Skip to content

Commit 8bfb1e7

Browse files
committed
Remove cruft
1 parent 3a8d646 commit 8bfb1e7

File tree

2 files changed

+0
-56
lines changed

2 files changed

+0
-56
lines changed

Diff for: src/omnibox/Omnibox.ts

-33
Original file line numberDiff line numberDiff line change
@@ -136,37 +136,4 @@ export class Omnibox extends Select<OmniOption> {
136136
return html`<temba-icon name="${Icon.contact}"></temba-icon>`;
137137
}
138138
}
139-
140-
/*public getValues(): any[] {
141-
const select = this.shadowRoot.querySelector('temba-select') as Select<any>;
142-
return select.values;
143-
}*/
144-
145-
/*
146-
public render(): TemplateResult {
147-
return html`
148-
<temba-select
149-
name=${this.name}
150-
endpoint=${this.getEndpoint()}
151-
placeholder=${this.placeholder}
152-
queryParam="search"
153-
.label=${this.label}
154-
.helpText=${this.helpText}
155-
.widgetOnly=${this.widgetOnly}
156-
?disabled=${this.disabled}
157-
.errors=${this.errors}
158-
.values=${this.value}
159-
.renderOption=${this.renderOption.bind(this)}
160-
.renderSelectedItem=${this.renderSelection.bind(this)}
161-
.inputRoot=${this}
162-
.isMatch=${this.isMatch}
163-
.infoText=${this.infoText}
164-
searchable
165-
searchOnFocus
166-
multi
167-
><div slot="right">
168-
<slot name="right"></slot></div
169-
></temba-select>
170-
`;
171-
}*/
172139
}

Diff for: src/select/Select.ts

-23
Original file line numberDiff line numberDiff line change
@@ -509,14 +509,11 @@ export class Select<T extends SelectOption> extends FormElement {
509509

510510
private lastQuery: number;
511511

512-
// private cancelToken: CancelTokenSource;
513512
private complete: boolean;
514513
private page: number;
515514
private next: string = null;
516515
private query: string;
517516

518-
private removingSelection: boolean;
519-
520517
private lruCache = lru(20, 60000);
521518

522519
constructor() {
@@ -632,10 +629,6 @@ export class Select<T extends SelectOption> extends FormElement {
632629
'slotchange',
633630
this.handleSlotChange.bind(this)
634631
);
635-
636-
// if (!this.placeholder || this.value) {
637-
// this.checkSelectedOption();
638-
// }
639632
}
640633

641634
public updated(changes: Map<string, any>) {
@@ -646,21 +639,15 @@ export class Select<T extends SelectOption> extends FormElement {
646639
}
647640

648641
if (changes.has('value')) {
649-
// console.log('value from', changes.get('value'), 'to', this.value);
650642
if (this.value && !this.values.length) {
651-
// console.log('setting selected value for value change', this.value);
652643
this.setSelectedValue(this.value);
653644
}
654645
}
655646

656647
if (changes.has('values')) {
657-
// console.log('values from', changes.get('values'), 'to', this.values);
658648
this.updateInputs();
659649
if (this.hasChanges(changes.get('values'))) {
660-
// console.log('firing change', changes.get('values'), this.values);
661650
this.fireEvent('change');
662-
} else {
663-
// console.log('no changes', changes.get('values'), this.values);
664651
}
665652
}
666653

@@ -743,7 +730,6 @@ export class Select<T extends SelectOption> extends FormElement {
743730
}
744731

745732
public setSelectedValue(value: string) {
746-
// console.log('setting value', value);
747733
if (this.staticOptions.length > 0) {
748734
const existing = this.staticOptions.find((option) => {
749735
return this.getValue(option) === value;
@@ -878,7 +864,6 @@ export class Select<T extends SelectOption> extends FormElement {
878864
}
879865

880866
public open(): void {
881-
// this.requestUpdate('input');
882867
(
883868
this.shadowRoot.querySelector('.select-container') as HTMLDivElement
884869
).click();
@@ -1004,11 +989,6 @@ export class Select<T extends SelectOption> extends FormElement {
1004989
if (!this.fetching) {
1005990
this.fetching = true;
1006991

1007-
// make sure we cancel any previous request
1008-
// if (this.cancelToken) {
1009-
// this.cancelToken.cancel();
1010-
// }
1011-
1012992
const options: any = [...this.staticOptions];
1013993
const q = (query || '').trim().toLowerCase();
1014994

@@ -1134,9 +1114,6 @@ export class Select<T extends SelectOption> extends FormElement {
11341114
private handleFocus(): void {
11351115
if (!this.focused && this.visibleOptions.length === 0) {
11361116
this.focused = true;
1137-
//if (this.searchOnFocus && !this.removingSelection) {
1138-
//this.requestUpdate('input');
1139-
//}
11401117
}
11411118
}
11421119

0 commit comments

Comments
 (0)