Commit e030d56
committed
ListBox item is now an object, not string
There are few reasons behind this change, so here they are:
* We are about to replace CodeMirror with Ace, and there we have a
different set of supported syntaxes. Due to internals, it would be
easiery for us to maintain syntaxes mode names on server side instead
of syntaxes human names (e.g. c_cpp instead of "C and C++"). Since
we want to separate enum value from its representational name,
ListBox component is ought to separate these concepts.
* ListBox is designed as a replacement for standard HTML <select> tag
and the latter separates the value it will send as selected from the
value it shows on the page. So why don't we?
* The change makes component more general, which is one step closer to
make it independent library.
The important note here is that it maintains both user interfaces, just
like <select> tag and one can pass either an array of strings or an
array of objects (with "name" and "value" props).1 parent 9bfe889 commit e030d56
2 files changed
+19
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
| 23 | + | |
24 | 24 | | |
| 25 | + | |
| 26 | + | |
25 | 27 | | |
26 | 28 | | |
27 | 29 | | |
28 | 30 | | |
29 | 31 | | |
30 | 32 | | |
31 | 33 | | |
32 | | - | |
| 34 | + | |
33 | 35 | | |
34 | | - | |
35 | | - | |
| 36 | + | |
| 37 | + | |
36 | 38 | | |
37 | 39 | | |
38 | 40 | | |
| |||
48 | 50 | | |
49 | 51 | | |
50 | 52 | | |
51 | | - | |
52 | | - | |
53 | | - | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
54 | 56 | | |
55 | | - | |
| 57 | + | |
56 | 58 | | |
57 | 59 | | |
58 | 60 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
23 | 31 | | |
24 | 32 | | |
25 | 33 | | |
26 | 34 | | |
27 | | - | |
| 35 | + | |
28 | 36 | | |
29 | 37 | | |
30 | 38 | | |
| |||
0 commit comments