@gov-cy/govcy-frontend-renderer 1.1.1 → 1.2.1
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.
|
@@ -2157,6 +2157,175 @@ root: root
|
|
|
2157
2157
|
})();
|
|
2158
2158
|
})();
|
|
2159
2159
|
|
|
2160
|
+
(function() {(window.nunjucksPrecompiled = window.nunjucksPrecompiled || {})["elements/panel.njk"] = (function() {
|
|
2161
|
+
function root(env, context, frame, runtime, cb) {
|
|
2162
|
+
var lineno = 0;
|
|
2163
|
+
var colno = 0;
|
|
2164
|
+
var output = "";
|
|
2165
|
+
try {
|
|
2166
|
+
var parentTemplate = null;
|
|
2167
|
+
output += "\r\n";
|
|
2168
|
+
var macro_t_1 = runtime.makeMacro(
|
|
2169
|
+
["params"],
|
|
2170
|
+
[],
|
|
2171
|
+
function (l_params, kwargs) {
|
|
2172
|
+
var callerFrame = frame;
|
|
2173
|
+
frame = new runtime.Frame();
|
|
2174
|
+
kwargs = kwargs || {};
|
|
2175
|
+
if (Object.prototype.hasOwnProperty.call(kwargs, "caller")) {
|
|
2176
|
+
frame.set("caller", kwargs.caller); }
|
|
2177
|
+
frame.set("params", l_params);
|
|
2178
|
+
var t_2 = "";env.getTemplate("utilities/govcyUtilities.njk", false, "elements/panel.njk", false, function(t_4,t_3) {
|
|
2179
|
+
if(t_4) { cb(t_4); return; }
|
|
2180
|
+
t_3.getExported(function(t_5,t_3) {
|
|
2181
|
+
if(t_5) { cb(t_5); return; }
|
|
2182
|
+
if(Object.prototype.hasOwnProperty.call(t_3, "govcyLocalizeContent")) {
|
|
2183
|
+
var t_6 = t_3.govcyLocalizeContent;
|
|
2184
|
+
} else {
|
|
2185
|
+
cb(new Error("cannot import 'govcyLocalizeContent'")); return;
|
|
2186
|
+
}
|
|
2187
|
+
context.setVariable("govcyLocalizeContent", t_6);
|
|
2188
|
+
if(Object.prototype.hasOwnProperty.call(t_3, "govcyLangAttribute")) {
|
|
2189
|
+
var t_7 = t_3.govcyLangAttribute;
|
|
2190
|
+
} else {
|
|
2191
|
+
cb(new Error("cannot import 'govcyLangAttribute'")); return;
|
|
2192
|
+
}
|
|
2193
|
+
context.setVariable("govcyLangAttribute", t_7);
|
|
2194
|
+
var t_8;
|
|
2195
|
+
t_8 = env.getFilter("default").call(context, runtime.memberLookup((l_params),"background"),"govcy-bg-success");
|
|
2196
|
+
frame.set("background", t_8, true);
|
|
2197
|
+
if(frame.topLevel) {
|
|
2198
|
+
context.setVariable("background", t_8);
|
|
2199
|
+
}
|
|
2200
|
+
if(frame.topLevel) {
|
|
2201
|
+
context.addExport("background", t_8);
|
|
2202
|
+
}
|
|
2203
|
+
t_2 += "<div ";
|
|
2204
|
+
if(runtime.memberLookup((l_params),"id")) {
|
|
2205
|
+
t_2 += "id=\"";
|
|
2206
|
+
t_2 += runtime.suppressValue(runtime.memberLookup((l_params),"id"), env.opts.autoescape);
|
|
2207
|
+
t_2 += "\" ";
|
|
2208
|
+
;
|
|
2209
|
+
}
|
|
2210
|
+
t_2 += "class=\"govcy-alert-completed-notification";
|
|
2211
|
+
if(runtime.memberLookup((l_params),"classes")) {
|
|
2212
|
+
t_2 += " ";
|
|
2213
|
+
t_2 += runtime.suppressValue(runtime.memberLookup((l_params),"classes"), env.opts.autoescape);
|
|
2214
|
+
;
|
|
2215
|
+
}
|
|
2216
|
+
t_2 += "\"";
|
|
2217
|
+
t_2 += runtime.suppressValue((lineno = 20, colno = 173, runtime.callWrap(t_7, "govcyLangAttribute", context, [runtime.memberLookup((l_params),"lang")])), env.opts.autoescape);
|
|
2218
|
+
t_2 += ">\r\n <div class=\"govcy-alert-completed-notification-body ";
|
|
2219
|
+
t_2 += runtime.suppressValue(runtime.contextOrFrameLookup(context, frame, "background"), env.opts.autoescape);
|
|
2220
|
+
t_2 += "\">";
|
|
2221
|
+
if(runtime.memberLookup((l_params),"header")) {
|
|
2222
|
+
t_2 += "<h1>";
|
|
2223
|
+
t_2 += runtime.suppressValue((lineno = 22, colno = 59, runtime.callWrap(t_6, "govcyLocalizeContent", context, [runtime.memberLookup((l_params),"header"),runtime.memberLookup((l_params),"lang")])), env.opts.autoescape);
|
|
2224
|
+
t_2 += "</h1>";
|
|
2225
|
+
;
|
|
2226
|
+
}
|
|
2227
|
+
if(runtime.memberLookup((l_params),"body")) {
|
|
2228
|
+
t_2 += "<p>";
|
|
2229
|
+
t_2 += runtime.suppressValue((lineno = 23, colno = 56, runtime.callWrap(t_6, "govcyLocalizeContent", context, [runtime.memberLookup((l_params),"body"),runtime.memberLookup((l_params),"lang")])), env.opts.autoescape);
|
|
2230
|
+
t_2 += "</p>";
|
|
2231
|
+
;
|
|
2232
|
+
}
|
|
2233
|
+
if(runtime.memberLookup((l_params),"referenceNumber")) {
|
|
2234
|
+
t_2 += "<p class=\"govcy-fw-bold\">";
|
|
2235
|
+
t_2 += runtime.suppressValue((lineno = 24, colno = 89, runtime.callWrap(t_6, "govcyLocalizeContent", context, [runtime.memberLookup((l_params),"referenceNumber"),runtime.memberLookup((l_params),"lang")])), env.opts.autoescape);
|
|
2236
|
+
t_2 += "</p>";
|
|
2237
|
+
;
|
|
2238
|
+
}
|
|
2239
|
+
env.getTemplate("govcyElement.njk", false, "elements/panel.njk", false, function(t_10,t_9) {
|
|
2240
|
+
if(t_10) { cb(t_10); return; }
|
|
2241
|
+
t_9.getExported(function(t_11,t_9) {
|
|
2242
|
+
if(t_11) { cb(t_11); return; }
|
|
2243
|
+
if(Object.prototype.hasOwnProperty.call(t_9, "govcyElement")) {
|
|
2244
|
+
var t_12 = t_9.govcyElement;
|
|
2245
|
+
} else {
|
|
2246
|
+
cb(new Error("cannot import 'govcyElement'")); return;
|
|
2247
|
+
}
|
|
2248
|
+
context.setVariable("govcyElement", t_12);
|
|
2249
|
+
frame = frame.push();
|
|
2250
|
+
var t_15 = runtime.memberLookup((l_params),"elements");
|
|
2251
|
+
if(t_15) {t_15 = runtime.fromIterator(t_15);
|
|
2252
|
+
var t_14 = t_15.length;
|
|
2253
|
+
for(var t_13=0; t_13 < t_15.length; t_13++) {
|
|
2254
|
+
var t_16 = t_15[t_13];
|
|
2255
|
+
frame.set("element", t_16);
|
|
2256
|
+
frame.set("loop.index", t_13 + 1);
|
|
2257
|
+
frame.set("loop.index0", t_13);
|
|
2258
|
+
frame.set("loop.revindex", t_14 - t_13);
|
|
2259
|
+
frame.set("loop.revindex0", t_14 - t_13 - 1);
|
|
2260
|
+
frame.set("loop.first", t_13 === 0);
|
|
2261
|
+
frame.set("loop.last", t_13 === t_14 - 1);
|
|
2262
|
+
frame.set("loop.length", t_14);
|
|
2263
|
+
if(runtime.memberLookup((l_params),"lang") && !runtime.memberLookup((runtime.memberLookup((t_16),"params")),"lang")) {
|
|
2264
|
+
var t_17;
|
|
2265
|
+
t_17 = env.getFilter("merge").call(context, runtime.memberLookup((t_16),"params"),{"lang": runtime.memberLookup((l_params),"lang")});
|
|
2266
|
+
frame.set("paramsIn", t_17, true);
|
|
2267
|
+
if(frame.topLevel) {
|
|
2268
|
+
context.setVariable("paramsIn", t_17);
|
|
2269
|
+
}
|
|
2270
|
+
if(frame.topLevel) {
|
|
2271
|
+
context.addExport("paramsIn", t_17);
|
|
2272
|
+
}
|
|
2273
|
+
;
|
|
2274
|
+
}
|
|
2275
|
+
else {
|
|
2276
|
+
var t_18;
|
|
2277
|
+
t_18 = runtime.memberLookup((t_16),"params");
|
|
2278
|
+
frame.set("paramsIn", t_18, true);
|
|
2279
|
+
if(frame.topLevel) {
|
|
2280
|
+
context.setVariable("paramsIn", t_18);
|
|
2281
|
+
}
|
|
2282
|
+
if(frame.topLevel) {
|
|
2283
|
+
context.addExport("paramsIn", t_18);
|
|
2284
|
+
}
|
|
2285
|
+
;
|
|
2286
|
+
}
|
|
2287
|
+
t_2 += runtime.suppressValue((lineno = 35, colno = 33, runtime.callWrap(t_12, "govcyElement", context, [runtime.memberLookup((t_16),"element"),runtime.contextOrFrameLookup(context, frame, "paramsIn"),runtime.makeKeywordArgs({"caller": (function (){var macro_t_19 = runtime.makeMacro(
|
|
2288
|
+
[],
|
|
2289
|
+
[],
|
|
2290
|
+
function (kwargs) {
|
|
2291
|
+
var callerFrame = frame;
|
|
2292
|
+
frame = frame.push(true);
|
|
2293
|
+
kwargs = kwargs || {};
|
|
2294
|
+
if (Object.prototype.hasOwnProperty.call(kwargs, "caller")) {
|
|
2295
|
+
frame.set("caller", kwargs.caller); }
|
|
2296
|
+
var t_20 = "";;
|
|
2297
|
+
frame = frame.pop();
|
|
2298
|
+
return new runtime.SafeString(t_20);
|
|
2299
|
+
});
|
|
2300
|
+
return macro_t_19;})()})])), env.opts.autoescape);
|
|
2301
|
+
;
|
|
2302
|
+
}
|
|
2303
|
+
}
|
|
2304
|
+
frame = frame.pop();
|
|
2305
|
+
t_2 += "</div> \r\n</div>";
|
|
2306
|
+
})})})});
|
|
2307
|
+
frame = callerFrame;
|
|
2308
|
+
return new runtime.SafeString(t_2);
|
|
2309
|
+
});
|
|
2310
|
+
context.addExport("panel");
|
|
2311
|
+
context.setVariable("panel", macro_t_1);
|
|
2312
|
+
if(parentTemplate) {
|
|
2313
|
+
parentTemplate.rootRenderFunc(env, context, frame, runtime, cb);
|
|
2314
|
+
} else {
|
|
2315
|
+
cb(null, output);
|
|
2316
|
+
}
|
|
2317
|
+
;
|
|
2318
|
+
} catch (e) {
|
|
2319
|
+
cb(runtime.handleError(e, lineno, colno));
|
|
2320
|
+
}
|
|
2321
|
+
}
|
|
2322
|
+
return {
|
|
2323
|
+
root: root
|
|
2324
|
+
};
|
|
2325
|
+
|
|
2326
|
+
})();
|
|
2327
|
+
})();
|
|
2328
|
+
|
|
2160
2329
|
(function() {(window.nunjucksPrecompiled = window.nunjucksPrecompiled || {})["elements/radios.njk"] = (function() {
|
|
2161
2330
|
function root(env, context, frame, runtime, cb) {
|
|
2162
2331
|
var lineno = 0;
|
|
@@ -2547,7 +2716,7 @@ context.addExport("updatedConditionalElements", t_36);
|
|
|
2547
2716
|
}
|
|
2548
2717
|
}
|
|
2549
2718
|
frame = frame.pop();
|
|
2550
|
-
t_2 += "<
|
|
2719
|
+
t_2 += "<div class=\"govcy-form-control";
|
|
2551
2720
|
if(runtime.memberLookup((l_item),"conditionalHasErrors")) {
|
|
2552
2721
|
t_2 += " govcy-form-control-error";
|
|
2553
2722
|
;
|
|
@@ -2559,7 +2728,7 @@ t_2 += " govcy-form-control-hint";
|
|
|
2559
2728
|
t_2 += " govcy-pl-4 govcy-ml-5 govcy-radio__conditional govcy-radio__conditional--hidden\" id=\"";
|
|
2560
2729
|
t_2 += runtime.suppressValue(runtime.contextOrFrameLookup(context, frame, "conditionalElementsId"), env.opts.autoescape);
|
|
2561
2730
|
t_2 += "\">\n ";
|
|
2562
|
-
t_2 += runtime.suppressValue((lineno =
|
|
2731
|
+
t_2 += runtime.suppressValue((lineno = 96, colno = 37, runtime.callWrap(t_8, "govcyElementsFromArray", context, [runtime.contextOrFrameLookup(context, frame, "updatedConditionalElements"),runtime.memberLookup((l_params),"lang")])), env.opts.autoescape);
|
|
2563
2732
|
t_2 += "\n </div>";
|
|
2564
2733
|
;
|
|
2565
2734
|
}
|
|
@@ -2721,7 +2890,7 @@ context.addExport("ariaDescribedBy", t_66);
|
|
|
2721
2890
|
}
|
|
2722
2891
|
;
|
|
2723
2892
|
}
|
|
2724
|
-
t_38 += runtime.suppressValue((lineno =
|
|
2893
|
+
t_38 += runtime.suppressValue((lineno = 160, colno = 20, runtime.callWrap(t_44, "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_67 = runtime.makeMacro(
|
|
2725
2894
|
[],
|
|
2726
2895
|
[],
|
|
2727
2896
|
function (kwargs) {
|
|
@@ -2731,7 +2900,7 @@ kwargs = kwargs || {};
|
|
|
2731
2900
|
if (Object.prototype.hasOwnProperty.call(kwargs, "caller")) {
|
|
2732
2901
|
frame.set("caller", kwargs.caller); }
|
|
2733
2902
|
var t_68 = "";t_68 += "\n ";
|
|
2734
|
-
t_68 += runtime.suppressValue((lineno =
|
|
2903
|
+
t_68 += runtime.suppressValue((lineno = 161, colno = 22, runtime.callWrap(t_52, "legend", context, [{"legend": runtime.memberLookup((l_params),"legend"),"isPageHeading": runtime.contextOrFrameLookup(context, frame, "isPageHeading"),"lang": runtime.memberLookup((l_params),"lang")},runtime.makeKeywordArgs({"caller": (function (){var macro_t_69 = runtime.makeMacro(
|
|
2735
2904
|
[],
|
|
2736
2905
|
[],
|
|
2737
2906
|
function (kwargs) {
|
|
@@ -2746,7 +2915,7 @@ return new runtime.SafeString(t_70);
|
|
|
2746
2915
|
});
|
|
2747
2916
|
return macro_t_69;})()})])), env.opts.autoescape);
|
|
2748
2917
|
t_68 += "\n ";
|
|
2749
|
-
t_68 += runtime.suppressValue((lineno =
|
|
2918
|
+
t_68 += runtime.suppressValue((lineno = 162, 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_71 = runtime.makeMacro(
|
|
2750
2919
|
[],
|
|
2751
2920
|
[],
|
|
2752
2921
|
function (kwargs) {
|
|
@@ -2756,7 +2925,7 @@ kwargs = kwargs || {};
|
|
|
2756
2925
|
if (Object.prototype.hasOwnProperty.call(kwargs, "caller")) {
|
|
2757
2926
|
frame.set("caller", kwargs.caller); }
|
|
2758
2927
|
var t_72 = "";t_72 += "\n ";
|
|
2759
|
-
t_72 += runtime.suppressValue((lineno =
|
|
2928
|
+
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(
|
|
2760
2929
|
[],
|
|
2761
2930
|
[],
|
|
2762
2931
|
function (kwargs) {
|
|
@@ -2770,7 +2939,7 @@ frame = frame.pop();
|
|
|
2770
2939
|
return new runtime.SafeString(t_74);
|
|
2771
2940
|
});
|
|
2772
2941
|
return macro_t_73;})()})])), env.opts.autoescape);
|
|
2773
|
-
t_72 += runtime.suppressValue((lineno =
|
|
2942
|
+
t_72 += runtime.suppressValue((lineno = 165, 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_75 = runtime.makeMacro(
|
|
2774
2943
|
[],
|
|
2775
2944
|
[],
|
|
2776
2945
|
function (kwargs) {
|
|
@@ -2800,7 +2969,7 @@ frame.set("loop.first", t_77 === 0);
|
|
|
2800
2969
|
frame.set("loop.last", t_77 === t_78 - 1);
|
|
2801
2970
|
frame.set("loop.length", t_78);
|
|
2802
2971
|
if(t_80) {
|
|
2803
|
-
t_72 += runtime.suppressValue((lineno =
|
|
2972
|
+
t_72 += runtime.suppressValue((lineno = 169, colno = 34, runtime.callWrap(runtime.contextOrFrameLookup(context, frame, "_radioItem"), "_radioItem", context, [l_params,t_80,runtime.contextOrFrameLookup(context, frame, "isInline"),runtime.memberLookup((runtime.contextOrFrameLookup(context, frame, "loop")),"index"),runtime.memberLookup((l_params),"lang")])), env.opts.autoescape);
|
|
2804
2973
|
;
|
|
2805
2974
|
}
|
|
2806
2975
|
;
|
|
@@ -4918,7 +5087,7 @@ var output = "";
|
|
|
4918
5087
|
try {
|
|
4919
5088
|
var parentTemplate = null;
|
|
4920
5089
|
var t_1;
|
|
4921
|
-
t_1 = ["label","legend","hint","button","errorMessage","select","textElement","htmlElement","textInput","radios","checkboxes","fileInput","fileView","backLink","tag","table","summaryList","textArea","markdown"];
|
|
5090
|
+
t_1 = ["label","legend","hint","button","errorMessage","select","textElement","htmlElement","textInput","radios","checkboxes","fileInput","fileView","backLink","tag","table","summaryList","textArea","markdown","panel"];
|
|
4922
5091
|
frame.set("macroSimpleBlocks", t_1, true);
|
|
4923
5092
|
if(frame.topLevel) {
|
|
4924
5093
|
context.setVariable("macroSimpleBlocks", t_1);
|
|
@@ -4966,7 +5135,7 @@ if(t_10) { cb(t_10); return; }
|
|
|
4966
5135
|
t_9.getExported(function(t_11,t_9) {
|
|
4967
5136
|
if(t_11) { cb(t_11); return; }
|
|
4968
5137
|
frame.set("comp", t_9);
|
|
4969
|
-
t_4 += runtime.suppressValue((lineno =
|
|
5138
|
+
t_4 += runtime.suppressValue((lineno = 34, colno = 22, runtime.callWrap(runtime.memberLookup((t_9),t_8), "comp[\"c\"]", context, [l_params])), env.opts.autoescape);
|
|
4970
5139
|
})});
|
|
4971
5140
|
}
|
|
4972
5141
|
;
|
|
@@ -4993,7 +5162,7 @@ if(t_17) { cb(t_17); return; }
|
|
|
4993
5162
|
t_16.getExported(function(t_18,t_16) {
|
|
4994
5163
|
if(t_18) { cb(t_18); return; }
|
|
4995
5164
|
frame.set("compm", t_16);
|
|
4996
|
-
t_4 += runtime.suppressValue((lineno =
|
|
5165
|
+
t_4 += runtime.suppressValue((lineno = 41, colno = 29, runtime.callWrap(runtime.memberLookup((t_16),t_15), "compm[\"c\"]", context, [l_params,runtime.makeKeywordArgs({"caller": (function (){var macro_t_19 = runtime.makeMacro(
|
|
4997
5166
|
[],
|
|
4998
5167
|
[],
|
|
4999
5168
|
function (kwargs) {
|
|
@@ -5002,7 +5171,7 @@ frame = frame.push(true);
|
|
|
5002
5171
|
kwargs = kwargs || {};
|
|
5003
5172
|
if (Object.prototype.hasOwnProperty.call(kwargs, "caller")) {
|
|
5004
5173
|
frame.set("caller", kwargs.caller); }
|
|
5005
|
-
var t_20 = "";t_20 += runtime.suppressValue((lineno =
|
|
5174
|
+
var t_20 = "";t_20 += runtime.suppressValue((lineno = 42, colno = 25, runtime.callWrap(runtime.contextOrFrameLookup(context, frame, "caller"), "caller", context, [])), env.opts.autoescape);
|
|
5006
5175
|
;
|
|
5007
5176
|
frame = frame.pop();
|
|
5008
5177
|
return new runtime.SafeString(t_20);
|
package/package.json
CHANGED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{# panel
|
|
2
|
+
@param {string} lang The language used. Can be 'en','el'. Optional.
|
|
3
|
+
@param {object} header if defined, will rendered the `<h1>` inside the panel. Will escape text. Example `{en:"Content",el:"Περιεχομένο"}`
|
|
4
|
+
@param {object} body if defined, will rendered the body in a `<p>` inside the panel. Will escape text. Example `{en:"Content",el:"Περιεχομένο"}`
|
|
5
|
+
@param {object} referenceNumber if defined, will rendered the reference number in a `<p>` inside the panel. Will escape text. Example `{en:"Content",el:"Περιεχομένο"}`
|
|
6
|
+
@param {array} elements if defined, govcy-elements to be rendered inside the panel.
|
|
7
|
+
i.e. `[
|
|
8
|
+
{element:"button",params:{text:{en:"Button 1",el:"Κουμπί 1"},lang:"en",id:"govcy-test-23b"} },
|
|
9
|
+
{element:"button",params:{text:{en:"Button 2",el:"Κουμπί 2"},variant:'secondary',lang:"en",id:"govcy-test-23c"} },
|
|
10
|
+
]`
|
|
11
|
+
@param {string} id The label id. Will escape text
|
|
12
|
+
@param {string} background The background class of the panel. Default is `govcy-bg-success`. Will escape text
|
|
13
|
+
@param {string} classes Additional classes to add to the outer div. Optional
|
|
14
|
+
@returns govcy panel html
|
|
15
|
+
#}
|
|
16
|
+
{% macro panel(params) -%}
|
|
17
|
+
{#- Import localizer from utilities -#}
|
|
18
|
+
{%- from "../utilities/govcyUtilities.njk" import govcyLocalizeContent, govcyLangAttribute -%}
|
|
19
|
+
{# set default values #}
|
|
20
|
+
{%- set background = params.background | default("govcy-bg-success") -%}
|
|
21
|
+
<div {% if params.id %}id="{{ params.id }}" {% endif %}class="govcy-alert-completed-notification{% if params.classes %} {{ params.classes }}{% endif %}"{{ govcyLangAttribute(params.lang) }}>
|
|
22
|
+
<div class="govcy-alert-completed-notification-body {{ background }}">
|
|
23
|
+
{%- if params.header -%}<h1>{{ govcyLocalizeContent(params.header, params.lang) }}</h1>{%- endif -%}
|
|
24
|
+
{%- if params.body -%}<p>{{ govcyLocalizeContent(params.body, params.lang) }}</p>{%- endif -%}
|
|
25
|
+
{%- if params.referenceNumber -%}<p class="govcy-fw-bold">{{ govcyLocalizeContent(params.referenceNumber, params.lang) }}</p>{%- endif -%}
|
|
26
|
+
{#- Import localizer from utilities -#}
|
|
27
|
+
{%- from "../govcyElement.njk" import govcyElement -%}
|
|
28
|
+
{#- handle elements if defined -#}
|
|
29
|
+
{%- for element in params.elements -%}
|
|
30
|
+
{#- if lang is defined in the element, merge it with the lang of the panel -#}
|
|
31
|
+
{%- if params.lang and not element.params.lang -%}
|
|
32
|
+
{%- set paramsIn = element.params | merge({lang: params.lang}) -%}
|
|
33
|
+
{%- else -%}
|
|
34
|
+
{%- set paramsIn = element.params -%}
|
|
35
|
+
{%- endif -%}
|
|
36
|
+
{%- call govcyElement(element.element, paramsIn) %}{% endcall -%}
|
|
37
|
+
{%- endfor -%}
|
|
38
|
+
</div>
|
|
39
|
+
</div>
|
|
40
|
+
{%- endmacro %}
|
|
@@ -93,12 +93,6 @@
|
|
|
93
93
|
}) -%}
|
|
94
94
|
{%- set updatedConditionalElements = updatedConditionalElements.concat([updatedElement]) -%}
|
|
95
95
|
{%- endfor -%}
|
|
96
|
-
<style>
|
|
97
|
-
.govcy-radio__conditional label,
|
|
98
|
-
.govcy-radio__conditional legend {
|
|
99
|
-
font-size: 1rem !important;
|
|
100
|
-
}
|
|
101
|
-
</style>
|
|
102
96
|
<div class="govcy-form-control{% if item.conditionalHasErrors %} govcy-form-control-error{% else %} govcy-form-control-hint{% endif %} govcy-pl-4 govcy-ml-5 govcy-radio__conditional govcy-radio__conditional--hidden" id="{{conditionalElementsId}}">
|
|
103
97
|
{{ govcyElementsFromArray(updatedConditionalElements, params.lang) }}
|
|
104
98
|
</div>
|
package/src/njk/govcyElement.njk
CHANGED
|
@@ -24,7 +24,8 @@ To use:
|
|
|
24
24
|
#}
|
|
25
25
|
{%- set macroSimpleBlocks = ['label', 'legend', 'hint', 'button',
|
|
26
26
|
'errorMessage','select','textElement','htmlElement','textInput','radios','checkboxes',
|
|
27
|
-
'fileInput','fileView','backLink','tag','table', 'summaryList', 'textArea','markdown'
|
|
27
|
+
'fileInput','fileView','backLink','tag','table', 'summaryList', 'textArea','markdown',
|
|
28
|
+
'panel'] -%}
|
|
28
29
|
{%- set macroCallerBlocks = ['formControl','form','fieldset'] -%}
|
|
29
30
|
{%- macro govcyElement(component, params) -%}
|
|
30
31
|
{#- Simple blocks -#}
|