Skip to content

Commit 29e1fb5

Browse files
Merge pull request #27 from vue-pivottable/refactor/dragndrop
feat: VFilterBox 이벤트 파라미터 전달 #23
2 parents 616ec79 + 236edf3 commit 29e1fb5

File tree

3 files changed

+30
-12
lines changed

3 files changed

+30
-12
lines changed

src/components/pivottable-ui/VDragAndDropCell.vue

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,16 @@
1717
:open="openStatus?.[item]"
1818
:unSelectedFilterValues="valueFilter?.[item]"
1919
:attributeName="item"
20-
:attributeValues="allFilters[item]"
21-
:zIndex="zIndices[item]"
20+
:attributeValues="allFilters?.[item]"
21+
:zIndex="zIndices?.[item]"
2222
:hideDropDownForUnused="hideDropDownForUnused"
23-
@update:zIndexOfFilterBox="$emit('update:zIndexOfFilterBox')"
24-
@update:unselectedFilterValues="$emit('update:unselectedFilterValues')"
25-
@update:openStatusOfFilterBox="$emit('update:unselectedFilterValues')"
23+
@update:zIndexOfFilterBox="$emit('update:zIndexOfFilterBox', $event)"
24+
@update:unselectedFilterValues="
25+
$emit('update:unselectedFilterValues', $event)
26+
"
27+
@update:openStatusOfFilterBox="
28+
$emit('update:openStatusOfFilterBox', $event)
29+
"
2630
>
2731
<template #pvtAttr="{ attrName }">
2832
{{ attrName }}

src/components/pivottable-ui/VDraggableAttribute.vue

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,10 @@
1111
:filterBoxKey="attributeName"
1212
:filterBoxValues="attributeValues"
1313
:zIndex="zIndex"
14-
@update:zIndexOfFilterBox="$emit('update:zIndexOfFilterBox')"
15-
@update:unselectedFilterValues="$emit('update:unselectedFilterValues')"
14+
@update:zIndexOfFilterBox="$emit('update:zIndexOfFilterBox', $event)"
15+
@update:unselectedFilterValues="
16+
$emit('update:unselectedFilterValues', $event)
17+
"
1618
>
1719
</VFilterBox>
1820
</span>
@@ -64,7 +66,10 @@ const props = defineProps({
6466
})
6567
6668
const toggleFilterBox = () => {
67-
emit('update:openStatusOfFilterBox', props.attributeName)
69+
emit('update:openStatusOfFilterBox', {
70+
key: props.attributeName,
71+
value: !props.open
72+
})
6873
}
6974
7075
const hideDropDown = computed(

src/components/pivottable-ui/VPivottableUi.vue

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,13 @@
1414
:attributeNames="unusedAttrs"
1515
:allFilters="allFilters"
1616
:valueFilter="state.valueFilter"
17+
:restrictedFromDragDrop="state.restrictedFromDragDrop"
1718
:fixedFromDragDrop="state.fixedFromDragDrop"
1819
:hideFilterBoxOfUnusedAttributes="
1920
state.hideFilterBoxOfUnusedAttributes
2021
"
22+
:zIndices="state.zIndices"
23+
:openStatus="state.openStatus"
2124
@update:zIndexOfFilterBox="onMoveFilterBoxToTop"
2225
@update:unselectedFilterValues="onUpdateValueFilter"
2326
@update:openStatusOfFilterBox="onUpdateOpenStatus"
@@ -51,10 +54,13 @@
5154
:attributeNames="colAttrs"
5255
:allFilters="allFilters"
5356
:valueFilter="state.valueFilter"
57+
:restrictedFromDragDrop="state.restrictedFromDragDrop"
5458
:fixedFromDragDrop="state.fixedFromDragDrop"
5559
:hideFilterBoxOfUnusedAttributes="
5660
state.hideFilterBoxOfUnusedAttributes
5761
"
62+
:zIndices="state.zIndices"
63+
:openStatus="state.openStatus"
5864
@update:zIndexOfFilterBox="onMoveFilterBoxToTop"
5965
@update:unselectedFilterValues="onUpdateValueFilter"
6066
@update:openStatusOfFilterBox="onUpdateOpenStatus"
@@ -72,10 +78,13 @@
7278
:attributeNames="rowAttrs"
7379
:allFilters="allFilters"
7480
:valueFilter="state.valueFilter"
81+
:restrictedFromDragDrop="state.restrictedFromDragDrop"
7582
:fixedFromDragDrop="state.fixedFromDragDrop"
7683
:hideFilterBoxOfUnusedAttributes="
7784
state.hideFilterBoxOfUnusedAttributes
7885
"
86+
:zIndices="state.zIndices"
87+
:openStatus="state.openStatus"
7988
@update:zIndexOfFilterBox="onMoveFilterBoxToTop"
8089
@update:unselectedFilterValues="onUpdateValueFilter"
8190
@update:openStatusOfFilterBox="onUpdateOpenStatus"
@@ -216,10 +225,10 @@ const onMoveFilterBoxToTop = ({ attribute }) => {
216225
[attribute]: state.value.maxZIndex
217226
})
218227
}
219-
const onUpdateValueFilter = ({ attribute, valueFilter }) => {
228+
const onUpdateValueFilter = ({ key, value }) => {
220229
updateState('valueFilter', {
221230
...state.value.valueFilter,
222-
[attribute]: valueFilter
231+
[key]: value
223232
})
224233
}
225234
const onUpdateRendererName = rendererName => {
@@ -240,10 +249,10 @@ const onUpdateVals = vals => {
240249
const onDraggedAttribute = ({ key, value }) => {
241250
updateState(key, value)
242251
}
243-
const onUpdateOpenStatus = ({ attribute, status }) => {
252+
const onUpdateOpenStatus = ({ key, value }) => {
244253
updateState('openStatus', {
245254
...state.value.openStatus,
246-
[attribute]: status
255+
[key]: value
247256
})
248257
}
249258
const pivotData = computed(() => new PivotData(state.value))

0 commit comments

Comments
 (0)