Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 751eb2f

Browse files
committed
Add titles for object
1 parent cd39e77 commit 751eb2f

File tree

5 files changed

+25
-5
lines changed

5 files changed

+25
-5
lines changed

‎src/Json/Form.elm

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import Json.Schema
2525
import Json.Schema.Definitions exposing (..)
2626
import Json.Schema.Validation exposing (Error)
2727
import Json.Value as JsonValue exposing (JsonValue(..))
28-
import JsonFormUtil as Util exposing (getUiSpec, jsonValueToString)
28+
import JsonFormUtil as Util exposing (getTitle, getUiSpec, jsonValueToString)
2929
import Task
3030

3131

@@ -210,14 +210,20 @@ viewObject model schema properties isRequired isDisabled path =
210210

211211
_ ->
212212
[]
213+
214+
title =
215+
schema |> getTitle isRequired
213216
in
214217
if hidden then
215218
text ""
216219

217220
else
218-
properties
219-
|> iterateOverSchemata
220-
|> div []
221+
div [ class "jf-nested-object" ]
222+
[ Html.h3 [] [ text title ]
223+
, properties
224+
|> iterateOverSchemata
225+
|> div []
226+
]
221227

222228

223229
updateConfig : Config -> Model -> Model

‎stylesheets/app.css

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
--color-active--054: #8fd9e3;
66
box-sizing: border-box;
77
--form-background: #fafafa;
8+
--object-heading-indent: 0px;
9+
--nested-object-padding: 0px;
810
}
911

1012
.app-topbar {

‎stylesheets/checkbox.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@
6464

6565
.jf-checkbox__helper-text {
6666
font-size: 12px;
67+
padding-top: 4px;
6768
padding-right: 32px;
6869
color: rgba(0, 0, 0, 0.54);
6970
}

‎stylesheets/globals.css

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
--color-active--054: #8fd9e3;
66
--color-inactive: #8a8a8a;
77
--color-invalid: #c72227;
8-
--color-swatch--500: #009688;
98
--form-background: #fafafa;
109
box-sizing: border-box;
1110
}

‎stylesheets/json-form.css

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,15 @@
1010
.array-item-add .button {
1111
font-size: 16px;
1212
}
13+
14+
h3 + div {
15+
padding: var(--object-heading-indent);
16+
}
17+
18+
.jf-nested-object {
19+
padding: var(--nested-object-padding);
20+
}
21+
22+
.jf-json-form {
23+
background: var(--form-background);
24+
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /