@gov-cy/govcy-frontend-renderer 1.4.0 → 1.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -794,8 +794,19 @@ frame = frame.pop();
|
|
|
794
794
|
return new runtime.SafeString(t_57);
|
|
795
795
|
});
|
|
796
796
|
return macro_t_56;})()})])), env.opts.autoescape);
|
|
797
|
+
env.getTemplate("utilities/govcyUtilities.njk", false, "elements/checkboxes.njk", false, function(t_59,t_58) {
|
|
798
|
+
if(t_59) { cb(t_59); return; }
|
|
799
|
+
t_58.getExported(function(t_60,t_58) {
|
|
800
|
+
if(t_60) { cb(t_60); return; }
|
|
801
|
+
if(Object.prototype.hasOwnProperty.call(t_58, "govcyElementsFromArray")) {
|
|
802
|
+
var t_61 = t_58.govcyElementsFromArray;
|
|
803
|
+
} else {
|
|
804
|
+
cb(new Error("cannot import 'govcyElementsFromArray'")); return;
|
|
805
|
+
}
|
|
806
|
+
frame.set("govcyElementsFromArray", t_61);
|
|
807
|
+
t_55 += runtime.suppressValue((lineno = 132, colno = 33, runtime.callWrap(t_61, "govcyElementsFromArray", context, [runtime.memberLookup((l_params),"elements"),runtime.memberLookup((l_params),"lang")])), env.opts.autoescape);
|
|
797
808
|
t_55 += "\n ";
|
|
798
|
-
t_55 += runtime.suppressValue((lineno =
|
|
809
|
+
t_55 += runtime.suppressValue((lineno = 133, colno = 27, runtime.callWrap(t_47, "formControl", context, [{"isError": (runtime.memberLookup((l_params),"hideFormControlError")?false:runtime.memberLookup((l_params),"error"))},runtime.makeKeywordArgs({"caller": (function (){var macro_t_62 = runtime.makeMacro(
|
|
799
810
|
[],
|
|
800
811
|
[],
|
|
801
812
|
function (kwargs) {
|
|
@@ -804,8 +815,8 @@ frame = frame.push(true);
|
|
|
804
815
|
kwargs = kwargs || {};
|
|
805
816
|
if (Object.prototype.hasOwnProperty.call(kwargs, "caller")) {
|
|
806
817
|
frame.set("caller", kwargs.caller); }
|
|
807
|
-
var
|
|
808
|
-
|
|
818
|
+
var t_63 = "";t_63 += "\n ";
|
|
819
|
+
t_63 += runtime.suppressValue((lineno = 134, colno = 24, runtime.callWrap(t_35, "hint", context, [{"hint": runtime.memberLookup((l_params),"hint"),"id": runtime.contextOrFrameLookup(context, frame, "hintId"),"lang": runtime.memberLookup((l_params),"lang")},runtime.makeKeywordArgs({"caller": (function (){var macro_t_64 = runtime.makeMacro(
|
|
809
820
|
[],
|
|
810
821
|
[],
|
|
811
822
|
function (kwargs) {
|
|
@@ -814,12 +825,12 @@ frame = frame.push(true);
|
|
|
814
825
|
kwargs = kwargs || {};
|
|
815
826
|
if (Object.prototype.hasOwnProperty.call(kwargs, "caller")) {
|
|
816
827
|
frame.set("caller", kwargs.caller); }
|
|
817
|
-
var
|
|
828
|
+
var t_65 = "";;
|
|
818
829
|
frame = frame.pop();
|
|
819
|
-
return new runtime.SafeString(
|
|
830
|
+
return new runtime.SafeString(t_65);
|
|
820
831
|
});
|
|
821
|
-
return
|
|
822
|
-
|
|
832
|
+
return macro_t_64;})()})])), env.opts.autoescape);
|
|
833
|
+
t_63 += runtime.suppressValue((lineno = 136, colno = 32, runtime.callWrap(t_43, "errorMessage", context, [{"message": runtime.memberLookup((l_params),"error"),"id": runtime.contextOrFrameLookup(context, frame, "errorId"),"lang": runtime.memberLookup((l_params),"lang")},runtime.makeKeywordArgs({"caller": (function (){var macro_t_66 = runtime.makeMacro(
|
|
823
834
|
[],
|
|
824
835
|
[],
|
|
825
836
|
function (kwargs) {
|
|
@@ -828,28 +839,28 @@ frame = frame.push(true);
|
|
|
828
839
|
kwargs = kwargs || {};
|
|
829
840
|
if (Object.prototype.hasOwnProperty.call(kwargs, "caller")) {
|
|
830
841
|
frame.set("caller", kwargs.caller); }
|
|
831
|
-
var
|
|
842
|
+
var t_67 = "";;
|
|
832
843
|
frame = frame.pop();
|
|
833
|
-
return new runtime.SafeString(
|
|
844
|
+
return new runtime.SafeString(t_67);
|
|
834
845
|
});
|
|
835
|
-
return
|
|
836
|
-
|
|
846
|
+
return macro_t_66;})()})])), env.opts.autoescape);
|
|
847
|
+
t_63 += "\n ";
|
|
837
848
|
frame = frame.push();
|
|
838
|
-
var
|
|
839
|
-
if(
|
|
840
|
-
var
|
|
841
|
-
for(var
|
|
842
|
-
var
|
|
843
|
-
frame.set("item",
|
|
844
|
-
frame.set("loop.index",
|
|
845
|
-
frame.set("loop.index0",
|
|
846
|
-
frame.set("loop.revindex",
|
|
847
|
-
frame.set("loop.revindex0",
|
|
848
|
-
frame.set("loop.first",
|
|
849
|
-
frame.set("loop.last",
|
|
850
|
-
frame.set("loop.length",
|
|
851
|
-
if(
|
|
852
|
-
|
|
849
|
+
var t_70 = runtime.memberLookup((l_params),"items");
|
|
850
|
+
if(t_70) {t_70 = runtime.fromIterator(t_70);
|
|
851
|
+
var t_69 = t_70.length;
|
|
852
|
+
for(var t_68=0; t_68 < t_70.length; t_68++) {
|
|
853
|
+
var t_71 = t_70[t_68];
|
|
854
|
+
frame.set("item", t_71);
|
|
855
|
+
frame.set("loop.index", t_68 + 1);
|
|
856
|
+
frame.set("loop.index0", t_68);
|
|
857
|
+
frame.set("loop.revindex", t_69 - t_68);
|
|
858
|
+
frame.set("loop.revindex0", t_69 - t_68 - 1);
|
|
859
|
+
frame.set("loop.first", t_68 === 0);
|
|
860
|
+
frame.set("loop.last", t_68 === t_69 - 1);
|
|
861
|
+
frame.set("loop.length", t_69);
|
|
862
|
+
if(t_71) {
|
|
863
|
+
t_63 += runtime.suppressValue((lineno = 140, colno = 37, runtime.callWrap(runtime.contextOrFrameLookup(context, frame, "_checkboxItem"), "_checkboxItem", context, [l_params,t_71,runtime.memberLookup((runtime.contextOrFrameLookup(context, frame, "loop")),"index"),runtime.memberLookup((l_params),"lang")])), env.opts.autoescape);
|
|
853
864
|
;
|
|
854
865
|
}
|
|
855
866
|
;
|
|
@@ -858,11 +869,11 @@ t_59 += runtime.suppressValue((lineno = 136, colno = 37, runtime.callWrap(runtim
|
|
|
858
869
|
frame = frame.pop();
|
|
859
870
|
;
|
|
860
871
|
frame = frame.pop();
|
|
861
|
-
return new runtime.SafeString(
|
|
872
|
+
return new runtime.SafeString(t_63);
|
|
862
873
|
});
|
|
863
|
-
return
|
|
874
|
+
return macro_t_62;})()})])), env.opts.autoescape);
|
|
864
875
|
t_55 += "\n ";
|
|
865
|
-
;
|
|
876
|
+
})});
|
|
866
877
|
frame = frame.pop();
|
|
867
878
|
return new runtime.SafeString(t_55);
|
|
868
879
|
});
|
|
@@ -1203,7 +1214,7 @@ context.addExport("ariaDescribedBy", t_50);
|
|
|
1203
1214
|
}
|
|
1204
1215
|
;
|
|
1205
1216
|
}
|
|
1206
|
-
t_2 += runtime.suppressValue((lineno = 65, colno = 20, runtime.callWrap(t_13, "fieldset", context, [{"ariaDescribedby": runtime.contextOrFrameLookup(context, frame, "ariaDescribedBy"),"classes": runtime.memberLookup((l_params),"classes"),"lang": runtime.memberLookup((l_params),"lang")},runtime.makeKeywordArgs({"caller": (function (){var macro_t_51 = runtime.makeMacro(
|
|
1217
|
+
t_2 += runtime.suppressValue((lineno = 65, colno = 20, runtime.callWrap(t_13, "fieldset", context, [{"ariaDescribedby": runtime.contextOrFrameLookup(context, frame, "ariaDescribedBy"),"classes": runtime.memberLookup((l_params),"classes"),"ariaRole": "group","lang": runtime.memberLookup((l_params),"lang")},runtime.makeKeywordArgs({"caller": (function (){var macro_t_51 = runtime.makeMacro(
|
|
1207
1218
|
[],
|
|
1208
1219
|
[],
|
|
1209
1220
|
function (kwargs) {
|
|
@@ -1881,15 +1892,21 @@ t_2 += runtime.suppressValue(runtime.memberLookup((l_params),"classes"), env.opt
|
|
|
1881
1892
|
;
|
|
1882
1893
|
}
|
|
1883
1894
|
t_2 += "\"";
|
|
1895
|
+
if(runtime.memberLookup((l_params),"ariaRole")) {
|
|
1896
|
+
t_2 += " role=\"";
|
|
1897
|
+
t_2 += runtime.suppressValue(runtime.memberLookup((l_params),"ariaRole"), env.opts.autoescape);
|
|
1898
|
+
t_2 += "\"";
|
|
1899
|
+
;
|
|
1900
|
+
}
|
|
1884
1901
|
if(runtime.memberLookup((l_params),"ariaDescribedby")) {
|
|
1885
1902
|
t_2 += " aria-describedby=\"";
|
|
1886
1903
|
t_2 += runtime.suppressValue(runtime.memberLookup((l_params),"ariaDescribedby"), env.opts.autoescape);
|
|
1887
1904
|
t_2 += "\"";
|
|
1888
1905
|
;
|
|
1889
1906
|
}
|
|
1890
|
-
t_2 += runtime.suppressValue((lineno =
|
|
1907
|
+
t_2 += runtime.suppressValue((lineno = 16, colno = 312, runtime.callWrap(t_7, "govcyLangAttribute", context, [runtime.memberLookup((l_params),"lang")])), env.opts.autoescape);
|
|
1891
1908
|
t_2 += ">\n";
|
|
1892
|
-
t_2 += runtime.suppressValue((lineno =
|
|
1909
|
+
t_2 += runtime.suppressValue((lineno = 17, colno = 9, runtime.callWrap(runtime.contextOrFrameLookup(context, frame, "caller"), "caller", context, [])), env.opts.autoescape);
|
|
1893
1910
|
if(runtime.memberLookup((l_params),"elements")) {
|
|
1894
1911
|
env.getTemplate("govcyElement.njk", false, "elements/fieldset.njk", false, function(t_9,t_8) {
|
|
1895
1912
|
if(t_9) { cb(t_9); return; }
|
|
@@ -1915,7 +1932,7 @@ frame.set("loop.revindex0", t_13 - t_12 - 1);
|
|
|
1915
1932
|
frame.set("loop.first", t_12 === 0);
|
|
1916
1933
|
frame.set("loop.last", t_12 === t_13 - 1);
|
|
1917
1934
|
frame.set("loop.length", t_13);
|
|
1918
|
-
t_2 += runtime.suppressValue((lineno =
|
|
1935
|
+
t_2 += runtime.suppressValue((lineno = 23, colno = 33, runtime.callWrap(t_11, "govcyElement", context, [runtime.memberLookup((t_15),"element"),runtime.memberLookup((t_15),"params"),runtime.makeKeywordArgs({"caller": (function (){var macro_t_16 = runtime.makeMacro(
|
|
1919
1936
|
[],
|
|
1920
1937
|
[],
|
|
1921
1938
|
function (kwargs) {
|
|
@@ -3760,8 +3777,19 @@ frame = frame.pop();
|
|
|
3760
3777
|
return new runtime.SafeString(t_70);
|
|
3761
3778
|
});
|
|
3762
3779
|
return macro_t_69;})()})])), env.opts.autoescape);
|
|
3780
|
+
env.getTemplate("utilities/govcyUtilities.njk", false, "elements/radios.njk", false, function(t_72,t_71) {
|
|
3781
|
+
if(t_72) { cb(t_72); return; }
|
|
3782
|
+
t_71.getExported(function(t_73,t_71) {
|
|
3783
|
+
if(t_73) { cb(t_73); return; }
|
|
3784
|
+
if(Object.prototype.hasOwnProperty.call(t_71, "govcyElementsFromArray")) {
|
|
3785
|
+
var t_74 = t_71.govcyElementsFromArray;
|
|
3786
|
+
} else {
|
|
3787
|
+
cb(new Error("cannot import 'govcyElementsFromArray'")); return;
|
|
3788
|
+
}
|
|
3789
|
+
frame.set("govcyElementsFromArray", t_74);
|
|
3790
|
+
t_68 += runtime.suppressValue((lineno = 165, colno = 33, runtime.callWrap(t_74, "govcyElementsFromArray", context, [runtime.memberLookup((l_params),"elements"),runtime.memberLookup((l_params),"lang")])), env.opts.autoescape);
|
|
3763
3791
|
t_68 += "\n ";
|
|
3764
|
-
t_68 += runtime.suppressValue((lineno =
|
|
3792
|
+
t_68 += runtime.suppressValue((lineno = 166, colno = 27, runtime.callWrap(t_60, "formControl", context, [{"isError": (runtime.memberLookup((l_params),"hideFormControlError")?false:runtime.memberLookup((l_params),"error"))},runtime.makeKeywordArgs({"caller": (function (){var macro_t_75 = runtime.makeMacro(
|
|
3765
3793
|
[],
|
|
3766
3794
|
[],
|
|
3767
3795
|
function (kwargs) {
|
|
@@ -3770,8 +3798,7 @@ frame = frame.push(true);
|
|
|
3770
3798
|
kwargs = kwargs || {};
|
|
3771
3799
|
if (Object.prototype.hasOwnProperty.call(kwargs, "caller")) {
|
|
3772
3800
|
frame.set("caller", kwargs.caller); }
|
|
3773
|
-
var
|
|
3774
|
-
t_72 += runtime.suppressValue((lineno = 163, colno = 24, runtime.callWrap(t_48, "hint", context, [{"hint": runtime.memberLookup((l_params),"hint"),"id": runtime.contextOrFrameLookup(context, frame, "hintId"),"lang": runtime.memberLookup((l_params),"lang")},runtime.makeKeywordArgs({"caller": (function (){var macro_t_73 = runtime.makeMacro(
|
|
3801
|
+
var t_76 = "";t_76 += runtime.suppressValue((lineno = 168, colno = 24, runtime.callWrap(t_48, "hint", context, [{"hint": runtime.memberLookup((l_params),"hint"),"id": runtime.contextOrFrameLookup(context, frame, "hintId"),"lang": runtime.memberLookup((l_params),"lang")},runtime.makeKeywordArgs({"caller": (function (){var macro_t_77 = runtime.makeMacro(
|
|
3775
3802
|
[],
|
|
3776
3803
|
[],
|
|
3777
3804
|
function (kwargs) {
|
|
@@ -3780,12 +3807,12 @@ frame = frame.push(true);
|
|
|
3780
3807
|
kwargs = kwargs || {};
|
|
3781
3808
|
if (Object.prototype.hasOwnProperty.call(kwargs, "caller")) {
|
|
3782
3809
|
frame.set("caller", kwargs.caller); }
|
|
3783
|
-
var
|
|
3810
|
+
var t_78 = "";;
|
|
3784
3811
|
frame = frame.pop();
|
|
3785
|
-
return new runtime.SafeString(
|
|
3812
|
+
return new runtime.SafeString(t_78);
|
|
3786
3813
|
});
|
|
3787
|
-
return
|
|
3788
|
-
|
|
3814
|
+
return macro_t_77;})()})])), env.opts.autoescape);
|
|
3815
|
+
t_76 += runtime.suppressValue((lineno = 170, colno = 32, runtime.callWrap(t_56, "errorMessage", context, [{"message": runtime.memberLookup((l_params),"error"),"id": runtime.contextOrFrameLookup(context, frame, "errorId"),"lang": runtime.memberLookup((l_params),"lang")},runtime.makeKeywordArgs({"caller": (function (){var macro_t_79 = runtime.makeMacro(
|
|
3789
3816
|
[],
|
|
3790
3817
|
[],
|
|
3791
3818
|
function (kwargs) {
|
|
@@ -3794,28 +3821,28 @@ frame = frame.push(true);
|
|
|
3794
3821
|
kwargs = kwargs || {};
|
|
3795
3822
|
if (Object.prototype.hasOwnProperty.call(kwargs, "caller")) {
|
|
3796
3823
|
frame.set("caller", kwargs.caller); }
|
|
3797
|
-
var
|
|
3824
|
+
var t_80 = "";;
|
|
3798
3825
|
frame = frame.pop();
|
|
3799
|
-
return new runtime.SafeString(
|
|
3826
|
+
return new runtime.SafeString(t_80);
|
|
3800
3827
|
});
|
|
3801
|
-
return
|
|
3802
|
-
|
|
3828
|
+
return macro_t_79;})()})])), env.opts.autoescape);
|
|
3829
|
+
t_76 += "\n ";
|
|
3803
3830
|
frame = frame.push();
|
|
3804
|
-
var
|
|
3805
|
-
if(
|
|
3806
|
-
var
|
|
3807
|
-
for(var
|
|
3808
|
-
var
|
|
3809
|
-
frame.set("item",
|
|
3810
|
-
frame.set("loop.index",
|
|
3811
|
-
frame.set("loop.index0",
|
|
3812
|
-
frame.set("loop.revindex",
|
|
3813
|
-
frame.set("loop.revindex0",
|
|
3814
|
-
frame.set("loop.first",
|
|
3815
|
-
frame.set("loop.last",
|
|
3816
|
-
frame.set("loop.length",
|
|
3817
|
-
if(
|
|
3818
|
-
|
|
3831
|
+
var t_83 = runtime.memberLookup((l_params),"items");
|
|
3832
|
+
if(t_83) {t_83 = runtime.fromIterator(t_83);
|
|
3833
|
+
var t_82 = t_83.length;
|
|
3834
|
+
for(var t_81=0; t_81 < t_83.length; t_81++) {
|
|
3835
|
+
var t_84 = t_83[t_81];
|
|
3836
|
+
frame.set("item", t_84);
|
|
3837
|
+
frame.set("loop.index", t_81 + 1);
|
|
3838
|
+
frame.set("loop.index0", t_81);
|
|
3839
|
+
frame.set("loop.revindex", t_82 - t_81);
|
|
3840
|
+
frame.set("loop.revindex0", t_82 - t_81 - 1);
|
|
3841
|
+
frame.set("loop.first", t_81 === 0);
|
|
3842
|
+
frame.set("loop.last", t_81 === t_82 - 1);
|
|
3843
|
+
frame.set("loop.length", t_82);
|
|
3844
|
+
if(t_84) {
|
|
3845
|
+
t_76 += runtime.suppressValue((lineno = 174, colno = 34, runtime.callWrap(runtime.contextOrFrameLookup(context, frame, "_radioItem"), "_radioItem", context, [l_params,t_84,runtime.contextOrFrameLookup(context, frame, "isInline"),runtime.memberLookup((runtime.contextOrFrameLookup(context, frame, "loop")),"index"),runtime.memberLookup((l_params),"lang")])), env.opts.autoescape);
|
|
3819
3846
|
;
|
|
3820
3847
|
}
|
|
3821
3848
|
;
|
|
@@ -3824,11 +3851,11 @@ t_72 += runtime.suppressValue((lineno = 169, colno = 34, runtime.callWrap(runtim
|
|
|
3824
3851
|
frame = frame.pop();
|
|
3825
3852
|
;
|
|
3826
3853
|
frame = frame.pop();
|
|
3827
|
-
return new runtime.SafeString(
|
|
3854
|
+
return new runtime.SafeString(t_76);
|
|
3828
3855
|
});
|
|
3829
|
-
return
|
|
3856
|
+
return macro_t_75;})()})])), env.opts.autoescape);
|
|
3830
3857
|
t_68 += "\n ";
|
|
3831
|
-
;
|
|
3858
|
+
})});
|
|
3832
3859
|
frame = frame.pop();
|
|
3833
3860
|
return new runtime.SafeString(t_68);
|
|
3834
3861
|
});
|
|
@@ -4949,6 +4976,184 @@ root: root
|
|
|
4949
4976
|
})();
|
|
4950
4977
|
})();
|
|
4951
4978
|
|
|
4979
|
+
(function() {(window.nunjucksPrecompiled = window.nunjucksPrecompiled || {})["elements/taskList.njk"] = (function() {
|
|
4980
|
+
function root(env, context, frame, runtime, cb) {
|
|
4981
|
+
var lineno = 0;
|
|
4982
|
+
var colno = 0;
|
|
4983
|
+
var output = "";
|
|
4984
|
+
try {
|
|
4985
|
+
var parentTemplate = null;
|
|
4986
|
+
output += "\n";
|
|
4987
|
+
var macro_t_1 = runtime.makeMacro(
|
|
4988
|
+
["params"],
|
|
4989
|
+
[],
|
|
4990
|
+
function (l_params, kwargs) {
|
|
4991
|
+
var callerFrame = frame;
|
|
4992
|
+
frame = new runtime.Frame();
|
|
4993
|
+
kwargs = kwargs || {};
|
|
4994
|
+
if (Object.prototype.hasOwnProperty.call(kwargs, "caller")) {
|
|
4995
|
+
frame.set("caller", kwargs.caller); }
|
|
4996
|
+
frame.set("params", l_params);
|
|
4997
|
+
var t_2 = "";if(runtime.memberLookup((l_params),"items")) {
|
|
4998
|
+
env.getTemplate("utilities/govcyUtilities.njk", false, "elements/taskList.njk", false, function(t_4,t_3) {
|
|
4999
|
+
if(t_4) { cb(t_4); return; }
|
|
5000
|
+
t_3.getExported(function(t_5,t_3) {
|
|
5001
|
+
if(t_5) { cb(t_5); return; }
|
|
5002
|
+
if(Object.prototype.hasOwnProperty.call(t_3, "govcyLocalizeContent")) {
|
|
5003
|
+
var t_6 = t_3.govcyLocalizeContent;
|
|
5004
|
+
} else {
|
|
5005
|
+
cb(new Error("cannot import 'govcyLocalizeContent'")); return;
|
|
5006
|
+
}
|
|
5007
|
+
context.setVariable("govcyLocalizeContent", t_6);
|
|
5008
|
+
if(Object.prototype.hasOwnProperty.call(t_3, "govcyLangAttribute")) {
|
|
5009
|
+
var t_7 = t_3.govcyLangAttribute;
|
|
5010
|
+
} else {
|
|
5011
|
+
cb(new Error("cannot import 'govcyLangAttribute'")); return;
|
|
5012
|
+
}
|
|
5013
|
+
context.setVariable("govcyLangAttribute", t_7);
|
|
5014
|
+
if(runtime.memberLookup((l_params),"visuallyHiddenStatus")) {
|
|
5015
|
+
var t_8;
|
|
5016
|
+
t_8 = (function() {
|
|
5017
|
+
var output = "";
|
|
5018
|
+
output += runtime.suppressValue((lineno = 39, colno = 65, runtime.callWrap(t_6, "govcyLocalizeContent", context, [runtime.memberLookup((l_params),"visuallyHiddenStatus"),runtime.memberLookup((l_params),"lang")])), env.opts.autoescape);
|
|
5019
|
+
;
|
|
5020
|
+
return output;
|
|
5021
|
+
})()
|
|
5022
|
+
;
|
|
5023
|
+
frame.set("visuallyHiddenStatus", t_8, true);
|
|
5024
|
+
if(frame.topLevel) {
|
|
5025
|
+
context.setVariable("visuallyHiddenStatus", t_8);
|
|
5026
|
+
}
|
|
5027
|
+
if(frame.topLevel) {
|
|
5028
|
+
context.addExport("visuallyHiddenStatus", t_8);
|
|
5029
|
+
}
|
|
5030
|
+
;
|
|
5031
|
+
}
|
|
5032
|
+
else {
|
|
5033
|
+
var t_9;
|
|
5034
|
+
t_9 = (function() {
|
|
5035
|
+
var output = "";
|
|
5036
|
+
output += runtime.suppressValue((lineno = 41, colno = 65, runtime.callWrap(t_6, "govcyLocalizeContent", context, [{"en": "with status ","el": "με κατάσταση "},runtime.memberLookup((l_params),"lang")])), env.opts.autoescape);
|
|
5037
|
+
;
|
|
5038
|
+
return output;
|
|
5039
|
+
})()
|
|
5040
|
+
;
|
|
5041
|
+
frame.set("visuallyHiddenStatus", t_9, true);
|
|
5042
|
+
if(frame.topLevel) {
|
|
5043
|
+
context.setVariable("visuallyHiddenStatus", t_9);
|
|
5044
|
+
}
|
|
5045
|
+
if(frame.topLevel) {
|
|
5046
|
+
context.addExport("visuallyHiddenStatus", t_9);
|
|
5047
|
+
}
|
|
5048
|
+
;
|
|
5049
|
+
}
|
|
5050
|
+
t_2 += "\n <table class=\"govcy-table";
|
|
5051
|
+
if(runtime.memberLookup((l_params),"classes")) {
|
|
5052
|
+
t_2 += " ";
|
|
5053
|
+
t_2 += runtime.suppressValue(runtime.memberLookup((l_params),"classes"), env.opts.autoescape);
|
|
5054
|
+
;
|
|
5055
|
+
}
|
|
5056
|
+
t_2 += "\"";
|
|
5057
|
+
if(runtime.memberLookup((l_params),"id")) {
|
|
5058
|
+
t_2 += " id=\"";
|
|
5059
|
+
t_2 += runtime.suppressValue(runtime.memberLookup((l_params),"id"), env.opts.autoescape);
|
|
5060
|
+
t_2 += "\"";
|
|
5061
|
+
;
|
|
5062
|
+
}
|
|
5063
|
+
t_2 += runtime.suppressValue((lineno = 43, colno = 156, runtime.callWrap(t_7, "govcyLangAttribute", context, [runtime.memberLookup((l_params),"lang")])), env.opts.autoescape);
|
|
5064
|
+
t_2 += ">\n <tbody>";
|
|
5065
|
+
frame = frame.push();
|
|
5066
|
+
var t_12 = runtime.memberLookup((l_params),"items");
|
|
5067
|
+
if(t_12) {t_12 = runtime.fromIterator(t_12);
|
|
5068
|
+
var t_11 = t_12.length;
|
|
5069
|
+
for(var t_10=0; t_10 < t_12.length; t_10++) {
|
|
5070
|
+
var t_13 = t_12[t_10];
|
|
5071
|
+
frame.set("item", t_13);
|
|
5072
|
+
frame.set("loop.index", t_10 + 1);
|
|
5073
|
+
frame.set("loop.index0", t_10);
|
|
5074
|
+
frame.set("loop.revindex", t_11 - t_10);
|
|
5075
|
+
frame.set("loop.revindex0", t_11 - t_10 - 1);
|
|
5076
|
+
frame.set("loop.first", t_10 === 0);
|
|
5077
|
+
frame.set("loop.last", t_10 === t_11 - 1);
|
|
5078
|
+
frame.set("loop.length", t_11);
|
|
5079
|
+
if(t_13) {
|
|
5080
|
+
if(runtime.memberLookup((t_13),"task") && runtime.memberLookup((t_13),"status")) {
|
|
5081
|
+
t_2 += "\n <tr";
|
|
5082
|
+
if(runtime.memberLookup((l_params),"id")) {
|
|
5083
|
+
t_2 += " id=\"";
|
|
5084
|
+
t_2 += runtime.suppressValue(runtime.memberLookup((l_params),"id"), env.opts.autoescape);
|
|
5085
|
+
t_2 += "-row-";
|
|
5086
|
+
t_2 += runtime.suppressValue(runtime.memberLookup((runtime.contextOrFrameLookup(context, frame, "loop")),"index"), env.opts.autoescape);
|
|
5087
|
+
t_2 += "\"";
|
|
5088
|
+
;
|
|
5089
|
+
}
|
|
5090
|
+
t_2 += ">\n <td classes=\"govcy-valign-top\">\n ";
|
|
5091
|
+
if(runtime.memberLookup((runtime.memberLookup((t_13),"task")),"link")) {
|
|
5092
|
+
t_2 += "<a href=\"";
|
|
5093
|
+
t_2 += runtime.suppressValue(runtime.memberLookup((runtime.memberLookup((t_13),"task")),"link"), env.opts.autoescape);
|
|
5094
|
+
t_2 += "\">";
|
|
5095
|
+
;
|
|
5096
|
+
}
|
|
5097
|
+
t_2 += runtime.suppressValue((lineno = 50, colno = 119, runtime.callWrap(t_6, "govcyLocalizeContent", context, [runtime.memberLookup((runtime.memberLookup((t_13),"task")),"text"),runtime.memberLookup((l_params),"lang")])), env.opts.autoescape);
|
|
5098
|
+
t_2 += "<span class=\"govcy-visually-hidden\"> ";
|
|
5099
|
+
t_2 += runtime.suppressValue(runtime.contextOrFrameLookup(context, frame, "visuallyHiddenStatus"), env.opts.autoescape);
|
|
5100
|
+
t_2 += " ";
|
|
5101
|
+
t_2 += runtime.suppressValue((lineno = 50, colno = 238, runtime.callWrap(t_6, "govcyLocalizeContent", context, [runtime.memberLookup((runtime.memberLookup((t_13),"status")),"text"),runtime.memberLookup((l_params),"lang")])), env.opts.autoescape);
|
|
5102
|
+
t_2 += "</span>";
|
|
5103
|
+
if(runtime.memberLookup((runtime.memberLookup((t_13),"task")),"link")) {
|
|
5104
|
+
t_2 += "</a>";
|
|
5105
|
+
;
|
|
5106
|
+
}
|
|
5107
|
+
if(runtime.memberLookup((t_13),"description")) {
|
|
5108
|
+
t_2 += "<p>";
|
|
5109
|
+
t_2 += runtime.suppressValue((lineno = 51, colno = 85, runtime.callWrap(t_6, "govcyLocalizeContent", context, [runtime.memberLookup((t_13),"description"),runtime.memberLookup((l_params),"lang")])), env.opts.autoescape);
|
|
5110
|
+
t_2 += "</p>";
|
|
5111
|
+
;
|
|
5112
|
+
}
|
|
5113
|
+
t_2 += "\n </td>";
|
|
5114
|
+
if(runtime.memberLookup((t_13),"status")) {
|
|
5115
|
+
t_2 += "\n <td class=\"govcy-valign-top govcy-text-end\">\n <span class=\"govcy-tag ";
|
|
5116
|
+
t_2 += runtime.suppressValue(runtime.memberLookup((runtime.memberLookup((t_13),"status")),"classes"), env.opts.autoescape);
|
|
5117
|
+
t_2 += "\">";
|
|
5118
|
+
t_2 += runtime.suppressValue((lineno = 55, colno = 105, runtime.callWrap(t_6, "govcyLocalizeContent", context, [runtime.memberLookup((runtime.memberLookup((t_13),"status")),"text"),runtime.memberLookup((l_params),"lang")])), env.opts.autoescape);
|
|
5119
|
+
t_2 += "</span>\n </td>";
|
|
5120
|
+
;
|
|
5121
|
+
}
|
|
5122
|
+
t_2 += "\n </tr>";
|
|
5123
|
+
;
|
|
5124
|
+
}
|
|
5125
|
+
;
|
|
5126
|
+
}
|
|
5127
|
+
;
|
|
5128
|
+
}
|
|
5129
|
+
}
|
|
5130
|
+
frame = frame.pop();
|
|
5131
|
+
t_2 += "\n </tbody>\n </table>\n";
|
|
5132
|
+
})});
|
|
5133
|
+
}
|
|
5134
|
+
;
|
|
5135
|
+
frame = callerFrame;
|
|
5136
|
+
return new runtime.SafeString(t_2);
|
|
5137
|
+
});
|
|
5138
|
+
context.addExport("taskList");
|
|
5139
|
+
context.setVariable("taskList", macro_t_1);
|
|
5140
|
+
if(parentTemplate) {
|
|
5141
|
+
parentTemplate.rootRenderFunc(env, context, frame, runtime, cb);
|
|
5142
|
+
} else {
|
|
5143
|
+
cb(null, output);
|
|
5144
|
+
}
|
|
5145
|
+
;
|
|
5146
|
+
} catch (e) {
|
|
5147
|
+
cb(runtime.handleError(e, lineno, colno));
|
|
5148
|
+
}
|
|
5149
|
+
}
|
|
5150
|
+
return {
|
|
5151
|
+
root: root
|
|
5152
|
+
};
|
|
5153
|
+
|
|
5154
|
+
})();
|
|
5155
|
+
})();
|
|
5156
|
+
|
|
4952
5157
|
(function() {(window.nunjucksPrecompiled = window.nunjucksPrecompiled || {})["elements/textArea.njk"] = (function() {
|
|
4953
5158
|
function root(env, context, frame, runtime, cb) {
|
|
4954
5159
|
var lineno = 0;
|
|
@@ -5933,7 +6138,7 @@ var output = "";
|
|
|
5933
6138
|
try {
|
|
5934
6139
|
var parentTemplate = null;
|
|
5935
6140
|
var t_1;
|
|
5936
|
-
t_1 = ["label","legend","hint","button","errorMessage","select","textElement","htmlElement","textInput","radios","checkboxes","fileInput","fileView","backLink","tag","table","summaryList","textArea","markdown","panel","datePicker","dateInput"];
|
|
6141
|
+
t_1 = ["label","legend","hint","button","errorMessage","select","textElement","htmlElement","textInput","radios","checkboxes","fileInput","fileView","backLink","tag","table","summaryList","textArea","markdown","panel","datePicker","dateInput","taskList"];
|
|
5937
6142
|
frame.set("macroSimpleBlocks", t_1, true);
|
|
5938
6143
|
if(frame.topLevel) {
|
|
5939
6144
|
context.setVariable("macroSimpleBlocks", t_1);
|
package/package.json
CHANGED
|
@@ -77,6 +77,11 @@
|
|
|
77
77
|
@param {object} error If not empty there is an error message and displays the error variant. Optional, default is ''. Will escape text. Example `{en:"Content",el:"Περιεχομένο"}`
|
|
78
78
|
@param {boolean} hideFormControlError If true, hides the form control error (red line on the left). Mostly used in conditional radio elements. Optional
|
|
79
79
|
@param {string} lang The language used. Can be 'en','el'. Optional.
|
|
80
|
+
@param {array} elements if defined, govcy-elements to be rendered after the legend.
|
|
81
|
+
i.e. `[
|
|
82
|
+
{element:"button",params:{text:{en:"Button 1",el:"Κουμπί 1"},lang:"en",id:"govcy-test-23b"} },
|
|
83
|
+
{element:"button",params:{text:{en:"Button 2",el:"Κουμπί 2"},variant:'secondary',lang:"en",id:"govcy-test-23c"} },
|
|
84
|
+
]`
|
|
80
85
|
@param {array} items The array of items to turn onto checkbox
|
|
81
86
|
i.e. `[
|
|
82
87
|
{
|
|
@@ -127,6 +132,10 @@
|
|
|
127
132
|
{%- endif -%}
|
|
128
133
|
{% call fieldset({ariaDescribedby:ariaDescribedBy,classes:params.classes, lang:params.lang}) %}
|
|
129
134
|
{% call legend({legend:params.legend, isPageHeading:isPageHeading,lang:params.lang}) %}{% endcall %}
|
|
135
|
+
{#- Import localizer from utilities -#}
|
|
136
|
+
{%- from "../utilities/govcyUtilities.njk" import govcyElementsFromArray -%}
|
|
137
|
+
{#- render elements -#}
|
|
138
|
+
{{ govcyElementsFromArray(params.elements, params.lang) }}
|
|
130
139
|
{% call formControl({isError: false if params.hideFormControlError else params.error}) %}
|
|
131
140
|
{% call hint({hint:params.hint, id:hintId,lang:params.lang}) %}{% endcall %}
|
|
132
141
|
{#- render error message -#}
|
|
@@ -109,6 +109,11 @@
|
|
|
109
109
|
@param {object} error If not empty there is an error message and displays the error variant. Optional, default is ''. Will escape text. Example `{en:"Content",el:"Περιεχομένο"}`
|
|
110
110
|
@param {boolean} hideFormControlError If true, hides the form control error (red line on the left). Mostly used in conditional radio elements. Optional
|
|
111
111
|
@param {string} lang The language used. Can be 'en','el'. Optional.
|
|
112
|
+
@param {array} elements if defined, govcy-elements to be rendered after the legend.
|
|
113
|
+
i.e. `[
|
|
114
|
+
{element:"button",params:{text:{en:"Button 1",el:"Κουμπί 1"},lang:"en",id:"govcy-test-23b"} },
|
|
115
|
+
{element:"button",params:{text:{en:"Button 2",el:"Κουμπί 2"},variant:'secondary',lang:"en",id:"govcy-test-23c"} },
|
|
116
|
+
]`
|
|
112
117
|
@param {array} items The array of items to turn onto radio
|
|
113
118
|
i.e. `[
|
|
114
119
|
{
|
|
@@ -160,7 +165,12 @@
|
|
|
160
165
|
{%- endif -%}
|
|
161
166
|
{% call fieldset({ariaDescribedby:ariaDescribedBy,classes:params.classes, lang:params.lang}) %}
|
|
162
167
|
{% call legend({legend:params.legend, isPageHeading:isPageHeading,lang:params.lang}) %}{% endcall %}
|
|
168
|
+
{#- Import localizer from utilities -#}
|
|
169
|
+
{%- from "../utilities/govcyUtilities.njk" import govcyElementsFromArray -%}
|
|
170
|
+
{#- render elements -#}
|
|
171
|
+
{{ govcyElementsFromArray(params.elements, params.lang) }}
|
|
163
172
|
{% call formControl({isError: false if params.hideFormControlError else params.error}) %}
|
|
173
|
+
{#- render hint -#}
|
|
164
174
|
{% call hint({hint:params.hint, id:hintId,lang:params.lang}) %}{% endcall %}
|
|
165
175
|
{#- render error message -#}
|
|
166
176
|
{% call errorMessage({message:params.error,id:errorId,lang:params.lang}) %}{% endcall %}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
{# taskList
|
|
2
|
+
@param {string} id The id on the task list table. Will escape text.
|
|
3
|
+
@param {string} classes Additional classes to add to the table. Optional
|
|
4
|
+
@param {object} visuallyHiddenStatus The visuallyHiddenText text indicating status . Optional. Will escape text. Default value is `{en:"with status ",el:"με κατάσταση "}`
|
|
5
|
+
@param {string} lang The language used. Can be 'en','el'. Optional.
|
|
6
|
+
@param {array} items The array of items to turn onto taskList
|
|
7
|
+
i.e. `[
|
|
8
|
+
{
|
|
9
|
+
"id": "task1",
|
|
10
|
+
"task": {
|
|
11
|
+
"text": {
|
|
12
|
+
"el": "Εργασία ένα",
|
|
13
|
+
"en": "Task one"
|
|
14
|
+
},
|
|
15
|
+
"link": "#task1"
|
|
16
|
+
},
|
|
17
|
+
"description": {
|
|
18
|
+
"el": "Επεξήγηση",
|
|
19
|
+
"en": "Some explanation text"
|
|
20
|
+
}
|
|
21
|
+
,
|
|
22
|
+
"status": {
|
|
23
|
+
"text": {
|
|
24
|
+
"el": "ΟΛΟΚΛΗΡΩΘΗΚΕ",
|
|
25
|
+
"en": "COMPLETED"
|
|
26
|
+
},
|
|
27
|
+
"classes": ""
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
]`
|
|
31
|
+
@returns govcy taskList html
|
|
32
|
+
#}
|
|
33
|
+
{% macro taskList(params) -%}
|
|
34
|
+
{#- legend, id and name are mandatory -#}
|
|
35
|
+
{%- if params.items -%}
|
|
36
|
+
{#- Import localizer from utilities -#}
|
|
37
|
+
{%- from "../utilities/govcyUtilities.njk" import govcyLocalizeContent, govcyLangAttribute -%}
|
|
38
|
+
{#- set localizations -#}
|
|
39
|
+
{%- if params.visuallyHiddenStatus -%}
|
|
40
|
+
{%- set visuallyHiddenStatus -%} {{- govcyLocalizeContent(params.visuallyHiddenStatus, params.lang) -}}{%- endset -%}
|
|
41
|
+
{%- else -%}
|
|
42
|
+
{%- set visuallyHiddenStatus -%} {{- govcyLocalizeContent({en:"with status ",el:"με κατάσταση "} , params.lang) -}}{%- endset -%}
|
|
43
|
+
{%- endif %}
|
|
44
|
+
<table class="govcy-table{% if params.classes %} {{ params.classes }}{% endif %}"{% if params.id %} id="{{ params.id }}"{% endif %}{{ govcyLangAttribute(params.lang) }}>
|
|
45
|
+
<tbody>
|
|
46
|
+
{%- for item in params.items -%}
|
|
47
|
+
{%- if item -%}
|
|
48
|
+
{%- if item.task and item.status %}
|
|
49
|
+
<tr{% if params.id %} id="{{ params.id }}-row-{{ loop.index }}"{% endif %}>
|
|
50
|
+
<td classes="govcy-valign-top">
|
|
51
|
+
{%if item.task.link %}<a href="{{ item.task.link }}">{% endif %}{{ govcyLocalizeContent(item.task.text, params.lang) }}<span class="govcy-visually-hidden"> {{ visuallyHiddenStatus }} {{ govcyLocalizeContent(item.status.text, params.lang) }}</span>{%if item.task.link %}</a>{% endif %}
|
|
52
|
+
{%- if item.description -%}<p>{{ govcyLocalizeContent(item.description, params.lang) }}</p>{%- endif %}
|
|
53
|
+
</td>
|
|
54
|
+
{%- if item.status %}
|
|
55
|
+
<td class="govcy-valign-top govcy-text-end">
|
|
56
|
+
<span class="govcy-tag {{ item.status.classes }}">{{ govcyLocalizeContent(item.status.text, params.lang) }}</span>
|
|
57
|
+
</td>
|
|
58
|
+
{%- endif %}
|
|
59
|
+
</tr>
|
|
60
|
+
{%- endif -%}
|
|
61
|
+
{%- endif -%}
|
|
62
|
+
{%- endfor %}
|
|
63
|
+
</tbody>
|
|
64
|
+
</table>
|
|
65
|
+
{% endif -%}
|
|
66
|
+
{%- endmacro %}
|
package/src/njk/govcyElement.njk
CHANGED
|
@@ -25,7 +25,7 @@ To use:
|
|
|
25
25
|
{%- set macroSimpleBlocks = ['label', 'legend', 'hint', 'button',
|
|
26
26
|
'errorMessage','select','textElement','htmlElement','textInput','radios','checkboxes',
|
|
27
27
|
'fileInput','fileView','backLink','tag','table', 'summaryList', 'textArea','markdown',
|
|
28
|
-
'panel', 'datePicker','dateInput'] -%}
|
|
28
|
+
'panel', 'datePicker','dateInput', 'taskList'] -%}
|
|
29
29
|
{%- set macroCallerBlocks = ['formControl','form','fieldset'] -%}
|
|
30
30
|
{%- macro govcyElement(component, params) -%}
|
|
31
31
|
{#- Simple blocks -#}
|