@qld-gov-au/qgds-bootstrap5 1.1.39 → 1.1.40

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.
Files changed (99) hide show
  1. package/dist/assets/components/bs5/backToTop/backToTop.hbs +1 -1
  2. package/dist/assets/components/bs5/breadcrumbs/breadcrumbs.hbs +19 -15
  3. package/dist/assets/components/bs5/contentFooter/contentFooter.hbs +15 -4
  4. package/dist/assets/components/bs5/head/head.hbs +1 -1
  5. package/dist/assets/components/bs5/logo/logo.hbs +7 -0
  6. package/dist/assets/components/bs5/logo/logoCOALandscape.hbs +58 -0
  7. package/dist/assets/components/bs5/logo/logoCOALandscape2Lines.hbs +58 -0
  8. package/dist/assets/components/bs5/pageLayout/pageLayout.hbs +11 -10
  9. package/dist/assets/components/bs5/pageLayout/templates/contentPageWithForm.hbs +78 -0
  10. package/dist/assets/components/bs5/pageLayout/templates/contentPageWithSideNavigation.hbs +103 -0
  11. package/dist/assets/components/bs5/pageLayout/templates/fullWidthLandingPage.hbs +61 -0
  12. package/dist/assets/css/qld.bootstrap.css +1 -1
  13. package/dist/assets/css/qld.bootstrap.css.map +3 -3
  14. package/dist/assets/js/handlebars.helpers.bundle.js +1 -1
  15. package/dist/assets/js/handlebars.helpers.bundle.js.map +3 -3
  16. package/dist/assets/js/handlebars.helpers.js +51 -40
  17. package/dist/assets/js/handlebars.init.min.js +441 -65
  18. package/dist/assets/js/handlebars.init.min.js.map +4 -4
  19. package/dist/assets/js/handlebars.partials.js +12 -0
  20. package/dist/assets/js/qld.bootstrap.min.js +5 -5
  21. package/dist/assets/js/qld.bootstrap.min.js.map +4 -4
  22. package/dist/assets/node/handlebars.init.min.js +173 -38
  23. package/dist/assets/node/handlebars.init.min.js.map +3 -3
  24. package/dist/components/bs5/backToTop/backToTop.hbs +1 -1
  25. package/dist/components/bs5/breadcrumbs/breadcrumbs.hbs +19 -15
  26. package/dist/components/bs5/contentFooter/contentFooter.hbs +15 -4
  27. package/dist/components/bs5/head/head.hbs +1 -1
  28. package/dist/components/bs5/logo/logo.hbs +7 -0
  29. package/dist/components/bs5/logo/logoCOALandscape.hbs +58 -0
  30. package/dist/components/bs5/logo/logoCOALandscape2Lines.hbs +58 -0
  31. package/dist/components/bs5/pageLayout/pageLayout.hbs +11 -10
  32. package/dist/components/bs5/pageLayout/templates/contentPageWithForm.hbs +78 -0
  33. package/dist/components/bs5/pageLayout/templates/contentPageWithSideNavigation.hbs +103 -0
  34. package/dist/components/bs5/pageLayout/templates/fullWidthLandingPage.hbs +61 -0
  35. package/dist/components/handlebars.helpers.js +51 -40
  36. package/dist/components/handlebars.partials.js +12 -0
  37. package/dist/package.json +1 -1
  38. package/dist/sample-data/breadcrumbs/breadcrumbs.data.json +113 -49
  39. package/dist/sample-data/contentFooter/contentFooter.data.json +9 -1
  40. package/dist/sample-data/logo/logo.data.json +6 -0
  41. package/package.json +1 -1
  42. package/src/components/bs5/backToTop/backToTop.hbs +1 -1
  43. package/src/components/bs5/banner/banner.scss +52 -46
  44. package/src/components/bs5/breadcrumbs/__snapshots__/breadcrumbs.test.js.snap +49 -0
  45. package/src/components/bs5/breadcrumbs/breadcrumbs.data.json +113 -49
  46. package/src/components/bs5/breadcrumbs/breadcrumbs.functions.js +167 -0
  47. package/src/components/bs5/breadcrumbs/breadcrumbs.hbs +19 -15
  48. package/src/components/bs5/breadcrumbs/breadcrumbs.scss +164 -43
  49. package/src/components/bs5/breadcrumbs/breadcrumbs.stories.js +16 -2
  50. package/src/components/bs5/breadcrumbs/breadcrumbs.test.js +136 -0
  51. package/src/components/bs5/button/button.scss +308 -248
  52. package/src/components/bs5/button/button.stories.js +97 -30
  53. package/src/components/bs5/contentFooter/contentFooter.data.json +9 -1
  54. package/src/components/bs5/contentFooter/contentFooter.hbs +15 -4
  55. package/src/components/bs5/logo/Logo.js +20 -0
  56. package/src/components/bs5/logo/Logo.mdx +10 -0
  57. package/src/components/bs5/logo/logo.data.json +6 -0
  58. package/src/components/bs5/logo/logo.hbs +7 -0
  59. package/src/components/bs5/logo/logo.stories.js +32 -0
  60. package/src/components/bs5/logo/logoCOALandscape.hbs +58 -0
  61. package/src/components/bs5/logo/logoCOALandscape2Lines.hbs +58 -0
  62. package/src/components/bs5/pageLayout/ContentPageWithForm.js +8 -0
  63. package/src/components/bs5/pageLayout/ContentPageWithSideNavigation.js +8 -0
  64. package/src/components/bs5/pageLayout/FullWidthLandingPage.js +8 -0
  65. package/src/components/bs5/pageLayout/pageLayout.hbs +11 -10
  66. package/src/components/bs5/pageLayout/pageLayout.stories.js +230 -6
  67. package/src/components/bs5/pageLayout/templates/contentPageWithForm.hbs +78 -0
  68. package/src/components/bs5/pageLayout/templates/contentPageWithSideNavigation.hbs +103 -0
  69. package/src/components/bs5/pageLayout/templates/fullWidthLandingPage.hbs +61 -0
  70. package/src/components/bs5/searchInput/searchInput.test.js +2 -2
  71. package/src/components/bs5/sidenav/sidenav.stories.js +17 -15
  72. package/src/components/common/footer/footer.scss +137 -140
  73. package/src/css/main.scss +0 -1
  74. package/src/js/handlebars.helpers.js +51 -40
  75. package/src/js/handlebars.partials.js +12 -0
  76. package/src/js/qld.bootstrap.js +17 -9
  77. package/src/components/bs5/backToTop/backToTop.scss +0 -9
  78. package/src/components/bs5/breadcrumbs/breadcrumb.functions.js +0 -95
  79. package/src/components/bs5/breadcumbsWrapper/breadcrumbsWrapper.stories.js +0 -34
  80. package/src/components/bs5/contentFooterWrapper/contentFooterWrapper.stories.js +0 -36
  81. package/src/components/bs5/contentWrapper/contentWrapper.stories.js +0 -65
  82. package/src/components/bs5/fullPageWrapper/fullPage.stories.js +0 -63
  83. package/src/components/bs5/mainContainerWrapper/mainContainerWrapper.stories.js +0 -50
  84. package/src/components/bs5/sidenavWrapper/SidenavWrapper.mdx +0 -11
  85. package/src/components/bs5/sidenavWrapper/sidenavWrapper.stories.js +0 -65
  86. package/src/stories/integration/MainIntegration.js +0 -28
  87. package/src/stories/integration/MainIntegration.mdx +0 -10
  88. package/src/stories/integration/breadcrumb.data.json +0 -28
  89. package/src/stories/integration/content.data.json +0 -3
  90. package/src/stories/integration/contentFooter.data.json +0 -3
  91. package/src/stories/integration/footer.data.json +0 -111
  92. package/src/stories/integration/globalAlert.data.json +0 -10
  93. package/src/stories/integration/header.data.json +0 -173
  94. package/src/stories/integration/inpagenav.data.json +0 -26
  95. package/src/stories/integration/integration.stories.js +0 -147
  96. package/src/stories/integration/main.hbs +0 -13
  97. package/src/stories/integration/navigation.data.json +0 -22
  98. package/src/stories/integration/search.data.json +0 -20
  99. package/src/stories/integration/sidenav.data.json +0 -88
