@coreui/vue-pro 4.3.0-beta.0 → 4.3.0-beta.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coreui/vue-pro",
3
- "version": "4.3.0-beta.0",
3
+ "version": "4.3.0-beta.1",
4
4
  "description": "UI Components Library for Vue.js",
5
5
  "keywords": [
6
6
  "vue",
@@ -225,7 +225,7 @@ const CSmartPagination = defineComponent({
225
225
  CPaginationItem,
226
226
  {
227
227
  onClick: () => {
228
- setPage(1)
228
+ activePage.value !== 1 && setPage(1)
229
229
  },
230
230
  'aria-label': 'Go to first page',
231
231
  ...(activePage.value === 1 && {
@@ -247,7 +247,7 @@ const CSmartPagination = defineComponent({
247
247
  CPaginationItem,
248
248
  {
249
249
  onClick: () => {
250
- setPage(activePage.value - 1)
250
+ activePage.value !== 1 && setPage(activePage.value - 1)
251
251
  },
252
252
  'aria-label': 'Go to previous page',
253
253
  ...(activePage.value === 1 && {
@@ -304,7 +304,7 @@ const CSmartPagination = defineComponent({
304
304
  CPaginationItem,
305
305
  {
306
306
  onClick: () => {
307
- setPage(activePage.value + 1)
307
+ activePage.value !== pages.value && setPage(activePage.value + 1)
308
308
  },
309
309
  'aria-label': 'Go to next page',
310
310
  ...(activePage.value === pages.value && {
@@ -326,7 +326,7 @@ const CSmartPagination = defineComponent({
326
326
  CPaginationItem,
327
327
  {
328
328
  onClick: () => {
329
- setPage(pages.value)
329
+ activePage.value !== pages.value && setPage(pages.value)
330
330
  },
331
331
  'aria-label': 'Go to last page',
332
332
  ...(activePage.value === pages.value && {
@@ -31,8 +31,6 @@ const CSmartTable = defineComponent({
31
31
  props: {
32
32
  /**
33
33
  * Sets active page. If 'pagination' prop is enabled, activePage is set only initially.
34
- *
35
- * @default 1
36
34
  */
37
35
  activePage: {
38
36
  type: Number,
@@ -41,7 +39,7 @@ const CSmartTable = defineComponent({
41
39
  },
42
40
  /**
43
41
  * When set, displays table cleaner above table, next to the table filter (or in place of table filter if `tableFilter` prop is not set)
44
- * Cleaner resets `tableFilterValue`, `columnFilterValue`, `sorterValue`. If clean is possible it is clickable (`tabIndex="0"` `role="button"`, `color="danger"`), otherwise it is not clickable and transparent. Cleaner can be customized through the `cleaner` slot.
42
+ * Cleaner resets `tableFilterValue`, `columnFilterValue`, `sorterValue`. If clean is possible it is clickable (`tabIndex="0"` `role="button"`, `color="danger"`), otherwise it is not clickable and transparent. Cleaner can be customized through the `cleanerIcon` slot.
45
43
  *
46
44
  */
47
45
  cleaner: {
@@ -50,8 +48,6 @@ const CSmartTable = defineComponent({
50
48
  },
51
49
  /**
52
50
  * Style table items as clickable.
53
- *
54
- * @type boolean
55
51
  */
56
52
  clickableRows: {
57
53
  type: Boolean,
@@ -62,8 +58,6 @@ const CSmartTable = defineComponent({
62
58
  * Column filter can be customized, by passing prop as object with additional options as keys. Available options:
63
59
  * - external (Boolean) - Disables automatic filtering inside component.
64
60
  * - lazy (Boolean) - Set to true to trigger filter updates only on change event.
65
- *
66
- * @type boolean | ColumnFilter
67
61
  */
68
62
  columnFilter: {
69
63
  type: [Boolean, Object] as PropType<boolean | ColumnFilter>,
@@ -72,7 +66,6 @@ const CSmartTable = defineComponent({
72
66
  /**
73
67
  * Value of table filter. To set pass object where keys are column names and values are filter strings e.g.:
74
68
  * { user: 'John', age: 12 }
75
- * You can track state of this prop by setting .sync modifier.
76
69
  */
77
70
  columnFilterValue: {
78
71
  type: Object as PropType<ColumnFilterValue>,
@@ -80,17 +73,17 @@ const CSmartTable = defineComponent({
80
73
  required: false,
81
74
  },
82
75
  /**
83
- * Prop for table columns configuration. If prop is not defined, table will display columns based on the first item keys, omitting keys that begins with underscore (e.g. '_classes')
76
+ * Prop for table columns configuration. If prop is not defined, table will display columns based on the first item keys, omitting keys that begins with underscore (e.g. '_props')
84
77
  *
85
78
  * In columns prop each array item represents one column. Item might be specified in two ways:
86
79
  * String: each item define column name equal to item value.
87
80
  * Object: item is object with following keys available as column configuration:
88
81
  * - key (required)(String) - define column name equal to item key.
82
+ * - filter (Boolean) - removes filter from column when set to false.
89
83
  * - label (String) - define visible label of column. If not defined, label will be generated automatically based on column name, by converting kebab-case and snake_case to individual words and capitalization of each word.
90
- * - _classes (String/Array/Object) - adds classes to all cels in column
91
- * - _style (String/Array/Object) - adds styles to the column header (useful for defining widths)
92
84
  * - sorter (Boolean) - disables sorting of the column when set to false
93
- * - filter (Boolean) - removes filter from column when set to false.
85
+ * - [_props](https://coreui.io/vue/docs/components/table.html#ctableheadercell) (String/Array/Object) - add props to `CTableHeaderCell`.
86
+ * - _style (String/Array/Object) - adds styles to the column header (useful for defining widths)
94
87
  */
95
88
  columns: {
96
89
  type: Array as PropType<Column[] | string[]>,
@@ -102,8 +95,6 @@ const CSmartTable = defineComponent({
102
95
  * Sorter can be customized, by passing prop as object with additional options as keys. Available options:
103
96
  * - external (Boolean) - Disables automatic sorting inside component.
104
97
  * - resetable (Boolean) - If set to true clicking on sorter have three states: ascending, descending and null. That means that third click on sorter will reset sorting, and restore table to original order.
105
- *
106
- * @type boolean | Sorter
107
98
  */
108
99
  columnSorter: {
109
100
  type: [Boolean, Object] as PropType<boolean | Sorter>,
@@ -119,8 +110,6 @@ const CSmartTable = defineComponent({
119
110
  },
120
111
  /**
121
112
  * Set to false to remove table header.
122
- *
123
- * @default true
124
113
  */
125
114
  header: {
126
115
  type: Boolean,
@@ -128,7 +117,11 @@ const CSmartTable = defineComponent({
128
117
  default: true,
129
118
  },
130
119
  /**
131
- * Array of objects, where each object represents one item - row in table. Additionally, you can add style classes to each row by passing them by '_classes' key and to single cell by '_cellClasses'.
120
+ * Array of objects, where each object represents one item - row in table. Additionally, you can customize each row by passing them by [_props](http://coreui.io/vue/docs/components/table.html#ctablerow) key and single cell by [_cellProps](http://coreui.io/vue/docs/components/table.html#ctabledatacell).
121
+ *
122
+ * Examples:
123
+ * - `_props: { color: 'primary', align: 'middle'}`
124
+ * - `_cellProps: { all: { class: 'fw-semibold'}, 'name': { color: 'info' }}`
132
125
  */
133
126
  items: {
134
127
  type: Array as PropType<Item[]>,
@@ -137,8 +130,6 @@ const CSmartTable = defineComponent({
137
130
  },
138
131
  /**
139
132
  * Number of items per site, when pagination is enabled.
140
- *
141
- * @default 10
142
133
  */
143
134
  itemsPerPage: {
144
135
  type: Number,
@@ -146,8 +137,6 @@ const CSmartTable = defineComponent({
146
137
  },
147
138
  /**
148
139
  * Label for items per page selector.
149
- *
150
- * @default 'Items per page:'
151
140
  */
152
141
  itemsPerPageLabel: {
153
142
  type: String,
@@ -156,8 +145,6 @@ const CSmartTable = defineComponent({
156
145
  },
157
146
  /**
158
147
  * Items per page selector options.
159
- *
160
- * @default [5, 10, 20, 50]
161
148
  */
162
149
  itemsPerPageOptions: {
163
150
  type: Array as PropType<number[]>,
@@ -184,7 +171,6 @@ const CSmartTable = defineComponent({
184
171
  },
185
172
  /**
186
173
  * ReactNode or string for passing custom noItemsLabel texts.
187
- * @default 'No items found'
188
174
  */
189
175
  noItemsLabel: {
190
176
  type: String,
@@ -199,9 +185,7 @@ const CSmartTable = defineComponent({
199
185
  required: false,
200
186
  },
201
187
  /**
202
- * Properties to `CSmartPagination` component.
203
- *
204
- * @link https://coreui.io/vue/docs/4.0/components/smart-pagination#csmartpagination
188
+ * Properties to [CSmartPagination](https://coreui.io/vue/docs/components/smart-pagination#csmartpagination) component.
205
189
  */
206
190
  paginationProps: {
207
191
  type: Object,
@@ -213,10 +197,8 @@ const CSmartTable = defineComponent({
213
197
  */
214
198
  selectable: Boolean,
215
199
  /**
216
- * State of the sorter. Name key is column name, direction can be 'asc' or 'desc'. Set .sync modifier to track changes. eg.:
200
+ * State of the sorter. Name key is column name, direction can be 'asc' or 'desc'. eg.:
217
201
  * { column: 'status', state: 'asc' }
218
- *
219
- * @type SorterValue
220
202
  */
221
203
  sorterValue: {
222
204
  type: Object as PropType<SorterValue>,
@@ -224,9 +206,7 @@ const CSmartTable = defineComponent({
224
206
  required: false,
225
207
  },
226
208
  /**
227
- * Properties to `CTableBody` component.
228
- *
229
- * @link https://coreui.io/vue/docs/4.0/components/table/#ctablebody
209
+ * Properties to [CTableBody](https://coreui.io/vue/docs/components/table/#ctablebody) component.
230
210
  */
231
211
  tableBodyProps: {
232
212
  type: Object,
@@ -234,9 +214,7 @@ const CSmartTable = defineComponent({
234
214
  required: false,
235
215
  },
236
216
  /**
237
- * Properties to `CTableFoot` component.
238
- *
239
- * @link https://coreui.io/vue/docs/4.0/components/table/#ctablefoot
217
+ * Properties to [CTableFoot](https://coreui.io/vue/docs/components/table/#ctablefoot) component.
240
218
  */
241
219
  tableFootProps: {
242
220
  type: Object,
@@ -247,8 +225,6 @@ const CSmartTable = defineComponent({
247
225
  * When set, displays table filter above table, allowing filtering by specific column.
248
226
  *
249
227
  * Column filter can be customized, by passing prop as object with additional options as keys. Available options:
250
- * - placeholder (String) - Sets custom table filter placeholder.
251
- * - label (String) - Sets custom table filter label.
252
228
  * - external (Boolean) - Disables automatic filtering inside component.
253
229
  * - lazy (Boolean) - Set to true to trigger filter updates only on change event.
254
230
  */
@@ -266,8 +242,6 @@ const CSmartTable = defineComponent({
266
242
  },
267
243
  /**
268
244
  * Specifies a short hint that is visible in the search input.
269
- *
270
- * @default 'type string...'
271
245
  */
272
246
  tableFilterPlaceholder: {
273
247
  type: String,
@@ -275,9 +249,7 @@ const CSmartTable = defineComponent({
275
249
  required: false,
276
250
  },
277
251
  /**
278
- * Value of table filter. Set .sync modifier to track changes.
279
- *
280
- * @default 'Filter:'
252
+ * Value of table filter.
281
253
  */
282
254
  tableFilterValue: {
283
255
  type: String,
@@ -285,9 +257,7 @@ const CSmartTable = defineComponent({
285
257
  required: false,
286
258
  },
287
259
  /**
288
- * Properties to `CTableHead` component.
289
- *
290
- * @link https://coreui.io/vue/docs/4.0/components/table/#ctablehead
260
+ * Properties to [CTableHead](https://coreui.io/vue/docs/components/table/#ctablehead) component.
291
261
  */
292
262
  tableHeadProps: {
293
263
  type: Object,
@@ -295,9 +265,7 @@ const CSmartTable = defineComponent({
295
265
  required: false,
296
266
  },
297
267
  /**
298
- * Properties to `CTable` component.
299
- *
300
- * @link https://coreui.io/vue/docs/4.0/components/table/#ctable
268
+ * Properties to [CTable](https://coreui.io/vue/docs/components/table/#ctable) component.
301
269
  */
302
270
  tableProps: {
303
271
  type: Object,
@@ -4,10 +4,10 @@
4
4
  /* eslint-disable no-unused-vars */
5
5
  /* eslint-disable @typescript-eslint/ban-types */
6
6
  export interface Column {
7
- sorter?: boolean
7
+ filter?: boolean
8
8
  key: string
9
9
  label?: string
10
- filter?: boolean
10
+ sorter?: boolean
11
11
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
12
12
  _style?: any
13
13
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -53,9 +53,11 @@ export interface SorterValue {
53
53
  }
54
54
 
55
55
  export interface TableFilter {
56
- lazy?: boolean
57
56
  external?: boolean
57
+ lazy?: boolean
58
+ // TODO: depracated, remove in v5
58
59
  label?: string
60
+ // TODO: depracated, remove in v5
59
61
  placeholder?: string
60
62
  }
61
63