Skip to content

Commit

Permalink
Merge 48facc6 into 19695cb
Browse files Browse the repository at this point in the history
  • Loading branch information
sghoweri committed Nov 18, 2018
2 parents 19695cb + 48facc6 commit ffe4359
Show file tree
Hide file tree
Showing 35 changed files with 732 additions and 21,822 deletions.
36 changes: 23 additions & 13 deletions apps/bolt-site/components/bolt-select/bolt-select.standalone.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,17 @@

import { props, define } from '@bolt/core/utils';
import Choices from 'choices.js/assets/scripts/dist/choices.js';
import { wire, withHyperHtml } from '@bolt/core/renderers';
import {
withLitHtml,
html,
// render,
} from '@bolt/core/renderers/renderer-lit-html';
import { filterObject, isDefined, createSelectOptionData } from './utils';

import styles from './bolt-select.scss';

@define
class BoltSelect extends withHyperHtml() {
class BoltSelect extends withLitHtml() {
static is = 'bolt-select';

static props = {
Expand Down Expand Up @@ -201,31 +205,37 @@ class BoltSelect extends withHyperHtml() {
switch (this.type) {
case 'single':
default:
this.element = wire()`
<select name=${this.props.name || null} class="js-bolt-select-root">
this.element = html`
<select name="${this.props.name || null}" class="js-bolt-select-root">
${this.value ? createSelectOptions(this.value) : null}
</select>
`;
break;
case 'multiple':
this.element = wire()`
<select multiple name=${this.props.name ||
null} class="js-bolt-select-root">
this.element = html`
<select
multiple
name="${this.props.name || null}"
class="js-bolt-select-root"
>
${this.value ? createSelectOptions(this.value) : null}
</select>
`;
break;
case 'text':
this.element = wire()`
<input type="text" value=${this.value} name=${this.props.name ||
null} class="js-bolt-select-root" />
this.element = html`
<input
type="text"
value="${this.value}"
name="${this.props.name || null}"
class="js-bolt-select-root"
/>
`;
break;
}

return this.html`
${this.addStyles([styles])}
${this.element}
return html`
${this.addStyles([styles])} ${this.element}
`;
}

Expand Down

0 comments on commit ffe4359

Please sign in to comment.