@formio/bootstrap
Version:
Bootstrap templates for Form.io forms
55 lines • 3.55 kB
JavaScript
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default=function(ctx) {
var __t, __p = '', __j = Array.prototype.join;
function print() { __p += __j.call(arguments, '') }
__p += '<div ref="menu">\r\n <ul class="dropdown-menu checkbox-menu allow-focus" ref="dropdown">\r\n ';
if (ctx.options.sortable && ctx.component && ctx.component.sortable) { ;
__p += '\r\n <li class="dropdown-item" ref="sortAscending">↑ ' +
((__t = (ctx.t('sortAscending'))) == null ? '' : __t) +
'</li>\r\n <li class="dropdown-item" ref="sortDescending">↓ ' +
((__t = (ctx.t('sortDescending'))) == null ? '' : __t) +
'</li>\r\n <li ref="rootItem" role="separator" class="divider"></li>\r\n ';
} ;
__p += '\r\n <li ref="rootItem" class="dropdown-item">\r\n ' +
((__t = (ctx.t('columns'))) == null ? '' : __t) +
' <span class="arrow-right">›</span>\r\n <ul ref="nestedDropdown" class="dropdown-menu checkbox-menu allow-focus">\r\n ';
ctx.components.forEach(function(comp) { ;
__p += '\r\n <li class="dropdown-item">\r\n <label class="radio-btn">\r\n <input \r\n ref="checkbox"\r\n ' +
((__t = ( comp.show ? 'checked' : '' )) == null ? '' : __t) +
'\r\n ' +
((__t = ( ctx.lastColumn && comp.show ? 'disabled' : '' )) == null ? '' : __t) +
'\r\n type="checkbox"\r\n class="form-check-input">\r\n <span class="form-check-label">\r\n ' +
((__t = ( ctx.t(comp.label, { _userInput: true }) )) == null ? '' : __t) +
'\r\n </span>\r\n </label>\r\n </li>\r\n ';
}); ;
__p += '\r\n </ul>\r\n </li>\r\n ';
if (ctx.options.filterable && ctx.component && ctx.component.filterable) { ;
__p += '\r\n <li ref="rootItem" role="separator" class="divider"></li>\r\n <li ref="rootItem" class="dropdown-item">\r\n ' +
((__t = (ctx.t('filter'))) == null ? '' : __t) +
' <span class="arrow-right">›</span>\r\n <ul ref="nestedDropdown" class="dropdown-menu">\r\n <form ref="filterForm" class="px-3 py-2">\r\n ' +
((__t = (ctx.t('showItemsWithValue'))) == null ? '' : __t) +
'\r\n <div class="form-group">\r\n <select ref="filterType" class="form-control">\r\n ';
ctx.filterTypes.forEach(function(filterType) { ;
__p += '\r\n ';
if (!(ctx.hideFilters.includes(ctx.component.key) && (['startsWith', 'contain', 'notContain', 'endsWith', 'matches' ].includes(filterType.type)))) { ;
__p += '\r\n <option value="' +
((__t = ( filterType.type )) == null ? '' : __t) +
'">' +
((__t = ( ctx.t(filterType.label) )) == null ? '' : __t) +
'</option>\r\n ';
} ;
__p += '\r\n ';
}); ;
__p += '\r\n </select>\r\n </div>\r\n <div class="form-group">\r\n <input type="text" ref="filterInput" name="' +
((__t = ( ctx.component && ctx.component.key )) == null ? '' : __t) +
'" class="form-control" placeholder="Filter">\r\n </div>\r\n <div class="form-row btn-toolbar">\r\n <button ref="filterButton" type="button" class="btn btn-primary">' +
((__t = (ctx.t('filter'))) == null ? '' : __t) +
'</button>\r\n <button ref="clearBtn" type="button" class="btn btn-secondary">' +
((__t = (ctx.t('clear'))) == null ? '' : __t) +
'</button>\r\n </div>\r\n </form>\r\n </ul>\r\n </li>\r\n ';
} ;
__p += '\r\n </ul>\r\n</div>\r\n';
return __p
}