Skip to content

Commit

Permalink
feat: generic change event handlers for settings-editor-form-fieldset
Browse files Browse the repository at this point in the history
  • Loading branch information
valeriansaliou committed Oct 1, 2023
1 parent 372ea8e commit 1a6ea1a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/components/popups/sidebar/SettingsEditorFormFieldset.vue
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
form-field(
v-if="field.type === 'input'"
v-model="field.data.value.inner"
@change="field.data.change"
:name="field.id"
:placeholder="field.data.placeholder"
:disabled="field.data.disabled"
Expand All @@ -51,6 +52,7 @@
form-select(
v-else-if="field.type === 'select'"
v-model="field.data.value.inner"
@change="field.data.change"
:options="field.data.options"
:icon="field.data.icon"
:name="field.id"
Expand All @@ -64,6 +66,7 @@
form-checkbox(
v-else-if="field.type === 'checkbox'"
v-model="field.data.value.inner"
@change="field.data.change"
:name="field.id"
:disabled="field.data.disabled"
size="small"
Expand All @@ -77,6 +80,7 @@
form-toggle(
v-else-if="field.type === 'toggle'"
v-model="field.data.value.inner"
@change="field.data.change"
:name="field.id"
:disabled="field.data.disabled"
)
Expand Down Expand Up @@ -251,6 +255,7 @@ export type FieldsetFieldDataInput = {
value: FieldsetFieldDataInputValue;
placeholder: string;
disabled?: boolean;
change?: (_: string | number) => void;
};

type FieldsetFieldDataInputValue = {
Expand All @@ -264,6 +269,7 @@ export type FieldsetFieldDataSelect = {
icon?: FormSelectIcon;
position?: string;
disabled?: boolean;
change?: (_: string) => void;
};

type FieldsetFieldDataSelectValue = {
Expand All @@ -274,6 +280,7 @@ export type FieldsetFieldDataCheckbox = {
value: FieldsetFieldDataCheckboxValue;
label?: string;
disabled?: boolean;
change?: (_: boolean) => void;
};

type FieldsetFieldDataCheckboxValue = {
Expand All @@ -283,6 +290,7 @@ type FieldsetFieldDataCheckboxValue = {
export type FieldsetFieldDataToggle = {
value: FieldsetFieldDataToggleValue;
disabled?: boolean;
change?: (_: boolean) => void;
};

type FieldsetFieldDataToggleValue = {
Expand Down

0 comments on commit 1a6ea1a

Please sign in to comment.