@duskmoon-dev/el-pagination 2.2.0 → 2.3.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/README.md +8 -1
- package/dist/cjs/index.js +197 -53
- package/dist/cjs/index.js.map +3 -3
- package/dist/cjs/register.js +197 -53
- package/dist/cjs/register.js.map +3 -3
- package/dist/esm/index.js +197 -53
- package/dist/esm/index.js.map +3 -3
- package/dist/esm/register.js +197 -53
- package/dist/esm/register.js.map +3 -3
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/el-dm-pagination.d.ts +33 -0
- package/dist/types/el-dm-pagination.d.ts.map +1 -1
- package/package.json +3 -3
package/dist/esm/index.js
CHANGED
|
@@ -3,7 +3,12 @@ import { BaseElement, css } from "@duskmoon-dev/el-base";
|
|
|
3
3
|
var styles = css`
|
|
4
4
|
:host {
|
|
5
5
|
display: inline-flex;
|
|
6
|
+
max-inline-size: 100%;
|
|
7
|
+
min-inline-size: 0;
|
|
6
8
|
vertical-align: middle;
|
|
9
|
+
--pagination-control-height: 2rem;
|
|
10
|
+
--pagination-control-font: 0.875rem;
|
|
11
|
+
--pagination-control-radius: var(--radius-sm, 0.375rem);
|
|
7
12
|
}
|
|
8
13
|
|
|
9
14
|
:host([hidden]) {
|
|
@@ -15,15 +20,22 @@ var styles = css`
|
|
|
15
20
|
align-items: center;
|
|
16
21
|
gap: 0.25rem;
|
|
17
22
|
font-family: inherit;
|
|
23
|
+
max-inline-size: 100%;
|
|
24
|
+
overflow-x: auto;
|
|
25
|
+
padding: 3px;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.pagination > * {
|
|
29
|
+
flex: none;
|
|
18
30
|
}
|
|
19
31
|
|
|
20
32
|
.pagination-btn {
|
|
21
33
|
display: inline-flex;
|
|
22
34
|
align-items: center;
|
|
23
35
|
justify-content: center;
|
|
24
|
-
border: 1px solid var(--color-border, #d1d5db);
|
|
36
|
+
border: 1px solid var(--color-border, var(--color-outline, #d1d5db));
|
|
25
37
|
background: var(--color-surface, #ffffff);
|
|
26
|
-
color: var(--color-text, #374151);
|
|
38
|
+
color: var(--color-text, var(--color-on-surface, #374151));
|
|
27
39
|
cursor: pointer;
|
|
28
40
|
font-family: inherit;
|
|
29
41
|
font-weight: 500;
|
|
@@ -31,20 +43,21 @@ var styles = css`
|
|
|
31
43
|
background-color 0.15s ease,
|
|
32
44
|
border-color 0.15s ease,
|
|
33
45
|
color 0.15s ease;
|
|
34
|
-
border-radius: var(--radius
|
|
35
|
-
min-width:
|
|
36
|
-
height:
|
|
46
|
+
border-radius: var(--pagination-control-radius);
|
|
47
|
+
min-width: var(--pagination-control-height);
|
|
48
|
+
height: var(--pagination-control-height);
|
|
37
49
|
padding: 0 0.5rem;
|
|
38
|
-
font-size:
|
|
50
|
+
font-size: var(--pagination-control-font);
|
|
39
51
|
line-height: 1;
|
|
40
52
|
}
|
|
41
53
|
|
|
42
54
|
.pagination-btn:hover:not(:disabled) {
|
|
43
|
-
background: var(--color-surface-hover, #f3f4f6);
|
|
55
|
+
background: var(--color-surface-hover, var(--color-surface-container, #f3f4f6));
|
|
44
56
|
border-color: var(--color-border-hover, #9ca3af);
|
|
45
57
|
}
|
|
46
58
|
|
|
47
|
-
.pagination-btn:focus-visible
|
|
59
|
+
.pagination-btn:focus-visible,
|
|
60
|
+
.pagination-field > :is(input, select):focus-visible {
|
|
48
61
|
outline: 2px solid var(--color-primary, #3b82f6);
|
|
49
62
|
outline-offset: 2px;
|
|
50
63
|
}
|
|
@@ -57,7 +70,7 @@ var styles = css`
|
|
|
57
70
|
.pagination-btn.active {
|
|
58
71
|
background: var(--color-primary, #3b82f6);
|
|
59
72
|
border-color: var(--color-primary, #3b82f6);
|
|
60
|
-
color: var(--color-primary-contrast, #ffffff);
|
|
73
|
+
color: var(--color-primary-contrast, var(--color-primary-content, #ffffff));
|
|
61
74
|
}
|
|
62
75
|
|
|
63
76
|
.pagination-btn.nav-btn {
|
|
@@ -69,14 +82,67 @@ var styles = css`
|
|
|
69
82
|
height: 1em;
|
|
70
83
|
}
|
|
71
84
|
|
|
85
|
+
.pagination-field {
|
|
86
|
+
position: relative;
|
|
87
|
+
display: inline-flex;
|
|
88
|
+
align-items: center;
|
|
89
|
+
color: var(--color-text, var(--color-on-surface, #374151));
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.pagination-field > :is(input, select) {
|
|
93
|
+
block-size: var(--pagination-control-height);
|
|
94
|
+
padding-block: 0;
|
|
95
|
+
border: 1px solid var(--color-border, var(--color-outline, #d1d5db));
|
|
96
|
+
border-radius: var(--pagination-control-radius);
|
|
97
|
+
background: var(--color-surface, #ffffff);
|
|
98
|
+
color: inherit;
|
|
99
|
+
font: inherit;
|
|
100
|
+
font-size: var(--pagination-control-font);
|
|
101
|
+
font-variant-numeric: tabular-nums;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.pagination-field > select {
|
|
105
|
+
appearance: none;
|
|
106
|
+
padding-inline: 1.75rem 1.5rem;
|
|
107
|
+
cursor: pointer;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.pagination-field > input {
|
|
111
|
+
appearance: textfield;
|
|
112
|
+
inline-size: 4.25rem;
|
|
113
|
+
padding-inline: 1.75rem 0.5rem;
|
|
114
|
+
text-align: center;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.pagination-field > input::-webkit-inner-spin-button {
|
|
118
|
+
appearance: none;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.pagination-field > svg {
|
|
122
|
+
position: absolute;
|
|
123
|
+
pointer-events: none;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.pagination-field > svg:first-child {
|
|
127
|
+
inset-inline-start: 0.5rem;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.pagination-field > svg:last-child {
|
|
131
|
+
inset-inline-end: 0.5rem;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.pagination:dir(rtl) :is(.nav-btn, .pagination-jumper) > svg {
|
|
135
|
+
transform: scaleX(-1);
|
|
136
|
+
}
|
|
137
|
+
|
|
72
138
|
.ellipsis {
|
|
73
139
|
display: inline-flex;
|
|
74
140
|
align-items: center;
|
|
75
141
|
justify-content: center;
|
|
76
|
-
min-width:
|
|
77
|
-
height:
|
|
142
|
+
min-width: var(--pagination-control-height);
|
|
143
|
+
height: var(--pagination-control-height);
|
|
78
144
|
color: var(--color-text-muted, #6b7280);
|
|
79
|
-
font-size:
|
|
145
|
+
font-size: var(--pagination-control-font);
|
|
80
146
|
user-select: none;
|
|
81
147
|
}
|
|
82
148
|
|
|
@@ -111,44 +177,31 @@ var styles = css`
|
|
|
111
177
|
}
|
|
112
178
|
|
|
113
179
|
/* Size variants */
|
|
180
|
+
:host([size='xs']) {
|
|
181
|
+
--pagination-control-height: 1.5rem;
|
|
182
|
+
--pagination-control-font: 0.75rem;
|
|
183
|
+
}
|
|
184
|
+
|
|
114
185
|
:host([size='xs']) .pagination-btn {
|
|
115
|
-
min-width: 1.5rem;
|
|
116
|
-
height: 1.5rem;
|
|
117
186
|
padding: 0 0.25rem;
|
|
118
|
-
font-size: 0.75rem;
|
|
119
|
-
border-radius: var(--radius-sm, 0.25rem);
|
|
120
187
|
}
|
|
121
188
|
|
|
122
|
-
:host([size='
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
font-size: 0.75rem;
|
|
189
|
+
:host([size='sm']) {
|
|
190
|
+
--pagination-control-height: 1.75rem;
|
|
191
|
+
--pagination-control-font: 0.8125rem;
|
|
126
192
|
}
|
|
127
193
|
|
|
128
194
|
:host([size='sm']) .pagination-btn {
|
|
129
|
-
min-width: 1.75rem;
|
|
130
|
-
height: 1.75rem;
|
|
131
195
|
padding: 0 0.375rem;
|
|
132
|
-
font-size: 0.8125rem;
|
|
133
196
|
}
|
|
134
197
|
|
|
135
|
-
:host([size='
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
font-size: 0.8125rem;
|
|
198
|
+
:host([size='lg']) {
|
|
199
|
+
--pagination-control-height: 2.5rem;
|
|
200
|
+
--pagination-control-font: 1rem;
|
|
139
201
|
}
|
|
140
202
|
|
|
141
203
|
:host([size='lg']) .pagination-btn {
|
|
142
|
-
min-width: 2.5rem;
|
|
143
|
-
height: 2.5rem;
|
|
144
204
|
padding: 0 0.75rem;
|
|
145
|
-
font-size: 1rem;
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
:host([size='lg']) .ellipsis {
|
|
149
|
-
min-width: 2.5rem;
|
|
150
|
-
height: 2.5rem;
|
|
151
|
-
font-size: 1rem;
|
|
152
205
|
}
|
|
153
206
|
|
|
154
207
|
/* Color variants */
|
|
@@ -178,10 +231,17 @@ var ICONS = {
|
|
|
178
231
|
next: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor"><path fill-rule="evenodd" d="M7.21 14.77a.75.75 0 01.02-1.06L11.168 10 7.23 6.29a.75.75 0 111.04-1.08l4.5 4.25a.75.75 0 010 1.08l-4.5 4.25a.75.75 0 01-1.06-.02z" clip-rule="evenodd"/></svg>`,
|
|
179
232
|
last: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor"><path fill-rule="evenodd" d="M4.21 5.23a.75.75 0 011.06-.02l4.5 4.25a.75.75 0 010 1.08l-4.5 4.25a.75.75 0 11-1.04-1.08L8.168 10 4.23 6.29a.75.75 0 01-.02-1.06zm6 0a.75.75 0 011.06-.02l4.5 4.25a.75.75 0 010 1.08l-4.5 4.25a.75.75 0 11-1.04-1.08L14.168 10l-3.938-3.71a.75.75 0 01-.02-1.06z" clip-rule="evenodd"/></svg>`
|
|
180
233
|
};
|
|
234
|
+
function fieldIcon(path, size = 14) {
|
|
235
|
+
return `<svg aria-hidden="true" width="${size}" height="${size}" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="${path}" /></svg>`;
|
|
236
|
+
}
|
|
181
237
|
|
|
182
238
|
class ElDmPagination extends BaseElement {
|
|
183
239
|
static properties = {
|
|
184
240
|
total: { type: Number, reflect: true, default: 1 },
|
|
241
|
+
totalItems: { type: Number, reflect: true },
|
|
242
|
+
pageSize: { type: Number, reflect: true, default: 10 },
|
|
243
|
+
showSizeChanger: { type: Boolean, reflect: true, default: false },
|
|
244
|
+
showQuickJumper: { type: Boolean, reflect: true, default: false },
|
|
185
245
|
current: { type: Number, reflect: true, default: 1 },
|
|
186
246
|
siblings: { type: Number, reflect: true, default: 1 },
|
|
187
247
|
boundaries: { type: Number, reflect: true, default: 1 },
|
|
@@ -192,11 +252,16 @@ class ElDmPagination extends BaseElement {
|
|
|
192
252
|
constructor() {
|
|
193
253
|
super();
|
|
194
254
|
this.attachStyles(styles);
|
|
255
|
+
this.shadowRoot.addEventListener("click", this._handleClick.bind(this));
|
|
256
|
+
this.shadowRoot.addEventListener("change", this._handleSizeChange.bind(this));
|
|
257
|
+
this.shadowRoot.addEventListener("keydown", (event) => this._handleKeydown(event));
|
|
258
|
+
this.addEventListener("keydown", (event) => {
|
|
259
|
+
if (event.composedPath()[0] === this)
|
|
260
|
+
this._handleKeydown(event);
|
|
261
|
+
});
|
|
195
262
|
}
|
|
196
263
|
connectedCallback() {
|
|
197
264
|
super.connectedCallback();
|
|
198
|
-
this.addEventListener("click", this._handleClick.bind(this));
|
|
199
|
-
this.addEventListener("keydown", this._handleKeydown.bind(this));
|
|
200
265
|
this._controlsObserver = new MutationObserver(() => this.update());
|
|
201
266
|
this._controlsObserver.observe(this, {
|
|
202
267
|
childList: true,
|
|
@@ -209,9 +274,7 @@ class ElDmPagination extends BaseElement {
|
|
|
209
274
|
this._controlsObserver?.disconnect();
|
|
210
275
|
super.disconnectedCallback();
|
|
211
276
|
}
|
|
212
|
-
_getPageRange() {
|
|
213
|
-
const total = Math.max(1, this.total);
|
|
214
|
-
const current = Math.min(Math.max(1, this.current), total);
|
|
277
|
+
_getPageRange(total, current) {
|
|
215
278
|
const siblings = Math.max(0, this.siblings);
|
|
216
279
|
const boundaries = Math.max(0, this.boundaries);
|
|
217
280
|
const totalPageNumbers = boundaries * 2 + siblings * 2 + 3;
|
|
@@ -251,8 +314,19 @@ class ElDmPagination extends BaseElement {
|
|
|
251
314
|
_hasDeclarativeControls() {
|
|
252
315
|
return this.querySelector('[slot="prev"], [slot="previous"], [slot="page"], [slot="next"]') !== null;
|
|
253
316
|
}
|
|
317
|
+
get _pageSize() {
|
|
318
|
+
return Number.isFinite(this.pageSize) ? Math.max(1, Math.floor(this.pageSize)) : 10;
|
|
319
|
+
}
|
|
320
|
+
get _pageCount() {
|
|
321
|
+
const itemCount = this.totalItems;
|
|
322
|
+
const count = itemCount !== undefined && Number.isFinite(itemCount) ? Math.ceil(itemCount / this._pageSize) : this.total;
|
|
323
|
+
return Number.isFinite(count) ? Math.max(1, Math.floor(count)) : 1;
|
|
324
|
+
}
|
|
325
|
+
_clampPage(page) {
|
|
326
|
+
return Number.isFinite(page) ? Math.min(Math.max(1, Math.floor(page)), this._pageCount) : 1;
|
|
327
|
+
}
|
|
254
328
|
_goToPage(page) {
|
|
255
|
-
const newPage =
|
|
329
|
+
const newPage = this._clampPage(page);
|
|
256
330
|
if (newPage !== this.current) {
|
|
257
331
|
this.current = newPage;
|
|
258
332
|
this.emit("change", { page: newPage });
|
|
@@ -270,26 +344,58 @@ class ElDmPagination extends BaseElement {
|
|
|
270
344
|
if (action === "first") {
|
|
271
345
|
this._goToPage(1);
|
|
272
346
|
} else if (action === "prev") {
|
|
273
|
-
this._goToPage(this.current - 1);
|
|
347
|
+
this._goToPage(this._clampPage(this.current) - 1);
|
|
274
348
|
} else if (action === "next") {
|
|
275
|
-
this._goToPage(this.current + 1);
|
|
349
|
+
this._goToPage(this._clampPage(this.current) + 1);
|
|
276
350
|
} else if (action === "last") {
|
|
277
|
-
this._goToPage(this.
|
|
351
|
+
this._goToPage(this._pageCount);
|
|
278
352
|
} else if (page) {
|
|
279
353
|
this._goToPage(parseInt(page, 10));
|
|
280
354
|
}
|
|
281
355
|
}
|
|
356
|
+
_handleSizeChange(event) {
|
|
357
|
+
const select = event.target;
|
|
358
|
+
if (select?.localName !== "select" || !select.matches('[data-control="page-size"]'))
|
|
359
|
+
return;
|
|
360
|
+
event.stopPropagation();
|
|
361
|
+
const pageSize = Number(select.value);
|
|
362
|
+
if (!Number.isInteger(pageSize) || pageSize < 1 || pageSize === this._pageSize)
|
|
363
|
+
return;
|
|
364
|
+
const current = this.current;
|
|
365
|
+
this.pageSize = pageSize;
|
|
366
|
+
const page = this._clampPage(current);
|
|
367
|
+
this.current = page;
|
|
368
|
+
if (page !== current)
|
|
369
|
+
this.emit("change", { page });
|
|
370
|
+
this.emit("page-size-change", { page, pageSize });
|
|
371
|
+
}
|
|
282
372
|
_handleKeydown(event) {
|
|
283
373
|
if (this._hasDeclarativeControls())
|
|
284
374
|
return;
|
|
375
|
+
const target = event.target;
|
|
376
|
+
if (target?.localName === "select")
|
|
377
|
+
return;
|
|
378
|
+
if (target?.localName === "input") {
|
|
379
|
+
if (event.key === "Enter" && target.matches('[data-control="page-jump"]')) {
|
|
380
|
+
event.preventDefault();
|
|
381
|
+
const page = target.valueAsNumber;
|
|
382
|
+
if (Number.isFinite(page)) {
|
|
383
|
+
target.value = "";
|
|
384
|
+
this._goToPage(page);
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
return;
|
|
388
|
+
}
|
|
389
|
+
const current = this._clampPage(this.current);
|
|
390
|
+
const rtl = this.matches(":dir(rtl)");
|
|
285
391
|
switch (event.key) {
|
|
286
392
|
case "ArrowLeft":
|
|
287
393
|
event.preventDefault();
|
|
288
|
-
this._goToPage(
|
|
394
|
+
this._goToPage(current + (rtl ? 1 : -1));
|
|
289
395
|
break;
|
|
290
396
|
case "ArrowRight":
|
|
291
397
|
event.preventDefault();
|
|
292
|
-
this._goToPage(
|
|
398
|
+
this._goToPage(current + (rtl ? -1 : 1));
|
|
293
399
|
break;
|
|
294
400
|
case "Home":
|
|
295
401
|
event.preventDefault();
|
|
@@ -297,10 +403,28 @@ class ElDmPagination extends BaseElement {
|
|
|
297
403
|
break;
|
|
298
404
|
case "End":
|
|
299
405
|
event.preventDefault();
|
|
300
|
-
this._goToPage(this.
|
|
406
|
+
this._goToPage(this._pageCount);
|
|
301
407
|
break;
|
|
302
408
|
}
|
|
303
409
|
}
|
|
410
|
+
update() {
|
|
411
|
+
const active = this.shadowRoot.activeElement;
|
|
412
|
+
const control = active?.getAttribute("data-control");
|
|
413
|
+
const draft = active?.localName === "input" ? active.value : undefined;
|
|
414
|
+
const scrollLeft = this.query("nav")?.scrollLeft ?? 0;
|
|
415
|
+
super.update();
|
|
416
|
+
const nav = this.query("nav");
|
|
417
|
+
if (nav)
|
|
418
|
+
nav.scrollLeft = scrollLeft;
|
|
419
|
+
if (control === "page-size" || control === "page-jump") {
|
|
420
|
+
const input = this.query(`[data-control="${control}"]`);
|
|
421
|
+
if (input) {
|
|
422
|
+
if (draft !== undefined)
|
|
423
|
+
input.value = draft;
|
|
424
|
+
input.focus({ preventScroll: true });
|
|
425
|
+
}
|
|
426
|
+
}
|
|
427
|
+
}
|
|
304
428
|
render() {
|
|
305
429
|
if (this._hasDeclarativeControls()) {
|
|
306
430
|
return `
|
|
@@ -312,21 +436,22 @@ class ElDmPagination extends BaseElement {
|
|
|
312
436
|
</nav>
|
|
313
437
|
`;
|
|
314
438
|
}
|
|
315
|
-
const total =
|
|
316
|
-
const current =
|
|
317
|
-
const pages = this._getPageRange();
|
|
439
|
+
const total = this._pageCount;
|
|
440
|
+
const current = this._clampPage(this.current);
|
|
441
|
+
const pages = this._getPageRange(total, current);
|
|
318
442
|
const isFirstPage = current === 1;
|
|
319
443
|
const isLastPage = current === total;
|
|
320
444
|
let pagesHtml = "";
|
|
321
445
|
for (const page of pages) {
|
|
322
446
|
if (page === "ellipsis") {
|
|
323
447
|
pagesHtml += `
|
|
324
|
-
<span class="ellipsis" part="ellipsis" aria-hidden="true"
|
|
448
|
+
<span class="ellipsis" part="ellipsis" aria-hidden="true">…</span>
|
|
325
449
|
`;
|
|
326
450
|
} else {
|
|
327
451
|
const isActive = page === current;
|
|
328
452
|
pagesHtml += `
|
|
329
453
|
<button
|
|
454
|
+
type="button"
|
|
330
455
|
class="pagination-btn${isActive ? " active" : ""}"
|
|
331
456
|
part="page"
|
|
332
457
|
data-page="${page}"
|
|
@@ -336,9 +461,12 @@ class ElDmPagination extends BaseElement {
|
|
|
336
461
|
`;
|
|
337
462
|
}
|
|
338
463
|
}
|
|
464
|
+
const pageSize = this._pageSize;
|
|
465
|
+
const sizes = [...new Set([10, 20, 50, 100, pageSize])].sort((a, b) => a - b);
|
|
339
466
|
return `
|
|
340
467
|
<nav class="pagination" part="container" role="navigation" aria-label="Pagination">
|
|
341
468
|
<button
|
|
469
|
+
type="button"
|
|
342
470
|
class="pagination-btn nav-btn"
|
|
343
471
|
part="button"
|
|
344
472
|
data-action="first"
|
|
@@ -346,6 +474,7 @@ class ElDmPagination extends BaseElement {
|
|
|
346
474
|
${isFirstPage ? "disabled" : ""}
|
|
347
475
|
>${ICONS.first}</button>
|
|
348
476
|
<button
|
|
477
|
+
type="button"
|
|
349
478
|
class="pagination-btn nav-btn"
|
|
350
479
|
part="button"
|
|
351
480
|
data-action="prev"
|
|
@@ -354,6 +483,7 @@ class ElDmPagination extends BaseElement {
|
|
|
354
483
|
>${ICONS.prev}</button>
|
|
355
484
|
${pagesHtml}
|
|
356
485
|
<button
|
|
486
|
+
type="button"
|
|
357
487
|
class="pagination-btn nav-btn"
|
|
358
488
|
part="button"
|
|
359
489
|
data-action="next"
|
|
@@ -361,12 +491,26 @@ class ElDmPagination extends BaseElement {
|
|
|
361
491
|
${isLastPage ? "disabled" : ""}
|
|
362
492
|
>${ICONS.next}</button>
|
|
363
493
|
<button
|
|
494
|
+
type="button"
|
|
364
495
|
class="pagination-btn nav-btn"
|
|
365
496
|
part="button"
|
|
366
497
|
data-action="last"
|
|
367
498
|
aria-label="Go to last page"
|
|
368
499
|
${isLastPage ? "disabled" : ""}
|
|
369
500
|
>${ICONS.last}</button>
|
|
501
|
+
${this.showSizeChanger ? `
|
|
502
|
+
<label class="pagination-field">
|
|
503
|
+
${fieldIcon("m12 3 9 5-9 5-9-5 9-5Zm-9 9 9 5 9-5M3 16l9 5 9-5")}
|
|
504
|
+
<select part="page-size" data-control="page-size" aria-label="Page size">
|
|
505
|
+
${sizes.map((size) => `<option${size === pageSize ? " selected" : ""}>${size}</option>`).join("")}
|
|
506
|
+
</select>
|
|
507
|
+
${fieldIcon("m6 9 6 6 6-6", 12)}
|
|
508
|
+
</label>` : ""}
|
|
509
|
+
${this.showQuickJumper ? `
|
|
510
|
+
<label class="pagination-field pagination-jumper">
|
|
511
|
+
${fieldIcon("M4 12h12m-5-5 5 5-5 5m9-12v14")}
|
|
512
|
+
<input part="page-jump" data-control="page-jump" type="number" min="1" max="${total}" aria-label="Jump to page" />
|
|
513
|
+
</label>` : ""}
|
|
370
514
|
</nav>
|
|
371
515
|
`;
|
|
372
516
|
}
|
|
@@ -383,5 +527,5 @@ export {
|
|
|
383
527
|
register
|
|
384
528
|
};
|
|
385
529
|
|
|
386
|
-
//# debugId=
|
|
530
|
+
//# debugId=3C7AD4F22526330364756E2164756E21
|
|
387
531
|
//# sourceMappingURL=index.js.map
|
package/dist/esm/index.js.map
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/el-dm-pagination.ts", "../../src/index.ts"],
|
|
4
4
|
"sourcesContent": [
|
|
5
|
-
"/**\n * DuskMoon Pagination Element\n *\n * A customizable pagination component for page navigation.\n * Supports first/last, previous/next buttons, and page number display with ellipsis.\n *\n * @element el-dm-pagination\n *\n * @attr {number} total - Total number of pages\n * @attr {number} current - Current active page (1-indexed)\n * @attr {number} siblings - Number of pages to show around current page\n * @attr {number} boundaries - Number of pages to show at start/end\n * @attr {string} size - Button size: xs, sm, md, lg\n * @attr {string} color - Color variant: primary, secondary, neutral\n *\n * @slot prev - Declarative server-rendered previous-page control\n * @slot previous - Alias for the declarative previous-page control\n * @slot page - Declarative server-rendered page or ellipsis control\n * @slot next - Declarative server-rendered next-page control\n *\n * @csspart container - The pagination container\n * @csspart button - Navigation buttons (first, prev, next, last)\n * @csspart page - Page number buttons\n * @csspart ellipsis - Ellipsis indicators\n *\n * @fires change - Fired when the current page changes, detail: { page: number }\n */\n\nimport { BaseElement, css } from '@duskmoon-dev/el-base';\n\nexport type PaginationSize = 'xs' | 'sm' | 'md' | 'lg';\nexport type PaginationColor = 'primary' | 'secondary' | 'neutral';\n\nconst styles = css`\n :host {\n display: inline-flex;\n vertical-align: middle;\n }\n\n :host([hidden]) {\n display: none !important;\n }\n\n .pagination {\n display: flex;\n align-items: center;\n gap: 0.25rem;\n font-family: inherit;\n }\n\n .pagination-btn {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n border: 1px solid var(--color-border, #d1d5db);\n background: var(--color-surface, #ffffff);\n color: var(--color-text, #374151);\n cursor: pointer;\n font-family: inherit;\n font-weight: 500;\n transition:\n background-color 0.15s ease,\n border-color 0.15s ease,\n color 0.15s ease;\n border-radius: var(--radius-md, 0.375rem);\n min-width: 2rem;\n height: 2rem;\n padding: 0 0.5rem;\n font-size: 0.875rem;\n line-height: 1;\n }\n\n .pagination-btn:hover:not(:disabled) {\n background: var(--color-surface-hover, #f3f4f6);\n border-color: var(--color-border-hover, #9ca3af);\n }\n\n .pagination-btn:focus-visible {\n outline: 2px solid var(--color-primary, #3b82f6);\n outline-offset: 2px;\n }\n\n .pagination-btn:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n }\n\n .pagination-btn.active {\n background: var(--color-primary, #3b82f6);\n border-color: var(--color-primary, #3b82f6);\n color: var(--color-primary-contrast, #ffffff);\n }\n\n .pagination-btn.nav-btn {\n padding: 0 0.375rem;\n }\n\n .pagination-btn.nav-btn svg {\n width: 1em;\n height: 1em;\n }\n\n .ellipsis {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n min-width: 2rem;\n height: 2rem;\n color: var(--color-text-muted, #6b7280);\n font-size: 0.875rem;\n user-select: none;\n }\n\n ::slotted([slot='prev']),\n ::slotted([slot='previous']),\n ::slotted([slot='page']),\n ::slotted([slot='next']) {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n min-width: 2rem;\n height: 2rem;\n padding: 0 0.5rem;\n border: 1px solid var(--color-border, #d1d5db);\n border-radius: var(--radius-md, 0.375rem);\n color: var(--color-text, #374151);\n font: inherit;\n text-decoration: none;\n }\n\n ::slotted([slot='page'][aria-current='page']),\n ::slotted([slot='page'][data-active='true']) {\n border-color: var(--color-primary, #3b82f6);\n background: var(--color-primary, #3b82f6);\n color: var(--color-primary-contrast, #ffffff);\n }\n\n ::slotted([disabled]),\n ::slotted([aria-disabled='true']) {\n opacity: 0.5;\n cursor: not-allowed;\n }\n\n /* Size variants */\n :host([size='xs']) .pagination-btn {\n min-width: 1.5rem;\n height: 1.5rem;\n padding: 0 0.25rem;\n font-size: 0.75rem;\n border-radius: var(--radius-sm, 0.25rem);\n }\n\n :host([size='xs']) .ellipsis {\n min-width: 1.5rem;\n height: 1.5rem;\n font-size: 0.75rem;\n }\n\n :host([size='sm']) .pagination-btn {\n min-width: 1.75rem;\n height: 1.75rem;\n padding: 0 0.375rem;\n font-size: 0.8125rem;\n }\n\n :host([size='sm']) .ellipsis {\n min-width: 1.75rem;\n height: 1.75rem;\n font-size: 0.8125rem;\n }\n\n :host([size='lg']) .pagination-btn {\n min-width: 2.5rem;\n height: 2.5rem;\n padding: 0 0.75rem;\n font-size: 1rem;\n }\n\n :host([size='lg']) .ellipsis {\n min-width: 2.5rem;\n height: 2.5rem;\n font-size: 1rem;\n }\n\n /* Color variants */\n :host([color='secondary']) .pagination-btn.active {\n background: var(--color-secondary, #8b5cf6);\n border-color: var(--color-secondary, #8b5cf6);\n color: var(--color-secondary-contrast, #ffffff);\n }\n\n :host([color='secondary']) .pagination-btn:focus-visible {\n outline-color: var(--color-secondary, #8b5cf6);\n }\n\n :host([color='neutral']) .pagination-btn.active {\n background: var(--color-neutral, #6b7280);\n border-color: var(--color-neutral, #6b7280);\n color: var(--color-neutral-contrast, #ffffff);\n }\n\n :host([color='neutral']) .pagination-btn:focus-visible {\n outline-color: var(--color-neutral, #6b7280);\n }\n`;\n\n// SVG icons for navigation buttons\nconst ICONS = {\n first: `<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 20 20\" fill=\"currentColor\"><path fill-rule=\"evenodd\" d=\"M15.79 14.77a.75.75 0 01-1.06.02l-4.5-4.25a.75.75 0 010-1.08l4.5-4.25a.75.75 0 111.04 1.08L11.832 10l3.938 3.71a.75.75 0 01.02 1.06zm-6 0a.75.75 0 01-1.06.02l-4.5-4.25a.75.75 0 010-1.08l4.5-4.25a.75.75 0 111.04 1.08L5.832 10l3.938 3.71a.75.75 0 01.02 1.06z\" clip-rule=\"evenodd\"/></svg>`,\n prev: `<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 20 20\" fill=\"currentColor\"><path fill-rule=\"evenodd\" d=\"M12.79 5.23a.75.75 0 01-.02 1.06L8.832 10l3.938 3.71a.75.75 0 11-1.04 1.08l-4.5-4.25a.75.75 0 010-1.08l4.5-4.25a.75.75 0 011.06.02z\" clip-rule=\"evenodd\"/></svg>`,\n next: `<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 20 20\" fill=\"currentColor\"><path fill-rule=\"evenodd\" d=\"M7.21 14.77a.75.75 0 01.02-1.06L11.168 10 7.23 6.29a.75.75 0 111.04-1.08l4.5 4.25a.75.75 0 010 1.08l-4.5 4.25a.75.75 0 01-1.06-.02z\" clip-rule=\"evenodd\"/></svg>`,\n last: `<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 20 20\" fill=\"currentColor\"><path fill-rule=\"evenodd\" d=\"M4.21 5.23a.75.75 0 011.06-.02l4.5 4.25a.75.75 0 010 1.08l-4.5 4.25a.75.75 0 11-1.04-1.08L8.168 10 4.23 6.29a.75.75 0 01-.02-1.06zm6 0a.75.75 0 011.06-.02l4.5 4.25a.75.75 0 010 1.08l-4.5 4.25a.75.75 0 11-1.04-1.08L14.168 10l-3.938-3.71a.75.75 0 01-.02-1.06z\" clip-rule=\"evenodd\"/></svg>`,\n};\n\nexport class ElDmPagination extends BaseElement {\n static properties = {\n total: { type: Number, reflect: true, default: 1 },\n current: { type: Number, reflect: true, default: 1 },\n siblings: { type: Number, reflect: true, default: 1 },\n boundaries: { type: Number, reflect: true, default: 1 },\n size: { type: String, reflect: true },\n color: { type: String, reflect: true },\n };\n\n /** Total number of pages */\n declare total: number;\n\n /** Current active page (1-indexed) */\n declare current: number;\n\n /** Number of pages shown around the current page */\n declare siblings: number;\n\n /** Number of pages shown at the start and end */\n declare boundaries: number;\n\n /** Button size: xs, sm, md, lg */\n declare size: PaginationSize;\n\n /** Color variant: primary, secondary, neutral */\n declare color: PaginationColor;\n\n private _controlsObserver?: MutationObserver;\n\n constructor() {\n super();\n this.attachStyles(styles);\n }\n\n connectedCallback(): void {\n super.connectedCallback();\n this.addEventListener('click', this._handleClick.bind(this));\n this.addEventListener('keydown', this._handleKeydown.bind(this));\n this._controlsObserver = new MutationObserver(() => this.update());\n this._controlsObserver.observe(this, {\n childList: true,\n subtree: true,\n attributes: true,\n attributeFilter: ['slot'],\n });\n }\n\n disconnectedCallback(): void {\n this._controlsObserver?.disconnect();\n super.disconnectedCallback();\n }\n\n /**\n * Calculate the range of page numbers to display\n */\n private _getPageRange(): (number | 'ellipsis')[] {\n const total = Math.max(1, this.total);\n const current = Math.min(Math.max(1, this.current), total);\n const siblings = Math.max(0, this.siblings);\n const boundaries = Math.max(0, this.boundaries);\n\n // If total pages fit without ellipsis\n const totalPageNumbers = boundaries * 2 + siblings * 2 + 3; // boundaries + siblings + current + 2 ellipsis spots\n if (total <= totalPageNumbers) {\n return Array.from({ length: total }, (_, i) => i + 1);\n }\n\n const leftSiblingIndex = Math.max(current - siblings, boundaries + 1);\n const rightSiblingIndex = Math.min(current + siblings, total - boundaries);\n\n const showLeftEllipsis = leftSiblingIndex > boundaries + 2;\n const showRightEllipsis = rightSiblingIndex < total - boundaries - 1;\n\n const pages: (number | 'ellipsis')[] = [];\n\n // Add left boundary pages\n for (let i = 1; i <= boundaries; i++) {\n pages.push(i);\n }\n\n // Add left ellipsis or connecting page\n if (showLeftEllipsis) {\n pages.push('ellipsis');\n } else if (boundaries + 1 < leftSiblingIndex) {\n pages.push(boundaries + 1);\n }\n\n // Add sibling pages and current page\n for (let i = leftSiblingIndex; i <= rightSiblingIndex; i++) {\n if (i > boundaries && i <= total - boundaries) {\n pages.push(i);\n }\n }\n\n // Add right ellipsis or connecting page\n if (showRightEllipsis) {\n pages.push('ellipsis');\n } else if (rightSiblingIndex < total - boundaries) {\n pages.push(total - boundaries);\n }\n\n // Add right boundary pages\n for (let i = total - boundaries + 1; i <= total; i++) {\n if (i > 0 && !pages.includes(i)) {\n pages.push(i);\n }\n }\n\n return pages;\n }\n\n private _hasDeclarativeControls(): boolean {\n return (\n this.querySelector('[slot=\"prev\"], [slot=\"previous\"], [slot=\"page\"], [slot=\"next\"]') !== null\n );\n }\n\n /**\n * Navigate to a specific page\n */\n private _goToPage(page: number): void {\n const newPage = Math.min(Math.max(1, page), this.total);\n if (newPage !== this.current) {\n this.current = newPage;\n this.emit('change', { page: newPage });\n }\n }\n\n /**\n * Handle click events on pagination buttons\n */\n private _handleClick(event: Event): void {\n if (this._hasDeclarativeControls()) return;\n\n const target = event.target as HTMLElement;\n const button = target.closest('button');\n\n if (!button || button.disabled) return;\n\n const action = button.dataset.action;\n const page = button.dataset.page;\n\n if (action === 'first') {\n this._goToPage(1);\n } else if (action === 'prev') {\n this._goToPage(this.current - 1);\n } else if (action === 'next') {\n this._goToPage(this.current + 1);\n } else if (action === 'last') {\n this._goToPage(this.total);\n } else if (page) {\n this._goToPage(parseInt(page, 10));\n }\n }\n\n /**\n * Handle keyboard navigation\n */\n private _handleKeydown(event: KeyboardEvent): void {\n if (this._hasDeclarativeControls()) return;\n\n switch (event.key) {\n case 'ArrowLeft':\n event.preventDefault();\n this._goToPage(this.current - 1);\n break;\n case 'ArrowRight':\n event.preventDefault();\n this._goToPage(this.current + 1);\n break;\n case 'Home':\n event.preventDefault();\n this._goToPage(1);\n break;\n case 'End':\n event.preventDefault();\n this._goToPage(this.total);\n break;\n }\n }\n\n render(): string {\n if (this._hasDeclarativeControls()) {\n return `\n <nav class=\"pagination\" part=\"container\" role=\"navigation\" aria-label=\"Pagination\">\n <slot name=\"previous\"></slot>\n <slot name=\"prev\"></slot>\n <slot name=\"page\"></slot>\n <slot name=\"next\"></slot>\n </nav>\n `;\n }\n\n const total = Math.max(1, this.total);\n const current = Math.min(Math.max(1, this.current), total);\n const pages = this._getPageRange();\n\n const isFirstPage = current === 1;\n const isLastPage = current === total;\n\n let pagesHtml = '';\n\n for (const page of pages) {\n if (page === 'ellipsis') {\n pagesHtml += `\n <span class=\"ellipsis\" part=\"ellipsis\" aria-hidden=\"true\">...</span>\n `;\n } else {\n const isActive = page === current;\n pagesHtml += `\n <button\n class=\"pagination-btn${isActive ? ' active' : ''}\"\n part=\"page\"\n data-page=\"${page}\"\n aria-label=\"Page ${page}\"\n aria-current=\"${isActive ? 'page' : 'false'}\"\n >${page}</button>\n `;\n }\n }\n\n return `\n <nav class=\"pagination\" part=\"container\" role=\"navigation\" aria-label=\"Pagination\">\n <button\n class=\"pagination-btn nav-btn\"\n part=\"button\"\n data-action=\"first\"\n aria-label=\"Go to first page\"\n ${isFirstPage ? 'disabled' : ''}\n >${ICONS.first}</button>\n <button\n class=\"pagination-btn nav-btn\"\n part=\"button\"\n data-action=\"prev\"\n aria-label=\"Go to previous page\"\n ${isFirstPage ? 'disabled' : ''}\n >${ICONS.prev}</button>\n ${pagesHtml}\n <button\n class=\"pagination-btn nav-btn\"\n part=\"button\"\n data-action=\"next\"\n aria-label=\"Go to next page\"\n ${isLastPage ? 'disabled' : ''}\n >${ICONS.next}</button>\n <button\n class=\"pagination-btn nav-btn\"\n part=\"button\"\n data-action=\"last\"\n aria-label=\"Go to last page\"\n ${isLastPage ? 'disabled' : ''}\n >${ICONS.last}</button>\n </nav>\n `;\n }\n}\n",
|
|
5
|
+
"/**\n * DuskMoon Pagination Element\n *\n * A customizable pagination component for page navigation.\n * Supports first/last, previous/next buttons, and page number display with ellipsis.\n *\n * @element el-dm-pagination\n *\n * @attr {number} total - Total number of pages\n * @attr {number} total-items - When set, calculate the number of pages from the item count\n * @attr {number} page-size - Items per page (default: 10)\n * @attr {boolean} show-size-changer - Show the page-size selector\n * @attr {boolean} show-quick-jumper - Show the page jump input\n * @attr {number} current - Current active page (1-indexed)\n * @attr {number} siblings - Number of pages to show around current page\n * @attr {number} boundaries - Number of pages to show at start/end\n * @attr {string} size - Button size: xs, sm, md, lg\n * @attr {string} color - Color variant: primary, secondary, neutral\n *\n * @slot prev - Declarative server-rendered previous-page control\n * @slot previous - Alias for the declarative previous-page control\n * @slot page - Declarative server-rendered page or ellipsis control\n * @slot next - Declarative server-rendered next-page control\n *\n * @csspart container - The pagination container\n * @csspart button - Navigation buttons (first, prev, next, last)\n * @csspart page - Page number buttons\n * @csspart ellipsis - Ellipsis indicators\n *\n * @fires change - Fired when the current page changes, detail: { page: number }\n * @fires page-size-change - Fired when the page size changes, detail: { page: number, pageSize: number }\n */\n\nimport { BaseElement, css } from '@duskmoon-dev/el-base';\n\nexport type PaginationSize = 'xs' | 'sm' | 'md' | 'lg';\nexport type PaginationColor = 'primary' | 'secondary' | 'neutral';\n\nconst styles = css`\n :host {\n display: inline-flex;\n max-inline-size: 100%;\n min-inline-size: 0;\n vertical-align: middle;\n --pagination-control-height: 2rem;\n --pagination-control-font: 0.875rem;\n --pagination-control-radius: var(--radius-sm, 0.375rem);\n }\n\n :host([hidden]) {\n display: none !important;\n }\n\n .pagination {\n display: flex;\n align-items: center;\n gap: 0.25rem;\n font-family: inherit;\n max-inline-size: 100%;\n overflow-x: auto;\n padding: 3px;\n }\n\n .pagination > * {\n flex: none;\n }\n\n .pagination-btn {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n border: 1px solid var(--color-border, var(--color-outline, #d1d5db));\n background: var(--color-surface, #ffffff);\n color: var(--color-text, var(--color-on-surface, #374151));\n cursor: pointer;\n font-family: inherit;\n font-weight: 500;\n transition:\n background-color 0.15s ease,\n border-color 0.15s ease,\n color 0.15s ease;\n border-radius: var(--pagination-control-radius);\n min-width: var(--pagination-control-height);\n height: var(--pagination-control-height);\n padding: 0 0.5rem;\n font-size: var(--pagination-control-font);\n line-height: 1;\n }\n\n .pagination-btn:hover:not(:disabled) {\n background: var(--color-surface-hover, var(--color-surface-container, #f3f4f6));\n border-color: var(--color-border-hover, #9ca3af);\n }\n\n .pagination-btn:focus-visible,\n .pagination-field > :is(input, select):focus-visible {\n outline: 2px solid var(--color-primary, #3b82f6);\n outline-offset: 2px;\n }\n\n .pagination-btn:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n }\n\n .pagination-btn.active {\n background: var(--color-primary, #3b82f6);\n border-color: var(--color-primary, #3b82f6);\n color: var(--color-primary-contrast, var(--color-primary-content, #ffffff));\n }\n\n .pagination-btn.nav-btn {\n padding: 0 0.375rem;\n }\n\n .pagination-btn.nav-btn svg {\n width: 1em;\n height: 1em;\n }\n\n .pagination-field {\n position: relative;\n display: inline-flex;\n align-items: center;\n color: var(--color-text, var(--color-on-surface, #374151));\n }\n\n .pagination-field > :is(input, select) {\n block-size: var(--pagination-control-height);\n padding-block: 0;\n border: 1px solid var(--color-border, var(--color-outline, #d1d5db));\n border-radius: var(--pagination-control-radius);\n background: var(--color-surface, #ffffff);\n color: inherit;\n font: inherit;\n font-size: var(--pagination-control-font);\n font-variant-numeric: tabular-nums;\n }\n\n .pagination-field > select {\n appearance: none;\n padding-inline: 1.75rem 1.5rem;\n cursor: pointer;\n }\n\n .pagination-field > input {\n appearance: textfield;\n inline-size: 4.25rem;\n padding-inline: 1.75rem 0.5rem;\n text-align: center;\n }\n\n .pagination-field > input::-webkit-inner-spin-button {\n appearance: none;\n }\n\n .pagination-field > svg {\n position: absolute;\n pointer-events: none;\n }\n\n .pagination-field > svg:first-child {\n inset-inline-start: 0.5rem;\n }\n\n .pagination-field > svg:last-child {\n inset-inline-end: 0.5rem;\n }\n\n .pagination:dir(rtl) :is(.nav-btn, .pagination-jumper) > svg {\n transform: scaleX(-1);\n }\n\n .ellipsis {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n min-width: var(--pagination-control-height);\n height: var(--pagination-control-height);\n color: var(--color-text-muted, #6b7280);\n font-size: var(--pagination-control-font);\n user-select: none;\n }\n\n ::slotted([slot='prev']),\n ::slotted([slot='previous']),\n ::slotted([slot='page']),\n ::slotted([slot='next']) {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n min-width: 2rem;\n height: 2rem;\n padding: 0 0.5rem;\n border: 1px solid var(--color-border, #d1d5db);\n border-radius: var(--radius-md, 0.375rem);\n color: var(--color-text, #374151);\n font: inherit;\n text-decoration: none;\n }\n\n ::slotted([slot='page'][aria-current='page']),\n ::slotted([slot='page'][data-active='true']) {\n border-color: var(--color-primary, #3b82f6);\n background: var(--color-primary, #3b82f6);\n color: var(--color-primary-contrast, #ffffff);\n }\n\n ::slotted([disabled]),\n ::slotted([aria-disabled='true']) {\n opacity: 0.5;\n cursor: not-allowed;\n }\n\n /* Size variants */\n :host([size='xs']) {\n --pagination-control-height: 1.5rem;\n --pagination-control-font: 0.75rem;\n }\n\n :host([size='xs']) .pagination-btn {\n padding: 0 0.25rem;\n }\n\n :host([size='sm']) {\n --pagination-control-height: 1.75rem;\n --pagination-control-font: 0.8125rem;\n }\n\n :host([size='sm']) .pagination-btn {\n padding: 0 0.375rem;\n }\n\n :host([size='lg']) {\n --pagination-control-height: 2.5rem;\n --pagination-control-font: 1rem;\n }\n\n :host([size='lg']) .pagination-btn {\n padding: 0 0.75rem;\n }\n\n /* Color variants */\n :host([color='secondary']) .pagination-btn.active {\n background: var(--color-secondary, #8b5cf6);\n border-color: var(--color-secondary, #8b5cf6);\n color: var(--color-secondary-contrast, #ffffff);\n }\n\n :host([color='secondary']) .pagination-btn:focus-visible {\n outline-color: var(--color-secondary, #8b5cf6);\n }\n\n :host([color='neutral']) .pagination-btn.active {\n background: var(--color-neutral, #6b7280);\n border-color: var(--color-neutral, #6b7280);\n color: var(--color-neutral-contrast, #ffffff);\n }\n\n :host([color='neutral']) .pagination-btn:focus-visible {\n outline-color: var(--color-neutral, #6b7280);\n }\n`;\n\n// SVG icons for navigation buttons\nconst ICONS = {\n first: `<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 20 20\" fill=\"currentColor\"><path fill-rule=\"evenodd\" d=\"M15.79 14.77a.75.75 0 01-1.06.02l-4.5-4.25a.75.75 0 010-1.08l4.5-4.25a.75.75 0 111.04 1.08L11.832 10l3.938 3.71a.75.75 0 01.02 1.06zm-6 0a.75.75 0 01-1.06.02l-4.5-4.25a.75.75 0 010-1.08l4.5-4.25a.75.75 0 111.04 1.08L5.832 10l3.938 3.71a.75.75 0 01.02 1.06z\" clip-rule=\"evenodd\"/></svg>`,\n prev: `<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 20 20\" fill=\"currentColor\"><path fill-rule=\"evenodd\" d=\"M12.79 5.23a.75.75 0 01-.02 1.06L8.832 10l3.938 3.71a.75.75 0 11-1.04 1.08l-4.5-4.25a.75.75 0 010-1.08l4.5-4.25a.75.75 0 011.06.02z\" clip-rule=\"evenodd\"/></svg>`,\n next: `<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 20 20\" fill=\"currentColor\"><path fill-rule=\"evenodd\" d=\"M7.21 14.77a.75.75 0 01.02-1.06L11.168 10 7.23 6.29a.75.75 0 111.04-1.08l4.5 4.25a.75.75 0 010 1.08l-4.5 4.25a.75.75 0 01-1.06-.02z\" clip-rule=\"evenodd\"/></svg>`,\n last: `<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 20 20\" fill=\"currentColor\"><path fill-rule=\"evenodd\" d=\"M4.21 5.23a.75.75 0 011.06-.02l4.5 4.25a.75.75 0 010 1.08l-4.5 4.25a.75.75 0 11-1.04-1.08L8.168 10 4.23 6.29a.75.75 0 01-.02-1.06zm6 0a.75.75 0 011.06-.02l4.5 4.25a.75.75 0 010 1.08l-4.5 4.25a.75.75 0 11-1.04-1.08L14.168 10l-3.938-3.71a.75.75 0 01-.02-1.06z\" clip-rule=\"evenodd\"/></svg>`,\n};\n\nfunction fieldIcon(path: string, size = 14): string {\n return `<svg aria-hidden=\"true\" width=\"${size}\" height=\"${size}\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"${path}\" /></svg>`;\n}\n\nexport class ElDmPagination extends BaseElement {\n static properties = {\n total: { type: Number, reflect: true, default: 1 },\n totalItems: { type: Number, reflect: true },\n pageSize: { type: Number, reflect: true, default: 10 },\n showSizeChanger: { type: Boolean, reflect: true, default: false },\n showQuickJumper: { type: Boolean, reflect: true, default: false },\n current: { type: Number, reflect: true, default: 1 },\n siblings: { type: Number, reflect: true, default: 1 },\n boundaries: { type: Number, reflect: true, default: 1 },\n size: { type: String, reflect: true },\n color: { type: String, reflect: true },\n };\n\n /** Total number of pages */\n declare total: number;\n\n declare totalItems: number | undefined;\n declare pageSize: number;\n declare showSizeChanger: boolean;\n declare showQuickJumper: boolean;\n\n /** Current active page (1-indexed) */\n declare current: number;\n\n /** Number of pages shown around the current page */\n declare siblings: number;\n\n /** Number of pages shown at the start and end */\n declare boundaries: number;\n\n /** Button size: xs, sm, md, lg */\n declare size: PaginationSize;\n\n /** Color variant: primary, secondary, neutral */\n declare color: PaginationColor;\n\n private _controlsObserver?: MutationObserver;\n\n constructor() {\n super();\n this.attachStyles(styles);\n this.shadowRoot.addEventListener('click', this._handleClick.bind(this));\n this.shadowRoot.addEventListener('change', this._handleSizeChange.bind(this));\n this.shadowRoot.addEventListener('keydown', (event) =>\n this._handleKeydown(event as KeyboardEvent),\n );\n this.addEventListener('keydown', (event) => {\n if (event.composedPath()[0] === this) this._handleKeydown(event);\n });\n }\n\n connectedCallback(): void {\n super.connectedCallback();\n this._controlsObserver = new MutationObserver(() => this.update());\n this._controlsObserver.observe(this, {\n childList: true,\n subtree: true,\n attributes: true,\n attributeFilter: ['slot'],\n });\n }\n\n disconnectedCallback(): void {\n this._controlsObserver?.disconnect();\n super.disconnectedCallback();\n }\n\n /**\n * Calculate the range of page numbers to display\n */\n private _getPageRange(total: number, current: number): (number | 'ellipsis')[] {\n const siblings = Math.max(0, this.siblings);\n const boundaries = Math.max(0, this.boundaries);\n\n // If total pages fit without ellipsis\n const totalPageNumbers = boundaries * 2 + siblings * 2 + 3; // boundaries + siblings + current + 2 ellipsis spots\n if (total <= totalPageNumbers) {\n return Array.from({ length: total }, (_, i) => i + 1);\n }\n\n const leftSiblingIndex = Math.max(current - siblings, boundaries + 1);\n const rightSiblingIndex = Math.min(current + siblings, total - boundaries);\n\n const showLeftEllipsis = leftSiblingIndex > boundaries + 2;\n const showRightEllipsis = rightSiblingIndex < total - boundaries - 1;\n\n const pages: (number | 'ellipsis')[] = [];\n\n // Add left boundary pages\n for (let i = 1; i <= boundaries; i++) {\n pages.push(i);\n }\n\n // Add left ellipsis or connecting page\n if (showLeftEllipsis) {\n pages.push('ellipsis');\n } else if (boundaries + 1 < leftSiblingIndex) {\n pages.push(boundaries + 1);\n }\n\n // Add sibling pages and current page\n for (let i = leftSiblingIndex; i <= rightSiblingIndex; i++) {\n if (i > boundaries && i <= total - boundaries) {\n pages.push(i);\n }\n }\n\n // Add right ellipsis or connecting page\n if (showRightEllipsis) {\n pages.push('ellipsis');\n } else if (rightSiblingIndex < total - boundaries) {\n pages.push(total - boundaries);\n }\n\n // Add right boundary pages\n for (let i = total - boundaries + 1; i <= total; i++) {\n if (i > 0 && !pages.includes(i)) {\n pages.push(i);\n }\n }\n\n return pages;\n }\n\n private _hasDeclarativeControls(): boolean {\n return (\n this.querySelector('[slot=\"prev\"], [slot=\"previous\"], [slot=\"page\"], [slot=\"next\"]') !== null\n );\n }\n\n private get _pageSize(): number {\n return Number.isFinite(this.pageSize) ? Math.max(1, Math.floor(this.pageSize)) : 10;\n }\n\n private get _pageCount(): number {\n const itemCount = this.totalItems;\n const count =\n itemCount !== undefined && Number.isFinite(itemCount)\n ? Math.ceil(itemCount / this._pageSize)\n : this.total;\n return Number.isFinite(count) ? Math.max(1, Math.floor(count)) : 1;\n }\n\n private _clampPage(page: number): number {\n return Number.isFinite(page) ? Math.min(Math.max(1, Math.floor(page)), this._pageCount) : 1;\n }\n\n /**\n * Navigate to a specific page\n */\n private _goToPage(page: number): void {\n const newPage = this._clampPage(page);\n if (newPage !== this.current) {\n this.current = newPage;\n this.emit('change', { page: newPage });\n }\n }\n\n /**\n * Handle click events on pagination buttons\n */\n private _handleClick(event: Event): void {\n if (this._hasDeclarativeControls()) return;\n\n const target = event.target as Element;\n const button = target.closest('button');\n\n if (!button || button.disabled) return;\n\n const action = button.dataset.action;\n const page = button.dataset.page;\n\n if (action === 'first') {\n this._goToPage(1);\n } else if (action === 'prev') {\n this._goToPage(this._clampPage(this.current) - 1);\n } else if (action === 'next') {\n this._goToPage(this._clampPage(this.current) + 1);\n } else if (action === 'last') {\n this._goToPage(this._pageCount);\n } else if (page) {\n this._goToPage(parseInt(page, 10));\n }\n }\n\n private _handleSizeChange(event: Event): void {\n const select = event.target as HTMLSelectElement | null;\n if (select?.localName !== 'select' || !select.matches('[data-control=\"page-size\"]')) return;\n\n event.stopPropagation();\n const pageSize = Number(select.value);\n if (!Number.isInteger(pageSize) || pageSize < 1 || pageSize === this._pageSize) return;\n\n const current = this.current;\n this.pageSize = pageSize;\n const page = this._clampPage(current);\n this.current = page;\n if (page !== current) this.emit('change', { page });\n this.emit('page-size-change', { page, pageSize });\n }\n\n /**\n * Handle keyboard navigation\n */\n private _handleKeydown(event: KeyboardEvent): void {\n if (this._hasDeclarativeControls()) return;\n\n const target = event.target as HTMLInputElement | null;\n if (target?.localName === 'select') return;\n if (target?.localName === 'input') {\n if (event.key === 'Enter' && target.matches('[data-control=\"page-jump\"]')) {\n event.preventDefault();\n const page = target.valueAsNumber;\n if (Number.isFinite(page)) {\n target.value = '';\n this._goToPage(page);\n }\n }\n return;\n }\n\n const current = this._clampPage(this.current);\n const rtl = this.matches(':dir(rtl)');\n\n switch (event.key) {\n case 'ArrowLeft':\n event.preventDefault();\n this._goToPage(current + (rtl ? 1 : -1));\n break;\n case 'ArrowRight':\n event.preventDefault();\n this._goToPage(current + (rtl ? -1 : 1));\n break;\n case 'Home':\n event.preventDefault();\n this._goToPage(1);\n break;\n case 'End':\n event.preventDefault();\n this._goToPage(this._pageCount);\n break;\n }\n }\n\n protected update(): void {\n const active = this.shadowRoot.activeElement;\n const control = active?.getAttribute('data-control');\n const draft = active?.localName === 'input' ? (active as HTMLInputElement).value : undefined;\n const scrollLeft = this.query<HTMLElement>('nav')?.scrollLeft ?? 0;\n\n super.update();\n\n const nav = this.query<HTMLElement>('nav');\n if (nav) nav.scrollLeft = scrollLeft;\n if (control === 'page-size' || control === 'page-jump') {\n const input = this.query<HTMLInputElement>(`[data-control=\"${control}\"]`);\n if (input) {\n if (draft !== undefined) input.value = draft;\n input.focus({ preventScroll: true });\n }\n }\n }\n\n render(): string {\n if (this._hasDeclarativeControls()) {\n return `\n <nav class=\"pagination\" part=\"container\" role=\"navigation\" aria-label=\"Pagination\">\n <slot name=\"previous\"></slot>\n <slot name=\"prev\"></slot>\n <slot name=\"page\"></slot>\n <slot name=\"next\"></slot>\n </nav>\n `;\n }\n\n const total = this._pageCount;\n const current = this._clampPage(this.current);\n const pages = this._getPageRange(total, current);\n\n const isFirstPage = current === 1;\n const isLastPage = current === total;\n\n let pagesHtml = '';\n\n for (const page of pages) {\n if (page === 'ellipsis') {\n pagesHtml += `\n <span class=\"ellipsis\" part=\"ellipsis\" aria-hidden=\"true\">…</span>\n `;\n } else {\n const isActive = page === current;\n pagesHtml += `\n <button\n type=\"button\"\n class=\"pagination-btn${isActive ? ' active' : ''}\"\n part=\"page\"\n data-page=\"${page}\"\n aria-label=\"Page ${page}\"\n aria-current=\"${isActive ? 'page' : 'false'}\"\n >${page}</button>\n `;\n }\n }\n\n const pageSize = this._pageSize;\n const sizes = [...new Set([10, 20, 50, 100, pageSize])].sort((a, b) => a - b);\n\n return `\n <nav class=\"pagination\" part=\"container\" role=\"navigation\" aria-label=\"Pagination\">\n <button\n type=\"button\"\n class=\"pagination-btn nav-btn\"\n part=\"button\"\n data-action=\"first\"\n aria-label=\"Go to first page\"\n ${isFirstPage ? 'disabled' : ''}\n >${ICONS.first}</button>\n <button\n type=\"button\"\n class=\"pagination-btn nav-btn\"\n part=\"button\"\n data-action=\"prev\"\n aria-label=\"Go to previous page\"\n ${isFirstPage ? 'disabled' : ''}\n >${ICONS.prev}</button>\n ${pagesHtml}\n <button\n type=\"button\"\n class=\"pagination-btn nav-btn\"\n part=\"button\"\n data-action=\"next\"\n aria-label=\"Go to next page\"\n ${isLastPage ? 'disabled' : ''}\n >${ICONS.next}</button>\n <button\n type=\"button\"\n class=\"pagination-btn nav-btn\"\n part=\"button\"\n data-action=\"last\"\n aria-label=\"Go to last page\"\n ${isLastPage ? 'disabled' : ''}\n >${ICONS.last}</button>\n ${\n this.showSizeChanger\n ? `\n <label class=\"pagination-field\">\n ${fieldIcon('m12 3 9 5-9 5-9-5 9-5Zm-9 9 9 5 9-5M3 16l9 5 9-5')}\n <select part=\"page-size\" data-control=\"page-size\" aria-label=\"Page size\">\n ${sizes.map((size) => `<option${size === pageSize ? ' selected' : ''}>${size}</option>`).join('')}\n </select>\n ${fieldIcon('m6 9 6 6 6-6', 12)}\n </label>`\n : ''\n }\n ${\n this.showQuickJumper\n ? `\n <label class=\"pagination-field pagination-jumper\">\n ${fieldIcon('M4 12h12m-5-5 5 5-5 5m9-12v14')}\n <input part=\"page-jump\" data-control=\"page-jump\" type=\"number\" min=\"1\" max=\"${total}\" aria-label=\"Jump to page\" />\n </label>`\n : ''\n }\n </nav>\n `;\n }\n}\n",
|
|
6
6
|
"/**\n * @duskmoon-dev/el-pagination\n *\n * DuskMoon Pagination custom element\n */\n\nimport { ElDmPagination } from './el-dm-pagination.js';\n\nexport { ElDmPagination };\n\n/**\n * Register the el-dm-pagination custom element\n *\n * @example\n * ```ts\n * import { register } from '@duskmoon-dev/el-pagination';\n * register();\n * ```\n */\nexport function register(): void {\n if (!customElements.get('el-dm-pagination')) {\n customElements.define('el-dm-pagination', ElDmPagination);\n }\n}\n"
|
|
7
7
|
],
|
|
8
|
-
"mappings": ";
|
|
9
|
-
"debugId": "
|
|
8
|
+
"mappings": ";AAiCA;AAKA,IAAM,SAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;A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