Skip to content

Commit

Permalink
fix(controls): mark value props as optional
Browse files Browse the repository at this point in the history
  • Loading branch information
Akryum committed Feb 15, 2023
1 parent 6a3aa4b commit 328f7c6
Show file tree
Hide file tree
Showing 10 changed files with 17 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import HstButton from './HstButton.vue'
const props = defineProps<{
title?: string
modelValue: string
modelValue?: string
options: string[] | number[] | HstControlOption[] | Record<string, string | number>
}>()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import HstWrapper from '../HstWrapper.vue'
import HstSimpleCheckbox from './HstSimpleCheckbox.vue'
const props = defineProps<{
modelValue: boolean
modelValue?: boolean
title?: string
}>()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export default {
import { computed, ref, watch } from 'vue'
const props = defineProps<{
modelValue: boolean
modelValue?: boolean
withToggle?: boolean
}>()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import HstWrapper from '../HstWrapper.vue'
const props = defineProps<{
title?: string
modelValue: number
modelValue?: number
}>()
const emit = defineEmits({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { HstControlOption } from '../../types'
const props = defineProps<{
title?: string
modelValue: string
modelValue?: string
options: HstControlOption[]
}>()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { HstControlOption } from '../../types'
defineProps<{
title?: string
modelValue: string
modelValue?: string
options: Record<string, any> | string[] | HstControlOption[]
}>()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { VTooltip as vTooltip } from 'floating-vue'
const props = defineProps<{
title?: string
modelValue: number
modelValue?: number
min: number
max: number
}>()
Expand Down
2 changes: 1 addition & 1 deletion packages/histoire-controls/src/components/text/HstText.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import HstWrapper from '../HstWrapper.vue'
defineProps<{
title?: string
modelValue: string
modelValue?: string
}>()
const emit = defineEmits({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import HstWrapper from '../HstWrapper.vue'
defineProps<{
title?: string
modelValue: string
modelValue?: string
}>()
const emit = defineEmits({
Expand Down
16 changes: 8 additions & 8 deletions packages/histoire-plugin-svelte/src/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ export interface Hst {
// Controls
Button: typeof SvelteComponentTyped
ButtonGroup: typeof SvelteComponentTyped<{
value: string
value?: string
options: (string | HstControlOption)[]
title?: string
}>
Checkbox: typeof SvelteComponentTyped<{
value: boolean
value?: boolean
title: string
}>
CheckboxList: typeof SvelteComponentTyped<{
Expand All @@ -33,30 +33,30 @@ export interface Hst {
title?: string
}>
Text: typeof SvelteComponentTyped<{
value: string
value?: string
title: string
}>
Number: typeof SvelteComponentTyped<{
value: number
value?: number
title: string
}>
Slider: typeof SvelteComponentTyped<{
value: number
value?: number
title: string
min: number
max: number
}>
Textarea: typeof SvelteComponentTyped<{
value: string
value?: string
title: string
}>
Select: typeof SvelteComponentTyped<{
value: string
value?: string
title: string
options: Record<string, any> | string[] | HstControlOption[]
}>
Radio: typeof SvelteComponentTyped<{
value: string
value?: string
options: HstControlOption[]
title?: string
}>
Expand Down

0 comments on commit 328f7c6

Please sign in to comment.