mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-03 02:20:19 +08:00
chore: fix eslint in blocksuite (#9232)
This commit is contained in:
+2
-2
@@ -82,13 +82,13 @@ export class FilterConditionView extends SignalWatcher(ShadowlessElement) {
|
||||
}
|
||||
`;
|
||||
|
||||
private onClickButton = (evt: Event) => {
|
||||
private readonly onClickButton = (evt: Event) => {
|
||||
this.popConditionEdit(
|
||||
popupTargetFromElement(evt.currentTarget as HTMLElement)
|
||||
);
|
||||
};
|
||||
|
||||
private popConditionEdit = (target: PopupTarget) => {
|
||||
private readonly popConditionEdit = (target: PopupTarget) => {
|
||||
const type = this.leftVar$.value?.type;
|
||||
if (!type) {
|
||||
return;
|
||||
|
||||
+4
-4
@@ -184,7 +184,7 @@ export class FilterGroupView extends SignalWatcher(ShadowlessElement) {
|
||||
}
|
||||
`;
|
||||
|
||||
private _addNew = (e: MouseEvent) => {
|
||||
private readonly _addNew = (e: MouseEvent) => {
|
||||
if (this.isMaxDepth) {
|
||||
this.onChange({
|
||||
...this.filterGroup.value,
|
||||
@@ -202,7 +202,7 @@ export class FilterGroupView extends SignalWatcher(ShadowlessElement) {
|
||||
});
|
||||
};
|
||||
|
||||
private _selectOp = (event: MouseEvent) => {
|
||||
private readonly _selectOp = (event: MouseEvent) => {
|
||||
popFilterableSimpleMenu(
|
||||
popupTargetFromElement(event.currentTarget as HTMLElement),
|
||||
[
|
||||
@@ -228,7 +228,7 @@ export class FilterGroupView extends SignalWatcher(ShadowlessElement) {
|
||||
);
|
||||
};
|
||||
|
||||
private _setFilter = (index: number, filter: Filter) => {
|
||||
private readonly _setFilter = (index: number, filter: Filter) => {
|
||||
this.onChange({
|
||||
...this.filterGroup.value,
|
||||
conditions: this.filterGroup.value.conditions.map((v, i) =>
|
||||
@@ -237,7 +237,7 @@ export class FilterGroupView extends SignalWatcher(ShadowlessElement) {
|
||||
});
|
||||
};
|
||||
|
||||
private opMap = {
|
||||
private readonly opMap = {
|
||||
and: 'And',
|
||||
or: 'Or',
|
||||
};
|
||||
|
||||
+3
-3
@@ -77,7 +77,7 @@ export class FilterBar extends SignalWatcher(ShadowlessElement) {
|
||||
}
|
||||
`;
|
||||
|
||||
private _setFilter = (index: number, filter: Filter) => {
|
||||
private readonly _setFilter = (index: number, filter: Filter) => {
|
||||
this.onChange({
|
||||
...this.filterGroup.value,
|
||||
conditions: this.filterGroup.value.conditions.map((v, i) =>
|
||||
@@ -86,7 +86,7 @@ export class FilterBar extends SignalWatcher(ShadowlessElement) {
|
||||
});
|
||||
};
|
||||
|
||||
private addFilter = (e: MouseEvent) => {
|
||||
private readonly addFilter = (e: MouseEvent) => {
|
||||
const element = popupTargetFromElement(e.target as HTMLElement);
|
||||
popCreateFilter(element, {
|
||||
vars: this.vars,
|
||||
@@ -103,7 +103,7 @@ export class FilterBar extends SignalWatcher(ShadowlessElement) {
|
||||
});
|
||||
};
|
||||
|
||||
private expandGroup = (position: PopupTarget, i: number) => {
|
||||
private readonly expandGroup = (position: PopupTarget, i: number) => {
|
||||
if (this.filterGroup.value.conditions[i]?.type !== 'group') {
|
||||
return;
|
||||
}
|
||||
|
||||
+2
-2
@@ -158,7 +158,7 @@ export class FilterRootView extends SignalWatcher(ShadowlessElement) {
|
||||
}
|
||||
`;
|
||||
|
||||
private _setFilter = (index: number, filter: Filter) => {
|
||||
private readonly _setFilter = (index: number, filter: Filter) => {
|
||||
this.onChange({
|
||||
...this.filterGroup.value,
|
||||
conditions: this.filterGroup.value.conditions.map((v, i) =>
|
||||
@@ -167,7 +167,7 @@ export class FilterRootView extends SignalWatcher(ShadowlessElement) {
|
||||
});
|
||||
};
|
||||
|
||||
private expandGroup = (position: PopupTarget, i: number) => {
|
||||
private readonly expandGroup = (position: PopupTarget, i: number) => {
|
||||
if (this.filterGroup.value.conditions[i]?.type !== 'group') {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -93,7 +93,7 @@ export class DataViewHeaderToolsSearch extends WidgetBase<
|
||||
> {
|
||||
static override styles = styles;
|
||||
|
||||
private _clearSearch = () => {
|
||||
private readonly _clearSearch = () => {
|
||||
this._searchInput.value = '';
|
||||
this.view.setSearch('');
|
||||
this.preventBlur = true;
|
||||
@@ -102,25 +102,25 @@ export class DataViewHeaderToolsSearch extends WidgetBase<
|
||||
});
|
||||
};
|
||||
|
||||
private _clickSearch = (e: MouseEvent) => {
|
||||
private readonly _clickSearch = (e: MouseEvent) => {
|
||||
e.stopPropagation();
|
||||
this.showSearch = true;
|
||||
};
|
||||
|
||||
private _onSearch = (event: InputEvent) => {
|
||||
private readonly _onSearch = (event: InputEvent) => {
|
||||
const el = event.target as HTMLInputElement;
|
||||
const inputValue = el.value.trim();
|
||||
this.view.setSearch(inputValue);
|
||||
};
|
||||
|
||||
private _onSearchBlur = () => {
|
||||
private readonly _onSearchBlur = () => {
|
||||
if (this._searchInput.value || this.preventBlur) {
|
||||
return;
|
||||
}
|
||||
this.showSearch = false;
|
||||
};
|
||||
|
||||
private _onSearchKeydown = (event: KeyboardEvent) => {
|
||||
private readonly _onSearchKeydown = (event: KeyboardEvent) => {
|
||||
if (event.key === 'Escape') {
|
||||
if (this._searchInput.value) {
|
||||
this._searchInput.value = '';
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@ const styles = css`
|
||||
export class DataViewHeaderToolsAddRow extends WidgetBase {
|
||||
static override styles = styles;
|
||||
|
||||
private _onAddNewRecord = () => {
|
||||
private readonly _onAddNewRecord = () => {
|
||||
if (this.readonly) return;
|
||||
this.viewMethods.addRow?.('start');
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user