@coreui/vue-pro 4.1.1 → 4.1.2
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 +1 -1
- package/dist/components/accordion/CAccordion.d.ts +18 -10
- package/dist/components/accordion/CAccordionBody.d.ts +1 -1
- package/dist/components/accordion/CAccordionButton.d.ts +1 -1
- package/dist/components/accordion/CAccordionCollapse.d.ts +9 -5
- package/dist/components/accordion/CAccordionHeader.d.ts +1 -1
- package/dist/components/accordion/CAccordionItem.d.ts +10 -5
- package/dist/components/alert/CAlert.d.ts +38 -12
- package/dist/components/alert/CAlertHeading.d.ts +10 -5
- package/dist/components/alert/CAlertLink.d.ts +1 -1
- package/dist/components/avatar/CAvatar.d.ts +59 -15
- package/dist/components/backdrop/CBackdrop.d.ts +10 -5
- package/dist/components/badge/CBadge.d.ts +59 -16
- package/dist/components/breadcrumb/CBreadcrumb.d.ts +1 -1
- package/dist/components/breadcrumb/CBreadcrumbItem.d.ts +17 -8
- package/dist/components/button/CButton.d.ts +73 -20
- package/dist/components/button-group/CButtonGroup.d.ts +20 -8
- package/dist/components/button-group/CButtonToolbar.d.ts +1 -1
- package/dist/components/callout/CCallout.d.ts +11 -5
- package/dist/components/card/CCard.d.ts +20 -7
- package/dist/components/card/CCardBody.d.ts +1 -1
- package/dist/components/card/CCardFooter.d.ts +1 -1
- package/dist/components/card/CCardGroup.d.ts +1 -1
- package/dist/components/card/CCardHeader.d.ts +10 -5
- package/dist/components/card/CCardImage.d.ts +21 -8
- package/dist/components/card/CCardImageOverlay.d.ts +1 -1
- package/dist/components/card/CCardLink.d.ts +10 -5
- package/dist/components/card/CCardSubtitle.d.ts +10 -5
- package/dist/components/card/CCardText.d.ts +10 -5
- package/dist/components/card/CCardTitle.d.ts +10 -5
- package/dist/components/carousel/CCarousel.d.ts +58 -19
- package/dist/components/carousel/CCarouselCaption.d.ts +1 -1
- package/dist/components/carousel/CCarouselItem.d.ts +25 -9
- package/dist/components/close-button/CCloseButton.d.ts +16 -7
- package/dist/components/collapse/CCollapse.d.ts +16 -7
- package/dist/components/dropdown/CDropdown.d.ts +82 -22
- package/dist/components/dropdown/CDropdownDivider.d.ts +1 -1
- package/dist/components/dropdown/CDropdownHeader.d.ts +10 -5
- package/dist/components/dropdown/CDropdownItem.d.ts +32 -12
- package/dist/components/dropdown/CDropdownMenu.d.ts +12 -5
- package/dist/components/dropdown/CDropdownToggle.d.ts +78 -22
- package/dist/components/element-cover/CElementCover.d.ts +22 -7
- package/dist/components/footer/CFooter.d.ts +13 -5
- package/dist/components/form/CForm.d.ts +9 -5
- package/dist/components/form/CFormCheck.d.ts +66 -23
- package/dist/components/form/CFormControl.d.ts +61 -20
- package/dist/components/form/CFormFeedback.d.ts +22 -11
- package/dist/components/form/CFormFloating.d.ts +1 -1
- package/dist/components/form/CFormInput.d.ts +66 -20
- package/dist/components/form/CFormLabel.d.ts +10 -5
- package/dist/components/form/CFormRange.d.ts +59 -18
- package/dist/components/form/CFormSelect.d.ts +66 -18
- package/dist/components/form/CFormSwitch.d.ts +61 -18
- package/dist/components/form/CFormText.d.ts +10 -5
- package/dist/components/form/CFormTextarea.d.ts +45 -16
- package/dist/components/form/CInputGroup.d.ts +13 -5
- package/dist/components/form/CInputGroupText.d.ts +10 -5
- package/dist/components/grid/CCol.d.ts +62 -15
- package/dist/components/grid/CContainer.d.ts +44 -15
- package/dist/components/grid/CRow.d.ts +57 -15
- package/dist/components/header/CHeader.d.ts +24 -7
- package/dist/components/header/CHeaderBrand.d.ts +10 -5
- package/dist/components/header/CHeaderDivider.d.ts +1 -1
- package/dist/components/header/CHeaderNav.d.ts +10 -5
- package/dist/components/header/CHeaderText.d.ts +1 -1
- package/dist/components/header/CHeaderToggler.d.ts +1 -1
- package/dist/components/image/CImage.d.ts +34 -12
- package/dist/components/link/CLink.d.ts +32 -12
- package/dist/components/list-group/CListGroup.d.ts +28 -10
- package/dist/components/list-group/CListGroupItem.d.ts +33 -12
- package/dist/components/modal/CModal.d.ts +96 -22
- package/dist/components/modal/CModalBody.d.ts +1 -1
- package/dist/components/modal/CModalFooter.d.ts +1 -1
- package/dist/components/modal/CModalHeader.d.ts +10 -5
- package/dist/components/modal/CModalTitle.d.ts +10 -5
- package/dist/components/multi-select/CMultiSelect.d.ts +131 -30
- package/dist/components/multi-select/CMultiSelectNativeSelect.d.ts +26 -11
- package/dist/components/multi-select/CMultiSelectOptions.d.ts +40 -11
- package/dist/components/multi-select/CMultiSelectSelection.d.ts +47 -13
- package/dist/components/nav/CNav.d.ts +32 -10
- package/dist/components/nav/CNavGroup.d.ts +10 -7
- package/dist/components/nav/CNavGroupItems.d.ts +1 -1
- package/dist/components/nav/CNavLink.d.ts +32 -12
- package/dist/components/nav/CNavTitle.d.ts +1 -1
- package/dist/components/navbar/CNavbar.d.ts +63 -16
- package/dist/components/navbar/CNavbarBrand.d.ts +19 -8
- package/dist/components/navbar/CNavbarNav.d.ts +10 -5
- package/dist/components/navbar/CNavbarText.d.ts +1 -1
- package/dist/components/navbar/CNavbarToggler.d.ts +1 -1
- package/dist/components/offcanvas/COffcanvas.d.ts +44 -14
- package/dist/components/offcanvas/COffcanvasBody.d.ts +1 -1
- package/dist/components/offcanvas/COffcanvasHeader.d.ts +1 -1
- package/dist/components/offcanvas/COffcanvasTitle.d.ts +10 -5
- package/dist/components/pagination/CPagination.d.ts +24 -7
- package/dist/components/pagination/CPaginationItem.d.ts +32 -12
- package/dist/components/pagination/CSmartPagination.d.ts +120 -28
- package/dist/components/placeholder/CPlaceholder.d.ts +89 -24
- package/dist/components/popover/CPopover.d.ts +50 -16
- package/dist/components/progress/CProgressBar.d.ts +37 -12
- package/dist/components/sidebar/CSidebar.d.ts +59 -20
- package/dist/components/sidebar/CSidebarBrand.d.ts +1 -1
- package/dist/components/sidebar/CSidebarFooter.d.ts +1 -1
- package/dist/components/sidebar/CSidebarHeader.d.ts +1 -1
- package/dist/components/sidebar/CSidebarNav.d.ts +1 -1
- package/dist/components/sidebar/CSidebarToggler.d.ts +1 -1
- package/dist/components/smart-table/CSmartTable.d.ts +278 -60
- package/dist/components/smart-table/CSmartTableBody.d.ts +37 -20
- package/dist/components/smart-table/CSmartTableCleaner.d.ts +7 -5
- package/dist/components/smart-table/CSmartTableFilter.d.ts +17 -9
- package/dist/components/smart-table/CSmartTableHead.d.ts +37 -22
- package/dist/components/smart-table/CSmartTableItemsPerPageSelector.d.ts +17 -10
- package/dist/components/spinner/CSpinner.d.ts +51 -14
- package/dist/components/table/CTable.d.ts +88 -24
- package/dist/components/table/CTableBody.d.ts +11 -5
- package/dist/components/table/CTableCaption.d.ts +2 -4
- package/dist/components/table/CTableDataCell.d.ts +29 -10
- package/dist/components/table/CTableFoot.d.ts +11 -5
- package/dist/components/table/CTableHead.d.ts +11 -5
- package/dist/components/table/CTableHeaderCell.d.ts +11 -5
- package/dist/components/table/CTableRow.d.ts +29 -10
- package/dist/components/tabs/CTabContent.d.ts +1 -1
- package/dist/components/tabs/CTabPane.d.ts +10 -5
- package/dist/components/toast/CToast.d.ts +59 -18
- package/dist/components/toast/CToastBody.d.ts +1 -1
- package/dist/components/toast/CToastHeader.d.ts +9 -5
- package/dist/components/toast/CToaster.d.ts +13 -5
- package/dist/components/tooltip/CTooltip.d.ts +42 -14
- package/dist/components/widgets/CWidgetStatsA.d.ts +23 -10
- package/dist/components/widgets/CWidgetStatsB.d.ts +45 -17
- package/dist/components/widgets/CWidgetStatsC.d.ts +37 -15
- package/dist/components/widgets/CWidgetStatsD.d.ts +19 -8
- package/dist/components/widgets/CWidgetStatsE.d.ts +18 -8
- package/dist/components/widgets/CWidgetStatsF.d.ts +42 -14
- package/dist/index.es.js +81 -39
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +80 -38
- package/dist/index.js.map +1 -1
- package/package.json +5 -5
- package/src/components/form/CFormSelect.ts +19 -6
- package/src/components/form/__tests__/__snapshots__/CFormCheck.spec.ts.snap +8 -2
- package/src/components/form/__tests__/__snapshots__/CFormSelect.spec.ts.snap +1 -1
- package/src/components/modal/CModal.ts +60 -37
- package/src/components/modal/__tests__/__snapshots__/CModal.spec.ts.snap +1 -2
- package/src/components/sidebar/__tests__/__snapshots__/CSidebar.spec.ts.snap +2 -8
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coreui/vue-pro",
|
|
3
|
-
"version": "4.1.
|
|
3
|
+
"version": "4.1.2",
|
|
4
4
|
"description": "UI Components Library for Vue.js",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"vue",
|
|
@@ -38,14 +38,14 @@
|
|
|
38
38
|
"version_short": "4.1"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"@popperjs/core": "^2.11.
|
|
41
|
+
"@popperjs/core": "^2.11.2",
|
|
42
42
|
"@rollup/plugin-commonjs": "^21.0.1",
|
|
43
|
-
"@rollup/plugin-node-resolve": "^13.
|
|
43
|
+
"@rollup/plugin-node-resolve": "^13.1.3",
|
|
44
44
|
"@rollup/plugin-typescript": "^8.3.0",
|
|
45
45
|
"@vue/test-utils": "^2.0.0-0",
|
|
46
|
-
"rollup": "^2.
|
|
46
|
+
"rollup": "^2.66.0",
|
|
47
47
|
"rollup-plugin-vue": "^6.0.0",
|
|
48
|
-
"typescript": "^4.5.
|
|
48
|
+
"typescript": "^4.5.5",
|
|
49
49
|
"vue": "^3.2.24",
|
|
50
50
|
"vue-types": "^4.1.1"
|
|
51
51
|
},
|
|
@@ -3,6 +3,7 @@ import { defineComponent, h, PropType } from 'vue'
|
|
|
3
3
|
type Option = {
|
|
4
4
|
disabled?: boolean
|
|
5
5
|
label?: string
|
|
6
|
+
selected?: boolean
|
|
6
7
|
value?: string
|
|
7
8
|
}
|
|
8
9
|
|
|
@@ -28,10 +29,14 @@ const CFormSelect = defineComponent({
|
|
|
28
29
|
* The default name for a value passed using v-model.
|
|
29
30
|
*/
|
|
30
31
|
modelValue: {
|
|
31
|
-
type: String,
|
|
32
|
+
type: [String, Array] as PropType<string | string[]>,
|
|
32
33
|
default: undefined,
|
|
33
34
|
require: false,
|
|
34
35
|
},
|
|
36
|
+
multiple: {
|
|
37
|
+
type: Boolean,
|
|
38
|
+
required: false,
|
|
39
|
+
},
|
|
35
40
|
/**
|
|
36
41
|
* Options list of the select component. Available keys: `label`, `value`, `disabled`.
|
|
37
42
|
* Examples:
|
|
@@ -80,9 +85,8 @@ const CFormSelect = defineComponent({
|
|
|
80
85
|
const selected = Array.from(target.options)
|
|
81
86
|
.filter((option) => option.selected)
|
|
82
87
|
.map((option) => option.value)
|
|
83
|
-
const value = target.multiple ? selected : selected[0]
|
|
84
88
|
emit('change', event)
|
|
85
|
-
emit('update:modelValue',
|
|
89
|
+
emit('update:modelValue', target.multiple ? selected : selected[0])
|
|
86
90
|
}
|
|
87
91
|
|
|
88
92
|
return () =>
|
|
@@ -97,17 +101,26 @@ const CFormSelect = defineComponent({
|
|
|
97
101
|
'is-valid': props.valid,
|
|
98
102
|
},
|
|
99
103
|
],
|
|
104
|
+
multiple: props.multiple,
|
|
100
105
|
onChange: (event: InputEvent) => handleChange(event),
|
|
101
106
|
size: props.htmlSize,
|
|
107
|
+
...(props.modelValue && !props.multiple && { value: props.modelValue }),
|
|
102
108
|
},
|
|
103
109
|
props.options
|
|
104
110
|
? props.options.map((option: Option | string) => {
|
|
105
111
|
return h(
|
|
106
112
|
'option',
|
|
107
113
|
{
|
|
108
|
-
...(typeof option === 'object' &&
|
|
109
|
-
option.disabled && { disabled: option.disabled }),
|
|
110
|
-
|
|
114
|
+
...(typeof option === 'object' && {
|
|
115
|
+
...(option.disabled && { disabled: option.disabled }),
|
|
116
|
+
...(option.selected && { selected: option.selected }),
|
|
117
|
+
...(option.value && {
|
|
118
|
+
value: option.value,
|
|
119
|
+
...(props.modelValue &&
|
|
120
|
+
props.multiple &&
|
|
121
|
+
props.modelValue.includes(option.value) && { selected: true }),
|
|
122
|
+
}),
|
|
123
|
+
}),
|
|
111
124
|
},
|
|
112
125
|
typeof option === 'string' ? option : option.label,
|
|
113
126
|
)
|
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
|
-
exports[`Customize with label - CFormCheck component renders correctly 1`] = `
|
|
3
|
+
exports[`Customize with label - CFormCheck component renders correctly 1`] = `
|
|
4
|
+
"<input class=\\"btn-check is-invalid is-valid\\" id=\\"uniqueid\\" type=\\"checkbox\\">
|
|
5
|
+
<label class=\\"btn btn-outline-warning btn-lg rounded-circle\\" for=\\"uniqueid\\">some label</label>"
|
|
6
|
+
`;
|
|
4
7
|
|
|
5
|
-
exports[`Customize with label in slot - CFormCheck component renders correctly 1`] = `
|
|
8
|
+
exports[`Customize with label in slot - CFormCheck component renders correctly 1`] = `
|
|
9
|
+
"<input class=\\"btn-check is-invalid is-valid\\" id=\\"uniqueid\\" type=\\"checkbox\\">
|
|
10
|
+
<label class=\\"btn btn-outline-warning btn-lg rounded-circle\\" for=\\"uniqueid\\">some label</label>"
|
|
11
|
+
`;
|
|
6
12
|
|
|
7
13
|
exports[`Loads and display CFormCheck component renders correctly 1`] = `"<input class=\\"form-check-input\\" type=\\"checkbox\\">"`;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
|
-
exports[`Customize CFormSelect component renders correctly 1`] = `"<select class=\\"form-select form-select-lg\\" size=\\"200\\">Default slot</select>"`;
|
|
3
|
+
exports[`Customize CFormSelect component renders correctly 1`] = `"<select class=\\"form-select form-select-lg is-invalid is-valid\\" size=\\"200\\">Default slot</select>"`;
|
|
4
4
|
|
|
5
5
|
exports[`Loads and display CFormSelect component renders correctly 1`] = `"<select class=\\"form-select\\">Default slot</select>"`;
|
|
@@ -1,4 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
defineComponent,
|
|
3
|
+
h,
|
|
4
|
+
provide,
|
|
5
|
+
ref,
|
|
6
|
+
RendererElement,
|
|
7
|
+
Transition,
|
|
8
|
+
vShow,
|
|
9
|
+
watch,
|
|
10
|
+
withDirectives,
|
|
11
|
+
} from 'vue'
|
|
2
12
|
|
|
3
13
|
import { CBackdrop } from './../backdrop/CBackdrop'
|
|
4
14
|
|
|
@@ -90,6 +100,14 @@ const CModal = defineComponent({
|
|
|
90
100
|
default: true,
|
|
91
101
|
required: false,
|
|
92
102
|
},
|
|
103
|
+
/**
|
|
104
|
+
* By default the component is unmounted after close animation, if you want to keep the component mounted set this property to false.
|
|
105
|
+
*/
|
|
106
|
+
unmountOnClose: {
|
|
107
|
+
type: Boolean,
|
|
108
|
+
default: true,
|
|
109
|
+
required: false,
|
|
110
|
+
},
|
|
93
111
|
/**
|
|
94
112
|
* Toggle the visibility of alert component.
|
|
95
113
|
*/
|
|
@@ -189,52 +207,57 @@ const CModal = defineComponent({
|
|
|
189
207
|
|
|
190
208
|
provide('handleDismiss', handleDismiss)
|
|
191
209
|
|
|
210
|
+
const modal = () =>
|
|
211
|
+
h(
|
|
212
|
+
'div',
|
|
213
|
+
{
|
|
214
|
+
class: [
|
|
215
|
+
'modal',
|
|
216
|
+
{
|
|
217
|
+
['fade']: props.transition,
|
|
218
|
+
},
|
|
219
|
+
attrs.class,
|
|
220
|
+
],
|
|
221
|
+
ref: modalRef,
|
|
222
|
+
},
|
|
223
|
+
h(
|
|
224
|
+
'div',
|
|
225
|
+
{
|
|
226
|
+
class: [
|
|
227
|
+
'modal-dialog',
|
|
228
|
+
{
|
|
229
|
+
'modal-dialog-centered': props.alignment === 'center',
|
|
230
|
+
[`modal-fullscreen-${props.fullscreen}-down`]:
|
|
231
|
+
props.fullscreen && typeof props.fullscreen === 'string',
|
|
232
|
+
'modal-fullscreen': props.fullscreen && typeof props.fullscreen === 'boolean',
|
|
233
|
+
['modal-dialog-scrollable']: props.scrollable,
|
|
234
|
+
[`modal-${props.size}`]: props.size,
|
|
235
|
+
},
|
|
236
|
+
],
|
|
237
|
+
role: 'dialog',
|
|
238
|
+
},
|
|
239
|
+
h(
|
|
240
|
+
'div',
|
|
241
|
+
{ class: ['modal-content', props.contentClassName], ref: modalContentRef },
|
|
242
|
+
slots.default && slots.default(),
|
|
243
|
+
),
|
|
244
|
+
),
|
|
245
|
+
)
|
|
246
|
+
|
|
192
247
|
return () => [
|
|
193
248
|
h(
|
|
194
249
|
Transition,
|
|
195
250
|
{
|
|
251
|
+
css: false,
|
|
196
252
|
onEnter: (el, done) => handleEnter(el, done),
|
|
197
253
|
onAfterEnter: () => handleAfterEnter(),
|
|
198
254
|
onLeave: (el, done) => handleLeave(el, done),
|
|
199
255
|
onAfterLeave: (el) => handleAfterLeave(el),
|
|
200
256
|
},
|
|
201
257
|
() =>
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
{
|
|
206
|
-
class: [
|
|
207
|
-
'modal',
|
|
208
|
-
{
|
|
209
|
-
['fade']: props.transition,
|
|
210
|
-
},
|
|
211
|
-
attrs.class,
|
|
212
|
-
],
|
|
213
|
-
ref: modalRef,
|
|
214
|
-
},
|
|
215
|
-
h(
|
|
216
|
-
'div',
|
|
217
|
-
{
|
|
218
|
-
class: [
|
|
219
|
-
'modal-dialog',
|
|
220
|
-
{
|
|
221
|
-
'modal-dialog-centered': props.alignment === 'center',
|
|
222
|
-
[`modal-fullscreen-${props.fullscreen}-down`]:
|
|
223
|
-
props.fullscreen && typeof props.fullscreen === 'string',
|
|
224
|
-
'modal-fullscreen': props.fullscreen && typeof props.fullscreen === 'boolean',
|
|
225
|
-
['modal-dialog-scrollable']: props.scrollable,
|
|
226
|
-
[`modal-${props.size}`]: props.size,
|
|
227
|
-
},
|
|
228
|
-
],
|
|
229
|
-
role: 'dialog',
|
|
230
|
-
},
|
|
231
|
-
h(
|
|
232
|
-
'div',
|
|
233
|
-
{ class: ['modal-content', props.contentClassName], ref: modalContentRef },
|
|
234
|
-
slots.default && slots.default(),
|
|
235
|
-
),
|
|
236
|
-
),
|
|
237
|
-
),
|
|
258
|
+
props.unmountOnClose
|
|
259
|
+
? visible.value && modal()
|
|
260
|
+
: withDirectives(modal(), [[vShow, visible.value]]),
|
|
238
261
|
),
|
|
239
262
|
props.backdrop &&
|
|
240
263
|
h(CBackdrop, {
|
|
@@ -7,8 +7,7 @@ exports[`Customize CModal component renders correctly 1`] = `
|
|
|
7
7
|
<div class=\\"modal-content bazinga\\">Default slot</div>
|
|
8
8
|
</div>
|
|
9
9
|
</div>
|
|
10
|
-
</transition-stub>
|
|
11
|
-
<!---->"
|
|
10
|
+
</transition-stub>"
|
|
12
11
|
`;
|
|
13
12
|
|
|
14
13
|
exports[`Loads and display CModal component renders correctly 1`] = `
|
|
@@ -1,11 +1,5 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
|
-
exports[`Customize CSidebar component renders correctly 1`] = `
|
|
4
|
-
"<div class=\\"sidebar sidebar-narrow sidebar-overlaid sidebar-fixed sidebar-xl sidebar-narrow-unfoldable\\">Default slot</div>
|
|
5
|
-
<!---->"
|
|
6
|
-
`;
|
|
3
|
+
exports[`Customize CSidebar component renders correctly 1`] = `"<div class=\\"sidebar sidebar-narrow sidebar-overlaid sidebar-fixed sidebar-xl sidebar-narrow-unfoldable\\">Default slot</div>"`;
|
|
7
4
|
|
|
8
|
-
exports[`Loads and display CSidebar component renders correctly 1`] = `
|
|
9
|
-
"<div class=\\"sidebar hide\\">Default slot</div>
|
|
10
|
-
<!---->"
|
|
11
|
-
`;
|
|
5
|
+
exports[`Loads and display CSidebar component renders correctly 1`] = `"<div class=\\"sidebar hide\\">Default slot</div>"`;
|