@duskmoon-dev/el-pagination 2.2.0 → 2.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.
- 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/cjs/register.js
CHANGED
|
@@ -49,7 +49,12 @@ var import_el_base = require("@duskmoon-dev/el-base");
|
|
|
49
49
|
var styles = import_el_base.css`
|
|
50
50
|
:host {
|
|
51
51
|
display: inline-flex;
|
|
52
|
+
max-inline-size: 100%;
|
|
53
|
+
min-inline-size: 0;
|
|
52
54
|
vertical-align: middle;
|
|
55
|
+
--pagination-control-height: 2rem;
|
|
56
|
+
--pagination-control-font: 0.875rem;
|
|
57
|
+
--pagination-control-radius: var(--radius-sm, 0.375rem);
|
|
53
58
|
}
|
|
54
59
|
|
|
55
60
|
:host([hidden]) {
|
|
@@ -61,15 +66,22 @@ var styles = import_el_base.css`
|
|
|
61
66
|
align-items: center;
|
|
62
67
|
gap: 0.25rem;
|
|
63
68
|
font-family: inherit;
|
|
69
|
+
max-inline-size: 100%;
|
|
70
|
+
overflow-x: auto;
|
|
71
|
+
padding: 3px;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.pagination > * {
|
|
75
|
+
flex: none;
|
|
64
76
|
}
|
|
65
77
|
|
|
66
78
|
.pagination-btn {
|
|
67
79
|
display: inline-flex;
|
|
68
80
|
align-items: center;
|
|
69
81
|
justify-content: center;
|
|
70
|
-
border: 1px solid var(--color-border, #d1d5db);
|
|
82
|
+
border: 1px solid var(--color-border, var(--color-outline, #d1d5db));
|
|
71
83
|
background: var(--color-surface, #ffffff);
|
|
72
|
-
color: var(--color-text, #374151);
|
|
84
|
+
color: var(--color-text, var(--color-on-surface, #374151));
|
|
73
85
|
cursor: pointer;
|
|
74
86
|
font-family: inherit;
|
|
75
87
|
font-weight: 500;
|
|
@@ -77,20 +89,21 @@ var styles = import_el_base.css`
|
|
|
77
89
|
background-color 0.15s ease,
|
|
78
90
|
border-color 0.15s ease,
|
|
79
91
|
color 0.15s ease;
|
|
80
|
-
border-radius: var(--radius
|
|
81
|
-
min-width:
|
|
82
|
-
height:
|
|
92
|
+
border-radius: var(--pagination-control-radius);
|
|
93
|
+
min-width: var(--pagination-control-height);
|
|
94
|
+
height: var(--pagination-control-height);
|
|
83
95
|
padding: 0 0.5rem;
|
|
84
|
-
font-size:
|
|
96
|
+
font-size: var(--pagination-control-font);
|
|
85
97
|
line-height: 1;
|
|
86
98
|
}
|
|
87
99
|
|
|
88
100
|
.pagination-btn:hover:not(:disabled) {
|
|
89
|
-
background: var(--color-surface-hover, #f3f4f6);
|
|
101
|
+
background: var(--color-surface-hover, var(--color-surface-container, #f3f4f6));
|
|
90
102
|
border-color: var(--color-border-hover, #9ca3af);
|
|
91
103
|
}
|
|
92
104
|
|
|
93
|
-
.pagination-btn:focus-visible
|
|
105
|
+
.pagination-btn:focus-visible,
|
|
106
|
+
.pagination-field > :is(input, select):focus-visible {
|
|
94
107
|
outline: 2px solid var(--color-primary, #3b82f6);
|
|
95
108
|
outline-offset: 2px;
|
|
96
109
|
}
|
|
@@ -103,7 +116,7 @@ var styles = import_el_base.css`
|
|
|
103
116
|
.pagination-btn.active {
|
|
104
117
|
background: var(--color-primary, #3b82f6);
|
|
105
118
|
border-color: var(--color-primary, #3b82f6);
|
|
106
|
-
color: var(--color-primary-contrast, #ffffff);
|
|
119
|
+
color: var(--color-primary-contrast, var(--color-primary-content, #ffffff));
|
|
107
120
|
}
|
|
108
121
|
|
|
109
122
|
.pagination-btn.nav-btn {
|
|
@@ -115,14 +128,67 @@ var styles = import_el_base.css`
|
|
|
115
128
|
height: 1em;
|
|
116
129
|
}
|
|
117
130
|
|
|
131
|
+
.pagination-field {
|
|
132
|
+
position: relative;
|
|
133
|
+
display: inline-flex;
|
|
134
|
+
align-items: center;
|
|
135
|
+
color: var(--color-text, var(--color-on-surface, #374151));
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.pagination-field > :is(input, select) {
|
|
139
|
+
block-size: var(--pagination-control-height);
|
|
140
|
+
padding-block: 0;
|
|
141
|
+
border: 1px solid var(--color-border, var(--color-outline, #d1d5db));
|
|
142
|
+
border-radius: var(--pagination-control-radius);
|
|
143
|
+
background: var(--color-surface, #ffffff);
|
|
144
|
+
color: inherit;
|
|
145
|
+
font: inherit;
|
|
146
|
+
font-size: var(--pagination-control-font);
|
|
147
|
+
font-variant-numeric: tabular-nums;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
.pagination-field > select {
|
|
151
|
+
appearance: none;
|
|
152
|
+
padding-inline: 1.75rem 1.5rem;
|
|
153
|
+
cursor: pointer;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
.pagination-field > input {
|
|
157
|
+
appearance: textfield;
|
|
158
|
+
inline-size: 4.25rem;
|
|
159
|
+
padding-inline: 1.75rem 0.5rem;
|
|
160
|
+
text-align: center;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
.pagination-field > input::-webkit-inner-spin-button {
|
|
164
|
+
appearance: none;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
.pagination-field > svg {
|
|
168
|
+
position: absolute;
|
|
169
|
+
pointer-events: none;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
.pagination-field > svg:first-child {
|
|
173
|
+
inset-inline-start: 0.5rem;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
.pagination-field > svg:last-child {
|
|
177
|
+
inset-inline-end: 0.5rem;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
.pagination:dir(rtl) :is(.nav-btn, .pagination-jumper) > svg {
|
|
181
|
+
transform: scaleX(-1);
|
|
182
|
+
}
|
|
183
|
+
|
|
118
184
|
.ellipsis {
|
|
119
185
|
display: inline-flex;
|
|
120
186
|
align-items: center;
|
|
121
187
|
justify-content: center;
|
|
122
|
-
min-width:
|
|
123
|
-
height:
|
|
188
|
+
min-width: var(--pagination-control-height);
|
|
189
|
+
height: var(--pagination-control-height);
|
|
124
190
|
color: var(--color-text-muted, #6b7280);
|
|
125
|
-
font-size:
|
|
191
|
+
font-size: var(--pagination-control-font);
|
|
126
192
|
user-select: none;
|
|
127
193
|
}
|
|
128
194
|
|
|
@@ -157,44 +223,31 @@ var styles = import_el_base.css`
|
|
|
157
223
|
}
|
|
158
224
|
|
|
159
225
|
/* Size variants */
|
|
226
|
+
:host([size='xs']) {
|
|
227
|
+
--pagination-control-height: 1.5rem;
|
|
228
|
+
--pagination-control-font: 0.75rem;
|
|
229
|
+
}
|
|
230
|
+
|
|
160
231
|
:host([size='xs']) .pagination-btn {
|
|
161
|
-
min-width: 1.5rem;
|
|
162
|
-
height: 1.5rem;
|
|
163
232
|
padding: 0 0.25rem;
|
|
164
|
-
font-size: 0.75rem;
|
|
165
|
-
border-radius: var(--radius-sm, 0.25rem);
|
|
166
233
|
}
|
|
167
234
|
|
|
168
|
-
:host([size='
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
font-size: 0.75rem;
|
|
235
|
+
:host([size='sm']) {
|
|
236
|
+
--pagination-control-height: 1.75rem;
|
|
237
|
+
--pagination-control-font: 0.8125rem;
|
|
172
238
|
}
|
|
173
239
|
|
|
174
240
|
:host([size='sm']) .pagination-btn {
|
|
175
|
-
min-width: 1.75rem;
|
|
176
|
-
height: 1.75rem;
|
|
177
241
|
padding: 0 0.375rem;
|
|
178
|
-
font-size: 0.8125rem;
|
|
179
242
|
}
|
|
180
243
|
|
|
181
|
-
:host([size='
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
font-size: 0.8125rem;
|
|
244
|
+
:host([size='lg']) {
|
|
245
|
+
--pagination-control-height: 2.5rem;
|
|
246
|
+
--pagination-control-font: 1rem;
|
|
185
247
|
}
|
|
186
248
|
|
|
187
249
|
:host([size='lg']) .pagination-btn {
|
|
188
|
-
min-width: 2.5rem;
|
|
189
|
-
height: 2.5rem;
|
|
190
250
|
padding: 0 0.75rem;
|
|
191
|
-
font-size: 1rem;
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
:host([size='lg']) .ellipsis {
|
|
195
|
-
min-width: 2.5rem;
|
|
196
|
-
height: 2.5rem;
|
|
197
|
-
font-size: 1rem;
|
|
198
251
|
}
|
|
199
252
|
|
|
200
253
|
/* Color variants */
|
|
@@ -224,10 +277,17 @@ var ICONS = {
|
|
|
224
277
|
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>`,
|
|
225
278
|
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>`
|
|
226
279
|
};
|
|
280
|
+
function fieldIcon(path, size = 14) {
|
|
281
|
+
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>`;
|
|
282
|
+
}
|
|
227
283
|
|
|
228
284
|
class ElDmPagination extends import_el_base.BaseElement {
|
|
229
285
|
static properties = {
|
|
230
286
|
total: { type: Number, reflect: true, default: 1 },
|
|
287
|
+
totalItems: { type: Number, reflect: true },
|
|
288
|
+
pageSize: { type: Number, reflect: true, default: 10 },
|
|
289
|
+
showSizeChanger: { type: Boolean, reflect: true, default: false },
|
|
290
|
+
showQuickJumper: { type: Boolean, reflect: true, default: false },
|
|
231
291
|
current: { type: Number, reflect: true, default: 1 },
|
|
232
292
|
siblings: { type: Number, reflect: true, default: 1 },
|
|
233
293
|
boundaries: { type: Number, reflect: true, default: 1 },
|
|
@@ -238,11 +298,16 @@ class ElDmPagination extends import_el_base.BaseElement {
|
|
|
238
298
|
constructor() {
|
|
239
299
|
super();
|
|
240
300
|
this.attachStyles(styles);
|
|
301
|
+
this.shadowRoot.addEventListener("click", this._handleClick.bind(this));
|
|
302
|
+
this.shadowRoot.addEventListener("change", this._handleSizeChange.bind(this));
|
|
303
|
+
this.shadowRoot.addEventListener("keydown", (event) => this._handleKeydown(event));
|
|
304
|
+
this.addEventListener("keydown", (event) => {
|
|
305
|
+
if (event.composedPath()[0] === this)
|
|
306
|
+
this._handleKeydown(event);
|
|
307
|
+
});
|
|
241
308
|
}
|
|
242
309
|
connectedCallback() {
|
|
243
310
|
super.connectedCallback();
|
|
244
|
-
this.addEventListener("click", this._handleClick.bind(this));
|
|
245
|
-
this.addEventListener("keydown", this._handleKeydown.bind(this));
|
|
246
311
|
this._controlsObserver = new MutationObserver(() => this.update());
|
|
247
312
|
this._controlsObserver.observe(this, {
|
|
248
313
|
childList: true,
|
|
@@ -255,9 +320,7 @@ class ElDmPagination extends import_el_base.BaseElement {
|
|
|
255
320
|
this._controlsObserver?.disconnect();
|
|
256
321
|
super.disconnectedCallback();
|
|
257
322
|
}
|
|
258
|
-
_getPageRange() {
|
|
259
|
-
const total = Math.max(1, this.total);
|
|
260
|
-
const current = Math.min(Math.max(1, this.current), total);
|
|
323
|
+
_getPageRange(total, current) {
|
|
261
324
|
const siblings = Math.max(0, this.siblings);
|
|
262
325
|
const boundaries = Math.max(0, this.boundaries);
|
|
263
326
|
const totalPageNumbers = boundaries * 2 + siblings * 2 + 3;
|
|
@@ -297,8 +360,19 @@ class ElDmPagination extends import_el_base.BaseElement {
|
|
|
297
360
|
_hasDeclarativeControls() {
|
|
298
361
|
return this.querySelector('[slot="prev"], [slot="previous"], [slot="page"], [slot="next"]') !== null;
|
|
299
362
|
}
|
|
363
|
+
get _pageSize() {
|
|
364
|
+
return Number.isFinite(this.pageSize) ? Math.max(1, Math.floor(this.pageSize)) : 10;
|
|
365
|
+
}
|
|
366
|
+
get _pageCount() {
|
|
367
|
+
const itemCount = this.totalItems;
|
|
368
|
+
const count = itemCount !== undefined && Number.isFinite(itemCount) ? Math.ceil(itemCount / this._pageSize) : this.total;
|
|
369
|
+
return Number.isFinite(count) ? Math.max(1, Math.floor(count)) : 1;
|
|
370
|
+
}
|
|
371
|
+
_clampPage(page) {
|
|
372
|
+
return Number.isFinite(page) ? Math.min(Math.max(1, Math.floor(page)), this._pageCount) : 1;
|
|
373
|
+
}
|
|
300
374
|
_goToPage(page) {
|
|
301
|
-
const newPage =
|
|
375
|
+
const newPage = this._clampPage(page);
|
|
302
376
|
if (newPage !== this.current) {
|
|
303
377
|
this.current = newPage;
|
|
304
378
|
this.emit("change", { page: newPage });
|
|
@@ -316,26 +390,58 @@ class ElDmPagination extends import_el_base.BaseElement {
|
|
|
316
390
|
if (action === "first") {
|
|
317
391
|
this._goToPage(1);
|
|
318
392
|
} else if (action === "prev") {
|
|
319
|
-
this._goToPage(this.current - 1);
|
|
393
|
+
this._goToPage(this._clampPage(this.current) - 1);
|
|
320
394
|
} else if (action === "next") {
|
|
321
|
-
this._goToPage(this.current + 1);
|
|
395
|
+
this._goToPage(this._clampPage(this.current) + 1);
|
|
322
396
|
} else if (action === "last") {
|
|
323
|
-
this._goToPage(this.
|
|
397
|
+
this._goToPage(this._pageCount);
|
|
324
398
|
} else if (page) {
|
|
325
399
|
this._goToPage(parseInt(page, 10));
|
|
326
400
|
}
|
|
327
401
|
}
|
|
402
|
+
_handleSizeChange(event) {
|
|
403
|
+
const select = event.target;
|
|
404
|
+
if (select?.localName !== "select" || !select.matches('[data-control="page-size"]'))
|
|
405
|
+
return;
|
|
406
|
+
event.stopPropagation();
|
|
407
|
+
const pageSize = Number(select.value);
|
|
408
|
+
if (!Number.isInteger(pageSize) || pageSize < 1 || pageSize === this._pageSize)
|
|
409
|
+
return;
|
|
410
|
+
const current = this.current;
|
|
411
|
+
this.pageSize = pageSize;
|
|
412
|
+
const page = this._clampPage(current);
|
|
413
|
+
this.current = page;
|
|
414
|
+
if (page !== current)
|
|
415
|
+
this.emit("change", { page });
|
|
416
|
+
this.emit("page-size-change", { page, pageSize });
|
|
417
|
+
}
|
|
328
418
|
_handleKeydown(event) {
|
|
329
419
|
if (this._hasDeclarativeControls())
|
|
330
420
|
return;
|
|
421
|
+
const target = event.target;
|
|
422
|
+
if (target?.localName === "select")
|
|
423
|
+
return;
|
|
424
|
+
if (target?.localName === "input") {
|
|
425
|
+
if (event.key === "Enter" && target.matches('[data-control="page-jump"]')) {
|
|
426
|
+
event.preventDefault();
|
|
427
|
+
const page = target.valueAsNumber;
|
|
428
|
+
if (Number.isFinite(page)) {
|
|
429
|
+
target.value = "";
|
|
430
|
+
this._goToPage(page);
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
return;
|
|
434
|
+
}
|
|
435
|
+
const current = this._clampPage(this.current);
|
|
436
|
+
const rtl = this.matches(":dir(rtl)");
|
|
331
437
|
switch (event.key) {
|
|
332
438
|
case "ArrowLeft":
|
|
333
439
|
event.preventDefault();
|
|
334
|
-
this._goToPage(
|
|
440
|
+
this._goToPage(current + (rtl ? 1 : -1));
|
|
335
441
|
break;
|
|
336
442
|
case "ArrowRight":
|
|
337
443
|
event.preventDefault();
|
|
338
|
-
this._goToPage(
|
|
444
|
+
this._goToPage(current + (rtl ? -1 : 1));
|
|
339
445
|
break;
|
|
340
446
|
case "Home":
|
|
341
447
|
event.preventDefault();
|
|
@@ -343,10 +449,28 @@ class ElDmPagination extends import_el_base.BaseElement {
|
|
|
343
449
|
break;
|
|
344
450
|
case "End":
|
|
345
451
|
event.preventDefault();
|
|
346
|
-
this._goToPage(this.
|
|
452
|
+
this._goToPage(this._pageCount);
|
|
347
453
|
break;
|
|
348
454
|
}
|
|
349
455
|
}
|
|
456
|
+
update() {
|
|
457
|
+
const active = this.shadowRoot.activeElement;
|
|
458
|
+
const control = active?.getAttribute("data-control");
|
|
459
|
+
const draft = active?.localName === "input" ? active.value : undefined;
|
|
460
|
+
const scrollLeft = this.query("nav")?.scrollLeft ?? 0;
|
|
461
|
+
super.update();
|
|
462
|
+
const nav = this.query("nav");
|
|
463
|
+
if (nav)
|
|
464
|
+
nav.scrollLeft = scrollLeft;
|
|
465
|
+
if (control === "page-size" || control === "page-jump") {
|
|
466
|
+
const input = this.query(`[data-control="${control}"]`);
|
|
467
|
+
if (input) {
|
|
468
|
+
if (draft !== undefined)
|
|
469
|
+
input.value = draft;
|
|
470
|
+
input.focus({ preventScroll: true });
|
|
471
|
+
}
|
|
472
|
+
}
|
|
473
|
+
}
|
|
350
474
|
render() {
|
|
351
475
|
if (this._hasDeclarativeControls()) {
|
|
352
476
|
return `
|
|
@@ -358,21 +482,22 @@ class ElDmPagination extends import_el_base.BaseElement {
|
|
|
358
482
|
</nav>
|
|
359
483
|
`;
|
|
360
484
|
}
|
|
361
|
-
const total =
|
|
362
|
-
const current =
|
|
363
|
-
const pages = this._getPageRange();
|
|
485
|
+
const total = this._pageCount;
|
|
486
|
+
const current = this._clampPage(this.current);
|
|
487
|
+
const pages = this._getPageRange(total, current);
|
|
364
488
|
const isFirstPage = current === 1;
|
|
365
489
|
const isLastPage = current === total;
|
|
366
490
|
let pagesHtml = "";
|
|
367
491
|
for (const page of pages) {
|
|
368
492
|
if (page === "ellipsis") {
|
|
369
493
|
pagesHtml += `
|
|
370
|
-
<span class="ellipsis" part="ellipsis" aria-hidden="true"
|
|
494
|
+
<span class="ellipsis" part="ellipsis" aria-hidden="true">…</span>
|
|
371
495
|
`;
|
|
372
496
|
} else {
|
|
373
497
|
const isActive = page === current;
|
|
374
498
|
pagesHtml += `
|
|
375
499
|
<button
|
|
500
|
+
type="button"
|
|
376
501
|
class="pagination-btn${isActive ? " active" : ""}"
|
|
377
502
|
part="page"
|
|
378
503
|
data-page="${page}"
|
|
@@ -382,9 +507,12 @@ class ElDmPagination extends import_el_base.BaseElement {
|
|
|
382
507
|
`;
|
|
383
508
|
}
|
|
384
509
|
}
|
|
510
|
+
const pageSize = this._pageSize;
|
|
511
|
+
const sizes = [...new Set([10, 20, 50, 100, pageSize])].sort((a, b) => a - b);
|
|
385
512
|
return `
|
|
386
513
|
<nav class="pagination" part="container" role="navigation" aria-label="Pagination">
|
|
387
514
|
<button
|
|
515
|
+
type="button"
|
|
388
516
|
class="pagination-btn nav-btn"
|
|
389
517
|
part="button"
|
|
390
518
|
data-action="first"
|
|
@@ -392,6 +520,7 @@ class ElDmPagination extends import_el_base.BaseElement {
|
|
|
392
520
|
${isFirstPage ? "disabled" : ""}
|
|
393
521
|
>${ICONS.first}</button>
|
|
394
522
|
<button
|
|
523
|
+
type="button"
|
|
395
524
|
class="pagination-btn nav-btn"
|
|
396
525
|
part="button"
|
|
397
526
|
data-action="prev"
|
|
@@ -400,6 +529,7 @@ class ElDmPagination extends import_el_base.BaseElement {
|
|
|
400
529
|
>${ICONS.prev}</button>
|
|
401
530
|
${pagesHtml}
|
|
402
531
|
<button
|
|
532
|
+
type="button"
|
|
403
533
|
class="pagination-btn nav-btn"
|
|
404
534
|
part="button"
|
|
405
535
|
data-action="next"
|
|
@@ -407,12 +537,26 @@ class ElDmPagination extends import_el_base.BaseElement {
|
|
|
407
537
|
${isLastPage ? "disabled" : ""}
|
|
408
538
|
>${ICONS.next}</button>
|
|
409
539
|
<button
|
|
540
|
+
type="button"
|
|
410
541
|
class="pagination-btn nav-btn"
|
|
411
542
|
part="button"
|
|
412
543
|
data-action="last"
|
|
413
544
|
aria-label="Go to last page"
|
|
414
545
|
${isLastPage ? "disabled" : ""}
|
|
415
546
|
>${ICONS.last}</button>
|
|
547
|
+
${this.showSizeChanger ? `
|
|
548
|
+
<label class="pagination-field">
|
|
549
|
+
${fieldIcon("m12 3 9 5-9 5-9-5 9-5Zm-9 9 9 5 9-5M3 16l9 5 9-5")}
|
|
550
|
+
<select part="page-size" data-control="page-size" aria-label="Page size">
|
|
551
|
+
${sizes.map((size) => `<option${size === pageSize ? " selected" : ""}>${size}</option>`).join("")}
|
|
552
|
+
</select>
|
|
553
|
+
${fieldIcon("m6 9 6 6 6-6", 12)}
|
|
554
|
+
</label>` : ""}
|
|
555
|
+
${this.showQuickJumper ? `
|
|
556
|
+
<label class="pagination-field pagination-jumper">
|
|
557
|
+
${fieldIcon("M4 12h12m-5-5 5 5-5 5m9-12v14")}
|
|
558
|
+
<input part="page-jump" data-control="page-jump" type="number" min="1" max="${total}" aria-label="Jump to page" />
|
|
559
|
+
</label>` : ""}
|
|
416
560
|
</nav>
|
|
417
561
|
`;
|
|
418
562
|
}
|
|
@@ -428,5 +572,5 @@ function register() {
|
|
|
428
572
|
// src/register.ts
|
|
429
573
|
register();
|
|
430
574
|
|
|
431
|
-
//# debugId=
|
|
575
|
+
//# debugId=421D0F7D9FA4AB1464756E2164756E21
|
|
432
576
|
//# sourceMappingURL=register.js.map
|
package/dist/cjs/register.js.map
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/el-dm-pagination.ts", "../../src/index.ts", "../../src/register.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
|
"/**\n * Auto-register el-dm-pagination custom element\n *\n * @example\n * ```ts\n * import '@duskmoon-dev/el-pagination/register';\n *\n * // Now you can use <el-dm-pagination> in HTML\n * ```\n */\nimport { register } from './index.js';\n\nregister();\n"
|
|
8
8
|
],
|
|
9
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
10
|
-
"debugId": "
|
|
9
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiCiC,IAAjC;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;A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