From 32737f85c068124fa3199c630a8f677f545a9a49 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 6 May 2020 04:57:47 -0300 Subject: [PATCH 01/25] chore(deps): update devdependency rollup to ^2.8.0 (#5308) Co-authored-by: Renovate Bot --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index d7c109af88d..2738ad29b86 100644 --- a/package.json +++ b/package.json @@ -149,7 +149,7 @@ "postcss-cli": "^7.1.1", "prettier": "1.14.3", "require-context": "^1.1.0", - "rollup": "^2.7.6", + "rollup": "^2.8.0", "rollup-plugin-babel": "^4.4.0", "rollup-plugin-commonjs": "^10.1.0", "rollup-plugin-node-resolve": "^5.2.0", diff --git a/yarn.lock b/yarn.lock index 17194126fc6..06e08dc18dd 100644 --- a/yarn.lock +++ b/yarn.lock @@ -11423,10 +11423,10 @@ rollup-pluginutils@^2.8.1: dependencies: estree-walker "^0.6.1" -rollup@^2.7.6: - version "2.7.6" - resolved "https://registry.yarnpkg.com/rollup/-/rollup-2.7.6.tgz#8e6682e64ca65eb33b896dcce902696f0415ce1a" - integrity sha512-AdHosxHBKyBsdtbT1/AqbWNQ87O4SSxS4N9iMwEpoCDAT6e4Du3uJSy83mp3ckgmCxly5VeXGx0WHsm21Djytg== +rollup@^2.8.0: + version "2.8.0" + resolved "https://registry.yarnpkg.com/rollup/-/rollup-2.8.0.tgz#a1d63fa8331f5c362f025a7fee78b86d4ada5cef" + integrity sha512-hyjpreMA0BTNrO68o4wCtcktwYTK8o1UtauOqsPniwDGzN2PvNaKmwa/RHmjNHJMrt6ItY2C7XjpT7TDf6WmJw== optionalDependencies: fsevents "~2.1.2" From 27b64b72de92f36974e711f107d9d15545e87f40 Mon Sep 17 00:00:00 2001 From: Troy Morehouse Date: Wed, 6 May 2020 05:24:22 -0300 Subject: [PATCH 02/25] chore: add dedicated documentation for `v-b-toggle` directive and additional popover/tooltip docs updates (closes #5262) (#5306) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore: add dedicated documentation for `v-b-toggle` directive * Update nuxt.config.js * Update package.json * Update index.js * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update package.json * Update README.md * Update package.json * Update README.md Co-authored-by: Jacob Müller --- docs/nuxt.config.js | 2 +- src/components/collapse/README.md | 7 ++- src/components/collapse/index.js | 4 +- src/components/collapse/package.json | 15 +----- src/components/popover/README.md | 22 +++++++- src/components/tooltip/README.md | 23 +++++++- src/directives/toggle/README.md | 78 ++++++++++++++++++++++++++++ src/directives/toggle/package.json | 17 ++++++ 8 files changed, 148 insertions(+), 20 deletions(-) create mode 100644 src/directives/toggle/README.md create mode 100644 src/directives/toggle/package.json diff --git a/docs/nuxt.config.js b/docs/nuxt.config.js index 7e890b428da..3b75ff8dfa2 100644 --- a/docs/nuxt.config.js +++ b/docs/nuxt.config.js @@ -272,7 +272,7 @@ module.exports = { routes: () => [ // Dynamic slug routes ...getRoutesByDir('src', 'components'), - ...getRoutesByDir('src', 'directives', ['modal', 'toggle']), + ...getRoutesByDir('src', 'directives', ['modal']), ...getRoutesByDir('docs/markdown', 'reference') ] }, diff --git a/src/components/collapse/README.md b/src/components/collapse/README.md index 960c3de2d5c..b2a43c44653 100644 --- a/src/components/collapse/README.md +++ b/src/components/collapse/README.md @@ -22,7 +22,8 @@ ## Usage -Other elements can easily toggle `` components using the `v-b-toggle` directive. +Other elements can easily toggle `` components using the +[`v-b-toggle` directive](/docs/directives/toggle). ```html
@@ -300,4 +301,8 @@ query. See the [reduced motion section of our accessibility documentation](/docs/reference/accessibility) for additional details. +## See also + +- [`v-b-toggle` directive](/docs/directives/toggle) + diff --git a/src/components/collapse/index.js b/src/components/collapse/index.js index 026531ac4cf..93ae702332d 100644 --- a/src/components/collapse/index.js +++ b/src/components/collapse/index.js @@ -1,10 +1,10 @@ import { BCollapse } from './collapse' -import { VBToggle } from '../../directives/toggle/toggle' +import { VBTogglePlugin } from '../../directives/toggle' import { pluginFactory } from '../../utils/plugins' const CollapsePlugin = /*#__PURE__*/ pluginFactory({ components: { BCollapse }, - directives: { VBToggle } + plugins: { VBTogglePlugin } }) export { CollapsePlugin, BCollapse } diff --git a/src/components/collapse/package.json b/src/components/collapse/package.json index 063e224e612..4d228382a96 100644 --- a/src/components/collapse/package.json +++ b/src/components/collapse/package.json @@ -4,19 +4,8 @@ "meta": { "title": "Collapse", "description": "Easily toggle content visibility on your pages. Includes support for making accordions.", - "directives": [ - { - "directive": "VBToggle", - "description": "Directive for toggling a collapse by ID", - "expression": "String", - "modifiers": [ - { - "name": "{collapseId}", - "pattern": "[a-zA-Z][a-zA-Z0-9_\\-]*", - "description": "Collapse ID to open. Replace `{collapseId}` with the collapse's ID" - } - ] - } + "plugins": [ + "VBTogglePlugin" ], "components": [ { diff --git a/src/components/popover/README.md b/src/components/popover/README.md index 8d188573c25..d2f120d5572 100644 --- a/src/components/popover/README.md +++ b/src/components/popover/README.md @@ -36,9 +36,29 @@ Things to know when using popover component: - When triggered from hyperlinks that span multiple lines, popovers will be centered. Use `white-space: nowrap;` on your ``s, ``s and ``s to avoid this behavior. +## Target + +The target is the _trigger_ element (or component) that will trigger the popover. The target is +specified via the `target` prop, and can be any of the following: + +- A string identifying the ID of the trigger element (or ID of the root element of a component) +- A reference (ref) to an `HTMLElement` or an `SVGElement` (e.g. via `this.$refs.refName`) +- A reference (ref) to a component that has either an `HTMLElement` or `SVGElement` as its root + element (e.g. via `this.$refs.refName`) +- A function (callback) that returns a reference to an `HTMLElement` or `SVGElement` + +For more information on references, see the official +[Vue documentation](https://vuejs.org/v2/api/#vm-refs). + +**Notes:** + The target element **must** exist in the document before `` is mounted. If the target element is not found during mount, the popover will never open. Always place your `` -component lower in the DOM than your target element. +component lower in the DOM than your target element. This rule also applies if a callback function +is used as target element, since that callback is called only once on mount. + +`HTMLElement` refers to standard HTML elements such as `
`, `