UNPKG

@formio/bootstrap

Version:

Bootstrap templates for Form.io forms

46 lines 1.7 kB
export default function(ctx) { var __t, __p = '', __j = Array.prototype.join; function print() { __p += __j.call(arguments, '') } __p += '<label\n ref="label"\n class="col-form-label ' + ((__t = (ctx.label.className)) == null ? '' : __t) + ' ' + ((__t = (ctx.label.hidden ? 'visually-hidden' : '')) == null ? '' : __t) + '"\n '; if (!ctx.readOnly && ctx.component.type !== 'radio' && ctx.component.type !== 'selectboxes') { ; __p += '\n for="' + ((__t = (ctx.instance.id)) == null ? '' : __t) + '-' + ((__t = (ctx.component.key)) == null ? '' : __t) + '"\n '; } ; __p += '\n '; if (ctx.component.type === 'radio' || ctx.component.type === 'selectboxes' || ctx.label.hidden) { ; __p += '\n aria-hidden="true"\n '; } ; __p += '\n id="l-' + ((__t = (ctx.instance.id)) == null ? '' : __t) + '-' + ((__t = (ctx.component.key)) == null ? '' : __t) + '"\n>\n ' + ((__t = ( ctx.t(ctx.component.label, { _userInput: true }) )) == null ? '' : __t) + '\n '; if (ctx.component.validate && ctx.component.validate.required) { ; __p += '\n <span class="required-star" aria-hidden="true">*</span>\n '; } ; __p += '\n '; if (ctx.component.type === 'number' || ctx.component.type === 'phoneNumber' || ctx.component.type === 'currency') { ; __p += '\n <span class="visually-hidden">, ' + ((__t = (ctx.t('numeric only'))) == null ? '' : __t) + ',</span>\n '; } ; __p += '\n '; if (ctx.component.tooltip && !ctx.label.hidden) { ; __p += '\n <i ref="tooltip" tabindex="0" class="' + ((__t = (ctx.iconClass('question-sign'))) == null ? '' : __t) + ' text-muted" data-tooltip="' + ((__t = (ctx.component.tooltip)) == null ? '' : __t) + '"></i>\n '; } ; __p += '\n</label>\n'; return __p }