TP_JO2024/home/dist/component/header/header.nomodule.min.js.map
2024-03-27 17:19:37 +01:00

1 line
No EOL
7.7 KiB
Text

{"version":3,"file":"header.nomodule.min.js","sources":["../../../.config/config.js","../../../src/core/api.js","../../../src/component/header/script/header/header-selector.js","../../../src/component/header/script/header/header-links.js","../../../src/component/header/script/header/header-modal.js","../../../src/component/header/index.js","../../../src/component/header/main.js"],"sourcesContent":["const config = {\r\n prefix: 'fr',\r\n namespace: 'dsfr',\r\n organisation: '@gouvfr',\r\n version: '1.11.2'\r\n};\r\n\r\nexport default config;\r\n","import config from './config.js';\nconst api = window[config.namespace];\nexport default api;\n","import api from '../../api.js';\n\nexport const HeaderSelector = {\n HEADER: api.internals.ns.selector('header'),\n TOOLS_LINKS: api.internals.ns.selector('header__tools-links'),\n MENU_LINKS: api.internals.ns.selector('header__menu-links'),\n BUTTONS: `${api.internals.ns.selector('header__tools-links')} ${api.internals.ns.selector('btns-group')}, ${api.internals.ns.selector('header__tools-links')} ${api.internals.ns.selector('links-group')}`,\n MODALS: `${api.internals.ns.selector('header__search')}${api.internals.ns.selector('modal')}, ${api.internals.ns.selector('header__menu')}${api.internals.ns.selector('modal')}`\n};\n","import api from '../../api.js';\nimport { HeaderSelector } from './header-selector.js';\n\nclass HeaderLinks extends api.core.Instance {\n static get instanceClassName () {\n return 'HeaderLinks';\n }\n\n init () {\n const header = this.queryParentSelector(HeaderSelector.HEADER);\n this.toolsLinks = header.querySelector(HeaderSelector.TOOLS_LINKS);\n this.menuLinks = header.querySelector(HeaderSelector.MENU_LINKS);\n const copySuffix = '-mobile';\n\n const toolsHtml = this.toolsLinks.innerHTML.replace(/ +/g, ' ');\n const menuHtml = this.menuLinks.innerHTML.replace(/ +/g, ' ');\n // Pour éviter de dupliquer des id, on ajoute un suffixe aux id et aria-controls duppliqués.\n let toolsHtmlIdList = toolsHtml.match(/id=\"(.*?)\"/gm) || [];\n\n // on a besoin d'échapper les backslash dans la chaine de caractère\n // eslint-disable-next-line no-useless-escape\n toolsHtmlIdList = toolsHtmlIdList.map(element => element.replace('id=\\\"', '').replace('\\\"', ''));\n\n const toolsHtmlAriaControlList = toolsHtml.match(/aria-controls=\"(.*?)\"/gm);\n let toolsHtmlDuplicateId = toolsHtml.replace(/id=\"(.*?)\"/gm, 'id=\"$1' + copySuffix + '\"');\n if (toolsHtmlAriaControlList) {\n for (const element of toolsHtmlAriaControlList) {\n const ariaControlsValue = element.replace('aria-controls=\"', '').replace('\"', '');\n if (toolsHtmlIdList.includes(ariaControlsValue)) {\n toolsHtmlDuplicateId = toolsHtmlDuplicateId.replace(`aria-controls=\"${ariaControlsValue}\"`, `aria-controls=\"${ariaControlsValue + copySuffix}\"`);\n };\n }\n }\n\n if (toolsHtmlDuplicateId === menuHtml) return;\n\n switch (api.mode) {\n case api.Modes.ANGULAR:\n case api.Modes.REACT:\n case api.Modes.VUE:\n this.warn(`header__tools-links content is different from header__menu-links content.\nAs you're using a dynamic framework, you should handle duplication of this content yourself, please refer to documentation:\n${api.header.doc}`);\n break;\n\n default:\n this.menuLinks.innerHTML = toolsHtmlDuplicateId;\n }\n }\n}\n\nexport { HeaderLinks };\n","import api from '../../api.js';\n\nclass HeaderModal extends api.core.Instance {\n static get instanceClassName () {\n return 'HeaderModal';\n }\n\n init () {\n this.isResizing = true;\n }\n\n resize () {\n if (this.isBreakpoint(api.core.Breakpoints.LG)) this.deactivateModal();\n else this.activateModal();\n }\n\n activateModal () {\n const modal = this.element.getInstance('Modal');\n if (!modal) return;\n modal.isEnabled = true;\n this.listenClick({ capture: true });\n }\n\n deactivateModal () {\n const modal = this.element.getInstance('Modal');\n if (!modal) return;\n modal.conceal();\n modal.isEnabled = false;\n this.unlistenClick({ capture: true });\n }\n\n handleClick (e) {\n if (e.target.matches('a, button') && !e.target.matches('[aria-controls]') && !e.target.matches(api.core.DisclosureSelector.PREVENT_CONCEAL)) {\n const modal = this.element.getInstance('Modal');\n modal.conceal();\n }\n }\n}\n\nexport { HeaderModal };\n","import api from './api.js';\nimport { HeaderLinks } from './script/header/header-links.js';\nimport { HeaderModal } from './script/header/header-modal.js';\nimport { HeaderSelector } from './script/header/header-selector.js';\n\napi.header = {\n HeaderLinks: HeaderLinks,\n HeaderModal: HeaderModal,\n HeaderSelector: HeaderSelector,\n doc: 'https://www.systeme-de-design.gouv.fr/elements-d-interface/composants/en-tete'\n};\n\nexport default api;\n","import api from './index.js';\n\napi.internals.register(api.header.HeaderSelector.TOOLS_LINKS, api.header.HeaderLinks);\napi.internals.register(api.header.HeaderSelector.MODALS, api.header.HeaderModal);\n\nexport default api;\n"],"names":["const","api","window","HeaderSelector","HEADER","internals","ns","selector","TOOLS_LINKS","MENU_LINKS","BUTTONS","MODALS","HeaderLinks","staticAccessors","instanceClassName","init","header","this","queryParentSelector","toolsLinks","querySelector","menuLinks","copySuffix","toolsHtml","innerHTML","replace","menuHtml","toolsHtmlIdList","match","map","element","toolsHtmlAriaControlList","toolsHtmlDuplicateId","ariaControlsValue","includes","mode","Modes","ANGULAR","REACT","VUE","warn","core","Instance","HeaderModal","isResizing","resize","isBreakpoint","Breakpoints","LG","deactivateModal","activateModal","modal","getInstance","isEnabled","listenClick","capture","conceal","unlistenClick","handleClick","e","target","matches","DisclosureSelector","PREVENT_CONCEAL","doc","register"],"mappings":";yBAAAA,ICCMC,EAAMC,OAAuB,KCCtBC,EAAiB,CAC5BC,OAAQH,EAAII,UAAUC,GAAGC,SAAS,UAClCC,YAAaP,EAAII,UAAUC,GAAGC,SAAS,uBACvCE,WAAYR,EAAII,UAAUC,GAAGC,SAAS,sBACtCG,QAAYT,EAAII,UAAUC,GAAGC,SAAS,2BAA0BN,EAAII,UAAUC,GAAGC,SAAS,mBAAkBN,EAAII,UAAUC,GAAGC,SAAS,2BAA0BN,EAAII,UAAUC,GAAGC,SAAS,eAC1LI,UAAWV,EAAII,UAAUC,GAAGC,SAAS,kBAAoBN,EAAII,UAAUC,GAAGC,SAAS,cAAaN,EAAII,UAAUC,GAAGC,SAAS,gBAAkBN,E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