@equinor/fusion-react-filter 1.1.10 → 2.1.0-filter.2

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 (401) hide show
  1. package/README.md +4 -4
  2. package/dist/FilterProvider.d.ts +7 -28
  3. package/dist/FilterProvider.d.ts.map +1 -1
  4. package/dist/FilterProvider.js +24 -31
  5. package/dist/FilterProvider.js.map +1 -1
  6. package/dist/actions.d.ts +32 -0
  7. package/dist/actions.d.ts.map +1 -0
  8. package/dist/actions.js +20 -0
  9. package/dist/actions.js.map +1 -0
  10. package/dist/components/filter/FilterOptionHeader.d.ts +7 -0
  11. package/dist/components/filter/FilterOptionHeader.d.ts.map +1 -0
  12. package/dist/components/filter/FilterOptionHeader.js +69 -0
  13. package/dist/components/filter/FilterOptionHeader.js.map +1 -0
  14. package/dist/components/filter/checkbox/CheckboxFilter.d.ts +16 -0
  15. package/dist/components/filter/checkbox/CheckboxFilter.d.ts.map +1 -0
  16. package/dist/components/filter/checkbox/CheckboxFilter.js +16 -0
  17. package/dist/components/filter/checkbox/CheckboxFilter.js.map +1 -0
  18. package/dist/components/filter/checkbox/CheckboxFilter.style.d.ts +5 -0
  19. package/dist/components/filter/checkbox/CheckboxFilter.style.d.ts.map +1 -0
  20. package/dist/components/filter/checkbox/CheckboxFilter.style.js +19 -0
  21. package/dist/components/filter/checkbox/CheckboxFilter.style.js.map +1 -0
  22. package/dist/components/filter/checkbox/CheckboxFilterOption.d.ts +14 -0
  23. package/dist/components/filter/checkbox/CheckboxFilterOption.d.ts.map +1 -0
  24. package/dist/components/filter/checkbox/CheckboxFilterOption.js +19 -0
  25. package/dist/components/filter/checkbox/CheckboxFilterOption.js.map +1 -0
  26. package/dist/components/filter/checkbox/CheckboxFilterOption.style.d.ts +3 -0
  27. package/dist/components/filter/checkbox/CheckboxFilterOption.style.d.ts.map +1 -0
  28. package/dist/components/filter/checkbox/CheckboxFilterOption.style.js +40 -0
  29. package/dist/components/filter/checkbox/CheckboxFilterOption.style.js.map +1 -0
  30. package/dist/components/filter/checkbox/CheckboxFilterOptionAll.d.ts +3 -0
  31. package/dist/components/filter/checkbox/CheckboxFilterOptionAll.d.ts.map +1 -0
  32. package/dist/components/filter/checkbox/CheckboxFilterOptionAll.js +24 -0
  33. package/dist/components/filter/checkbox/CheckboxFilterOptionAll.js.map +1 -0
  34. package/dist/components/filter/checkbox/CheckboxFilterOptions.d.ts +3 -0
  35. package/dist/components/filter/checkbox/CheckboxFilterOptions.d.ts.map +1 -0
  36. package/dist/components/filter/checkbox/CheckboxFilterOptions.js +37 -0
  37. package/dist/components/filter/checkbox/CheckboxFilterOptions.js.map +1 -0
  38. package/dist/components/filter/checkbox/CheckboxFilterProvider.d.ts +13 -0
  39. package/dist/components/filter/checkbox/CheckboxFilterProvider.d.ts.map +1 -0
  40. package/dist/components/filter/checkbox/CheckboxFilterProvider.js +16 -0
  41. package/dist/components/filter/checkbox/CheckboxFilterProvider.js.map +1 -0
  42. package/dist/components/filter/checkbox/context.d.ts +4 -0
  43. package/dist/components/filter/checkbox/context.d.ts.map +1 -0
  44. package/dist/components/filter/checkbox/context.js +3 -0
  45. package/dist/components/filter/checkbox/context.js.map +1 -0
  46. package/dist/components/filter/checkbox/index.d.ts +2 -0
  47. package/dist/components/filter/checkbox/index.d.ts.map +1 -0
  48. package/dist/components/filter/checkbox/index.js +2 -0
  49. package/dist/components/filter/checkbox/index.js.map +1 -0
  50. package/dist/components/filter/checkbox/types.d.ts +7 -0
  51. package/dist/components/filter/checkbox/types.d.ts.map +1 -0
  52. package/dist/components/filter/checkbox/types.js +2 -0
  53. package/dist/components/filter/checkbox/types.js.map +1 -0
  54. package/dist/components/filter/index.d.ts +5 -0
  55. package/dist/components/filter/index.d.ts.map +1 -0
  56. package/dist/components/filter/index.js +5 -0
  57. package/dist/components/filter/index.js.map +1 -0
  58. package/dist/components/filter/search/SearchFilter.d.ts +17 -0
  59. package/dist/components/filter/search/SearchFilter.d.ts.map +1 -0
  60. package/dist/components/filter/search/SearchFilter.js +47 -0
  61. package/dist/components/filter/search/SearchFilter.js.map +1 -0
  62. package/dist/components/filter/search/index.d.ts +2 -0
  63. package/dist/components/filter/search/index.d.ts.map +1 -0
  64. package/dist/components/filter/search/index.js +2 -0
  65. package/dist/components/filter/search/index.js.map +1 -0
  66. package/dist/components/filter/types.d.ts +7 -0
  67. package/dist/components/filter/types.d.ts.map +1 -0
  68. package/dist/components/filter/types.js +2 -0
  69. package/dist/components/filter/types.js.map +1 -0
  70. package/dist/components/index.d.ts +4 -0
  71. package/dist/components/index.d.ts.map +1 -0
  72. package/dist/components/index.js +4 -0
  73. package/dist/components/index.js.map +1 -0
  74. package/dist/components/misc/ClearFilterButton.d.ts +10 -0
  75. package/dist/components/misc/ClearFilterButton.d.ts.map +1 -0
  76. package/dist/components/misc/ClearFilterButton.js +25 -0
  77. package/dist/components/misc/ClearFilterButton.js.map +1 -0
  78. package/dist/components/misc/FilterContainer.d.ts +12 -0
  79. package/dist/components/misc/FilterContainer.d.ts.map +1 -0
  80. package/dist/components/misc/FilterContainer.js +18 -0
  81. package/dist/components/misc/FilterContainer.js.map +1 -0
  82. package/dist/components/misc/index.d.ts +3 -0
  83. package/dist/components/misc/index.d.ts.map +1 -0
  84. package/dist/components/misc/index.js +3 -0
  85. package/dist/components/misc/index.js.map +1 -0
  86. package/dist/components/panel/FilterPanel.d.ts +19 -0
  87. package/dist/components/panel/FilterPanel.d.ts.map +1 -0
  88. package/dist/components/panel/FilterPanel.js +17 -0
  89. package/dist/components/panel/FilterPanel.js.map +1 -0
  90. package/dist/components/panel/FilterPanelBar.d.ts +3 -0
  91. package/dist/components/panel/FilterPanelBar.d.ts.map +1 -0
  92. package/dist/components/panel/FilterPanelBar.js +31 -0
  93. package/dist/components/panel/FilterPanelBar.js.map +1 -0
  94. package/dist/components/panel/FilterPanelFilters.d.ts +3 -0
  95. package/dist/components/panel/FilterPanelFilters.d.ts.map +1 -0
  96. package/dist/components/panel/FilterPanelFilters.js +13 -0
  97. package/dist/components/panel/FilterPanelFilters.js.map +1 -0
  98. package/dist/components/panel/FilterPanelProvider.d.ts +32 -0
  99. package/dist/components/panel/FilterPanelProvider.d.ts.map +1 -0
  100. package/dist/components/panel/FilterPanelProvider.js +35 -0
  101. package/dist/components/panel/FilterPanelProvider.js.map +1 -0
  102. package/dist/components/panel/FilterPanelSelector.d.ts +7 -0
  103. package/dist/components/panel/FilterPanelSelector.d.ts.map +1 -0
  104. package/dist/components/panel/FilterPanelSelector.js +17 -0
  105. package/dist/components/panel/FilterPanelSelector.js.map +1 -0
  106. package/dist/components/panel/index.d.ts +5 -0
  107. package/dist/components/panel/index.d.ts.map +1 -0
  108. package/dist/components/panel/index.js +5 -0
  109. package/dist/components/panel/index.js.map +1 -0
  110. package/dist/context.d.ts +6 -0
  111. package/dist/context.d.ts.map +1 -0
  112. package/dist/context.js +6 -0
  113. package/dist/context.js.map +1 -0
  114. package/dist/hooks/index.d.ts +12 -0
  115. package/dist/hooks/index.d.ts.map +1 -0
  116. package/dist/hooks/index.js +25 -0
  117. package/dist/hooks/index.js.map +1 -0
  118. package/dist/hooks/useClearFilter.d.ts +9 -0
  119. package/dist/hooks/useClearFilter.d.ts.map +1 -0
  120. package/dist/hooks/useClearFilter.js +30 -0
  121. package/dist/hooks/useClearFilter.js.map +1 -0
  122. package/dist/hooks/useFilter.d.ts +7 -0
  123. package/dist/hooks/useFilter.d.ts.map +1 -0
  124. package/dist/hooks/useFilter.js +26 -0
  125. package/dist/hooks/useFilter.js.map +1 -0
  126. package/dist/hooks/useFilterData.d.ts +11 -0
  127. package/dist/hooks/useFilterData.d.ts.map +1 -0
  128. package/dist/hooks/useFilterData.js +39 -0
  129. package/dist/hooks/useFilterData.js.map +1 -0
  130. package/dist/hooks/useFilterSelection.d.ts +5 -9
  131. package/dist/hooks/useFilterSelection.d.ts.map +1 -1
  132. package/dist/hooks/useFilterSelection.js +6 -21
  133. package/dist/hooks/useFilterSelection.js.map +1 -1
  134. package/dist/index.d.ts +4 -14
  135. package/dist/index.d.ts.map +1 -1
  136. package/dist/index.js +3 -15
  137. package/dist/index.js.map +1 -1
  138. package/dist/options/FilterOptionProvider.d.ts +12 -0
  139. package/dist/options/FilterOptionProvider.d.ts.map +1 -0
  140. package/dist/options/FilterOptionProvider.js +55 -0
  141. package/dist/options/FilterOptionProvider.js.map +1 -0
  142. package/dist/options/actions.d.ts +8 -0
  143. package/dist/options/actions.d.ts.map +1 -0
  144. package/dist/options/actions.js +6 -0
  145. package/dist/options/actions.js.map +1 -0
  146. package/dist/options/context.d.ts +6 -0
  147. package/dist/options/context.d.ts.map +1 -0
  148. package/dist/options/context.js +7 -0
  149. package/dist/options/context.js.map +1 -0
  150. package/dist/options/create-options.d.ts +4 -0
  151. package/dist/options/create-options.d.ts.map +1 -0
  152. package/dist/options/create-options.js +24 -0
  153. package/dist/options/create-options.js.map +1 -0
  154. package/dist/options/index.d.ts +6 -0
  155. package/dist/options/index.d.ts.map +1 -0
  156. package/dist/options/index.js +6 -0
  157. package/dist/options/index.js.map +1 -0
  158. package/dist/options/reducer.d.ts +58 -0
  159. package/dist/options/reducer.d.ts.map +1 -0
  160. package/dist/options/reducer.js +4 -0
  161. package/dist/options/reducer.js.map +1 -0
  162. package/dist/options/search/filter-option-match.d.ts +7 -0
  163. package/dist/options/search/filter-option-match.d.ts.map +1 -0
  164. package/dist/options/search/filter-option-match.js +10 -0
  165. package/dist/options/search/filter-option-match.js.map +1 -0
  166. package/dist/options/search/filter-option-search.d.ts +8 -0
  167. package/dist/options/search/filter-option-search.d.ts.map +1 -0
  168. package/dist/options/search/filter-option-search.js +12 -0
  169. package/dist/options/search/filter-option-search.js.map +1 -0
  170. package/dist/options/search/index.d.ts +2 -0
  171. package/dist/options/search/index.d.ts.map +1 -0
  172. package/dist/options/search/index.js +2 -0
  173. package/dist/options/search/index.js.map +1 -0
  174. package/dist/options/search/types.d.ts +9 -0
  175. package/dist/options/search/types.d.ts.map +1 -0
  176. package/dist/options/search/types.js +2 -0
  177. package/dist/options/search/types.js.map +1 -0
  178. package/dist/options/search/useFilterOptionSearch.d.ts +12 -0
  179. package/dist/options/search/useFilterOptionSearch.d.ts.map +1 -0
  180. package/dist/options/search/useFilterOptionSearch.js +28 -0
  181. package/dist/options/search/useFilterOptionSearch.js.map +1 -0
  182. package/dist/options/types.d.ts +32 -0
  183. package/dist/options/types.d.ts.map +1 -0
  184. package/dist/options/types.js +2 -0
  185. package/dist/options/types.js.map +1 -0
  186. package/dist/reducers.d.ts +170 -0
  187. package/dist/reducers.d.ts.map +1 -0
  188. package/dist/reducers.js +23 -0
  189. package/dist/reducers.js.map +1 -0
  190. package/dist/{types/Filter.d.ts → types.d.ts} +19 -16
  191. package/dist/types.d.ts.map +1 -0
  192. package/dist/types.js +2 -0
  193. package/dist/types.js.map +1 -0
  194. package/package.json +13 -9
  195. package/dist/FilterContext.d.ts +0 -8
  196. package/dist/FilterContext.d.ts.map +0 -1
  197. package/dist/FilterContext.js +0 -4
  198. package/dist/FilterContext.js.map +0 -1
  199. package/dist/components/CheckBoxFilter/CheckBoxFilter.d.ts +0 -34
  200. package/dist/components/CheckBoxFilter/CheckBoxFilter.d.ts.map +0 -1
  201. package/dist/components/CheckBoxFilter/CheckBoxFilter.js +0 -76
  202. package/dist/components/CheckBoxFilter/CheckBoxFilter.js.map +0 -1
  203. package/dist/components/CheckBoxFilter/CheckBoxOption.d.ts +0 -14
  204. package/dist/components/CheckBoxFilter/CheckBoxOption.d.ts.map +0 -1
  205. package/dist/components/CheckBoxFilter/CheckBoxOption.js +0 -10
  206. package/dist/components/CheckBoxFilter/CheckBoxOption.js.map +0 -1
  207. package/dist/components/CheckBoxFilter/CheckBoxOption.style.d.ts +0 -3
  208. package/dist/components/CheckBoxFilter/CheckBoxOption.style.d.ts.map +0 -1
  209. package/dist/components/CheckBoxFilter/CheckBoxOption.style.js +0 -24
  210. package/dist/components/CheckBoxFilter/CheckBoxOption.style.js.map +0 -1
  211. package/dist/components/CheckBoxFilter/CheckboxFilter.style.d.ts +0 -3
  212. package/dist/components/CheckBoxFilter/CheckboxFilter.style.d.ts.map +0 -1
  213. package/dist/components/CheckBoxFilter/CheckboxFilter.style.js +0 -29
  214. package/dist/components/CheckBoxFilter/CheckboxFilter.style.js.map +0 -1
  215. package/dist/components/CheckBoxFilter/SelectAllOption.d.ts +0 -12
  216. package/dist/components/CheckBoxFilter/SelectAllOption.d.ts.map +0 -1
  217. package/dist/components/CheckBoxFilter/SelectAllOption.js +0 -22
  218. package/dist/components/CheckBoxFilter/SelectAllOption.js.map +0 -1
  219. package/dist/components/CheckBoxFilter/index.d.ts +0 -5
  220. package/dist/components/CheckBoxFilter/index.d.ts.map +0 -1
  221. package/dist/components/CheckBoxFilter/index.js +0 -5
  222. package/dist/components/CheckBoxFilter/index.js.map +0 -1
  223. package/dist/components/FilterSection/FilterSection.d.ts +0 -29
  224. package/dist/components/FilterSection/FilterSection.d.ts.map +0 -1
  225. package/dist/components/FilterSection/FilterSection.js +0 -64
  226. package/dist/components/FilterSection/FilterSection.js.map +0 -1
  227. package/dist/components/FilterSection/FilterSection.style.d.ts +0 -3
  228. package/dist/components/FilterSection/FilterSection.style.d.ts.map +0 -1
  229. package/dist/components/FilterSection/FilterSection.style.js +0 -56
  230. package/dist/components/FilterSection/FilterSection.style.js.map +0 -1
  231. package/dist/components/FilterSection/index.d.ts +0 -3
  232. package/dist/components/FilterSection/index.d.ts.map +0 -1
  233. package/dist/components/FilterSection/index.js +0 -3
  234. package/dist/components/FilterSection/index.js.map +0 -1
  235. package/dist/components/FilterSelectionChips/FilterSelectionChips.d.ts +0 -7
  236. package/dist/components/FilterSelectionChips/FilterSelectionChips.d.ts.map +0 -1
  237. package/dist/components/FilterSelectionChips/FilterSelectionChips.js +0 -18
  238. package/dist/components/FilterSelectionChips/FilterSelectionChips.js.map +0 -1
  239. package/dist/components/FilterSelectionChips/FilterSelectionChips.style.d.ts +0 -3
  240. package/dist/components/FilterSelectionChips/FilterSelectionChips.style.d.ts.map +0 -1
  241. package/dist/components/FilterSelectionChips/FilterSelectionChips.style.js +0 -31
  242. package/dist/components/FilterSelectionChips/FilterSelectionChips.style.js.map +0 -1
  243. package/dist/components/FilterSelectionChips/index.d.ts +0 -2
  244. package/dist/components/FilterSelectionChips/index.d.ts.map +0 -1
  245. package/dist/components/FilterSelectionChips/index.js +0 -2
  246. package/dist/components/FilterSelectionChips/index.js.map +0 -1
  247. package/dist/components/FilterSelectionChips/useChipsSelection.d.ts +0 -9
  248. package/dist/components/FilterSelectionChips/useChipsSelection.d.ts.map +0 -1
  249. package/dist/components/FilterSelectionChips/useChipsSelection.js +0 -26
  250. package/dist/components/FilterSelectionChips/useChipsSelection.js.map +0 -1
  251. package/dist/components/FilterSelector/FilterCategory.d.ts +0 -7
  252. package/dist/components/FilterSelector/FilterCategory.d.ts.map +0 -1
  253. package/dist/components/FilterSelector/FilterCategory.js +0 -24
  254. package/dist/components/FilterSelector/FilterCategory.js.map +0 -1
  255. package/dist/components/FilterSelector/FilterCategory.style.d.ts +0 -3
  256. package/dist/components/FilterSelector/FilterCategory.style.d.ts.map +0 -1
  257. package/dist/components/FilterSelector/FilterCategory.style.js +0 -12
  258. package/dist/components/FilterSelector/FilterCategory.style.js.map +0 -1
  259. package/dist/components/FilterSelector/FilterSelector.d.ts +0 -31
  260. package/dist/components/FilterSelector/FilterSelector.d.ts.map +0 -1
  261. package/dist/components/FilterSelector/FilterSelector.js +0 -51
  262. package/dist/components/FilterSelector/FilterSelector.js.map +0 -1
  263. package/dist/components/FilterSelector/FilterSelector.style.d.ts +0 -3
  264. package/dist/components/FilterSelector/FilterSelector.style.d.ts.map +0 -1
  265. package/dist/components/FilterSelector/FilterSelector.style.js +0 -44
  266. package/dist/components/FilterSelector/FilterSelector.style.js.map +0 -1
  267. package/dist/components/FilterSelector/index.d.ts +0 -4
  268. package/dist/components/FilterSelector/index.d.ts.map +0 -1
  269. package/dist/components/FilterSelector/index.js +0 -4
  270. package/dist/components/FilterSelector/index.js.map +0 -1
  271. package/dist/components/GeneralBar/GeneralBar.d.ts +0 -26
  272. package/dist/components/GeneralBar/GeneralBar.d.ts.map +0 -1
  273. package/dist/components/GeneralBar/GeneralBar.js +0 -63
  274. package/dist/components/GeneralBar/GeneralBar.js.map +0 -1
  275. package/dist/components/GeneralBar/GeneralBar.style.d.ts +0 -3
  276. package/dist/components/GeneralBar/GeneralBar.style.d.ts.map +0 -1
  277. package/dist/components/GeneralBar/GeneralBar.style.js +0 -20
  278. package/dist/components/GeneralBar/GeneralBar.style.js.map +0 -1
  279. package/dist/components/GeneralBar/index.d.ts +0 -3
  280. package/dist/components/GeneralBar/index.d.ts.map +0 -1
  281. package/dist/components/GeneralBar/index.js +0 -3
  282. package/dist/components/GeneralBar/index.js.map +0 -1
  283. package/dist/components/HorizontalBar/HorizontalBar.d.ts +0 -10
  284. package/dist/components/HorizontalBar/HorizontalBar.d.ts.map +0 -1
  285. package/dist/components/HorizontalBar/HorizontalBar.js +0 -23
  286. package/dist/components/HorizontalBar/HorizontalBar.js.map +0 -1
  287. package/dist/components/HorizontalBar/index.d.ts +0 -3
  288. package/dist/components/HorizontalBar/index.d.ts.map +0 -1
  289. package/dist/components/HorizontalBar/index.js +0 -3
  290. package/dist/components/HorizontalBar/index.js.map +0 -1
  291. package/dist/components/HorizontalFilterPanel/HorizontalFilterPanel.d.ts +0 -17
  292. package/dist/components/HorizontalFilterPanel/HorizontalFilterPanel.d.ts.map +0 -1
  293. package/dist/components/HorizontalFilterPanel/HorizontalFilterPanel.js +0 -28
  294. package/dist/components/HorizontalFilterPanel/HorizontalFilterPanel.js.map +0 -1
  295. package/dist/components/HorizontalFilterPanel/index.d.ts +0 -3
  296. package/dist/components/HorizontalFilterPanel/index.d.ts.map +0 -1
  297. package/dist/components/HorizontalFilterPanel/index.js +0 -3
  298. package/dist/components/HorizontalFilterPanel/index.js.map +0 -1
  299. package/dist/components/Icon/index.d.ts +0 -11
  300. package/dist/components/Icon/index.d.ts.map +0 -1
  301. package/dist/components/Icon/index.js +0 -16
  302. package/dist/components/Icon/index.js.map +0 -1
  303. package/dist/components/RadioFilter/RadioFilter.d.ts +0 -17
  304. package/dist/components/RadioFilter/RadioFilter.d.ts.map +0 -1
  305. package/dist/components/RadioFilter/RadioFilter.js +0 -51
  306. package/dist/components/RadioFilter/RadioFilter.js.map +0 -1
  307. package/dist/components/RadioFilter/RadioFilter.style.d.ts +0 -3
  308. package/dist/components/RadioFilter/RadioFilter.style.d.ts.map +0 -1
  309. package/dist/components/RadioFilter/RadioFilter.style.js +0 -38
  310. package/dist/components/RadioFilter/RadioFilter.style.js.map +0 -1
  311. package/dist/components/RadioFilter/index.d.ts +0 -3
  312. package/dist/components/RadioFilter/index.d.ts.map +0 -1
  313. package/dist/components/RadioFilter/index.js +0 -3
  314. package/dist/components/RadioFilter/index.js.map +0 -1
  315. package/dist/epic/StatefulObserver.d.ts +0 -8
  316. package/dist/epic/StatefulObserver.d.ts.map +0 -1
  317. package/dist/epic/StatefulObserver.js +0 -26
  318. package/dist/epic/StatefulObserver.js.map +0 -1
  319. package/dist/epic/epic.d.ts +0 -14
  320. package/dist/epic/epic.d.ts.map +0 -1
  321. package/dist/epic/epic.js +0 -2
  322. package/dist/epic/epic.js.map +0 -1
  323. package/dist/epic/hooks/useObservableSelector.d.ts +0 -14
  324. package/dist/epic/hooks/useObservableSelector.d.ts.map +0 -1
  325. package/dist/epic/hooks/useObservableSelector.js +0 -16
  326. package/dist/epic/hooks/useObservableSelector.js.map +0 -1
  327. package/dist/epic/hooks/useObservableState.d.ts +0 -13
  328. package/dist/epic/hooks/useObservableState.d.ts.map +0 -1
  329. package/dist/epic/hooks/useObservableState.js +0 -18
  330. package/dist/epic/hooks/useObservableState.js.map +0 -1
  331. package/dist/epic/hooks/useSelector.d.ts +0 -10
  332. package/dist/epic/hooks/useSelector.d.ts.map +0 -1
  333. package/dist/epic/hooks/useSelector.js +0 -14
  334. package/dist/epic/hooks/useSelector.js.map +0 -1
  335. package/dist/epic/reducer.d.ts +0 -56
  336. package/dist/epic/reducer.d.ts.map +0 -1
  337. package/dist/epic/reducer.js +0 -78
  338. package/dist/epic/reducer.js.map +0 -1
  339. package/dist/filterStore/actions.d.ts +0 -23
  340. package/dist/filterStore/actions.d.ts.map +0 -1
  341. package/dist/filterStore/actions.js +0 -18
  342. package/dist/filterStore/actions.js.map +0 -1
  343. package/dist/filterStore/epics.d.ts +0 -10
  344. package/dist/filterStore/epics.d.ts.map +0 -1
  345. package/dist/filterStore/epics.js +0 -10
  346. package/dist/filterStore/epics.js.map +0 -1
  347. package/dist/filterStore/reducers.d.ts +0 -4
  348. package/dist/filterStore/reducers.d.ts.map +0 -1
  349. package/dist/filterStore/reducers.js +0 -43
  350. package/dist/filterStore/reducers.js.map +0 -1
  351. package/dist/filterStore/store.d.ts +0 -106
  352. package/dist/filterStore/store.d.ts.map +0 -1
  353. package/dist/filterStore/store.js +0 -158
  354. package/dist/filterStore/store.js.map +0 -1
  355. package/dist/hooks/useEventListener.d.ts +0 -4
  356. package/dist/hooks/useEventListener.d.ts.map +0 -1
  357. package/dist/hooks/useEventListener.js +0 -14
  358. package/dist/hooks/useEventListener.js.map +0 -1
  359. package/dist/hooks/useFilterChangeHandler.d.ts +0 -26
  360. package/dist/hooks/useFilterChangeHandler.d.ts.map +0 -1
  361. package/dist/hooks/useFilterChangeHandler.js +0 -43
  362. package/dist/hooks/useFilterChangeHandler.js.map +0 -1
  363. package/dist/hooks/useFilterContext.d.ts +0 -4
  364. package/dist/hooks/useFilterContext.d.ts.map +0 -1
  365. package/dist/hooks/useFilterContext.js +0 -5
  366. package/dist/hooks/useFilterContext.js.map +0 -1
  367. package/dist/hooks/useFilterOptionsBuilder.d.ts +0 -27
  368. package/dist/hooks/useFilterOptionsBuilder.d.ts.map +0 -1
  369. package/dist/hooks/useFilterOptionsBuilder.js +0 -39
  370. package/dist/hooks/useFilterOptionsBuilder.js.map +0 -1
  371. package/dist/hooks/useFilterOptionsCounter.d.ts +0 -16
  372. package/dist/hooks/useFilterOptionsCounter.d.ts.map +0 -1
  373. package/dist/hooks/useFilterOptionsCounter.js +0 -32
  374. package/dist/hooks/useFilterOptionsCounter.js.map +0 -1
  375. package/dist/hooks/useFilterStore.d.ts +0 -25
  376. package/dist/hooks/useFilterStore.d.ts.map +0 -1
  377. package/dist/hooks/useFilterStore.js +0 -34
  378. package/dist/hooks/useFilterStore.js.map +0 -1
  379. package/dist/hooks/useResizablePanel.d.ts +0 -20
  380. package/dist/hooks/useResizablePanel.d.ts.map +0 -1
  381. package/dist/hooks/useResizablePanel.js +0 -71
  382. package/dist/hooks/useResizablePanel.js.map +0 -1
  383. package/dist/types/Filter.d.ts.map +0 -1
  384. package/dist/types/Filter.js +0 -2
  385. package/dist/types/Filter.js.map +0 -1
  386. package/dist/types/FilterContainerProps.d.ts +0 -10
  387. package/dist/types/FilterContainerProps.d.ts.map +0 -1
  388. package/dist/types/FilterContainerProps.js +0 -2
  389. package/dist/types/FilterContainerProps.js.map +0 -1
  390. package/dist/types/FilterCounters.d.ts +0 -3
  391. package/dist/types/FilterCounters.d.ts.map +0 -1
  392. package/dist/types/FilterCounters.js +0 -2
  393. package/dist/types/FilterCounters.js.map +0 -1
  394. package/dist/types/FilterOption.d.ts +0 -13
  395. package/dist/types/FilterOption.d.ts.map +0 -1
  396. package/dist/types/FilterOption.js +0 -2
  397. package/dist/types/FilterOption.js.map +0 -1
  398. package/dist/types/FilterStoreState.d.ts +0 -6
  399. package/dist/types/FilterStoreState.d.ts.map +0 -1
  400. package/dist/types/FilterStoreState.js +0 -2
  401. package/dist/types/FilterStoreState.js.map +0 -1
