{"version":3,"file":"question-checkbox-tree.bundle.mjs","sources":["../../../../src/digitalmarketplace/components/question-checkbox-tree/question-checkbox-tree.ts"],"sourcesContent":["import { DigitalMarketplaceFrontendComponent } from '../../digitalmarketplace-frontend-component'\n\nclass QuestionCheckboxTreeSummary {\n  $totalSelected: JQuery<HTMLElement>\n  $totalSelectedText: JQuery<HTMLElement>\n  itemNameSingular: string\n  itemNamePlural: string\n\n  constructor ($summary: JQuery<HTMLElement>, itemNameSingular: string, itemNamePlural: string) {\n    this.$totalSelected = $summary.find('.dm-checkbox-tree__summary-total-selected')\n    this.$totalSelectedText = $summary.find('.dm-checkbox-tree__summary-total-selected-text')\n    this.itemNameSingular = itemNameSingular\n    this.itemNamePlural = itemNamePlural\n  }\n\n  updateSelectedCount = (numberSelected: number) => {\n    this.$totalSelected.text(numberSelected)\n\n    if (numberSelected === 1) {\n      this.$totalSelectedText.text(`${this.itemNameSingular} selected.`)\n    } else {\n      this.$totalSelectedText.text(`${this.itemNamePlural} selected.`)\n    }\n  }\n}\n\nclass QuestionCheckboxTreeSection {\n  checkboxTree: QuestionCheckboxTree\n  $section: JQuery<HTMLDetailsElement>\n  $summaryTag: JQuery<HTMLElement>\n  $summaryTagCount: JQuery<HTMLElement>\n  tier: number\n  checkboxTreeSections: QuestionCheckboxTreeSection[]\n  checkboxes: JQuery<HTMLInputElement>[]\n  isParent: boolean\n\n  constructor (checkboxTree: QuestionCheckboxTree, $section: JQuery<HTMLDetailsElement>, tier: number) {\n    this.checkboxTree = checkboxTree\n    this.$section = $section\n    this.tier = tier\n    this.$summaryTag = this.$section.find('> .dm-checkbox-tree-details__summary .govuk-tag')\n    this.$summaryTagCount = this.$summaryTag.find('.dm-checkbox-tree-details__summary-text-count-selected')\n    this.checkboxTreeSections = this.$section.find('> .dm-checkbox-tree-details__text > .dm-checkbox-tree-details').get().map((element) => new QuestionCheckboxTreeSection(this.checkboxTree, $(element as HTMLDetailsElement), tier + 1))\n    this.checkboxes = this.$section.find<HTMLInputElement>(`${this.$section.prop('tagName') === 'DETAILS' ? '> .dm-checkbox-tree-details__text > .govuk-form-group > .govuk-checkboxes > .govuk-checkboxes__item > ' : ''}.govuk-checkboxes__input`).get().map((element) => $(element))\n    this.isParent = this.checkboxTreeSections.length > 0\n  }\n\n  init = () => {\n    this.openSectionIfSelected()\n\n    if (this.isParent) {\n      this.checkboxTreeSections.forEach((checkboxTreeSection) => checkboxTreeSection.init())\n    } else {\n      this.checkboxes.forEach(($checkbox) => {\n        $checkbox.on('click', () => {\n          this.checkboxTree.updateTotals($checkbox.val(), $checkbox.is(':checked'))\n        })\n      })\n    }\n\n  }\n\n  private selectedItems = () => {\n    return this.checkboxes.filter(($checkbox) => $checkbox.is(':checked'))\n  }\n\n  private openSectionIfSelected = () => {\n    if (this.countSelected() > 0 && this.$section.attr('open') !== 'open') {\n      this.$section.attr('open', 'open')\n    }\n  }\n\n  countSelected = (): number => {\n    if (this.isParent) {\n      return this.checkboxTreeSections.reduce((total, checkboxTreeSection) => total + checkboxTreeSection.countSelected(), 0)\n    } else {\n      return this.selectedItems().length\n    }\n  }\n\n  slectedItemValues = (): (string | undefined)[] => {\n    if (this.isParent) {\n      return this.checkboxTreeSections.map((checkboxTreeSection) => checkboxTreeSection.slectedItemValues()).flat()\n    } else {\n      return this.selectedItems().map(($checkbox) => $checkbox.val())\n    }\n  }\n\n  updateSelectedCount = () => {\n    const numberSelected = this.countSelected()\n\n    if (numberSelected > 0) {\n      this.$summaryTagCount.text(numberSelected)\n      this.$summaryTag.toggleClass('govuk-visually-hidden', false)\n    } else {\n      this.$summaryTag.toggleClass('govuk-visually-hidden', true)\n      this.$summaryTagCount.text('')\n    }\n\n    if (this.isParent) {\n      this.checkboxTreeSections.forEach((checkboxTreeSection) => checkboxTreeSection.updateSelectedCount())\n    }\n  }\n\n  updateSectionLocks = (fromTier: number) => {\n    if (this.countSelected()) {\n      if (this.tier === fromTier) {\n        this.checkboxTreeSections.forEach((checkboxTreeSection) => checkboxTreeSection.toggleSectionLock(false))\n      } else {\n        this.checkboxTreeSections.forEach((checkboxTreeSection) => checkboxTreeSection.updateSectionLocks(fromTier))\n      }\n    } else {\n      this.toggleSectionLock(true)\n    }\n  }\n\n  toggleSectionLock = (isLocked: boolean) => {\n    if (this.isParent) {\n      this.checkboxTreeSections.forEach((checkboxTreeSection) => checkboxTreeSection.toggleSectionLock(isLocked))\n    } else {\n      this.checkboxes.forEach((checkbox) => checkbox.prop('disabled', isLocked))\n    }\n\n    if (isLocked) {\n      this.$section.attr('disabled', 'disabled')\n      this.$section.attr('tabIndex', -1)\n      this.$section.removeAttr('open')\n    } else {\n      this.$section.removeAttr('disabled')\n      this.$section.removeAttr('tabIndex')\n    }\n  }\n\n  toggleCheckbox = (value: string | undefined, isChecked: boolean) => {\n    if (this.isParent) {\n      this.checkboxTreeSections.forEach((checkboxTreeSection) => checkboxTreeSection.toggleCheckbox(value, isChecked))\n    } else {\n      this.checkboxes.forEach(($checkbox) => {\n        if ($checkbox.val() === value) {\n          $checkbox.prop('checked', isChecked)\n        }\n      })\n    }\n  }\n}\n\nclass QuestionCheckboxTree implements DigitalMarketplaceFrontendComponent {\n  static moduleName = 'dm-question-checkbox-tree'\n  $checkboxTree: JQuery<HTMLElement>\n  checkboxTreeSummary: QuestionCheckboxTreeSummary\n  checkboxTreeSections: QuestionCheckboxTreeSection[]\n  tierLimit: number\n  currentCount: number = 0\n  \n  constructor ($checkboxTree: JQuery<HTMLElement>) {\n    this.$checkboxTree = $checkboxTree\n    this.checkboxTreeSummary = new QuestionCheckboxTreeSummary(this.$checkboxTree.find('.dm-checkbox-tree__summary'), this.$checkboxTree.data('itemNameSingular'), this.$checkboxTree.data('itemNamePlural'))\n    this.tierLimit = this.$checkboxTree.data('tierRestriction') || 0\n\n    const checkboxTreeSections = this.$checkboxTree.find<HTMLDetailsElement>('.dm-checkbox-tree__options > .dm-checkbox-tree-details').get().map((element) => new QuestionCheckboxTreeSection(this, $(element), 1))\n\n    if (checkboxTreeSections.length) {\n      this.checkboxTreeSections = checkboxTreeSections\n    } else {\n      this.checkboxTreeSections = [new QuestionCheckboxTreeSection(this, $('.dm-checkbox-tree__options'), 1)]\n    }\n  }\n\n  init = () => {\n    this.checkboxTreeSections.forEach((checkboxTreeSection) => checkboxTreeSection.init())\n\n    this.updateCheckboxTreeSummaryCount()\n    this.updateCheckboxTreeSectionSelectedCounts()\n    this.updateSectionLocks()\n  }\n\n  private countSelected = () => {\n    return new Set(this.checkboxTreeSections.map((checkboxTreeSection) => checkboxTreeSection.slectedItemValues()).flat()).size\n  }\n\n  private updateCheckboxTreeSummaryCount = () => {\n    this.currentCount = this.countSelected()\n    this.checkboxTreeSummary.updateSelectedCount(this.currentCount)\n  }\n\n  private updateCheckboxTreeSectionSelectedCounts = () => {\n    this.checkboxTreeSections.forEach((checkboxTreeSection) => checkboxTreeSection.updateSelectedCount())\n  }\n\n  private updateSectionLocks = () => {\n    if (!this.tierLimit) return\n\n    this.checkboxTreeSections.forEach((checkboxTreeSection) => {\n      if (this.currentCount === 0) {\n        checkboxTreeSection.toggleSectionLock(false)\n      } else {\n        checkboxTreeSection.updateSectionLocks(this.tierLimit)\n      }\n    })\n  }\n\n  updateTotals = (value: string | undefined, isChecked: boolean) => {\n    this.checkboxTreeSections.forEach((checkboxTreeSection) => checkboxTreeSection.toggleCheckbox(value, isChecked))\n\n    this.updateCheckboxTreeSummaryCount()\n    this.updateCheckboxTreeSectionSelectedCounts()\n    this.updateSectionLocks()\n  }\n}\n\nexport { QuestionCheckboxTree }\n"],"names":[],"mappings":"AAEA,MAAM,2BAA2B,CAAA;AAC/B,IAAA,cAAc;AACd,IAAA,kBAAkB;AAClB,IAAA,gBAAgB;AAChB,IAAA,cAAc;AAEd,IAAA,WAAA,CAAa,QAA6B,EAAE,gBAAwB,EAAE,cAAsB,EAAA;QAC1F,IAAI,CAAC,cAAc,GAAG,QAAQ,CAAC,IAAI,CAAC,2CAA2C,CAAC;QAChF,IAAI,CAAC,kBAAkB,GAAG,Q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