Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: プリセット管理ダイアログを編集可能にする #2452

Merged
merged 34 commits into from
Jan 18, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
90985fb
BaseSliderの高さを少し小さめに
takusea Dec 29, 2024
da95662
BaseSliderをホイール操作可能に変更
takusea Dec 29, 2024
581e272
BaseTextFieldのpropsにidを追加
takusea Dec 29, 2024
a956b28
ParameterSliderコンポーネントを追加
takusea Dec 29, 2024
22a725f
プリセット管理ダイアログに編集機能を追加
takusea Dec 29, 2024
1adf83b
TextFieldにchangeイベントを追加
takusea Jan 2, 2025
915fbba
エラー時の枠線表示をborderからoutlineに
takusea Jan 2, 2025
03814a8
BaseSliderにValueCommitイベントを追加
takusea Jan 2, 2025
8f7a24d
プリセットの編集内容を即時反映するように変更
takusea Jan 2, 2025
d6971c7
プリセット名が長いときの表示崩れを修正
takusea Jan 2, 2025
674b85c
BaseListItem内テキストを左揃えに
takusea Jan 2, 2025
fc58807
inputのテキスト色を色変数を用いるように修正
takusea Jan 2, 2025
10ab7c1
リセット時の値をダイアログ表示時の値に変更
takusea Jan 7, 2025
9d354b2
不要な背景色を削除
takusea Jan 7, 2025
226ac82
リセット機能を削除
takusea Jan 10, 2025
7465270
不要なCSSプロパティを削除
takusea Jan 10, 2025
84c7354
Merge branch 'main' into editable-preset-manage-dialog
Hiroshiba Jan 15, 2025
3d3a290
chore: debounce追加とdeep追加とclonecopy追加
Hiroshiba Jan 15, 2025
1e09256
Merge pull request #3 from Hiroshiba/hiho-counter-pr-3d3a2907
takusea Jan 16, 2025
a55a8b3
コメントに注釈を追加
takusea Jan 16, 2025
2f0014f
emitの実行タイミングに関するコメントを追加
takusea Jan 16, 2025
5b50a89
例外をスローするように
takusea Jan 16, 2025
4985566
命名を修正
takusea Jan 16, 2025
e691e2b
update:selectedVoiceのイベントハンドラを切り出し
takusea Jan 16, 2025
1096717
handleInputUpdateの処理を修正
takusea Jan 16, 2025
dae6171
Merge branch 'main' into editable-preset-manage-dialog
Hiroshiba Jan 17, 2025
6d46556
refactor: selectedPresetKeyなどをselectedにまとめてdebounceを簡単に
Hiroshiba Jan 18, 2025
f169858
refactor: handleSelectedVoiceUpdate関数を移動
Hiroshiba Jan 18, 2025
b6ff2ac
refactor: ParameterSliderのインポートパスをv2に変更
Hiroshiba Jan 18, 2025
c9bd70c
[update snapshots]
Hiroshiba Jan 18, 2025
5be461f
docs: Talk/v2ディレクトリのREADME.mdを追加
Hiroshiba Jan 18, 2025
776ef10
(スナップショットを更新)
github-actions[bot] Jan 18, 2025
0f315df
Merge remote-tracking branch 'takusea/editable-preset-manage-dialog' …
Hiroshiba Jan 18, 2025
73ff0a0
fix: ParameterSliderの入力ハンドラ名を変更し、README.mdを更新
Hiroshiba Jan 18, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/components/Base/BaseListItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ defineEmits<{
border: none;
padding: vars.$padding-1 vars.$padding-2;
border-radius: vars.$radius-1;
text-align: left;

&:not(.selected):hover {
background-color: colors.$clear-hovered;
Expand Down
56 changes: 45 additions & 11 deletions src/components/Base/BaseSlider.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
:max
:step
:disabled
:modelValue="[model]"
:modelValue="[modelValue]"
@update:modelValue="
(value) => {
if (value == undefined) {
Expand All @@ -14,6 +14,8 @@
$emit('update:modelValue', value[0]);
}
"
@wheel="onWheel"
@valueCommit="$emit('valueCommit', $event[0])"
>
<SliderTrack class="SliderTrack">
<SliderRange class="SliderRange" />
Expand All @@ -24,20 +26,52 @@

<script setup lang="ts">
import { SliderRange, SliderRoot, SliderThumb, SliderTrack } from "radix-vue";
import { isOnCommandOrCtrlKeyDown } from "@/store/utility";
import { debounce } from "@/helpers/timer";

defineProps<{
min?: number;
max?: number;
step?: number;
disabled?: boolean;
modelValue: number;
}>();
const props = withDefaults(
defineProps<{
min?: number;
max?: number;
step?: number;
scrollStep?: number;
disabled?: boolean;
modelValue: number;
}>(),
{
min: 0,
max: 100,
step: 1,
scrollStep: undefined,
},
);

defineEmits<{
const emit = defineEmits<{
"update:modelValue": [value: number];
valueCommit: [value: number];
}>();

const model = defineModel<number>({ required: true });
const debounceEmitValueCommit = debounce(
(value: number) => emit("valueCommit", value),
300,
);

const onWheel = (event: WheelEvent) => {
if (props.disabled) return;
event.preventDefault();

const delta = event.deltaY > 0 ? -1 : 1;
const scrollStep =
props.scrollStep && !isOnCommandOrCtrlKeyDown(event)
? props.scrollStep
: props.step;

const value = props.modelValue + scrollStep * delta;
const clampedValue = Math.min(props.max, Math.max(props.min, value));

emit("update:modelValue", clampedValue);
debounceEmitValueCommit(clampedValue);
};
</script>

<style lang="scss">
Expand All @@ -49,7 +83,7 @@ const model = defineModel<number>({ required: true });
position: relative;
display: flex;
align-items: center;
height: vars.$size-control;
height: vars.$size-indicator;
cursor: grab;

&:active {
Expand Down
7 changes: 6 additions & 1 deletion src/components/Base/BaseTextField.vue
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
<template>
<div class="wrapper">
<input
:id
v-model="model"
type="text"
class="input"
:class="{ error: hasError }"
:placeholder
:readonly
:disabled
@change="(payload) => $emit('change', payload)"
@click="(payload) => $emit('click', payload)"
/>
<div v-if="hasError" class="error-label">
Expand All @@ -22,9 +24,11 @@ defineProps<{
hasError?: boolean;
readonly?: boolean;
disabled?: boolean;
id?: string;
}>();

defineEmits<{
change: [payload: Event];
click: [payload: MouseEvent];
}>();

Expand Down Expand Up @@ -66,7 +70,8 @@ const model = defineModel<string>();
}

.error {
border: 2px solid colors.$display-warning;
@include mixin.on-focus;
outline-color: colors.$display-warning !important;
}

.error-label {
Expand Down
Loading
Loading