@@ -1,106 +0,0 @@
1
- import { Observable, BehaviorSubject } from 'rxjs';
2
- import EpicReducer from '../epic/reducer';
3
- import { TSelection } from '../FilterProvider';
4
- import { Filter, FilterFn, FilterFnStore, FilterSettingsStore } from '../types/Filter';
5
- import FilterStoreState from '../types/FilterStoreState';
6
- import { Actions } from './actions';
7
- /**
8
- *The engine of the Filter provider.
9
- *Holds all registered filters and selections.
10
- *Controlled through actions, that will trigger and apply filters when needed.
11
- */
12
- export declare class FilterStore<TSelections extends Record<string, unknown> = Record<string, unknown>, TData = unknown> extends EpicReducer<FilterStoreState<TSelections, TData>, Actions> {
13
- protected _filterFn: FilterFnStore<TData>;
14
- protected _filterSettings: FilterSettingsStore<TData>;
15
- /**
16
- * Holds all filter selections.
17
- */
18
- selection$: BehaviorSubject<TSelections>;
19
- /**
20
- *
21
- * @param key Filter key
22
- * @returns Filter settings for given key
23
- */
24
- getFilterSetting(key: string): Filter<TData, TSelection>;
25
- /**
26
- * Register filterSettings for a new Filter
27
- * @param filter Filter settings
28
- */
29
- registerFilterSettings(filter: Filter<TData, TSelection>): void;
30
- /**
31
- * unregister a filter.
32
- * Removes the filter functions from the filtering routine.
33
- * @param key Registered Filter key
34
- */
35
- unRegisterFilter(key: string): void;
36
- /**
37
- * Registers the filter functions for use in the filtering process
38
- *
39
- * @param key filter Key
40
- * @param filterFn Function for filtering given filter.
41
- */
42
- registerFilter(key: string, filterFn: FilterFn<TData, TSelection>): void;
43
- /**
44
- * Updates a filter selection with new selection. Overwrites the current selection.
45
- * This triggers the filtering process.
46
- *
47
- * @param key Filter key
48
- * @param values new Selection values
49
- *
50
- */
51
- updateFilterSelection(key: string, values: any): void;
52
- /**
53
- * Clears the filter selection for all Registered filters.
54
- */
55
- clearAllFilterSelections(): void;
56
- /**
57
- * Clears filter selection for give filter key
58
- * @param key Filter key
59
- */
60
- clearSingleFilterSelection(key: string): void;
61
- /**
62
- * Remove selection from selections
63
- * @param key Filter key
64
- * @returns
65
- */
66
- unregisterSelection(key: string): void;
67
- /**
68
- * Add a new selection to the selections.
69
- * @param key filter key
70
- * @param values selections values
71
- */
72
- registerSelection(key: string, values: any): void;
73
- /**
74
- * ovewrites the current selections completly.
75
- * @param values new selections object
76
- */
77
- setFilterSelections(values: TSelections): void;
78
- /**
79
- * set or orverwrites the current dataset in the provider.
80
- * @param data new dataset
81
- */
82
- setData(data: TData): void;
83
- /**
84
- * Get filtered data for given Filter key, to be used for getting filter Options.
85
- * This will return a filtered dataset, without filtering on the given filter key.
86
- *
87
- * @param key filter key
88
- * @returns filtered dataset
89
- */
90
- filterSelectionData(key: string): Observable<TData>;
91
- /**
92
- *@return filtered dataset based on all registered filters and selections
93
- */
94
- get data$(): Observable<TData>;
95
- }
96
- /**
97
- *Creates the initial context.
98
- *Selections can be provided to get an inital filtering of the dataset.
99
- *
100
- * @param initialData Dataset that will be used for filtering
101
- * @param initialSelections Add intial/default selections that filters the dataset on load
102
- * @returns store
103
- */
104
- export declare const createFilterStore: <TSelections extends Record<string, unknown>, TData>(initialData: TData, initialSelections?: TSelections | undefined) => FilterStore<TSelections, TData>;
105
- export default FilterStore;
106
- //# sourceMappingURL=store.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../src/filterStore/store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAM,UAAU,EAAE,eAAe,EAAE,MAAM,MAAM,CAAC;AAEvD,OAAO,WAAW,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACvF,OAAO,gBAAgB,MAAM,2BAA2B,CAAC;AACzD,OAAgB,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAa7C;;;;GAIG;AACH,qBAAa,WAAW,CACtB,WAAW,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACrE,KAAK,GAAG,OAAO,CACf,SAAQ,WAAW,CAAC,gBAAgB,CAAC,WAAW,EAAE,KAAK,CAAC,EAAE,OAAO,CAAC;IAClE,SAAS,CAAC,SAAS,EAAE,aAAa,CAAC,KAAK,CAAC,CAAM;IAC/C,SAAS,CAAC,eAAe,EAAE,mBAAmB,CAAC,KAAK,CAAC,CAAM;IAE3D;;OAEG;IACI,UAAU,+BAAuD;IAExE;;;;OAIG;IACI,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC,KAAK,EAAE,UAAU,CAAC;IAI/D;;;OAGG;IACI,sBAAsB,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,EAAE,UAAU,CAAC,GAAG,IAAI;IAItE;;;;OAIG;IACI,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;IAK1C;;;;;OAKG;IACI,cAAc,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,CAAC,KAAK,EAAE,UAAU,CAAC,GAAG,IAAI;IAG/E;;;;;;;OAOG;IACI,qBAAqB,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,GAAG,IAAI;IAK5D;;OAEG;IACI,wBAAwB,IAAI,IAAI;IAIvC;;;OAGG;IACI,0BAA0B,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;IAIpD;;;;OAIG;IACI,mBAAmB,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;IAI7C;;;;OAIG;IACI,iBAAiB,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,GAAG,IAAI;IAIxD;;;OAGG;IACI,mBAAmB,CAAC,MAAM,EAAE,WAAW,GAAG,IAAI;IAIrD;;;OAGG;IACI,OAAO,CAAC,IAAI,EAAE,KAAK,GAAG,IAAI;IAKjC;;;;;;OAMG;IACI,mBAAmB,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,CAAC,KAAK,CAAC;IAc1D;;OAEG;IACH,IAAI,KAAK,IAAI,UAAU,CAAC,KAAK,CAAC,CAS7B;CACF;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,iBAAiB,0JAa7B,CAAC;AAEF,eAAe,WAAW,CAAC"}
@@ -1,158 +0,0 @@
1
- import { of, BehaviorSubject } from 'rxjs';
2
- import { pluck, switchMap, withLatestFrom, distinctUntilChanged } from 'rxjs/operators';
3
- import EpicReducer from '../epic/reducer';
4
- import actions from './actions';
5
- import reducers from './reducers';
6
- const filterReducer = (filters) => (data, selections) => {
7
- return Object.keys(filters).reduce((acc, key) => filters[key](acc, selections[key], data), data);
8
- };
9
- /**
10
- *The engine of the Filter provider.
11
- *Holds all registered filters and selections.
12
- *Controlled through actions, that will trigger and apply filters when needed.
13
- */
14
- export class FilterStore extends EpicReducer {
15
- constructor() {
16
- super(...arguments);
17
- this._filterFn = {};
18
- this._filterSettings = {};
19
- /**
20
- * Holds all filter selections.
21
- */
22
- this.selection$ = new BehaviorSubject({});
23
- }
24
- /**
25
- *
26
- * @param key Filter key
27
- * @returns Filter settings for given key
28
- */
29
- getFilterSetting(key) {
30
- return this._filterSettings[key];
31
- }
32
- /**
33
- * Register filterSettings for a new Filter
34
- * @param filter Filter settings
35
- */
36
- registerFilterSettings(filter) {
37
- this._filterSettings[filter.key] = filter;
38
- }
39
- /**
40
- * unregister a filter.
41
- * Removes the filter functions from the filtering routine.
42
- * @param key Registered Filter key
43
- */
44
- unRegisterFilter(key) {
45
- if (this.getFilterSetting(key)?.mandatory)
46
- return;
47
- delete this._filterFn[key];
48
- }
49
- /**
50
- * Registers the filter functions for use in the filtering process
51
- *
52
- * @param key filter Key
53
- * @param filterFn Function for filtering given filter.
54
- */
55
- registerFilter(key, filterFn) {
56
- this._filterFn[key] = filterFn;
57
- }
58
- /**
59
- * Updates a filter selection with new selection. Overwrites the current selection.
60
- * This triggers the filtering process.
61
- *
62
- * @param key Filter key
63
- * @param values new Selection values
64
- *
65
- */
66
- updateFilterSelection(key, values) {
67
- if (this._filterSettings[key]?.noFilterReset && !Object.keys(values).length)
68
- return;
69
- this.dispatch(actions.selection.update({ key, values }));
70
- }
71
- /**
72
- * Clears the filter selection for all Registered filters.
73
- */
74
- clearAllFilterSelections() {
75
- this.dispatch(actions.selection.clearAll(this._filterSettings));
76
- }
77
- /**
78
- * Clears filter selection for give filter key
79
- * @param key Filter key
80
- */
81
- clearSingleFilterSelection(key) {
82
- this.dispatch(actions.selection.clearSingle(this._filterSettings[key]));
83
- }
84
- /**
85
- * Remove selection from selections
86
- * @param key Filter key
87
- * @returns
88
- */
89
- unregisterSelection(key) {
90
- if (this.getFilterSetting(key).mandatory)
91
- return;
92
- this.dispatch(actions.selection.unSet(key));
93
- }
94
- /**
95
- * Add a new selection to the selections.
96
- * @param key filter key
97
- * @param values selections values
98
- */
99
- registerSelection(key, values) {
100
- this.dispatch(actions.selection.set({ [key]: values }));
101
- }
102
- /**
103
- * ovewrites the current selections completly.
104
- * @param values new selections object
105
- */
106
- setFilterSelections(values) {
107
- this.dispatch(actions.selection.override({ ...values }));
108
- }
109
- /**
110
- * set or orverwrites the current dataset in the provider.
111
- * @param data new dataset
112
- */
113
- setData(data) {
114
- this.dispatch(actions.data.set(data));
115
- this.dispatch(actions.selection.triggerFilter());
116
- }
117
- /**
118
- * Get filtered data for given Filter key, to be used for getting filter Options.
119
- * This will return a filtered dataset, without filtering on the given filter key.
120
- *
121
- * @param key filter key
122
- * @returns filtered dataset
123
- */
124
- filterSelectionData(key) {
125
- const data$ = this.state$.pipe(pluck('data'));
126
- return this.state$.pipe(pluck('selection'), withLatestFrom(data$), switchMap(([selection, data]) => {
127
- const filterFn = { ...this._filterFn };
128
- delete filterFn[key];
129
- const applyFilter = filterReducer(filterFn);
130
- return of(applyFilter(data, selection));
131
- }));
132
- }
133
- /**
134
- *@return filtered dataset based on all registered filters and selections
135
- */
136
- get data$() {
137
- const data$ = this.state$.pipe(pluck('data'));
138
- return this.selection$.pipe(withLatestFrom(data$), switchMap(([selection, data]) => {
139
- const applyFilter = filterReducer(this._filterFn);
140
- return of(applyFilter(data, selection));
141
- }));
142
- }
143
- }
144
- /**
145
- *Creates the initial context.
146
- *Selections can be provided to get an inital filtering of the dataset.
147
- *
148
- * @param initialData Dataset that will be used for filtering
149
- * @param initialSelections Add intial/default selections that filters the dataset on load
150
- * @returns store
151
- */
152
- export const createFilterStore = (initialData, initialSelections) => {
153
- const store = new FilterStore(reducers, { data: initialData, selection: initialSelections || {} }, undefined);
154
- store.state$.pipe(pluck('selection'), distinctUntilChanged()).subscribe(store.selection$);
155
- return store;
156
- };
157
- export default FilterStore;
158
- //# sourceMappingURL=store.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"store.js","sourceRoot":"","sources":["../../src/filterStore/store.ts"],"names":[],"mappings":"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"}
@@ -1,4 +0,0 @@
1
- import React from 'react';
2
- declare const _default: <T extends EventListenerOrEventListenerObject>(node: HTMLElement | Window | null, eventType: string, handler: T, dependencies: React.DependencyList, useCapture?: boolean) => void;
3
- export default _default;
4
- //# sourceMappingURL=useEventListener.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useEventListener.d.ts","sourceRoot":"","sources":["../../src/hooks/useEventListener.ts"],"names":[],"mappings":"AAAA,OAAO,KAAoB,MAAM,OAAO,CAAC;6EAKjC,WAAW,GAAG,MAAM,GAAG,IAAI,aACtB,MAAM,2EAIhB,IAAI;AANP,wBAkBE"}
@@ -1,14 +0,0 @@
1
- import { useEffect } from 'react';
2
- // TODO @odinr - move to util lib
3
- export default (node, eventType, handler, dependencies, useCapture = false) => {
4
- useEffect(() => {
5
- if (node == null) {
6
- return;
7
- }
8
- node.addEventListener(eventType, handler, useCapture);
9
- return () => {
10
- node.removeEventListener(eventType, handler, useCapture);
11
- };
12
- }, [node, ...dependencies]);
13
- };
14
- //# sourceMappingURL=useEventListener.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useEventListener.js","sourceRoot":"","sources":["../../src/hooks/useEventListener.ts"],"names":[],"mappings":"AAAA,OAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEzC,iCAAiC;AAEjC,eAAe,CACb,IAAiC,EACjC,SAAiB,EACjB,OAAU,EACV,YAAkC,EAClC,UAAU,GAAG,KAAK,EACZ,EAAE;IACR,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,IAAI,IAAI,IAAI,EAAE;YAChB,OAAO;SACR;QAED,IAAI,CAAC,gBAAgB,CAAC,SAAS,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC;QAEtD,OAAO,GAAG,EAAE;YACV,IAAI,CAAC,mBAAmB,CAAC,SAAS,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC;QAC3D,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,YAAY,CAAC,CAAC,CAAC;AAC9B,CAAC,CAAC"}
@@ -1,26 +0,0 @@
1
- declare type FilterChange<TChange> = (data: TChange) => void;
2
- /**
3
- *Handled updating the filterSelection, when a selection i made.
4
- * used the updateFilterSelection to interact with the current selection.
5
- * Supply the Key for the selection, and a function that describes how the selection should be updated.
6
- * TChange is the object you send in to the updateSelectionFunction, and can be any information you need.
7
- *
8
- * @param key registered filter key
9
- * @param updateSelectionFunction function that applies the change to the current selection,TChange can be any type of object
10
- * @returns FilterChange Function
11
- * @example
12
- *
13
- * const selectionUpdate = (change:{name:string,selected:boolean}, selection:string[]) => {
14
- * if(change.selected) return [...selected, change.name]
15
- * selection.splice(selection.indexOf(change.name), 1);
16
- * return [...selection];
17
- * }
18
- *
19
- * const {onChange} = useFilterChangeHandles('Name',selectionUpdate)
20
- *
21
- * <Checkbox onInput={(e) => onChange({name:'Helge',selected:e.currentTarget.checked})}
22
- *
23
- */
24
- declare const useFilterChangeHandler: <TChange, TSelection>(key: string, updateSelectionFunction: (change: TChange, selection: TSelection) => TSelection) => FilterChange<TChange>;
25
- export default useFilterChangeHandler;
26
- //# sourceMappingURL=useFilterChangeHandler.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useFilterChangeHandler.d.ts","sourceRoot":"","sources":["../../src/hooks/useFilterChangeHandler.tsx"],"names":[],"mappings":"AAKA,aAAK,YAAY,CAAC,OAAO,IAAI,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;AACrD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,QAAA,MAAM,sBAAsB,6BACrB,MAAM,2GAmBZ,CAAC;AAEF,eAAe,sBAAsB,CAAC"}
@@ -1,43 +0,0 @@
1
- import { useCallback, useEffect, useMemo } from 'react';
2
- import { Subject } from 'rxjs';
3
- import { withLatestFrom, pluck } from 'rxjs/operators';
4
- import useFilterContext from './useFilterContext';
5
- /**
6
- *Handled updating the filterSelection, when a selection i made.
7
- * used the updateFilterSelection to interact with the current selection.
8
- * Supply the Key for the selection, and a function that describes how the selection should be updated.
9
- * TChange is the object you send in to the updateSelectionFunction, and can be any information you need.
10
- *
11
- * @param key registered filter key
12
- * @param updateSelectionFunction function that applies the change to the current selection,TChange can be any type of object
13
- * @returns FilterChange Function
14
- * @example
15
- *
16
- * const selectionUpdate = (change:{name:string,selected:boolean}, selection:string[]) => {
17
- * if(change.selected) return [...selected, change.name]
18
- * selection.splice(selection.indexOf(change.name), 1);
19
- * return [...selection];
20
- * }
21
- *
22
- * const {onChange} = useFilterChangeHandles('Name',selectionUpdate)
23
- *
24
- * <Checkbox onInput={(e) => onChange({name:'Helge',selected:e.currentTarget.checked})}
25
- *
26
- */
27
- const useFilterChangeHandler = (key, updateSelectionFunction) => {
28
- const { store } = useFilterContext();
29
- const change$ = useMemo(() => new Subject(), []);
30
- useEffect(() => {
31
- const subscription = change$
32
- .pipe(withLatestFrom(store.selection$.pipe(pluck(key))))
33
- .subscribe(([change, selection]) => {
34
- store.updateFilterSelection(key, updateSelectionFunction(change, selection));
35
- });
36
- return () => subscription.unsubscribe();
37
- }, [store, key, change$, updateSelectionFunction]);
38
- return useCallback((data) => {
39
- change$.next(data);
40
- }, [change$]);
41
- };
42
- export default useFilterChangeHandler;
43
- //# sourceMappingURL=useFilterChangeHandler.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useFilterChangeHandler.js","sourceRoot":"","sources":["../../src/hooks/useFilterChangeHandler.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACxD,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAC/B,OAAO,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AACvD,OAAO,gBAAgB,MAAM,oBAAoB,CAAC;AAGlD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,sBAAsB,GAAG,CAC7B,GAAW,EACX,uBAA+E,EACxD,EAAE;IACzB,MAAM,EAAE,KAAK,EAAE,GAAG,gBAAgB,EAAE,CAAC;IACrC,MAAM,OAAO,GAAqB,OAAO,CAAC,GAAG,EAAE,CAAC,IAAI,OAAO,EAAW,EAAE,EAAE,CAAC,CAAC;IAC5E,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,YAAY,GAAG,OAAO;aACzB,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;aACvD,SAAS,CAAC,CAAC,CAAC,MAAM,EAAE,SAAS,CAAC,EAAE,EAAE;YACjC,KAAK,CAAC,qBAAqB,CAAC,GAAG,EAAE,uBAAuB,CAAC,MAAM,EAAE,SAAuB,CAAC,CAAC,CAAC;QAC7F,CAAC,CAAC,CAAC;QACL,OAAO,GAAG,EAAE,CAAC,YAAY,CAAC,WAAW,EAAE,CAAC;IAC1C,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,EAAE,OAAO,EAAE,uBAAuB,CAAC,CAAC,CAAC;IACnD,OAAO,WAAW,CAChB,CAAC,IAAa,EAAE,EAAE;QAChB,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACrB,CAAC,EACD,CAAC,OAAO,CAAC,CACV,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,sBAAsB,CAAC"}
@@ -1,4 +0,0 @@
1
- import { FilterContext } from '../FilterContext';
2
- declare const useFilterContext: () => FilterContext;
3
- export default useFilterContext;
4
- //# sourceMappingURL=useFilterContext.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useFilterContext.d.ts","sourceRoot":"","sources":["../../src/hooks/useFilterContext.tsx"],"names":[],"mappings":"AACA,OAAO,EAA4B,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAE3E,QAAA,MAAM,gBAAgB,QAAO,aAA0C,CAAC;AAExE,eAAe,gBAAgB,CAAC"}
@@ -1,5 +0,0 @@
1
- import { useContext } from 'react';
2
- import { default as filterContext } from '../FilterContext';
3
- const useFilterContext = () => useContext(filterContext);
4
- export default useFilterContext;
5
- //# sourceMappingURL=useFilterContext.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useFilterContext.js","sourceRoot":"","sources":["../../src/hooks/useFilterContext.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACnC,OAAO,EAAE,OAAO,IAAI,aAAa,EAAiB,MAAM,kBAAkB,CAAC;AAE3E,MAAM,gBAAgB,GAAG,GAAkB,EAAE,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;AAExE,eAAe,gBAAgB,CAAC"}
@@ -1,27 +0,0 @@
1
- import { FilterOptions, FilterOptionsFn } from '../types/FilterOption';
2
- /**
3
- * Handles building filter options for a filter.
4
- * uses the dataset in the filterstore to create a set of options for filter.
5
- *
6
- * @param optionsBuilderFn function that takes in all data and creates a set off options for a filter.
7
- * @returns FilterOptions
8
- * @example
9
- * const optionsBuilderFn = (data) => {
10
- * const options = data.reduce(c,d) => curr[data.name] = {
11
- key: option,
12
- searchString: option,
13
- label: option,
14
- }
15
- };
16
-
17
- return {
18
- options,
19
- sortOrder: Object.keys(options).sort((a, b) => a.localeCompare(b)),
20
- }
21
- }
22
- *
23
- * const {options,sortOrder} = useFilterOptionsBuilder(optionsBuilderFn);
24
- */
25
- declare const useFilterOptionsBuilder: <TData>(optionsBuilderFn: FilterOptionsFn<TData>) => FilterOptions | null;
26
- export default useFilterOptionsBuilder;
27
- //# sourceMappingURL=useFilterOptionsBuilder.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useFilterOptionsBuilder.d.ts","sourceRoot":"","sources":["../../src/hooks/useFilterOptionsBuilder.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAGvE;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,QAAA,MAAM,uBAAuB,uDAAuD,aAAa,GAAG,IAWnG,CAAC;AAEF,eAAe,uBAAuB,CAAC"}
@@ -1,39 +0,0 @@
1
- import { useMemo } from 'react';
2
- import useSelector from '../epic/hooks/useSelector';
3
- import useFilterContext from './useFilterContext';
4
- /**
5
- * Handles building filter options for a filter.
6
- * uses the dataset in the filterstore to create a set of options for filter.
7
- *
8
- * @param optionsBuilderFn function that takes in all data and creates a set off options for a filter.
9
- * @returns FilterOptions
10
- * @example
11
- * const optionsBuilderFn = (data) => {
12
- * const options = data.reduce(c,d) => curr[data.name] = {
13
- key: option,
14
- searchString: option,
15
- label: option,
16
- }
17
- };
18
-
19
- return {
20
- options,
21
- sortOrder: Object.keys(options).sort((a, b) => a.localeCompare(b)),
22
- }
23
- }
24
- *
25
- * const {options,sortOrder} = useFilterOptionsBuilder(optionsBuilderFn);
26
- */
27
- const useFilterOptionsBuilder = (optionsBuilderFn) => {
28
- const { store } = useFilterContext();
29
- const data$ = useSelector(store, 'data');
30
- const filterOptions = useMemo(() => (data$ ? optionsBuilderFn(data$) : null), [optionsBuilderFn, data$]);
31
- return filterOptions
32
- ? {
33
- options: filterOptions.options,
34
- sortOrder: filterOptions.sortOrder || Object.keys(filterOptions.options),
35
- }
36
- : null;
37
- };
38
- export default useFilterOptionsBuilder;
39
- //# sourceMappingURL=useFilterOptionsBuilder.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useFilterOptionsBuilder.js","sourceRoot":"","sources":["../../src/hooks/useFilterOptionsBuilder.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,WAAW,MAAM,2BAA2B,CAAC;AAGpD,OAAO,gBAAgB,MAAM,oBAAoB,CAAC;AAElD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,uBAAuB,GAAG,CAAS,gBAAwC,EAAwB,EAAE;IACzG,MAAM,EAAE,KAAK,EAAE,GAAG,gBAAgB,EAAE,CAAC;IACrC,MAAM,KAAK,GAAG,WAAW,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IACzC,MAAM,aAAa,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,gBAAgB,EAAE,KAAK,CAAC,CAAC,CAAC;IAEzG,OAAO,aAAa;QAClB,CAAC,CAAC;YACE,OAAO,EAAE,aAAa,CAAC,OAAO;YAC9B,SAAS,EAAE,aAAa,CAAC,SAAS,IAAI,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC;SACzE;QACH,CAAC,CAAC,IAAI,CAAC;AACX,CAAC,CAAC;AAEF,eAAe,uBAAuB,CAAC"}
@@ -1,16 +0,0 @@
1
- import FilterCounters from '../types/FilterCounters';
2
- /**
3
- * This hook uses the supplied function to count the amount of times a given options occurs in the filtered dataset
4
- * Updates every time the data set gets filtered, recounting the remaining options.
5
- *
6
- * @param key Filter key
7
- * @param counterFn function that describes how the options should be counted
8
- * @returns FilterCounters {key: number}
9
- * @example
10
- *
11
- * const countNames = (data) => data.reduce((namesCount,data) => { ...namesCount, [name]: (namesCount[name] || 0) + 1 } )
12
- * const currentOptionsCounters = useFilterOptionsCounter(key, countNames);
13
- */
14
- declare const useFilterOptionsCounter: <TData>(key: string, counterFn?: ((data: TData) => FilterCounters) | undefined) => FilterCounters | null;
15
- export default useFilterOptionsCounter;
16
- //# sourceMappingURL=useFilterOptionsCounter.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useFilterOptionsCounter.d.ts","sourceRoot":"","sources":["../../src/hooks/useFilterOptionsCounter.tsx"],"names":[],"mappings":"AACA,OAAO,cAAc,MAAM,yBAAyB,CAAC;AAGrD;;;;;;;;;;;GAWG;AACH,QAAA,MAAM,uBAAuB,eACtB,MAAM,gCACkB,cAAc,kBAC1C,cAAc,GAAG,IAoBnB,CAAC;AAEF,eAAe,uBAAuB,CAAC"}
@@ -1,32 +0,0 @@
1
- import { useState, useMemo, useEffect } from 'react';
2
- import useFilterContext from './useFilterContext';
3
- /**
4
- * This hook uses the supplied function to count the amount of times a given options occurs in the filtered dataset
5
- * Updates every time the data set gets filtered, recounting the remaining options.
6
- *
7
- * @param key Filter key
8
- * @param counterFn function that describes how the options should be counted
9
- * @returns FilterCounters {key: number}
10
- * @example
11
- *
12
- * const countNames = (data) => data.reduce((namesCount,data) => { ...namesCount, [name]: (namesCount[name] || 0) + 1 } )
13
- * const currentOptionsCounters = useFilterOptionsCounter(key, countNames);
14
- */
15
- const useFilterOptionsCounter = (key, counterFn) => {
16
- const { store } = useFilterContext();
17
- const [optionsCount, setOptionsCount] = useState(null);
18
- const filteredSelectionData = useMemo(() => store.filterSelectionData(key), [store, key]);
19
- useEffect(() => {
20
- if (!counterFn) {
21
- setOptionsCount(null);
22
- return;
23
- }
24
- const subscription = filteredSelectionData.subscribe((filteredData) => {
25
- setOptionsCount(counterFn(filteredData));
26
- });
27
- return () => subscription.unsubscribe();
28
- }, [setOptionsCount, filteredSelectionData, counterFn]);
29
- return optionsCount;
30
- };
31
- export default useFilterOptionsCounter;
32
- //# sourceMappingURL=useFilterOptionsCounter.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useFilterOptionsCounter.js","sourceRoot":"","sources":["../../src/hooks/useFilterOptionsCounter.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAErD,OAAO,gBAAgB,MAAM,oBAAoB,CAAC;AAElD;;;;;;;;;;;GAWG;AACH,MAAM,uBAAuB,GAAG,CAC9B,GAAW,EACX,SAA2C,EACpB,EAAE;IACzB,MAAM,EAAE,KAAK,EAAE,GAAG,gBAAgB,EAAE,CAAC;IACrC,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,QAAQ,CAAwB,IAAI,CAAC,CAAC;IAE9E,MAAM,qBAAqB,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,mBAAmB,CAAC,GAAG,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,CAAC;IAE1F,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,CAAC,SAAS,EAAE;YACd,eAAe,CAAC,IAAI,CAAC,CAAC;YACtB,OAAO;SACR;QAED,MAAM,YAAY,GAAG,qBAAqB,CAAC,SAAS,CAAC,CAAC,YAAY,EAAE,EAAE;YACpE,eAAe,CAAC,SAAS,CAAC,YAAqB,CAAC,CAAC,CAAC;QACpD,CAAC,CAAC,CAAC;QAEH,OAAO,GAAG,EAAE,CAAC,YAAY,CAAC,WAAW,EAAE,CAAC;IAC1C,CAAC,EAAE,CAAC,eAAe,EAAE,qBAAqB,EAAE,SAAS,CAAC,CAAC,CAAC;IAExD,OAAO,YAAY,CAAC;AACtB,CAAC,CAAC;AAEF,eAAe,uBAAuB,CAAC"}
@@ -1,25 +0,0 @@
1
- import { FilterStore } from '../filterStore/store';
2
- declare type FilterStoreHook<TData> = {
3
- filteredData: TData | null;
4
- selection: Record<string, unknown>;
5
- store: FilterStore;
6
- };
7
- /**
8
- * A way to access the filteredData and selections.
9
- * Use full when you need to get hold of the filteredData, to be used in one of your components.
10
- * Also gives you the entire selections object, with all selections that currently active.
11
- *
12
- * The store object is gives you access to the entire FilterProvider "engine".
13
- *
14
- * @returns filteredData, selection and store
15
- *
16
- * @example
17
- * ```tsx
18
- * const {filteredData,selection,store} = useFilterStore();
19
- *
20
- * <MyTableComponent data={filteredData} />
21
- * ```
22
- */
23
- declare const useFilterStore: <TData>() => FilterStoreHook<TData>;
24
- export default useFilterStore;
25
- //# sourceMappingURL=useFilterStore.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useFilterStore.d.ts","sourceRoot":"","sources":["../../src/hooks/useFilterStore.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAGnD,aAAK,eAAe,CAAC,KAAK,IAAI;IAC5B,YAAY,EAAE,KAAK,GAAG,IAAI,CAAC;IAC3B,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACnC,KAAK,EAAE,WAAW,CAAC;CACpB,CAAC;AAEF;;;;;;;;;;;;;;;GAeG;AAEH,QAAA,MAAM,cAAc,qCAkBnB,CAAC;AAEF,eAAe,cAAc,CAAC"}
@@ -1,34 +0,0 @@
1
- import { useState, useEffect } from 'react';
2
- import useFilterContext from './useFilterContext';
3
- /**
4
- * A way to access the filteredData and selections.
5
- * Use full when you need to get hold of the filteredData, to be used in one of your components.
6
- * Also gives you the entire selections object, with all selections that currently active.
7
- *
8
- * The store object is gives you access to the entire FilterProvider "engine".
9
- *
10
- * @returns filteredData, selection and store
11
- *
12
- * @example
13
- * ```tsx
14
- * const {filteredData,selection,store} = useFilterStore();
15
- *
16
- * <MyTableComponent data={filteredData} />
17
- * ```
18
- */
19
- const useFilterStore = () => {
20
- const { store } = useFilterContext();
21
- const [filteredData, setFilteredData] = useState(null);
22
- const [selection, setSelection] = useState({});
23
- useEffect(() => {
24
- const sub = store.data$.subscribe((d) => setFilteredData(d));
25
- return () => sub.unsubscribe();
26
- }, [store]);
27
- useEffect(() => {
28
- const sub = store.selection$.subscribe((d) => setSelection(d));
29
- return () => sub.unsubscribe();
30
- }, [store]);
31
- return { filteredData, selection, store };
32
- };
33
- export default useFilterStore;
34
- //# sourceMappingURL=useFilterStore.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useFilterStore.js","sourceRoot":"","sources":["../../src/hooks/useFilterStore.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAE5C,OAAO,gBAAgB,MAAM,oBAAoB,CAAC;AAQlD;;;;;;;;;;;;;;;GAeG;AAEH,MAAM,cAAc,GAAG,GAAmC,EAAE;IAC1D,MAAM,EAAE,KAAK,EAAE,GAAG,gBAAgB,EAAE,CAAC;IACrC,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,QAAQ,CAAe,IAAI,CAAC,CAAC;IACrE,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,CAA0B,EAAE,CAAC,CAAC;IAExE,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,GAAG,GAAG,KAAK,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,eAAe,CAAC,CAAU,CAAC,CAAC,CAAC;QAEtE,OAAO,GAAG,EAAE,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC;IACjC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;IAEZ,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,GAAG,GAAG,KAAK,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC;QAE/D,OAAO,GAAG,EAAE,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC;IACjC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;IAEZ,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;AAC5C,CAAC,CAAC;AAEF,eAAe,cAAc,CAAC"}
@@ -1,20 +0,0 @@
1
- import { RefObject } from 'react';
2
- interface ResizedSize {
3
- height: number;
4
- }
5
- export interface ResizablePaneOptions {
6
- id: string;
7
- isResizable?: boolean;
8
- minHeight?: number;
9
- maxHeight?: number;
10
- defaultHeight?: number;
11
- resizeContainerRef: RefObject<HTMLDivElement>;
12
- }
13
- export declare type ResizablePane = {
14
- onResizeStart: (e: React.MouseEvent<HTMLDivElement>) => void;
15
- resizedSize: ResizedSize | null;
16
- isResizing: boolean;
17
- };
18
- declare const useResizablePanel: ({ isResizable: isEnabled, id, defaultHeight, minHeight, maxHeight, resizeContainerRef, }: ResizablePaneOptions) => ResizablePane;
19
- export default useResizablePanel;
20
- //# sourceMappingURL=useResizablePanel.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useResizablePanel.d.ts","sourceRoot":"","sources":["../../src/hooks/useResizablePanel.ts"],"names":[],"mappings":"AAEA,OAAO,EAAoC,SAAS,EAAW,MAAM,OAAO,CAAC;AAG7E,UAAU,WAAW;IACnB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,oBAAoB;IACnC,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,kBAAkB,EAAE,SAAS,CAAC,cAAc,CAAC,CAAC;CAC/C;AAED,oBAAY,aAAa,GAAG;IAC1B,aAAa,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,cAAc,CAAC,KAAK,IAAI,CAAC;IAC7D,WAAW,EAAE,WAAW,GAAG,IAAI,CAAC;IAChC,UAAU,EAAE,OAAO,CAAC;CACrB,CAAC;AAEF,QAAA,MAAM,iBAAiB,6FAOpB,oBAAoB,KAAG,aAgFzB,CAAC;AAEF,eAAe,iBAAiB,CAAC"}