@3birds/midori-ui 0.0.52 → 0.0.54
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.
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
<script lang="ts">
|
|
25
25
|
import { onMount } from 'svelte';
|
|
26
26
|
import { dev } from '$app/environment';
|
|
27
|
-
import {
|
|
27
|
+
import { env } from '$env/dynamic/public';
|
|
28
28
|
|
|
29
29
|
let {
|
|
30
30
|
slot = '8044265066',
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
|
|
41
41
|
onMount(async () => {
|
|
42
42
|
try {
|
|
43
|
-
await loadAdsense(PUBLIC_ADSENSE_CLIENT);
|
|
43
|
+
await loadAdsense(env.PUBLIC_ADSENSE_CLIENT);
|
|
44
44
|
(window.adsbygoogle = window.adsbygoogle || []).push({});
|
|
45
45
|
} catch (e) {
|
|
46
46
|
console.warn(e);
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
<ins
|
|
52
52
|
class="adsbygoogle {className}"
|
|
53
53
|
style="display:block"
|
|
54
|
-
data-ad-client={PUBLIC_ADSENSE_CLIENT}
|
|
54
|
+
data-ad-client={env.PUBLIC_ADSENSE_CLIENT}
|
|
55
55
|
data-ad-slot={slot}
|
|
56
56
|
data-ad-format={format}
|
|
57
57
|
data-full-width-responsive={responsive}
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { page as pageState } from '$app/state';
|
|
3
|
-
import { Btn } from '
|
|
3
|
+
import { Btn } from '..';
|
|
4
4
|
|
|
5
5
|
let {
|
|
6
|
-
value = $bindable(),
|
|
7
6
|
per,
|
|
8
7
|
deadend,
|
|
9
8
|
class: className
|
|
10
|
-
}: {
|
|
9
|
+
}: { per: number; deadend: boolean; class?: string } = $props();
|
|
10
|
+
|
|
11
|
+
const pageQuery = $derived(Number(pageState.url.searchParams.get('page')) || 1);
|
|
11
12
|
|
|
12
13
|
const generatePaginationHref = (value: number): string => {
|
|
13
14
|
const searchParams: URLSearchParams = new URLSearchParams(pageState.url.searchParams);
|
|
@@ -17,12 +18,12 @@
|
|
|
17
18
|
return `${pageState.url.pathname}?${searchParams.toString()}`;
|
|
18
19
|
};
|
|
19
20
|
|
|
20
|
-
const prevHref = $derived(
|
|
21
|
-
const nextHref = $derived(deadend ? '' : generatePaginationHref(
|
|
21
|
+
const prevHref = $derived(pageQuery === 1 ? '' : generatePaginationHref(pageQuery - 1));
|
|
22
|
+
const nextHref = $derived(deadend ? '' : generatePaginationHref(pageQuery + 1));
|
|
22
23
|
</script>
|
|
23
24
|
|
|
24
25
|
<div class="join col-span-8 col-start-3 grid grid-cols-2 {className}">
|
|
25
|
-
<Btn class="join-item rounded-r-none btn-outline" href={prevHref} disabled={
|
|
26
|
+
<Btn class="join-item rounded-r-none btn-outline" href={prevHref} disabled={pageQuery === 1}
|
|
26
27
|
>前の{per}件</Btn
|
|
27
28
|
>
|
|
28
29
|
<Btn class="join-item rounded-l-none btn-outline" disabled={deadend} href={nextHref}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
type $$ComponentProps = {
|
|
2
|
-
value: number;
|
|
3
2
|
per: number;
|
|
4
3
|
deadend: boolean;
|
|
5
4
|
class?: string;
|
|
6
5
|
};
|
|
7
|
-
declare const Pagination: import("svelte").Component<$$ComponentProps, {}, "
|
|
6
|
+
declare const Pagination: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
8
7
|
type Pagination = ReturnType<typeof Pagination>;
|
|
9
8
|
export default Pagination;
|
package/dist/types/index.d.ts
CHANGED