ui(all pages): MR!13 - Upgrade to core v0.6

Fixed responsive issue on counter in /members page
Had to modify some CSS files, create templates, modify data-fields in sib-display, clean up and refactor
Removed custom-widgets
This commit is contained in:
Gaëlle Morin
2019-03-25 16:35:36 +01:00
parent 9681943289
commit 05d71de379
27 changed files with 422 additions and 487 deletions

View File

@ -1,93 +0,0 @@
import {Helpers, SIBWidget, store} from 'https://unpkg.com/@startinblox/core@0.6';
class HDAppMail extends SIBWidget {
get template() {
return `<a href="mailto:${this.value}"><div class="icon-envelope"></div><div>SEND A MESSAGE</div></a>`;
}
}
class HDAppMember extends SIBWidget {
get template() {
return `
<div name="${this.name}">
<img src="${this.value.avatar}"/>
</div>
`;
}
render() {
store.get(this.value).then(value => {
this._value = value;
this.innerHTML = this.template;
});
}
}
class HDAppClosingDate extends SIBWidget {
get template() {
return this.value
? `<strong>closed</strong> (${this.value})`
: '<strong>open</strong>';
}
render() {
this.innerHTML = this.template;
}
}
class HDAppAvailable extends SIBWidget {
get template() {
return this.value
? '<strong>Available</strong>'
: '<strong>Not available</strong>';
}
render() {
this.innerHTML = this.template;
}
}
class HDAppHyperlink extends SIBWidget {
get template() {
const escaped = this.value
.replace(/&/g, '&amp;')
.replace(/</g, '&lt;')
.replace(/>/g, '&gt;')
.replace(/"/g, '&quot;')
.replace(/'/g, '&#039;');
return `<a href="${escaped}">${escaped}</a>`;
}
render() {
this.innerHTML = this.template;
}
}
class HDAppLinkMore extends SIBWidget {
get template() {
const id = Helpers.uniqID();
return `
${this.label}
${this.name}
${this.escapedValue}
`;
}
}
class HDAppFormText extends SIBWidget {
get template() {
return `<p name="${this.name}">${this.value}</p>`;
}
render() {
this.innerHTML = this.template;
}
}
customElements.define('hdapp-mail', HDAppMail);
customElements.define('hdapp-member', HDAppMember);
customElements.define('hdapp-closing-date', HDAppClosingDate);
customElements.define('hdapp-available', HDAppAvailable);
customElements.define('hdapp-hyperlink', HDAppHyperlink);
customElements.define('hdapp-link-more', HDAppLinkMore);
customElements.define('hdapp-form-text', HDAppFormText);