Skip to content

Commit 15e1c35

Browse files
committed
refactor: move props and types to src folder
1 parent f97d0dc commit 15e1c35

30 files changed

+59
-45
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { defineComponent, h, inject, Ref } from 'vue'
2-
import { CCollapse } from './../collapse/CCollapse'
2+
import { CCollapse } from '../collapse/CCollapse'
33

44
const CAccordionBody = defineComponent({
55
name: 'CAccordionBody',

packages/coreui-vue/src/components/alert/CAlert.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import { defineComponent, h, ref, Transition, watch } from 'vue'
22

3-
import { Color } from '../props'
4-
import { CCloseButton } from '../close-button/CCloseButton'
3+
import { CCloseButton } from '../close-button'
4+
5+
import { Color } from '../../props'
56

67
export const CAlert = defineComponent({
78
name: 'CAlert',

packages/coreui-vue/src/components/avatar/CAvatar.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { defineComponent, h } from 'vue'
2-
import { Color, Shape, TextColor } from '../props'
2+
3+
import { Color, Shape, TextColor } from '../../props'
34

45
const CAvatar = defineComponent({
56
name: 'CAvatar',

packages/coreui-vue/src/components/badge/CBadge.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { defineComponent, h } from 'vue'
22

3-
import { Color, Shape, TextColor } from '../props'
3+
import { Color, Shape, TextColor } from '../../props'
44

55
const CBadge = defineComponent({
66
name: 'CBadge',

packages/coreui-vue/src/components/button/CButton.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { defineComponent, h } from 'vue'
2-
import { Color, Shape } from '../props'
2+
3+
import { Color, Shape } from '../../props'
34

45
export const CButton = defineComponent({
56
name: 'CButton',

packages/coreui-vue/src/components/callout/CCallout.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { defineComponent, h } from 'vue'
2-
import { Color } from '../props'
2+
3+
import { Color } from '../../props'
34

45
const CCallout = defineComponent({
56
name: 'CCallout',

packages/coreui-vue/src/components/card/CCard.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { defineComponent, h } from 'vue'
2-
import { Color, TextColor } from '../props'
2+
3+
import { Color, TextColor } from '../../props'
34

45
const CCard = defineComponent({
56
name: 'CCard',

packages/coreui-vue/src/components/dropdown/CDropdown.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import { defineComponent, h, ref, provide, watch, PropType } from 'vue'
22
import { createPopper, Placement } from '@popperjs/core'
33

4+
import { Triggers } from '../../types'
5+
46
const CDropdown = defineComponent({
57
name: 'CDropdown',
68
props: {
@@ -91,7 +93,7 @@ const CDropdown = defineComponent({
9193
* Sets which event handlers you’d like provided to your toggle prop. You can specify one trigger or an array of them.
9294
*/
9395
trigger: {
94-
type: [String, Array],
96+
type: String as PropType<Triggers>,
9597
default: 'click',
9698
},
9799
/**

packages/coreui-vue/src/components/dropdown/CDropdownToggle.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
import { cloneVNode, defineComponent, h, inject, onMounted, PropType, Ref, ref } from 'vue'
2+
23
import { CButton } from '../button'
3-
import { Color, Shape } from '../props'
4-
import { Triggers } from '../Types'
4+
5+
import { Color, Shape } from '../../props'
6+
import { Triggers } from '../../types'
57

68
const CDropdownToggle = defineComponent({
79
name: 'CDropdownToggle',

packages/coreui-vue/src/components/list-group/CListGroupItem.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { defineComponent, h } from 'vue'
22

3-
import { Color } from '../props'
3+
import { Color } from '../../props'
44

55
const CListGroupItem = defineComponent({
66
name: 'CListGroupItem',

packages/coreui-vue/src/components/modal/CModal.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import {
1010
withDirectives,
1111
} from 'vue'
1212

13-
import { CBackdrop } from './../backdrop/CBackdrop'
13+
import { CBackdrop } from '../backdrop/CBackdrop'
1414

1515
import { executeAfterTransition } from '../../utils/transition'
1616

packages/coreui-vue/src/components/nav/CNavGroup.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { defineComponent, h, onMounted, ref, RendererElement, Transition, watch } from 'vue'
22

3-
import { executeAfterTransition } from './../../utils/transition'
3+
import { executeAfterTransition } from '../../utils/transition'
44

55
const CNavGroup = defineComponent({
66
name: 'CNavGroup',

packages/coreui-vue/src/components/navbar/CNavbar.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { defineComponent, h } from 'vue'
22

3-
import { Color } from '../props'
3+
import { Color } from '../../props'
44

55
const CNavbar = defineComponent({
66
name: 'CNavbar',

packages/coreui-vue/src/components/placeholder/CPlaceholder.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { defineComponent, h } from 'vue'
22

3-
import { Color } from '../props'
3+
import { Color } from '../../props'
44

55
const BREAKPOINTS = [
66
'xxl' as const,

packages/coreui-vue/src/components/progress/CProgressBar.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { defineComponent, h } from 'vue'
22

3-
import { Color } from '../props'
3+
import { Color } from '../../props'
44

55
const CProgressBar = defineComponent({
66
name: 'CProgressBar',

packages/coreui-vue/src/components/table/CTable.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { CTableHead } from './CTableHead'
88
import { CTableHeaderCell } from './CTableHeaderCell'
99
import { CTableRow } from './CTableRow'
1010

11-
import { Color } from '../props'
11+
import { Color } from '../../props'
1212
import { getColumnLabel, getColumnNames } from './utils'
1313
import type { Column, FooterItem, Item } from './types'
1414

packages/coreui-vue/src/components/table/CTableBody.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { defineComponent, h } from 'vue'
22

3-
import { Color } from '../props'
3+
import { Color } from '../../props'
44

55
const CTableBody = defineComponent({
66
name: 'CTableBody',

packages/coreui-vue/src/components/table/CTableDataCell.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { defineComponent, h } from 'vue'
22

3-
import { Color } from '../props'
3+
import { Color } from '../../props'
44

55
const CTableDataCell = defineComponent({
66
name: 'CTableDataCell',

packages/coreui-vue/src/components/table/CTableFoot.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { defineComponent, h } from 'vue'
22

3-
import { Color } from '../props'
3+
import { Color } from '../../props'
44

55
const CTableFoot = defineComponent({
66
name: 'CTableFoot',

packages/coreui-vue/src/components/table/CTableHead.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { defineComponent, h } from 'vue'
22

3-
import { Color } from '../props'
3+
import { Color } from '../../props'
44

55
const CTableHead = defineComponent({
66
name: 'CTableHead',

packages/coreui-vue/src/components/table/CTableHeaderCell.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { defineComponent, h } from 'vue'
22

3-
import { Color } from '../props'
3+
import { Color } from '../../props'
44

55
const CTableHeaderCell = defineComponent({
66
name: 'CTableHeaderCell',

packages/coreui-vue/src/components/table/CTableRow.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { defineComponent, h } from 'vue'
22

3-
import { Color } from '../props'
3+
import { Color } from '../../props'
44

55
const CTableRow = defineComponent({
66
name: 'CTableRow',

packages/coreui-vue/src/components/toast/CToast.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { defineComponent, h, onMounted, provide, ref, Transition } from 'vue'
22

3-
import { Color } from '../props'
3+
import { Color } from '../../props'
44

55
const CToast = defineComponent({
66
name: 'CToast',

packages/coreui-vue/src/components/widgets/CWidgetStatsB.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
import { defineComponent, h } from 'vue'
22
import { shape } from 'vue-types'
33

4-
import { Color } from '../props'
5-
import { CCard, CCardBody } from './../card'
6-
import { CProgress } from '../progress/CProgress'
4+
import { CCard, CCardBody } from '../card'
5+
import { CProgress } from '../progress'
6+
7+
import { Color } from '../../props'
78

89
const CWidgetStatsB = defineComponent({
910
name: 'CWidgetStatsB',

packages/coreui-vue/src/components/widgets/CWidgetStatsC.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { defineComponent, h } from 'vue'
22
import { shape } from 'vue-types'
33

4-
import { Color } from '../props'
5-
import { CCard, CCardBody } from './../card'
4+
import { Color } from '../../props'
5+
import { CCard, CCardBody } from '../card'
66
import { CProgress } from '../progress/CProgress'
77

88
const CWidgetStatsC = defineComponent({

packages/coreui-vue/src/components/widgets/CWidgetStatsD.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import { defineComponent, h, PropType } from 'vue'
22

3-
import { Color } from '../props'
4-
import { CCard, CCardBody, CCardHeader } from './../card/'
5-
import { CCol } from './../grid/'
3+
import { CCard, CCardBody, CCardHeader } from '../card/'
4+
import { CCol } from '../grid/'
5+
6+
import { Color } from '../../props'
67

78
type Value = {
89
title?: string
@@ -23,7 +24,7 @@ const CWidgetStatsD = defineComponent({
2324
*/
2425
values: {
2526
type: Array as PropType<Value[]>,
26-
default: () => []
27+
default: () => [],
2728
},
2829
},
2930
/**

packages/coreui-vue/src/components/widgets/CWidgetStatsE.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { defineComponent, h } from 'vue'
22

3-
import { CCard, CCardBody } from './../card/'
3+
import { CCard, CCardBody } from '../card/'
44

55
const CWidgetStatsE = defineComponent({
66
name: 'CWidgetStatsE',

packages/coreui-vue/src/components/widgets/CWidgetStatsF.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import { defineComponent, h } from 'vue'
22

3-
import { Color } from '../props'
4-
import { CCard, CCardBody, CCardFooter } from './../card/'
3+
import { CCard, CCardBody, CCardFooter } from '../card/'
4+
5+
import { Color } from '../../props'
56

67
const CWidgetStatsF = defineComponent({
78
name: 'CWidgetStatsF',

packages/coreui-vue/src/components/props.ts renamed to packages/coreui-vue/src/props.ts

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const Shape = {
1+
export const Shape = {
22
type: String,
33
validator: (value: string): boolean => {
44
// The value must match one of these strings
@@ -17,14 +17,16 @@ const Shape = {
1717
].includes(value)
1818
},
1919
}
20-
const Align = {
20+
21+
export const Align = {
2122
type: String,
2223
validator: (value: string): boolean => {
2324
// The value must match one of these strings
2425
return ['', 'left', 'center', 'right'].includes(value)
2526
},
2627
}
27-
const Color = {
28+
29+
export const Color = {
2830
type: String,
2931
validator: (value: string): boolean => {
3032
// The value must match one of these strings
@@ -42,7 +44,8 @@ const Color = {
4244
].includes(value)
4345
},
4446
}
45-
const TextColor = {
47+
48+
export const TextColor = {
4649
type: String,
4750
validator: (value: string): boolean => {
4851
return [
@@ -65,14 +68,13 @@ const TextColor = {
6568
].includes(value)
6669
},
6770
}
68-
const Breakpoint = {
71+
72+
export const Breakpoint = {
6973
validator: (value: boolean | number): boolean => {
7074
if (typeof value == 'boolean' || typeof value == 'number') {
7175
return true
7276
} else {
7377
return false
7478
}
7579
},
76-
}
77-
78-
export { Align, Breakpoint, Color, Shape, TextColor }
80+
}

0 commit comments

Comments
 (0)