multiselect: keep defaultItems (no breaking change)
This commit is contained in:
@@ -60,11 +60,11 @@
|
||||
}
|
||||
}
|
||||
|
||||
$: resolvedConfig.defaultValues && handleDefaultValues()
|
||||
$: resolvedConfig.defaultItems && handleDefaultItems()
|
||||
|
||||
function handleDefaultValues() {
|
||||
if (Array.isArray(resolvedConfig.defaultValues)) {
|
||||
const nvalue = resolvedConfig.defaultValues?.map((label) => {
|
||||
function handleDefaultItems() {
|
||||
if (Array.isArray(resolvedConfig.defaultItems)) {
|
||||
const nvalue = resolvedConfig.defaultItems?.map((label) => {
|
||||
return typeof label === 'string' ? label : `NOT_STRING`
|
||||
})
|
||||
value = [...new Set(nvalue)]
|
||||
|
||||
@@ -57,8 +57,8 @@
|
||||
}
|
||||
}
|
||||
|
||||
$: if (resolvedConfig.defaultValues) {
|
||||
selectOptionsByValue(resolvedConfig.defaultValues)
|
||||
$: if (resolvedConfig.defaultItems) {
|
||||
selectOptionsByValue(resolvedConfig.defaultItems)
|
||||
}
|
||||
|
||||
$: outerDiv &&
|
||||
|
||||
@@ -2151,7 +2151,7 @@ This is a paragraph.
|
||||
subFieldType: 'text',
|
||||
value: ['Foo', 'Bar']
|
||||
} as StaticAppInput,
|
||||
defaultValues: {
|
||||
defaultItems: {
|
||||
type: 'static',
|
||||
fieldType: 'array',
|
||||
subFieldType: 'text',
|
||||
@@ -2204,7 +2204,7 @@ This is a paragraph.
|
||||
value: ['Foo', 'Bar'],
|
||||
hasLabeledMode: true
|
||||
} as StaticAppInput,
|
||||
defaultValues: {
|
||||
defaultItems: {
|
||||
type: 'static',
|
||||
fieldType: 'array',
|
||||
subFieldType: 'simplestringselect',
|
||||
|
||||
Reference in New Issue
Block a user