-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add KeywordList option to SearchAttributeInput
- Loading branch information
1 parent
0de2c30
commit 4a72641
Showing
9 changed files
with
61 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
src/lib/components/workflow/search-attribute-input/list-input.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<script lang="ts"> | ||
import { afterUpdate, onMount } from 'svelte'; | ||
import ChipInput from '$lib/holocene/input/chip-input.svelte'; | ||
import { translate } from '$lib/i18n/translate'; | ||
import type { SearchAttributeInputValue } from '$lib/stores/search-attributes'; | ||
export let value: SearchAttributeInputValue; | ||
let _value = []; | ||
afterUpdate(() => { | ||
value = _value; | ||
}); | ||
onMount(() => { | ||
_value = getInitialValue(value); | ||
}); | ||
function getInitialValue(value: SearchAttributeInputValue) { | ||
if (!value) return []; | ||
if (typeof value === 'string' || typeof value === 'number') return []; | ||
return value; | ||
} | ||
</script> | ||
|
||
<ChipInput | ||
label={translate('common.value')} | ||
id="attribute-value" | ||
bind:chips={_value} | ||
class="w-full" | ||
removeChipButtonLabel={(chip) => | ||
translate('workflows.remove-keyword-label', { keyword: chip })} | ||
/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters