@@ -37,32 +37,40 @@ switch model schema isRequired isDisabled path =
37
37
actuallyDisabled =
38
38
isDisabled || disabled
39
39
in
40
- label
40
+ div
41
41
[ classList
42
- [ ( " jf-switch" , True )
43
- , ( " jf-switch--on" , isChecked )
44
- , ( " jf-switch--focused" , model. focused |> Maybe . map ( (==) path) |> Maybe . withDefault False )
45
- , ( " jf-switch--invalid" , hasError )
46
- , ( " jf-switch--disabled" , actuallyDisabled )
47
- , ( " jf-switch--hidden" , hidden )
42
+ [ ( " jf-element" , True )
43
+ , ( " jf-element--hidden" , hidden )
44
+ , ( " jf-element--invalid" , hasError )
48
45
]
49
46
]
50
- [ input
51
- [ type_ " checkbox"
52
- , class " jf-switch__input"
53
- , checked isChecked
54
- , onFocus <| FocusInput ( Just path)
55
- , onBlur <| FocusInput Nothing
56
- , onCheck <| ( JsonValue . BoolValue >> EditValue path)
57
- , Html . Attributes . id id
58
- , Html . Attributes . name id
59
- , Html . Attributes . disabled actuallyDisabled
47
+ [ label
48
+ [ classList
49
+ [ ( " jf-switch" , True )
50
+ , ( " jf-switch--on" , isChecked )
51
+ , ( " jf-switch--focused" , model. focused |> Maybe . map ( (==) path) |> Maybe . withDefault False )
52
+ , ( " jf-switch--invalid" , hasError )
53
+ , ( " jf-switch--disabled" , actuallyDisabled )
54
+ , ( " jf-switch--hidden" , hidden )
55
+ ]
56
+ ]
57
+ [ input
58
+ [ type_ " checkbox"
59
+ , class " jf-switch__input"
60
+ , checked isChecked
61
+ , onFocus <| FocusInput ( Just path)
62
+ , onBlur <| FocusInput Nothing
63
+ , onCheck <| ( JsonValue . BoolValue >> EditValue path)
64
+ , Html . Attributes . id id
65
+ , Html . Attributes . name id
66
+ , Html . Attributes . disabled actuallyDisabled
67
+ ]
68
+ []
69
+ , span [ class " jf-switch__label" ] [ schema |> getTitle isRequired |> text ]
70
+ , div [ class " jf-switch__track" ] []
71
+ , div [ class " jf-switch__thumb" ] []
72
+ , div [ class " jf-switch__helper-text" ] [ helperText ]
60
73
]
61
- []
62
- , span [ class " jf-switch__label" ] [ schema |> getTitle isRequired |> text ]
63
- , div [ class " jf-switch__track" ] []
64
- , div [ class " jf-switch__thumb" ] []
65
- , div [ class " jf-switch__helper-text" ] [ helperText ]
66
74
]
67
75
68
76
@@ -92,31 +100,39 @@ checkbox model schema isRequired isDisabled path =
92
100
actuallyDisabled =
93
101
isDisabled || disabled
94
102
in
95
- label
103
+ div
96
104
[ classList
97
- [ ( " jf-checkbox" , True )
98
- , ( " jf-checkbox--on" , isChecked )
99
- , ( " jf-checkbox--focused" , model. focused |> Maybe . map ( (==) path) |> Maybe . withDefault False )
100
- , ( " jf-checkbox--invalid" , hasError )
101
- , ( " jf-checkbox--disabled" , actuallyDisabled )
102
- , ( " jf-checkbox--hidden" , hidden )
105
+ [ ( " jf-element" , True )
106
+ , ( " jf-element--hidden" , hidden )
107
+ , ( " jf-element--invalid" , hasError )
103
108
]
104
109
]
105
- [ input
106
- [ type_ " checkbox"
107
- , class " jf-checkbox__input"
108
- , checked isChecked
109
- , Html . Attributes . id id
110
- , Html . Attributes . name id
111
- , Html . Attributes . disabled actuallyDisabled
112
- , onFocus <| FocusInput ( Just path)
113
- , onBlur <| FocusInput Nothing
114
- , onCheck <| ( JsonValue . BoolValue >> EditValue path)
110
+ [ label
111
+ [ classList
112
+ [ ( " jf-checkbox" , True )
113
+ , ( " jf-checkbox--on" , isChecked )
114
+ , ( " jf-checkbox--focused" , model. focused |> Maybe . map ( (==) path) |> Maybe . withDefault False )
115
+ , ( " jf-checkbox--invalid" , hasError )
116
+ , ( " jf-checkbox--disabled" , actuallyDisabled )
117
+ , ( " jf-checkbox--hidden" , hidden )
118
+ ]
115
119
]
116
- []
117
- , span [ class " jf-checkbox__label" ] [ schema |> getTitle isRequired |> text ]
118
- , div [ class " jf-checkbox__box-outline" ]
119
- [ div [ class " jf-checkbox__tick-outline" ] []
120
+ [ input
121
+ [ type_ " checkbox"
122
+ , class " jf-checkbox__input"
123
+ , checked isChecked
124
+ , Html . Attributes . id id
125
+ , Html . Attributes . name id
126
+ , Html . Attributes . disabled actuallyDisabled
127
+ , onFocus <| FocusInput ( Just path)
128
+ , onBlur <| FocusInput Nothing
129
+ , onCheck <| ( JsonValue . BoolValue >> EditValue path)
130
+ ]
131
+ []
132
+ , span [ class " jf-checkbox__label" ] [ schema |> getTitle isRequired |> text ]
133
+ , div [ class " jf-checkbox__box-outline" ]
134
+ [ div [ class " jf-checkbox__tick-outline" ] []
135
+ ]
136
+ , div [ class " jf-checkbox__helper-text" ] [ helperText ]
120
137
]
121
- , div [ class " jf-checkbox__helper-text" ] [ helperText ]
122
138
]
0 commit comments