Skip to content

Commit

Permalink
chore(bump): deps rb-base v0.0.3 and rb-button v0.0.10 and swap this.…
Browse files Browse the repository at this point in the history
…elms with this.rb.elms
  • Loading branch information
jyounce committed Sep 14, 2018
1 parent 209e45f commit d1c8346
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 31 deletions.
4 changes: 2 additions & 2 deletions src/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
},
"flat": true,
"dependencies": {
"@rapid-build-ui/rb-base": "^0.0.2",
"@rapid-build-ui/rb-button": "^0.0.9"
"@rapid-build-ui/rb-base": "^0.0.3",
"@rapid-build-ui/rb-button": "^0.0.10"
}
}
26 changes: 13 additions & 13 deletions src/client/scripts/rb-popover.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@
}
viewReady() {
super.viewReady && super.viewReady();
this.elms = {
Object.assign(this.rb.elms, {
rbPopover: this.shadowRoot.querySelector('.rb-popover'),
trigger: this.shadowRoot.querySelector('rb-button'),
popover: this.shadowRoot.querySelector('.popover'),
pointer: this.shadowRoot.querySelector('.pointer'),
caption: this.shadowRoot.querySelector('.caption')
}
});
this._hasContent(this.shadowRoot.querySelector('slot'));
this.rb.events.add(window, 'click touchstart', this._windowClickToggle);
if (this.showPopover) this.triggerUpdate();
Expand Down Expand Up @@ -71,20 +71,20 @@
****************/
_updateCssPositionClass(action, position = null) { // :void
const cssClasses = action === 'add' ? [position] : ['left','right','top','bottom'];
this.elms.rbPopover.classList[action](...cssClasses);
this.rb.elms.rbPopover.classList[action](...cssClasses);
}
_updateCssTopStyles(action, dims) { // :void
if (action === 'remove') {
this.elms.pointer.style.top = null;
this.elms.popover.style.top = null;
this.rb.elms.pointer.style.top = null;
this.rb.elms.popover.style.top = null;
return;
}
// must be positioned left or right and have caption and content (css handles the rest)
if (['left','right'].indexOf(this.state.position) === -1) return;
if (!(!!this.caption && this.state.hasContent)) return;
const coords = this._getPopoverCoords(dims);
this.elms.popover.style.top = `${coords.popoverTop}px`;
this.elms.pointer.style.top = `${coords.pointerTop}px`;
this.rb.elms.popover.style.top = `${coords.popoverTop}px`;
this.rb.elms.pointer.style.top = `${coords.pointerTop}px`;
}

/* Coordinates & Dimensions
Expand All @@ -100,10 +100,10 @@
}
_getDimensions() { // :{}
return {
trigger: this.elms.trigger.getBoundingClientRect(),
popover: this.elms.popover.getBoundingClientRect(),
pointer: this.elms.pointer.getBoundingClientRect(),
caption: this.elms.caption && this.elms.caption.getBoundingClientRect(),
trigger: this.rb.elms.trigger.getBoundingClientRect(),
popover: this.rb.elms.popover.getBoundingClientRect(),
pointer: this.rb.elms.pointer.getBoundingClientRect(),
caption: this.rb.elms.caption && this.rb.elms.caption.getBoundingClientRect(),
viewport: {
height: window.innerHeight,
width: window.innerWidth
Expand Down Expand Up @@ -215,8 +215,8 @@
_windowClickToggle(e) { // :void
if (!this.showPopover) return;
const path = e.composedPath();
if (path.includes(this.elms.popover)) return;
if (path.includes(this.elms.trigger)) return;
if (path.includes(this.rb.elms.popover)) return;
if (path.includes(this.rb.elms.trigger)) return;
this.showPopover = false;
}

Expand Down
32 changes: 16 additions & 16 deletions src/client/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,29 @@
# yarn lockfile v1


"@rapid-build-ui/rb-base@^0.0.2":
version "0.0.2"
resolved "https://registry.yarnpkg.com/@rapid-build-ui/rb-base/-/rb-base-0.0.2.tgz#c79683ad6d021a60dce320ff8cbc3bcabf8bddcd"
"@rapid-build-ui/rb-base@^0.0.3":
version "0.0.3"
resolved "https://registry.yarnpkg.com/@rapid-build-ui/rb-base/-/rb-base-0.0.3.tgz#799f2aa04b146122b901a74482572a6aff451399"
dependencies:
lit-html "^0.11.1"
lit-html "^0.11.3"
skatejs "^5.2.4"

"@rapid-build-ui/rb-button@^0.0.9":
version "0.0.9"
resolved "https://registry.yarnpkg.com/@rapid-build-ui/rb-button/-/rb-button-0.0.9.tgz#b11e03c1a4c56fa6ef8303bfd16fb77fa1677b00"
"@rapid-build-ui/rb-button@^0.0.10":
version "0.0.10"
resolved "https://registry.yarnpkg.com/@rapid-build-ui/rb-button/-/rb-button-0.0.10.tgz#e5feba2976ac22dbe6715f16563f0fdd3d4e641b"
dependencies:
"@rapid-build-ui/rb-base" "^0.0.2"
"@rapid-build-ui/rb-icon" "^0.0.7"
"@rapid-build-ui/rb-base" "^0.0.3"
"@rapid-build-ui/rb-icon" "^0.0.8"

"@rapid-build-ui/rb-icon@^0.0.7":
version "0.0.7"
resolved "https://registry.yarnpkg.com/@rapid-build-ui/rb-icon/-/rb-icon-0.0.7.tgz#8641ff3791c5ed579ce2b23ac45ca668b1ffecd5"
"@rapid-build-ui/rb-icon@^0.0.8":
version "0.0.8"
resolved "https://registry.yarnpkg.com/@rapid-build-ui/rb-icon/-/rb-icon-0.0.8.tgz#f796e16b37bb67ec66f64052a8e8ab0880c31e94"
dependencies:
"@rapid-build-ui/rb-base" "^0.0.2"
"@rapid-build-ui/rb-base" "^0.0.3"

lit-html@^0.11.1:
version "0.11.1"
resolved "https://registry.yarnpkg.com/lit-html/-/lit-html-0.11.1.tgz#ad3dcfea1dbaf65fadf335fa1e2bd9ac19255394"
lit-html@^0.11.3:
version "0.11.3"
resolved "https://registry.yarnpkg.com/lit-html/-/lit-html-0.11.3.tgz#34d6eb27ef0c7fdae542c7b50762526704605681"

skatejs@^5.2.4:
version "5.2.4"
Expand Down

0 comments on commit d1c8346

Please sign in to comment.