tinybase 8.2.0-beta.1 → 8.2.0
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/ui-react-dom/index.d.ts +40 -10
- package/@types/ui-react-dom/with-schemas/index.d.ts +40 -10
- package/@types/ui-react-inspector/index.d.ts +4 -1
- package/@types/ui-react-inspector/with-schemas/index.d.ts +4 -1
- package/@types/ui-svelte-dom/index.d.ts +40 -10
- package/@types/ui-svelte-dom/with-schemas/index.d.ts +40 -10
- package/@types/ui-svelte-inspector/index.d.ts +4 -1
- package/@types/ui-svelte-inspector/with-schemas/index.d.ts +4 -1
- package/agents.md +7 -3
- 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/package.json +12 -12
- package/readme.md +14 -14
- package/releases.md +102 -67
- package/ui-react/index.js +7 -4
- package/ui-react/with-schemas/index.js +7 -4
- package/ui-react-dom/index.js +7 -4
- package/ui-react-dom/with-schemas/index.js +7 -4
- package/ui-react-inspector/index.js +7 -4
- package/ui-react-inspector/with-schemas/index.js +7 -4
- package/ui-svelte/index.js +1 -1
- package/ui-svelte/with-schemas/index.js +1 -1
- package/ui-svelte-dom/index.js +22 -24
- package/ui-svelte-dom/with-schemas/index.js +22 -24
- package/ui-svelte-inspector/index.js +22 -24
- package/ui-svelte-inspector/with-schemas/index.js +22 -24
package/ui-react/index.js
CHANGED
|
@@ -384,16 +384,19 @@ const addAndDelListener = (thing, listenable, ...args) => {
|
|
|
384
384
|
return () => thing?.delListener?.(listenerId);
|
|
385
385
|
};
|
|
386
386
|
const useListenable = (listenable, thing, returnType, args = EMPTY_ARRAY) => {
|
|
387
|
-
const
|
|
387
|
+
const lastResultRef = useRef(DEFAULTS[returnType]);
|
|
388
388
|
const getResult = useCallback(
|
|
389
389
|
() => {
|
|
390
390
|
const nextResult =
|
|
391
391
|
thing?.[(returnType == 6 /* Boolean */ ? _HAS : GET) + listenable]?.(
|
|
392
392
|
...args,
|
|
393
393
|
) ?? DEFAULTS[returnType];
|
|
394
|
-
return !(IS_EQUALS[returnType] ?? isEqual)(
|
|
395
|
-
|
|
396
|
-
|
|
394
|
+
return !(IS_EQUALS[returnType] ?? isEqual)(
|
|
395
|
+
nextResult,
|
|
396
|
+
lastResultRef.current,
|
|
397
|
+
)
|
|
398
|
+
? (lastResultRef.current = nextResult)
|
|
399
|
+
: lastResultRef.current;
|
|
397
400
|
},
|
|
398
401
|
/* eslint-disable-next-line react-hooks/exhaustive-deps */
|
|
399
402
|
[thing, returnType, listenable, ...args],
|
|
@@ -384,16 +384,19 @@ const addAndDelListener = (thing, listenable, ...args) => {
|
|
|
384
384
|
return () => thing?.delListener?.(listenerId);
|
|
385
385
|
};
|
|
386
386
|
const useListenable = (listenable, thing, returnType, args = EMPTY_ARRAY) => {
|
|
387
|
-
const
|
|
387
|
+
const lastResultRef = useRef(DEFAULTS[returnType]);
|
|
388
388
|
const getResult = useCallback(
|
|
389
389
|
() => {
|
|
390
390
|
const nextResult =
|
|
391
391
|
thing?.[(returnType == 6 /* Boolean */ ? _HAS : GET) + listenable]?.(
|
|
392
392
|
...args,
|
|
393
393
|
) ?? DEFAULTS[returnType];
|
|
394
|
-
return !(IS_EQUALS[returnType] ?? isEqual)(
|
|
395
|
-
|
|
396
|
-
|
|
394
|
+
return !(IS_EQUALS[returnType] ?? isEqual)(
|
|
395
|
+
nextResult,
|
|
396
|
+
lastResultRef.current,
|
|
397
|
+
)
|
|
398
|
+
? (lastResultRef.current = nextResult)
|
|
399
|
+
: lastResultRef.current;
|
|
397
400
|
},
|
|
398
401
|
/* eslint-disable-next-line react-hooks/exhaustive-deps */
|
|
399
402
|
[thing, returnType, listenable, ...args],
|
package/ui-react-dom/index.js
CHANGED
|
@@ -214,16 +214,19 @@ const addAndDelListener = (thing, listenable, ...args) => {
|
|
|
214
214
|
return () => thing?.delListener?.(listenerId);
|
|
215
215
|
};
|
|
216
216
|
const useListenable = (listenable, thing, returnType, args = EMPTY_ARRAY) => {
|
|
217
|
-
const
|
|
217
|
+
const lastResultRef = useRef(DEFAULTS[returnType]);
|
|
218
218
|
const getResult = useCallback(
|
|
219
219
|
() => {
|
|
220
220
|
const nextResult =
|
|
221
221
|
thing?.[(returnType == 6 /* Boolean */ ? _HAS : GET) + listenable]?.(
|
|
222
222
|
...args,
|
|
223
223
|
) ?? DEFAULTS[returnType];
|
|
224
|
-
return !(IS_EQUALS[returnType] ?? isEqual)(
|
|
225
|
-
|
|
226
|
-
|
|
224
|
+
return !(IS_EQUALS[returnType] ?? isEqual)(
|
|
225
|
+
nextResult,
|
|
226
|
+
lastResultRef.current,
|
|
227
|
+
)
|
|
228
|
+
? (lastResultRef.current = nextResult)
|
|
229
|
+
: lastResultRef.current;
|
|
227
230
|
},
|
|
228
231
|
/* eslint-disable-next-line react-hooks/exhaustive-deps */
|
|
229
232
|
[thing, returnType, listenable, ...args],
|
|
@@ -214,16 +214,19 @@ const addAndDelListener = (thing, listenable, ...args) => {
|
|
|
214
214
|
return () => thing?.delListener?.(listenerId);
|
|
215
215
|
};
|
|
216
216
|
const useListenable = (listenable, thing, returnType, args = EMPTY_ARRAY) => {
|
|
217
|
-
const
|
|
217
|
+
const lastResultRef = useRef(DEFAULTS[returnType]);
|
|
218
218
|
const getResult = useCallback(
|
|
219
219
|
() => {
|
|
220
220
|
const nextResult =
|
|
221
221
|
thing?.[(returnType == 6 /* Boolean */ ? _HAS : GET) + listenable]?.(
|
|
222
222
|
...args,
|
|
223
223
|
) ?? DEFAULTS[returnType];
|
|
224
|
-
return !(IS_EQUALS[returnType] ?? isEqual)(
|
|
225
|
-
|
|
226
|
-
|
|
224
|
+
return !(IS_EQUALS[returnType] ?? isEqual)(
|
|
225
|
+
nextResult,
|
|
226
|
+
lastResultRef.current,
|
|
227
|
+
)
|
|
228
|
+
? (lastResultRef.current = nextResult)
|
|
229
|
+
: lastResultRef.current;
|
|
227
230
|
},
|
|
228
231
|
/* eslint-disable-next-line react-hooks/exhaustive-deps */
|
|
229
232
|
[thing, returnType, listenable, ...args],
|
|
@@ -3006,16 +3006,19 @@ const addAndDelListener = (thing, listenable, ...args) => {
|
|
|
3006
3006
|
return () => thing?.delListener?.(listenerId);
|
|
3007
3007
|
};
|
|
3008
3008
|
const useListenable = (listenable, thing, returnType, args = EMPTY_ARRAY) => {
|
|
3009
|
-
const
|
|
3009
|
+
const lastResultRef = useRef(DEFAULTS[returnType]);
|
|
3010
3010
|
const getResult = useCallback(
|
|
3011
3011
|
() => {
|
|
3012
3012
|
const nextResult =
|
|
3013
3013
|
thing?.[(returnType == 6 /* Boolean */ ? _HAS : GET) + listenable]?.(
|
|
3014
3014
|
...args,
|
|
3015
3015
|
) ?? DEFAULTS[returnType];
|
|
3016
|
-
return !(IS_EQUALS[returnType] ?? isEqual)(
|
|
3017
|
-
|
|
3018
|
-
|
|
3016
|
+
return !(IS_EQUALS[returnType] ?? isEqual)(
|
|
3017
|
+
nextResult,
|
|
3018
|
+
lastResultRef.current,
|
|
3019
|
+
)
|
|
3020
|
+
? (lastResultRef.current = nextResult)
|
|
3021
|
+
: lastResultRef.current;
|
|
3019
3022
|
},
|
|
3020
3023
|
/* eslint-disable-next-line react-hooks/exhaustive-deps */
|
|
3021
3024
|
[thing, returnType, listenable, ...args],
|
|
@@ -3006,16 +3006,19 @@ const addAndDelListener = (thing, listenable, ...args) => {
|
|
|
3006
3006
|
return () => thing?.delListener?.(listenerId);
|
|
3007
3007
|
};
|
|
3008
3008
|
const useListenable = (listenable, thing, returnType, args = EMPTY_ARRAY) => {
|
|
3009
|
-
const
|
|
3009
|
+
const lastResultRef = useRef(DEFAULTS[returnType]);
|
|
3010
3010
|
const getResult = useCallback(
|
|
3011
3011
|
() => {
|
|
3012
3012
|
const nextResult =
|
|
3013
3013
|
thing?.[(returnType == 6 /* Boolean */ ? _HAS : GET) + listenable]?.(
|
|
3014
3014
|
...args,
|
|
3015
3015
|
) ?? DEFAULTS[returnType];
|
|
3016
|
-
return !(IS_EQUALS[returnType] ?? isEqual)(
|
|
3017
|
-
|
|
3018
|
-
|
|
3016
|
+
return !(IS_EQUALS[returnType] ?? isEqual)(
|
|
3017
|
+
nextResult,
|
|
3018
|
+
lastResultRef.current,
|
|
3019
|
+
)
|
|
3020
|
+
? (lastResultRef.current = nextResult)
|
|
3021
|
+
: lastResultRef.current;
|
|
3019
3022
|
},
|
|
3020
3023
|
/* eslint-disable-next-line react-hooks/exhaustive-deps */
|
|
3021
3024
|
[thing, returnType, listenable, ...args],
|
package/ui-svelte/index.js
CHANGED
|
@@ -59,7 +59,7 @@ const objGet = (obj, id) => ifNotUndefined(obj, (obj2) => obj2[id]);
|
|
|
59
59
|
|
|
60
60
|
const TINYBASE_CONTEXT_KEY = TINYBASE + '_uisc';
|
|
61
61
|
|
|
62
|
-
/* functions.svelte.ts generated by Svelte v5.55.
|
|
62
|
+
/* functions.svelte.ts generated by Svelte v5.55.4 */
|
|
63
63
|
|
|
64
64
|
class ReactiveHandle {
|
|
65
65
|
#get;
|
|
@@ -59,7 +59,7 @@ const objGet = (obj, id) => ifNotUndefined(obj, (obj2) => obj2[id]);
|
|
|
59
59
|
|
|
60
60
|
const TINYBASE_CONTEXT_KEY = TINYBASE + '_uisc';
|
|
61
61
|
|
|
62
|
-
/* functions.svelte.ts generated by Svelte v5.55.
|
|
62
|
+
/* functions.svelte.ts generated by Svelte v5.55.4 */
|
|
63
63
|
|
|
64
64
|
class ReactiveHandle {
|
|
65
65
|
#get;
|
package/ui-svelte-dom/index.js
CHANGED
|
@@ -88,7 +88,7 @@ const objMap = (obj, cb) =>
|
|
|
88
88
|
|
|
89
89
|
const TINYBASE_CONTEXT_KEY = TINYBASE + '_uisc';
|
|
90
90
|
|
|
91
|
-
/* functions.svelte.ts generated by Svelte v5.55.
|
|
91
|
+
/* functions.svelte.ts generated by Svelte v5.55.4 */
|
|
92
92
|
|
|
93
93
|
class ReactiveHandle {
|
|
94
94
|
#get;
|
|
@@ -443,7 +443,7 @@ var root_3$3 = $.from_html(`<input type="number"/>`);
|
|
|
443
443
|
var root_4$4 = $.from_html(`<input type="checkbox"/>`);
|
|
444
444
|
var root_5$3 = $.from_html(`<input/>`);
|
|
445
445
|
var root_6$2 = $.from_html(`<input/>`);
|
|
446
|
-
var root$5 = $.from_html(`<div
|
|
446
|
+
var root$5 = $.from_html(`<div><!><!></div>`);
|
|
447
447
|
|
|
448
448
|
function EditableThing($$anchor, $$props) {
|
|
449
449
|
$.push($$props, true);
|
|
@@ -562,7 +562,7 @@ function EditableThing($$anchor, $$props) {
|
|
|
562
562
|
});
|
|
563
563
|
}
|
|
564
564
|
|
|
565
|
-
var node_1 = $.sibling(node
|
|
565
|
+
var node_1 = $.sibling(node);
|
|
566
566
|
|
|
567
567
|
{
|
|
568
568
|
var consequent_1 = ($$anchor) => {
|
|
@@ -1621,7 +1621,7 @@ function HtmlTable($$anchor, $$props) {
|
|
|
1621
1621
|
$.delegate(['click']);
|
|
1622
1622
|
|
|
1623
1623
|
var root_1$1 = $.from_html(
|
|
1624
|
-
`<button class="previous"></button
|
|
1624
|
+
`<button class="previous"></button><button class="next"></button> `,
|
|
1625
1625
|
1,
|
|
1626
1626
|
);
|
|
1627
1627
|
var root$1 = $.from_html(`<!> `, 1);
|
|
@@ -1639,6 +1639,14 @@ function SortedTablePaginator($$anchor, $$props) {
|
|
|
1639
1639
|
const limit = $.derived(() => $$props.limit ?? $$props.total);
|
|
1640
1640
|
const singular = $.derived(() => $$props.singular ?? 'row');
|
|
1641
1641
|
const plural = $.derived(() => $$props.plural ?? $.get(singular) + 's');
|
|
1642
|
+
const rangeLabel = $.derived(
|
|
1643
|
+
() =>
|
|
1644
|
+
`${$.get(offset) + 1} to ${mathMin($$props.total, $.get(offset) + $.get(limit))} of `,
|
|
1645
|
+
);
|
|
1646
|
+
const totalLabel = $.derived(
|
|
1647
|
+
() =>
|
|
1648
|
+
`${$$props.total} ${$$props.total != 1 ? $.get(plural) : $.get(singular)}`,
|
|
1649
|
+
);
|
|
1642
1650
|
|
|
1643
1651
|
$.user_effect(() => {
|
|
1644
1652
|
if (($$props.offset ?? 0) > $$props.total || ($$props.offset ?? 0) < 0) {
|
|
@@ -1656,20 +1664,17 @@ function SortedTablePaginator($$anchor, $$props) {
|
|
|
1656
1664
|
|
|
1657
1665
|
button.textContent = '←';
|
|
1658
1666
|
|
|
1659
|
-
var button_1 = $.sibling(button
|
|
1667
|
+
var button_1 = $.sibling(button);
|
|
1660
1668
|
|
|
1661
1669
|
button_1.textContent = '→';
|
|
1662
1670
|
|
|
1663
|
-
var text = $.sibling(button_1);
|
|
1671
|
+
var text = $.sibling(button_1, 1, true);
|
|
1664
1672
|
|
|
1665
|
-
$.template_effect(
|
|
1666
|
-
(
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
},
|
|
1671
|
-
[() => mathMin($$props.total, $.get(offset) + $.get(limit))],
|
|
1672
|
-
);
|
|
1673
|
+
$.template_effect(() => {
|
|
1674
|
+
button.disabled = $.get(offset) == 0;
|
|
1675
|
+
button_1.disabled = $.get(offset) + $.get(limit) >= $$props.total;
|
|
1676
|
+
$.set_text(text, $.get(rangeLabel));
|
|
1677
|
+
});
|
|
1673
1678
|
|
|
1674
1679
|
$.delegated('click', button, () =>
|
|
1675
1680
|
$$props.onChange($.get(offset) - $.get(limit)),
|
|
@@ -1685,23 +1690,16 @@ function SortedTablePaginator($$anchor, $$props) {
|
|
|
1685
1690
|
});
|
|
1686
1691
|
}
|
|
1687
1692
|
|
|
1688
|
-
var text_1 = $.sibling(node);
|
|
1689
|
-
|
|
1690
|
-
$.template_effect(() =>
|
|
1691
|
-
$.set_text(
|
|
1692
|
-
text_1,
|
|
1693
|
-
` ${$$props.total ?? ''}
|
|
1694
|
-
${($$props.total != 1 ? $.get(plural) : $.get(singular)) ?? ''}`,
|
|
1695
|
-
),
|
|
1696
|
-
);
|
|
1693
|
+
var text_1 = $.sibling(node, 1, true);
|
|
1697
1694
|
|
|
1695
|
+
$.template_effect(() => $.set_text(text_1, $.get(totalLabel)));
|
|
1698
1696
|
$.append($$anchor, fragment);
|
|
1699
1697
|
$.pop();
|
|
1700
1698
|
}
|
|
1701
1699
|
|
|
1702
1700
|
$.delegate(['click']);
|
|
1703
1701
|
|
|
1704
|
-
/* sortingAndPagination.svelte.ts generated by Svelte v5.55.
|
|
1702
|
+
/* sortingAndPagination.svelte.ts generated by Svelte v5.55.4 */
|
|
1705
1703
|
|
|
1706
1704
|
const createSortingAndPagination = (
|
|
1707
1705
|
getCellId,
|
|
@@ -88,7 +88,7 @@ const objMap = (obj, cb) =>
|
|
|
88
88
|
|
|
89
89
|
const TINYBASE_CONTEXT_KEY = TINYBASE + '_uisc';
|
|
90
90
|
|
|
91
|
-
/* functions.svelte.ts generated by Svelte v5.55.
|
|
91
|
+
/* functions.svelte.ts generated by Svelte v5.55.4 */
|
|
92
92
|
|
|
93
93
|
class ReactiveHandle {
|
|
94
94
|
#get;
|
|
@@ -443,7 +443,7 @@ var root_3$3 = $.from_html(`<input type="number"/>`);
|
|
|
443
443
|
var root_4$4 = $.from_html(`<input type="checkbox"/>`);
|
|
444
444
|
var root_5$3 = $.from_html(`<input/>`);
|
|
445
445
|
var root_6$2 = $.from_html(`<input/>`);
|
|
446
|
-
var root$5 = $.from_html(`<div
|
|
446
|
+
var root$5 = $.from_html(`<div><!><!></div>`);
|
|
447
447
|
|
|
448
448
|
function EditableThing($$anchor, $$props) {
|
|
449
449
|
$.push($$props, true);
|
|
@@ -562,7 +562,7 @@ function EditableThing($$anchor, $$props) {
|
|
|
562
562
|
});
|
|
563
563
|
}
|
|
564
564
|
|
|
565
|
-
var node_1 = $.sibling(node
|
|
565
|
+
var node_1 = $.sibling(node);
|
|
566
566
|
|
|
567
567
|
{
|
|
568
568
|
var consequent_1 = ($$anchor) => {
|
|
@@ -1621,7 +1621,7 @@ function HtmlTable($$anchor, $$props) {
|
|
|
1621
1621
|
$.delegate(['click']);
|
|
1622
1622
|
|
|
1623
1623
|
var root_1$1 = $.from_html(
|
|
1624
|
-
`<button class="previous"></button
|
|
1624
|
+
`<button class="previous"></button><button class="next"></button> `,
|
|
1625
1625
|
1,
|
|
1626
1626
|
);
|
|
1627
1627
|
var root$1 = $.from_html(`<!> `, 1);
|
|
@@ -1639,6 +1639,14 @@ function SortedTablePaginator($$anchor, $$props) {
|
|
|
1639
1639
|
const limit = $.derived(() => $$props.limit ?? $$props.total);
|
|
1640
1640
|
const singular = $.derived(() => $$props.singular ?? 'row');
|
|
1641
1641
|
const plural = $.derived(() => $$props.plural ?? $.get(singular) + 's');
|
|
1642
|
+
const rangeLabel = $.derived(
|
|
1643
|
+
() =>
|
|
1644
|
+
`${$.get(offset) + 1} to ${mathMin($$props.total, $.get(offset) + $.get(limit))} of `,
|
|
1645
|
+
);
|
|
1646
|
+
const totalLabel = $.derived(
|
|
1647
|
+
() =>
|
|
1648
|
+
`${$$props.total} ${$$props.total != 1 ? $.get(plural) : $.get(singular)}`,
|
|
1649
|
+
);
|
|
1642
1650
|
|
|
1643
1651
|
$.user_effect(() => {
|
|
1644
1652
|
if (($$props.offset ?? 0) > $$props.total || ($$props.offset ?? 0) < 0) {
|
|
@@ -1656,20 +1664,17 @@ function SortedTablePaginator($$anchor, $$props) {
|
|
|
1656
1664
|
|
|
1657
1665
|
button.textContent = '←';
|
|
1658
1666
|
|
|
1659
|
-
var button_1 = $.sibling(button
|
|
1667
|
+
var button_1 = $.sibling(button);
|
|
1660
1668
|
|
|
1661
1669
|
button_1.textContent = '→';
|
|
1662
1670
|
|
|
1663
|
-
var text = $.sibling(button_1);
|
|
1671
|
+
var text = $.sibling(button_1, 1, true);
|
|
1664
1672
|
|
|
1665
|
-
$.template_effect(
|
|
1666
|
-
(
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
},
|
|
1671
|
-
[() => mathMin($$props.total, $.get(offset) + $.get(limit))],
|
|
1672
|
-
);
|
|
1673
|
+
$.template_effect(() => {
|
|
1674
|
+
button.disabled = $.get(offset) == 0;
|
|
1675
|
+
button_1.disabled = $.get(offset) + $.get(limit) >= $$props.total;
|
|
1676
|
+
$.set_text(text, $.get(rangeLabel));
|
|
1677
|
+
});
|
|
1673
1678
|
|
|
1674
1679
|
$.delegated('click', button, () =>
|
|
1675
1680
|
$$props.onChange($.get(offset) - $.get(limit)),
|
|
@@ -1685,23 +1690,16 @@ function SortedTablePaginator($$anchor, $$props) {
|
|
|
1685
1690
|
});
|
|
1686
1691
|
}
|
|
1687
1692
|
|
|
1688
|
-
var text_1 = $.sibling(node);
|
|
1689
|
-
|
|
1690
|
-
$.template_effect(() =>
|
|
1691
|
-
$.set_text(
|
|
1692
|
-
text_1,
|
|
1693
|
-
` ${$$props.total ?? ''}
|
|
1694
|
-
${($$props.total != 1 ? $.get(plural) : $.get(singular)) ?? ''}`,
|
|
1695
|
-
),
|
|
1696
|
-
);
|
|
1693
|
+
var text_1 = $.sibling(node, 1, true);
|
|
1697
1694
|
|
|
1695
|
+
$.template_effect(() => $.set_text(text_1, $.get(totalLabel)));
|
|
1698
1696
|
$.append($$anchor, fragment);
|
|
1699
1697
|
$.pop();
|
|
1700
1698
|
}
|
|
1701
1699
|
|
|
1702
1700
|
$.delegate(['click']);
|
|
1703
1701
|
|
|
1704
|
-
/* sortingAndPagination.svelte.ts generated by Svelte v5.55.
|
|
1702
|
+
/* sortingAndPagination.svelte.ts generated by Svelte v5.55.4 */
|
|
1705
1703
|
|
|
1706
1704
|
const createSortingAndPagination = (
|
|
1707
1705
|
getCellId,
|
|
@@ -2874,7 +2874,7 @@ const createStore = () => {
|
|
|
2874
2874
|
|
|
2875
2875
|
const TINYBASE_CONTEXT_KEY = TINYBASE + '_uisc';
|
|
2876
2876
|
|
|
2877
|
-
/* functions.svelte.ts generated by Svelte v5.55.
|
|
2877
|
+
/* functions.svelte.ts generated by Svelte v5.55.4 */
|
|
2878
2878
|
|
|
2879
2879
|
class ReactiveHandle {
|
|
2880
2880
|
#get;
|
|
@@ -3472,7 +3472,7 @@ var root_3$3 = $.from_html(`<input type="number"/>`);
|
|
|
3472
3472
|
var root_4$5 = $.from_html(`<input type="checkbox"/>`);
|
|
3473
3473
|
var root_5$5 = $.from_html(`<input/>`);
|
|
3474
3474
|
var root_6$2 = $.from_html(`<input/>`);
|
|
3475
|
-
var root$b = $.from_html(`<div
|
|
3475
|
+
var root$b = $.from_html(`<div><!><!></div>`);
|
|
3476
3476
|
|
|
3477
3477
|
function EditableThing($$anchor, $$props) {
|
|
3478
3478
|
$.push($$props, true);
|
|
@@ -3591,7 +3591,7 @@ function EditableThing($$anchor, $$props) {
|
|
|
3591
3591
|
});
|
|
3592
3592
|
}
|
|
3593
3593
|
|
|
3594
|
-
var node_1 = $.sibling(node
|
|
3594
|
+
var node_1 = $.sibling(node);
|
|
3595
3595
|
|
|
3596
3596
|
{
|
|
3597
3597
|
var consequent_1 = ($$anchor) => {
|
|
@@ -4650,7 +4650,7 @@ function HtmlTable($$anchor, $$props) {
|
|
|
4650
4650
|
$.delegate(['click']);
|
|
4651
4651
|
|
|
4652
4652
|
var root_1$8 = $.from_html(
|
|
4653
|
-
`<button class="previous"></button
|
|
4653
|
+
`<button class="previous"></button><button class="next"></button> `,
|
|
4654
4654
|
1,
|
|
4655
4655
|
);
|
|
4656
4656
|
var root$7 = $.from_html(`<!> `, 1);
|
|
@@ -4668,6 +4668,14 @@ function SortedTablePaginator($$anchor, $$props) {
|
|
|
4668
4668
|
const limit = $.derived(() => $$props.limit ?? $$props.total);
|
|
4669
4669
|
const singular = $.derived(() => $$props.singular ?? 'row');
|
|
4670
4670
|
const plural = $.derived(() => $$props.plural ?? $.get(singular) + 's');
|
|
4671
|
+
const rangeLabel = $.derived(
|
|
4672
|
+
() =>
|
|
4673
|
+
`${$.get(offset) + 1} to ${mathMin($$props.total, $.get(offset) + $.get(limit))} of `,
|
|
4674
|
+
);
|
|
4675
|
+
const totalLabel = $.derived(
|
|
4676
|
+
() =>
|
|
4677
|
+
`${$$props.total} ${$$props.total != 1 ? $.get(plural) : $.get(singular)}`,
|
|
4678
|
+
);
|
|
4671
4679
|
|
|
4672
4680
|
$.user_effect(() => {
|
|
4673
4681
|
if (($$props.offset ?? 0) > $$props.total || ($$props.offset ?? 0) < 0) {
|
|
@@ -4685,20 +4693,17 @@ function SortedTablePaginator($$anchor, $$props) {
|
|
|
4685
4693
|
|
|
4686
4694
|
button.textContent = '←';
|
|
4687
4695
|
|
|
4688
|
-
var button_1 = $.sibling(button
|
|
4696
|
+
var button_1 = $.sibling(button);
|
|
4689
4697
|
|
|
4690
4698
|
button_1.textContent = '→';
|
|
4691
4699
|
|
|
4692
|
-
var text = $.sibling(button_1);
|
|
4700
|
+
var text = $.sibling(button_1, 1, true);
|
|
4693
4701
|
|
|
4694
|
-
$.template_effect(
|
|
4695
|
-
(
|
|
4696
|
-
|
|
4697
|
-
|
|
4698
|
-
|
|
4699
|
-
},
|
|
4700
|
-
[() => mathMin($$props.total, $.get(offset) + $.get(limit))],
|
|
4701
|
-
);
|
|
4702
|
+
$.template_effect(() => {
|
|
4703
|
+
button.disabled = $.get(offset) == 0;
|
|
4704
|
+
button_1.disabled = $.get(offset) + $.get(limit) >= $$props.total;
|
|
4705
|
+
$.set_text(text, $.get(rangeLabel));
|
|
4706
|
+
});
|
|
4702
4707
|
|
|
4703
4708
|
$.delegated('click', button, () =>
|
|
4704
4709
|
$$props.onChange($.get(offset) - $.get(limit)),
|
|
@@ -4714,23 +4719,16 @@ function SortedTablePaginator($$anchor, $$props) {
|
|
|
4714
4719
|
});
|
|
4715
4720
|
}
|
|
4716
4721
|
|
|
4717
|
-
var text_1 = $.sibling(node);
|
|
4718
|
-
|
|
4719
|
-
$.template_effect(() =>
|
|
4720
|
-
$.set_text(
|
|
4721
|
-
text_1,
|
|
4722
|
-
` ${$$props.total ?? ''}
|
|
4723
|
-
${($$props.total != 1 ? $.get(plural) : $.get(singular)) ?? ''}`,
|
|
4724
|
-
),
|
|
4725
|
-
);
|
|
4722
|
+
var text_1 = $.sibling(node, 1, true);
|
|
4726
4723
|
|
|
4724
|
+
$.template_effect(() => $.set_text(text_1, $.get(totalLabel)));
|
|
4727
4725
|
$.append($$anchor, fragment);
|
|
4728
4726
|
$.pop();
|
|
4729
4727
|
}
|
|
4730
4728
|
|
|
4731
4729
|
$.delegate(['click']);
|
|
4732
4730
|
|
|
4733
|
-
/* sortingAndPagination.svelte.ts generated by Svelte v5.55.
|
|
4731
|
+
/* sortingAndPagination.svelte.ts generated by Svelte v5.55.4 */
|
|
4734
4732
|
|
|
4735
4733
|
const createSortingAndPagination = (
|
|
4736
4734
|
getCellId,
|
|
@@ -2874,7 +2874,7 @@ const createStore = () => {
|
|
|
2874
2874
|
|
|
2875
2875
|
const TINYBASE_CONTEXT_KEY = TINYBASE + '_uisc';
|
|
2876
2876
|
|
|
2877
|
-
/* functions.svelte.ts generated by Svelte v5.55.
|
|
2877
|
+
/* functions.svelte.ts generated by Svelte v5.55.4 */
|
|
2878
2878
|
|
|
2879
2879
|
class ReactiveHandle {
|
|
2880
2880
|
#get;
|
|
@@ -3472,7 +3472,7 @@ var root_3$3 = $.from_html(`<input type="number"/>`);
|
|
|
3472
3472
|
var root_4$5 = $.from_html(`<input type="checkbox"/>`);
|
|
3473
3473
|
var root_5$5 = $.from_html(`<input/>`);
|
|
3474
3474
|
var root_6$2 = $.from_html(`<input/>`);
|
|
3475
|
-
var root$b = $.from_html(`<div
|
|
3475
|
+
var root$b = $.from_html(`<div><!><!></div>`);
|
|
3476
3476
|
|
|
3477
3477
|
function EditableThing($$anchor, $$props) {
|
|
3478
3478
|
$.push($$props, true);
|
|
@@ -3591,7 +3591,7 @@ function EditableThing($$anchor, $$props) {
|
|
|
3591
3591
|
});
|
|
3592
3592
|
}
|
|
3593
3593
|
|
|
3594
|
-
var node_1 = $.sibling(node
|
|
3594
|
+
var node_1 = $.sibling(node);
|
|
3595
3595
|
|
|
3596
3596
|
{
|
|
3597
3597
|
var consequent_1 = ($$anchor) => {
|
|
@@ -4650,7 +4650,7 @@ function HtmlTable($$anchor, $$props) {
|
|
|
4650
4650
|
$.delegate(['click']);
|
|
4651
4651
|
|
|
4652
4652
|
var root_1$8 = $.from_html(
|
|
4653
|
-
`<button class="previous"></button
|
|
4653
|
+
`<button class="previous"></button><button class="next"></button> `,
|
|
4654
4654
|
1,
|
|
4655
4655
|
);
|
|
4656
4656
|
var root$7 = $.from_html(`<!> `, 1);
|
|
@@ -4668,6 +4668,14 @@ function SortedTablePaginator($$anchor, $$props) {
|
|
|
4668
4668
|
const limit = $.derived(() => $$props.limit ?? $$props.total);
|
|
4669
4669
|
const singular = $.derived(() => $$props.singular ?? 'row');
|
|
4670
4670
|
const plural = $.derived(() => $$props.plural ?? $.get(singular) + 's');
|
|
4671
|
+
const rangeLabel = $.derived(
|
|
4672
|
+
() =>
|
|
4673
|
+
`${$.get(offset) + 1} to ${mathMin($$props.total, $.get(offset) + $.get(limit))} of `,
|
|
4674
|
+
);
|
|
4675
|
+
const totalLabel = $.derived(
|
|
4676
|
+
() =>
|
|
4677
|
+
`${$$props.total} ${$$props.total != 1 ? $.get(plural) : $.get(singular)}`,
|
|
4678
|
+
);
|
|
4671
4679
|
|
|
4672
4680
|
$.user_effect(() => {
|
|
4673
4681
|
if (($$props.offset ?? 0) > $$props.total || ($$props.offset ?? 0) < 0) {
|
|
@@ -4685,20 +4693,17 @@ function SortedTablePaginator($$anchor, $$props) {
|
|
|
4685
4693
|
|
|
4686
4694
|
button.textContent = '←';
|
|
4687
4695
|
|
|
4688
|
-
var button_1 = $.sibling(button
|
|
4696
|
+
var button_1 = $.sibling(button);
|
|
4689
4697
|
|
|
4690
4698
|
button_1.textContent = '→';
|
|
4691
4699
|
|
|
4692
|
-
var text = $.sibling(button_1);
|
|
4700
|
+
var text = $.sibling(button_1, 1, true);
|
|
4693
4701
|
|
|
4694
|
-
$.template_effect(
|
|
4695
|
-
(
|
|
4696
|
-
|
|
4697
|
-
|
|
4698
|
-
|
|
4699
|
-
},
|
|
4700
|
-
[() => mathMin($$props.total, $.get(offset) + $.get(limit))],
|
|
4701
|
-
);
|
|
4702
|
+
$.template_effect(() => {
|
|
4703
|
+
button.disabled = $.get(offset) == 0;
|
|
4704
|
+
button_1.disabled = $.get(offset) + $.get(limit) >= $$props.total;
|
|
4705
|
+
$.set_text(text, $.get(rangeLabel));
|
|
4706
|
+
});
|
|
4702
4707
|
|
|
4703
4708
|
$.delegated('click', button, () =>
|
|
4704
4709
|
$$props.onChange($.get(offset) - $.get(limit)),
|
|
@@ -4714,23 +4719,16 @@ function SortedTablePaginator($$anchor, $$props) {
|
|
|
4714
4719
|
});
|
|
4715
4720
|
}
|
|
4716
4721
|
|
|
4717
|
-
var text_1 = $.sibling(node);
|
|
4718
|
-
|
|
4719
|
-
$.template_effect(() =>
|
|
4720
|
-
$.set_text(
|
|
4721
|
-
text_1,
|
|
4722
|
-
` ${$$props.total ?? ''}
|
|
4723
|
-
${($$props.total != 1 ? $.get(plural) : $.get(singular)) ?? ''}`,
|
|
4724
|
-
),
|
|
4725
|
-
);
|
|
4722
|
+
var text_1 = $.sibling(node, 1, true);
|
|
4726
4723
|
|
|
4724
|
+
$.template_effect(() => $.set_text(text_1, $.get(totalLabel)));
|
|
4727
4725
|
$.append($$anchor, fragment);
|
|
4728
4726
|
$.pop();
|
|
4729
4727
|
}
|
|
4730
4728
|
|
|
4731
4729
|
$.delegate(['click']);
|
|
4732
4730
|
|
|
4733
|
-
/* sortingAndPagination.svelte.ts generated by Svelte v5.55.
|
|
4731
|
+
/* sortingAndPagination.svelte.ts generated by Svelte v5.55.4 */
|
|
4734
4732
|
|
|
4735
4733
|
const createSortingAndPagination = (
|
|
4736
4734
|
getCellId,
|