Skip to content

Commit 518a93a

Browse files
Adding a default value to description on components
1 parent 5e1a57c commit 518a93a

File tree

25 files changed

+416
-377
lines changed

25 files changed

+416
-377
lines changed

dist/met-formio-components.js

+309-298
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/met-formio-components.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/met-formio-components.use.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/components/CategoryCheckboxes/Component.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
2828
function verb(n) { return function (v) { return step([n, v]); }; }
2929
function step(op) {
3030
if (f) throw new TypeError("Generator is already executing.");
31-
while (_) try {
31+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
3232
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
3333
if (y = 0, t) op = [op[0] & 2, t.value];
3434
switch (op[0]) {

lib/components/SimpleCheckboxes/Component.js

+2
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ import editForm from "./Component.form";
2929
import { Constants } from "../Common/Constants";
3030
var ID = "simplecheckboxes";
3131
var DISPLAY = "Checkbox";
32+
var DEFAULT_DESCRIPTION = "Check all that apply.";
3233
var Component = /** @class */ (function (_super) {
3334
__extends(Component, _super);
3435
function Component() {
@@ -43,6 +44,7 @@ var Component = /** @class */ (function (_super) {
4344
type: ID,
4445
label: DISPLAY,
4546
key: ID,
47+
description: DEFAULT_DESCRIPTION,
4648
inline: false,
4749
values: [{ label: "", value: "" }],
4850
fieldSet: false,

lib/components/SimplePostalCode/Component.js

+2
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ import editForm from "./Component.form";
2929
import { Constants } from "../Common/Constants";
3030
var ID = "simplepostalcode";
3131
var DISPLAY = "Postal Code";
32+
var DEFAULT_DESCRIPTION = "Please input the first three characters of your postal code in the format like V9E.";
3233
var Component = /** @class */ (function (_super) {
3334
__extends(Component, _super);
3435
function Component() {
@@ -43,6 +44,7 @@ var Component = /** @class */ (function (_super) {
4344
type: ID,
4445
label: DISPLAY,
4546
key: ID,
47+
description: DEFAULT_DESCRIPTION,
4648
inputType: "postalcode",
4749
inputFormat: "plain",
4850
inputMask: "***",

lib/components/SimpleRadios/Component.js

+2
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ import editForm from "./Component.form";
2929
import { Constants } from "../Common/Constants";
3030
var ID = "simpleradios";
3131
var DISPLAY = "Radio Button";
32+
var DEFAULT_DESCRIPTION = "Choose one of the answers above.";
3233
var Component = /** @class */ (function (_super) {
3334
__extends(Component, _super);
3435
function Component() {
@@ -43,6 +44,7 @@ var Component = /** @class */ (function (_super) {
4344
type: ID,
4445
label: DISPLAY,
4546
key: ID,
47+
description: DEFAULT_DESCRIPTION,
4648
inline: false,
4749
values: [{ label: "", value: "" }],
4850
fieldSet: false,

lib/components/SimpleSelect/Component.js

+2
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ import editForm from "./Component.form";
2929
import { Constants } from "../Common/Constants";
3030
var ID = "simpleselect";
3131
var DISPLAY = "Drop-down";
32+
var DEFAULT_DESCRIPTION = "Choose one of the answers above.";
3233
var Component = /** @class */ (function (_super) {
3334
__extends(Component, _super);
3435
function Component() {
@@ -43,6 +44,7 @@ var Component = /** @class */ (function (_super) {
4344
type: ID,
4445
label: DISPLAY,
4546
key: ID,
47+
description: DEFAULT_DESCRIPTION,
4648
dataSrc: "values",
4749
dataType: "auto",
4850
widget: "choicesjs",

lib/components/SimpleSurvey/Component.js

+2
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ import editForm from "./Component.form";
2929
import { Constants } from "../Common/Constants";
3030
var ID = "simplesurvey";
3131
var DISPLAY = "Likert";
32+
var DEFAULT_DESCRIPTION = "Please select the option that best applies.";
3233
var Component = /** @class */ (function (_super) {
3334
__extends(Component, _super);
3435
function Component() {
@@ -43,6 +44,7 @@ var Component = /** @class */ (function (_super) {
4344
type: ID,
4445
label: DISPLAY,
4546
key: ID,
47+
description: DEFAULT_DESCRIPTION,
4648
}], extend, false));
4749
};
4850
Object.defineProperty(Component, "builderInfo", {

lib/components/SimpleTextArea/Component.js

+2
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ import editForm from "./Component.form";
2929
import { Constants } from "../Common/Constants";
3030
var ID = "simpletextarea";
3131
var DISPLAY = "Multiple Lines Answer";
32+
var DEFAULT_DESCRIPTION = "Please do not include any personally identifiable information about yourself or others in your responses.";
3233
var Component = /** @class */ (function (_super) {
3334
__extends(Component, _super);
3435
function Component() {
@@ -43,6 +44,7 @@ var Component = /** @class */ (function (_super) {
4344
type: ID,
4445
label: DISPLAY,
4546
key: ID,
47+
description: DEFAULT_DESCRIPTION,
4648
rows: 3,
4749
wysiwyg: false,
4850
editor: "",

lib/components/SimpleTextField/Component.js

+2
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ import editForm from './Component.form';
3131
import { Constants } from '../Common/Constants';
3232
var ID = 'simpletextfield';
3333
var DISPLAY = 'Single Line Answer';
34+
var DEFAULT_DESCRIPTION = "Please do not include any personally identifiable information about yourself or others in your responses.";
3435
var Component = /** @class */ (function (_super) {
3536
__extends(Component, _super);
3637
function Component() {
@@ -45,6 +46,7 @@ var Component = /** @class */ (function (_super) {
4546
type: ID,
4647
label: DISPLAY,
4748
key: ID,
49+
description: DEFAULT_DESCRIPTION,
4850
mask: false,
4951
inputType: 'text',
5052
inputFormat: 'plain',

lib/templates/bootstrap/categorycomponent/form.ejs.js

+22-22
Original file line numberDiff line numberDiff line change
@@ -4,58 +4,58 @@ Object.defineProperty(exports, "__esModule", {
44
exports.default=function(ctx) {
55
var __t, __p = '', __j = Array.prototype.join;
66
function print() { __p += __j.call(arguments, '') }
7-
__p += '<div\r\n class="form-radio radio"\r\n ref="radioGroup"\r\n role="group"\r\n aria-required="' +
7+
__p += '<div\n class="form-radio radio"\n ref="radioGroup"\n role="group"\n aria-required="' +
88
((__t = (ctx.input.component.validate.required)) == null ? '' : __t) +
9-
'"\r\n aria-labelledby="l-' +
9+
'"\n aria-labelledby="l-' +
1010
((__t = (ctx.instance.id)) == null ? '' : __t) +
1111
'-' +
1212
((__t = (ctx.component.key)) == null ? '' : __t) +
13-
'"\r\n ';
13+
'"\n ';
1414
if (ctx.component.description) { ;
15-
__p += '\r\n aria-describedby="d-' +
15+
__p += '\n aria-describedby="d-' +
1616
((__t = (ctx.instance.id)) == null ? '' : __t) +
1717
'-' +
1818
((__t = (ctx.component.key)) == null ? '' : __t) +
19-
'"\r\n ';
19+
'"\n ';
2020
} ;
21-
__p += '\r\n>\r\n <div class="container p-0 m-1">\r\n <div class="row">\r\n ';
21+
__p += '\n>\n <div class="container p-0 m-1">\n <div class="row">\n ';
2222
ctx.values.forEach(function(item) { ;
23-
__p += '\r\n ';
23+
__p += '\n ';
2424
var isChecked = ctx.value && (ctx.value === item.value || (typeof ctx.value === 'object' && ctx.value.hasOwnProperty(item.value) && ctx.value[item.value])) ;
25-
__p += '\r\n <div class="col-12 col-md-6 col-lg-6 col-xl-4 mb-4">\r\n <div class="container vcbox ' +
25+
__p += '\n <div class="col-12 col-md-6 col-lg-6 col-xl-4 mb-4">\n <div class="container vcbox ' +
2626
((__t = ( isChecked ? `vcbox-checked-${item.category}` : '' )) == null ? '' : __t) +
27-
' p-1">\r\n <div class="row align-items-center justify-content-start">\r\n <div class="col-8">\r\n <div class="container">\r\n <div class="row align-items-center justify-content-start">\r\n <span class="fa-stack icon-stack">\r\n <i class="fas fa-circle fa-stack-2x circle-icon-' +
27+
' p-1">\n <div class="row align-items-center justify-content-start">\n <div class="col-8">\n <div class="container">\n <div class="row align-items-center justify-content-start">\n <span class="fa-stack icon-stack">\n <i class="fas fa-circle fa-stack-2x circle-icon-' +
2828
((__t = (item.category)) == null ? '' : __t) +
29-
'"></i>\r\n ';
29+
'"></i>\n ';
3030
if (item.icon) { ;
31-
__p += '\r\n <i class="' +
31+
__p += '\n <i class="' +
3232
((__t = (item.icon)) == null ? '' : __t) +
33-
' fa-stack-1x"></i>\r\n ';
33+
' fa-stack-1x"></i>\n ';
3434
} ;
35-
__p += '\r\n </span>\r\n <span class="ml-1">' +
35+
__p += '\n </span>\n <span class="ml-1">' +
3636
((__t = (item.label)) == null ? '' : __t) +
37-
'</span>\r\n \r\n </div>\r\n </div>\r\n </div>\r\n <div class="col">\r\n <div class="container">\r\n <div class="row justify-content-end">\r\n <input\r\n type="checkbox"\r\n ref="input"\r\n value="' +
37+
'</span>\n \n </div>\n </div>\n </div>\n <div class="col">\n <div class="container">\n <div class="row justify-content-end">\n <input\n type="checkbox"\n ref="input"\n value="' +
3838
((__t = (item.value)) == null ? '' : __t) +
39-
'"\r\n ';
39+
'"\n ';
4040
if (isChecked) { ;
41-
__p += '\r\n checked=true\r\n ';
41+
__p += '\n checked=true\n ';
4242
} ;
43-
__p += '\r\n ';
43+
__p += '\n ';
4444
if (item.disabled) { ;
45-
__p += '\r\n disabled=true\r\n ';
45+
__p += '\n disabled=true\n ';
4646
} ;
47-
__p += '\r\n id="' +
47+
__p += '\n id="' +
4848
((__t = (ctx.instance.root && ctx.instance.root.id)) == null ? '' : __t) +
4949
'-' +
5050
((__t = (ctx.id)) == null ? '' : __t) +
5151
'-' +
5252
((__t = (ctx.row)) == null ? '' : __t) +
5353
'-' +
5454
((__t = (item.value)) == null ? '' : __t) +
55-
'"\r\n role="checkbox"\r\n class="cc-checked"\r\n name="' +
55+
'"\n role="checkbox"\n class="cc-checked"\n name="' +
5656
((__t = (ctx.component.key)) == null ? '' : __t) +
57-
'"\r\n >\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n ';
57+
'"\n >\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n ';
5858
}) ;
59-
__p += '\r\n </div>\r\n </div>\r\n</div>\r\n';
59+
__p += '\n </div>\n </div>\n</div>\n';
6060
return __p
6161
}

lib/templates/bootstrap/categorycomponent/html.ejs.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ Object.defineProperty(exports, "__esModule", {
44
exports.default=function(ctx) {
55
var __t, __p = '', __j = Array.prototype.join;
66
function print() { __p += __j.call(arguments, '') }
7-
__p += '<div ref="value">\r\n ';
7+
__p += '<div ref="value">\n ';
88
var filtered = ctx.values.filter(function(item) {return ctx.value === item.value || (typeof ctx.value === 'object' && ctx.value.hasOwnProperty(item.value) && ctx.value[item.value])}).map(function(item) { return ctx.t(item.label, { _userInput: true })}).join(', ') ;
9-
__p += '\r\n ' +
9+
__p += '\n ' +
1010
((__t = ( filtered )) == null ? '' : __t) +
11-
'\r\n </div>\r\n';
11+
'\n </div>\n';
1212
return __p
1313
}

lib/templates/bootstrap/categorytextarea/form.ejs.js

+41-41
Original file line numberDiff line numberDiff line change
@@ -6,51 +6,51 @@ var __t, __p = '', __j = Array.prototype.join;
66
function print() { __p += __j.call(arguments, '') }
77

88
if (ctx.prefix || ctx.suffix) { ;
9-
__p += '\r\n<div class="input-group">\r\n ';
9+
__p += '\n<div class="input-group">\n ';
1010
} ;
11-
__p += '\r\n ';
11+
__p += '\n ';
1212
if (ctx.prefix) { ;
13-
__p += '\r\n <div class="input-group-prepend" ref="prefix">\r\n <span class="input-group-text">\r\n ';
13+
__p += '\n <div class="input-group-prepend" ref="prefix">\n <span class="input-group-text">\n ';
1414
if(ctx.prefix instanceof HTMLElement){ ;
15-
__p += '\r\n ' +
15+
__p += '\n ' +
1616
((__t = ( ctx.t(ctx.prefix.outerHTML, { _userInput: true }) )) == null ? '' : __t) +
17-
'\r\n ';
17+
'\n ';
1818
} else{ ;
19-
__p += '\r\n ' +
19+
__p += '\n ' +
2020
((__t = ( ctx.t(ctx.prefix, { _userInput: true }) )) == null ? '' : __t) +
21-
'\r\n ';
21+
'\n ';
2222
} ;
23-
__p += '\r\n </span>\r\n </div>\r\n ';
23+
__p += '\n </span>\n </div>\n ';
2424
} ;
25-
__p += '\r\n\r\n \r\n <div class="container p-0 mb-1">\r\n <div class="row">\r\n ';
25+
__p += '\n\n \n <div class="container p-0 mb-1">\n <div class="row">\n ';
2626
ctx.categoryComponents.forEach(function(item) { ;
27-
__p += '\r\n <div class="col-12 col-md-6 col-lg-4 col-xl-3 mb-1">\r\n <div class="vcbox vcbox-checked-' +
27+
__p += '\n <div class="col-12 col-md-6 col-lg-4 col-xl-3 mb-1">\n <div class="vcbox vcbox-checked-' +
2828
((__t = (item.category)) == null ? '' : __t) +
29-
' p-1">\r\n <div class="container">\r\n <div class="row align-items-center justify-content-start">\r\n <span class="fa-stack icon-stack">\r\n <i class="fas fa-circle fa-stack-2x circle-icon-' +
29+
' p-1">\n <div class="container">\n <div class="row align-items-center justify-content-start">\n <span class="fa-stack icon-stack">\n <i class="fas fa-circle fa-stack-2x circle-icon-' +
3030
((__t = (item.category)) == null ? '' : __t) +
31-
'"></i>\r\n <i class="' +
31+
'"></i>\n <i class="' +
3232
((__t = (item.icon)) == null ? '' : __t) +
33-
' fa-stack-1x"></i>\r\n </span>\r\n <span class="ml-1">' +
33+
' fa-stack-1x"></i>\n </span>\n <span class="ml-1">' +
3434
((__t = (item.label)) == null ? '' : __t) +
35-
'</span>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n ';
35+
'</span>\n </div>\n </div>\n </div>\n </div>\n ';
3636
}) ;
37-
__p += '\r\n </div>\r\n </div>\r\n\r\n <' +
37+
__p += '\n </div>\n </div>\n\n <' +
3838
((__t = (ctx.input.type)) == null ? '' : __t) +
39-
'\r\n ref="' +
39+
'\n ref="' +
4040
((__t = (ctx.input.ref ? ctx.input.ref : 'input')) == null ? '' : __t) +
41-
'"\r\n ';
41+
'"\n ';
4242
for (var attr in ctx.input.attr) { ;
43-
__p += '\r\n ' +
43+
__p += '\n ' +
4444
((__t = (attr)) == null ? '' : __t) +
4545
'="' +
4646
((__t = (ctx.input.attr[attr])) == null ? '' : __t) +
47-
'"\r\n ';
47+
'"\n ';
4848
} ;
49-
__p += '\r\n id="' +
49+
__p += '\n id="' +
5050
((__t = (ctx.instance.id)) == null ? '' : __t) +
5151
'-' +
5252
((__t = (ctx.component.key)) == null ? '' : __t) +
53-
'"\r\n aria-labelledby="l-' +
53+
'"\n aria-labelledby="l-' +
5454
((__t = (ctx.instance.id)) == null ? '' : __t) +
5555
'-' +
5656
((__t = (ctx.component.key)) == null ? '' : __t) +
@@ -61,48 +61,48 @@ __p += 'd-' +
6161
'-' +
6262
((__t = (ctx.component.key)) == null ? '' : __t);
6363
} ;
64-
__p += '"\r\n aria-required="' +
64+
__p += '"\n aria-required="' +
6565
((__t = (ctx.input.ref === 'input' || !ctx.input.ref ? ctx.component.validate.required :
6666
ctx.component.fields && ctx.component.fields[ctx.input.ref] && ctx.component.fields[ctx.input.ref].required || false)) == null ? '' : __t) +
67-
'"\r\n >' +
67+
'"\n >' +
6868
((__t = (ctx.input.content)) == null ? '' : __t) +
6969
'</' +
7070
((__t = (ctx.input.type)) == null ? '' : __t) +
71-
'>\r\n ';
71+
'>\n ';
7272
if (ctx.hasValueMaskInput) { ;
73-
__p += '\r\n <input ref="valueMaskInput" />\r\n ';
73+
__p += '\n <input ref="valueMaskInput" />\n ';
7474
} ;
75-
__p += '\r\n\r\n';
75+
__p += '\n\n';
7676
if (ctx.suffix) { ;
77-
__p += '\r\n <div class="input-group-append" ref="suffix">\r\n <span class="input-group-text">\r\n ';
77+
__p += '\n <div class="input-group-append" ref="suffix">\n <span class="input-group-text">\n ';
7878
if(ctx.suffix instanceof HTMLElement){ ;
79-
__p += '\r\n ' +
79+
__p += '\n ' +
8080
((__t = ( ctx.t(ctx.suffix.outerHTML, { _userInput: true }) )) == null ? '' : __t) +
81-
'\r\n ';
81+
'\n ';
8282
} else{ ;
83-
__p += '\r\n ' +
83+
__p += '\n ' +
8484
((__t = ( ctx.t(ctx.suffix, { _userInput: true }) )) == null ? '' : __t) +
85-
'\r\n ';
85+
'\n ';
8686
} ;
87-
__p += '\r\n </span>\r\n </div>\r\n';
87+
__p += '\n </span>\n </div>\n';
8888
} ;
89-
__p += '\r\n';
89+
__p += '\n';
9090
if (ctx.prefix || ctx.suffix) { ;
91-
__p += '\r\n </div>\r\n';
91+
__p += '\n </div>\n';
9292
} ;
93-
__p += '\r\n';
93+
__p += '\n';
9494
if (ctx.component.showCharCount || ctx.component.showWordCount) { ;
95-
__p += '\r\n<div class="form-text ' +
95+
__p += '\n<div class="form-text ' +
9696
((__t = (ctx.component.description ? 'pull-right' : 'text-right')) == null ? '' : __t) +
97-
'">\r\n ';
97+
'">\n ';
9898
if (ctx.component.showCharCount) { ;
99-
__p += '\r\n <span class="text-muted" ref="charcount" aria-live="polite"></span>\r\n ';
99+
__p += '\n <span class="text-muted" ref="charcount" aria-live="polite"></span>\n ';
100100
} ;
101-
__p += '\r\n ';
101+
__p += '\n ';
102102
if (ctx.component.showWordCount) { ;
103-
__p += '\r\n <span class="text-muted" ref="wordcount" aria-live="polite"></span>\r\n ';
103+
__p += '\n <span class="text-muted" ref="wordcount" aria-live="polite"></span>\n ';
104104
} ;
105-
__p += '\r\n</div>\r\n';
105+
__p += '\n</div>\n';
106106
} ;
107107

108108
return __p

lib/templates/bootstrap/categorytextarea/html.ejs.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ __p +=
1111
} else { ;
1212
__p += '-';
1313
} ;
14-
__p += '</div>\r\n';
14+
__p += '</div>\n';
1515
return __p
1616
}

lib/templates/bootstrap/checkmatrix/form.ejs.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,16 @@ var __t, __p = '', __j = Array.prototype.join;
66
function print() { __p += __j.call(arguments, '') }
77
__p += '<table class="' +
88
((__t = ( ctx.tableClass )) == null ? '' : __t) +
9-
'">\r\n <tbody>\r\n ';
9+
'">\n <tbody>\n ';
1010
for (let i = 0; i < ctx.component.numRows; i++) { ;
11-
__p += '\r\n <tr>\r\n ';
11+
__p += '\n <tr>\n ';
1212
for (let j = 0; j < ctx.component.numCols; j++) { ;
13-
__p += '\r\n <td>' +
13+
__p += '\n <td>' +
1414
((__t = ( ctx.renderCell(i, j) )) == null ? '' : __t) +
15-
'</td>\r\n ';
15+
'</td>\n ';
1616
} ;
17-
__p += '\r\n </tr>\r\n ';
17+
__p += '\n </tr>\n ';
1818
} ;
19-
__p += '\r\n </tbody>\r\n</table>\r\n';
19+
__p += '\n </tbody>\n</table>\n';
2020
return __p
2121
}

0 commit comments

Comments
 (0)