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

4 lines
7.7 KiB
JavaScript
Raw Permalink 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=function(e){function i(){e.call(this,t.core.DisclosureType.SELECT)}e&&(i.__proto__=e),i.prototype=Object.create(e&&e.prototype),i.prototype.constructor=i;var s={list:{configurable:!0}},n={instanceClassName:{configurable:!0}};return n.instanceClassName.get=function(){return"TabButton"},i.prototype.handleClick=function(t){e.prototype.handleClick.call(this,t),this.focus()},i.prototype.apply=function(t){e.prototype.apply.call(this,t),this.isPrimary&&(this.setAttribute("tabindex",t?"0":"-1"),t&&this.list&&this.list.focalize(this))},s.list.get=function(){return this.element.getAscendantInstance("TabsList","TabsGroup")},Object.defineProperties(i.prototype,s),Object.defineProperties(i,n),i}(t.core.DisclosureButton),i={TAB:t.internals.ns.selector("tabs__tab"),GROUP:t.internals.ns.selector("tabs"),PANEL:t.internals.ns.selector("tabs__panel"),LIST:t.internals.ns.selector("tabs__list"),SHADOW:t.internals.ns.selector("tabs__shadow"),SHADOW_LEFT:t.internals.ns.selector("tabs__shadow--left"),SHADOW_RIGHT:t.internals.ns.selector("tabs__shadow--right"),PANEL_START:t.internals.ns.selector("tabs__panel--direction-start"),PANEL_END:t.internals.ns.selector("tabs__panel--direction-end")},s="direction-start",n="direction-end",o="none",r=function(r){function a(){r.call(this,t.core.DisclosureType.SELECT,i.PANEL,e,"TabsGroup"),this._direction=o,this._isPreventingTransition=!1}r&&(a.__proto__=r),a.prototype=Object.create(r&&r.prototype),a.prototype.constructor=a;var c={direction:{configurable:!0},isPreventingTransition:{configurable:!0}},l={instanceClassName:{configurable:!0}};return l.instanceClassName.get=function(){return"TabPanel"},c.direction.get=function(){return this._direction},c.direction.set=function(t){if(t!==this._direction){switch(this._direction){case s:this.removeClass(i.PANEL_START);break;case n:this.removeClass(i.PANEL_END);break;case o:break;default:return}switch(this._direction=t,this._direction){case s:this.addClass(i.PANEL_START);break;case n:this.addClass(i.PANEL_END)}}},c.isPreventingTransition.get=function(){return this._isPreventingTransition},c.isPreventingTransition.set=function(e){this._isPreventingTransition!==e&&(e?this.addClass(t.internals.motion.TransitionSelector.NONE):this.removeClass(t.internals.motion.TransitionSelector.NONE),this._isPreventingTransition=!0===e)},a.prototype.translate=function(t,e){this.isPreventingTransition=e,this.direction=t},a.prototype.reset=function(){this.group&&this.group.retrieve(!0)},a.prototype._electPrimaries=function(t){var e=this;return this.group&&this.group.list?r.prototype._electPrimaries.call(this,t).filter((function(t){return e.group.list.node.contains(t.node)})):[]},Object.defineProperties(a.prototype,c),Object.defineProperties(a,l),a}(t.core.Disclosure),a="tab_keys_left",c="tab_keys_right",l="tab_keys_home",h="tab_keys_end",p={PRESS_KEY:t.internals.ns.emission("tab","press_key"),LIST_HEIGHT:t.internals.ns.emission("tab","list_height")},u=function(e){function i(){e.call(this,"TabPanel")}e&&(i.__proto__=e),i.prototype=Object.create(e&&e.prototype),i.prototype.constructor=i;var r={list:{configurable:!0},buttonHasFocus:{configurable:!0},isPreventingTransition:{configurable:!0}},u={instanceClassName:{configurable:!0}};return u.instanceClassName.get=function(){return"TabsGroup"},i.prototype.init=function(){e.prototype.init.call(this),this.listen("transitionend",this.transitionend.bind(this)),this.addAscent(p.PRESS_KEY,this.pressKey.bind(this)),this.addAscent(p.LIST_HEIGHT,this.setListHeight.bind(this)),this.isRendering=!0},i.prototype.getIndex=function(t){void 0===t&&(t=0),e.prototype.getIndex.call(this,t)},r.list.get=function(){return this.element.getDescendantInstances("TabsList","TabsGroup",!0)[0]},i.prototype.setListHeight=function(t){this.listHeight=t},i.prototype.transitionend=function(t){this.isPreventingTransition=!0},r.buttonHasFocus.get=function(){return this.members.some((function(t){return t.buttonHasFocus}))},i.prototype.pressKey=function(t){switch(t){case a:this.pressLeft();break;case c:this.pressRight();break;case l:this
//# sourceMappingURL=tab.nomodule.min.js.map