@cloudparker/moldex.js 0.0.107 → 0.0.108
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.
|
@@ -8,9 +8,9 @@ import {
|
|
|
8
8
|
mdiPageLast
|
|
9
9
|
} from "../../../icon";
|
|
10
10
|
let {
|
|
11
|
-
|
|
12
|
-
pageIndex = 0,
|
|
13
|
-
pageSize = 10,
|
|
11
|
+
itemsCount = $bindable(0),
|
|
12
|
+
pageIndex = $bindable(0),
|
|
13
|
+
pageSize = $bindable(10),
|
|
14
14
|
pageSizeOptions = [5, 10, 25, 50, 100, 200],
|
|
15
15
|
itemsText = "Items",
|
|
16
16
|
pageSizeText = "Page Size",
|
|
@@ -19,7 +19,7 @@ let {
|
|
|
19
19
|
onPageSizeChange,
|
|
20
20
|
onPageIndexChange
|
|
21
21
|
} = $props();
|
|
22
|
-
let pageCount = $derived(Math.ceil(
|
|
22
|
+
let pageCount = $derived(Math.ceil(itemsCount / pageSize));
|
|
23
23
|
let hasFirst = $derived(pageIndex > 0);
|
|
24
24
|
let hasPrev = $derived(pageIndex > 0);
|
|
25
25
|
let hasLast = $derived(pageIndex < pageCount - 1);
|
|
@@ -70,7 +70,7 @@ $effect(() => {
|
|
|
70
70
|
{/snippet}
|
|
71
71
|
|
|
72
72
|
<div class="flex items-center flex-wrap justify-end text-base-500 gap-3 -mb-2">
|
|
73
|
-
<div class="flex-grow">{itemsText} {
|
|
73
|
+
<div class="flex-grow">{itemsText} {itemsCount}</div>
|
|
74
74
|
<div class="flex items-center flex-nowrap gap-2">
|
|
75
75
|
<div>{pageSizeText}</div>
|
|
76
76
|
<div class="">
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
type PropsType = {
|
|
2
|
-
|
|
2
|
+
itemsCount?: number;
|
|
3
3
|
pageIndex?: number;
|
|
4
4
|
pageSize?: number;
|
|
5
5
|
pageSizeOptions?: number[];
|
|
@@ -10,6 +10,6 @@ type PropsType = {
|
|
|
10
10
|
onPageSizeChange?: (size: number) => void;
|
|
11
11
|
onPageIndexChange?: (index: number) => void;
|
|
12
12
|
};
|
|
13
|
-
declare const Pagination: import("svelte").Component<PropsType, {}, "">;
|
|
13
|
+
declare const Pagination: import("svelte").Component<PropsType, {}, "itemsCount" | "pageIndex" | "pageSize">;
|
|
14
14
|
type Pagination = ReturnType<typeof Pagination>;
|
|
15
15
|
export default Pagination;
|