@ibobbyts/svelte-ui-utils 0.3.8 → 0.4.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.
Files changed (39) hide show
  1. package/README.md +97 -21
  2. package/dist/data-table/BaseDataTable.svelte +5 -0
  3. package/dist/data-table/BaseDataTable.svelte.d.ts +1 -0
  4. package/dist/data-table/BaseDataTable.svelte.d.ts.map +1 -1
  5. package/dist/data-table/DataTable.svelte +141 -22
  6. package/dist/data-table/DataTable.svelte.d.ts +3 -8
  7. package/dist/data-table/DataTable.svelte.d.ts.map +1 -1
  8. package/dist/data-table/FilterControl.svelte +64 -18
  9. package/dist/data-table/FilterControl.svelte.d.ts.map +1 -1
  10. package/dist/data-table/FilterTable.svelte +2 -1
  11. package/dist/data-table/FilterTable.svelte.d.ts +1 -0
  12. package/dist/data-table/FilterTable.svelte.d.ts.map +1 -1
  13. package/dist/data-table/filter.d.ts +3 -1
  14. package/dist/data-table/filter.d.ts.map +1 -1
  15. package/dist/data-table/filter.js +4 -0
  16. package/dist/data-table/index.d.ts +1 -1
  17. package/dist/data-table/index.d.ts.map +1 -1
  18. package/dist/data-table/types.d.ts +37 -3
  19. package/dist/data-table/types.d.ts.map +1 -1
  20. package/dist/dropdown/DropdownMultiSelect.svelte +1 -1
  21. package/dist/dropdown-search/DropdownSearch.svelte +30 -0
  22. package/dist/dropdown-search/DropdownSearch.svelte.d.ts.map +1 -1
  23. package/dist/index.d.ts +1 -0
  24. package/dist/index.d.ts.map +1 -1
  25. package/dist/index.js +1 -0
  26. package/dist/ordered-list/OrderedListEditor.svelte +1 -1
  27. package/dist/pagination/Pagination.svelte +9 -0
  28. package/dist/pagination/Pagination.svelte.d.ts +1 -0
  29. package/dist/pagination/Pagination.svelte.d.ts.map +1 -1
  30. package/dist/sortable-list/SortableList.svelte +1 -1
  31. package/dist/sortable-table/SortableTable.svelte +1 -1
  32. package/dist/style.css +101 -23
  33. package/dist/tooltip/Tooltip.svelte +149 -0
  34. package/dist/tooltip/Tooltip.svelte.d.ts +22 -0
  35. package/dist/tooltip/Tooltip.svelte.d.ts.map +1 -0
  36. package/dist/tooltip/index.d.ts +2 -0
  37. package/dist/tooltip/index.d.ts.map +1 -0
  38. package/dist/tooltip/index.js +1 -0
  39. package/package.json +1 -1
package/README.md CHANGED
@@ -507,7 +507,16 @@ can stop event propagation without preventing the dropdown from opening.
507
507
 
508
508
  ```svelte
509
509
  <script lang="ts">
510
- import { DataTable } from '@ibobbyts/svelte-ui-utils/table';
510
+ import {
511
+ DataTable,
512
+ type PaginationState,
513
+ type SortState
514
+ } from '@ibobbyts/svelte-ui-utils/table';
515
+
516
+ type UserRow = {
517
+ name: string;
518
+ createdAt: string;
519
+ };
511
520
 
512
521
  const columns = [
513
522
  { key: 'name', header: 'Name', sortable: true },
@@ -522,9 +531,27 @@ can stop event propagation without preventing the dropdown from opening.
522
531
  }
523
532
  ];
524
533
 
525
- let sort = null;
526
- let page = 1;
527
- let pageSize = 20;
534
+ let rows: UserRow[] = [];
535
+ let totalRows = 0;
536
+ let searchTerm = '';
537
+ let sort: SortState | null = null;
538
+
539
+ async function loadRows({ page, pageSize }: PaginationState) {
540
+ const params = new URLSearchParams({
541
+ page: String(page),
542
+ pageSize: String(pageSize),
543
+ search: searchTerm
544
+ });
545
+ const response = await fetch(`/api/users?${params}`);
546
+
547
+ if (!response.ok) {
548
+ throw new Error('Failed to load users');
549
+ }
550
+
551
+ const result = (await response.json()) as { rows: UserRow[]; totalRows: number };
552
+ rows = result.rows;
553
+ totalRows = result.totalRows;
554
+ }
528
555
  </script>
529
556
 
530
557
  <DataTable
@@ -532,31 +559,53 @@ can stop event propagation without preventing the dropdown from opening.
532
559
  rows={rows}
533
560
  {columns}
534
561
  {sort}
535
- {page}
536
- {pageSize}
537
- totalRows={totalRows}
562
+ pagination={{
563
+ tableId: 'admin-users',
564
+ totalRows,
565
+ defaultPageSize: 20,
566
+ pageSizeOptions: [10, 20, 50, 100],
567
+ persistPageSize: true,
568
+ queryKey: searchTerm,
569
+ onRequest: loadRows
570
+ }}
538
571
  tableLayout="auto"
539
572
  stickyHeader={true}
540
573
  onSortChange={(next) => {
541
574
  sort = next;
542
- page = 1;
543
- }}
544
- onPaginationChange={(next) => {
545
- page = next.page;
546
- pageSize = next.pageSize;
547
575
  }}
548
576
  />
549
577
  ```
