Skip to content

Commit 3dc6b82

Browse files
committed
releae: v4.0.0-beta.1
1 parent d9120d2 commit 3dc6b82

File tree

9 files changed

+17
-58
lines changed

9 files changed

+17
-58
lines changed

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@coreui/vue",
33
"description": "UI Components Library for Vue.js",
4-
"version": "4.0.0-beta.0",
4+
"version": "4.0.0-beta.1",
55
"config": {
66
"version_short": "4.0"
77
},
@@ -67,7 +67,7 @@
6767
"rollup-plugin-peer-deps-external": "^2.2.4",
6868
"rollup-plugin-vue": "^6.0.0",
6969
"ts-jest": "^27.0.5",
70-
"typescript": "^4.4.2",
70+
"typescript": "4.3.5",
7171
"vue": "^3.2.6",
7272
"vue-docgen-cli": "^4.41.1",
7373
"vue-jest": "^5.0.0-alpha.7",

src/components/badge/CBadge.ts

+1
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ const CBadge = defineComponent({
5959
[`text-${props.textColor}`]: props.textColor,
6060
[`badge-${props.size}`]: props.size,
6161
},
62+
props.shape,
6263
],
6364
},
6465
slots.default && slots.default(),

src/components/form/CFormCheck.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ const CFormCheck = defineComponent({
9797
required: false,
9898
},
9999
},
100-
setup(props, { attrs }) {
100+
setup(props, { slots, attrs }) {
101101
const formControl = () => {
102102
return h('input', {
103103
...attrs,
@@ -131,14 +131,14 @@ const CFormCheck = defineComponent({
131131
...(props.id && { for: props.id }),
132132
},
133133
{
134-
default: () => props.label,
134+
default: () => (slots.label && slots.label()) || props.label,
135135
},
136136
)
137137
}
138138

139139
return () =>
140140
props.button
141-
? [formControl(), props.label && formLabel()]
141+
? [formControl(), (slots.label || props.label) && formLabel()]
142142
: props.label
143143
? h(
144144
'div',

src/components/form/CFormInput.ts

+1-13
Original file line numberDiff line numberDiff line change
@@ -63,17 +63,7 @@ const CFormInput = defineComponent({
6363
required: false,
6464
},
6565
},
66-
emits: ['change', 'input'],
67-
setup(props, { attrs, emit, slots }) {
68-
const handleInput = (event: Event) => {
69-
const target = event.target as HTMLInputElement
70-
emit('input', target.value)
71-
}
72-
73-
const handleChange = (event: Event) => {
74-
const target = event.target as HTMLInputElement
75-
emit('change', target.value)
76-
}
66+
setup(props, { attrs, slots }) {
7767
return () =>
7868
h(
7969
'input',
@@ -89,8 +79,6 @@ const CFormInput = defineComponent({
8979
'is-valid': props.valid,
9080
},
9181
],
92-
onChange: handleChange,
93-
onInput: handleInput,
9482
},
9583
slots.default && slots.default(),
9684
)

src/components/form/CFormSelect.ts

+1-7
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,7 @@ const CFormSelect = defineComponent({
3939
required: false,
4040
},
4141
},
42-
emits: ['change'],
43-
setup(props, { attrs, emit, slots }) {
44-
const handleChange = (event: Event) => {
45-
const target = event.target as HTMLSelectElement
46-
emit('change', Number(target.value))
47-
}
42+
setup(props, { attrs, slots }) {
4843
return () =>
4944
h(
5045
'select',
@@ -57,7 +52,6 @@ const CFormSelect = defineComponent({
5752
},
5853
],
5954
size: props.htmlSize,
60-
onChange: handleChange,
6155
},
6256
slots.default && slots.default(),
6357
)

src/components/pagination/CPaginationItem.ts

+1-6
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,7 @@ const CPaginationItem = defineComponent({
3636
required: false,
3737
},
3838
},
39-
emits: ['click'],
40-
setup(props, { emit, slots }) {
41-
const handleClick = () => {
42-
emit('click')
43-
}
39+
setup(props, { slots }) {
4440
return () => {
4541
const component = props.component ? props.component : props.active ? 'span' : 'a'
4642
return h(
@@ -62,7 +58,6 @@ const CPaginationItem = defineComponent({
6258
class: ['page-link'],
6359
component: component,
6460
href: props.href,
65-
onClick: handleClick,
6661
},
6762
{
6863
default: () => slots.default && slots.default(),

src/components/progress/CProgressBar.ts

+3-17
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import { defineComponent, h } from 'vue'
22

3+
import { Color } from '../props'
4+
35
const CProgressBar = defineComponent({
46
name: 'CProgressBar',
57
props: {
@@ -15,23 +17,7 @@ const CProgressBar = defineComponent({
1517
*
1618
* @values 'primary', 'secondary', 'success', 'danger', 'warning', 'info', 'dark', 'light'
1719
*/
18-
color: {
19-
type: String,
20-
default: undefined,
21-
require: true,
22-
validator: (value: string) => {
23-
return [
24-
'primary',
25-
'secondary',
26-
'success',
27-
'danger',
28-
'warning',
29-
'info',
30-
'dark',
31-
'light',
32-
].includes(value)
33-
},
34-
},
20+
color: Color,
3521
/**
3622
* The percent to progress the ProgressBar.
3723
*

src/components/table/CTableRow.ts

+1-6
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,7 @@ const CTableRow = defineComponent({
3232
*/
3333
color: Color,
3434
},
35-
emits: ['click'],
36-
setup(props, { emit, slots }) {
37-
const handleClick = () => {
38-
emit('click')
39-
}
35+
setup(props, { slots }) {
4036
return () =>
4137
h(
4238
'tr',
@@ -48,7 +44,6 @@ const CTableRow = defineComponent({
4844
[`table-${props.color}`]: props.color,
4945
},
5046
],
51-
onClick: handleClick,
5247
},
5348
slots.default && slots.default(),
5449
)

yarn.lock

+4-4
Original file line numberDiff line numberDiff line change
@@ -6991,10 +6991,10 @@ typedarray-to-buffer@^3.1.5:
69916991
dependencies:
69926992
is-typedarray "^1.0.0"
69936993

6994-
typescript@^4.4.2:
6995-
version "4.4.2"
6996-
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.4.2.tgz#6d618640d430e3569a1dfb44f7d7e600ced3ee86"
6997-
integrity sha512-gzP+t5W4hdy4c+68bfcv0t400HVJMMd2+H9B7gae1nQlBzCqvrXX+6GL/b3GAgyTH966pzrZ70/fRjwAtZksSQ==
6994+
typescript@4.3.5:
6995+
version "4.3.5"
6996+
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.3.5.tgz#4d1c37cc16e893973c45a06886b7113234f119f4"
6997+
integrity sha512-DqQgihaQ9cUrskJo9kIyW/+g0Vxsk8cDtZ52a3NGh0YNTfpUSArXSohyUGnvbPazEPLu398C0UxmKSOrPumUzA==
69986998

69996999
uc.micro@^1.0.1, uc.micro@^1.0.5:
70007000
version "1.0.6"

0 commit comments

Comments
 (0)