@@ -1,2 +1,2 @@
1
- "use strict";(()=>{function g(n){n.registerHelper("contains",function(e,t,i){return e=n.escapeExpression(e),t=n.escapeExpression(t),t.indexOf(e)>-1?i.fn(this):i.inverse(this)}),n.registerHelper("ifCond",function(e,t,i,r){switch(t){case"==":return e==i?r.fn(this):r.inverse(this);case"===":return e===i?r.fn(this):r.inverse(this);case"!=":return e!=i?r.fn(this):r.inverse(this);case"!==":return e!==i?r.fn(this):r.inverse(this);case"<":return e<i?r.fn(this):r.inverse(this);case"<=":return e<=i?r.fn(this):r.inverse(this);case">":return e>i?r.fn(this):r.inverse(this);case">=":return e>=i?r.fn(this):r.inverse(this);case"&&":return e&&i?r.fn(this):r.inverse(this);case"||":return e||i?r.fn(this):r.inverse(this);case"contains":return typeof e=="string"&&typeof i=="string"?e.toLowerCase().indexOf(i.toLowerCase())>=0?r.fn(this):r.inverse(this):r.inverse(this);default:return r.inverse(this)}}),n.registerHelper("isType",function(e,t,i){return e===t?i.fn(this):i.inverse(this)}),n.registerHelper("ifAny",function(...e){let t=e.pop();return e.some(i=>!!i)?t.fn(this):t.inverse(this)}),n.registerHelper("now",function(){return new Date().toISOString()}),n.registerHelper("formatDate",function(e,t,i){let r;if(e&&(r=new Date(e)),isNaN(r)&&t&&(r=new Date(t)),isNaN(r))return"Invalid Date";var s=["January","February","March","April","May","June","July","August","September","October","November","December"],u=r.getDate(),f=s[r.getMonth()],c=r.getFullYear();switch(i){case"YYYY":return`${c}`;case"MMMM YYYY":return`${f} ${c}`;default:return`${u} ${f} ${c}`}}),n.registerHelper("formatDateOrToday",function(e,t){let i=e||new Date().toISOString();return n.helpers.formatDate(e,i,t)}),n.registerHelper("formatDuration",function(e,t){if(!e)return"";if(typeof e=="string"&&t!=="long")return e;let i="",r=[],s,u,f;if(typeof e=="string"){let c=e.split(":");f=c[0],c.length==2?[u="",f=""]=c:c.length==3&&([s="",u="",f=""]=c)}else[s="",u="",f=""]=e;return t==="long"?(s>0&&r.push(`${s} hour${s>1?"s":""}`),u>0&&r.push(`${u} minute${u>1?"s":""}`),f>0&&r.push(`${f} second${f>1?"s":""}`),i=r.join(" ")):(s>0&&r.push(s.toString().padStart(2,0)),r.push(u.toString().padStart(2,0)),r.push(f.toString().padStart(2,0)),i=r.join(":")),i}),n.registerHelper("isdefined",function(e,t){return e!==void 0?e:t}),n.registerHelper("isdefined",function(e,t){return e!==void 0&&e!==""?e:t}),n.registerHelper("getClassNames",function(e,t){let i=e.split(",").map(s=>s.trim()),r=[];for(let s=0;s<i.length;s++){let u=i[s];if(t){for(let f=0;f<t.length;f++)if(t[f][u]===!0){r.push(u);break}}}return r.length>0?r.join(" "):""}),n.registerHelper("join",function(e,t){return(!t||typeof t!="string")&&(t=" "),Array.isArray(e)?e.join(t):e}),n.registerHelper("toCamelCase",function(e){return typeof e!="string"?e:e.toLowerCase().replace(/(?:^\w|[A-Z]|\b\w|\s+)/g,(t,i)=>i===0?t.toLowerCase():t.toUpperCase()).replace(/\s+/g,"")})}typeof Handlebars!="undefined"&&g(Handlebars);})();
1
+ "use strict";(()=>{function l(i,t,r,e){switch(t){case"==":return i==r?e.fn(this):e.inverse(this);case"===":return i===r?e.fn(this):e.inverse(this);case"!=":return i!=r?e.fn(this):e.inverse(this);case"!==":return i!==r?e.fn(this):e.inverse(this);case"<":return i<r?e.fn(this):e.inverse(this);case"<=":return i<=r?e.fn(this):e.inverse(this);case">":return i>r?e.fn(this):e.inverse(this);case">=":return i>=r?e.fn(this):e.inverse(this);case"&&":return i&&r?e.fn(this):e.inverse(this);case"||":return i||r?e.fn(this):e.inverse(this);case"contains":return typeof i=="string"&&typeof r=="string"?i.toLowerCase().indexOf(r.toLowerCase())>=0?e.fn(this):e.inverse(this):e.inverse(this);default:return e.inverse(this)}}function g(i){i.registerHelper("contains",function(t,r,e){return t=i.escapeExpression(t),r=i.escapeExpression(r),r.indexOf(t)>-1?e.fn(this):e.inverse(this)}),i.registerHelper("ifCond",l),i.registerHelper("isType",function(t,r,e){return t===r?e.fn(this):e.inverse(this)}),i.registerHelper("ifAny",function(...t){let r=t.pop();return t.some(e=>!!e)?r.fn(this):r.inverse(this)}),i.registerHelper("now",function(){return new Date().toISOString()}),i.registerHelper("formatDate",function(t,r,e){let n;if(t&&(n=new Date(t)),isNaN(n)&&r&&(n=new Date(r)),isNaN(n))return"Invalid Date";var s=["January","February","March","April","May","June","July","August","September","October","November","December"],u=n.getDate(),f=s[n.getMonth()],c=n.getFullYear();switch(e){case"YYYY":return`${c}`;case"MMMM YYYY":return`${f} ${c}`;default:return`${u} ${f} ${c}`}}),i.registerHelper("formatDateOrToday",function(t,r){let e=t||new Date().toISOString();return i.helpers.formatDate(t,e,r)}),i.registerHelper("formatDuration",function(t,r){if(!t)return"";if(typeof t=="string"&&r!=="long")return t;let e="",n=[],s,u,f;if(typeof t=="string"){let c=t.split(":");f=c[0],c.length==2?[u="",f=""]=c:c.length==3&&([s="",u="",f=""]=c)}else[s="",u="",f=""]=t;return r==="long"?(s>0&&n.push(`${s} hour${s>1?"s":""}`),u>0&&n.push(`${u} minute${u>1?"s":""}`),f>0&&n.push(`${f} second${f>1?"s":""}`),e=n.join(" ")):(s>0&&n.push(s.toString().padStart(2,0)),n.push(u.toString().padStart(2,0)),n.push(f.toString().padStart(2,0)),e=n.join(":")),e}),i.registerHelper("isdefined",function(t,r){return t!==void 0&&t!==""?t:r}),i.registerHelper("getClassNames",function(t,r){let e=t.split(",").map(s=>s.trim()),n=[];for(let s=0;s<e.length;s++){let u=e[s];if(r){for(let f=0;f<r.length;f++)if(r[f][u]===!0){n.push(u);break}}}return n.length>0?n.join(" "):""}),i.registerHelper("join",function(t,r){return(!r||typeof r!="string")&&(r=" "),Array.isArray(t)?t.join(r):t}),i.registerHelper("toCamelCase",function(t){return typeof t!="string"?t:t.toLowerCase().replace(/(?:^\w|[A-Z]|\b\w|\s+)/g,(r,e)=>e===0?r.toLowerCase():r.toUpperCase()).replace(/\s+/g,"")})}typeof Handlebars!="undefined"&&g(Handlebars);})();
2
2
  //# sourceMappingURL=handlebars.helpers.bundle.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/js/handlebars.helpers.js"],
