#39 eslint changes

This commit is contained in:
Agriya Dev5
2021-01-19 13:58:45 +05:30
parent b08ca41d37
commit 18c16dbf37
5 changed files with 27 additions and 30 deletions

View File

@@ -1,4 +1,3 @@
/* eslint-disable node/no-unpublished-import */
import '../dialogs/se-elix/define/NumberSpinBox.js'; import '../dialogs/se-elix/define/NumberSpinBox.js';
const template = document.createElement('template'); const template = document.createElement('template');

View File

@@ -101,7 +101,7 @@ export class SeExportDialog extends HTMLElement {
this.$okBtn = this._shadowRoot.querySelector('#export_ok'); this.$okBtn = this._shadowRoot.querySelector('#export_ok');
this.$cancelBtn = this._shadowRoot.querySelector('#export_cancel'); this.$cancelBtn = this._shadowRoot.querySelector('#export_cancel');
this.$exportOption = this._shadowRoot.querySelector('#se-storage-pref'); this.$exportOption = this._shadowRoot.querySelector('#se-storage-pref');
this.$qualityCont = this._shadowRoot.querySelector('#se-quality'); this.$qualityCont = this._shadowRoot.querySelector('#se-quality');
this.$input = this._shadowRoot.querySelector('elix-number-spin-box'); this.$input = this._shadowRoot.querySelector('elix-number-spin-box');
this.value = 1; this.value = 1;
} }

View File

@@ -1,3 +1,4 @@
/* eslint-disable class-methods-use-this */
/* eslint-disable node/no-unpublished-import */ /* eslint-disable node/no-unpublished-import */
import { import {
defaultState, defaultState,
@@ -44,6 +45,7 @@ class NumberSpinBox extends SpinBox {
} }
/** /**
* @function formatValue
* Format the numeric value as a string. * Format the numeric value as a string.
* *
* This is used after incrementing/decrementing the value to reformat the * This is used after incrementing/decrementing the value to reformat the
@@ -51,6 +53,7 @@ class NumberSpinBox extends SpinBox {
* *
* @param {number} value * @param {number} value
* @param {number} precision * @param {number} precision
* @returns {number}
*/ */
formatValue (value, precision) { formatValue (value, precision) {
return Number(value).toFixed(precision); return Number(value).toFixed(precision);
@@ -97,19 +100,21 @@ class NumberSpinBox extends SpinBox {
} }
/** /**
* Parse the given string as a number. * @function parseValue
* * @param {number} value
* This is used to parse the current value before incrementing/decrementing
* it.
*
* @param {string} value
* @param {number} precision * @param {number} precision
* @returns {int}
*/ */
parseValue(value, precision) { parseValue (value, precision) {
const parsed = precision === 0 ? parseInt(value) : parseFloat(value); const parsed = precision === 0 ? parseInt(value) : parseFloat(value);
return isNaN(parsed) ? 0 : parsed; return isNaN(parsed) ? 0 : parsed;
} }
/**
* @function stateEffects
* @param {any} state
* @param {any} changed
* @returns {any}
*/
[stateEffects] (state, changed) { [stateEffects] (state, changed) {
const effects = super[stateEffects]; const effects = super[stateEffects];
// If step changed, calculate its precision (number of digits after // If step changed, calculate its precision (number of digits after
@@ -175,19 +180,16 @@ class NumberSpinBox extends SpinBox {
} }
/** /**
* The amount by which the `value` will be incremented or decremented. * @function get
* * @returns {any}
* The precision of the step (the number of digits after any decimal)
* determines how the spin box will format the number. The default `step`
* value of 1 has no decimals, so the `value` will be formatted as an integer.
* A `step` of 0.1 will format the `value` as a number with one decimal place.
*
* @type {number}
* @default 1
*/ */
get step () { get step () {
return this[state].step; return this[state].step;
} }
/**
* @function set
* @returns {void}
*/
set step (step) { set step (step) {
if (!isNaN(step)) { if (!isNaN(step)) {
this[setState]({ this[setState]({
@@ -197,10 +199,8 @@ class NumberSpinBox extends SpinBox {
} }
/** /**
* Decrements the `value` by the amount of the `step`. * @function stepDown
* * @returns {void}
* If the result is still greater than the `max` value, this will force
* `value` to `max`.
*/ */
stepDown () { stepDown () {
super.stepDown(); super.stepDown();
@@ -222,10 +222,8 @@ class NumberSpinBox extends SpinBox {
} }
/** /**
* Increments the `value` by the amount of the `step`. * @function stepUp
* * @returns {void}
* If the result is still smaller than the `min` value, this will force
* `value` to `min`.
*/ */
stepUp () { stepUp () {
super.stepUp(); super.stepUp();

View File

@@ -42,7 +42,7 @@ export class SePromptDialog extends HTMLElement {
} }
break; break;
default: default:
console.error('unkonw attr for:', name, 'newValue =', newValue); // console.log('unkonw attr for:', name, 'newValue =', newValue);
break; break;
} }
} }

View File

@@ -1,4 +1,4 @@
/* globals jQuery seConfirm seAlert seSelect */ /* globals jQuery seConfirm seAlert */
/** /**
* The main module for the visual SVG this. * The main module for the visual SVG this.
* *
@@ -993,7 +993,7 @@ class Editor extends EditorStartup {
} }
/** /**
* * @function copySelected
* @returns {void} * @returns {void}
*/ */
copySelected () { copySelected () {