From f7307c38aaf82d8642f0e6c9c0fd4021b9c64946 Mon Sep 17 00:00:00 2001 From: Yaroslav Ovdii Date: Fri, 24 Jul 2020 12:04:54 +0300 Subject: [PATCH 1/2] added readonly feature --- js/build.templates.js | 26 +++--- js/interface.templates.js | 22 ++--- js/libs/core.js | 4 + templates/components/checkbox.build.hbs | 38 ++++++--- templates/components/date.build.hbs | 81 +++++++++++++------ templates/components/email.build.hbs | 16 +++- templates/components/input.build.hbs | 15 +++- templates/components/number.build.hbs | 17 +++- templates/components/radio.build.hbs | 30 +++++-- templates/components/select.build.hbs | 17 ++++ templates/components/starRating.build.hbs | 18 ++++- templates/components/telephone.build.hbs | 16 +++- templates/components/textarea.build.hbs | 16 +++- templates/components/time.build.hbs | 42 +++++++--- templates/components/url.build.hbs | 16 +++- .../configurations/checkbox.interface.hbs | 8 ++ templates/configurations/date.interface.hbs | 9 ++- templates/configurations/email.interface.hbs | 9 ++- templates/configurations/input.interface.hbs | 8 ++ templates/configurations/number.interface.hbs | 8 ++ templates/configurations/radio.build.hbs | 8 ++ templates/configurations/select.interface.hbs | 8 ++ .../configurations/starRating.interface.hbs | 8 ++ .../configurations/telephone.interface.hbs | 8 ++ .../configurations/textarea.interface.hbs | 8 ++ templates/configurations/time.interface.hbs | 8 ++ templates/configurations/url.interface.hbs | 8 ++ 27 files changed, 381 insertions(+), 91 deletions(-) diff --git a/js/build.templates.js b/js/build.templates.js index ae6d60c0..1c33c0a1 100644 --- a/js/build.templates.js +++ b/js/build.templates.js @@ -7,15 +7,15 @@ this["Fliplet"]["Widget"]["Templates"]["templates.components.buttons"] = Handleb },"useData":true}); this["Fliplet"]["Widget"]["Templates"]["templates.components.checkbox"] = Handlebars.template({"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { - return "\n"; + return "\n"; },"useData":true}); this["Fliplet"]["Widget"]["Templates"]["templates.components.date"] = Handlebars.template({"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { - return "
{{ description }}
\n
\n
\n \n
\n\n \n
\n
\n
\n \n
\n\n \n
\n

Field is required.

\n"; + return "
{{ description }}
\n
\n \n\n \n
\n
\n\n \n\n \n
\n

Field is required.

\n"; },"useData":true}); this["Fliplet"]["Widget"]["Templates"]["templates.components.email"] = Handlebars.template({"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { - return "
{{ description }}
\n\n

The input is not a valid email address.

\n

Field is required.

\n"; + return "
{{ description }}
\n\n\n

The input is not a valid email address.

\n

Field is required.

\n"; },"useData":true}); this["Fliplet"]["Widget"]["Templates"]["templates.components.field"] = Handlebars.template({"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { @@ -39,7 +39,7 @@ this["Fliplet"]["Widget"]["Templates"]["templates.components.image"] = Handlebar },"useData":true}); this["Fliplet"]["Widget"]["Templates"]["templates.components.input"] = Handlebars.template({"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { - return "
{{ description }}
\n\n

Field is required.

\n"; + return "
{{ description }}
\n\n\n

Field is required.

\n"; },"useData":true}); this["Fliplet"]["Widget"]["Templates"]["templates.components.interface"] = Handlebars.template({"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { @@ -51,7 +51,7 @@ this["Fliplet"]["Widget"]["Templates"]["templates.components.interface"] = Handl },"useData":true}); this["Fliplet"]["Widget"]["Templates"]["templates.components.number"] = Handlebars.template({"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { - return "
{{ description }}
\n\n

This field only accept up to 15 digits.

\n

Field is required.

\n

Only positive digits are allowed.

\n

Only integer digits are allowed.

\n

Only digits or {{decimals}} digits after point are allowed.

\n"; + return "
{{ description }}
\n\n\n\n\n

This field only accept up to 15 digits.

\n

Field is required.

\n

Only positive digits are allowed.

\n

Only integer digits are allowed.

\n

Only digits or {{decimals}} digits after point are allowed.

\n"; },"useData":true}); this["Fliplet"]["Widget"]["Templates"]["templates.components.paragraph"] = Handlebars.template({"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { @@ -63,11 +63,11 @@ this["Fliplet"]["Widget"]["Templates"]["templates.components.password"] = Handle },"useData":true}); this["Fliplet"]["Widget"]["Templates"]["templates.components.radio"] = Handlebars.template({"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { - return "\n"; + return "\n"; },"useData":true}); this["Fliplet"]["Widget"]["Templates"]["templates.components.select"] = Handlebars.template({"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { - return "
{{ description }}
\n\n

Field is required.

\n"; + return "
{{ description }}
\n\n\n"; },"useData":true}); this["Fliplet"]["Widget"]["Templates"]["templates.components.signature"] = Handlebars.template({"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { @@ -75,19 +75,19 @@ this["Fliplet"]["Widget"]["Templates"]["templates.components.signature"] = Handl },"useData":true}); this["Fliplet"]["Widget"]["Templates"]["templates.components.starRating"] = Handlebars.template({"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { - return "
{{ description }}
\n
\n \n
\n

Field is required.

\n"; + return "
{{ description }}
\n
\n \n
\n
\n \n
\n

Field is required.

\n"; },"useData":true}); this["Fliplet"]["Widget"]["Templates"]["templates.components.telephone"] = Handlebars.template({"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { - return "
{{ description }}
\n\n

Field is required.

\n

Phone could contain ; , . ( ) - + SPACE * # and numbers.

\n"; + return "
{{ description }}
\n
\n

{{ value }}

\n \n
\n\n\n

Field is required.

\n

Phone could contain ; , . ( ) - + SPACE * # and numbers.

\n"; },"useData":true}); this["Fliplet"]["Widget"]["Templates"]["templates.components.textarea"] = Handlebars.template({"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { - return "
{{ description }}
\n\n

Field is required.

\n"; + return "
{{ description }}
\n\n\n\n

Field is required.

\n"; },"useData":true}); this["Fliplet"]["Widget"]["Templates"]["templates.components.time"] = Handlebars.template({"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { - return "
{{ description }}
\n
\n
\n \n
\n\n \n
\n

Field is required.

\n"; + return "
{{ description }}
\n
\n \n\n \n
\n

Field is required.

\n"; },"useData":true}); this["Fliplet"]["Widget"]["Templates"]["templates.components.title"] = Handlebars.template({"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { @@ -95,7 +95,7 @@ this["Fliplet"]["Widget"]["Templates"]["templates.components.title"] = Handlebar },"useData":true}); this["Fliplet"]["Widget"]["Templates"]["templates.components.url"] = Handlebars.template({"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { - return "
{{ description }}
\n\n

The input is not a valid URL.

\n

Field is required.

\n"; + return "
{{ description }}
\n\n\n\n

The input is not a valid URL.

\n

Field is required.

\n"; },"useData":true}); this["Fliplet"]["Widget"]["Templates"]["templates.components.wysiwyg"] = Handlebars.template({"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { @@ -103,5 +103,5 @@ this["Fliplet"]["Widget"]["Templates"]["templates.components.wysiwyg"] = Handleb },"useData":true}); this["Fliplet"]["Widget"]["Templates"]["templates.configurations.radio"] = Handlebars.template({"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { - return "
\n \n \n
\n
\n \n \n
\n"; + return "
\n \n \n
\n
\n \n \n
\n
\n
\n \n \n
\n
\n"; },"useData":true}); \ No newline at end of file diff --git a/js/interface.templates.js b/js/interface.templates.js index a278abef..a68b2a19 100644 --- a/js/interface.templates.js +++ b/js/interface.templates.js @@ -7,15 +7,15 @@ this["Fliplet"]["Widget"]["Templates"]["templates.configurations.buttons"] = Han },"useData":true}); this["Fliplet"]["Widget"]["Templates"]["templates.configurations.checkbox"] = Handlebars.template({"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { - return "
\n \n \n
\n
\n \n \n
\n
\n \n \n
\n
\n \n \n
\n"; + return "
\n \n \n
\n
\n \n \n
\n
\n \n \n
\n
\n \n \n
\n
\n
\n \n \n
\n
\n"; },"useData":true}); this["Fliplet"]["Widget"]["Templates"]["templates.configurations.time"] = Handlebars.template({"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { - return "
\n \n \n
\n
\n \n \n
\n
\n \n \n
\n"; + return "
\n \n \n
\n
\n \n \n
\n
\n \n \n
\n
\n
\n \n \n
\n
\n"; },"useData":true}); this["Fliplet"]["Widget"]["Templates"]["templates.configurations.title"] = Handlebars.template({"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { @@ -92,7 +92,7 @@ this["Fliplet"]["Widget"]["Templates"]["templates.configurations.title"] = Handl },"useData":true}); this["Fliplet"]["Widget"]["Templates"]["templates.configurations.url"] = Handlebars.template({"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { - return "
\n \n \n
\n
\n \n \n
\n
\n \n \n
\n"; + return "
\n \n \n
\n
\n \n \n
\n
\n \n \n
\n
\n
\n \n \n
\n
\n"; },"useData":true}); this["Fliplet"]["Widget"]["Templates"]["templates.configurations.wysiwyg"] = Handlebars.template({"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { diff --git a/js/libs/core.js b/js/libs/core.js index 5674b7cf..d2b85127 100644 --- a/js/libs/core.js +++ b/js/libs/core.js @@ -161,6 +161,10 @@ Fliplet.FormBuilder = (function() { canHide: { type: Boolean, default: true + }, + readonly: { + type: Boolean, + default: false } }, component.props); diff --git a/templates/components/checkbox.build.hbs b/templates/components/checkbox.build.hbs index 87297d95..c46fc231 100644 --- a/templates/components/checkbox.build.hbs +++ b/templates/components/checkbox.build.hbs @@ -1,18 +1,32 @@ +\{{ description }} - +

\{{ value }}

+ + + +
\{{ description }}
- diff --git a/templates/components/select.build.hbs b/templates/components/select.build.hbs index f3d289d4..a8701991 100644 --- a/templates/components/select.build.hbs +++ b/templates/components/select.build.hbs @@ -1,4 +1,20 @@
\{{ description }}
+ + diff --git a/templates/components/starRating.build.hbs b/templates/components/starRating.build.hbs index 70bd0cc7..8b8838b2 100644 --- a/templates/components/starRating.build.hbs +++ b/templates/components/starRating.build.hbs @@ -1,5 +1,21 @@
\{{ description }}
-
+
+ +
+