@svadmin/ui 0.131.1 → 0.131.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.
@@ -11,7 +11,7 @@
11
11
  const resources = $derived(adminContext.resources.filter((resource) => resource.meta?.['aboutVisible'] !== false));
12
12
  const providerNames = $derived(adminContext.getDataProviderNames());
13
13
  let { version: suppliedVersion, headingLevel = 'h1' }: { version?: string; headingLevel?: 'h1' | 'h2' } = $props();
14
- const buildVersion = "0.131.1";
14
+ const buildVersion = "0.131.2";
15
15
  const version = $derived(suppliedVersion ?? (
16
16
  buildVersion.startsWith('__')
17
17
  ? (i18n.locale === 'zh-CN' ? '开发构建(未提供版本)' : 'Development build (version unavailable)')
@@ -93,6 +93,8 @@
93
93
 
94
94
  const items = $derived(listPaginationItems(page, totalPages));
95
95
  const paginated = $derived(totalPages > 1);
96
+ // 条数选择独立于页码和汇总文字,扩大每页条数后仍能切回原来的值。
97
+ const showPageSizeControl = $derived(Boolean(onPageSizeChange && resolvedPageSize !== undefined));
96
98
 
97
99
  function jump(event: Event): void {
98
100
  const input = event.currentTarget as HTMLInputElement;
@@ -104,12 +106,14 @@
104
106
  }
105
107
  </script>
106
108
 
107
- {#if paginated}
108
- <div {...restProps} class={`svadmin-list-pagination ${className}`.trim()} role="navigation" aria-label={listText(i18n, 'listPagination.navigation', { label })}>
109
- {#if resolvedShowSummary}
109
+ {#if paginated || showPageSizeControl}
110
+ <div {...restProps} class={`svadmin-list-pagination ${className}`.trim()} role={paginated ? 'navigation' : 'group'} aria-label={listText(i18n, 'listPagination.navigation', { label })}>
111
+ {#if resolvedShowSummary || showPageSizeControl}
110
112
  <div class="svadmin-list-pagination__info">
111
- <span>{listText(i18n, 'listPagination.range', { start: rangeStart, end: rangeEnd, total })}</span>
112
- {#if onPageSizeChange && resolvedPageSize !== undefined}
113
+ {#if resolvedShowSummary}<span>{paginated
114
+ ? listText(i18n, 'listPagination.range', { start: rangeStart, end: rangeEnd, total })
115
+ : listText(i18n, 'common.total', { total })}</span>{/if}
116
+ {#if showPageSizeControl}
113
117
  <span class="svadmin-list-pagination__size">{pageSizeLabel ?? listText(i18n, 'listPagination.pageSizeLabel')}
114
118
  <select
115
119
  aria-label={listText(i18n, 'listPagination.pageSizeAria', { label })}
@@ -122,7 +126,7 @@
122
126
  {/if}
123
127
  </div>
124
128
  {/if}
125
- <div class="svadmin-list-pagination__controls">
129
+ {#if paginated}<div class="svadmin-list-pagination__controls">
126
130
  <button type="button" class="svadmin-list-pagination__control" disabled={page <= 1}
127
131
  title={listText(i18n, page <= 1 ? 'listPagination.firstPage' : 'listPagination.previous')}
128
132
  aria-label={listText(i18n, 'listPagination.previousAria', { label })} onclick={() => onPageChange(page - 1)}>{listText(i18n, 'listPagination.previous')}</button>
@@ -155,7 +159,7 @@
155
159
  <button type="button" class="svadmin-list-pagination__control" disabled={page >= totalPages}
156
160
  title={listText(i18n, page >= totalPages ? 'listPagination.lastPage' : 'listPagination.next')}
157
161
  aria-label={listText(i18n, 'listPagination.nextAria', { label })} onclick={() => onPageChange(page + 1)}>{listText(i18n, 'listPagination.next')}</button>
158
- </div>
162
+ </div>{/if}
159
163
  </div>
160
164
  {:else if resolvedShowSummary}
161
165
  <p {...restProps} class={`svadmin-list-pagination__summary ${className}`.trim()}>{listText(i18n, 'common.total', { total })}</p>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@svadmin/ui",
3
- "version": "0.131.1",
3
+ "version": "0.131.2",
4
4
  "description": "Pre-built admin UI components — AdminApp, AutoTable, AutoForm, Sidebar, Layout",
5
5
  "type": "module",
6
6
  "sideEffects": [