Skip to content

Commit e6cbd07

Browse files
committed
chore: change folder names and js files casing to kebab-case
1 parent 81d2c80 commit e6cbd07

File tree

313 files changed

+23064
-22667
lines changed

Some content is hidden

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

313 files changed

+23064
-22667
lines changed

dist/coreui-vue.common.js

Lines changed: 4326 additions & 10956 deletions
Large diffs are not rendered by default.

dist/coreui-vue.common.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/coreui-vue.esm.js

Lines changed: 1074 additions & 688 deletions
Large diffs are not rendered by default.

dist/coreui-vue.umd.js

Lines changed: 4326 additions & 10956 deletions
Large diffs are not rendered by default.

dist/coreui-vue.umd.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/coreui-vue.umd.min.js

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/coreui-vue.umd.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/components/Progress/CProgress.vue

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

99
<script>
1010
import CProgressBar from './CProgressBar'
11-
import props from './progressProps'
11+
import props from './progress-props'
1212
1313
export default {
1414
name:'CProgress',

src/components/Progress/CProgressBar.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
</template>
1313

1414
<script>
15-
import props from './progressProps'
15+
import props from './progress-props'
1616
export default {
1717
name: 'CProgressBar',
1818
props,

src/components/Scrollbar/tests/CScrollbar.spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { mount } from '@vue/test-utils'
2-
import CSidebarNav from '../../Sidebar/CSidebarNav'
3-
import CSidebar from '../../Sidebar/CSidebar'
2+
import CSidebarNav from '../../sidebar/CSidebarNav'
3+
import CSidebar from '../../sidebar/CSidebar'
44
import Component from '../CScrollbar'
55
import Vue from 'vue'
66

src/components/Sidebar/CSidebarBrand.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
</template>
3939

4040
<script>
41-
import CLink from '../Link/CLink'
41+
import CLink from '../link/CLink'
4242
export default {
4343
name: 'CSidebarBrand',
4444
components: {

src/components/Sidebar/CSidebarClose.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
</template>
99

1010
<script>
11-
import CButtonClose from '../Button/CButtonClose'
11+
import CButtonClose from '../button/CButtonClose'
1212
export default {
1313
name: 'CSidebarClose',
1414
components: {

src/components/Sidebar/CSidebarNav.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
</template>
1111

1212
<script>
13-
import CScrollbar from '../Scrollbar/CScrollbar'
13+
import CScrollbar from '../scrollbar/CScrollbar'
1414
1515
export default {
1616
name: 'CSidebarNav',

src/components/Sidebar/CSidebarNavLink.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
</template>
2121

2222
<script>
23-
import CLink, { props as linkProps } from '../Link/CLink'
24-
import CBadge from '../Badge/CBadge'
23+
import CLink, { props as linkProps } from '../link/CLink'
24+
import CBadge from '../badge/CBadge'
2525
// import CIcon from '@coreui/icons/vue'
2626
2727
const props = Object.assign(linkProps, {

src/components/Table/CTable.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,8 +219,8 @@
219219
</template>
220220

221221
<script>
222-
import CSpinner from '../Spinner/CSpinner'
223-
import CPagination from '../Pagination/CPagination'
222+
import CSpinner from '../spinner/CSpinner'
223+
import CPagination from '../pagination/CPagination'
224224
import { CIcon as CIconRaw} from '@coreui/icons/vue'
225225
import { arrowTop, ban } from '@coreui/icons'
226226
const CIcon = Object.assign({}, CIconRaw, { icons : { arrowTop, ban }})

src/components/Tabs/CTabNav.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<script>
2-
import CLink, { propsFactory as linkPropsFactory } from '../Link/CLink'
2+
import CLink, { propsFactory as linkPropsFactory } from '../link/CLink'
33
44
export default {
55
name: 'CTabNav',

src/components/Toast/CToast.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@
3030
</template>
3131

3232
<script>
33-
import toastMixin from './toastMixin'
34-
import CButtonClose from '../Button/CButtonClose'
33+
import toastMixin from './toast-mixin'
34+
import CButtonClose from '../button/CButtonClose'
3535
3636
export default {
3737
name: 'CToast',

src/components/Toast/CToaster.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
</template>
99

1010
<script>
11-
import toastMixin from './toastMixin'
11+
import toastMixin from './toast-mixin'
1212
1313
export default {
1414
name: 'CToaster',

src/components/Widgets/CWidgetProgress.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
</template>
2020

2121
<script>
22-
import CProgress from '../Progress/CProgress'
22+
import CProgress from '../progress/CProgress'
2323
export default {
2424
name: 'CWidgetProgress',
2525
components: {

src/components/Widgets/CWidgetProgressIcon.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
</template>
2828

2929
<script>
30-
import CProgress from '../Progress/CProgress'
30+
import CProgress from '../progress/CProgress'
3131
export default {
3232
name: 'CWidgetProgressIcon',
3333
components: {

src/components/Widgets/tests/CWidgetProgress.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { mount } from '@vue/test-utils'
22
import Component from '../CWidgetProgress'
3-
import CProgress from '../../Progress/CProgress'
3+
import CProgress from '../../progress/CProgress'
44
import Vue from 'vue'
55

66
Vue.component('CProgress', CProgress)

src/components/Widgets/tests/CWidgetProgressIcon.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { mount } from '@vue/test-utils'
22
import Component from '../CWidgetProgressIcon'
3-
import CProgress from '../../Progress/CProgress'
3+
import CProgress from '../../progress/CProgress'
44
import Vue from 'vue'
55

66
Vue.component('CProgress', CProgress)

src/components/alert/CAlert.vue

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
<template>
2+
<transition :name="fade ? 'fade' : null" :appear="true">
3+
<div
4+
v-if="state"
5+
:class="alertClasses"
6+
role="alert"
7+
aria-live="polite"
8+
aria-atomic="true"
9+
>
10+
<CButtonClose
11+
v-if="closeButton"
12+
@click="dismiss()"
13+
/>
14+
<slot></slot>
15+
</div>
16+
</transition>
17+
</template>
18+
19+
<script>
20+
import CButtonClose from '../button/CButtonClose'
21+
export default {
22+
name: 'CAlert',
23+
components: { CButtonClose },
24+
props: {
25+
color: String,
26+
closeButton: Boolean,
27+
show: {
28+
type: [Boolean, Number],
29+
default: true
30+
},
31+
fade: Boolean,
32+
},
33+
data () {
34+
return {
35+
countdownTimeout: null,
36+
state: this.show
37+
}
38+
},
39+
computed: {
40+
alertClasses () {
41+
return [
42+
'alert',
43+
{
44+
'alert-dismissible': this.closeButton,
45+
[`alert-${this.color}`]: this.color
46+
}
47+
]
48+
}
49+
},
50+
watch: {
51+
show (val) {
52+
this.state = val
53+
},
54+
state: {
55+
immediate: true,
56+
handler (val, oldVal) {
57+
this.clearCounter()
58+
if (!val && oldVal) {
59+
this.$emit('update:show', val)
60+
} else if (typeof val === 'number' && val) {
61+
this.countdownTimeout = setTimeout(() => {
62+
const isWatched = this.$listeners['update:show']
63+
isWatched ? this.$emit('update:show', this.state - 1) : this.state--
64+
}, 1000)
65+
}
66+
}
67+
}
68+
},
69+
destroyed () {
70+
this.clearCounter()
71+
},
72+
methods: {
73+
dismiss () {
74+
this.state = false
75+
},
76+
clearCounter () {
77+
if (this.countdownTimeout) {
78+
clearTimeout(this.countdownTimeout)
79+
this.countdownTimeout = null
80+
}
81+
}
82+
}
83+
}
84+
</script>
85+
86+
<style>
87+
.fade-enter-active, .fade-leave-active {
88+
transition: opacity .3s;
89+
}
90+
.fade-enter, .fade-leave-to {
91+
opacity: 0;
92+
}
93+
94+
</style>

src/components/alert/index.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import CAlert from './CAlert'
2+
3+
export {
4+
CAlert
5+
}
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
import { mount } from '@vue/test-utils'
2+
import Component from '../CAlert'
3+
import CButtonClose from '../../button/CButtonClose'
4+
import Vue from 'vue'
5+
6+
Vue.component('CButtonClose', CButtonClose)
7+
8+
const ComponentName = 'CAlert'
9+
const defaultWrapper = mount(Component, {
10+
propsData: {
11+
show: true,
12+
closeButton: true
13+
},
14+
slots: {
15+
default: 'Dismissible Alert!'
16+
}
17+
})
18+
19+
const customWrapper = mount(Component, {
20+
propsData: {
21+
show: true,
22+
fade: true,
23+
closeButton: true,
24+
color: 'success'
25+
},
26+
slots: {
27+
default: 'Dismissible Alert!'
28+
},
29+
listeners: {
30+
'update:show': () => {}
31+
}
32+
})
33+
34+
describe(ComponentName, () => {
35+
it('has a name', () => {
36+
expect(Component.name).toMatch(ComponentName)
37+
})
38+
it('renders correctly', () => {
39+
expect(defaultWrapper.element).toMatchSnapshot()
40+
})
41+
it('renders correctly', () => {
42+
expect(customWrapper.element).toMatchSnapshot()
43+
})
44+
it('changes state corectly', () => {
45+
expect(customWrapper.vm.state).toBe(true)
46+
customWrapper.setProps({ show: false })
47+
expect(customWrapper.vm.state).toBe(false)
48+
})
49+
it('closes alert after given number of seconds', () => {
50+
jest.useFakeTimers()
51+
defaultWrapper.setProps({ show: 10 })
52+
expect(defaultWrapper.vm.state).toBe(10)
53+
setTimeout(() => expect(defaultWrapper.vm.state).toBe(0), 10001)
54+
jest.runAllTimers()
55+
})
56+
it('closes alert after click on dismiss button', () => {
57+
customWrapper.setProps({ show: true })
58+
const button = customWrapper.find('button')
59+
button.trigger('click')
60+
expect(customWrapper.vm.state).toBe(false)
61+
})
62+
63+
it('emmits correct update:show events when listener is set', () => {
64+
jest.useFakeTimers()
65+
customWrapper.setProps({ show: 10 })
66+
setTimeout(() => {
67+
expect(customWrapper.emitted()['update:show'].slice(-1)[0]).toEqual([9])
68+
}, 1000)
69+
jest.runAllTimers()
70+
})
71+
it('properly destroys alert', () => {
72+
customWrapper.destroy()
73+
expect(customWrapper.vm.countdownTimeout).toBe(null)
74+
})
75+
})
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
// Jest Snapshot v1, https://goo.gl/fbAQLP
2+
3+
exports[`CAlert renders correctly 1`] = `
4+
<div
5+
appear="true"
6+
aria-atomic="true"
7+
aria-live="polite"
8+
class="alert alert-dismissible"
9+
role="alert"
10+
>
11+
<button
12+
aria-label="Close"
13+
class="close"
14+
type="button"
15+
>
16+
×
17+
</button>
18+
Dismissible Alert!
19+
</div>
20+
`;
21+
22+
exports[`CAlert renders correctly 2`] = `
23+
<div
24+
appear="true"
25+
aria-atomic="true"
26+
aria-live="polite"
27+
class="alert alert-dismissible alert-success"
28+
name="fade"
29+
role="alert"
30+
>
31+
<button
32+
aria-label="Close"
33+
class="close"
34+
type="button"
35+
>
36+
×
37+
</button>
38+
Dismissible Alert!
39+
</div>
40+
`;

src/components/badge/CBadge.vue

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<script>
2+
import { mergeData } from 'vue-functional-data-merge'
3+
import CLink, { props as linkProps } from '../link/CLink'
4+
5+
const props = Object.assign(linkProps, {
6+
tag: {
7+
type: String,
8+
default: 'span'
9+
},
10+
color: String,
11+
pill: Boolean
12+
})
13+
14+
export default {
15+
functional: true,
16+
name:'CBadge',
17+
props,
18+
render (h, { props, data, children }) {
19+
const tag = !props.href && !props.to ? props.tag : CLink
20+
const componentData = {
21+
staticClass: 'badge',
22+
class: {
23+
[`badge-${props.color}`]: props.color,
24+
'badge-pill': props.pill,
25+
'active': props.active,
26+
'disabled': props.disabled
27+
},
28+
props
29+
}
30+
return h(tag, mergeData(data, componentData), children)
31+
}
32+
}
33+
</script>

src/components/badge/index.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import CBadge from './CBadge'
2+
3+
export {
4+
CBadge
5+
}

0 commit comments

Comments
 (0)