550
578
 
579
+ `DataTable` only supports server pagination. Pass the current page rows in
580
+ `rows`, the server count in `pagination.totalRows`, and load each requested page
581
+ through `pagination.onRequest`. The component owns page and page-size state,
582
+ resets to page `1` when the primitive `queryKey` changes, disables both
583
+ pagination bars while a request is pending, and rolls back its controls if that
584
+ request rejects. The callback remains responsible for presenting request errors.
585
+
586
+ Set `persistPageSize: true` and provide a stable, non-empty `tableId` to retain
587
+ the selected page size in browser `localStorage`. The generated key is
588
+ `svelte-ui-utils:data-table:<tableId>:page-size`; callers do not construct it.
589
+ Stored values are accepted only when present in the normalized
590
+ `pageSizeOptions`. Storage failures are ignored. Options default to
591
+ `[10, 20, 50, 100]`, and `defaultPageSize` falls back to the first unique
592
+ positive integer option when omitted or invalid.
593
+
551
594
  `DataTable` renders page-number pagination above and below the data table by
552
595
  default, including a page-size selector. Use `language` for package-owned
553
596
  defaults such as empty state, pagination label, and page-size label; use
554
- `pageSizeLabel` or `emptyText` when a specific app needs to override them.
555
- Use `showPagination={false}` for static tables. Use `showHeader={false}` for
597
+ `pagination.pageSizeLabel` or `emptyText` when a specific app needs to override
598
+ them.
599
+ Pass `pagination={false}` for static tables. Use `showHeader={false}` for
556
600
  tables that should render body rows without a header section. Sortable headers
557
601
  preserve the current window scroll position by default and wait for an async
558
602
  `onSortChange` before restoring scroll position.
559
603
 
604
+ Body rows change background on pointer hover by default. Set
605
+ `hoverable={false}` to disable that behavior. When `zebra={false}`, the body
606
+ uses `var(--suu-color-bg)` as its explicit background instead of alternating
607
+ row colors.
608
+
560
609
  Column alignment is configured separately for headers and body cells.
561
610
  Horizontal alignment accepts `left`, `center`, or `right`; vertical alignment
562
611
  accepts `top`, `middle`, or `bottom`. Header alignment defaults to
@@ -585,9 +634,10 @@ pagination outside `DataTable`:
585
634
  />
586
635
  ```
587
636
 
588
- Render two synchronized pagination bars by passing both instances the same
589
- controlled `pagination` value and the same `onPaginationChange` handler. This
590
- is the same contract `DataTable` uses for its top and bottom pagination.
637
+ Render two synchronized standalone pagination bars by passing both instances
638
+ the same controlled `pagination` value and the same `onPaginationChange`
639
+ handler. Standalone `Pagination` remains controlled; `DataTable` owns its own
640
+ server-pagination state.
591
641
 
592
642
  `FilterTable` is filter-only. It accepts `rows`, where each row has a `title`
593
643
  for the left column and a controlled filter created with the `filter` helper:
@@ -632,6 +682,10 @@ for the left column and a controlled filter created with the `filter` helper:
632
682
  <FilterTable rows={filterRows} language="en_us" />
633
683
  ```
634
684
 
685
+ `FilterTable` uses the same `1px solid var(--suu-color-border)` outer border
686
+ and `var(--suu-radius)` corner radius as a bordered `DataTable`. Set
687
+ `bordered={false}` to remove both the border and outer corner radius.
688
+
635
689
  `filter.select` uses the shared `Dropdown` component, so select filters keep the
636
690
  same menu, keyboard, and visual behavior as standalone dropdowns.
637
691
 
@@ -667,16 +721,17 @@ toast close labels, dropdown loading/empty/clear labels, table empty and
667
721
  pagination labels, date range labels and presets, and number range labels.
668
722
  Business labels such as column headers, filter row titles, button labels, and
669
723
  placeholders should still be passed by the consuming app. Explicit props such
670
- as `closeLabel`, `clearLabel`, `noResultsText`, `emptyText`, `pageSizeLabel`,
671
- `startLabel`, and `minLabel` always override the language defaults.
724
+ as `closeLabel`, `clearLabel`, `noResultsText`, `emptyText`, `startLabel`, and
725
+ `minLabel`, plus nested settings such as `pagination.pageSizeLabel`, always
726
+ override the language defaults.
672
727
 
673
- Use `DataTable showPagination={false}` for a non-paginated data table:
728
+ Pass `pagination={false}` for a non-paginated data table:
674
729
 
675
730
  ```svelte
676
731
  <DataTable
677
732
  rows={rows}
678
733
  {columns}
679
- showPagination={false}
734
+ pagination={false}
680
735
  rowKey="id"
681
736
  tableLayout="fixed"
682
737
  stickyHeader={true}
@@ -727,6 +782,27 @@ inside a theme root:
727
782
  }
728
783
  ```
