Skip to content

Commit 49a9c5e

Browse files
Merge branch 'coreui:main' into main
2 parents e26e7fa + 9c7ed6f commit 49a9c5e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+4350
-1716
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646

4747
Several quick start options are available:
4848

49-
- [Download the latest release](https://github.com/coreui/coreui-vue/archive/v4.3.0.zip)
49+
- [Download the latest release](https://github.com/coreui/coreui-vue/archive/v4.3.1.zip)
5050
- Clone the repo: `git clone https://github.com/coreui/coreui-vue.git`
5151
- Install with [npm](https://www.npmjs.com/): `npm install @coreui/vue`
5252
- Install with [yarn](https://yarnpkg.com/): `yarn add @coreui/vue`

jest.config.js

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,19 @@
55
* LICENSE file in the root directory of this source tree.
66
*/
77

8-
"use strict";
8+
'use strict'
99

1010
module.exports = {
11-
moduleFileExtensions: ["tsx", "js", "ts", "json", "vue"],
12-
preset: "ts-jest",
13-
setupFiles: ["jest-canvas-mock"],
14-
testEnvironment: "jsdom",
15-
testPathIgnorePatterns: ["dist/"],
11+
moduleFileExtensions: ['tsx', 'js', 'ts', 'json', 'vue'],
12+
preset: 'ts-jest',
13+
setupFiles: ['jest-canvas-mock'],
14+
testEnvironment: 'jsdom',
15+
testEnvironmentOptions: {
16+
customExportConditions: ['node', 'node-addons'],
17+
},
18+
testPathIgnorePatterns: ['dist/'],
1619
transform: {
17-
".*\\.(ts)$": "ts-jest",
18-
".*\\.(vue)$": "vue-jest",
20+
'.*\\.(ts)$': 'ts-jest',
21+
'.*\\.(vue)$': '@vue/vue3-jest',
1922
},
20-
};
23+
}

lerna.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@
44
"packages/*"
55
],
66
"useWorkspaces": true,
7-
"version": "4.3.0"
7+
"version": "4.3.1"
88
}

package.json

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -20,20 +20,21 @@
2020
"test:update": "jest --coverage --updateSnapshot"
2121
},
2222
"devDependencies": {
23-
"@types/jest": "^27.4.1",
24-
"@typescript-eslint/eslint-plugin": "^5.19.0",
25-
"@typescript-eslint/parser": "^5.19.0",
26-
"@vue/compiler-sfc": "^3.2.33",
23+
"@types/jest": "^28.1.6",
24+
"@typescript-eslint/eslint-plugin": "^5.30.7",
25+
"@typescript-eslint/parser": "^5.30.7",
26+
"@vue/compiler-sfc": "^3.2.37",
2727
"@vue/eslint-config-prettier": "^7.0.0",
28-
"@vue/eslint-config-typescript": "^10.0.0",
29-
"eslint": "8.13.0",
30-
"eslint-plugin-prettier": "^4.0.0",
31-
"eslint-plugin-vue": "^8.6.0",
32-
"jest": "^27.5.1",
33-
"jest-canvas-mock": "^2.3.1",
28+
"@vue/eslint-config-typescript": "^11.0.0",
29+
"@vue/vue3-jest": "28.0.1",
30+
"eslint": "8.20.0",
31+
"eslint-plugin-prettier": "^4.2.1",
32+
"eslint-plugin-vue": "^9.3.0",
33+
"jest": "^28.1.3",
34+
"jest-canvas-mock": "^2.4.0",
35+
"jest-environment-jsdom": "^28.1.3",
3436
"lerna": "^4.0.0",
35-
"prettier": "^2.6.2",
36-
"ts-jest": "^27.1.4",
37-
"vue-jest": "^5.0.0-0"
37+
"prettier": "^2.7.1",
38+
"ts-jest": "^28.0.7"
3839
}
3940
}

