Skip to content

Commit

Permalink
fix eslint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
ivicic-petr committed Mar 13, 2024
1 parent cbbdb6e commit ffaf75d
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { EditorTile } from './editor-tile'
library.add(faTrash, faMagnifyingGlass)

@customElement('function-tile')
class FunctionTile extends EditorTile {
export class FunctionTile extends EditorTile {
varIndex = 0
constructor () {
super()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { EditorTile } from './editor-tile'
library.add(faTrash, faMagnifyingGlass)

@customElement('variable-tile')
class VariableTile extends EditorTile {
export class VariableTile extends EditorTile {
@property() regulations: IRegulationData[] = []
@property() variables: IVariableData[] = []

Expand Down
2 changes: 1 addition & 1 deletion src/html/component/functions-editor/functions-editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { getNextEssentiality, getNextMonotonicity } from '../../util/utilities'
import { dialog } from '@tauri-apps/api'

@customElement('functions-editor')
class FunctionsEditor extends LitElement {
export class FunctionsEditor extends LitElement {
static styles = css`${unsafeCSS(style_less)}`
@property() contentData: ContentData = ContentData.create()
@state() functions: IFunctionData[] = []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export default class EditObservation extends LitElement {
<div class="uk-margin-small">
<label class="uk-form-label" for="form-horizontal-text">${key.toUpperCase()}</label>
<div class="uk-form-controls">
<input class="uk-input" value="${this.getValue(this.data, key)}" @input="${(e: InputEvent) => { this.setValue(this.data, key, e.target?.value) }}" id="node-id" type="text" placeholder="${key}"/>
<input class="uk-input" value="${this.getValue(this.data, key)}" @input="${(e: InputEvent) => { this.setValue(this.data, key, (e.target as HTMLInputElement).value) }}" id="node-id" type="text" placeholder="${key}"/>
</div>
</div>`
})}
Expand Down
7 changes: 4 additions & 3 deletions src/html/component/regulations-editor/regulations-editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { type Event as TauriEvent } from '@tauri-apps/api/event'
import { ContentData, ElementType, type IRegulationData, type IVariableData } from '../../util/data-interfaces'

@customElement('regulations-editor')
export default class RegulationsEditor extends LitElement {
export class RegulationsEditor extends LitElement {
static styles = css`${unsafeCSS(style_less)}`
dialogs: Record<string, WebviewWindow | undefined> = {}
editorElement
Expand Down Expand Up @@ -101,14 +101,15 @@ export default class RegulationsEditor extends LitElement {
}

private addEdge (event: Event): void {
this.cy?.nodes().deselect()
if (this.cy === undefined) return
this.cy.nodes().deselect()
this.toggleMenu(ElementType.NONE)
const variableId = (event as CustomEvent).detail.id

// start attribute wrongly typed - added weird typecast to avoid tslint error
this.edgeHandles?.start((this.cy?.$id(variableId) as unknown as string))
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-expect-error
// @ts-expect-error renderer exists but its missing from the *.d.ts file
this.cy.renderer().hoverData.capture = true
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { emit, type Event as TauriEvent, once } from '@tauri-apps/api/event'
import { appWindow, LogicalSize } from '@tauri-apps/api/window'

@customElement('rename-dialog')
class RenameDialog extends LitElement {
export class RenameDialog extends LitElement {
static styles = css`${unsafeCSS(style_less)}`
@query('#node-name') nameField: HTMLInputElement | undefined
@query('#node-id') variableIdField: HTMLInputElement | undefined
Expand Down

0 comments on commit ffaf75d

Please sign in to comment.