4
- "sourcesContent": ["/* global Handlebars */\n/**\n * Registers Handlebars Helpers\n * @param {Handlebars} handlebars Templating engine\n * @returns {void} Result of the helper operation\n */\n\nexport default function handlebarsHelpers(handlebars) {\n // contains - if first object is in collection (second object) to return true\n handlebars.registerHelper(\"contains\", function (needle, haystack, options) {\n needle = handlebars.escapeExpression(needle);\n haystack = handlebars.escapeExpression(haystack);\n return haystack.indexOf(needle) > -1\n ? options.fn(this)\n : options.inverse(this);\n });\n // ifCond - checks conditions\n handlebars.registerHelper(\"ifCond\", function (v1, operator, v2, options) {\n switch (operator) {\n case \"==\":\n return v1 == v2 ? options.fn(this) : options.inverse(this);\n case \"===\":\n return v1 === v2 ? options.fn(this) : options.inverse(this);\n case \"!=\":\n return v1 != v2 ? options.fn(this) : options.inverse(this);\n case \"!==\":\n return v1 !== v2 ? options.fn(this) : options.inverse(this);\n case \"<\":\n return v1 < v2 ? options.fn(this) : options.inverse(this);\n case \"<=\":\n return v1 <= v2 ? options.fn(this) : options.inverse(this);\n case \">\":\n return v1 > v2 ? options.fn(this) : options.inverse(this);\n case \">=\":\n return v1 >= v2 ? options.fn(this) : options.inverse(this);\n case \"&&\":\n return v1 && v2 ? options.fn(this) : options.inverse(this);\n case \"||\":\n return v1 || v2 ? options.fn(this) : options.inverse(this);\n case \"contains\":\n if (typeof v1 == \"string\" && typeof v2 == \"string\") {\n return v1.toLowerCase().indexOf(v2.toLowerCase()) >= 0\n ? options.fn(this)\n : options.inverse(this);\n } else return options.inverse(this);\n default:\n return options.inverse(this);\n }\n });\n // isType - Checks is expected type\n handlebars.registerHelper(\"isType\", function (value, expected, options) {\n if (value === expected) {\n return options.fn(this); // Render the block if condition is true\n } else {\n return options.inverse(this); // Render the else block if present\n }\n });\n // ifAny - {{{#ifAny variable1 variable2 variable3 variable4 etc}}, if any set then return true\n handlebars.registerHelper(\"ifAny\", function (...args) {\n const options = args.pop(); // The last argument is the options object\n return args.some((arg) => !!arg) ? options.fn(this) : options.inverse(this);\n });\n // now - return current timestamp i.e {{now}}\n handlebars.registerHelper(\"now\", function () {\n return new Date().toISOString();\n });\n // formatDate - Format Date, for footer meta data i.e {{formatDate '2023-06-23'}}\n handlebars.registerHelper(\n \"formatDate\",\n function (dateString, defaultDate, format) {\n // Use the dateString if provided, otherwise use the defaultDate, otherwise error\n let date;\n if (dateString) {\n date = new Date(dateString);\n }\n if (isNaN(date) && defaultDate) {\n date = new Date(defaultDate);\n }\n\n // Check if the date is valid\n if (isNaN(date)) {\n return \"Invalid Date\";\n }\n\n var monthNames = [\n \"January\",\n \"February\",\n \"March\",\n \"April\",\n \"May\",\n \"June\",\n \"July\",\n \"August\",\n \"September\",\n \"October\",\n \"November\",\n \"December\",\n ];\n var day = date.getDate();\n var month = monthNames[date.getMonth()];\n var year = date.getFullYear();\n // Format date based on the format string\n switch (format) {\n case \"YYYY\":\n return `${year}`;\n case \"MMMM YYYY\":\n return `${month} ${year}`;\n default:\n return `${day} ${month} ${year}`;\n }\n },\n );\n\n // formatDateOrToday - Format Date if passed or today i.e. {{formatDateOrToday '2023-06-23'}} or {{formatDateOrToday}} <!-- This will use the current date -->\n handlebars.registerHelper(\"formatDateOrToday\", function (dateString, format) {\n // Use the current date if dateString is missing or invalid\n const dateToFormat = dateString || new Date().toISOString();\n // Call the formatDate helper with the determined date and format\n return handlebars.helpers.formatDate(dateString, dateToFormat, format);\n });\n\n /**\n * Format time duration into a string.\n *\n * Supports two formats: \"short\" and \"long\".\n * - Short format: Display the duration in simplified format of \"HH:MM:SS\". It is the default format.\n * - Long format: Display the duration in descriptive format of \"X hours Y minutes Z seconds\".\n *\n * @param {Object | String} duration - Duration object with properties: 'hours', 'minutes', and 'seconds'. Duration string: \"HH:MM:SS\".\n * @param {String} format - Option for format type 'short' or 'long'. If none provided, 'short' is the defaut value.\n *\n * @returns {String} Formatted duration\n * Examples:\n * - 03:00:00 - 3 hours\n * - 03:15:00 - 3 hours 15 minutes\n * - 01:30:45 - 1 hour 30 minutes 45 seconds\n * - 02:00:45 - 2 hours 45 seconds\n * - 07:12 - 7 minutes 12 seconds\n * - 00:45 - 45 seconds\n *\n * Usage:\n * {{formatDuration duration}}\n * {{formatDuration duration \"long\"}}\n */\n handlebars.registerHelper(\"formatDuration\", function (duration, format) {\n // Return empty string when there is no duration.\n if (!duration) {\n return \"\";\n }\n\n // Nothing to process here when the duration is already in short format string\n // (to support existing CMS metadata).\n if (typeof duration === \"string\" && format !== \"long\") {\n return duration;\n }\n\n let durationString = \"\";\n let parts = [];\n let hours, minutes, seconds;\n\n // Support for string type 'duration'.\n if (typeof duration === \"string\") {\n const durationSplit = duration.split(\":\");\n seconds = durationSplit[0];\n if (durationSplit.length == 2) {\n [minutes = \"\", seconds = \"\"] = durationSplit;\n } else if (durationSplit.length == 3) {\n [hours = \"\", minutes = \"\", seconds = \"\"] = durationSplit;\n }\n } else {\n // Support for object type 'duration'.\n [hours = \"\", minutes = \"\", seconds = \"\"] = duration;\n }\n\n // Long format: \"X hours Y minutes Z seconds\"\n if (format === \"long\") {\n if (hours > 0) {\n parts.push(`${hours} hour${hours > 1 ? \"s\" : \"\"}`);\n }\n if (minutes > 0) {\n parts.push(`${minutes} minute${minutes > 1 ? \"s\" : \"\"}`);\n }\n if (seconds > 0) {\n parts.push(`${seconds} second${seconds > 1 ? \"s\" : \"\"}`);\n }\n durationString = parts.join(\" \");\n\n // Short format: \"HH:MM:SS\"\n } else {\n // Omitting hours when zero\n if (hours > 0) {\n parts.push(hours.toString().padStart(2, 0));\n }\n parts.push(minutes.toString().padStart(2, 0));\n parts.push(seconds.toString().padStart(2, 0));\n durationString = parts.join(\":\");\n }\n return durationString;\n });\n\n // helper for extending components to set overridable data values\n // if the value is not set in the component data.json, it will use the hds data value\n handlebars.registerHelper('isdefined', function (value, defaultValue) {\n return value !== undefined ? value : defaultValue;\n });\n\n /**\n * Helper for extending components to set overridable data values\n * If the value is not set in the component data.json, it will use the hds data value\n * \n * @param {string} value - The value to check if it is defined\n * @param {string} defaultValue - The default value to return if value is not defined\n * @returns {string} - The value if it is defined, otherwise the default value\n */\n handlebars.registerHelper('isdefined', function (value, defaultValue) {\n return value !== undefined && value !== \"\" ? value : defaultValue;\n });\n\n /**\n * Used to get class names added to an element based on their boolean values in an array\n * \n * @param {string} names - Comma-separated list of class names to check for\n * @param {array} array - Array of objects to check for true values\n * @returns {string} - Space-separated list of class names that have true values\n */\n handlebars.registerHelper(\"getClassNames\", function (names, array) {\n // Split the comma-separated string of names into an array\n let nameList = names.split(\",\").map((name) => name.trim());\n\n // Create an array to hold the names that have true values\n let matchedItems = [];\n\n for (let i = 0; i < nameList.length; i++) {\n let name = nameList[i];\n // Check if any item in the array matches the name and is true\n if(array){\n for (let j = 0; j < array.length; j++) {\n if (array[j][name] === true) {\n matchedItems.push(name); // Add to matchedItems if found and true\n break;\n }\n }\n }\n }\n\n // If we found any matched items, return them as a space-separated string\n if (matchedItems.length > 0) {\n return matchedItems.join(\" \");\n } else {\n return \"\";\n }\n });\n\n\n handlebars.registerHelper(\"join\", function (theArray, separator) {\n // Handle if a separator is not provided\n if (!separator || typeof separator !== \"string\") {\n separator = \" \";\n }\n \n // If theArray is not an array, return it as is, otherwise join it\n return !Array.isArray(theArray) ? theArray : theArray.join(separator);\n });\n \n handlebars.registerHelper('toCamelCase', function (text) {\n if (typeof text !== 'string') return text;\n\n // Remove whitespace and convert to camelCase\n return text\n .toLowerCase()\n .replace(/(?:^\\w|[A-Z]|\\b\\w|\\s+)/g, (match, index) =>\n index === 0 ? match.toLowerCase() : match.toUpperCase(),\n )\n .replace(/\\s+/g, ''); // Remove all spaces\n });\n\n}\n\nif (typeof Handlebars !== \"undefined\") {\n handlebarsHelpers(Handlebars);\n}\n"],
5
- "mappings": "mBAOe,SAARA,EAAmCC,EAAY,CAEpDA,EAAW,eAAe,WAAY,SAAUC,EAAQC,EAAUC,EAAS,CACzE,OAAAF,EAASD,EAAW,iBAAiBC,CAAM,EAC3CC,EAAWF,EAAW,iBAAiBE,CAAQ,EACxCA,EAAS,QAAQD,CAAM,EAAI,GAC9BE,EAAQ,GAAG,IAAI,EACfA,EAAQ,QAAQ,IAAI,CAC1B,CAAC,EAEDH,EAAW,eAAe,SAAU,SAAUI,EAAIC,EAAUC,EAAIH,EAAS,CACvE,OAAQE,EAAU,CAClB,IAAK,KACH,OAAOD,GAAME,EAAKH,EAAQ,GAAG,IAAI,EAAIA,EAAQ,QAAQ,IAAI,EAC3D,IAAK,MACH,OAAOC,IAAOE,EAAKH,EAAQ,GAAG,IAAI,EAAIA,EAAQ,QAAQ,IAAI,EAC5D,IAAK,KACH,OAAOC,GAAME,EAAKH,EAAQ,GAAG,IAAI,EAAIA,EAAQ,QAAQ,IAAI,EAC3D,IAAK,MACH,OAAOC,IAAOE,EAAKH,EAAQ,GAAG,IAAI,EAAIA,EAAQ,QAAQ,IAAI,EAC5D,IAAK,IACH,OAAOC,EAAKE,EAAKH,EAAQ,GAAG,IAAI,EAAIA,EAAQ,QAAQ,IAAI,EAC1D,IAAK,KACH,OAAOC,GAAME,EAAKH,EAAQ,GAAG,IAAI,EAAIA,EAAQ,QAAQ,IAAI,EAC3D,IAAK,IACH,OAAOC,EAAKE,EAAKH,EAAQ,GAAG,IAA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C,EAAOC,IAC1CA,IAAU,EAAID,EAAM,YAAY,EAAIA,EAAM,YAAY,CACxD,EACC,QAAQ,OAAQ,EAAE,CACvB,CAAC,CAEH,CAEI,OAAO,YAAe,aACxBvC,EAAkB,UAAU",
6
- "names": ["handlebarsHelpers", "handlebars", "needle", "haystack", "options", "v1", "operator", "v2", "value", "expected", "args", "arg", "dateString", "defaultDate", "format", "date", "monthNames", "day", "month", "year", "dateToFormat", "duration", "durationString", "parts", "hours", "minutes", "seconds", "durationSplit", "defaultValue", "names", "array", "nameList", "name", "matchedItems", "i", "j", "theArray", "separator", "text", "match", "index"]
4
+ "sourcesContent": ["/* global Handlebars */\n\n/**\n *\n * @param {*} v1 The left value\n * @param { \"==\" | \"===\" | \"!=\" | \"!==\" | \"<\" | \"<=\" | \">\" | \">=\" | \"&&\" | \"||\" | \"contains\"} operator the operator to handle comparison\n * @param {*} v2 The right value\n * @param {Object} options handlebars-provided options object\n * @returns {string} handlebars template block string\n * @example\n * {{#ifCond value1 \"===\" value2}}\n * <!-- Content to render if condition is true -->\n * <p>Value1 is strictly equal to Value2</p>\n * {{else}}\n * <!-- Content to render if condition is false -->\n * <p>Value1 is not strictly equal to Value2</p>\n * {{/ifCond}}\n */\nfunction ifCond(v1, operator, v2, options) {\n switch (operator) {\n case \"==\":\n return v1 == v2 ? options.fn(this) : options.inverse(this);\n case \"===\":\n return v1 === v2 ? options.fn(this) : options.inverse(this);\n case \"!=\":\n return v1 != v2 ? options.fn(this) : options.inverse(this);\n case \"!==\":\n return v1 !== v2 ? options.fn(this) : options.inverse(this);\n case \"<\":\n return v1 < v2 ? options.fn(this) : options.inverse(this);\n case \"<=\":\n return v1 <= v2 ? options.fn(this) : options.inverse(this);\n case \">\":\n return v1 > v2 ? options.fn(this) : options.inverse(this);\n case \">=\":\n return v1 >= v2 ? options.fn(this) : options.inverse(this);\n case \"&&\":\n return v1 && v2 ? options.fn(this) : options.inverse(this);\n case \"||\":\n return v1 || v2 ? options.fn(this) : options.inverse(this);\n case \"contains\":\n if (typeof v1 == \"string\" && typeof v2 == \"string\") {\n return v1.toLowerCase().indexOf(v2.toLowerCase()) >= 0\n ? options.fn(this)\n : options.inverse(this);\n } else return options.inverse(this);\n default:\n return options.inverse(this);\n }\n}\n/**\n * Registers Handlebars Helpers\n * @param {Handlebars} handlebars Templating engine\n * @returns {void} Result of the helper operation\n */\n\nexport default function handlebarsHelpers(handlebars) {\n // contains - if first object is in collection (second object) to return true\n handlebars.registerHelper(\"contains\", function (needle, haystack, options) {\n needle = handlebars.escapeExpression(needle);\n haystack = handlebars.escapeExpression(haystack);\n return haystack.indexOf(needle) > -1\n ? options.fn(this)\n : options.inverse(this);\n });\n\n handlebars.registerHelper(\"ifCond\", ifCond);\n\n // isType - Checks is expected type\n handlebars.registerHelper(\"isType\", function (value, expected, options) {\n if (value === expected) {\n return options.fn(this); // Render the block if condition is true\n } else {\n return options.inverse(this); // Render the else block if present\n }\n });\n // ifAny - {{{#ifAny variable1 variable2 variable3 variable4 etc}}, if any set then return true\n handlebars.registerHelper(\"ifAny\", function (...args) {\n const options = args.pop(); // The last argument is the options object\n return args.some((arg) => !!arg) ? options.fn(this) : options.inverse(this);\n });\n // now - return current timestamp i.e {{now}}\n handlebars.registerHelper(\"now\", function () {\n return new Date().toISOString();\n });\n // formatDate - Format Date, for footer meta data i.e {{formatDate '2023-06-23'}}\n handlebars.registerHelper(\n \"formatDate\",\n function (dateString, defaultDate, format) {\n // Use the dateString if provided, otherwise use the defaultDate, otherwise error\n let date;\n if (dateString) {\n date = new Date(dateString);\n }\n if (isNaN(date) && defaultDate) {\n date = new Date(defaultDate);\n }\n\n // Check if the date is valid\n if (isNaN(date)) {\n return \"Invalid Date\";\n }\n\n var monthNames = [\n \"January\",\n \"February\",\n \"March\",\n \"April\",\n \"May\",\n \"June\",\n \"July\",\n \"August\",\n \"September\",\n \"October\",\n \"November\",\n \"December\",\n ];\n var day = date.getDate();\n var month = monthNames[date.getMonth()];\n var year = date.getFullYear();\n // Format date based on the format string\n switch (format) {\n case \"YYYY\":\n return `${year}`;\n case \"MMMM YYYY\":\n return `${month} ${year}`;\n default:\n return `${day} ${month} ${year}`;\n }\n },\n );\n\n // formatDateOrToday - Format Date if passed or today i.e. {{formatDateOrToday '2023-06-23'}} or {{formatDateOrToday}} <!-- This will use the current date -->\n handlebars.registerHelper(\"formatDateOrToday\", function (dateString, format) {\n // Use the current date if dateString is missing or invalid\n const dateToFormat = dateString || new Date().toISOString();\n // Call the formatDate helper with the determined date and format\n return handlebars.helpers.formatDate(dateString, dateToFormat, format);\n });\n\n /**\n * Format time duration into a string.\n *\n * Supports two formats: \"short\" and \"long\".\n * - Short format: Display the duration in simplified format of \"HH:MM:SS\". It is the default format.\n * - Long format: Display the duration in descriptive format of \"X hours Y minutes Z seconds\".\n *\n * @param {Object | String} duration - Duration object with properties: 'hours', 'minutes', and 'seconds'. Duration string: \"HH:MM:SS\".\n * @param {String} format - Option for format type 'short' or 'long'. If none provided, 'short' is the defaut value.\n *\n * @returns {String} Formatted duration\n * Examples:\n * - 03:00:00 - 3 hours\n * - 03:15:00 - 3 hours 15 minutes\n * - 01:30:45 - 1 hour 30 minutes 45 seconds\n * - 02:00:45 - 2 hours 45 seconds\n * - 07:12 - 7 minutes 12 seconds\n * - 00:45 - 45 seconds\n *\n * Usage:\n * {{formatDuration duration}}\n * {{formatDuration duration \"long\"}}\n */\n handlebars.registerHelper(\"formatDuration\", function (duration, format) {\n // Return empty string when there is no duration.\n if (!duration) {\n return \"\";\n }\n\n // Nothing to process here when the duration is already in short format string\n // (to support existing CMS metadata).\n if (typeof duration === \"string\" && format !== \"long\") {\n return duration;\n }\n\n let durationString = \"\";\n let parts = [];\n let hours, minutes, seconds;\n\n // Support for string type 'duration'.\n if (typeof duration === \"string\") {\n const durationSplit = duration.split(\":\");\n seconds = durationSplit[0];\n if (durationSplit.length == 2) {\n [minutes = \"\", seconds = \"\"] = durationSplit;\n } else if (durationSplit.length == 3) {\n [hours = \"\", minutes = \"\", seconds = \"\"] = durationSplit;\n }\n } else {\n // Support for object type 'duration'.\n [hours = \"\", minutes = \"\", seconds = \"\"] = duration;\n }\n\n // Long format: \"X hours Y minutes Z seconds\"\n if (format === \"long\") {\n if (hours > 0) {\n parts.push(`${hours} hour${hours > 1 ? \"s\" : \"\"}`);\n }\n if (minutes > 0) {\n parts.push(`${minutes} minute${minutes > 1 ? \"s\" : \"\"}`);\n }\n if (seconds > 0) {\n parts.push(`${seconds} second${seconds > 1 ? \"s\" : \"\"}`);\n }\n durationString = parts.join(\" \");\n\n // Short format: \"HH:MM:SS\"\n } else {\n // Omitting hours when zero\n if (hours > 0) {\n parts.push(hours.toString().padStart(2, 0));\n }\n parts.push(minutes.toString().padStart(2, 0));\n parts.push(seconds.toString().padStart(2, 0));\n durationString = parts.join(\":\");\n }\n return durationString;\n });\n\n /**\n * Helper for extending components to set overridable data values\n * If the value is not set in the component data.json, it will use the hds data value\n *\n * @param {string} value - The value to check if it is defined\n * @param {string} defaultValue - The default value to return if value is not defined\n * @returns {string} - The value if it is defined, otherwise the default value\n */\n handlebars.registerHelper(\"isdefined\", function (value, defaultValue) {\n return value !== undefined && value !== \"\" ? value : defaultValue;\n });\n\n /**\n * Used to get class names added to an element based on their boolean values in an array\n *\n * @param {string} names - Comma-separated list of class names to check for\n * @param {array} array - Array of objects to check for true values\n * @returns {string} - Space-separated list of class names that have true values\n */\n handlebars.registerHelper(\"getClassNames\", function (names, array) {\n // Split the comma-separated string of names into an array\n let nameList = names.split(\",\").map((name) => name.trim());\n\n // Create an array to hold the names that have true values\n let matchedItems = [];\n\n for (let i = 0; i < nameList.length; i++) {\n let name = nameList[i];\n // Check if any item in the array matches the name and is true\n if (array) {\n for (let j = 0; j < array.length; j++) {\n if (array[j][name] === true) {\n matchedItems.push(name); // Add to matchedItems if found and true\n break;\n }\n }\n }\n }\n\n // If we found any matched items, return them as a space-separated string\n if (matchedItems.length > 0) {\n return matchedItems.join(\" \");\n } else {\n return \"\";\n }\n });\n\n handlebars.registerHelper(\"join\", function (theArray, separator) {\n // Handle if a separator is not provided\n if (!separator || typeof separator !== \"string\") {\n separator = \" \";\n }\n\n // If theArray is not an array, return it as is, otherwise join it\n return !Array.isArray(theArray) ? theArray : theArray.join(separator);\n });\n\n handlebars.registerHelper(\"toCamelCase\", function (text) {\n if (typeof text !== \"string\") return text;\n\n // Remove whitespace and convert to camelCase\n return text\n .toLowerCase()\n .replace(/(?:^\\w|[A-Z]|\\b\\w|\\s+)/g, (match, index) =>\n index === 0 ? match.toLowerCase() : match.toUpperCase(),\n )\n .replace(/\\s+/g, \"\"); // Remove all spaces\n });\n}\n\nif (typeof Handlebars !== \"undefined\") {\n handlebarsHelpers(Handlebars);\n}\n"],
5
+ "mappings": "mBAkBA,SAASA,EAAOC,EAAIC,EAAUC,EAAIC,EAAS,CACzC,OAAQF,EAAU,CAChB,IAAK,KACH,OAAOD,GAAME,EAAKC,EAAQ,GAAG,IAAI,EAAIA,EAAQ,QAAQ,IAAI,EAC3D,IAAK,MACH,OAAOH,IAAOE,EAAKC,EAAQ,GAAG,IAAI,EAAIA,EAAQ,QAAQ,IAAI,EAC5D,IAAK,KACH,OAAOH,GAAME,EAAKC,EAAQ,GAAG,IAAI,EAAIA,EAAQ,QAAQ,IAAI,EAC3D,IAAK,MACH,OAAOH,IAAOE,EAAKC,EAAQ,GAAG,IAAI,EAAIA,EAAQ,QAAQ,IAAI,EAC5D,IAAK,IACH,OAAOH,EAAKE,EAAKC,EAAQ,GAAG,IAAI,EAAIA,EAAQ,QAAQ,IAAI,EAC1D,IAAK,KACH,OAAOH,GAAME,EAAKC,EAAQ,GAAG,IAAI,EAAIA,EAAQ,QAAQ,IAAI,EAC3D,IAAK,IACH,OAAOH,EAAKE,EAAKC,EAAQ,GAAG,IAAI,EAAIA,EAAQ,QAAQ,IAAI,EAC1D,IAAK,KACH,OAAOH,GAAME,EAAKC,EAAQ,GAAG,IAAI,EAAIA,EAAQ,QAAQ,IAAI,EAC3D,IAAK,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GAAS,SAAiBA,EAG9BA,EACJ,YAAY,EACZ,QAAQ,0BAA2B,CAACC,EAAOC,IAC1CA,IAAU,EAAID,EAAM,YAAY,EAAIA,EAAM,YAAY,CACxD,EACC,QAAQ,OAAQ,EAAE,CACvB,CAAC,CACH,CAEI,OAAO,YAAe,aACxBnC,EAAkB,UAAU",
6
+ "names": ["ifCond", "v1", "operator", "v2", "options", "handlebarsHelpers", "handlebars", "needle", "haystack", "value", "expected", "args", "arg", "dateString", "defaultDate", "format", "date", "monthNames", "day", "month", "year", "dateToFormat", "duration", "durationString", "parts", "hours", "minutes", "seconds", "durationSplit", "defaultValue", "names", "array", "nameList", "name", "matchedItems", "i", "j", "theArray", "separator", "text", "match", "index"]
7
7
  }
