From 595c937d502defbdec9cdd1b7b827a608e6d131c Mon Sep 17 00:00:00 2001 From: th33xitus Date: Tue, 18 Jan 2022 22:07:27 +0100 Subject: [PATCH] fix: improve machine settings number inputs (#537) * fix: truncate excessive decimal places fix: add `toString` casting to labels fix: disable spinner appropriately Signed-off-by: Dominik Willner * fix: allow smooth time with 3 decimal places Signed-off-by: Dominik Willner * fix: disable both spinners if input value triggers error Signed-off-by: Dominik Willner * feat: add spinnerFactor prop Simple multiplicator that can be used in combination with spinners to increase/decrease values with a different step size. Signed-off-by: Dominik Willner * fix: smooth time step size of 0.001 fix: spinnerFactor of 10 Allows for manual input of numbers with 3 decimal places. Spinners will still increase/decrease by 0.01 Signed-off-by: Dominik Willner * feat: add hasSpinner prop Allows for individually activating/disabling spinners on a number input field Signed-off-by: Dominik Willner * fix: add sane values as spinnerFactor for motion and fw retract spinners Signed-off-by: Dominik Willner * fix: nullish coalescing operator logic Signed-off-by: Dominik Willner --- .../FirmwareRetractionSettingsInput.vue | 31 ++++++++++++---- src/components/inputs/MotionSettingsInput.vue | 31 ++++++++++++---- .../inputs/PressureAdvanceSettingsInput.vue | 31 ++++++++++++---- .../FirmwareRetractionSettings.vue | 32 ++++++++++------ .../MachineSettings/MachineSettingsPanel.vue | 8 ++-- .../panels/MachineSettings/MotionSettings.vue | 37 +++++++++++-------- .../PressureAdvanceSettings.vue | 21 ++++++----- 7 files changed, 130 insertions(+), 61 deletions(-) diff --git a/src/components/inputs/FirmwareRetractionSettingsInput.vue b/src/components/inputs/FirmwareRetractionSettingsInput.vue index 09f1fae5..0874ca94 100644 --- a/src/components/inputs/FirmwareRetractionSettingsInput.vue +++ b/src/components/inputs/FirmwareRetractionSettingsInput.vue @@ -13,8 +13,8 @@ @click:append="resetLimit" :label="label" :suffix="unit" - :append-icon="this.value !== this.defaultValue ? 'mdi-restart' : ''" - :error="(this.value < this.min) || ((this.value > this.max) && this.max !== null)" + :append-icon="value !== defaultValue ? 'mdi-restart' : ''" + :error="error = ((value < min) || ((value > max) && max !== null))" :step="step" :min="min" :max="max" @@ -25,10 +25,24 @@ outlined dense > -