Skip to content

Commit 595a5f3

Browse files
committed
feat(PrimeListbox): add additional props for enhanced functionality
1 parent 67d3be9 commit 595a5f3

File tree

2 files changed

+18
-3
lines changed

2 files changed

+18
-3
lines changed

src/components/PrimeListbox.vue

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
<script setup lang='ts'>
1+
<script setup lang="ts">
22
import type { FormKitFrameworkContext } from '@formkit/core'
33
import type { ListboxProps } from 'primevue/listbox'
4-
54
import type { PropType } from 'vue'
65
import { useFormKitInput } from '../composables'
76
@@ -20,6 +19,16 @@ export interface FormKitPrimeListboxProps {
2019
filterMatchMode?: ListboxProps['filterMatchMode']
2120
autoOptionFocus?: ListboxProps['autoOptionFocus']
2221
selectOnFocus?: ListboxProps['selectOnFocus']
22+
optionDisabled?: ListboxProps['optionDisabled']
23+
optionGroupLabel?: ListboxProps['optionGroupLabel']
24+
optionGroupChildren?: ListboxProps['optionGroupChildren']
25+
listStyle?: ListboxProps['listStyle']
26+
dataKey?: ListboxProps['dataKey']
27+
metaKeySelection?: ListboxProps['metaKeySelection']
28+
virtualScrollerOptions?: ListboxProps['virtualScrollerOptions']
29+
tabindex?: ListboxProps['tabindex']
30+
ariaLabel?: ListboxProps['ariaLabel']
31+
ariaLabelledby?: ListboxProps['ariaLabelledby']
2332
}
2433
2534
const props = defineProps({
@@ -49,6 +58,9 @@ const { validSlotNames, unstyled, isInvalid, handleInput, handleBlur } = useForm
4958
:options="context?.options"
5059
:option-label="context.optionLabel"
5160
:option-value="context.optionValue"
61+
:option-disabled="context.optionDisabled"
62+
:option-group-label="context.optionGroupLabel"
63+
:option-group-children="context.optionGroupChildren"
5264
:multiple="context.multiple ?? false"
5365
:filter="context.filter ?? false"
5466
:filter-icon="context.filterIcon"
@@ -57,6 +69,9 @@ const { validSlotNames, unstyled, isInvalid, handleInput, handleBlur } = useForm
5769
:filter-match-mode="context.filterMatchMode"
5870
:auto-option-focus="context.autoOptionFocus ?? true"
5971
:select-on-focus="context.selectOnFocus ?? false"
72+
:data-key="context.dataKey"
73+
:meta-key-selection="context.metaKeySelection ?? false"
74+
:virtual-scroller-options="context.virtualScrollerOptions"
6075
:pt="context.pt"
6176
:pt-options="context.ptOptions"
6277
:unstyled="unstyled"

src/definitions/input.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ export const primeMultiSelectDefinition: FormKitTypeDefinition = createInput(Pri
7979
})
8080

8181
export const primeListboxDefinition: FormKitTypeDefinition = createInput(PrimeListbox, {
82-
props: ['pt', 'ptOptions', 'unstyled', 'options', 'optionLabel', 'optionValue', 'multiple', 'filter', 'filterIcon', 'filterPlaceholder', 'filterLocale', 'filterMatchMode', 'autoOptionFocus', 'selectOnFocus'],
82+
props: ['pt', 'ptOptions', 'unstyled', 'options', 'optionLabel', 'optionValue', 'multiple', 'filter', 'filterIcon', 'filterPlaceholder', 'filterLocale', 'filterMatchMode', 'autoOptionFocus', 'selectOnFocus', 'optionDisabled', 'optionGroupLabel', 'optionGroupChildren', 'dataKey', 'metaKeySelection', 'virtualScrollerOptions'],
8383
family: 'PrimeInput',
8484
})
8585

0 commit comments

Comments
 (0)