vueye-table 2.0.0-alpha.6 → 2.0.0-alpha.8

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.
Files changed (2) hide show
  1. package/README.md +89 -56
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,56 +1,89 @@
1
- # VueyeTableProps TypeScript Definition
2
-
3
- This Markdown file provides documentation for the TypeScript `VueyeTableProps` type and its associated default values.
4
-
5
- ## VueyeTableProps Type
6
-
7
- `VueyeTableProps` is a TypeScript type that represents the properties for a Vueye table component.
8
-
9
- ### Properties
10
-
11
- - `itemValue?: string` (Optional)
12
-
13
- - The key used to identify items in the data array.
14
- - Default: `'id'`
15
-
16
- - `columnHeaders: TColumn[]`
17
-
18
- - An array of column headers.
19
-
20
- - `data: TData[]`
21
-
22
- - An array of data.
23
-
24
- - `perPage?: number` (Optional)
25
-
26
- - The number of items to display per page.
27
- - Default: `10`
28
-
29
- - `currentPage?: number` (Optional)
30
-
31
- - The current page number.
32
- - Default: `1`
33
-
34
- - `perPageOptions?: number[]` (Optional)
35
-
36
- - An array of options for the number of items to display per page.
37
- - Default: `[5, 10, 20, 30]`
38
-
39
- - `loading?: boolean` (Optional)
40
-
41
- - Indicates whether the table is in a loading state.
42
- - Default: `false`
43
-
44
- - `selectable?: boolean` (Optional)
45
-
46
- - Indicates whether items in the table are selectable.
47
- - Default: `false`
48
-
49
- - `caption?: string` (Optional)
50
-
51
- - A caption for the table.
52
- - Default: `''`
53
-
54
- - `summary?: string` (Optional)
55
- - A summary for the table.
56
- - Default: `''`
1
+ # Vueye Table
2
+
3
+ Vueye Table is a Vue 3 component for displaying data in a table.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install vueye-table
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ ```vue
14
+ <template>
15
+ <VueyeTable
16
+ :data="data"
17
+ :columnHeaders="columnHeaders"
18
+ :itemValue="itemValue"
19
+ :perPage="perPage"
20
+ :currentPage="currentPage"
21
+ :perPageOptions="perPageOptions"
22
+ :loading="loading"
23
+ :selected="selected"
24
+ :selectMode="selectMode"
25
+ :caption="caption"
26
+ :summary="summary"
27
+ @update:loading="updateLoading"
28
+ @update:selected="updateSelected"
29
+ >
30
+ <template #headerCellContent.name="props">
31
+ {{ props.columnHeader.name }}
32
+ </template>
33
+ <template #itemCellContent.name="props">
34
+ {{ props.item.name }}
35
+ </template>
36
+ </VueyeTable>
37
+ </template>
38
+ ```
39
+
40
+ ### VueyeTableProps
41
+
42
+ | Prop Name | Type | Default Value | Description |
43
+ | --- | --- | --- | --- |
44
+ | data | TData[] | [] | An array of data for the table. |
45
+ | columnHeaders | TColumn[] or a function returning an array | [] | An array of column headers for the table. |
46
+ | itemValue | string | 'id' | The property name used as a unique identifier for each item. |
47
+ | perPage | number | 10 | The number of items displayed per page. |
48
+ | currentPage | number | 1 | The current page number. |
49
+ | perPageOptions | number[] or a function returning an array | [5, 10, 20, 30] | An array of options for the number of items per page. |
50
+ | loading | boolean | false | Indicates whether the table is in a loading state. |
51
+ | selected | TData[], Row[], or null | null | An array of selected items or rows. |
52
+ | selectMode | 'page' or 'all' | 'all' | The mode for selecting items: 'page' or 'all'. |
53
+ | caption | string | '' | The table's caption. |
54
+ | summary | string | '' | The table's summary. |
55
+
56
+ ### VueyeTableEmits
57
+
58
+ | Emit Name | Parameters | Description |
59
+ | --------------- | -------------- | ------------------------------------- |
60
+ | update:loading | value: boolean | Emits when the loading state changes. |
61
+ | update:selected | value: T[] | Emits when the selected items change. |
62
+
63
+ ### PaginationEmits
64
+
65
+ | Emit Name | Parameters | Description |
66
+ | ------------------ | ------------- | ------------------------------------------------ |
67
+ | update:currentPage | value: number | Emits when the current page changes. |
68
+ | update:perPage | value: number | Emits when the number of items per page changes. |
69
+
70
+ ### SlotHeader
71
+
72
+ The SlotHeader component defines various slots for customizing the table header.
73
+
74
+ - `headerCell.<ColumnKey>`: Slot for customizing the content of a specific column header.
75
+ - `headerCellContent.<ColumnKey>`: Slot for customizing the content within a specific column header cell.
76
+ - `headers`: Slot for customizing the entire table header, containing all column headers.
77
+ - `checkbox`: Slot for customizing the checkbox used for selecting all items.
78
+
79
+ ### SlotRow
80
+
81
+ The SlotRow component defines various slots for customizing the table rows.
82
+
83
+ - `itemCell.<ItemKey>`: Slot for customizing the content of a specific item cell within a row.
84
+ - `itemCellContent.<ItemKey>`: Slot for customizing the content within a specific item cell.
85
+ - `rows`: Slot for customizing the entire table rows, containing all rows.
86
+ - `row`: Slot for customizing a specific row.
87
+ - `checkbox`: Slot for customizing the checkbox used for selecting a specific row.
88
+
89
+ You can use these Markdown tables to document the props, emits, and slot definitions for the data table and pagination components in your Vue 3 project.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vueye-table",
3
- "version": "2.0.0-alpha.6",
3
+ "version": "2.0.0-alpha.8",
4
4
  "private": false,
5
5
  "description": "Vue data table",
6
6
  "author": "Brahim Boussadjra",