remove throttle-debounce

This commit is contained in:
Alexander Drozdov
2022-02-16 16:51:02 +02:00
parent 1f23ec5043
commit 70da2bdeb2
6 changed files with 6 additions and 48 deletions
-2
View File
@@ -37,7 +37,6 @@
"object-hash": "^2.1.1",
"robotjs": "^0.6.0",
"tailwindcss": "2.x.x",
"throttle-debounce": "3.0.x",
"tippy.js": "^6.2.7",
"uiohook-napi": "1.0.x",
"vue": "3.2.x",
@@ -53,7 +52,6 @@
"@types/luxon": "^2.0.0",
"@types/node": "^14.0.0",
"@types/object-hash": "^2.0.0",
"@types/throttle-debounce": "^2.1.0",
"@typescript-eslint/eslint-plugin": "^4.9.1",
"@typescript-eslint/parser": "^4.9.1",
"@vue/cli-plugin-eslint": "5.0.0-beta.7",
+1 -1
View File
@@ -65,7 +65,7 @@ for (const lang of LANGUAGES) {
{
const ndjson = fs.readFileSync(`./public/data/${lang}/items.ndjson`, { encoding: 'utf-8' })
let start = 0
/** @type{Map<string, typeof lineStarts[number]} */
/** @type{Map<string, typeof lineStarts[number]>} */
const startsByName = new Map()
while (start !== ndjson.length) {
const end = ndjson.indexOf('\n', start)
@@ -20,12 +20,12 @@
<div class="flex items-baseline gap-x-1">
<div v-if="showQ20Notice" :class="$style['qualityLabel']">{{ t('Q {0}%', [calcQuality]) }}</div>
<div class="flex gap-x-px">
<ui-input-debounced :class="$style['rollInput']" :placeholder="t('min')" :min="rollBounds?.min" :max="rollBounds?.max" :step="changeStep" type="number"
<input :class="$style['rollInput']" :placeholder="t('min')" :min="rollBounds?.min" :max="rollBounds?.max" :step="changeStep" type="number"
v-if="showInputs" ref="inputMinEl"
v-model.number="inputMin" @focus="inputFocus($event, 'min')" :delay="0" />
<ui-input-debounced :class="$style['rollInput']" :placeholder="t('max')" :min="rollBounds?.min" :max="rollBounds?.max" :step="changeStep" type="number"
v-model.number="inputMin" @focus="inputFocus($event, 'min')" @mousewheel.stop>
<input :class="$style['rollInput']" :placeholder="t('max')" :min="rollBounds?.min" :max="rollBounds?.max" :step="changeStep" type="number"
v-if="showInputs" ref="inputMaxEl"
v-model.number="inputMax" @focus="inputFocus($event, 'max')" :delay="0" />
v-model.number="inputMax" @focus="inputFocus($event, 'max')" @mousewheel.stop>
</div>
</div>
</div>
-33
View File
@@ -1,33 +0,0 @@
<template>
<input
:value="modelValue"
@input="update"
@mousewheel="noop">
</template>
<script lang="ts">
import { defineComponent } from 'vue'
import { debounce } from 'throttle-debounce'
export default defineComponent({
name: 'UiInputDebounced',
emits: ['update:modelValue'],
props: {
modelValue: {},
delay: {
type: Number,
default: 350
}
},
setup (props, ctx) {
return {
update: debounce(props.delay, (e: InputEvent) => {
ctx.emit('update:modelValue', (e.target as HTMLInputElement).value)
}),
noop () {
// fixes not working mouseScroll
}
}
}
})
</script>
-2
View File
@@ -2,7 +2,6 @@ import { App } from 'vue'
import AppTitlebar from './AppTitlebar.vue'
import UiRadio from './UiRadio.vue'
import UiToggle from './UiToggle.vue'
import UiInputDebounced from './InputDebounced.vue'
import FullscreenImage from './FullscreenImage.vue'
import Popover from './Popover.vue'
@@ -10,7 +9,6 @@ export default function (app: App) {
app.component(AppTitlebar.name, AppTitlebar)
app.component(UiRadio.name, UiRadio)
app.component(UiToggle.name, UiToggle)
app.component(UiInputDebounced.name, UiInputDebounced)
app.component(FullscreenImage.name, FullscreenImage)
app.component(Popover.name, Popover)
}
+1 -6
View File
@@ -793,11 +793,6 @@
dependencies:
"@types/node" "*"
"@types/throttle-debounce@^2.1.0":
version "2.1.0"
resolved "https://registry.yarnpkg.com/@types/throttle-debounce/-/throttle-debounce-2.1.0.tgz#1c3df624bfc4b62f992d3012b84c56d41eab3776"
integrity sha512-5eQEtSCoESnh2FsiLTxE121IiE60hnMqcb435fShf4bpLRjEu1Eoekht23y6zXS9Ts3l+Szu3TARnTsA0GkOkQ==
"@types/verror@^1.10.3":
version "1.10.5"
resolved "https://registry.yarnpkg.com/@types/verror/-/verror-1.10.5.tgz#2a1413aded46e67a1fe2386800e291123ed75eb1"
@@ -9336,7 +9331,7 @@ thread-loader@^3.0.0:
neo-async "^2.6.2"
schema-utils "^3.0.0"
throttle-debounce@3.0.x, throttle-debounce@3.x.x:
throttle-debounce@3.x.x:
version "3.0.1"
resolved "https://registry.yarnpkg.com/throttle-debounce/-/throttle-debounce-3.0.1.tgz#32f94d84dfa894f786c9a1f290e7a645b6a19abb"
integrity sha512-dTEWWNu6JmeVXY0ZYoPuH5cRIwc0MeGbJwah9KUNYSJwommQpCzTySTpEe8Gs1J23aeWEuAobe4Ag7EHVt/LOg==