Skip to content

Commit 38b646f

Browse files
committed
feat: 변경사항 자동 커밋
- 여러 파일 수정 및 일부 파일 추가/삭제 - 상세 내역은 git diff로 확인 가능
1 parent 8ef8d7b commit 38b646f

17 files changed

+215
-259
lines changed

packages/lazy-table-renderer/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export default markRaw({
66
'Lazy Table': defineComponent({
77
name: 'VueLazyTable',
88
props: { ...PivotUtilities.defaultProps },
9-
setup(props) {
9+
setup (props) {
1010
return () =>
1111
h(LazyPivottableRenderer, {
1212
...props,

src/components/pivottable/VPivottable.vue

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,12 @@
55
/>
66
</template>
77

8-
<script setup>
8+
<script setup lang="ts">
99
import { computed } from 'vue'
10-
import { defaultProps } from '@/helper'
1110
import TableRenderer from './renderer'
12-
const props = defineProps({
13-
...defaultProps
14-
})
11+
import { DefaultPropsType } from '@/types'
12+
13+
const props = defineProps<DefaultPropsType>()
1514
1615
const rendererComponent = computed(
1716
() => props.renderers[props.rendererName] || TableRenderer.Table

src/components/pivottable/VPivottableBody.vue

Lines changed: 9 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -3,48 +3,30 @@
33
<VPivottableBodyRows
44
:row-keys="rowKeys"
55
:col-keys="colKeys"
6-
:row-total="rowTotal"
6+
:show-row-total="showRowTotal"
77
:table-options="tableOptions"
88
/>
99
<VPivottableBodyRowsTotalRow
10-
:col-total="colTotal"
11-
:row-total="rowTotal"
10+
:show-col-total="showColTotal"
11+
:show-row-total="showRowTotal"
1212
:row-attrs="rowAttrs"
1313
:col-attrs="colAttrs"
1414
:col-keys="colKeys"
15-
:locale-strings="localeStrings"
15+
:language-pack="languagePack"
1616
:table-options="tableOptions"
1717
/>
1818
</tbody>
1919
</template>
2020

21-
<script setup>
21+
<script setup lang="ts">
2222
import { useProvidePivotData } from '@/composables/useProvidePivotData'
2323
import VPivottableBodyRows from './VPivottableBodyRows.vue'
2424
import VPivottableBodyRowsTotalRow from './VPivottableBodyRowsTotalRow.vue'
25+
import type { DefaultPropsType } from '@/types'
2526
26-
defineProps({
27-
rowTotal: {
28-
type: Boolean,
29-
default: true
30-
},
31-
colTotal: {
32-
type: Boolean,
33-
default: true
34-
},
35-
localeStrings: {
36-
type: Object,
37-
default: () => ({
38-
totals: 'Totals'
39-
})
40-
},
41-
tableOptions: {
42-
type: Object,
43-
default: () => ({
44-
clickCallback: null
45-
})
46-
}
47-
})
27+
type Props = Pick<DefaultPropsType, 'showRowTotal' | 'showColTotal' | 'languagePack' | 'tableOptions'>
28+
29+
defineProps<Props>()
4830
4931
const { pivotData, rowKeys, colKeys, rowAttrs, colAttrs } =
5032
useProvidePivotData()

src/components/pivottable/VPivottableBodyRows.vue

Lines changed: 17 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
}}
3737
</td>
3838
<td
39-
v-if="rowTotal"
39+
v-if="showRowTotal"
4040
class="pvtTotal"
4141
:style="getRowTotalStyle(rowKey)"
4242
@click="
@@ -48,27 +48,19 @@
4848
</tr>
4949
</template>
5050

51-
<script setup>
51+
<script setup lang="ts">
5252
import { useProvidePivotData } from '@/composables/useProvidePivotData'
53+
import { DefaultPropsType } from '@/types'
5354
54-
const props = defineProps({
55-
rowKeys: {
56-
type: Array,
57-
required: true
58-
},
59-
colKeys: {
60-
type: Array,
61-
required: true
62-
},
63-
rowTotal: {
64-
type: Boolean,
65-
required: true
66-
},
67-
tableOptions: {
68-
type: Object,
69-
required: true
70-
}
71-
})
55+
type VPivottableBodyRowsProps = Pick<
56+
DefaultPropsType,
57+
'showRowTotal' | 'tableOptions'
58+
> & {
59+
rowKeys: any[][]
60+
colKeys: any[][]
61+
}
62+
63+
const props = defineProps<VPivottableBodyRowsProps>()
7264
7365
const {
7466
pivotData,
@@ -80,19 +72,19 @@ const {
8072
getAggregator
8173
} = useProvidePivotData()
8274
83-
const getValueCellStyle = (rowKey, colKey) => {
75+
const getValueCellStyle = (rowKey: any, colKey: any) => {
8476
const value = getAggregator(rowKey, colKey).value()
8577
return valueCellColors(rowKey, colKey, value)
8678
}
8779
88-
const getRowTotalStyle = (rowKey) => {
80+
const getRowTotalStyle = (rowKey: any) => {
8981
const value = getAggregator(rowKey, []).value()
9082
return colTotalColors(value)
9183
}
9284
93-
const handleCellClick = (value, rowValues, colValues) => {
85+
const handleCellClick = (value: any, rowValues: any, colValues: any) => {
9486
if (props.tableOptions?.clickCallback) {
95-
const filters = {}
87+
const filters = {} as any
9688
9789
colAttrs.value.forEach((attr, i) => {
9890
if (colValues[i] !== undefined && colValues[i] !== null) {
@@ -106,7 +98,7 @@ const handleCellClick = (value, rowValues, colValues) => {
10698
}
10799
})
108100
109-
return (event) =>
101+
return (event: MouseEvent) =>
110102
props.tableOptions.clickCallback(event, value, filters, pivotData.value)
111103
}
112104
return () => ({})

src/components/pivottable/VPivottableBodyRowsTotalRow.vue

Lines changed: 15 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<template>
2-
<tr v-if="colTotal">
2+
<tr v-if="showColTotal">
33
<th
44
class="pvtTotalLabel"
55
:colSpan="rowAttrs.length + (colAttrs.length === 0 ? 0 : 1)"
66
>
7-
{{ localeStrings.totals }}
7+
{{ languagePack.totals }}
88
</th>
99
<td
1010
v-for="(colKey, i) in colKeys"
@@ -18,7 +18,7 @@
1818
{{ getAggregator([], colKey).format(getAggregator([], colKey).value()) }}
1919
</td>
2020
<td
21-
v-if="rowTotal"
21+
v-if="showRowTotal"
2222
class="pvtGrandTotal"
2323
@click="handleCellClick(grandTotalValue, [], [])($event)"
2424
>
@@ -27,28 +27,17 @@
2727
</tr>
2828
</template>
2929

30-
<script setup>
30+
<script setup lang="ts">
3131
import { computed } from 'vue'
3232
import { useProvidePivotData } from '@/composables/useProvidePivotData'
33+
import { DefaultPropsType } from '@/types'
3334
34-
const props = defineProps({
35-
colTotal: {
36-
type: Boolean,
37-
required: true
38-
},
39-
rowTotal: {
40-
type: Boolean,
41-
required: true
42-
},
43-
localeStrings: {
44-
type: Object,
45-
required: true
46-
},
47-
tableOptions: {
48-
type: Object,
49-
required: true
50-
}
51-
})
35+
type VPivottableBodyRowsTotalRowProps = Pick<
36+
DefaultPropsType,
37+
'showRowTotal' | 'showColTotal' | 'languagePack' | 'tableOptions'
38+
>
39+
40+
const props = defineProps<VPivottableBodyRowsTotalRowProps>()
5241
5342
const {
5443
getAggregator,
@@ -63,14 +52,14 @@ const grandTotalValue = computed(() => {
6352
return getAggregator([], []).value()
6453
})
6554
66-
const getColTotalStyle = (colKey) => {
55+
const getColTotalStyle = (colKey: any) => {
6756
const value = getAggregator([], colKey).value()
6857
return rowTotalColors(value)
6958
}
7059
71-
const handleCellClick = (value, rowValues, colValues) => {
60+
const handleCellClick = (value: any, rowValues: any[], colValues: any[]) => {
7261
if (props.tableOptions?.clickCallback) {
73-
const filters = {}
62+
const filters = {} as any
7463
7564
colAttrs.value.forEach((attr, i) => {
7665
if (colValues[i] !== undefined && colValues[i] !== null) {
@@ -84,7 +73,7 @@ const handleCellClick = (value, rowValues, colValues) => {
8473
}
8574
})
8675
87-
return (event) =>
76+
return (event: MouseEvent) =>
8877
props.tableOptions.clickCallback(event, value, filters, pivotData.value)
8978
}
9079
return () => ({})
Lines changed: 36 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,50 @@
11
<template>
2-
<thead>
3-
<template v-if="pivotData">
4-
<tr
5-
v-for="(c, j) in colAttrs"
6-
:key="`colAttrs${j}`"
7-
>
8-
<th
9-
v-if="j === 0 && rowAttrs.length !== 0"
10-
:colSpan="rowAttrs.length"
11-
:rowSpan="colAttrs.length"
12-
/>
13-
<th class="pvtAxisLabel">
14-
{{ c }}
15-
</th>
16-
<VPivottableHeaderColumns
17-
:col-keys="colKeys"
18-
:col-index="j"
19-
:col-attrs-length="colAttrs.length"
20-
:row-attrs-length="rowAttrs.length"
21-
/>
22-
<VPivottableHeaderRowsTotal
23-
v-if="j === 0 && rowTotal"
24-
:col-attrs-length="colAttrs.length"
25-
:row-attrs-length="rowAttrs.length"
26-
:locale-strings="localeStrings"
27-
/>
28-
</tr>
29-
<VPivottableHeaderRows
30-
v-if="rowAttrs.length !== 0"
31-
:row-attrs="rowAttrs"
32-
:row-total="rowTotal"
2+
<thead v-if="pivotData">
3+
<tr
4+
v-for="(c, j) in colAttrs"
5+
:key="`colAttrs${j}`"
6+
>
7+
<th
8+
v-if="j === 0 && rowAttrs.length !== 0"
9+
:colSpan="rowAttrs.length"
10+
:rowSpan="colAttrs.length"
11+
/>
12+
<th class="pvtAxisLabel">
13+
{{ c }}
14+
</th>
15+
<VPivottableHeaderColumns
16+
:col-keys="colKeys"
17+
:col-index="j"
18+
:col-attrs-length="colAttrs.length"
19+
:row-attrs-length="rowAttrs.length"
20+
/>
21+
<VPivottableHeaderRowsTotal
22+
v-if="j === 0 && showRowTotal"
3323
:col-attrs-length="colAttrs.length"
34-
:locale-strings="localeStrings"
24+
:row-attrs-length="rowAttrs.length"
25+
:language-pack="languagePack"
3526
/>
36-
</template>
27+
</tr>
28+
<VPivottableHeaderRows
29+
v-if="rowAttrs.length !== 0"
30+
:row-attrs="rowAttrs"
31+
:show-row-total="showRowTotal"
32+
:col-attrs-length="colAttrs.length"
33+
:language-pack="languagePack"
34+
/>
3735
</thead>
3836
</template>
3937

40-
<script setup>
38+
<script setup lang="ts">
4139
import { useProvidePivotData } from '@/composables/useProvidePivotData'
4240
import VPivottableHeaderColumns from './VPivottableHeaderColumns.vue'
4341
import VPivottableHeaderRows from './VPivottableHeaderRows.vue'
4442
import VPivottableHeaderRowsTotal from './VPivottableHeaderRowsTotal.vue'
43+
import type { DefaultPropsType } from '@/types'
44+
45+
type Props = Pick<DefaultPropsType, 'showRowTotal' | 'languagePack'>
4546
46-
defineProps({
47-
rowTotal: {
48-
type: Boolean,
49-
default: true
50-
},
51-
localeStrings: {
52-
type: Object,
53-
default: () => ({
54-
totals: 'Totals'
55-
})
56-
}
57-
})
47+
defineProps<Props>()
5848
5949
const { pivotData, colAttrs, rowAttrs, colKeys } = useProvidePivotData()
6050
</script>

src/components/pivottable/VPivottableHeaderColumns.vue

Lines changed: 8 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -14,27 +14,16 @@
1414
</template>
1515
</template>
1616

17-
<script setup>
17+
<script setup lang="ts">
1818
import { useProvidePivotData } from '@/composables/useProvidePivotData'
1919
20-
defineProps({
21-
colKeys: {
22-
type: Array,
23-
required: true
24-
},
25-
colIndex: {
26-
type: Number,
27-
required: true
28-
},
29-
colAttrsLength: {
30-
type: Number,
31-
required: true
32-
},
33-
rowAttrsLength: {
34-
type: Number,
35-
required: true
36-
}
37-
})
20+
type VPivottableHeaderColumnsProps = {
21+
colKeys: string[][]
22+
colIndex: number
23+
colAttrsLength: number
24+
rowAttrsLength: number
25+
}
26+
defineProps<VPivottableHeaderColumnsProps>()
3827
3928
const { spanSize } = useProvidePivotData()
4029
</script>

0 commit comments

Comments
 (0)