tinybase 9.0.0 → 9.1.0-beta.1

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 (111) hide show
  1. package/@types/common/index.d.ts +17 -2
  2. package/@types/common/with-schemas/index.d.ts +18 -2
  3. package/@types/store/index.d.ts +37 -7
  4. package/@types/store/with-schemas/index.d.ts +38 -7
  5. package/@types/ui-react/index.d.ts +6 -2
  6. package/@types/ui-react/with-schemas/index.d.ts +7 -2
  7. package/@types/ui-react-dom/index.d.ts +10 -10
  8. package/@types/ui-react-dom/with-schemas/index.d.ts +10 -10
  9. package/@types/ui-react-dom-charts/index.d.ts +7 -7
  10. package/@types/ui-react-dom-charts/with-schemas/index.d.ts +7 -7
  11. package/@types/ui-react-inspector/index.d.ts +1 -1
  12. package/@types/ui-react-inspector/with-schemas/index.d.ts +1 -1
  13. package/@types/ui-solid/index.d.ts +9 -2
  14. package/@types/ui-solid/with-schemas/index.d.ts +10 -2
  15. package/@types/ui-solid-dom/index.d.ts +10 -10
  16. package/@types/ui-solid-dom/with-schemas/index.d.ts +10 -10
  17. package/@types/ui-solid-inspector/index.d.ts +1 -1
  18. package/@types/ui-solid-inspector/with-schemas/index.d.ts +1 -1
  19. package/@types/ui-svelte/index.d.ts +50 -2
  20. package/@types/ui-svelte/with-schemas/index.d.ts +88 -25
  21. package/@types/ui-svelte-dom/index.d.ts +10 -10
  22. package/@types/ui-svelte-dom/with-schemas/index.d.ts +10 -10
  23. package/@types/ui-svelte-inspector/index.d.ts +1 -1
  24. package/@types/ui-svelte-inspector/with-schemas/index.d.ts +1 -1
  25. package/index.js +34 -6
  26. package/mergeable-store/index.js +34 -6
  27. package/mergeable-store/with-schemas/index.js +34 -6
  28. package/min/index.js +1 -1
  29. package/min/index.js.gz +0 -0
  30. package/min/mergeable-store/index.js +1 -1
  31. package/min/mergeable-store/index.js.gz +0 -0
  32. package/min/mergeable-store/with-schemas/index.js +1 -1
  33. package/min/mergeable-store/with-schemas/index.js.gz +0 -0
  34. package/min/omni/index.js +1 -1
  35. package/min/omni/index.js.gz +0 -0
  36. package/min/omni/with-schemas/index.js +1 -1
  37. package/min/omni/with-schemas/index.js.gz +0 -0
  38. package/min/store/index.js +1 -1
  39. package/min/store/index.js.gz +0 -0
  40. package/min/store/with-schemas/index.js +1 -1
  41. package/min/store/with-schemas/index.js.gz +0 -0
  42. package/min/ui-react/index.js +1 -1
  43. package/min/ui-react/index.js.gz +0 -0
  44. package/min/ui-react/with-schemas/index.js +1 -1
  45. package/min/ui-react/with-schemas/index.js.gz +0 -0
  46. package/min/ui-react-dom/index.js +1 -1
  47. package/min/ui-react-dom/index.js.gz +0 -0
  48. package/min/ui-react-dom/with-schemas/index.js +1 -1
  49. package/min/ui-react-dom/with-schemas/index.js.gz +0 -0
  50. package/min/ui-react-dom-charts/index.js +1 -1
  51. package/min/ui-react-dom-charts/index.js.gz +0 -0
  52. package/min/ui-react-dom-charts/with-schemas/index.js +1 -1
  53. package/min/ui-react-dom-charts/with-schemas/index.js.gz +0 -0
  54. package/min/ui-react-inspector/index.js +1 -1
  55. package/min/ui-react-inspector/index.js.gz +0 -0
  56. package/min/ui-react-inspector/with-schemas/index.js +1 -1
  57. package/min/ui-react-inspector/with-schemas/index.js.gz +0 -0
  58. package/min/ui-solid/index.js +1 -1
  59. package/min/ui-solid/index.js.gz +0 -0
  60. package/min/ui-solid/with-schemas/index.js +1 -1
  61. package/min/ui-solid/with-schemas/index.js.gz +0 -0
  62. package/min/ui-solid-dom/index.js +1 -1
  63. package/min/ui-solid-dom/index.js.gz +0 -0
  64. package/min/ui-solid-dom/with-schemas/index.js +1 -1
  65. package/min/ui-solid-dom/with-schemas/index.js.gz +0 -0
  66. package/min/ui-solid-inspector/index.js +1 -1
  67. package/min/ui-solid-inspector/index.js.gz +0 -0
  68. package/min/ui-solid-inspector/with-schemas/index.js +1 -1
  69. package/min/ui-solid-inspector/with-schemas/index.js.gz +0 -0
  70. package/min/ui-svelte/index.js +1 -1
  71. package/min/ui-svelte/index.js.gz +0 -0
  72. package/min/ui-svelte/with-schemas/index.js +1 -1
  73. package/min/ui-svelte/with-schemas/index.js.gz +0 -0
  74. package/min/ui-svelte-dom/index.js +1 -1
  75. package/min/ui-svelte-dom/index.js.gz +0 -0
  76. package/min/ui-svelte-dom/with-schemas/index.js +1 -1
  77. package/min/ui-svelte-dom/with-schemas/index.js.gz +0 -0
  78. package/min/ui-svelte-inspector/index.js +1 -1
  79. package/min/ui-svelte-inspector/index.js.gz +0 -0
  80. package/min/ui-svelte-inspector/with-schemas/index.js +1 -1
  81. package/min/ui-svelte-inspector/with-schemas/index.js.gz +0 -0
  82. package/min/with-schemas/index.js +1 -1
  83. package/min/with-schemas/index.js.gz +0 -0
  84. package/omni/index.js +34 -6
  85. package/omni/with-schemas/index.js +34 -6
  86. package/package.json +3 -3
  87. package/readme.md +14 -14
  88. package/releases.md +59 -59
  89. package/store/index.js +34 -6
  90. package/store/with-schemas/index.js +34 -6
  91. package/ui-react/index.js +36 -6
  92. package/ui-react/with-schemas/index.js +36 -6
  93. package/ui-react-dom/index.js +24 -4
  94. package/ui-react-dom/with-schemas/index.js +24 -4
  95. package/ui-react-dom-charts/index.js +24 -4
  96. package/ui-react-dom-charts/with-schemas/index.js +24 -4
  97. package/ui-react-inspector/index.js +58 -10
  98. package/ui-react-inspector/with-schemas/index.js +58 -10
  99. package/ui-solid/index.js +32 -2
  100. package/ui-solid/with-schemas/index.js +32 -2
  101. package/ui-solid-dom/index.js +17 -1
  102. package/ui-solid-dom/with-schemas/index.js +17 -1
  103. package/ui-solid-inspector/index.js +51 -7
  104. package/ui-solid-inspector/with-schemas/index.js +51 -7
  105. package/ui-svelte/index.js +73 -31
  106. package/ui-svelte/with-schemas/index.js +73 -31
  107. package/ui-svelte-dom/index.js +35 -14
  108. package/ui-svelte-dom/with-schemas/index.js +35 -14
  109. package/ui-svelte-inspector/index.js +69 -20
  110. package/ui-svelte-inspector/with-schemas/index.js +69 -20
  111. package/with-schemas/index.js +34 -6