packages/coreui-vue-chartjs/package.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,19 +36,19 @@
3636
},
3737
"devDependencies": {
3838
"@coreui/chartjs": "^3.0.0",
39-
"@rollup/plugin-commonjs": "^21.1.0",
40-
"@rollup/plugin-node-resolve": "^13.2.1",
41-
"@rollup/plugin-typescript": "^8.3.2",
39+
"@rollup/plugin-commonjs": "^22.0.1",
40+
"@rollup/plugin-node-resolve": "^13.3.0",
41+
"@rollup/plugin-typescript": "^8.3.3",
4242
"@types/lodash": "^4.14.181",
43-
"@vue/test-utils": "^2.0.0-rc.20",
44-
"chart.js": "^3.7.1",
43+
"@vue/test-utils": "^2.0.2",
44+
"chart.js": "^3.8.2",
4545
"lodash": "^4.17.21",
46-
"rollup": "^2.70.2",
46+
"rollup": "^2.77.0",
4747
"rollup-plugin-peer-deps-external": "^2.2.4",
4848
"rollup-plugin-vue": "^6.0.0",
49-
"typescript": "^4.6.3",
50-
"vue": "^3.2.33",
51-
"vue-types": "^4.1.1"
49+
"typescript": "^4.7.4",
50+
"vue": "^3.2.37",
51+
"vue-types": "^4.2.0"
5252
},
5353
"peerDependencies": {
5454
"@coreui/chartjs": "^3.0.0",

packages/coreui-vue/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646

4747
Several quick start options are available:
4848

49-
- [Download the latest release](https://github.com/coreui/coreui-vue/archive/v4.3.0.zip)
49+
- [Download the latest release](https://github.com/coreui/coreui-vue/archive/v4.3.1.zip)
5050
- Clone the repo: `git clone https://github.com/coreui/coreui-vue.git`
5151
- Install with [npm](https://www.npmjs.com/): `npm install @coreui/vue`
5252
- Install with [yarn](https://yarnpkg.com/): `yarn add @coreui/vue`

packages/coreui-vue/package.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@coreui/vue",
3-
"version": "4.3.0",
3+
"version": "4.3.1",
44
"description": "UI Components Library for Vue.js",
55
"keywords": [
66
"vue",
@@ -38,18 +38,18 @@
3838
},
3939
"devDependencies": {
4040
"@popperjs/core": "^2.11.5",
41-
"@rollup/plugin-commonjs": "^21.1.0",
42-
"@rollup/plugin-node-resolve": "^13.2.1",
43-
"@rollup/plugin-typescript": "^8.3.2",
44-
"@vue/test-utils": "^2.0.0-rc.20",
45-
"rollup": "^2.70.2",
41+
"@rollup/plugin-commonjs": "^22.0.1",
42+
"@rollup/plugin-node-resolve": "^13.3.0",
43+
"@rollup/plugin-typescript": "^8.3.3",
44+
"@vue/test-utils": "^2.0.2",
45+
"rollup": "^2.77.0",
4646
"rollup-plugin-vue": "^6.0.0",
47-
"typescript": "^4.6.3",
48-
"vue": "^3.2.33",
49-
"vue-types": "^4.1.1"
47+
"typescript": "^4.7.4",
48+
"vue": "^3.2.37",
49+
"vue-types": "^4.2.0"
5050
},
5151
"peerDependencies": {
52-
"@coreui/coreui": "^4.1.3",
52+
"@coreui/coreui": "^4.2.0",
5353
"vue": "^3.2.21"
5454
},
5555
"standard": {

packages/coreui-vue/src/components/accordion/CAccordionCollapse.ts

Lines changed: 0 additions & 28 deletions
This file was deleted.

packages/coreui-vue/src/components/accordion/__tests__/CAccordionCollapse.spec.ts

Lines changed: 0 additions & 28 deletions
This file was deleted.

packages/coreui-vue/src/components/accordion/__tests__/__snapshots__/CAccordionCollapse.spec.ts.snap

Lines changed: 0 additions & 7 deletions
This file was deleted.

packages/coreui-vue/src/components/accordion/index.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import { App } from 'vue'
22
import { CAccordion } from './CAccordion'
33
import { CAccordionBody } from './CAccordionBody'
44
import { CAccordionButton } from './CAccordionButton'
5-
import { CAccordionCollapse } from './CAccordionCollapse'
65
import { CAccordionHeader } from './CAccordionHeader'
76
import { CAccordionItem } from './CAccordionItem'
87

@@ -11,7 +10,6 @@ const CAccordionPlugin = {
1110
app.component(CAccordion.name, CAccordion)
1211
app.component(CAccordionBody.name, CAccordionBody)
1312
app.component(CAccordionButton.name, CAccordionButton)
14-
app.component(CAccordionCollapse.name, CAccordionCollapse)
1513
app.component(CAccordionHeader.name, CAccordionHeader)
1614
app.component(CAccordionItem.name, CAccordionItem)
1715
},
@@ -22,7 +20,6 @@ export {
2220
CAccordion,
2321
CAccordionBody,
2422
CAccordionButton,
25-
CAccordionCollapse,
2623
CAccordionHeader,
2724
CAccordionItem,
2825
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Jest Snapshot v1, https://goo.gl/fbAQLP
22

3-
exports[`Customize CCloseButton component renders correctly 1`] = `"<button class=\\"btn btn-close btn-close-white\\" aria-label=\\"Close\\" disabled=\\"\\"></button>"`;
3+
exports[`Customize CCloseButton component renders correctly 1`] = `"<button type=\\"button\\" class=\\"btn btn-close btn-close-white\\" aria-label=\\"Close\\" disabled=\\"\\"></button>"`;
44
5-
exports[`Loads and display CCloseButton component renders correctly 1`] = `"<button class=\\"btn btn-close\\" aria-label=\\"Close\\"></button>"`;
5+
exports[`Loads and display CCloseButton component renders correctly 1`] = `"<button type=\\"button\\" class=\\"btn btn-close\\" aria-label=\\"Close\\"></button>"`;

packages/coreui-vue/src/components/form/CFormCheck.ts

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -132,16 +132,14 @@ const CFormCheck = defineComponent({
132132
attrs.class,
133133
]
134134

135-
const inputClassName = props.button
136-
? 'btn-check'
137-
: [
138-
'form-check-input',
139-
{
140-
'is-invalid': props.invalid,
141-
'is-valid': props.valid,
142-
'me-2': props.hitArea,
143-
},
144-
]
135+
const inputClassName = [
136+
props.button ? 'btn-check' : 'form-check-input',
137+
{
138+
'is-invalid': props.invalid,
139+
'is-valid': props.valid,
140+
'me-2': props.hitArea,
141+
},
142+
]
145143

146144
const formControl = () => {
147145
return h('input', {

packages/coreui-vue/src/components/form/CFormInput.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ const CFormInput = defineComponent({
6767
* The default name for a value passed using v-model.
6868
*/
6969
modelValue: {
70-
type: String,
70+
type: [File, Number, String],
7171
default: undefined,
7272
},
7373
/**

packages/coreui-vue/src/components/form/CFormTextarea.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,12 @@ const CFormTextarea = defineComponent({
113113
'update:modelValue',
114114
],
115115
setup(props, { attrs, emit, slots }) {
116+
const handleChange = (event: InputEvent) => {
117+
const target = event.target as HTMLInputElement
118+
emit('change', event)
119+
emit('update:modelValue', target.value)
120+
}
121+
116122
const handleInput = (event: InputEvent) => {
117123
const target = event.target as HTMLInputElement
118124
emit('input', event)
@@ -151,6 +157,7 @@ const CFormTextarea = defineComponent({
151157
'is-valid': props.valid,
152158
},
153159
],
160+
onChange: (event: InputEvent) => handleChange(event),
154161
onInput: (event: InputEvent) => handleInput(event),
155162
...(props.modelValue && { value: props.modelValue }),
156163
},

packages/coreui-vue/src/components/form/__tests__/CFormInput.spec.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ describe(`Loads and display ${ComponentName} component`, () => {
4949
})
5050
it('contain slots and classes', () => {
5151
expect(defaultWrapper.text()).toContain('Default slot')
52-
expect(defaultWrapper.classes('form-control')).toBe(true)
52+
expect(defaultWrapper.find('input').classes('form-control')).toBe(true)
5353
})
5454
})
5555

@@ -59,11 +59,11 @@ describe(`Customize ${ComponentName} component`, () => {
5959
})
6060
it('contain slots and classes', () => {
6161
expect(customWrapper.text()).toContain('Default slot')
62-
expect(customWrapper.classes('form-control-plaintext')).toBe(true)
63-
expect(customWrapper.classes('form-control-color')).toBe(true)
64-
expect(customWrapper.classes('form-control-lg')).toBe(true)
65-
expect(customWrapper.classes('is-invalid')).toBe(true)
66-
expect(customWrapper.classes('is-valid')).toBe(true)
62+
expect(customWrapper.find('input').classes('form-control-plaintext')).toBe(true)
63+
expect(customWrapper.find('input').classes('form-control-color')).toBe(true)
64+
expect(customWrapper.find('input').classes('form-control-lg')).toBe(true)
65+
expect(customWrapper.find('input').classes('is-invalid')).toBe(true)
66+
expect(customWrapper.find('input').classes('is-valid')).toBe(true)
6767
})
6868
})
6969

@@ -73,10 +73,10 @@ describe(`Customize (two) ${ComponentName} component`, () => {
7373
})
7474
it('contain slots and classes', () => {
7575
expect(customWrapperTwo.text()).toContain('Default slot')
76-
expect(customWrapperTwo.classes('form-control')).toBe(true)
77-
expect(customWrapper.classes('form-control-color')).toBe(true)
78-
expect(customWrapper.classes('form-control-lg')).toBe(true)
79-
expect(customWrapper.classes('is-invalid')).toBe(true)
80-
expect(customWrapper.classes('is-valid')).toBe(true)
76+
expect(customWrapperTwo.find('input').classes('form-control')).toBe(true)
77+
expect(customWrapper.find('input').classes('form-control-color')).toBe(true)
78+
expect(customWrapper.find('input').classes('form-control-lg')).toBe(true)
79+
expect(customWrapper.find('input').classes('is-invalid')).toBe(true)
80+
expect(customWrapper.find('input').classes('is-valid')).toBe(true)
8181
})
8282
})

packages/coreui-vue/src/components/form/__tests__/CFormRange.spec.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ describe(`Loads and display ${ComponentName} component`, () => {
3333
})
3434
it('contain slots and classes', () => {
3535
expect(defaultWrapper.text()).toContain('Default slot')
36-
expect(defaultWrapper.classes('form-range')).toBe(true)
37-
expect(defaultWrapper.attributes('type')).toBe('range')
36+
expect(defaultWrapper.find('input').classes('form-range')).toBe(true)
37+
expect(defaultWrapper.find('input').attributes('type')).toBe('range')
3838
})
3939
})
4040

@@ -44,12 +44,12 @@ describe(`Customize ${ComponentName} component`, () => {
4444
})
4545
it('contain slots and classes', () => {
4646
expect(customWrapper.text()).toContain('Default slot')
47-
expect(customWrapper.classes('form-range')).toBe(true)
48-
expect(customWrapper.attributes('type')).toBe('range')
49-
expect(customWrapper.attributes('disabled')).toBe('')
50-
expect(customWrapper.attributes('max')).toBe('400')
51-
expect(customWrapper.attributes('min')).toBe('50')
52-
expect(customWrapper.attributes('readonly')).toBe('')
53-
expect(customWrapper.attributes('steps')).toBe('10')
47+
expect(customWrapper.find('input').classes('form-range')).toBe(true)
48+
expect(customWrapper.find('input').attributes('type')).toBe('range')
49+
expect(customWrapper.find('input').attributes('disabled')).toBe('')
50+
expect(customWrapper.find('input').attributes('max')).toBe('400')
51+
expect(customWrapper.find('input').attributes('min')).toBe('50')
52+
expect(customWrapper.find('input').attributes('readonly')).toBe('')
53+
expect(customWrapper.find('input').attributes('steps')).toBe('10')
5454
})
5555
})

0 commit comments

Comments
 (0)