From 2fc2767acde2673afab89c58223e29f68e0ecf27 Mon Sep 17 00:00:00 2001 From: Eric Liu Date: Fri, 19 Feb 2021 15:47:28 -0800 Subject: [PATCH] feat(combo-box): add direction prop --- COMPONENT_INDEX.md | 1 + docs/src/COMPONENT_API.json | 10 ++++++++++ docs/src/pages/components/ComboBox.svx | 11 +++++++++++ src/ComboBox/ComboBox.svelte | 14 ++++++++++---- tests/ComboBox.test.svelte | 1 + types/ComboBox/ComboBox.d.ts | 6 ++++++ 6 files changed, 39 insertions(+), 4 deletions(-) diff --git a/COMPONENT_INDEX.md b/COMPONENT_INDEX.md index 355627b0..35895bcb 100644 --- a/COMPONENT_INDEX.md +++ b/COMPONENT_INDEX.md @@ -611,6 +611,7 @@ export interface ComboBoxItem { | selectedIndex | let | Yes | number | -1 | Set the selected item by value index | | items | let | No | ComboBoxItem[] | [] | Set the combobox items | | itemToString | let | No | (item: ComboBoxItem) => string | (item) => item.text || item.id | Override the display of a combobox item | +| direction | let | No | "bottom" | "top" | "bottom" | Specify the direction of the combobox dropdown menu | | size | let | No | "sm" | "xl" | -- | Set the size of the combobox | | disabled | let | No | boolean | false | Set to `true` to disable the combobox | | titleText | let | No | string | "" | Specify the title text of the combobox | diff --git a/docs/src/COMPONENT_API.json b/docs/src/COMPONENT_API.json index 2bbc6bc8..923ae719 100644 --- a/docs/src/COMPONENT_API.json +++ b/docs/src/COMPONENT_API.json @@ -1189,6 +1189,16 @@ "constant": false, "reactive": true }, + { + "name": "direction", + "kind": "let", + "description": "Specify the direction of the combobox dropdown menu", + "type": "\"bottom\" | \"top\"", + "value": "\"bottom\"", + "isFunction": false, + "constant": false, + "reactive": false + }, { "name": "size", "kind": "let", diff --git a/docs/src/pages/components/ComboBox.svx b/docs/src/pages/components/ComboBox.svx index b94fdde3..014769f0 100644 --- a/docs/src/pages/components/ComboBox.svx +++ b/docs/src/pages/components/ComboBox.svx @@ -30,6 +30,17 @@ items={[ +### Top direction + +Set `direction` to `"top"` for the combobox dropdown menu to appear above the input. + + + ### Light variant {/if}