@@ -2117,13 +2117,36 @@ const createStore = () => {
2117
2117
  listener,
2118
2118
  mutator,
2119
2119
  ) => {
2120
- let sortedRowIds = getSortedRowIds(tableId, cellId, ...otherArgs);
2120
+ const [descending, offset, limit, sorter] = otherArgs;
2121
+ let sortedRowIds = getSortedRowIds(
2122
+ tableId,
2123
+ cellId,
2124
+ descending,
2125
+ offset,
2126
+ limit,
2127
+ sorter,
2128
+ );
2121
2129
  return addListener(
2122
2130
  () => {
2123
- const newSortedRowIds = getSortedRowIds(tableId, cellId, ...otherArgs);
2131
+ const newSortedRowIds = getSortedRowIds(
2132
+ tableId,
2133
+ cellId,
2134
+ descending,
2135
+ offset,
2136
+ limit,
2137
+ sorter,
2138
+ );
2124
2139
  if (!arrayIsEqual(newSortedRowIds, sortedRowIds)) {
2125
2140
  sortedRowIds = newSortedRowIds;
2126
- listener(store, tableId, cellId, ...otherArgs, sortedRowIds);
2141
+ listener(
2142
+ store,
2143
+ tableId,
2144
+ cellId,
2145
+ descending,
2146
+ offset,
2147
+ limit,
2148
+ sortedRowIds,
2149
+ );
2127
2150
  }
2128
2151
  },
2129
2152
  sortedRowIdsListeners[mutator ? 1 : 0],
@@ -2177,6 +2200,7 @@ const createStore = () => {
2177
2200
  descending,
2178
2201
  offset = 0,
2179
2202
  limit,
2203
+ sorter = defaultSorter,
2180
2204
  ) =>
2181
2205
  isObject(tableIdOrArgs)
2182
2206
  ? getSortedRowIds(
@@ -2185,16 +2209,19 @@ const createStore = () => {
2185
2209
  tableIdOrArgs.descending,
2186
2210
  tableIdOrArgs.offset,
2187
2211
  tableIdOrArgs.limit,
2212
+ tableIdOrArgs.sorter,
2188
2213
  )
2189
2214
  : arrayMap(
2190
2215
  slice(
2191
2216
  arraySort(
2192
2217
  mapMap(mapGet(tablesMap, id(tableIdOrArgs)), (row, rowId) => [
2193
- isUndefined(cellId) ? rowId : mapGet(row, id(cellId)),
2218
+ isUndefined(cellId)
2219
+ ? rowId
2220
+ : decodeIfJson(mapGet(row, id(cellId))),
2194
2221
  rowId,
2195
2222
  ]),
2196
2223
  ([cell1], [cell2]) =>
2197
- defaultSorter(cell1, cell2) * (descending ? -1 : 1),
2224
+ sorter(cell1, cell2) * (descending ? -1 : 1),
2198
2225
  ),
2199
2226
  offset,
2200
2227
  isUndefined(limit) ? limit : offset + limit,
@@ -2672,6 +2699,7 @@ const createStore = () => {
2672
2699
  tableIdOrArgs.descending ?? false,
2673
2700
  tableIdOrArgs.offset ?? 0,
2674
2701
  tableIdOrArgs.limit,
2702
+ tableIdOrArgs.sorter,
2675
2703
  ],
2676
2704
  cellIdOrListener,
2677
2705
  descendingOrMutator,
@@ -2679,7 +2707,7 @@ const createStore = () => {
2679
2707
  : addSortedRowIdsListenerImpl(
2680
2708
  tableIdOrArgs,
2681
2709
  cellIdOrListener,
2682
- [descendingOrMutator, offset, limit],
2710
+ [descendingOrMutator, offset, limit, void 0],
2683
2711
  listener,
2684
2712
  mutator,
2685
2713
  );
@@ -3153,14 +3181,29 @@ const useSortedRowIdsImpl = (
3153
3181
  descending,
3154
3182
  offset,
3155
3183
  limit,
3184
+ sorter,
3156
3185
  storeOrStoreId,
3157
- ) =>
3158
- useListenable(
3186
+ ) => {
3187
+ const sortedRowIdsArgs = useMemo(
3188
+ () => ({
3189
+ tableId,
3190
+ cellId,
3191
+ descending: descending ?? false,
3192
+ offset: offset ?? 0,
3193
+ limit,
3194
+ sorter,
3195
+ }),
3196
+ [tableId, cellId, descending, offset, limit, sorter],
3197
+ );
3198
+ return useListenable(
3159
3199
  SORTED_ROW_IDS,
3160
3200
  useStoreOrStoreById(storeOrStoreId),
3161
3201
  1 /* Array */,
3162
- [tableId, cellId, descending, offset, limit],
3202
+ isUndefined(sorter)
3203
+ ? [tableId, cellId, descending, offset, limit]
3204
+ : [sortedRowIdsArgs],
3163
3205
  );
3206
+ };
3164
3207
  const useStoreOrStoreById = (storeOrStoreId) =>
3165
3208
  useThingOrThingById(storeOrStoreId, OFFSET_STORE);
3166
3209
  const useHasTables = (storeOrStoreId) =>
@@ -3194,6 +3237,7 @@ const useSortedRowIds = (
3194
3237
  descending,
3195
3238
  offset,
3196
3239
  limit,
3240
+ sorterOrStoreOrStoreId,
3197
3241
  storeOrStoreId,
3198
3242
  ) =>
3199
3243
  useSortedRowIdsImpl(
@@ -3204,6 +3248,7 @@ const useSortedRowIds = (
3204
3248
  tableIdOrArgs.descending ?? false,
3205
3249
  tableIdOrArgs.offset ?? 0,
3206
3250
  tableIdOrArgs.limit,
3251
+ tableIdOrArgs.sorter,
3207
3252
  cellIdOrStoreOrStoreId,
3208
3253
  ]
3209
3254
  : [
@@ -3212,7 +3257,10 @@ const useSortedRowIds = (
3212
3257
  descending,
3213
3258
  offset,
3214
3259
  limit,
3215
- storeOrStoreId,
3260
+ isFunction(sorterOrStoreOrStoreId) ? sorterOrStoreOrStoreId : void 0,
3261
+ isFunction(sorterOrStoreOrStoreId)
3262
+ ? storeOrStoreId
3263
+ : sorterOrStoreOrStoreId,
3216
3264
  ]),
3217
3265
  );
3218
3266
  const useCell = (tableId, rowId, cellId, storeOrStoreId) =>
@@ -2117,13 +2117,36 @@ const createStore = () => {
2117
2117
  listener,
2118
2118
  mutator,
2119
2119
  ) => {
2120
- let sortedRowIds = getSortedRowIds(tableId, cellId, ...otherArgs);
2120
+ const [descending, offset, limit, sorter] = otherArgs;
2121
+ let sortedRowIds = getSortedRowIds(
2122
+ tableId,
2123
+ cellId,
2124
+ descending,
2125
+ offset,
2126
+ limit,
2127
+ sorter,
2128
+ );
2121
2129
  return addListener(
2122
2130
  () => {
2123
- const newSortedRowIds = getSortedRowIds(tableId, cellId, ...otherArgs);
2131
+ const newSortedRowIds = getSortedRowIds(
2132
+ tableId,
2133
+ cellId,
2134
+ descending,
2135
+ offset,
2136
+ limit,
2137
+ sorter,
2138
+ );
2124
2139
  if (!arrayIsEqual(newSortedRowIds, sortedRowIds)) {
2125
2140
  sortedRowIds = newSortedRowIds;
2126
- listener(store, tableId, cellId, ...otherArgs, sortedRowIds);
2141
+ listener(
2142
+ store,
2143
+ tableId,
2144
+ cellId,
2145
+ descending,
2146
+ offset,
2147
+ limit,
2148
+ sortedRowIds,
2149
+ );
2127
2150
  }
2128
2151
  },
2129
2152
  sortedRowIdsListeners[mutator ? 1 : 0],
@@ -2177,6 +2200,7 @@ const createStore = () => {
2177
2200
  descending,
2178
2201
  offset = 0,
2179
2202
  limit,
2203
+ sorter = defaultSorter,
2180
2204
  ) =>
2181
2205
  isObject(tableIdOrArgs)
2182
2206
  ? getSortedRowIds(
@@ -2185,16 +2209,19 @@ const createStore = () => {
2185
2209
  tableIdOrArgs.descending,
2186
2210
  tableIdOrArgs.offset,
2187
2211
  tableIdOrArgs.limit,
2212
+ tableIdOrArgs.sorter,
2188
2213
  )
2189
2214
  : arrayMap(
2190
2215
  slice(
2191
2216
  arraySort(
2192
2217
  mapMap(mapGet(tablesMap, id(tableIdOrArgs)), (row, rowId) => [
2193
- isUndefined(cellId) ? rowId : mapGet(row, id(cellId)),
2218
+ isUndefined(cellId)
2219
+ ? rowId
2220
+ : decodeIfJson(mapGet(row, id(cellId))),
2194
2221
  rowId,
2195
2222
  ]),
2196
2223
  ([cell1], [cell2]) =>
2197
- defaultSorter(cell1, cell2) * (descending ? -1 : 1),
2224
+ sorter(cell1, cell2) * (descending ? -1 : 1),
2198
2225
  ),
2199
2226
  offset,
2200
2227
  isUndefined(limit) ? limit : offset + limit,
@@ -2672,6 +2699,7 @@ const createStore = () => {
2672
2699
  tableIdOrArgs.descending ?? false,
2673
2700
  tableIdOrArgs.offset ?? 0,
2674
2701
  tableIdOrArgs.limit,
2702
+ tableIdOrArgs.sorter,
2675
2703
  ],
2676
2704
  cellIdOrListener,
2677
2705
  descendingOrMutator,
@@ -2679,7 +2707,7 @@ const createStore = () => {
2679
2707
  : addSortedRowIdsListenerImpl(
2680
2708
  tableIdOrArgs,
2681
2709
  cellIdOrListener,
2682
- [descendingOrMutator, offset, limit],
2710
+ [descendingOrMutator, offset, limit, void 0],
2683
2711
  listener,
2684
2712
  mutator,
2685
2713
  );
@@ -3153,14 +3181,29 @@ const useSortedRowIdsImpl = (
3153
3181
  descending,
3154
3182
  offset,
3155
3183
  limit,
3184
+ sorter,
3156
3185
  storeOrStoreId,
3157
- ) =>
3158
- useListenable(
3186
+ ) => {
3187
+ const sortedRowIdsArgs = useMemo(
3188
+ () => ({
3189
+ tableId,
3190
+ cellId,
3191
+ descending: descending ?? false,
3192
+ offset: offset ?? 0,
3193
+ limit,
3194
+ sorter,
3195
+ }),
3196
+ [tableId, cellId, descending, offset, limit, sorter],
3197
+ );
3198
+ return useListenable(
3159
3199
  SORTED_ROW_IDS,
3160
3200
  useStoreOrStoreById(storeOrStoreId),
3161
3201
  1 /* Array */,
3162
- [tableId, cellId, descending, offset, limit],
3202
+ isUndefined(sorter)
3203
+ ? [tableId, cellId, descending, offset, limit]
3204
+ : [sortedRowIdsArgs],
3163
3205
  );
3206
+ };
3164
3207
  const useStoreOrStoreById = (storeOrStoreId) =>
3165
3208
  useThingOrThingById(storeOrStoreId, OFFSET_STORE);
3166
3209
  const useHasTables = (storeOrStoreId) =>
@@ -3194,6 +3237,7 @@ const useSortedRowIds = (
3194
3237
  descending,
3195
3238
  offset,
3196
3239
  limit,
3240
+ sorterOrStoreOrStoreId,
3197
3241
  storeOrStoreId,
3198
3242
  ) =>
3199
3243
  useSortedRowIdsImpl(
@@ -3204,6 +3248,7 @@ const useSortedRowIds = (
3204
3248
  tableIdOrArgs.descending ?? false,
3205
3249
  tableIdOrArgs.offset ?? 0,
3206
3250
  tableIdOrArgs.limit,
3251
+ tableIdOrArgs.sorter,
3207
3252
  cellIdOrStoreOrStoreId,
3208
3253
  ]
3209
3254
  : [
@@ -3212,7 +3257,10 @@ const useSortedRowIds = (
3212
3257
  descending,
3213
3258
  offset,
3214
3259
  limit,
3215
- storeOrStoreId,
3260
+ isFunction(sorterOrStoreOrStoreId) ? sorterOrStoreOrStoreId : void 0,
3261
+ isFunction(sorterOrStoreOrStoreId)
3262
+ ? storeOrStoreId
3263
+ : sorterOrStoreOrStoreId,
3216
3264
  ]),
3217
3265
  );
3218
3266
  const useCell = (tableId, rowId, cellId, storeOrStoreId) =>
package/ui-solid/index.js CHANGED
@@ -467,13 +467,25 @@ const useSortedRowIdsImpl = (
467
467
  descending,
468
468
  offset,
469
469
  limit,
470
+ sorter,
470
471
  storeOrStoreId,
471
472
  ) =>
472
473
  useListenable(
473
474
  SORTED_ROW_IDS,
474
475
  useStoreOrStoreById(storeOrStoreId),
475
476
  1 /* Array */,
476
- [tableId, cellId, descending, offset, limit],
477
+ isUndefined(sorter)
478
+ ? [tableId, cellId, descending, offset, limit]
479
+ : [
480
+ () => ({
481
+ tableId: getThing(tableId),
482
+ cellId: getThing(cellId),
483
+ descending: getThing(descending) ?? false,
484
+ offset: getThing(offset) ?? 0,
485
+ limit: getThing(limit),
486
+ sorter: getThing(sorter),
487
+ }),
488
+ ],
477
489
  );
478
490
  const useSortedRowIdsListenerImpl = (
479
491
  tableId,
@@ -481,6 +493,7 @@ const useSortedRowIdsListenerImpl = (
481
493
  descending,
482
494
  offset,
483
495
  limit,
496
+ sorter,
484
497
  listener,
485
498
  mutator,
486
499
  storeOrStoreId,
@@ -489,7 +502,18 @@ const useSortedRowIdsListenerImpl = (
489
502
  SORTED_ROW_IDS,
490
503
  useStoreOrStoreById(storeOrStoreId),
491
504
  listener,
492
- [tableId, cellId, descending, offset, limit],
505
+ isUndefined(sorter)
506
+ ? [tableId, cellId, descending, offset, limit]
507
+ : [
508
+ () => ({
509
+ tableId: getThing(tableId),
510
+ cellId: getThing(cellId),
511
+ descending: getThing(descending),
512
+ offset: getThing(offset),
513
+ limit: getThing(limit),
514
+ sorter: getThing(sorter),
515
+ }),
516
+ ],
493
517
  mutator,
494
518
  );
495
519
  const useCreateStore = (create) => {
@@ -565,6 +589,7 @@ const useSortedRowIds = (
565
589
  descending,
566
590
  offset,
567
591
  limit,
592
+ sorter,
568
593
  storeOrStoreId,
569
594
  ) =>
570
595
  isObject(tableIdOrArgs)
@@ -574,6 +599,7 @@ const useSortedRowIds = (
574
599
  tableIdOrArgs.descending ?? false,
575
600
  tableIdOrArgs.offset ?? 0,
576
601
  tableIdOrArgs.limit,
602
+ () => tableIdOrArgs.sorter,
577
603
  cellIdOrStoreOrStoreId,
578
604
  )
579
605
  : useSortedRowIdsImpl(
@@ -582,6 +608,7 @@ const useSortedRowIds = (
582
608
  descending,
583
609
  offset,
584
610
  limit,
611
+ isUndefined(sorter) ? void 0 : () => sorter,
585
612
  storeOrStoreId,
586
613
  );
587
614
  const useHasRow = (tableId, rowId, storeOrStoreId) =>
@@ -830,6 +857,7 @@ const useSortedRowIdsListener = (
830
857
  tableIdOrArgs.descending ?? false,
831
858
  tableIdOrArgs.offset ?? 0,
832
859
  tableIdOrArgs.limit,
860
+ () => tableIdOrArgs.sorter,
833
861
  cellIdOrListener,
834
862
  descendingOrMutator,
835
863
  offsetOrStoreOrStoreId,
@@ -840,6 +868,7 @@ const useSortedRowIdsListener = (
840
868
  descendingOrMutator ?? false,
841
869
  offsetOrStoreOrStoreId ?? 0,
842
870
  limit,
871
+ void 0,
843
872
  listener,
844
873
  mutator,
845
874
  storeOrStoreId,
@@ -1985,6 +2014,7 @@ const SortedTableView = (props) =>
1985
2014
  () => props.descending,
1986
2015
  () => props.offset,
1987
2016
  () => props.limit,
2017
+ void 0,
1988
2018
  () => props.store,
1989
2019
  ),
1990
2020
  );
@@ -467,13 +467,25 @@ const useSortedRowIdsImpl = (
467
467
  descending,
468
468
  offset,
469
469
  limit,
470
+ sorter,
470
471
  storeOrStoreId,
471
472
  ) =>
472
473
  useListenable(
473
474
  SORTED_ROW_IDS,
474
475
  useStoreOrStoreById(storeOrStoreId),
475
476
  1 /* Array */,
476
- [tableId, cellId, descending, offset, limit],
477
+ isUndefined(sorter)
478
+ ? [tableId, cellId, descending, offset, limit]
479
+ : [
480
+ () => ({
481
+ tableId: getThing(tableId),
482
+ cellId: getThing(cellId),
483
+ descending: getThing(descending) ?? false,
484
+ offset: getThing(offset) ?? 0,
485
+ limit: getThing(limit),
486
+ sorter: getThing(sorter),
487
+ }),
488
+ ],
477
489
  );
478
490
  const useSortedRowIdsListenerImpl = (
479
491
  tableId,
@@ -481,6 +493,7 @@ const useSortedRowIdsListenerImpl = (
481
493
  descending,
482
494
  offset,
483
495
  limit,
496
+ sorter,
484
497
  listener,
485
498
  mutator,
486
499
  storeOrStoreId,
@@ -489,7 +502,18 @@ const useSortedRowIdsListenerImpl = (
489
502
  SORTED_ROW_IDS,
490
503
  useStoreOrStoreById(storeOrStoreId),
491
504
  listener,
492
- [tableId, cellId, descending, offset, limit],
505
+ isUndefined(sorter)
506
+ ? [tableId, cellId, descending, offset, limit]
507
+ : [
508
+ () => ({
509
+ tableId: getThing(tableId),
510
+ cellId: getThing(cellId),
511
+ descending: getThing(descending),
512
+ offset: getThing(offset),
513
+ limit: getThing(limit),
514
+ sorter: getThing(sorter),
515
+ }),
516
+ ],
493
517
  mutator,
494
518
  );
495
519
  const useCreateStore = (create) => {
@@ -565,6 +589,7 @@ const useSortedRowIds = (
565
589
  descending,
566
590
  offset,
567
591
  limit,
592
+ sorter,
568
593
  storeOrStoreId,
569
594
  ) =>
570
595
  isObject(tableIdOrArgs)
@@ -574,6 +599,7 @@ const useSortedRowIds = (
574
599
  tableIdOrArgs.descending ?? false,
575
600
  tableIdOrArgs.offset ?? 0,
576
601
  tableIdOrArgs.limit,
602
+ () => tableIdOrArgs.sorter,
577
603
  cellIdOrStoreOrStoreId,
578
604
  )
579
605
  : useSortedRowIdsImpl(
@@ -582,6 +608,7 @@ const useSortedRowIds = (
582
608
  descending,
583
609
  offset,
584
610
  limit,
611
+ isUndefined(sorter) ? void 0 : () => sorter,
585
612
  storeOrStoreId,
586
613
  );
587
614
  const useHasRow = (tableId, rowId, storeOrStoreId) =>
@@ -830,6 +857,7 @@ const useSortedRowIdsListener = (
830
857
  tableIdOrArgs.descending ?? false,
831
858
  tableIdOrArgs.offset ?? 0,
832
859
  tableIdOrArgs.limit,
860
+ () => tableIdOrArgs.sorter,
833
861
  cellIdOrListener,
834
862
  descendingOrMutator,
835
863
  offsetOrStoreOrStoreId,
@@ -840,6 +868,7 @@ const useSortedRowIdsListener = (
840
868
  descendingOrMutator ?? false,
841
869
  offsetOrStoreOrStoreId ?? 0,
842
870
  limit,
871
+ void 0,
843
872
  listener,
844
873
  mutator,
845
874
  storeOrStoreId,
@@ -1985,6 +2014,7 @@ const SortedTableView = (props) =>
1985
2014
  () => props.descending,
1986
2015
  () => props.offset,
1987
2016
  () => props.limit,
2017
+ void 0,
1988
2018
  () => props.store,
1989
2019
  ),
1990
2020
  );
@@ -300,13 +300,25 @@ const useSortedRowIdsImpl = (
300
300
  descending,
301
301
  offset,
302
302
  limit,
303
+ sorter,
303
304
  storeOrStoreId,
304
305
  ) =>
305
306
  useListenable(
306
307
  SORTED_ROW_IDS,
307
308
  useStoreOrStoreById(storeOrStoreId),
308
309
  1 /* Array */,
309
- [tableId, cellId, descending, offset, limit],
310
+ isUndefined(sorter)
311
+ ? [tableId, cellId, descending, offset, limit]
312
+ : [
313
+ () => ({
314
+ tableId: getThing(tableId),
315
+ cellId: getThing(cellId),
316
+ descending: getThing(descending) ?? false,
317
+ offset: getThing(offset) ?? 0,
318
+ limit: getThing(limit),
319
+ sorter: getThing(sorter),
320
+ }),
321
+ ],
310
322
  );
311
323
  const useStoreOrStoreById = (storeOrStoreId) =>
312
324
  useThingOrThingById(storeOrStoreId, OFFSET_STORE);
@@ -334,6 +346,7 @@ const useSortedRowIds = (
334
346
  descending,
335
347
  offset,
336
348
  limit,
349
+ sorter,
337
350
  storeOrStoreId,
338
351
  ) =>
339
352
  isObject(tableIdOrArgs)
@@ -343,6 +356,7 @@ const useSortedRowIds = (
343
356
  tableIdOrArgs.descending ?? false,
344
357
  tableIdOrArgs.offset ?? 0,
345
358
  tableIdOrArgs.limit,
359
+ () => tableIdOrArgs.sorter,
346
360
  cellIdOrStoreOrStoreId,
347
361
  )
348
362
  : useSortedRowIdsImpl(
@@ -351,6 +365,7 @@ const useSortedRowIds = (
351
365
  descending,
352
366
  offset,
353
367
  limit,
368
+ isUndefined(sorter) ? void 0 : () => sorter,
354
369
  storeOrStoreId,
355
370
  );
356
371
  const useCell = (tableId, rowId, cellId, storeOrStoreId) =>
@@ -1420,6 +1435,7 @@ const SortedTableInHtmlTable = (props) => {
1420
1435
  () => sortAndOffset()[1],
1421
1436
  () => sortAndOffset()[2],
1422
1437
  () => props.limit,
1438
+ void 0,
1423
1439
  () => props.store,
1424
1440
  ),
1425
1441
  props.extraCellsBefore,
@@ -300,13 +300,25 @@ const useSortedRowIdsImpl = (
300
300
  descending,
301
301
  offset,
302
302
  limit,
303
+ sorter,
303
304
  storeOrStoreId,
304
305
  ) =>
305
306
  useListenable(
306
307
  SORTED_ROW_IDS,
307
308
  useStoreOrStoreById(storeOrStoreId),
308
309
  1 /* Array */,
309
- [tableId, cellId, descending, offset, limit],
310
+ isUndefined(sorter)
311
+ ? [tableId, cellId, descending, offset, limit]
312
+ : [
313
+ () => ({
314
+ tableId: getThing(tableId),
315
+ cellId: getThing(cellId),
316
+ descending: getThing(descending) ?? false,
317
+ offset: getThing(offset) ?? 0,
318
+ limit: getThing(limit),
319
+ sorter: getThing(sorter),
320
+ }),
321
+ ],
310
322
  );
311
323
  const useStoreOrStoreById = (storeOrStoreId) =>
312
324
  useThingOrThingById(storeOrStoreId, OFFSET_STORE);
@@ -334,6 +346,7 @@ const useSortedRowIds = (
334
346
  descending,
335
347
  offset,
336
348
  limit,
349
+ sorter,
337
350
  storeOrStoreId,
338
351
  ) =>
339
352
  isObject(tableIdOrArgs)
@@ -343,6 +356,7 @@ const useSortedRowIds = (
343
356
  tableIdOrArgs.descending ?? false,
344
357
  tableIdOrArgs.offset ?? 0,
345
358
  tableIdOrArgs.limit,
359
+ () => tableIdOrArgs.sorter,
346
360
  cellIdOrStoreOrStoreId,
347
361
  )
348
362
  : useSortedRowIdsImpl(
@@ -351,6 +365,7 @@ const useSortedRowIds = (
351
365
  descending,
352
366
  offset,
353
367
  limit,
368
+ isUndefined(sorter) ? void 0 : () => sorter,
354
369
  storeOrStoreId,
355
370
  );
356
371
  const useCell = (tableId, rowId, cellId, storeOrStoreId) =>
@@ -1420,6 +1435,7 @@ const SortedTableInHtmlTable = (props) => {
1420
1435
  () => sortAndOffset()[1],
1421
1436
  () => sortAndOffset()[2],
1422
1437
  () => props.limit,
1438
+ void 0,
1423
1439
  () => props.store,
1424
1440
  ),
1425
1441
  props.extraCellsBefore,