@ministryofjustice/frontend 4.0.1 → 5.0.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.
- package/govuk-prototype-kit.config.json +19 -4
- package/moj/_base.scss +2 -0
- package/moj/_base.scss.map +1 -0
- package/moj/all.bundle.js +2523 -0
- package/moj/all.bundle.js.map +1 -0
- package/moj/all.bundle.mjs +2502 -0
- package/moj/all.bundle.mjs.map +1 -0
- package/moj/all.mjs +59 -69
- package/moj/all.mjs.map +1 -1
- package/moj/all.scss +2 -0
- package/moj/all.scss.map +1 -0
- package/moj/components/_all.scss +2 -0
- package/moj/components/_all.scss.map +1 -0
- package/moj/components/action-bar/_action-bar.scss +2 -0
- package/moj/components/action-bar/_action-bar.scss.map +1 -0
- package/moj/components/add-another/_add-another.scss +2 -0
- package/moj/components/add-another/_add-another.scss.map +1 -0
- package/moj/components/add-another/add-another.bundle.js +128 -0
- package/moj/components/add-another/add-another.bundle.js.map +1 -0
- package/moj/components/add-another/add-another.bundle.mjs +120 -0
- package/moj/components/add-another/add-another.bundle.mjs.map +1 -0
- package/moj/components/add-another/add-another.mjs +112 -99
- package/moj/components/add-another/add-another.mjs.map +1 -1
- package/moj/components/alert/_alert.scss +4 -0
- package/moj/components/alert/_alert.scss.map +1 -0
- package/moj/components/alert/alert.bundle.js +330 -0
- package/moj/components/alert/alert.bundle.js.map +1 -0
- package/moj/components/alert/alert.bundle.mjs +322 -0
- package/moj/components/alert/alert.bundle.mjs.map +1 -0
- package/moj/components/alert/alert.mjs +181 -217
- package/moj/components/alert/alert.mjs.map +1 -1
- package/moj/components/alert/{alert.spec.helper.js → alert.spec.helper.bundle.js} +1 -1
- package/moj/components/alert/alert.spec.helper.bundle.js.map +1 -0
- package/moj/components/alert/alert.spec.helper.bundle.mjs +67 -0
- package/moj/components/alert/alert.spec.helper.bundle.mjs.map +1 -0
- package/moj/components/alert/alert.spec.helper.mjs.map +1 -1
- package/moj/components/badge/_badge.scss +2 -0
- package/moj/components/badge/_badge.scss.map +1 -0
- package/moj/components/banner/_banner.scss +2 -0
- package/moj/components/banner/_banner.scss.map +1 -0
- package/moj/components/button-menu/README.md +10 -6
- package/moj/components/button-menu/_button-menu.scss +4 -1
- package/moj/components/button-menu/_button-menu.scss.map +1 -0
- package/moj/components/button-menu/button-menu.bundle.js +299 -0
- package/moj/components/button-menu/button-menu.bundle.js.map +1 -0
- package/moj/components/button-menu/{button-menu.js → button-menu.bundle.mjs} +74 -121
- package/moj/components/button-menu/button-menu.bundle.mjs.map +1 -0
- package/moj/components/button-menu/button-menu.mjs +246 -285
- package/moj/components/button-menu/button-menu.mjs.map +1 -1
- package/moj/components/cookie-banner/_cookie-banner.scss +2 -0
- package/moj/components/cookie-banner/_cookie-banner.scss.map +1 -0
- package/moj/components/currency-input/_currency-input.scss +2 -0
- package/moj/components/currency-input/_currency-input.scss.map +1 -0
- package/moj/components/date-picker/_date-picker.scss +2 -0
- package/moj/components/date-picker/_date-picker.scss.map +1 -0
- package/moj/components/date-picker/date-picker.bundle.js +784 -0
- package/moj/components/date-picker/date-picker.bundle.js.map +1 -0
- package/moj/components/date-picker/{date-picker.js → date-picker.bundle.mjs} +245 -439
- package/moj/components/date-picker/date-picker.bundle.mjs.map +1 -0
- package/moj/components/date-picker/date-picker.mjs +654 -840
- package/moj/components/date-picker/date-picker.mjs.map +1 -1
- package/moj/components/filter/_filter.scss +2 -0
- package/moj/components/filter/_filter.scss.map +1 -0
- package/moj/components/filter-toggle-button/filter-toggle-button.bundle.js +96 -0
- package/moj/components/filter-toggle-button/filter-toggle-button.bundle.js.map +1 -0
- package/moj/components/filter-toggle-button/filter-toggle-button.bundle.mjs +88 -0
- package/moj/components/filter-toggle-button/filter-toggle-button.bundle.mjs.map +1 -0
- package/moj/components/filter-toggle-button/filter-toggle-button.mjs +78 -84
- package/moj/components/filter-toggle-button/filter-toggle-button.mjs.map +1 -1
- package/moj/components/form-validator/form-validator.bundle.js +198 -0
- package/moj/components/form-validator/form-validator.bundle.js.map +1 -0
- package/moj/components/form-validator/form-validator.bundle.mjs +190 -0
- package/moj/components/form-validator/form-validator.bundle.mjs.map +1 -0
- package/moj/components/form-validator/form-validator.mjs +149 -152
- package/moj/components/form-validator/form-validator.mjs.map +1 -1
- package/moj/components/header/_header.scss +2 -0
- package/moj/components/header/_header.scss.map +1 -0
- package/moj/components/identity-bar/_identity-bar.scss +2 -0
- package/moj/components/identity-bar/_identity-bar.scss.map +1 -0
- package/moj/components/interruption-card/_interruption-card.scss +2 -0
- package/moj/components/interruption-card/_interruption-card.scss.map +1 -0
- package/moj/components/messages/_messages.scss +2 -0
- package/moj/components/messages/_messages.scss.map +1 -0
- package/moj/components/multi-file-upload/_multi-file-upload.scss +2 -0
- package/moj/components/multi-file-upload/_multi-file-upload.scss.map +1 -0
- package/moj/components/multi-file-upload/multi-file-upload.bundle.js +223 -0
- package/moj/components/multi-file-upload/multi-file-upload.bundle.js.map +1 -0
- package/moj/components/multi-file-upload/multi-file-upload.bundle.mjs +215 -0
- package/moj/components/multi-file-upload/multi-file-upload.bundle.mjs.map +1 -0
- package/moj/components/multi-file-upload/multi-file-upload.mjs +193 -209
- package/moj/components/multi-file-upload/multi-file-upload.mjs.map +1 -1
- package/moj/components/multi-select/_multi-select.scss +2 -0
- package/moj/components/multi-select/_multi-select.scss.map +1 -0
- package/moj/components/multi-select/multi-select.bundle.js +78 -0
- package/moj/components/multi-select/multi-select.bundle.js.map +1 -0
- package/moj/components/multi-select/multi-select.bundle.mjs +70 -0
- package/moj/components/multi-select/multi-select.bundle.mjs.map +1 -0
- package/moj/components/multi-select/multi-select.mjs +59 -67
- package/moj/components/multi-select/multi-select.mjs.map +1 -1
- package/moj/components/notification-badge/_notification-badge.scss +2 -0
- package/moj/components/notification-badge/_notification-badge.scss.map +1 -0
- package/moj/components/organisation-switcher/_organisation-switcher.scss +2 -0
- package/moj/components/organisation-switcher/_organisation-switcher.scss.map +1 -0
- package/moj/components/page-header-actions/_page-header-actions.scss +2 -0
- package/moj/components/page-header-actions/_page-header-actions.scss.map +1 -0
- package/moj/components/pagination/_pagination.scss +2 -2
- package/moj/components/pagination/_pagination.scss.map +1 -0
- package/moj/components/password-reveal/_password-reveal.scss +2 -0
- package/moj/components/password-reveal/_password-reveal.scss.map +1 -0
- package/moj/components/password-reveal/password-reveal.bundle.js +49 -0
- package/moj/components/password-reveal/password-reveal.bundle.js.map +1 -0
- package/moj/components/password-reveal/password-reveal.bundle.mjs +41 -0
- package/moj/components/password-reveal/password-reveal.bundle.mjs.map +1 -0
- package/moj/components/password-reveal/password-reveal.mjs +36 -31
- package/moj/components/password-reveal/password-reveal.mjs.map +1 -1
- package/moj/components/primary-navigation/_primary-navigation.scss +2 -0
- package/moj/components/primary-navigation/_primary-navigation.scss.map +1 -0
- package/moj/components/progress-bar/_progress-bar.scss +2 -0
- package/moj/components/progress-bar/_progress-bar.scss.map +1 -0
- package/moj/components/rich-text-editor/README.md +15 -9
- package/moj/components/rich-text-editor/_rich-text-editor.scss +2 -0
- package/moj/components/rich-text-editor/_rich-text-editor.scss.map +1 -0
- package/moj/components/rich-text-editor/rich-text-editor.bundle.js +145 -0
- package/moj/components/rich-text-editor/rich-text-editor.bundle.js.map +1 -0
- package/moj/components/rich-text-editor/rich-text-editor.bundle.mjs +137 -0
- package/moj/components/rich-text-editor/rich-text-editor.bundle.mjs.map +1 -0
- package/moj/components/rich-text-editor/rich-text-editor.mjs +124 -145
- package/moj/components/rich-text-editor/rich-text-editor.mjs.map +1 -1
- package/moj/components/search/_search.scss +2 -0
- package/moj/components/search/_search.scss.map +1 -0
- package/moj/components/search-toggle/{search-toggle.scss → _search-toggle.scss} +2 -0
- package/moj/components/search-toggle/_search-toggle.scss.map +1 -0
- package/moj/components/search-toggle/search-toggle.bundle.js +54 -0
- package/moj/components/search-toggle/search-toggle.bundle.js.map +1 -0
- package/moj/components/search-toggle/search-toggle.bundle.mjs +46 -0
- package/moj/components/search-toggle/search-toggle.bundle.mjs.map +1 -0
- package/moj/components/search-toggle/search-toggle.mjs +40 -49
- package/moj/components/search-toggle/search-toggle.mjs.map +1 -1
- package/moj/components/side-navigation/_side-navigation.scss +2 -0
- package/moj/components/side-navigation/_side-navigation.scss.map +1 -0
- package/moj/components/sortable-table/_sortable-table.scss +2 -2
- package/moj/components/sortable-table/_sortable-table.scss.map +1 -0
- package/moj/components/sortable-table/sortable-table.bundle.js +134 -0
- package/moj/components/sortable-table/sortable-table.bundle.js.map +1 -0
- package/moj/components/sortable-table/sortable-table.bundle.mjs +126 -0
- package/moj/components/sortable-table/sortable-table.bundle.mjs.map +1 -0
- package/moj/components/sortable-table/sortable-table.mjs +117 -130
- package/moj/components/sortable-table/sortable-table.mjs.map +1 -1
- package/moj/components/sub-navigation/_sub-navigation.scss +2 -0
- package/moj/components/sub-navigation/_sub-navigation.scss.map +1 -0
- package/moj/components/tag/_tag.scss +2 -0
- package/moj/components/tag/_tag.scss.map +1 -0
- package/moj/components/task-list/_task-list.scss +2 -0
- package/moj/components/task-list/_task-list.scss.map +1 -0
- package/moj/components/ticket-panel/_ticket-panel.scss +2 -0
- package/moj/components/ticket-panel/_ticket-panel.scss.map +1 -0
- package/moj/components/timeline/_timeline.scss +2 -0
- package/moj/components/timeline/_timeline.scss.map +1 -0
- package/moj/filters/all.js +44 -22
- package/moj/helpers/_all.scss +2 -0
- package/moj/helpers/_all.scss.map +1 -0
- package/moj/helpers/_hidden.scss +2 -0
- package/moj/helpers/_hidden.scss.map +1 -0
- package/moj/helpers/_links.scss +2 -0
- package/moj/helpers/_links.scss.map +1 -0
- package/moj/{helpers.js → helpers.bundle.js} +37 -42
- package/moj/helpers.bundle.js.map +1 -0
- package/moj/helpers.bundle.mjs +179 -0
- package/moj/helpers.bundle.mjs.map +1 -0
- package/moj/helpers.mjs +52 -28
- package/moj/helpers.mjs.map +1 -1
- package/moj/init.js +11 -2
- package/moj/moj-frontend.min.css +1 -1
- package/moj/moj-frontend.min.css.map +1 -1
- package/moj/moj-frontend.min.js +1 -1
- package/moj/moj-frontend.min.js.map +1 -1
- package/moj/objects/_all.scss +2 -0
- package/moj/objects/_all.scss.map +1 -0
- package/moj/objects/_button-group.scss +2 -0
- package/moj/objects/_button-group.scss.map +1 -0
- package/moj/objects/_filter-layout.scss +2 -0
- package/moj/objects/_filter-layout.scss.map +1 -0
- package/moj/objects/_scrollable-pane.scss +2 -0
- package/moj/objects/_scrollable-pane.scss.map +1 -0
- package/moj/objects/_width-container.scss +2 -0
- package/moj/objects/_width-container.scss.map +1 -0
- package/moj/settings/_all.scss +2 -0
- package/moj/settings/_all.scss.map +1 -0
- package/moj/settings/_assets.scss +2 -0
- package/moj/settings/_assets.scss.map +1 -0
- package/moj/settings/_colours.scss +2 -0
- package/moj/settings/_colours.scss.map +1 -0
- package/moj/settings/_measurements.scss +2 -0
- package/moj/settings/_measurements.scss.map +1 -0
- package/moj/settings/_typography.scss +2 -0
- package/moj/settings/_typography.scss.map +1 -0
- package/moj/template.njk +13 -0
- package/moj/utilities/_all.scss +2 -0
- package/moj/utilities/_all.scss.map +1 -0
- package/moj/utilities/_hidden.scss +2 -0
- package/moj/utilities/_hidden.scss.map +1 -0
- package/moj/utilities/_width-container.scss +2 -0
- package/moj/utilities/_width-container.scss.map +1 -0
- package/moj/vendor/govuk-frontend/_base.scss +2 -0
- package/moj/vendor/govuk-frontend/_base.scss.map +1 -0
- package/moj/vendor/govuk-frontend/_index.scss +2 -0
- package/moj/vendor/govuk-frontend/_index.scss.map +1 -0
- package/moj/{version.js → version.bundle.js} +1 -1
- package/moj/version.bundle.js.map +1 -0
- package/moj/version.bundle.mjs +4 -0
- package/moj/version.bundle.mjs.map +1 -0
- package/moj/version.mjs.map +1 -1
- package/package.json +5 -6
- package/moj/all.jquery.min.js +0 -1
- package/moj/all.jquery.min.js.map +0 -1
- package/moj/all.js +0 -2662
- package/moj/all.js.map +0 -1
- package/moj/components/add-another/add-another.js +0 -115
- package/moj/components/add-another/add-another.js.map +0 -1
- package/moj/components/alert/alert.js +0 -356
- package/moj/components/alert/alert.js.map +0 -1
- package/moj/components/alert/alert.spec.helper.js.map +0 -1
- package/moj/components/button-menu/button-menu.js.map +0 -1
- package/moj/components/date-picker/date-picker.js.map +0 -1
- package/moj/components/filter-toggle-button/filter-toggle-button.js +0 -102
- package/moj/components/filter-toggle-button/filter-toggle-button.js.map +0 -1
- package/moj/components/form-validator/form-validator.js +0 -205
- package/moj/components/form-validator/form-validator.js.map +0 -1
- package/moj/components/multi-file-upload/multi-file-upload.js +0 -241
- package/moj/components/multi-file-upload/multi-file-upload.js.map +0 -1
- package/moj/components/multi-select/multi-select.js +0 -86
- package/moj/components/multi-select/multi-select.js.map +0 -1
- package/moj/components/password-reveal/password-reveal.js +0 -44
- package/moj/components/password-reveal/password-reveal.js.map +0 -1
- package/moj/components/rich-text-editor/rich-text-editor.js +0 -166
- package/moj/components/rich-text-editor/rich-text-editor.js.map +0 -1
- package/moj/components/search-toggle/search-toggle.js +0 -63
- package/moj/components/search-toggle/search-toggle.js.map +0 -1
- package/moj/components/sortable-table/sortable-table.js +0 -147
- package/moj/components/sortable-table/sortable-table.js.map +0 -1
- package/moj/helpers.js.map +0 -1
- package/moj/vendor/html5shiv.js +0 -326
- package/moj/vendor/jquery.js +0 -9300
- package/moj/version.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"all.jquery.min.js","sources":["../../src/moj/components/add-another/add-another.mjs","../../src/moj/helpers.mjs","../../src/moj/components/alert/alert.mjs","../../src/moj/components/button-menu/button-menu.mjs","../../src/moj/components/date-picker/date-picker.mjs","../../src/moj/components/filter-toggle-button/filter-toggle-button.mjs","../../src/moj/components/multi-file-upload/multi-file-upload.mjs","../../src/moj/components/multi-select/multi-select.mjs","../../src/moj/components/password-reveal/password-reveal.mjs","../../src/moj/components/rich-text-editor/rich-text-editor.mjs","../../src/moj/components/search-toggle/search-toggle.mjs","../../src/moj/components/sortable-table/sortable-table.mjs","../../src/moj/all.mjs","../../src/moj/version.mjs"],"sourcesContent":["import $ from 'jquery'\n\nexport function AddAnother(container) {\n this.container = $(container)\n\n if (this.container.data('moj-add-another-initialised')) {\n return\n }\n\n this.container.data('moj-add-another-initialised', true)\n\n this.container.on(\n 'click',\n '.moj-add-another__remove-button',\n $.proxy(this, 'onRemoveButtonClick')\n )\n this.container.on(\n 'click',\n '.moj-add-another__add-button',\n $.proxy(this, 'onAddButtonClick')\n )\n this.container\n .find('.moj-add-another__add-button, moj-add-another__remove-button')\n .prop('type', 'button')\n}\n\nAddAnother.prototype.onAddButtonClick = function (e) {\n const item = this.getNewItem()\n this.updateAttributes(this.getItems().length, item)\n this.resetItem(item)\n const firstItem = this.getItems().first()\n if (!this.hasRemoveButton(firstItem)) {\n this.createRemoveButton(firstItem)\n }\n this.getItems().last().after(item)\n item.find('input, textarea, select').first().focus()\n}\n\nAddAnother.prototype.hasRemoveButton = function (item) {\n return item.find('.moj-add-another__remove-button').length\n}\n\nAddAnother.prototype.getItems = function () {\n return this.container.find('.moj-add-another__item')\n}\n\nAddAnother.prototype.getNewItem = function () {\n const item = this.getItems().first().clone()\n if (!this.hasRemoveButton(item)) {\n this.createRemoveButton(item)\n }\n return item\n}\n\nAddAnother.prototype.updateAttributes = function (index, item) {\n item.find('[data-name]').each(function (i, el) {\n const originalId = el.id\n\n el.name = $(el)\n .attr('data-name')\n .replace(/%index%/, index)\n el.id = $(el)\n .attr('data-id')\n .replace(/%index%/, index)\n\n const label =\n $(el).siblings('label')[0] ||\n $(el).parents('label')[0] ||\n item.find(`[for=\"${originalId}\"]`)[0]\n label.htmlFor = el.id\n })\n}\n\nAddAnother.prototype.createRemoveButton = function (item) {\n item.append(\n '<button type=\"button\" class=\"govuk-button govuk-button--secondary moj-add-another__remove-button\">Remove</button>'\n )\n}\n\nAddAnother.prototype.resetItem = function (item) {\n item.find('[data-name], [data-id]').each(function (index, el) {\n if (el.type === 'checkbox' || el.type === 'radio') {\n el.checked = false\n } else {\n el.value = ''\n }\n })\n}\n\nAddAnother.prototype.onRemoveButtonClick = function (e) {\n $(e.currentTarget).parents('.moj-add-another__item').remove()\n const items = this.getItems()\n if (items.length === 1) {\n items.find('.moj-add-another__remove-button').remove()\n }\n items.each(\n $.proxy(function (index, el) {\n this.updateAttributes(index, $(el))\n }, this)\n )\n this.focusHeading()\n}\n\nAddAnother.prototype.focusHeading = function () {\n this.container.find('.moj-add-another__heading').get(0).focus()\n}\n","export function removeAttributeValue(el, attr, value) {\n let re, m\n if (el.getAttribute(attr)) {\n if (el.getAttribute(attr) === value) {\n el.removeAttribute(attr)\n } else {\n re = new RegExp(`(^|\\\\s)${value}(\\\\s|$)`)\n m = el.getAttribute(attr).match(re)\n if (m && m.length === 3) {\n el.setAttribute(\n attr,\n el.getAttribute(attr).replace(re, m[1] && m[2] ? ' ' : '')\n )\n }\n }\n }\n}\n\nexport function addAttributeValue(el, attr, value) {\n let re\n if (!el.getAttribute(attr)) {\n el.setAttribute(attr, value)\n } else {\n re = new RegExp(`(^|\\\\s)${value}(\\\\s|$)`)\n if (!re.test(el.getAttribute(attr))) {\n el.setAttribute(attr, `${el.getAttribute(attr)} ${value}`)\n }\n }\n}\n\nexport function dragAndDropSupported() {\n const div = document.createElement('div')\n return typeof div.ondrop !== 'undefined'\n}\n\nexport function formDataSupported() {\n return typeof FormData === 'function'\n}\n\nexport function fileApiSupported() {\n const input = document.createElement('input')\n input.type = 'file'\n return typeof input.files !== 'undefined'\n}\n\nexport function nodeListForEach(nodes, callback) {\n if (window.NodeList.prototype.forEach) {\n return nodes.forEach(callback)\n }\n for (let i = 0; i < nodes.length; i++) {\n callback.call(window, nodes[i], i, nodes)\n }\n}\n\n/**\n * Find an elements next sibling\n *\n * Utility function to find an elements next sibling matching the provided\n * selector.\n *\n * @param {HTMLElement} $element - Element to find siblings for\n * @param {string} selector - selector for required sibling\n */\nexport function getNextSibling($element, selector) {\n if (!$element) return\n // Get the next sibling element\n let $sibling = $element.nextElementSibling\n\n // If there's no selector, return the first sibling\n if (!selector) return $sibling\n\n // If the sibling matches our selector, use it\n // If not, jump to the next sibling and continue the loop\n while ($sibling) {\n if ($sibling.matches(selector)) return $sibling\n $sibling = $sibling.nextElementSibling\n }\n}\n\n/**\n * Find an elements preceding sibling\n *\n * Utility function to find an elements previous sibling matching the provided\n * selector.\n *\n * @param {HTMLElement} $element - Element to find siblings for\n * @param {string} selector - selector for required sibling\n */\nexport function getPreviousSibling($element, selector) {\n if (!$element) return\n // Get the previous sibling element\n let $sibling = $element.previousElementSibling\n\n // If there's no selector, return the first sibling\n if (!selector) return $sibling\n\n // If the sibling matches our selector, use it\n // If not, jump to the next sibling and continue the loop\n while ($sibling) {\n if ($sibling.matches(selector)) return $sibling\n $sibling = $sibling.previousElementSibling\n }\n}\n\nexport function findNearestMatchingElement($element, selector) {\n // If no element or selector is provided, return null\n if (!$element) return\n if (!selector) return\n\n // Start with the current element\n let $currentElement = $element\n\n while ($currentElement) {\n // First check the current element\n if ($currentElement.matches(selector)) {\n return $currentElement\n }\n\n // Check all previous siblings\n let $sibling = $currentElement.previousElementSibling\n while ($sibling) {\n // Check if the sibling itself is a heading\n if ($sibling.matches(selector)) {\n return $sibling\n }\n $sibling = $sibling.previousElementSibling\n }\n\n // If no match found in siblings, move up to parent\n $currentElement = $currentElement.parentElement\n }\n}\n\n/**\n * Move focus to element\n *\n * Sets tabindex to -1 to make the element programmatically focusable,\n * but removes it on blur as the element doesn't need to be focused again.\n *\n * @param {HTMLElement} $element - HTML element\n * @param {object} [options] - Handler options\n * @param {function(this: HTMLElement): void} [options.onBeforeFocus] - Callback before focus\n * @param {function(this: HTMLElement): void} [options.onBlur] - Callback on blur\n */\nexport function setFocus($element, options = {}) {\n const isFocusable = $element.getAttribute('tabindex')\n\n if (!isFocusable) {\n $element.setAttribute('tabindex', '-1')\n }\n\n /**\n * Handle element focus\n */\n function onFocus() {\n $element.addEventListener('blur', onBlur, { once: true })\n }\n\n /**\n * Handle element blur\n */\n function onBlur() {\n if (options.onBlur) {\n options.onBlur.call($element)\n }\n\n if (!isFocusable) {\n $element.removeAttribute('tabindex')\n }\n }\n\n // Add listener to reset element on blur, after focus\n $element.addEventListener('focus', onFocus, { once: true })\n\n // Focus element\n if (options.onBeforeFocus) {\n options.onBeforeFocus.call($element)\n }\n $element.focus()\n}\n","import {\n findNearestMatchingElement,\n getPreviousSibling,\n setFocus\n} from '../../helpers.mjs'\n\n/**\n * @typedef {object} AlertConfig\n * @property {boolean} [dismissible=false] - Can the alert be dismissed by the user\n * @property {string} [dismissText=Dismiss] - the label text for the dismiss button\n * @property {boolean} [disableAutoFocus=false] - whether the alert will be autofocused\n * @property {string} [focusOnDismissSelector] - CSS Selector for element to be focused on dismiss\n */\n\n/**\n * @param {HTMLElement} $module - the Alert element\n * @param {AlertConfig} config - configuration options\n * @class\n */\nexport function Alert($module, config = {}) {\n if (!$module) {\n return this\n }\n\n const schema = Object.freeze({\n properties: {\n dismissible: { type: 'boolean' },\n dismissText: { type: 'string' },\n disableAutoFocus: { type: 'boolean' },\n focusOnDismissSelector: { type: 'string' }\n }\n })\n\n const defaults = {\n dismissible: false,\n dismissText: 'Dismiss',\n disableAutoFocus: false\n }\n\n // data attributes override JS config, which overrides defaults\n this.config = this.mergeConfigs(\n defaults,\n config,\n this.parseDataset(schema, $module.dataset)\n )\n\n this.$module = $module\n}\n\nAlert.prototype.init = function () {\n /**\n * Focus the alert\n *\n * If `role=\"alert\"` is set, focus the element to help some assistive\n * technologies prioritise announcing it.\n *\n * You can turn off the auto-focus functionality by setting\n * `data-disable-auto-focus=\"true\"` in the component HTML. You might wish to\n * do this based on user research findings, or to avoid a clash with another\n * element which should be focused when the page loads.\n */\n if (\n this.$module.getAttribute('role') === 'alert' &&\n !this.config.disableAutoFocus\n ) {\n setFocus(this.$module)\n }\n\n this.$dismissButton = this.$module.querySelector('.moj-alert__dismiss')\n\n if (this.config.dismissible && this.$dismissButton) {\n this.$dismissButton.innerHTML = this.config.dismissText\n this.$dismissButton.removeAttribute('hidden')\n\n this.$module.addEventListener('click', (event) => {\n if (this.$dismissButton.contains(event.target)) {\n this.dimiss()\n }\n })\n }\n}\n\n/**\n * Handle dismissing the alert\n */\nAlert.prototype.dimiss = function () {\n let $elementToRecieveFocus\n\n // If a selector has been provided, attempt to find that element\n if (this.config.focusOnDismissSelector) {\n $elementToRecieveFocus = document.querySelector(\n this.config.focusOnDismissSelector\n )\n }\n\n // Is the next sibling another alert\n if (!$elementToRecieveFocus) {\n const $nextSibling = this.$module.nextElementSibling\n if ($nextSibling && $nextSibling.matches('.moj-alert')) {\n $elementToRecieveFocus = $nextSibling\n }\n }\n\n // Else try to find any preceding sibling alert or heading\n if (!$elementToRecieveFocus) {\n $elementToRecieveFocus = getPreviousSibling(\n this.$module,\n '.moj-alert, h1, h2, h3, h4, h5, h6'\n )\n }\n\n // Else find the closest ancestor heading, or fallback to main, or last resort\n // use the body element\n if (!$elementToRecieveFocus) {\n $elementToRecieveFocus = findNearestMatchingElement(\n this.$module,\n 'h1, h2, h3, h4, h5, h6, main, body'\n )\n }\n\n // If we have an element, place focus on it\n if ($elementToRecieveFocus) {\n setFocus($elementToRecieveFocus)\n }\n\n // Remove the alert\n this.$module.remove()\n}\n\n/**\n * Normalise string\n *\n * 'If it looks like a duck, and it quacks like a duck…' 🦆\n *\n * If the passed value looks like a boolean or a number, convert it to a boolean\n * or number.\n *\n * Designed to be used to convert config passed via data attributes (which are\n * always strings) into something sensible.\n *\n * @internal\n * @param {DOMStringMap[string]} value - The value to normalise\n * @param {SchemaProperty} [property] - Component schema property\n * @returns {string | boolean | number | undefined} Normalised data\n */\nAlert.prototype.normaliseString = function (value, property) {\n const trimmedValue = value ? value.trim() : ''\n\n let output\n let outputType\n if (property && property.type) {\n outputType = property.type\n }\n\n // No schema type set? Determine automatically\n if (!outputType) {\n if (['true', 'false'].includes(trimmedValue)) {\n outputType = 'boolean'\n }\n\n // Empty / whitespace-only strings are considered finite so we need to check\n // the length of the trimmed string as well\n if (trimmedValue.length > 0 && isFinite(Number(trimmedValue))) {\n outputType = 'number'\n }\n }\n\n switch (outputType) {\n case 'boolean':\n output = trimmedValue === 'true'\n break\n\n case 'number':\n output = Number(trimmedValue)\n break\n\n default:\n output = value\n }\n\n return output\n}\n\n/**\n * Parse dataset\n *\n * Loop over an object and normalise each value using {@link normaliseString},\n * optionally expanding nested `i18n.field`\n *\n * @param {Schema} schema - component schema\n * @param {DOMStringMap} dataset - HTML element dataset\n * @returns {object} Normalised dataset\n */\nAlert.prototype.parseDataset = function (schema, dataset) {\n const parsed = {}\n\n for (const [field, property] of Object.entries(schema.properties)) {\n if (field in dataset) {\n if (dataset[field]) {\n parsed[field] = this.normaliseString(dataset[field], property)\n }\n }\n }\n\n return parsed\n}\n\n/**\n * Config merging function\n *\n * Takes any number of objects and combines them together, with\n * greatest priority on the LAST item passed in.\n *\n * @param {...{ [key: string]: unknown }} configObjects - Config objects to merge\n * @returns {{ [key: string]: unknown }} A merged config object\n */\nAlert.prototype.mergeConfigs = function (...configObjects) {\n const formattedConfigObject = {}\n\n // Loop through each of the passed objects\n for (const configObject of configObjects) {\n for (const key of Object.keys(configObject)) {\n const option = formattedConfigObject[key]\n const override = configObject[key]\n\n // Push their keys one-by-one into formattedConfigObject. Any duplicate\n // keys with object values will be merged, otherwise the new value will\n // override the existing value.\n if (typeof option === 'object' && typeof override === 'object') {\n // @ts-expect-error Index signature for type 'string' is missing\n formattedConfigObject[key] = this.mergeConfigs(option, override)\n } else {\n formattedConfigObject[key] = override\n }\n }\n }\n\n return formattedConfigObject\n}\n\n/**\n * Schema for component config\n *\n * @typedef {object} Schema\n * @property {{ [field: string]: SchemaProperty | undefined }} properties - Schema properties\n */\n\n/**\n * Schema property for component config\n *\n * @typedef {object} SchemaProperty\n * @property {'string' | 'boolean' | 'number' | 'object'} type - Property type\n */\n","/**\n * @typedef {object} ButtonMenuConfig\n * @property {string} [buttonText=Actions] - Label for the toggle button\n * @property {\"left\" | \"right\"} [alignMenu=left] - the alignment of the menu\n * @property {string} [buttonClasses=govuk-button--secondary] - css classes applied to the toggle button\n */\n\n/**\n * @param {HTMLElement} $module\n * @param {ButtonMenuConfig} config\n * @class\n */\nexport function ButtonMenu($module, config = {}) {\n if (!$module) {\n return this\n }\n\n const schema = Object.freeze({\n properties: {\n buttonText: { type: 'string' },\n buttonClasses: { type: 'string' },\n alignMenu: { type: 'string' }\n }\n })\n\n const defaults = {\n buttonText: 'Actions',\n alignMenu: 'left',\n buttonClasses: ''\n }\n // data attributes override JS config, which overrides defaults\n this.config = this.mergeConfigs(\n defaults,\n config,\n this.parseDataset(schema, $module.dataset)\n )\n\n this.$module = $module\n}\n\nButtonMenu.prototype.init = function () {\n // If only one button is provided, don't initiate a menu and toggle button\n // if classes have been provided for the toggleButton, apply them to the single item\n if (this.$module.children.length === 1) {\n const button = this.$module.children[0]\n button.classList.forEach((className) => {\n if (className.startsWith('govuk-button-')) {\n button.classList.remove(className)\n }\n button.classList.remove('moj-button-menu__item')\n })\n if (this.config.buttonClasses) {\n button.classList.add(...this.config.buttonClasses.split(' '))\n }\n }\n // Otherwise intialise a button menu\n if (this.$module.children.length > 1) {\n this.initMenu()\n }\n}\n\nButtonMenu.prototype.initMenu = function () {\n this.$menu = this.createMenu()\n this.$module.insertAdjacentHTML('afterbegin', this.toggleTemplate())\n this.setupMenuItems()\n\n this.$menuToggle = this.$module.querySelector(':scope > button')\n this.items = this.$menu.querySelectorAll('a, button')\n\n this.$menuToggle.addEventListener('click', (event) => {\n this.toggleMenu(event)\n })\n\n this.$module.addEventListener('keydown', (event) => {\n this.handleKeyDown(event)\n })\n\n document.addEventListener('click', (event) => {\n if (!this.$module.contains(event.target)) {\n this.closeMenu(false)\n }\n })\n}\n\nButtonMenu.prototype.createMenu = function () {\n const $menu = document.createElement('ul')\n $menu.setAttribute('role', 'list')\n $menu.hidden = true\n $menu.classList.add('moj-button-menu__wrapper')\n if (this.config.alignMenu === 'right') {\n $menu.classList.add('moj-button-menu__wrapper--right')\n }\n\n this.$module.appendChild($menu)\n while (this.$module.firstChild !== $menu) {\n $menu.appendChild(this.$module.firstChild)\n }\n\n return $menu\n}\n\nButtonMenu.prototype.setupMenuItems = function () {\n Array.from(this.$menu.children).forEach((item) => {\n // wrap item in li tag\n const listItem = document.createElement('li')\n this.$menu.insertBefore(listItem, item)\n listItem.appendChild(item)\n\n item.setAttribute('tabindex', -1)\n\n if (item.tagName === 'BUTTON') {\n item.setAttribute('type', 'button')\n }\n\n item.classList.forEach((className) => {\n if (className.startsWith('govuk-button')) {\n item.classList.remove(className)\n }\n })\n\n // add a slight delay after click before closing the menu, makes it *feel* better\n item.addEventListener('click', (event) => {\n setTimeout(() => {\n this.closeMenu(false)\n }, 50)\n })\n })\n}\n\nButtonMenu.prototype.toggleTemplate = function () {\n return `\n <button type=\"button\" class=\"govuk-button moj-button-menu__toggle-button ${this.config.buttonClasses || ''}\" aria-haspopup=\"true\" aria-expanded=\"false\">\n <span>\n ${this.config.buttonText}\n <svg width=\"11\" height=\"5\" viewBox=\"0 0 11 5\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M5.5 0L11 5L0 5L5.5 0Z\" fill=\"currentColor\"/>\n </svg>\n </span>\n </button>`\n}\n\n/**\n * @returns {boolean}\n */\nButtonMenu.prototype.isOpen = function () {\n return this.$menuToggle.getAttribute('aria-expanded') === 'true'\n}\n\nButtonMenu.prototype.toggleMenu = function (event) {\n event.preventDefault()\n\n // If menu is triggered with mouse don't move focus to first item\n const keyboardEvent = event.detail === 0\n const focusIndex = keyboardEvent ? 0 : -1\n\n if (this.isOpen()) {\n this.closeMenu()\n } else {\n this.openMenu(focusIndex)\n }\n}\n\n/**\n * Opens the menu and optionally sets the focus to the item with given index\n *\n * @param {number} focusIndex - The index of the item to focus\n */\nButtonMenu.prototype.openMenu = function (focusIndex = 0) {\n this.$menu.hidden = false\n this.$menuToggle.setAttribute('aria-expanded', 'true')\n if (focusIndex !== -1) {\n this.focusItem(focusIndex)\n }\n}\n\n/**\n * Closes the menu and optionally returns focus back to menuToggle\n *\n * @param {boolean} moveFocus - whether to return focus to the toggle button\n */\nButtonMenu.prototype.closeMenu = function (moveFocus = true) {\n this.$menu.hidden = true\n this.$menuToggle.setAttribute('aria-expanded', 'false')\n if (moveFocus) {\n this.$menuToggle.focus()\n }\n}\n\n/**\n * Focuses the menu item at the specified index\n *\n * @param {number} index - the index of the item to focus\n */\nButtonMenu.prototype.focusItem = function (index) {\n if (index >= this.items.length) index = 0\n if (index < 0) index = this.items.length - 1\n\n const menuItem = this.items.item(index)\n if (menuItem) {\n menuItem.focus()\n }\n}\n\nButtonMenu.prototype.currentFocusIndex = function () {\n const activeElement = document.activeElement\n const menuItems = Array.from(this.items)\n\n return menuItems.indexOf(activeElement)\n}\n\nButtonMenu.prototype.handleKeyDown = function (event) {\n if (event.target === this.$menuToggle) {\n switch (event.key) {\n case 'ArrowDown':\n event.preventDefault()\n this.openMenu()\n break\n case 'ArrowUp':\n event.preventDefault()\n this.openMenu(this.items.length - 1)\n break\n }\n }\n\n if (this.$menu.contains(event.target) && this.isOpen()) {\n switch (event.key) {\n case 'ArrowDown':\n event.preventDefault()\n if (this.currentFocusIndex() !== -1) {\n this.focusItem(this.currentFocusIndex() + 1)\n }\n break\n case 'ArrowUp':\n event.preventDefault()\n if (this.currentFocusIndex() !== -1) {\n this.focusItem(this.currentFocusIndex() - 1)\n }\n break\n case 'Home':\n event.preventDefault()\n this.focusItem(0)\n break\n case 'End':\n event.preventDefault()\n this.focusItem(this.items.length - 1)\n break\n }\n }\n\n if (event.key === 'Escape' && this.isOpen()) {\n this.closeMenu()\n }\n if (event.key === 'Tab' && this.isOpen()) {\n this.closeMenu(false)\n }\n}\n\n/**\n * Parse dataset\n *\n * Loop over an object and normalise each value using {@link normaliseString},\n * optionally expanding nested `i18n.field`\n *\n * @param {Schema} schema - component schema\n * @param {DOMStringMap} dataset - HTML element dataset\n * @returns {object} Normalised dataset\n */\nButtonMenu.prototype.parseDataset = function (schema, dataset) {\n const parsed = {}\n\n for (const [field, ,] of Object.entries(schema.properties)) {\n if (field in dataset) {\n if (dataset[field]) {\n parsed[field] = dataset[field]\n }\n }\n }\n\n return parsed\n}\n\n/**\n * Config merging function\n *\n * Takes any number of objects and combines them together, with\n * greatest priority on the LAST item passed in.\n *\n * @param {...{ [key: string]: unknown }} configObjects - Config objects to merge\n * @returns {{ [key: string]: unknown }} A merged config object\n */\nButtonMenu.prototype.mergeConfigs = function (...configObjects) {\n const formattedConfigObject = {}\n\n // Loop through each of the passed objects\n for (const configObject of configObjects) {\n for (const key of Object.keys(configObject)) {\n const option = formattedConfigObject[key]\n const override = configObject[key]\n\n // Push their keys one-by-one into formattedConfigObject. Any duplicate\n // keys with object values will be merged, otherwise the new value will\n // override the existing value.\n if (typeof option === 'object' && typeof override === 'object') {\n // @ts-expect-error Index signature for type 'string' is missing\n formattedConfigObject[key] = this.mergeConfigs(option, override)\n } else {\n formattedConfigObject[key] = override\n }\n }\n }\n\n return formattedConfigObject\n}\n\n/**\n * Schema for component config\n *\n * @typedef {object} Schema\n * @property {{ [field: string]: SchemaProperty | undefined }} properties - Schema properties\n */\n\n/**\n * Schema property for component config\n *\n * @typedef {object} SchemaProperty\n * @property {'string' | 'boolean' | 'number' | 'object'} type - Property type\n */\n","/**\n * Date picker config\n *\n * @typedef {object} DatePickerConfig\n * @property {string} [excludedDates] - Dates that cannot be selected\n * @property {string} [excludedDays] - Days that cannot be selected\n * @property {boolean} [leadingZeroes] - Whether to add leading zeroes when populating the field\n * @property {string} [minDate] - The earliest available date\n * @property {string} [maxDate] - The latest available date\n * @property {string} [weekStartDay] - First day of the week in calendar view\n */\n\n/**\n * @param {HTMLElement} $module - HTML element\n * @param {DatePickerConfig} config - config object\n * @class\n */\nexport function DatePicker($module, config = {}) {\n if (!$module) {\n return this\n }\n\n const schema = Object.freeze({\n properties: {\n excludedDates: { type: 'string' },\n excludedDays: { type: 'string' },\n leadingZeros: { type: 'string' },\n maxDate: { type: 'string' },\n minDate: { type: 'string' },\n weekStartDay: { type: 'string' }\n }\n })\n\n const defaults = {\n leadingZeros: false,\n weekStartDay: 'monday'\n }\n\n // data attributes override JS config, which overrides defaults\n this.config = this.mergeConfigs(\n defaults,\n config,\n this.parseDataset(schema, $module.dataset)\n )\n\n this.dayLabels = [\n 'Monday',\n 'Tuesday',\n 'Wednesday',\n 'Thursday',\n 'Friday',\n 'Saturday',\n 'Sunday'\n ]\n\n this.monthLabels = [\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\n this.currentDate = new Date()\n this.currentDate.setHours(0, 0, 0, 0)\n this.calendarDays = []\n this.excludedDates = []\n this.excludedDays = []\n\n this.buttonClass = 'moj-datepicker__button'\n this.selectedDayButtonClass = 'moj-datepicker__button--selected'\n this.currentDayButtonClass = 'moj-datepicker__button--current'\n this.todayButtonClass = 'moj-datepicker__button--today'\n\n this.$module = $module\n this.$input = $module.querySelector('.moj-js-datepicker-input')\n}\n\nDatePicker.prototype.init = function () {\n // Check that required elements are present\n if (!this.$input) {\n return\n }\n if (this.$module.dataset.initialized) {\n return\n }\n\n this.setOptions()\n this.initControls()\n this.$module.setAttribute('data-initialized', 'true')\n}\n\nDatePicker.prototype.initControls = function () {\n this.id = `datepicker-${this.$input.id}`\n\n this.$dialog = this.createDialog()\n this.createCalendarHeaders()\n\n const $componentWrapper = document.createElement('div')\n const $inputWrapper = document.createElement('div')\n $componentWrapper.classList.add('moj-datepicker__wrapper')\n $inputWrapper.classList.add('govuk-input__wrapper')\n\n this.$input.parentNode.insertBefore($componentWrapper, this.$input)\n $componentWrapper.appendChild($inputWrapper)\n $inputWrapper.appendChild(this.$input)\n\n $inputWrapper.insertAdjacentHTML('beforeend', this.toggleTemplate())\n $componentWrapper.insertAdjacentElement('beforeend', this.$dialog)\n\n this.$calendarButton = this.$module.querySelector('.moj-js-datepicker-toggle')\n this.$dialogTitle = this.$dialog.querySelector(\n '.moj-js-datepicker-month-year'\n )\n\n this.createCalendar()\n\n this.$prevMonthButton = this.$dialog.querySelector(\n '.moj-js-datepicker-prev-month'\n )\n this.$prevYearButton = this.$dialog.querySelector(\n '.moj-js-datepicker-prev-year'\n )\n this.$nextMonthButton = this.$dialog.querySelector(\n '.moj-js-datepicker-next-month'\n )\n this.$nextYearButton = this.$dialog.querySelector(\n '.moj-js-datepicker-next-year'\n )\n this.$cancelButton = this.$dialog.querySelector('.moj-js-datepicker-cancel')\n this.$okButton = this.$dialog.querySelector('.moj-js-datepicker-ok')\n\n // add event listeners\n this.$prevMonthButton.addEventListener('click', (event) =>\n this.focusPreviousMonth(event, false)\n )\n this.$prevYearButton.addEventListener('click', (event) =>\n this.focusPreviousYear(event, false)\n )\n this.$nextMonthButton.addEventListener('click', (event) =>\n this.focusNextMonth(event, false)\n )\n this.$nextYearButton.addEventListener('click', (event) =>\n this.focusNextYear(event, false)\n )\n this.$cancelButton.addEventListener('click', (event) => {\n event.preventDefault()\n this.closeDialog(event)\n })\n this.$okButton.addEventListener('click', () => {\n this.selectDate(this.currentDate)\n })\n\n const dialogButtons = this.$dialog.querySelectorAll(\n 'button:not([disabled=\"true\"])'\n )\n // eslint-disable-next-line prefer-destructuring\n this.$firstButtonInDialog = dialogButtons[0]\n this.$lastButtonInDialog = dialogButtons[dialogButtons.length - 1]\n this.$firstButtonInDialog.addEventListener('keydown', (event) =>\n this.firstButtonKeydown(event)\n )\n this.$lastButtonInDialog.addEventListener('keydown', (event) =>\n this.lastButtonKeydown(event)\n )\n\n this.$calendarButton.addEventListener('click', (event) =>\n this.toggleDialog(event)\n )\n\n this.$dialog.addEventListener('keydown', (event) => {\n if (event.key === 'Escape') {\n this.closeDialog()\n event.preventDefault()\n event.stopPropagation()\n }\n })\n\n document.body.addEventListener('mouseup', (event) =>\n this.backgroundClick(event)\n )\n\n // populates calendar with initial dates, avoids Wave errors about null buttons\n this.updateCalendar()\n}\n\nDatePicker.prototype.createDialog = function () {\n const titleId = `datepicker-title-${this.$input.id}`\n const $dialog = document.createElement('div')\n\n $dialog.id = this.id\n $dialog.setAttribute('class', 'moj-datepicker__dialog')\n $dialog.setAttribute('role', 'dialog')\n $dialog.setAttribute('aria-modal', 'true')\n $dialog.setAttribute('aria-labelledby', titleId)\n $dialog.innerHTML = this.dialogTemplate(titleId)\n $dialog.hidden = true\n\n return $dialog\n}\n\nDatePicker.prototype.createCalendar = function () {\n const $tbody = this.$dialog.querySelector('tbody')\n let dayCount = 0\n for (let i = 0; i < 6; i++) {\n // create row\n const $row = $tbody.insertRow(i)\n\n for (let j = 0; j < 7; j++) {\n // create cell (day)\n const $cell = document.createElement('td')\n const $dateButton = document.createElement('button')\n\n $cell.appendChild($dateButton)\n $row.appendChild($cell)\n\n const calendarDay = new DSCalendarDay($dateButton, dayCount, i, j, this)\n calendarDay.init()\n this.calendarDays.push(calendarDay)\n dayCount++\n }\n }\n}\n\nDatePicker.prototype.toggleTemplate = function () {\n return `<button class=\"moj-datepicker__toggle moj-js-datepicker-toggle\" type=\"button\" aria-haspopup=\"dialog\" aria-controls=\"${this.id}\" aria-expanded=\"false\">\n <span class=\"govuk-visually-hidden\">Choose date</span>\n <svg width=\"32\" height=\"24\" focusable=\"false\" class=\"moj-datepicker-icon\" aria-hidden=\"true\" role=\"img\" viewBox=\"0 0 22 22\">\n <path\n fill=\"currentColor\"\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n d=\"M16.1333 2.93333H5.86668V4.4C5.86668 5.21002 5.21003 5.86667 4.40002 5.86667C3.59 5.86667 2.93335 5.21002 2.93335 4.4V2.93333H2C0.895431 2.93333 0 3.82877 0 4.93334V19.2667C0 20.3712 0.89543 21.2667 2 21.2667H20C21.1046 21.2667 22 20.3712 22 19.2667V4.93333C22 3.82876 21.1046 2.93333 20 2.93333H19.0667V4.4C19.0667 5.21002 18.41 5.86667 17.6 5.86667C16.79 5.86667 16.1333 5.21002 16.1333 4.4V2.93333ZM20.5333 8.06667H1.46665V18.8C1.46665 19.3523 1.91436 19.8 2.46665 19.8H19.5333C20.0856 19.8 20.5333 19.3523 20.5333 18.8V8.06667Z\"\n ></path>\n <rect x=\"3.66669\" width=\"1.46667\" height=\"5.13333\" rx=\"0.733333\" fill=\"currentColor\"></rect>\n <rect x=\"16.8667\" width=\"1.46667\" height=\"5.13333\" rx=\"0.733333\" fill=\"currentColor\"></rect>\n </svg>\n </button>`\n}\n\n/**\n * HTML template for calendar dialog\n *\n * @param {string} [titleId] - Id attribute for dialog title\n * @returns {string}\n */\nDatePicker.prototype.dialogTemplate = function (titleId) {\n return `<div class=\"moj-datepicker__dialog-header\">\n <div class=\"moj-datepicker__dialog-navbuttons\">\n <button class=\"moj-datepicker__button moj-js-datepicker-prev-year\">\n <span class=\"govuk-visually-hidden\">Previous year</span>\n <svg width=\"44\" height=\"40\" viewBox=\"0 0 44 40\" fill=\"none\" fill=\"none\" focusable=\"false\" aria-hidden=\"true\" role=\"img\">\n <path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M23.1643 20L28.9572 14.2071L27.5429 12.7929L20.3358 20L27.5429 27.2071L28.9572 25.7929L23.1643 20Z\" fill=\"currentColor\"/>\n <path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M17.1643 20L22.9572 14.2071L21.5429 12.7929L14.3358 20L21.5429 27.2071L22.9572 25.7929L17.1643 20Z\" fill=\"currentColor\"/>\n </svg>\n </button>\n\n <button class=\"moj-datepicker__button moj-js-datepicker-prev-month\">\n <span class=\"govuk-visually-hidden\">Previous month</span>\n <svg width=\"44\" height=\"40\" viewBox=\"0 0 44 40\" fill=\"none\" focusable=\"false\" aria-hidden=\"true\" role=\"img\">\n <path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M20.5729 20L25.7865 14.2071L24.5137 12.7929L18.0273 20L24.5137 27.2071L25.7865 25.7929L20.5729 20Z\" fill=\"currentColor\"/>\n </svg>\n </button>\n </div>\n\n <h2 id=\"${titleId}\" class=\"moj-datepicker__dialog-title moj-js-datepicker-month-year\" aria-live=\"polite\">June 2020</h2>\n\n <div class=\"moj-datepicker__dialog-navbuttons\">\n <button class=\"moj-datepicker__button moj-js-datepicker-next-month\">\n <span class=\"govuk-visually-hidden\">Next month</span>\n <svg width=\"44\" height=\"40\" viewBox=\"0 0 44 40\" fill=\"none\" focusable=\"false\" aria-hidden=\"true\" role=\"img\">\n <path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M23.4271 20L18.2135 14.2071L19.4863 12.7929L25.9727 20L19.4863 27.2071L18.2135 25.7929L23.4271 20Z\" fill=\"currentColor\"/>\n </svg>\n </button>\n\n <button class=\"moj-datepicker__button moj-js-datepicker-next-year\">\n <span class=\"govuk-visually-hidden\">Next year</span>\n <svg width=\"44\" height=\"40\" viewBox=\"0 0 44 40\" fill=\"none\" fill=\"none\" focusable=\"false\" aria-hidden=\"true\" role=\"img\">\n <path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M20.8357 20L15.0428 14.2071L16.4571 12.7929L23.6642 20L16.4571 27.2071L15.0428 25.7929L20.8357 20Z\" fill=\"currentColor\"/>\n <path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M26.8357 20L21.0428 14.2071L22.4571 12.7929L29.6642 20L22.4571 27.2071L21.0428 25.7929L26.8357 20Z\" fill=\"currentColor\"/>\n </svg>\n </button>\n </div>\n </div>\n\n <table class=\"moj-datepicker__calendar moj-js-datepicker-grid\" role=\"grid\" aria-labelledby=\"${titleId}\">\n <thead>\n <tr></tr>\n </thead>\n\n <tbody></tbody>\n </table>\n\n <div class=\"govuk-button-group\">\n <button type=\"button\" class=\"govuk-button moj-js-datepicker-ok\">Select</button>\n <button type=\"button\" class=\"govuk-button govuk-button--secondary moj-js-datepicker-cancel\">Close</button>\n </div>`\n}\n\nDatePicker.prototype.createCalendarHeaders = function () {\n this.dayLabels.forEach((day) => {\n const html = `<th scope=\"col\"><span aria-hidden=\"true\">${day.substring(0, 3)}</span><span class=\"govuk-visually-hidden\">${day}</span></th>`\n const $headerRow = this.$dialog.querySelector('thead > tr')\n $headerRow.insertAdjacentHTML('beforeend', html)\n })\n}\n\n/**\n * Pads given number with leading zeros\n *\n * @param {number} value - The value to be padded\n * @param {number} length - The length in characters of the output\n * @returns {string}\n */\nDatePicker.prototype.leadingZeros = function (value, length = 2) {\n let ret = value.toString()\n\n while (ret.length < length) {\n ret = `0${ret}`\n }\n\n return ret\n}\n\nDatePicker.prototype.setOptions = function () {\n this.setMinAndMaxDatesOnCalendar()\n this.setExcludedDates()\n this.setExcludedDays()\n this.setLeadingZeros()\n this.setWeekStartDay()\n}\n\nDatePicker.prototype.setMinAndMaxDatesOnCalendar = function () {\n if (this.config.minDate) {\n this.minDate = this.formattedDateFromString(this.config.minDate, null)\n if (this.minDate && this.currentDate < this.minDate) {\n this.currentDate = this.minDate\n }\n }\n\n if (this.config.maxDate) {\n this.maxDate = this.formattedDateFromString(this.config.maxDate, null)\n if (this.maxDate && this.currentDate > this.maxDate) {\n this.currentDate = this.maxDate\n }\n }\n}\n\nDatePicker.prototype.setExcludedDates = function () {\n if (this.config.excludedDates) {\n this.excludedDates = this.config.excludedDates\n .replace(/\\s+/, ' ')\n .split(' ')\n .map((item) => {\n return item.includes('-')\n ? this.parseDateRangeString(item)\n : this.formattedDateFromString(item)\n })\n .flat()\n .filter((item) => item)\n }\n}\n\n/*\n * Parses a daterange string into an array of dates\n * @param {String} datestring - A daterange string in the format \"dd/mm/yyyy-dd/mm/yyyy\"\n * @returns {Date[]}\n */\nDatePicker.prototype.parseDateRangeString = function (datestring) {\n const dates = []\n const [startDate, endDate] = datestring\n .split('-')\n .map((d) => this.formattedDateFromString(d, null))\n\n if (startDate && endDate) {\n const date = new Date(startDate.getTime())\n /* eslint-disable no-unmodified-loop-condition */\n while (date <= endDate) {\n dates.push(new Date(date))\n date.setDate(date.getDate() + 1)\n }\n /* eslint-enable no-unmodified-loop-condition */\n }\n return dates\n}\n\nDatePicker.prototype.setExcludedDays = function () {\n if (this.config.excludedDays) {\n // lowercase and arrange dayLabels to put indexOf sunday == 0 for comparison\n // with getDay() function\n const weekDays = this.dayLabels.map((item) => item.toLowerCase())\n if (this.config.weekStartDay === 'monday') {\n weekDays.unshift(weekDays.pop())\n }\n\n this.excludedDays = this.config.excludedDays\n .replace(/\\s+/, ' ')\n .toLowerCase()\n .split(' ')\n .map((item) => weekDays.indexOf(item))\n .filter((item) => item !== -1)\n }\n}\n\nDatePicker.prototype.setLeadingZeros = function () {\n if (typeof this.config.leadingZeros !== 'boolean') {\n if (this.config.leadingZeros.toLowerCase() === 'true') {\n this.config.leadingZeros = true\n return\n }\n if (this.config.leadingZeros.toLowerCase() === 'false') {\n this.config.leadingZeros = false\n }\n }\n}\n\nDatePicker.prototype.setWeekStartDay = function () {\n const weekStartDayParam = this.config.weekStartDay\n if (weekStartDayParam && weekStartDayParam.toLowerCase() === 'sunday') {\n this.config.weekStartDay = 'sunday'\n // Rotate dayLabels array to put Sunday as the first item\n this.dayLabels.unshift(this.dayLabels.pop())\n } else {\n this.config.weekStartDay = 'monday'\n }\n}\n\n/**\n * Determine if a date is selecteable\n *\n * @param {Date} date - the date to check\n * @returns {boolean}\n */\nDatePicker.prototype.isExcludedDate = function (date) {\n // This comparison does not work correctly - it will exclude the mindate itself\n // see: https://github.com/ministryofjustice/moj-frontend/issues/923\n if (this.minDate && this.minDate > date) {\n return true\n }\n\n // This comparison works as expected - the maxdate will not be excluded\n if (this.maxDate && this.maxDate < date) {\n return true\n }\n\n for (const excludedDate of this.excludedDates) {\n if (date.toDateString() === excludedDate.toDateString()) {\n return true\n }\n }\n\n if (this.excludedDays.includes(date.getDay())) {\n return true\n }\n\n return false\n}\n\n/**\n * Get a Date object from a string\n *\n * @param {string} dateString - string in the format d/m/yyyy dd/mm/yyyy\n * @param {Date} fallback - date object to return if formatting fails\n * @returns {Date}\n */\nDatePicker.prototype.formattedDateFromString = function (\n dateString,\n fallback = new Date()\n) {\n let formattedDate = null\n // Accepts d/m/yyyy and dd/mm/yyyy\n const dateFormatPattern = /(\\d{1,2})([-/,. ])(\\d{1,2})\\2(\\d{4})/\n\n if (!dateFormatPattern.test(dateString)) return fallback\n\n const match = dateString.match(dateFormatPattern)\n const day = match[1]\n const month = match[3]\n const year = match[4]\n\n formattedDate = new Date(`${year}-${month}-${day}`)\n if (formattedDate instanceof Date && !isNaN(formattedDate)) {\n return formattedDate\n }\n return fallback\n}\n\n/**\n * Get a formatted date string from a Date object\n *\n * @param {Date} date - date to format to a string\n * @returns {string}\n */\nDatePicker.prototype.formattedDateFromDate = function (date) {\n if (this.config.leadingZeros) {\n return `${this.leadingZeros(date.getDate())}/${this.leadingZeros(date.getMonth() + 1)}/${date.getFullYear()}`\n }\n\n return `${date.getDate()}/${date.getMonth() + 1}/${date.getFullYear()}`\n}\n\n/**\n * Get a human readable date in the format Monday 2 March 2024\n *\n * @param {Date} date - date to format\n * @returns {string}\n */\nDatePicker.prototype.formattedDateHuman = function (date) {\n return `${this.dayLabels[(date.getDay() + 6) % 7]} ${date.getDate()} ${this.monthLabels[date.getMonth()]} ${date.getFullYear()}`\n}\n\nDatePicker.prototype.backgroundClick = function (event) {\n if (\n this.isOpen() &&\n !this.$dialog.contains(event.target) &&\n !this.$input.contains(event.target) &&\n !this.$calendarButton.contains(event.target)\n ) {\n event.preventDefault()\n this.closeDialog()\n }\n}\n\nDatePicker.prototype.firstButtonKeydown = function (event) {\n if (event.key === 'Tab' && event.shiftKey) {\n this.$lastButtonInDialog.focus()\n event.preventDefault()\n }\n}\n\nDatePicker.prototype.lastButtonKeydown = function (event) {\n if (event.key === 'Tab' && !event.shiftKey) {\n this.$firstButtonInDialog.focus()\n event.preventDefault()\n }\n}\n\n// render calendar\nDatePicker.prototype.updateCalendar = function () {\n this.$dialogTitle.innerHTML = `${this.monthLabels[this.currentDate.getMonth()]} ${this.currentDate.getFullYear()}`\n\n const day = this.currentDate\n const firstOfMonth = new Date(day.getFullYear(), day.getMonth(), 1)\n let dayOfWeek\n\n if (this.config.weekStartDay === 'monday') {\n dayOfWeek = firstOfMonth.getDay() === 0 ? 6 : firstOfMonth.getDay() - 1 // Change logic to make Monday first day of week, i.e. 0\n } else {\n dayOfWeek = firstOfMonth.getDay()\n }\n\n firstOfMonth.setDate(firstOfMonth.getDate() - dayOfWeek)\n\n const thisDay = new Date(firstOfMonth)\n\n // loop through our days\n for (let i = 0; i < this.calendarDays.length; i++) {\n const hidden = thisDay.getMonth() !== day.getMonth()\n const disabled = this.isExcludedDate(thisDay)\n\n this.calendarDays[i].update(thisDay, hidden, disabled)\n\n thisDay.setDate(thisDay.getDate() + 1)\n }\n}\n\nDatePicker.prototype.setCurrentDate = function (focus = true) {\n const { currentDate } = this\n this.calendarDays.forEach((calendarDay) => {\n calendarDay.button.classList.add('moj-datepicker__button')\n calendarDay.button.classList.add('moj-datepicker__calendar-day')\n calendarDay.button.setAttribute('tabindex', -1)\n calendarDay.button.classList.remove(this.selectedDayButtonClass)\n const calendarDayDate = calendarDay.date\n calendarDayDate.setHours(0, 0, 0, 0)\n\n const today = new Date()\n today.setHours(0, 0, 0, 0)\n\n if (\n calendarDayDate.getTime() ===\n currentDate.getTime() /* && !calendarDay.button.disabled */\n ) {\n if (focus) {\n calendarDay.button.setAttribute('tabindex', 0)\n calendarDay.button.focus()\n calendarDay.button.classList.add(this.selectedDayButtonClass)\n }\n }\n\n if (\n this.inputDate &&\n calendarDayDate.getTime() === this.inputDate.getTime()\n ) {\n calendarDay.button.classList.add(this.currentDayButtonClass)\n calendarDay.button.setAttribute('aria-current', 'date')\n } else {\n calendarDay.button.classList.remove(this.currentDayButtonClass)\n calendarDay.button.removeAttribute('aria-current')\n }\n\n if (calendarDayDate.getTime() === today.getTime()) {\n calendarDay.button.classList.add(this.todayButtonClass)\n } else {\n calendarDay.button.classList.remove(this.todayButtonClass)\n }\n })\n\n // if no date is tab-able, make the first non-disabled date tab-able\n if (!focus) {\n const enabledDays = this.calendarDays.filter((calendarDay) => {\n return (\n window.getComputedStyle(calendarDay.button).display === 'block' &&\n !calendarDay.button.disabled\n )\n })\n\n enabledDays[0].button.setAttribute('tabindex', 0)\n\n this.currentDate = enabledDays[0].date\n }\n}\n\nDatePicker.prototype.selectDate = function (date) {\n if (this.isExcludedDate(date)) {\n return\n }\n\n this.$calendarButton.querySelector('span').innerText =\n `Choose date. Selected date is ${this.formattedDateHuman(date)}`\n this.$input.value = this.formattedDateFromDate(date)\n\n const changeEvent = new Event('change', { bubbles: true, cancelable: true })\n this.$input.dispatchEvent(changeEvent)\n\n this.closeDialog()\n}\n\nDatePicker.prototype.isOpen = function () {\n return this.$dialog.classList.contains('moj-datepicker__dialog--open')\n}\n\nDatePicker.prototype.toggleDialog = function (event) {\n event.preventDefault()\n if (this.isOpen()) {\n this.closeDialog()\n } else {\n this.setMinAndMaxDatesOnCalendar()\n this.openDialog()\n }\n}\n\nDatePicker.prototype.openDialog = function () {\n this.$dialog.hidden = false\n this.$dialog.classList.add('moj-datepicker__dialog--open')\n this.$calendarButton.setAttribute('aria-expanded', 'true')\n\n // position the dialog\n // if input is wider than dialog pin it to the right\n if (this.$input.offsetWidth > this.$dialog.offsetWidth) {\n this.$dialog.style.right = `0px`\n }\n this.$dialog.style.top = `${this.$input.offsetHeight + 3}px`\n\n // get the date from the input element\n this.inputDate = this.formattedDateFromString(this.$input.value)\n this.currentDate = this.inputDate\n this.currentDate.setHours(0, 0, 0, 0)\n\n this.updateCalendar()\n this.setCurrentDate()\n}\n\nDatePicker.prototype.closeDialog = function () {\n this.$dialog.hidden = true\n this.$dialog.classList.remove('moj-datepicker__dialog--open')\n this.$calendarButton.setAttribute('aria-expanded', 'false')\n this.$calendarButton.focus()\n}\n\nDatePicker.prototype.goToDate = function (date, focus) {\n const current = this.currentDate\n this.currentDate = date\n\n if (\n current.getMonth() !== this.currentDate.getMonth() ||\n current.getFullYear() !== this.currentDate.getFullYear()\n ) {\n this.updateCalendar()\n }\n\n this.setCurrentDate(focus)\n}\n\n// day navigation\nDatePicker.prototype.focusNextDay = function () {\n const date = new Date(this.currentDate)\n date.setDate(date.getDate() + 1)\n this.goToDate(date)\n}\n\nDatePicker.prototype.focusPreviousDay = function () {\n const date = new Date(this.currentDate)\n date.setDate(date.getDate() - 1)\n this.goToDate(date)\n}\n\n// week navigation\nDatePicker.prototype.focusNextWeek = function () {\n const date = new Date(this.currentDate)\n date.setDate(date.getDate() + 7)\n this.goToDate(date)\n}\n\nDatePicker.prototype.focusPreviousWeek = function () {\n const date = new Date(this.currentDate)\n date.setDate(date.getDate() - 7)\n this.goToDate(date)\n}\n\nDatePicker.prototype.focusFirstDayOfWeek = function () {\n const date = new Date(this.currentDate)\n const firstDayOfWeekIndex = this.config.weekStartDay === 'sunday' ? 0 : 1\n const dayOfWeek = date.getDay()\n const diff =\n dayOfWeek >= firstDayOfWeekIndex\n ? dayOfWeek - firstDayOfWeekIndex\n : 6 - dayOfWeek\n\n date.setDate(date.getDate() - diff)\n date.setHours(0, 0, 0, 0)\n\n this.goToDate(date)\n}\n\nDatePicker.prototype.focusLastDayOfWeek = function () {\n const date = new Date(this.currentDate)\n const lastDayOfWeekIndex = this.config.weekStartDay === 'sunday' ? 6 : 0\n const dayOfWeek = date.getDay()\n const diff =\n dayOfWeek <= lastDayOfWeekIndex\n ? lastDayOfWeekIndex - dayOfWeek\n : 7 - dayOfWeek\n\n date.setDate(date.getDate() + diff)\n date.setHours(0, 0, 0, 0)\n\n this.goToDate(date)\n}\n\n// month navigation\nDatePicker.prototype.focusNextMonth = function (event, focus = true) {\n event.preventDefault()\n const date = new Date(this.currentDate)\n date.setMonth(date.getMonth() + 1, 1)\n this.goToDate(date, focus)\n}\n\nDatePicker.prototype.focusPreviousMonth = function (event, focus = true) {\n event.preventDefault()\n const date = new Date(this.currentDate)\n date.setMonth(date.getMonth() - 1, 1)\n this.goToDate(date, focus)\n}\n\n// year navigation\nDatePicker.prototype.focusNextYear = function (event, focus = true) {\n event.preventDefault()\n const date = new Date(this.currentDate)\n date.setFullYear(date.getFullYear() + 1, date.getMonth(), 1)\n this.goToDate(date, focus)\n}\n\nDatePicker.prototype.focusPreviousYear = function (event, focus = true) {\n event.preventDefault()\n const date = new Date(this.currentDate)\n date.setFullYear(date.getFullYear() - 1, date.getMonth(), 1)\n this.goToDate(date, focus)\n}\n\n/**\n * Parse dataset\n *\n * @param {Schema} schema - Component class\n * @param {DOMStringMap} dataset - HTML element dataset\n * @returns {object} Normalised dataset\n */\nDatePicker.prototype.parseDataset = function (schema, dataset) {\n const parsed = {}\n\n for (const [field, ,] of Object.entries(schema.properties)) {\n if (field in dataset) {\n parsed[field] = dataset[field]\n }\n }\n\n return parsed\n}\n\n/**\n * Config merging function\n *\n * Takes any number of objects and combines them together, with\n * greatest priority on the LAST item passed in.\n *\n * @param {...{ [key: string]: unknown }} configObjects - Config objects to merge\n * @returns {{ [key: string]: unknown }} A merged config object\n */\nDatePicker.prototype.mergeConfigs = function (...configObjects) {\n const formattedConfigObject = {}\n\n // Loop through each of the passed objects\n for (const configObject of configObjects) {\n for (const key of Object.keys(configObject)) {\n const option = formattedConfigObject[key]\n const override = configObject[key]\n\n // Push their keys one-by-one into formattedConfigObject. Any duplicate\n // keys with object values will be merged, otherwise the new value will\n // override the existing value.\n if (typeof option === 'object' && typeof override === 'object') {\n // @ts-expect-error Index signature for type 'string' is missing\n formattedConfigObject[key] = this.mergeConfigs(option, override)\n } else {\n formattedConfigObject[key] = override\n }\n }\n }\n\n return formattedConfigObject\n}\n\n/**\n *\n * @param {HTMLElement} button\n * @param {number} index\n * @param {number} row\n * @param {number} column\n * @param {DatePicker} picker\n * @class\n */\nfunction DSCalendarDay(button, index, row, column, picker) {\n this.index = index\n this.row = row\n this.column = column\n this.button = button\n this.picker = picker\n\n this.date = new Date()\n}\n\nDSCalendarDay.prototype.init = function () {\n this.button.addEventListener('keydown', this.keyPress.bind(this))\n this.button.addEventListener('click', this.click.bind(this))\n}\n\n/**\n * @param {Date} day - the Date for the calendar day\n * @param {boolean} hidden - visibility of the day\n * @param {boolean} disabled - is the day selectable or excluded\n */\nDSCalendarDay.prototype.update = function (day, hidden, disabled) {\n const label = day.getDate()\n let accessibleLabel = this.picker.formattedDateHuman(day)\n\n if (disabled) {\n this.button.setAttribute('aria-disabled', true)\n accessibleLabel = `Excluded date, ${accessibleLabel}`\n } else {\n this.button.removeAttribute('aria-disabled')\n }\n\n if (hidden) {\n this.button.style.display = 'none'\n } else {\n this.button.style.display = 'block'\n }\n this.button.setAttribute(\n 'data-testid',\n this.picker.formattedDateFromDate(day)\n )\n\n this.button.innerHTML = `<span class=\"govuk-visually-hidden\">${accessibleLabel}</span><span aria-hidden=\"true\">${label}</span>`\n this.date = new Date(day)\n}\n\nDSCalendarDay.prototype.click = function (event) {\n this.picker.goToDate(this.date)\n this.picker.selectDate(this.date)\n\n event.stopPropagation()\n event.preventDefault()\n}\n\nDSCalendarDay.prototype.keyPress = function (event) {\n let calendarNavKey = true\n\n switch (event.key) {\n case 'ArrowLeft':\n this.picker.focusPreviousDay()\n break\n case 'ArrowRight':\n this.picker.focusNextDay()\n break\n case 'ArrowUp':\n this.picker.focusPreviousWeek()\n break\n case 'ArrowDown':\n this.picker.focusNextWeek()\n break\n case 'Home':\n this.picker.focusFirstDayOfWeek()\n break\n case 'End':\n this.picker.focusLastDayOfWeek()\n break\n case 'PageUp':\n // eslint-disable-next-line no-unused-expressions\n event.shiftKey\n ? this.picker.focusPreviousYear(event)\n : this.picker.focusPreviousMonth(event)\n break\n case 'PageDown':\n // eslint-disable-next-line no-unused-expressions\n event.shiftKey\n ? this.picker.focusNextYear(event)\n : this.picker.focusNextMonth(event)\n break\n default:\n calendarNavKey = false\n break\n }\n\n if (calendarNavKey) {\n event.preventDefault()\n event.stopPropagation()\n }\n}\n\n/**\n * Schema for component config\n *\n * @typedef {object} Schema\n * @property {{ [field: string]: SchemaProperty | undefined }} properties - Schema properties\n */\n\n/**\n * Schema property for component config\n *\n * @typedef {object} SchemaProperty\n * @property {'string' | 'boolean' | 'number' | 'object'} type - Property type\n */\n","import $ from 'jquery'\n\nexport function FilterToggleButton(options) {\n this.options = options\n this.container = $(this.options.toggleButton.container)\n this.filterContainer = $(this.options.filter.container)\n\n this.createToggleButton()\n this.setupResponsiveChecks()\n this.filterContainer.attr('tabindex', '-1')\n if (this.options.startHidden) {\n this.hideMenu()\n }\n}\n\nFilterToggleButton.prototype.setupResponsiveChecks = function () {\n this.mq = window.matchMedia(this.options.bigModeMediaQuery)\n this.mq.addListener($.proxy(this, 'checkMode'))\n this.checkMode(this.mq)\n}\n\nFilterToggleButton.prototype.createToggleButton = function () {\n this.menuButton = $(\n `<button class=\"govuk-button ${this.options.toggleButton.classes}\" type=\"button\" aria-haspopup=\"true\" aria-expanded=\"false\">${this.options.toggleButton.showText}</button>`\n )\n this.menuButton.on('click', $.proxy(this, 'onMenuButtonClick'))\n this.container.append(this.menuButton)\n}\n\nFilterToggleButton.prototype.checkMode = function (mq) {\n if (mq.matches) {\n this.enableBigMode()\n } else {\n this.enableSmallMode()\n }\n}\n\nFilterToggleButton.prototype.enableBigMode = function () {\n this.showMenu()\n this.removeCloseButton()\n}\n\nFilterToggleButton.prototype.enableSmallMode = function () {\n this.hideMenu()\n this.addCloseButton()\n}\n\nFilterToggleButton.prototype.addCloseButton = function () {\n if (this.options.closeButton) {\n this.closeButton = $(\n `<button class=\"moj-filter__close\" type=\"button\">${this.options.closeButton.text}</button>`\n )\n this.closeButton.on('click', $.proxy(this, 'onCloseClick'))\n $(this.options.closeButton.container).append(this.closeButton)\n }\n}\n\nFilterToggleButton.prototype.onCloseClick = function () {\n this.hideMenu()\n this.menuButton.focus()\n}\n\nFilterToggleButton.prototype.removeCloseButton = function () {\n if (this.closeButton) {\n this.closeButton.remove()\n this.closeButton = null\n }\n}\n\nFilterToggleButton.prototype.hideMenu = function () {\n this.menuButton.attr('aria-expanded', 'false')\n this.filterContainer.addClass('moj-js-hidden')\n this.menuButton.text(this.options.toggleButton.showText)\n}\n\nFilterToggleButton.prototype.showMenu = function () {\n this.menuButton.attr('aria-expanded', 'true')\n this.filterContainer.removeClass('moj-js-hidden')\n this.menuButton.text(this.options.toggleButton.hideText)\n}\n\nFilterToggleButton.prototype.onMenuButtonClick = function () {\n this.toggle()\n}\n\nFilterToggleButton.prototype.toggle = function () {\n if (this.menuButton.attr('aria-expanded') === 'false') {\n this.showMenu()\n this.filterContainer.get(0).focus()\n } else {\n this.hideMenu()\n }\n}\n","import $ from 'jquery'\n\nimport {\n dragAndDropSupported,\n fileApiSupported,\n formDataSupported\n} from '../../helpers.mjs'\n\nexport function MultiFileUpload(params) {\n if (!(dragAndDropSupported() && formDataSupported() && fileApiSupported())) {\n return\n }\n\n this.defaultParams = {\n uploadFileEntryHook: $.noop,\n uploadFileExitHook: $.noop,\n uploadFileErrorHook: $.noop,\n fileDeleteHook: $.noop,\n uploadStatusText: 'Uploading files, please wait',\n dropzoneHintText: 'Drag and drop files here or',\n dropzoneButtonText: 'Choose files'\n }\n\n this.params = $.extend({}, this.defaultParams, params)\n this.container = $(this.params.container)\n\n this.container.addClass('moj-multi-file-upload--enhanced')\n\n this.feedbackContainer = this.container.find(\n '.moj-multi-file__uploaded-files'\n )\n this.setupFileInput()\n this.setupDropzone()\n this.setupLabel()\n this.setupStatusBox()\n this.container.on(\n 'click',\n '.moj-multi-file-upload__delete',\n $.proxy(this, 'onFileDeleteClick')\n )\n}\n\nMultiFileUpload.prototype.setupDropzone = function () {\n this.fileInput.wrap('<div class=\"moj-multi-file-upload__dropzone\" />')\n this.dropzone = this.container.find('.moj-multi-file-upload__dropzone')\n this.dropzone.on('dragover', $.proxy(this, 'onDragOver'))\n this.dropzone.on('dragleave', $.proxy(this, 'onDragLeave'))\n this.dropzone.on('drop', $.proxy(this, 'onDrop'))\n}\n\nMultiFileUpload.prototype.setupLabel = function () {\n this.label = $(\n `<label for=\"${this.fileInput[0].id}\" class=\"govuk-button govuk-button--secondary\">${this.params.dropzoneButtonText}</label>`\n )\n this.dropzone.append(\n `<p class=\"govuk-body\">${this.params.dropzoneHintText}</p>`\n )\n this.dropzone.append(this.label)\n}\n\nMultiFileUpload.prototype.setupFileInput = function () {\n this.fileInput = this.container.find('.moj-multi-file-upload__input')\n this.fileInput.on('change', $.proxy(this, 'onFileChange'))\n this.fileInput.on('focus', $.proxy(this, 'onFileFocus'))\n this.fileInput.on('blur', $.proxy(this, 'onFileBlur'))\n}\n\nMultiFileUpload.prototype.setupStatusBox = function () {\n this.status = $(\n '<div aria-live=\"polite\" role=\"status\" class=\"govuk-visually-hidden\" />'\n )\n this.dropzone.append(this.status)\n}\n\nMultiFileUpload.prototype.onDragOver = function (e) {\n e.preventDefault()\n this.dropzone.addClass('moj-multi-file-upload--dragover')\n}\n\nMultiFileUpload.prototype.onDragLeave = function () {\n this.dropzone.removeClass('moj-multi-file-upload--dragover')\n}\n\nMultiFileUpload.prototype.onDrop = function (e) {\n e.preventDefault()\n this.dropzone.removeClass('moj-multi-file-upload--dragover')\n this.feedbackContainer.removeClass('moj-hidden')\n this.status.html(this.params.uploadStatusText)\n this.uploadFiles(e.originalEvent.dataTransfer.files)\n}\n\nMultiFileUpload.prototype.uploadFiles = function (files) {\n for (let i = 0; i < files.length; i++) {\n this.uploadFile(files[i])\n }\n}\n\nMultiFileUpload.prototype.onFileChange = function (e) {\n this.feedbackContainer.removeClass('moj-hidden')\n this.status.html(this.params.uploadStatusText)\n this.uploadFiles(e.currentTarget.files)\n this.fileInput.replaceWith($(e.currentTarget).val('').clone(true))\n this.setupFileInput()\n this.fileInput.get(0).focus()\n}\n\nMultiFileUpload.prototype.onFileFocus = function (e) {\n this.label.addClass('moj-multi-file-upload--focused')\n}\n\nMultiFileUpload.prototype.onFileBlur = function (e) {\n this.label.removeClass('moj-multi-file-upload--focused')\n}\n\nMultiFileUpload.prototype.getSuccessHtml = function (success) {\n return `<span class=\"moj-multi-file-upload__success\"> <svg class=\"moj-banner__icon\" fill=\"currentColor\" role=\"presentation\" focusable=\"false\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 25 25\" height=\"25\" width=\"25\"><path d=\"M25,6.2L8.7,23.2L0,14.1l4-4.2l4.7,4.9L21,2L25,6.2z\"/></svg>${success.messageHtml}</span>`\n}\n\nMultiFileUpload.prototype.getErrorHtml = function (error) {\n return `<span class=\"moj-multi-file-upload__error\"> <svg class=\"moj-banner__icon\" fill=\"currentColor\" role=\"presentation\" focusable=\"false\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 25 25\" height=\"25\" width=\"25\"><path d=\"M13.6,15.4h-2.3v-4.5h2.3V15.4z M13.6,19.8h-2.3v-2.2h2.3V19.8z M0,23.2h25L12.5,2L0,23.2z\"/></svg>${error.message}</span>`\n}\n\nMultiFileUpload.prototype.getFileRowHtml = function (file) {\n const html = `\n <div class=\"govuk-summary-list__row moj-multi-file-upload__row\">\n <div class=\"govuk-summary-list__value moj-multi-file-upload__message\">\n <span class=\"moj-multi-file-upload__filename\">${file.name}</span>\n <span class=\"moj-multi-file-upload__progress\">0%</span>\n </div>\n <div class=\"govuk-summary-list__actions moj-multi-file-upload__actions\"></div>\n </div>`\n return html\n}\n\nMultiFileUpload.prototype.getDeleteButtonHtml = function (file) {\n return `<button class=\"moj-multi-file-upload__delete govuk-button govuk-button--secondary govuk-!-margin-bottom-0\" type=\"button\" name=\"delete\" value=\"${file.filename}\">\n Delete <span class=\"govuk-visually-hidden\">${file.originalname}</span>\n </button>`\n}\n\nMultiFileUpload.prototype.uploadFile = function (file) {\n this.params.uploadFileEntryHook(this, file)\n const item = $(this.getFileRowHtml(file))\n const formData = new FormData()\n formData.append('documents', file)\n this.feedbackContainer.find('.moj-multi-file-upload__list').append(item)\n\n $.ajax({\n url: this.params.uploadUrl,\n type: 'post',\n data: formData,\n processData: false,\n contentType: false,\n success: $.proxy(function (response) {\n if (response.error) {\n item\n .find('.moj-multi-file-upload__message')\n .html(this.getErrorHtml(response.error))\n this.status.html(response.error.message)\n } else {\n item\n .find('.moj-multi-file-upload__message')\n .html(this.getSuccessHtml(response.success))\n this.status.html(response.success.messageText)\n }\n item\n .find('.moj-multi-file-upload__actions')\n .append(this.getDeleteButtonHtml(response.file))\n this.params.uploadFileExitHook(this, file, response)\n }, this),\n error: $.proxy(function (jqXHR, textStatus, errorThrown) {\n this.params.uploadFileErrorHook(\n this,\n file,\n jqXHR,\n textStatus,\n errorThrown\n )\n }, this),\n xhr: function () {\n const xhr = new XMLHttpRequest()\n xhr.upload.addEventListener(\n 'progress',\n function (e) {\n if (e.lengthComputable) {\n let percentComplete = e.loaded / e.total\n percentComplete = parseInt(percentComplete * 100, 10)\n item\n .find('.moj-multi-file-upload__progress')\n .text(` ${percentComplete}%`)\n }\n },\n false\n )\n return xhr\n }\n })\n}\n\nMultiFileUpload.prototype.onFileDeleteClick = function (e) {\n e.preventDefault() // if user refreshes page and then deletes\n const button = $(e.currentTarget)\n const data = {}\n data[button[0].name] = button[0].value\n $.ajax({\n url: this.params.deleteUrl,\n type: 'post',\n dataType: 'json',\n data,\n success: $.proxy(function (response) {\n if (response.error) {\n // handle error\n } else {\n button.parents('.moj-multi-file-upload__row').remove()\n if (\n this.feedbackContainer.find('.moj-multi-file-upload__row').length ===\n 0\n ) {\n this.feedbackContainer.addClass('moj-hidden')\n }\n }\n this.params.fileDeleteHook(this, response)\n }, this)\n })\n}\n","import $ from 'jquery'\n\nexport function MultiSelect(options) {\n this.container = $(options.container)\n\n if (this.container.data('moj-multi-select-initialised')) {\n return\n }\n\n this.container.data('moj-multi-select-initialised', true)\n\n const idPrefix = options.id_prefix\n let allId = 'checkboxes-all'\n if (typeof idPrefix !== 'undefined') {\n allId = `${idPrefix}checkboxes-all`\n }\n\n this.toggle = $(this.getToggleHtml(allId))\n this.toggleButton = this.toggle.find('input')\n this.toggleButton.on('click', $.proxy(this, 'onButtonClick'))\n this.container.append(this.toggle)\n this.checkboxes = $(options.checkboxes)\n this.checkboxes.on('click', $.proxy(this, 'onCheckboxClick'))\n this.checked = options.checked || false\n}\n\nMultiSelect.prototype.getToggleHtml = function (allId) {\n let html = ''\n html +=\n '<div class=\"govuk-checkboxes__item govuk-checkboxes--small moj-multi-select__checkbox\">'\n html += ` <input type=\"checkbox\" class=\"govuk-checkboxes__input\" id=\"${allId}\">`\n html += ` <label class=\"govuk-label govuk-checkboxes__label moj-multi-select__toggle-label\" for=\"${allId}\">`\n html += ' <span class=\"govuk-visually-hidden\">Select all</span>'\n html += ' </label>'\n html += '</div>'\n return html\n}\n\nMultiSelect.prototype.onButtonClick = function (e) {\n if (this.checked) {\n this.uncheckAll()\n this.toggleButton[0].checked = false\n } else {\n this.checkAll()\n this.toggleButton[0].checked = true\n }\n}\n\nMultiSelect.prototype.checkAll = function () {\n this.checkboxes.each(\n $.proxy(function (index, el) {\n el.checked = true\n }, this)\n )\n this.checked = true\n}\n\nMultiSelect.prototype.uncheckAll = function () {\n this.checkboxes.each(\n $.proxy(function (index, el) {\n el.checked = false\n }, this)\n )\n this.checked = false\n}\n\nMultiSelect.prototype.onCheckboxClick = function (e) {\n if (!e.target.checked) {\n this.toggleButton[0].checked = false\n this.checked = false\n } else {\n if (this.checkboxes.filter(':checked').length === this.checkboxes.length) {\n this.toggleButton[0].checked = true\n this.checked = true\n }\n }\n}\n","import $ from 'jquery'\n\nexport function PasswordReveal(element) {\n this.el = element\n const $el = $(this.el)\n\n if ($el.data('moj-password-reveal-initialised')) {\n return\n }\n\n $el.data('moj-password-reveal-initialised', true)\n $el.attr('spellcheck', 'false')\n\n $el.wrap('<div class=\"moj-password-reveal\"></div>')\n this.container = $(this.el).parent()\n this.createButton()\n}\n\nPasswordReveal.prototype.createButton = function () {\n this.button = $(\n '<button type=\"button\" class=\"govuk-button govuk-button--secondary moj-password-reveal__button\">Show <span class=\"govuk-visually-hidden\">password</span></button>'\n )\n this.container.append(this.button)\n this.button.on('click', $.proxy(this, 'onButtonClick'))\n}\n\nPasswordReveal.prototype.onButtonClick = function () {\n if (this.el.type === 'password') {\n this.el.type = 'text'\n this.button.html('Hide <span class=\"govuk-visually-hidden\">password</span>')\n } else {\n this.el.type = 'password'\n this.button.html('Show <span class=\"govuk-visually-hidden\">password</span>')\n }\n}\n","import $ from 'jquery'\n\nexport function RichTextEditor(options) {\n if (!('contentEditable' in document.documentElement)) {\n return\n }\n\n this.options = options\n this.options.toolbar = this.options.toolbar || {\n bold: false,\n italic: false,\n underline: false,\n bullets: true,\n numbers: true\n }\n this.textarea = this.options.textarea\n this.container = $(this.textarea).parent()\n\n if (this.container.data('moj-rich-text-editor-initialised')) {\n return\n }\n\n this.container.data('moj-rich-text-editor-initialised', true)\n\n this.createToolbar()\n this.hideDefault()\n this.configureToolbar()\n this.keys = {\n left: 37,\n right: 39,\n up: 38,\n down: 40\n }\n this.container.on(\n 'click',\n '.moj-rich-text-editor__toolbar-button',\n $.proxy(this, 'onButtonClick')\n )\n this.container\n .find('.moj-rich-text-editor__content')\n .on('input', $.proxy(this, 'onEditorInput'))\n this.container.find('label').on('click', $.proxy(this, 'onLabelClick'))\n this.toolbar.on('keydown', $.proxy(this, 'onToolbarKeydown'))\n}\n\nRichTextEditor.prototype.onToolbarKeydown = function (e) {\n let focusableButton\n switch (e.keyCode) {\n case this.keys.right:\n case this.keys.down: {\n focusableButton = this.toolbar.find('button[tabindex=0]')\n const nextButton = focusableButton.next('button')\n if (nextButton[0]) {\n nextButton.focus()\n focusableButton.attr('tabindex', '-1')\n nextButton.attr('tabindex', '0')\n }\n break\n }\n case this.keys.left:\n case this.keys.up: {\n focusableButton = this.toolbar.find('button[tabindex=0]')\n const previousButton = focusableButton.prev('button')\n if (previousButton[0]) {\n previousButton.focus()\n focusableButton.attr('tabindex', '-1')\n previousButton.attr('tabindex', '0')\n }\n break\n }\n }\n}\n\nRichTextEditor.prototype.getToolbarHtml = function () {\n let html = ''\n\n html += '<div class=\"moj-rich-text-editor__toolbar\" role=\"toolbar\">'\n\n if (this.options.toolbar.bold) {\n html +=\n '<button class=\"moj-rich-text-editor__toolbar-button moj-rich-text-editor__toolbar-button--bold\" type=\"button\" data-command=\"bold\"><span class=\"govuk-visually-hidden\">Bold</span></button>'\n }\n\n if (this.options.toolbar.italic) {\n html +=\n '<button class=\"moj-rich-text-editor__toolbar-button moj-rich-text-editor__toolbar-button--italic\" type=\"button\" data-command=\"italic\"><span class=\"govuk-visually-hidden\">Italic</span></button>'\n }\n\n if (this.options.toolbar.underline) {\n html +=\n '<button class=\"moj-rich-text-editor__toolbar-button moj-rich-text-editor__toolbar-button--underline\" type=\"button\" data-command=\"underline\"><span class=\"govuk-visually-hidden\">Underline</span></button>'\n }\n\n if (this.options.toolbar.bullets) {\n html +=\n '<button class=\"moj-rich-text-editor__toolbar-button moj-rich-text-editor__toolbar-button--unordered-list\" type=\"button\" data-command=\"insertUnorderedList\"><span class=\"govuk-visually-hidden\">Unordered list</span></button>'\n }\n\n if (this.options.toolbar.numbers) {\n html +=\n '<button class=\"moj-rich-text-editor__toolbar-button moj-rich-text-editor__toolbar-button--ordered-list\" type=\"button\" data-command=\"insertOrderedList\"><span class=\"govuk-visually-hidden\">Ordered list</span></button>'\n }\n\n html += '</div>'\n return html\n}\n\nRichTextEditor.prototype.getEnhancedHtml = function (val) {\n return `${this.getToolbarHtml()}<div class=\"govuk-textarea moj-rich-text-editor__content\" contenteditable=\"true\" spellcheck=\"false\"></div>`\n}\n\nRichTextEditor.prototype.hideDefault = function () {\n this.textarea = this.container.find('textarea')\n this.textarea.addClass('govuk-visually-hidden')\n this.textarea.attr('aria-hidden', true)\n this.textarea.attr('tabindex', '-1')\n}\n\nRichTextEditor.prototype.createToolbar = function () {\n this.toolbar = document.createElement('div')\n this.toolbar.className = 'moj-rich-text-editor'\n this.toolbar.innerHTML = this.getEnhancedHtml()\n this.container.append(this.toolbar)\n this.toolbar = this.container.find('.moj-rich-text-editor__toolbar')\n this.container\n .find('.moj-rich-text-editor__content')\n .html(this.textarea.val())\n}\n\nRichTextEditor.prototype.configureToolbar = function () {\n this.buttons = this.container.find('.moj-rich-text-editor__toolbar-button')\n this.buttons.prop('tabindex', '-1')\n const firstTab = this.buttons.first()\n firstTab.prop('tabindex', '0')\n}\n\nRichTextEditor.prototype.onButtonClick = function (e) {\n document.execCommand($(e.currentTarget).data('command'), false, null)\n}\n\nRichTextEditor.prototype.getContent = function () {\n return this.container.find('.moj-rich-text-editor__content').html()\n}\n\nRichTextEditor.prototype.onEditorInput = function (e) {\n this.updateTextarea()\n}\n\nRichTextEditor.prototype.updateTextarea = function () {\n document.execCommand('defaultParagraphSeparator', false, 'p')\n this.textarea.val(this.getContent())\n}\n\nRichTextEditor.prototype.onLabelClick = function (e) {\n e.preventDefault()\n this.container.find('.moj-rich-text-editor__content').focus()\n}\n","import $ from 'jquery'\n\nexport function SearchToggle(options) {\n this.options = options\n this.container = $(this.options.search.container)\n this.toggleButtonContainer = $(this.options.toggleButton.container)\n\n if (this.container.data('moj-search-toggle-initialised')) {\n return\n }\n\n this.container.data('moj-search-toggle-initialised', true)\n\n const svg =\n '<svg viewBox=\"0 0 20 20\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" class=\"moj-search-toggle__button__icon\"><path d=\"M7.433,12.5790048 C6.06762625,12.5808611 4.75763941,12.0392925 3.79217348,11.0738265 C2.82670755,10.1083606 2.28513891,8.79837375 2.28699522,7.433 C2.28513891,6.06762625 2.82670755,4.75763941 3.79217348,3.79217348 C4.75763941,2.82670755 6.06762625,2.28513891 7.433,2.28699522 C8.79837375,2.28513891 10.1083606,2.82670755 11.0738265,3.79217348 C12.0392925,4.75763941 12.5808611,6.06762625 12.5790048,7.433 C12.5808611,8.79837375 12.0392925,10.1083606 11.0738265,11.0738265 C10.1083606,12.0392925 8.79837375,12.5808611 7.433,12.5790048 L7.433,12.5790048 Z M14.293,12.579 L13.391,12.579 L13.071,12.269 C14.2300759,10.9245158 14.8671539,9.20813198 14.866,7.433 C14.866,3.32786745 11.5381325,-1.65045755e-15 7.433,-1.65045755e-15 C3.32786745,-1.65045755e-15 -1.65045755e-15,3.32786745 -1.65045755e-15,7.433 C-1.65045755e-15,11.5381325 3.32786745,14.866 7.433,14.866 C9.208604,14.8671159 10.9253982,14.2296624 12.27,13.07 L12.579,13.39 L12.579,14.294 L18.296,20 L20,18.296 L14.294,12.579 L14.293,12.579 Z\"></path></svg>'\n\n this.toggleButton = $(\n `<button class=\"moj-search-toggle__button\" type=\"button\" aria-haspopup=\"true\" aria-expanded=\"false\">\n ${this.options.toggleButton.text} ${svg}\n </button>`\n )\n this.toggleButton.on('click', $.proxy(this, 'onToggleButtonClick'))\n this.toggleButtonContainer.append(this.toggleButton)\n $(document).on('click', this.onDocumentClick.bind(this))\n $(document).on('focusin', this.onDocumentClick.bind(this))\n}\n\nSearchToggle.prototype.showMenu = function () {\n this.toggleButton.attr('aria-expanded', 'true')\n this.container.removeClass('moj-js-hidden')\n this.container.find('input').first().get(0).focus()\n}\n\nSearchToggle.prototype.hideMenu = function () {\n this.container.addClass('moj-js-hidden')\n this.toggleButton.attr('aria-expanded', 'false')\n}\n\nSearchToggle.prototype.onToggleButtonClick = function () {\n if (this.toggleButton.attr('aria-expanded') === 'false') {\n this.showMenu()\n } else {\n this.hideMenu()\n }\n}\n\nSearchToggle.prototype.onDocumentClick = function (e) {\n if (\n !$.contains(this.toggleButtonContainer[0], e.target) &&\n !$.contains(this.container[0], e.target)\n ) {\n this.hideMenu()\n }\n}\n","import $ from 'jquery'\n\nexport function SortableTable(params) {\n this.table = $(params.table)\n\n if (this.table.data('moj-search-toggle-initialised')) {\n return\n }\n\n this.table.data('moj-search-toggle-initialised', true)\n\n this.setupOptions(params)\n this.body = this.table.find('tbody')\n this.createHeadingButtons()\n this.createStatusBox()\n this.initialiseSortedColumn()\n this.table.on('click', 'th button', $.proxy(this, 'onSortButtonClick'))\n}\n\nSortableTable.prototype.setupOptions = function (params) {\n params = params || {}\n this.statusMessage = params.statusMessage || 'Sort by %heading% (%direction%)'\n this.ascendingText = params.ascendingText || 'ascending'\n this.descendingText = params.descendingText || 'descending'\n}\n\nSortableTable.prototype.createHeadingButtons = function () {\n const headings = this.table.find('thead th')\n let heading\n for (let i = 0; i < headings.length; i++) {\n heading = $(headings[i])\n if (heading.attr('aria-sort')) {\n this.createHeadingButton(heading, i)\n }\n }\n}\n\nSortableTable.prototype.createHeadingButton = function (heading, i) {\n const text = heading.text()\n const button = $(`<button type=\"button\" data-index=\"${i}\">${text}</button>`)\n heading.text('')\n heading.append(button)\n}\n\nSortableTable.prototype.createStatusBox = function () {\n this.status = $(\n '<div aria-live=\"polite\" role=\"status\" aria-atomic=\"true\" class=\"govuk-visually-hidden\" />'\n )\n this.table.parent().append(this.status)\n}\n\nSortableTable.prototype.initialiseSortedColumn = function () {\n const rows = this.getTableRowsArray()\n\n this.table\n .find('th')\n .filter('[aria-sort=\"ascending\"], [aria-sort=\"descending\"]')\n .first()\n .each((index, el) => {\n const sortDirection = $(el).attr('aria-sort')\n const columnNumber = $(el).find('button').attr('data-index')\n const sortedRows = this.sort(rows, columnNumber, sortDirection)\n this.addRows(sortedRows)\n })\n}\n\nSortableTable.prototype.onSortButtonClick = function (e) {\n const columnNumber = e.currentTarget.getAttribute('data-index')\n const sortDirection = $(e.currentTarget).parent().attr('aria-sort')\n let newSortDirection\n if (sortDirection === 'none' || sortDirection === 'descending') {\n newSortDirection = 'ascending'\n } else {\n newSortDirection = 'descending'\n }\n const rows = this.getTableRowsArray()\n const sortedRows = this.sort(rows, columnNumber, newSortDirection)\n this.addRows(sortedRows)\n this.removeButtonStates()\n this.updateButtonState($(e.currentTarget), newSortDirection)\n}\n\nSortableTable.prototype.updateButtonState = function (button, direction) {\n button.parent().attr('aria-sort', direction)\n let message = this.statusMessage\n message = message.replace(/%heading%/, button.text())\n message = message.replace(/%direction%/, this[`${direction}Text`])\n this.status.text(message)\n}\n\nSortableTable.prototype.removeButtonStates = function () {\n this.table.find('thead th').attr('aria-sort', 'none')\n}\n\nSortableTable.prototype.addRows = function (rows) {\n for (let i = 0; i < rows.length; i++) {\n this.body.append(rows[i])\n }\n}\n\nSortableTable.prototype.getTableRowsArray = function () {\n const rows = []\n const trs = this.body.find('tr')\n for (let i = 0; i < trs.length; i++) {\n rows.push(trs[i])\n }\n return rows\n}\n\nSortableTable.prototype.sort = function (rows, columnNumber, sortDirection) {\n const newRows = rows.sort(\n function (rowA, rowB) {\n const tdA = $(rowA).find('td,th').eq(columnNumber)\n const tdB = $(rowB).find('td,th').eq(columnNumber)\n\n const valueA =\n sortDirection === 'ascending'\n ? this.getCellValue(tdA)\n : this.getCellValue(tdB)\n const valueB =\n sortDirection === 'ascending'\n ? this.getCellValue(tdB)\n : this.getCellValue(tdA)\n\n if (typeof valueA === 'string' || typeof valueB === 'string')\n return valueA.toString().localeCompare(valueB.toString())\n return valueA - valueB\n }.bind(this)\n )\n return newRows\n}\n\nSortableTable.prototype.getCellValue = function (cell) {\n const val = cell.attr('data-sort-value') || cell.html()\n\n const valAsNumber = Number(val)\n return isNaN(valAsNumber) ? val : valAsNumber\n}\n","/* eslint-disable no-new */\n\nimport $ from 'jquery'\n\nimport { AddAnother } from './components/add-another/add-another.mjs'\nimport { Alert } from './components/alert/alert.mjs'\nimport { ButtonMenu } from './components/button-menu/button-menu.mjs'\nimport { DatePicker } from './components/date-picker/date-picker.mjs'\nimport { FilterToggleButton } from './components/filter-toggle-button/filter-toggle-button.mjs'\nimport { MultiFileUpload } from './components/multi-file-upload/multi-file-upload.mjs'\nimport { MultiSelect } from './components/multi-select/multi-select.mjs'\nimport { PasswordReveal } from './components/password-reveal/password-reveal.mjs'\nimport { RichTextEditor } from './components/rich-text-editor/rich-text-editor.mjs'\nimport { SearchToggle } from './components/search-toggle/search-toggle.mjs'\nimport { SortableTable } from './components/sortable-table/sortable-table.mjs'\nimport { nodeListForEach } from './helpers.mjs'\nimport { version } from './version.mjs'\n\nfunction initAll(options) {\n // Set the options to an empty object by default if no options are passed.\n options = typeof options !== 'undefined' ? options : {}\n\n // Allow the user to initialise MOJ Frontend in only certain sections of the page\n // Defaults to the entire document if nothing is set.\n const scope = typeof options.scope !== 'undefined' ? options.scope : document\n\n const $addAnothers = scope.querySelectorAll('[data-module=\"moj-add-another\"]')\n\n nodeListForEach($addAnothers, function ($addAnother) {\n new AddAnother($addAnother)\n })\n\n const $multiSelects = scope.querySelectorAll(\n '[data-module=\"moj-multi-select\"]'\n )\n\n nodeListForEach($multiSelects, function ($multiSelect) {\n new MultiSelect({\n container: $multiSelect.querySelector(\n $multiSelect.getAttribute('data-multi-select-checkbox')\n ),\n checkboxes: $multiSelect.querySelectorAll(\n 'tbody .govuk-checkboxes__input'\n ),\n id_prefix: $multiSelect.getAttribute('data-multi-select-idprefix')\n })\n })\n\n const $passwordReveals = scope.querySelectorAll(\n '[data-module=\"moj-password-reveal\"]'\n )\n\n nodeListForEach($passwordReveals, function ($passwordReveal) {\n new PasswordReveal($passwordReveal)\n })\n\n const $richTextEditors = scope.querySelectorAll(\n '[data-module=\"moj-rich-text-editor\"]'\n )\n\n nodeListForEach($richTextEditors, function ($richTextEditor) {\n const options = {\n textarea: $($richTextEditor)\n }\n\n const toolbarAttr = $richTextEditor.getAttribute(\n 'data-moj-rich-text-editor-toolbar'\n )\n\n if (toolbarAttr) {\n const toolbar = toolbarAttr.split(',')\n\n options.toolbar = {}\n\n for (const item in toolbar) {\n options.toolbar[toolbar[item]] = true\n }\n }\n\n new RichTextEditor(options)\n })\n\n const $searchToggles = scope.querySelectorAll(\n '[data-module=\"moj-search-toggle\"]'\n )\n\n nodeListForEach($searchToggles, function ($searchToggle) {\n new SearchToggle({\n toggleButton: {\n container: $($searchToggle.querySelector('.moj-search-toggle__toggle')),\n text: $searchToggle.getAttribute('data-moj-search-toggle-text')\n },\n search: {\n container: $($searchToggle.querySelector('.moj-search'))\n }\n })\n })\n\n const $sortableTables = scope.querySelectorAll(\n '[data-module=\"moj-sortable-table\"]'\n )\n\n nodeListForEach($sortableTables, function ($table) {\n new SortableTable({\n table: $table\n })\n })\n\n const $datepickers = scope.querySelectorAll('[data-module=\"moj-date-picker\"]')\n\n nodeListForEach($datepickers, function ($datepicker) {\n new DatePicker($datepicker, {}).init()\n })\n\n const $buttonMenus = scope.querySelectorAll('[data-module=\"moj-button-menu\"]')\n\n nodeListForEach($buttonMenus, function ($buttonmenu) {\n new ButtonMenu($buttonmenu, {}).init()\n })\n\n const $alerts = scope.querySelectorAll('[data-module=\"moj-alert\"]')\n nodeListForEach($alerts, function ($alert) {\n new Alert($alert, {}).init()\n })\n}\n\nexport {\n initAll,\n version,\n\n // Components\n AddAnother,\n Alert,\n ButtonMenu,\n DatePicker,\n FilterToggleButton,\n MultiFileUpload,\n MultiSelect,\n PasswordReveal,\n RichTextEditor,\n SearchToggle,\n SortableTable\n}\n","export const version = '0.0.0-development'\n"],"names":["AddAnother","container","this","$","data","on","proxy","find","prop","nodeListForEach","nodes","callback","window","NodeList","prototype","forEach","i","length","call","setFocus","$element","options","isFocusable","getAttribute","onBlur","removeAttribute","setAttribute","addEventListener","once","onBeforeFocus","focus","Alert","$module","config","schema","Object","freeze","properties","dismissible","type","dismissText","disableAutoFocus","focusOnDismissSelector","mergeConfigs","parseDataset","dataset","ButtonMenu","buttonText","buttonClasses","alignMenu","DatePicker","excludedDates","excludedDays","leadingZeros","maxDate","minDate","weekStartDay","dayLabels","monthLabels","currentDate","Date","setHours","calendarDays","buttonClass","selectedDayButtonClass","currentDayButtonClass","todayButtonClass","$input","querySelector","DSCalendarDay","button","index","row","column","picker","date","FilterToggleButton","toggleButton","filterContainer","filter","createToggleButton","setupResponsiveChecks","attr","startHidden","hideMenu","MultiFileUpload","params","document","createElement","ondrop","FormData","input","files","fileApiSupported","defaultParams","uploadFileEntryHook","noop","uploadFileExitHook","uploadFileErrorHook","fileDeleteHook","uploadStatusText","dropzoneHintText","dropzoneButtonText","extend","addClass","feedbackContainer","setupFileInput","setupDropzone","setupLabel","setupStatusBox","MultiSelect","idPrefix","id_prefix","allId","toggle","getToggleHtml","append","checkboxes","checked","PasswordReveal","element","el","$el","wrap","parent","createButton","RichTextEditor","documentElement","toolbar","bold","italic","underline","bullets","numbers","textarea","createToolbar","hideDefault","configureToolbar","keys","left","right","up","down","SearchToggle","search","toggleButtonContainer","text","onDocumentClick","bind","SortableTable","table","setupOptions","body","createHeadingButtons","createStatusBox","initialiseSortedColumn","onAddButtonClick","e","item","getNewItem","updateAttributes","getItems","resetItem","firstItem","first","hasRemoveButton","createRemoveButton","last","after","clone","each","originalId","id","name","replace","siblings","parents","htmlFor","value","onRemoveButtonClick","currentTarget","remove","items","focusHeading","get","init","$dismissButton","innerHTML","event","contains","target","dimiss","$elementToRecieveFocus","$nextSibling","nextElementSibling","matches","selector","$sibling","previousElementSibling","getPreviousSibling","$currentElement","parentElement","findNearestMatchingElement","normaliseString","property","trimmedValue","trim","output","outputType","includes","isFinite","Number","parsed","field","entries","configObjects","formattedConfigObject","configObject","key","option","override","children","classList","className","startsWith","add","split","initMenu","$menu","createMenu","insertAdjacentHTML","toggleTemplate","setupMenuItems","$menuToggle","querySelectorAll","toggleMenu","handleKeyDown","closeMenu","hidden","appendChild","firstChild","Array","from","listItem","insertBefore","tagName","setTimeout","isOpen","preventDefault","focusIndex","detail","openMenu","focusItem","moveFocus","menuItem","currentFocusIndex","activeElement","indexOf","initialized","setOptions","initControls","$dialog","createDialog","createCalendarHeaders","$componentWrapper","$inputWrapper","parentNode","insertAdjacentElement","$calendarButton","$dialogTitle","createCalendar","$prevMonthButton","$prevYearButton","$nextMonthButton","$nextYearButton","$cancelButton","$okButton","focusPreviousMonth","focusPreviousYear","focusNextMonth","focusNextYear","closeDialog","selectDate","dialogButtons","$firstButtonInDialog","$lastButtonInDialog","firstButtonKeydown","lastButtonKeydown","toggleDialog","stopPropagation","backgroundClick","updateCalendar","titleId","dialogTemplate","$tbody","dayCount","$row","insertRow","j","$cell","$dateButton","calendarDay","push","day","html","substring","ret","toString","setMinAndMaxDatesOnCalendar","setExcludedDates","setExcludedDays","setLeadingZeros","setWeekStartDay","formattedDateFromString","map","parseDateRangeString","flat","datestring","dates","startDate","endDate","d","getTime","setDate","getDate","weekDays","toLowerCase","unshift","pop","weekStartDayParam","isExcludedDate","excludedDate","toDateString","getDay","dateString","fallback","formattedDate","dateFormatPattern","test","match","month","year","isNaN","formattedDateFromDate","getMonth","getFullYear","formattedDateHuman","shiftKey","firstOfMonth","dayOfWeek","thisDay","disabled","update","setCurrentDate","calendarDayDate","today","inputDate","enabledDays","getComputedStyle","display","innerText","changeEvent","Event","bubbles","cancelable","dispatchEvent","openDialog","offsetWidth","style","top","offsetHeight","goToDate","current","focusNextDay","focusPreviousDay","focusNextWeek","focusPreviousWeek","focusFirstDayOfWeek","firstDayOfWeekIndex","diff","focusLastDayOfWeek","lastDayOfWeekIndex","setMonth","setFullYear","keyPress","click","label","accessibleLabel","calendarNavKey","mq","matchMedia","bigModeMediaQuery","addListener","checkMode","menuButton","classes","showText","enableBigMode","enableSmallMode","showMenu","removeCloseButton","addCloseButton","closeButton","onCloseClick","removeClass","hideText","onMenuButtonClick","fileInput","dropzone","status","onDragOver","onDragLeave","onDrop","uploadFiles","originalEvent","dataTransfer","uploadFile","onFileChange","replaceWith","val","onFileFocus","onFileBlur","getSuccessHtml","success","messageHtml","getErrorHtml","error","message","getFileRowHtml","file","getDeleteButtonHtml","filename","originalname","formData","ajax","url","uploadUrl","processData","contentType","response","messageText","jqXHR","textStatus","errorThrown","xhr","XMLHttpRequest","upload","lengthComputable","percentComplete","loaded","total","parseInt","onFileDeleteClick","deleteUrl","dataType","onButtonClick","uncheckAll","checkAll","onCheckboxClick","onToolbarKeydown","focusableButton","keyCode","nextButton","next","previousButton","prev","getToolbarHtml","getEnhancedHtml","buttons","execCommand","getContent","onEditorInput","updateTextarea","onLabelClick","onToggleButtonClick","statusMessage","ascendingText","descendingText","headings","heading","createHeadingButton","rows","getTableRowsArray","sortDirection","columnNumber","sortedRows","sort","addRows","onSortButtonClick","newSortDirection","removeButtonStates","updateButtonState","direction","trs","rowA","rowB","tdA","eq","tdB","valueA","getCellValue","valueB","localeCompare","cell","valAsNumber","exports","initAll","scope","$addAnother","$multiSelect","$passwordReveal","$richTextEditor","toolbarAttr","$searchToggle","$table","$datepicker","$buttonmenu","$alert","version"],"mappings":"2xqFAEA,SAAAA,EAAAC,GACAC,KAAAD,UAAAE,EAAAF,GAEAC,KAAAD,UAAAG,KAAA,iCAIAF,KAAAD,UAAAG,KAAA,+BAAA,GAEAF,KAAAD,UAAAI,GACA,QACA,kCACAF,EAAAG,MAAAJ,KAAA,wBAEAA,KAAAD,UAAAI,GACA,QACA,+BACAF,EAAAG,MAAAJ,KAAA,qBAEAA,KAAAD,UACAM,KAAA,gEACAC,KAAA,OAAA,UACA,CCqBO,SAASC,EAAgBC,EAAOC,GACrC,GAAIC,OAAOC,SAASC,UAAUC,QAC5B,OAAOL,EAAMK,QAAQJ,GAEvB,IAAK,IAAIK,EAAI,EAAGA,EAAIN,EAAMO,OAAQD,IAChCL,EAASO,KAAKN,OAAQF,EAAMM,GAAIA,EAAGN,EAEvC,CA4FO,SAASS,EAASC,EAAUC,EAAU,IAC3C,MAAMC,EAAcF,EAASG,aAAa,YAgB1C,SAASC,IACHH,EAAQG,QACVH,EAAQG,OAAON,KAAKE,GAGjBE,GACHF,EAASK,gBAAgB,WAE/B,CAtBOH,GACHF,EAASM,aAAa,WAAY,MAwBpCN,EAASO,iBAAiB,SAlB1B,WACEP,EAASO,iBAAiB,OAAQH,EAAQ,CAAEI,MAAM,GACtD,GAgB8C,CAAEA,MAAM,IAGhDP,EAAQQ,eACVR,EAAQQ,cAAcX,KAAKE,GAE7BA,EAASU,OACX,CChKO,SAASC,EAAMC,EAASC,EAAS,IACtC,IAAKD,EACH,OAAO9B,KAGT,MAAMgC,EAASC,OAAOC,OAAO,CAC3BC,WAAY,CACVC,YAAa,CAAEC,KAAM,WACrBC,YAAa,CAAED,KAAM,UACrBE,iBAAkB,CAAEF,KAAM,WAC1BG,uBAAwB,CAAEH,KAAM,aAWpCrC,KAAK+B,OAAS/B,KAAKyC,aAPF,CACfL,aAAa,EACbE,YAAa,UACbC,kBAAkB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