@formbox/htmx 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +323 -0
- package/dist/index.d.ts +615 -0
- package/dist/index.js +62387 -0
- package/dist/templates/AnswerList.html.hbs +17 -0
- package/dist/templates/AnswerScaffold.html.hbs +19 -0
- package/dist/templates/Checkbox.html.hbs +14 -0
- package/dist/templates/CheckboxList.html.hbs +29 -0
- package/dist/templates/CustomOptionForm.html.hbs +16 -0
- package/dist/templates/DateInput.html.hbs +14 -0
- package/dist/templates/DateTimeInput.html.hbs +18 -0
- package/dist/templates/DisplayRenderer.html.hbs +9 -0
- package/dist/templates/Errors.html.hbs +15 -0
- package/dist/templates/FileInput.html.hbs +20 -0
- package/dist/templates/Flyover.html.hbs +12 -0
- package/dist/templates/Footer.html.hbs +8 -0
- package/dist/templates/Form.html.hbs +13 -0
- package/dist/templates/GroupList.html.hbs +22 -0
- package/dist/templates/GroupScaffold.html.hbs +36 -0
- package/dist/templates/Header.html.hbs +8 -0
- package/dist/templates/Help.html.hbs +12 -0
- package/dist/templates/InputGroup.html.hbs +10 -0
- package/dist/templates/Label.html.hbs +23 -0
- package/dist/templates/LanguageSelector.html.hbs +13 -0
- package/dist/templates/Legal.html.hbs +12 -0
- package/dist/templates/Link.html.hbs +9 -0
- package/dist/templates/MultiSelectInput.html.hbs +30 -0
- package/dist/templates/NumberInput.html.hbs +16 -0
- package/dist/templates/OptionDisplay.html.hbs +10 -0
- package/dist/templates/OptionsLoading.html.hbs +10 -0
- package/dist/templates/QuestionScaffold.html.hbs +30 -0
- package/dist/templates/RadioButton.html.hbs +14 -0
- package/dist/templates/RadioButtonList.html.hbs +27 -0
- package/dist/templates/SelectInput.html.hbs +32 -0
- package/dist/templates/SignatureInput.html.hbs +12 -0
- package/dist/templates/SliderInput.html.hbs +23 -0
- package/dist/templates/SpinnerInput.html.hbs +16 -0
- package/dist/templates/Stack.html.hbs +7 -0
- package/dist/templates/TabContainer.html.hbs +27 -0
- package/dist/templates/Table.html.hbs +39 -0
- package/dist/templates/TextArea.html.hbs +13 -0
- package/dist/templates/TextInput.html.hbs +14 -0
- package/dist/templates/TimeInput.html.hbs +12 -0
- package/package.json +57 -0
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{{!--
|
|
2
|
+
Template: AnswerList
|
|
3
|
+
|
|
4
|
+
Inputs:
|
|
5
|
+
- children: rendered repeated answer rows.
|
|
6
|
+
- hasCount/countName/count: hidden occurrence count state.
|
|
7
|
+
- actionName/addAction/addLabel: add-answer submit action.
|
|
8
|
+
- linkId: current question link id for data attributes.
|
|
9
|
+
- path: renderer node path, when present.
|
|
10
|
+
--}}
|
|
11
|
+
{{#if hasCount}}
|
|
12
|
+
<input type="hidden"{{{attr "name" countName}}}{{{attr "value" count}}}>
|
|
13
|
+
{{/if}}
|
|
14
|
+
{{{children}}}
|
|
15
|
+
{{#if addAction}}
|
|
16
|
+
<button type="submit"{{{attr "data-fb-link-id" linkId}}} data-fb-field="add-action"{{{attr "name" actionName}}}{{{attr "value" addAction}}}>{{addLabel}}</button>
|
|
17
|
+
{{/if}}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{{!--
|
|
2
|
+
Template: AnswerScaffold
|
|
3
|
+
|
|
4
|
+
Inputs:
|
|
5
|
+
- control: rendered answer control.
|
|
6
|
+
- errors: rendered answer errors.
|
|
7
|
+
- children: rendered answer child items.
|
|
8
|
+
- actionName/removeAction/removeLabel: remove-answer submit action.
|
|
9
|
+
- linkId: current question link id for data attributes.
|
|
10
|
+
- path/canRemove: repeat answer state used to derive removeAction.
|
|
11
|
+
--}}
|
|
12
|
+
<div>
|
|
13
|
+
{{{control}}}
|
|
14
|
+
{{{errors}}}
|
|
15
|
+
{{{children}}}
|
|
16
|
+
{{#if removeAction}}
|
|
17
|
+
<button type="submit"{{{attr "data-fb-link-id" linkId}}} data-fb-field="remove-action"{{{attr "name" actionName}}}{{{attr "value" removeAction}}}>{{removeLabel}}</button>
|
|
18
|
+
{{/if}}
|
|
19
|
+
</div>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{{!--
|
|
2
|
+
Template: Checkbox
|
|
3
|
+
|
|
4
|
+
Inputs:
|
|
5
|
+
- id: control id.
|
|
6
|
+
- checkedValue/uncheckedValue: submitted values for checked and unchecked states.
|
|
7
|
+
- checked/disabled: current boolean state.
|
|
8
|
+
- hiddenValue: hidden mirror value for unchecked or disabled checked state.
|
|
9
|
+
- label: rendered inline label html.
|
|
10
|
+
- ariaLabelledBy/ariaDescribedBy: accessibility references.
|
|
11
|
+
- field/name/data-fb-link-id/data-fb-field/hx-include: generated form field attributes.
|
|
12
|
+
- path: renderer node path, when present.
|
|
13
|
+
--}}
|
|
14
|
+
<label>{{#if hiddenValue}}<input type="hidden"{{{attr "name" name}}}{{{attr "value" hiddenValue}}}>{{/if}}<input{{{fieldAttributes}}}{{{attr "id" id}}} type="checkbox"{{{attr "value" checkedValue}}}{{{attr "checked" checked}}}{{{attr "disabled" disabled}}}{{{attr "aria-labelledby" ariaLabelledBy}}}{{{attr "aria-describedby" ariaDescribedBy}}}>{{{label}}}</label>
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{{!--
|
|
2
|
+
Template: CheckboxList
|
|
3
|
+
|
|
4
|
+
Inputs:
|
|
5
|
+
- id: fieldset id.
|
|
6
|
+
- options: items with token, label, selected, disabled, and hiddenInput.
|
|
7
|
+
- selectedOptions/selectedName: selected option state and hidden selected-token field name.
|
|
8
|
+
- hiddenInputs/trailingHiddenInputs: hidden values that preserve disabled or off-list selections.
|
|
9
|
+
- specifyOtherOption/customOptionForm: custom option entry controls.
|
|
10
|
+
- orientation/disabled/isLoading: list presentation and state.
|
|
11
|
+
- ariaLabelledBy/ariaDescribedBy: accessibility references.
|
|
12
|
+
- field/name/data-fb-link-id/data-fb-field/hx-include: generated form field attributes.
|
|
13
|
+
- path: renderer node path, when present.
|
|
14
|
+
--}}
|
|
15
|
+
<fieldset{{{attr "id" id}}}{{{attr "data-orientation" orientation}}}{{{attr "aria-labelledby" ariaLabelledBy}}}>
|
|
16
|
+
{{#each hiddenInputs}}
|
|
17
|
+
<input type="hidden"{{{attr "name" name}}}{{{attr "value" value}}}>
|
|
18
|
+
{{/each}}
|
|
19
|
+
{{#each options}}
|
|
20
|
+
{{#if hiddenInput}}
|
|
21
|
+
<input type="hidden"{{{attr "name" hiddenInput.name}}}{{{attr "value" hiddenInput.value}}}>
|
|
22
|
+
{{/if}}
|
|
23
|
+
<label><input{{{fieldAttributes ..}}} type="checkbox"{{{attr "value" token}}}{{{attr "checked" selected}}}{{{attr "disabled" disabled}}}{{{attr "aria-describedby" ../ariaDescribedBy}}}>{{{label}}}</label>
|
|
24
|
+
{{/each}}
|
|
25
|
+
{{#each trailingHiddenInputs}}
|
|
26
|
+
<input type="hidden"{{{attr "name" name}}}{{{attr "value" value}}}>
|
|
27
|
+
{{/each}}
|
|
28
|
+
{{{customOptionForm}}}
|
|
29
|
+
</fieldset>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{{!--
|
|
2
|
+
Template: CustomOptionForm
|
|
3
|
+
|
|
4
|
+
Inputs:
|
|
5
|
+
- content: rendered custom option fields.
|
|
6
|
+
- errors: rendered validation errors.
|
|
7
|
+
- actionName: submit action field name.
|
|
8
|
+
- submitLabel/cancelLabel: button labels.
|
|
9
|
+
- canSubmit: source theme state, if supplied.
|
|
10
|
+
--}}
|
|
11
|
+
<fieldset>
|
|
12
|
+
{{{content}}}
|
|
13
|
+
{{{errors}}}
|
|
14
|
+
<button type="submit"{{{attr "name" actionName}}} value="submit-custom">{{submitLabel}}</button>
|
|
15
|
+
<button type="submit"{{{attr "name" actionName}}} value="cancel-custom">{{cancelLabel}}</button>
|
|
16
|
+
</fieldset>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{{!--
|
|
2
|
+
Template: DateInput
|
|
3
|
+
|
|
4
|
+
Inputs:
|
|
5
|
+
- id: control id.
|
|
6
|
+
- inputType: date or text fallback input type.
|
|
7
|
+
- step: date step attribute, currently undefined.
|
|
8
|
+
- value: submitted date string.
|
|
9
|
+
- disabled/placeholder/min/max: native input state and constraints.
|
|
10
|
+
- ariaLabelledBy/ariaDescribedBy: accessibility references.
|
|
11
|
+
- field/name/data-fb-link-id/data-fb-field/hx-include: generated form field attributes.
|
|
12
|
+
- path: renderer node path, when present.
|
|
13
|
+
--}}
|
|
14
|
+
<input{{{fieldAttributes}}}{{{attr "id" id}}}{{{attr "type" inputType}}}{{{attr "step" step}}}{{{attr "value" value}}}{{{attr "readonly" disabled}}}{{{attr "placeholder" placeholder}}}{{{attr "aria-labelledby" ariaLabelledBy}}}{{{attr "aria-describedby" ariaDescribedBy}}}{{{attr "min" min}}}{{{attr "max" max}}}>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{{!--
|
|
2
|
+
Template: DateTimeInput
|
|
3
|
+
|
|
4
|
+
Inputs:
|
|
5
|
+
- id: control id.
|
|
6
|
+
- inputType: datetime-local or text fallback input type.
|
|
7
|
+
- inputValue/inputMin/inputMax: browser-local datetime value and constraints.
|
|
8
|
+
- baselineName/baselineValue: hidden original value for protected datetime state.
|
|
9
|
+
- step: native input step attribute.
|
|
10
|
+
- disabled/placeholder: native input state.
|
|
11
|
+
- ariaLabelledBy/ariaDescribedBy: accessibility references.
|
|
12
|
+
- field/name/data-fb-link-id/data-fb-field/hx-include: generated form field attributes.
|
|
13
|
+
- path: renderer node path, when present.
|
|
14
|
+
--}}
|
|
15
|
+
{{#if baselineValue}}
|
|
16
|
+
<input type="hidden"{{{attr "name" baselineName}}}{{{attr "value" baselineValue}}}>
|
|
17
|
+
{{/if}}
|
|
18
|
+
<input{{{fieldAttributes}}}{{{attr "id" id}}}{{{attr "type" inputType}}}{{{attr "step" step}}}{{{attr "value" inputValue}}}{{{attr "readonly" disabled}}}{{{attr "placeholder" placeholder}}}{{{attr "aria-labelledby" ariaLabelledBy}}}{{{attr "aria-describedby" ariaDescribedBy}}}{{{attr "min" inputMin}}}{{{attr "max" inputMax}}}>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{{!--
|
|
2
|
+
Template: Errors
|
|
3
|
+
|
|
4
|
+
Inputs:
|
|
5
|
+
- id: error container id.
|
|
6
|
+
- messages: escaped validation messages as html entries.
|
|
7
|
+
- hasMessages: true when messages should render.
|
|
8
|
+
--}}
|
|
9
|
+
{{#if hasMessages}}
|
|
10
|
+
<ul{{{attr "id" id}}} class="fb-errors">
|
|
11
|
+
{{#each messages}}
|
|
12
|
+
<li>{{{html}}}</li>
|
|
13
|
+
{{/each}}
|
|
14
|
+
</ul>
|
|
15
|
+
{{/if}}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{{!--
|
|
2
|
+
Template: FileInput
|
|
3
|
+
|
|
4
|
+
Inputs:
|
|
5
|
+
- id: control id.
|
|
6
|
+
- value/hiddenValue: current attachment and hidden JSON mirror.
|
|
7
|
+
- clearAction/clearLabel: clear-file submit control state.
|
|
8
|
+
- dataLinkId/hxInclude: clear button HTMX attributes.
|
|
9
|
+
- disabled/accept: native file input state.
|
|
10
|
+
- ariaLabelledBy/ariaDescribedBy: accessibility references.
|
|
11
|
+
- field/name/data-fb-link-id/data-fb-field/hx-include: generated form field attributes.
|
|
12
|
+
- path: renderer node path, when present.
|
|
13
|
+
--}}
|
|
14
|
+
{{#if hiddenValue}}
|
|
15
|
+
<input type="hidden"{{{attr "name" name}}}{{{attr "value" hiddenValue}}}>
|
|
16
|
+
{{/if}}
|
|
17
|
+
<input{{{fieldAttributes}}}{{{attr "id" id}}} type="file"{{{attr "disabled" disabled}}}{{{attr "accept" accept}}}{{{attr "aria-labelledby" ariaLabelledBy}}}{{{attr "aria-describedby" ariaDescribedBy}}}>
|
|
18
|
+
{{#if clearAction}}
|
|
19
|
+
<button type="submit"{{{attr "data-fb-link-id" dataLinkId}}} data-fb-field="value"{{{attr "name" name}}} value=""{{{attr "hx-include" hxInclude}}}>{{clearLabel}}</button>
|
|
20
|
+
{{/if}}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{{!--
|
|
2
|
+
Template: Flyover
|
|
3
|
+
|
|
4
|
+
Inputs:
|
|
5
|
+
- id: tooltip id.
|
|
6
|
+
- children: rendered flyover content.
|
|
7
|
+
- ariaLabel: button accessible label.
|
|
8
|
+
--}}
|
|
9
|
+
<span>
|
|
10
|
+
<button type="button"{{{attr "aria-describedby" id}}}{{{attr "aria-label" ariaLabel}}}>i</button>
|
|
11
|
+
<span{{{attr "id" id}}} role="tooltip">{{{children}}}</span>
|
|
12
|
+
</span>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{{!--
|
|
2
|
+
Template: Form
|
|
3
|
+
|
|
4
|
+
Inputs:
|
|
5
|
+
- attributes: native form attributes generated by the renderer.
|
|
6
|
+
- fields: full rendered field html.
|
|
7
|
+
- customExtensions: source extension values, if supplied.
|
|
8
|
+
- title/description/languageSelector/errors/before/children/after/signature: source sections already included in fields.
|
|
9
|
+
- pagination/submitLabel: source action state already included in fields.
|
|
10
|
+
--}}
|
|
11
|
+
<form{{{attrs attributes}}}>
|
|
12
|
+
{{{fields}}}
|
|
13
|
+
</form>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{{!--
|
|
2
|
+
Template: GroupList
|
|
3
|
+
|
|
4
|
+
Inputs:
|
|
5
|
+
- linkId: repeated group link id.
|
|
6
|
+
- header/errors/children: rendered group list sections.
|
|
7
|
+
- hasCount/countName/count: hidden occurrence count state.
|
|
8
|
+
- actionName/addAction/addLabel: add-group submit action.
|
|
9
|
+
- path/canAdd: repeat group state used to derive addAction.
|
|
10
|
+
- customExtensions: source extension values, if supplied.
|
|
11
|
+
--}}
|
|
12
|
+
<section{{{attr "data-fb-group-list" linkId}}}>
|
|
13
|
+
{{#if hasCount}}
|
|
14
|
+
<input type="hidden"{{{attr "name" countName}}}{{{attr "value" count}}}>
|
|
15
|
+
{{/if}}
|
|
16
|
+
{{{header}}}
|
|
17
|
+
{{{errors}}}
|
|
18
|
+
{{{children}}}
|
|
19
|
+
{{#if addAction}}
|
|
20
|
+
<button type="submit"{{{attr "data-fb-link-id" linkId}}} data-fb-field="add-action"{{{attr "name" actionName}}}{{{attr "value" addAction}}}>{{addLabel}}</button>
|
|
21
|
+
{{/if}}
|
|
22
|
+
</section>
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
{{!--
|
|
2
|
+
Template: GroupScaffold
|
|
3
|
+
|
|
4
|
+
Inputs:
|
|
5
|
+
- linkId: group link id.
|
|
6
|
+
- header/children/expandedChildren/errors/signature: rendered group sections.
|
|
7
|
+
- isExpandable/isExpanded/expandedName/expandedValue: collapsible group state.
|
|
8
|
+
- summaryLabel/collapseLabel/expandLabel/toggleAction: collapsible submit control state.
|
|
9
|
+
- actionName/removeAction/removeLabel: remove-group submit action.
|
|
10
|
+
- path/canRemove: repeat group state used to derive removeAction.
|
|
11
|
+
- customExtensions: source extension values, if supplied.
|
|
12
|
+
--}}
|
|
13
|
+
<fieldset{{{attr "data-fb-link-id" linkId}}}>
|
|
14
|
+
{{{header}}}
|
|
15
|
+
{{#if isExpandable}}
|
|
16
|
+
{{#if expandedName}}
|
|
17
|
+
<input type="hidden"{{{attr "name" expandedName}}}{{{attr "value" expandedValue}}}>
|
|
18
|
+
{{/if}}
|
|
19
|
+
<details{{{attr "data-fb-collapsible" linkId}}}{{{attr "open" isExpanded}}}>
|
|
20
|
+
<summary>{{#if toggleAction}}<button type="submit"{{{attr "name" actionName}}}{{{attr "value" toggleAction}}}>{{summaryLabel}}</button>{{else}}{{summaryLabel}}{{/if}}</summary>
|
|
21
|
+
{{{expandedChildren}}}
|
|
22
|
+
</details>
|
|
23
|
+
{{{errors}}}
|
|
24
|
+
{{{signature}}}
|
|
25
|
+
{{#if removeAction}}
|
|
26
|
+
<button type="submit"{{{attr "data-fb-link-id" linkId}}} data-fb-field="remove-action"{{{attr "name" actionName}}}{{{attr "value" removeAction}}}>{{removeLabel}}</button>
|
|
27
|
+
{{/if}}
|
|
28
|
+
{{else}}
|
|
29
|
+
{{{errors}}}
|
|
30
|
+
{{{children}}}
|
|
31
|
+
{{{signature}}}
|
|
32
|
+
{{#if removeAction}}
|
|
33
|
+
<button type="submit"{{{attr "data-fb-link-id" linkId}}} data-fb-field="remove-action"{{{attr "name" actionName}}}{{{attr "value" removeAction}}}>{{removeLabel}}</button>
|
|
34
|
+
{{/if}}
|
|
35
|
+
{{/if}}
|
|
36
|
+
</fieldset>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{{!--
|
|
2
|
+
Template: Help
|
|
3
|
+
|
|
4
|
+
Inputs:
|
|
5
|
+
- id: tooltip id.
|
|
6
|
+
- children: rendered help content.
|
|
7
|
+
- ariaLabel: button accessible label.
|
|
8
|
+
--}}
|
|
9
|
+
<span>
|
|
10
|
+
<button type="button"{{{attr "aria-describedby" id}}}{{{attr "aria-label" ariaLabel}}}>?</button>
|
|
11
|
+
<span{{{attr "id" id}}} role="tooltip">{{{children}}}</span>
|
|
12
|
+
</span>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{{!--
|
|
2
|
+
Template: Label
|
|
3
|
+
|
|
4
|
+
Inputs:
|
|
5
|
+
- id/htmlFor: label id and target control id.
|
|
6
|
+
- as/isLegend/isText: rendered label element kind.
|
|
7
|
+
- content: rendered label text, prefix, required marker, and help/legal/flyover html.
|
|
8
|
+
- children/prefix/required/shortText: source label text state.
|
|
9
|
+
- supportHyperlinks: links with href and labelHtml.
|
|
10
|
+
- media: rendered attachment media html.
|
|
11
|
+
- help/legal/flyover: rendered extension slots.
|
|
12
|
+
- isExpanded: source expansion state, if supplied.
|
|
13
|
+
- attachmentLabel: accessible text used while rendering media.
|
|
14
|
+
--}}
|
|
15
|
+
{{#if isLegend}}
|
|
16
|
+
<legend{{{attr "id" id}}}{{{attr "data-short-text" shortText}}}>{{{content}}}{{#if supportHyperlinks.length}}<div>{{#each supportHyperlinks}}<a{{{attr "href" href}}} target="_blank" rel="noreferrer">{{{labelHtml}}}</a>{{/each}}</div>{{/if}}{{{media}}}</legend>
|
|
17
|
+
{{else}}
|
|
18
|
+
{{#if isText}}
|
|
19
|
+
<span{{{attr "id" id}}}{{{attr "data-short-text" shortText}}}>{{{content}}}{{#if supportHyperlinks.length}}<div>{{#each supportHyperlinks}}<a{{{attr "href" href}}} target="_blank" rel="noreferrer">{{{labelHtml}}}</a>{{/each}}</div>{{/if}}{{{media}}}</span>
|
|
20
|
+
{{else}}
|
|
21
|
+
<label{{{attr "id" id}}}{{{attr "for" htmlFor}}}{{{attr "data-short-text" shortText}}}>{{{content}}}{{#if supportHyperlinks.length}}<div>{{#each supportHyperlinks}}<a{{{attr "href" href}}} target="_blank" rel="noreferrer">{{{labelHtml}}}</a>{{/each}}</div>{{/if}}{{{media}}}</label>
|
|
22
|
+
{{/if}}
|
|
23
|
+
{{/if}}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{{!--
|
|
2
|
+
Template: LanguageSelector
|
|
3
|
+
|
|
4
|
+
Inputs:
|
|
5
|
+
- name: generated language field name.
|
|
6
|
+
- value: current language code.
|
|
7
|
+
- options: language options with value, label, and selected.
|
|
8
|
+
--}}
|
|
9
|
+
<select{{{attr "name" name}}}>
|
|
10
|
+
{{#each options}}
|
|
11
|
+
<option{{{attr "value" value}}}{{{attr "selected" selected}}}>{{label}}</option>
|
|
12
|
+
{{/each}}
|
|
13
|
+
</select>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{{!--
|
|
2
|
+
Template: Legal
|
|
3
|
+
|
|
4
|
+
Inputs:
|
|
5
|
+
- id: dialog id.
|
|
6
|
+
- children: rendered legal content.
|
|
7
|
+
- ariaLabel: button accessible label.
|
|
8
|
+
--}}
|
|
9
|
+
<span>
|
|
10
|
+
<button type="button"{{{attr "aria-describedby" id}}}{{{attr "aria-label" ariaLabel}}}>!</button>
|
|
11
|
+
<span{{{attr "id" id}}} role="dialog">{{{children}}}</span>
|
|
12
|
+
</span>
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{{!--
|
|
2
|
+
Template: MultiSelectInput
|
|
3
|
+
|
|
4
|
+
Inputs:
|
|
5
|
+
- id: fieldset id.
|
|
6
|
+
- options: items with token, label, selected, disabled, and hiddenInput.
|
|
7
|
+
- selectedOptions/selectedName: selected option state and hidden selected-token field name.
|
|
8
|
+
- hiddenInputs/trailingHiddenInputs: hidden values that preserve disabled or off-list selections.
|
|
9
|
+
- searchQuery/searchName/searchLabel: server-side option search state.
|
|
10
|
+
- specifyOtherOption/customOptionForm: custom option entry controls.
|
|
11
|
+
- orientation/disabled/isLoading/placeholder: list presentation and state.
|
|
12
|
+
- ariaLabelledBy/ariaDescribedBy: accessibility references.
|
|
13
|
+
- field/name/data-fb-link-id/data-fb-field/hx-include: generated form field attributes.
|
|
14
|
+
- path: renderer node path, when present.
|
|
15
|
+
--}}
|
|
16
|
+
<fieldset{{{attr "id" id}}}{{{attr "data-orientation" orientation}}}{{{attr "aria-labelledby" ariaLabelledBy}}}>
|
|
17
|
+
{{#each hiddenInputs}}
|
|
18
|
+
<input type="hidden"{{{attr "name" name}}}{{{attr "value" value}}}>
|
|
19
|
+
{{/each}}
|
|
20
|
+
{{#each options}}
|
|
21
|
+
{{#if hiddenInput}}
|
|
22
|
+
<input type="hidden"{{{attr "name" hiddenInput.name}}}{{{attr "value" hiddenInput.value}}}>
|
|
23
|
+
{{/if}}
|
|
24
|
+
<label><input{{{fieldAttributes ..}}} type="checkbox"{{{attr "value" token}}}{{{attr "checked" selected}}}{{{attr "disabled" disabled}}}{{{attr "aria-describedby" ../ariaDescribedBy}}}>{{{label}}}</label>
|
|
25
|
+
{{/each}}
|
|
26
|
+
{{#each trailingHiddenInputs}}
|
|
27
|
+
<input type="hidden"{{{attr "name" name}}}{{{attr "value" value}}}>
|
|
28
|
+
{{/each}}
|
|
29
|
+
{{{customOptionForm}}}
|
|
30
|
+
</fieldset>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{{!--
|
|
2
|
+
Template: NumberInput
|
|
3
|
+
|
|
4
|
+
Inputs:
|
|
5
|
+
- id: control id.
|
|
6
|
+
- value/inputValue: numeric answer value prepared for the native input.
|
|
7
|
+
- unitLabel/unitId/describedBy: optional rendered unit text and combined aria description.
|
|
8
|
+
- disabled/placeholder/step/min/max: native input state and constraints.
|
|
9
|
+
- ariaLabelledBy/ariaDescribedBy: accessibility references.
|
|
10
|
+
- field/name/data-fb-link-id/data-fb-field/hx-include: generated form field attributes.
|
|
11
|
+
- path: renderer node path, when present.
|
|
12
|
+
--}}
|
|
13
|
+
<input{{{fieldAttributes}}}{{{attr "id" id}}} type="number"{{{attr "value" inputValue}}}{{{attr "readonly" disabled}}}{{{attr "placeholder" placeholder}}}{{{attr "step" step}}}{{{attr "min" min}}}{{{attr "max" max}}}{{{attr "aria-labelledby" ariaLabelledBy}}}{{{attr "aria-describedby" describedBy}}}>
|
|
14
|
+
{{#if unitLabel}}
|
|
15
|
+
<span{{{attr "id" unitId}}}>{{unitLabel}}</span>
|
|
16
|
+
{{/if}}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{{!--
|
|
2
|
+
Template: OptionDisplay
|
|
3
|
+
|
|
4
|
+
Inputs:
|
|
5
|
+
- children: rendered option text.
|
|
6
|
+
- prefix: optional option prefix.
|
|
7
|
+
- media: rendered attachment media html.
|
|
8
|
+
- attachmentLabel: accessible text used while rendering media.
|
|
9
|
+
--}}
|
|
10
|
+
<span>{{{media}}}{{#if prefix}}{{{prefix}}} {{/if}}{{{children}}}</span>
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{{!--
|
|
2
|
+
Template: QuestionScaffold
|
|
3
|
+
|
|
4
|
+
Inputs:
|
|
5
|
+
- linkId: question link id.
|
|
6
|
+
- header/children/expandedChildren/errors/signature: rendered question sections.
|
|
7
|
+
- isExpandable/isExpanded/expandedName/expandedValue: collapsible question state.
|
|
8
|
+
- summaryLabel/collapseLabel/expandLabel/toggleAction: collapsible submit control state.
|
|
9
|
+
- actionName: submit action field name.
|
|
10
|
+
- path: renderer node path, when present.
|
|
11
|
+
- customExtensions: source extension values, if supplied.
|
|
12
|
+
--}}
|
|
13
|
+
<div{{{attr "data-fb-question" linkId}}}>
|
|
14
|
+
{{{header}}}
|
|
15
|
+
{{#if isExpandable}}
|
|
16
|
+
{{#if expandedName}}
|
|
17
|
+
<input type="hidden"{{{attr "name" expandedName}}}{{{attr "value" expandedValue}}}>
|
|
18
|
+
{{/if}}
|
|
19
|
+
<details{{{attr "data-fb-collapsible" linkId}}}{{{attr "open" isExpanded}}}>
|
|
20
|
+
<summary>{{#if toggleAction}}<button type="submit"{{{attr "name" actionName}}}{{{attr "value" toggleAction}}}>{{summaryLabel}}</button>{{else}}{{summaryLabel}}{{/if}}</summary>
|
|
21
|
+
{{{expandedChildren}}}
|
|
22
|
+
</details>
|
|
23
|
+
{{{errors}}}
|
|
24
|
+
{{{signature}}}
|
|
25
|
+
{{else}}
|
|
26
|
+
{{{errors}}}
|
|
27
|
+
{{{children}}}
|
|
28
|
+
{{{signature}}}
|
|
29
|
+
{{/if}}
|
|
30
|
+
</div>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{{!--
|
|
2
|
+
Template: RadioButton
|
|
3
|
+
|
|
4
|
+
Inputs:
|
|
5
|
+
- id: control id.
|
|
6
|
+
- groupName: source radio group name, if supplied.
|
|
7
|
+
- value/hiddenValue: submitted radio value and hidden mirror.
|
|
8
|
+
- checked/disabled: current radio state.
|
|
9
|
+
- label: rendered inline label html.
|
|
10
|
+
- ariaLabelledBy/ariaDescribedBy: accessibility references.
|
|
11
|
+
- field/name/data-fb-link-id/data-fb-field/hx-include: generated form field attributes.
|
|
12
|
+
- path: renderer node path, when present.
|
|
13
|
+
--}}
|
|
14
|
+
<label>{{#if hiddenValue}}<input type="hidden"{{{attr "name" name}}}{{{attr "value" hiddenValue}}}>{{/if}}<input{{{fieldAttributes}}}{{{attr "id" id}}} type="radio"{{{attr "value" value}}}{{{attr "checked" checked}}}{{{attr "disabled" disabled}}}{{{attr "aria-labelledby" ariaLabelledBy}}}{{{attr "aria-describedby" ariaDescribedBy}}}>{{{label}}}</label>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{{!--
|
|
2
|
+
Template: RadioButtonList
|
|
3
|
+
|
|
4
|
+
Inputs:
|
|
5
|
+
- id: fieldset id.
|
|
6
|
+
- options: items with token, label, checked, and disabled.
|
|
7
|
+
- selectedOption: current selected option state.
|
|
8
|
+
- hiddenValue: hidden mirror value for disabled or preserved selections.
|
|
9
|
+
- baselineName/baselineValue: hidden original value for protected selection state.
|
|
10
|
+
- specifyOtherOption/customOptionForm: custom option entry controls.
|
|
11
|
+
- orientation/disabled/isLoading: list presentation and state.
|
|
12
|
+
- ariaLabelledBy/ariaDescribedBy: accessibility references.
|
|
13
|
+
- field/name/data-fb-link-id/data-fb-field/hx-include: generated form field attributes.
|
|
14
|
+
- path: renderer node path, when present.
|
|
15
|
+
--}}
|
|
16
|
+
<fieldset{{{attr "id" id}}} role="radiogroup"{{{attr "data-orientation" orientation}}}{{{attr "aria-labelledby" ariaLabelledBy}}}>
|
|
17
|
+
{{#if hiddenValue}}
|
|
18
|
+
<input type="hidden"{{{attr "name" name}}}{{{attr "value" hiddenValue}}}>
|
|
19
|
+
{{/if}}
|
|
20
|
+
{{#if baselineValue}}
|
|
21
|
+
<input type="hidden"{{{attr "name" baselineName}}}{{{attr "value" baselineValue}}}>
|
|
22
|
+
{{/if}}
|
|
23
|
+
{{#each options}}
|
|
24
|
+
<label><input{{{fieldAttributes ..}}} type="radio"{{{attr "value" token}}}{{{attr "checked" checked}}}{{{attr "disabled" disabled}}}{{{attr "aria-describedby" ../ariaDescribedBy}}}>{{{label}}}</label>
|
|
25
|
+
{{/each}}
|
|
26
|
+
{{{customOptionForm}}}
|
|
27
|
+
</fieldset>
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{{!--
|
|
2
|
+
Template: SelectInput
|
|
3
|
+
|
|
4
|
+
Inputs:
|
|
5
|
+
- id: select id.
|
|
6
|
+
- value: selected option token.
|
|
7
|
+
- options: items with token, label, selected, disabled, and exclusive.
|
|
8
|
+
- selectedOption: current selected option state.
|
|
9
|
+
- hiddenValue: true when the selected token needs a hidden mirror.
|
|
10
|
+
- baselineName/baselineValue: hidden original value for protected selection state.
|
|
11
|
+
- searchName/searchLabel: server-side option search state.
|
|
12
|
+
- placeholder/specifyOtherOption/customOptionForm: option presentation and custom entry controls.
|
|
13
|
+
- disabled/isLoading/isBusy: select state.
|
|
14
|
+
- ariaLabelledBy/ariaDescribedBy: accessibility references.
|
|
15
|
+
- field/name/data-fb-link-id/data-fb-field/hx-include: generated form field attributes.
|
|
16
|
+
- path: renderer node path, when present.
|
|
17
|
+
--}}
|
|
18
|
+
{{#if hiddenValue}}
|
|
19
|
+
<input type="hidden"{{{attr "name" name}}}{{{attr "value" value}}}>
|
|
20
|
+
{{/if}}
|
|
21
|
+
{{#if baselineValue}}
|
|
22
|
+
<input type="hidden"{{{attr "name" baselineName}}}{{{attr "value" baselineValue}}}>
|
|
23
|
+
{{/if}}
|
|
24
|
+
<select{{{fieldAttributes}}}{{{attr "id" id}}}{{{attr "disabled" disabled}}}{{{attr "aria-labelledby" ariaLabelledBy}}}{{{attr "aria-describedby" ariaDescribedBy}}}{{{attr "aria-busy" isBusy}}}>
|
|
25
|
+
{{#unless placeholder}}
|
|
26
|
+
<option value=""></option>
|
|
27
|
+
{{/unless}}
|
|
28
|
+
{{#each options}}
|
|
29
|
+
<option{{{attr "value" token}}}{{{attr "disabled" disabled}}}{{{attr "selected" selected}}}>{{{label}}}</option>
|
|
30
|
+
{{/each}}
|
|
31
|
+
</select>
|
|
32
|
+
{{{customOptionForm}}}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{{!--
|
|
2
|
+
Template: SignatureInput
|
|
3
|
+
|
|
4
|
+
Inputs:
|
|
5
|
+
- id: control id.
|
|
6
|
+
- value/inputValue: serialized signature value.
|
|
7
|
+
- disabled: source disabled state, if supplied.
|
|
8
|
+
- ariaLabelledBy/ariaDescribedBy: accessibility references.
|
|
9
|
+
- field/name/data-fb-link-id/data-fb-field/hx-include: generated form field attributes.
|
|
10
|
+
- path: renderer node path, when present.
|
|
11
|
+
--}}
|
|
12
|
+
<input{{{fieldAttributes}}}{{{attr "id" id}}} type="hidden"{{{attr "value" inputValue}}}{{{attr "aria-labelledby" ariaLabelledBy}}}{{{attr "aria-describedby" ariaDescribedBy}}}>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{{!--
|
|
2
|
+
Template: SliderInput
|
|
3
|
+
|
|
4
|
+
Inputs:
|
|
5
|
+
- id: control id.
|
|
6
|
+
- value/inputValue: numeric answer value prepared for the native range input.
|
|
7
|
+
- lowerLabel/upperLabel: rendered range end labels.
|
|
8
|
+
- unitLabel/unitId/describedBy: optional rendered unit text and combined aria description.
|
|
9
|
+
- disabled/step/min/max: native range state and constraints.
|
|
10
|
+
- ariaLabelledBy/ariaDescribedBy: accessibility references.
|
|
11
|
+
- field/name/data-fb-link-id/data-fb-field/hx-include: generated form field attributes.
|
|
12
|
+
- path: renderer node path, when present.
|
|
13
|
+
--}}
|
|
14
|
+
{{#if lowerLabel}}
|
|
15
|
+
<span>{{lowerLabel}}</span>
|
|
16
|
+
{{/if}}
|
|
17
|
+
<input{{{fieldAttributes}}}{{{attr "id" id}}} type="range"{{{attr "value" inputValue}}}{{{attr "disabled" disabled}}}{{{attr "step" step}}}{{{attr "min" min}}}{{{attr "max" max}}}{{{attr "aria-labelledby" ariaLabelledBy}}}{{{attr "aria-describedby" describedBy}}}>
|
|
18
|
+
{{#if upperLabel}}
|
|
19
|
+
<span>{{upperLabel}}</span>
|
|
20
|
+
{{/if}}
|
|
21
|
+
{{#if unitLabel}}
|
|
22
|
+
<span{{{attr "id" unitId}}}>{{unitLabel}}</span>
|
|
23
|
+
{{/if}}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{{!--
|
|
2
|
+
Template: SpinnerInput
|
|
3
|
+
|
|
4
|
+
Inputs:
|
|
5
|
+
- id: control id.
|
|
6
|
+
- value/inputValue: numeric answer value prepared for the native number input.
|
|
7
|
+
- unitLabel/unitId/describedBy: optional rendered unit text and combined aria description.
|
|
8
|
+
- disabled/placeholder/step/min/max: native input state and constraints.
|
|
9
|
+
- ariaLabelledBy/ariaDescribedBy: accessibility references.
|
|
10
|
+
- field/name/data-fb-link-id/data-fb-field/hx-include: generated form field attributes.
|
|
11
|
+
- path: renderer node path, when present.
|
|
12
|
+
--}}
|
|
13
|
+
<input{{{fieldAttributes}}}{{{attr "id" id}}} type="number"{{{attr "value" inputValue}}}{{{attr "readonly" disabled}}}{{{attr "placeholder" placeholder}}}{{{attr "step" step}}}{{{attr "min" min}}}{{{attr "max" max}}}{{{attr "aria-labelledby" ariaLabelledBy}}}{{{attr "aria-describedby" describedBy}}}>
|
|
14
|
+
{{#if unitLabel}}
|
|
15
|
+
<span{{{attr "id" unitId}}}>{{unitLabel}}</span>
|
|
16
|
+
{{/if}}
|