diff --git a/docs/components/drawer/index.html b/docs/components/drawer/index.html index ffa5ec020..e44ad126d 100644 --- a/docs/components/drawer/index.html +++ b/docs/components/drawer/index.html @@ -1,5 +1,6 @@ --- title: Drawer +minver: 0.17.0 also: components/drawer/test.html: Testing - Drawer elements/hx-drawer: @@ -124,4 +125,128 @@

+ +
+
+

Drawer with Positionable Child Elements

+

+ + Positionable elements (e.g., <hx-tooltip> and + <hx-popover>) need to be direct children of the + <hx-drawer> element, and placed in a named slot. + Positionable elements require the [slot="fixed] attribute. +

+
+ +
+
+
+ + + + +
+ + + + + + + + + + +

(triggers scrolling)

+
+
+
+
+ +
+ + Drawer with Slotted Positionable Element + + + +
+

+
+ + + +

+ + + Toggle Popover #1 + +

+
+ +
+ + +
+ + + + +
Tooltip #1
+

+ hx-drawer > hx-tooltip[slot="fixed"] +

+
+ + +
+ Popover #1 +
+ + +

This popover is a slotted child of hx-drawer.

+

hx-drawer > hx-popover[slot="fixed"]

+
+
+
+
+ +
+
+
+
+
{% endblock %} diff --git a/docs/components/drawer/slotted-drawer-demo.js b/docs/components/drawer/slotted-drawer-demo.js new file mode 100644 index 000000000..d74aa859e --- /dev/null +++ b/docs/components/drawer/slotted-drawer-demo.js @@ -0,0 +1,63 @@ +import Util from '../../_util'; + +if (document.getElementById('vue-slottedDrawerDemo')) { + new Vue({ + el: '#vue-slottedDrawerDemo', + data: { + hasSlottedPadding: true, + hasSlottedLengthyContent: false, + drawerTitle: 'Drawer with Slotted Positionable Element', + }, + computed: { + attrBodyClass: function () { + if (this.bodyClasses !== '') { + return `class="${this.bodyClasses}"`; + } + return ''; + }, + bodyClasses: function () { + return this.hasSlottedPadding ? 'hxMd' : ''; + }, + snippet: function () { + return Util.snippet(` + + Drawer with Slotted Positionable Element + + + +
+ + + ... + + +
Tooltip #1
+

+ hx-drawer > hx-tooltip[slot="fixed"] +

+
+ + +
+ Popover #1 +
+ + +

This popover is a slotted child of hx-drawer.

+

hx-drawer > hx-popover[slot="fixed"]

+
+
+ +
+ `); + }, + }, + }); +} diff --git a/docs/docs.js b/docs/docs.js index 2bde28bfb..001fb048f 100644 --- a/docs/docs.js +++ b/docs/docs.js @@ -11,6 +11,7 @@ import './components/button/button-demo'; import './components/checkbox/checkbox-demo'; import './components/choice-tile/choice-tile-demo'; import './components/drawer/drawer-demo'; +import './components/drawer/slotted-drawer-demo'; import './components/dropdown-select/select-demo'; import './components/email/email-control-demo'; import './components/file/drop-zone-demo';