@@ -1,22 +1,23 @@
1
1
  /* global Handlebars */
2
+
2
3
  /**
3
- * Registers Handlebars Helpers
4
- * @param {Handlebars} handlebars Templating engine
5
- * @returns {void} Result of the helper operation
4
+ *
5
+ * @param {*} v1 The left value
6
+ * @param { "==" | "===" | "!=" | "!==" | "<" | "<=" | ">" | ">=" | "&&" | "||" | "contains"} operator the operator to handle comparison
7
+ * @param {*} v2 The right value
8
+ * @param {Object} options handlebars-provided options object
9
+ * @returns {string} handlebars template block string
10
+ * @example
11
+ * {{#ifCond value1 "===" value2}}
12
+ * <!-- Content to render if condition is true -->
13
+ * <p>Value1 is strictly equal to Value2</p>
14
+ * {{else}}
15
+ * <!-- Content to render if condition is false -->
16
+ * <p>Value1 is not strictly equal to Value2</p>
17
+ * {{/ifCond}}
6
18
  */
7
-
8
- export default function handlebarsHelpers(handlebars) {
9
- // contains - if first object is in collection (second object) to return true
10
- handlebars.registerHelper("contains", function (needle, haystack, options) {
11
- needle = handlebars.escapeExpression(needle);
12
- haystack = handlebars.escapeExpression(haystack);
13
- return haystack.indexOf(needle) > -1
14
- ? options.fn(this)
15
- : options.inverse(this);
16
- });
17
- // ifCond - checks conditions
18
- handlebars.registerHelper("ifCond", function (v1, operator, v2, options) {
19
- switch (operator) {
19
+ function ifCond(v1, operator, v2, options) {
20
+ switch (operator) {
20
21
  case "==":
21
22
  return v1 == v2 ? options.fn(this) : options.inverse(this);
22
23
  case "===":
@@ -45,8 +46,26 @@ export default function handlebarsHelpers(handlebars) {
45
46
  } else return options.inverse(this);
46
47
  default:
47
48
  return options.inverse(this);
48
- }
49
+ }
50
+ }
51
+ /**
52
+ * Registers Handlebars Helpers
53
+ * @param {Handlebars} handlebars Templating engine
54
+ * @returns {void} Result of the helper operation
55
+ */
56
+
57
+ export default function handlebarsHelpers(handlebars) {
58
+ // contains - if first object is in collection (second object) to return true
59
+ handlebars.registerHelper("contains", function (needle, haystack, options) {
60
+ needle = handlebars.escapeExpression(needle);
61
+ haystack = handlebars.escapeExpression(haystack);
62
+ return haystack.indexOf(needle) > -1
63
+ ? options.fn(this)
64
+ : options.inverse(this);
49
65
  });
66
+
67
+ handlebars.registerHelper("ifCond", ifCond);
68
+
50
69
  // isType - Checks is expected type
51
70
  handlebars.registerHelper("isType", function (value, expected, options) {
52
71
  if (value === expected) {
@@ -101,12 +120,12 @@ export default function handlebarsHelpers(handlebars) {
101
120
  var year = date.getFullYear();
102
121
  // Format date based on the format string
103
122
  switch (format) {
104
- case "YYYY":
105
- return `${year}`;
106
- case "MMMM YYYY":
107
- return `${month} ${year}`;
108
- default:
109
- return `${day} ${month} ${year}`;
123
+ case "YYYY":
124
+ return `${year}`;
125
+ case "MMMM YYYY":
126
+ return `${month} ${year}`;
127
+ default:
128
+ return `${day} ${month} ${year}`;
110
129
  }
111
130
  },
112
131
  );
@@ -198,27 +217,21 @@ export default function handlebarsHelpers(handlebars) {
198
217
  return durationString;
199
218
  });
200
219
 
201
- // helper for extending components to set overridable data values
202
- // if the value is not set in the component data.json, it will use the hds data value
203
- handlebars.registerHelper('isdefined', function (value, defaultValue) {
204
- return value !== undefined ? value : defaultValue;
205
- });
206
-
207
220
  /**
208
221
  * Helper for extending components to set overridable data values
209
222
  * If the value is not set in the component data.json, it will use the hds data value
210
- *
223
+ *
211
224
  * @param {string} value - The value to check if it is defined
212
225
  * @param {string} defaultValue - The default value to return if value is not defined
213
226
  * @returns {string} - The value if it is defined, otherwise the default value
214
227
  */
215
- handlebars.registerHelper('isdefined', function (value, defaultValue) {
228
+ handlebars.registerHelper("isdefined", function (value, defaultValue) {
216
229
  return value !== undefined && value !== "" ? value : defaultValue;
217
230
  });
218
231
 
219
232
  /**
220
233
  * Used to get class names added to an element based on their boolean values in an array
221
- *
234
+ *
222
235
  * @param {string} names - Comma-separated list of class names to check for
223
236
  * @param {array} array - Array of objects to check for true values
224
237
  * @returns {string} - Space-separated list of class names that have true values
@@ -233,7 +246,7 @@ export default function handlebarsHelpers(handlebars) {
233
246
  for (let i = 0; i < nameList.length; i++) {
234
247
  let name = nameList[i];
235
248
  // Check if any item in the array matches the name and is true
236
- if(array){
249
+ if (array) {
237
250
  for (let j = 0; j < array.length; j++) {
238
251
  if (array[j][name] === true) {
239
252
  matchedItems.push(name); // Add to matchedItems if found and true
@@ -251,19 +264,18 @@ export default function handlebarsHelpers(handlebars) {
251
264
  }
252
265
  });
253
266
 
254
-
255
267
  handlebars.registerHelper("join", function (theArray, separator) {
256
268
  // Handle if a separator is not provided
257
269
  if (!separator || typeof separator !== "string") {
258
270
  separator = " ";
259
271
  }
260
-
272
+
261
273
  // If theArray is not an array, return it as is, otherwise join it
262
274
  return !Array.isArray(theArray) ? theArray : theArray.join(separator);
263
275
  });
264
-
265
- handlebars.registerHelper('toCamelCase', function (text) {
266
- if (typeof text !== 'string') return text;
276
+
277
+ handlebars.registerHelper("toCamelCase", function (text) {
278
+ if (typeof text !== "string") return text;
267
279
 
268
280
  // Remove whitespace and convert to camelCase
269
281
  return text
@@ -271,9 +283,8 @@ export default function handlebarsHelpers(handlebars) {
271
283
  .replace(/(?:^\w|[A-Z]|\b\w|\s+)/g, (match, index) =>
272
284
  index === 0 ? match.toLowerCase() : match.toUpperCase(),
273
285
  )
274
- .replace(/\s+/g, ''); // Remove all spaces
286
+ .replace(/\s+/g, ""); // Remove all spaces
275
287
  });
276
-
277
288
  }
278
289
 
279
290
  if (typeof Handlebars !== "undefined") {