From c7730902d85c4e86a16699bf35913fb0da4b9cae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carl=20G=C3=B6decken?= Date: Fri, 29 Nov 2024 11:32:31 +0100 Subject: [PATCH] feat(RisAutoComplete): add clear button, change styles --- package-lock.json | 11 +++++ package.json | 1 + .../RisAutoComplete/RisAutoComplete.vue | 45 ++++++++++++------- .../RisGhostButton/RisGhostButton.vue | 9 ++++ src/primevue/autocomplete/autocomplete.ts | 9 ++-- 5 files changed, 56 insertions(+), 19 deletions(-) create mode 100644 src/components/RisGhostButton/RisGhostButton.vue diff --git a/package-lock.json b/package-lock.json index 6809573..696945c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,6 +14,7 @@ "@digitalservice4germany/style-dictionary": "~2.0.0", "@eslint/compat": "~1.2.2", "@eslint/js": "~9.14.0", + "@iconify-json/ic": "^1.2.1", "@iconify-json/material-symbols": "~1.2.6", "@iconify-json/mdi": "~1.2.1", "@iconify/vue": "~4.1.2", @@ -924,6 +925,16 @@ "url": "https://github.com/sponsors/nzakas" } }, + "node_modules/@iconify-json/ic": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@iconify-json/ic/-/ic-1.2.1.tgz", + "integrity": "sha512-UjL/bjJP/T5EV881+hTzcfTKVo0KEUjhnMiJcLtPzNgPtU2KZZmRx8BSKKR61H4CN/5FTEbyawGyG0aEt3SwGQ==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@iconify/types": "*" + } + }, "node_modules/@iconify-json/material-symbols": { "version": "1.2.7", "resolved": "https://registry.npmjs.org/@iconify-json/material-symbols/-/material-symbols-1.2.7.tgz", diff --git a/package.json b/package.json index 2af2fe4..03f6119 100644 --- a/package.json +++ b/package.json @@ -61,6 +61,7 @@ "@digitalservice4germany/style-dictionary": "~2.0.0", "@eslint/compat": "~1.2.2", "@eslint/js": "~9.14.0", + "@iconify-json/ic": "^1.2.1", "@iconify-json/material-symbols": "~1.2.6", "@iconify-json/mdi": "~1.2.1", "@iconify/vue": "~4.1.2", diff --git a/src/components/RisAutoComplete/RisAutoComplete.vue b/src/components/RisAutoComplete/RisAutoComplete.vue index 0816226..176e01c 100644 --- a/src/components/RisAutoComplete/RisAutoComplete.vue +++ b/src/components/RisAutoComplete/RisAutoComplete.vue @@ -1,6 +1,8 @@ @@ -84,40 +88,51 @@ defineExpose({ autoCompleteRef }); v-bind="$attrs" :suggestions="props.suggestions" :model-value="innerValue" - @update:model-value="onUpdateInnerValue" - @option-select="(e) => (model = e.value.id)" :dropdown="props.dropdown" - :dropdownMode="props.dropdownMode" + :dropdown-mode="props.dropdownMode" :disabled="props.disabled" - :forceSelection="props.forceSelection" + :force-selection="props.forceSelection" :placeholder="props.placeholder" - :ariaLabel="props.ariaLabel" - :ariaLabelledby="props.ariaLabelledby" + :aria-label="props.ariaLabel" + :aria-labelledby="props.ariaLabelledby" :delay="props.delay" - :completeOnFocus="props.completeOnFocus" + :complete-on-focus="props.completeOnFocus" :typeahead="props.typeahead" - :scrollHeight="props.scrollHeight" + :scroll-height="props.scrollHeight" :loading="props.loading" :invalid="props.invalid" - :autoOptionFocus="props.autoOptionFocus" - :selectOnFocus="props.selectOnFocus" + :auto-option-focus="props.autoOptionFocus" + :select-on-focus="props.selectOnFocus" :fluid="true" - :optionDisabled="props.optionDisabled" + :option-disabled="props.optionDisabled" option-label="label" data-key="value" + @update:model-value="onUpdateInnerValue" + @option-select="(e) => (model = e.value.id)" > -