|
1 | 1 | import { UIModel, ComponentExample } from '@ngx-dynamic-components/core';
|
2 | 2 | import { InputTypeaheadProperties } from './input-typeahead.component';
|
3 | 3 |
|
4 |
| -export const example1: ComponentExample<UIModel<InputTypeaheadProperties>> = { |
| 4 | +export const example2: ComponentExample<UIModel<InputTypeaheadProperties>> = { |
5 | 5 | uiModel: `
|
6 | 6 | <div class="flex-column">
|
7 | 7 | <div class="form-group">
|
8 | 8 | <label class="col-form-label" width="60px">Type text</label>
|
9 |
| - <input-typeahead width="300px" binding="$.selectedOption"> |
10 |
| - <option value="o1">Option 1</option> |
11 |
| - <option value="o2">Option 2</option> |
12 |
| - </input-typeahead> |
| 9 | + <input-typeahead width="300px" itemsSource="$.list" binding="$.selected"></input-typeahead> |
13 | 10 | </div>
|
14 | 11 | </div>
|
15 | 12 | `,
|
16 |
| - dataModel: {}, |
17 |
| - title: 'Static dropdown declaration', |
| 13 | + dataModel: { |
| 14 | + list: [{ label: 'Data 1', value: 'd1' }, { label: 'Data 2', value: 'd2' }] |
| 15 | + }, |
| 16 | + title: 'Dropdown options binded to dataModel', |
18 | 17 | };
|
19 | 18 |
|
20 |
| -export const example2: ComponentExample<UIModel<InputTypeaheadProperties>> = { |
| 19 | +export const example3: ComponentExample<UIModel<InputTypeaheadProperties>> = { |
21 | 20 | uiModel: `
|
22 | 21 | <div class="flex-column">
|
23 | 22 | <div class="form-group">
|
24 | 23 | <label class="col-form-label" width="60px">Type text</label>
|
25 |
| - <input-typeahead width="300px" itemsSource="$.list" binding="$.selected"></input-typeahead> |
| 24 | + <input-typeahead width="300px" binding="$.selectedOption"> |
| 25 | + <option value="o1">Option 1</option> |
| 26 | + <option value="o2">Option 2</option> |
| 27 | + </input-typeahead> |
26 | 28 | </div>
|
27 | 29 | </div>
|
28 | 30 | `,
|
29 |
| - dataModel: { |
30 |
| - list: [{ label: 'Data 1', value: 'd1' }, { label: 'Data 2', value: 'd2' }] |
31 |
| - }, |
32 |
| - title: 'Dropdown options binded to dataModel', |
| 31 | + dataModel: {}, |
| 32 | + title: 'Static dropdown declaration', |
33 | 33 | };
|
34 | 34 |
|
35 |
| -export const example3: ComponentExample<UIModel<InputTypeaheadProperties>> = { |
| 35 | +export const example1: ComponentExample<UIModel<InputTypeaheadProperties>> = { |
36 | 36 | uiModel: `
|
37 | 37 | <div class="flex-column">
|
38 | 38 | <div class="form-group">
|
@@ -97,4 +97,4 @@ export const example4: ComponentExample<UIModel<InputTypeaheadProperties>> = {
|
97 | 97 | title: 'drop-down with typeahead and debounceTime',
|
98 | 98 | };
|
99 | 99 |
|
100 |
| -export default [example1, example2, example4]; |
| 100 | +export default [example4, example1, example2]; |
0 commit comments