1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2026-04-23 22:25:56 -04:00

New: Frontend Package and Lint Updates

This commit is contained in:
Qstick
2022-05-19 23:15:43 -05:00
committed by Mark McDowall
parent 2291f3e00e
commit 909af6c874
569 changed files with 4963 additions and 5998 deletions
@@ -2,12 +2,12 @@ import _ from 'lodash';
import PropTypes from 'prop-types';
import React, { Component } from 'react';
import Autosuggest from 'react-autosuggest';
import { icons } from 'Helpers/Props';
import Icon from 'Components/Icon';
import keyboardShortcuts, { shortcuts } from 'Components/keyboardShortcuts';
import SeriesSearchResult from './SeriesSearchResult';
import LoadingIndicator from 'Components/Loading/LoadingIndicator';
import { icons } from 'Helpers/Props';
import FuseWorker from './fuse.worker';
import SeriesSearchResult from './SeriesSearchResult';
import styles from './SeriesSearchInput.css';
const ADD_NEW_TYPE = 'addNew';
@@ -55,12 +55,12 @@ class SeriesSearchInput extends Component {
setAutosuggestRef = (ref) => {
this._autosuggest = ref;
}
};
focusInput = (event) => {
event.preventDefault();
this._autosuggest.input.focus();
}
};
getSectionSuggestions(section) {
return section.suggestions;
@@ -73,11 +73,11 @@ class SeriesSearchInput extends Component {
{
section.loading &&
<LoadingIndicator
className={styles.loading}
rippleClassName={styles.ripple}
size={20}
/>
<LoadingIndicator
className={styles.loading}
rippleClassName={styles.ripple}
size={20}
/>
}
</div>
);
@@ -126,7 +126,7 @@ class SeriesSearchInput extends Component {
}
this.setState({ value: newValue });
}
};
onKeyDown = (event) => {
if (event.shiftKey || event.altKey || event.ctrlKey) {
@@ -171,11 +171,11 @@ class SeriesSearchInput extends Component {
this._autosuggest.input.blur();
this.reset();
}
};
onBlur = () => {
this.reset();
}
};
onSuggestionsFetchRequested = ({ value }) => {
if (!this.state.loading) {
@@ -240,14 +240,14 @@ class SeriesSearchInput extends Component {
this.getWorker().postMessage(payload);
}
}
};
onSuggestionsClearRequested = () => {
this.setState({
suggestions: [],
loading: false
});
}
};
onSuggestionSelected = (event, { suggestion }) => {
if (suggestion.type === ADD_NEW_TYPE) {
@@ -255,7 +255,7 @@ class SeriesSearchInput extends Component {
} else {
this.goToSeries(suggestion);
}
}
};
//
// Render