Add inset_form to options and date picker macros
This commit is contained in:
@@ -7,7 +7,8 @@
|
||||
mindate=None,
|
||||
maxdate=None,
|
||||
watch=False,
|
||||
optional=True) -%}
|
||||
optional=True,
|
||||
inset_form=False) -%}
|
||||
|
||||
<date-selector
|
||||
{% if maxdate %}maxdate="{{ maxdate.strftime("%Y-%m-%d") }}"{% endif %}
|
||||
@@ -18,9 +19,10 @@
|
||||
initialyear="{{ field.data.year }}"
|
||||
v-bind:watch='{{ watch | string | lower }}'
|
||||
:optional='{{ optional | string | lower }}'
|
||||
v-bind:inset-form={{ inset_form|lower }}
|
||||
inline-template>
|
||||
|
||||
<fieldset class="usa-input date-picker" v-bind:class="{ 'usa-input--success': isDateValid }">
|
||||
<fieldset class="usa-input date-picker" v-bind:class="{ 'usa-input--success': isDateValid && showValidation }">
|
||||
<legend>
|
||||
<div class="usa-input__title">
|
||||
{{ label }}
|
||||
|
@@ -1,7 +1,16 @@
|
||||
{% from "components/icon.html" import Icon %}
|
||||
{% from "components/tooltip.html" import Tooltip %}
|
||||
|
||||
{% macro OptionsInput(field, tooltip, inline=False, label=True, show_validation=True, disabled=False, watch=False, optional=True) -%}
|
||||
{% macro OptionsInput(
|
||||
field,
|
||||
tooltip,
|
||||
inline=False,
|
||||
label=True,
|
||||
show_validation=True,
|
||||
disabled=False,
|
||||
watch=False,
|
||||
optional=True,
|
||||
inset_form=False) -%}
|
||||
<optionsinput
|
||||
name='{{ field.name }}'
|
||||
inline-template
|
||||
@@ -11,6 +20,7 @@
|
||||
v-bind:watch='{{ watch | string | lower }}'
|
||||
v-bind:optional={{ optional|lower }}
|
||||
v-bind:null-option="'{{ field.default }}'"
|
||||
v-bind:inset-form={{ inset_form|lower }}
|
||||
>
|
||||
<div
|
||||
v-bind:class="['usa-input', { 'usa-input--error': showError, 'usa-input--success': showValid }]">
|
||||
|
@@ -3,10 +3,10 @@
|
||||
{% macro PhoneInput(phone_number, phone_ext, placeholder_phone="") %}
|
||||
<div class='phone-input'>
|
||||
<div class='phone-input__phone'>
|
||||
{{ TextInput(phone_number, placeholder=placeholder_phone, validation='usPhone') }}
|
||||
{{ TextInput(phone_number, placeholder=placeholder_phone, validation='usPhone', inset_form=True) }}
|
||||
</div>
|
||||
<div class='phone-input__extension'>
|
||||
{{ TextInput(phone_ext, validation='phoneExt')}}
|
||||
{{ TextInput(phone_ext, validation='phoneExt', inset_form=True)}}
|
||||
</div>
|
||||
</div>
|
||||
{%- endmacro %}
|
||||
|
Reference in New Issue
Block a user