Skip to content

Commit

Permalink
Disassociate @observable and @Property decorators in ExportControls/F…
Browse files Browse the repository at this point in the history
…acetingControl

PiperOrigin-RevId: 555216786
  • Loading branch information
RyanMullins authored and LIT team committed Aug 9, 2023
1 parent fd6ccba commit d7e5406
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
8 changes: 4 additions & 4 deletions lit_nlp/client/core/faceting_control.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,10 @@ export class FacetingControl extends ReactiveElement {
@observable private features: string[] = [];
@observable private bins: NumericFeatureBins = {};

@observable @property({type: Boolean}) disabled = false;
@observable @property({type: String}) contextName?: string;
@observable @property({type: Number}) binLimit = DEFAULT_BIN_LIMIT;
@observable @property({type: Number}) choiceLimit?: number;
@property({type: Boolean, reflect: true}) disabled = false;
@property({type: String}) contextName?: string;
@property({type: Number}) binLimit = DEFAULT_BIN_LIMIT;
@property({type: Number}) choiceLimit?: number;

static override get styles() {
return [sharedStyles, styles];
Expand Down
6 changes: 2 additions & 4 deletions lit_nlp/client/elements/export_controls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import './popup_container';
import {html} from 'lit';
import {classMap} from 'lit/directives/class-map.js';
import {customElement, property} from 'lit/decorators.js';
import {observable} from 'mobx';
import * as papa from 'papaparse';

import {ReactiveElement} from '../lib/elements';
Expand All @@ -42,7 +41,7 @@ export class ExportControls extends ReactiveElement {
}

/** The default file download name. */
@observable @property({type: String}) downloadFilename = 'data.csv';
@property({type: String}) downloadFilename = 'data.csv';
/** A list of rows of data to download. */
@property({type: Object}) data: SortableTableEntry[][] = [];
/** Column names. */
Expand Down Expand Up @@ -91,8 +90,7 @@ export class ExportControls extends ReactiveElement {
};

const updateFilename = (e: Event) => {
// tslint:disable-next-line:no-any
this.downloadFilename = (e as any).target.value as string;
this.downloadFilename = (e.target as HTMLInputElement).value;
};

function onEnter(e: KeyboardEvent) {
Expand Down

0 comments on commit d7e5406

Please sign in to comment.