@toolbox-web/grid 3.10.1 → 3.10.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/all.js +2 -1
- package/all.js.map +1 -1
- package/index.js +1 -1
- package/index.js.map +1 -1
- package/lib/features/registry.js +1 -1
- package/lib/plugins/editing/editing-plugin.d.ts +11 -5
- package/lib/plugins/editing/index.js +2 -1
- package/lib/plugins/editing/index.js.map +1 -1
- package/lib/plugins/editing/internal/editor-injection.d.ts +9 -2
- package/lib/plugins/hierarchy/hierarchy.d.ts +5 -1
- package/lib/plugins/hierarchy/index.js +1 -1
- package/lib/plugins/hierarchy/index.js.map +1 -1
- package/lib/plugins/shell/index.js +1 -1
- package/lib/plugins/shell/index.js.map +1 -1
- package/lib/plugins/shell/types.d.ts +9 -1
- package/package.json +1 -1
- package/umd/grid.all.umd.js +1 -1
- package/umd/grid.all.umd.js.map +1 -1
- package/umd/grid.umd.js +1 -1
- package/umd/grid.umd.js.map +1 -1
- package/umd/plugins/editing.umd.js +1 -1
- package/umd/plugins/editing.umd.js.map +1 -1
- package/umd/plugins/grouping-rows.umd.js +1 -1
- package/umd/plugins/grouping-rows.umd.js.map +1 -1
- package/umd/plugins/hierarchy.umd.js +1 -1
- package/umd/plugins/hierarchy.umd.js.map +1 -1
- package/umd/plugins/shell.umd.js +1 -1
- package/umd/plugins/shell.umd.js.map +1 -1
- package/umd/plugins/tree.umd.js +1 -1
- package/umd/plugins/tree.umd.js.map +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(e
|
|
1
|
+
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@toolbox-web/grid")):"function"==typeof define&&define.amd?define(["exports","@toolbox-web/grid"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).TbwGridPlugin_hierarchy={},t.TbwGrid)}(this,function(t,e){function r(t,e,r=new WeakMap,o){const n=o?function(t,e){let r;for(let o=0;o<t.length;o++){const n=e(t[o]);n!==t[o]&&(r??=t.slice(),r[o]=n)}return r??t}(t,o):t,i=[];for(const h of["structure","transform"])for(const t of e)t.hierarchyStage===h&&t.beginHierarchy(n)&&i.push(t);if(0===i.length)return[...n];const s=[],l=(t,e,r)=>{o&&e&&(t=function(t,e){let r;for(let o=0;o<t.length;o++){const n=e(t[o].row);n!==t[o].row&&(r??=t.slice(),r[o]={...t[o],row:n})}return r??t}(t,o));const n={parent:e?e.row:null,parentKey:e?.key??null,depth:r};for(const o of i)t=o.processSiblings(t,n);return t},u=(t,e)=>{const o=t.length;for(let n=0;n<o;n++){const i=t[n];s.push(i.row),"object"==typeof i.row&&null!==i.row&&r.set(i.row,{level:e+1,setSize:o,posInSet:n+1});const a=i.children;i.expanded&&a&&u(i.shaped?a:l(a,i,e+1),e+1)}},a=new Array(n.length);for(let h=0;h<n.length;h++)a[h]={row:n[h]};u(l(a,null,0),0);const c=t=>"object"==typeof t&&null!==t?r.get(t):void 0;let f=!1;for(const h of i)h.endHierarchy(s,c)&&(f=!0);if(!f)for(const h of s)"object"==typeof h&&null!==h&&r.delete(h);return s}function o(t,e,r){const o=String(r);t.getAttribute(e)!==o&&t.setAttribute(e,o)}function n(t){return"function"==typeof t.processSiblings}function i(t){return t.constructor.manifest?.hookPriority?.processRows??0}Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});var s=class extends e.BaseGridPlugin{static manifest={modifiesRowStructure:!0};name="hierarchy";#t=new WeakMap;detach(){this.gridElement?.querySelector(".rows-body")?.setAttribute("role","grid"),this.#t=new WeakMap}process(t,e){const o=this.#e();return o.includes(e)?o[o.length-1]!==e?t:(this.#t=new WeakMap,r(t,o,this.#t,this.#r())):(this.#t=new WeakMap,r(t,[e],this.#t,this.#r()))}#r(){const t=this.grid?.query?.("getRowSubstitutes",null)??[];let e;for(const o of t)if(o?.size){e??=new Map;for(const[t,r]of o)e.set(t,r)}if(!e)return;const r=this.grid;return t=>{if("object"!=typeof t||null===t)return t;let o;try{o=r.getRowId(t)}catch{return t}return e.has(o)?e.get(o):t}}getRowMeta(t){return"object"==typeof t&&null!==t?this.#t.get(t):void 0}afterRender(){this.#o()}onScrollRender(){this.#o()}#e(){return(this.grid?._pluginManager?.getPlugins?.()??[]).filter(n).sort((t,e)=>i(t)-i(e))}#o(){if(0===this.#e().length)return;const t=this.gridElement?.querySelector(".rows");if(!t)return;let e=!1;for(const i of t.querySelectorAll(".data-grid-row")){const t=this.getRowMeta(i.__rowDataRef);t?(e=!0,o(i,"aria-level",t.level),o(i,"aria-setsize",t.setSize),o(i,"aria-posinset",t.posInSet)):(i.removeAttribute("aria-level"),i.removeAttribute("aria-setsize"),i.removeAttribute("aria-posinset"))}const r=e?"treegrid":"grid",n=this.gridElement?.querySelector(".rows-body");n&&n.getAttribute("role")!==r&&n.setAttribute("role",r)}};t.HierarchyPlugin=s,t.buildHierarchy=r});
|
|
2
2
|
//# sourceMappingURL=hierarchy.umd.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hierarchy.umd.js","names":["BaseGridPlugin","global","factory","exports","module","require","define","amd","globalThis","self","TbwGridPlugin_hierarchy","TbwGrid","this","_toolbox_web_grid","buildHierarchy","rows","contributors","meta","WeakMap","active","stage","c","hierarchyStage","beginHierarchy","push","length","out","process","nodes","parent","depth","context","row","parentKey","key","processSiblings","emit","setSize","i","node","set","level","posInSet","children","expanded","shaped","roots","Array","positionOf","get","endHierarchy","delete","setAttrIfChanged","el","name","value","next","String","getAttribute","setAttribute","isContributor","plugin","processRowsPriority","constructor","manifest","hookPriority","processRows","Object","defineProperty","Symbol","toStringTag","HierarchyPlugin","BaseGridPlugin","static","modifiesRowStructure","detach","gridElement","querySelector","caller","includes","getRowMeta","afterRender","applyAria","onScrollRender","grid","_pluginManager","getPlugins","filter","sort","a","b","body","hierarchical","rowEl","querySelectorAll","__rowDataRef","removeAttribute","role","rowsBody"],"sources":["../../../../../libs/grid/src/lib/plugins/hierarchy/hierarchy.ts","../../../../../libs/grid/src/lib/plugins/hierarchy/hierarchy-plugin.ts"],"sourcesContent":["/**\n * Hierarchy Engine\n *\n * Pure row-model builder shared by the HierarchyPlugin and its contributors.\n */\n\nimport type { HierarchyContributor, HierarchyNode, HierarchyRowMeta } from './types';\n\n/**\n * Build the flat row list for `rows` from every contributor's sibling-list\n * transforms, recording each emitted row's ARIA position in `meta`.\n *\n * Contributors whose `beginHierarchy` returns `false` sit out the rebuild.\n * With no active contributor the rows pass through unchanged. When every\n * active contributor's `endHierarchy` returns `false`, no position is kept in `meta`.\n *\n * This is what `HierarchyPlugin.process()` runs for all attached contributors.\n * Call it directly to run a contributor without a grid — e.g. as the\n * `processRows` fallback when no HierarchyPlugin is attached, or in unit tests.\n *\n * @example\n * ```ts\n * override processRows(rows: readonly unknown[]): unknown[] {\n * const hierarchy = this.grid?.getPluginByName('hierarchy');\n * return hierarchy ? hierarchy.process(rows, this) : buildHierarchy(rows, [this]);\n * }\n * ```\n *\n * @param rows - The root rows.\n * @param contributors - Contributors to run, in `processRows` hook order.\n * @param meta - Receives each emitted row's position. Pass a fresh map per rebuild.\n * @returns The flattened rows, in render order.\n * @since 3.9.0\n */\nexport function buildHierarchy(\n rows: readonly unknown[],\n contributors: readonly HierarchyContributor[],\n meta: WeakMap<object, HierarchyRowMeta> = new WeakMap(),\n): unknown[] {\n const active: HierarchyContributor[] = [];\n for (const stage of ['structure', 'transform'] as const) {\n for (const c of contributors) {\n if (c.hierarchyStage === stage && c.beginHierarchy(rows)) active.push(c);\n }\n }\n if (active.length === 0) return [...rows];\n\n const out: unknown[] = [];\n const process = (nodes: HierarchyNode[], parent: HierarchyNode | null, depth: number): HierarchyNode[] => {\n const context = { parent: parent ? parent.row : null, parentKey: parent?.key ?? null, depth };\n for (const c of active) nodes = c.processSiblings(nodes, context);\n return nodes;\n };\n const emit = (nodes: HierarchyNode[], depth: number): void => {\n const setSize = nodes.length;\n for (let i = 0; i < setSize; i++) {\n const node = nodes[i];\n out.push(node.row);\n if (typeof node.row === 'object' && node.row !== null) {\n meta.set(node.row, { level: depth + 1, setSize, posInSet: i + 1 });\n }\n const children = node.children;\n if (node.expanded && children) {\n emit(node.shaped ? children : process(children, node, depth + 1), depth + 1);\n }\n }\n };\n\n const roots: HierarchyNode[] = new Array(rows.length);\n for (let i = 0; i < rows.length; i++) roots[i] = { row: rows[i] };\n emit(process(roots, null, 0), 0);\n\n const positionOf = (row: unknown) => (typeof row === 'object' && row !== null ? meta.get(row) : undefined);\n let shaped = false;\n for (const c of active) if (c.endHierarchy(out, positionOf)) shaped = true;\n if (!shaped) {\n for (const row of out) if (typeof row === 'object' && row !== null) meta.delete(row);\n }\n return out;\n}\n","/**\n * Hierarchy Plugin\n *\n * Owns the hierarchical row model shared by structure-contributing plugins.\n */\n\nimport type { PluginManifest } from '../../core/plugin/base-plugin';\nimport { BaseGridPlugin } from '../../core/plugin/base-plugin';\nimport type { RowElementInternal } from '../../core/types';\nimport { buildHierarchy } from './hierarchy';\nimport type { HierarchyContributor, HierarchyRowMeta } from './types';\n\n/** Attribute write that skips the DOM mutation when the value is unchanged (per-frame hot path). */\nfunction setAttrIfChanged(el: Element, name: string, value: number): void {\n const next = String(value);\n if (el.getAttribute(name) !== next) el.setAttribute(name, next);\n}\n\nfunction isContributor(plugin: unknown): plugin is HierarchyContributor & BaseGridPlugin {\n return typeof (plugin as Partial<HierarchyContributor>).processSiblings === 'function';\n}\n\nfunction processRowsPriority(plugin: BaseGridPlugin): number {\n return (plugin.constructor as typeof BaseGridPlugin).manifest?.hookPriority?.processRows ?? 0;\n}\n\n/**\n * Hierarchy Plugin for tbw-grid\n *\n * Builds one hierarchical row model from every attached structure contributor\n * — {@link https://toolboxjs.com/grid/plugins/tree/ | TreePlugin} discovers\n * child rows, {@link https://toolboxjs.com/grid/plugins/grouping-rows/ | GroupingRowsPlugin}\n * groups sibling lists — and announces each row's position with the WAI-ARIA\n * treegrid pattern (`aria-level` / `aria-setsize` / `aria-posinset`).\n *\n * Contributors know nothing about each other, so they compose: a grid with\n * both Tree and GroupingRows groups the children of every tree level.\n *\n * You never need to add this plugin yourself — TreePlugin and\n * GroupingRowsPlugin declare it as a dependency and the grid attaches it\n * automatically. It has no configuration.\n *\n * @example Group the children of every tree node\n * ```ts\n * import { TreePlugin } from '@toolbox-web/grid/plugins/tree';\n * import { GroupingRowsPlugin } from '@toolbox-web/grid/plugins/grouping-rows';\n *\n * grid.gridConfig = {\n * plugins: [\n * new TreePlugin({ childrenField: 'children' }),\n * new GroupingRowsPlugin({\n * // Leave the root level ungrouped, group every child level by kind\n * groupOn: (row, { depth }) => (depth > 0 ? row.kind : null),\n * }),\n * ],\n * };\n * ```\n *\n * @since 3.9.0\n */\nexport class HierarchyPlugin extends BaseGridPlugin {\n /** @internal */\n static override readonly manifest: PluginManifest = {\n modifiesRowStructure: true,\n };\n\n /** @internal */\n readonly name = 'hierarchy';\n\n #meta = new WeakMap<object, HierarchyRowMeta>();\n\n /** @internal */\n override detach(): void {\n // Restore the default `role=\"grid\"` (template default in `core/internal/dom-builder.ts`).\n this.gridElement?.querySelector('.rows-body')?.setAttribute('role', 'grid');\n this.#meta = new WeakMap();\n }\n\n /**\n * Build the row model for a contributor's `processRows` hook.\n *\n * Every contributor forwards its hook here; only the one that runs last in\n * the `processRows` pipeline builds the model (for all contributors at\n * once) — the earlier ones pass their rows through untouched.\n *\n * @example\n * ```ts\n * override processRows(rows: readonly unknown[]): unknown[] {\n * return this.grid.getPluginByName('hierarchy')?.process(rows, this) ?? [...rows];\n * }\n * ```\n *\n * @since 3.9.0\n */\n process(rows: readonly unknown[], caller: HierarchyContributor): unknown[] {\n const contributors = this.#contributors();\n if (!contributors.includes(caller as HierarchyContributor & BaseGridPlugin)) {\n this.#meta = new WeakMap();\n return buildHierarchy(rows, [caller], this.#meta);\n }\n if (contributors[contributors.length - 1] !== caller) return rows as unknown[];\n this.#meta = new WeakMap();\n return buildHierarchy(rows, contributors, this.#meta);\n }\n\n /**\n * Hierarchy position of a row in the current row model, or `undefined` when\n * the row is not rendered (e.g. collapsed under a parent).\n *\n * @example\n * ```ts\n * const meta = grid.getPluginByName('hierarchy')?.getRowMeta(grid.rows[0]);\n * console.log(meta?.level, meta?.posInSet, meta?.setSize);\n * ```\n *\n * @since 3.9.0\n */\n getRowMeta(row: unknown): HierarchyRowMeta | undefined {\n return typeof row === 'object' && row !== null ? this.#meta.get(row) : undefined;\n }\n\n /** @internal */\n override afterRender(): void {\n this.#applyAria();\n }\n\n /** @internal */\n override onScrollRender(): void {\n this.#applyAria();\n }\n\n /** Attached contributors, in `processRows` hook order. */\n #contributors(): Array<HierarchyContributor & BaseGridPlugin> {\n const plugins = (this.grid?._pluginManager?.getPlugins?.() ?? []) as readonly BaseGridPlugin[];\n return plugins.filter(isContributor).sort((a, b) => processRowsPriority(a) - processRowsPriority(b));\n }\n\n #applyAria(): void {\n if (this.#contributors().length === 0) return;\n const body = this.gridElement?.querySelector('.rows');\n if (!body) return;\n\n let hierarchical = false;\n for (const rowEl of body.querySelectorAll('.data-grid-row')) {\n const meta = this.getRowMeta((rowEl as RowElementInternal).__rowDataRef);\n if (!meta) {\n // Pooled row elements may carry a position from a previous row model.\n rowEl.removeAttribute('aria-level');\n rowEl.removeAttribute('aria-setsize');\n rowEl.removeAttribute('aria-posinset');\n continue;\n }\n hierarchical = true;\n setAttrIfChanged(rowEl, 'aria-level', meta.level);\n setAttrIfChanged(rowEl, 'aria-setsize', meta.setSize);\n setAttrIfChanged(rowEl, 'aria-posinset', meta.posInSet);\n }\n\n // `treegrid` only while the model has hierarchy, so per-row level/setsize/posinset are valid in context.\n const role = hierarchical ? 'treegrid' : 'grid';\n const rowsBody = this.gridElement?.querySelector('.rows-body');\n if (rowsBody && rowsBody.getAttribute('role') !== role) rowsBody.setAttribute('role', role);\n }\n}\n"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"hierarchy.umd.js","names":["BaseGridPlugin","global","factory","exports","module","require","define","amd","globalThis","self","TbwGridPlugin_hierarchy","TbwGrid","this","_toolbox_web_grid","buildHierarchy","rows","contributors","meta","WeakMap","substitute","roots","out","i","length","row","slice","substituteValues","active","stage","c","hierarchyStage","beginHierarchy","push","process","nodes","parent","depth","substituteRows","context","parentKey","key","processSiblings","emit","setSize","node","set","level","posInSet","children","expanded","shaped","rootNodes","Array","positionOf","get","endHierarchy","delete","setAttrIfChanged","el","name","value","next","String","getAttribute","setAttribute","isContributor","plugin","processRowsPriority","constructor","manifest","hookPriority","processRows","Object","defineProperty","Symbol","toStringTag","HierarchyPlugin","BaseGridPlugin","static","modifiesRowStructure","detach","gridElement","querySelector","caller","includes","rowSubstitute","responses","grid","query","pinned","map","size","Map","id","getRowId","has","getRowMeta","afterRender","applyAria","onScrollRender","_pluginManager","getPlugins","filter","sort","a","b","body","hierarchical","rowEl","querySelectorAll","__rowDataRef","removeAttribute","role","rowsBody"],"sources":["../../../../../libs/grid/src/lib/plugins/hierarchy/hierarchy.ts","../../../../../libs/grid/src/lib/plugins/hierarchy/hierarchy-plugin.ts"],"sourcesContent":["/**\n * Hierarchy Engine\n *\n * Pure row-model builder shared by the HierarchyPlugin and its contributors.\n */\n\nimport type { HierarchyContributor, HierarchyNode, HierarchyRowMeta } from './types';\n\n/** Copy-on-write: contributors may hold on to node objects, so a substituted node is a new object. */\nfunction substituteRows(nodes: HierarchyNode[], substitute: (row: unknown) => unknown): HierarchyNode[] {\n let out: HierarchyNode[] | undefined;\n for (let i = 0; i < nodes.length; i++) {\n const row = substitute(nodes[i].row);\n if (row === nodes[i].row) continue;\n out ??= nodes.slice();\n out[i] = { ...nodes[i], row };\n }\n return out ?? nodes;\n}\n\n/** Copy-on-write substitution of a plain row list (the roots, before any node exists). */\nfunction substituteValues(rows: readonly unknown[], substitute: (row: unknown) => unknown): readonly unknown[] {\n let out: unknown[] | undefined;\n for (let i = 0; i < rows.length; i++) {\n const row = substitute(rows[i]);\n if (row === rows[i]) continue;\n out ??= rows.slice();\n out[i] = row;\n }\n return out ?? rows;\n}\n\n/**\n * Build the flat row list for `rows` from every contributor's sibling-list\n * transforms, recording each emitted row's ARIA position in `meta`.\n *\n * Contributors whose `beginHierarchy` returns `false` sit out the rebuild.\n * With no active contributor the rows pass through unchanged. When every\n * active contributor's `endHierarchy` returns `false`, no position is kept in `meta`.\n *\n * This is what `HierarchyPlugin.process()` runs for all attached contributors.\n * Call it directly to run a contributor without a grid — e.g. as the\n * `processRows` fallback when no HierarchyPlugin is attached, or in unit tests.\n *\n * @example\n * ```ts\n * override processRows(rows: readonly unknown[]): unknown[] {\n * const hierarchy = this.grid?.getPluginByName('hierarchy');\n * return hierarchy ? hierarchy.process(rows, this) : buildHierarchy(rows, [this]);\n * }\n * ```\n *\n * @param rows - The root rows.\n * @param contributors - Contributors to run, in `processRows` hook order.\n * @param meta - Receives each emitted row's position. Pass a fresh map per rebuild.\n * @param substitute - Optional. Maps a row to the object to use in its place, at\n * every nesting level, before any contributor sees it. Return the row itself to\n * keep it. `HierarchyPlugin` uses this to keep a row being edited when the data\n * is replaced with new objects. Added in 3.10.2.\n * @returns The flattened rows, in render order.\n * @since 3.9.0\n */\nexport function buildHierarchy(\n rows: readonly unknown[],\n contributors: readonly HierarchyContributor[],\n meta: WeakMap<object, HierarchyRowMeta> = new WeakMap(),\n substitute?: (row: unknown) => unknown,\n): unknown[] {\n // Roots are substituted BEFORE activation: `beginHierarchy` decides from them whether\n // there is any structure (a pinned parent may be the only row with children).\n const roots = substitute ? substituteValues(rows, substitute) : rows;\n const active: HierarchyContributor[] = [];\n for (const stage of ['structure', 'transform'] as const) {\n for (const c of contributors) {\n if (c.hierarchyStage === stage && c.beginHierarchy(roots)) active.push(c);\n }\n }\n if (active.length === 0) return [...roots];\n\n const out: unknown[] = [];\n const process = (nodes: HierarchyNode[], parent: HierarchyNode | null, depth: number): HierarchyNode[] => {\n if (substitute && parent) nodes = substituteRows(nodes, substitute);\n const context = { parent: parent ? parent.row : null, parentKey: parent?.key ?? null, depth };\n for (const c of active) nodes = c.processSiblings(nodes, context);\n return nodes;\n };\n const emit = (nodes: HierarchyNode[], depth: number): void => {\n const setSize = nodes.length;\n for (let i = 0; i < setSize; i++) {\n const node = nodes[i];\n out.push(node.row);\n if (typeof node.row === 'object' && node.row !== null) {\n meta.set(node.row, { level: depth + 1, setSize, posInSet: i + 1 });\n }\n const children = node.children;\n if (node.expanded && children) {\n emit(node.shaped ? children : process(children, node, depth + 1), depth + 1);\n }\n }\n };\n\n const rootNodes: HierarchyNode[] = new Array(roots.length);\n for (let i = 0; i < roots.length; i++) rootNodes[i] = { row: roots[i] };\n emit(process(rootNodes, null, 0), 0);\n\n const positionOf = (row: unknown) => (typeof row === 'object' && row !== null ? meta.get(row) : undefined);\n let shaped = false;\n for (const c of active) if (c.endHierarchy(out, positionOf)) shaped = true;\n if (!shaped) {\n for (const row of out) if (typeof row === 'object' && row !== null) meta.delete(row);\n }\n return out;\n}\n","/**\n * Hierarchy Plugin\n *\n * Owns the hierarchical row model shared by structure-contributing plugins.\n */\n\nimport type { PluginManifest } from '../../core/plugin/base-plugin';\nimport { BaseGridPlugin } from '../../core/plugin/base-plugin';\nimport type { RowElementInternal } from '../../core/types';\nimport { buildHierarchy } from './hierarchy';\nimport type { HierarchyContributor, HierarchyRowMeta } from './types';\n\n/** Attribute write that skips the DOM mutation when the value is unchanged (per-frame hot path). */\nfunction setAttrIfChanged(el: Element, name: string, value: number): void {\n const next = String(value);\n if (el.getAttribute(name) !== next) el.setAttribute(name, next);\n}\n\nfunction isContributor(plugin: unknown): plugin is HierarchyContributor & BaseGridPlugin {\n return typeof (plugin as Partial<HierarchyContributor>).processSiblings === 'function';\n}\n\nfunction processRowsPriority(plugin: BaseGridPlugin): number {\n return (plugin.constructor as typeof BaseGridPlugin).manifest?.hookPriority?.processRows ?? 0;\n}\n\n/**\n * Hierarchy Plugin for tbw-grid\n *\n * Builds one hierarchical row model from every attached structure contributor\n * — {@link https://toolboxjs.com/grid/plugins/tree/ | TreePlugin} discovers\n * child rows, {@link https://toolboxjs.com/grid/plugins/grouping-rows/ | GroupingRowsPlugin}\n * groups sibling lists — and announces each row's position with the WAI-ARIA\n * treegrid pattern (`aria-level` / `aria-setsize` / `aria-posinset`).\n *\n * Contributors know nothing about each other, so they compose: a grid with\n * both Tree and GroupingRows groups the children of every tree level.\n *\n * You never need to add this plugin yourself — TreePlugin and\n * GroupingRowsPlugin declare it as a dependency and the grid attaches it\n * automatically. It has no configuration.\n *\n * @example Group the children of every tree node\n * ```ts\n * import { TreePlugin } from '@toolbox-web/grid/plugins/tree';\n * import { GroupingRowsPlugin } from '@toolbox-web/grid/plugins/grouping-rows';\n *\n * grid.gridConfig = {\n * plugins: [\n * new TreePlugin({ childrenField: 'children' }),\n * new GroupingRowsPlugin({\n * // Leave the root level ungrouped, group every child level by kind\n * groupOn: (row, { depth }) => (depth > 0 ? row.kind : null),\n * }),\n * ],\n * };\n * ```\n *\n * @since 3.9.0\n */\nexport class HierarchyPlugin extends BaseGridPlugin {\n /** @internal */\n static override readonly manifest: PluginManifest = {\n modifiesRowStructure: true,\n };\n\n /** @internal */\n readonly name = 'hierarchy';\n\n #meta = new WeakMap<object, HierarchyRowMeta>();\n\n /** @internal */\n override detach(): void {\n // Restore the default `role=\"grid\"` (template default in `core/internal/dom-builder.ts`).\n this.gridElement?.querySelector('.rows-body')?.setAttribute('role', 'grid');\n this.#meta = new WeakMap();\n }\n\n /**\n * Build the row model for a contributor's `processRows` hook.\n *\n * Every contributor forwards its hook here; only the one that runs last in\n * the `processRows` pipeline builds the model (for all contributors at\n * once) — the earlier ones pass their rows through untouched.\n *\n * @example\n * ```ts\n * override processRows(rows: readonly unknown[]): unknown[] {\n * return this.grid.getPluginByName('hierarchy')?.process(rows, this) ?? [...rows];\n * }\n * ```\n *\n * @since 3.9.0\n */\n process(rows: readonly unknown[], caller: HierarchyContributor): unknown[] {\n const contributors = this.#contributors();\n if (!contributors.includes(caller as HierarchyContributor & BaseGridPlugin)) {\n this.#meta = new WeakMap();\n return buildHierarchy(rows, [caller], this.#meta, this.#rowSubstitute());\n }\n if (contributors[contributors.length - 1] !== caller) return rows as unknown[];\n this.#meta = new WeakMap();\n return buildHierarchy(rows, contributors, this.#meta, this.#rowSubstitute());\n }\n\n /**\n * Rows other plugins pin by ID for this rebuild (`getRowSubstitutes` query) — e.g.\n * EditingPlugin's in-progress row, so an edit survives `rows` being replaced with\n * new objects even when the row is nested (#570). `undefined` when nothing is pinned.\n */\n #rowSubstitute(): ((row: unknown) => unknown) | undefined {\n const responses = this.grid?.query?.<ReadonlyMap<string, unknown> | undefined>('getRowSubstitutes', null) ?? [];\n let pinned: Map<string, unknown> | undefined;\n for (const map of responses) {\n if (!map?.size) continue;\n pinned ??= new Map();\n for (const [id, row] of map) pinned.set(id, row);\n }\n if (!pinned) return undefined;\n const grid = this.grid;\n return (row) => {\n if (typeof row !== 'object' || row === null) return row;\n let id: string | undefined;\n try {\n id = grid.getRowId(row);\n } catch {\n return row;\n }\n return pinned.has(id) ? pinned.get(id) : row;\n };\n }\n\n /**\n * Hierarchy position of a row in the current row model, or `undefined` when\n * the row is not rendered (e.g. collapsed under a parent).\n *\n * @example\n * ```ts\n * const meta = grid.getPluginByName('hierarchy')?.getRowMeta(grid.rows[0]);\n * console.log(meta?.level, meta?.posInSet, meta?.setSize);\n * ```\n *\n * @since 3.9.0\n */\n getRowMeta(row: unknown): HierarchyRowMeta | undefined {\n return typeof row === 'object' && row !== null ? this.#meta.get(row) : undefined;\n }\n\n /** @internal */\n override afterRender(): void {\n this.#applyAria();\n }\n\n /** @internal */\n override onScrollRender(): void {\n this.#applyAria();\n }\n\n /** Attached contributors, in `processRows` hook order. */\n #contributors(): Array<HierarchyContributor & BaseGridPlugin> {\n const plugins = (this.grid?._pluginManager?.getPlugins?.() ?? []) as readonly BaseGridPlugin[];\n return plugins.filter(isContributor).sort((a, b) => processRowsPriority(a) - processRowsPriority(b));\n }\n\n #applyAria(): void {\n if (this.#contributors().length === 0) return;\n const body = this.gridElement?.querySelector('.rows');\n if (!body) return;\n\n let hierarchical = false;\n for (const rowEl of body.querySelectorAll('.data-grid-row')) {\n const meta = this.getRowMeta((rowEl as RowElementInternal).__rowDataRef);\n if (!meta) {\n // Pooled row elements may carry a position from a previous row model.\n rowEl.removeAttribute('aria-level');\n rowEl.removeAttribute('aria-setsize');\n rowEl.removeAttribute('aria-posinset');\n continue;\n }\n hierarchical = true;\n setAttrIfChanged(rowEl, 'aria-level', meta.level);\n setAttrIfChanged(rowEl, 'aria-setsize', meta.setSize);\n setAttrIfChanged(rowEl, 'aria-posinset', meta.posInSet);\n }\n\n // `treegrid` only while the model has hierarchy, so per-row level/setsize/posinset are valid in context.\n const role = hierarchical ? 'treegrid' : 'grid';\n const rowsBody = this.gridElement?.querySelector('.rows-body');\n if (rowsBody && rowsBody.getAttribute('role') !== role) rowsBody.setAttribute('role', role);\n }\n}\n"],"mappings":"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"}
|
package/umd/plugins/shell.umd.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@toolbox-web/grid")):"function"==typeof define&&define.amd?define(["exports","@toolbox-web/grid"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).TbwGridPlugin_shell={},e.TbwGrid)}(this,function(e,t){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});var o="TBW072",n="TBW073",r="TBW074";function l(e,t,o,n){console.warn(function(e,t,o,n){return`${function(e,t){return`[tbw-grid${e?`#${e}`:""}${t?`:${t}`:""}]`}(o,n)} ${e}: ${t}\n\n → More info: ${function(e){return`https://toolboxjs.com/grid/errors#${e.toLowerCase()}`}(e)}`}(e,t,o,n))}var i="__otorp__|__retteGenifed__|__retteSenifed__|rotcurtsnoc|wodniw|sihTlabolg|labolg|ssecorp|noitcnuF|tropmi|lave|tcelfeR|yxorP|rorrE|stnemugra|tnemucod|noitacol|eikooc|egarotSlacol|egarotSnoisses|BDdexedni|hctef|tseuqeRpttHLMX|tekcoSbeW|rekroW|rekroWderahS|rekroWecivreS|renepo|tnerap|pot|semarf|fles".split("|").map(e=>e.split("").reverse().join("")),a=(new RegExp(`__(proto|defineGetter|defineSetter)|${i.slice(3).join("|")}|this\\b`),new Set("script|iframe|object|embed|form|input|button|textarea|select|link|meta|base|style|template|slot|portal|frame|frameset|applet|noscript|noembed|plaintext|xmp|listing|math".split("|"))),s=/^on\w+$/i,d=new Set("href|src|action|formaction|data|srcdoc|xlink:href|poster|srcset".split("|")),c=/^\s*(javascript|vbscript|data|blob):/i;function p(e,t){t&&"string"==typeof t?-1!==t.indexOf("<")||-1!==t.indexOf("&")?e.replaceChildren(function(e){const t=document.createElement("template");return e&&"string"==typeof e&&(t.innerHTML=e,h(t.content)),t.content}(t)):e.textContent=t:e.replaceChildren()}function h(e){const t=[],o=e.querySelectorAll("*");for(const n of o){const e=n.tagName.toLowerCase();if(a.has(e)){t.push(n);continue}if(("svg"===e||"http://www.w3.org/2000/svg"===n.namespaceURI)&&Array.from(n.attributes).some(e=>s.test(e.name)||"href"===e.name||"xlink:href"===e.name)){t.push(n);continue}const o=[];for(const t of n.attributes){const e=t.name.toLowerCase();s.test(e)?o.push(t.name):"is"!==e?(d.has(e)&&c.test(t.value)||"style"===e&&/expression\s*\(|javascript:|behavior\s*:/i.test(t.value))&&o.push(t.name):o.push(t.name)}o.forEach(e=>n.removeAttribute(e))}t.forEach(e=>e.remove())}function u(){return"function"==typeof HTMLElement.prototype?.showPopover}function b(e,t){const o=document.createElement("button");return o.type="button",o.className="tbw-size-popover-btn",o.setAttribute("aria-label",e),o.textContent=t,o}function g(e){const t=e.step??16;let o,n=null,r=null,l=null,i=!1,a=!1;const s=new AbortController;function d(){i&&n&&(i=!1,u()&&n.hidePopover(),n.hidden=!0,l?.removeAttribute("data-tbw-size-open"),l=null)}function c(){r&&(r.value=String(Math.round(e.getSize(o))))}function p(t){Number.isFinite(t)&&(e.setSize(o,t),c())}return document.addEventListener("pointerdown",e=>{i&&n&&!e.composedPath().includes(n)&&d()},{capture:!0,signal:s.signal}),document.addEventListener("keydown",e=>{"Escape"===e.key&&d()},{capture:!0,signal:s.signal}),{get element(){return n},open(h,g){if(a)return;o=h,l?.removeAttribute("data-tbw-size-open"),l=g,g.setAttribute("data-tbw-size-open",""),n||(n=function(){const n=document.createElement("div");n.id=e.id,n.className="tbw-size-popover",n.setAttribute("popover","manual"),n.setAttribute("role","group"),n.hidden=!0;const l=b("Narrower","−"),i=b("Wider","+"),a=b("Reset size","Reset"),h=document.createElement("input");return h.type="number",h.className="tbw-size-popover-input",h.min="0",h.step="any",h.setAttribute("aria-label","Size in pixels"),l.addEventListener("click",()=>p(e.getSize(o)-t),{signal:s.signal}),i.addEventListener("click",()=>p(e.getSize(o)+t),{signal:s.signal}),a.addEventListener("click",()=>{e.reset(o),c()},{signal:s.signal}),h.addEventListener("change",()=>p(h.valueAsNumber),{signal:s.signal}),n.addEventListener("focusout",e=>{const t=e.relatedTarget;t instanceof Node&&!n.contains(t)&&d()},{signal:s.signal}),n.append(l,h,i,a),r=h,n}());const f=e.getHost(h)??document.body;n.parentNode!==f&&f.appendChild(n),n.setAttribute("aria-label",e.getLabel(h)),c(),n.hidden=!1,!i&&u()&&n.showPopover(),i=!0,function(e){if(!n)return;const t=e.getBoundingClientRect(),o=n.getBoundingClientRect(),r=(e,t)=>Math.max(4,Math.min(e,t-4)),l=r(t.left+t.width/2-o.width/2,window.innerWidth-o.width),i=t.bottom+6,a=t.top-6-o.height,s=t.height>3*o.height;let d;d=!s&&i+o.height<=window.innerHeight?i:!s&&a>=4?a:r(t.top+t.height/2-o.height/2,window.innerHeight-o.height),n.style.left=`${Math.round(l)}px`,n.style.top=`${Math.round(d)}px`}(g),r?.focus()},close:d,dispose(){a=!0,d(),s.abort(),n?.remove(),n=null,r=null}}}var f="tbw-grid-root";function w(e,t){if(t)for(const o in t){const n=t[o];null!=n&&e.setAttribute(o,n)}}function v(e,t,o){const n=document.createElement(e);if(w(n,t),o)for(const r of o)null!=r&&("string"==typeof r?n.appendChild(document.createTextNode(r)):n.appendChild(r));return n}function C(e,t){const o=document.createElement("div");return e&&(o.className=e),w(o,t),o}function m(e,t,o){const n=document.createElement("button");return n.type="button",e&&(n.className=e),w(n,t),o&&("string"==typeof o?n.textContent=o:n.appendChild(o)),n}var y=document.createElement("template");function x(){return y.content.cloneNode(!0)}function P(e){const t=document.createDocumentFragment(),o=C(e.hasShell?`${f} has-shell`:f);if(e.hasShell&&e.shellBody)e.shellHeader&&o.appendChild(e.shellHeader),o.appendChild(e.shellBody);else{const e=C("tbw-grid-content");e.appendChild(x()),o.appendChild(e)}return t.appendChild(o),t}function S(e){const t=C("tbw-shell-header",{part:"shell-header",role:"presentation"});if(e.title){const o=C("tbw-shell-title");o.textContent=e.title,t.appendChild(o)}const o=C("tbw-shell-content",{part:"shell-content",role:"presentation","data-light-dom-header-content":""});t.appendChild(o);const n=C("tbw-shell-toolbar",{part:"shell-toolbar",role:"presentation"});for(const i of e.configButtons)i.hasRender&&n.appendChild(C("tbw-toolbar-content-slot",{"data-toolbar-content":i.id}));for(const i of e.apiButtons)i.hasRender&&n.appendChild(C("tbw-toolbar-content-slot",{"data-toolbar-content":i.id}));const r=e.configButtons.some(e=>e.hasRender)||e.apiButtons.some(e=>e.hasRender),l=e.hasPanels&&!1!==e.showToggle;if(r&&l&&n.appendChild(C("tbw-toolbar-separator")),l){const t=m(e.isPanelOpen?"tbw-toolbar-btn active":"tbw-toolbar-btn",{"data-panel-toggle":"",title:"Settings","aria-label":"Toggle settings panel","aria-pressed":String(e.isPanelOpen),"aria-controls":"tbw-tool-panel"});t.dataset.icon="tool-panel",void 0!==e.toolPanelIcon&&p(t,e.toolPanelIcon),n.appendChild(t)}return t.appendChild(n),t}function T(e){const t=m(e?"tbw-tool-panel-close tbw-tool-panel-close--inline":"tbw-tool-panel-close",{part:"tool-panel-close","data-panel-close":"",title:"Close panel","aria-label":"Close panel","aria-controls":"tbw-tool-panel"});return t.textContent="✕",t}function O(){const e=C("tbw-tool-panel-header",{part:"tool-panel-header"});return e.appendChild(T(!1)),e}function z(e,t,o,n){const r=!!e.title||!o,l=n&&r,i=C(`tbw-accordion-section${e.isExpanded?" expanded":""}${o?" single":""}${l?" has-inline-close":""}`,{"data-section":e.id});if(r){const n=function(e,t,o){const n=m("tbw-accordion-header",{"aria-expanded":String(e.isExpanded),"aria-controls":`tbw-section-${e.id}`});if(o&&n.setAttribute("aria-disabled","true"),e.icon){const t=v("span",{class:"tbw-accordion-icon"});p(t,e.icon),n.appendChild(t)}const r=v("span",{class:"tbw-accordion-title"});if(r.textContent=e.title??"",n.appendChild(r),!o){const e=v("span",{class:"tbw-accordion-chevron","data-icon":"expand"});void 0!==t.expandIcon&&p(e,t.expandIcon),n.appendChild(e)}return n}(e,t,o);if(l){const e=C("tbw-accordion-header-row");e.appendChild(n),e.appendChild(T(!0)),i.appendChild(e)}else i.appendChild(n)}else n&&i.appendChild(O());return i.appendChild(C("tbw-accordion-content",{id:`tbw-section-${e.id}`,role:"presentation"})),i}function D(e){const t=e.mode??"overlay",o=C("tbw-shell-body",{"data-mode":t}),n=C("tbw-grid-content");n.appendChild(x());const r=e.panels.length>0?function(e,t){const o=1===e.panels.length,n=v("aside",{class:e.isPanelOpen?"tbw-tool-panel open":"tbw-tool-panel",part:"tool-panel","data-position":e.position,role:"presentation",id:"tbw-tool-panel",..."dropdown"===t?{popover:"manual"}:{}});n.appendChild(C("tbw-tool-panel-resize",{"data-resize-handle":"","data-handle-position":"left"===e.position?"right":"left",role:"button",tabindex:"-1","aria-label":"Tool panel width — drag, or activate to set a width"}));const r=!0===e.showCloseButton&&o;e.showCloseButton&&!o&&n.appendChild(O());const l=C("tbw-tool-panel-content",{role:"presentation"}),i=C("tbw-accordion");for(const a of e.panels)i.appendChild(z(a,e,o,r));return l.appendChild(i),n.appendChild(l),n}(e,t):null;return"left"===e.position&&r?(o.appendChild(r),o.appendChild(n)):(o.appendChild(n),r&&o.appendChild(r)),o}y.innerHTML='\n <div class="tbw-scroll-area">\n <div class="rows-body-wrapper">\n <div class="rows-body" role="grid">\n <div class="header" role="rowgroup">\n <div class="header-row" role="row" part="header-row"></div>\n </div>\n <div class="rows-container" role="presentation">\n <div class="rows-viewport" role="presentation">\n <div class="rows"></div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <div class="faux-vscroll">\n <div class="faux-vscroll-spacer"></div>\n </div>\n <div class="tbw-sr-only" aria-live="polite" aria-atomic="true"></div>\n';function E(e){return e?"string"==typeof e?function(e){if(!e||"string"!=typeof e)return"";if(-1===e.indexOf("<"))return e;const t=document.createElement("template");return t.innerHTML=e,h(t.content),t.innerHTML}(e):e.outerHTML:""}function k(e){return!!e?.header?.title||(!!e?.header?.toolbarContents?.length||(!!e?.toolPanels?.length||(!!e?.headerContents?.length||(!!e?.header?.lightDomContent?.length||!!e?.header?.hasToolButtonsContainer))))}function _(e){return!1!==e?.header?.visible}function H(e,t){if(t.contains(e))return!0;const o=e.getRootNode();return o instanceof ShadowRoot&&o.host===t}function L(e,o,n){const r=e.querySelector(".tbw-tool-panel"),l=e.querySelector("[data-resize-handle]"),i=e.querySelector(".tbw-shell-body");if(!r||!l||!i)return()=>{};const a=o?.toolPanel?.position??"right";let s=0,d=0,c=0,p=!1,h=!1,u=null,b=null;const f=()=>i.getBoundingClientRect().width-20,w=e=>{if(!p)return;e.preventDefault(),h=!0;const t="left"===a?e.clientX-s:s-e.clientX,o=Math.min(c,Math.max(200,d+t));r.style.width=`${o}px`},v=e=>{if(p&&(p=!1,u=null,l.classList.remove("resizing"),r.style.transition="",document.body.style.cursor="",document.body.style.userSelect="",e)){const e=r.getBoundingClientRect().width;n(e)}},C=e=>{p||0!==e.button&&"mouse"===e.pointerType||(e.preventDefault(),p=!0,h=!1,s=e.clientX,d=r.getBoundingClientRect().width,c=f(),l.classList.add("resizing"),r.style.transition="none",document.body.style.cursor="col-resize",document.body.style.userSelect="none",u=(0,t.startPointerDrag)(e,l,{onMove:w,onEnd:()=>{const e=!h;v(!e),e&&(b??=g({id:"tbw-tool-panel-width-popover",step:32,getSize:e=>e.getBoundingClientRect().width,setSize:(e,t)=>{const o=Math.min(f(),Math.max(200,t));e.style.width=`${o}px`,n(o)},reset:e=>{e.style.width="",n(e.getBoundingClientRect().width)},getLabel:()=>"Tool panel width",getHost:e=>e.closest("tbw-grid, [data-tbw-grid]")}),b.open(r,l))},onCancel:()=>{r.style.width=`${d}px`,v(!1)}}))};return l.addEventListener("pointerdown",C),()=>{l.removeEventListener("pointerdown",C),u?.(),u=null,b?.dispose(),b=null}}function A(e,t){const o=t.lightDomHeaderContent.length>0&&!t.lightDomContentMoved,n=t.headerContents.size>0;if(!o&&!n)return;const r=e.querySelector(".tbw-shell-content");if(!r)return;if(o){for(const e of t.lightDomHeaderContent)e.style.display="",r.appendChild(e);t.lightDomContentMoved=!0}const l=[...t.headerContents.values()].sort((e,t)=>(e.order??100)-(t.order??100));for(const i of l){const e=t.headerContentCleanups.get(i.id);e&&(e(),t.headerContentCleanups.delete(i.id));let o=r.querySelector(`[data-header-content="${i.id}"]`);o||(o=document.createElement("div"),o.setAttribute("data-header-content",i.id),r.appendChild(o));const n=i.render(o);n&&t.headerContentCleanups.set(i.id,n)}}function R(e,t,o){if(t.isPanelOpen)for(const[n,r]of t.toolPanels){const o=t.expandedSections.has(n),l=e.querySelector(`[data-section="${n}"]`),i=l?.querySelector(".tbw-accordion-content");if(!l||!i)continue;l.classList.toggle("expanded",o);const a=l.querySelector(".tbw-accordion-header");if(a&&a.setAttribute("aria-expanded",String(o)),o){if(0===i.children.length){const e=r.render(i);e&&t.panelCleanups.set(n,e)}}else{const e=t.panelCleanups.get(n);e&&(e(),t.panelCleanups.delete(n)),i.innerHTML=""}}}function $(e,t){const o=e.querySelector("[data-panel-toggle]");o&&(o.classList.toggle("active",t.isPanelOpen),o.setAttribute("aria-pressed",String(t.isPanelOpen)))}function q(e,t){const o=e.querySelector(".tbw-tool-panel");o&&(o.classList.toggle("open",t.isPanelOpen),t.isPanelOpen||(o.style.width=""))}var B="--tbw-tool-panel-anchor",I=0;function M(){return"undefined"!=typeof CSS&&"function"==typeof CSS.supports&&CSS.supports("anchor-name",B)}function N(e,t,o,n){const r=e.querySelector(".tbw-tool-panel");if(r){if(t.dropdownAnchorEl=o,r.dataset.anchor=n?"corner":"below",r.hasAttribute("popover")&&"function"==typeof r.showPopover)try{r.showPopover()}catch{}if(M()){const e=`${B}-${++I}`;t.dropdownAnchorName=e,o.style.setProperty("anchor-name",e),r.style.setProperty("position-anchor",e),r.style.removeProperty("top"),r.style.removeProperty("left"),r.style.removeProperty("right")}else!function(e,t,o){const n=t.getBoundingClientRect(),r=e.getAttribute("data-position")??"right";if(e.style.position="fixed",e.style.top=`${Math.round((o?n.top:n.bottom)+4)}px`,"left"===r)e.style.left=`${Math.round(n.left)}px`,e.style.right="auto";else{const t="undefined"!=typeof window?window.innerWidth:0;e.style.left="auto",e.style.right=`${Math.round(t-n.right)}px`}}(r,o,n)}}function W(e){for(const t of e.toolbarContentCleanups.values())t();e.toolbarContentCleanups.clear();for(const t of e.panelCleanups.values())t();e.panelCleanups.clear();for(const t of e.headerContentCleanups.values())t();e.headerContentCleanups.clear(),e.lightDomContentMoved=!1}function j(e,t,o){const n=void 0!==o?.toolPanel?E(o.toolPanel):void 0,r=void 0!==o?.expand?E(o.expand):void 0,l=void 0!==o?.collapse?E(o.collapse):void 0,i=[...e.header?.toolbarContents??[]].sort((e,t)=>(e.order??0)-(t.order??0)),a=[...e.toolPanels??[]].sort((e,t)=>(e.order??100)-(t.order??100));return{headerOptions:{title:e.header?.title??void 0,hasPanels:a.length>0,isPanelOpen:t.isPanelOpen,toolPanelIcon:n,showToggle:!1!==e.header?.toolPanelToggle&&!0!==e.toolPanel?.locked,configButtons:i.map(e=>({id:e.id,hasElement:!1,hasRender:!!e.render})),apiButtons:[]},bodyOptions:{position:e.toolPanel?.position??"right",mode:e.toolPanel?.mode??"overlay",isPanelOpen:t.isPanelOpen,expandIcon:r,collapseIcon:l,showCloseButton:!1===e.header?.visible&&!0!==e.toolPanel?.locked&&"dropdown"!==(e.toolPanel?.mode??"overlay"),panels:a.map(e=>({id:e.id,title:e.title,icon:E(e.icon),isExpanded:t.expandedSections.has(e.id)}))}}}function G(e,t,o,n){const r=e.querySelector(`.${f}`),l=r?.querySelector(".tbw-grid-content");if(!r||!l)return function(e,t,o,n){const r=k(t),l=[];for(let i=e.firstChild;i;i=i.nextSibling)1===i.nodeType&&i.classList.contains(f)||l.push(i);e.replaceChildren();for(const i of l)e.appendChild(i);if(r){const{headerOptions:r,bodyOptions:l}=j(t,o,n),i=P({hasShell:!0,shellHeader:_(t)?S(r):void 0,shellBody:D(l)});e.appendChild(i)}else{const t=P({hasShell:!1});e.appendChild(t)}return r}(e,t,o,n);l.remove();const i=k(t);if(r.replaceChildren(),i){r.className=`${f} has-shell`;const{headerOptions:e,bodyOptions:i}=j(t,o,n),a=_(t)?S(e):void 0,s=D(i),d=s.querySelector(".tbw-grid-content");d&&d.replaceWith(l),a&&r.appendChild(a),r.appendChild(s)}else r.className=f,r.appendChild(l);return i}function F(e,t){let i=!1;const a={get isInitialized(){return i},setInitialized(e){i=e},get isPanelOpen(){return e.isPanelOpen},get expandedSections(){return[...e.expandedSections]},openToolPanel(n,r){if(0===e.toolPanels.size)return void l("TBW071","No tool panels registered",t.id);let i;if(void 0!==n&&(e.toolPanels.has(n)?i=n:l(o,`Tool panel "${n}" not found`,t.id)),e.isPanelOpen&&i&&e.expandedSections.has(i))return;if(e.isPanelOpen&&i&&!e.expandedSections.has(i))return void a.toggleToolPanelSection(i);if(e.isPanelOpen)return;if(e.isPanelOpen=!0,0===e.expandedSections.size&&e.toolPanels.size>0)if(i)e.expandedSections.add(i);else{const o=t.effectiveConfig?.shell?.toolPanel?.defaultOpen;if(o&&e.toolPanels.has(o))e.expandedSections.add(o);else{const t=[...e.toolPanels.values()].sort((e,t)=>(e.order??100)-(t.order??100))[0];t&&e.expandedSections.add(t.id)}}else if(i&&!e.expandedSections.has(i)){for(const t of[...e.expandedSections])e.expandedSections.delete(t);e.expandedSections.add(i)}const s=t._renderRoot;if($(s,e),q(s,e),R(s,e,t._accordionIcons),"dropdown"===t.effectiveConfig?.shell?.toolPanel?.mode){const{el:o,corner:n}=function(e){if(e)return{el:e,corner:!1};const o=t._renderRoot.querySelector("[data-panel-toggle]");return o?{el:o,corner:!1}:{el:t._hostElement,corner:!0}}(r?.anchor);N(s,e,o,n)}t._emit("tool-panel-open",{sections:a.expandedSections})},closeToolPanel(){if(!e.isPanelOpen)return;if(t.effectiveConfig?.shell?.toolPanel?.locked)return;for(const t of e.panelCleanups.values())t();e.panelCleanups.clear();for(const t of e.toolPanels.values())t.onClose?.();e.isPanelOpen=!1;const o=t._renderRoot;$(o,e),q(o,e),"dropdown"===t.effectiveConfig?.shell?.toolPanel?.mode&&function(e,t){const o=e.querySelector(".tbw-tool-panel");if(o){if(o.hasAttribute("popover")&&"function"==typeof o.hidePopover)try{o.hidePopover()}catch{}o.style.removeProperty("position-anchor"),o.style.removeProperty("position"),o.style.removeProperty("top"),o.style.removeProperty("left"),o.style.removeProperty("right"),delete o.dataset.anchor}t.dropdownAnchorEl&&(t.dropdownAnchorEl.style.removeProperty("anchor-name"),t.dropdownAnchorEl=null),t.dropdownAnchorName=null}(o,e),t._emit("tool-panel-close",{})},toggleToolPanel(t){e.isPanelOpen?a.closeToolPanel():a.openToolPanel(void 0,t)},reanchorOpenDropdown(){if(!e.isPanelOpen)return;if("dropdown"!==t.effectiveConfig?.shell?.toolPanel?.mode)return;const o=e.dropdownAnchorEl;if(o&&o.isConnected&&e.dropdownAnchorName&&o.style.getPropertyValue("anchor-name")===e.dropdownAnchorName)return;if(!e.dropdownAnchorName&&o&&o.isConnected&&o!==t._hostElement&&"below"===t._renderRoot.querySelector(".tbw-tool-panel")?.dataset.anchor)return;const n=t._renderRoot.querySelector("[data-panel-toggle]");if(n&&n!==t._hostElement){if(e.dropdownAnchorName&&M()&&function(e,t,o){const n=t.dropdownAnchorName;if(!n)return!1;const r=e.querySelector(".tbw-tool-panel");if(!r)return!1;const l=t.dropdownAnchorEl;if(l&&l!==o&&l.style.removeProperty("anchor-name"),o.style.setProperty("anchor-name",n),r.style.setProperty("position-anchor",n),r.style.removeProperty("top"),r.style.removeProperty("left"),r.style.removeProperty("right"),r.dataset.anchor="below",t.dropdownAnchorEl=o,r.hasAttribute("popover")&&"function"==typeof r.showPopover)try{r.showPopover()}catch{}return!0}(t._renderRoot,e,n))return;N(t._renderRoot,e,n,!1)}else o!==t._hostElement||N(t._renderRoot,e,t._hostElement,!0)},toggleToolPanelSection(n){const r=e.toolPanels.get(n);if(!r)return void l(o,`Tool panel section "${n}" not found`,t.id);if(1===e.toolPanels.size)return;const i=t._renderRoot,a=e.expandedSections.has(n);if(a){const t=e.panelCleanups.get(n);t&&(t(),e.panelCleanups.delete(n)),r.onClose?.(),e.expandedSections.delete(n),X(i,n,!1)}else{for(const[t,o]of e.toolPanels)if(t!==n&&e.expandedSections.has(t)){const n=e.panelCleanups.get(t);n&&(n(),e.panelCleanups.delete(t)),o.onClose?.(),e.expandedSections.delete(t),X(i,t,!1);const r=i.querySelector(`[data-section="${t}"] .tbw-accordion-content`);r&&(r.innerHTML="")}e.expandedSections.add(n),X(i,n,!0),function(e,t,o){const n=t.toolPanels.get(o);if(!n?.render)return;const r=e.querySelector(`[data-section="${o}"] .tbw-accordion-content`);if(!r)return;const l=n.render(r);l&&t.panelCleanups.set(o,l)}(i,e,n)}t._emit("tool-panel-section-toggle",{id:n,expanded:!a})},getToolPanels:()=>[...e.toolPanels.values()],registerToolPanel(o){e.toolPanels.has(o.id)?l(n,`Tool panel "${o.id}" already registered`,t.id):(e.toolPanels.set(o.id,o),(i||t._hostElement.isConnected)&&t.refreshShellHeader?.())},unregisterToolPanel(o){if(e.expandedSections.has(o)){const t=e.panelCleanups.get(o);t&&(t(),e.panelCleanups.delete(o)),e.expandedSections.delete(o)}e.toolPanels.delete(o),(i||t._hostElement.isConnected)&&t.refreshShellHeader?.()},getHeaderContents:()=>[...e.headerContents.values()],registerHeaderContent(o){e.headerContents.has(o.id)?l(r,`Header content "${o.id}" already registered`,t.id):(e.headerContents.set(o.id,o),i?A(t._renderRoot,e):t._hostElement.isConnected&&t.refreshShellHeader?.())},unregisterHeaderContent(o){const n=e.headerContentCleanups.get(o);n&&(n(),e.headerContentCleanups.delete(o)),e.headerContents.get(o)?.onDestroy?.(),e.headerContents.delete(o),t._renderRoot.querySelector(`[data-header-content="${o}"]`)?.remove()},getToolbarContents:()=>[...e.toolbarContents.values()].sort((e,t)=>(e.order??0)-(t.order??0)),registerToolbarContent(o){e.toolbarContents.has(o.id)?l("TBW075",`Toolbar content "${o.id}" already registered`,t.id):(e.toolbarContents.set(o.id,o),(i||t._hostElement.isConnected)&&t.refreshShellHeader?.())},unregisterToolbarContent(o){const n=e.toolbarContentCleanups.get(o);n&&(n(),e.toolbarContentCleanups.delete(o));const r=e.toolbarContents.get(o);r?.onDestroy&&r.onDestroy(),e.toolbarContents.delete(o),i&&t.refreshShellHeader?.()}};return a}function X(e,t,o){const n=e.querySelector(`[data-section="${t}"]`);n&&n.classList.toggle("expanded",o)}var U=class extends t.BaseGridPlugin{name="shell";styles='@layer tbw-base{tbw-grid .tbw-shell-header{min-height:var(--tbw-shell-header-height);background:var(--tbw-shell-header-bg);border-bottom:1px solid var(--tbw-shell-header-border);flex-shrink:0;align-items:center;gap:8px;padding:0 8px;display:flex}tbw-grid .tbw-shell-title{font-size:var(--tbw-shell-title-font-size);font-weight:var(--tbw-shell-title-font-weight);white-space:nowrap;text-overflow:ellipsis;overflow:hidden}tbw-grid .tbw-shell-content{flex:1;align-items:center;gap:12px;min-width:0;display:flex;overflow:hidden}tbw-grid .tbw-shell-toolbar{align-items:center;gap:var(--tbw-toolbar-button-gap);flex-shrink:0;display:flex}tbw-grid .tbw-toolbar-btn{width:var(--tbw-toolbar-button-size);height:var(--tbw-toolbar-button-size);border-radius:var(--tbw-border-radius);color:var(--tbw-color-fg);cursor:pointer;transition:background var(--tbw-transition-duration) var(--tbw-transition-ease), border-color var(--tbw-transition-duration) var(--tbw-transition-ease);background:0 0;border:1px solid #0000;justify-content:center;align-items:center;padding:0;font-size:16px;display:inline-flex}tbw-grid .tbw-toolbar-btn:hover{background:var(--tbw-color-row-hover)}tbw-grid .tbw-toolbar-btn:focus-visible{outline:var(--tbw-focus-outline);outline-offset:var(--tbw-focus-outline-offset)}tbw-grid .tbw-toolbar-btn.active{background:var(--tbw-focus-background);border-color:var(--tbw-color-accent)}tbw-grid .tbw-toolbar-btn:disabled{opacity:.5;cursor:not-allowed}tbw-grid .tbw-toolbar-separator{background:var(--tbw-color-border);width:1px;height:20px;margin:0 4px}tbw-grid .tbw-shell-body{flex:1;min-height:0;display:flex;position:relative;overflow:visible}tbw-grid .tbw-tool-panel{overflow-clip-margin:var(--tbw-tool-panel-resize-overhang,12px);background:var(--tbw-tool-panel-bg);border-left:1px solid var(--tbw-tool-panel-border);width:0;transition:width var(--tbw-tool-panel-transition);z-index:var(--tbw-z-layer-toolpanel,31);box-shadow:-2px 0 8px var(--tbw-color-shadow);flex-direction:column;display:flex;position:absolute;top:0;bottom:0;right:0;overflow:clip}tbw-grid .tbw-tool-panel[data-position=left]{border-left:none;border-right:1px solid var(--tbw-tool-panel-border);box-shadow:2px 0 8px var(--tbw-color-shadow);left:0;right:auto}tbw-grid .tbw-tool-panel.open{width:min(var(--tbw-tool-panel-width), 100% - 20px);max-width:calc(100% - 20px)}tbw-grid .tbw-shell-body[data-mode=push] .tbw-tool-panel{box-shadow:none;z-index:auto;border-left:none;border-right:none;flex-shrink:0;position:relative;inset:auto}tbw-grid .tbw-shell-body[data-mode=push] .tbw-tool-panel.open{border-left:1px solid var(--tbw-tool-panel-border)}tbw-grid .tbw-shell-body[data-mode=push] .tbw-tool-panel[data-position=left].open{border-left:none;border-right:1px solid var(--tbw-tool-panel-border)}tbw-grid .tbw-shell-body[data-mode=push] .tbw-tool-panel-resize{display:none}tbw-grid .tbw-tool-panel[popover]{width:var(--tbw-tool-panel-width);border:1px solid var(--tbw-tool-panel-border);border-radius:var(--tbw-border-radius,6px);max-width:calc(100vw - 16px);height:auto;max-height:min(70vh,480px);box-shadow:0 8px 24px var(--tbw-color-shadow);margin:4px 0 0;padding:0;transition:none;display:none;position:fixed;inset:auto;overflow:hidden auto}:is(tbw-grid .tbw-tool-panel[popover]:popover-open,tbw-grid .tbw-tool-panel[popover].open){width:var(--tbw-tool-panel-width);display:flex}tbw-grid .tbw-tool-panel[popover] .tbw-tool-panel-resize{display:none}@supports (anchor-name:--x){tbw-grid .tbw-tool-panel[popover]{top:anchor(bottom);right:anchor(right);position-try-fallbacks:flip-block, flip-inline, flip-block flip-inline;left:auto}tbw-grid .tbw-tool-panel[popover][data-anchor=corner]{top:anchor(top)}tbw-grid .tbw-tool-panel[popover][data-position=left]{left:anchor(left);right:auto}}tbw-grid .tbw-tool-panel-resize{width:calc(var(--tbw-tool-panel-resize-overhang,12px) * 2);cursor:col-resize;z-index:10;touch-action:none;-webkit-user-select:none;user-select:none;background:0 0;position:absolute;top:0;bottom:0}tbw-grid .tbw-tool-panel-resize:before{content:"";width:6px;transition:background var(--tbw-transition-duration) var(--tbw-transition-ease);background:0 0;position:absolute;top:0;bottom:0}tbw-grid .tbw-tool-panel-resize[data-handle-position=left]{left:calc(3px - var(--tbw-tool-panel-resize-overhang,12px))}tbw-grid .tbw-tool-panel-resize[data-handle-position=left]:before{left:calc(var(--tbw-tool-panel-resize-overhang,12px) - 3px)}tbw-grid .tbw-tool-panel-resize[data-handle-position=right]{right:calc(3px - var(--tbw-tool-panel-resize-overhang,12px))}tbw-grid .tbw-tool-panel-resize[data-handle-position=right]:before{right:calc(var(--tbw-tool-panel-resize-overhang,12px) - 3px)}tbw-grid .tbw-tool-panel-resize:hover:before,tbw-grid .tbw-tool-panel-resize.resizing:before,tbw-grid .tbw-tool-panel-resize[data-tbw-size-open]:before{background:var(--tbw-color-accent)}tbw-grid .tbw-tool-panel:not(.open) .tbw-tool-panel-resize{display:none}tbw-grid .tbw-tool-panel-header{min-height:var(--tbw-tool-panel-header-height);border-bottom:1px solid var(--tbw-tool-panel-border);flex-shrink:0;justify-content:flex-end;align-items:center;padding:0 12px;display:flex}tbw-grid .tbw-tool-panel-title{white-space:nowrap;text-overflow:ellipsis;font-size:13px;font-weight:600;overflow:hidden}tbw-grid .tbw-tool-panel-close{border-radius:var(--tbw-border-radius);width:24px;height:24px;color:var(--tbw-color-fg-muted);cursor:pointer;background:0 0;border:none;justify-content:center;align-items:center;padding:0;font-size:14px;display:inline-flex}tbw-grid .tbw-tool-panel-close:hover{background:var(--tbw-color-row-hover);color:var(--tbw-color-fg)}tbw-grid .tbw-accordion-header-row{align-items:stretch;display:flex}tbw-grid .tbw-accordion-header-row .tbw-accordion-header{flex:1;min-width:0}tbw-grid .tbw-tool-panel-close--inline{flex-shrink:0;align-self:center;margin-inline-end:8px}tbw-grid .tbw-tool-panel-content{flex:1;overflow:auto}tbw-grid .tbw-accordion{flex-direction:column;gap:0;display:flex}tbw-grid .tbw-accordion-section{border-bottom:1px solid var(--tbw-tool-panel-border)}tbw-grid .tbw-accordion-section:last-child{border-bottom:none}tbw-grid .tbw-accordion-section.single .tbw-accordion-header{cursor:default}tbw-grid .tbw-accordion-section.single .tbw-accordion-header:hover{background:0 0}tbw-grid .tbw-accordion-section.expanded .tbw-accordion-chevron{transform:rotate(90deg)}tbw-grid .tbw-accordion-section.expanded .tbw-accordion-content{display:block}tbw-grid .tbw-accordion-header{width:100%;color:var(--tbw-color-fg);text-align:start;cursor:pointer;-webkit-user-select:none;user-select:none;background:0 0;border:none;align-items:center;gap:8px;padding:10px 12px;font-size:13px;font-weight:600;display:flex}tbw-grid .tbw-accordion-header:hover{background:var(--tbw-color-row-hover)}tbw-grid .tbw-accordion-chevron{width:16px;height:16px;color:var(--tbw-color-fg-muted);flex-shrink:0;justify-content:center;align-items:center;font-size:10px;transition:transform .15s;display:inline-flex}tbw-grid .tbw-accordion-icon{flex-shrink:0;justify-content:center;align-items:center;width:16px;height:16px;font-size:14px;display:inline-flex}tbw-grid .tbw-accordion-title{text-overflow:ellipsis;white-space:nowrap;flex:1;overflow:hidden}tbw-grid .tbw-accordion-content{display:none}}';#e;#t;#o;#n;#r;#l;#i;#a=!1;get hasState(){return void 0!==this.#e}ensureState(e){if(this.#e)return;const t={toolPanels:new Map,headerContents:new Map,toolbarContents:new Map,hasToolButtonsContainer:!1,lightDomHeaderContent:[],lightDomTitle:null,lightDomToolPanelIds:new Set,adapterBoundToolPanelIds:new Set,lightDomToolbarContentIds:new Set,apiToolPanelIds:new Set,apiHeaderContentIds:new Set,isPanelOpen:!1,expandedSections:new Set,headerContentCleanups:new Map,panelCleanups:new Map,toolbarContentCleanups:new Map,lightDomContentMoved:!1,dropdownAnchorEl:null,dropdownAnchorName:null};this.#e=t,this.#t=F(t,e)}get shellState(){return this.#e}get shellController(){return this.#t}get isToolPanelOpen(){return!!this.hasState&&this.shellController.isPanelOpen}get expandedToolPanelSections(){return this.hasState?this.shellController.expandedSections:[]}openToolPanel(e,t){this.shellController?.openToolPanel(e,t)}closeToolPanel(){this.shellController?.closeToolPanel()}toggleToolPanel(e){this.shellController?.toggleToolPanel(e)}toggleToolPanelSection(e){this.shellController?.toggleToolPanelSection(e)}getToolPanels(){return this.hasState?this.shellController.getToolPanels():[]}registerToolPanel(e){this.hasState&&(this.shellState.apiToolPanelIds.add(e.id),this.shellController.registerToolPanel(e))}unregisterToolPanel(e){this.hasState&&(this.shellState.apiToolPanelIds.delete(e),this.shellController.unregisterToolPanel(e))}getHeaderContents(){return this.hasState?this.shellController.getHeaderContents():[]}registerHeaderContent(e){this.hasState&&(this.shellState.apiHeaderContentIds.add(e.id),this.shellController.registerHeaderContent(e))}unregisterHeaderContent(e){this.hasState&&(this.shellState.apiHeaderContentIds.delete(e),this.shellController.unregisterHeaderContent(e))}getToolbarContents(){return this.hasState?this.shellController.getToolbarContents():[]}registerToolbarContent(e){this.shellController?.registerToolbarContent(e)}unregisterToolbarContent(e){this.shellController?.unregisterToolbarContent(e)}attach(e){super.attach(e),this.ensureState(e);const t=()=>this.syncLightDom();this.#l=t,e._registerLightDomHandler("tbw-grid-header",t),e._registerLightDomHandler("tbw-grid-tool-buttons",t),e._registerLightDomHandler("tbw-grid-tool-panel",t)}#s(e){const t=e._hostElement;!function(e,t){const o=e.querySelector("tbw-grid-header");if(!o)return;if(!t.lightDomTitle){const e=o.getAttribute("title");e&&(t.lightDomTitle=e)}const n=o.querySelectorAll("tbw-grid-header-content");n.length>0&&0===t.lightDomHeaderContent.length&&(t.lightDomHeaderContent=Array.from(n)),o.style.display="none"}(t,this.shellState),function(e,t,o){const n=e.querySelector(":scope > tbw-grid-tool-buttons");if(!n)return;t.hasToolButtonsContainer=!0;const r="light-dom-toolbar-content";if(t.lightDomToolbarContentIds.has(r))return;const l={id:r,order:0,render:o?.(n)??(e=>{for(;n.firstChild;)e.appendChild(n.firstChild);return()=>{for(;e.firstChild;)n.appendChild(e.firstChild)}})};t.toolbarContents.set(r,l),t.lightDomToolbarContentIds.add(r),n.style.display="none"}(t,this.shellState),function(e,t,o){e.querySelectorAll(":scope > tbw-grid-tool-panel").forEach(e=>{const r=e,i=r.getAttribute("id"),a=r.getAttribute("title")??void 0;if(!i)return void l("TBW070",`Tool panel missing required id attribute: title="${a??""}"`);const s=r.getAttribute("icon")??void 0,d=r.getAttribute("tooltip")??void 0,c=parseInt(r.getAttribute("order")??"100",10);let h;const u=o?.(r);if(u)h=u;else{const e=r.innerHTML.trim();h=t=>{const o=document.createElement("div");return p(o,e),t.appendChild(o),()=>o.remove()}}const b=t.toolPanels.get(i);if(b&&!t.lightDomToolPanelIds.has(i))return l(n,`Tool panel "${i}" is already provided by a plugin or the grid API; ignoring the matching light-DOM <tbw-grid-tool-panel>.`),void(r.style.display="none");if(b){if(u){const e=!t.adapterBoundToolPanelIds.has(i),o=b.title!==a||b.order!==c||b.icon!==s||b.tooltip!==d;if(b.render=h,b.title=a,b.order=c,b.icon=s,b.tooltip=d,t.adapterBoundToolPanelIds.add(i),e||o){const e=t.panelCleanups.get(i);e&&(e(),t.panelCleanups.delete(i))}}return}const g={id:i,title:a,icon:s,tooltip:d,order:c,render:h};t.toolPanels.set(i,g),t.lightDomToolPanelIds.add(i),u&&t.adapterBoundToolPanelIds.add(i),r.style.display="none"})}(t,this.shellState,e._getToolPanelRendererFactory())}syncLightDom(){const e=this.grid;if(!e||!this.hasState)return;const t=this.shellState,o=t.lightDomTitle,n=t.hasToolButtonsContainer;this.#s(e);const r=t.lightDomTitle,l=t.hasToolButtonsContainer;(r&&!o||l&&!n)&&(e._requestConfigMerge(),e._renderRoot.querySelector(".tbw-shell-header")&&(W(t),this.afterStructuralRender()))}parseLightDom(){const e=this.grid;e&&this.hasState&&this.#s(e)}beforeStructuralRender(){this.hasState&&W(this.shellState)}needsStructuralRerender(){const e=this.grid;if(!e||!this.hasState)return!1;const t=e._renderRoot,o=!!t.querySelector(".has-shell"),n=!!t.querySelector(".tbw-tool-panel"),r=t.querySelectorAll(".tbw-accordion-section").length,l=t.querySelector(".tbw-tool-panel")?.dataset.position??"right",i=t.querySelector(".tbw-shell-body")?.dataset.mode??"overlay",a=e.effectiveConfig?.shell;return o!==k(a)||!n&&(a?.toolPanels?.length??0)>0||n&&(a?.toolPanels?.length??0)!==r||n&&l!==(a?.toolPanel?.position??"right")||n&&i!==(a?.toolPanel?.mode??"overlay")}#d(e){const t=this.shellState,o=e._hostElement.id;for(const n of[...t.toolPanels.keys()])t.lightDomToolPanelIds.has(n)||t.apiToolPanelIds.has(n)||(t.panelCleanups.get(n)?.(),t.panelCleanups.delete(n),t.toolPanels.delete(n));for(const n of[...t.headerContents.keys()])t.apiHeaderContentIds.has(n)||(t.headerContentCleanups.get(n)?.(),t.headerContentCleanups.delete(n),t.headerContents.delete(n));const{toolPanels:i,headerContents:a}=e._pluginShellContributions();for(const r of i)t.apiToolPanelIds.has(r.id)||(t.lightDomToolPanelIds.has(r.id)&&(l(n,`Tool panel "${r.id}" is provided by a plugin; ignoring the matching light-DOM <tbw-grid-tool-panel>.`,o),t.panelCleanups.get(r.id)?.(),t.panelCleanups.delete(r.id),t.lightDomToolPanelIds.delete(r.id),t.adapterBoundToolPanelIds.delete(r.id)),t.toolPanels.set(r.id,r));for(const n of a)t.apiHeaderContentIds.has(n.id)||(t.headerContents.has(n.id)&&(l(r,`Header content "${n.id}" is provided by a plugin; ignoring the matching light-DOM definition.`,o),t.headerContentCleanups.get(n.id)?.(),t.headerContentCleanups.delete(n.id)),t.headerContents.set(n.id,n))}processConfig(e){if(!this.hasState)return;const t=this.shellState,o=this.grid;o&&(this.#s(o),this.#d(o));const n=this.resolvedConfig;if(e.shell={...n,...e.shell},e.shell.header={...n.header,...e.shell.header},t.lightDomTitle&&!e.shell.header.title&&(e.shell.header.title=t.lightDomTitle),t.lightDomHeaderContent?.length>0&&(e.shell.header.lightDomContent=t.lightDomHeaderContent),t.hasToolButtonsContainer&&(e.shell.header.hasToolButtonsContainer=!0),t.toolPanels.size>0){const o=Array.from(t.toolPanels.values());o.sort((e,t)=>(e.order??100)-(t.order??100)),e.shell.toolPanels=o}if(t.headerContents.size>0){const o=Array.from(t.headerContents.values());o.sort((e,t)=>(e.order??100)-(t.order??100)),e.shell.headerContents=o}const r=Array.from(t.toolbarContents.values()),l=this.grid?._sourceConfig?.shell?.header?.toolbarContents??[],i=new Set(l.map(e=>e.id)),a=[...l];for(const s of r)i.has(s.id)||a.push(s);a.sort((e,t)=>(e.order??0)-(t.order??0)),e.shell.header.toolbarContents=a}afterStructuralRender(){const e=this.grid;if(!e||!this.hasState)return;const t=this.shellState;G(e._renderRoot,e.effectiveConfig?.shell,{isPanelOpen:t.isPanelOpen,expandedSections:t.expandedSections},e.effectiveConfig?.icons)&&(this.#c(e),this.shellController.setInitialized(!0),this.#p(e))}afterRender(){const e=this.grid;if(!e||!this.hasState)return;const t=this.shellState;this.#h(e),t.isPanelOpen&&R(e._renderRoot,t),t.isPanelOpen?(this.shellController.reanchorOpenDropdown(),this.#u(e)):this.#b()}#h(e){const t=e._renderRoot.querySelector(".tbw-shell-header");if(!t)return;const o=e.effectiveConfig?.shell?.header?.title??this.shellState.lightDomTitle;let n=t.querySelector(".tbw-shell-title");o?(n||(n=document.createElement("h2"),n.className="tbw-shell-title",n.setAttribute("part","shell-title"),t.insertBefore(n,t.firstChild)),n.textContent=o):n&&n.remove()}#u(e){"dropdown"===e.effectiveConfig?.shell?.toolPanel?.mode?"undefined"!=typeof MutationObserver&&(this.#i||(this.#i=new MutationObserver(()=>{this.grid&&this.hasState&&this.shellState.isPanelOpen?this.shellController.reanchorOpenDropdown():this.#b()})),this.#a||(this.#i.observe(e._renderRoot,{childList:!0,subtree:!0}),this.#a=!0)):this.#b()}#b(){this.#i&&this.#a&&(this.#i.disconnect(),this.#a=!1)}#p(e){const t=this.shellState,o=e._renderRoot,n=e.effectiveConfig?.shell;A(o,t),function(e,t,o){const n=t?.header?.toolbarContents??[],r=[...o.toolbarContents.values()],l=new Set(n.map(e=>e.id)),i=[...n];for(const a of r)l.has(a.id)||i.push(a);for(const a of i){if(o.toolbarContentCleanups.has(a.id))continue;if(!a.render)continue;const t=e.querySelector(`[data-toolbar-content="${a.id}"]`);if(!t)continue;const n=a.render(t);n&&o.toolbarContentCleanups.set(a.id,n)}}(o,n,t);const r=n?.toolPanel,l=r?.defaultOpen;l&&t.toolPanels.has(l)&&t.expandedSections.add(l);const i=!0===r?.locked||"open"===r?.initialState||void 0===r?.initialState&&void 0!==l&&t.toolPanels.has(l);!t.isPanelOpen&&t.toolPanels.size>0&&i&&this.openToolPanel(),t.isPanelOpen&&(q(o,t),R(o,t,(e.effectiveConfig,e.effectiveConfig)),$(o,t),this.shellController.reanchorOpenDropdown())}#c(e){const t=e._renderRoot,o=e.effectiveConfig?.shell,n=this.shellState;!function(e,t,o,n){const r=e.querySelector(".tbw-shell-toolbar");r&&r.addEventListener("click",e=>{e.target.closest("[data-panel-toggle]")&&n.onPanelToggle()});const l=e.querySelector(".tbw-tool-panel");l&&n.onPanelClose&&l.addEventListener("click",e=>{e.target.closest("[data-panel-close]")&&n.onPanelClose()});const i=e.querySelector(".tbw-accordion");i&&i.addEventListener("click",e=>{const t=e.target.closest(".tbw-accordion-header");if(t){const e=t.closest("[data-section]")?.getAttribute("data-section");e&&n.onSectionToggle(e)}})}(t,0,0,{onPanelToggle:()=>this.toggleToolPanel(),onSectionToggle:e=>this.toggleToolPanelSection(e),onPanelClose:()=>this.closeToolPanel()}),this.#o?.(),this.#o=L(t,o,t=>{e._hostElement.style.setProperty("--tbw-tool-panel-width",`${t}px`)}),this.#n?.(),this.#n=function(e,t,o,n){const r=t?.toolPanel?.mode;if("dropdown"!==r&&!t?.toolPanel?.closeOnClickOutside)return()=>{};if("push"===r)return()=>{};const l=t=>{if(!o.isPanelOpen)return;const r=o.dropdownAnchorEl;for(const o of t.composedPath()){if(null!=r&&o===r)return;if(o instanceof Element&&(o.classList?.contains("tbw-tool-panel")||o.matches?.("[data-panel-toggle]"))&&H(o,e))return}n()};return document.addEventListener("mousedown",l),()=>document.removeEventListener("mousedown",l)}(e._hostElement,o,n,()=>this.closeToolPanel()),this.#r?.(),this.#r=function(e,t,o){if("push"===e?.toolPanel?.mode)return()=>{};const n=e=>{"Escape"!==e.key||e.defaultPrevented||t.isPanelOpen&&o()};return document.addEventListener("keydown",n),()=>document.removeEventListener("keydown",n)}(o,n,()=>this.closeToolPanel())}#g(){this.#o?.(),this.#o=void 0,this.#n?.(),this.#n=void 0,this.#r?.(),this.#r=void 0}detach(){super.detach()}disposeShellState(){this.#g(),this.#b(),this.#i=void 0;const e=this.grid;e&&this.#l&&(e._unregisterLightDomHandler("tbw-grid-header"),e._unregisterLightDomHandler("tbw-grid-tool-buttons"),e._unregisterLightDomHandler("tbw-grid-tool-panel"),this.#l=void 0),this.#e&&(!function(e){for(const t of e.headerContentCleanups.values())t();e.headerContentCleanups.clear();for(const t of e.panelCleanups.values())t();e.panelCleanups.clear();for(const t of e.toolbarContentCleanups.values())t();e.toolbarContentCleanups.clear();for(const t of e.toolbarContents.values())t.onDestroy?.();if(e.isPanelOpen)for(const t of e.expandedSections)e.toolPanels.get(t)?.onClose?.();e.isPanelOpen=!1,e.expandedSections.clear(),e.toolPanels.clear(),e.headerContents.clear(),e.toolbarContents.clear(),e.lightDomHeaderContent=[],e.lightDomToolPanelIds.clear(),e.adapterBoundToolPanelIds.clear(),e.lightDomToolbarContentIds.clear(),e.lightDomContentMoved=!1}(this.#e),this.#t?.setInitialized(!1))}};e.ShellPlugin=U});
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@toolbox-web/grid")):"function"==typeof define&&define.amd?define(["exports","@toolbox-web/grid"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).TbwGridPlugin_shell={},e.TbwGrid)}(this,function(e,t){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});var o="TBW072",n="TBW073",r="TBW074";function l(e,t,o,n){console.warn(function(e,t,o,n){return`${function(e,t){return`[tbw-grid${e?`#${e}`:""}${t?`:${t}`:""}]`}(o,n)} ${e}: ${t}\n\n → More info: ${function(e){return`https://toolboxjs.com/grid/errors#${e.toLowerCase()}`}(e)}`}(e,t,o,n))}var i="__otorp__|__retteGenifed__|__retteSenifed__|rotcurtsnoc|wodniw|sihTlabolg|labolg|ssecorp|noitcnuF|tropmi|lave|tcelfeR|yxorP|rorrE|stnemugra|tnemucod|noitacol|eikooc|egarotSlacol|egarotSnoisses|BDdexedni|hctef|tseuqeRpttHLMX|tekcoSbeW|rekroW|rekroWderahS|rekroWecivreS|renepo|tnerap|pot|semarf|fles".split("|").map(e=>e.split("").reverse().join("")),a=(new RegExp(`__(proto|defineGetter|defineSetter)|${i.slice(3).join("|")}|this\\b`),new Set("script|iframe|object|embed|form|input|button|textarea|select|link|meta|base|style|template|slot|portal|frame|frameset|applet|noscript|noembed|plaintext|xmp|listing|math".split("|"))),s=/^on\w+$/i,d=new Set("href|src|action|formaction|data|srcdoc|xlink:href|poster|srcset".split("|")),c=/^\s*(javascript|vbscript|data|blob):/i;function p(e,t){t&&"string"==typeof t?-1!==t.indexOf("<")||-1!==t.indexOf("&")?e.replaceChildren(function(e){const t=document.createElement("template");return e&&"string"==typeof e&&(t.innerHTML=e,h(t.content)),t.content}(t)):e.textContent=t:e.replaceChildren()}function h(e){const t=[],o=e.querySelectorAll("*");for(const n of o){const e=n.tagName.toLowerCase();if(a.has(e)){t.push(n);continue}if(("svg"===e||"http://www.w3.org/2000/svg"===n.namespaceURI)&&Array.from(n.attributes).some(e=>s.test(e.name)||"href"===e.name||"xlink:href"===e.name)){t.push(n);continue}const o=[];for(const t of n.attributes){const e=t.name.toLowerCase();s.test(e)?o.push(t.name):"is"!==e?(d.has(e)&&c.test(t.value)||"style"===e&&/expression\s*\(|javascript:|behavior\s*:/i.test(t.value))&&o.push(t.name):o.push(t.name)}o.forEach(e=>n.removeAttribute(e))}t.forEach(e=>e.remove())}function u(){return"function"==typeof HTMLElement.prototype?.showPopover}function b(e,t){const o=document.createElement("button");return o.type="button",o.className="tbw-size-popover-btn",o.setAttribute("aria-label",e),o.textContent=t,o}function g(e){const t=e.step??16;let o,n=null,r=null,l=null,i=!1,a=!1;const s=new AbortController;function d(){i&&n&&(i=!1,u()&&n.hidePopover(),n.hidden=!0,l?.removeAttribute("data-tbw-size-open"),l=null)}function c(){r&&(r.value=String(Math.round(e.getSize(o))))}function p(t){Number.isFinite(t)&&(e.setSize(o,t),c())}return document.addEventListener("pointerdown",e=>{i&&n&&!e.composedPath().includes(n)&&d()},{capture:!0,signal:s.signal}),document.addEventListener("keydown",e=>{"Escape"===e.key&&d()},{capture:!0,signal:s.signal}),{get element(){return n},open(h,g){if(a)return;o=h,l?.removeAttribute("data-tbw-size-open"),l=g,g.setAttribute("data-tbw-size-open",""),n||(n=function(){const n=document.createElement("div");n.id=e.id,n.className="tbw-size-popover",n.setAttribute("popover","manual"),n.setAttribute("role","group"),n.hidden=!0;const l=b("Narrower","−"),i=b("Wider","+"),a=b("Reset size","Reset"),h=document.createElement("input");return h.type="number",h.className="tbw-size-popover-input",h.min="0",h.step="any",h.setAttribute("aria-label","Size in pixels"),l.addEventListener("click",()=>p(e.getSize(o)-t),{signal:s.signal}),i.addEventListener("click",()=>p(e.getSize(o)+t),{signal:s.signal}),a.addEventListener("click",()=>{e.reset(o),c()},{signal:s.signal}),h.addEventListener("change",()=>p(h.valueAsNumber),{signal:s.signal}),n.addEventListener("focusout",e=>{const t=e.relatedTarget;t instanceof Node&&!n.contains(t)&&d()},{signal:s.signal}),n.append(l,h,i,a),r=h,n}());const f=e.getHost(h)??document.body;n.parentNode!==f&&f.appendChild(n),n.setAttribute("aria-label",e.getLabel(h)),c(),n.hidden=!1,!i&&u()&&n.showPopover(),i=!0,function(e){if(!n)return;const t=e.getBoundingClientRect(),o=n.getBoundingClientRect(),r=(e,t)=>Math.max(4,Math.min(e,t-4)),l=r(t.left+t.width/2-o.width/2,window.innerWidth-o.width),i=t.bottom+6,a=t.top-6-o.height,s=t.height>3*o.height;let d;d=!s&&i+o.height<=window.innerHeight?i:!s&&a>=4?a:r(t.top+t.height/2-o.height/2,window.innerHeight-o.height),n.style.left=`${Math.round(l)}px`,n.style.top=`${Math.round(d)}px`}(g),r?.focus()},close:d,dispose(){a=!0,d(),s.abort(),n?.remove(),n=null,r=null}}}var f="tbw-grid-root";function w(e,t){if(t)for(const o in t){const n=t[o];null!=n&&e.setAttribute(o,n)}}function v(e,t,o){const n=document.createElement(e);if(w(n,t),o)for(const r of o)null!=r&&("string"==typeof r?n.appendChild(document.createTextNode(r)):n.appendChild(r));return n}function C(e,t){const o=document.createElement("div");return e&&(o.className=e),w(o,t),o}function m(e,t,o){const n=document.createElement("button");return n.type="button",e&&(n.className=e),w(n,t),o&&("string"==typeof o?n.textContent=o:n.appendChild(o)),n}var y=document.createElement("template");function P(){return y.content.cloneNode(!0)}function x(e){const t=document.createDocumentFragment(),o=C(e.hasShell?`${f} has-shell`:f);if(e.hasShell&&e.shellBody)e.shellHeader&&o.appendChild(e.shellHeader),o.appendChild(e.shellBody);else{const e=C("tbw-grid-content");e.appendChild(P()),o.appendChild(e)}return t.appendChild(o),t}function S(e){const t=C("tbw-shell-header",{part:"shell-header",role:"presentation"});if(e.title){const o=C("tbw-shell-title");o.textContent=e.title,t.appendChild(o)}const o=C("tbw-shell-content",{part:"shell-content",role:"presentation","data-light-dom-header-content":""});t.appendChild(o);const n=C("tbw-shell-toolbar",{part:"shell-toolbar",role:"presentation"});for(const i of e.configButtons)i.hasRender&&n.appendChild(C("tbw-toolbar-content-slot",{"data-toolbar-content":i.id}));for(const i of e.apiButtons)i.hasRender&&n.appendChild(C("tbw-toolbar-content-slot",{"data-toolbar-content":i.id}));const r=e.configButtons.some(e=>e.hasRender)||e.apiButtons.some(e=>e.hasRender),l=e.hasPanels&&!1!==e.showToggle;if(r&&l&&n.appendChild(C("tbw-toolbar-separator")),l){const t=m(e.isPanelOpen?"tbw-toolbar-btn active":"tbw-toolbar-btn",{"data-panel-toggle":"",title:"Settings","aria-label":"Toggle settings panel","aria-pressed":String(e.isPanelOpen),"aria-controls":"tbw-tool-panel"});t.dataset.icon="tool-panel",void 0!==e.toolPanelIcon&&p(t,e.toolPanelIcon),n.appendChild(t)}return t.appendChild(n),t}function T(e){const t=m(e?"tbw-tool-panel-close tbw-tool-panel-close--inline":"tbw-tool-panel-close",{part:"tool-panel-close","data-panel-close":"",title:"Close panel","aria-label":"Close panel","aria-controls":"tbw-tool-panel"});return t.textContent="✕",t}function O(){const e=C("tbw-tool-panel-header",{part:"tool-panel-header"});return e.appendChild(T(!1)),e}function z(e,t,o,n){const r=!!e.title||!o,l=n&&r,i=C(`tbw-accordion-section${e.isExpanded?" expanded":""}${o?" single":""}${l?" has-inline-close":""}`,{"data-section":e.id});if(r){const n=function(e,t,o){const n=m("tbw-accordion-header",{"aria-expanded":String(e.isExpanded),"aria-controls":`tbw-section-${e.id}`});if(o&&n.setAttribute("aria-disabled","true"),e.icon){const t=v("span",{class:"tbw-accordion-icon"});p(t,e.icon),n.appendChild(t)}const r=v("span",{class:"tbw-accordion-title"});if(r.textContent=e.title??"",n.appendChild(r),!o){const e=v("span",{class:"tbw-accordion-chevron","data-icon":"expand"});void 0!==t.expandIcon&&p(e,t.expandIcon),n.appendChild(e)}return n}(e,t,o);if(l){const e=C("tbw-accordion-header-row");e.appendChild(n),e.appendChild(T(!0)),i.appendChild(e)}else i.appendChild(n)}else n&&i.appendChild(O());return i.appendChild(C("tbw-accordion-content",{id:`tbw-section-${e.id}`,role:"presentation"})),i}function D(e){const t=e.mode??"overlay",o=C("tbw-shell-body",{"data-mode":t}),n=C("tbw-grid-content");n.appendChild(P());const r=e.panels.length>0?function(e,t){const o=1===e.panels.length,n=v("aside",{class:e.isPanelOpen?"tbw-tool-panel open":"tbw-tool-panel",part:"tool-panel","data-position":e.position,role:"presentation",id:"tbw-tool-panel",..."dropdown"===t?{popover:"manual"}:{}});n.appendChild(C("tbw-tool-panel-resize",{"data-resize-handle":"","data-handle-position":"left"===e.position?"right":"left",role:"button",tabindex:"-1","aria-label":"Tool panel width — drag, or activate to set a width"}));const r=!0===e.showCloseButton&&o;e.showCloseButton&&!o&&n.appendChild(O());const l=C("tbw-tool-panel-content",{role:"presentation"}),i=C("tbw-accordion");for(const a of e.panels)i.appendChild(z(a,e,o,r));return l.appendChild(i),n.appendChild(l),n}(e,t):null;return"left"===e.position&&r?(o.appendChild(r),o.appendChild(n)):(o.appendChild(n),r&&o.appendChild(r)),o}y.innerHTML='\n <div class="tbw-scroll-area">\n <div class="rows-body-wrapper">\n <div class="rows-body" role="grid">\n <div class="header" role="rowgroup">\n <div class="header-row" role="row" part="header-row"></div>\n </div>\n <div class="rows-container" role="presentation">\n <div class="rows-viewport" role="presentation">\n <div class="rows"></div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <div class="faux-vscroll">\n <div class="faux-vscroll-spacer"></div>\n </div>\n <div class="tbw-sr-only" aria-live="polite" aria-atomic="true"></div>\n';function E(e){return e?"string"==typeof e?function(e){if(!e||"string"!=typeof e)return"";if(-1===e.indexOf("<"))return e;const t=document.createElement("template");return t.innerHTML=e,h(t.content),t.innerHTML}(e):e.outerHTML:""}function _(e){return!!e?.header?.title||(!!e?.header?.toolbarContents?.length||(!!e?.toolPanels?.length||(!!e?.headerContents?.length||(!!e?.header?.lightDomContent?.length||!!e?.header?.hasToolButtonsContainer))))}function k(e){return!1!==e?.header?.visible}function H(e,t){if(t.contains(e))return!0;const o=e.getRootNode();return o instanceof ShadowRoot&&o.host===t}function L(e,o,n){const r=e.querySelector(".tbw-tool-panel"),l=e.querySelector("[data-resize-handle]"),i=e.querySelector(".tbw-shell-body");if(!r||!l||!i)return()=>{};const a=o?.toolPanel?.position??"right";let s=0,d=0,c=0,p=!1,h=!1,u=null,b=null;const f=()=>i.getBoundingClientRect().width-20,w=e=>{if(!p)return;e.preventDefault(),h=!0;const t="left"===a?e.clientX-s:s-e.clientX,o=Math.min(c,Math.max(200,d+t));r.style.width=`${o}px`},v=e=>{if(p&&(p=!1,u=null,l.classList.remove("resizing"),r.style.transition="",document.body.style.cursor="",document.body.style.userSelect="",e)){const e=r.getBoundingClientRect().width;n(e)}},C=e=>{p||0!==e.button&&"mouse"===e.pointerType||(e.preventDefault(),p=!0,h=!1,s=e.clientX,d=r.getBoundingClientRect().width,c=f(),l.classList.add("resizing"),r.style.transition="none",document.body.style.cursor="col-resize",document.body.style.userSelect="none",u=(0,t.startPointerDrag)(e,l,{onMove:w,onEnd:()=>{const e=!h;v(!e),e&&(b??=g({id:"tbw-tool-panel-width-popover",step:32,getSize:e=>e.getBoundingClientRect().width,setSize:(e,t)=>{const o=Math.min(f(),Math.max(200,t));e.style.width=`${o}px`,n(o)},reset:e=>{e.style.width="",n(e.getBoundingClientRect().width)},getLabel:()=>"Tool panel width",getHost:e=>e.closest("tbw-grid, [data-tbw-grid]")}),b.open(r,l))},onCancel:()=>{r.style.width=`${d}px`,v(!1)}}))};return l.addEventListener("pointerdown",C),()=>{l.removeEventListener("pointerdown",C),u?.(),u=null,b?.dispose(),b=null}}function A(e,t){const o=t.lightDomHeaderContent.length>0&&!t.lightDomContentMoved,n=t.headerContents.size>0;if(!o&&!n)return;const r=e.querySelector(".tbw-shell-content");if(!r)return;if(o){for(const e of t.lightDomHeaderContent)e.style.display="",r.appendChild(e);t.lightDomContentMoved=!0}const l=[...t.headerContents.values()].sort((e,t)=>(e.order??100)-(t.order??100));for(const i of l){const e=t.headerContentCleanups.get(i.id);e&&(e(),t.headerContentCleanups.delete(i.id));let o=r.querySelector(`[data-header-content="${i.id}"]`);o||(o=document.createElement("div"),o.setAttribute("data-header-content",i.id),r.appendChild(o));const n=i.render(o);n&&t.headerContentCleanups.set(i.id,n)}}function R(e,t,o){if(t.isPanelOpen)for(const[n,r]of t.toolPanels){const o=t.expandedSections.has(n),l=e.querySelector(`[data-section="${n}"]`),i=l?.querySelector(".tbw-accordion-content");if(!l||!i)continue;l.classList.toggle("expanded",o);const a=l.querySelector(".tbw-accordion-header");if(a&&a.setAttribute("aria-expanded",String(o)),o){if(0===i.children.length){const e=r.render(i);e&&t.panelCleanups.set(n,e)}}else{const e=t.panelCleanups.get(n);e&&(e(),t.panelCleanups.delete(n)),i.innerHTML=""}}}function $(e,t){const o=e.querySelector("[data-panel-toggle]");o&&(o.classList.toggle("active",t.isPanelOpen),o.setAttribute("aria-pressed",String(t.isPanelOpen)))}function q(e,t){const o=e.querySelector(".tbw-tool-panel");o&&(o.classList.toggle("open",t.isPanelOpen),t.isPanelOpen||(o.style.width=""))}var B="--tbw-tool-panel-anchor",I=0;function M(){return"undefined"!=typeof CSS&&"function"==typeof CSS.supports&&CSS.supports("anchor-name",B)}function N(e,t,o,n){const r=e.querySelector(".tbw-tool-panel");if(r){if(t.dropdownAnchorEl=o,r.dataset.anchor=n?"corner":"below",r.hasAttribute("popover")&&"function"==typeof r.showPopover)try{r.showPopover()}catch{}if(M()){const e=`${B}-${++I}`;t.dropdownAnchorName=e,o.style.setProperty("anchor-name",e),r.style.setProperty("position-anchor",e),r.style.removeProperty("top"),r.style.removeProperty("left"),r.style.removeProperty("right")}else!function(e,t,o){const n=t.getBoundingClientRect(),r=e.getAttribute("data-position")??"right";if(e.style.position="fixed",e.style.top=`${Math.round((o?n.top:n.bottom)+4)}px`,"left"===r)e.style.left=`${Math.round(n.left)}px`,e.style.right="auto";else{const t="undefined"!=typeof window?window.innerWidth:0;e.style.left="auto",e.style.right=`${Math.round(t-n.right)}px`}}(r,o,n)}}function W(e){for(const t of e.toolbarContentCleanups.values())t();e.toolbarContentCleanups.clear();for(const t of e.panelCleanups.values())t();e.panelCleanups.clear();for(const t of e.headerContentCleanups.values())t();e.headerContentCleanups.clear(),e.lightDomContentMoved=!1}function j(e,t,o){const n=void 0!==o?.toolPanel?E(o.toolPanel):void 0,r=void 0!==o?.expand?E(o.expand):void 0,l=void 0!==o?.collapse?E(o.collapse):void 0,i=[...e.header?.toolbarContents??[]].sort((e,t)=>(e.order??0)-(t.order??0)),a=[...e.toolPanels??[]].sort((e,t)=>(e.order??100)-(t.order??100));return{headerOptions:{title:e.header?.title??void 0,hasPanels:a.length>0,isPanelOpen:t.isPanelOpen,toolPanelIcon:n,showToggle:!1!==e.header?.toolPanelToggle&&!0!==e.toolPanel?.locked,configButtons:i.map(e=>({id:e.id,hasElement:!1,hasRender:!!e.render})),apiButtons:[]},bodyOptions:{position:e.toolPanel?.position??"right",mode:e.toolPanel?.mode??"overlay",isPanelOpen:t.isPanelOpen,expandIcon:r,collapseIcon:l,showCloseButton:!1===e.header?.visible&&!0!==e.toolPanel?.locked&&"dropdown"!==(e.toolPanel?.mode??"overlay"),panels:a.map(e=>({id:e.id,title:e.title,icon:E(e.icon),isExpanded:t.expandedSections.has(e.id)}))}}}function F(e,t,o,n){const r=e.querySelector(`.${f}`),l=r?.querySelector(".tbw-grid-content");if(!r||!l)return function(e,t,o,n){const r=_(t),l=[];for(let i=e.firstChild;i;i=i.nextSibling)1===i.nodeType&&i.classList.contains(f)||l.push(i);e.replaceChildren();for(const i of l)e.appendChild(i);if(r){const{headerOptions:r,bodyOptions:l}=j(t,o,n),i=x({hasShell:!0,shellHeader:k(t)?S(r):void 0,shellBody:D(l)});e.appendChild(i)}else{const t=x({hasShell:!1});e.appendChild(t)}return r}(e,t,o,n);l.remove();const i=_(t);if(r.replaceChildren(),i){r.className=`${f} has-shell`;const{headerOptions:e,bodyOptions:i}=j(t,o,n),a=k(t)?S(e):void 0,s=D(i),d=s.querySelector(".tbw-grid-content");d&&d.replaceWith(l),a&&r.appendChild(a),r.appendChild(s)}else r.className=f,r.appendChild(l);return i}function G(e,t){let i=!1;const a={get isInitialized(){return i},setInitialized(e){i=e},get isPanelOpen(){return e.isPanelOpen},get expandedSections(){return[...e.expandedSections]},openToolPanel(n,r){if(0===e.toolPanels.size)return void l("TBW071","No tool panels registered",t.id);let i;if(void 0!==n&&(e.toolPanels.has(n)?i=n:l(o,`Tool panel "${n}" not found`,t.id)),e.isPanelOpen&&i&&e.expandedSections.has(i))return;if(e.isPanelOpen&&i&&!e.expandedSections.has(i))return void a.toggleToolPanelSection(i);if(e.isPanelOpen)return;if(e.isPanelOpen=!0,0===e.expandedSections.size&&e.toolPanels.size>0)if(i)e.expandedSections.add(i);else{const o=t.effectiveConfig?.shell?.toolPanel?.defaultOpen;if(o&&e.toolPanels.has(o))e.expandedSections.add(o);else{const t=[...e.toolPanels.values()].sort((e,t)=>(e.order??100)-(t.order??100))[0];t&&e.expandedSections.add(t.id)}}else if(i&&!e.expandedSections.has(i)){for(const t of[...e.expandedSections])e.expandedSections.delete(t);e.expandedSections.add(i)}const s=t._renderRoot;if($(s,e),q(s,e),R(s,e,t._accordionIcons),"dropdown"===t.effectiveConfig?.shell?.toolPanel?.mode){const{el:o,corner:n}=function(e){if(e)return{el:e,corner:!1};const o=t._renderRoot.querySelector("[data-panel-toggle]");return o?{el:o,corner:!1}:{el:t._hostElement,corner:!0}}(r?.anchor);N(s,e,o,n)}t._emit("tool-panel-open",{sections:a.expandedSections})},closeToolPanel(){if(!e.isPanelOpen)return;if(t.effectiveConfig?.shell?.toolPanel?.locked)return;for(const t of e.panelCleanups.values())t();e.panelCleanups.clear();for(const t of e.toolPanels.values())t.onClose?.();e.isPanelOpen=!1;const o=t._renderRoot;$(o,e),q(o,e),"dropdown"===t.effectiveConfig?.shell?.toolPanel?.mode&&function(e,t){const o=e.querySelector(".tbw-tool-panel");if(o){if(o.hasAttribute("popover")&&"function"==typeof o.hidePopover)try{o.hidePopover()}catch{}o.style.removeProperty("position-anchor"),o.style.removeProperty("position"),o.style.removeProperty("top"),o.style.removeProperty("left"),o.style.removeProperty("right"),delete o.dataset.anchor}t.dropdownAnchorEl&&(t.dropdownAnchorEl.style.removeProperty("anchor-name"),t.dropdownAnchorEl=null),t.dropdownAnchorName=null}(o,e),t._emit("tool-panel-close",{})},toggleToolPanel(t){e.isPanelOpen?a.closeToolPanel():a.openToolPanel(void 0,t)},reanchorOpenDropdown(){if(!e.isPanelOpen)return;if("dropdown"!==t.effectiveConfig?.shell?.toolPanel?.mode)return;const o=e.dropdownAnchorEl;if(o&&o.isConnected&&e.dropdownAnchorName&&o.style.getPropertyValue("anchor-name")===e.dropdownAnchorName)return;if(!e.dropdownAnchorName&&o&&o.isConnected&&o!==t._hostElement&&"below"===t._renderRoot.querySelector(".tbw-tool-panel")?.dataset.anchor)return;const n=t._renderRoot.querySelector("[data-panel-toggle]");if(n&&n!==t._hostElement){if(e.dropdownAnchorName&&M()&&function(e,t,o){const n=t.dropdownAnchorName;if(!n)return!1;const r=e.querySelector(".tbw-tool-panel");if(!r)return!1;const l=t.dropdownAnchorEl;if(l&&l!==o&&l.style.removeProperty("anchor-name"),o.style.setProperty("anchor-name",n),r.style.setProperty("position-anchor",n),r.style.removeProperty("top"),r.style.removeProperty("left"),r.style.removeProperty("right"),r.dataset.anchor="below",t.dropdownAnchorEl=o,r.hasAttribute("popover")&&"function"==typeof r.showPopover)try{r.showPopover()}catch{}return!0}(t._renderRoot,e,n))return;N(t._renderRoot,e,n,!1)}else o!==t._hostElement||N(t._renderRoot,e,t._hostElement,!0)},toggleToolPanelSection(n){const r=e.toolPanels.get(n);if(!r)return void l(o,`Tool panel section "${n}" not found`,t.id);if(1===e.toolPanels.size)return;const i=t._renderRoot,a=e.expandedSections.has(n);if(a){const t=e.panelCleanups.get(n);t&&(t(),e.panelCleanups.delete(n)),r.onClose?.(),e.expandedSections.delete(n),X(i,n,!1)}else{for(const[t,o]of e.toolPanels)if(t!==n&&e.expandedSections.has(t)){const n=e.panelCleanups.get(t);n&&(n(),e.panelCleanups.delete(t)),o.onClose?.(),e.expandedSections.delete(t),X(i,t,!1);const r=i.querySelector(`[data-section="${t}"] .tbw-accordion-content`);r&&(r.innerHTML="")}e.expandedSections.add(n),X(i,n,!0),function(e,t,o){const n=t.toolPanels.get(o);if(!n?.render)return;const r=e.querySelector(`[data-section="${o}"] .tbw-accordion-content`);if(!r)return;const l=n.render(r);l&&t.panelCleanups.set(o,l)}(i,e,n)}t._emit("tool-panel-section-toggle",{id:n,expanded:!a})},getToolPanels:()=>[...e.toolPanels.values()],registerToolPanel(o){e.toolPanels.has(o.id)?l(n,`Tool panel "${o.id}" already registered`,t.id):(e.toolPanels.set(o.id,o),(i||t._hostElement.isConnected)&&t.refreshShellHeader?.())},unregisterToolPanel(o){if(e.expandedSections.has(o)){const t=e.panelCleanups.get(o);t&&(t(),e.panelCleanups.delete(o)),e.expandedSections.delete(o)}e.toolPanels.delete(o),(i||t._hostElement.isConnected)&&t.refreshShellHeader?.()},getHeaderContents:()=>[...e.headerContents.values()],registerHeaderContent(o){e.headerContents.has(o.id)?l(r,`Header content "${o.id}" already registered`,t.id):(e.headerContents.set(o.id,o),i?A(t._renderRoot,e):t._hostElement.isConnected&&t.refreshShellHeader?.())},unregisterHeaderContent(o){const n=e.headerContentCleanups.get(o);n&&(n(),e.headerContentCleanups.delete(o)),e.headerContents.get(o)?.onDestroy?.(),e.headerContents.delete(o),t._renderRoot.querySelector(`[data-header-content="${o}"]`)?.remove()},getToolbarContents:()=>[...e.toolbarContents.values()].sort((e,t)=>(e.order??0)-(t.order??0)),registerToolbarContent(o){e.toolbarContents.has(o.id)?l("TBW075",`Toolbar content "${o.id}" already registered`,t.id):(e.toolbarContents.set(o.id,o),(i||t._hostElement.isConnected)&&t.refreshShellHeader?.())},unregisterToolbarContent(o){const n=e.toolbarContentCleanups.get(o);n&&(n(),e.toolbarContentCleanups.delete(o));const r=e.toolbarContents.get(o);r?.onDestroy&&r.onDestroy(),e.toolbarContents.delete(o),i&&t.refreshShellHeader?.()}};return a}function X(e,t,o){const n=e.querySelector(`[data-section="${t}"]`);n&&n.classList.toggle("expanded",o)}var V=Symbol.for("@toolbox-web/grid:shell-configured-panel-width"),U=class extends t.BaseGridPlugin{name="shell";styles='@layer tbw-base{tbw-grid .tbw-shell-header{min-height:var(--tbw-shell-header-height);background:var(--tbw-shell-header-bg);border-bottom:1px solid var(--tbw-shell-header-border);flex-shrink:0;align-items:center;gap:8px;padding:0 8px;display:flex}tbw-grid .tbw-shell-title{font-size:var(--tbw-shell-title-font-size);font-weight:var(--tbw-shell-title-font-weight);white-space:nowrap;text-overflow:ellipsis;overflow:hidden}tbw-grid .tbw-shell-content{flex:1;align-items:center;gap:12px;min-width:0;display:flex;overflow:hidden}tbw-grid .tbw-shell-toolbar{align-items:center;gap:var(--tbw-toolbar-button-gap);flex-shrink:0;display:flex}tbw-grid .tbw-toolbar-btn{width:var(--tbw-toolbar-button-size);height:var(--tbw-toolbar-button-size);border-radius:var(--tbw-border-radius);color:var(--tbw-color-fg);cursor:pointer;transition:background var(--tbw-transition-duration) var(--tbw-transition-ease), border-color var(--tbw-transition-duration) var(--tbw-transition-ease);background:0 0;border:1px solid #0000;justify-content:center;align-items:center;padding:0;font-size:16px;display:inline-flex}tbw-grid .tbw-toolbar-btn:hover{background:var(--tbw-color-row-hover)}tbw-grid .tbw-toolbar-btn:focus-visible{outline:var(--tbw-focus-outline);outline-offset:var(--tbw-focus-outline-offset)}tbw-grid .tbw-toolbar-btn.active{background:var(--tbw-focus-background);border-color:var(--tbw-color-accent)}tbw-grid .tbw-toolbar-btn:disabled{opacity:.5;cursor:not-allowed}tbw-grid .tbw-toolbar-separator{background:var(--tbw-color-border);width:1px;height:20px;margin:0 4px}tbw-grid .tbw-shell-body{flex:1;min-height:0;display:flex;position:relative;overflow:visible}tbw-grid .tbw-tool-panel{overflow-clip-margin:var(--tbw-tool-panel-resize-overhang,12px);background:var(--tbw-tool-panel-bg);border-left:1px solid var(--tbw-tool-panel-border);width:0;transition:width var(--tbw-tool-panel-transition);z-index:var(--tbw-z-layer-toolpanel,31);box-shadow:-2px 0 8px var(--tbw-color-shadow);flex-direction:column;display:flex;position:absolute;top:0;bottom:0;right:0;overflow:clip}tbw-grid .tbw-tool-panel[data-position=left]{border-left:none;border-right:1px solid var(--tbw-tool-panel-border);box-shadow:2px 0 8px var(--tbw-color-shadow);left:0;right:auto}tbw-grid .tbw-tool-panel.open{width:min(var(--tbw-tool-panel-width), 100% - 20px);max-width:calc(100% - 20px)}tbw-grid .tbw-shell-body[data-mode=push] .tbw-tool-panel{box-shadow:none;z-index:auto;border-left:none;border-right:none;flex-shrink:0;position:relative;inset:auto}tbw-grid .tbw-shell-body[data-mode=push] .tbw-tool-panel.open{border-left:1px solid var(--tbw-tool-panel-border)}tbw-grid .tbw-shell-body[data-mode=push] .tbw-tool-panel[data-position=left].open{border-left:none;border-right:1px solid var(--tbw-tool-panel-border)}tbw-grid .tbw-shell-body[data-mode=push] .tbw-tool-panel-resize{display:none}tbw-grid .tbw-tool-panel[popover]{width:var(--tbw-tool-panel-width);border:1px solid var(--tbw-tool-panel-border);border-radius:var(--tbw-border-radius,6px);max-width:calc(100vw - 16px);height:auto;max-height:min(70vh,480px);box-shadow:0 8px 24px var(--tbw-color-shadow);margin:4px 0 0;padding:0;transition:none;display:none;position:fixed;inset:auto;overflow:hidden auto}:is(tbw-grid .tbw-tool-panel[popover]:popover-open,tbw-grid .tbw-tool-panel[popover].open){width:var(--tbw-tool-panel-width);display:flex}tbw-grid .tbw-tool-panel[popover] .tbw-tool-panel-resize{display:none}@supports (anchor-name:--x){tbw-grid .tbw-tool-panel[popover]{top:anchor(bottom);right:anchor(right);position-try-fallbacks:flip-block, flip-inline, flip-block flip-inline;left:auto}tbw-grid .tbw-tool-panel[popover][data-anchor=corner]{top:anchor(top)}tbw-grid .tbw-tool-panel[popover][data-position=left]{left:anchor(left);right:auto}}tbw-grid .tbw-tool-panel-resize{width:calc(var(--tbw-tool-panel-resize-overhang,12px) * 2);cursor:col-resize;z-index:10;touch-action:none;-webkit-user-select:none;user-select:none;background:0 0;position:absolute;top:0;bottom:0}tbw-grid .tbw-tool-panel-resize:before{content:"";width:6px;transition:background var(--tbw-transition-duration) var(--tbw-transition-ease);background:0 0;position:absolute;top:0;bottom:0}tbw-grid .tbw-tool-panel-resize[data-handle-position=left]{left:calc(3px - var(--tbw-tool-panel-resize-overhang,12px))}tbw-grid .tbw-tool-panel-resize[data-handle-position=left]:before{left:calc(var(--tbw-tool-panel-resize-overhang,12px) - 3px)}tbw-grid .tbw-tool-panel-resize[data-handle-position=right]{right:calc(3px - var(--tbw-tool-panel-resize-overhang,12px))}tbw-grid .tbw-tool-panel-resize[data-handle-position=right]:before{right:calc(var(--tbw-tool-panel-resize-overhang,12px) - 3px)}tbw-grid .tbw-tool-panel-resize:hover:before,tbw-grid .tbw-tool-panel-resize.resizing:before,tbw-grid .tbw-tool-panel-resize[data-tbw-size-open]:before{background:var(--tbw-color-accent)}tbw-grid .tbw-tool-panel:not(.open) .tbw-tool-panel-resize{display:none}tbw-grid .tbw-tool-panel-header{min-height:var(--tbw-tool-panel-header-height);border-bottom:1px solid var(--tbw-tool-panel-border);flex-shrink:0;justify-content:flex-end;align-items:center;padding:0 12px;display:flex}tbw-grid .tbw-tool-panel-title{white-space:nowrap;text-overflow:ellipsis;font-size:13px;font-weight:600;overflow:hidden}tbw-grid .tbw-tool-panel-close{border-radius:var(--tbw-border-radius);width:24px;height:24px;color:var(--tbw-color-fg-muted);cursor:pointer;background:0 0;border:none;justify-content:center;align-items:center;padding:0;font-size:14px;display:inline-flex}tbw-grid .tbw-tool-panel-close:hover{background:var(--tbw-color-row-hover);color:var(--tbw-color-fg)}tbw-grid .tbw-accordion-header-row{align-items:stretch;display:flex}tbw-grid .tbw-accordion-header-row .tbw-accordion-header{flex:1;min-width:0}tbw-grid .tbw-tool-panel-close--inline{flex-shrink:0;align-self:center;margin-inline-end:8px}tbw-grid .tbw-tool-panel-content{flex:1;overflow:auto}tbw-grid .tbw-accordion{flex-direction:column;gap:0;display:flex}tbw-grid .tbw-accordion-section{border-bottom:1px solid var(--tbw-tool-panel-border)}tbw-grid .tbw-accordion-section:last-child{border-bottom:none}tbw-grid .tbw-accordion-section.single .tbw-accordion-header{cursor:default}tbw-grid .tbw-accordion-section.single .tbw-accordion-header:hover{background:0 0}tbw-grid .tbw-accordion-section.expanded .tbw-accordion-chevron{transform:rotate(90deg)}tbw-grid .tbw-accordion-section.expanded .tbw-accordion-content{display:block}tbw-grid .tbw-accordion-header{width:100%;color:var(--tbw-color-fg);text-align:start;cursor:pointer;-webkit-user-select:none;user-select:none;background:0 0;border:none;align-items:center;gap:8px;padding:10px 12px;font-size:13px;font-weight:600;display:flex}tbw-grid .tbw-accordion-header:hover{background:var(--tbw-color-row-hover)}tbw-grid .tbw-accordion-chevron{width:16px;height:16px;color:var(--tbw-color-fg-muted);flex-shrink:0;justify-content:center;align-items:center;font-size:10px;transition:transform .15s;display:inline-flex}tbw-grid .tbw-accordion-icon{flex-shrink:0;justify-content:center;align-items:center;width:16px;height:16px;font-size:14px;display:inline-flex}tbw-grid .tbw-accordion-title{text-overflow:ellipsis;white-space:nowrap;flex:1;overflow:hidden}tbw-grid .tbw-accordion-content{display:none}}';#e;#t;#o;#n;#r;#l;#i;#a=!1;get hasState(){return void 0!==this.#e}ensureState(e){if(this.#e)return;const t={toolPanels:new Map,headerContents:new Map,toolbarContents:new Map,hasToolButtonsContainer:!1,lightDomHeaderContent:[],lightDomTitle:null,lightDomToolPanelIds:new Set,adapterBoundToolPanelIds:new Set,lightDomToolbarContentIds:new Set,apiToolPanelIds:new Set,apiHeaderContentIds:new Set,isPanelOpen:!1,expandedSections:new Set,headerContentCleanups:new Map,panelCleanups:new Map,toolbarContentCleanups:new Map,lightDomContentMoved:!1,dropdownAnchorEl:null,dropdownAnchorName:null};this.#e=t,this.#t=G(t,e)}get shellState(){return this.#e}get shellController(){return this.#t}get isToolPanelOpen(){return!!this.hasState&&this.shellController.isPanelOpen}get expandedToolPanelSections(){return this.hasState?this.shellController.expandedSections:[]}openToolPanel(e,t){this.shellController?.openToolPanel(e,t)}closeToolPanel(){this.shellController?.closeToolPanel()}toggleToolPanel(e){this.shellController?.toggleToolPanel(e)}toggleToolPanelSection(e){this.shellController?.toggleToolPanelSection(e)}getToolPanels(){return this.hasState?this.shellController.getToolPanels():[]}registerToolPanel(e){this.hasState&&(this.shellState.apiToolPanelIds.add(e.id),this.shellController.registerToolPanel(e))}unregisterToolPanel(e){this.hasState&&(this.shellState.apiToolPanelIds.delete(e),this.shellController.unregisterToolPanel(e))}getHeaderContents(){return this.hasState?this.shellController.getHeaderContents():[]}registerHeaderContent(e){this.hasState&&(this.shellState.apiHeaderContentIds.add(e.id),this.shellController.registerHeaderContent(e))}unregisterHeaderContent(e){this.hasState&&(this.shellState.apiHeaderContentIds.delete(e),this.shellController.unregisterHeaderContent(e))}getToolbarContents(){return this.hasState?this.shellController.getToolbarContents():[]}registerToolbarContent(e){this.shellController?.registerToolbarContent(e)}unregisterToolbarContent(e){this.shellController?.unregisterToolbarContent(e)}attach(e){super.attach(e),this.ensureState(e);const t=()=>this.syncLightDom();this.#l=t,e._registerLightDomHandler("tbw-grid-header",t),e._registerLightDomHandler("tbw-grid-tool-buttons",t),e._registerLightDomHandler("tbw-grid-tool-panel",t)}#s(e){const t=e._hostElement;!function(e,t){const o=e.querySelector("tbw-grid-header");if(!o)return;if(!t.lightDomTitle){const e=o.getAttribute("title");e&&(t.lightDomTitle=e)}const n=o.querySelectorAll("tbw-grid-header-content");n.length>0&&0===t.lightDomHeaderContent.length&&(t.lightDomHeaderContent=Array.from(n)),o.style.display="none"}(t,this.shellState),function(e,t,o){const n=e.querySelector(":scope > tbw-grid-tool-buttons");if(!n)return;t.hasToolButtonsContainer=!0;const r="light-dom-toolbar-content";if(t.lightDomToolbarContentIds.has(r))return;const l={id:r,order:0,render:o?.(n)??(e=>{for(;n.firstChild;)e.appendChild(n.firstChild);return()=>{for(;e.firstChild;)n.appendChild(e.firstChild)}})};t.toolbarContents.set(r,l),t.lightDomToolbarContentIds.add(r),n.style.display="none"}(t,this.shellState),function(e,t,o){e.querySelectorAll(":scope > tbw-grid-tool-panel").forEach(e=>{const r=e,i=r.getAttribute("id"),a=r.getAttribute("title")??void 0;if(!i)return void l("TBW070",`Tool panel missing required id attribute: title="${a??""}"`);const s=r.getAttribute("icon")??void 0,d=r.getAttribute("tooltip")??void 0,c=parseInt(r.getAttribute("order")??"100",10);let h;const u=o?.(r);if(u)h=u;else{const e=r.innerHTML.trim();h=t=>{const o=document.createElement("div");return p(o,e),t.appendChild(o),()=>o.remove()}}const b=t.toolPanels.get(i);if(b&&!t.lightDomToolPanelIds.has(i))return l(n,`Tool panel "${i}" is already provided by a plugin or the grid API; ignoring the matching light-DOM <tbw-grid-tool-panel>.`),void(r.style.display="none");if(b){if(u){const e=!t.adapterBoundToolPanelIds.has(i),o=b.title!==a||b.order!==c||b.icon!==s||b.tooltip!==d;if(b.render=h,b.title=a,b.order=c,b.icon=s,b.tooltip=d,t.adapterBoundToolPanelIds.add(i),e||o){const e=t.panelCleanups.get(i);e&&(e(),t.panelCleanups.delete(i))}}return}const g={id:i,title:a,icon:s,tooltip:d,order:c,render:h};t.toolPanels.set(i,g),t.lightDomToolPanelIds.add(i),u&&t.adapterBoundToolPanelIds.add(i),r.style.display="none"})}(t,this.shellState,e._getToolPanelRendererFactory())}syncLightDom(){const e=this.grid;if(!e||!this.hasState)return;const t=this.shellState,o=t.lightDomTitle,n=t.hasToolButtonsContainer;this.#s(e);const r=t.lightDomTitle,l=t.hasToolButtonsContainer;(r&&!o||l&&!n)&&(e._requestConfigMerge(),e._renderRoot.querySelector(".tbw-shell-header")&&(W(t),this.afterStructuralRender()))}parseLightDom(){const e=this.grid;e&&this.hasState&&this.#s(e)}beforeStructuralRender(){this.hasState&&W(this.shellState)}needsStructuralRerender(){const e=this.grid;if(!e||!this.hasState)return!1;const t=e._renderRoot,o=!!t.querySelector(".has-shell"),n=!!t.querySelector(".tbw-tool-panel"),r=t.querySelectorAll(".tbw-accordion-section").length,l=t.querySelector(".tbw-tool-panel")?.dataset.position??"right",i=t.querySelector(".tbw-shell-body")?.dataset.mode??"overlay",a=e.effectiveConfig?.shell;return o!==_(a)||!n&&(a?.toolPanels?.length??0)>0||n&&(a?.toolPanels?.length??0)!==r||n&&l!==(a?.toolPanel?.position??"right")||n&&i!==(a?.toolPanel?.mode??"overlay")}#d(e){const t=this.shellState,o=e._hostElement.id;for(const n of[...t.toolPanels.keys()])t.lightDomToolPanelIds.has(n)||t.apiToolPanelIds.has(n)||(t.panelCleanups.get(n)?.(),t.panelCleanups.delete(n),t.toolPanels.delete(n));for(const n of[...t.headerContents.keys()])t.apiHeaderContentIds.has(n)||(t.headerContentCleanups.get(n)?.(),t.headerContentCleanups.delete(n),t.headerContents.delete(n));const{toolPanels:i,headerContents:a}=e._pluginShellContributions();for(const r of i)t.apiToolPanelIds.has(r.id)||(t.lightDomToolPanelIds.has(r.id)&&(l(n,`Tool panel "${r.id}" is provided by a plugin; ignoring the matching light-DOM <tbw-grid-tool-panel>.`,o),t.panelCleanups.get(r.id)?.(),t.panelCleanups.delete(r.id),t.lightDomToolPanelIds.delete(r.id),t.adapterBoundToolPanelIds.delete(r.id)),t.toolPanels.set(r.id,r));for(const n of a)t.apiHeaderContentIds.has(n.id)||(t.headerContents.has(n.id)&&(l(r,`Header content "${n.id}" is provided by a plugin; ignoring the matching light-DOM definition.`,o),t.headerContentCleanups.get(n.id)?.(),t.headerContentCleanups.delete(n.id)),t.headerContents.set(n.id,n))}processConfig(e){if(!this.hasState)return;const t=this.shellState,o=this.grid;o&&(this.#s(o),this.#d(o));const n=this.resolvedConfig;if(e.shell={...n,...e.shell},e.shell.header={...n.header,...e.shell.header},t.lightDomTitle&&!e.shell.header.title&&(e.shell.header.title=t.lightDomTitle),t.lightDomHeaderContent?.length>0&&(e.shell.header.lightDomContent=t.lightDomHeaderContent),t.hasToolButtonsContainer&&(e.shell.header.hasToolButtonsContainer=!0),t.toolPanels.size>0){const o=Array.from(t.toolPanels.values());o.sort((e,t)=>(e.order??100)-(t.order??100)),e.shell.toolPanels=o}if(t.headerContents.size>0){const o=Array.from(t.headerContents.values());o.sort((e,t)=>(e.order??100)-(t.order??100)),e.shell.headerContents=o}const r=Array.from(t.toolbarContents.values()),l=this.grid?._sourceConfig?.shell?.header?.toolbarContents??[],i=new Set(l.map(e=>e.id)),a=[...l];for(const s of r)i.has(s.id)||a.push(s);a.sort((e,t)=>(e.order??0)-(t.order??0)),e.shell.header.toolbarContents=a,o&&this.#c(o,e.shell.toolPanel?.width)}afterStructuralRender(){const e=this.grid;if(!e||!this.hasState)return;const t=this.shellState;F(e._renderRoot,e.effectiveConfig?.shell,{isPanelOpen:t.isPanelOpen,expandedSections:t.expandedSections},e.effectiveConfig?.icons)&&(this.#p(e),this.shellController.setInitialized(!0),this.#h(e))}afterRender(){const e=this.grid;if(!e||!this.hasState)return;const t=this.shellState;this.#u(e),t.isPanelOpen&&R(e._renderRoot,t),t.isPanelOpen?(this.shellController.reanchorOpenDropdown(),this.#b(e)):this.#g()}#u(e){const t=e._renderRoot.querySelector(".tbw-shell-header");if(!t)return;const o=e.effectiveConfig?.shell?.header?.title??this.shellState.lightDomTitle;let n=t.querySelector(".tbw-shell-title");o?(n||(n=document.createElement("h2"),n.className="tbw-shell-title",n.setAttribute("part","shell-title"),t.insertBefore(n,t.firstChild)),n.textContent=o):n&&n.remove()}#c(e,t){const o=e._hostElement,n="number"==typeof t&&Number.isFinite(t)&&t>0?`${t}px`:void 0,r=o[V];if(n===r)return;o[V]=n;const l=o.style;n?(l.setProperty("--tbw-tool-panel-width",n),e._renderRoot.querySelector(".tbw-tool-panel")?.style.removeProperty("width")):l.getPropertyValue("--tbw-tool-panel-width")===r&&l.removeProperty("--tbw-tool-panel-width")}#b(e){"dropdown"===e.effectiveConfig?.shell?.toolPanel?.mode?"undefined"!=typeof MutationObserver&&(this.#i||(this.#i=new MutationObserver(()=>{this.grid&&this.hasState&&this.shellState.isPanelOpen?this.shellController.reanchorOpenDropdown():this.#g()})),this.#a||(this.#i.observe(e._renderRoot,{childList:!0,subtree:!0}),this.#a=!0)):this.#g()}#g(){this.#i&&this.#a&&(this.#i.disconnect(),this.#a=!1)}#h(e){const t=this.shellState,o=e._renderRoot,n=e.effectiveConfig?.shell;A(o,t),function(e,t,o){const n=t?.header?.toolbarContents??[],r=[...o.toolbarContents.values()],l=new Set(n.map(e=>e.id)),i=[...n];for(const a of r)l.has(a.id)||i.push(a);for(const a of i){if(o.toolbarContentCleanups.has(a.id))continue;if(!a.render)continue;const t=e.querySelector(`[data-toolbar-content="${a.id}"]`);if(!t)continue;const n=a.render(t);n&&o.toolbarContentCleanups.set(a.id,n)}}(o,n,t);const r=n?.toolPanel,l=r?.defaultOpen;l&&t.toolPanels.has(l)&&t.expandedSections.add(l);const i=!0===r?.locked||"open"===r?.initialState||void 0===r?.initialState&&void 0!==l&&t.toolPanels.has(l);!t.isPanelOpen&&t.toolPanels.size>0&&i&&this.openToolPanel(),t.isPanelOpen&&(q(o,t),R(o,t,(e.effectiveConfig,e.effectiveConfig)),$(o,t),this.shellController.reanchorOpenDropdown())}#p(e){const t=e._renderRoot,o=e.effectiveConfig?.shell,n=this.shellState;!function(e,t,o,n){const r=e.querySelector(".tbw-shell-toolbar");r&&r.addEventListener("click",e=>{e.target.closest("[data-panel-toggle]")&&n.onPanelToggle()});const l=e.querySelector(".tbw-tool-panel");l&&n.onPanelClose&&l.addEventListener("click",e=>{e.target.closest("[data-panel-close]")&&n.onPanelClose()});const i=e.querySelector(".tbw-accordion");i&&i.addEventListener("click",e=>{const t=e.target.closest(".tbw-accordion-header");if(t){const e=t.closest("[data-section]")?.getAttribute("data-section");e&&n.onSectionToggle(e)}})}(t,0,0,{onPanelToggle:()=>this.toggleToolPanel(),onSectionToggle:e=>this.toggleToolPanelSection(e),onPanelClose:()=>this.closeToolPanel()}),this.#o?.(),this.#o=L(t,o,t=>{e._hostElement.style.setProperty("--tbw-tool-panel-width",`${t}px`)}),this.#n?.(),this.#n=function(e,t,o,n){const r=t?.toolPanel?.mode;if("dropdown"!==r&&!t?.toolPanel?.closeOnClickOutside)return()=>{};if("push"===r)return()=>{};const l=t=>{if(!o.isPanelOpen)return;const r=o.dropdownAnchorEl;for(const o of t.composedPath()){if(null!=r&&o===r)return;if(o instanceof Element&&(o.classList?.contains("tbw-tool-panel")||o.matches?.("[data-panel-toggle]"))&&H(o,e))return}n()};return document.addEventListener("mousedown",l),()=>document.removeEventListener("mousedown",l)}(e._hostElement,o,n,()=>this.closeToolPanel()),this.#r?.(),this.#r=function(e,t,o){if("push"===e?.toolPanel?.mode)return()=>{};const n=e=>{"Escape"!==e.key||e.defaultPrevented||t.isPanelOpen&&o()};return document.addEventListener("keydown",n),()=>document.removeEventListener("keydown",n)}(o,n,()=>this.closeToolPanel())}#f(){this.#o?.(),this.#o=void 0,this.#n?.(),this.#n=void 0,this.#r?.(),this.#r=void 0}detach(){super.detach()}disposeShellState(){this.#f(),this.#g(),this.#i=void 0;const e=this.grid;e&&this.#l&&(e._unregisterLightDomHandler("tbw-grid-header"),e._unregisterLightDomHandler("tbw-grid-tool-buttons"),e._unregisterLightDomHandler("tbw-grid-tool-panel"),this.#l=void 0),this.#e&&(!function(e){for(const t of e.headerContentCleanups.values())t();e.headerContentCleanups.clear();for(const t of e.panelCleanups.values())t();e.panelCleanups.clear();for(const t of e.toolbarContentCleanups.values())t();e.toolbarContentCleanups.clear();for(const t of e.toolbarContents.values())t.onDestroy?.();if(e.isPanelOpen)for(const t of e.expandedSections)e.toolPanels.get(t)?.onClose?.();e.isPanelOpen=!1,e.expandedSections.clear(),e.toolPanels.clear(),e.headerContents.clear(),e.toolbarContents.clear(),e.lightDomHeaderContent=[],e.lightDomToolPanelIds.clear(),e.adapterBoundToolPanelIds.clear(),e.lightDomToolbarContentIds.clear(),e.lightDomContentMoved=!1}(this.#e),this.#t?.setInitialized(!1))}};e.ShellPlugin=U});
|
|
2
2
|
//# sourceMappingURL=shell.umd.js.map
|