@@ -46,54 +46,33 @@ An item can be either a simple string or a object containing the following keys:
46
46
- ** disabled** : boolean |adds the class .is-disabled to the item
47
47
- ** className** : string | classes which get's added to the item</li ></ul >
48
48
49
- <<<<<<< HEAD
50
49
** Value** :
51
- =======
52
- ** Value** :
53
- >>>>>>> master
54
50
You can pass an item as value to the dropdown and it will mark the specific item as selected for you.
55
51
The value you can pass into the dropdown differs from the combination of tags you choose.
56
52
When you specify the ` multiple="1" ` flag, the value can be a dropdown item or a list of dropdown items.
57
53
In case you specify the ` input-only="1" ` flag the value must be a simple string!
58
- <<<<<<< HEAD
59
- Are those two flags not specified the value can be a dropdown item represented as an object or just it's value as a string.
60
- =======
61
54
Are those two flags not specified the value can be a dropdown item represented as an object or just it's value as a string.
62
- >>>>>>> master
63
55
64
56
## Simple dropdown menu
65
57
The simple dropdown menu only contains one level of menu items and provides the ability to select only one item at the same time.
66
58
All changes are propagated via a custom change event which contains the selected item.
67
59
68
60
<ws-dropdown items.bind =' ["Item 1", "Item 2", "Item 3"] ' text =" Click me " change.delegate =" log('dd1 changed', $event) " ></ws-dropdown >
69
61
``` html
70
- <<<<<<< HEAD
71
- <ws-dropdown
72
- items =' ["Item 1", "Item 2", "Item 3"]'
73
- =======
74
62
<ws-dropdown
75
- items =' ["Item 1", "Item 2", "Item 3"]'
76
- >>>>>>> master
63
+ items =' ["Item 1", "Item 2", "Item 3"]'
77
64
text =" Click me" >
78
65
</ws-dropdown >
79
66
```
80
67
81
68
## Hierarchical dropdown menu
82
69
Sometimes not everything fits into one menu and we have to group our items and create a hierarchical menu.
83
- <<<<<<< HEAD
84
- This happens quite often on page headers or context menu's (right click). To create a hierarchical menu you
85
- =======
86
70
This happens quite often on page headers or context menu's (right click). To create a hierarchical menu you
87
- >>>>>>> master
88
71
just have to add the children for the dropdown item as you want.
89
72
90
73
<ws-dropdown items.bind =' ["Item 1", {"label": "Item 2", "children": ["Item 2.1", {"label": "Item 2.2", "children": ["Item 2.2.1", "Item 2.2.2", "Item 2.2.3", "Item 2.2.4"]}]}, "Item 3"] ' text =" Click me " change.delegate =" log('dd1 changed', $event) " ></ws-dropdown >
91
74
``` html
92
- <<<<<<< HEAD
93
- <ws-dropdown
94
- =======
95
75
<ws-dropdown
96
- >>>>>>> master
97
76
items =' ["Item 1", {"label": "Item 2", "children": ["Item 2.1", {"label": "Item 2.2", "children": ["Item 2.2.1", "Item 2.2.2", "Item 2.2.3", "Item 2.2.4"]}]}, "Item 3"]'
98
77
text =" Click me" >
99
78
</ws-dropdown >
@@ -121,17 +100,10 @@ interpreted as false.
121
100
<ws-dropdown items.bind =' ["Item 1", "Item 2", "Item 3"] ' value =" Item 2 " multiple =" 1 " text =" Select a value " type =" select " style =" display : inline-block ; width : 150px " ></ws-dropdown >
122
101
``` html
123
102
<ws-dropdown
124
- <<<<<<< HEAD
125
- items =' ["Item 1", "Item 2", "Item 3"]'
126
- value =" Item 2"
127
- text =" Select a value"
128
- multiple =" 1"
129
- =======
130
103
items =' ["Item 1", "Item 2", "Item 3"]'
131
104
value =" Item 2"
132
105
text =" Select a value"
133
106
multiple =" 1"
134
- >>>>>>> master
135
107
type =" select" >
136
108
</ws-dropdown >
137
109
```
@@ -146,21 +118,12 @@ the default filter with the attribute `filter="blue"` and the maximum amount of
146
118
<ws-dropdown items.bind =' ["Car (Blue)", "Car (Red)", "Car (Orange)", "Bus (Blue)", "Bus (Red)", "Bus (Orange)", "Yet (Blue)", "Yet (Red)", "Yet (Orange)"] ' filterable =" 1 " filter =" blue " limit =" 7 " text =" Select a value " type =" select " style =" display : inline-block ; width : 150px " ></ws-dropdown >
147
119
``` html
148
120
<ws-dropdown
149
- <<<<<<< HEAD
150
- items.bind =' ["Car (Blue)", "Car (Red)", "Car (Orange)", "Bus (Blue)", "Bus (Red)", "Bus (Orange)", "Yet (Blue)", "Yet (Red)", "Yet (Orange)"]'
151
- filterable =" 1"
152
- filter =" blue"
153
- limit =" 7"
154
- text =" Select a value"
155
- type =" select"
156
- =======
157
121
items.bind =' ["Car (Blue)", "Car (Red)", "Car (Orange)", "Bus (Blue)", "Bus (Red)", "Bus (Orange)", "Yet (Blue)", "Yet (Red)", "Yet (Orange)"]'
158
122
filterable =" 1"
159
123
filter =" blue"
160
124
limit =" 7"
161
125
text =" Select a value"
162
126
type =" select"
163
- >>>>>>> master
164
127
style =" display : inline-block ; width : 150px " >
165
128
</ws-dropdown >
166
129
```
@@ -174,24 +137,27 @@ the `value` attribute also the `placeholder` attribute to set the placeholder fo
174
137
175
138
<ws-dropdown type =" button " text =" Click me " placeholder =" Insert a text " value =" Default value " input-only =" 1 " ></ws-dropdown >
176
139
``` html
177
- <<<<<<< HEAD
178
- <ws-dropdown
140
+ <ws-dropdown
179
141
type =" button"
180
142
text =" Click me"
181
- placeholder =" Insert a text"
182
- value =" Default value"
143
+ placeholder =" Insert a text"
144
+ value =" Default value"
183
145
input-only =" 1" >
184
146
</ws-dropdown >
185
147
```
186
148
187
- =======
188
- <ws-dropdown
189
- type="button"
149
+ ## Custom width
150
+ Per default the dropdown has a width of 200px when the type is not select. For those select dropdown elements the default
151
+ width is 100%. This means the dropdown is as wide as the select box. To change the width you can add the attribute
152
+ ` width ` and give it a pixel, percent or any size value.
153
+
154
+ <ws-dropdown items.bind =' ["Item 1", "Item 2", "Item 3"] ' text =" Click me " type =" button " width =" 500px " ></ws-dropdown >
155
+ ``` html
156
+ <ws-dropdown
157
+ items =' ["Item 1", "Item 2", "Item 3"]'
190
158
text =" Click me"
191
- placeholder="Insert a text"
192
- value="Default value"
193
- input-only="1">
159
+ type =" button"
160
+ width =" 500px" >
194
161
</ws-dropdown >
195
162
```
196
163
197
- >>>>>>> master
0 commit comments