UNPKG

@formio/bootstrap

Version:

Bootstrap templates for Form.io forms

106 lines (105 loc) 2.95 kB
export default function(ctx) { var __t, __p = '', __j = Array.prototype.join; function print() { __p += __j.call(arguments, '') } var fieldsetLegendIds = ctx.instance.getFieldsetLegendIds ? ctx.instance.getFieldsetLegendIds() : ''; ; __p += '\n<div class="row" role="group"\n '; if (ctx.label.hidden) { ; __p += '\n aria-label="' + ((__t = (ctx.component.label)) == null ? '' : __t) + '"\n '; } else { ; __p += '\n aria-labelledby="'; if (fieldsetLegendIds) { ; __p += ((__t = (fieldsetLegendIds)) == null ? '' : __t) + ' '; } ; __p += 'l-' + ((__t = (ctx.instance.id)) == null ? '' : __t) + '-' + ((__t = (ctx.component.key)) == null ? '' : __t) + '"\n '; } ; __p += '\n '; if (ctx.component.description) { ; __p += '\n aria-describedby="d-' + ((__t = (ctx.instance.id)) == null ? '' : __t) + '-' + ((__t = (ctx.component.key)) == null ? '' : __t) + '"\n '; } ; __p += '\n >\n '; if (ctx.dayFirst && ctx.showDay) { ; __p += '\n <div class="col col-xs-3">\n '; if (!ctx.component.hideInputLabels) { ; __p += '\n <label for="' + ((__t = (ctx.component.key)) == null ? '' : __t) + '-day" class="'; if(ctx.component.fields.day.required) { ; __p += 'field-required'; } ; __p += '">' + ((__t = (ctx.t('day'))) == null ? '' : __t) + '</label>\n '; } ; __p += '\n <div>' + ((__t = (ctx.day)) == null ? '' : __t) + '</div>\n </div>\n '; } ; __p += '\n '; if (ctx.showMonth) { ; __p += '\n <div class="col col-xs-4">\n '; if (!ctx.component.hideInputLabels) { ; __p += '\n <label for="' + ((__t = (ctx.component.key)) == null ? '' : __t) + '-month" class="'; if(ctx.component.fields.month.required) { ; __p += 'field-required'; } ; __p += '">' + ((__t = (ctx.t('month'))) == null ? '' : __t) + '</label>\n '; } ; __p += '\n <div>' + ((__t = (ctx.month)) == null ? '' : __t) + '</div>\n </div>\n '; } ; __p += '\n '; if (!ctx.dayFirst && ctx.showDay) { ; __p += '\n <div class="col col-xs-3">\n '; if (!ctx.component.hideInputLabels) { ; __p += '\n <label for="' + ((__t = (ctx.component.key)) == null ? '' : __t) + '-day" class="'; if(ctx.component.fields.day.required) { ; __p += 'field-required'; } ; __p += '">' + ((__t = (ctx.t('day'))) == null ? '' : __t) + '</label>\n '; } ; __p += '\n <div>' + ((__t = (ctx.day)) == null ? '' : __t) + '</div>\n </div>\n '; } ; __p += '\n '; if (ctx.showYear) { ; __p += '\n <div class="col col-xs-5">\n '; if (!ctx.component.hideInputLabels) { ; __p += '\n <label for="' + ((__t = (ctx.component.key)) == null ? '' : __t) + '-year" class="'; if(ctx.component.fields.year.required) { ; __p += 'field-required'; } ; __p += '">' + ((__t = (ctx.t('year'))) == null ? '' : __t) + '</label>\n '; } ; __p += '\n <div>' + ((__t = (ctx.year)) == null ? '' : __t) + '</div>\n </div>\n '; } ; __p += '\n</div>\n<input name="ctx.data[day]" type="hidden" class="form-control" lang="en" value="" ref="input">\n'; return __p }