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

1 line
No EOL
9.2 KiB
Text

{"version":3,"file":"table.nomodule.js","sources":["../../../.config/config.js","../../../src/core/api.js","../../../src/component/table/script/table/table-emission.js","../../../src/component/table/script/table/table.js","../../../src/component/table/script/table/table-selector.js","../../../src/component/table/script/table/table-element.js","../../../src/component/table/script/table/table-caption.js","../../../src/component/table/index.js","../../../src/component/table/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 TableEmission = {\n SCROLLABLE: api.internals.ns.emission('table', 'scrollable'),\n CHANGE: api.internals.ns.emission('table', 'change'),\n CAPTION_HEIGHT: api.internals.ns.emission('table', 'captionheight')\n};\n","import api from '../../api.js';\nimport { TableEmission } from './table-emission.js';\n\nconst PADDING = '1rem'; // padding de 4v sur le caption\n\nclass Table extends api.core.Instance {\n static get instanceClassName () {\n return 'Table';\n }\n\n init () {\n this.addAscent(TableEmission.CAPTION_HEIGHT, this.setCaptionHeight.bind(this));\n }\n\n setCaptionHeight (value) {\n this.setProperty('--table-offset', `calc(${value}px + ${PADDING})`);\n }\n}\n\nexport { Table };\n","import api from '../../api.js';\n\nexport const TableSelector = {\n TABLE: api.internals.ns.selector('table'),\n SHADOW: api.internals.ns.selector('table__shadow'),\n SHADOW_LEFT: api.internals.ns.selector('table__shadow--left'),\n SHADOW_RIGHT: api.internals.ns.selector('table__shadow--right'),\n ELEMENT: `${api.internals.ns.selector('table')}:not(${api.internals.ns.selector('table--no-scroll')}) table`,\n CAPTION: `${api.internals.ns.selector('table')} table caption`\n};\n","import api from '../../api.js';\nimport { TableSelector } from './table-selector.js';\n\nconst SCROLL_OFFSET = 8; // valeur en px du scroll avant laquelle le shadow s'active ou se desactive\n\nclass TableElement extends api.core.Instance {\n static get instanceClassName () {\n return 'TableElement';\n }\n\n init () {\n this.listen('scroll', this.scroll.bind(this));\n this.content = this.querySelector('tbody');\n this.isResizing = true;\n }\n\n get isScrolling () {\n return this._isScrolling;\n }\n\n set isScrolling (value) {\n if (this._isScrolling === value) return;\n this._isScrolling = value;\n\n if (value) {\n this.addClass(TableSelector.SHADOW);\n this.scroll();\n } else {\n this.removeClass(TableSelector.SHADOW);\n this.removeClass(TableSelector.SHADOW_LEFT);\n this.removeClass(TableSelector.SHADOW_RIGHT);\n }\n }\n\n /* ajoute la classe fr-table__shadow-left ou fr-table__shadow-right sur fr-table en fonction d'une valeur de scroll et du sens (right, left) */\n scroll () {\n const isMin = this.node.scrollLeft <= SCROLL_OFFSET;\n const max = this.content.offsetWidth - this.node.offsetWidth - SCROLL_OFFSET;\n const isMax = Math.abs(this.node.scrollLeft) >= max;\n const isRtl = document.documentElement.getAttribute('dir') === 'rtl';\n const minSelector = isRtl ? TableSelector.SHADOW_RIGHT : TableSelector.SHADOW_LEFT;\n const maxSelector = isRtl ? TableSelector.SHADOW_LEFT : TableSelector.SHADOW_RIGHT;\n\n if (isMin) {\n this.removeClass(minSelector);\n } else {\n this.addClass(minSelector);\n }\n\n if (isMax) {\n this.removeClass(maxSelector);\n } else {\n this.addClass(maxSelector);\n }\n }\n\n resize () {\n this.isScrolling = this.content.offsetWidth > this.node.offsetWidth;\n }\n\n dispose () {\n this.isScrolling = false;\n }\n}\n\nexport { TableElement };\n","import api from '../../api.js';\nimport { TableEmission } from './table-emission.js';\n\nclass TableCaption extends api.core.Instance {\n static get instanceClassName () {\n return 'TableCaption';\n }\n\n init () {\n this.height = 0;\n this.isResizing = true;\n }\n\n resize () {\n const height = this.getRect().height;\n if (this.height === height) return;\n this.height = height;\n this.ascend(TableEmission.CAPTION_HEIGHT, height);\n }\n}\n\nexport { TableCaption };\n","import api from './api.js';\nimport { Table } from './script/table/table.js';\nimport { TableElement } from './script/table/table-element.js';\nimport { TableSelector } from './script/table/table-selector.js';\nimport { TableCaption } from './script/table/table-caption.js';\n\napi.table = {\n Table: Table,\n TableElement: TableElement,\n TableCaption: TableCaption,\n TableSelector: TableSelector\n};\n\nexport default api;\n","import api from './index.js';\n\napi.internals.register(api.table.TableSelector.TABLE, api.table.Table);\napi.internals.register(api.table.TableSelector.ELEMENT, api.table.TableElement);\napi.internals.register(api.table.TableSelector.CAPTION, api.table.TableCaption);\n\nexport default api;\n"],"names":["const"],"mappings":";;;;;EAAAA,IAAM,MAAM,GAAG;EACf,EAAE,MAAM,EAAE,IAAI;EACd,EAAE,SAAS,EAAE,MAAM;EACnB,EAAE,YAAY,EAAE,SAAS;EACzB,EAAE,OAAO,EAAE,QAAQ;EACnB,CAAC;;ECJDA,IAAM,GAAG,GAAG,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC;;ECC7BA,IAAM,aAAa,GAAG;EAC7B,EAAE,UAAU,EAAE,GAAG,CAAC,SAAS,CAAC,EAAE,CAAC,QAAQ,CAAC,OAAO,EAAE,YAAY,CAAC;EAC9D,EAAE,MAAM,EAAE,GAAG,CAAC,SAAS,CAAC,EAAE,CAAC,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC;EACtD,EAAE,cAAc,EAAE,GAAG,CAAC,SAAS,CAAC,EAAE,CAAC,QAAQ,CAAC,OAAO,EAAE,eAAe,CAAC;EACrE,CAAC;;ECHDA,IAAM,OAAO,GAAG,MAAM,CAAC;AACvB;EACA,IAAM,KAAK;;;;;;;;;;;IACT,gBAAW,oCAAqB;EAClC,IAAI,OAAO,OAAO,CAAC;EACnB,IAAG;AACH;EACA,kBAAE,wBAAQ;EACV,IAAI,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC,cAAc,EAAE,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;EACnF,IAAG;AACH;EACA,kBAAE,8CAAkB,KAAK,EAAE;EAC3B,IAAI,IAAI,CAAC,WAAW,CAAC,gBAAgB,aAAU,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