@gov-cy/govcy-frontend-renderer 1.22.1 → 1.23.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.
|
@@ -167,7 +167,7 @@ frame.set("key", l_key);
|
|
|
167
167
|
frame.set("lang", l_lang);
|
|
168
168
|
frame.set("isHTML", l_isHTML);
|
|
169
169
|
var t_22 = "";var t_23;
|
|
170
|
-
t_23 = {"backLink_back": {"el": "Πίσω","en": "Back"},"common_or": {"el": "Ή","en": "Or"},"common_and": {"el": "Και","en": "And"},"common_entry": {"en": "Entry","el": "Καταχώρηση"},"common_entries": {"en": "Entries","el": "Καταχωρήσεις"},"dateInput_dayLabel": {"el": "Μέρα","en": "Day"},"dateInput_monthLabel": {"el": "Μήνας","en": "Month"},"dateInput_yearLabel": {"el": "Χρόνος","en": "Year"},"dateInput_monthValue1": {"en": "January","el": "Ιανουάριος"},"dateInput_monthValue2": {"en": "February","el": "Φεβρουάριος"},"dateInput_monthValue3": {"en": "March","el": "Μάρτιος"},"dateInput_monthValue4": {"en": "April","el": "Απρίλιος"},"dateInput_monthValue5": {"en": "May","el": "Μάϊος"},"dateInput_monthValue6": {"en": "June","el": "Ιούνιος"},"dateInput_monthValue7": {"en": "July","el": "Ιούλιος"},"dateInput_monthValue8": {"en": "August","el": "Αύγουστος"},"dateInput_monthValue9": {"en": "September","el": "Σεπτέμβριος"},"dateInput_monthValue10": {"en": "October","el": "Οκτώβριος"},"dateInput_monthValue11": {"en": "November","el": "Νοέμβριος"},"dateInput_monthValue12": {"en": "December","el": "Δεκέμβριος"},"errorMessage_hiddenError": {"en": "Error","el": "Σφάλμα"},"errorSummary_header": {"en": "There is a problem","el": "Υπάρχει πρόβλημα"},"fileView_view": {"en": "View","el": "Προβολή"},"fileView_delete": {"en": "Delete","el": "Διαγραφή"},"progressList_completedLabel": {"en": "Completed","el": "Ολοκληρώθηκε"},"progressList_notCompletedLabel": {"en": "Not completed","el": "Δεν ολοκληρώθηκε"},"progressList_stepLabel": {"en": "Step","el": "Βήμα"},"progressList_ofLabel": {"en": "of","el": "από"},"radios_conditionalLabel": {"en": "This option expands and has more questions,","el": "Αυτή η επιλογή επεκτείνεται και έχει περισσότερες ερωτήσεις,"},"stepByStepStatic_step": {"en": "Step","el": "Βήμα"},"taskList_withStatus": {"en": "with status ","el": "με κατάσταση "},"textArea_charRemaining": {"en": "You have <span></span> characters remaining","el": "Έχετε <span></span> χαρακτήρες που απομένουν"},"textArea_charExceeding": {"en": "You have entered <span></span> characters more","el": "Έχετε περάσει <span></span> χαρακτήρες περισσότερους"},"textArea_wordRemaining": {"en": "You have <span></span> words remaining","el": "Έχετε <span></span> λέξεις που απομένουν"},"textArea_wordsExceeding": {"en": "You have entered <span></span> words more","el": "Έχετε περάσει <span></span> λέξεις περισσότερες"},"userName_signOut": {"en": "Sign out","el": "Αποσύνδεση"},"userName_fromUser": {"en": "from user","el": "από το χρήστη"}};
|
|
170
|
+
t_23 = {"backLink_back": {"el": "Πίσω","en": "Back"},"common_or": {"el": "Ή","en": "Or"},"common_and": {"el": "Και","en": "And"},"common_entry": {"en": "Entry","el": "Καταχώρηση"},"common_entries": {"en": "Entries","el": "Καταχωρήσεις"},"dateInput_dayLabel": {"el": "Μέρα","en": "Day"},"dateInput_monthLabel": {"el": "Μήνας","en": "Month"},"dateInput_yearLabel": {"el": "Χρόνος","en": "Year"},"dateInput_monthValue1": {"en": "January","el": "Ιανουάριος"},"dateInput_monthValue2": {"en": "February","el": "Φεβρουάριος"},"dateInput_monthValue3": {"en": "March","el": "Μάρτιος"},"dateInput_monthValue4": {"en": "April","el": "Απρίλιος"},"dateInput_monthValue5": {"en": "May","el": "Μάϊος"},"dateInput_monthValue6": {"en": "June","el": "Ιούνιος"},"dateInput_monthValue7": {"en": "July","el": "Ιούλιος"},"dateInput_monthValue8": {"en": "August","el": "Αύγουστος"},"dateInput_monthValue9": {"en": "September","el": "Σεπτέμβριος"},"dateInput_monthValue10": {"en": "October","el": "Οκτώβριος"},"dateInput_monthValue11": {"en": "November","el": "Νοέμβριος"},"dateInput_monthValue12": {"en": "December","el": "Δεκέμβριος"},"errorMessage_hiddenError": {"en": "Error","el": "Σφάλμα"},"errorSummary_header": {"en": "There is a problem","el": "Υπάρχει πρόβλημα"},"fileView_view": {"en": "View","el": "Προβολή"},"fileView_delete": {"en": "Delete","el": "Διαγραφή"},"progressList_completedLabel": {"en": "Completed","el": "Ολοκληρώθηκε"},"progressList_notCompletedLabel": {"en": "Not completed","el": "Δεν ολοκληρώθηκε"},"progressList_stepLabel": {"en": "Step","el": "Βήμα"},"progressList_ofLabel": {"en": "of","el": "από"},"radios_conditionalLabel": {"en": "This option expands and has more questions,","el": "Αυτή η επιλογή επεκτείνεται και έχει περισσότερες ερωτήσεις,"},"stepByStepStatic_step": {"en": "Step","el": "Βήμα"},"taskList_withStatus": {"en": "with status ","el": "με κατάσταση "},"textArea_charRemaining": {"en": "You have <span></span> characters remaining","el": "Έχετε <span></span> χαρακτήρες που απομένουν"},"textArea_charExceeding": {"en": "You have entered <span></span> characters more","el": "Έχετε περάσει <span></span> χαρακτήρες περισσότερους"},"textArea_wordRemaining": {"en": "You have <span></span> words remaining","el": "Έχετε <span></span> λέξεις που απομένουν"},"textArea_wordsExceeding": {"en": "You have entered <span></span> words more","el": "Έχετε περάσει <span></span> λέξεις περισσότερες"},"userName_signOut": {"en": "Sign out","el": "Αποσύνδεση"},"userName_fromUser": {"en": "from user","el": "από το χρήστη"},"warning": {"en": "Warning","el": "Προσοχή"}};
|
|
171
171
|
frame.set("govcyContent", t_23, true);
|
|
172
172
|
if(frame.topLevel) {
|
|
173
173
|
context.setVariable("govcyContent", t_23);
|
|
@@ -7477,6 +7477,98 @@ root: root
|
|
|
7477
7477
|
})();
|
|
7478
7478
|
})();
|
|
7479
7479
|
|
|
7480
|
+
(function() {(window.nunjucksPrecompiled = window.nunjucksPrecompiled || {})["elements/warning.njk"] = (function() {
|
|
7481
|
+
function root(env, context, frame, runtime, cb) {
|
|
7482
|
+
var lineno = 0;
|
|
7483
|
+
var colno = 0;
|
|
7484
|
+
var output = "";
|
|
7485
|
+
try {
|
|
7486
|
+
var parentTemplate = null;
|
|
7487
|
+
output += "\r\n";
|
|
7488
|
+
var macro_t_1 = runtime.makeMacro(
|
|
7489
|
+
["params"],
|
|
7490
|
+
[],
|
|
7491
|
+
function (l_params, kwargs) {
|
|
7492
|
+
var callerFrame = frame;
|
|
7493
|
+
frame = new runtime.Frame();
|
|
7494
|
+
kwargs = kwargs || {};
|
|
7495
|
+
if (Object.prototype.hasOwnProperty.call(kwargs, "caller")) {
|
|
7496
|
+
frame.set("caller", kwargs.caller); }
|
|
7497
|
+
frame.set("params", l_params);
|
|
7498
|
+
var t_2 = "";env.getTemplate("utilities/govcyUtilities.njk", false, "elements/warning.njk", false, function(t_4,t_3) {
|
|
7499
|
+
if(t_4) { cb(t_4); return; }
|
|
7500
|
+
t_3.getExported(function(t_5,t_3) {
|
|
7501
|
+
if(t_5) { cb(t_5); return; }
|
|
7502
|
+
if(Object.prototype.hasOwnProperty.call(t_3, "govcyLocalizeContent")) {
|
|
7503
|
+
var t_6 = t_3.govcyLocalizeContent;
|
|
7504
|
+
} else {
|
|
7505
|
+
cb(new Error("cannot import 'govcyLocalizeContent'")); return;
|
|
7506
|
+
}
|
|
7507
|
+
context.setVariable("govcyLocalizeContent", t_6);
|
|
7508
|
+
if(Object.prototype.hasOwnProperty.call(t_3, "govcyLangAttribute")) {
|
|
7509
|
+
var t_7 = t_3.govcyLangAttribute;
|
|
7510
|
+
} else {
|
|
7511
|
+
cb(new Error("cannot import 'govcyLangAttribute'")); return;
|
|
7512
|
+
}
|
|
7513
|
+
context.setVariable("govcyLangAttribute", t_7);
|
|
7514
|
+
if(Object.prototype.hasOwnProperty.call(t_3, "govcyElementsFromArray")) {
|
|
7515
|
+
var t_8 = t_3.govcyElementsFromArray;
|
|
7516
|
+
} else {
|
|
7517
|
+
cb(new Error("cannot import 'govcyElementsFromArray'")); return;
|
|
7518
|
+
}
|
|
7519
|
+
context.setVariable("govcyElementsFromArray", t_8);
|
|
7520
|
+
if(Object.prototype.hasOwnProperty.call(t_3, "govcyGetContent")) {
|
|
7521
|
+
var t_9 = t_3.govcyGetContent;
|
|
7522
|
+
} else {
|
|
7523
|
+
cb(new Error("cannot import 'govcyGetContent'")); return;
|
|
7524
|
+
}
|
|
7525
|
+
context.setVariable("govcyGetContent", t_9);
|
|
7526
|
+
if(runtime.memberLookup((l_params),"text")) {
|
|
7527
|
+
t_2 += "\r\n<div ";
|
|
7528
|
+
if(runtime.memberLookup((l_params),"id")) {
|
|
7529
|
+
t_2 += "id=\"";
|
|
7530
|
+
t_2 += runtime.suppressValue(runtime.memberLookup((l_params),"id"), env.opts.autoescape);
|
|
7531
|
+
t_2 += "\" ";
|
|
7532
|
+
;
|
|
7533
|
+
}
|
|
7534
|
+
t_2 += "class=\"govcy-warning-text";
|
|
7535
|
+
if(runtime.memberLookup((l_params),"classes")) {
|
|
7536
|
+
t_2 += " ";
|
|
7537
|
+
t_2 += runtime.suppressValue(runtime.memberLookup((l_params),"classes"), env.opts.autoescape);
|
|
7538
|
+
;
|
|
7539
|
+
}
|
|
7540
|
+
t_2 += "\"";
|
|
7541
|
+
t_2 += runtime.suppressValue((lineno = 12, colno = 157, runtime.callWrap(t_7, "govcyLangAttribute", context, [runtime.memberLookup((l_params),"lang")])), env.opts.autoescape);
|
|
7542
|
+
t_2 += ">\r\n <span class=\"govcy-warning-text-icon\" aria-hidden=\"true\">!</span>\r\n <span class=\"govcy-warning-text-message\">\r\n <span class=\"govcy-visually-hidden\">";
|
|
7543
|
+
t_2 += runtime.suppressValue((lineno = 15, colno = 63, runtime.callWrap(t_9, "govcyGetContent", context, ["warning",runtime.memberLookup((l_params),"lang")])), env.opts.autoescape);
|
|
7544
|
+
t_2 += ":</span>\r\n ";
|
|
7545
|
+
t_2 += runtime.suppressValue((lineno = 16, colno = 31, runtime.callWrap(t_6, "govcyLocalizeContent", context, [runtime.memberLookup((l_params),"text"),runtime.memberLookup((l_params),"lang")])), env.opts.autoescape);
|
|
7546
|
+
t_2 += "</span>\r\n</div>\r\n";
|
|
7547
|
+
;
|
|
7548
|
+
}
|
|
7549
|
+
})});
|
|
7550
|
+
frame = callerFrame;
|
|
7551
|
+
return new runtime.SafeString(t_2);
|
|
7552
|
+
});
|
|
7553
|
+
context.addExport("warning");
|
|
7554
|
+
context.setVariable("warning", macro_t_1);
|
|
7555
|
+
if(parentTemplate) {
|
|
7556
|
+
parentTemplate.rootRenderFunc(env, context, frame, runtime, cb);
|
|
7557
|
+
} else {
|
|
7558
|
+
cb(null, output);
|
|
7559
|
+
}
|
|
7560
|
+
;
|
|
7561
|
+
} catch (e) {
|
|
7562
|
+
cb(runtime.handleError(e, lineno, colno));
|
|
7563
|
+
}
|
|
7564
|
+
}
|
|
7565
|
+
return {
|
|
7566
|
+
root: root
|
|
7567
|
+
};
|
|
7568
|
+
|
|
7569
|
+
})();
|
|
7570
|
+
})();
|
|
7571
|
+
|
|
7480
7572
|
(function() {(window.nunjucksPrecompiled = window.nunjucksPrecompiled || {})["govcyElement.njk"] = (function() {
|
|
7481
7573
|
function root(env, context, frame, runtime, cb) {
|
|
7482
7574
|
var lineno = 0;
|
|
@@ -7485,7 +7577,7 @@ var output = "";
|
|
|
7485
7577
|
try {
|
|
7486
7578
|
var parentTemplate = null;
|
|
7487
7579
|
var t_1;
|
|
7488
|
-
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","errorSummary","details","stepByStepStatic","progressList","userName"];
|
|
7580
|
+
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","errorSummary","details","stepByStepStatic","progressList","userName","warning"];
|
|
7489
7581
|
frame.set("macroSimpleBlocks", t_1, true);
|
|
7490
7582
|
if(frame.topLevel) {
|
|
7491
7583
|
context.setVariable("macroSimpleBlocks", t_1);
|
package/package.json
CHANGED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{# warning
|
|
2
|
+
@param {string} lang The language used. Can be 'en','el'. Optional.
|
|
3
|
+
@param {string} id The id of the warning. Will escape text. Optional
|
|
4
|
+
@param {object} text The text. Will escape text, Example `{en:"Content",el:"Περιεχομένο"}`
|
|
5
|
+
@param {string} classes Additional classes to add to the outer `<details>`. Optional
|
|
6
|
+
@returns govcy details html
|
|
7
|
+
#}
|
|
8
|
+
{% macro warning(params) -%}
|
|
9
|
+
{#- Import localizer from utilities -#}
|
|
10
|
+
{%- from "../utilities/govcyUtilities.njk" import govcyLocalizeContent, govcyLangAttribute, govcyElementsFromArray, govcyGetContent -%}
|
|
11
|
+
{#- text is mandatory -#}
|
|
12
|
+
{%- if params.text %}
|
|
13
|
+
<div {% if params.id %}id="{{ params.id }}" {% endif %}class="govcy-warning-text{% if params.classes %} {{ params.classes }}{% endif %}"{{ govcyLangAttribute(params.lang) }}>
|
|
14
|
+
<span class="govcy-warning-text-icon" aria-hidden="true">!</span>
|
|
15
|
+
<span class="govcy-warning-text-message">
|
|
16
|
+
<span class="govcy-visually-hidden">{{- govcyGetContent('warning', params.lang) -}}:</span>
|
|
17
|
+
{{ govcyLocalizeContent(params.text, params.lang) }}</span>
|
|
18
|
+
</div>
|
|
19
|
+
{% endif %}
|
|
20
|
+
{%- endmacro %}
|
package/src/njk/govcyElement.njk
CHANGED
|
@@ -26,7 +26,7 @@ To use:
|
|
|
26
26
|
'errorMessage','select','textElement','htmlElement','textInput','radios','checkboxes',
|
|
27
27
|
'fileInput','fileView','backLink','tag','table', 'summaryList', 'textArea','markdown',
|
|
28
28
|
'panel', 'datePicker','dateInput', 'taskList', 'errorSummary', 'details', 'stepByStepStatic',
|
|
29
|
-
'progressList', 'userName'] -%}
|
|
29
|
+
'progressList', 'userName', 'warning'] -%}
|
|
30
30
|
{%- set macroCallerBlocks = ['formControl','form','fieldset'] -%}
|
|
31
31
|
{%- macro govcyElement(component, params) -%}
|
|
32
32
|
{#- Simple blocks -#}
|
|
@@ -75,7 +75,8 @@
|
|
|
75
75
|
textArea_wordRemaining: {en:"You have <span></span> words remaining",el:"Έχετε <span></span> λέξεις που απομένουν"},
|
|
76
76
|
textArea_wordsExceeding: {en:"You have entered <span></span> words more",el:"Έχετε περάσει <span></span> λέξεις περισσότερες"},
|
|
77
77
|
userName_signOut: {en:'Sign out',el:'Αποσύνδεση'},
|
|
78
|
-
userName_fromUser: {en:'from user',el:'από το χρήστη'}
|
|
78
|
+
userName_fromUser: {en:'from user',el:'από το χρήστη'},
|
|
79
|
+
warning: {en:'Warning',el:'Προσοχή'}
|
|
79
80
|
} -%}
|
|
80
81
|
{# Set default values #}
|
|
81
82
|
{#- Set the language with priority: lang > globalData.site.lang > 'el' -#}
|