Skip to content

Commit 94256a1

Browse files
committed
feat: CListGroup: add accent functionality
1 parent 7bc7f96 commit 94256a1

File tree

7 files changed

+17
-7
lines changed

7 files changed

+17
-7
lines changed

src/components/index.d.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -374,14 +374,18 @@ export declare class CListGroup extends Vue {
374374
tag?: string
375375
flush?: boolean
376376
horizontal?: string | boolean
377+
accent?: boolean
377378
}
378379

379380
export declare class CListGroupItem extends CLink {
380381
tag?: string
381382
action?: boolean
382383
color?: string
384+
accent?: string
383385
}
384386

387+
export declare class CListGroupItemDivider extends Vue {}
388+
385389
export declare class CMedia extends Vue {
386390
addAsideMargin?: boolean
387391
addAsideClasses?: string | Array<any> | object

src/components/list-group/CListGroup.vue

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ export default {
1010
default: 'ul'
1111
},
1212
flush: Boolean,
13-
horizontal: [Boolean, String]
13+
horizontal: [Boolean, String],
14+
accent: Boolean
1415
},
1516
render (h, { props, data, children }) {
1617
const hor = props.horizontal
@@ -19,7 +20,8 @@ export default {
1920
staticClass: 'list-group',
2021
class: {
2122
'list-group-flush': !hor && props.flush,
22-
[`list-group-horizontal${horizontalClassSuffix}`]: hor
23+
[`list-group-horizontal${horizontalClassSuffix}`]: hor,
24+
'list-group-accent': props.accent
2325
},
2426
attrs: {
2527
role: data.attrs ? data.attrs.role || 'list-items' : 'list-items'

src/components/list-group/CListGroupItem.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ const props = Object.assign(
1010
default: 'li'
1111
},
1212
action: Boolean,
13-
color: String
13+
color: String,
14+
accent: String
1415
},
1516
linkPropsFactory()
1617
)
@@ -45,6 +46,7 @@ export default {
4546
staticClass: 'list-group-item',
4647
class: {
4748
[`list-group-item-${props.color}`]: props.color,
49+
[`list-group-item-accent-${props.accent}`]: props.accent,
4850
'list-group-item-action': isAction,
4951
'active': props.active,
5052
'disabled': props.disabled

src/components/list-group/tests/CListGroup.spec.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ const wrapper = mount(Component, {
1010

1111
const customWrapper = mount(Component, {
1212
propsData: {
13-
flush: true
13+
flush: true,
14+
accent: true
1415
},
1516
slots: {
1617
default: 'CListGroup content'

src/components/list-group/tests/CListGroupItem.spec.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ const customWrapper = mount(Component, {
77
propsData: {
88
tag: 'button',
99
action: true,
10-
color: 'success'
10+
color: 'success',
11+
accent: 'success'
1112
},
1213
slots: {
1314
default: 'CListGroupItem content'

src/components/list-group/tests/__snapshots__/CListGroup.spec.js.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ exports[`CListGroup renders correctly 1`] = `
99

1010
exports[`CListGroup renders correctly with flush option 1`] = `
1111
<ul
12-
class="list-group list-group-flush"
12+
class="list-group list-group-flush list-group-accent"
1313
role="list-items"
1414
>
1515
<template>

src/components/list-group/tests/__snapshots__/CListGroupItem.spec.js.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ exports[`CListGroupItem renders correctly 1`] = `
88

99
exports[`CListGroupItem renders correctly 2`] = `
1010
<button
11-
class="list-group-item list-group-item-success list-group-item-action"
11+
class="list-group-item list-group-item-success list-group-item-accent-success list-group-item-action"
1212
type="button"
1313
>
1414
<template>

0 commit comments

Comments
 (0)