Skip to content

Commit

Permalink
Merge pull request #1542 from PrefectHQ/allow-adding-class-to-select-…
Browse files Browse the repository at this point in the history
…options

Allow adding class to select options
  • Loading branch information
pleek91 authored Dec 3, 2024
2 parents 71027aa + 70d82ba commit 8c06c21
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/components/Combobox/PCombobox.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<PSelect
v-model="modelValue"
:options="filteredSelectOptions"
:options-class
:empty-message="emptyMessage"
@update:model-value="resetTypedValue"
@close="resetTypedValue"
Expand Down Expand Up @@ -71,10 +72,12 @@
placeholder?: string,
search?: string,
manual?: boolean,
optionsClass?: string,
}>(), {
emptyMessage: undefined,
placeholder: 'Search',
search: undefined,
optionsClass: undefined,
})
const emit = defineEmits<{
Expand Down
2 changes: 2 additions & 0 deletions src/components/Select/PSelect.vue
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
<PSelectOptions
v-model="modelValue"
class="p-select__options"
:class="optionsClass"
:options="options"
:style="styles.option"
:multiple="multiple"
Expand Down Expand Up @@ -117,6 +118,7 @@
emptyMessage?: string,
multiple?: boolean,
small?: boolean,
optionsClass?: string,
}>()
const emit = defineEmits<{
Expand Down
11 changes: 10 additions & 1 deletion src/components/TagsInput/PTagsInput.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
<template>
<PCombobox v-model="internalValue" class="p-tags-input" allow-unknown-value :options="[]" :placeholder="placeholder">
<PCombobox
v-model="internalValue"
class="p-tags-input"
allow-unknown-value
:options="[]"
:placeholder
:options-class
>
<template v-for="(index, name) in $slots" #[name]="data">
<slot :name="name" v-bind="data" />
</template>
Expand All @@ -24,8 +31,10 @@
const props = withDefaults(defineProps<{
modelValue: string[] | null | undefined,
placeholder?: string,
optionsClass?: string,
}>(), {
placeholder: 'Add tag',
optionsClass: undefined,
})
const emit = defineEmits<{
Expand Down

0 comments on commit 8c06c21

Please sign in to comment.