@coreui/vue-pro 4.3.1 → 4.4.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.
Files changed (120) hide show
  1. package/dist/components/accordion/CAccordion.d.ts +1 -1
  2. package/dist/components/accordion/CAccordionBody.d.ts +1 -1
  3. package/dist/components/accordion/CAccordionButton.d.ts +1 -1
  4. package/dist/components/accordion/CAccordionHeader.d.ts +1 -1
  5. package/dist/components/accordion/CAccordionItem.d.ts +1 -1
  6. package/dist/components/alert/CAlertHeading.d.ts +1 -1
  7. package/dist/components/alert/CAlertLink.d.ts +1 -1
  8. package/dist/components/avatar/CAvatar.d.ts +1 -1
  9. package/dist/components/backdrop/CBackdrop.d.ts +1 -1
  10. package/dist/components/badge/CBadge.d.ts +1 -1
  11. package/dist/components/breadcrumb/CBreadcrumb.d.ts +1 -1
  12. package/dist/components/breadcrumb/CBreadcrumbItem.d.ts +1 -1
  13. package/dist/components/button-group/CButtonGroup.d.ts +1 -1
  14. package/dist/components/button-group/CButtonToolbar.d.ts +1 -1
  15. package/dist/components/callout/CCallout.d.ts +1 -1
  16. package/dist/components/card/CCard.d.ts +1 -1
  17. package/dist/components/card/CCardBody.d.ts +1 -1
  18. package/dist/components/card/CCardFooter.d.ts +1 -1
  19. package/dist/components/card/CCardGroup.d.ts +1 -1
  20. package/dist/components/card/CCardHeader.d.ts +1 -1
  21. package/dist/components/card/CCardImage.d.ts +1 -1
  22. package/dist/components/card/CCardImageOverlay.d.ts +1 -1
  23. package/dist/components/card/CCardLink.d.ts +1 -1
  24. package/dist/components/card/CCardSubtitle.d.ts +1 -1
  25. package/dist/components/card/CCardText.d.ts +1 -1
  26. package/dist/components/card/CCardTitle.d.ts +1 -1
  27. package/dist/components/carousel/CCarousel.d.ts +1 -1
  28. package/dist/components/carousel/CCarouselCaption.d.ts +1 -1
  29. package/dist/components/carousel/CCarouselItem.d.ts +1 -1
  30. package/dist/components/date-picker/CDatePicker.d.ts +4 -2
  31. package/dist/components/date-range-picker/CDateRangePicker.d.ts +7 -2
  32. package/dist/components/dropdown/CDropdown.d.ts +2 -2
  33. package/dist/components/dropdown/CDropdownDivider.d.ts +1 -1
  34. package/dist/components/dropdown/CDropdownHeader.d.ts +1 -1
  35. package/dist/components/dropdown/CDropdownItem.d.ts +1 -1
  36. package/dist/components/dropdown/CDropdownMenu.d.ts +1 -1
  37. package/dist/components/dropdown/CDropdownToggle.d.ts +1 -1
  38. package/dist/components/element-cover/CElementCover.d.ts +1 -1
  39. package/dist/components/footer/CFooter.d.ts +1 -1
  40. package/dist/components/form/CForm.d.ts +1 -1
  41. package/dist/components/form/CFormControl.d.ts +1 -1
  42. package/dist/components/form/CFormControlValidation.d.ts +1 -1
  43. package/dist/components/form/CFormControlWrapper.d.ts +1 -1
  44. package/dist/components/form/CFormFeedback.d.ts +1 -1
  45. package/dist/components/form/CFormFloating.d.ts +1 -1
  46. package/dist/components/form/CFormLabel.d.ts +1 -1
  47. package/dist/components/form/CFormText.d.ts +1 -1
  48. package/dist/components/form/CInputGroup.d.ts +1 -1
  49. package/dist/components/form/CInputGroupText.d.ts +1 -1
  50. package/dist/components/grid/CCol.d.ts +1 -1
  51. package/dist/components/grid/CContainer.d.ts +1 -1
  52. package/dist/components/grid/CRow.d.ts +1 -1
  53. package/dist/components/header/CHeader.d.ts +1 -1
  54. package/dist/components/header/CHeaderBrand.d.ts +1 -1
  55. package/dist/components/header/CHeaderDivider.d.ts +1 -1
  56. package/dist/components/header/CHeaderNav.d.ts +1 -1
  57. package/dist/components/header/CHeaderText.d.ts +1 -1
  58. package/dist/components/header/CHeaderToggler.d.ts +1 -1
  59. package/dist/components/image/CImage.d.ts +1 -1
  60. package/dist/components/list-group/CListGroup.d.ts +1 -1
  61. package/dist/components/list-group/CListGroupItem.d.ts +1 -1
  62. package/dist/components/modal/CModalBody.d.ts +1 -1
  63. package/dist/components/modal/CModalFooter.d.ts +1 -1
  64. package/dist/components/modal/CModalHeader.d.ts +1 -1
  65. package/dist/components/modal/CModalTitle.d.ts +1 -1
  66. package/dist/components/nav/CNav.d.ts +1 -1
  67. package/dist/components/nav/CNavGroupItems.d.ts +1 -1
  68. package/dist/components/nav/CNavItem.d.ts +1 -1
  69. package/dist/components/nav/CNavLink.d.ts +1 -1
  70. package/dist/components/nav/CNavTitle.d.ts +1 -1
  71. package/dist/components/navbar/CNavbar.d.ts +1 -1
  72. package/dist/components/navbar/CNavbarBrand.d.ts +1 -1
  73. package/dist/components/navbar/CNavbarNav.d.ts +1 -1
  74. package/dist/components/navbar/CNavbarText.d.ts +1 -1
  75. package/dist/components/navbar/CNavbarToggler.d.ts +1 -1
  76. package/dist/components/offcanvas/COffcanvasBody.d.ts +1 -1
  77. package/dist/components/offcanvas/COffcanvasHeader.d.ts +1 -1
  78. package/dist/components/offcanvas/COffcanvasTitle.d.ts +1 -1
  79. package/dist/components/pagination/CPagination.d.ts +1 -1
  80. package/dist/components/pagination/CPaginationItem.d.ts +1 -1
  81. package/dist/components/placeholder/CPlaceholder.d.ts +1 -1
  82. package/dist/components/progress/CProgress.d.ts +1 -1
  83. package/dist/components/progress/CProgressBar.d.ts +1 -1
  84. package/dist/components/sidebar/CSidebarBrand.d.ts +1 -1
  85. package/dist/components/sidebar/CSidebarFooter.d.ts +1 -1
  86. package/dist/components/sidebar/CSidebarHeader.d.ts +1 -1
  87. package/dist/components/sidebar/CSidebarNav.d.ts +1 -1
  88. package/dist/components/sidebar/CSidebarToggler.d.ts +1 -1
  89. package/dist/components/spinner/CSpinner.d.ts +1 -1
  90. package/dist/components/table/CTable.d.ts +20 -1
  91. package/dist/components/table/CTableBody.d.ts +1 -1
  92. package/dist/components/table/CTableCaption.d.ts +1 -1
  93. package/dist/components/table/CTableDataCell.d.ts +1 -1
  94. package/dist/components/table/CTableFoot.d.ts +1 -1
  95. package/dist/components/table/CTableHead.d.ts +1 -1
  96. package/dist/components/table/CTableHeaderCell.d.ts +1 -1
  97. package/dist/components/table/CTableRow.d.ts +1 -1
  98. package/dist/components/tabs/CTabContent.d.ts +1 -1
  99. package/dist/components/toast/CToastBody.d.ts +1 -1
  100. package/dist/components/toast/CToaster.d.ts +1 -1
  101. package/dist/components/widgets/CWidgetStatsA.d.ts +1 -1
  102. package/dist/components/widgets/CWidgetStatsB.d.ts +9 -4
  103. package/dist/components/widgets/CWidgetStatsC.d.ts +9 -4
  104. package/dist/components/widgets/CWidgetStatsD.d.ts +1 -1
  105. package/dist/components/widgets/CWidgetStatsE.d.ts +1 -1
  106. package/dist/components/widgets/CWidgetStatsF.d.ts +1 -1
  107. package/dist/index.es.js +2783 -1398
  108. package/dist/index.es.js.map +1 -1
  109. package/dist/index.js +2783 -1398
  110. package/dist/index.js.map +1 -1
  111. package/package.json +11 -11
  112. package/src/components/date-picker/CDatePicker.ts +4 -1
  113. package/src/components/date-range-picker/CDateRangePicker.ts +11 -3
  114. package/src/components/dropdown/CDropdown.ts +18 -3
  115. package/src/components/modal/CModal.ts +4 -0
  116. package/src/components/sidebar/CSidebar.ts +2 -3
  117. package/src/components/smart-table/CSmartTableHead.ts +1 -1
  118. package/src/components/table/CTable.ts +10 -0
  119. package/src/components/time-picker/CTimePicker.ts +1 -0
  120. package/src/components/accordion/CAccordionCollapse.ts +0 -28
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coreui/vue-pro",
3
- "version": "4.3.1",
3
+ "version": "4.4.1",
4
4
  "description": "UI Components Library for Vue.js",
