|
1 | 1 | #macro(leaf $el) |
2 | 2 | #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. |
5 | 7 | A relation.field control's model is the resolver-set name/value variable, so e.g. listing |
6 | 8 | `customer.name` shows the customer's name here rather than the raw FK id. A number is |
7 | 9 | 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> |
10 | 12 | #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> |
12 | 14 | #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> |
14 | 16 | #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> |
16 | 18 | #end |
17 | 19 | </div> |
18 | 20 | #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> |
20 | 22 | #elseif($el.controlId == "paragraph") |
21 | | - <p x-h-text>$!el.label</p> |
| 23 | + <p x-h-text class="col-span-full">$!el.label</p> |
22 | 24 | #elseif($el.controlId == "line") |
23 | | - <hr x-h-separator /> |
| 25 | + <hr x-h-separator class="col-span-full" /> |
24 | 26 | #elseif($el.controlId == "spacer") |
25 | 27 | <div class="flex-1"></div> |
26 | 28 | #elseif($el.controlId == "link") |
27 | 29 | <a x-h-button data-variant="link" href="$!el.url">$!el.label</a> |
28 | 30 | #elseif($el.controlId == "input-textarea") |
29 | | - <div x-h-field> |
| 31 | + <div x-h-field class="col-span-full"> |
30 | 32 | <label x-h-label for="$el.id">$!el.label</label> |
31 | 33 | <textarea x-h-textarea id="$el.id" rows="4" x-model="model.$el.model"#if($el.readonly) readonly#end></textarea> |
32 | 34 | </div> |
|
135 | 137 | <div x-show="message" x-h-alert data-variant="information" role="status"> |
136 | 138 | <div x-h-alert-description x-text="message"></div> |
137 | 139 | </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 |
138 | 146 | <div x-h-field-group> |
| 147 | +#end |
139 | 148 | #foreach($element in $form) |
140 | 149 | #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"> |
142 | 151 | #foreach($child in $element.children) |
143 | 152 | #leaf($child) |
144 | 153 | #end |
145 | 154 | </div> |
146 | 155 | #elseif($element.controlId == "container-vbox") |
147 | | - <div class="vbox gap-3"> |
| 156 | + <div class="vbox gap-3 col-span-full"> |
148 | 157 | #foreach($child in $element.children) |
149 | 158 | #leaf($child) |
150 | 159 | #end |
|
0 commit comments