kempo-ui 0.4.19 → 0.4.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -0
- package/package.json +1 -1
- package/tasks/released/0006-create-pagination-component.md +1 -1
- package/tasks/0006-create-pagination-component/screenshot-01-top.png +0 -0
- package/tasks/0006-create-pagination-component/screenshot-02-controls.png +0 -0
- package/tasks/0006-create-pagination-component/screenshot-03-preconfigured.png +0 -0
- package/tasks/0006-create-pagination-component/screenshot-04-live-demo-page1.png +0 -0
- package/tasks/0006-create-pagination-component/screenshot-05-live-demo-page2.png +0 -0
- package/tasks/0006-create-pagination-component/screenshot-06-live-demo-last-page.png +0 -0
- package/tasks/0006-create-pagination-component/screenshot-07-js-reference.png +0 -0
- package/tasks/0006-create-pagination-component.md +0 -136
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
|
6
6
|
|
|
7
7
|
## [Unreleased]
|
|
8
8
|
|
|
9
|
+
|
|
10
|
+
## [0.4.19] - 2026-05-06
|
|
9
11
|
### Added
|
|
10
12
|
- **Pagination component** (`<k-pagination>`): Full-featured pagination with composable control sub-components
|
|
11
13
|
- `page` attribute reflects and controls the current page number (defaults to 1)
|
package/package.json
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,136 +0,0 @@
|
|
|
1
|
-
# 0006 - Create Pagination Component
|
|
2
|
-
|
|
3
|
-
## Status: Complete
|
|
4
|
-
|
|
5
|
-
## Dependency
|
|
6
|
-
None
|
|
7
|
-
|
|
8
|
-
## References
|
|
9
|
-
[styles](file:///c:\Users\dusti\.copilot\skills\styles\SKILL.md) - global skill for properly styling the component
|
|
10
|
-
[component-code](file:///c:\Users\dusti\.copilot\skills\component-code\SKILL.md) - global skill for coding kempo-ui components
|
|
11
|
-
[MarkdownEditor](../src/components/MarkdownEditor.js) - similar component pattern with control variants and preconfigured controls showing how to structure controls, make them interact with the primary component, and implement preconfigured control combinations
|
|
12
|
-
|
|
13
|
-
## Current State
|
|
14
|
-
|
|
15
|
-
No pagination component exists yet. Pagination functionality is not available to users.
|
|
16
|
-
|
|
17
|
-
## Aceptance Criteria
|
|
18
|
-
|
|
19
|
-
A new Pagination component should be created that:
|
|
20
|
-
- Acts as a UI interface component placed under content
|
|
21
|
-
- Does not manage the actual content being paginated
|
|
22
|
-
- Accepts attributes for total number of items, items per page, and current page number
|
|
23
|
-
- Calculates total number of pages from total items and items per page
|
|
24
|
-
- Displays and tracks the current page number
|
|
25
|
-
- Exposes public methods: `nextPage()`, `previousPage()`
|
|
26
|
-
- Allows direct page assignment via the `page` property with automatic clamping
|
|
27
|
-
- Emits `page-change` event when the user navigates to a different page
|
|
28
|
-
- Emits `items-per-page-change` event when the items-per-page configuration changes
|
|
29
|
-
- Has separate control components for common pagination controls (like HtmlEditor pattern)
|
|
30
|
-
- Includes preconfigured control variants for common use cases
|
|
31
|
-
|
|
32
|
-
### In-Scope
|
|
33
|
-
- `src/components/pagination.js` - main component
|
|
34
|
-
- `src/components/pagination-controls-*.js` - control component variants
|
|
35
|
-
- `docs-src/components/pagination.page.html` - documentation page
|
|
36
|
-
- `tests/components/pagination.test.js` - component tests
|
|
37
|
-
|
|
38
|
-
### Out of Scope
|
|
39
|
-
- Modifications to existing components
|
|
40
|
-
- Backend pagination logic or data fetching
|
|
41
|
-
- Content management or rendering within the pagination component itself
|
|
42
|
-
|
|
43
|
-
## Task Details
|
|
44
|
-
|
|
45
|
-
1. Set up the Pagination component using the component-setup skill
|
|
46
|
-
2. Implement the base Pagination component with:
|
|
47
|
-
- Attributes: `totalItems` (total number of items), `itemsPerPage` (items per page), and `page` (current page)
|
|
48
|
-
- Getter properties: `totalPages` (calculated from totalItems and itemsPerPage)
|
|
49
|
-
- `page` property with automatic clamping to [1, totalPages] range
|
|
50
|
-
- Internal tracking of current page (default to page 1)
|
|
51
|
-
- Display of page information (e.g., "Page 3 of 10")
|
|
52
|
-
- Public methods: `nextPage()`, `previousPage()` (automatically clamped)
|
|
53
|
-
- `page-change` event emission when user navigates (not fired on auto-resets)
|
|
54
|
-
- `items-per-page-change` event emission when items-per-page changes
|
|
55
|
-
- Event detail includes full pagination state
|
|
56
|
-
3. Create pagination control component variants following the HtmlEditor control pattern
|
|
57
|
-
4. Create preconfigured pagination control combinations
|
|
58
|
-
5. Write component tests covering all functionality
|
|
59
|
-
6. Create documentation page with examples
|
|
60
|
-
7. Update `llms.txt` with new component
|
|
61
|
-
|
|
62
|
-
## Testing / Validation Plan
|
|
63
|
-
|
|
64
|
-
- Verify component renders correctly with various page counts and items per page values
|
|
65
|
-
- Test direct page assignment (`el.page = n`) sets the correct page with automatic clamping
|
|
66
|
-
- Test `nextPage()` increments page and disables when at last page
|
|
67
|
-
- Test `previousPage()` decrements page and disables when at first page
|
|
68
|
-
- Verify `page-change` event fires only when user navigates (not on auto-resets)
|
|
69
|
-
- Verify `items-per-page-change` event fires when itemsPerPage changes
|
|
70
|
-
- Verify event details include full pagination state
|
|
71
|
-
- Verify control components render and function correctly
|
|
72
|
-
- Verify preconfigured controls work as expected
|
|
73
|
-
- Test with browser DevTools to confirm no console errors
|
|
74
|
-
|
|
75
|
-
### Testing / Validation Results
|
|
76
|
-
|
|
77
|
-
#### LLM Validation Results
|
|
78
|
-
|
|
79
|
-
##### Component renders correctly with various page counts and items per page
|
|
80
|
-
|
|
81
|
-
**PASS.** The documentation page shows `<k-pagination>` working at 100 total items / 10 per page (10 pages) and 47 total items / 10 per page (5 pages). The `totalPages` getter returns the correct ceiling division in both cases. The page info text ("Page 1 of 10", "Page 1 of 5") reflects the correct state.
|
|
82
|
-
|
|
83
|
-

|
|
84
|
-

|
|
85
|
-
|
|
86
|
-
##### setPage() sets the correct page and emits event
|
|
87
|
-
|
|
88
|
-
**PASS.** The `page` property can be set directly (e.g. `el.page = 3`) and automatically clamps out-of-range values to [1, totalPages]. The `page-change` event fires only when the page actually changes (not during auto-resets). The event detail includes `{ currentPage, totalPages, itemsPerPage, totalItems }`.
|
|
89
|
-
|
|
90
|
-
##### nextPage() increments page and disables when at last page
|
|
91
|
-
|
|
92
|
-
**PASS.** In the live demo, clicking Next advanced cards from Items 1–10 (page 1) to Items 11–20 (page 2). On the last page (page 5, Items 41–47), the Next and Last buttons are correctly disabled.
|
|
93
|
-
|
|
94
|
-

|
|
95
|
-

|
|
96
|
-

|
|
97
|
-
|
|
98
|
-
##### previousPage() decrements page and disables when at first page
|
|
99
|
-
|
|
100
|
-
**PASS.** On page 1, the Previous and First buttons are disabled (confirmed in screenshots). Unit tests verify previousPage() decrements correctly and is a no-op at page 1.
|
|
101
|
-
|
|
102
|
-
##### Events are properly emitted on all page changes
|
|
103
|
-
|
|
104
|
-
**PASS.** The `page-change` event fires when the user navigates (via direct page assignment, `nextPage()`, or `previousPage()`), but NOT when the page auto-resets due to configuration changes. The `items-per-page-change` event fires when `itemsPerPage` changes. The live demo re-renders cards on every `page-change` event. Unit tests (all 2157 pass) verify both events fire correctly and do NOT fire inappropriately.
|
|
105
|
-
|
|
106
|
-
##### Control components render and function correctly
|
|
107
|
-
|
|
108
|
-
**PASS.** All six original controls (`k-pg-first`, `k-pg-prev`, `k-pg-page-info`, `k-pg-next`, `k-pg-last`, `k-pg-items-per-page`) plus two new controls (`k-pg-goto-page`, `k-pg-count`) render and respond to pagination state. Icons use `chevron` and `chevron-line` with the `direction` attribute for correct orientation.
|
|
109
|
-
|
|
110
|
-

|
|
111
|
-
|
|
112
|
-
##### Preconfigured controls work as expected
|
|
113
|
-
|
|
114
|
-
**PASS.** `controls="simple"` renders prev/page-info/next. `controls="full"` renders first/prev/page-info/next/last/items-per-page. All control modules are dynamically imported automatically when the `controls` attribute is set.
|
|
115
|
-
|
|
116
|
-
##### No console errors
|
|
117
|
-
|
|
118
|
-
**PASS.** The only 404s logged are for icon files at the relative `./icons/` path (e.g. `/components/icons/chevron.svg`) — this is the expected first-attempt behavior of the Icon component's fallback lookup system, which then succeeds at `/icons/chevron.svg`. The same pattern appears on every page of the docs. No JavaScript errors or unexpected failures.
|
|
119
|
-
|
|
120
|
-
##### Unit tests
|
|
121
|
-
|
|
122
|
-
**PASS.** All 2157 tests pass (includes 25+ Pagination-specific tests covering page navigation, clamping, direct assignment, event separation, and control rendering).
|
|
123
|
-
|
|
124
|
-
```
|
|
125
|
-
=== Test Summary ====
|
|
126
|
-
Total Tests: 2157
|
|
127
|
-
Passed: 2157
|
|
128
|
-
Failed: 0
|
|
129
|
-
|
|
130
|
-
All tests passed!
|
|
131
|
-
```
|
|
132
|
-
|
|
133
|
-

|
|
134
|
-
|
|
135
|
-
#### User Validation Results
|
|
136
|
-
I (Dustin Poissant) have validated this is all working as expected (see notes above).
|