729
784
 
785
+ ### Corner-radius tokens
786
+
787
+ All non-zero component corner radii come from the token definitions in
788
+ `src/lib/style.css`. Reuse an existing token before adding another radius; when
789
+ a confirmed design requirement needs a new size, define it in that token block
790
+ first and reference it from components.
791
+
792
+ | Token | Default | Intended use |
793
+ | --- | ---: | --- |
794
+ | `--suu-radius-xs` | `4px` | compact checks and small indicators |
795
+ | `--suu-radius-sm` | `6px` | compact controls |
796
+ | `--suu-radius-md` | `8px` | standard controls and surfaces |
797
+ | `--suu-radius-lg` | standard radius plus `2px` | dialogs and prominent surfaces |
798
+ | `--suu-radius-pill` | `999px` | pills and circular controls |
799
+ | `--suu-radius` | `--suu-radius-md` | backward-compatible standard radius override |
800
+ | `--suu-radius-inner` | standard radius minus `1px` | inner fill inside a standard `1px` border |
801
+
802
+ Use `0` directly when a component intentionally has square corners. Component
803
+ styles must not introduce other numeric `border-radius` values or ad hoc radius
804
+ calculations.
805
+
730
806
  ## Release
731
807
 
732
808
  Do not publish this package as part of consumer-app local integration work.
@@ -19,6 +19,7 @@
19
19
  export let sort: SortState | null = null;
20
20
  export let showHeader = true;
21
21
  export let zebra = true;
22
+ export let hoverable = true;
22
23
  export let bordered = true;
23
24
  export let verticalSeparators = false;
24
25
  export let tableLayout: DataTableLayout = 'auto';
@@ -228,6 +229,8 @@
228
229
  class:suu-table--layout-fixed={tableLayout === 'fixed'}
229
230
  class:suu-table--sticky-header={stickyHeader}
230
231
  class:suu-table--zebra={zebra}
232
+ class:suu-table--plain={!zebra}
233
+ class:suu-table--hoverable={hoverable}
231
234
  class:suu-table--vertical-separators={verticalSeparators}
232
235
  class="suu-table"
233
236
  >
@@ -282,6 +285,8 @@
282
285
  class:suu-table--sticky-header={stickyHeader}
283
286
  class:suu-table--sticky-header-shadowed={showHeader && stickyHeaderVisible}
284
287
  class:suu-table--zebra={zebra}
288
+ class:suu-table--plain={!zebra}
289
+ class:suu-table--hoverable={hoverable}
285
290
  class:suu-table--vertical-separators={verticalSeparators}
286
291
  class="suu-table"
287
292
  >
