@velkymx/vibeui 0.8.2 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +171 -9
- package/dist/components/VibeAlert.vue.d.ts +12 -2
- package/dist/components/VibeAutocomplete.vue.d.ts +46 -0
- package/dist/components/VibeButton.vue.d.ts +4 -4
- package/dist/components/VibeDataTable.vue.d.ts +6 -6
- package/dist/components/VibeDatePicker.vue.d.ts +122 -0
- package/dist/components/VibeDraggable.vue.d.ts +81 -0
- package/dist/components/VibeDroppable.vue.d.ts +74 -0
- package/dist/components/VibeFileInput.vue.d.ts +133 -0
- package/dist/components/VibeFormCheckbox.vue.d.ts +1 -1
- package/dist/components/VibeFormDatepicker.vue.d.ts +1 -1
- package/dist/components/VibeFormGroup.vue.d.ts +1 -1
- package/dist/components/VibeFormInput.vue.d.ts +1 -1
- package/dist/components/VibeFormRadio.vue.d.ts +1 -1
- package/dist/components/VibeFormSelect.vue.d.ts +1 -1
- package/dist/components/VibeFormSpinbutton.vue.d.ts +1 -1
- package/dist/components/VibeFormSwitch.vue.d.ts +1 -1
- package/dist/components/VibeFormTextarea.vue.d.ts +1 -1
- package/dist/components/VibeFormWysiwyg.vue.d.ts +2 -2
- package/dist/components/VibeResizable.vue.d.ts +144 -0
- package/dist/components/VibeSkeleton.vue.d.ts +53 -0
- package/dist/components/VibeSlider.vue.d.ts +78 -0
- package/dist/components/VibeSortable.vue.d.ts +40 -0
- package/dist/components/VibeStepper.vue.d.ts +132 -0
- package/dist/components/VibeTab.vue.d.ts +45 -0
- package/dist/components/VibeTabs.vue.d.ts +82 -0
- package/dist/components/VibeToast.vue.d.ts +11 -0
- package/dist/components/VibeToastHost.vue.d.ts +15 -0
- package/dist/components/dndStore.d.ts +6 -0
- package/dist/components/index.d.ts +14 -1
- package/dist/composables/useForm.d.ts +22 -0
- package/dist/composables/usePosition.d.ts +20 -0
- package/dist/composables/useToast.d.ts +52 -0
- package/dist/directives/vTooltip.d.ts +25 -0
- package/dist/index.d.ts +6 -0
- package/dist/types.d.ts +11 -4
- package/dist/vibeui.css +1 -1
- package/dist/vibeui.es.js +4256 -1827
- package/dist/vibeui.umd.js +1 -1
- package/package.json +4 -5
- package/CLAUDE.md +0 -48
- package/docs/README.md +0 -153
- package/docs/components/advanced/popover.md +0 -150
- package/docs/components/advanced/scrollspy.md +0 -64
- package/docs/components/advanced/tooltip.md +0 -111
- package/docs/components/card/card.md +0 -215
- package/docs/components/core/alert.md +0 -72
- package/docs/components/core/badge.md +0 -81
- package/docs/components/core/button-group.md +0 -105
- package/docs/components/core/button.md +0 -127
- package/docs/components/core/close-button.md +0 -82
- package/docs/components/core/link.md +0 -36
- package/docs/components/core/placeholder.md +0 -135
- package/docs/components/core/spinner.md +0 -109
- package/docs/components/data/datatable.md +0 -416
- package/docs/components/interactive/accordion.md +0 -92
- package/docs/components/interactive/carousel.md +0 -97
- package/docs/components/interactive/collapse.md +0 -105
- package/docs/components/interactive/dropdown.md +0 -93
- package/docs/components/interactive/modal.md +0 -148
- package/docs/components/interactive/offcanvas.md +0 -89
- package/docs/components/interactive/toast.md +0 -114
- package/docs/components/layout/col.md +0 -123
- package/docs/components/layout/container.md +0 -59
- package/docs/components/layout/row.md +0 -113
- package/docs/components/list/list-group.md +0 -221
- package/docs/components/navigation/breadcrumb.md +0 -116
- package/docs/components/navigation/nav.md +0 -88
- package/docs/components/navigation/navbar.md +0 -106
- package/docs/components/navigation/pagination.md +0 -146
- package/docs/components/progress/progress.md +0 -182
- package/docs/composables/back-button.md +0 -28
- package/docs/composables/breakpoints.md +0 -54
- package/docs/composables/color-mode.md +0 -141
- package/docs/forms/README.md +0 -88
- package/docs/forms/form-checkbox.md +0 -50
- package/docs/forms/form-datepicker.md +0 -50
- package/docs/forms/form-group.md +0 -80
- package/docs/forms/form-input.md +0 -55
- package/docs/forms/form-radio.md +0 -58
- package/docs/forms/form-select.md +0 -54
- package/docs/forms/form-spinbutton.md +0 -55
- package/docs/forms/form-switch.md +0 -47
- package/docs/forms/form-textarea.md +0 -51
- package/docs/forms/form-wysiwyg.md +0 -64
- package/docs/forms/input-group.md +0 -51
- package/docs/forms/validation.md +0 -599
- package/llms.txt +0 -422
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
# VibeLink
|
|
2
|
-
|
|
3
|
-
A flexible link component that supports Bootstrap 5.3's new link and underline utilities.
|
|
4
|
-
|
|
5
|
-
## Basic Usage
|
|
6
|
-
|
|
7
|
-
```vue
|
|
8
|
-
<VibeLink href="https://example.com">Standard Link</VibeLink>
|
|
9
|
-
|
|
10
|
-
<VibeLink variant="danger" underline="0">Link without underline</VibeLink>
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
## Props
|
|
14
|
-
|
|
15
|
-
| Prop | Type | Default | Description |
|
|
16
|
-
|------|------|---------|-------------|
|
|
17
|
-
| `variant` | `Variant` | `undefined` | Link color variant (`primary`, `success`, etc.) |
|
|
18
|
-
| `underline` | `Boolean \| '0' \| '1' \| '2' \| '3'` | `true` | Underline behavior. `'0'` removes underline. |
|
|
19
|
-
| `underlineVariant` | `Variant` | `undefined` | Color of the underline |
|
|
20
|
-
| `underlineOpacity` | `0 \| 10 \| 25 \| 50 \| 75 \| 100` | `undefined` | Opacity of the underline |
|
|
21
|
-
| `offset` | `1 \| 2 \| 3` | `undefined` | Underline offset from text |
|
|
22
|
-
| `opacity` | `10 \| 25 \| 50 \| 75 \| 100` | `undefined` | Link text opacity |
|
|
23
|
-
| `focusRing` | `Boolean` | `false` | Enable the focus-ring helper |
|
|
24
|
-
| `href` | `String` | `undefined` | URL for standard links |
|
|
25
|
-
| `to` | `String \| Object` | `undefined` | Router link destination |
|
|
26
|
-
| `tag` | `String` | `'a'` | HTML tag to use (if not a router-link) |
|
|
27
|
-
|
|
28
|
-
## Bootstrap 5.3 Utilities
|
|
29
|
-
This component maps directly to the following Bootstrap classes:
|
|
30
|
-
- `.link-{variant}`
|
|
31
|
-
- `.link-underline-0`
|
|
32
|
-
- `.link-underline-{variant}`
|
|
33
|
-
- `.link-underline-opacity-{value}`
|
|
34
|
-
- `.link-offset-{value}`
|
|
35
|
-
- `.link-opacity-{value}`
|
|
36
|
-
- `.focus-ring`
|
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
# VibePlaceholder
|
|
2
|
-
|
|
3
|
-
Placeholder loading component with optional animations.
|
|
4
|
-
|
|
5
|
-
## Props
|
|
6
|
-
|
|
7
|
-
| Prop | Type | Default | Description |
|
|
8
|
-
|------|------|---------|-------------|
|
|
9
|
-
| `variant` | `Variant` | `undefined` | Background color variant |
|
|
10
|
-
| `size` | `Size` | `undefined` | Placeholder size: `'sm'` or `'lg'` |
|
|
11
|
-
| `animation` | `PlaceholderAnimation` | `undefined` | Animation type: `'glow'` or `'wave'` |
|
|
12
|
-
| `width` | `String\|Number` | `undefined` | Width as percentage or CSS value |
|
|
13
|
-
| `tag` | `String` | `'span'` | HTML tag to render |
|
|
14
|
-
|
|
15
|
-
## Events
|
|
16
|
-
|
|
17
|
-
| Event | Payload | Description |
|
|
18
|
-
|-------|---------|-------------|
|
|
19
|
-
| `component-error` | `Object` | Emitted when an error occurs |
|
|
20
|
-
|
|
21
|
-
## Slots
|
|
22
|
-
|
|
23
|
-
| Slot | Description |
|
|
24
|
-
|------|-------------|
|
|
25
|
-
| `default` | Placeholder content (typically empty) |
|
|
26
|
-
|
|
27
|
-
## Usage
|
|
28
|
-
|
|
29
|
-
### Basic Placeholder
|
|
30
|
-
|
|
31
|
-
```vue
|
|
32
|
-
<template>
|
|
33
|
-
<VibePlaceholder width="75" />
|
|
34
|
-
</template>
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
### Placeholder Card
|
|
38
|
-
|
|
39
|
-
```vue
|
|
40
|
-
<template>
|
|
41
|
-
<VibeCard>
|
|
42
|
-
<template #title>
|
|
43
|
-
<VibePlaceholder width="100" />
|
|
44
|
-
</template>
|
|
45
|
-
<template #body>
|
|
46
|
-
<VibePlaceholder width="100" />
|
|
47
|
-
<VibePlaceholder width="100" />
|
|
48
|
-
<VibePlaceholder width="75" />
|
|
49
|
-
</template>
|
|
50
|
-
</VibeCard>
|
|
51
|
-
</template>
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
### With Glow Animation
|
|
55
|
-
|
|
56
|
-
```vue
|
|
57
|
-
<template>
|
|
58
|
-
<div>
|
|
59
|
-
<VibePlaceholder animation="glow" width="100" />
|
|
60
|
-
<VibePlaceholder animation="glow" width="75" />
|
|
61
|
-
</div>
|
|
62
|
-
</template>
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
### With Wave Animation
|
|
66
|
-
|
|
67
|
-
```vue
|
|
68
|
-
<template>
|
|
69
|
-
<div>
|
|
70
|
-
<VibePlaceholder animation="wave" width="100" />
|
|
71
|
-
<VibePlaceholder animation="wave" width="90" />
|
|
72
|
-
<VibePlaceholder animation="wave" width="80" />
|
|
73
|
-
</div>
|
|
74
|
-
</template>
|
|
75
|
-
```
|
|
76
|
-
|
|
77
|
-
### Colored Placeholders
|
|
78
|
-
|
|
79
|
-
```vue
|
|
80
|
-
<template>
|
|
81
|
-
<div>
|
|
82
|
-
<VibePlaceholder variant="primary" width="100" />
|
|
83
|
-
<VibePlaceholder variant="success" width="75" />
|
|
84
|
-
<VibePlaceholder variant="danger" width="50" />
|
|
85
|
-
</div>
|
|
86
|
-
</template>
|
|
87
|
-
```
|
|
88
|
-
|
|
89
|
-
### Sizes
|
|
90
|
-
|
|
91
|
-
```vue
|
|
92
|
-
<template>
|
|
93
|
-
<div>
|
|
94
|
-
<VibePlaceholder size="lg" width="100" />
|
|
95
|
-
<VibePlaceholder width="100" />
|
|
96
|
-
<VibePlaceholder size="sm" width="100" />
|
|
97
|
-
</div>
|
|
98
|
-
</template>
|
|
99
|
-
```
|
|
100
|
-
|
|
101
|
-
### Loading State Example
|
|
102
|
-
|
|
103
|
-
```vue
|
|
104
|
-
<script setup>
|
|
105
|
-
import { ref, onMounted } from 'vue'
|
|
106
|
-
|
|
107
|
-
const loading = ref(true)
|
|
108
|
-
const data = ref(null)
|
|
109
|
-
|
|
110
|
-
onMounted(async () => {
|
|
111
|
-
// Simulate API call
|
|
112
|
-
await new Promise(resolve => setTimeout(resolve, 2000))
|
|
113
|
-
data.value = { title: 'Article Title', content: 'Article content...' }
|
|
114
|
-
loading.value = false
|
|
115
|
-
})
|
|
116
|
-
</script>
|
|
117
|
-
|
|
118
|
-
<template>
|
|
119
|
-
<VibeCard v-if="loading">
|
|
120
|
-
<template #body>
|
|
121
|
-
<VibePlaceholder animation="glow" width="100" />
|
|
122
|
-
<VibePlaceholder animation="glow" width="100" />
|
|
123
|
-
<VibePlaceholder animation="glow" width="75" />
|
|
124
|
-
</template>
|
|
125
|
-
</VibeCard>
|
|
126
|
-
<VibeCard v-else :title="data.title" :body="data.content" />
|
|
127
|
-
</template>
|
|
128
|
-
```
|
|
129
|
-
|
|
130
|
-
## Bootstrap CSS Classes
|
|
131
|
-
|
|
132
|
-
- `.placeholder`
|
|
133
|
-
- `.bg-{variant}`
|
|
134
|
-
- `.placeholder-{size}`
|
|
135
|
-
- `.placeholder-{animation}`
|
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
# VibeSpinner
|
|
2
|
-
|
|
3
|
-
Loading spinner with border or grow animation styles.
|
|
4
|
-
|
|
5
|
-
## Props
|
|
6
|
-
|
|
7
|
-
| Prop | Type | Default | Description |
|
|
8
|
-
|------|------|---------|-------------|
|
|
9
|
-
| `variant` | `Variant` | `undefined` | Text color variant |
|
|
10
|
-
| `type` | `SpinnerType` | `'border'` | Spinner type: `'border'` or `'grow'` |
|
|
11
|
-
| `size` | `Size` | `undefined` | Spinner size: `'sm'` or `'lg'` |
|
|
12
|
-
| `label` | `String` | `'Loading...'` | Screen reader text |
|
|
13
|
-
| `tag` | `String` | `'div'` | HTML tag to render |
|
|
14
|
-
|
|
15
|
-
## Events
|
|
16
|
-
|
|
17
|
-
| Event | Payload | Description |
|
|
18
|
-
|-------|---------|-------------|
|
|
19
|
-
| `component-error` | `Object` | Emitted when an error occurs |
|
|
20
|
-
|
|
21
|
-
## Usage
|
|
22
|
-
|
|
23
|
-
### Basic Spinner
|
|
24
|
-
|
|
25
|
-
```vue
|
|
26
|
-
<template>
|
|
27
|
-
<VibeSpinner />
|
|
28
|
-
</template>
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
### Grow Spinner
|
|
32
|
-
|
|
33
|
-
```vue
|
|
34
|
-
<template>
|
|
35
|
-
<VibeSpinner type="grow" />
|
|
36
|
-
</template>
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
### Colored Spinners
|
|
40
|
-
|
|
41
|
-
```vue
|
|
42
|
-
<template>
|
|
43
|
-
<div>
|
|
44
|
-
<VibeSpinner variant="primary" />
|
|
45
|
-
<VibeSpinner variant="success" />
|
|
46
|
-
<VibeSpinner variant="danger" />
|
|
47
|
-
<VibeSpinner variant="warning" />
|
|
48
|
-
<VibeSpinner variant="info" />
|
|
49
|
-
</div>
|
|
50
|
-
</template>
|
|
51
|
-
```
|
|
52
|
-
|
|
53
|
-
### Small Spinners
|
|
54
|
-
|
|
55
|
-
```vue
|
|
56
|
-
<template>
|
|
57
|
-
<div>
|
|
58
|
-
<VibeSpinner size="sm" />
|
|
59
|
-
<VibeSpinner type="grow" size="sm" />
|
|
60
|
-
</div>
|
|
61
|
-
</template>
|
|
62
|
-
```
|
|
63
|
-
|
|
64
|
-
### In Button
|
|
65
|
-
|
|
66
|
-
```vue
|
|
67
|
-
<template>
|
|
68
|
-
<VibeButton variant="primary" disabled>
|
|
69
|
-
<VibeSpinner size="sm" tag="span" />
|
|
70
|
-
Loading...
|
|
71
|
-
</VibeButton>
|
|
72
|
-
</template>
|
|
73
|
-
```
|
|
74
|
-
|
|
75
|
-
### Custom Label
|
|
76
|
-
|
|
77
|
-
```vue
|
|
78
|
-
<template>
|
|
79
|
-
<VibeSpinner label="Please wait while we load your data..." />
|
|
80
|
-
</template>
|
|
81
|
-
```
|
|
82
|
-
|
|
83
|
-
### Loading State Example
|
|
84
|
-
|
|
85
|
-
```vue
|
|
86
|
-
<script setup>
|
|
87
|
-
import { ref } from 'vue'
|
|
88
|
-
|
|
89
|
-
const loading = ref(true)
|
|
90
|
-
|
|
91
|
-
setTimeout(() => {
|
|
92
|
-
loading.value = false
|
|
93
|
-
}, 3000)
|
|
94
|
-
</script>
|
|
95
|
-
|
|
96
|
-
<template>
|
|
97
|
-
<div>
|
|
98
|
-
<VibeSpinner v-if="loading" variant="primary" />
|
|
99
|
-
<div v-else>Content loaded!</div>
|
|
100
|
-
</div>
|
|
101
|
-
</template>
|
|
102
|
-
```
|
|
103
|
-
|
|
104
|
-
## Bootstrap CSS Classes
|
|
105
|
-
|
|
106
|
-
- `.spinner-border` or `.spinner-grow`
|
|
107
|
-
- `.text-{variant}`
|
|
108
|
-
- `.spinner-{type}-{size}`
|
|
109
|
-
- `.visually-hidden` (for label)
|
|
@@ -1,416 +0,0 @@
|
|
|
1
|
-
# VibeDataTable
|
|
2
|
-
|
|
3
|
-
Powerful data table component with search, sorting, and pagination - similar to DataTables.net but built for Vue 3 and Bootstrap 5.3.
|
|
4
|
-
|
|
5
|
-
## Features
|
|
6
|
-
|
|
7
|
-
- **Search/Filter** - Real-time search across all searchable columns
|
|
8
|
-
- **Column Sorting** - Click column headers to sort (asc/desc)
|
|
9
|
-
- **Pagination** - Built-in pagination with customizable page sizes
|
|
10
|
-
- **Responsive** - Mobile-friendly with responsive table wrapper
|
|
11
|
-
- **Bootstrap Styling** - All Bootstrap table variants (striped, bordered, hover, etc.)
|
|
12
|
-
- **Custom Cell Rendering** - Slots for custom cell content
|
|
13
|
-
- **Formatters** - Custom data formatters per column
|
|
14
|
-
- **TypeScript** - Fully typed with comprehensive interfaces
|
|
15
|
-
|
|
16
|
-
## Props
|
|
17
|
-
|
|
18
|
-
### Data Props
|
|
19
|
-
|
|
20
|
-
| Prop | Type | Default | Description |
|
|
21
|
-
|------|------|---------|-------------|
|
|
22
|
-
| `items` | `Array<any>` | `[]` | Array of data objects to display |
|
|
23
|
-
| `columns` | `DataTableColumn[]` | Required | Column definitions |
|
|
24
|
-
|
|
25
|
-
### Table Styling Props
|
|
26
|
-
|
|
27
|
-
| Prop | Type | Default | Description |
|
|
28
|
-
|------|------|---------|-------------|
|
|
29
|
-
| `striped` | `Boolean` | `false` | Striped table rows |
|
|
30
|
-
| `bordered` | `Boolean` | `false` | Bordered table |
|
|
31
|
-
| `borderless` | `Boolean` | `false` | Remove all borders |
|
|
32
|
-
| `hover` | `Boolean` | `false` | Hover effect on rows |
|
|
33
|
-
| `small` | `Boolean` | `false` | Compact table |
|
|
34
|
-
| `responsive` | `Boolean` | `true` | Responsive table wrapper |
|
|
35
|
-
| `stack` | `Boolean` | `false` | Transforms table into cards on mobile screens |
|
|
36
|
-
| `variant` | `String` | `undefined` | Table color variant |
|
|
37
|
-
|
|
38
|
-
### Feature Props
|
|
39
|
-
|
|
40
|
-
| Prop | Type | Default | Description |
|
|
41
|
-
|------|------|---------|-------------|
|
|
42
|
-
| `searchable` | `Boolean` | `true` | Enable search functionality |
|
|
43
|
-
| `sortable` | `Boolean` | `true` | Enable column sorting |
|
|
44
|
-
| `paginated` | `Boolean` | `true` | Enable pagination |
|
|
45
|
-
|
|
46
|
-
### Search Props
|
|
47
|
-
|
|
48
|
-
| Prop | Type | Default | Description |
|
|
49
|
-
|------|------|---------|-------------|
|
|
50
|
-
| `searchPlaceholder` | `String` | `'Search...'` | Search input placeholder |
|
|
51
|
-
| `searchDebounce` | `Number` | `300` | Search debounce delay (ms) |
|
|
52
|
-
|
|
53
|
-
### Pagination Props
|
|
54
|
-
|
|
55
|
-
| Prop | Type | Default | Description |
|
|
56
|
-
|------|------|---------|-------------|
|
|
57
|
-
| `perPage` | `Number` | `10` | Items per page |
|
|
58
|
-
| `currentPage` | `Number` | `1` | Current page number |
|
|
59
|
-
| `perPageOptions` | `Number[]` | `[5, 10, 25, 50, 100]` | Page size options |
|
|
60
|
-
|
|
61
|
-
### Sorting Props
|
|
62
|
-
|
|
63
|
-
| Prop | Type | Default | Description |
|
|
64
|
-
|------|------|---------|-------------|
|
|
65
|
-
| `sortBy` | `String` | `undefined` | Initial sort column key |
|
|
66
|
-
| `sortDesc` | `Boolean` | `false` | Initial sort direction (true = descending) |
|
|
67
|
-
|
|
68
|
-
### Display Props
|
|
69
|
-
|
|
70
|
-
| Prop | Type | Default | Description |
|
|
71
|
-
|------|------|---------|-------------|
|
|
72
|
-
| `showEmpty` | `Boolean` | `true` | Show message when no data |
|
|
73
|
-
| `emptyText` | `String` | `'No data available'` | Empty state message |
|
|
74
|
-
| `showPerPage` | `Boolean` | `true` | Show per-page selector |
|
|
75
|
-
| `showInfo` | `Boolean` | `true` | Show info text (X to Y of Z entries) |
|
|
76
|
-
| `infoText` | `String` | `'Showing {start} to {end} of {total} entries'` | Info text template |
|
|
77
|
-
| `filteredInfoText` | `String` | `'Showing {start} to {end} of {total} entries (filtered from {totalRows} total entries)'` | Filtered info text template |
|
|
78
|
-
|
|
79
|
-
## Column Definition
|
|
80
|
-
|
|
81
|
-
The `columns` prop accepts an array of `DataTableColumn` objects:
|
|
82
|
-
|
|
83
|
-
```typescript
|
|
84
|
-
interface DataTableColumn {
|
|
85
|
-
key: string // Property key in data object
|
|
86
|
-
label: string // Column header label
|
|
87
|
-
sortable?: boolean // Enable/disable sorting (default: true)
|
|
88
|
-
searchable?: boolean // Include in search (default: true)
|
|
89
|
-
formatter?: (value: any, row: any) => string | number // Custom formatter
|
|
90
|
-
class?: string // CSS class for td
|
|
91
|
-
headerClass?: string // CSS class for th
|
|
92
|
-
thStyle?: Record<string, string> // Inline styles for th
|
|
93
|
-
tdStyle?: Record<string, string> // Inline styles for td
|
|
94
|
-
}
|
|
95
|
-
```
|
|
96
|
-
|
|
97
|
-
## Events
|
|
98
|
-
|
|
99
|
-
| Event | Payload | Description |
|
|
100
|
-
|-------|---------|-------------|
|
|
101
|
-
| `update:currentPage` | `Number` | Emitted when page changes |
|
|
102
|
-
| `update:perPage` | `Number` | Emitted when per-page changes |
|
|
103
|
-
| `update:sortBy` | `String` | Emitted when sort column changes |
|
|
104
|
-
| `update:sortDesc` | `Boolean` | Emitted when sort direction changes |
|
|
105
|
-
| `row-clicked` | `(item, index)` | Emitted when row is clicked |
|
|
106
|
-
|
|
107
|
-
## Slots
|
|
108
|
-
|
|
109
|
-
| Slot | Props | Description |
|
|
110
|
-
|------|-------|-------------|
|
|
111
|
-
| `cell({columnKey})` | `{ item, value, index }` | Custom cell rendering for specific column |
|
|
112
|
-
|
|
113
|
-
## Usage
|
|
114
|
-
|
|
115
|
-
### Basic DataTable
|
|
116
|
-
|
|
117
|
-
```vue
|
|
118
|
-
<script setup>
|
|
119
|
-
import { ref } from 'vue'
|
|
120
|
-
|
|
121
|
-
const columns = [
|
|
122
|
-
{ key: 'id', label: 'ID' },
|
|
123
|
-
{ key: 'name', label: 'Name' },
|
|
124
|
-
{ key: 'email', label: 'Email' },
|
|
125
|
-
{ key: 'status', label: 'Status' }
|
|
126
|
-
]
|
|
127
|
-
|
|
128
|
-
const items = [
|
|
129
|
-
{ id: 1, name: 'John Doe', email: 'john@example.com', status: 'Active' },
|
|
130
|
-
{ id: 2, name: 'Jane Smith', email: 'jane@example.com', status: 'Inactive' },
|
|
131
|
-
{ id: 3, name: 'Bob Johnson', email: 'bob@example.com', status: 'Active' }
|
|
132
|
-
]
|
|
133
|
-
</script>
|
|
134
|
-
|
|
135
|
-
<template>
|
|
136
|
-
<VibeDataTable :columns="columns" :items="items" />
|
|
137
|
-
</template>
|
|
138
|
-
```
|
|
139
|
-
|
|
140
|
-
### With Bootstrap Styling
|
|
141
|
-
|
|
142
|
-
```vue
|
|
143
|
-
<template>
|
|
144
|
-
<VibeDataTable
|
|
145
|
-
:columns="columns"
|
|
146
|
-
:items="items"
|
|
147
|
-
striped
|
|
148
|
-
hover
|
|
149
|
-
bordered
|
|
150
|
-
/>
|
|
151
|
-
</template>
|
|
152
|
-
```
|
|
153
|
-
|
|
154
|
-
### Custom Column Configuration
|
|
155
|
-
|
|
156
|
-
```vue
|
|
157
|
-
<script setup>
|
|
158
|
-
const columns = [
|
|
159
|
-
{
|
|
160
|
-
key: 'id',
|
|
161
|
-
label: 'ID',
|
|
162
|
-
sortable: true,
|
|
163
|
-
searchable: false,
|
|
164
|
-
headerClass: 'bg-primary text-white'
|
|
165
|
-
},
|
|
166
|
-
{
|
|
167
|
-
key: 'name',
|
|
168
|
-
label: 'Full Name',
|
|
169
|
-
sortable: true
|
|
170
|
-
},
|
|
171
|
-
{
|
|
172
|
-
key: 'salary',
|
|
173
|
-
label: 'Salary',
|
|
174
|
-
formatter: (value) => `$${value.toLocaleString()}`,
|
|
175
|
-
tdStyle: { textAlign: 'right' }
|
|
176
|
-
},
|
|
177
|
-
{
|
|
178
|
-
key: 'status',
|
|
179
|
-
label: 'Status',
|
|
180
|
-
class: 'text-center'
|
|
181
|
-
}
|
|
182
|
-
]
|
|
183
|
-
</script>
|
|
184
|
-
|
|
185
|
-
<template>
|
|
186
|
-
<VibeDataTable :columns="columns" :items="items" />
|
|
187
|
-
</template>
|
|
188
|
-
```
|
|
189
|
-
|
|
190
|
-
### With Custom Cell Rendering
|
|
191
|
-
|
|
192
|
-
```vue
|
|
193
|
-
<script setup>
|
|
194
|
-
const columns = [
|
|
195
|
-
{ key: 'name', label: 'Name' },
|
|
196
|
-
{ key: 'email', label: 'Email' },
|
|
197
|
-
{ key: 'status', label: 'Status' },
|
|
198
|
-
{ key: 'actions', label: 'Actions', sortable: false }
|
|
199
|
-
]
|
|
200
|
-
</script>
|
|
201
|
-
|
|
202
|
-
<template>
|
|
203
|
-
<VibeDataTable :columns="columns" :items="items">
|
|
204
|
-
<!-- Custom status column -->
|
|
205
|
-
<template #cell(status)="{ value }">
|
|
206
|
-
<VibeBadge :variant="value === 'Active' ? 'success' : 'danger'">
|
|
207
|
-
{{ value }}
|
|
208
|
-
</VibeBadge>
|
|
209
|
-
</template>
|
|
210
|
-
|
|
211
|
-
<!-- Custom actions column -->
|
|
212
|
-
<template #cell(actions)="{ item }">
|
|
213
|
-
<VibeButton size="sm" variant="primary" @click="editItem(item)">
|
|
214
|
-
Edit
|
|
215
|
-
</VibeButton>
|
|
216
|
-
<VibeButton size="sm" variant="danger" @click="deleteItem(item)">
|
|
217
|
-
Delete
|
|
218
|
-
</VibeButton>
|
|
219
|
-
</template>
|
|
220
|
-
</VibeDataTable>
|
|
221
|
-
</template>
|
|
222
|
-
```
|
|
223
|
-
|
|
224
|
-
### Controlled State (v-model)
|
|
225
|
-
|
|
226
|
-
```vue
|
|
227
|
-
<script setup>
|
|
228
|
-
import { ref } from 'vue'
|
|
229
|
-
|
|
230
|
-
const currentPage = ref(1)
|
|
231
|
-
const perPage = ref(25)
|
|
232
|
-
const sortBy = ref('name')
|
|
233
|
-
const sortDesc = ref(false)
|
|
234
|
-
|
|
235
|
-
const handleRowClick = (item, index) => {
|
|
236
|
-
console.log('Clicked row:', item, index)
|
|
237
|
-
}
|
|
238
|
-
</script>
|
|
239
|
-
|
|
240
|
-
<template>
|
|
241
|
-
<VibeDataTable
|
|
242
|
-
:columns="columns"
|
|
243
|
-
:items="items"
|
|
244
|
-
v-model:current-page="currentPage"
|
|
245
|
-
v-model:per-page="perPage"
|
|
246
|
-
v-model:sort-by="sortBy"
|
|
247
|
-
v-model:sort-desc="sortDesc"
|
|
248
|
-
@row-clicked="handleRowClick"
|
|
249
|
-
/>
|
|
250
|
-
</template>
|
|
251
|
-
```
|
|
252
|
-
|
|
253
|
-
### Disable Features
|
|
254
|
-
|
|
255
|
-
```vue
|
|
256
|
-
<template>
|
|
257
|
-
<!-- No search, no pagination -->
|
|
258
|
-
<VibeDataTable
|
|
259
|
-
:columns="columns"
|
|
260
|
-
:items="items"
|
|
261
|
-
:searchable="false"
|
|
262
|
-
:paginated="false"
|
|
263
|
-
/>
|
|
264
|
-
|
|
265
|
-
<!-- No sorting -->
|
|
266
|
-
<VibeDataTable
|
|
267
|
-
:columns="columns"
|
|
268
|
-
:items="items"
|
|
269
|
-
:sortable="false"
|
|
270
|
-
/>
|
|
271
|
-
</template>
|
|
272
|
-
```
|
|
273
|
-
|
|
274
|
-
### Custom Page Sizes
|
|
275
|
-
|
|
276
|
-
```vue
|
|
277
|
-
<template>
|
|
278
|
-
<VibeDataTable
|
|
279
|
-
:columns="columns"
|
|
280
|
-
:items="items"
|
|
281
|
-
:per-page="20"
|
|
282
|
-
:per-page-options="[10, 20, 50, 100, 500]"
|
|
283
|
-
/>
|
|
284
|
-
</template>
|
|
285
|
-
```
|
|
286
|
-
|
|
287
|
-
### Large Dataset Example
|
|
288
|
-
|
|
289
|
-
```vue
|
|
290
|
-
<script setup>
|
|
291
|
-
import { ref } from 'vue'
|
|
292
|
-
|
|
293
|
-
// Generate large dataset
|
|
294
|
-
const items = ref(
|
|
295
|
-
Array.from({ length: 1000 }, (_, i) => ({
|
|
296
|
-
id: i + 1,
|
|
297
|
-
name: `User ${i + 1}`,
|
|
298
|
-
email: `user${i + 1}@example.com`,
|
|
299
|
-
department: ['Sales', 'Marketing', 'Engineering', 'HR'][i % 4],
|
|
300
|
-
salary: Math.floor(Math.random() * 100000) + 50000,
|
|
301
|
-
joinDate: new Date(2020 + Math.floor(Math.random() * 5), Math.floor(Math.random() * 12), 1)
|
|
302
|
-
.toISOString()
|
|
303
|
-
.split('T')[0]
|
|
304
|
-
}))
|
|
305
|
-
)
|
|
306
|
-
|
|
307
|
-
const columns = [
|
|
308
|
-
{ key: 'id', label: 'ID', sortable: true },
|
|
309
|
-
{ key: 'name', label: 'Name', sortable: true },
|
|
310
|
-
{ key: 'email', label: 'Email', sortable: true },
|
|
311
|
-
{ key: 'department', label: 'Department', sortable: true },
|
|
312
|
-
{
|
|
313
|
-
key: 'salary',
|
|
314
|
-
label: 'Salary',
|
|
315
|
-
sortable: true,
|
|
316
|
-
formatter: (value) => `$${value.toLocaleString()}`
|
|
317
|
-
},
|
|
318
|
-
{ key: 'joinDate', label: 'Join Date', sortable: true }
|
|
319
|
-
]
|
|
320
|
-
</script>
|
|
321
|
-
|
|
322
|
-
<template>
|
|
323
|
-
<VibeDataTable
|
|
324
|
-
:columns="columns"
|
|
325
|
-
:items="items"
|
|
326
|
-
:per-page="25"
|
|
327
|
-
striped
|
|
328
|
-
hover
|
|
329
|
-
small
|
|
330
|
-
/>
|
|
331
|
-
</template>
|
|
332
|
-
```
|
|
333
|
-
|
|
334
|
-
### With Custom Empty State
|
|
335
|
-
|
|
336
|
-
```vue
|
|
337
|
-
<template>
|
|
338
|
-
<VibeDataTable
|
|
339
|
-
:columns="columns"
|
|
340
|
-
:items="[]"
|
|
341
|
-
empty-text="No users found. Try adjusting your search."
|
|
342
|
-
/>
|
|
343
|
-
</template>
|
|
344
|
-
```
|
|
345
|
-
|
|
346
|
-
## Advanced Features
|
|
347
|
-
|
|
348
|
-
### Formatters
|
|
349
|
-
|
|
350
|
-
Use formatters to transform data before display:
|
|
351
|
-
|
|
352
|
-
```vue
|
|
353
|
-
<script setup>
|
|
354
|
-
const columns = [
|
|
355
|
-
{
|
|
356
|
-
key: 'price',
|
|
357
|
-
label: 'Price',
|
|
358
|
-
formatter: (value) => `$${value.toFixed(2)}`
|
|
359
|
-
},
|
|
360
|
-
{
|
|
361
|
-
key: 'date',
|
|
362
|
-
label: 'Date',
|
|
363
|
-
formatter: (value) => new Date(value).toLocaleDateString()
|
|
364
|
-
},
|
|
365
|
-
{
|
|
366
|
-
key: 'percentage',
|
|
367
|
-
label: 'Complete',
|
|
368
|
-
formatter: (value) => `${value}%`
|
|
369
|
-
}
|
|
370
|
-
]
|
|
371
|
-
</script>
|
|
372
|
-
```
|
|
373
|
-
|
|
374
|
-
### Accessing Full Row in Formatter
|
|
375
|
-
|
|
376
|
-
```vue
|
|
377
|
-
<script setup>
|
|
378
|
-
const columns = [
|
|
379
|
-
{
|
|
380
|
-
key: 'fullName',
|
|
381
|
-
label: 'Full Name',
|
|
382
|
-
formatter: (value, row) => `${row.firstName} ${row.lastName}`
|
|
383
|
-
},
|
|
384
|
-
{
|
|
385
|
-
key: 'discount',
|
|
386
|
-
label: 'Discount',
|
|
387
|
-
formatter: (value, row) => {
|
|
388
|
-
return row.isPremium ? `${value}% (Premium)` : `${value}%`
|
|
389
|
-
}
|
|
390
|
-
}
|
|
391
|
-
]
|
|
392
|
-
</script>
|
|
393
|
-
```
|
|
394
|
-
|
|
395
|
-
## Bootstrap CSS Classes
|
|
396
|
-
|
|
397
|
-
- `.table` - Base table
|
|
398
|
-
- `.table-striped` - Striped rows
|
|
399
|
-
- `.table-bordered` - Bordered table
|
|
400
|
-
- `.table-borderless` - Borderless table
|
|
401
|
-
- `.table-hover` - Hover effect
|
|
402
|
-
- `.table-sm` - Compact table
|
|
403
|
-
- `.table-{variant}` - Color variants
|
|
404
|
-
- `.table-responsive` - Responsive wrapper
|
|
405
|
-
- `.vibe-table-stack` - Mobile card view transformation
|
|
406
|
-
- `.pagination` - Pagination controls
|
|
407
|
-
- `.form-control` - Search input
|
|
408
|
-
- `.form-select` - Per-page selector
|
|
409
|
-
|
|
410
|
-
## Tips
|
|
411
|
-
|
|
412
|
-
1. **Large Datasets**: For datasets with 1000+ rows, consider server-side pagination
|
|
413
|
-
2. **Performance**: Use `:key` on items for better Vue reactivity
|
|
414
|
-
3. **Search Debounce**: Adjust `searchDebounce` prop for performance with large datasets
|
|
415
|
-
4. **Custom Styling**: Use column `class`, `headerClass`, `thStyle`, `tdStyle` for styling
|
|
416
|
-
5. **Slots**: Use slots for complex cell rendering (badges, buttons, images, etc.)
|