@katlux/toolkit 0.1.1-alpha.129 → 0.1.1-alpha.131
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/bin/add-ai-reference.mjs +85 -46
- package/dist/module.json +1 -1
- package/dist/runtime/components/KButton/KButton.global.d.vue.ts +1 -1
- package/dist/runtime/components/KButton/KButton.global.vue.d.ts +1 -1
- package/dist/runtime/components/KCheckbox/KCheckbox.global.d.vue.ts +1 -1
- package/dist/runtime/components/KCheckbox/KCheckbox.global.vue.d.ts +1 -1
- package/dist/runtime/components/KCombobox/KCombobox.global.d.vue.ts +1 -1
- package/dist/runtime/components/KCombobox/KCombobox.global.vue.d.ts +1 -1
- package/dist/runtime/components/KDatatable/KDataIterator.global.d.vue.ts +1 -1
- package/dist/runtime/components/KDatatable/KDataIterator.global.vue.d.ts +1 -1
- package/dist/runtime/components/KDropdown/KDropdown.global.d.vue.ts +1 -1
- package/dist/runtime/components/KDropdown/KDropdown.global.vue.d.ts +1 -1
- package/dist/runtime/components/KGantt/KGantt.global.d.vue.ts +8 -0
- package/dist/runtime/components/KGantt/KGantt.global.vue +15 -1
- package/dist/runtime/components/KGantt/KGantt.global.vue.d.ts +8 -0
- package/dist/runtime/components/KHourPicker/KHourPicker.global.d.vue.ts +1 -1
- package/dist/runtime/components/KHourPicker/KHourPicker.global.vue.d.ts +1 -1
- package/dist/runtime/components/KRangeSlider/KRangeSlider.global.d.vue.ts +1 -1
- package/dist/runtime/components/KRangeSlider/KRangeSlider.global.vue.d.ts +1 -1
- package/dist/runtime/components/KSlider/KSlider.global.d.vue.ts +1 -1
- package/dist/runtime/components/KSlider/KSlider.global.vue.d.ts +1 -1
- package/dist/runtime/components/KTreePicker/KTreePicker.global.d.vue.ts +1 -1
- package/dist/runtime/components/KTreePicker/KTreePicker.global.vue.d.ts +1 -1
- package/dist/runtime/presets/default/components/KGantt/KGantt.d.vue.ts +20 -0
- package/dist/runtime/presets/default/components/KGantt/KGantt.vue +26 -1
- package/dist/runtime/presets/default/components/KGantt/KGantt.vue.d.ts +20 -0
- package/dist/runtime/presets/default/components/KGantt/KGanttTimeline.d.vue.ts +60 -0
- package/dist/runtime/presets/default/components/KGantt/KGanttTimeline.vue +23 -0
- package/dist/runtime/presets/default/components/KGantt/KGanttTimeline.vue.d.ts +60 -0
- package/dist/skills/KATLUX_INDEX.md +41 -0
- package/dist/skills/katlux-components/SKILL.md +106 -0
- package/dist/skills/katlux-components/components/KAccordion.md +27 -0
- package/dist/skills/katlux-components/components/KAlert.md +22 -0
- package/dist/skills/katlux-components/components/KAreaChart.md +19 -0
- package/dist/skills/katlux-components/components/KBarChart.md +20 -0
- package/dist/skills/katlux-components/components/KBulkActions.md +19 -0
- package/dist/skills/katlux-components/components/KButton.md +12 -0
- package/dist/skills/katlux-components/components/KCalendar.md +17 -0
- package/dist/skills/katlux-components/components/KCheckbox.md +15 -0
- package/dist/skills/katlux-components/components/KCombobox.md +41 -0
- package/dist/skills/katlux-components/components/KCompositeInput.md +67 -0
- package/dist/skills/katlux-components/components/KContextMenu.md +20 -0
- package/dist/skills/katlux-components/components/KDataIterator.md +35 -0
- package/dist/skills/katlux-components/components/KDatatable.md +55 -0
- package/dist/skills/katlux-components/components/KDatePicker.md +26 -0
- package/dist/skills/katlux-components/components/KDropdown.md +18 -0
- package/dist/skills/katlux-components/components/KGantt.md +87 -0
- package/dist/skills/katlux-components/components/KGrid.md +17 -0
- package/dist/skills/katlux-components/components/KHeatMap.md +32 -0
- package/dist/skills/katlux-components/components/KHourSelect.md +11 -0
- package/dist/skills/katlux-components/components/KIcon.md +5 -0
- package/dist/skills/katlux-components/components/KLayout.md +34 -0
- package/dist/skills/katlux-components/components/KLineChart.md +18 -0
- package/dist/skills/katlux-components/components/KLoader.md +7 -0
- package/dist/skills/katlux-components/components/KMaskTextbox.md +12 -0
- package/dist/skills/katlux-components/components/KModal.md +22 -0
- package/dist/skills/katlux-components/components/KPagination.md +22 -0
- package/dist/skills/katlux-components/components/KPanel.md +18 -0
- package/dist/skills/katlux-components/components/KPieChart.md +14 -0
- package/dist/skills/katlux-components/components/KProductList.md +42 -0
- package/dist/skills/katlux-components/components/KScatterChart.md +20 -0
- package/dist/skills/katlux-components/components/KSlider.md +28 -0
- package/dist/skills/katlux-components/components/KTabs.md +31 -0
- package/dist/skills/katlux-components/components/KTextbox.md +15 -0
- package/dist/skills/katlux-components/components/KToast.md +14 -0
- package/dist/skills/katlux-components/components/KTooltip.md +13 -0
- package/dist/skills/katlux-components/components/KTree.md +45 -0
- package/dist/skills/katlux-components/components/KTreePicker.md +35 -0
- package/dist/skills/katlux-components/components/KTreeView.md +30 -0
- package/dist/skills/katlux-components/components/MultiTabs.md +20 -0
- package/dist/skills/katlux-components/components/calendar-customization.md +6 -0
- package/dist/skills/katlux-components/components/datatable-customization.md +14 -0
- package/dist/skills/katlux-components/components/directives.md +11 -0
- package/dist/skills/katlux-components/components/form-validation.md +125 -0
- package/dist/skills/katlux-components/components/tree-customization.md +9 -0
- package/dist/skills/katlux-components/components/useToast.md +27 -0
- package/dist/skills/katlux-components/components/validation-directives.md +6 -0
- package/dist/skills/katlux-config/SKILL.md +156 -0
- package/dist/skills/katlux-presets/SKILL.md +356 -0
- package/dist/skills/katlux-providers/SKILL.md +64 -0
- package/dist/skills/katlux-providers/providers/ADataProvider.md +59 -0
- package/dist/skills/katlux-providers/providers/CAPIFlatClientDataProvider.md +28 -0
- package/dist/skills/katlux-providers/providers/CAPIFlatServerDataProvider.md +20 -0
- package/dist/skills/katlux-providers/providers/CFlatClientDataProvider.md +11 -0
- package/dist/skills/katlux-providers/providers/CFlatServerDataProvider.md +58 -0
- package/dist/skills/katlux-providers/providers/CTreeClientDataProvider.md +14 -0
- package/dist/skills/katlux-providers/providers/CTreeServerDataProvider.md +5 -0
- package/dist/skills/katlux-providers/providers/KatluxIndexedDB.md +10 -0
- package/dist/skills/katlux-providers/providers/RequestProvider.md +49 -0
- package/dist/skills/katlux-providers/providers/RequestQueue.md +52 -0
- package/dist/skills/katlux-providers/providers/api-protocol.md +40 -0
- package/dist/skills/katlux-providers/providers/caching.md +170 -0
- package/dist/skills/katlux-providers/providers/composables.md +107 -0
- package/dist/skills/katlux-providers/providers/encryption.md +151 -0
- package/dist/skills/katlux-providers/providers/react-integration.md +45 -0
- package/dist/skills/katlux-providers/providers/testing-isolation.md +6 -0
- package/dist/skills/katlux-providers/providers/types.md +27 -0
- package/dist/skills/katlux-providers/providers/useDataProvider.md +51 -0
- package/dist/skills/katlux-tokens/SKILL.md +133 -0
- package/package.json +3 -3
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
### `KDataIterator`
|
|
2
|
+
- **Purpose**: Flexible list iterator with support for custom row templates, pagination, and bulk actions.
|
|
3
|
+
- **Props**:
|
|
4
|
+
| Prop | Type | Default | Description |
|
|
5
|
+
| --- | --- | --- | --- |
|
|
6
|
+
| `dataProvider` | `ADataProvider` | **Required** | Reactive data engine |
|
|
7
|
+
| `rowActions` | `IKDatatableAction[]` | `[]` | Per-row action buttons |
|
|
8
|
+
| `bulkActions` | `IKDatatableAction[]` | `[]` | Global actions for selected rows |
|
|
9
|
+
| `visibleFields` | `string[]` | `null` | Array of keys to expose |
|
|
10
|
+
| `loading` | `boolean` | `false` | Manual loading state toggle |
|
|
11
|
+
| `v-model:search` / `search` | `string` | `''` | Search string with two-way binding |
|
|
12
|
+
| `v-model:page` / `v-model:currentPage` / `page` | `number` | `1` | Current page with two-way binding |
|
|
13
|
+
| `v-model:itemsPerPage` / `v-model:pageSize` / `itemsPerPage` | `number` | `10` | Items per page with two-way binding |
|
|
14
|
+
| `v-model:selectedRows` / `selectedRows` | `any[]` | `[]` | Selected rows array with two-way binding |
|
|
15
|
+
| `v-model:selectAll` / `selectAll` | `boolean` | `false` | Select-all boolean state with two-way binding |
|
|
16
|
+
|
|
17
|
+
- **Events / Emits**:
|
|
18
|
+
| Event | Payload | Description |
|
|
19
|
+
| --- | --- | --- |
|
|
20
|
+
| `@update:page` | `(page: number)` | Emitted when page changes |
|
|
21
|
+
| `@update:currentPage` | `(page: number)` | Emitted when page changes |
|
|
22
|
+
| `@update:itemsPerPage`| `(size: number)` | Emitted when page size changes |
|
|
23
|
+
| `@update:pageSize` | `(size: number)` | Emitted when page size changes |
|
|
24
|
+
| `@update:search` | `(search: string)` | Emitted when search changes |
|
|
25
|
+
| `@update:selectedRows`| `(rows: any[])` | Emitted when selection changes |
|
|
26
|
+
| `@update:selectAll` | `(all: boolean)` | Emitted when selectAll toggles |
|
|
27
|
+
|
|
28
|
+
- **Slots**:
|
|
29
|
+
| Slot | Scope | Description |
|
|
30
|
+
| --- | --- | --- |
|
|
31
|
+
| `#row` | `{ row: any, rowActions: any[] }` | Custom template for each data item |
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## 2.4. Trees & Navigation
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
### `KDatatable`
|
|
2
|
+
- **Props**:
|
|
3
|
+
| Prop | Type | Default | Description |
|
|
4
|
+
| --- | --- | --- | --- |
|
|
5
|
+
| `dataProvider` | `ADataProvider` | **Required** | Reactive data engine |
|
|
6
|
+
| `visibleFields` | `string[]` | `null` | Array of keys to show (null = all) |
|
|
7
|
+
| `columnHeaders` | `Record<string, string>` | `{}` | Maps field keys to human-readable labels |
|
|
8
|
+
| `columnWidths` | `Record<string, string>` | `{}` | Maps field keys to CSS widths |
|
|
9
|
+
| `rowActions` | `IKDatatableAction[]` | `[]` | Per-row action buttons |
|
|
10
|
+
| `bulkActions` | `IKDatatableAction[]` | `[]` | Global actions for selected rows. **Automatically enables multi-selection checkboxes** on rows and the header select-all toggle when provided |
|
|
11
|
+
| `cellSlots` | `Record<string, any>` | `undefined` | Custom cell slots map (alternative to template slots) |
|
|
12
|
+
| `headerSlots` | `Record<string, any>` | `undefined` | Custom header slots map (alternative to template slots) |
|
|
13
|
+
| `emptyStateText` | `string` | `'no result'` | Message when dataset is empty |
|
|
14
|
+
| `emptyFilterStateText`| `string` | `'no result found for filter'` | Message when filtered dataset is empty |
|
|
15
|
+
| `v-model:currentPage` / `currentPage` | `number` | `undefined` | Current page number with two-way sync to provider |
|
|
16
|
+
| `v-model:pageSize` / `pageSize` | `number` | `undefined` | Page size number with two-way sync to provider |
|
|
17
|
+
| `v-model:filter` / `filter` | `IDataFilter \| null` | `undefined` | Active filter object with two-way sync |
|
|
18
|
+
| `v-model:sortList` / `sortList` | `IDataSort[]` | `undefined` | Active sort definitions with two-way sync |
|
|
19
|
+
| `v-model:selectedRows` / `selectedRows`| `any[]` | `[]` | Array of currently selected row objects (preserved across page changes) |
|
|
20
|
+
| `v-model:selectAll` / `selectAll` | `boolean` | `false` | Header select-all boolean state |
|
|
21
|
+
| `v-model:unselectedRows` / `unselectedRows` | `any[]` | `[]` | Excluded row objects when `selectAll: true` in dataset scope |
|
|
22
|
+
| `selectAllScope` | `'page' \| 'dataset'` | `'page'` | Scope for header select-all toggle. Automatically defaults/overrides to `'dataset'` when `virtualScroll: true` |
|
|
23
|
+
| `virtualScroll` | `boolean` | `false` | Enables virtual DOM windowing and sticky headers for large datasets |
|
|
24
|
+
| `itemHeight` | `number` | `40` | Row height in pixels for virtual scroll window calculations |
|
|
25
|
+
| `viewportHeight` | `number` | `500` | Viewport container height in pixels for virtual scroll window |
|
|
26
|
+
| `buffer` | `number` | `5` | Buffer rows rendered above and below the viewport |
|
|
27
|
+
|
|
28
|
+
- **Events / Emits**:
|
|
29
|
+
| Event | Payload | Description |
|
|
30
|
+
| --- | --- | --- |
|
|
31
|
+
| `@update:currentPage` | `(page: number)` | Emitted when page changes |
|
|
32
|
+
| `@update:pageSize` | `(size: number)` | Emitted when page size changes |
|
|
33
|
+
| `@update:filter` | `(filter: IDataFilter \| null)` | Emitted when filter changes |
|
|
34
|
+
| `@update:sortList` | `(sortList: IDataSort[])` | Emitted when sorting changes |
|
|
35
|
+
| `@update:selectedRows` | `(rows: any[])` | Emitted when selectedRows changes |
|
|
36
|
+
| `@update:selectAll` | `(all: boolean)` | Emitted when selectAll state changes |
|
|
37
|
+
| `@update:unselectedRows` | `(rows: any[])` | Emitted when unselectedRows changes |
|
|
38
|
+
| `@update:selectAllScope` | `(scope: 'page' \| 'dataset')` | Emitted when selectAllScope changes |
|
|
39
|
+
|
|
40
|
+
> [!NOTE]
|
|
41
|
+
> **Component-Level Selection Architecture (Option B)**:
|
|
42
|
+
> - **Pure Headless DataProvider**: DataProviders are strictly headless data services (fetching, sorting, filtering, caching, pagination) and contain **zero selection state**. This ensures multiple components (e.g. Datatable and Combobox, or multiple Datatables) can safely share the same data provider instance without selection crosstalk.
|
|
43
|
+
> - **Multi-Page Selection Retention**: Navigating across pages via pagination does NOT reset `selectedRows`. Selections across multiple pages are retained until explicitly deselected or cleared.
|
|
44
|
+
> - **Select All Scope (`selectAllScope: 'page' | 'dataset'`)**:
|
|
45
|
+
> - `'page'` (Default): The header checkbox selects only the visible page rows and adds them to `selectedRows`. Navigating to another page keeps previous selections.
|
|
46
|
+
> - `'dataset'`: The header checkbox sets `selectAll = true` as a fast flag without duplicating thousands/millions of records in memory. Deselected rows are recorded in `unselectedRows`, turning the header checkbox into an indeterminate state (`isIndeterminate: true`). Clicking select-all again clears all selections.
|
|
47
|
+
> - **Virtual Scrolling Incompatibility & Override**: Virtual scrolling renders a continuous window without discrete pages. Therefore, when `virtualScroll: true`, `selectAllScope` automatically defaults to `'dataset'`. If `selectAllScope="page"` is explicitly set with `virtualScroll: true`, `KDatatable` logs a console warning and automatically overrides the scope to `'dataset'`.
|
|
48
|
+
>
|
|
49
|
+
> **Mobile Responsiveness**: The datatable container provides native horizontal scrolling with touch scrolling support (`-webkit-overflow-scrolling: touch`) and `white-space: nowrap` on cells to prevent columns from collapsing awkwardly on small screens. Below `768px`, the table footer automatically stacks vertically to keep bulk actions and pagination cleanly separated.
|
|
50
|
+
|
|
51
|
+
- **Slots**:
|
|
52
|
+
| Slot | Scope | Description |
|
|
53
|
+
| --- | --- | --- |
|
|
54
|
+
| `#cell-[field]` | `{ row: any, value: any }` | Custom cell renderer |
|
|
55
|
+
| `#header-[field]`| `{ field: string }` | Custom header renderer |
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
### `KDatePicker` / `KHourPicker` / `KDateTimePicker`
|
|
2
|
+
- **Common Props**:
|
|
3
|
+
| Prop | Type | Default | Description |
|
|
4
|
+
| --- | --- | --- | --- |
|
|
5
|
+
| `label` | `string` | `''` | There will be a label. |
|
|
6
|
+
| `v-model` | `any` | `undefined` | Primary value binding |
|
|
7
|
+
| `v-model:day` | `any` | `undefined` | Alias for `v-model` (Date/Time) |
|
|
8
|
+
| `v-model:isOpen` | `boolean` | `false` | Controls dropdown visibility |
|
|
9
|
+
| `format` | `string` | *Varies* | Display and mask format |
|
|
10
|
+
| `showClear` | `boolean` | `false` | Show clear icon in the textbox |
|
|
11
|
+
| `placeholder` | `string` | `''` | Placeholder text |
|
|
12
|
+
| `disabled` | `boolean` | `false` | Disable interactions |
|
|
13
|
+
| `markedDays`| `IMarkedDay[]` | `[]` | Event dots on calendar |
|
|
14
|
+
| `definedDays`| `IDefinedDay[]`| `[]` | Styling for specific days |
|
|
15
|
+
| `validation` | `'success' \| 'warning' \| 'error' \| null` | `null` | Semantic validation state |
|
|
16
|
+
| `validationText`| `string` | `''` | message to display below input |
|
|
17
|
+
|
|
18
|
+
- **Component Specific Props**:
|
|
19
|
+
| Component | Prop | Type | Default | Description |
|
|
20
|
+
| --- | --- | --- | --- | --- |
|
|
21
|
+
| `KDatePicker` | `v-model:day` | `any` | `undefined` | Alias for `v-model` |
|
|
22
|
+
| `KHourPicker` | `step` | `number` | `30` | Minute selection interval |
|
|
23
|
+
| `KHourPicker` | `startHour` | `string` | `'00:00'` | Earliest selectable time |
|
|
24
|
+
| `KHourPicker` | `endHour` | `string` | `undefined` | Latest selectable time |
|
|
25
|
+
| `KDateTimePicker` | `timeFormat` | `string` | `'HH:mm'` | Internal time list format |
|
|
26
|
+
| `KDateTimePicker` | `timeStep` | `number` | `30` | Minute selection interval |
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
### `KDropdown`
|
|
2
|
+
- **Purpose**: Floating dropdown panel with smart viewport-aware positioning. Teleports its content to the target portal to escape overflow-hidden ancestors.
|
|
3
|
+
- **Props**:
|
|
4
|
+
| Prop | Type | Default | Accepted Values | Description |
|
|
5
|
+
| --- | --- | --- | --- | --- |
|
|
6
|
+
| `v-model:isOpen` | `boolean` | `false` | `true`, `false` | Controls open/closed state |
|
|
7
|
+
| `fullWidth` | `boolean` | `false` | `true`, `false` | Sets min-width to match anchor element width |
|
|
8
|
+
| `anchorEl` | `HTMLElement` | `undefined` | Any element ref | The element the dropdown is positioned relative to |
|
|
9
|
+
| `teleportTo` | `string` | `'body'` | CSS selector | Override teleport target (auto-detects modal portals) |
|
|
10
|
+
| `direction` | `string` | `'auto'` | `'auto'`, `'bottom'`, `'top'`, `'left'`, `'right'` | Preferred opening direction. `'auto'` measures available space and picks the best fit (prefers bottom → top → right → left). Forced values fall back gracefully if space is insufficient. |
|
|
11
|
+
| `align` | `string` | `'left'` | `'left'`, `'right'` (for vertical dirs); `'top'`, `'bottom'` (for horizontal dirs) | Secondary cross-axis alignment. For top/bottom directions: aligns the dropdown's left or right edge with the anchor. For left/right directions: aligns the dropdown's top or bottom edge with the anchor. |
|
|
12
|
+
|
|
13
|
+
- **Direction & Align Combinations**:
|
|
14
|
+
- `direction="bottom"` (default): opens below anchor. `align="left"` (default) left-aligns to anchor; `align="right"` right-aligns to anchor.
|
|
15
|
+
- `direction="top"`: opens above anchor. Same left/right align semantics.
|
|
16
|
+
- `direction="right"`: opens to the right of the anchor. `align="top"` (default for horizontal) top-aligns; `align="bottom"` bottom-aligns.
|
|
17
|
+
- `direction="left"`: opens to the left of the anchor. Same top/bottom align semantics.
|
|
18
|
+
- `direction="auto"`: measures viewport space at open time and picks best direction automatically.
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
### `KGantt`
|
|
2
|
+
- **Props**:
|
|
3
|
+
| Prop | Type | Default | Description |
|
|
4
|
+
| --- | --- | --- | --- |
|
|
5
|
+
| `dataProvider` | `ADataProvider` | **Required** | Resource data source |
|
|
6
|
+
| `columns` | `ITreeViewColumn[]`| **Required** | Left-side resource columns |
|
|
7
|
+
| `treeColumnIndex` | `number` | `0` | Column index displaying the hierarchical tree expander |
|
|
8
|
+
| `startDate` | `Date \| string` | Now - 15d | Timeline start date (date mode) |
|
|
9
|
+
| `endDate` | `Date \| string` | Now + 45d | Timeline end date (date mode) |
|
|
10
|
+
| `startingPoint` | `number` | `undefined` | Timeline starting integer (numeric mode) |
|
|
11
|
+
| `endingPoint` | `number` | `undefined` | Timeline ending integer (numeric mode) |
|
|
12
|
+
| `mode` | `string` | `'date'` | Timeline mode: `'date'` or `'numeric'` |
|
|
13
|
+
| `snapTo` | `string` | `'day'` | Drag snapping unit |
|
|
14
|
+
| `editable` | `boolean` | `true` | Enables interactive dragging and resizing of tasks |
|
|
15
|
+
| `taskMapping` | `any` | `undefined` | Custom mapping definition for task data structure |
|
|
16
|
+
| `resourceTypeField`| `string` | `undefined` | Field identifying resource row classification |
|
|
17
|
+
| `taskTypeField` | `string` | `undefined` | Field identifying individual task classifications |
|
|
18
|
+
| `rowActions` | `IKDatatableAction[]` | `[]` | Per-row action buttons |
|
|
19
|
+
| `bulkActions` | `IKDatatableAction[]` | `[]` | Global actions for selected rows |
|
|
20
|
+
| `loading` | `boolean` | `false` | Manual loading state toggle |
|
|
21
|
+
| `idKey` | `string` | `'id'` | Unique identifier field |
|
|
22
|
+
| `v-model:selectedRows` / `selectedRows` | `any[]` | `[]` | Selected resource rows |
|
|
23
|
+
| `v-model:selectAll` / `selectAll` | `boolean` | `false` | Global select all |
|
|
24
|
+
| `v-model:task` | `any` | `null` | Selected task |
|
|
25
|
+
| `virtualScroll` | `boolean` | `false` | Enables DOM virtualization for large resource datasets |
|
|
26
|
+
| `itemHeight` | `number` | `40` | Fixed height in px for each resource row |
|
|
27
|
+
| `viewportHeight` | `number` | `500` | Height in px of the scrollable viewport |
|
|
28
|
+
| `buffer` | `number` | `5` | Number of off-screen buffer rows rendered above/below |
|
|
29
|
+
|
|
30
|
+
- **Events**:
|
|
31
|
+
| Event | Payload | Description |
|
|
32
|
+
| --- | --- | --- |
|
|
33
|
+
| `@task-click` | `{ task: IGanttTask, row: any }` | Triggered when a timeline task bar is clicked (suppressed during drag/resize) |
|
|
34
|
+
| `@task-dblclick` | `{ task: IGanttTask, row: any }` | Triggered when a timeline task bar is double-clicked |
|
|
35
|
+
| `@task-contextmenu` / `@task-rightclick` | `{ event: MouseEvent, task: IGanttTask, row: any, ctrlKey: boolean, shiftKey: boolean, altKey: boolean, metaKey: boolean, clientX: number, clientY: number }` | Triggered on right-click over a timeline task bar. Includes full `event` and keyboard modifier flags for custom context menus or modifier actions. |
|
|
36
|
+
| `@update:task` | `{ task: IGanttTask, sourceRow: any, targetRow?: any }` | Triggered when a task bar is dragged, resized, or moved across rows and dropped |
|
|
37
|
+
| `@update:selectedRows` | `any[]` | Triggered when row selection checkboxes change |
|
|
38
|
+
| `@update:selectAll` | `boolean` | Triggered when global select all changes |
|
|
39
|
+
|
|
40
|
+
- **Opening a Modal or Custom Context Menu on Task Click / Right-Click (Pug)**:
|
|
41
|
+
```pug
|
|
42
|
+
KGantt(
|
|
43
|
+
:dataProvider="ganttProvider"
|
|
44
|
+
:columns="columns"
|
|
45
|
+
@task-click="handleTaskClick"
|
|
46
|
+
@task-contextmenu="handleTaskRightClick"
|
|
47
|
+
)
|
|
48
|
+
|
|
49
|
+
//- Custom Context Menu or Modal
|
|
50
|
+
KContextMenu(v-model:isOpen="isContextMenuOpen" :x="menuPos.x" :y="menuPos.y")
|
|
51
|
+
div Menu Content
|
|
52
|
+
|
|
53
|
+
KModal(v-model="isModalOpen" :title="activeTask?.title || 'Task Details'")
|
|
54
|
+
p(v-if="activeTask") Task ID: \#{{ activeTask.id }}
|
|
55
|
+
p(v-if="activeTask") Resource: \#{{ activeRow?.name }}
|
|
56
|
+
```
|
|
57
|
+
```typescript
|
|
58
|
+
const isModalOpen = ref(false)
|
|
59
|
+
const isContextMenuOpen = ref(false)
|
|
60
|
+
const menuPos = ref({ x: 0, y: 0 })
|
|
61
|
+
const activeTask = ref(null)
|
|
62
|
+
const activeRow = ref(null)
|
|
63
|
+
|
|
64
|
+
const handleTaskClick = ({ task, row }: { task: any, row: any }) => {
|
|
65
|
+
activeTask.value = task
|
|
66
|
+
activeRow.value = row
|
|
67
|
+
isModalOpen.value = true
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
const handleTaskRightClick = ({ event, task, row, ctrlKey, shiftKey, clientX, clientY }: any) => {
|
|
71
|
+
event.preventDefault() // Suppress browser default context menu
|
|
72
|
+
activeTask.value = task
|
|
73
|
+
activeRow.value = row
|
|
74
|
+
|
|
75
|
+
if (ctrlKey || shiftKey) {
|
|
76
|
+
// Modifier-specific action (e.g. multi-select or quick inspect)
|
|
77
|
+
console.log('Modifier right click', { ctrlKey, shiftKey })
|
|
78
|
+
return
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
// Position and open custom context menu
|
|
82
|
+
menuPos.value = { x: clientX, y: clientY }
|
|
83
|
+
isContextMenuOpen.value = true
|
|
84
|
+
}
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
### `KGrid`
|
|
2
|
+
- **Purpose**: Flexbox-based layout container.
|
|
3
|
+
- **Props**:
|
|
4
|
+
| Prop | Type | Default | Accepted Values | Description |
|
|
5
|
+
| --- | --- | --- | --- | --- |
|
|
6
|
+
| `direction` | `string` | `'row'` | `'row'`, `'column'` | Flex direction |
|
|
7
|
+
| `wrap` | `string` | `'wrap'` | `'wrap'`, `'nowrap'` | Flex wrap |
|
|
8
|
+
| `flexChild` | `boolean` | `false` | `true`, `false` | Apply flex: 1 to child |
|
|
9
|
+
| `align` | `string` | `'start'` | `'start'`, `'center'`, `'end'`, `'stretch'`, `'baseline'` | Align items |
|
|
10
|
+
| `justify` | `string` | `'start'` | `'start'`, `'center'`, `'end'`, `'space-between'`, `'around'`, `'evenly'` | Justify content |
|
|
11
|
+
| `noGap` | `boolean` | `false` | `true`, `false` | Remove default grid gaps |
|
|
12
|
+
| `gap` | `string` | `'1rem'` | Any CSS gap value | Custom gap between items |
|
|
13
|
+
| `columns` | `number \| string` | `undefined` | e.g. `4` or `'repeat(12, 1fr)'` | Grid columns layout |
|
|
14
|
+
- **Slots**:
|
|
15
|
+
| Slot | Scope | Description |
|
|
16
|
+
| --- | --- | --- |
|
|
17
|
+
| `default` | None | Primary content grid items |
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
### `KHeatMap`
|
|
2
|
+
- **Purpose**: Two-dimensional matrix heat grid visualizing values with continuous color gradients.
|
|
3
|
+
- **Props**:
|
|
4
|
+
| Prop | Type | Default | Description |
|
|
5
|
+
| --- | --- | --- | --- |
|
|
6
|
+
| `dataProvider` | `ADataProvider \| any[]` | `undefined` | Data source |
|
|
7
|
+
| `rowField` | `string` | `'row'` | Vertical matrix row key |
|
|
8
|
+
| `columnField` | `string` | `'column'` | Horizontal matrix column key |
|
|
9
|
+
| `valueField` | `string` | `'value'` | Numeric matrix cell value key |
|
|
10
|
+
| `colorLow` | `string` | `undefined` | Minimum intensity gradient color |
|
|
11
|
+
| `colorHigh` | `string` | `undefined` | Maximum intensity gradient color |
|
|
12
|
+
| `colors` | `string[]` | `undefined` | Custom multi-stop gradient array |
|
|
13
|
+
| `backgroundColor` | `string` | `undefined` | Canvas background |
|
|
14
|
+
| `showLegend` | `boolean` | `true` | Gradient legend bar |
|
|
15
|
+
| `xAxisTitle` | `string` | `undefined` | Label on horizontal axis |
|
|
16
|
+
| `yAxisTitle` | `string` | `undefined` | Label on vertical axis |
|
|
17
|
+
|
|
18
|
+
- **Example Chart Usage (Pug)**:
|
|
19
|
+
```pug
|
|
20
|
+
KLineChart(
|
|
21
|
+
:dataProvider="salesProvider"
|
|
22
|
+
xField="date"
|
|
23
|
+
yField="revenue"
|
|
24
|
+
seriesField="channel"
|
|
25
|
+
:animated="true"
|
|
26
|
+
:zoomable="true"
|
|
27
|
+
)
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
## 2.9. Directives Reference
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
### `KHourSelect`
|
|
2
|
+
- **Purpose**: Scrollable time-slot picker (non-dropdown, inline list).
|
|
3
|
+
- **Props**:
|
|
4
|
+
| Prop | Type | Default | Description |
|
|
5
|
+
| --- | --- | --- | --- |
|
|
6
|
+
| `label` | `string` | `''` | There will be a label. |
|
|
7
|
+
| `v-model` | `string` | `''` | Selected time value |
|
|
8
|
+
| `step` | `number` | `30` | Minute interval between time slots |
|
|
9
|
+
| `format` | `string` | `'HH:mm'` | Display format. Tokens: `HH` (24h), `hh` (12h), `mm` (minutes), `A` (AM/PM), `a` (am/pm) |
|
|
10
|
+
| `startHour` | `string` | `'00:00'` | Earliest time slot |
|
|
11
|
+
| `endHour` | `string` | `undefined` | Latest time slot (defaults to one step before midnight) |
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
### `KIcon`
|
|
2
|
+
- **Props**: `iconname` (Required), `width`, `height`, `rotate`.
|
|
3
|
+
- **Available Icons**: `'close'`, `'search'`, `'chevron'`, `'calendar'`, `'folder'`, `'file'`, `'home'`, `'arrow-left'`, `'arrow-right'`, `'arrow-up'`, `'arrow-down'`, `'plus'`, `'minus'`, `'multiply'`, `'divide'`, `'info'`, `'mail'`, `'type'`, `'hash'`, `'user'`, `'check'`, `'settings'`, `'trash'`, `'edit'`, `'menu'`, `'more-vertical'`, `'warning'`, `'eye'`, `'eye-off'`, `'logout'`, `'refresh'`, `'download'`, `'upload'`, `'link'`, `'bell'`, `'phone'`, `'message-square'`, `'star'`, `'heart'`, `'shopping-bag'`, `'share'`, `'lock'`, `'map-pin'`, `'copy'`, `'external-link'`, `'clock'`, `'camera'`, `'image'`.
|
|
4
|
+
- **Styling**: Icons inherit their primary color from `currentColor` (set via CSS `color`). For complex icons with secondary layers (e.g. `calendar`), define the `--icon-secondary` CSS variable (e.g., `--icon-secondary: var(--primary-900);`).
|
|
5
|
+
- **Testing Note**: `KIcon` resolves SVG components at runtime via Vite's `import.meta.glob`. In headless Vitest test environments, `import.meta.glob` is Vite-specific and resolves empty without a running dev server; unit tests (`KIcon.logic.spec.ts`) therefore validate pure sizing, dimension formatting, and default properties. Full SVG rendering is verified in browser E2E tests.
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
### `KLayout`
|
|
2
|
+
- **Purpose**: Unified, slot-driven top-level application layout container. Adapts automatically based on slot presence (`header`, `aside`, `main`, `footer`) and dynamically forwards all slots to preset implementations.
|
|
3
|
+
- **Slots**:
|
|
4
|
+
| Slot | Scope | Description |
|
|
5
|
+
| --- | --- | --- |
|
|
6
|
+
| `header` | None | Top application header, navigation bar, and branding |
|
|
7
|
+
| `aside` | None | Sidebar / navigation tree / contextual drawer. When omitted, aside column collapses automatically and `main` expands to 100% width |
|
|
8
|
+
| `main` | None | Main application content area. If `#main` is not explicitly named, the default slot falls back here |
|
|
9
|
+
| `footer` | None | Application footer, status bar, and legal notices |
|
|
10
|
+
| `[custom]` | Dynamic | Any custom slot (`toolbar`, `statusbar`, `banner`, etc.) dynamically forwarded to preset components |
|
|
11
|
+
- **Presence-Based Adaptation**:
|
|
12
|
+
No `variant` prop is needed. When `#aside` is not passed (e.g. checkout, login, or canvas view), `KLayout` automatically collapses the aside grid column and expands `#main` to full width.
|
|
13
|
+
- **Example Usage (Pug)**:
|
|
14
|
+
```pug
|
|
15
|
+
// Standard App Layout
|
|
16
|
+
KLayout
|
|
17
|
+
template(#header)
|
|
18
|
+
AppHeader
|
|
19
|
+
template(#aside)
|
|
20
|
+
TreeNavigation
|
|
21
|
+
template(#main)
|
|
22
|
+
NuxtPage
|
|
23
|
+
template(#footer)
|
|
24
|
+
AppFooter
|
|
25
|
+
|
|
26
|
+
// Checkout / Full-Width (omitting #aside)
|
|
27
|
+
KLayout
|
|
28
|
+
template(#header)
|
|
29
|
+
CheckoutHeader
|
|
30
|
+
template(#main)
|
|
31
|
+
CheckoutForm
|
|
32
|
+
template(#footer)
|
|
33
|
+
CheckoutFooter
|
|
34
|
+
```
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
### `KLineChart`
|
|
2
|
+
- **Purpose**: Interactive multi-series line chart with optional smooth curves, markers, tooltips, and wheel navigation.
|
|
3
|
+
- **Props**:
|
|
4
|
+
| Prop | Type | Default | Description |
|
|
5
|
+
| --- | --- | --- | --- |
|
|
6
|
+
| `dataProvider` | `ADataProvider \| any[]` | `undefined` | Data provider or raw array of data points |
|
|
7
|
+
| `xField` | `string` | `'x'` | Key for horizontal X-axis values |
|
|
8
|
+
| `yField` | `string` | `'y'` | Key for vertical Y-axis values |
|
|
9
|
+
| `seriesField` | `string` | `undefined` | Key for multi-series grouping |
|
|
10
|
+
| `animated` | `boolean` | `true` | Enables path entrance animations |
|
|
11
|
+
| `zoomable` | `boolean` | `true` | Enables drag-box and interactive zooming |
|
|
12
|
+
| `wheelNavigation` | `boolean` | `true` | Enables scroll-wheel zooming and panning |
|
|
13
|
+
| `maxZoom` | `number` | `10` | Maximum zoom magnification factor |
|
|
14
|
+
| `colors` | `string[]` | `undefined` | Array of theme color hex/CSS codes |
|
|
15
|
+
| `backgroundColor` | `string` | `undefined` | Chart canvas background |
|
|
16
|
+
| `showLegend` | `boolean` | `true` | Displays color-coded legend |
|
|
17
|
+
| `xAxisTitle` | `string` | `undefined` | Label displayed on X axis |
|
|
18
|
+
| `yAxisTitle` | `string` | `undefined` | Label displayed on Y axis |
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
### `KLoader`
|
|
2
|
+
- **Props**:
|
|
3
|
+
| Prop | Type | Default | Accepted Values | Description |
|
|
4
|
+
| --- | --- | --- | --- | --- |
|
|
5
|
+
| `loading` | `boolean` | `false` | `true`, `false` | Toggle visibility |
|
|
6
|
+
| `overlay` | `boolean` | `false` | `true`, `false` | Cover parent container |
|
|
7
|
+
| `size` | `string` | `'medium'` | `'small'`, `'medium'`, `'large'` | Spinner dimensions |
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
### `KMaskTextbox`
|
|
2
|
+
- **Props**:
|
|
3
|
+
| Prop | Type | Default | Description |
|
|
4
|
+
| --- | --- | --- | --- |
|
|
5
|
+
| `label` | `string` | `''` | There will be a label. |
|
|
6
|
+
| `v-model` | `string` | `''` | Note: v-model emits the **RAW** (unmasked) value |
|
|
7
|
+
| `mask` | `string` | **Required** | Pattern (e.g., `'99/99/9999'`) |
|
|
8
|
+
| `placeholder` | `string` | `''` | Ghost text |
|
|
9
|
+
| `showClear` | `boolean` | `false` | Toggle clear icon |
|
|
10
|
+
| `disabled` | `boolean` | `false` | Disable interactions |
|
|
11
|
+
| `readonly` | `boolean` | `false` | Make input read-only |
|
|
12
|
+
- **Mask Tokens**: `9` (Digit), `A` (Alpha Upper), `a` (Alpha Lower), `L` (Alpha), `*` (Alphanumeric).
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
### `KModal`
|
|
2
|
+
- **Purpose**: Centered overlay dialog supporting both two-way `v-model` visibility and programmatic template ref controls.
|
|
3
|
+
- **Props**:
|
|
4
|
+
| Prop | Type | Default | Description |
|
|
5
|
+
| --- | --- | --- | --- |
|
|
6
|
+
| `v-model` / `modelValue` | `boolean` | `false` | Controls dialog visibility with two-way data binding |
|
|
7
|
+
| `closeOnOutsideClick` | `boolean` | `true` | Whether to close when clicking the backdrop |
|
|
8
|
+
- **Events / Emits**:
|
|
9
|
+
| Event | Payload | Description |
|
|
10
|
+
| --- | --- | --- |
|
|
11
|
+
| `@update:modelValue` | `(opened: boolean)` | Emitted when modal visibility toggles |
|
|
12
|
+
- **Methods (Exposed via `ref`)**:
|
|
13
|
+
| Method | Params | Description |
|
|
14
|
+
| --- | --- | --- |
|
|
15
|
+
| `openModal()` | None | Sets `opened` to true |
|
|
16
|
+
| `closeModal()` | None | Sets `opened` to false |
|
|
17
|
+
- **Slots**:
|
|
18
|
+
| Slot | Description |
|
|
19
|
+
| --- | --- |
|
|
20
|
+
| `#header` | Title or custom header content |
|
|
21
|
+
| `#content` | Main body content |
|
|
22
|
+
| `#footer` | Action buttons (Confirm, Cancel, etc.) |
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
### `KPagination`
|
|
2
|
+
- **Purpose**: Pagination controls. Operates either connected directly to an `ADataProvider` or in standalone mode with two-way `v-model` binding.
|
|
3
|
+
- **Props**:
|
|
4
|
+
| Prop | Type | Default | Description |
|
|
5
|
+
| --- | --- | --- | --- |
|
|
6
|
+
| `dataProvider` | `ADataProvider` | `undefined` | Optional data provider. When provided, automatically synchronizes with provider page and page size |
|
|
7
|
+
| `v-model` / `modelValue` | `number` | `1` | Active page number (standalone or override) |
|
|
8
|
+
| `v-model:currentPage` / `currentPage` | `number` | `1` | Explicit named prop for active page number |
|
|
9
|
+
| `v-model:pageSize` / `pageSize` | `number` | `10` | Items per page (standalone or override) |
|
|
10
|
+
| `totalItems` | `number` | `undefined` | Total record count (required for standalone mode without `dataProvider`) |
|
|
11
|
+
| `maxVisiblePages` | `number` | `10` | Maximum numeric page buttons shown |
|
|
12
|
+
|
|
13
|
+
> [!NOTE]
|
|
14
|
+
> **Mobile Pagination**: On viewports `<= 640px`, pagination controls automatically center. On viewports `<= 480px`, distant page numbers and ellipses are hidden, keeping only the active window and navigation arrows to avoid multi-line button wrapping.
|
|
15
|
+
|
|
16
|
+
- **Events / Emits**:
|
|
17
|
+
| Event | Payload | Description |
|
|
18
|
+
| --- | --- | --- |
|
|
19
|
+
| `@update:modelValue` | `(page: number)` | Emitted when page changes (`v-model`) |
|
|
20
|
+
| `@update:currentPage` | `(page: number)` | Emitted when page changes (`v-model:currentPage`) |
|
|
21
|
+
| `@update:pageSize` | `(size: number)` | Emitted when page size changes (`v-model:pageSize`) |
|
|
22
|
+
| `@change` | `(page: number)` | Emitted when page changes |
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
### `KPanel`
|
|
2
|
+
- **Purpose**: Content container with structured regions.
|
|
3
|
+
- **Props**:
|
|
4
|
+
| Prop | Type | Default | Accepted Values | Description |
|
|
5
|
+
| --- | --- | --- | --- | --- |
|
|
6
|
+
| `title` | `string` | `''` | Any string | Header title text |
|
|
7
|
+
| `type` | `string` | `'default'` | `'default'`, `'primary'`, `'danger'`, `'success'`, `'warning'`, `'info'` | Semantic color theme |
|
|
8
|
+
| `noGap` | `boolean` | `true` | `true`, `false` | Remove internal padding |
|
|
9
|
+
| `flexContent` | `boolean` | `false` | `true`, `false` | Make content area flex column |
|
|
10
|
+
| `scrollable` | `boolean` | `false` | `true`, `false` | Enable internal scrolling |
|
|
11
|
+
| `noBorder` | `boolean` | `false` | `true`, `false` | Hide panel border |
|
|
12
|
+
| `height` | `string` | `undefined` | Any CSS height | Fixed panel height |
|
|
13
|
+
- **Slots**:
|
|
14
|
+
| Slot | Description |
|
|
15
|
+
| --- | --- |
|
|
16
|
+
| `header` | Replaces title in header |
|
|
17
|
+
| `default` | Main body content |
|
|
18
|
+
| `footer` | Bottom action/info area |
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
### `KPieChart`
|
|
2
|
+
- **Purpose**: Pie and donut chart with animated arcs, slice highlights, percentages, and legend.
|
|
3
|
+
- **Props**:
|
|
4
|
+
| Prop | Type | Default | Description |
|
|
5
|
+
| --- | --- | --- | --- |
|
|
6
|
+
| `dataProvider` | `ADataProvider \| any[]` | `undefined` | Data source |
|
|
7
|
+
| `labelField` | `string` | `'label'` | Slice category label key |
|
|
8
|
+
| `valueField` | `string` | `'value'` | Numeric slice magnitude key |
|
|
9
|
+
| `donut` | `boolean` | `false` | When true, renders with an inner cutout ring |
|
|
10
|
+
| `animated` | `boolean` | `true` | Arc expansion animation |
|
|
11
|
+
| `colors` | `string[]` | `undefined` | Slice color palette |
|
|
12
|
+
| `backgroundColor` | `string` | `undefined` | Canvas background |
|
|
13
|
+
| `showLegend` | `boolean` | `true` | Displays legend |
|
|
14
|
+
| `title` | `string` | `undefined` | Chart title |
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
### `KProductList`
|
|
2
|
+
- **Purpose**: Paginated, responsive product catalog display supporting grid and list layouts, item actions, skeleton loading, and two-way pagination synchronization.
|
|
3
|
+
- **Props**:
|
|
4
|
+
| Prop | Type | Default | Description |
|
|
5
|
+
| --- | --- | --- | --- |
|
|
6
|
+
| `dataProvider` | `ADataProvider` | **Required** | Reactive data provider delivering product items |
|
|
7
|
+
| `layout` | `'grid' \| 'list'` | `'grid'` | Display mode: grid or list |
|
|
8
|
+
| `gridColumns` | `number \| string` | `4` | Number of columns in grid layout |
|
|
9
|
+
| `gap` | `string` | `'1rem'` | CSS gap between product cards |
|
|
10
|
+
| `locale` | `string` | `undefined` | Locale for currency/text formatting |
|
|
11
|
+
| `emptyText` | `string` | `undefined` | Custom empty state message |
|
|
12
|
+
| `rowActions` | `KProductRowAction[]`| `[]` | Action buttons (e.g. Add to Cart, Quick View) |
|
|
13
|
+
| `v-model:currentPage` / `currentPage` | `number` | `undefined` | Active page with two-way binding |
|
|
14
|
+
| `v-model:pageSize` / `pageSize` | `number` | `undefined` | Page size with two-way binding |
|
|
15
|
+
|
|
16
|
+
- **Events / Emits**:
|
|
17
|
+
| Event | Payload | Description |
|
|
18
|
+
| --- | --- | --- |
|
|
19
|
+
| `@update:currentPage` | `(page: number)` | Emitted when page changes |
|
|
20
|
+
| `@update:pageSize` | `(size: number)` | Emitted when page size changes |
|
|
21
|
+
| `@page-change` | `(page: number)` | Emitted on page transition |
|
|
22
|
+
|
|
23
|
+
- **Slots**:
|
|
24
|
+
| Slot | Scope | Description |
|
|
25
|
+
| --- | --- | --- |
|
|
26
|
+
| `#default` | `{ item: KProductItemData, index: number }` | Custom card template (replaces `KProductListItem`) |
|
|
27
|
+
| `#loading` | `{ loading: boolean }` | Custom loading skeleton state |
|
|
28
|
+
| `#empty` | None | Custom empty results view |
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
## 2.8. Chart Block Components (`@katlux/block-charts`)
|
|
33
|
+
|
|
34
|
+
Pre-built, responsive SVG charting components supporting animation, zoom, pan, tooltips, legends, and direct data provider integration.
|
|
35
|
+
|
|
36
|
+
> [!IMPORTANT]
|
|
37
|
+
> **DataProviders with Charts (Single-Page Architecture & Full Data Access)**:
|
|
38
|
+
> Server-side DataProviders (`CFlatServerDataProvider`, `CAPIFlatServerDataProvider`) intentionally draw **one page at a time** (`pageData`). This deliberate architecture supports future developments such as chart-level pagination, deep interactive zooming in/out, and virtual windowing over massive time-series/scatter datasets.
|
|
39
|
+
> - **Full Dataset Plotting**: To render the entire unpaginated dataset in a chart, developers should:
|
|
40
|
+
> 1. Configure `pageSize: -1` on the DataProvider (e.g. `new CAPIFlatClientDataProvider({ pageSize: -1 })`), OR
|
|
41
|
+
> 2. Use client-side DataProviders (`CFlatClientDataProvider`) loaded with complete rows.
|
|
42
|
+
> - **Paginated / Windowed Plotting**: For paginated or segmented charts, adjust `pageSize` to the desired window size (e.g. `pageSize: 50` or `pageSize: 100`).
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
### `KScatterChart`
|
|
2
|
+
- **Purpose**: Scatter and bubble chart plotting multi-dimensional coordinates with variable bubble sizes.
|
|
3
|
+
- **Props**:
|
|
4
|
+
| Prop | Type | Default | Description |
|
|
5
|
+
| --- | --- | --- | --- |
|
|
6
|
+
| `dataProvider` | `ADataProvider \| any[]` | `undefined` | Data source |
|
|
7
|
+
| `xField` | `string` | `'x'` | Horizontal coordinate key |
|
|
8
|
+
| `yField` | `string` | `'y'` | Vertical coordinate key |
|
|
9
|
+
| `seriesField` | `string` | `undefined` | Series group key |
|
|
10
|
+
| `sizeField` | `string` | `undefined` | Optional bubble diameter scale key |
|
|
11
|
+
| `labelField` | `string` | `undefined` | Point tooltip label key |
|
|
12
|
+
| `animated` | `boolean` | `true` | Point entrance animation |
|
|
13
|
+
| `zoomable` | `boolean` | `true` | Interactive zoom support |
|
|
14
|
+
| `wheelNavigation` | `boolean` | `true` | Wheel zoom/pan support |
|
|
15
|
+
| `maxZoom` | `number` | `10` | Max zoom factor |
|
|
16
|
+
| `colors` | `string[]` | `undefined` | Series color palette |
|
|
17
|
+
| `backgroundColor` | `string` | `undefined` | Canvas background |
|
|
18
|
+
| `showLegend` | `boolean` | `true` | Displays legend |
|
|
19
|
+
| `xAxisTitle` | `string` | `undefined` | Label on X axis |
|
|
20
|
+
| `yAxisTitle` | `string` | `undefined` | Label on Y axis |
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
### `KSlider` / `KRangeSlider`
|
|
2
|
+
- **KSlider Props & Events**:
|
|
3
|
+
| Prop / Event | Type | Default | Description |
|
|
4
|
+
| --- | --- | --- | --- |
|
|
5
|
+
| `label` | `string` | `''` | Slider label |
|
|
6
|
+
| `v-model` / `modelValue` | `number` | `0` | Primary two-way binding value |
|
|
7
|
+
| `v-model:value` / `value` | `number` | `undefined` | Legacy two-way binding value |
|
|
8
|
+
| `min` | `number` | `0` | Minimum possible value |
|
|
9
|
+
| `max` | `number` | `100` | Maximum possible value |
|
|
10
|
+
| `step` | `number` | `1` | Increment step |
|
|
11
|
+
| `disabled` | `boolean` | `false` | Disables slider |
|
|
12
|
+
| `@update:modelValue` | `(val: number)` | - | Emitted when slider value changes |
|
|
13
|
+
| `@update:value` | `(val: number)` | - | Emitted when slider value changes |
|
|
14
|
+
|
|
15
|
+
- **KRangeSlider Props & Events**:
|
|
16
|
+
| Prop / Event | Type | Default | Description |
|
|
17
|
+
| --- | --- | --- | --- |
|
|
18
|
+
| `label` | `string` | `''` | Range slider label |
|
|
19
|
+
| `v-model` / `modelValue` | `[number, number] \| number[]` | `undefined` | Tuple `[min, max]` two-way binding both handles |
|
|
20
|
+
| `v-model:minValue` / `minValue` | `number` | `0` | Lower range handle bound |
|
|
21
|
+
| `v-model:maxValue` / `maxValue` | `number` | `100` | Upper range handle bound |
|
|
22
|
+
| `min` | `number` | `0` | Minimum possible value |
|
|
23
|
+
| `max` | `number` | `100` | Maximum possible value |
|
|
24
|
+
| `step` | `number` | `1` | Increment step |
|
|
25
|
+
| `disabled` | `boolean` | `false` | Disables range slider |
|
|
26
|
+
| `@update:modelValue` | `(val: [number, number])` | - | Emitted when either handle moves |
|
|
27
|
+
| `@update:minValue` | `(val: number)` | - | Emitted when lower handle moves |
|
|
28
|
+
| `@update:maxValue` | `(val: number)` | - | Emitted when upper handle moves |
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
### `KTabs` / `KTabItem`
|
|
2
|
+
- **Purpose**: Tabbed navigation container with built-in two-way binding support.
|
|
3
|
+
- **KTabs Props**:
|
|
4
|
+
| Prop | Type | Default | Description |
|
|
5
|
+
| --- | --- | --- | --- |
|
|
6
|
+
| `v-model` / `modelValue` | `number \| string` | `undefined` | Active tab value, name, title, or 0-based numeric index with two-way binding |
|
|
7
|
+
| `v-model:activeTab` / `activeTab` | `number \| string` | `undefined` | Alternative explicit named property for two-way binding |
|
|
8
|
+
- **KTabs Events**:
|
|
9
|
+
| Event | Payload | Description |
|
|
10
|
+
| --- | --- | --- |
|
|
11
|
+
| `@update:modelValue` | `(val: number \| string)` | Fired when active tab changes (for `v-model`) |
|
|
12
|
+
| `@update:activeTab` | `(val: number \| string)` | Fired when active tab changes (for `v-model:activeTab`) |
|
|
13
|
+
| `@change` | `(val: number \| string)` | Fired whenever active tab is toggled |
|
|
14
|
+
- **KTabItem Props**:
|
|
15
|
+
| Prop | Type | Default | Description |
|
|
16
|
+
| --- | --- | --- | --- |
|
|
17
|
+
| `title` | `string` | **Required** | Tab button label |
|
|
18
|
+
| `isOpen` | `boolean` | `false` | If true, this tab is active by default in uncontrolled mode |
|
|
19
|
+
| `value` | `string \| number` | `undefined` | Custom identifier emitted when selected |
|
|
20
|
+
| `name` | `string` | `undefined` | Optional name identifier for matching |
|
|
21
|
+
- **Slots**: `default` (Content shown when tab is active).
|
|
22
|
+
- **Keyboard Navigation & WAI-ARIA**:
|
|
23
|
+
- Compliant with the **WAI-ARIA Tablist Pattern**. `ArrowRight` / `ArrowLeft` cyclically shift active tab. `Home` / `End` jump to first/last tab.
|
|
24
|
+
- **Example Usage (Pug)**:
|
|
25
|
+
```pug
|
|
26
|
+
KTabs(v-model="activeTab")
|
|
27
|
+
KTabItem(title="Profile" value="profile")
|
|
28
|
+
p Profile content
|
|
29
|
+
KTabItem(title="Settings" value="settings")
|
|
30
|
+
p Settings content
|
|
31
|
+
```
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
### `KTextbox` / `KTextarea`
|
|
2
|
+
- **Props**:
|
|
3
|
+
| Prop | Type | Default | Description |
|
|
4
|
+
| --- | --- | --- | --- |
|
|
5
|
+
| `label` | `string` | `''` | There will be a label. |
|
|
6
|
+
| `v-model` | `string` | `''` | Input binding |
|
|
7
|
+
| `type` | `string` | `'text'` | Input type (`text`, `password`, `email`, etc.) |
|
|
8
|
+
| `placeholder` | `string` | `''` | Ghost text |
|
|
9
|
+
| `showClear` | `boolean` | `false` | (**Textbox only**) Show clear icon |
|
|
10
|
+
| `disabled` | `boolean` | `false` | Disable interactions |
|
|
11
|
+
| `readonly` | `boolean` | `false` | Make input read-only |
|
|
12
|
+
| `maxlength` | `number` | `undefined` | Character count limit |
|
|
13
|
+
| `rows` | `number` | `4` | (**Textarea only**) Initial height |
|
|
14
|
+
| `validation` | `'success' \| 'warning' \| 'error' \| null` | `null` | Semantic validation state |
|
|
15
|
+
| `validationText`| `string` | `''` | message to display below input |
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
### `KToast`
|
|
2
|
+
- **Purpose**: Temporary notification or informative message that can auto-hide.
|
|
3
|
+
- **Props**:
|
|
4
|
+
| Prop | Type | Default | Description |
|
|
5
|
+
| --- | --- | --- | --- |
|
|
6
|
+
| `v-model` | `boolean` | `false` | Controls visibility |
|
|
7
|
+
| `text` | `string` | `''` | Message content |
|
|
8
|
+
| `title` | `string` | `''` | Optional header/title |
|
|
9
|
+
| `timeout` | `number` | `3000` | Auto-hide delay (ms). 0 to disable. |
|
|
10
|
+
| `teleport` | `boolean` | `false` | Teleport to body (fixed top-right) |
|
|
11
|
+
| `type` | `string` | `'info'` | `'primary'`, `'success'`, `'warning'`, `'danger'`, `'info'`, `'error'`, `'default'` |
|
|
12
|
+
| `pauseOnHover` | `boolean` | `true` | Pauses the auto-dismiss timer while hovered |
|
|
13
|
+
- **Slots**: `default` (overrides `text` prop).
|
|
14
|
+
- **Events**: `@close`, `@update:modelValue`.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
### `KTooltip`
|
|
2
|
+
- **Purpose**: Hover-activated informational overlay.
|
|
3
|
+
- **Props**:
|
|
4
|
+
| Prop | Type | Default | Accepted Values | Description |
|
|
5
|
+
| --- | --- | --- | --- | --- |
|
|
6
|
+
| `text` | `string` | `''` | Any string | Plain text contents of the tooltip |
|
|
7
|
+
| `position` | `string` | `'top'` | `'top'`, `'bottom'`, `'left'`, `'right'` | Tooltip placement relative to the trigger element |
|
|
8
|
+
| `disabled` | `boolean` | `false` | `true`, `false` | Disable tooltip trigger |
|
|
9
|
+
- **Slots**: `default` (Trigger element), `content` (Optional custom tooltip text/markup).
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## 2.2. Form & Input Components
|