File tree Expand file tree Collapse file tree 2 files changed +11
-10
lines changed
Expand file tree Collapse file tree 2 files changed +11
-10
lines changed Original file line number Diff line number Diff line change 66 filter
77 :placeholder =" placeholder"
88 :maxSelectedLabels =" 3"
9+ :display =" display"
910 class =" w-full"
1011 />
1112 </div >
1213</template >
1314
1415<script setup lang="ts">
1516import MultiSelect from ' primevue/multiselect'
16- import { computed , defineModel } from ' vue'
1717
1818import type { ComboInputSpec } from ' @/schemas/nodeDef/nodeDefSchemaV2'
1919import type { ComponentWidget } from ' @/scripts/domWidget'
@@ -22,10 +22,9 @@ const selectedItems = defineModel<string[]>({ required: true })
2222const { widget } = defineProps <{
2323 widget: ComponentWidget <string []>
2424}>()
25- const options = computed (
26- () => (widget .inputSpec as ComboInputSpec ).options ?? []
27- )
28- const placeholder = computed (
29- () => (widget .inputSpec as ComboInputSpec ).placeholder ?? ' Select items'
30- )
25+
26+ const inputSpec = widget .inputSpec as ComboInputSpec
27+ const options = inputSpec .options ?? []
28+ const placeholder = inputSpec .multi_select ?.placeholder ?? ' Select items'
29+ const display = inputSpec .multi_select ?.chip ? ' chip' : ' comma'
3130 </script >
Original file line number Diff line number Diff line change @@ -12,6 +12,10 @@ const zRemoteWidgetConfig = z.object({
1212 timeout : z . number ( ) . gte ( 0 ) . optional ( ) ,
1313 max_retries : z . number ( ) . gte ( 0 ) . optional ( )
1414} )
15+ const zMultiSelectOption = z . object ( {
16+ placeholder : z . string ( ) . optional ( ) ,
17+ chip : z . boolean ( ) . optional ( )
18+ } )
1519
1620export const zBaseInputOptions = z
1721 . object ( {
@@ -74,9 +78,7 @@ export const zComboInputOptions = zBaseInputOptions.extend({
7478 options : z . array ( zComboOption ) . optional ( ) ,
7579 remote : zRemoteWidgetConfig . optional ( ) ,
7680 /** Whether the widget is a multi-select widget. */
77- multi_select : z . boolean ( ) . optional ( ) ,
78- /** Placeholder when no item is selected in multi-select widget. */
79- placeholder : z . string ( ) . optional ( )
81+ multi_select : zMultiSelectOption . optional ( )
8082} )
8183
8284const zIntInputSpec = z . tuple ( [ z . literal ( 'INT' ) , zIntInputOptions . optional ( ) ] )
You can’t perform that action at this time.
0 commit comments