Skip to content

Commit

Permalink
fixed console warnings of prop types
Browse files Browse the repository at this point in the history
  • Loading branch information
stackoverfloweth committed Aug 26, 2022
1 parent 77238b1 commit 3bd54f7
Show file tree
Hide file tree
Showing 15 changed files with 28 additions and 26 deletions.
3 changes: 2 additions & 1 deletion src/components/ButtonGroup/PButtonGroup.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@
const props = withDefaults(defineProps<{
options: ButtonGroupOption[],
modelValue: string | number | null | undefined,
modelValue?: string | number | null,
size?: Size,
}>(), {
modelValue: undefined,
size: 'md',
})
Expand Down
2 changes: 1 addition & 1 deletion src/components/DateInput/PDateButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
import PBaseInput from '@/components/BaseInput/PBaseInput.vue'
const props = defineProps<{
date: Date | null | undefined,
date?: Date | null,
}>()
const buttonElement = ref<HTMLButtonElement>()
Expand Down
6 changes: 3 additions & 3 deletions src/components/DateInput/PDateInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,12 @@
import { bottomRight, topRight, bottomLeft, topLeft } from '@/utilities/position'
const props = defineProps<{
modelValue: Date | null | undefined,
modelValue?: Date | null,
showTime?: boolean,
clearable?: boolean,
disabled?: boolean,
min?: Date | null | undefined,
max?: Date | null | undefined,
min?: Date | null,
max?: Date | null,
}>()
const emits = defineEmits<{
Expand Down
6 changes: 3 additions & 3 deletions src/components/DatePicker/PDatePicker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,11 @@
type Overlay = 'year' | 'month' | 'time' | null
const props = defineProps<{
modelValue: Date | null | undefined,
modelValue?: Date | null,
showTime?: boolean,
clearable?: boolean,
min?: Date | null | undefined,
max?: Date | null | undefined,
min?: Date | null,
max?: Date | null,
}>()
const emits = defineEmits<{
Expand Down
6 changes: 3 additions & 3 deletions src/components/DatePicker/PMonthPicker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@
import { isDateAfter, isDateBefore, keepDateInRange } from '@/utilities/dates'
const props = defineProps<{
modelValue: Date | null | undefined,
min?: Date | null | undefined,
max?: Date | null | undefined,
modelValue?: Date | null,
min?: Date | null,
max?: Date | null,
}>()
const emits = defineEmits<{
Expand Down
6 changes: 3 additions & 3 deletions src/components/DatePicker/PTimePicker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@
import { isDateAfter, isDateBefore, isDateInRange, keepDateInRange } from '@/utilities/dates'
const props = defineProps<{
modelValue: Date | null | undefined,
min?: Date | null | undefined,
max?: Date | null | undefined,
modelValue?: Date | null,
min?: Date | null,
max?: Date | null,
}>()
const emits = defineEmits<{
Expand Down
6 changes: 3 additions & 3 deletions src/components/DatePicker/PYearPicker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
import { isDateInRange, keepDateInRange } from '@/utilities/dates'
const props = defineProps<{
modelValue: Date | null | undefined,
min?: Date | null | undefined,
max?: Date | null | undefined,
modelValue?: Date | null,
min?: Date | null,
max?: Date | null,
}>()
const emits = defineEmits<{
Expand Down
2 changes: 1 addition & 1 deletion src/components/DatePicker/ScrollingPicker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import { isSelectOption, SelectModelValue, SelectOption } from '@/types/selectOption'
const props = defineProps<{
modelValue: string | number | null | undefined,
modelValue?: string | number | null,
options: (string | number | SelectOption)[],
preventFocus?: boolean,
}>()
Expand Down
2 changes: 1 addition & 1 deletion src/components/NativeDateInput/PNativeDateInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
import PIcon from '@/components/Icon/PIcon.vue'
const props = defineProps<{
modelValue: Date | null | undefined,
modelValue?: Date | null,
min?: Date | null,
max?: Date | null,
}>()
Expand Down
2 changes: 1 addition & 1 deletion src/components/NumberInput/PNumberInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import { keys } from '@/types/keyEvent'
const props = defineProps<{
modelValue: number | null | undefined,
modelValue?: number | null,
}>()
const emits = defineEmits<{
Expand Down
2 changes: 1 addition & 1 deletion src/components/TagsArea/PTagsArea.vue
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
import { keys } from '@/types/keyEvent'
const props = defineProps<{
modelValue: string[] | null | undefined,
modelValue?: string[] | null,
}>()
const emits = defineEmits<{
Expand Down
3 changes: 2 additions & 1 deletion src/components/TagsInput/PTagsInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@
import PCombobox from '@/components/Combobox/PCombobox.vue'
const props = withDefaults(defineProps<{
modelValue: string[] | null | undefined,
modelValue?: string[] | null,
placeholder?: string,
}>(), {
modelValue: undefined,
placeholder: 'Add tag',
})
Expand Down
2 changes: 1 addition & 1 deletion src/components/TextInput/PTextInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import PBaseInput from '@/components/BaseInput/PBaseInput.vue'
const props = defineProps<{
modelValue: string | null | undefined,
modelValue?: string | null,
}>()
const emits = defineEmits<{
Expand Down
2 changes: 1 addition & 1 deletion src/components/Textarea/PTextarea.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import PBaseInput from '@/components/BaseInput/PBaseInput.vue'
const props = defineProps<{
modelValue: string | null | undefined,
modelValue?: string | null,
}>()
const emits = defineEmits<{
Expand Down
4 changes: 2 additions & 2 deletions src/utilities/dates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import { useAdjustedDate } from '@/compositions/useAdjustedDate'
import { secondsToApproximateString } from '@/utilities/seconds'

export type DateRange = {
min?: Date | null | undefined,
max?: Date | null | undefined,
min?: Date | null,
max?: Date | null,
}
export type Precision = 'minute' | 'hour' | 'day' | 'month' | 'year'

Expand Down

0 comments on commit 3bd54f7

Please sign in to comment.