Skip to content

Commit

Permalink
[Version 4.0.0] new release build
Browse files Browse the repository at this point in the history
  • Loading branch information
george committed Mar 29, 2019
1 parent dd7fa9c commit d42e4e5
Show file tree
Hide file tree
Showing 23 changed files with 1,294 additions and 831 deletions.
1,069 changes: 662 additions & 407 deletions dist/undernet.bundle.esm.js

Large diffs are not rendered by default.

951 changes: 576 additions & 375 deletions dist/undernet.bundle.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/undernet.bundle.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/undernet.bundle.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/undernet.bundle.min.js.map

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions dist/undernet.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 7 additions & 8 deletions dist/undernet.css.map

Large diffs are not rendered by default.

Binary file modified dist/undernet.css.zip
Binary file not shown.
Binary file modified dist/undernet.js.zip
Binary file not shown.
4 changes: 2 additions & 2 deletions dist/undernet.min.css

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions dist/undernet.min.css.map

Large diffs are not rendered by default.

Binary file modified dist/undernet.modules.js.zip
Binary file not shown.
Binary file modified dist/undernet.scss.zip
Binary file not shown.
2 changes: 1 addition & 1 deletion js/dist/accordion.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/dist/dropdown.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/dist/modal.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/dist/tooltip.js.map

Large diffs are not rendered by default.

