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.
- package/@types/common/index.d.ts +17 -2
- package/@types/common/with-schemas/index.d.ts +18 -2
- package/@types/store/index.d.ts +37 -7
- package/@types/store/with-schemas/index.d.ts +38 -7
- package/@types/ui-react/index.d.ts +6 -2
- package/@types/ui-react/with-schemas/index.d.ts +7 -2
- package/@types/ui-react-dom/index.d.ts +10 -10
- package/@types/ui-react-dom/with-schemas/index.d.ts +10 -10
- package/@types/ui-react-dom-charts/index.d.ts +7 -7
- package/@types/ui-react-dom-charts/with-schemas/index.d.ts +7 -7
- package/@types/ui-react-inspector/index.d.ts +1 -1
- package/@types/ui-react-inspector/with-schemas/index.d.ts +1 -1
- package/@types/ui-solid/index.d.ts +9 -2
- package/@types/ui-solid/with-schemas/index.d.ts +10 -2
- package/@types/ui-solid-dom/index.d.ts +10 -10
- package/@types/ui-solid-dom/with-schemas/index.d.ts +10 -10
- package/@types/ui-solid-inspector/index.d.ts +1 -1
- package/@types/ui-solid-inspector/with-schemas/index.d.ts +1 -1
- package/@types/ui-svelte/index.d.ts +50 -2
- package/@types/ui-svelte/with-schemas/index.d.ts +88 -25
- package/@types/ui-svelte-dom/index.d.ts +10 -10
- package/@types/ui-svelte-dom/with-schemas/index.d.ts +10 -10
- package/@types/ui-svelte-inspector/index.d.ts +1 -1
- package/@types/ui-svelte-inspector/with-schemas/index.d.ts +1 -1
- package/index.js +34 -6
- package/mergeable-store/index.js +34 -6
- package/mergeable-store/with-schemas/index.js +34 -6
- package/min/index.js +1 -1
- package/min/index.js.gz +0 -0
- package/min/mergeable-store/index.js +1 -1
- package/min/mergeable-store/index.js.gz +0 -0
- package/min/mergeable-store/with-schemas/index.js +1 -1
- package/min/mergeable-store/with-schemas/index.js.gz +0 -0
- package/min/omni/index.js +1 -1
- package/min/omni/index.js.gz +0 -0
- package/min/omni/with-schemas/index.js +1 -1
- package/min/omni/with-schemas/index.js.gz +0 -0
- package/min/store/index.js +1 -1
- package/min/store/index.js.gz +0 -0
- package/min/store/with-schemas/index.js +1 -1
- package/min/store/with-schemas/index.js.gz +0 -0
- package/min/ui-react/index.js +1 -1
- package/min/ui-react/index.js.gz +0 -0
- package/min/ui-react/with-schemas/index.js +1 -1
- package/min/ui-react/with-schemas/index.js.gz +0 -0
- package/min/ui-react-dom/index.js +1 -1
- package/min/ui-react-dom/index.js.gz +0 -0
- package/min/ui-react-dom/with-schemas/index.js +1 -1
- package/min/ui-react-dom/with-schemas/index.js.gz +0 -0
- package/min/ui-react-dom-charts/index.js +1 -1
- package/min/ui-react-dom-charts/index.js.gz +0 -0
- package/min/ui-react-dom-charts/with-schemas/index.js +1 -1
- package/min/ui-react-dom-charts/with-schemas/index.js.gz +0 -0
- package/min/ui-react-inspector/index.js +1 -1
- package/min/ui-react-inspector/index.js.gz +0 -0
- package/min/ui-react-inspector/with-schemas/index.js +1 -1
- package/min/ui-react-inspector/with-schemas/index.js.gz +0 -0
- package/min/ui-solid/index.js +1 -1
- package/min/ui-solid/index.js.gz +0 -0
- package/min/ui-solid/with-schemas/index.js +1 -1
- package/min/ui-solid/with-schemas/index.js.gz +0 -0
- package/min/ui-solid-dom/index.js +1 -1
- package/min/ui-solid-dom/index.js.gz +0 -0
- package/min/ui-solid-dom/with-schemas/index.js +1 -1
- package/min/ui-solid-dom/with-schemas/index.js.gz +0 -0
- package/min/ui-solid-inspector/index.js +1 -1
- package/min/ui-solid-inspector/index.js.gz +0 -0
- package/min/ui-solid-inspector/with-schemas/index.js +1 -1
- package/min/ui-solid-inspector/with-schemas/index.js.gz +0 -0
- package/min/ui-svelte/index.js +1 -1
- package/min/ui-svelte/index.js.gz +0 -0
- package/min/ui-svelte/with-schemas/index.js +1 -1
- package/min/ui-svelte/with-schemas/index.js.gz +0 -0
- package/min/ui-svelte-dom/index.js +1 -1
- package/min/ui-svelte-dom/index.js.gz +0 -0
- package/min/ui-svelte-dom/with-schemas/index.js +1 -1
- package/min/ui-svelte-dom/with-schemas/index.js.gz +0 -0
- package/min/ui-svelte-inspector/index.js +1 -1
- package/min/ui-svelte-inspector/index.js.gz +0 -0
- package/min/ui-svelte-inspector/with-schemas/index.js +1 -1
- package/min/ui-svelte-inspector/with-schemas/index.js.gz +0 -0
- package/min/with-schemas/index.js +1 -1
- package/min/with-schemas/index.js.gz +0 -0
- package/omni/index.js +34 -6
- package/omni/with-schemas/index.js +34 -6
- package/package.json +3 -3
- package/readme.md +14 -14
- package/releases.md +59 -59
- package/store/index.js +34 -6
- package/store/with-schemas/index.js +34 -6
- package/ui-react/index.js +36 -6
- package/ui-react/with-schemas/index.js +36 -6
- package/ui-react-dom/index.js +24 -4
- package/ui-react-dom/with-schemas/index.js +24 -4
- package/ui-react-dom-charts/index.js +24 -4
- package/ui-react-dom-charts/with-schemas/index.js +24 -4
- package/ui-react-inspector/index.js +58 -10
- package/ui-react-inspector/with-schemas/index.js +58 -10
- package/ui-solid/index.js +32 -2
- package/ui-solid/with-schemas/index.js +32 -2
- package/ui-solid-dom/index.js +17 -1
- package/ui-solid-dom/with-schemas/index.js +17 -1
- package/ui-solid-inspector/index.js +51 -7
- package/ui-solid-inspector/with-schemas/index.js +51 -7
- package/ui-svelte/index.js +73 -31
- package/ui-svelte/with-schemas/index.js +73 -31
- package/ui-svelte-dom/index.js +35 -14
- package/ui-svelte-dom/with-schemas/index.js +35 -14
- package/ui-svelte-inspector/index.js +69 -20
- package/ui-svelte-inspector/with-schemas/index.js +69 -20
- package/with-schemas/index.js +34 -6
|
@@ -46,7 +46,7 @@ export type InspectorProps = {
|
|
|
46
46
|
*
|
|
47
47
|
* See the <Inspector /> (React) demo for this component in action:
|
|
48
48
|
*
|
|
49
|
-
* 
|
|
51
51
|
*
|
|
52
52
|
* The component displays a nub in the corner of the screen which you may then
|
|
@@ -38,6 +38,7 @@ import type {
|
|
|
38
38
|
IdOrNull,
|
|
39
39
|
Ids,
|
|
40
40
|
ParameterizedCallback,
|
|
41
|
+
Sorter,
|
|
41
42
|
} from '../common/index.d.ts';
|
|
42
43
|
import type {
|
|
43
44
|
Indexes,
|
|
@@ -1418,6 +1419,8 @@ export function useRowIds(
|
|
|
1418
1419
|
* @param descending Whether the sorting should be in descending order.
|
|
1419
1420
|
* @param offset The number of Row Ids to skip for pagination purposes, if any.
|
|
1420
1421
|
* @param limit The maximum number of Row Ids to return, or `undefined` for all.
|
|
1422
|
+
* @param sorter A custom function for comparing the sorting values, or
|
|
1423
|
+
* `undefined` to use the default alphanumeric sorting.
|
|
1421
1424
|
* @param storeOrStoreId The Store to be accessed: omit for the default context
|
|
1422
1425
|
* Store, provide an Id for a named context Store, or provide an explicit
|
|
1423
1426
|
* reference.
|
|
@@ -1441,6 +1444,7 @@ export function useRowIds(
|
|
|
1441
1444
|
* false,
|
|
1442
1445
|
* 0,
|
|
1443
1446
|
* undefined,
|
|
1447
|
+
* undefined,
|
|
1444
1448
|
* store,
|
|
1445
1449
|
* );
|
|
1446
1450
|
* console.log(JSON.stringify(rowIds()));
|
|
@@ -1457,6 +1461,7 @@ export function useSortedRowIds(
|
|
|
1457
1461
|
descending?: MaybeAccessor<boolean | undefined>,
|
|
1458
1462
|
offset?: MaybeAccessor<number | undefined>,
|
|
1459
1463
|
limit?: MaybeAccessor<number | undefined>,
|
|
1464
|
+
sorter?: Sorter,
|
|
1460
1465
|
storeOrStoreId?: MaybeAccessor<StoreOrStoreId | undefined>,
|
|
1461
1466
|
): Accessor<Ids>;
|
|
1462
1467
|
|
|
@@ -1464,7 +1469,8 @@ export function useSortedRowIds(
|
|
|
1464
1469
|
* When called with an object as the first argument, the useSortedRowIds method
|
|
1465
1470
|
* destructures it to make it easier to skip optional parameters.
|
|
1466
1471
|
* @param args A SortedRowIdsArgs object containing the Id of the Table in the
|
|
1467
|
-
* Store, and optional `cellId`, `descending`, `offset`, and `
|
|
1472
|
+
* Store, and optional `cellId`, `descending`, `offset`, `limit`, and `sorter`
|
|
1473
|
+
* parameters.
|
|
1468
1474
|
* @param storeOrStoreId The Store to be accessed: omit for the default context
|
|
1469
1475
|
* Store, provide an Id for a named context Store, or provide an explicit
|
|
1470
1476
|
* reference.
|
|
@@ -4517,7 +4523,8 @@ export function useSortedRowIdsListener(
|
|
|
4517
4523
|
* When called with an object as the first argument, the useSortedRowIds method
|
|
4518
4524
|
* destructures it to make it easier to skip optional parameters.
|
|
4519
4525
|
* @param args A SortedRowIdsArgs object containing the Id of the Table in the
|
|
4520
|
-
* Store, and optional `cellId`, `descending`, `offset`, and `
|
|
4526
|
+
* Store, and optional `cellId`, `descending`, `offset`, `limit`, and `sorter`
|
|
4527
|
+
* parameters.
|
|
4521
4528
|
* @param listener The function that will be called whenever the sorted Row Ids
|
|
4522
4529
|
* in the Table change.
|
|
4523
4530
|
* @param mutator An optional boolean that indicates that the listener mutates
|
|
@@ -84,6 +84,7 @@ import type {
|
|
|
84
84
|
IdOrNull,
|
|
85
85
|
Ids,
|
|
86
86
|
ParameterizedCallback,
|
|
87
|
+
Sorter,
|
|
87
88
|
} from '../../common/with-schemas/index.d.ts';
|
|
88
89
|
import type {
|
|
89
90
|
Indexes,
|
|
@@ -1635,6 +1636,7 @@ export type WithSchemas<Schemas extends OptionalSchemas> = {
|
|
|
1635
1636
|
* descending?: MaybeAccessor<boolean | undefined>,
|
|
1636
1637
|
* offset?: MaybeAccessor<number | undefined>,
|
|
1637
1638
|
* limit?: MaybeAccessor<number | undefined>,
|
|
1639
|
+
* sorter?: Sorter,
|
|
1638
1640
|
* storeOrStoreId?: MaybeAccessor<StoreOrStoreId | undefined>,
|
|
1639
1641
|
* ): Accessor<Ids>;
|
|
1640
1642
|
* ```
|
|
@@ -1654,6 +1656,8 @@ export type WithSchemas<Schemas extends OptionalSchemas> = {
|
|
|
1654
1656
|
* @param descending Whether the sorting should be in descending order.
|
|
1655
1657
|
* @param offset The number of Row Ids to skip for pagination purposes, if any.
|
|
1656
1658
|
* @param limit The maximum number of Row Ids to return, or `undefined` for all.
|
|
1659
|
+
* @param sorter A custom function for comparing the sorting values, or
|
|
1660
|
+
* `undefined` to use the default alphanumeric sorting.
|
|
1657
1661
|
* @param storeOrStoreId The Store to be accessed: omit for the default context
|
|
1658
1662
|
* Store, provide an Id for a named context Store, or provide an explicit
|
|
1659
1663
|
* reference.
|
|
@@ -1677,6 +1681,7 @@ export type WithSchemas<Schemas extends OptionalSchemas> = {
|
|
|
1677
1681
|
* false,
|
|
1678
1682
|
* 0,
|
|
1679
1683
|
* undefined,
|
|
1684
|
+
* undefined,
|
|
1680
1685
|
* store,
|
|
1681
1686
|
* );
|
|
1682
1687
|
* console.log(JSON.stringify(rowIds()));
|
|
@@ -1697,6 +1702,7 @@ export type WithSchemas<Schemas extends OptionalSchemas> = {
|
|
|
1697
1702
|
descending?: MaybeAccessor<boolean | undefined>,
|
|
1698
1703
|
offset?: MaybeAccessor<number | undefined>,
|
|
1699
1704
|
limit?: MaybeAccessor<number | undefined>,
|
|
1705
|
+
sorter?: Sorter,
|
|
1700
1706
|
storeOrStoreId?: MaybeAccessor<StoreOrStoreId<Schemas> | undefined>,
|
|
1701
1707
|
): Accessor<Ids>;
|
|
1702
1708
|
|
|
@@ -1704,7 +1710,8 @@ export type WithSchemas<Schemas extends OptionalSchemas> = {
|
|
|
1704
1710
|
* When called with an object as the first argument, the useSortedRowIds method
|
|
1705
1711
|
* destructures it to make it easier to skip optional parameters.
|
|
1706
1712
|
* @param args A SortedRowIdsArgs object containing the Id of the Table in the
|
|
1707
|
-
* Store, and optional `cellId`, `descending`, `offset`, and `
|
|
1713
|
+
* Store, and optional `cellId`, `descending`, `offset`, `limit`, and `sorter`
|
|
1714
|
+
* parameters.
|
|
1708
1715
|
* @param storeOrStoreId The Store to be accessed: omit for the default context
|
|
1709
1716
|
* Store, provide an Id for a named context Store, or provide an explicit
|
|
1710
1717
|
* reference.
|
|
@@ -5274,7 +5281,8 @@ export type WithSchemas<Schemas extends OptionalSchemas> = {
|
|
|
5274
5281
|
* When called with an object as the first argument, the useSortedRowIds method
|
|
5275
5282
|
* destructures it to make it easier to skip optional parameters.
|
|
5276
5283
|
* @param args A SortedRowIdsArgs object containing the Id of the Table in the
|
|
5277
|
-
* Store, and optional `cellId`, `descending`, `offset`, and `
|
|
5284
|
+
* Store, and optional `cellId`, `descending`, `offset`, `limit`, and `sorter`
|
|
5285
|
+
* parameters.
|
|
5278
5286
|
* @param listener The function that will be called whenever the sorted Row Ids
|
|
5279
5287
|
* in the Table change.
|
|
5280
5288
|
* @param mutator An optional boolean that indicates that the listener mutates
|
|
@@ -692,7 +692,7 @@ export type SortedTablePaginatorProps = {
|
|
|
692
692
|
*
|
|
693
693
|
* See the <TableInHtmlTable /> (Solid) demo for this component in action:
|
|
694
694
|
*
|
|
695
|
-
* 
|
|
697
697
|
*
|
|
698
698
|
* The component's props identify which Table to render based on Table Id, and
|
|
@@ -836,7 +836,7 @@ export function TableInHtmlTable(
|
|
|
836
836
|
* See the <SortedTableInHtmlTable /> (Solid) demo for this component in
|
|
837
837
|
* action:
|
|
838
838
|
*
|
|
839
|
-
* 
|
|
841
841
|
*
|
|
842
842
|
* The component's props identify which Table to render based on Table Id, and
|
|
@@ -1007,7 +1007,7 @@ export function SortedTableInHtmlTable(
|
|
|
1007
1007
|
*
|
|
1008
1008
|
* See the <ValuesInHtmlTable /> (Solid) demo for this component in action:
|
|
1009
1009
|
*
|
|
1010
|
-
* 
|
|
1012
1012
|
*
|
|
1013
1013
|
* The component's props identify which Row to render based on Table Id, Row Id,
|
|
@@ -1136,7 +1136,7 @@ export function ValuesInHtmlTable(
|
|
|
1136
1136
|
*
|
|
1137
1137
|
* See the <SliceInHtmlTable /> (Solid) demo for this component in action:
|
|
1138
1138
|
*
|
|
1139
|
-
* 
|
|
1141
1141
|
*
|
|
1142
1142
|
* The component's props identify which Slice to render based on Index Id, Slice
|
|
@@ -1292,7 +1292,7 @@ export function SliceInHtmlTable(
|
|
|
1292
1292
|
* See the <RelationshipInHtmlTable /> (Solid) demo for this component in
|
|
1293
1293
|
* action:
|
|
1294
1294
|
*
|
|
1295
|
-
* 
|
|
1297
1297
|
*
|
|
1298
1298
|
* The component's props identify which Relationship to render based on
|
|
@@ -1466,7 +1466,7 @@ export function RelationshipInHtmlTable(
|
|
|
1466
1466
|
* See the <ResultTableInHtmlTable /> (Solid) demo for this component in
|
|
1467
1467
|
* action:
|
|
1468
1468
|
*
|
|
1469
|
-
* 
|
|
1471
1471
|
*
|
|
1472
1472
|
* The component's props identify which ResultTable to render based on query Id,
|
|
@@ -1617,7 +1617,7 @@ export function ResultTableInHtmlTable(
|
|
|
1617
1617
|
* See the <ResultSortedTableInHtmlTable /> (Solid) demo for this component in
|
|
1618
1618
|
* action:
|
|
1619
1619
|
*
|
|
1620
|
-
* 
|
|
1622
1622
|
*
|
|
1623
1623
|
* The component's props identify which ResultTable to render based on query Id,
|
|
@@ -1789,7 +1789,7 @@ export function ResultSortedTableInHtmlTable(
|
|
|
1789
1789
|
*
|
|
1790
1790
|
* See the <EditableCellView /> (Solid) demo for this component in action:
|
|
1791
1791
|
*
|
|
1792
|
-
* 
|
|
1794
1794
|
*
|
|
1795
1795
|
* The component's props identify which Cell to render based on Table Id, Row
|
|
@@ -1859,7 +1859,7 @@ export function EditableCellView(
|
|
|
1859
1859
|
*
|
|
1860
1860
|
* See the <EditableValueView /> (Solid) demo for this component in action:
|
|
1861
1861
|
*
|
|
1862
|
-
* 
|
|
1864
1864
|
*
|
|
1865
1865
|
* The component's props identify which Value to render based on Table Id, Row
|
|
@@ -1929,7 +1929,7 @@ export function EditableValueView(
|
|
|
1929
1929
|
* See the <SortedTableInHtmlTable /> (Solid) demo for this component in
|
|
1930
1930
|
* action:
|
|
1931
1931
|
*
|
|
1932
|
-
* 
|
|
1934
1934
|
*
|
|
1935
1935
|
* The component displays 'previous' and 'next' buttons for paging through the
|
|
@@ -666,7 +666,7 @@ export type WithSchemas<Schemas extends OptionalSchemas> = {
|
|
|
666
666
|
*
|
|
667
667
|
* See the <TableInHtmlTable /> (Solid) demo for this component in action:
|
|
668
668
|
*
|
|
669
|
-
* 
|
|
671
671
|
*
|
|
672
672
|
* The component's props identify which Table to render based on Table Id, and
|
|
@@ -818,7 +818,7 @@ export type WithSchemas<Schemas extends OptionalSchemas> = {
|
|
|
818
818
|
* See the <SortedTableInHtmlTable /> (Solid) demo for this component in
|
|
819
819
|
* action:
|
|
820
820
|
*
|
|
821
|
-
* 
|
|
823
823
|
*
|
|
824
824
|
* The component's props identify which Table to render based on Table Id, and
|
|
@@ -997,7 +997,7 @@ export type WithSchemas<Schemas extends OptionalSchemas> = {
|
|
|
997
997
|
*
|
|
998
998
|
* See the <ValuesInHtmlTable /> (Solid) demo for this component in action:
|
|
999
999
|
*
|
|
1000
|
-
* 
|
|
1002
1002
|
*
|
|
1003
1003
|
* The component's props identify which Row to render based on Table Id, Row Id,
|
|
@@ -1134,7 +1134,7 @@ export type WithSchemas<Schemas extends OptionalSchemas> = {
|
|
|
1134
1134
|
*
|
|
1135
1135
|
* See the <SliceInHtmlTable /> (Solid) demo for this component in action:
|
|
1136
1136
|
*
|
|
1137
|
-
* 
|
|
1139
1139
|
*
|
|
1140
1140
|
* The component's props identify which Slice to render based on Index Id, Slice
|
|
@@ -1298,7 +1298,7 @@ export type WithSchemas<Schemas extends OptionalSchemas> = {
|
|
|
1298
1298
|
* See the <RelationshipInHtmlTable /> (Solid) demo for this component in
|
|
1299
1299
|
* action:
|
|
1300
1300
|
*
|
|
1301
|
-
* 
|
|
1303
1303
|
*
|
|
1304
1304
|
* The component's props identify which Relationship to render based on
|
|
@@ -1480,7 +1480,7 @@ export type WithSchemas<Schemas extends OptionalSchemas> = {
|
|
|
1480
1480
|
* See the <ResultTableInHtmlTable /> (Solid) demo for this component in
|
|
1481
1481
|
* action:
|
|
1482
1482
|
*
|
|
1483
|
-
* 
|
|
1485
1485
|
*
|
|
1486
1486
|
* The component's props identify which ResultTable to render based on query Id,
|
|
@@ -1639,7 +1639,7 @@ export type WithSchemas<Schemas extends OptionalSchemas> = {
|
|
|
1639
1639
|
* See the <ResultSortedTableInHtmlTable /> (Solid) demo for this component in
|
|
1640
1640
|
* action:
|
|
1641
1641
|
*
|
|
1642
|
-
* 
|
|
1644
1644
|
*
|
|
1645
1645
|
* The component's props identify which ResultTable to render based on query Id,
|
|
@@ -1819,7 +1819,7 @@ export type WithSchemas<Schemas extends OptionalSchemas> = {
|
|
|
1819
1819
|
*
|
|
1820
1820
|
* See the <EditableCellView /> (Solid) demo for this component in action:
|
|
1821
1821
|
*
|
|
1822
|
-
* 
|
|
1824
1824
|
*
|
|
1825
1825
|
* The component's props identify which Cell to render based on Table Id, Row
|
|
@@ -1903,7 +1903,7 @@ export type WithSchemas<Schemas extends OptionalSchemas> = {
|
|
|
1903
1903
|
*
|
|
1904
1904
|
* See the <EditableValueView /> (Solid) demo for this component in action:
|
|
1905
1905
|
*
|
|
1906
|
-
* 
|
|
1908
1908
|
*
|
|
1909
1909
|
* The component's props identify which Value to render based on Table Id, Row
|
|
@@ -1973,7 +1973,7 @@ export type WithSchemas<Schemas extends OptionalSchemas> = {
|
|
|
1973
1973
|
* See the <SortedTableInHtmlTable /> (Solid) demo for this component in
|
|
1974
1974
|
* action:
|
|
1975
1975
|
*
|
|
1976
|
-
* 
|
|
1978
1978
|
*
|
|
1979
1979
|
* The component displays 'previous' and 'next' buttons for paging through the
|
|
@@ -46,7 +46,7 @@ export type InspectorProps = {
|
|
|
46
46
|
*
|
|
47
47
|
* See the <Inspector /> (Solid) demo for this component in action:
|
|
48
48
|
*
|
|
49
|
-
* 
|
|
51
51
|
*
|
|
52
52
|
* The component displays a nub in the corner of the screen which you may then
|
|
@@ -46,7 +46,7 @@ export type InspectorProps = {
|
|
|
46
46
|
*
|
|
47
47
|
* See the <Inspector /> (Solid) demo for this component in action:
|
|
48
48
|
*
|
|
49
|
-
* 
|
|
51
51
|
*
|
|
52
52
|
* The component displays a nub in the corner of the screen which you may then
|
|
@@ -35,7 +35,7 @@ import type {
|
|
|
35
35
|
CheckpointListener,
|
|
36
36
|
Checkpoints,
|
|
37
37
|
} from '../checkpoints/index.d.ts';
|
|
38
|
-
import type {Id, IdOrNull, Ids} from '../common/index.d.ts';
|
|
38
|
+
import type {Id, IdOrNull, Ids, Sorter} from '../common/index.d.ts';
|
|
39
39
|
import type {
|
|
40
40
|
Indexes,
|
|
41
41
|
SliceIdsListener,
|
|
@@ -82,6 +82,7 @@ import type {
|
|
|
82
82
|
RowCountListener,
|
|
83
83
|
RowIdsListener,
|
|
84
84
|
RowListener,
|
|
85
|
+
SortedRowIdsArgs,
|
|
85
86
|
SortedRowIdsListener,
|
|
86
87
|
Store,
|
|
87
88
|
Table,
|
|
@@ -2893,6 +2894,8 @@ export function getRowIds(
|
|
|
2893
2894
|
* @param descending Whether to sort descending (or a getter returning it).
|
|
2894
2895
|
* @param offset The starting Row offset (or a getter returning it).
|
|
2895
2896
|
* @param limit The maximum number of Rows to return (or a getter returning it).
|
|
2897
|
+
* @param sorter A custom function for comparing the sorting values, or
|
|
2898
|
+
* `undefined` to use the default alphanumeric sorting.
|
|
2896
2899
|
* @param storeOrStoreId The Store to use (plain value or getter), or its Id.
|
|
2897
2900
|
* @returns A reactive object with a `current` Ids property.
|
|
2898
2901
|
* @example
|
|
@@ -2907,7 +2910,15 @@ export function getRowIds(
|
|
|
2907
2910
|
*
|
|
2908
2911
|
* let {store} = $props();
|
|
2909
2912
|
*
|
|
2910
|
-
* const result = getSortedRowIds(
|
|
2913
|
+
* const result = getSortedRowIds(
|
|
2914
|
+
* 'pets',
|
|
2915
|
+
* 'sold',
|
|
2916
|
+
* false,
|
|
2917
|
+
* 0,
|
|
2918
|
+
* undefined,
|
|
2919
|
+
* undefined,
|
|
2920
|
+
* store,
|
|
2921
|
+
* );
|
|
2911
2922
|
* </script>
|
|
2912
2923
|
*
|
|
2913
2924
|
* {JSON.stringify(result.current)}
|
|
@@ -2941,6 +2952,23 @@ export function getSortedRowIds(
|
|
|
2941
2952
|
descending?: MaybeGetter<boolean>,
|
|
2942
2953
|
offset?: MaybeGetter<number>,
|
|
2943
2954
|
limit?: MaybeGetter<number | undefined>,
|
|
2955
|
+
sorter?: Sorter,
|
|
2956
|
+
storeOrStoreId?: MaybeGetter<StoreOrStoreId | undefined>,
|
|
2957
|
+
): {readonly current: Ids};
|
|
2958
|
+
|
|
2959
|
+
/**
|
|
2960
|
+
* When called with an object as the first argument, the getSortedRowIds
|
|
2961
|
+
* function destructures it to make it easier to skip optional parameters.
|
|
2962
|
+
* @param args A SortedRowIdsArgs object containing the Id of the Table in the
|
|
2963
|
+
* Store, and optional `cellId`, `descending`, `offset`, `limit`, and `sorter`
|
|
2964
|
+
* parameters.
|
|
2965
|
+
* @param storeOrStoreId The Store to use (plain value or getter), or its Id.
|
|
2966
|
+
* @returns A reactive object with a `current` Ids property.
|
|
2967
|
+
* @category Getter
|
|
2968
|
+
* @since v9.1.0
|
|
2969
|
+
*/
|
|
2970
|
+
export function getSortedRowIds(
|
|
2971
|
+
args: SortedRowIdsArgs,
|
|
2944
2972
|
storeOrStoreId?: MaybeGetter<StoreOrStoreId | undefined>,
|
|
2945
2973
|
): {readonly current: Ids};
|
|
2946
2974
|
|
|
@@ -6936,6 +6964,26 @@ export function onSortedRowIds(
|
|
|
6936
6964
|
storeOrStoreId?: MaybeGetter<StoreOrStoreId | undefined>,
|
|
6937
6965
|
): void;
|
|
6938
6966
|
|
|
6967
|
+
/**
|
|
6968
|
+
* When called with an object as the first argument, the onSortedRowIds function
|
|
6969
|
+
* destructures it to make it easier to skip optional parameters.
|
|
6970
|
+
* @param args A SortedRowIdsArgs object containing the Id of the Table in the
|
|
6971
|
+
* Store, and optional `cellId`, `descending`, `offset`, `limit`, and `sorter`
|
|
6972
|
+
* parameters.
|
|
6973
|
+
* @param listener The function to call when sorted Row Ids change.
|
|
6974
|
+
* @param mutator An optional boolean indicating the listener mutates Store
|
|
6975
|
+
* data.
|
|
6976
|
+
* @param storeOrStoreId The Store to use, or its Id.
|
|
6977
|
+
* @category Listener
|
|
6978
|
+
* @since v9.1.0
|
|
6979
|
+
*/
|
|
6980
|
+
export function onSortedRowIds(
|
|
6981
|
+
args: SortedRowIdsArgs,
|
|
6982
|
+
listener: SortedRowIdsListener,
|
|
6983
|
+
mutator?: boolean,
|
|
6984
|
+
storeOrStoreId?: MaybeGetter<StoreOrStoreId | undefined>,
|
|
6985
|
+
): void;
|
|
6986
|
+
|
|
6939
6987
|
/**
|
|
6940
6988
|
* The onHasRow function registers a listener that is called whenever a
|
|
6941
6989
|
* specified Row is added to or removed from a Table.
|
|
@@ -23,7 +23,12 @@ import type {
|
|
|
23
23
|
CheckpointListener,
|
|
24
24
|
Checkpoints,
|
|
25
25
|
} from '../../checkpoints/with-schemas/index.d.ts';
|
|
26
|
-
import type {
|
|
26
|
+
import type {
|
|
27
|
+
Id,
|
|
28
|
+
IdOrNull,
|
|
29
|
+
Ids,
|
|
30
|
+
Sorter,
|
|
31
|
+
} from '../../common/with-schemas/index.d.ts';
|
|
27
32
|
import type {
|
|
28
33
|
Indexes,
|
|
29
34
|
SliceIdsListener,
|
|
@@ -77,6 +82,7 @@ import type {
|
|
|
77
82
|
RowCountListener,
|
|
78
83
|
RowIdsListener,
|
|
79
84
|
RowListener,
|
|
85
|
+
SortedRowIdsArgs,
|
|
80
86
|
SortedRowIdsListener,
|
|
81
87
|
Store,
|
|
82
88
|
Table,
|
|
@@ -3151,7 +3157,8 @@ export type WithSchemas<Schemas extends OptionalSchemas> = {
|
|
|
3151
3157
|
storeOrStoreId?: StoreOrStoreId<Schemas>,
|
|
3152
3158
|
) => {readonly current: Ids};
|
|
3153
3159
|
|
|
3154
|
-
|
|
3160
|
+
getSortedRowIds: {
|
|
3161
|
+
/**
|
|
3155
3162
|
* The getSortedRowIds function returns a reactive object reflecting the sorted
|
|
3156
3163
|
* Row Ids in a Table, and registers a listener so that any changes will update
|
|
3157
3164
|
* `current`.
|
|
@@ -3160,6 +3167,8 @@ export type WithSchemas<Schemas extends OptionalSchemas> = {
|
|
|
3160
3167
|
* @param descending Whether to sort descending (or a getter returning it).
|
|
3161
3168
|
* @param offset The starting Row offset (or a getter returning it).
|
|
3162
3169
|
* @param limit The maximum number of Rows to return (or a getter returning it).
|
|
3170
|
+
* @param sorter A custom function for comparing the sorting values, or
|
|
3171
|
+
* `undefined` to use the default alphanumeric sorting.
|
|
3163
3172
|
* @param storeOrStoreId The Store to use (plain value or getter), or its Id.
|
|
3164
3173
|
* @returns A reactive object with a `current` Ids property.
|
|
3165
3174
|
* @example
|
|
@@ -3175,6 +3184,7 @@ export type WithSchemas<Schemas extends OptionalSchemas> = {
|
|
|
3175
3184
|
* descending?: MaybeGetter<boolean>,
|
|
3176
3185
|
* offset?: MaybeGetter<number>,
|
|
3177
3186
|
* limit?: MaybeGetter<number | undefined>,
|
|
3187
|
+
* sorter?: Sorter,
|
|
3178
3188
|
* storeOrStoreId?: MaybeGetter<StoreOrStoreId | undefined>,
|
|
3179
3189
|
* ): {readonly current: Ids};
|
|
3180
3190
|
* ```
|
|
@@ -3187,7 +3197,15 @@ export type WithSchemas<Schemas extends OptionalSchemas> = {
|
|
|
3187
3197
|
*
|
|
3188
3198
|
* let {store} = $props();
|
|
3189
3199
|
*
|
|
3190
|
-
* const result = getSortedRowIds(
|
|
3200
|
+
* const result = getSortedRowIds(
|
|
3201
|
+
* 'pets',
|
|
3202
|
+
* 'sold',
|
|
3203
|
+
* false,
|
|
3204
|
+
* 0,
|
|
3205
|
+
* undefined,
|
|
3206
|
+
* undefined,
|
|
3207
|
+
* store,
|
|
3208
|
+
* );
|
|
3191
3209
|
* </script>
|
|
3192
3210
|
*
|
|
3193
3211
|
* {JSON.stringify(result.current)}
|
|
@@ -3215,14 +3233,32 @@ export type WithSchemas<Schemas extends OptionalSchemas> = {
|
|
|
3215
3233
|
* @category Getter
|
|
3216
3234
|
* @since v8.1.0
|
|
3217
3235
|
*/
|
|
3218
|
-
|
|
3219
|
-
|
|
3220
|
-
|
|
3221
|
-
|
|
3222
|
-
|
|
3223
|
-
|
|
3224
|
-
|
|
3225
|
-
|
|
3236
|
+
<TableId extends TableIdFromSchema<Schemas[0]>>(
|
|
3237
|
+
tableId: MaybeGetter<TableId>,
|
|
3238
|
+
cellId?: MaybeGetter<CellIdFromSchema<Schemas[0], TableId> | undefined>,
|
|
3239
|
+
descending?: MaybeGetter<boolean>,
|
|
3240
|
+
offset?: MaybeGetter<number>,
|
|
3241
|
+
limit?: MaybeGetter<number | undefined>,
|
|
3242
|
+
sorter?: Sorter,
|
|
3243
|
+
storeOrStoreId?: StoreOrStoreId<Schemas>,
|
|
3244
|
+
): {readonly current: Ids};
|
|
3245
|
+
|
|
3246
|
+
/**
|
|
3247
|
+
* When called with an object as the first argument, the getSortedRowIds
|
|
3248
|
+
* function destructures it to make it easier to skip optional parameters.
|
|
3249
|
+
* @param args A SortedRowIdsArgs object containing the Id of the Table in the
|
|
3250
|
+
* Store, and optional `cellId`, `descending`, `offset`, `limit`, and `sorter`
|
|
3251
|
+
* parameters.
|
|
3252
|
+
* @param storeOrStoreId The Store to use (plain value or getter), or its Id.
|
|
3253
|
+
* @returns A reactive object with a `current` Ids property.
|
|
3254
|
+
* @category Getter
|
|
3255
|
+
* @since v9.1.0
|
|
3256
|
+
*/
|
|
3257
|
+
<TableId extends TableIdFromSchema<Schemas[0]>>(
|
|
3258
|
+
args: SortedRowIdsArgs<Schemas[0], TableId>,
|
|
3259
|
+
storeOrStoreId?: StoreOrStoreId<Schemas>,
|
|
3260
|
+
): {readonly current: Ids};
|
|
3261
|
+
};
|
|
3226
3262
|
|
|
3227
3263
|
/**
|
|
3228
3264
|
* The hasRow function returns a reactive object indicating whether a Row exists
|
|
@@ -7745,7 +7781,8 @@ export type WithSchemas<Schemas extends OptionalSchemas> = {
|
|
|
7745
7781
|
storeOrStoreId?: StoreOrStoreId<Schemas>,
|
|
7746
7782
|
) => void;
|
|
7747
7783
|
|
|
7748
|
-
|
|
7784
|
+
onSortedRowIds: {
|
|
7785
|
+
/**
|
|
7749
7786
|
* The onSortedRowIds function registers a listener that is called whenever the
|
|
7750
7787
|
* sorted Row Ids in a Table change.
|
|
7751
7788
|
* @param tableId The Id of the Table to listen to.
|
|
@@ -7818,19 +7855,45 @@ export type WithSchemas<Schemas extends OptionalSchemas> = {
|
|
|
7818
7855
|
* @category Listener
|
|
7819
7856
|
* @since v8.1.0
|
|
7820
7857
|
*/
|
|
7821
|
-
|
|
7822
|
-
|
|
7823
|
-
|
|
7824
|
-
|
|
7825
|
-
|
|
7826
|
-
|
|
7827
|
-
|
|
7828
|
-
|
|
7829
|
-
|
|
7830
|
-
|
|
7831
|
-
|
|
7832
|
-
|
|
7833
|
-
|
|
7858
|
+
<
|
|
7859
|
+
TableId extends TableIdFromSchema<Schemas[0]>,
|
|
7860
|
+
CellIdOrUndefined extends
|
|
7861
|
+
CellIdFromSchema<Schemas[0], TableId> | undefined,
|
|
7862
|
+
>(
|
|
7863
|
+
tableId: MaybeGetter<TableId>,
|
|
7864
|
+
cellId: MaybeGetter<CellIdOrUndefined>,
|
|
7865
|
+
descending: MaybeGetter<boolean>,
|
|
7866
|
+
offset: MaybeGetter<number>,
|
|
7867
|
+
limit: MaybeGetter<number | undefined>,
|
|
7868
|
+
listener: SortedRowIdsListener<Schemas, TableId, CellIdOrUndefined>,
|
|
7869
|
+
mutator?: boolean,
|
|
7870
|
+
storeOrStoreId?: StoreOrStoreId<Schemas>,
|
|
7871
|
+
): void;
|
|
7872
|
+
|
|
7873
|
+
/**
|
|
7874
|
+
* When called with an object as the first argument, the onSortedRowIds function
|
|
7875
|
+
* destructures it to make it easier to skip optional parameters.
|
|
7876
|
+
* @param args A SortedRowIdsArgs object containing the Id of the Table in the
|
|
7877
|
+
* Store, and optional `cellId`, `descending`, `offset`, `limit`, and `sorter`
|
|
7878
|
+
* parameters.
|
|
7879
|
+
* @param listener The function to call when sorted Row Ids change.
|
|
7880
|
+
* @param mutator An optional boolean indicating the listener mutates Store
|
|
7881
|
+
* data.
|
|
7882
|
+
* @param storeOrStoreId The Store to use, or its Id.
|
|
7883
|
+
* @category Listener
|
|
7884
|
+
* @since v9.1.0
|
|
7885
|
+
*/
|
|
7886
|
+
<
|
|
7887
|
+
TableId extends TableIdFromSchema<Schemas[0]>,
|
|
7888
|
+
CellIdOrUndefined extends
|
|
7889
|
+
CellIdFromSchema<Schemas[0], TableId> | undefined,
|
|
7890
|
+
>(
|
|
7891
|
+
args: SortedRowIdsArgs<Schemas[0], TableId, CellIdOrUndefined>,
|
|
7892
|
+
listener: SortedRowIdsListener<Schemas, TableId, CellIdOrUndefined>,
|
|
7893
|
+
mutator?: boolean,
|
|
7894
|
+
storeOrStoreId?: StoreOrStoreId<Schemas>,
|
|
7895
|
+
): void;
|
|
7896
|
+
};
|
|
7834
7897
|
|
|
7835
7898
|
/**
|
|
7836
7899
|
* The onHasRow function registers a listener that is called whenever a
|