|
9 | 9 | <link rel="import" href="../mm-header/mm-header.html" /> |
10 | 10 | <link rel="import" href="../mm-footer/mm-footer.html" /> |
11 | 11 | <link rel="import" href="../mm-button/mm-button.html" /> |
| 12 | + <link rel="import" href="../mm-button/mm-button.html" /> |
| 13 | + <link rel="import" href="../mm-radio/mm-radio.html" /> |
| 14 | + <link rel="import" href="../mm-group/mm-group.html" /> |
12 | 15 | <link rel="import" href="mm-form.html" /> |
13 | 16 | <style type="text/css"> |
14 | 17 | body, html { |
|
22 | 25 | background: #eee; |
23 | 26 | } |
24 | 27 |
|
| 28 | + p { |
| 29 | + font-family: "Arimo", sans-serif; |
| 30 | + font-weight: 400; |
| 31 | + font-size: 13px !important; |
| 32 | + line-height: 28px !important; |
| 33 | + -webkit-font-smoothing: antialiased; |
| 34 | + -moz-osx-font-smoothing: grayscale; |
| 35 | + font-smoothing: antialiased; |
| 36 | + color: #333; |
| 37 | + margin: 0; |
| 38 | + padding: 0; |
| 39 | + } |
| 40 | + |
25 | 41 | .col { |
26 | 42 | box-sizing: border-box; |
27 | | - padding: 10px 0 10px 10px; |
28 | | - } |
| 43 | + padding: 10px 0 0 10px; |
| 44 | + } |
29 | 45 |
|
30 | 46 | mm-form[unresolved] { |
31 | 47 | display: none; |
|
35 | 51 | <body> |
36 | 52 |
|
37 | 53 | <mm-form id="testForm" unresolved> |
38 | | - |
| 54 | + |
| 55 | + <!-- row 1 --> |
39 | 56 | <div class="col" span="1"> |
40 | | - <mm-header size="medium">Type a Number</mm-header> |
| 57 | + <!-- <mm-header size="medium">Type a Number</mm-header> --> |
41 | 58 | <mm-input |
42 | 59 | fitparent |
43 | 60 | form-id="input" |
44 | 61 | validation="int|empty" |
45 | 62 | placeholder="Type a Number" |
46 | | - error-message="#inputError"></mm-input> |
| 63 | + label="Type a Number" |
| 64 | + error-message="You need to type a number"></mm-input> |
| 65 | + <!-- |
47 | 66 | <mm-inline-box id="inputError" type="error" fitparent> |
48 | 67 | You need to type a number |
49 | 68 | </mm-inline-box> |
| 69 | + --> |
50 | 70 | </div> |
51 | | - |
52 | 71 | <div class="col" span="1"> |
53 | | - <mm-header size="medium">Select an Item</mm-header> |
| 72 | + <!-- <mm-header size="medium">Select an Item</mm-header> --> |
54 | 73 | <mm-dropdown |
55 | 74 | fitparent |
56 | 75 | form-id="dropdown" |
57 | 76 | placeholder="Select an Item" |
58 | 77 | validation="empty" |
59 | | - error-message="#dropdownError"> |
| 78 | + label="Select an Item" |
| 79 | + error-message="You need to select an item"> |
60 | 80 | <mm-list-item>List Item 1</mm-list-item> |
61 | 81 | <mm-list-item>List Item 2</mm-list-item> |
62 | 82 | <mm-list-item>List Item 3</mm-list-item> |
63 | 83 | <mm-list-item>List Item 4</mm-list-item> |
64 | 84 | </mm-dropdown> |
| 85 | + <!-- |
65 | 86 | <mm-inline-box id="dropdownError" type="error" fitparent> |
66 | 87 | You need to select an item |
67 | 88 | </mm-inline-box> |
| 89 | + --> |
| 90 | + </div> |
| 91 | + <div class="col" span="1"> |
| 92 | + <!-- <mm-header size="medium">Select a Color</mm-header> --> |
| 93 | + <mm-group |
| 94 | + fitparent |
| 95 | + unresolved |
| 96 | + form-id="radio" |
| 97 | + placeholder="Select an Item" |
| 98 | + validation="empty" |
| 99 | + label="Select a Color" |
| 100 | + error-message="You need to select a color"> |
| 101 | + <mm-radio> |
| 102 | + <label>Red</label> |
| 103 | + </mm-radio> |
| 104 | + <mm-radio> |
| 105 | + <label>Green</label> |
| 106 | + </mm-radio> |
| 107 | + <mm-radio> |
| 108 | + <label>Blue</label> |
| 109 | + </mm-radio> |
| 110 | + </mm-group> |
| 111 | + <!-- |
| 112 | + <mm-inline-box id="radioError" type="error" fitparent> |
| 113 | + You need to select a color |
| 114 | + </mm-inline-box> |
| 115 | + --> |
68 | 116 | </div> |
69 | 117 |
|
70 | 118 | </mm-form> |
71 | 119 |
|
72 | 120 | <script> |
73 | 121 | window.addEventListener('WebComponentsReady', function(e) { |
74 | | - // |
| 122 | + var testForm = document.querySelector('#testForm'); |
| 123 | + testForm.addEventListener('serialize-form', function(e){ |
| 124 | + console.log('serialize-form', e.detail); |
| 125 | + }); |
75 | 126 | }); |
76 | 127 | </script> |
77 | 128 |
|
|
0 commit comments