Skip to content

Commit 0c230ac

Browse files
committed
feat(harmonia): professional BPM task-form layout - two-column detail grid with label columns
A task form rendered every read-only field as a stacked Label-above-Value block in a single column with the field-group's full gap - a long, loose page for what is really a compact detail card. Rework the task-form layout: - the field container becomes a responsive two-column grid (single column below sm, so narrow dialogs still read well); - each read-only field is a compact row: a fixed-width muted label column with the value LEFT-aligned beside it, so values line up vertically like a classic detail card; - headers, separators, paragraphs, textareas and the action-button row span both columns; non-task forms keep the x-h-field-group vertical layout unchanged. All utility classes used ship in harmonia.css 2.6.0. Verified live: regenerated a confirm task form on the updated template - the served form renders the two-column detail card.
1 parent 486db9a commit 0c230ac

1 file changed

Lines changed: 22 additions & 13 deletions

File tree

  • components/template/template-form-builder-harmonia/src/main/resources/META-INF/dirigible/template-form-builder-harmonia/ui

components/template/template-form-builder-harmonia/src/main/resources/META-INF/dirigible/template-form-builder-harmonia/ui/index.html.template

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,34 @@
11
#macro(leaf $el)
22
#if($metadata.taskForm && $el.readonly && $el.model)
3-
<!-- BPM task form: a read-only field is shown as a Label: Value row (like the detail card), not
4-
an editable input. Editable opt-in fields (readonly=false) fall through to the input below.
3+
<!-- BPM task form: a read-only field is a compact Label: Value row - a fixed-width muted
4+
label column with the value LEFT-aligned beside it, so values line up vertically like a
5+
classic detail card - one cell of the two-column grid.
6+
Editable opt-in fields (readonly=false) fall through to the input below.
57
A relation.field control's model is the resolver-set name/value variable, so e.g. listing
68
`customer.name` shows the customer's name here rather than the raw FK id. A number is
79
formatted with its pattern (grouped, fixed decimals); other values render as-is. -->
8-
<div x-h-field>
9-
<label x-h-label>$!el.label</label>
10+
<div class="hbox items-center gap-3">
11+
<span x-h-text.muted class="text-sm shrink-0" style="width: 9rem;">$!el.label</span>
1012
#if($el.controlId == "input-number")
11-
<div x-h-text class="py-1" x-text="fmtNumber(model.$el.model, '$!el.pattern')"></div>
13+
<span x-h-text class="font-medium min-w-0 break-words" x-text="fmtNumber(model.$el.model, '$!el.pattern')"></span>
1214
#elseif($el.controlId == "input-date" || $el.controlId == "input-datetime-local" || $el.controlId == "input-time" || $el.controlId == "input-month")
13-
<div x-h-text class="py-1" x-text="fmtDate(model.$el.model, '$el.controlId')"></div>
15+
<span x-h-text class="font-medium min-w-0 break-words" x-text="fmtDate(model.$el.model, '$el.controlId')"></span>
1416
#else
15-
<div x-h-text class="py-1" x-text="(model.$el.model === null || model.$el.model === undefined || model.$el.model === '') ? '—' : model.$el.model"></div>
17+
<span x-h-text class="font-medium min-w-0 break-words" x-text="(model.$el.model === null || model.$el.model === undefined || model.$el.model === '') ? '—' : model.$el.model"></span>
1618
#end
1719
</div>
1820
#elseif($el.controlId == "header")
19-
<h1 x-h-text.h3 class="mb-2">$!el.label</h1>
21+
<h1 x-h-text.h3 class="mb-2 col-span-full">$!el.label</h1>
2022
#elseif($el.controlId == "paragraph")
21-
<p x-h-text>$!el.label</p>
23+
<p x-h-text class="col-span-full">$!el.label</p>
2224
#elseif($el.controlId == "line")
23-
<hr x-h-separator />
25+
<hr x-h-separator class="col-span-full" />
2426
#elseif($el.controlId == "spacer")
2527
<div class="flex-1"></div>
2628
#elseif($el.controlId == "link")
2729
<a x-h-button data-variant="link" href="$!el.url">$!el.label</a>
2830
#elseif($el.controlId == "input-textarea")
29-
<div x-h-field>
31+
<div x-h-field class="col-span-full">
3032
<label x-h-label for="$el.id">$!el.label</label>
3133
<textarea x-h-textarea id="$el.id" rows="4" x-model="model.$el.model"#if($el.readonly) readonly#end></textarea>
3234
</div>
@@ -135,16 +137,23 @@
135137
<div x-show="message" x-h-alert data-variant="information" role="status">
136138
<div x-h-alert-description x-text="message"></div>
137139
</div>
140+
#if($metadata.taskForm)
141+
<!-- Task form: a responsive two-column detail grid (single column below the sm breakpoint) -
142+
compact horizontal Label: Value rows; headers, separators, textareas and the action-button
143+
row span both columns. -->
144+
<div class="grid grid-cols-1 sm:grid-cols-2 gap-x-10 gap-y-3">
145+
#else
138146
<div x-h-field-group>
147+
#end
139148
#foreach($element in $form)
140149
#if($element.controlId == "container-hbox")
141-
<div class="hbox gap-3 items-end">
150+
<div class="hbox gap-3 items-end col-span-full mt-2">
142151
#foreach($child in $element.children)
143152
#leaf($child)
144153
#end
145154
</div>
146155
#elseif($element.controlId == "container-vbox")
147-
<div class="vbox gap-3">
156+
<div class="vbox gap-3 col-span-full">
148157
#foreach($child in $element.children)
149158
#leaf($child)
150159
#end

0 commit comments

Comments
 (0)