5
5
  "keywords": [
6
6
  "vue",
@@ -35,23 +35,23 @@
35
35
  "watch": "rollup -c -w"
36
36
  },
37
37
  "config": {
38
- "version_short": "4.2"
38
+ "version_short": "4.4"
39
39
  },
40
40
  "devDependencies": {
41
- "@popperjs/core": "^2.11.5",
42
- "@rollup/plugin-commonjs": "^22.0.1",
41
+ "@popperjs/core": "^2.11.6",
42
+ "@rollup/plugin-commonjs": "^22.0.2",
43
43
  "@rollup/plugin-node-resolve": "^13.3.0",
44
- "@rollup/plugin-typescript": "^8.3.3",
44
+ "@rollup/plugin-typescript": "^8.5.0",
45
45
  "@vue/test-utils": "^2.0.2",
46
- "date-fns": "^2.29.1",
47
- "rollup": "^2.77.2",
46
+ "date-fns": "^2.29.3",
47
+ "rollup": "^2.79.0",
48
48
  "rollup-plugin-vue": "^6.0.0",
49
- "typescript": "^4.7.4",
50
- "vue": "^3.2.37",
51
- "vue-types": "^4.2.0"
49
+ "typescript": "^4.8.3",
50
+ "vue": "^3.2.39",
51
+ "vue-types": "^4.2.1"
52
52
  },
