1 line
No EOL
6.6 KiB
Text
1 line
No EOL
6.6 KiB
Text
{"version":3,"file":"breadcrumb.module.js","sources":["../../../.config/config.js","../../../src/core/api.js","../../../src/component/breadcrumb/script/breadcrumb/breadcrumb-selector.js","../../../src/component/breadcrumb/script/breadcrumb/breadcrumb.js","../../../src/component/breadcrumb/index.js","../../../src/component/breadcrumb/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 BreadcrumbSelector = {\n BREADCRUMB: api.internals.ns.selector('breadcrumb'),\n BUTTON: api.internals.ns.selector('breadcrumb__button')\n};\n","import api from '../../api.js';\nimport { BreadcrumbSelector } from './breadcrumb-selector.js';\n\nclass Breadcrumb extends api.core.Instance {\n constructor () {\n super();\n this.count = 0;\n this.focusing = this.focus.bind(this);\n }\n\n static get instanceClassName () {\n return 'Breadcrumb';\n }\n\n init () {\n this.getCollapse();\n this.isResizing = true;\n }\n\n get proxy () {\n const scope = this;\n return Object.assign(super.proxy, {\n focus: scope.focus.bind(scope),\n disclose: scope.collapse.disclose.bind(scope.collapse)\n });\n }\n\n getCollapse () {\n const collapse = this.collapse;\n if (collapse) {\n collapse.listen(api.core.DisclosureEvent.DISCLOSE, this.focusing);\n } else {\n this.addAscent(api.core.DisclosureEmission.ADDED, this.getCollapse.bind(this));\n }\n }\n\n resize () {\n const collapse = this.collapse;\n const links = this.links;\n if (!collapse || !links.length) return;\n\n if (this.isBreakpoint(api.core.Breakpoints.MD)) {\n if (collapse.buttonHasFocus) links[0].focus();\n } else {\n if (links.indexOf(document.activeElement) > -1) collapse.focus();\n }\n }\n\n get links () {\n return [...this.querySelectorAll('a[href]')];\n }\n\n get collapse () {\n return this.element.getDescendantInstances(api.core.Collapse.instanceClassName, null, true)[0];\n }\n\n focus () {\n this.count = 0;\n this._focus();\n }\n\n _focus () {\n const link = this.links[0];\n if (!link) return;\n link.focus();\n this.request(this.verify.bind(this));\n }\n\n verify () {\n this.count++;\n if (this.count > 100) return;\n const link = this.links[0];\n if (!link) return;\n if (document.activeElement !== link) this._focus();\n }\n\n get collapsePrimary () {\n const buttons = this.element.children.map(child => child.getInstance('CollapseButton')).filter(button => button !== null && button.hasClass(BreadcrumbSelector.BUTTON));\n return buttons[0];\n }\n}\n\nexport { Breadcrumb };\n","import api from './api.js';\nimport { Breadcrumb } from './script/breadcrumb/breadcrumb.js';\nimport { BreadcrumbSelector } from './script/breadcrumb/breadcrumb-selector.js';\n\napi.breadcrumb = {\n BreadcrumbSelector: BreadcrumbSelector,\n Breadcrumb: Breadcrumb\n};\n\nexport default api;\n","import api from './index.js';\n\napi.internals.register(api.breadcrumb.BreadcrumbSelector.BREADCRUMB, api.breadcrumb.Breadcrumb);\n\nexport default api;\n"],"names":[],"mappings":";;AAAA,MAAM,MAAM,GAAG;AACf,EAAE,MAAM,EAAE,IAAI;AACd,EAAE,SAAS,EAAE,MAAM;AACnB,EAAE,YAAY,EAAE,SAAS;AACzB,EAAE,OAAO,EAAE,QAAQ;AACnB,CAAC;;ACJD,MAAM,GAAG,GAAG,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC;;ACC7B,MAAM,kBAAkB,GAAG;AAClC,EAAE,UAAU,EAAE,GAAG,CAAC,SAAS,CAAC,EAAE,CAAC,QAAQ,CAAC,YAAY,CAAC;AACrD,EAAE,MAAM,EAAE,GAAG,CAAC,SAAS,CAAC,EAAE,CAAC,QAAQ,CAAC,oBAAoB,CAAC;AACzD,CAAC;;ACFD,MAAM,UAAU,SAAS,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC;AAC3C,EAAE,WAAW,CAAC,GAAG;AACjB,IAAI,KAAK,EAAE,CAAC;AACZ,IAAI,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC;AACnB,IAAI,IAAI,CAAC,QAAQ,GAAG,IAAI,CAA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