diff --git a/docs/pages/webitel-ui/components/wt-search-bar/Readme.md b/docs/pages/webitel-ui/components/wt-search-bar/Readme.md index 1833cc98..990dda6f 100644 --- a/docs/pages/webitel-ui/components/wt-search-bar/Readme.md +++ b/docs/pages/webitel-ui/components/wt-search-bar/Readme.md @@ -1,18 +1,40 @@ # WtSearchBar ## Props -::: raw - -::: + +| Name | Type | Default | Description | +|---------------------|----------|----------|-------------------------------------------| +| `value` | `String` | `''` | The value of the search bar | +| `placeholder` | `String` | 'Search' | The placeholder of the search bar | +| `hint` | `String` | `''` | The hint of the search bar | +| `v` | `Object` | `''` | Validation object | +| `customValidators` | `Array` | `[]` | Custom validators for validation object | +| `searchMode` | `String` | `''` | The search mode of the search bar | +| `searchModeOptions` | `Array` | `[]` | The search mode options of the search bar | + +## Events + +| Name | Params | Description | +|----------|-------------------|------------------------------------------------------------------------------------------------------------| +| `input` | `value`: `String` | Emitted when the value of the search bar changes (not debounced!) | +| `search` | `value`: `String` | Sends changed value, immediately, or, if "debounced" is on, debounced. Recommended for api search requests | + +## Slots + +| Name | Scope | Description | +|----------------------|------------------------|----------------------------------------------------------------------------| +| `search-icon` | `{ invalid: Boolean }` | Change default search icon | +| `additional-actions` | `{ invalid: Boolean }` | Adding additional functionality to search bar. For example wt-context-menu | ## Example SearchBar + ::: raw ::: @@ -22,6 +44,7 @@ import ExampleInvalidSearchBar from './examples/example-invalid-search-bar.vue'; ::: ## Example HintedSearchBar + ::: raw ::: @@ -31,6 +54,7 @@ import ExampleInvalidSearchBar from './examples/example-invalid-search-bar.vue'; ::: ## Example InvalidSearchBar + ::: raw ::: @@ -38,3 +62,13 @@ import ExampleInvalidSearchBar from './examples/example-invalid-search-bar.vue'; ::: details Code <<< ./examples/example-invalid-search-bar.vue ::: + +## Example SearchBarWithSearchModes + +::: raw + +::: + +::: details Code +<<< ./examples/example-search-bar-with-search-modes.vue +::: diff --git a/docs/pages/webitel-ui/components/wt-search-bar/examples/example-search-bar-with-search-modes.vue b/docs/pages/webitel-ui/components/wt-search-bar/examples/example-search-bar-with-search-modes.vue new file mode 100644 index 00000000..73a0998e --- /dev/null +++ b/docs/pages/webitel-ui/components/wt-search-bar/examples/example-search-bar-with-search-modes.vue @@ -0,0 +1,37 @@ + + + + + diff --git a/docs/pages/webitel-ui/components/wt-search-bar/wt-search-bar-docs.vue b/docs/pages/webitel-ui/components/wt-search-bar/wt-search-bar-docs.vue deleted file mode 100644 index dbb3ba25..00000000 --- a/docs/pages/webitel-ui/components/wt-search-bar/wt-search-bar-docs.vue +++ /dev/null @@ -1,126 +0,0 @@ - - - - - diff --git a/package.json b/package.json index 72364359..07d69c02 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@webitel/ui-sdk", - "version": "24.2.54", + "version": "24.2.55", "private": false, "scripts": { "dev": "vite", diff --git a/src/components/wt-search-bar/wt-search-bar.vue b/src/components/wt-search-bar/wt-search-bar.vue index 19250321..1571cf52 100644 --- a/src/components/wt-search-bar/wt-search-bar.vue +++ b/src/components/wt-search-bar/wt-search-bar.vue @@ -39,6 +39,32 @@ > {{ hint }} + + + + + + ([]), + }, }); const emit = defineEmits([ 'input', 'search', 'enter', + 'change:search-mode', ]); const { v, customValidators } = toRefs(props);