53
53
  "peerDependencies": {
54
- "@coreui/coreui-pro": "^4.3.2",
54
+ "@coreui/coreui-pro": "^4.3.4",
55
55
  "vue": "^3.2.21"
56
56
  },
57
57
  "standard": {
@@ -225,9 +225,12 @@ const CDatePicker = defineComponent({
225
225
  },
226
226
  },
227
227
  },
228
- emit: [
228
+ emits: [
229
229
  /**
230
230
  * Callback fired when the date changed.
231
+ *
232
+ * @property {Date} date - date object
233
+ * @property {string} formatedDate - formated date
231
234
  */
232
235
  'date-change',
233
236
  ],
@@ -308,9 +308,12 @@ const CDateRangePicker = defineComponent({
308
308
  },
309
309
  },
310
310
  },
311
- emit: [
311
+ emits: [
312
312
  /**
313
313
  * Callback fired when the end date changed.
314
+ *
315
+ * @property {Date} date - date object
316
+ * @property {string} formatedDate - formated date
314
317
  */
315
318
  'end-date-change',
316
319
  /**
@@ -323,6 +326,9 @@ const CDateRangePicker = defineComponent({
323
326
  'show',
324
327
  /**
325
328
  * Callback fired when the start date changed.
329
+ *
330
+ * @property {Date} date - date object
331
+ * @property {string} formatedDate - formated date
326
332
  */
327
333
  'start-date-change',
328
334
  ],
@@ -458,11 +464,12 @@ const CDateRangePicker = defineComponent({
458
464
  },
459
465
  () => [
460
466
  h(CFormInput, {
467
+ autocomplete: 'off',
461
468
  class: {
462
469
  hover: inputStartHoverValue.value,
463
470
  },
464
471
  disabled: props.disabled,
465
- name: props.range ? `${props.id}-start-date` : `${props.id}-date`,
472
+ ...(props.id && { name: props.range ? `${props.id}-start-date` : `${props.id}-date` }),
466
473
  onClick: () => {
467
474
  selectEndDate.value = false
468
475
  },
@@ -494,11 +501,12 @@ const CDateRangePicker = defineComponent({
494
501
  ),
495
502
  props.range &&
496
503
  h(CFormInput, {
504
+ autocomplete: 'off',
497
505
  class: {
498
506
  hover: inputEndHoverValue.value,
499
507
  },
500
508
  disabled: props.disabled,
501
- name: `${props.id}-end-date`,
509
+ ...(props.id && { name: `${props.id}-end-date` }),
502
510
  onClick: () => {
503
511
  selectEndDate.value = true
504
512
  },
@@ -64,14 +64,14 @@ const CDropdown = defineComponent({
64
64
  /**
65
65
  * Sets a specified direction and location of the dropdown menu.
66
66
  *
67
- * @values 'dropup', 'dropend', 'dropstart'
67
+ * @values 'center', 'dropup', 'dropup-center', 'dropend', 'dropstart'
68
68
  */
69
69
  direction: {
70
70
  type: String,
71
71
  default: undefined,
72
72
  required: false,
73
73
  validator: (value: string) => {
74
- return ['dropup', 'dropend', 'dropstart'].includes(value)
74
+ return ['center', 'dropup', 'dropup-center', 'dropend', 'dropstart'].includes(value)
75
75
  },
76
76
  },
77
77
  /**
@@ -164,15 +164,26 @@ const CDropdown = defineComponent({
164
164
  provide('dropdownToggleRef', dropdownToggleRef)
165
165
  provide('dropdownMenuRef', dropdownMenuRef)
166
166
 
167
+ if (props.direction === 'center') {
168
+ placement.value = 'bottom'
169
+ }
170
+
167
171
  if (props.direction === 'dropup') {
168
172
  placement.value = 'top-start'
169
173
  }
174
+
175
+ if (props.direction === 'dropup-center') {
176
+ placement.value = 'top'
177
+ }
178
+
170
179
  if (props.direction === 'dropend') {
171
180
  placement.value = 'right-start'
172
181
  }
182
+
173
183
  if (props.direction === 'dropstart') {
174
184
  placement.value = 'left-start'
175
185
  }
186
+
176
187
  if (props.alignment === 'end') {
177
188
  placement.value = 'bottom-end'
178
189
  }
@@ -240,7 +251,11 @@ const CDropdown = defineComponent({
240
251
  {
241
252
  class: [
242
253
  props.variant === 'nav-item' ? 'nav-item dropdown' : props.variant,
243
- props.direction,
254
+ props.direction === 'center'
255
+ ? 'dropdown-center'
256
+ : props.direction === 'dropup-center'
257
+ ? 'dropup dropup-center'
258
+ : props.direction,
244
259
  ],
245
260
  },
246
261
  slots.default && slots.default(),
@@ -145,6 +145,8 @@ const CModal = defineComponent({
145
145
  const handleEnter = (el: RendererElement, done: () => void) => {
146
146
  executeAfterTransition(() => done(), el as HTMLElement)
147
147
  document.body.classList.add('modal-open')
148
+ document.body.style.overflow = 'hidden'
149
+ document.body.style.paddingRight = '0px'
148
150
  el.style.display = 'block'
149
151
  setTimeout(() => {
150
152
  el.classList.add('show')
@@ -160,6 +162,8 @@ const CModal = defineComponent({
160
162
  const handleLeave = (el: RendererElement, done: () => void) => {
161
163
  executeAfterTransition(() => done(), el as HTMLElement)
162
164
  document.body.classList.remove('modal-open')
165
+ document.body.style.removeProperty('overflow')
166
+ document.body.style.removeProperty('padding-right')
163
167
  if (document.body.className === '') {
164
168
  document.body.removeAttribute('class')
165
169
  }
@@ -144,6 +144,7 @@ const CSidebar = defineComponent({
144
144
 
145
145
  const handleHide = () => {
146
146
  visible.value = false
147
+ emit('visible-change', false)
147
148
  }
148
149
 
149
150
  const handleResize = () => {
@@ -198,9 +199,7 @@ const CSidebar = defineComponent({
198
199
  h(CBackdrop, {
199
200
  class: 'sidebar-backdrop d-none',
200
201
  visible: props.visible,
201
- onClick: () => {
202
- visible.value = false
203
- },
202
+ onClick: () => handleHide(),
204
203
  }),
205
204
  ]
206
205
  },
@@ -75,7 +75,7 @@ const CSmartTableHead = defineComponent({
75
75
  style.cursor = 'pointer'
76
76
  }
77
77
 
78
- if (typeof column === 'object' && column._props) {
78
+ if (typeof column === 'object' && column._style) {
79
79
  return { ...style, ...column._style }
80
80
  }
81
81
  return style
@@ -97,6 +97,15 @@ const CTable = defineComponent({
97
97
  type: Boolean,
98
98
  required: false,
99
99
  },
100
+ /**
101
+ * Add zebra-striping to any table column.
102
+ *
103
+ * @since 4.4.0
104
+ */
105
+ stripedColumns: {
106
+ type: Boolean,
107
+ required: false,
108
+ },
100
109
  },
101
110
  setup(props, { slots, attrs }) {
102
111
  const table = () =>
@@ -115,6 +124,7 @@ const CTable = defineComponent({
115
124
  'table-hover': props.hover,
116
125
  'table-sm': props.small,
117
126
  'table-striped': props.striped,
127
+ 'table-striped-columns': props.stripedColumns,
118
128
  },
119
129
  attrs.class,
120
130
  ],
@@ -238,6 +238,7 @@ const CTimePicker = defineComponent({
238
238
  const InputGroup = () =>
239
239
  h(CInputGroup, { class: 'picker-input-group', size: props.size }, () => [
240
240
  h(CFormInput, {
241
+ autocomplete: 'off',
241
242
  disabled: props.disabled,
242
243
  onInput: (event) => {
243
244
  if (isValidTime(event.target.value)) {
@@ -1,28 +0,0 @@
1
- import { defineComponent, h } from 'vue'
2
- import { CCollapse } from '../collapse/CCollapse'
3
-
4
- const CAccordionCollapse = defineComponent({
5
- name: 'CAccordionCollapse',
6
- props: {
7
- /**
8
- * Toggle the visibility of component.
9
- */
10
- visible: {
11
- type: Boolean,
12
- required: false,
13
- },
14
- },
15
- setup(props, { slots }) {
16
- return () =>
17
- h(
18
- CCollapse,
19
- {
20
- class: 'accordion-collapse',
21
- visible: props.visible,
22
- },
23
- slots.default && slots.default(),
24
- )
25
- },
26
- })
27
-
28
- export { CAccordionCollapse }