#39 eslint changes
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
/* eslint-disable node/no-unpublished-import */
|
||||
import '../dialogs/se-elix/define/NumberSpinBox.js';
|
||||
|
||||
const template = document.createElement('template');
|
||||
|
||||
@@ -101,7 +101,7 @@ export class SeExportDialog extends HTMLElement {
|
||||
this.$okBtn = this._shadowRoot.querySelector('#export_ok');
|
||||
this.$cancelBtn = this._shadowRoot.querySelector('#export_cancel');
|
||||
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.value = 1;
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
/* eslint-disable class-methods-use-this */
|
||||
/* eslint-disable node/no-unpublished-import */
|
||||
import {
|
||||
defaultState,
|
||||
@@ -44,6 +45,7 @@ class NumberSpinBox extends SpinBox {
|
||||
}
|
||||
|
||||
/**
|
||||
* @function formatValue
|
||||
* Format the numeric value as a string.
|
||||
*
|
||||
* This is used after incrementing/decrementing the value to reformat the
|
||||
@@ -51,6 +53,7 @@ class NumberSpinBox extends SpinBox {
|
||||
*
|
||||
* @param {number} value
|
||||
* @param {number} precision
|
||||
* @returns {number}
|
||||
*/
|
||||
formatValue (value, precision) {
|
||||
return Number(value).toFixed(precision);
|
||||
@@ -97,19 +100,21 @@ class NumberSpinBox extends SpinBox {
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse the given string as a number.
|
||||
*
|
||||
* This is used to parse the current value before incrementing/decrementing
|
||||
* it.
|
||||
*
|
||||
* @param {string} value
|
||||
* @function parseValue
|
||||
* @param {number} value
|
||||
* @param {number} precision
|
||||
* @returns {int}
|
||||
*/
|
||||
parseValue(value, precision) {
|
||||
parseValue (value, precision) {
|
||||
const parsed = precision === 0 ? parseInt(value) : parseFloat(value);
|
||||
return isNaN(parsed) ? 0 : parsed;
|
||||
}
|
||||
|
||||
/**
|
||||
* @function stateEffects
|
||||
* @param {any} state
|
||||
* @param {any} changed
|
||||
* @returns {any}
|
||||
*/
|
||||
[stateEffects] (state, changed) {
|
||||
const effects = super[stateEffects];
|
||||
// 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.
|
||||
*
|
||||
* 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
|
||||
* @function get
|
||||
* @returns {any}
|
||||
*/
|
||||
get step () {
|
||||
return this[state].step;
|
||||
}
|
||||
/**
|
||||
* @function set
|
||||
* @returns {void}
|
||||
*/
|
||||
set step (step) {
|
||||
if (!isNaN(step)) {
|
||||
this[setState]({
|
||||
@@ -197,10 +199,8 @@ class NumberSpinBox extends SpinBox {
|
||||
}
|
||||
|
||||
/**
|
||||
* Decrements the `value` by the amount of the `step`.
|
||||
*
|
||||
* If the result is still greater than the `max` value, this will force
|
||||
* `value` to `max`.
|
||||
* @function stepDown
|
||||
* @returns {void}
|
||||
*/
|
||||
stepDown () {
|
||||
super.stepDown();
|
||||
@@ -222,10 +222,8 @@ class NumberSpinBox extends SpinBox {
|
||||
}
|
||||
|
||||
/**
|
||||
* Increments the `value` by the amount of the `step`.
|
||||
*
|
||||
* If the result is still smaller than the `min` value, this will force
|
||||
* `value` to `min`.
|
||||
* @function stepUp
|
||||
* @returns {void}
|
||||
*/
|
||||
stepUp () {
|
||||
super.stepUp();
|
||||
|
||||
@@ -42,7 +42,7 @@ export class SePromptDialog extends HTMLElement {
|
||||
}
|
||||
break;
|
||||
default:
|
||||
console.error('unkonw attr for:', name, 'newValue =', newValue);
|
||||
// console.log('unkonw attr for:', name, 'newValue =', newValue);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* globals jQuery seConfirm seAlert seSelect */
|
||||
/* globals jQuery seConfirm seAlert */
|
||||
/**
|
||||
* The main module for the visual SVG this.
|
||||
*
|
||||
@@ -993,7 +993,7 @@ class Editor extends EditorStartup {
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @function copySelected
|
||||
* @returns {void}
|
||||
*/
|
||||
copySelected () {
|
||||
|
||||
Reference in New Issue
Block a user