chore(packages): move the packages to root

This commit is contained in:
Brandy Carney
2018-03-12 16:02:25 -04:00
parent 097f1a2cd3
commit d37623a2ca
1255 changed files with 38 additions and 38 deletions

View File

@ -1,18 +0,0 @@
export function getOrAppendElement(tagName: string): Element {
const element = document.querySelector(tagName);
if (element) {
return element;
}
const tmp = document.createElement(tagName);
document.body.appendChild(tmp);
return tmp;
}
export function isElementNav(element: HTMLElement) {
return element.tagName.toUpperCase() === 'ION-NAV';
}
export function isElementModal(element: HTMLElement) {
return element.classList.contains('modal-wrapper');
}

View File

@ -1,24 +0,0 @@
export function wc(events = {}, obj = {}) {
let storedEl: HTMLElement;
return function (el: HTMLElement) {
(Object as any).entries(events).forEach((keyValues: string[]) => {
const name = keyValues[0];
const value = keyValues[1];
const action = (el) ? el.addEventListener : storedEl.removeEventListener;
if (typeof value === 'function') {
action(name, value);
return;
}
});
if (el) {
(Object as any).entries(obj).forEach((keyValues: string[]) => {
const name = keyValues[0];
const value = keyValues[1];
(el as any)[name] = value;
});
}
storedEl = el;
};
}