Skip to content

Commit fba6474

Browse files
Merge pull request #40 from vue-pivottable/refactor/dragndrop
fix: unselectedFilterValues 오타 수정 #39
2 parents 798d1b8 + fc23628 commit fba6474

File tree

2 files changed

+43
-29
lines changed

2 files changed

+43
-29
lines changed

src/components/pivottable-ui/VDragAndDropCell.vue

+8-4
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@
1313
:key="item"
1414
:fixed="fixedFromDragDrop.includes(item)"
1515
:restricted="restrictedFromDragDrop.includes(item)"
16-
:open="openStatus?.[item]"
17-
:unSelectedFilterValues="valueFilter?.[item]"
16+
:open="openStatus[item]"
17+
:unselectedFilterValues="valueFilter[item]"
1818
:attributeName="item"
19-
:attributeValues="allFilters?.[item]"
20-
:zIndex="zIndices?.[item]"
19+
:attributeValues="allFilters[item]"
20+
:zIndex="zIndices[item] || maxZIndex"
2121
:hideDropDownForUnused="hideDropDownForUnused"
2222
@update:zIndexOfFilterBox="$emit('update:zIndexOfFilterBox', $event)"
2323
@update:unselectedFilterValues="
@@ -85,6 +85,10 @@ const props = defineProps({
8585
type: Object,
8686
default: () => ({})
8787
},
88+
maxZIndex: {
89+
type: Number,
90+
default: 1000
91+
},
8892
openStatus: {
8993
type: Object,
9094
default: () => ({})

src/components/pivottable-ui/VPivottableUi.vue

+35-25
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,11 @@
1616
:valueFilter="state.valueFilter"
1717
:restrictedFromDragDrop="state.restrictedFromDragDrop"
1818
:fixedFromDragDrop="state.fixedFromDragDrop"
19-
:hideFilterBoxOfUnusedAttributes="state.hideFilterBoxOfUnusedAttributes"
19+
:hideFilterBoxOfUnusedAttributes="
20+
state.hideFilterBoxOfUnusedAttributes
21+
"
2022
:zIndices="pivotUiState.zIndices"
23+
:maxZIndex="pivotUiState.maxZIndex"
2124
:openStatus="pivotUiState.openStatus"
2225
@update:zIndexOfFilterBox="onMoveFilterBoxToTop"
2326
@update:unselectedFilterValues="onUpdateValueFilter"
@@ -54,8 +57,11 @@
5457
:valueFilter="state.valueFilter"
5558
:restrictedFromDragDrop="state.restrictedFromDragDrop"
5659
:fixedFromDragDrop="state.fixedFromDragDrop"
57-
:hideFilterBoxOfUnusedAttributes="state.hideFilterBoxOfUnusedAttributes"
60+
:hideFilterBoxOfUnusedAttributes="
61+
state.hideFilterBoxOfUnusedAttributes
62+
"
5863
:zIndices="pivotUiState.zIndices"
64+
:maxZIndex="pivotUiState.maxZIndex"
5965
:openStatus="pivotUiState.openStatus"
6066
@update:zIndexOfFilterBox="onMoveFilterBoxToTop"
6167
@update:unselectedFilterValues="onUpdateValueFilter"
@@ -76,8 +82,11 @@
7682
:valueFilter="state.valueFilter"
7783
:restrictedFromDragDrop="state.restrictedFromDragDrop"
7884
:fixedFromDragDrop="state.fixedFromDragDrop"
79-
:hideFilterBoxOfUnusedAttributes="state.hideFilterBoxOfUnusedAttributes"
85+
:hideFilterBoxOfUnusedAttributes="
86+
state.hideFilterBoxOfUnusedAttributes
87+
"
8088
:zIndices="pivotUiState.zIndices"
89+
:maxZIndex="pivotUiState.maxZIndex"
8190
:openStatus="pivotUiState.openStatus"
8291
@update:zIndexOfFilterBox="onMoveFilterBoxToTop"
8392
@update:unselectedFilterValues="onUpdateValueFilter"
@@ -96,22 +105,22 @@
96105
</tr>
97106
</tbody>
98107
</table>
99-
<div>
108+
<div>
100109
<h4>State</h4>
101-
rows: {{ state.rows }} <br>
102-
cols: {{ state.cols }} <br>
103-
aggregatorName: {{ state.aggregatorName }} <br>
104-
rendererName: {{ state.rendererName }} <br>
105-
vals: {{ state.vals }} <br>
110+
rows: {{ state.rows }} <br />
111+
cols: {{ state.cols }} <br />
112+
aggregatorName: {{ state.aggregatorName }} <br />
113+
rendererName: {{ state.rendererName }} <br />
114+
vals: {{ state.vals }} <br />
106115
attributeNames: {{ attributeNames }}
107116
<h4>UI State</h4>
108-
unusedOrder: {{ pivotUiState.unusedOrder }} <br>
109-
zIndices: {{ pivotUiState.zIndices }} <br>
110-
maxZIndex: {{ pivotUiState.maxZIndex }} <br>
111-
openStatus: {{ pivotUiState.openStatus }} <br>
117+
unusedOrder: {{ pivotUiState.unusedOrder }} <br />
118+
zIndices: {{ pivotUiState.zIndices }} <br />
119+
maxZIndex: {{ pivotUiState.maxZIndex }} <br />
120+
openStatus: {{ pivotUiState.openStatus }} <br />
112121
allFilters:
113122
<textarea
114-
style="height: 500px; margin: 10px; width: 100%;"
123+
style="height: 500px; margin: 10px; width: 100%"
115124
readonly
116125
:value="JSON.stringify(allFilters, undefined, 2)"
117126
/>
@@ -125,7 +134,12 @@ import VAggregatorCell from './VAggregatorCell.vue'
125134
import VDragAndDropCell from './VDragAndDropCell.vue'
126135
import { VPivottable } from '@/'
127136
import { computed, watch } from 'vue'
128-
import { usePropsState, useMaterializeInput, usePivotUiState, provideFilterBox } from '@/composables'
137+
import {
138+
usePropsState,
139+
useMaterializeInput,
140+
usePivotUiState,
141+
provideFilterBox
142+
} from '@/composables'
129143
import TableRenderer from '../pivottable/renderer'
130144
131145
const props = defineProps({
@@ -182,20 +196,15 @@ const {
182196
onUpdateUnusedOrder
183197
} = usePivotUiState()
184198
185-
const {
186-
allFilters,
187-
materializedInput
188-
} = useMaterializeInput(
199+
const { allFilters, materializedInput } = useMaterializeInput(
189200
computed(() => props.data),
190201
{
191202
derivedAttributes: computed(() => props.derivedAttributes)
192203
}
193204
)
194205
195206
const rendererItems = computed(() =>
196-
Object.keys(state.renderers).length
197-
? state.renderers
198-
: TableRenderer
207+
Object.keys(state.renderers).length ? state.renderers : TableRenderer
199208
)
200209
const aggregatorItems = computed(() => state.aggregators)
201210
const rowAttrs = computed(() => {
@@ -245,15 +254,16 @@ watch(
245254
allFilters: allFilters.value,
246255
materializedInput: materializedInput.value
247256
})
248-
}, {
257+
},
258+
{
249259
deep: true
250-
})
260+
}
261+
)
251262
</script>
252263

253264
<style>
254265
.pvtUi {
255266
border-collapse: collapse;
256267
width: 100%;
257268
}
258-
259269
</style>

0 commit comments

Comments
 (0)