10 changes: 4 additions & 6 deletions js/src/accordion.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,14 +141,14 @@ export default class Accordion extends Utils {
_setupAccordion(button) {
const buttonId = button.getAttribute(Selectors.DATA_TARGET)
const buttonContent = document.getElementById(buttonId)

if (!buttonContent) {
return console.error(Messages.NO_CONTENT_ERROR(buttonId))
}

const accordionRowAttr = this._getAccordionRowAttr(buttonId)
const accordionRow = document.querySelector(accordionRowAttr)

if (!accordionRow) {
return console.error(Messages.NO_ROW_ERROR(buttonId))
}
Expand All @@ -166,7 +166,7 @@ export default class Accordion extends Utils {
buttonContent.setAttribute(Selectors.ARIA_LABELLEDBY, buttonHeader.id)

const contentShouldExpand = accordionRow.getAttribute(Selectors.DATA_VISIBLE)

if (!contentShouldExpand) {
return console.error(Messages.NO_VISIBLE_ERROR(buttonId))
}
Expand Down Expand Up @@ -226,9 +226,7 @@ export default class Accordion extends Utils {
if (this._activeContainer.hasAttribute(Selectors.DATA_TOGGLE_MULTIPLE)) return

const allContentAttr = `${this._activeContainerAttr} [${Selectors.ARIA_HIDDEN}]`
const allRows = nodeListToArray(
`${this._activeContainerAttr} [${Selectors.DATA_VISIBLE}]`
)
const allRows = nodeListToArray(`${this._activeContainerAttr} [${Selectors.DATA_VISIBLE}]`)
const allContent = nodeListToArray(allContentAttr)

const accordionButtonSelector = this._getPossibleAccordionButtonAttrs(this._activeContainerAttr)
Expand Down
1 change: 0 additions & 1 deletion js/src/dropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@ export default class Dropdown extends Utils {
return console.error(Messages.NO_PARENT_ERROR)
}


// dropdown container
this._activeDropdownAttr = `[${Selectors.DATA_DROPDOWN}="${this._activeDropdownId}"]`
this._activeDropdown = document.querySelector(this._activeDropdownAttr)
Expand Down
21 changes: 14 additions & 7 deletions js/src/modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,12 @@ const Events = {
}

const Messages = {
NO_BUTTON_ID_ERROR: "Could not find an id on your [data-modal-button] element. Modal can't be opened.",
NO_MODAL_ID_ERROR: "Could not detect an id on your [data-modal] element. Please add a value matching a button's [data-modal-button] attribute.",
NO_MODAL_ERROR: id => `Could not find a [data-parent='${id}'] attribute within your [data-modal='${id}'] element.`
NO_BUTTON_ID_ERROR:
"Could not find an id on your [data-modal-button] element. Modal can't be opened.",
NO_MODAL_ID_ERROR:
"Could not detect an id on your [data-modal] element. Please add a value matching a button's [data-modal-button] attribute.",
NO_MODAL_ERROR: id =>
`Could not find a [data-parent='${id}'] attribute within your [data-modal='${id}'] element.`,
}

/**
Expand Down Expand Up @@ -115,10 +118,14 @@ export default class Modal extends Utils {
return console.error(Messages.NO_BUTTON_ID_ERROR)
}

this._activeModalOverlay = document.querySelector(`[${Selectors.DATA_MODAL}="${this._activeModalId}"]`)
this._activeModalOverlay = document.querySelector(
`[${Selectors.DATA_MODAL}="${this._activeModalId}"]`
)
this._activeModalSelector = `[${Selectors.DATA_PARENT}='${this._activeModalId}']`
this._activeModal = this._activeModalOverlay.querySelector(this._activeModalSelector)
this._activeModalCloseButtons = nodeListToArray(`${this._activeModalSelector} [${Selectors.DATA_CLOSE}]`)
this._activeModalCloseButtons = nodeListToArray(
`${this._activeModalSelector} [${Selectors.DATA_CLOSE}]`
)

getFocusableElements(this._activeModalSelector).forEach(element => {
element.setAttribute(Selectors.TABINDEX, "0")
Expand Down Expand Up @@ -152,10 +159,10 @@ export default class Modal extends Utils {
*/
_setupModal(instance) {
const modalId = instance.getAttribute(Selectors.DATA_MODAL)

if (!modalId) {
return console.error(Messages.NO_MODAL_ID_ERROR)
}
}

const modal = instance.querySelector(`[${Selectors.DATA_PARENT}='${modalId}']`)

Expand Down
10 changes: 6 additions & 4 deletions js/src/tooltip.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const Events = {
const Messages = {
NO_ID_ERROR: "Could not find your tooltip's id.",
NO_TRIGGER_ERROR: id => `Could not find a tooltip trigger with id of ${id}.`,
NO_TOOLTIP_ERROR: id => `Could not find a tooltip with id of ${id}.`
NO_TOOLTIP_ERROR: id => `Could not find a tooltip with id of ${id}.`,
}

/**
Expand Down Expand Up @@ -84,7 +84,7 @@ export default class Tooltip {
this._activeTrigger = event.target
const tooltipId = this._activeTrigger.getAttribute(Selectors.DATA_TARGET)
this._activeTooltip = document.getElementById(tooltipId)

// align tooltip to its trigger
// -> if the trigger is on the left or right side, use height
// -> else use width
Expand Down Expand Up @@ -139,7 +139,7 @@ export default class Tooltip {
}

/**
* Close a tooltip with the escape key.
* Close a tooltip with the escape key.
* @param {Object} event - The event object
*/
_handleEscapeKeyPress(event) {
Expand Down Expand Up @@ -236,6 +236,8 @@ export default class Tooltip {
*/
_isLeftOrRight() {
const classes = this._activeTooltip.classList
return classes.contains(Selectors.DROP_LEFT_CLASS) || classes.contains(Selectors.DROP_RIGHT_CLASS)
return (
classes.contains(Selectors.DROP_LEFT_CLASS) || classes.contains(Selectors.DROP_RIGHT_CLASS)
)
}
}
3 changes: 2 additions & 1 deletion scss/components/_tooltip.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
display: inline-block;
cursor: pointer;

> *:disabled, > .disabled {
> *:disabled,
> .disabled {
pointer-events: none;
}
}
Expand Down
4 changes: 2 additions & 2 deletions site/docs/download.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ The quickest way to use Undernet is to link the bundled js and minified css usin
<link
rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/undernet@4.0.0/dist/undernet.min.css"
integrity="sha256-elUkx344iJwgNT6UDtgfGHoJ7LYSzdKZVgKc0G8cZT8="
integrity="sha256-pkEmUG/sgYrXlPz7eeYP5xKg+ieGJVFZfv+TFebi+VI="
crossorigin="anonymous"
/>
```
Expand All @@ -17,7 +17,7 @@ The quickest way to use Undernet is to link the bundled js and minified css usin
<script
type="text/javascript"
src="https://cdn.jsdelivr.net/npm/undernet@4.0.0/dist/undernet.bundle.min.js"
integrity="sha256-NMO3AZDAg4UmdomIqe33x7hoTFMV/8hZyf2ZcvG7YWc="
integrity="sha256-H/FMmlnD2nGnnzRR/NTvUXjv971hE/oCb9c3NEmzHGA="
crossorigin="anonymous"
></script>
<script type="text/javascript">
Expand Down

0 comments on commit d42e4e5

Please sign in to comment.