Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[useTree]: hook #1880

Merged
merged 310 commits into from
Apr 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
310 commits
Select commit Hold shift + click to select a range
f2c814f
[useTree]: Fixed ItemsStorage usage (not final version).
Kuznietsov Jan 12, 2024
609df6f
[useTree]: Added subscription to AsyncDataSource and LazyDataSource.
Kuznietsov Jan 12, 2024
9ac7486
[useTree]: used ItemsStorage at ProjectTableDemo.
Kuznietsov Jan 12, 2024
0506876
[useTree]: TreeSnapshot fixes.
Kuznietsov Jan 12, 2024
5ab1e69
[useTree]: more fixes of ProjectTableDemo.
Kuznietsov Jan 12, 2024
865287e
[useTree]: New try of itemsMap.
Kuznietsov Jan 15, 2024
7c2167c
[useTree]: Added more generic type for Lens ItemsMap.
Kuznietsov Jan 16, 2024
8bf5257
[useTree]: fixed adding items.
Kuznietsov Jan 16, 2024
1c29a8c
[useTree]: IMap -> IBaseMap.
Kuznietsov Jan 16, 2024
e2d926e
[useTree]: itemsMap -> getItemsMap() and itemsStorage reinit where it…
Kuznietsov Jan 16, 2024
9e60317
[useTree]: removed useTreeStrategy.
Kuznietsov Jan 16, 2024
2e54c24
[useTree]: inited storage after props
Kuznietsov Jan 16, 2024
373ebf4
[useTree]: fixes and refactoring
Kuznietsov Jan 17, 2024
cec0cff
[useTree]: fixed paging.
Kuznietsov Jan 17, 2024
3fcdbfa
[useTree]: additional pack of fixes
Kuznietsov Jan 17, 2024
c8ea765
[useTree]: patch items
Kuznietsov Jan 18, 2024
11ab58e
[useTree]: Added TreeStructure.
Kuznietsov Jan 18, 2024
de50c92
[useTree]: Finished TreeState and TreeStructure.
Kuznietsov Jan 19, 2024
8bc7279
[useTree]: Removed ListViews and old Trees and refactored new TreeSta…
Kuznietsov Jan 19, 2024
423522e
[useTree]: Removed useList.
Kuznietsov Jan 19, 2024
d2414a4
[useTree]: Moved all NewTree consumers to TreeState.
Kuznietsov Jan 22, 2024
5015c50
[useTree]: Added getById to PureTreeState.
Kuznietsov Jan 22, 2024
61d447d
[useTree]: more fixes.
Kuznietsov Jan 22, 2024
a7710c1
[useTree]: fixed setItems call on itemsMap change.
Kuznietsov Jan 22, 2024
98d474d
[useTree]: fixes.
Kuznietsov Jan 22, 2024
9f87865
[useTree]: fixed checking service.
Kuznietsov Jan 22, 2024
0a14d95
[useTree]: removed ITreeState.
Kuznietsov Jan 22, 2024
b9a988b
[useTree]: Removed ITreeStructure.
Kuznietsov Jan 22, 2024
48489df
[useTree]: visibleRows -> rows.
Kuznietsov Jan 23, 2024
a95db1b
[useTree]: handleCascadeSelection POC.
Kuznietsov Jan 25, 2024
9760f76
[useTree]: moved FetchingHelper to ITree.
Kuznietsov Jan 26, 2024
1164a8b
[useTree]: refactored FetchingService and moved decision making of fe…
Kuznietsov Jan 29, 2024
2e41c96
[useTree]: added LocationsTable to sandbox.
Kuznietsov Jan 29, 2024
53301b8
[useTree]: Fixed fetching.
Kuznietsov Jan 29, 2024
6b237ca
[useTree]: Fixed lazy loading.
Kuznietsov Jan 30, 2024
d9f08db
[useTree]: Added basic example of useQuery with lazy loading.
Kuznietsov Jan 30, 2024
7b26228
[useTree]: Integrated isFetching/useLazyFetchingAdvisor with useQuery…
Kuznietsov Jan 31, 2024
7dae6fc
[useTree]: small refactoring.
Kuznietsov Jan 31, 2024
3bb9f5e
[useTree]: start of cascade selection with useQuery.
Kuznietsov Jan 31, 2024
23aab70
[useTree]: basic example of cascade selection.
Kuznietsov Jan 31, 2024
ff6bf09
[useTree]: simplified code.
Kuznietsov Jan 31, 2024
d854e6f
[useTree]: some improvements.
Kuznietsov Feb 1, 2024
ceb0111
[useTree]: removed invalidation.
Kuznietsov Feb 1, 2024
2c7b9e0
[useTree]: params -> getParams.
Kuznietsov Feb 1, 2024
36439cb
[useTree]: TreeNodeStatus: Symbol -> string literal.
Kuznietsov Feb 1, 2024
fcf89a4
[useTree]: removed getTotalCount from ITree.
Kuznietsov Feb 1, 2024
0063207
[useTree]: got rid of getTotalCount.
Kuznietsov Feb 1, 2024
e1204d4
[useTree]: cleaned up TreeState and TreeStructure classes and remove …
Kuznietsov Feb 1, 2024
496cd70
[useTree]: Fixed ArrayDS with PickerInput on items change.
Kuznietsov Feb 2, 2024
6a73148
[useTree]: Fixed cascade selection with search reset.
Kuznietsov Feb 2, 2024
b32f025
[useTree]: fixed changing filter and search + cascadeSelection.
Kuznietsov Feb 2, 2024
ec3f71e
[useTree]: added complexIds to ItemsMap.
Kuznietsov Feb 2, 2024
c2a166a
Merge branch 'develop' into feature/use-tree-hook
Kuznietsov Feb 5, 2024
b770fd4
[useTree]: fixed creation of form history checkpoints.
Kuznietsov Feb 5, 2024
e94b5a0
Merge branch 'develop' into feature/use-tree-hook
Kuznietsov Feb 6, 2024
957690f
[useTree]: draft of showOnlySelected.
Kuznietsov Feb 7, 2024
136b027
[useTree]: added tracking of loading items (early draft).
Kuznietsov Feb 7, 2024
d4015c5
Revert "[useTree]: added tracking of loading items (early draft)."
Kuznietsov Feb 8, 2024
9bf0d6e
[useTree]: added itemsStatusCollector.
Kuznietsov Feb 8, 2024
d2453d3
[useTree]: PoC show only selected.
Kuznietsov Feb 9, 2024
e97b113
[useTree]: added itemsStatusCollector to AsyncDataSource.
Kuznietsov Feb 12, 2024
7ad1c16
[useTree]: added assumed count to TreeNodeInfo.
Kuznietsov Feb 12, 2024
fc8cf98
[useTree]: draft assumedCount.
Kuznietsov Feb 13, 2024
74e1a7b
[useTree]: draft
Kuznietsov Feb 13, 2024
375830d
[useTree]: moved useDataRows/useBuildRows from using isFlattenSearch …
Kuznietsov Feb 13, 2024
b281f49
[useTree]: flat selectedOnly tree.
Kuznietsov Feb 15, 2024
82513c8
Merge branch 'develop' into feature/use-tree-hook
Kuznietsov Feb 16, 2024
b46e798
[useTree]: one more fix.
Kuznietsov Feb 16, 2024
2b89450
[useTree]: fixed Async tree structure onFold with focusIndex.
Kuznietsov Feb 16, 2024
8ce6ae6
[useTree]: fix test.
Kuznietsov Feb 19, 2024
93777eb
[useTree]: applied fix of fetch on search to useLazyTree.
Kuznietsov Feb 19, 2024
c68574d
[useTree]: fixed tests of ArrayListView and fixed errors in code.
Kuznietsov Feb 19, 2024
962d666
[useTree]: some tests changes/fixes and DataSources fixes.
Kuznietsov Feb 19, 2024
2978a26
[useTree]: fixed tests and solutions.
Kuznietsov Feb 20, 2024
d126251
[useTree]: tests fixes.
Kuznietsov Feb 20, 2024
e21d7f4
[useTree]: LazyListView tests fixed.
Kuznietsov Feb 21, 2024
f8dc1e1
[useTree]: fixed some tests.
Kuznietsov Feb 21, 2024
66eae28
[useTree]: fixed tests.
Kuznietsov Feb 21, 2024
f687cd7
[useTree]: more fixes.
Kuznietsov Feb 21, 2024
e28ee15
[useTree]: more tests fixed.
Kuznietsov Feb 21, 2024
918b216
[useTree]: test improvements.
Kuznietsov Feb 21, 2024
a61ffa6
[useTree]: fixed PickerInput selection display.
Kuznietsov Feb 21, 2024
41a42f7
[useTree]: fixed picker tests and picker behavior.
Kuznietsov Feb 21, 2024
65e47ff
[useTree]: Fixed PickerList tests and PickerList component.
Kuznietsov Feb 21, 2024
e98233a
[useTree]: PickerModal fixed and fixed tests.
Kuznietsov Feb 22, 2024
2df15f6
[useTree]: fixed PickerList tests.
Kuznietsov Feb 22, 2024
b284b23
[useTree]: fixed snapshots.
Kuznietsov Feb 22, 2024
fa901aa
[useTree]: fixed DataPickerBody tests.
Kuznietsov Feb 22, 2024
d17ea83
[useTree]: fixed more tests.
Kuznietsov Feb 22, 2024
652d7ff
[useTree]: FIltersPanel tests fix.
Kuznietsov Feb 22, 2024
76adaf1
[useTree]: added tests for LazyDataSource backgroundReload.
Kuznietsov Feb 26, 2024
82e1efb
[useTree]: showOnlySelected tests for LazyDataSource.
Kuznietsov Feb 27, 2024
6a18ce8
[useTree]: selectAll/clearAll for cascadeSelection: false.
Kuznietsov Feb 27, 2024
20337d7
[useTree]: added tests for clearing loading/loaded/not-found data.
Kuznietsov Feb 27, 2024
6860ac2
[useTree]: patchItems tests added.
Kuznietsov Feb 27, 2024
9bd7cc7
[useTree]: added foldAll tests and fixed code.
Kuznietsov Feb 27, 2024
a5753c3
[useTree]: one more test for foldAll.
Kuznietsov Feb 28, 2024
9174e67
[useTree]: added test for flattenSearchResults with cascadeSelection:…
Kuznietsov Feb 28, 2024
1895821
[useTree]: added tests for flattenSearch + cascadeSelection implicit/…
Kuznietsov Feb 28, 2024
c8e44c9
[useTree]: added test for flattenSearchResults with cascadeSelection …
Kuznietsov Feb 28, 2024
3e88658
[useTree]: fixed bug in tree-search with cascade selection.
Kuznietsov Feb 28, 2024
a6925fc
[useTree]: foldAll tests.
Kuznietsov Feb 29, 2024
04d6076
[useTree]: Added patchItems to ArrayDataSource.
Kuznietsov Feb 29, 2024
cc9880a
[useTree]: added showOnlySelected tests.
Kuznietsov Feb 29, 2024
1da9ee6
[useTree]: finished tests for ArrayDataSource.
Kuznietsov Feb 29, 2024
f785711
[useTree]: added complex-ids tests for asyncListView.
Kuznietsov Feb 29, 2024
438a4fb
[useTree]: added tests for complex-ids for array.
Kuznietsov Feb 29, 2024
b690f22
[useTree]: flat list tree tests for async.
Kuznietsov Feb 29, 2024
96368db
Merge branch 'develop' into feature/use-tree-hook
Kuznietsov Mar 1, 2024
7096688
[useTree]: removed tree tests temporary.
Kuznietsov Mar 1, 2024
3ff9bf7
[useTree]: async fold-all test.
Kuznietsov Mar 1, 2024
d54abcf
[useTree]: added patchItems to useAsyncTree.
Kuznietsov Mar 1, 2024
a7a39c7
[useTree]: async showOnlySelected tests.
Kuznietsov Mar 1, 2024
c16c932
[useTree]: added tests for search.
Kuznietsov Mar 1, 2024
2488bd4
[useTree]: added search test.
Kuznietsov Mar 1, 2024
221d904
[useTree]: more tests for AsyncListView and fixed bug with sortByRele…
Kuznietsov Mar 1, 2024
d77c874
Merge branch 'develop' into feature/use-tree-hook
Kuznietsov Mar 1, 2024
374cb71
Merge branch 'develop' into feature/use-tree-hook
Kuznietsov Mar 4, 2024
e62d397
[useTree]: added handling of async not found items.
Kuznietsov Mar 4, 2024
f537908
[useTree]: Fixed clearing not found tree-like items and fetching item…
Kuznietsov Mar 4, 2024
0fea656
[useTree]: added tests for clearing unknown items.
Kuznietsov Mar 4, 2024
f59c8ba
[useTree]: added test for correct loading of tree on showOnlySelected…
Kuznietsov Mar 4, 2024
fb18edf
[useTree]: fixed selectAll for checkbox.isVisible: false.
Kuznietsov Mar 5, 2024
84e4da9
[useTree]: added tests for rowOptions selectAll.
Kuznietsov Mar 5, 2024
35f29c5
[useTree]: added tests for all rowOptions, except dnd.
Kuznietsov Mar 5, 2024
498a170
[useTree]: added tests for getRowOptions.
Kuznietsov Mar 5, 2024
3c14e7d
[useTree]: added rowOptions test for Async and Lazy dataSources.
Kuznietsov Mar 5, 2024
51d6531
[useTree]: fixed PickerList tests.
Kuznietsov Mar 5, 2024
94700fd
[useTree]: added tests for selectAll prop of dataSource.
Kuznietsov Mar 5, 2024
f63664e
[useTree]: added test for useAsyncTree with minimal amount of props t…
Kuznietsov Mar 5, 2024
faca33c
[useTree]: added tests for passing props.
Kuznietsov Mar 5, 2024
c670245
[useTree]: added tests for useAsyncTree and useLazyTree.
Kuznietsov Mar 6, 2024
67a70b3
[useTree]: added tests for usePlainTree.
Kuznietsov Mar 6, 2024
e8707a5
[useTree]: added refactoring of useMemo.
Kuznietsov Mar 6, 2024
b2c6fb1
[useTree]: more fixes.
Kuznietsov Mar 6, 2024
33a6e09
[useTree]: refactored usePlainTree.
Kuznietsov Mar 6, 2024
f006f04
[useTree]: more refactoring of useAsyncTree/useLazyTree.
Kuznietsov Mar 6, 2024
123bad2
[useTree]: more refactoring.
Kuznietsov Mar 6, 2024
50270dd
[useTree]: added comments.
Kuznietsov Mar 6, 2024
9d698f6
[useTree]: removed todos.
Kuznietsov Mar 6, 2024
706772c
[useTree]: fixed problem in extra's.
Kuznietsov Mar 6, 2024
a68c9f0
[useTree]: fixed tests.
Kuznietsov Mar 6, 2024
41b8a66
Merge branch 'develop' into feature/use-tree-hook
Kuznietsov Mar 6, 2024
0d0a351
[useTree]: removed not used view functions.
Kuznietsov Mar 6, 2024
02a2402
Merge branch 'develop' into feature/use-tree-hook
Kuznietsov Mar 6, 2024
64bb194
[useTree]: getVisibleRows -> getRows.
Kuznietsov Mar 6, 2024
0b769ed
[useTree]: added tests for clearCache, reload, etc.
Kuznietsov Mar 6, 2024
d518a87
[useTree]: fixed async tree.
Kuznietsov Mar 6, 2024
7a99379
[useTree]: fixed grouping example.
Kuznietsov Mar 6, 2024
851a39a
[useTree]: fixed example.
Kuznietsov Mar 6, 2024
14bf262
Merge branch 'develop' into feature/use-tree-hook
Kuznietsov Mar 7, 2024
5f33ab5
[useTree]: fixed canUndo.
Kuznietsov Mar 7, 2024
070b484
[useTree]: fixed getChildCount.
Kuznietsov Mar 7, 2024
d4652eb
[useTree]: fixed more tests.
Kuznietsov Mar 7, 2024
6c0d7ae
[useTree]: removed getChildCount.
Kuznietsov Mar 7, 2024
7c67044
[useTree]: removed legacyLoadDataBehavior.
Kuznietsov Mar 7, 2024
1358cc7
[useTree]: getRows -> getVisibleRows..
Kuznietsov Mar 8, 2024
d290f05
[useTree]: created a separate type for onValueChange in useView.
Kuznietsov Mar 8, 2024
292d504
[useTree]: showOnlySelected -> showSelectedOnly.
Kuznietsov Mar 8, 2024
72cf62e
[useTree]: moved all examples to useDataSource.
Kuznietsov Mar 8, 2024
e7fea74
[useTree]: added editableTable example with patch.
Kuznietsov Mar 8, 2024
71ba4fe
[useTree]: simplified usePatchTree.
Kuznietsov Mar 8, 2024
71ec7c7
[useTree]: added focusRow.
Kuznietsov Mar 11, 2024
77da02e
Merge branch 'develop' into feature/use-tree-hook
Kuznietsov Mar 11, 2024
21a321a
[useTree]: updated changlog.
Kuznietsov Mar 11, 2024
b7cec19
[useTree]: trying to get report.
Kuznietsov Mar 11, 2024
1c3b08f
[useTree]: docs were added.
Kuznietsov Mar 11, 2024
fbff563
Merge branch 'develop' into feature/use-tree-hook
Kuznietsov Mar 11, 2024
15e7159
[useTree]: fixed bundleSizeBaseLine and added more docs.
Kuznietsov Mar 11, 2024
19ec4fb
[useTree]: Added more docs and changed logic of finding a tree is flat.
Kuznietsov Mar 12, 2024
96d7a31
[useTree]: added isNew field to TodoItem.
Kuznietsov Mar 12, 2024
e4f8636
[useTree]: patch lazy editable table with dnd simple example.
Kuznietsov Mar 13, 2024
4a19b66
[useTree]: fixed bugs at patching.
Kuznietsov Mar 13, 2024
162e1dc
[useTree]: added more fixes.
Kuznietsov Mar 13, 2024
50804cd
[useTree]: some refactoring.
Kuznietsov Mar 13, 2024
5c3082a
[useTree]: more fixes of itemsMap.
Kuznietsov Mar 14, 2024
f8d2b21
[useTree]: fixed itemsMap usage in usePlainTree.
Kuznietsov Mar 14, 2024
9370cda
[useTree]: fixed itemsMap setItems flow.
Kuznietsov Mar 14, 2024
6808a75
[useTree]: added IImmutableMap along with IMap.
Kuznietsov Mar 14, 2024
073f5c8
[useTree]: fixed validation of maps.
Kuznietsov Mar 14, 2024
d032c0f
[useTree]: getItem -> key in ILens.
Kuznietsov Mar 14, 2024
9f66b1e
[useTree]: Changed type of patchItems.
Kuznietsov Mar 15, 2024
7f295ee
Merge branch 'develop' into feature/use-tree-hook
Kuznietsov Mar 18, 2024
949cfe8
[useTree]: start of POC of patch ordering.
Kuznietsov Mar 19, 2024
261d1ef
[useTree]: ordering of patch before zip (only patch sorting part).
Kuznietsov Mar 20, 2024
4f8d1c0
[useTree]: new patch implementation PoC (not tested yet, in process o…
Kuznietsov Mar 21, 2024
3980e22
[useTree]: more tests and fixes.
Kuznietsov Mar 21, 2024
dfb10a7
[useTree]: fixed a lot of problems.
Kuznietsov Mar 22, 2024
ac98a2e
[useTree]: fixed deleting.
Kuznietsov Mar 22, 2024
c356c31
[useTree]: added stableSort (for existing items).
Kuznietsov Mar 22, 2024
bb779e0
[useTree]: added a lot of fixes of usePatchTree.
Kuznietsov Mar 25, 2024
895fdde
[useTree]: tried to reduce the complexity of code.
Kuznietsov Mar 25, 2024
ec77d71
[useTree]: some refactoring.
Kuznietsov Mar 25, 2024
b7ff7f1
[useTree]: simplified algorithm.
Kuznietsov Mar 26, 2024
9f22dac
[useTree]: fixed sorting push(...arrs).
Kuznietsov Mar 26, 2024
abe082e
[useTree]: added possibility to generate and move rows in lazy with p…
Kuznietsov Mar 27, 2024
8f8b8cc
[useTree]: some refactoring.
Kuznietsov Mar 27, 2024
6cc05e3
[useTree]: added refactoring.
Kuznietsov Mar 27, 2024
8425c7a
[useTree]: new refactoring
Kuznietsov Mar 27, 2024
1fcb5f1
[useTree]: fixed rerendering of multi PickerInput (for single).
Kuznietsov Mar 28, 2024
bf8bf17
[useTree]: added tests.
Kuznietsov Mar 28, 2024
3004932
[useTree]: added docs.
Kuznietsov Mar 28, 2024
7deecdb
[useTree]: updated numberToOrder.
Kuznietsov Mar 28, 2024
a83e301
[useTree]: refactored and fixed form save.
Kuznietsov Mar 28, 2024
5b1dddb
Merge branch 'develop' into feature/use-tree-hook
Kuznietsov Mar 28, 2024
b0e2fff
[useTree]: fixed merge problems.
Kuznietsov Mar 28, 2024
f5b1157
[useTree]: more refactoring.
Kuznietsov Mar 28, 2024
668ac22
[useTree]: changelog was updated.
Kuznietsov Mar 28, 2024
81456ca
getOrderBetween now tries to generate orders w/o digits, if possible …
Mar 28, 2024
aa47a22
getOrderBetween - numberToOrder now handles arbitrary number lengths
Mar 28, 2024
fd8ff02
Simple handling of tempOrder in Sandbox/Editable Table
Mar 29, 2024
4851a02
[useTree]: added exposed.
Kuznietsov Mar 29, 2024
ea629c5
Merge branch 'feature/use-tree-hook' of github.com:epam/UUI into feat…
Kuznietsov Mar 29, 2024
79ccdd2
[useTree]: added fixItemBetweenSortings.
Kuznietsov Mar 29, 2024
169fe9e
[useTree]: updated changelog.
Kuznietsov Mar 29, 2024
fa1c673
Merge branch 'develop' into feature/use-tree-hook
Kuznietsov Mar 29, 2024
46d7cea
[useTree]: fixed problems
Kuznietsov Mar 29, 2024
3fee1d8
[useTree]: Added experimental to the comments.
Kuznietsov Mar 29, 2024
29fe52c
[useTree]: ItemsStorage internal tag is added.
Kuznietsov Mar 29, 2024
c4caa72
[useTree]: plain to sync.
Kuznietsov Mar 29, 2024
42ca8b8
[useTree]: patchItems -> patch.
Kuznietsov Mar 29, 2024
76974e7
[useTree]: added docs to IMap/IImmutableMap.
Kuznietsov Mar 29, 2024
6452e98
Merge remote-tracking branch 'remotes/origin/use-tree-simpler-temp-or…
Mar 29, 2024
3ca10f5
Sandbox/editable table - simpler and more efficient tempOrder handling
Mar 31, 2024
34c2f1a
Merge pull request #2094 from epam/use-tree-simpler-temp-order-handling
Kuznietsov Apr 1, 2024
ee4c66d
[useTree]: fixed moving parents.
Kuznietsov Apr 1, 2024
4e5a3be
[useTree]: added stable ordering of items while editing by comparing …
Kuznietsov Apr 1, 2024
db25dc0
[useTree]: merge refactoring was added.
Kuznietsov Apr 1, 2024
800946a
[useTree]: got rid of unnecessary index stabilization.
Kuznietsov Apr 1, 2024
753e992
[useTree]: fixed typo in composeComparators.
Kuznietsov Apr 1, 2024
091de1e
[useTree]: usePrevious updated.
Kuznietsov Apr 1, 2024
bf3d21d
sandbox/editableTable - fixed insertion before/after the first item
Apr 1, 2024
8e11484
[useTree]: fixed comparators and fixed adding item after 0.
Kuznietsov Apr 1, 2024
913e9ce
Merge branch 'feature/use-tree-hook' of github.com:epam/UUI into feat…
Kuznietsov Apr 1, 2024
88e31f3
renamed numberToOrder to indexToOrder; added code doc
Apr 1, 2024
db72443
Merge branch 'feature/use-tree-hook' of github.com:epam/UUI into feat…
Apr 1, 2024
2be67a0
[useTree]: fixed moving items into children without leaves.
Kuznietsov Apr 1, 2024
693b53d
Merge branch 'feature/use-tree-hook' of github.com:epam/UUI into feat…
Kuznietsov Apr 1, 2024
6374a19
[useTree]: fixed loading missing items while patching.
Kuznietsov Apr 1, 2024
afede6f
[useTree]: fixed tests of PickerList.
Kuznietsov Apr 1, 2024
2d01cfe
[useTree]: one more fix.
Kuznietsov Apr 1, 2024
c863029
[useTree]: cleaned up ProjectTableDemo.
Kuznietsov Apr 2, 2024
27eb512
[useTree]: cleaned up unnecessary changes in FilteredTable.
Kuznietsov Apr 2, 2024
69215b6
[useTree]: removed unnecessary diff.
Kuznietsov Apr 2, 2024
18e69a7
[useTree]: more cleanups.
Kuznietsov Apr 2, 2024
850cc56
[useTree]: refactored types.
Kuznietsov Apr 2, 2024
d743bff
[useTree]: unified simpleComparator.
Kuznietsov Apr 2, 2024
6890e68
[useTree]: reduced export types.
Kuznietsov Apr 2, 2024
5718e80
[useTree]: fixed types.
Kuznietsov Apr 2, 2024
090addd
Merge branch 'develop' into feature/use-tree-hook
AlekseyManetov Apr 3, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"@epam/uui-docs": "5.7.1",
"@epam/uui-editor": "5.7.1",
"@epam/uui-timeline": "5.7.1",
"@tanstack/react-query": "^5.17.19",
"@udecode/plate-common": "25.0.1",
"amplitude-js": "8.9.1",
"classnames": "2.2.6",
Expand Down
2 changes: 1 addition & 1 deletion app/src/common/apiReference/TypeRefTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export function TypeRefTable(props: TypeRefTableProps) {
[items, props.isGrouped],
);

const view = exportPropsDs.getView(tableState, setTableState, {
const view = exportPropsDs.useView(tableState, setTableState, {
isFoldedByDefault: () => false,
});

Expand Down
21 changes: 10 additions & 11 deletions app/src/demo/tables/editableTable/ProjectTableDemo.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { useCallback, useEffect, useMemo, useState } from 'react';
import { DataTable, Panel, Button, FlexCell, FlexRow, FlexSpacer, IconButton, useForm, SearchInput, Tooltip } from '@epam/uui';
import { AcceptDropParams, DataTableState, DropParams, DropPosition, Metadata, useList } from '@epam/uui-core';
import { AcceptDropParams, DataTableState, DropParams, DropPosition, Metadata, useArrayDataSource } from '@epam/uui-core';
import { useDataTableFocusManager } from '@epam/uui-components';

import { ReactComponent as undoIcon } from '@epam/assets/icons/content-edit_undo-outline.svg';
Expand Down Expand Up @@ -39,7 +39,7 @@ let savedValue: FormState = { items: getDemoTasks() };

export function ProjectTableDemo() {
const {
lens, value, save, isChanged, revert, undo, canUndo, redo, canRedo, setValue,
value, save, isChanged, revert, undo, canUndo, redo, canRedo, setValue, lens,
} = useForm<FormState>({
value: savedValue,
onSave: async (data) => {
Expand All @@ -52,7 +52,6 @@ export function ProjectTableDemo() {
const [tableState, setTableState] = useState<DataTableState>({ sorting: [{ field: 'order' }], visibleCount: 1000 });
const dataTableFocusManager = useDataTableFocusManager<Task['id']>({}, []);

// Insert new/exiting top/bottom or above/below relative to other task
const insertTask = useCallback((position: DropPosition, relativeTask: Task | null = null, existingTask: Task | null = null) => {
let tempRelativeTask = relativeTask;
const task: Task = existingTask ? { ...existingTask } : { id: lastId--, name: '' };
Expand Down Expand Up @@ -117,15 +116,13 @@ export function ProjectTableDemo() {
[],
);

const { rows, listProps } = useList(
const dataSource = useArrayDataSource<Task, number, any>(
{
type: 'array',
listState: tableState,
setListState: setTableState,
items: Object.values(value.items),
getSearchFields: (item) => [item.name],
getId: (i) => i.id,
getParentId: (i) => i.parentId,
fixItemBetweenSortings: false,
getRowOptions: (task) => ({
...lens.prop('items').prop(task.id).toProps(), // pass IEditable to each row to allow editing
// checkbox: { isVisible: true },
Expand All @@ -141,6 +138,8 @@ export function ProjectTableDemo() {
[],
);

const view = dataSource.useView(tableState, setTableState);

const columns = useMemo(
() => getColumns({ insertTask, deleteTask }),
[insertTask, deleteTask],
Expand All @@ -156,7 +155,7 @@ export function ProjectTableDemo() {
const deleteSelectedItem = useCallback(() => {
if (selectedItem === undefined) return;

const prevRows = [...rows];
const prevRows = [...view.getVisibleRows()];
deleteTask(selectedItem);
const index = prevRows.findIndex((task) => task.id === selectedItem.id);
const newSelectedIndex = index === prevRows.length - 1
Expand All @@ -167,7 +166,7 @@ export function ProjectTableDemo() {
...state,
selectedId: newSelectedIndex >= 0 ? prevRows[newSelectedIndex].id : undefined,
}));
}, [deleteTask, rows, selectedItem, setTableState]);
}, [deleteTask, view, selectedItem, setTableState]);

const keydownHandler = useCallback((event: KeyboardEvent) => {
if ((event.metaKey || event.ctrlKey) && event.shiftKey && event.code === 'Enter') {
Expand Down Expand Up @@ -251,15 +250,15 @@ export function ProjectTableDemo() {
</FlexRow>
<DataTable
headerTextCase="upper"
getRows={ () => rows }
getRows={ view.getVisibleRows }
columns={ columns }
value={ tableState }
onValueChange={ setTableState }
dataTableFocusManager={ dataTableFocusManager }
showColumnsConfig
allowColumnsResizing
allowColumnsReordering
{ ...listProps }
{ ...view.getListProps() }
/>
</Panel>
);
Expand Down
12 changes: 9 additions & 3 deletions app/src/demo/tables/editableTable/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,18 @@ const findAllChildren = (tasks: Task[], parentTask: Task) => {

export const deleteTaskWithChildren = (tasks: Record<number, Task>, taskToDelete: Task | null): Record<number, Task> => {
const currentTasks = { ...tasks };
if (!taskToDelete) {
let taskToBeDeleted = taskToDelete;
if (taskToBeDeleted === undefined) {
const rootItems = Object.values(currentTasks).filter((task) => task.parentId === undefined);
taskToBeDeleted = rootItems[rootItems.length - 1];
}

if (!taskToBeDeleted) {
return currentTasks;
}

const childrenIds = findAllChildren(Object.values(currentTasks), taskToDelete);
[taskToDelete.id, ...childrenIds].forEach((id) => {
const childrenIds = findAllChildren(Object.values(currentTasks), taskToBeDeleted);
[taskToBeDeleted.id, ...childrenIds].forEach((id) => {
delete currentTasks[id];
});

Expand Down
6 changes: 3 additions & 3 deletions app/src/demo/tables/filteredTable/FilteredTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import {
} from '@epam/uui';
import { getFilters } from './filters';
import {
useLazyDataSource, useUuiContext, UuiContexts, useTableState, LazyDataSourceApiRequest, ITablePreset,
DataQueryFilter,
useUuiContext, UuiContexts, useTableState, LazyDataSourceApiRequest, ITablePreset,
DataQueryFilter, useLazyDataSource,
} from '@epam/uui-core';
import { FilteredTableFooter } from './FilteredTableFooter';
import { Person } from '@epam/uui-docs';
Expand Down Expand Up @@ -58,7 +58,7 @@ export function FilteredTable() {
return result;
}, [svc.api.demo]);

const dataSource = useLazyDataSource<Person, number, Person>(
const dataSource = useLazyDataSource<Person, number, DataQueryFilter<Person>>(
{
api: api,
selectAll: false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ import { FiltersBlock } from './FiltersBlock';
// import { ColumnsBlock } from './ColumnsBlock';
import { GroupingBlock } from './GroupingBlock';

export interface IFilterPanelProps<TFilter extends Record<string, any>> extends ITableState<TFilter> {
export interface IFilterPanelProps<TFilter> extends ITableState<TFilter> {
columns: DataColumnProps[];
filters: TableFiltersConfig<TFilter>[];
closePanel(): void;
}

function FilterPanel<TFilter = any>(props: IFilterPanelProps<TFilter>) {
function FilterPanel<TFilter extends { groupBy?: string[] } = any>(props: IFilterPanelProps<TFilter>) {
return (
<>
<FlexRow borderBottom size="48" padding="18">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import React from 'react';
import React, { Dispatch, SetStateAction } from 'react';
import { Accordion, PickerList } from '@epam/uui';
import { DataTableState } from '@epam/uui-core';
import { groupingsDataSource } from '../../groupings';

interface GroupingBlockProps<TFilter> {
tableState: DataTableState<TFilter>;
setTableState(newState: DataTableState<TFilter>): void;
setTableState: Dispatch<SetStateAction<DataTableState<TFilter, any>>>;
}

function GroupingBlock<TFilter extends { groupBy?: string[] }>({ tableState, setTableState }: GroupingBlockProps<TFilter>) {
Expand Down Expand Up @@ -33,4 +33,4 @@ function GroupingBlock<TFilter extends { groupBy?: string[] }>({ tableState, set
);
}

export default React.memo(GroupingBlock);
export default React.memo(GroupingBlock) as typeof GroupingBlock;
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ export function MasterDetailedTable() {
.addDefaults({
getType: ({ __typename }) => __typename,
getGroupBy: () => tableStateApi.tableState.filter?.groupBy,
complexIds: true,
backgroundReload: true,
fetchStrategy: 'parallel',
cascadeSelection: true,
Expand Down
2 changes: 1 addition & 1 deletion app/src/demo/tables/masterDetailedTable/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export type PersonFilters = {
PersonEmploymentGroup: DataQueryFilter<PersonEmploymentGroup>;
};

export type PersonTableFilter = DataQueryFilter<Person> & { groupBy?: GroupByLocation | GroupByEmployment | Array<GroupByLocation | GroupByEmployment> };
export type PersonTableFilter = DataQueryFilter<Person> & { groupBy?: Array<GroupByLocation | GroupByEmployment> };
export interface Grouping {
id: string;
name: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,9 @@ export class GroupingConfigBuilder<
LazyDataSourceProps<TGroupsWithMeta<TGroups, TId, TGroupBy>[TType], TId[TType], TFilter[TType]>['api']
>
) {
return this.entitiesConfig[this.defaultEntity].api(...apiArgs);
const [request, context] = apiArgs;
const response = await this.entitiesConfig[this.defaultEntity].api(request, context);
return this.getResultsWithMeta(response, context?.parent, []);
}

private getGroupByPathForParent(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ interface Props<TItem, TId> extends IEditable<DataSourceState> {
selectAll?: boolean;
getName?: (item: TItem) => string;
dataSource: IDataSource<TItem, TId, any>;
onValueChange: React.Dispatch<React.SetStateAction<DataSourceState<any, TId>>>;
}

export function DataSourceViewer<TItem, TId>(props: Props<TItem, TId>) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export default function LazyTreePickerModal() {
const handleModalOpening = useCallback(() => {
context.uuiModals
.show((props) => (
<PickerModal
<PickerModal<Location, string>
initialValue={ value }
dataSource={ dataSource }
selectionMode="multi"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ const personColumns: DataColumnProps<Person, number>[] = [
export default function WithTableExample() {
const { api } = useUuiContext();

const { tableState, setTableState } = useTableState({
const { tableState, setTableState } = useTableState<Person, any>({
columns: personColumns,
});

Expand Down
8 changes: 4 additions & 4 deletions app/src/docs/_examples/tables/ArrayTable.example.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { demoData, FeatureClass } from '@epam/uui-docs';
import css from './TablesExamples.module.scss';

export default function ArrayDataTableExample() {
const [value, onValueChange] = useState({});
const [dataSourceState, setDataSourceState] = useState({});

const dataSource = useArrayDataSource<FeatureClass, number, unknown>(
{
Expand All @@ -14,7 +14,7 @@ export default function ArrayDataTableExample() {
[],
);

const view = dataSource.useView(value, onValueChange, {});
const view = dataSource.useView(dataSourceState, setDataSourceState, {});

const productColumns: DataColumnProps<FeatureClass>[] = useMemo(
() => [
Expand Down Expand Up @@ -47,8 +47,8 @@ export default function ArrayDataTableExample() {
<DataTable
{ ...view.getListProps() }
getRows={ view.getVisibleRows }
value={ value }
onValueChange={ onValueChange }
value={ dataSourceState }
onValueChange={ setDataSourceState }
columns={ productColumns }
headerTextCase="upper"
/>
Expand Down
17 changes: 6 additions & 11 deletions app/src/docs/_examples/tables/ColumnsConfig.example.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useCallback, useEffect, useState, useMemo } from 'react';
import React, { useCallback, useState, useMemo, SetStateAction } from 'react';
import { DataTableState, DataColumnProps, useLazyDataSource, useUuiContext } from '@epam/uui-core';
import { Text, DataTable, Panel, IconButton } from '@epam/uui';
import { City } from '@epam/uui-docs';
Expand Down Expand Up @@ -91,17 +91,12 @@ export default function ColumnsConfigurationDataTableExample() {
[],
);

const handleTableStateChange = useCallback((newState: DataTableState) => {
const handleTableStateChange = useCallback((newState: SetStateAction<DataTableState>) => {
const updatedState = typeof newState === 'function' ? newState(tableState) : newState;
// Set columns config to localStorage
svc.uuiUserSettings.set(LOCAL_STORAGE_KEY, newState.columnsConfig || {});
setTableState(newState);
}, []);

useEffect(() => {
return () => {
citiesDS.unsubscribeView(handleTableStateChange);
};
}, []);
svc.uuiUserSettings.set(LOCAL_STORAGE_KEY, updatedState.columnsConfig || {});
setTableState(updatedState);
}, [svc.uuiUserSettings, tableState]);

const view = citiesDS.useView(tableState, handleTableStateChange, {
getRowOptions: useCallback(() => ({ checkbox: { isVisible: true } }), []),
Expand Down
Loading
Loading