Skip to content

Commit 8776809

Browse files
committed
chore: rename usePivotData to useProvidePivotData
1 parent 8eb8a35 commit 8776809

8 files changed

+13
-13
lines changed

src/components/pivottable/VPivottableBody.vue

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
</template>
2020

2121
<script setup>
22-
import { usePivotData } from '@/composables/usePivotData'
22+
import { useProvidePivotData } from '@/composables/useProvidePivotData'
2323
import VPivottableBodyRows from './VPivottableBodyRows.vue'
2424
import VPivottableBodyRowsTotalRow from './VPivottableBodyRowsTotalRow.vue'
2525
@@ -52,6 +52,6 @@ const {
5252
colKeys,
5353
rowAttrs,
5454
colAttrs
55-
} = usePivotData()
55+
} = useProvidePivotData()
5656
5757
</script>

src/components/pivottable/VPivottableBodyRows.vue

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232

3333
<script setup>
3434
35-
import { usePivotData } from '@/composables/usePivotData'
35+
import { useProvidePivotData } from '@/composables/useProvidePivotData'
3636
3737
const props = defineProps({
3838
rowKeys: {
@@ -61,7 +61,7 @@ const {
6161
rowAttrs,
6262
colAttrs,
6363
getAggregator
64-
} = usePivotData()
64+
} = useProvidePivotData()
6565
6666
const getValueCellStyle = (rowKey, colKey) => {
6767
const value = getAggregator(rowKey, colKey).value()

src/components/pivottable/VPivottableBodyRowsTotalRow.vue

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828
<script setup>
2929
import { computed } from 'vue'
30-
import { usePivotData } from '@/composables/usePivotData'
30+
import { useProvidePivotData } from '@/composables/useProvidePivotData'
3131
3232
const props = defineProps({
3333
colTotal: {
@@ -55,7 +55,7 @@ const {
5555
rowAttrs,
5656
colKeys,
5757
pivotData
58-
} = usePivotData()
58+
} = useProvidePivotData()
5959
6060
const grandTotalValue = computed(() => {
6161
return getAggregator([], []).value()

src/components/pivottable/VPivottableHeader.vue

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
</template>
3030

3131
<script setup>
32-
import { usePivotData } from '@/composables/usePivotData'
32+
import { useProvidePivotData } from '@/composables/useProvidePivotData'
3333
import VPivottableHeaderColumns from './VPivottableHeaderColumns.vue'
3434
import VPivottableHeaderRows from './VPivottableHeaderRows.vue'
3535
import VPivottableHeaderRowsTotal from './VPivottableHeaderRowsTotal.vue'
@@ -47,6 +47,6 @@ defineProps({
4747
}
4848
})
4949
50-
const { pivotData, colAttrs, rowAttrs, colKeys } = usePivotData()
50+
const { pivotData, colAttrs, rowAttrs, colKeys } = useProvidePivotData()
5151
5252
</script>

src/components/pivottable/VPivottableHeaderColumns.vue

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
</template>
1313

1414
<script setup>
15-
import { usePivotData } from '@/composables/usePivotData'
15+
import { useProvidePivotData } from '@/composables/useProvidePivotData'
1616
1717
defineProps({
1818
colKeys: {
@@ -33,5 +33,5 @@ defineProps({
3333
}
3434
})
3535
36-
const { spanSize } = usePivotData()
36+
const { spanSize } = useProvidePivotData()
3737
</script>

src/components/pivottable/renderer/TableRenderer.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
<script setup>
1515
import { defaultProps } from '@/helper'
16-
import { providePivotData } from '@/composables/usePivotData'
16+
import { providePivotData } from '@/composables/useProvidePivotData'
1717
import VPivottableHeader from '../VPivottableHeader.vue'
1818
import VPivottableBody from '../VPivottableBody.vue'
1919

src/composables/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
export { usePivotData, providePivotData } from './usePivotData'
1+
export { useProvidePivotData, providePivotData } from './useProvidePivotData'
22
export { usePropsState } from './usePropsState'
33
export { useMaterializeInput } from './useMaterializeInput'

src/composables/usePivotData.js renamed to src/composables/useProvidePivotData.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,6 @@ export function providePivotData (props) {
134134
return pivotDataContext
135135
}
136136

137-
export function usePivotData () {
137+
export function useProvidePivotData () {
138138
return inject(PIVOT_DATA_KEY)
139139
}

0 commit comments

Comments
 (0)