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

4 lines
3.2 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={SCROLLABLE:t.internals.ns.emission("table","scrollable"),CHANGE:t.internals.ns.emission("table","change"),CAPTION_HEIGHT:t.internals.ns.emission("table","captionheight")},s=function(t){function s(){t.apply(this,arguments)}t&&(s.__proto__=t),s.prototype=Object.create(t&&t.prototype),s.prototype.constructor=s;var n={instanceClassName:{configurable:!0}};return n.instanceClassName.get=function(){return"Table"},s.prototype.init=function(){this.addAscent(e.CAPTION_HEIGHT,this.setCaptionHeight.bind(this))},s.prototype.setCaptionHeight=function(t){this.setProperty("--table-offset","calc("+t+"px + 1rem)")},Object.defineProperties(s,n),s}(t.core.Instance),n={TABLE:t.internals.ns.selector("table"),SHADOW:t.internals.ns.selector("table__shadow"),SHADOW_LEFT:t.internals.ns.selector("table__shadow--left"),SHADOW_RIGHT:t.internals.ns.selector("table__shadow--right"),ELEMENT:t.internals.ns.selector("table")+":not("+t.internals.ns.selector("table--no-scroll")+") table",CAPTION:t.internals.ns.selector("table")+" table caption"},i=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var s={isScrolling:{configurable:!0}},i={instanceClassName:{configurable:!0}};return i.instanceClassName.get=function(){return"TableElement"},e.prototype.init=function(){this.listen("scroll",this.scroll.bind(this)),this.content=this.querySelector("tbody"),this.isResizing=!0},s.isScrolling.get=function(){return this._isScrolling},s.isScrolling.set=function(t){this._isScrolling!==t&&(this._isScrolling=t,t?(this.addClass(n.SHADOW),this.scroll()):(this.removeClass(n.SHADOW),this.removeClass(n.SHADOW_LEFT),this.removeClass(n.SHADOW_RIGHT)))},e.prototype.scroll=function(){var t=this.node.scrollLeft<=8,e=this.content.offsetWidth-this.node.offsetWidth-8,s=Math.abs(this.node.scrollLeft)>=e,i="rtl"===document.documentElement.getAttribute("dir"),o=i?n.SHADOW_RIGHT:n.SHADOW_LEFT,r=i?n.SHADOW_LEFT:n.SHADOW_RIGHT;t?this.removeClass(o):this.addClass(o),s?this.removeClass(r):this.addClass(r)},e.prototype.resize=function(){this.isScrolling=this.content.offsetWidth>this.node.offsetWidth},e.prototype.dispose=function(){this.isScrolling=!1},Object.defineProperties(e.prototype,s),Object.defineProperties(e,i),e}(t.core.Instance),o=function(t){function s(){t.apply(this,arguments)}t&&(s.__proto__=t),s.prototype=Object.create(t&&t.prototype),s.prototype.constructor=s;var n={instanceClassName:{configurable:!0}};return n.instanceClassName.get=function(){return"TableCaption"},s.prototype.init=function(){this.height=0,this.isResizing=!0},s.prototype.resize=function(){var t=this.getRect().height;this.height!==t&&(this.height=t,this.ascend(e.CAPTION_HEIGHT,t))},Object.defineProperties(s,n),s}(t.core.Instance);t.table={Table:s,TableElement:i,TableCaption:o,TableSelector:n},t.internals.register(t.table.TableSelector.TABLE,t.table.Table),t.internals.register(t.table.TableSelector.ELEMENT,t.table.TableElement),t.internals.register(t.table.TableSelector.CAPTION,t.table.TableCaption)}();
//# sourceMappingURL=table.nomodule.min.js.map