@iyulab/components 2.15.0 → 2.16.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## [2.16.0] - 2026-10-07
4
+
5
+ ### Added
6
+
7
+ - **`u-pagination` `label` and `formatRange`.** `label` names the navigation (the locale string when empty) — two
8
+ pagers on one page were two landmarks with the same name. `formatRange(start, end, total)` builds the range text
9
+ when a screen formats counts its own way. Both are what a table needs to use `u-pagination` as its pager.
10
+
3
11
  ## [2.15.0] - 2026-10-07
4
12
 
5
13
  ### Added
@@ -39,6 +39,16 @@ export declare class UPagination extends UElement {
39
39
  size: PaginationSize;
40
40
  /** 현재 쪽 양옆에 보일 쪽 번호 수. */
41
41
  siblings: number;
42
+ /**
43
+ * 내비게이션의 접근 가능한 이름. 비우면 로케일 문장(`pagination`). 한 화면에 페이저가 둘 이상이면 각자 이름을 준다
44
+ * (랜드마크는 이름으로 구별된다 — 예: «주문 목록 페이지»).
45
+ */
46
+ label: string;
47
+ /**
48
+ * 범위 글자를 만든다 — `(start, end, total)`, `start` 는 1 기준(행이 없으면 0). 비우면 로케일 문장(`rangeOfTotal` —
49
+ * «1–20 / 345»). 숫자 형식·문구를 화면 규약에 맞출 때.
50
+ */
51
+ formatRange?: (start: number, end: number, total: number) => string;
42
52
  /** 페이지 수 — 행이 없어도 1. */
43
53
  get pageCount(): number;
44
54
  private get current();
@@ -19,6 +19,7 @@ var UPagination = class UPagination extends UElement {
19
19
  this.pageSizes = [];
20
20
  this.size = "md";
21
21
  this.siblings = 1;
22
+ this.label = "";
22
23
  this.onPageSizeChange = (e) => {
23
24
  e.stopPropagation();
24
25
  const size = Number(e.target.value);
@@ -48,8 +49,8 @@ var UPagination = class UPagination extends UElement {
48
49
  const start = this.totalCount === 0 ? 0 : current * this.pageSize + 1;
49
50
  const end = Math.min(this.totalCount, (current + 1) * this.pageSize);
50
51
  return html`
51
- <nav part="nav" aria-label=${Locale.getValue("pagination")}>
52
- <span class="range" part="range">${Locale.getValue("rangeOfTotal", {
52
+ <nav part="nav" aria-label=${this.label || Locale.getValue("pagination")}>
53
+ <span class="range" part="range">${this.formatRange ? this.formatRange(start, end, this.totalCount) : Locale.getValue("rangeOfTotal", {
53
54
  start,
54
55
  end,
55
56
  total: this.totalCount
@@ -130,6 +131,8 @@ __decorate([property({
130
131
  reflect: true
131
132
  }), __decorateMetadata("design:type", Object)], UPagination.prototype, "size", void 0);
132
133
  __decorate([property({ type: Number }), __decorateMetadata("design:type", Object)], UPagination.prototype, "siblings", void 0);
134
+ __decorate([property({ type: String }), __decorateMetadata("design:type", Object)], UPagination.prototype, "label", void 0);
135
+ __decorate([property({ attribute: false }), __decorateMetadata("design:type", Function)], UPagination.prototype, "formatRange", void 0);
133
136
  UPagination = __decorate([customElement("u-pagination")], UPagination);
134
137
  //#endregion
135
138
  export { UPagination };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@iyulab/components",
3
3
  "description": "web-components library based on lit-element made by iyulab",
4
- "version": "2.15.0",
4
+ "version": "2.16.0",
5
5
  "keywords": [
6
6
  "iyulab",
7
7
  "components",
@@ -37,6 +37,8 @@ pager.addEventListener('page-change', (e) => {
37
37
  | `pageSizes` | `number[]` | `[]` | | Choices for rows per page (attribute `page-sizes`, a comma list). Empty — no select |
38
38
  | `size` | `'sm' \| 'md' \| 'lg'` | `'md'` | ✓ | Size step of the buttons and the select, as the other controls |
39
39
  | `siblings` | `number` | `1` | | Page numbers shown on each side of the current one |
40
+ | `label` | `string` | `''` | | The navigation's accessible name; the locale string (`pagination`) when empty. Give each pager on a page its own — landmarks are told apart by name |
41
+ | `formatRange` | `(start, end, total) => string` | — | | Builds the range text (`start` is 1-based, 0 when there are no rows); the locale string (`rangeOfTotal`) when unset |
40
42
 
41
43
  `pageCount` (read-only) is the number of pages — 1 when there are no rows.
42
44