@@ -19,6 +19,7 @@ declare const BaseDataTable: $$__sveltets_2_IsomorphicComponent<{
19
19
  sort?: SortState | null;
20
20
  showHeader?: boolean;
21
21
  zebra?: boolean;
22
+ hoverable?: boolean;
22
23
  bordered?: boolean;
23
24
  verticalSeparators?: boolean;
24
25
  tableLayout?: DataTableLayout;
@@ -1 +1 @@
1
- {"version":3,"file":"BaseDataTable.svelte.d.ts","sourceRoot":"","sources":["../../src/lib/data-table/BaseDataTable.svelte.ts"],"names":[],"mappings":"AAIA,OAAO,EAAiB,KAAK,UAAU,EAAE,MAAM,YAAY,CAAC;AAE5D,OAAO,KAAK,EAER,eAAe,EACf,eAAe,EACf,sBAAsB,EACtB,eAAe,EACf,0BAA0B,EAC1B,SAAS,EACV,MAAM,YAAY,CAAC;AAmTtB,UAAU,kCAAkC,CAAC,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,EAAE,MAAM,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,EAAE,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,EAAE,OAAO,GAAG,EAAE,EAAE,QAAQ,GAAG,MAAM;IACpM,KAAK,OAAO,EAAE,OAAO,QAAQ,EAAE,2BAA2B,CAAC,KAAK,CAAC,GAAG,OAAO,QAAQ,EAAE,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,GAAG;QAAE,UAAU,CAAC,EAAE,QAAQ,CAAA;KAAE,GAAG,OAAO,CAAC;IACjK,CAAC,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,GAAG;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,KAAK,CAAA;KAAC,GAAG,OAAO,GAAG;QAAE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2BAA2B,CAAC,KAAK,CAAC,GAAG,OAAO,QAAQ,EAAE,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,GAAG;QAAE,UAAU,CAAC,EAAE,QAAQ,CAAA;KAAE,GAAG,OAAO,CAAC;IACjK,CAAC,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,GAAG;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,KAAK,CAAA;KAAC,GAAG,OAAO,GAAG;QAAE,IAAI,CAAC,EAAE,GAAG,CAAC;QAAC,GAAG,CAAC,EAAE,GAAG,CAAA;KAAE,CAAC;IAC9G,YAAY,CAAC,EAAE,QAAQ,CAAC;CAC3B;AAUD,QAAA,MAAM,aAAa;WAfif,OAAO,EAAE;cAAY,eAAe,EAAE;WAAS,SAAS,GAAG,IAAI;;;;;;kBAAgL,eAAe;;sBAAwD,MAAM,GAAG,SAAS;yBAAuB,MAAM,GAAG,SAAS;;eAAiE,UAAU;gBAAc,MAAM,GAAG,SAAS;aAAW,eAAe,GAAG,SAAS;eAAa,MAAM,GAAG,CAAC,CAAC,GAAG,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,GAAG,IAAI,CAAC,GAAG,SAAS;oBAAkB,sBAAsB,GAAG,SAAS;mBAAiB,0BAA0B,GAAG,SAAS;;;;;;;;;;;;;cAevmC,CAAC;AACvF,KAAK,aAAa,GAAG,YAAY,CAAC,OAAO,aAAa,CAAC,CAAC;AAC1D,eAAe,aAAa,CAAC"}
@@ -1,16 +1,18 @@
1
1
  <svelte:options runes={false} />
2
2
 
3
3
  <script lang="ts">
4
+ import { onMount } from 'svelte';
4
5
  import BaseDataTable from './BaseDataTable.svelte';
5
6
  import Pagination from '../pagination/Pagination.svelte';
6
7
  import { getUiMessages, type UiLanguage } from '../i18n.js';
8
+ import { normalizePagination } from './state.js';
7
9
  import type {
8
10
  DataTableColumn,
9
11
  DataTableLayout,
10
12
  DataTableRowAttributes,
11
13
  DataTableRowKey,
12
14
  DataTableSortChangeHandler,
13
- PaginationChangeHandler,
15
+ DataTableServerPagination,
14
16
  PaginationState,
15
17
  SortState
16
18
  } from './types.js';
@@ -23,15 +25,10 @@
23
25
  export let sort: SortState | null = null;
24
26
  export let onSortChange: DataTableSortChangeHandler | undefined = undefined;
25
27
  export let showHeader = true;
26
- export let showPagination = true;
27
- export let page = 1;
28
- export let pageSize = 20;
29
- export let totalRows: number | undefined = undefined;
30
- export let pageSizeOptions: number[] = [10, 20, 50, 100];
31
- export let pageSizeLabel: string | undefined = undefined;
28
+ export let pagination: false | DataTableServerPagination;
32
29
  export let maxPageButtons = 15;
33
- export let onPaginationChange: PaginationChangeHandler | undefined = undefined;
34
30
  export let zebra = true;
31
+ export let hoverable = true;
35
32
  export let bordered = true;
36
33
  export let verticalSeparators = true;
37
34
  export let tableLayout: DataTableLayout = 'auto';
@@ -42,30 +39,150 @@
42
39
  export let rowClass: string | ((row: unknown, index: number) => string | undefined | null) | undefined = undefined;
43
40
  export let rowAttributes: DataTableRowAttributes | undefined = undefined;
44
41
 
42
+ const defaultPageSizeOptions = [10, 20, 50, 100];
43
+ const initialPaginationConfig = pagination === false ? undefined : pagination;
44
+
45
+ let currentPagination: PaginationState = {
46
+ page: 1,
47
+ pageSize: resolveDefaultPageSize(initialPaginationConfig)
48
+ };
49
+ let requestPending = false;
50
+ let requestSequence = 0;
51
+ let mounted = false;
52
+ let lastQueryKey = initialPaginationConfig?.queryKey;
53
+
45
54
  $: messages = getUiMessages(language);
46
55
  $: resolvedEmptyText = emptyText ?? messages.table.emptyText;
47
- $: resolvedPageSizeLabel = pageSizeLabel ?? messages.table.pageSizeLabel;
48
- $: resolvedTotalRows = totalRows ?? rows.length;
49
- $: minimumPageSizeOption = pageSizeOptions.length > 0 ? Math.min(...pageSizeOptions) : 0;
50
- $: shouldShowPagination = showPagination && (minimumPageSizeOption <= 0 || resolvedTotalRows >= minimumPageSizeOption);
51
- $: pagination = { page, pageSize };
52
-
53
- function updatePagination(next: PaginationState) {
54
- void onPaginationChange?.(next);
56
+ $: serverPagination = pagination === false ? undefined : pagination;
57
+ $: resolvedPageSizeOptions = normalizePageSizeOptions(serverPagination?.pageSizeOptions);
58
+ $: resolvedDefaultPageSize = resolveDefaultPageSize(serverPagination);
59
+ $: resolvedTotalRows = serverPagination?.totalRows ?? 0;
60
+ $: resolvedPageSizeLabel = serverPagination?.pageSizeLabel ?? messages.table.pageSizeLabel;
61
+ $: minimumPageSizeOption = Math.min(...resolvedPageSizeOptions);
62
+ $: shouldShowPagination = serverPagination !== undefined && resolvedTotalRows >= minimumPageSizeOption;
63
+
64
+ $: if (mounted && serverPagination && serverPagination.queryKey !== lastQueryKey) {
65
+ lastQueryKey = serverPagination.queryKey;
66
+ void requestPagination({ page: 1, pageSize: currentPagination.pageSize }, true);
67
+ }
68
+
69
+ $: if (mounted && serverPagination) {
70
+ const normalized = normalizePagination(currentPagination, resolvedTotalRows);
71
+ if (resolvedTotalRows === 0 && currentPagination.page !== 1) {
72
+ currentPagination = { ...currentPagination, page: 1 };
73
+ } else if (resolvedTotalRows > 0 && normalized.page !== currentPagination.page) {
74
+ void requestPagination(normalized);
75
+ }
76
+ }
77
+
78
+ $: if (mounted && serverPagination && !resolvedPageSizeOptions.includes(currentPagination.pageSize)) {
79
+ void requestPagination({ page: 1, pageSize: resolvedDefaultPageSize });
80
+ }
81
+
82
+ function normalizePageSizeOptions(options: number[] | undefined): number[] {
83
+ const normalized = [...new Set((options ?? defaultPageSizeOptions).filter((option) => Number.isInteger(option) && option > 0))];
84
+ return normalized.length > 0 ? normalized : [...defaultPageSizeOptions];
55
85
  }
86
+
87
+ function resolveDefaultPageSize(config: DataTableServerPagination | undefined): number {
88
+ const options = normalizePageSizeOptions(config?.pageSizeOptions);
89
+ return config?.defaultPageSize !== undefined && options.includes(config.defaultPageSize)
90
+ ? config.defaultPageSize
91
+ : (options[0] as number);
92
+ }
93
+
94
+ function storageKey(config: DataTableServerPagination): string | undefined {
95
+ const tableId = config.tableId.trim();
96
+ return config.persistPageSize === true && tableId.length > 0
97
+ ? `svelte-ui-utils:data-table:${tableId}:page-size`
98
+ : undefined;
99
+ }
100
+
101
+ function readStoredPageSize(): number | null {
102
+ if (!serverPagination) {
103
+ return null;
104
+ }
105
+ const key = storageKey(serverPagination);
106
+ if (!key) {
107
+ return null;
108
+ }
109
+ try {
110
+ const storedValue = window.localStorage.getItem(key);
111
+ if (storedValue === null) {
112
+ return null;
113
+ }
114
+ const storedPageSize = Number(storedValue);
115
+ return resolvedPageSizeOptions.includes(storedPageSize) ? storedPageSize : null;
116
+ } catch {
117
+ return null;
118
+ }
119
+ }
120
+
121
+ function storePageSize(config: DataTableServerPagination, nextPageSize: number) {
122
+ const key = storageKey(config);
123
+ if (!key || !normalizePageSizeOptions(config.pageSizeOptions).includes(nextPageSize)) {
124
+ return;
125
+ }
126
+ try {
127
+ window.localStorage.setItem(key, String(nextPageSize));
128
+ } catch {
129
+ // localStorage 可能因浏览器隐私策略或存储空间限制而不可用。
130
+ }
131
+ }
132
+
133
+ async function requestPagination(next: PaginationState, force = false) {
134
+ const config = serverPagination;
135
+ if (!config) {
136
+ return;
137
+ }
138
+
139
+ const nextPagination = normalizePagination(next, config.totalRows);
140
+ if (!force && nextPagination.page === currentPagination.page && nextPagination.pageSize === currentPagination.pageSize) {
141
+ return;
142
+ }
143
+
144
+ const previousPagination = currentPagination;
145
+ const sequence = ++requestSequence;
146
+ currentPagination = nextPagination;
147
+ requestPending = true;
148
+
149
+ try {
150
+ await config.onRequest(nextPagination);
151
+ if (sequence === requestSequence) {
152
+ storePageSize(config, nextPagination.pageSize);
153
+ requestPending = false;
154
+ }
155
+ } catch {
156
+ if (sequence === requestSequence) {
157
+ const latestTotalRows = pagination === false ? 0 : pagination.totalRows;
158
+ currentPagination = normalizePagination(previousPagination, latestTotalRows);
159
+ requestPending = false;
160
+ }
161
+ }
162
+ }
163
+
164
+ onMount(() => {
165
+ mounted = true;
166
+ lastQueryKey = pagination === false ? undefined : pagination.queryKey;
167
+ const storedPageSize = readStoredPageSize();
168
+ if (storedPageSize !== null && storedPageSize !== currentPagination.pageSize) {
169
+ void requestPagination({ page: 1, pageSize: storedPageSize });
170
+ }
171
+ });
56
172
  </script>
57
173
 
58
174
  <div class="suu-data-table">
59
175
  {#if shouldShowPagination}
60
176
  <Pagination
61
- {pagination}
177
+ pagination={currentPagination}
62
178
  {language}
63
179
  totalRows={resolvedTotalRows}
64
- {pageSizeOptions}
180
+ pageSizeOptions={resolvedPageSizeOptions}
65
181
  pageSizeLabel={resolvedPageSizeLabel}
66
182
  {maxPageButtons}
183
+ disabled={requestPending}
67
184
  pageSizeDropdownPlacement="down"
68
- onPaginationChange={updatePagination}
185
+ onPaginationChange={requestPagination}
69
186
  />
70
187
  {/if}
71
188
 
@@ -75,6 +192,7 @@
75
192
  {sort}
76
193
  {showHeader}
77
194
  {zebra}
195
+ {hoverable}
78
196
  {bordered}
79
197
  {verticalSeparators}
80
198
  {tableLayout}
@@ -95,14 +213,15 @@
95
213
 
96
214
  {#if shouldShowPagination}
97
215
  <Pagination
98
- {pagination}
216
+ pagination={currentPagination}
99
217
  {language}
100
218
  totalRows={resolvedTotalRows}
101
- {pageSizeOptions}
219
+ pageSizeOptions={resolvedPageSizeOptions}
102
220
  pageSizeLabel={resolvedPageSizeLabel}
103
221
  {maxPageButtons}
222
+ disabled={requestPending}
104
223
  pageSizeDropdownPlacement="up"
105
- onPaginationChange={updatePagination}
224
+ onPaginationChange={requestPagination}
106
225
  />
107
226
  {/if}
108
227
  </div>
@@ -1,5 +1,5 @@
1
1
  import { type UiLanguage } from '../i18n.js';
2
- import type { DataTableColumn, DataTableLayout, DataTableRowAttributes, DataTableRowKey, DataTableSortChangeHandler, PaginationChangeHandler, SortState } from './types.js';
2
+ import type { DataTableColumn, DataTableLayout, DataTableRowAttributes, DataTableRowKey, DataTableSortChangeHandler, DataTableServerPagination, SortState } from './types.js';
3
3
  interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
4
4
  new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
5
5
  $$bindings?: Bindings;
@@ -22,15 +22,10 @@ declare const DataTable: $$__sveltets_2_IsomorphicComponent<{
22
22
  sort?: SortState | null;
23
23
  onSortChange?: DataTableSortChangeHandler | undefined;
24
24
  showHeader?: boolean;
25
- showPagination?: boolean;
26
- page?: number;
27
- pageSize?: number;
28
- totalRows?: number | undefined;
29
- pageSizeOptions?: number[];
30
- pageSizeLabel?: string | undefined;
25
+ pagination: false | DataTableServerPagination;
31
26
  maxPageButtons?: number;
32
- onPaginationChange?: PaginationChangeHandler | undefined;
33
27
  zebra?: boolean;
28
+ hoverable?: boolean;
34
29
  bordered?: boolean;
35
30
  verticalSeparators?: boolean;
36
31
  tableLayout?: DataTableLayout;
@@ -1 +1 @@
1
- {"version":3,"file":"DataTable.svelte.d.ts","sourceRoot":"","sources":["../../src/lib/data-table/DataTable.svelte.ts"],"names":[],"mappings":"AAKA,OAAO,EAAiB,KAAK,UAAU,EAAE,MAAM,YAAY,CAAC;AAC5D,OAAO,KAAK,EACR,eAAe,EACf,eAAe,EACf,sBAAsB,EACtB,eAAe,EACf,0BAA0B,EAC1B,uBAAuB,EAEvB,SAAS,EACV,MAAM,YAAY,CAAC;AAmEtB,UAAU,kCAAkC,CAAC,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,EAAE,MAAM,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,EAAE,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,EAAE,OAAO,GAAG,EAAE,EAAE,QAAQ,GAAG,MAAM;IACpM,KAAK,OAAO,EAAE,OAAO,QAAQ,EAAE,2BAA2B,CAAC,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EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,GAAG,IAAI,CAAC,GAAG,SAAS;oBAAkB,sBAAsB,GAAG,SAAS;;;;;;;;;;;;;;;cAe5vC,CAAC;AACnF,KAAK,SAAS,GAAG,YAAY,CAAC,OAAO,SAAS,CAAC,CAAC;AAClD,eAAe,SAAS,CAAC"}
@@ -2,6 +2,7 @@
2
2
 
3
3
  <script lang="ts">
4
4
  import Dropdown from '../dropdown/Dropdown.svelte';
5
+ import DropdownMultiSelect from '../dropdown/DropdownMultiSelect.svelte';
5
6
  import DropdownSearch from '../dropdown-search/DropdownSearch.svelte';
6
7
  import type { UiLanguage } from '../i18n.js';
7
8
  import DateRangeFilter from './DateRangeFilter.svelte';
@@ -41,24 +42,51 @@
41
42
  </div>
42
43
  {:else if control.type === 'checkbox'}
43
44
  <div class="suu-filter-table__options">
44
- {#each control.options as option}
45
- <label class="suu-filter-table__option" class:suu-filter-table__option--checked={control.value.includes(option.value)}>
46
- <input
47
- class="suu-filter-table__option-input"
48
- type="checkbox"
49
- value={option.value}
50
- disabled={option.disabled}
51
- checked={control.value.includes(option.value)}
52
- on:change={(event) => toggleCheckbox(option.value, (event.currentTarget as HTMLInputElement).checked)}
53
- />
54
- <span class="suu-filter-table__option-label">{option.label}</span>
55
- <span class="suu-filter-table__option-check" aria-hidden="true">
56
- <svg viewBox="0 0 20 20">
57
- <path d="m5 10 3 3 7-7"></path>
58
- </svg>
59
- </span>
60
- </label>
61
- {/each}
45
+ {#if control.optionGroups?.length}
46
+ {#each control.optionGroups as group, groupIndex}
47
+ {#each group.options as option, optionIndex}
48
+ <label
49
+ class="suu-filter-table__option"
50
+ class:suu-filter-table__option--checked={control.value.includes(option.value)}
51
+ class:suu-filter-table__option--group-end={groupIndex < control.optionGroups.length - 1 && optionIndex === group.options.length - 1}
52
+ >
53
+ <input
54
+ class="suu-filter-table__option-input"
55
+ type="checkbox"
56
+ value={option.value}
57
+ disabled={option.disabled}
58
+ checked={control.value.includes(option.value)}
59
+ on:change={(event) => toggleCheckbox(option.value, (event.currentTarget as HTMLInputElement).checked)}
60
+ />
61
+ <span class="suu-filter-table__option-label">{option.label}</span>
62
+ <span class="suu-filter-table__option-check" aria-hidden="true">
63
+ <svg viewBox="0 0 20 20">
64
+ <path d="m5 10 3 3 7-7"></path>
65
+ </svg>
66
+ </span>
67
+ </label>
68
+ {/each}
69
+ {/each}
70
+ {:else}
71
+ {#each control.options as option}
72
+ <label class="suu-filter-table__option" class:suu-filter-table__option--checked={control.value.includes(option.value)}>
73
+ <input
74
+ class="suu-filter-table__option-input"
75
+ type="checkbox"
76
+ value={option.value}
77
+ disabled={option.disabled}
78
+ checked={control.value.includes(option.value)}
79
+ on:change={(event) => toggleCheckbox(option.value, (event.currentTarget as HTMLInputElement).checked)}
80
+ />
81
+ <span class="suu-filter-table__option-label">{option.label}</span>
82
+ <span class="suu-filter-table__option-check" aria-hidden="true">
83
+ <svg viewBox="0 0 20 20">
84
+ <path d="m5 10 3 3 7-7"></path>
85
+ </svg>
86
+ </span>
87
+ </label>
88
+ {/each}
89
+ {/if}
62
90
  </div>
63
91
  {:else if control.type === 'radio'}
64
92
  <div class="suu-filter-table__options">
@@ -191,4 +219,22 @@
191
219
  }
192
220
  }}
193
221
  />
222
+ {:else if control.type === 'dropdownMultiSelect'}
223
+ <DropdownMultiSelect
224
+ value={control.value}
225
+ options={control.options}
226
+ optionGroups={control.optionGroups}
227
+ ariaLabel={control.ariaLabel}
228
+ placement={control.placement}
229
+ menuAlign={control.menuAlign}
230
+ fitViewport={control.fitViewport}
231
+ fitContent={control.fitContent ?? true}
232
+ disabled={control.disabled}
233
+ width={control.width}
234
+ minWidth={control.minWidth}
235
+ maxWidth={control.maxWidth}
236
+ portal={control.portal}
237
+ onChange={control.onChange}
238
+ onTriggerClick={control.onTriggerClick}
239
+ />
194
240
  {/if}
@@ -1 +1 @@
1
- {"version":3,"file":"FilterControl.svelte.d.ts","sourceRoot":"","sources":["../../src/lib/data-table/FilterControl.svelte.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAwIhD,QAAA,MAAM,aAAa,KAA+E,CAAC;AACjF,KAAK,aAAa,GAAG,YAAY,CAAC,OAAO,aAAa,CAAC,CAAC;AAC1D,eAAe,aAAa,CAAC"}
1
+ {"version":3,"file":"FilterControl.svelte.d.ts","sourceRoot":"","sources":["../../src/lib/data-table/FilterControl.svelte.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AA2JhD,QAAA,MAAM,aAAa,KAA+E,CAAC;AACjF,KAAK,aAAa,GAAG,YAAY,CAAC,OAAO,aAAa,CAAC,CAAC;AAC1D,eAAe,aAAa,CAAC"}
@@ -7,10 +7,11 @@
7
7
 
8
8
  export let rows: FilterTableRow[] = [];
9
9
  export let language: UiLanguage = 'en_us';
10
+ export let bordered = true;
10
11
  </script>
11
12
 
12
13
  <div class="suu-filter-table">
13
- <table class="suu-filter-table__filters">
14
+ <table class:suu-filter-table__filters--borderless={!bordered} class="suu-filter-table__filters">
14
15
  <tbody>
15
16
  {#each rows as row (row.key)}
16
17
  <tr>
@@ -16,6 +16,7 @@ interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> =
16
16
  declare const FilterTable: $$__sveltets_2_IsomorphicComponent<{
17
17
  rows?: FilterTableRow[];
18
18
  language?: UiLanguage;
19
+ bordered?: boolean;
19
20
  }, {
20
21
  [evt: string]: CustomEvent<any>;
21
22
  }, {}, {}, string>;
@@ -1 +1 @@
1
- {"version":3,"file":"FilterTable.svelte.d.ts","sourceRoot":"","sources":["../../src/lib/data-table/FilterTable.svelte.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AA8BjD,UAAU,kCAAkC,CAAC,KAAK,SAAS,MAAM,CAAC,MAAM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AAE,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,EAAE,OAAO,GAAG,EAAE,EAAE,QAAQ,GAAG,MAAM;IACpM,KAAK,OAAO,EAAE,OAAO,QAAQ,EAAE,2BAA2B,CAAC,KAAK,CAAC,GAAG,OAAO,QAAQ,EAAE,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,GAAG;QAAE,UAAU,CAAC,EAAE,QAAQ,CAAA;KAAE,GAAG,OAAO,CAAC;IACjK,CAAC,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,GAAG;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,KAAK,CAAA;KAAC,GAAG,OAAO,GAAG;QAAE,IAAI,CAAC,EAAE,GAAG,CAAC;QAAC,GAAG,CAAC,EAAE,GAAG,CAAA;KAAE,CAAC;IAC9G,YAAY,CAAC,EAAE,QAAQ,CAAC;CAC3B;AAKD,QAAA,MAAM,WAAW;WAViE,cAAc,EAAE;eAAa,UAAU;;;;kBAUzB,CAAC;AAC/E,KAAK,WAAW,GAAG,YAAY,CAAC,OAAO,WAAW,CAAC,CAAC;AACtD,eAAe,WAAW,CAAC"}
@@ -1,4 +1,4 @@
1
- import type { CheckboxFilterControl, DateRangeFilterControl, DropdownSearchFilterControl, FilterButtonControl, FilterContainerControl, FilterControl, FilterLinkControl, FilterSelectControl, NumberRangeFilterControl, RadioFilterControl } from './types.js';
1
+ import type { CheckboxFilterControl, DateRangeFilterControl, DropdownMultiSelectFilterControl, DropdownSearchFilterControl, FilterButtonControl, FilterContainerControl, FilterControl, FilterLinkControl, FilterSelectControl, NumberRangeFilterControl, RadioFilterControl } from './types.js';
2
2
  declare function checkbox(options: Omit<CheckboxFilterControl, 'type'>): CheckboxFilterControl;
3
3
  declare function radio(options: Omit<RadioFilterControl, 'type'>): RadioFilterControl;
4
4
  declare function dropdownSearch(options: Omit<DropdownSearchFilterControl, 'type'>): DropdownSearchFilterControl;
@@ -7,6 +7,7 @@ declare function numberRange(options: Omit<NumberRangeFilterControl, 'type'>): N
7
7
  declare function button(options: Omit<FilterButtonControl, 'type'>): FilterButtonControl;
8
8
  declare function link(options: Omit<FilterLinkControl, 'type'>): FilterLinkControl;
9
9
  declare function select(options: Omit<FilterSelectControl, 'type'>): FilterSelectControl;
10
+ declare function dropdownMultiSelect(options: Omit<DropdownMultiSelectFilterControl, 'type'>): DropdownMultiSelectFilterControl;
10
11
  declare function container(controls: FilterControl[]): FilterContainerControl;
11
12
  export declare const filter: {
12
13
  checkbox: typeof checkbox;
@@ -17,6 +18,7 @@ export declare const filter: {
17
18
  button: typeof button;
18
19
  link: typeof link;
19
20
  select: typeof select;
21
+ dropdownMultiSelect: typeof dropdownMultiSelect;
20
22
  container: typeof container;
21
23
  };
22
24
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"filter.d.ts","sourceRoot":"","sources":["../../src/lib/data-table/filter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,qBAAqB,EACrB,sBAAsB,EACtB,2BAA2B,EAC3B,mBAAmB,EACnB,sBAAsB,EACtB,aAAa,EACb,iBAAiB,EACjB,mBAAmB,EACnB,wBAAwB,EACxB,kBAAkB,EACnB,MAAM,YAAY,CAAC;AAEpB,iBAAS,QAAQ,CAAC,OAAO,EAAE,IAAI,CAAC,qBAAqB,EAAE,MAAM,CAAC,GAAG,qBAAqB,CAErF;AAED,iBAAS,KAAK,CAAC,OAAO,EAAE,IAAI,CAAC,kBAAkB,EAAE,MAAM,CAAC,GAAG,kBAAkB,CAE5E;AAED,iBAAS,cAAc,CAAC,OAAO,EAAE,IAAI,CAAC,2BAA2B,EAAE,MAAM,CAAC,GAAG,2BAA2B,CAEvG;AAED,iBAAS,SAAS,CAAC,OAAO,EAAE,IAAI,CAAC,sBAAsB,EAAE,MAAM,CAAC,GAAG,sBAAsB,CAExF;AAED,iBAAS,WAAW,CAAC,OAAO,EAAE,IAAI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