Skip to content

Commit

Permalink
feat(VDataIterator): add current items to toggle-select-all event (#9641
Browse files Browse the repository at this point in the history
)

closes #8532
  • Loading branch information
nekosaur authored and johnleider committed Dec 4, 2019
1 parent 65256b2 commit ab28d72
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/api-generator/src/maps/v-data-iterator.js
Expand Up @@ -19,7 +19,7 @@ const DataIteratorEvents = DataEvents.concat([
{ name: 'update:expanded', source: 'v-data-iterator', value: 'any[]' },
{ name: 'item-selected', source: 'v-data-iterator', value: '{ item: any, value: boolean }' },
{ name: 'item-expanded', source: 'v-data-iterator', value: '{ item: any, value: boolean }' },
{ name: 'toggle-select-all', source: 'v-data-iterator', value: '{ value: boolean }' },
{ name: 'toggle-select-all', source: 'v-data-iterator', value: '{ items: any[], value: boolean }' },
])

const DataIteratorSlots = [
Expand Down
Expand Up @@ -153,7 +153,7 @@ export default Themeable.extend({
}

this.selection = selection
this.$emit('toggle-select-all', { value })
this.$emit('toggle-select-all', { items: this.internalCurrentItems, value })
},
isSelectable (item: any): boolean {
return getObjectValueByPath(item, this.selectableKey) !== false
Expand Down
Expand Up @@ -202,7 +202,7 @@ describe('VDataIterator.ts', () => {
await wrapper.vm.$nextTick()

expect(input).toHaveBeenCalledWith(items)
expect(toggleSelectAll).toHaveBeenCalledWith({ value: true })
expect(toggleSelectAll).toHaveBeenCalledWith({ items, value: true })
})

it('should update expansion from the outside', async () => {
Expand Down

0 comments on commit ab28d72

Please sign in to comment.