| author | Tomas Zeman <tzeman@volny.cz> |
| Thu, 14 Dec 2017 15:32:50 +0100 | |
| changeset 9 | ee8565f13df7 |
| child 10 | f4bf01584928 |
| permissions | -rw-r--r-- |
|
9
ee8565f13df7
Components: form, grid, inputs, table
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
1 |
/* |
|
ee8565f13df7
Components: form, grid, inputs, table
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
2 |
* Copyright 2017 Tomas Zeman <tzeman@volny.cz> |
|
ee8565f13df7
Components: form, grid, inputs, table
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
3 |
* |
|
ee8565f13df7
Components: form, grid, inputs, table
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
4 |
* Licensed under the Apache License, Version 2.0 (the "License"); |
|
ee8565f13df7
Components: form, grid, inputs, table
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
5 |
* you may not use this file except in compliance with the License. |
|
ee8565f13df7
Components: form, grid, inputs, table
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
6 |
* You may obtain a copy of the License at |
|
ee8565f13df7
Components: form, grid, inputs, table
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
7 |
* |
|
ee8565f13df7
Components: form, grid, inputs, table
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
8 |
* http://www.apache.org/licenses/LICENSE-2.0 |
|
ee8565f13df7
Components: form, grid, inputs, table
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
9 |
* |
|
ee8565f13df7
Components: form, grid, inputs, table
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
10 |
* Unless required by applicable law or agreed to in writing, software |
|
ee8565f13df7
Components: form, grid, inputs, table
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
11 |
* distributed under the License is distributed on an "AS IS" BASIS, |
|
ee8565f13df7
Components: form, grid, inputs, table
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
12 |
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|
ee8565f13df7
Components: form, grid, inputs, table
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
13 |
* See the License for the specific language governing permissions and |
|
ee8565f13df7
Components: form, grid, inputs, table
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
14 |
* limitations under the License. |
|
ee8565f13df7
Components: form, grid, inputs, table
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
15 |
*/ |
|
ee8565f13df7
Components: form, grid, inputs, table
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
16 |
package purecss.generic |
|
ee8565f13df7
Components: form, grid, inputs, table
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
17 |
|
|
ee8565f13df7
Components: form, grid, inputs, table
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
18 |
import scala.language.{implicitConversions, postfixOps}
|
|
ee8565f13df7
Components: form, grid, inputs, table
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
19 |
|
|
ee8565f13df7
Components: form, grid, inputs, table
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
20 |
trait PureForm[B, O <: F, F] extends Component[B, O, F] {
|
|
ee8565f13df7
Components: form, grid, inputs, table
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
21 |
|
|
ee8565f13df7
Components: form, grid, inputs, table
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
22 |
import bundle.all._ |
|
ee8565f13df7
Components: form, grid, inputs, table
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
23 |
|
|
ee8565f13df7
Components: form, grid, inputs, table
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
24 |
val pure_form: C = pc("pure-form")
|
|
ee8565f13df7
Components: form, grid, inputs, table
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
25 |
val pure_form_stacked: C = pc("pure-form-stacked")
|
|
ee8565f13df7
Components: form, grid, inputs, table
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
26 |
val pure_form_aligned: C = pc("pure-form-aligned")
|
|
ee8565f13df7
Components: form, grid, inputs, table
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
27 |
val pure_group: C = pc("pure-group")
|
|
ee8565f13df7
Components: form, grid, inputs, table
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
28 |
val pure_control_group: C = pc("pure-control-group")
|
|
ee8565f13df7
Components: form, grid, inputs, table
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
29 |
val pure_form_message: C = pc("pure-form-message")
|
|
ee8565f13df7
Components: form, grid, inputs, table
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
30 |
val pure_form_message_inline: C = pc("pure-form-message-inline")
|
|
ee8565f13df7
Components: form, grid, inputs, table
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
31 |
|
|
ee8565f13df7
Components: form, grid, inputs, table
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
32 |
implicit def f2cls(f: Form): C = f.toCls |
|
ee8565f13df7
Components: form, grid, inputs, table
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
33 |
implicit def f2mod(f: Form): Modifier = f.toCls.apply() |
|
ee8565f13df7
Components: form, grid, inputs, table
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
34 |
|
|
ee8565f13df7
Components: form, grid, inputs, table
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
35 |
case class Form(opt: Option[C] = None) extends Element {
|
|
ee8565f13df7
Components: form, grid, inputs, table
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
36 |
def stacked: Form = copy(opt = Some(pure_form_stacked)) |
|
ee8565f13df7
Components: form, grid, inputs, table
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
37 |
def aligned: Form = copy(opt = Some(pure_form_aligned)) |
|
ee8565f13df7
Components: form, grid, inputs, table
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
38 |
override def toCls: C = pure_form.copy(chain = opt toList) |
|
ee8565f13df7
Components: form, grid, inputs, table
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
39 |
} |
|
ee8565f13df7
Components: form, grid, inputs, table
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
40 |
} |