Skip to content
This repository was archived by the owner on Aug 2, 2024. It is now read-only.

Commit 48fa2f4

Browse files
feat: Fixes Search Input and Combobox + makes them better
1 parent 30781be commit 48fa2f4

41 files changed

Lines changed: 1625 additions & 1196 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,3 +98,4 @@ node_modules
9898
/ui/.vscode
9999
/server/.vscode
100100
/docs/.vscode
101+
/ui/coverage

docs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"chai": "^4.2.0",
3131
"eslint": "^5.13.0",
3232
"eslint-plugin-vue": "^5.2.1",
33-
"fiori-fundamentals": "^1.4.3",
33+
"fiori-fundamentals": "^1.4.9",
3434
"highlight.js": "^9.14.2",
3535
"html-loader": "^0.5.5",
3636
"markdown-loader": "^5.0.0",

docs/src/api/_baseline.json

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1557,39 +1557,44 @@
15571557
"componentName": "FdCombobox"
15581558
},
15591559
"FdSearchInput": {
1560-
"slots": {},
1560+
"slots": {
1561+
"empty": {
1562+
"name": "empty",
1563+
"description": "Content that is rendered in case there are no matching completions."
1564+
}
1565+
},
15611566
"events": {
1562-
"autoComplete": {
1563-
"name": "autoComplete",
1564-
"description": "Trigerred when the value in the SearchInput is changed. \n NOTE: This event will get trigerred only if there are children components in the suggestion."
1567+
"update": {
1568+
"name": "update",
1569+
"description": "Trigerred when the value in the search input changed."
15651570
},
1566-
"search": {
1567-
"name": "search",
1568-
"description": "Triggered when the search button is clicked or enter is pressed from the keyboard."
1571+
"change": {
1572+
"name": "change",
1573+
"description": "Trigerred when the value in the search input was confirmed."
15691574
}
15701575
},
15711576
"mixins": [],
15721577
"props": {
1573-
"value": {
1574-
"name": "value",
1575-
"description": "Value set in the Search Input",
1578+
"predicate": {
1579+
"name": "predicate",
1580+
"description": "Value of the enclosed search input element.",
15761581
"required": false,
15771582
"types": ["String"],
1578-
"defaultValue": ""
1583+
"defaultValue": null
15791584
},
15801585
"placeholder": {
15811586
"name": "placeholder",
1582-
"description": "Placeholder in case the SearchInput is empty",
1587+
"description": "Placeholder in case predicate is empty",
15831588
"required": false,
15841589
"types": ["String"],
15851590
"defaultValue": ""
15861591
},
1587-
"ariaLabel": {
1588-
"name": "ariaLabel",
1589-
"description": "Aria Label",
1592+
"completions": {
1593+
"name": "completions",
1594+
"description": "Array of strings used for auto completion.",
15901595
"required": false,
1591-
"types": ["String"],
1592-
"defaultValue": "Search Input"
1596+
"types": ["Array"],
1597+
"defaultValue": "empty array"
15931598
},
15941599
"compact": {
15951600
"name": "compact",

docs/src/pages/Combobox/0-default.vue

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
<title>Default Combobox</title>
2-
<tip>`FdCombobox` supports `v-model` and thus you can easily create bi-directional bindings.</tip>
2+
<tip>
3+
`FdCombobox` supports `v-model` and thus you can easily create bi-directional bindings.
4+
5+
---
6+
7+
**Important**
8+
9+
All `FdMenuItem`s need an associated `value` – otherwise `v-model` will not work.
10+
</tip>
311

412
<template>
513
<div>
@@ -8,9 +16,9 @@
816
<span class="favorite-fruit-current">{{ fruit || "none" }}</span>
917
</div>
1018
<FdCombobox v-model="fruit" placeholder="Pick your Fruit of the day">
11-
<FdMenuItem @click="fruit = 'Apple'">Apple</FdMenuItem>
12-
<FdMenuItem @click="fruit = 'Banana'">Banana</FdMenuItem>
13-
<FdMenuItem @click="fruit = 'Cherry'">Cherry</FdMenuItem>
19+
<FdMenuItem value="Apple">Apple</FdMenuItem>
20+
<FdMenuItem value="Banana">Banana</FdMenuItem>
21+
<FdMenuItem value="Cherry">Cherry</FdMenuItem>
1422
</FdCombobox>
1523
</div>
1624
</template>

docs/src/pages/Combobox/1-sizes.vue

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
v-model="fruit"
77
placeholder="Pick your Fruit of the day (default size)"
88
>
9-
<FdMenuItem @click="fruit = 'Apple'">Apple</FdMenuItem>
10-
<FdMenuItem @click="fruit = 'Banana'">Banana</FdMenuItem>
11-
<FdMenuItem @click="fruit = 'Cherry'">Cherry</FdMenuItem>
9+
<FdMenuItem value="Apple">Apple</FdMenuItem>
10+
<FdMenuItem value="Banana">Banana</FdMenuItem>
11+
<FdMenuItem value="Cherry">Cherry</FdMenuItem>
1212
</FdCombobox>
1313

1414
<br /><br />
@@ -18,9 +18,9 @@
1818
compact
1919
placeholder="Pick your Fruit of the day (compact size)"
2020
>
21-
<FdMenuItem @click="fruit = 'Apple'">Apple</FdMenuItem>
22-
<FdMenuItem @click="fruit = 'Banana'">Banana</FdMenuItem>
23-
<FdMenuItem @click="fruit = 'Cherry'">Cherry</FdMenuItem>
21+
<FdMenuItem value="Apple">Apple</FdMenuItem>
22+
<FdMenuItem value="Banana">Banana</FdMenuItem>
23+
<FdMenuItem value="Cherry">Cherry</FdMenuItem>
2424
</FdCombobox>
2525
</div>
2626
</template>
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<title>Popover without Content</title>
2+
<tip>Sometimes it is useful to have a Popover that renders a trigger but no body.</tip>
3+
4+
<template>
5+
<div>
6+
<FdPopover title="Show (is not showing anything)" />
7+
</div>
8+
</template>
Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,19 @@
11
<title>Search Input</title>
2-
2+
<docs>`FdSearchInput` supports `v-model`: The *model value* is simply the currently entered predicate/query/value.</docs>
3+
<tip>
4+
Currently `FdSearchInput` always renderes an empty state even when no auto compleiton is used. This issue will be addressed in the near future.
5+
</tip>
36
<template>
47
<div>
5-
<p>Search Query: '{{ query }}'</p>
6-
<FdSearchInput
7-
v-model="query"
8-
placeholder="Enter Search Query"
9-
@search="onSearch"
10-
/>
8+
<p>
9+
Predicate: <code>{{ predicate }}</code>
10+
</p>
11+
<FdSearchInput v-model="predicate" placeholder="Search" />
1112
</div>
1213
</template>
1314

1415
<script>
1516
export default {
16-
methods: {
17-
onSearch(txt) {
18-
this.query = txt;
19-
}
20-
},
21-
data: () => ({ query: "Apples and Oranges" })
17+
data: () => ({ predicate: "Apples and Oranges" })
2218
};
2319
</script>
Lines changed: 9 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,21 @@
11
<title>Search Input with Auto Complete</title>
2+
<docs>Use the `completions`-prop in order to pass an array of strings to `FdSearchInput`. `FdSearchInput` will then render a completion list that is automatically filtered.</docs>
23

34
<template>
45
<div>
5-
<p>Search Query: '{{ query }}'</p>
6+
<p>
7+
Predicate: <code>{{ predicate }}</code>
8+
</p>
69
<FdSearchInput
7-
v-model="query"
8-
placeholder="Enter Search Query"
9-
@search="search"
10-
@autoComplete="autoComplete"
11-
:enableSuggest="true"
12-
>
13-
<FdMenuItem
14-
v-for="item in data"
15-
:key="item.key"
16-
@click="searchvalue = item.text"
17-
>{{ item.text }}</FdMenuItem
18-
>
19-
</FdSearchInput>
10+
v-model="predicate"
11+
placeholder="Search"
12+
:completions="['Apple', 'Peach', 'Banana']"
13+
/>
2014
</div>
2115
</template>
2216

2317
<script>
2418
export default {
25-
methods: {
26-
search(query) {
27-
this.query = query;
28-
},
29-
autoComplete(event) {}
30-
},
31-
data() {
32-
return {
33-
query: "",
34-
data: [
35-
{ key: 1, text: "apple" },
36-
{ key: 2, text: "mango" },
37-
{ key: 3, text: "grapes" },
38-
{ key: 4, text: "banana" },
39-
{ key: 5, text: "orange" }
40-
]
41-
};
42-
}
19+
data: () => ({ predicate: "" })
4320
};
4421
</script>

docs/src/pages/Search Input/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ export const plugin: ExampleCollectionFunction = () => {
44
return {
55
status: "experimental",
66
icon: "search",
7-
related: ["FdSearchInput", "FdMenuItem"]
7+
related: ["FdSearchInput"]
88
};
99
};

0 commit comments

Comments
 (0)