UNPKG

digitalmarketplace-frontend

Version:

Digital Marketplace Frontend contains assets and components used in Digital Marketplace projects

1 lines 22.1 kB
{"version":3,"file":"compliance-communication-attachments.mjs","sources":["../../../../src/digitalmarketplace/components/compliance-communication-attachments/compliance-communication-attachments.ts"],"sourcesContent":["import { DigitalMarketplaceFrontendComponent } from '../../digitalmarketplace-frontend-component'\nimport { FileUpload } from 'govuk-frontend/dist/govuk/all.mjs'\n\n\nclass ComplianceCommunicationAttachmentListRowFileInput {\n $dropZone: JQuery<HTMLElement>\n $input: JQuery<HTMLInputElement>\n $label: JQuery<HTMLLabelElement>\n $hint: JQuery<HTMLElement>\n $button: JQuery<HTMLButtonElement>\n $comma: JQuery<HTMLElement>\n $announcements: JQuery<HTMLElement>\n\n constructor ($row: JQuery<HTMLElement>, column: number) {\n const $column = $row.find(`.govuk-grid-column-one-half:nth-of-type(${column})`)\n\n this.$dropZone = $column.find('.govuk-drop-zone')\n this.$input = $column.find('input')\n this.$label = $column.find<HTMLLabelElement>('.govuk-label')\n this.$hint = $column.find('div.govuk-hint')\n this.$button = $column.find('button')\n this.$comma = $column.find('button > span.govuk-visually-hidden')\n this.$announcements = $column.find('span.govuk-file-upload-announcements')\n }\n\n updateIndex (newIndex: number) {\n const newName = (this.$input.attr('name') as string).replace(/\\d+/, newIndex.toString())\n const newId = `input-${newName}`\n\n if (this.$button.length) {\n this.$label.attr('for', newId)\n this.$label.attr('id', `${newId}-label`)\n \n this.$hint.attr('id', `${newId}-hint`)\n \n this.$input.attr('id', `${newId}-input`)\n this.$input.attr('name', newName)\n this.$input.attr('aria-describedby', `${newId}-hint`)\n \n this.$button.attr('id', newId)\n this.$button.attr('aria-describedby', `${newId}-hint`)\n this.$button.attr('aria-labelledby', `${newId}-label ${newId}-comma ${newId}`)\n \n this.$comma.attr('id', `${newId}-comma`)\n } else {\n this.$label.attr('for', newId)\n this.$hint.attr('id', `${newId}-hint`)\n \n this.$input.attr('id', newId)\n this.$input.attr('name', newName)\n this.$input.attr('aria-describedby', `${newId}-hint`)\n }\n }\n\n makeInteractable () {\n if (!this.$button.length) {\n return new FileUpload(this.$dropZone.get(0) as HTMLElement)\n }\n }\n\n resetHtml () {\n this.$label.removeAttr('id')\n \n this.$dropZone.removeAttr('data-govuk-file-upload-init')\n \n this.$button.remove()\n \n const id = this.$input.attr('id') as string\n\n this.$input.removeAttr('hidden')\n this.$input.removeAttr('aria-hidden')\n this.$input.attr('id', id.substring(0, id.length - 6))\n\n this.$announcements.remove()\n }\n}\n\nclass ComplianceCommunicationAttachmentListRequiredInput {\n $requiredSection: JQuery<HTMLElement>\n $input: JQuery<HTMLInputElement>\n $label: JQuery<HTMLLabelElement>\n\n constructor ($row: JQuery<HTMLElement>) {\n this.$requiredSection = $row.find('.dm-compliance-communication__attachments-item-required')\n this.$input = this.$requiredSection.find<HTMLInputElement>('.govuk-checkboxes__item > input')\n this.$label = this.$requiredSection.find<HTMLLabelElement>('.govuk-checkboxes__item > .govuk-label')\n }\n\n isChecked () {\n return this.$input.is(':checked')\n }\n\n updateIndex (newIndex: number) {\n const newName = (this.$input.attr('name') as string).replace(/\\d+/, newIndex.toString())\n const newId = `input-${newName}`\n\n this.$label.attr('for', newId)\n\n this.$input.attr('id', newId)\n this.$input.attr('name', newName)\n }\n\n checkRow () {\n this.$requiredSection.toggleClass('govuk-visually-hidden', true)\n this.$input.prop('checked', true)\n this.$input.attr('tabindex', -1)\n this.$input.attr('tabindex', -1)\n }\n}\n\nclass ComplianceCommunicationAttachmentListRowRemoveButton {\n attachmentListRow: ComplianceCommunicationAttachmentListRow\n $button: JQuery<HTMLElement>\n $removeButtonCounter: JQuery<HTMLElement>\n\n constructor (attachmentListRow: ComplianceCommunicationAttachmentListRow, $row: JQuery<HTMLElement>) {\n this.attachmentListRow = attachmentListRow\n this.$button = $row.find('.dm-compliance-communication__attachments-item-remove')\n this.$removeButtonCounter = this.$button.find('.dm-compliance-communication__attachments-item-remove-counter')\n }\n\n init () {\n this.toggleVisibility(true)\n\n this.$button.on('click', () => {\n this.attachmentListRow.removeRow()\n })\n }\n\n toggleVisibility (isShown: boolean) {\n this.$button.toggleClass('govuk-visually-hidden', !isShown)\n\n if (isShown) {\n this.$button.removeAttr('tabindex')\n } else {\n this.$button.attr('tabindex', -1)\n }\n }\n\n updateIndex (newIndex: number) {\n this.$removeButtonCounter.text(newIndex + 1)\n }\n}\n\nclass ComplianceCommunicationAttachmentListRow {\n $row: JQuery<HTMLElement>\n attachmentList: ComplianceCommunicationAttachments\n index: number\n $legendCounter: JQuery<HTMLElement>\n attachmentListRowFileInput: ComplianceCommunicationAttachmentListRowFileInput\n attachmentListRowRequiredInput: ComplianceCommunicationAttachmentListRequiredInput\n attachmentListRowRemoveButton: ComplianceCommunicationAttachmentListRowRemoveButton\n\n constructor (attachmentList: ComplianceCommunicationAttachments, index: number, $row: JQuery<HTMLElement>) {\n this.$row = $row\n this.attachmentList = attachmentList\n this.index = index\n this.$legendCounter = this.$row.find('.dm-compliance-communication__attachments-item-legend-counter')\n this.attachmentListRowFileInput = new ComplianceCommunicationAttachmentListRowFileInput($row, 1)\n this.attachmentListRowRequiredInput = new ComplianceCommunicationAttachmentListRequiredInput($row)\n this.attachmentListRowRemoveButton = new ComplianceCommunicationAttachmentListRowRemoveButton(this, $row)\n }\n\n init () {\n this.attachmentListRowRemoveButton.init()\n this.attachmentListRowFileInput.makeInteractable()\n this.attachmentListRowRequiredInput.checkRow()\n }\n\n updateIndex (newIndex: number) {\n this.index = newIndex\n this.attachmentListRowFileInput.updateIndex(newIndex)\n this.attachmentListRowRequiredInput.updateIndex(newIndex)\n this.attachmentListRowRemoveButton.updateIndex(newIndex)\n this.$legendCounter.text(newIndex + 1)\n }\n\n removeRow () {\n this.attachmentList.removeRow(this.index)\n this.deleteRow()\n }\n\n deleteRow () {\n this.$row.remove()\n }\n\n toggleRemoveButtonVisibility (isShown: boolean) {\n this.attachmentListRowRemoveButton.toggleVisibility(isShown)\n }\n\n isRowChecked () {\n return this.attachmentListRowRequiredInput.isChecked()\n }\n}\n\nclass ComplianceCommunicationAttachmentListAddButton {\n attachmentList: ComplianceCommunicationAttachments\n $button: JQuery<HTMLButtonElement>\n $buttonCounter: JQuery<HTMLElement>\n\n constructor (attachmentList: ComplianceCommunicationAttachments, $button: JQuery<HTMLButtonElement>) {\n this.attachmentList = attachmentList\n this.$button = $button\n this.$buttonCounter = $button.find('.dm-compliance-communication__attachments__js-remaining-counter')\n }\n\n init (numberOfRows: number) {\n this.$button.on('click', () => {\n this.attachmentList.addRow()\n })\n\n this.updateButtonText(this.attachmentList.maxNumberOfAttachments - numberOfRows)\n }\n\n updateButtonText (numberRemaining: number) {\n this.$buttonCounter.text(numberRemaining)\n }\n\n toggleVisibility (isShown: boolean) {\n this.$button.toggleClass('govuk-visually-hidden', !isShown)\n\n if (isShown) {\n this.$button.removeAttr('tabindex')\n } else {\n this.$button.attr('tabindex', -1)\n }\n }\n}\n\nclass ComplianceCommunicationAttachments implements DigitalMarketplaceFrontendComponent {\n static moduleName = 'dm-compliance-communication-attachments'\n $attachmentList: JQuery<HTMLElement>\n $attachmentListItems: JQuery<HTMLElement>\n attachmentListRows: ComplianceCommunicationAttachmentListRow[]\n attachmentListTemplateRow: ComplianceCommunicationAttachmentListRow\n attachmentListAddButton: ComplianceCommunicationAttachmentListAddButton\n maxNumberOfAttachments: number\n\n constructor ($attachmentList: JQuery<HTMLElement>) {\n this.$attachmentList = $attachmentList\n this.$attachmentListItems = this.$attachmentList.find('.dm-compliance-communication__attachments-items')\n this.attachmentListRows = this.$attachmentListItems.find('.dm-compliance-communication__attachments-item').get().map((row, index) => new ComplianceCommunicationAttachmentListRow(this, index, $(row)))\n this.attachmentListTemplateRow = new ComplianceCommunicationAttachmentListRow(this, 99, this.$attachmentList.find('.dm-compliance-communication__attachments-item-template > .dm-compliance-communication__attachments-item'))\n this.attachmentListAddButton = new ComplianceCommunicationAttachmentListAddButton(this, this.$attachmentList.find<HTMLButtonElement>('.dm-compliance-communication__attachments-add'))\n this.maxNumberOfAttachments = this.$attachmentList.data('maxNumberOfAttachments')\n }\n\n init () {\n const rowsChecked = this.attachmentListRows.map((attachmentListRow) => attachmentListRow.isRowChecked())\n let indexToDeleteFrom\n\n if (rowsChecked.every((rowChecked) => !rowChecked)) {\n indexToDeleteFrom = 0\n } else {\n indexToDeleteFrom = rowsChecked.indexOf(false)\n }\n\n if (indexToDeleteFrom >= 0) {\n this.attachmentListRows.slice(indexToDeleteFrom).forEach((attachmentListRow) => attachmentListRow.deleteRow())\n this.attachmentListRows.splice(indexToDeleteFrom)\n }\n\n this.attachmentListAddButton.init(this.attachmentListRows.length)\n this.attachmentListRows.forEach((attachmentListRow) => attachmentListRow.init())\n\n this.attachmentListTemplateRow.attachmentListRowFileInput.resetHtml()\n\n this.updateIfMinRows()\n this.updateAttachmentButton()\n }\n\n removeRow (indexToRemove: number) {\n this.attachmentListRows.splice(indexToRemove, 1)\n\n this.attachmentListRows.slice(indexToRemove).forEach((attachmentListRow, index) => {\n attachmentListRow.updateIndex(indexToRemove + index)\n })\n\n this.updateIfMinRows()\n this.updateAttachmentButton()\n\n if (indexToRemove > 0) {\n this.focusOnRow(indexToRemove)\n } else {\n this.attachmentListAddButton.$button.focus()\n }\n }\n\n addRow () {\n const numberOfRows = this.attachmentListRows.length\n\n if (numberOfRows < this.maxNumberOfAttachments) {\n const $newRow = this.attachmentListTemplateRow.$row.clone()\n const attachmentListRow = new ComplianceCommunicationAttachmentListRow(this, numberOfRows, $newRow)\n\n attachmentListRow.updateIndex(numberOfRows)\n\n this.attachmentListRows.push(attachmentListRow)\n this.$attachmentListItems.append($newRow)\n this.attachmentListRows[numberOfRows].init()\n\n this.updateIfMinRows()\n this.updateAttachmentButton()\n this.focusOnRow(numberOfRows)\n }\n }\n\n updateIfMinRows () {\n if (this.attachmentListRows.length !== 0) {\n this.attachmentListRows[0].toggleRemoveButtonVisibility(true)\n }\n }\n\n updateAttachmentButton () {\n if (this.attachmentListRows.length === this.maxNumberOfAttachments) {\n this.attachmentListAddButton.toggleVisibility(false)\n } else {\n this.attachmentListAddButton.toggleVisibility(true)\n this.attachmentListAddButton.updateButtonText(this.maxNumberOfAttachments - this.attachmentListRows.length)\n }\n }\n\n focusOnRow (targetIndexToFocus: number) {\n const numberOfRows = this.attachmentListRows.length\n let indexToFocus = targetIndexToFocus\n\n if (targetIndexToFocus >= numberOfRows) {\n indexToFocus = numberOfRows - 1\n }\n\n this.attachmentListRows[indexToFocus].attachmentListRowFileInput.$button.focus()\n }\n}\n\nexport { ComplianceCommunicationAttachments }\n"],"names":[],"mappings":";;AAIA,MAAM,iDAAiD,CAAA;AACrD,IAAA,SAAS;AACT,IAAA,MAAM;AACN,IAAA,MAAM;AACN,IAAA,KAAK;AACL,IAAA,OAAO;AACP,IAAA,MAAM;AACN,IAAA,cAAc;IAEd,WAAA,CAAa,IAAyB,EAAE,MAAc,EAAA;QACpD,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,CAAA,wCAAA,EAA2C,MAAM,CAAA,CAAA,CAAG,CAAC;QAE/E,IAAI,CAAC,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,kBAAkB,CAAC;QACjD,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC;QACnC,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,IAAI,CAAmB,cAAc,CAAC;QAC5D,IAAI,CAAC,KAAK,GAAG,OAAO,CAAC,IAAI,CAAC,gBAAgB,CAAC;QAC3C,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC;QACrC,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,qCAAqC,CAAC;QACjE,IAAI,CAAC,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,sCAAsC,CAAC;IAC5E;AAEA,IAAA,WAAW,CAAE,QAAgB,EAAA;QAC3B,MAAM,OAAO,GAAI,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM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