@@ -124,7 +124,7 @@ field ::
124
124
Full model action t Unique ->
125
125
Opts model action ->
126
126
[View action ]
127
- field Full {fullArgs = args, fullParser = parser, fullViewer = viewer} opts =
127
+ field full @ Full {fullArgs = args, fullParser = parser, fullViewer = viewer} opts =
128
128
( do
129
129
x0 <-
130
130
catMaybes
@@ -143,42 +143,56 @@ field Full {fullArgs = args, fullParser = parser, fullViewer = viewer} opts =
143
143
_ -> mempty
144
144
fieldModal args x1
145
145
)
146
- <> [ maybe
147
- id
148
- ( \ x ->
149
- label_ mempty
150
- . (text x : )
151
- . (br_ mempty : )
152
- . singleton
153
- )
154
- (optsLabel opts)
155
- . input_
156
- $ ( catMaybes
157
- [ fmap
158
- (type_ . htmlFieldType)
159
- (st ^? cloneTraversal optic . # fieldType),
160
- fmap
161
- (textProp " defaultValue" )
162
- (st ^? cloneTraversal optic . # fieldInput . # uniqueValue),
163
- Just $ onInput onInputAction,
164
- Just . disabled_ $ opts ^. # optsDisabled,
165
- fmap placeholder_
166
- $ if null placeholder
167
- then optsLabel opts
168
- else Just placeholder,
169
- Just
170
- . id_
171
- . either impureThrow id
172
- . decodeUtf8Strict
173
- . unTagged
174
- $ htmlUid uid,
175
- Just . onKeyDown $ action . optsOnKeyDownAction opts uid,
176
- Just $ onBlur onBlurAction
177
- ]
178
- )
179
- <> ( opts ^. # optsExtraAttributes
180
- )
181
- ]
146
+ <> maybe
147
+ id
148
+ ( \ x ->
149
+ singleton
150
+ . label_ mempty
151
+ . (text x : )
152
+ . (br_ mempty : )
153
+ )
154
+ (optsLabel opts)
155
+ ( [ input_
156
+ $ ( catMaybes
157
+ [ fmap
158
+ (type_ . htmlFieldType)
159
+ (st ^? cloneTraversal optic . # fieldType),
160
+ fmap
161
+ (textProp " defaultValue" )
162
+ (st ^? cloneTraversal optic . # fieldInput . # uniqueValue),
163
+ Just $ onInput onInputAction,
164
+ Just . disabled_ $ opts ^. # optsDisabled,
165
+ fmap placeholder_
166
+ $ if null placeholder
167
+ then optsLabel opts
168
+ else Just placeholder,
169
+ Just
170
+ . id_
171
+ . either impureThrow id
172
+ . decodeUtf8Strict
173
+ . unTagged
174
+ $ htmlUid uid,
175
+ Just . onKeyDown $ action . optsOnKeyDownAction opts uid,
176
+ Just $ onBlur onBlurAction
177
+ ]
178
+ )
179
+ <> ( opts ^. # optsExtraAttributes
180
+ )
181
+ ]
182
+ --
183
+ -- TODO : with new semantic layout separate leading/trailing
184
+ -- widgets do not make a lot of sense, should be a single option
185
+ -- which is just a list widgets.
186
+ --
187
+ <> catMaybes
188
+ [ fmap
189
+ (fieldIcon full opts)
190
+ (opts ^? # optsLeadingWidget . _Just . cloneTraversal widgetOptic),
191
+ fmap
192
+ (fieldIcon full opts)
193
+ (opts ^? # optsTrailingWidget . _Just . cloneTraversal widgetOptic)
194
+ ]
195
+ )
182
196
where
183
197
--
184
198
-- TODO : implement
0 commit comments