@katlux/toolkit 0.1.1-alpha.129 → 0.1.1-alpha.130
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 +2 -2
- package/dist/runtime/components/KButton/KButton.global.vue.d.ts +2 -2
- package/dist/runtime/components/KButton/KButton.logic.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/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/skills/KATLUX_INDEX.md +40 -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 +28 -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 +2 -2
|
@@ -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
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
### `KTree`
|
|
2
|
+
- **Purpose**: Hierarchical data display with toggle, live search, full WAI-ARIA Tree View compliance, and high-performance virtual scrolling.
|
|
3
|
+
- **Props**:
|
|
4
|
+
| Prop | Type | Default | Description |
|
|
5
|
+
| --- | --- | --- | --- |
|
|
6
|
+
| `dataProvider` | `ADataProvider` | **Required** | Must be a tree-capable provider (e.g. `CTreeClientDataProvider`) |
|
|
7
|
+
| `labelField` | `string` | `'name'` | Field to display as label |
|
|
8
|
+
| `iconField` | `string` | `'icon'` | Field for node icon name |
|
|
9
|
+
| `disabled` | `boolean` | `false` | Disable interactions |
|
|
10
|
+
| `multiSelect` | `boolean` | `false` | Enable node checkboxes |
|
|
11
|
+
| `isNodeSelected`| `Function` | `() => false` | Custom selection logic handler |
|
|
12
|
+
| `selectable` | `boolean` | `false` | Enable node clicking for selection |
|
|
13
|
+
| `v-model` / `v-model:selectedNode` / `selectedNode` | `any` | `null` | Selected node with two-way binding |
|
|
14
|
+
| `v-model:expandedNodes` / `expandedNodes` | `Set<string \| number> \| (string \| number)[]` | `undefined` | Expanded node IDs with two-way binding |
|
|
15
|
+
| `v-model:searchtext` / `searchtext` | `string` | `''` | Live filtering search text with two-way binding |
|
|
16
|
+
| `virtualScroll` | `boolean` | `false` | Enable virtual windowing for massive hierarchies (5,000+ nodes) |
|
|
17
|
+
| `itemHeight` | `number` | `32` | Height of each tree node in pixels when virtualized |
|
|
18
|
+
| `viewportHeight` | `number` | `400` | Viewport container height in pixels when virtualized |
|
|
19
|
+
| `buffer` | `number` | `5` | Buffer rows rendered above and below virtual viewport |
|
|
20
|
+
- **Events / Emits**:
|
|
21
|
+
| Event | Payload | Description |
|
|
22
|
+
| --- | --- | --- |
|
|
23
|
+
| `@update:modelValue` | `node: any` | Emitted when selected node changes (`v-model`) |
|
|
24
|
+
| `@update:selectedNode` | `node: any` | Emitted when selected node changes (`v-model:selectedNode`) |
|
|
25
|
+
| `@select` | `node: any` | Emitted when a node is selected / clicked |
|
|
26
|
+
| `@node-click` | `node: any` | Emitted when a node is clicked |
|
|
27
|
+
| `@node-toggle` | `nodeId: string \| number` | Emitted when a node's chevron is toggled |
|
|
28
|
+
| `@update:expandedNodes`| `nodes: Set<string \| number> \| (string \| number)[]` | Emitted when expansion state changes (`v-model:expandedNodes`) |
|
|
29
|
+
| `@update:searchtext` | `text: string` | Emitted when search text changes (`v-model:searchtext`) |
|
|
30
|
+
- **Slots**:
|
|
31
|
+
| Slot | Scope | Description |
|
|
32
|
+
| --- | --- | --- |
|
|
33
|
+
| `#node` | `{ node: ITreeNode, data: any }` | Top-priority slot for custom node content |
|
|
34
|
+
| `#item` | `{ node: ITreeNode, data: any }` | Custom content for node (falls back to `#node`) |
|
|
35
|
+
| `#default` | `{ node: ITreeNode, data: any }` | Fallback for `#item` slot |
|
|
36
|
+
- **WAI-ARIA Tree View Keyboard Accessibility**:
|
|
37
|
+
- `ArrowRight`: On a closed parent, expands the node without moving focus. On an open parent, moves focus to the first child. On a leaf node, does nothing.
|
|
38
|
+
- `ArrowLeft`: On an open parent, collapses the node without moving focus. On a child node or closed node, moves focus to its parent node.
|
|
39
|
+
- `ArrowDown`: Moves focus to the next visible node.
|
|
40
|
+
- `ArrowUp`: Moves focus to the previous visible node.
|
|
41
|
+
- `Home`: Moves focus to the first visible node in the tree.
|
|
42
|
+
- `End`: Moves focus to the last visible node in the tree (automatically scrolls virtual viewport).
|
|
43
|
+
- `Enter` / `Space`: Selects or toggles the focused node.
|
|
44
|
+
- **Roving Tabindex**: Exactly one `treeitem` has `tabindex="0"`; all other treeitems have `tabindex="-1"`. Inner virtual scroll container has no double tab stops.
|
|
45
|
+
- **ARIA Hierarchy**: In standard mode, children are enclosed in `.tree-node-group[role="group"]`. In virtual mode, flat treeitems are decorated with `aria-level`, `aria-setsize`, and `aria-posinset`.
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
### `KTreePicker`
|
|
2
|
+
- **Purpose**: Dropdown component containing a searchable `KTree`.
|
|
3
|
+
- **Props**:
|
|
4
|
+
| Prop | Type | Default | Description |
|
|
5
|
+
| --- | --- | --- | --- |
|
|
6
|
+
| `label` | `string` | `''` | There will be a label. |
|
|
7
|
+
| `v-model` | `any` | `null` | Selected node(s) |
|
|
8
|
+
| `v-model:isOptionsOpen` | `boolean` | `false` | Controls the visibility of the dropdown |
|
|
9
|
+
| `v-model:searchtext` / `searchtext` | `string` | `''` | Live search text with two-way binding |
|
|
10
|
+
| `v-model:expandedNodes` / `expandedNodes` | `(string \| number)[]` | `[]` | Expanded node IDs with two-way binding |
|
|
11
|
+
| `dataProvider` | `ADataProvider` | **Required** | Tree data provider |
|
|
12
|
+
| `labelField` | `string` | **Required** | Field to display as label |
|
|
13
|
+
| `valueField` | `string` | `null` | Optional. Field to bind v-model with (primitive). Falls back to `idKey`. |
|
|
14
|
+
| `placeholder` | `string` | `'Select...'` | Input placeholder text |
|
|
15
|
+
| `disabled` | `boolean` | `false` | Disable interactions |
|
|
16
|
+
| `idKey` | `string` | `'id'` | Unique ID field |
|
|
17
|
+
| `parentKey` | `string` | `'parentId'` | Parent reference field |
|
|
18
|
+
| `iconField` | `string` | `undefined` | Field for node icon name |
|
|
19
|
+
| `multiSelect` | `boolean` | `false` | Enable node checkboxes |
|
|
20
|
+
| `searchbox` | `boolean` | `false` | Enable live search |
|
|
21
|
+
| `searchPlaceholder` | `string` | `'Search...'` | Placeholder for the search input |
|
|
22
|
+
| `closeOnSelect` | `boolean` | `true` | Auto-close dropdown |
|
|
23
|
+
| `fullWidth` | `boolean` | `true` | Whether the dropdown should match at least the anchor width |
|
|
24
|
+
| `loading` | `boolean` | `false` | Manual loading state toggle |
|
|
25
|
+
| `validation` | `'success' \| 'warning' \| 'error' \| null` | `null` | Semantic validation state |
|
|
26
|
+
| `validationText`| `string` | `''` | message to display below the picker |
|
|
27
|
+
- **Events / Emits**:
|
|
28
|
+
| Event | Payload | Description |
|
|
29
|
+
| --- | --- | --- |
|
|
30
|
+
| `@update:modelValue` | `value: any` | Emitted when selected node changes |
|
|
31
|
+
| `@update:isOptionsOpen` | `open: boolean` | Emitted when dropdown opens/closes |
|
|
32
|
+
| `@update:searchtext` | `text: string` | Emitted when search changes (`v-model:searchtext`) |
|
|
33
|
+
| `@update:expandedNodes` | `nodes: (string \| number)[]` | Emitted when expansion changes (`v-model:expandedNodes`) |
|
|
34
|
+
| `@change` | `node: any` | Emitted on selection change |
|
|
35
|
+
- **Slots**: Forwards all slots to its internal `KTree` (e.g., `#item`, `#default`).
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
### `KTreeView`
|
|
2
|
+
- **Props**:
|
|
3
|
+
| Prop | Type | Default | Description |
|
|
4
|
+
| --- | --- | --- | --- |
|
|
5
|
+
| `dataProvider` | `ADataProvider` | **Required** | Must be a Tree provider |
|
|
6
|
+
| `columns` | `ITreeViewColumn[]`| **Required** | Column definitions |
|
|
7
|
+
| `treeColumnIndex` | `number` | `0` | Which column gets the expander |
|
|
8
|
+
| `idKey` | `string` | `'id'` | Unique ID field |
|
|
9
|
+
| `parentKey` | `string` | `'parentId'` | Parent reference field |
|
|
10
|
+
| `expandedByDefault`| `boolean` | `false` | Whether branch nodes are expanded by default |
|
|
11
|
+
| `v-model:expandedNodes` / `expandedNodes` | `(string \| number)[]` | `[]` | Array of expanded node IDs with two-way binding |
|
|
12
|
+
| `rowActions` | `IKDatatableAction[]` | `[]` | Per-row action menu |
|
|
13
|
+
| `bulkActions` | `IKDatatableAction[]` | `[]` | Global actions for selected rows |
|
|
14
|
+
| `selectedRows` | `any[]` | `[]` | Currently selected rows (supports `v-model:selectedRows`) |
|
|
15
|
+
| `selectAll` | `boolean` | `false` | Header select-all state (supports `v-model:selectAll`) |
|
|
16
|
+
| `loading` | `boolean` | `false` | Manual loading state toggle |
|
|
17
|
+
| `multiSelect` | `boolean` | `false` | Enable node checkboxes |
|
|
18
|
+
| `selectable` | `boolean` | `false` | Enable node clicking for selection |
|
|
19
|
+
| `searchtext` | `string` | `''` | Live filtering text |
|
|
20
|
+
- **Events / Emits**:
|
|
21
|
+
| Event | Payload | Description |
|
|
22
|
+
| --- | --- | --- |
|
|
23
|
+
| `@update:expandedNodes` | `value: (string \| number)[]` | Emitted when node expansion changes (`v-model:expandedNodes`) |
|
|
24
|
+
| `@update:selectedRows` | `value: any[]` | Emitted when row selection changes (`v-model:selectedRows`) |
|
|
25
|
+
| `@update:selectAll` | `value: boolean` | Emitted when select-all state toggles (`v-model:selectAll`) |
|
|
26
|
+
- **Slots**:
|
|
27
|
+
| Slot | Scope | Description |
|
|
28
|
+
| --- | --- | --- |
|
|
29
|
+
| `#cell-[field]` | `{ row: any, field: string, value: any }` | Custom cell renderer for a column |
|
|
30
|
+
| `#header-[field]` | `{ field: string }` | Custom header renderer for a column |
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
### `MultiTabs`
|
|
2
|
+
- **Purpose**: Manage complex layouts involving multiple tabs and vertical split screens dynamically.
|
|
3
|
+
- **Props**:
|
|
4
|
+
| Prop | Type | Default | Description |
|
|
5
|
+
| --- | --- | --- | --- |
|
|
6
|
+
| `v-model` | `MultiTabsGroup[]` | **Required** | The active groupings of tabs. Each group represents a vertical split pane. |
|
|
7
|
+
- **Methods (Exposed via `ref`)**:
|
|
8
|
+
| Method | Params | Description |
|
|
9
|
+
| --- | --- | --- |
|
|
10
|
+
| `addTab(tab, groupId?)` | `(tab: MultiTabsTab, groupId?: string)` | Opens a new tab within the specified group (or defaults to the first group). |
|
|
11
|
+
| `splitScreen(initialTab?)` | `(initialTab?: MultiTabsTab)` | Creates a new vertical pane to the right, optionally initializing it with a tab. |
|
|
12
|
+
| `closeSplit(groupId)` | `(groupId: string)` | Closes the specified split screen pane. |
|
|
13
|
+
- **Slots**:
|
|
14
|
+
| Slot | Scope | Description |
|
|
15
|
+
| --- | --- | --- |
|
|
16
|
+
| `#tab-[id]` | `{ tab: MultiTabsTab }` | Render custom content for a specific tab by its ID. |
|
|
17
|
+
| `#empty` | None | Fallback content shown in a pane when it contains no tabs. |
|
|
18
|
+
- **Associated Types**:
|
|
19
|
+
- **`MultiTabsGroup`**: `{ id: string, tabs: MultiTabsTab[] }`
|
|
20
|
+
- **`MultiTabsTab`**: `{ id: string, title: string, isOpen: boolean }`
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
### 2.2.1 Unified Calendar Customization Props (`markedDays` & `definedDays`)
|
|
2
|
+
All calendar-based components (`KCalendar`, `KDatePicker`, and `KDateTimePicker`) share a unified prop interface:
|
|
3
|
+
- **`markedDays`**: `IMarkedDay[]` *(default: `[]`)* — Highlighting specific dates with dots/badges.
|
|
4
|
+
- **`definedDays`**: `IDefinedDay[]` *(default: `[]`)* — Applying custom styles (e.g., coloring weekends) or disabling specific dates.
|
|
5
|
+
|
|
6
|
+
*(Note: `KHourPicker` is a time-only selector and does not accept calendar day props).*
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
### `KDatatable` Cell Customization
|
|
2
|
+
```pug
|
|
3
|
+
KDatatable(:dataProvider="myProvider" :visibleFields="['id', 'status']")
|
|
4
|
+
template(#cell-id="{ value }")
|
|
5
|
+
span(style="color: red") # {{ value }}
|
|
6
|
+
|
|
7
|
+
template(#cell-status="{ row, value }")
|
|
8
|
+
KIcon(:iconname="value === 'success' ? 'check' : 'close'")
|
|
9
|
+
span {{ value }}
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## 2.7. eCommerce Block Components (`@katlux/block-ecommerce`)
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
### `v-click-outside`
|
|
2
|
+
- **Purpose**: Detects click events outside the host element. Supports standalone function callbacks as well as options objects with `extraInside` exceptions (selectors, elements, or predicate functions).
|
|
3
|
+
- **Usage (Pug)**:
|
|
4
|
+
```pug
|
|
5
|
+
// Simple callback
|
|
6
|
+
div(v-click-outside="closeDropdown")
|
|
7
|
+
p Dropdown Content
|
|
8
|
+
|
|
9
|
+
// With extra inside exclusion (e.g., trigger button)
|
|
10
|
+
div(v-click-outside="{ handler: closeDropdown, extraInside: '#open-btn' }")
|
|
11
|
+
```
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
### 2.2.2 Form & Input Validation Architecture
|
|
2
|
+
Katlux provides a standardized, reactive validation system built directly into all form components (`KTextbox`, `KMaskTextbox`, `KTextarea`, `KCombobox`, `KRadiobox`, `KCheckbox`, `KDatePicker`, `KDateTimePicker`, `KTreePicker`, `KCompositeInput`).
|
|
3
|
+
|
|
4
|
+
#### Universal Validation Props
|
|
5
|
+
Every input component accepts:
|
|
6
|
+
| Prop | Type | Default | Description |
|
|
7
|
+
| --- | --- | --- | --- |
|
|
8
|
+
| `validation` | `'success' \| 'warning' \| 'error' \| null` | `null` | Semantic validation state. Applies thematic border classes (`is-success`, `is-warning`, `is-error`) via active preset CSS variables. |
|
|
9
|
+
| `validationText` | `string` | `''` | User-facing feedback message displayed immediately below the input. Only visible when `validation` is `'success'`, `'warning'`, or `'error'`. |
|
|
10
|
+
|
|
11
|
+
#### Semantic States & Design Tokens
|
|
12
|
+
- **`null` (Clean / Default)**: Neutral state. Default input borders (`var(--border-color)`), no validation text rendered.
|
|
13
|
+
- **`'success'`**: Constraint met / verified. Accented with `var(--success-500)` and green feedback text.
|
|
14
|
+
- **`'warning'`**: Advisory condition (e.g. approaching character limit, weak password, or asynchronous check pending). Accented with `var(--warning-500)`.
|
|
15
|
+
- **`'error'`**: Constraint violated (e.g. required field empty, format failure, server conflict). Accented with `var(--danger-500)`.
|
|
16
|
+
|
|
17
|
+
#### Standard Implementation Patterns
|
|
18
|
+
|
|
19
|
+
1. **Reactive Computed Rules (Real-Time)**:
|
|
20
|
+
```typescript
|
|
21
|
+
const email = ref('')
|
|
22
|
+
const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/
|
|
23
|
+
|
|
24
|
+
const emailValidation = computed(() => {
|
|
25
|
+
if (!email.value) return null
|
|
26
|
+
if (emailRegex.test(email.value)) return 'success'
|
|
27
|
+
if (email.value.includes('@') && !email.value.includes('.')) return 'warning'
|
|
28
|
+
return 'error'
|
|
29
|
+
})
|
|
30
|
+
|
|
31
|
+
const emailValidationText = computed(() => {
|
|
32
|
+
if (!email.value) return ''
|
|
33
|
+
if (emailRegex.test(email.value)) return 'Valid email format'
|
|
34
|
+
if (email.value.includes('@') && !email.value.includes('.')) return 'Incomplete domain extension'
|
|
35
|
+
return 'Please enter a valid email address'
|
|
36
|
+
})
|
|
37
|
+
```
|
|
38
|
+
```pug
|
|
39
|
+
KTextbox(
|
|
40
|
+
v-model="email"
|
|
41
|
+
type="email"
|
|
42
|
+
placeholder="user@example.com"
|
|
43
|
+
:validation="emailValidation"
|
|
44
|
+
:validationText="emailValidationText"
|
|
45
|
+
showClear
|
|
46
|
+
)
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
2. **Debounced Asynchronous / Remote Validation**:
|
|
50
|
+
```typescript
|
|
51
|
+
const username = ref('')
|
|
52
|
+
const asyncValidation = ref<'success' | 'warning' | 'error' | null>(null)
|
|
53
|
+
const asyncValidationText = ref('')
|
|
54
|
+
let timer: ReturnType<typeof setTimeout> | null = null
|
|
55
|
+
|
|
56
|
+
watch(username, (val) => {
|
|
57
|
+
if (timer) clearTimeout(timer)
|
|
58
|
+
const clean = val.trim()
|
|
59
|
+
if (!clean) {
|
|
60
|
+
asyncValidation.value = null
|
|
61
|
+
asyncValidationText.value = ''
|
|
62
|
+
return
|
|
63
|
+
}
|
|
64
|
+
// Set in-flight warning state
|
|
65
|
+
asyncValidation.value = 'warning'
|
|
66
|
+
asyncValidationText.value = `Checking availability for "${clean}"...`
|
|
67
|
+
|
|
68
|
+
timer = setTimeout(async () => {
|
|
69
|
+
const isTaken = ['admin', 'root', 'support'].includes(clean.toLowerCase())
|
|
70
|
+
if (isTaken) {
|
|
71
|
+
asyncValidation.value = 'error'
|
|
72
|
+
asyncValidationText.value = `Username "${clean}" is already taken`
|
|
73
|
+
} else {
|
|
74
|
+
asyncValidation.value = 'success'
|
|
75
|
+
asyncValidationText.value = `Username "${clean}" is available!`
|
|
76
|
+
}
|
|
77
|
+
}, 400)
|
|
78
|
+
})
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
3. **Complete Form Submission Handling**:
|
|
82
|
+
```typescript
|
|
83
|
+
const form = reactive({ name: '', email: '', terms: false })
|
|
84
|
+
const submitted = ref(false)
|
|
85
|
+
|
|
86
|
+
const formErrors = computed(() => {
|
|
87
|
+
const errs: string[] = []
|
|
88
|
+
if (!form.name.trim()) errs.push('Full Name is required')
|
|
89
|
+
if (!form.email || !/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(form.email)) errs.push('Valid Email is required')
|
|
90
|
+
if (!form.terms) errs.push('You must accept the terms of service')
|
|
91
|
+
return errs
|
|
92
|
+
})
|
|
93
|
+
|
|
94
|
+
function getFieldState(field: keyof typeof form) {
|
|
95
|
+
if (!submitted.value) return null
|
|
96
|
+
if (field === 'name') return form.name.trim() ? 'success' : 'error'
|
|
97
|
+
if (field === 'email') return /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(form.email) ? 'success' : 'error'
|
|
98
|
+
if (field === 'terms') return form.terms ? 'success' : 'error'
|
|
99
|
+
return null
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
function submitForm() {
|
|
103
|
+
submitted.value = true
|
|
104
|
+
if (formErrors.value.length === 0) {
|
|
105
|
+
// Dispatch validated payload to backend
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
```
|
|
109
|
+
```pug
|
|
110
|
+
KAlert(v-if="submitted && formErrors.length > 0" type="danger" title="Validation Errors")
|
|
111
|
+
ul
|
|
112
|
+
li(v-for="err in formErrors" :key="err") {{ err }}
|
|
113
|
+
|
|
114
|
+
KTextbox(
|
|
115
|
+
v-model="form.name"
|
|
116
|
+
:validation="getFieldState('name')"
|
|
117
|
+
validationText="Full Name is required"
|
|
118
|
+
placeholder="Name"
|
|
119
|
+
)
|
|
120
|
+
KButton(type="primary" @click="submitForm") Submit
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
---
|
|
124
|
+
|
|
125
|
+
## 2.3. Data & Advanced Display
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
### `KTree` Item Customization
|
|
2
|
+
```pug
|
|
3
|
+
KTree(:dataProvider="myProvider")
|
|
4
|
+
template(#item="{ data, node }")
|
|
5
|
+
KGrid(align="center")
|
|
6
|
+
KIcon(:iconname="data.type === 'folder' ? 'folder' : 'file'")
|
|
7
|
+
span {{ data.name }}
|
|
8
|
+
span.badge(v-if="node.hasChildren") {{ node.depth }}
|
|
9
|
+
```
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
### Global Notification Queue (`useToast()`)
|
|
2
|
+
Imperative notification composable accessible across any component, store, or composable:
|
|
3
|
+
```ts
|
|
4
|
+
const toast = useToast()
|
|
5
|
+
|
|
6
|
+
// Variant shortcuts
|
|
7
|
+
toast.success('Record created!')
|
|
8
|
+
toast.error('Failed to update')
|
|
9
|
+
toast.warning('Check connection')
|
|
10
|
+
toast.info('New message received')
|
|
11
|
+
toast.primary('System announcement')
|
|
12
|
+
|
|
13
|
+
// Custom configuration and positions
|
|
14
|
+
toast.show('Custom Alert', {
|
|
15
|
+
title: 'Network Sync',
|
|
16
|
+
position: 'bottom-right', // 'top-right' | 'top-left' | 'top-center' | 'bottom-right' | 'bottom-left' | 'bottom-center'
|
|
17
|
+
duration: 4000,
|
|
18
|
+
pauseOnHover: true,
|
|
19
|
+
onClose: () => console.log('Closed')
|
|
20
|
+
})
|
|
21
|
+
|
|
22
|
+
// Dismissal
|
|
23
|
+
toast.dismiss(id)
|
|
24
|
+
toast.clear() // Clear all toasts
|
|
25
|
+
toast.clear('top-right') // Clear specific position
|
|
26
|
+
```
|
|
27
|
+
- **Auto-Mounting**: `KToastContainer` is mounted automatically to `document.body` by `@katlux/toolkit`, requiring zero boilerplate in consumer projects.
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
### Form Validation Directives & Semantic Classes
|
|
2
|
+
- Form components automatically apply semantic class names matching validation state:
|
|
3
|
+
- `is-success`: Border and focus rings use `var(--success-500)`.
|
|
4
|
+
- `is-warning`: Border and focus rings use `var(--warning-500)`.
|
|
5
|
+
- `is-error`: Border and focus rings use `var(--danger-500)`.
|
|
6
|
+
- Use universal validation props (`:validation="state"` and `:validationText="msg"`) across all input components.
|