TP_JO2024/home/dist/component/breadcrumb/breadcrumb.nomodule.min.js

4 lines
2.2 KiB
JavaScript
Raw Normal View History

2024-03-27 17:19:37 +01:00
/*! DSFR v1.11.2 | SPDX-License-Identifier: MIT | License-Filename: LICENSE.md | restricted use (see terms and conditions) */
!function(){"use strict";var t=window.dsfr,e={BREADCRUMB:t.internals.ns.selector("breadcrumb"),BUTTON:t.internals.ns.selector("breadcrumb__button")},s=function(s){function n(){s.call(this),this.count=0,this.focusing=this.focus.bind(this)}s&&(n.__proto__=s),n.prototype=Object.create(s&&s.prototype),n.prototype.constructor=n;var o={proxy:{configurable:!0},links:{configurable:!0},collapse:{configurable:!0},collapsePrimary:{configurable:!0}},i={instanceClassName:{configurable:!0}};return i.instanceClassName.get=function(){return"Breadcrumb"},n.prototype.init=function(){this.getCollapse(),this.isResizing=!0},o.proxy.get=function(){var t=this;return Object.assign.call(this,s.prototype.proxy,{focus:t.focus.bind(t),disclose:t.collapse.disclose.bind(t.collapse)})},n.prototype.getCollapse=function(){var e=this.collapse;e?e.listen(t.core.DisclosureEvent.DISCLOSE,this.focusing):this.addAscent(t.core.DisclosureEmission.ADDED,this.getCollapse.bind(this))},n.prototype.resize=function(){var e=this.collapse,s=this.links;e&&s.length&&(this.isBreakpoint(t.core.Breakpoints.MD)?e.buttonHasFocus&&s[0].focus():s.indexOf(document.activeElement)>-1&&e.focus())},o.links.get=function(){return[].concat(this.querySelectorAll("a[href]"))},o.collapse.get=function(){return this.element.getDescendantInstances(t.core.Collapse.instanceClassName,null,!0)[0]},n.prototype.focus=function(){this.count=0,this._focus()},n.prototype._focus=function(){var t=this.links[0];t&&(t.focus(),this.request(this.verify.bind(this)))},n.prototype.verify=function(){if(this.count++,!(this.count>100)){var t=this.links[0];t&&document.activeElement!==t&&this._focus()}},o.collapsePrimary.get=function(){return this.element.children.map((function(t){return t.getInstance("CollapseButton")})).filter((function(t){return null!==t&&t.hasClass(e.BUTTON)}))[0]},Object.defineProperties(n.prototype,o),Object.defineProperties(n,i),n}(t.core.Instance);t.breadcrumb={BreadcrumbSelector:e,Breadcrumb:s},t.internals.register(t.breadcrumb.BreadcrumbSelector.BREADCRUMB,t.breadcrumb.Breadcrumb)}();
//# sourceMappingURL=breadcrumb.nomodule.min.js.map