A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/bootstrap-vue/bootstrap-vue/commit/f6b51e04f074e45e98650034e88c2b5629ad25f6 below:

render data-* attributes on root component… · bootstrap-vue/bootstrap-vue@f6b51e0 · GitHub

File tree Expand file treeCollapse file tree 6 files changed

+24

-22

lines changed

Filter options

Expand file treeCollapse file tree 6 files changed

+24

-22

lines changed Original file line number Diff line number Diff line change

@@ -182,8 +182,6 @@ describe('form-date', () => {

182 182

await waitNT(wrapper.vm)

183 183

await waitRAF()

184 184 185 -

// TBD

186 - 187 185

wrapper.destroy()

188 186

})

189 187 Original file line number Diff line number Diff line change

@@ -32,7 +32,10 @@ const App = {

32 32

h(

33 33

BPopover,

34 34

{

35 -

attrs: { id: 'bar' },

35 +

attrs: {

36 +

id: 'bar',

37 +

'data-foo': 'bar'

38 +

},

36 39

props: {

37 40

target: 'foo',

38 41

triggers: this.triggers,

@@ -156,20 +159,22 @@ describe('b-popover', () => {

156 159

expect($button.attributes('id')).toEqual('foo')

157 160

expect($button.attributes('data-original-title')).not.toBeDefined()

158 161

// ID of the tooltip that will be in the body

159 -

const adb = $button.attributes('aria-describedby')

162 +

const $adb = $button.attributes('aria-describedby')

160 163 161 164

// <b-popover> wrapper

162 165

const $tipHolder = wrapper.findComponent(BPopover)

163 166

expect($tipHolder.exists()).toBe(true)

164 167

expect($tipHolder.element.nodeType).toEqual(Node.COMMENT_NODE)

165 168 166 169

// Find the popover element in the document

167 -

const tip = document.getElementById(adb)

168 -

expect(tip).not.toBe(null)

169 -

expect(tip).toBeInstanceOf(HTMLElement)

170 -

expect(tip.tagName).toEqual('DIV')

171 -

expect(tip.classList.contains('popover')).toBe(true)

172 -

expect(tip.classList.contains('b-popover')).toBe(true)

170 +

const $tip = document.getElementById($adb)

171 +

expect($tip).not.toBe(null)

172 +

expect($tip).toBeInstanceOf(HTMLElement)

173 +

expect($tip.tagName).toEqual('DIV')

174 +

expect($tip.getAttribute('id')).toEqual('bar')

175 +

expect($tip.getAttribute('data-foo')).toEqual('bar')

176 +

expect($tip.classList.contains('popover')).toBe(true)

177 +

expect($tip.classList.contains('b-popover')).toBe(true)

173 178 174 179

// Hide the Popover

175 180

await wrapper.setProps({

@@ -184,8 +189,8 @@ describe('b-popover', () => {

184 189

expect($button.attributes('aria-describedby')).not.toBeDefined()

185 190 186 191

// Popover element should not be in the document

187 -

expect(document.body.contains(tip)).toBe(false)

188 -

expect(document.getElementById(adb)).toBe(null)

192 +

expect(document.body.contains($tip)).toBe(false)

193 +

expect(document.getElementById($adb)).toBe(null)

189 194 190 195

wrapper.destroy()

191 196

})

Original file line number Diff line number Diff line change

@@ -5,13 +5,13 @@

5 5

// Templates are only instantiated when shown, and destroyed when hidden

6 6

//

7 7 8 +

import Popper from 'popper.js'

8 9

import { NAME_POPPER } from '../../../constants/components'

9 10

import Vue from '../../../utils/vue'

10 -

import Popper from 'popper.js'

11 +

import { BVTransition } from '../../../utils/bv-transition'

11 12

import { getCS, requestAF, select } from '../../../utils/dom'

12 13

import { toFloat } from '../../../utils/number'

13 14

import { HTMLElement, SVGElement } from '../../../utils/safe-types'

14 -

import { BVTransition } from '../../../utils/bv-transition'

15 15 16 16

const AttachmentMap = {

17 17

AUTO: 'auto',

@@ -95,12 +95,12 @@ export const BVPopper = /*#__PURE__*/ Vue.extend({

95 95

},

96 96

computed: {

97 97

/* istanbul ignore next */

98 -

templateType() /* istanbul ignore next */ {

98 +

templateType() {

99 99

// Overridden by template component

100 100

return 'unknown'

101 101

},

102 102

popperConfig() {

103 -

const placement = this.placement

103 +

const { placement } = this

104 104

return {

105 105

placement: this.getAttachment(placement),

106 106

modifiers: {

@@ -157,9 +157,6 @@ export const BVPopper = /*#__PURE__*/ Vue.extend({

157 157

// as our propsData is added after `new Template({...})`

158 158

this.attachment = this.getAttachment(this.placement)

159 159

},

160 -

mounted() {

161 -

// TBD

162 -

},

163 160

updated() {

164 161

// Update popper if needed

165 162

// TODO: Should this be a watcher on `this.popperConfig` instead?

Original file line number Diff line number Diff line change

@@ -51,9 +51,13 @@ export const BVTooltipTemplate = /*#__PURE__*/ Vue.extend({

51 51

},

52 52

templateAttributes() {

53 53

return {

54 +

// Apply attributes from root tooltip component

55 +

...this.$parent.$parent.$attrs,

56 + 54 57

id: this.id,

55 58

role: 'tooltip',

56 59

tabindex: '-1',

60 + 57 61

// Add the scoped style data attribute to the template root element

58 62

...this.scopedStyleAttrs

59 63

}

Original file line number Diff line number Diff line change

@@ -110,9 +110,6 @@ const templateData = {

110 110

// @vue/component

111 111

export const BVTooltip = /*#__PURE__*/ Vue.extend({

112 112

name: NAME_TOOLTIP_HELPER,

113 -

props: {

114 -

// None

115 -

},

116 113

data() {

117 114

return {

118 115

// BTooltip/BPopover/VBTooltip/VBPopover will update this data

Original file line number Diff line number Diff line change

@@ -10,6 +10,7 @@ import { BVTooltip } from './helpers/bv-tooltip'

10 10

// @vue/component

11 11

export const BTooltip = /*#__PURE__*/ Vue.extend({

12 12

name: NAME_TOOLTIP,

13 +

inheritAttrs: false,

13 14

props: {

14 15

title: {

15 16

type: String

You can’t perform that action at this time.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4