@zhangt58/svelte-vtable 0.4.1 → 0.4.2
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.
|
@@ -29,6 +29,8 @@
|
|
|
29
29
|
className = '',
|
|
30
30
|
// callback when perPage changes: onperpage({ perPage })
|
|
31
31
|
onperpage = undefined,
|
|
32
|
+
// set false to hide the Filters button (e.g. when inline column filters are in use)
|
|
33
|
+
showFilters = true,
|
|
32
34
|
} = $props();
|
|
33
35
|
|
|
34
36
|
const perPageOptions = [
|
|
@@ -196,6 +198,7 @@
|
|
|
196
198
|
<div class="flex-1">
|
|
197
199
|
<div class="flex items-center gap-2">
|
|
198
200
|
<!-- Styled button to open/close filters modal -->
|
|
201
|
+
{#if showFilters}
|
|
199
202
|
<div class="flex items-center gap-1 relative">
|
|
200
203
|
<button
|
|
201
204
|
type="button"
|
|
@@ -237,6 +240,7 @@
|
|
|
237
240
|
>
|
|
238
241
|
{/if}
|
|
239
242
|
</div>
|
|
243
|
+
{/if}
|
|
240
244
|
|
|
241
245
|
<div class="vtable-search-wrapper relative flex items-center">
|
|
242
246
|
<svg
|
|
@@ -320,6 +324,7 @@
|
|
|
320
324
|
</div>
|
|
321
325
|
</div>
|
|
322
326
|
|
|
327
|
+
{#if showFilters}
|
|
323
328
|
<FiltersModal
|
|
324
329
|
bind:open={filtersVisible}
|
|
325
330
|
columnFilters={effectiveColumnFilters}
|
|
@@ -329,6 +334,7 @@
|
|
|
329
334
|
{showCounts}
|
|
330
335
|
{className}
|
|
331
336
|
/>
|
|
337
|
+
{/if}
|
|
332
338
|
|
|
333
339
|
<style>/* ── Theming contract — override these on :root or any wrapper element ── */
|
|
334
340
|
:root {
|
|
@@ -21,6 +21,7 @@ declare const DataTableControls: import("svelte").Component<{
|
|
|
21
21
|
showCounts?: boolean;
|
|
22
22
|
className?: string;
|
|
23
23
|
onperpage?: any;
|
|
24
|
+
showFilters?: boolean;
|
|
24
25
|
}, {}, "perPage">;
|
|
25
26
|
type $$ComponentProps = {
|
|
26
27
|
search?: string;
|
|
@@ -40,4 +41,5 @@ type $$ComponentProps = {
|
|
|
40
41
|
showCounts?: boolean;
|
|
41
42
|
className?: string;
|
|
42
43
|
onperpage?: any;
|
|
44
|
+
showFilters?: boolean;
|
|
43
45
|
};
|
|
@@ -30,6 +30,8 @@
|
|
|
30
30
|
className = '',
|
|
31
31
|
// callback when perPage changes: onperpage({ perPage })
|
|
32
32
|
onperpage = undefined,
|
|
33
|
+
// set false to hide the Filters button (e.g. when inline column filters are in use)
|
|
34
|
+
showFilters = true,
|
|
33
35
|
} = $props();
|
|
34
36
|
|
|
35
37
|
const perPageOptions = [
|
|
@@ -197,6 +199,7 @@
|
|
|
197
199
|
<div class="flex-1">
|
|
198
200
|
<div class="flex items-center gap-2">
|
|
199
201
|
<!-- Styled button to open/close filters modal -->
|
|
202
|
+
{#if showFilters}
|
|
200
203
|
<div class="flex items-center gap-1 relative">
|
|
201
204
|
<button
|
|
202
205
|
type="button"
|
|
@@ -238,6 +241,7 @@
|
|
|
238
241
|
>
|
|
239
242
|
{/if}
|
|
240
243
|
</div>
|
|
244
|
+
{/if}
|
|
241
245
|
|
|
242
246
|
<Search
|
|
243
247
|
size="sm"
|
|
@@ -271,6 +275,7 @@
|
|
|
271
275
|
</div>
|
|
272
276
|
</div>
|
|
273
277
|
|
|
278
|
+
{#if showFilters}
|
|
274
279
|
<FiltersModal
|
|
275
280
|
bind:open={filtersVisible}
|
|
276
281
|
columnFilters={effectiveColumnFilters}
|
|
@@ -280,6 +285,7 @@
|
|
|
280
285
|
{showCounts}
|
|
281
286
|
{className}
|
|
282
287
|
/>
|
|
288
|
+
{/if}
|
|
283
289
|
|
|
284
290
|
<style>/* ── Theming contract — override these on :root or any wrapper element ── */
|
|
285
291
|
:root {
|
|
@@ -21,6 +21,7 @@ declare const DataTableControls: import("svelte").Component<{
|
|
|
21
21
|
showCounts?: boolean;
|
|
22
22
|
className?: string;
|
|
23
23
|
onperpage?: any;
|
|
24
|
+
showFilters?: boolean;
|
|
24
25
|
}, {}, "perPage">;
|
|
25
26
|
type $$ComponentProps = {
|
|
26
27
|
search?: string;
|
|
@@ -40,4 +41,5 @@ type $$ComponentProps = {
|
|
|
40
41
|
showCounts?: boolean;
|
|
41
42
|
className?: string;
|
|
42
43
|
onperpage?: any;
|
|
44
|
+
showFilters?: boolean;
|
|
43
45
|
};
|