-
Notifications
You must be signed in to change notification settings - Fork 160
Expand file tree
/
Copy pathdrop-down.sample.html
More file actions
181 lines (175 loc) · 5.42 KB
/
drop-down.sample.html
File metadata and controls
181 lines (175 loc) · 5.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
<section class="sample-content">
<div class="sample-wrapper">
<strong>Angular DropDown</strong>
<button
igxButton="contained"
#button
(click)="toggleDropDown()"
[igxDropDownItemNavigation]="dropdown1"
>
Toggle
</button>
<igx-drop-down
#dropdown1
[igSize]="properties.size"
[closeOnOutsideClick]="!properties.keepOpenOnOutsideClick"
>
@for(item of items; track item) {
<igx-drop-down-item
[ariaLabel]="item.field"
[disabled]="item.disabled"
[isHeader]="item.header"
>
@if(!item.header && !properties.hidePrefix){
<igx-icon igxPrefix>location_city</igx-icon>
} {{ item.field }} @if(!item.header && !properties.hideSuffix){
<igx-icon igxSuffix>location_on</igx-icon>
}
</igx-drop-down-item>
}
</igx-drop-down>
</div>
<div class="sample-wrapper">
<strong>WC DropDown</strong>
<igc-dropdown
id="dropdownWC"
[igSize]="properties.size"
[placement]="properties.placement"
[scrollStrategy]="properties.scrollStrategy"
[keepOpenOnOutsideClick]="properties.keepOpenOnOutsideClick"
>
<igc-button [style.--ig-size]="'var(--ig-size-3)'" slot="target"
>Toggle</igc-button
>
@for(item of items; track item) { @if(item.header) {
<igc-dropdown-header> {{ item.field }} </igc-dropdown-header>
} @else {
<igc-dropdown-item
[disabled]="item.disabled"
[value]="item.selected"
>
@if(!properties.hidePrefix) {
<igx-icon slot="prefix">location_city</igx-icon>
} {{ item.field }} @if(!properties.hideSuffix) {
<igx-icon slot="suffix">location_on</igx-icon>
}
</igc-dropdown-item>
} }
</igc-dropdown>
</div>
</section>
<section class="sample-content">
<div class="sample-button-group">
<h5>Angular Dropdown With Action directive</h5>
<igx-buttongroup>
<button
igxButton
[igxToggleAction]="dropdown2"
[igxDropDownItemNavigation]="dropdown2"
>
Drop-down
</button>
<button
igxButton
[igxToggleAction]="toggle"
[igxToggleOutlet]="outlet"
>
Outlet
</button>
<button
igxButton
[igxToggleAction]="menu"
[igxDropDownItemNavigation]="menu"
>
Menu
</button>
<button
igxButton
[igxToggleAction]="group"
[igxDropDownItemNavigation]="group"
>
Group
</button>
</igx-buttongroup>
</div>
<igx-drop-down
#dropdown2
(selectionChanging)="onSelection($event)"
(opening)="onOpening()"
height="400px"
>
@for(item of items; track item) {
<igx-drop-down-item [disabled]="item.disabled" [isHeader]="item.header">
{{ item.field }}
</igx-drop-down-item>
}
</igx-drop-down>
<div igxToggle #toggle="toggle" style="height: 300px; overflow: auto">
@for(item of items; track item.field) {
<div>{{ item.field }}</div>
}
</div>
<igx-drop-down
#menu
(selectionChanging)="onSelectionMenu($event)"
height="400px"
>
@for(item of items; track item) {
<igx-drop-down-item [disabled]="item.disabled" [isHeader]="item.header">
{{ item.field }}
</igx-drop-down-item>
}
</igx-drop-down>
<igx-drop-down
#group
(selectionChanging)="onSelection($event)"
height="400px"
>
@for(foodGroup of foods; track foodGroup) {
<igx-drop-down-item-group [label]="foodGroup.name">
@for(food of foodGroup.entries; track food) {
<igx-drop-down-item [value]="food.refNo">
{{ food.name }}
</igx-drop-down-item>
}
</igx-drop-down-item-group>
}
</igx-drop-down>
</section>
<section class="sample-content">
<igx-input-group class="input-group">
<input
type="text"
[igxToggleAction]="dropdown3"
[igxDropDownItemNavigation]="dropdown3"
igxInput
readonly="true"
[value]="dropdown3.selectedItem?.value.field"
/>
</igx-input-group>
<igx-drop-down
#dropdown3
(opening)="onOpening()"
(selectionChanging)="onSelectionLogger($event)"
height="400px"
>
@for(item of items; track item) {
<igx-drop-down-item
[value]="item"
[disabled]="item.disabled"
[isHeader]="item.header"
>
{{ item.field }}
</igx-drop-down-item>
}
</igx-drop-down>
<button
igxButton="contained"
igxRipple
(click)="clearSelection()"
style="display: block"
>
Clear selection
</button>
</section>
<div igxOverlayOutlet #outlet="overlay-outlet"></div>