@sken-ds/primitives 0.4.2 → 0.4.6
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/dist/index.js +1 -1
- package/dist/{sken-datatable-ChDjB_T_.js → sken-datatable-CEXcvhM-.js} +2 -2
- package/dist/{sken-datatable-ChDjB_T_.js.map → sken-datatable-CEXcvhM-.js.map} +1 -1
- package/dist/sken-datatable.js +1 -1
- package/dist/sken-layout.js +5 -11
- package/dist/sken-layout.js.map +1 -1
- package/package.json +4 -3
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as e } from "./sken-datatable-
|
|
1
|
+
import { t as e } from "./sken-datatable-CEXcvhM-.js";
|
|
2
2
|
import { SkenButton as t } from "./sken-button.js";
|
|
3
3
|
import { SkenCheckbox as n } from "./sken-checkbox.js";
|
|
4
4
|
import { SkenComboboxGroup as r } from "./sken-combobox-group.js";
|
|
@@ -1251,7 +1251,7 @@ var $ = class extends a {
|
|
|
1251
1251
|
`;
|
|
1252
1252
|
if (this.rows.length === 0) return this.#c();
|
|
1253
1253
|
let e = {}, t = {};
|
|
1254
|
-
this.sorting !== void 0 && this.sorting.length > 0 && (e.sorting = this.sorting, t.sorting = this.sorting), this.globalFilter !== void 0 &&
|
|
1254
|
+
this.sorting !== void 0 && this.sorting.length > 0 && (e.sorting = this.sorting, t.sorting = this.sorting), this.globalFilter !== void 0 && (e.globalFilter = this.globalFilter, t.globalFilter = this.globalFilter), this.pagination === void 0 ? t.pagination = this.#n : (e.pagination = this.pagination, t.pagination = this.pagination);
|
|
1255
1255
|
let n = this.#a().table({
|
|
1256
1256
|
data: this.rows,
|
|
1257
1257
|
columns: this.columns,
|
|
@@ -1558,4 +1558,4 @@ e([d({ attribute: !1 })], $.prototype, "rows", void 0), e([d({ attribute: !1 })]
|
|
|
1558
1558
|
//#endregion
|
|
1559
1559
|
export { $ as t };
|
|
1560
1560
|
|
|
1561
|
-
//# sourceMappingURL=sken-datatable-
|
|
1561
|
+
//# sourceMappingURL=sken-datatable-CEXcvhM-.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sken-datatable-ChDjB_T_.js","names":["#host","#getStore","#selector","#compare","#lastSelected","#subscribedStore","#unsubscribe","#hasSelected","o","i","n","e","c","f","r","s","h","s","n","e","t","i","AsyncDirective","directive","s","s","t","t","createContext","ContextConsumer","ContextProvider","#tableController","#warnIfNoGetRowId","#uncontrolledPagination","#renderEmpty","#getTableController","#features","#fuzzyFilter","#uncontrolledSorting","#uncontrolledGlobalFilter"],"sources":["../../../node_modules/.pnpm/@tanstack+lit-table@9.0.0_@lit+context@1.1.6_lit@3.3.3/node_modules/@tanstack/lit-table/dist/flexRender.js","../../../node_modules/.pnpm/@tanstack+lit-store@0.14.0_lit@3.3.3/node_modules/@tanstack/lit-store/dist/tan-stack-store-selector.js","../../../node_modules/.pnpm/@tanstack+store@0.11.0/node_modules/@tanstack/store/dist/alien.js","../../../node_modules/.pnpm/@tanstack+store@0.11.0/node_modules/@tanstack/store/dist/atom.js","../../../node_modules/.pnpm/@tanstack+store@0.11.0/node_modules/@tanstack/store/dist/shallow.js","../../../node_modules/.pnpm/lit-html@3.3.3/node_modules/lit-html/directive-helpers.js","../../../node_modules/.pnpm/lit-html@3.3.3/node_modules/lit-html/async-directive.js","../../../node_modules/.pnpm/@tanstack+lit-table@9.0.0_@lit+context@1.1.6_lit@3.3.3/node_modules/@tanstack/lit-table/dist/subscribe-directive.js","../../../node_modules/.pnpm/@tanstack+table-core@9.0.0/node_modules/@tanstack/table-core/dist/core/reactivity/renderPhaseReactivity.js","../../../node_modules/.pnpm/@tanstack+lit-table@9.0.0_@lit+context@1.1.6_lit@3.3.3/node_modules/@tanstack/lit-table/dist/reactivity.js","../../../node_modules/.pnpm/@tanstack+lit-table@9.0.0_@lit+context@1.1.6_lit@3.3.3/node_modules/@tanstack/lit-table/dist/TableController.js","../../../node_modules/.pnpm/@lit+context@1.1.6/node_modules/@lit/context/lib/context-request-event.js","../../../node_modules/.pnpm/@lit+context@1.1.6/node_modules/@lit/context/lib/create-context.js","../../../node_modules/.pnpm/@lit+context@1.1.6/node_modules/@lit/context/lib/controllers/context-consumer.js","../../../node_modules/.pnpm/@lit+context@1.1.6/node_modules/@lit/context/lib/value-notifier.js","../../../node_modules/.pnpm/@lit+context@1.1.6/node_modules/@lit/context/lib/controllers/context-provider.js","../../../node_modules/.pnpm/@tanstack+lit-table@9.0.0_@lit+context@1.1.6_lit@3.3.3/node_modules/@tanstack/lit-table/dist/createTableHook.js","../../../node_modules/.pnpm/@tanstack+lit-table@9.0.0_@lit+context@1.1.6_lit@3.3.3/node_modules/@tanstack/lit-table/dist/index.js","../../../node_modules/.pnpm/@tanstack+match-sorter-utils@9.0.0/node_modules/@tanstack/match-sorter-utils/dist/remove-accents.js","../../../node_modules/.pnpm/@tanstack+match-sorter-utils@9.0.0/node_modules/@tanstack/match-sorter-utils/dist/index.js","../src/components/sken-datatable.ts"],"sourcesContent":["//#region src/flexRender.ts\n/**\n* Renders a Lit table template value with the provided context props.\n*\n* Use this lower-level helper for custom header, cell, or footer renderers when\n* you already have the render function and context. `FlexRender` is the\n* convenience wrapper for table cell/header/footer objects.\n*\n* @example\n* ```ts\n* flexRender(cell.column.columnDef.cell, cell.getContext())\n* ```\n*/\nfunction flexRender(Comp, props) {\n\tif (Comp === null || Comp === void 0) return null;\n\tif (typeof Comp === \"function\") return Comp(props);\n\treturn Comp;\n}\n/**\n* Simplified component wrapper of `flexRender`. Use this utility function to render headers, cells, or footers with custom markup.\n* Only one prop (`cell`, `header`, or `footer`) may be passed.\n* @example\n* ```ts\n* ${FlexRender({ cell })}\n* ${FlexRender({ header })}\n* ${FlexRender({ footer: header })}\n* ```\n*\n* This replaces calling `flexRender` directly like this:\n* ```ts\n* flexRender(cell.column.columnDef.cell, cell.getContext())\n* flexRender(header.column.columnDef.header, header.getContext())\n* flexRender(footer.column.columnDef.footer, footer.getContext())\n* ```\n*/\nfunction FlexRender(props) {\n\tif (\"cell\" in props && props.cell) {\n\t\tconst cell = props.cell;\n\t\tconst columnDef = cell.column.columnDef;\n\t\tconst groupingCell = cell;\n\t\tconst groupingColumnDef = columnDef;\n\t\tif (groupingCell.getIsAggregated?.()) return flexRender(groupingColumnDef.aggregatedCell ?? columnDef.cell, cell.getContext());\n\t\tif (groupingCell.getIsPlaceholder?.()) return null;\n\t\treturn flexRender(columnDef.cell, cell.getContext());\n\t}\n\tif (\"header\" in props && props.header) return flexRender(props.header.column.columnDef.header, props.header.getContext());\n\tif (\"footer\" in props && props.footer) return flexRender(props.footer.column.columnDef.footer, props.footer.getContext());\n\treturn null;\n}\n\n//#endregion\nexport { FlexRender, flexRender };","//#region src/tan-stack-store-selector.ts\nfunction defaultCompare(a, b) {\n\treturn a === b;\n}\nfunction defaultSelector(snapshot) {\n\treturn snapshot;\n}\n/**\n* Subscribes a Lit host to a TanStack Store and exposes a selected slice of its state.\n*\n* The host will only re-render when the selected value actually changes\n* (according to the configured `compare` function).\n*\n* @example\n* ```ts\n* class UserNameEl extends LitElement {\n* #name = new TanStackStoreSelector(\n* this,\n* () => userStore,\n* (snapshot) => snapshot.name,\n* )\n*\n* render() {\n* return html`<p>${this.#name.value}</p>`\n* }\n* }\n* ```\n*\n* @example\n* ```ts\n* class UserNameEl extends LitElement {\n* _ = new TanStackStoreAtom(\n* this,\n* () => userStore,\n* (snapshot) => snapshot.name,\n* )\n*\n* render() {\n* return html`<p>${userStore.state.name}</p>`\n* }\n* }\n* ```\n*\n*/\nvar TanStackStoreSelector = class {\n\t#host;\n\t#getStore;\n\t#selector;\n\t#compare;\n\t#unsubscribe;\n\t#subscribedStore;\n\t#hasSelected = false;\n\t#lastSelected;\n\tconstructor(host, getStore, selector = defaultSelector, options) {\n\t\tthis.#host = host;\n\t\tthis.#getStore = getStore;\n\t\tthis.#selector = selector;\n\t\tthis.#compare = options?.compare ?? defaultCompare;\n\t\thost.addController(this);\n\t}\n\tget value() {\n\t\treturn this.#lastSelected;\n\t}\n\thostUpdate() {\n\t\tconst store = this.#getStore();\n\t\tif (store === this.#subscribedStore) return;\n\t\tthis.#unsubscribe?.();\n\t\tthis.#subscribedStore = store;\n\t\tif (!store) {\n\t\t\tthis.#unsubscribe = void 0;\n\t\t\tthis.#hasSelected = false;\n\t\t\tthis.#lastSelected = void 0;\n\t\t\treturn;\n\t\t}\n\t\tthis.#lastSelected = this.#selector(store.get());\n\t\tthis.#hasSelected = true;\n\t\tthis.#unsubscribe = store.subscribe((value) => {\n\t\t\tconst next = this.#selector(value);\n\t\t\tif (this.#hasSelected && this.#compare(this.#lastSelected, next)) return;\n\t\t\tthis.#lastSelected = next;\n\t\t\tthis.#hasSelected = true;\n\t\t\tthis.#host.requestUpdate();\n\t\t}).unsubscribe;\n\t}\n\thostDisconnected() {\n\t\tthis.#unsubscribe?.();\n\t\tthis.#unsubscribe = void 0;\n\t\tthis.#subscribedStore = void 0;\n\t\tthis.#hasSelected = false;\n\t\tthis.#lastSelected = void 0;\n\t}\n};\n\n//#endregion\nexport { TanStackStoreSelector };\n//# sourceMappingURL=tan-stack-store-selector.js.map","//#region src/alien.ts\nlet ReactiveFlags = /* @__PURE__ */ function(ReactiveFlags) {\n\tReactiveFlags[ReactiveFlags[\"None\"] = 0] = \"None\";\n\tReactiveFlags[ReactiveFlags[\"Mutable\"] = 1] = \"Mutable\";\n\tReactiveFlags[ReactiveFlags[\"Watching\"] = 2] = \"Watching\";\n\tReactiveFlags[ReactiveFlags[\"RecursedCheck\"] = 4] = \"RecursedCheck\";\n\tReactiveFlags[ReactiveFlags[\"Recursed\"] = 8] = \"Recursed\";\n\tReactiveFlags[ReactiveFlags[\"Dirty\"] = 16] = \"Dirty\";\n\tReactiveFlags[ReactiveFlags[\"Pending\"] = 32] = \"Pending\";\n\treturn ReactiveFlags;\n}({});\n/* @__NO_SIDE_EFFECTS__ */\nfunction createReactiveSystem({ update, notify, unwatched }) {\n\treturn {\n\t\tlink,\n\t\tunlink,\n\t\tpropagate,\n\t\tcheckDirty,\n\t\tshallowPropagate\n\t};\n\tfunction link(dep, sub, version) {\n\t\tconst prevDep = sub.depsTail;\n\t\tif (prevDep !== void 0 && prevDep.dep === dep) return;\n\t\tconst nextDep = prevDep !== void 0 ? prevDep.nextDep : sub.deps;\n\t\tif (nextDep !== void 0 && nextDep.dep === dep) {\n\t\t\tnextDep.version = version;\n\t\t\tsub.depsTail = nextDep;\n\t\t\treturn;\n\t\t}\n\t\tconst prevSub = dep.subsTail;\n\t\tif (prevSub !== void 0 && prevSub.version === version && prevSub.sub === sub) return;\n\t\tconst newLink = sub.depsTail = dep.subsTail = {\n\t\t\tversion,\n\t\t\tdep,\n\t\t\tsub,\n\t\t\tprevDep,\n\t\t\tnextDep,\n\t\t\tprevSub,\n\t\t\tnextSub: void 0\n\t\t};\n\t\tif (nextDep !== void 0) nextDep.prevDep = newLink;\n\t\tif (prevDep !== void 0) prevDep.nextDep = newLink;\n\t\telse sub.deps = newLink;\n\t\tif (prevSub !== void 0) prevSub.nextSub = newLink;\n\t\telse dep.subs = newLink;\n\t}\n\tfunction unlink(link, sub = link.sub) {\n\t\tconst dep = link.dep;\n\t\tconst prevDep = link.prevDep;\n\t\tconst nextDep = link.nextDep;\n\t\tconst nextSub = link.nextSub;\n\t\tconst prevSub = link.prevSub;\n\t\tif (nextDep !== void 0) nextDep.prevDep = prevDep;\n\t\telse sub.depsTail = prevDep;\n\t\tif (prevDep !== void 0) prevDep.nextDep = nextDep;\n\t\telse sub.deps = nextDep;\n\t\tif (nextSub !== void 0) nextSub.prevSub = prevSub;\n\t\telse dep.subsTail = prevSub;\n\t\tif (prevSub !== void 0) prevSub.nextSub = nextSub;\n\t\telse if ((dep.subs = nextSub) === void 0) unwatched(dep);\n\t\treturn nextDep;\n\t}\n\tfunction propagate(link) {\n\t\tlet next = link.nextSub;\n\t\tlet stack;\n\t\ttop: do {\n\t\t\tconst sub = link.sub;\n\t\t\tlet flags = sub.flags;\n\t\t\tif (!(flags & (ReactiveFlags.RecursedCheck | ReactiveFlags.Recursed | ReactiveFlags.Dirty | ReactiveFlags.Pending))) sub.flags = flags | ReactiveFlags.Pending;\n\t\t\telse if (!(flags & (ReactiveFlags.RecursedCheck | ReactiveFlags.Recursed))) flags = ReactiveFlags.None;\n\t\t\telse if (!(flags & ReactiveFlags.RecursedCheck)) sub.flags = flags & ~ReactiveFlags.Recursed | ReactiveFlags.Pending;\n\t\t\telse if (!(flags & (ReactiveFlags.Dirty | ReactiveFlags.Pending)) && isValidLink(link, sub)) {\n\t\t\t\tsub.flags = flags | (ReactiveFlags.Recursed | ReactiveFlags.Pending);\n\t\t\t\tflags &= ReactiveFlags.Mutable;\n\t\t\t} else flags = ReactiveFlags.None;\n\t\t\tif (flags & ReactiveFlags.Watching) notify(sub);\n\t\t\tif (flags & ReactiveFlags.Mutable) {\n\t\t\t\tconst subSubs = sub.subs;\n\t\t\t\tif (subSubs !== void 0) {\n\t\t\t\t\tconst nextSub = (link = subSubs).nextSub;\n\t\t\t\t\tif (nextSub !== void 0) {\n\t\t\t\t\t\tstack = {\n\t\t\t\t\t\t\tvalue: next,\n\t\t\t\t\t\t\tprev: stack\n\t\t\t\t\t\t};\n\t\t\t\t\t\tnext = nextSub;\n\t\t\t\t\t}\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ((link = next) !== void 0) {\n\t\t\t\tnext = link.nextSub;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\twhile (stack !== void 0) {\n\t\t\t\tlink = stack.value;\n\t\t\t\tstack = stack.prev;\n\t\t\t\tif (link !== void 0) {\n\t\t\t\t\tnext = link.nextSub;\n\t\t\t\t\tcontinue top;\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\t} while (true);\n\t}\n\tfunction checkDirty(link, sub) {\n\t\tlet stack;\n\t\tlet checkDepth = 0;\n\t\tlet dirty = false;\n\t\ttop: do {\n\t\t\tconst dep = link.dep;\n\t\t\tconst flags = dep.flags;\n\t\t\tif (sub.flags & ReactiveFlags.Dirty) dirty = true;\n\t\t\telse if ((flags & (ReactiveFlags.Mutable | ReactiveFlags.Dirty)) === (ReactiveFlags.Mutable | ReactiveFlags.Dirty)) {\n\t\t\t\tif (update(dep)) {\n\t\t\t\t\tconst subs = dep.subs;\n\t\t\t\t\tif (subs.nextSub !== void 0) shallowPropagate(subs);\n\t\t\t\t\tdirty = true;\n\t\t\t\t}\n\t\t\t} else if ((flags & (ReactiveFlags.Mutable | ReactiveFlags.Pending)) === (ReactiveFlags.Mutable | ReactiveFlags.Pending)) {\n\t\t\t\tif (link.nextSub !== void 0 || link.prevSub !== void 0) stack = {\n\t\t\t\t\tvalue: link,\n\t\t\t\t\tprev: stack\n\t\t\t\t};\n\t\t\t\tlink = dep.deps;\n\t\t\t\tsub = dep;\n\t\t\t\t++checkDepth;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (!dirty) {\n\t\t\t\tconst nextDep = link.nextDep;\n\t\t\t\tif (nextDep !== void 0) {\n\t\t\t\t\tlink = nextDep;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\t\t\twhile (checkDepth--) {\n\t\t\t\tconst firstSub = sub.subs;\n\t\t\t\tconst hasMultipleSubs = firstSub.nextSub !== void 0;\n\t\t\t\tif (hasMultipleSubs) {\n\t\t\t\t\tlink = stack.value;\n\t\t\t\t\tstack = stack.prev;\n\t\t\t\t} else link = firstSub;\n\t\t\t\tif (dirty) {\n\t\t\t\t\tif (update(sub)) {\n\t\t\t\t\t\tif (hasMultipleSubs) shallowPropagate(firstSub);\n\t\t\t\t\t\tsub = link.sub;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tdirty = false;\n\t\t\t\t} else sub.flags &= ~ReactiveFlags.Pending;\n\t\t\t\tsub = link.sub;\n\t\t\t\tconst nextDep = link.nextDep;\n\t\t\t\tif (nextDep !== void 0) {\n\t\t\t\t\tlink = nextDep;\n\t\t\t\t\tcontinue top;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn dirty;\n\t\t} while (true);\n\t}\n\tfunction shallowPropagate(link) {\n\t\tdo {\n\t\t\tconst sub = link.sub;\n\t\t\tconst flags = sub.flags;\n\t\t\tif ((flags & (ReactiveFlags.Pending | ReactiveFlags.Dirty)) === ReactiveFlags.Pending) {\n\t\t\t\tsub.flags = flags | ReactiveFlags.Dirty;\n\t\t\t\tif ((flags & (ReactiveFlags.Watching | ReactiveFlags.RecursedCheck)) === ReactiveFlags.Watching) notify(sub);\n\t\t\t}\n\t\t} while ((link = link.nextSub) !== void 0);\n\t}\n\tfunction isValidLink(checkLink, sub) {\n\t\tlet link = sub.depsTail;\n\t\twhile (link !== void 0) {\n\t\t\tif (link === checkLink) return true;\n\t\t\tlink = link.prevDep;\n\t\t}\n\t\treturn false;\n\t}\n}\n\n//#endregion\nexport { ReactiveFlags, createReactiveSystem };\n//# sourceMappingURL=alien.js.map","import { ReactiveFlags, createReactiveSystem } from \"./alien.js\";\n\n//#region src/atom.ts\nfunction toObserver(nextHandler, errorHandler, completionHandler) {\n\tconst isObserver = typeof nextHandler === \"object\";\n\tconst self = isObserver ? nextHandler : void 0;\n\treturn {\n\t\tnext: (isObserver ? nextHandler.next : nextHandler)?.bind(self),\n\t\terror: (isObserver ? nextHandler.error : errorHandler)?.bind(self),\n\t\tcomplete: (isObserver ? nextHandler.complete : completionHandler)?.bind(self)\n\t};\n}\nconst queuedEffects = [];\nlet cycle = 0;\nconst { link, unlink, propagate, checkDirty, shallowPropagate } = /* @__PURE__ */ createReactiveSystem({\n\tupdate(atom) {\n\t\treturn atom._update();\n\t},\n\tnotify(effect) {\n\t\tqueuedEffects[queuedEffectsLength++] = effect;\n\t\teffect.flags &= ~ReactiveFlags.Watching;\n\t},\n\tunwatched(atom) {\n\t\tif (atom.depsTail !== void 0) {\n\t\t\tatom.depsTail = void 0;\n\t\t\tatom.flags = ReactiveFlags.Mutable | ReactiveFlags.Dirty;\n\t\t\tpurgeDeps(atom);\n\t\t}\n\t}\n});\nlet notifyIndex = 0;\nlet queuedEffectsLength = 0;\nlet activeSub;\nlet batchDepth = 0;\nfunction batch(fn) {\n\ttry {\n\t\t++batchDepth;\n\t\tfn();\n\t} finally {\n\t\tif (!--batchDepth) flush();\n\t}\n}\nfunction purgeDeps(sub) {\n\tconst depsTail = sub.depsTail;\n\tlet dep = depsTail !== void 0 ? depsTail.nextDep : sub.deps;\n\twhile (dep !== void 0) dep = unlink(dep, sub);\n}\nfunction flush() {\n\tif (batchDepth > 0) return;\n\twhile (notifyIndex < queuedEffectsLength) {\n\t\tconst effect = queuedEffects[notifyIndex];\n\t\tqueuedEffects[notifyIndex++] = void 0;\n\t\teffect.notify();\n\t}\n\tnotifyIndex = 0;\n\tqueuedEffectsLength = 0;\n}\nfunction createAsyncAtom(getValue, options) {\n\tconst ref = {};\n\tconst atom = createAtom(() => {\n\t\tgetValue().then((data) => {\n\t\t\tconst internalAtom = ref.current;\n\t\t\tif (internalAtom._update({\n\t\t\t\tstatus: \"done\",\n\t\t\t\tdata\n\t\t\t})) {\n\t\t\t\tconst subs = internalAtom.subs;\n\t\t\t\tif (subs !== void 0) {\n\t\t\t\t\tpropagate(subs);\n\t\t\t\t\tshallowPropagate(subs);\n\t\t\t\t\tflush();\n\t\t\t\t}\n\t\t\t}\n\t\t}, (error) => {\n\t\t\tconst internalAtom = ref.current;\n\t\t\tif (internalAtom._update({\n\t\t\t\tstatus: \"error\",\n\t\t\t\terror\n\t\t\t})) {\n\t\t\t\tconst subs = internalAtom.subs;\n\t\t\t\tif (subs !== void 0) {\n\t\t\t\t\tpropagate(subs);\n\t\t\t\t\tshallowPropagate(subs);\n\t\t\t\t\tflush();\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\treturn { status: \"pending\" };\n\t}, options);\n\tref.current = atom;\n\treturn atom;\n}\nfunction createAtom(valueOrFn, options) {\n\tconst isComputed = typeof valueOrFn === \"function\";\n\tconst getter = valueOrFn;\n\tconst atom = {\n\t\t_snapshot: isComputed ? void 0 : valueOrFn,\n\t\tsubs: void 0,\n\t\tsubsTail: void 0,\n\t\tdeps: void 0,\n\t\tdepsTail: void 0,\n\t\tflags: isComputed ? ReactiveFlags.None : ReactiveFlags.Mutable,\n\t\tget() {\n\t\t\tif (activeSub !== void 0) link(atom, activeSub, cycle);\n\t\t\treturn atom._snapshot;\n\t\t},\n\t\tsubscribe(observerOrFn) {\n\t\t\tconst obs = toObserver(observerOrFn);\n\t\t\tconst observed = { current: false };\n\t\t\tconst e = effect(() => {\n\t\t\t\tatom.get();\n\t\t\t\tif (!observed.current) observed.current = true;\n\t\t\t\telse obs.next?.(atom._snapshot);\n\t\t\t});\n\t\t\treturn { unsubscribe: () => {\n\t\t\t\te.stop();\n\t\t\t} };\n\t\t},\n\t\t_update(getValue) {\n\t\t\tconst prevSub = activeSub;\n\t\t\tconst compare = options?.compare ?? Object.is;\n\t\t\tif (isComputed) {\n\t\t\t\tactiveSub = atom;\n\t\t\t\t++cycle;\n\t\t\t\tatom.depsTail = void 0;\n\t\t\t} else if (getValue === void 0) return false;\n\t\t\tif (isComputed) atom.flags = ReactiveFlags.Mutable | ReactiveFlags.RecursedCheck;\n\t\t\ttry {\n\t\t\t\tconst oldValue = atom._snapshot;\n\t\t\t\tconst newValue = typeof getValue === \"function\" ? getValue(oldValue) : getValue === void 0 && isComputed ? getter(oldValue) : getValue;\n\t\t\t\tif (oldValue === void 0 || !compare(oldValue, newValue)) {\n\t\t\t\t\tatom._snapshot = newValue;\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t} finally {\n\t\t\t\tactiveSub = prevSub;\n\t\t\t\tif (isComputed) atom.flags &= ~ReactiveFlags.RecursedCheck;\n\t\t\t\tpurgeDeps(atom);\n\t\t\t}\n\t\t}\n\t};\n\tif (isComputed) {\n\t\tatom.flags = ReactiveFlags.Mutable | ReactiveFlags.Dirty;\n\t\tatom.get = function() {\n\t\t\tconst flags = atom.flags;\n\t\t\tif (flags & ReactiveFlags.Dirty || flags & ReactiveFlags.Pending && checkDirty(atom.deps, atom)) {\n\t\t\t\tif (atom._update()) {\n\t\t\t\t\tconst subs = atom.subs;\n\t\t\t\t\tif (subs !== void 0) shallowPropagate(subs);\n\t\t\t\t}\n\t\t\t} else if (flags & ReactiveFlags.Pending) atom.flags = flags & ~ReactiveFlags.Pending;\n\t\t\tif (activeSub !== void 0) link(atom, activeSub, cycle);\n\t\t\treturn atom._snapshot;\n\t\t};\n\t} else atom.set = function(valueOrFn) {\n\t\tif (atom._update(valueOrFn)) {\n\t\t\tconst subs = atom.subs;\n\t\t\tif (subs !== void 0) {\n\t\t\t\tpropagate(subs);\n\t\t\t\tshallowPropagate(subs);\n\t\t\t\tflush();\n\t\t\t}\n\t\t}\n\t};\n\treturn atom;\n}\nfunction effect(fn) {\n\tconst run = () => {\n\t\tconst prevSub = activeSub;\n\t\tactiveSub = effectObj;\n\t\t++cycle;\n\t\teffectObj.depsTail = void 0;\n\t\teffectObj.flags = ReactiveFlags.Watching | ReactiveFlags.RecursedCheck;\n\t\ttry {\n\t\t\treturn fn();\n\t\t} finally {\n\t\t\tactiveSub = prevSub;\n\t\t\teffectObj.flags &= ~ReactiveFlags.RecursedCheck;\n\t\t\tpurgeDeps(effectObj);\n\t\t}\n\t};\n\tconst effectObj = {\n\t\tdeps: void 0,\n\t\tdepsTail: void 0,\n\t\tsubs: void 0,\n\t\tsubsTail: void 0,\n\t\tflags: ReactiveFlags.Watching | ReactiveFlags.RecursedCheck,\n\t\tnotify() {\n\t\t\tconst flags = this.flags;\n\t\t\tif (flags & ReactiveFlags.Dirty || flags & ReactiveFlags.Pending && checkDirty(this.deps, this)) run();\n\t\t\telse this.flags = ReactiveFlags.Watching;\n\t\t},\n\t\tstop() {\n\t\t\tthis.flags = ReactiveFlags.None;\n\t\t\tthis.depsTail = void 0;\n\t\t\tpurgeDeps(this);\n\t\t}\n\t};\n\trun();\n\treturn effectObj;\n}\n\n//#endregion\nexport { batch, createAsyncAtom, createAtom, flush, toObserver };\n//# sourceMappingURL=atom.js.map","//#region src/shallow.ts\nfunction shallow(objA, objB) {\n\tif (Object.is(objA, objB)) return true;\n\tif (typeof objA !== \"object\" || objA === null || typeof objB !== \"object\" || objB === null) return false;\n\tif (objA instanceof Map && objB instanceof Map) {\n\t\tif (objA.size !== objB.size) return false;\n\t\tfor (const [k, v] of objA) if (!objB.has(k) || !Object.is(v, objB.get(k))) return false;\n\t\treturn true;\n\t}\n\tif (objA instanceof Set && objB instanceof Set) {\n\t\tif (objA.size !== objB.size) return false;\n\t\tfor (const v of objA) if (!objB.has(v)) return false;\n\t\treturn true;\n\t}\n\tif (objA instanceof Date && objB instanceof Date) {\n\t\tif (objA.getTime() !== objB.getTime()) return false;\n\t\treturn true;\n\t}\n\tconst keysA = getOwnKeys(objA);\n\tif (keysA.length !== getOwnKeys(objB).length) return false;\n\tfor (let i = 0; i < keysA.length; i++) if (!Object.prototype.hasOwnProperty.call(objB, keysA[i]) || !Object.is(objA[keysA[i]], objB[keysA[i]])) return false;\n\treturn true;\n}\nfunction getOwnKeys(obj) {\n\treturn Object.keys(obj).concat(Object.getOwnPropertySymbols(obj));\n}\n\n//#endregion\nexport { shallow };\n//# sourceMappingURL=shallow.js.map","import{_$LH as o}from\"./lit-html.js\";\n/**\n * @license\n * Copyright 2020 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */const{I:t}=o,i=o=>o,n=o=>null===o||\"object\"!=typeof o&&\"function\"!=typeof o,e={HTML:1,SVG:2,MATHML:3},l=(o,t)=>void 0===t?void 0!==o?._$litType$:o?._$litType$===t,d=o=>null!=o?._$litType$?.h,c=o=>void 0!==o?._$litDirective$,f=o=>o?._$litDirective$,r=o=>void 0===o.strings,s=()=>document.createComment(\"\"),v=(o,n,e)=>{const l=o._$AA.parentNode,d=void 0===n?o._$AB:n._$AA;if(void 0===e){const i=l.insertBefore(s(),d),n=l.insertBefore(s(),d);e=new t(i,n,o,o.options)}else{const t=e._$AB.nextSibling,n=e._$AM,c=n!==o;if(c){let t;e._$AQ?.(o),e._$AM=o,void 0!==e._$AP&&(t=o._$AU)!==n._$AU&&e._$AP(t)}if(t!==d||c){let o=e._$AA;for(;o!==t;){const t=i(o).nextSibling;i(l).insertBefore(o,d),o=t}}}return e},u=(o,t,i=o)=>(o._$AI(t,i),o),m={},p=(o,t=m)=>o._$AH=t,M=o=>o._$AH,h=o=>{o._$AR(),o._$AA.remove()},j=o=>{o._$AR()};export{e as TemplateResultType,j as clearPart,M as getCommittedValue,f as getDirectiveClass,v as insertPart,d as isCompiledTemplateResult,c as isDirectiveResult,n as isPrimitive,r as isSingleExpression,l as isTemplateResult,h as removePart,u as setChildPartValue,p as setCommittedValue};\n//# sourceMappingURL=directive-helpers.js.map\n","import{isSingleExpression as i}from\"./directive-helpers.js\";import{Directive as t,PartType as e}from\"./directive.js\";export{directive}from\"./directive.js\";\n/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */const s=(i,t)=>{const e=i._$AN;if(void 0===e)return!1;for(const i of e)i._$AO?.(t,!1),s(i,t);return!0},o=i=>{let t,e;do{if(void 0===(t=i._$AM))break;e=t._$AN,e.delete(i),i=t}while(0===e?.size)},r=i=>{for(let t;t=i._$AM;i=t){let e=t._$AN;if(void 0===e)t._$AN=e=new Set;else if(e.has(i))break;e.add(i),c(t)}};function h(i){void 0!==this._$AN?(o(this),this._$AM=i,r(this)):this._$AM=i}function n(i,t=!1,e=0){const r=this._$AH,h=this._$AN;if(void 0!==h&&0!==h.size)if(t)if(Array.isArray(r))for(let i=e;i<r.length;i++)s(r[i],!1),o(r[i]);else null!=r&&(s(r,!1),o(r));else s(this,i)}const c=i=>{i.type==e.CHILD&&(i._$AP??=n,i._$AQ??=h)};class f extends t{constructor(){super(...arguments),this._$AN=void 0}_$AT(i,t,e){super._$AT(i,t,e),r(this),this.isConnected=i._$AU}_$AO(i,t=!0){i!==this.isConnected&&(this.isConnected=i,i?this.reconnected?.():this.disconnected?.()),t&&(s(this,i),o(this))}setValue(t){if(i(this._$Ct))this._$Ct._$AI(t,this);else{const i=[...this._$Ct._$AH];i[this._$Ci]=t,this._$Ct._$AI(i,this,0)}}disconnected(){}reconnected(){}}export{f as AsyncDirective,t as Directive,e as PartType};\n//# sourceMappingURL=async-directive.js.map\n","import { TanStackStoreSelector } from \"@tanstack/lit-store\";\nimport { AsyncDirective, directive } from \"lit/async-directive.js\";\nimport { noChange } from \"lit\";\n\n//#region src/subscribe-directive.ts\n/**\n* A simple identity selector used when no specific selection is needed,\n* allowing the directive to subscribe to the entire state of the source.\n* @template T - The type of the state being passed through unchanged.\n*/\nconst identitySelector = (state) => state;\n/**\n* An asynchronous Lit directive that subscribes to a `@tanstack/lit-store`\n* source and triggers re-renders specifically for the template portion it wraps.\n* * It uses a \"fake\" `ReactiveControllerHost` to bridge the gap between\n* TanStack's standard controller requirements and the `AsyncDirective` lifecycle.\n*/\nvar SubscribeDirective = class extends AsyncDirective {\n\t/** The `TanStackStoreSelector` controller that manages the subscription to the store/atom */\n\tcontroller;\n\t/** The latest source and selector used to determine if a new subscription is needed on updates */\n\tlatestSource;\n\tlatestSelector;\n\tresolvedTemplate;\n\tinitialized = false;\n\trender(_source, _selectorOrTemplate, _template) {\n\t\t/** The actual rendering is handled in the {@link update} method to ensure that template is only evaluated if needed */\n\t\treturn noChange;\n\t}\n\tupdate(_part, args) {\n\t\tconst [source, selectorOrTemplate, template] = args;\n\t\tconst isIdentitySubscription = template === void 0;\n\t\tconst selector = isIdentitySubscription ? identitySelector : selectorOrTemplate;\n\t\tconst actualTemplate = isIdentitySubscription ? selectorOrTemplate : template;\n\t\tconst sourceChanged = this.latestSource !== source;\n\t\tconst selectorChanged = this.latestSelector !== selector;\n\t\tconst shouldReinitialize = !this.initialized || sourceChanged || selectorChanged;\n\t\tthis.resolvedTemplate = actualTemplate;\n\t\tif (shouldReinitialize) {\n\t\t\tif (this.initialized) {\n\t\t\t\tthis.controller?.hostDisconnected();\n\t\t\t\tthis.controller = void 0;\n\t\t\t}\n\t\t\tthis.latestSource = source;\n\t\t\tthis.latestSelector = selector;\n\t\t\tif (!this.controller) this.controller = new TanStackStoreSelector(this.createFakeHost(), () => this.latestSource, (state) => this.latestSelector?.(state));\n\t\t\tthis.controller.hostUpdate();\n\t\t\tthis.initialized = true;\n\t\t}\n\t\treturn this.resolvedTemplate?.(this.latestSelector(this.latestSource.get()));\n\t}\n\t/** Cleans up the controller subscription when the directive is removed from the DOM. */\n\tdisconnected() {\n\t\tthis.controller?.hostDisconnected();\n\t}\n\t/** Restores the controller subscription when the directive is re-attached to the DOM. */\n\treconnected() {\n\t\tthis.controller?.hostUpdate();\n\t\tif (this.resolvedTemplate && this.controller) this.setValue(this.resolvedTemplate(this.controller.value));\n\t}\n\t/**\n\t* Creates a mock `ReactiveControllerHost` allowing the `TanStackStoreSelector`\n\t* to plug into the `AsyncDirective`'s update cycle using `setValue()`.\n\t*/\n\tcreateFakeHost() {\n\t\treturn {\n\t\t\taddController: () => {},\n\t\t\tremoveController: () => {},\n\t\t\trequestUpdate: () => {\n\t\t\t\tif (this.resolvedTemplate && this.controller) this.setValue(this.resolvedTemplate(this.controller.value));\n\t\t\t},\n\t\t\tget updateComplete() {\n\t\t\t\treturn Promise.resolve(true);\n\t\t\t}\n\t\t};\n\t}\n};\n/**\n* A Lit directive that subscribes to a source (Store or Atom)\n* and efficiently updates only the wrapped template\n* when the state or selected slice changes.\n* @example\n* ```ts\n* // Without a selector (subscribes to entire state)\n* html`<div>${subscribe(myStore, (state) => html`<span>${state.count}</span>`)}</div>`\n* * // With a selector (only updates when `count` changes)\n* html`<div>${subscribe(myStore, state => state.count, (count) => html`<span>${count}</span>`)}</div>`\n* ```\n*/\nconst subscribe = directive(SubscribeDirective);\n\n//#endregion\nexport { SubscribeDirective, subscribe };","//#region src/core/reactivity/renderPhaseReactivity.ts\n/**\n* Creates reactivity bindings for render-phase adapters (React, Preact, Lit):\n* frameworks with plain, non-reactive options that are re-synchronized during\n* component render, where store notifications must not fire until the host\n* commits.\n*\n* Readonly atoms are exposed as live facades. `get()` re-evaluates the\n* resolver against the options of the render in progress — a normal computed\n* cannot know that plain `options.state` changed — and caches the result\n* through the configured comparator so external-store consumers (e.g. React's\n* `useSyncExternalStore`) see referentially stable snapshots. `subscribe()`\n* goes through a hidden computed that tracks the resolver's real atom\n* dependencies plus a commit version, so subscribers are invalidated by\n* actual reactive writes and by the adapter's post-commit publication.\n*\n* @example\n* ```ts\n* import { batch, createAtom } from '@tanstack/react-store'\n*\n* export const reactReactivity = () =>\n* renderPhaseReactivity({ createAtom, batch })\n* ```\n*/\nfunction renderPhaseReactivity(primitives) {\n\tconst { createAtom, batch } = primitives;\n\tconst commitAtom = createAtom(0);\n\treturn {\n\t\tcreateOptionsStore: false,\n\t\twrapExternalAtoms: false,\n\t\taddSubscription: () => {\n\t\t\tthrow new Error(\"Feature not supported in current reactivity implementation\");\n\t\t},\n\t\tunmount: () => {\n\t\t\tthrow new Error(\"Feature not supported in current reactivity implementation\");\n\t\t},\n\t\tschedule: primitives.schedule ?? ((fn) => queueMicrotask(fn)),\n\t\tbatch,\n\t\tuntrack: (fn) => fn(),\n\t\tcreateReadonlyAtom: (fn, atomOptions) => {\n\t\t\tconst compare = atomOptions?.compare ?? Object.is;\n\t\t\tlet hasSnapshot = false;\n\t\t\tlet snapshot;\n\t\t\tconst getSnapshot = () => {\n\t\t\t\tconst nextSnapshot = fn();\n\t\t\t\tif (!hasSnapshot || !compare(snapshot, nextSnapshot)) {\n\t\t\t\t\tsnapshot = nextSnapshot;\n\t\t\t\t\thasSnapshot = true;\n\t\t\t\t}\n\t\t\t\treturn snapshot;\n\t\t\t};\n\t\t\tconst reactiveAtom = createAtom(() => {\n\t\t\t\tcommitAtom.get();\n\t\t\t\treturn getSnapshot();\n\t\t\t}, { compare });\n\t\t\treturn {\n\t\t\t\tget: getSnapshot,\n\t\t\t\tsubscribe: reactiveAtom.subscribe.bind(reactiveAtom)\n\t\t\t};\n\t\t},\n\t\tcreateWritableAtom: (value, atomOptions) => {\n\t\t\treturn createAtom(value, { compare: atomOptions?.compare });\n\t\t},\n\t\tcommit: () => {\n\t\t\tcommitAtom.set((version) => version + 1);\n\t\t}\n\t};\n}\n/**\n* Creates a render-phase source with an explicit commit baseline.\n*\n* Render-phase adapters publish controlled state after the host framework\n* commits so isolated subscribers update, but the component that owns the\n* table already rendered that exact snapshot — forwarding the notification to\n* its root subscription would produce a redundant render. Unlike a last-read\n* filter, speculative reads do not change notification behavior: only\n* `markCommitted()` advances the baseline.\n*/\nfunction createRenderPhaseSource(source, compare = Object.is) {\n\tlet hasCommittedSnapshot = false;\n\tlet committedSnapshot;\n\treturn {\n\t\tget: source.get,\n\t\tmarkCommitted: (snapshot) => {\n\t\t\tcommittedSnapshot = snapshot;\n\t\t\thasCommittedSnapshot = true;\n\t\t},\n\t\tsubscribe: (listener) => source.subscribe((value) => {\n\t\t\tif (!hasCommittedSnapshot || !compare(committedSnapshot, value)) listener(value);\n\t\t})\n\t};\n}\n\n//#endregion\nexport { createRenderPhaseSource, renderPhaseReactivity };","import { renderPhaseReactivity } from \"@tanstack/table-core/reactivity\";\nimport { batch, createAtom } from \"@tanstack/lit-store\";\n\n//#region src/reactivity.ts\n/**\n* Creates the table-core reactivity bindings used by the Lit adapter.\n*\n* Lit calls `controller.table(options)` from the host's `render()`, so options\n* are plain values synchronized during the update cycle — writing a reactive\n* options store there would schedule a second update per interaction. The\n* render-phase preset supplies the live readonly-atom facades and the `commit`\n* hook; `TableController` publishes its captured controlled state from\n* `hostUpdated()`. Store primitives come from `@tanstack/lit-store` so all\n* atoms share one store instance with user-provided external atoms.\n*/\nfunction litReactivity() {\n\treturn renderPhaseReactivity({\n\t\tcreateAtom,\n\t\tbatch\n\t});\n}\n\n//#endregion\nexport { litReactivity };","import { FlexRender } from \"./flexRender.js\";\nimport { litReactivity } from \"./reactivity.js\";\nimport { subscribe } from \"./subscribe-directive.js\";\nimport { constructTable } from \"@tanstack/table-core\";\nimport { createRenderPhaseSource } from \"@tanstack/table-core/reactivity\";\nimport { table_publishExternalState, table_setOptions } from \"@tanstack/table-core/static-functions\";\nimport { shallow } from \"@tanstack/lit-store\";\n\n//#region src/TableController.ts\n/**\n* A Lit ReactiveController for TanStack Table integration.\n*\n* Uses `constructReactivityFeature` from table-core to properly integrate\n* with the TanStack Store reactivity system, matching the pattern used by\n* all other framework adapters (React, Vue, Solid, Svelte, Angular).\n*\n* @example\n* ```ts\n* @customElement('my-table')\n* class MyTable extends LitElement {\n* private tableController = new TableController<typeof features, Person>(this)\n*\n* protected render() {\n* const table = this.tableController.table(\n* {\n* features,\n* columns,\n* data,\n* },\n* (state) => ({ sorting: state.sorting }),\n* )\n* // use table in your template...\n* }\n* }\n* ```\n*/\nvar TableController = class {\n\thost;\n\t_table = null;\n\t_rootSource;\n\t_storeSubscription;\n\t_capturedState;\n\t_capturedSnapshot;\n\t_hasSelector = false;\n\t_latestSelector;\n\t_lastSelected;\n\tconstructor(host) {\n\t\t(this.host = host).addController(this);\n\t}\n\t/**\n\t* Returns the Lit-backed table instance for the current render pass.\n\t*\n\t* The first call constructs the table with Lit reactivity bindings and\n\t* subscribes the host to table state/options changes. Later calls merge new\n\t* options into the same table instance and expose selected state through\n\t* `table.state`.\n\t*\n\t* @example\n\t* ```ts\n\t* const table = this.tableController.table(\n\t* { features, columns, data },\n\t* (state) => ({ sorting: state.sorting }),\n\t* )\n\t* ```\n\t*/\n\ttable(tableOptions, selector) {\n\t\tif (!this._table) {\n\t\t\tconst mergedOptions = {\n\t\t\t\t...tableOptions,\n\t\t\t\tfeatures: {\n\t\t\t\t\tcoreReactivityFeature: litReactivity(),\n\t\t\t\t\t...tableOptions.features\n\t\t\t\t},\n\t\t\t\tmergeOptions: (defaultOptions, newOptions) => {\n\t\t\t\t\treturn {\n\t\t\t\t\t\t...defaultOptions,\n\t\t\t\t\t\t...newOptions\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t};\n\t\t\tthis._table = constructTable(mergedOptions);\n\t\t\tthis._rootSource = createRenderPhaseSource(this._table.store, shallow);\n\t\t\tthis._setupSubscriptions();\n\t\t}\n\t\ttable_setOptions(this._table, (prev) => ({\n\t\t\t...prev,\n\t\t\t...tableOptions\n\t\t}), { syncExternalState: false });\n\t\tthis._capturedState = this._table.options.state;\n\t\tconst renderSnapshot = this._rootSource.get();\n\t\tthis._capturedSnapshot = renderSnapshot;\n\t\tthis._hasSelector = selector !== void 0;\n\t\tthis._latestSelector = selector;\n\t\tthis._lastSelected = selector ? selector(renderSnapshot) : renderSnapshot;\n\t\treturn {\n\t\t\t...this._table,\n\t\t\tsubscribe,\n\t\t\tFlexRender,\n\t\t\tget state() {\n\t\t\t\treturn selector?.(renderSnapshot) ?? renderSnapshot;\n\t\t\t}\n\t\t};\n\t}\n\t_setupSubscriptions() {\n\t\tif (this._table && !this._storeSubscription) this._storeSubscription = this._rootSource.subscribe((state) => {\n\t\t\tif (this._hasSelector) {\n\t\t\t\tconst nextSelected = this._latestSelector(state);\n\t\t\t\tif (shallow(this._lastSelected, nextSelected)) return;\n\t\t\t\tthis._lastSelected = nextSelected;\n\t\t\t}\n\t\t\tthis.host.requestUpdate();\n\t\t});\n\t}\n\thostConnected() {\n\t\tthis._setupSubscriptions();\n\t\tif (this._table) this.host.requestUpdate();\n\t}\n\thostUpdated() {\n\t\tif (!this._table) return;\n\t\tthis._rootSource.markCommitted(this._capturedSnapshot);\n\t\ttable_publishExternalState(this._table, this._capturedState ?? null, shallow);\n\t}\n\thostDisconnected() {\n\t\tthis._storeSubscription?.unsubscribe();\n\t\tthis._storeSubscription = void 0;\n\t}\n};\n\n//#endregion\nexport { TableController };","/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nclass s extends Event{constructor(s,t,e,o){super(\"context-request\",{bubbles:!0,composed:!0}),this.context=s,this.contextTarget=t,this.callback=e,this.subscribe=o??!1}}export{s as ContextRequestEvent};\n//# sourceMappingURL=context-request-event.js.map\n","/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nfunction n(n){return n}export{n as createContext};\n//# sourceMappingURL=create-context.js.map\n","import{ContextRequestEvent as t}from\"../context-request-event.js\";\n/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */class s{constructor(t,s,i,h){if(this.subscribe=!1,this.provided=!1,this.value=void 0,this.t=(t,s)=>{this.unsubscribe&&(this.unsubscribe!==s&&(this.provided=!1,this.unsubscribe()),this.subscribe||this.unsubscribe()),this.value=t,this.host.requestUpdate(),this.provided&&!this.subscribe||(this.provided=!0,this.callback&&this.callback(t,s)),this.unsubscribe=s},this.host=t,void 0!==s.context){const t=s;this.context=t.context,this.callback=t.callback,this.subscribe=t.subscribe??!1}else this.context=s,this.callback=i,this.subscribe=h??!1;this.host.addController(this)}hostConnected(){this.dispatchRequest()}hostDisconnected(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=void 0)}dispatchRequest(){this.host.dispatchEvent(new t(this.context,this.host,this.t,this.subscribe))}}export{s as ContextConsumer};\n//# sourceMappingURL=context-consumer.js.map\n","/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nclass s{get value(){return this.o}set value(s){this.setValue(s)}setValue(s,t=!1){const i=t||!Object.is(s,this.o);this.o=s,i&&this.updateObservers()}constructor(s){this.subscriptions=new Map,this.updateObservers=()=>{for(const[s,{disposer:t}]of this.subscriptions)s(this.o,t)},void 0!==s&&(this.value=s)}addCallback(s,t,i){if(!i)return void s(this.value);this.subscriptions.has(s)||this.subscriptions.set(s,{disposer:()=>{this.subscriptions.delete(s)},consumerHost:t});const{disposer:h}=this.subscriptions.get(s);s(this.value,h)}clearCallbacks(){this.subscriptions.clear()}}export{s as ValueNotifier};\n//# sourceMappingURL=value-notifier.js.map\n","import{ContextRequestEvent as t}from\"../context-request-event.js\";import{ValueNotifier as s}from\"../value-notifier.js\";\n/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */class e extends Event{constructor(t,s){super(\"context-provider\",{bubbles:!0,composed:!0}),this.context=t,this.contextTarget=s}}class i extends s{constructor(s,e,i){super(void 0!==e.context?e.initialValue:i),this.onContextRequest=t=>{if(t.context!==this.context)return;const s=t.contextTarget??t.composedPath()[0];s!==this.host&&(t.stopPropagation(),this.addCallback(t.callback,s,t.subscribe))},this.onProviderRequest=s=>{if(s.context!==this.context)return;if((s.contextTarget??s.composedPath()[0])===this.host)return;const e=new Set;for(const[s,{consumerHost:i}]of this.subscriptions)e.has(s)||(e.add(s),i.dispatchEvent(new t(this.context,i,s,!0)));s.stopPropagation()},this.host=s,void 0!==e.context?this.context=e.context:this.context=e,this.attachListeners(),this.host.addController?.(this)}attachListeners(){this.host.addEventListener(\"context-request\",this.onContextRequest),this.host.addEventListener(\"context-provider\",this.onProviderRequest)}hostConnected(){this.host.dispatchEvent(new e(this.context,this.host))}}export{i as ContextProvider,e as ContextProviderEvent};\n//# sourceMappingURL=context-provider.js.map\n","import { FlexRender, flexRender } from \"./flexRender.js\";\nimport { TableController } from \"./TableController.js\";\nimport { createColumnHelper } from \"@tanstack/table-core\";\nimport { ContextConsumer, ContextProvider, createContext } from \"@lit/context\";\n\n//#region src/createTableHook.ts\n/**\n* Creates a custom table hook with pre-bound components for composition.\n*\n* This is the table equivalent of TanStack Form's `createFormHook`. It allows you to:\n* - Define features, row models, and default options once, shared across all tables\n* - Register reusable table, cell, and header components\n* - Access table/cell/header instances via `@lit/context` in those components\n* - Get a `useAppTable` hook that returns an extended table with App wrapper functions\n* - Get a `createAppColumnHelper` function pre-bound to your features\n*\n* @example\n* ```ts\n* // hooks/table.ts\n* export const {\n* createAppColumnHelper,\n* useAppTable,\n* useTableContext,\n* useCellContext,\n* useHeaderContext,\n* } = createTableHook({\n* features: tableFeatures({\n* rowPaginationFeature,\n* rowSortingFeature,\n* columnFilteringFeature,\n* paginatedRowModel: createPaginatedRowModel(),\n* sortedRowModel: createSortedRowModel(),\n* filteredRowModel: createFilteredRowModel(),\n* sortFns,\n* filterFns,\n* }),\n* tableComponents: { PaginationControls, RowCount },\n* cellComponents: { TextCell, NumberCell },\n* headerComponents: { SortIndicator, ColumnFilter },\n* })\n*\n* // Create column helper with TFeatures already bound\n* const columnHelper = createAppColumnHelper<Person>()\n*\n* // my-table.ts\n* @customElement('my-table')\n* class MyTable extends LitElement {\n* private appTable = useAppTable(this, {\n* columns,\n* data: this.data,\n* })\n*\n* protected render() {\n* const table = this.appTable.table()\n*\n* return html`\n* <table>\n* <thead>\n* ${repeat(table.getHeaderGroups(), (hg) => hg.id, (hg) => html`\n* <tr>\n* ${hg.headers.map((h) => table.AppHeader(h, (header) => html`\n* <th>${header.FlexRender()}</th>\n* `))}\n* </tr>\n* `)}\n* </thead>\n* <tbody>\n* ${table.getRowModel().rows.map((row) => html`\n* <tr>\n* ${row.getAllCells().map((c) => table.AppCell(c, (cell) => html`\n* <td>${cell.FlexRender()}</td>\n* `))}\n* </tr>\n* `)}\n* </tbody>\n* </table>\n* `\n* }\n* }\n* ```\n*/\nfunction createTableHook({ tableComponents, cellComponents, headerComponents, ...defaultTableOptions }) {\n\tconst tableContext = createContext(Symbol(\"tanstack-table\"));\n\tconst cellContext = createContext(Symbol(\"tanstack-cell\"));\n\tconst headerContext = createContext(Symbol(\"tanstack-header\"));\n\t/**\n\t* Create a column helper pre-bound to the features and components configured in this table hook.\n\t* The cell, header, and footer contexts include pre-bound components (e.g., `cell.TextCell`).\n\t* @example\n\t* ```ts\n\t* const columnHelper = createAppColumnHelper<Person>()\n\t*\n\t* const columns = [\n\t* columnHelper.accessor('firstName', {\n\t* header: 'First Name',\n\t* cell: ({ cell }) => cell.FlexRender(), // cell has pre-bound components!\n\t* }),\n\t* columnHelper.accessor('age', {\n\t* header: 'Age',\n\t* cell: ({ cell }) => cell.NumberCell(),\n\t* }),\n\t* ]\n\t* ```\n\t*/\n\tfunction createAppColumnHelper() {\n\t\treturn createColumnHelper();\n\t}\n\t/**\n\t* Access the table instance from within a custom element that is a descendant\n\t* of the element using `useAppTable`.\n\t* Uses `@lit/context` ContextConsumer to retrieve the table from the nearest ancestor provider.\n\t* TFeatures is already known from the createTableHook call.\n\t*\n\t* @example\n\t* ```ts\n\t* @customElement('pagination-controls')\n\t* class PaginationControls extends LitElement {\n\t* private _table = useTableContext(this)\n\t*\n\t* protected render() {\n\t* const table = this._table.value\n\t* if (!table) return html``\n\t* return html`\n\t* <button @click=${() => table.previousPage()}>Prev</button>\n\t* <button @click=${() => table.nextPage()}>Next</button>\n\t* `\n\t* }\n\t* }\n\t* ```\n\t*/\n\tfunction useTableContext(host) {\n\t\treturn new ContextConsumer(host, {\n\t\t\tcontext: tableContext,\n\t\t\tsubscribe: true\n\t\t});\n\t}\n\t/**\n\t* Access the cell instance from within a custom element that is a descendant\n\t* of an element providing cell context.\n\t* Uses `@lit/context` ContextConsumer to retrieve the cell.\n\t* TFeatures is already known from the createTableHook call.\n\t*\n\t* @example\n\t* ```ts\n\t* @customElement('text-cell')\n\t* class TextCell extends LitElement {\n\t* private _cell = useCellContext(this)\n\t*\n\t* protected render() {\n\t* const cell = this._cell.value\n\t* if (!cell) return html``\n\t* return html`<span>${cell.getValue()}</span>`\n\t* }\n\t* }\n\t* ```\n\t*/\n\tfunction useCellContext(host) {\n\t\treturn new ContextConsumer(host, {\n\t\t\tcontext: cellContext,\n\t\t\tsubscribe: true\n\t\t});\n\t}\n\t/**\n\t* Access the header instance from within a custom element that is a descendant\n\t* of an element providing header context.\n\t* Uses `@lit/context` ContextConsumer to retrieve the header.\n\t* TFeatures is already known from the createTableHook call.\n\t*\n\t* @example\n\t* ```ts\n\t* @customElement('sort-indicator')\n\t* class SortIndicator extends LitElement {\n\t* private _header = useHeaderContext(this)\n\t*\n\t* protected render() {\n\t* const header = this._header.value\n\t* if (!header) return html``\n\t* const sorted = header.column.getIsSorted()\n\t* return html`${sorted === 'asc' ? '🔼' : sorted === 'desc' ? '🔽' : ''}`\n\t* }\n\t* }\n\t* ```\n\t*/\n\tfunction useHeaderContext(host) {\n\t\treturn new ContextConsumer(host, {\n\t\t\tcontext: headerContext,\n\t\t\tsubscribe: true\n\t\t});\n\t}\n\t/**\n\t* Enhanced table hook that returns a controller-like object with a `table()` method.\n\t* The returned table has App wrapper functions and pre-bound tableComponents\n\t* attached directly to the table object.\n\t*\n\t* Default options from createTableHook are automatically merged with\n\t* the options passed here. Options passed here take precedence.\n\t*\n\t* TFeatures is already known from the createTableHook call; TData is inferred from the data prop.\n\t*\n\t* @example\n\t* ```ts\n\t* @customElement('my-table')\n\t* class MyTable extends LitElement {\n\t* private appTable = useAppTable(this, {\n\t* columns,\n\t* data: this.data,\n\t* })\n\t*\n\t* protected render() {\n\t* const table = this.appTable.table()\n\t* return html`...`\n\t* }\n\t* }\n\t* ```\n\t*/\n\tfunction useAppTable(host, tableOptions, selector) {\n\t\tconst controller = new TableController(host);\n\t\tconst provider = new ContextProvider(host, { context: tableContext });\n\t\treturn { table() {\n\t\t\tconst mergedOptions = {\n\t\t\t\t...defaultTableOptions,\n\t\t\t\t...tableOptions\n\t\t\t};\n\t\t\tconst table = controller.table(mergedOptions, selector);\n\t\t\tprovider.setValue(table);\n\t\t\tfunction AppCell(cell, renderFn) {\n\t\t\t\tconst cellFlexRender = () => FlexRender({ cell });\n\t\t\t\tconst boundCellComponents = {};\n\t\t\t\tfor (const [key, fn] of Object.entries(cellComponents ?? {})) boundCellComponents[key] = () => fn(cell);\n\t\t\t\treturn renderFn(Object.assign(cell, {\n\t\t\t\t\tFlexRender: cellFlexRender,\n\t\t\t\t\t...boundCellComponents\n\t\t\t\t}));\n\t\t\t}\n\t\t\tfunction AppHeader(header, renderFn) {\n\t\t\t\tconst headerFlexRender = () => flexRender(header.column.columnDef.header, header.getContext());\n\t\t\t\tconst boundHeaderComponents = {};\n\t\t\t\tfor (const [key, fn] of Object.entries(headerComponents ?? {})) boundHeaderComponents[key] = () => fn(header);\n\t\t\t\treturn renderFn(Object.assign(header, {\n\t\t\t\t\tFlexRender: headerFlexRender,\n\t\t\t\t\t...boundHeaderComponents\n\t\t\t\t}));\n\t\t\t}\n\t\t\tfunction AppFooter(header, renderFn) {\n\t\t\t\tconst footerFlexRender = () => flexRender(header.column.columnDef.footer, header.getContext());\n\t\t\t\tconst boundFooterComponents = {};\n\t\t\t\tfor (const [key, fn] of Object.entries(headerComponents ?? {})) boundFooterComponents[key] = () => fn(header);\n\t\t\t\treturn renderFn(Object.assign(header, {\n\t\t\t\t\tFlexRender: footerFlexRender,\n\t\t\t\t\t...boundFooterComponents\n\t\t\t\t}));\n\t\t\t}\n\t\t\treturn Object.assign(table, {\n\t\t\t\tAppCell,\n\t\t\t\tAppHeader,\n\t\t\t\tAppFooter,\n\t\t\t\tFlexRender,\n\t\t\t\t...tableComponents ?? {}\n\t\t\t});\n\t\t} };\n\t}\n\treturn {\n\t\tappFeatures: defaultTableOptions.features,\n\t\tcreateAppColumnHelper,\n\t\tuseAppTable,\n\t\tuseTableContext,\n\t\tuseCellContext,\n\t\tuseHeaderContext\n\t};\n}\n\n//#endregion\nexport { createTableHook };","import { FlexRender, flexRender } from \"./flexRender.js\";\nimport { SubscribeDirective, subscribe } from \"./subscribe-directive.js\";\nimport { TableController } from \"./TableController.js\";\nimport { createTableHook } from \"./createTableHook.js\";\n\nexport * from \"@tanstack/table-core\"\n\nexport { FlexRender, SubscribeDirective, TableController, createTableHook, flexRender, subscribe };","//#region src/remove-accents.ts\nconst characterMap = {\n\tÀ: \"A\",\n\tÁ: \"A\",\n\tÂ: \"A\",\n\tÃ: \"A\",\n\tÄ: \"A\",\n\tÅ: \"A\",\n\tẤ: \"A\",\n\tẮ: \"A\",\n\tẲ: \"A\",\n\tẴ: \"A\",\n\tẶ: \"A\",\n\tÆ: \"AE\",\n\tẦ: \"A\",\n\tẰ: \"A\",\n\tȂ: \"A\",\n\tÇ: \"C\",\n\tḈ: \"C\",\n\tÈ: \"E\",\n\tÉ: \"E\",\n\tÊ: \"E\",\n\tË: \"E\",\n\tẾ: \"E\",\n\tḖ: \"E\",\n\tỀ: \"E\",\n\tḔ: \"E\",\n\tḜ: \"E\",\n\tȆ: \"E\",\n\tÌ: \"I\",\n\tÍ: \"I\",\n\tÎ: \"I\",\n\tÏ: \"I\",\n\tḮ: \"I\",\n\tȊ: \"I\",\n\tÐ: \"D\",\n\tÑ: \"N\",\n\tÒ: \"O\",\n\tÓ: \"O\",\n\tÔ: \"O\",\n\tÕ: \"O\",\n\tÖ: \"O\",\n\tØ: \"O\",\n\tỐ: \"O\",\n\tṌ: \"O\",\n\tṒ: \"O\",\n\tȎ: \"O\",\n\tÙ: \"U\",\n\tÚ: \"U\",\n\tÛ: \"U\",\n\tÜ: \"U\",\n\tÝ: \"Y\",\n\tà: \"a\",\n\tá: \"a\",\n\tâ: \"a\",\n\tã: \"a\",\n\tä: \"a\",\n\tå: \"a\",\n\tấ: \"a\",\n\tắ: \"a\",\n\tẳ: \"a\",\n\tẵ: \"a\",\n\tặ: \"a\",\n\tæ: \"ae\",\n\tầ: \"a\",\n\tằ: \"a\",\n\tȃ: \"a\",\n\tç: \"c\",\n\tḉ: \"c\",\n\tè: \"e\",\n\té: \"e\",\n\tê: \"e\",\n\të: \"e\",\n\tế: \"e\",\n\tḗ: \"e\",\n\tề: \"e\",\n\tḕ: \"e\",\n\tḝ: \"e\",\n\tȇ: \"e\",\n\tì: \"i\",\n\tí: \"i\",\n\tî: \"i\",\n\tï: \"i\",\n\tḯ: \"i\",\n\tȋ: \"i\",\n\tð: \"d\",\n\tñ: \"n\",\n\tò: \"o\",\n\tó: \"o\",\n\tô: \"o\",\n\tõ: \"o\",\n\tö: \"o\",\n\tø: \"o\",\n\tố: \"o\",\n\tṍ: \"o\",\n\tṓ: \"o\",\n\tȏ: \"o\",\n\tù: \"u\",\n\tú: \"u\",\n\tû: \"u\",\n\tü: \"u\",\n\tý: \"y\",\n\tÿ: \"y\",\n\tĀ: \"A\",\n\tā: \"a\",\n\tĂ: \"A\",\n\tă: \"a\",\n\tĄ: \"A\",\n\tą: \"a\",\n\tĆ: \"C\",\n\tć: \"c\",\n\tĈ: \"C\",\n\tĉ: \"c\",\n\tĊ: \"C\",\n\tċ: \"c\",\n\tČ: \"C\",\n\tč: \"c\",\n\tC̆: \"C\",\n\tc̆: \"c\",\n\tĎ: \"D\",\n\tď: \"d\",\n\tĐ: \"D\",\n\tđ: \"d\",\n\tĒ: \"E\",\n\tē: \"e\",\n\tĔ: \"E\",\n\tĕ: \"e\",\n\tĖ: \"E\",\n\tė: \"e\",\n\tĘ: \"E\",\n\tę: \"e\",\n\tĚ: \"E\",\n\tě: \"e\",\n\tĜ: \"G\",\n\tǴ: \"G\",\n\tĝ: \"g\",\n\tǵ: \"g\",\n\tĞ: \"G\",\n\tğ: \"g\",\n\tĠ: \"G\",\n\tġ: \"g\",\n\tĢ: \"G\",\n\tģ: \"g\",\n\tĤ: \"H\",\n\tĥ: \"h\",\n\tĦ: \"H\",\n\tħ: \"h\",\n\tḪ: \"H\",\n\tḫ: \"h\",\n\tĨ: \"I\",\n\tĩ: \"i\",\n\tĪ: \"I\",\n\tī: \"i\",\n\tĬ: \"I\",\n\tĭ: \"i\",\n\tĮ: \"I\",\n\tį: \"i\",\n\tİ: \"I\",\n\tı: \"i\",\n\tIJ: \"IJ\",\n\tij: \"ij\",\n\tĴ: \"J\",\n\tĵ: \"j\",\n\tĶ: \"K\",\n\tķ: \"k\",\n\tḰ: \"K\",\n\tḱ: \"k\",\n\tK̆: \"K\",\n\tk̆: \"k\",\n\tĹ: \"L\",\n\tĺ: \"l\",\n\tĻ: \"L\",\n\tļ: \"l\",\n\tĽ: \"L\",\n\tľ: \"l\",\n\tĿ: \"L\",\n\tŀ: \"l\",\n\tŁ: \"l\",\n\tł: \"l\",\n\tḾ: \"M\",\n\tḿ: \"m\",\n\tM̆: \"M\",\n\tm̆: \"m\",\n\tŃ: \"N\",\n\tń: \"n\",\n\tŅ: \"N\",\n\tņ: \"n\",\n\tŇ: \"N\",\n\tň: \"n\",\n\tʼn: \"n\",\n\tN̆: \"N\",\n\tn̆: \"n\",\n\tŌ: \"O\",\n\tō: \"o\",\n\tŎ: \"O\",\n\tŏ: \"o\",\n\tŐ: \"O\",\n\tő: \"o\",\n\tŒ: \"OE\",\n\tœ: \"oe\",\n\tP̆: \"P\",\n\tp̆: \"p\",\n\tŔ: \"R\",\n\tŕ: \"r\",\n\tŖ: \"R\",\n\tŗ: \"r\",\n\tŘ: \"R\",\n\tř: \"r\",\n\tR̆: \"R\",\n\tr̆: \"r\",\n\tȒ: \"R\",\n\tȓ: \"r\",\n\tŚ: \"S\",\n\tś: \"s\",\n\tŜ: \"S\",\n\tŝ: \"s\",\n\tŞ: \"S\",\n\tȘ: \"S\",\n\tș: \"s\",\n\tş: \"s\",\n\tŠ: \"S\",\n\tš: \"s\",\n\tŢ: \"T\",\n\tţ: \"t\",\n\tț: \"t\",\n\tȚ: \"T\",\n\tŤ: \"T\",\n\tť: \"t\",\n\tŦ: \"T\",\n\tŧ: \"t\",\n\tT̆: \"T\",\n\tt̆: \"t\",\n\tŨ: \"U\",\n\tũ: \"u\",\n\tŪ: \"U\",\n\tū: \"u\",\n\tŬ: \"U\",\n\tŭ: \"u\",\n\tŮ: \"U\",\n\tů: \"u\",\n\tŰ: \"U\",\n\tű: \"u\",\n\tŲ: \"U\",\n\tų: \"u\",\n\tȖ: \"U\",\n\tȗ: \"u\",\n\tV̆: \"V\",\n\tv̆: \"v\",\n\tŴ: \"W\",\n\tŵ: \"w\",\n\tẂ: \"W\",\n\tẃ: \"w\",\n\tX̆: \"X\",\n\tx̆: \"x\",\n\tŶ: \"Y\",\n\tŷ: \"y\",\n\tŸ: \"Y\",\n\tY̆: \"Y\",\n\ty̆: \"y\",\n\tŹ: \"Z\",\n\tź: \"z\",\n\tŻ: \"Z\",\n\tż: \"z\",\n\tŽ: \"Z\",\n\tž: \"z\",\n\tſ: \"s\",\n\tƒ: \"f\",\n\tƠ: \"O\",\n\tơ: \"o\",\n\tƯ: \"U\",\n\tư: \"u\",\n\tǍ: \"A\",\n\tǎ: \"a\",\n\tǏ: \"I\",\n\tǐ: \"i\",\n\tǑ: \"O\",\n\tǒ: \"o\",\n\tǓ: \"U\",\n\tǔ: \"u\",\n\tǕ: \"U\",\n\tǖ: \"u\",\n\tǗ: \"U\",\n\tǘ: \"u\",\n\tǙ: \"U\",\n\tǚ: \"u\",\n\tǛ: \"U\",\n\tǜ: \"u\",\n\tỨ: \"U\",\n\tứ: \"u\",\n\tṸ: \"U\",\n\tṹ: \"u\",\n\tǺ: \"A\",\n\tǻ: \"a\",\n\tǼ: \"AE\",\n\tǽ: \"ae\",\n\tǾ: \"O\",\n\tǿ: \"o\",\n\tÞ: \"TH\",\n\tþ: \"th\",\n\tṔ: \"P\",\n\tṕ: \"p\",\n\tṤ: \"S\",\n\tṥ: \"s\",\n\tX́: \"X\",\n\tx́: \"x\",\n\tЃ: \"Г\",\n\tѓ: \"г\",\n\tЌ: \"К\",\n\tќ: \"к\",\n\tA̋: \"A\",\n\ta̋: \"a\",\n\tE̋: \"E\",\n\te̋: \"e\",\n\tI̋: \"I\",\n\ti̋: \"i\",\n\tǸ: \"N\",\n\tǹ: \"n\",\n\tỒ: \"O\",\n\tồ: \"o\",\n\tṐ: \"O\",\n\tṑ: \"o\",\n\tỪ: \"U\",\n\từ: \"u\",\n\tẀ: \"W\",\n\tẁ: \"w\",\n\tỲ: \"Y\",\n\tỳ: \"y\",\n\tȀ: \"A\",\n\tȁ: \"a\",\n\tȄ: \"E\",\n\tȅ: \"e\",\n\tȈ: \"I\",\n\tȉ: \"i\",\n\tȌ: \"O\",\n\tȍ: \"o\",\n\tȐ: \"R\",\n\tȑ: \"r\",\n\tȔ: \"U\",\n\tȕ: \"u\",\n\tB̌: \"B\",\n\tb̌: \"b\",\n\tČ̣: \"C\",\n\tč̣: \"c\",\n\tÊ̌: \"E\",\n\tê̌: \"e\",\n\tF̌: \"F\",\n\tf̌: \"f\",\n\tǦ: \"G\",\n\tǧ: \"g\",\n\tȞ: \"H\",\n\tȟ: \"h\",\n\tJ̌: \"J\",\n\tǰ: \"j\",\n\tǨ: \"K\",\n\tǩ: \"k\",\n\tM̌: \"M\",\n\tm̌: \"m\",\n\tP̌: \"P\",\n\tp̌: \"p\",\n\tQ̌: \"Q\",\n\tq̌: \"q\",\n\tŘ̩: \"R\",\n\tř̩: \"r\",\n\tṦ: \"S\",\n\tṧ: \"s\",\n\tV̌: \"V\",\n\tv̌: \"v\",\n\tW̌: \"W\",\n\tw̌: \"w\",\n\tX̌: \"X\",\n\tx̌: \"x\",\n\tY̌: \"Y\",\n\ty̌: \"y\",\n\tA̧: \"A\",\n\ta̧: \"a\",\n\tB̧: \"B\",\n\tb̧: \"b\",\n\tḐ: \"D\",\n\tḑ: \"d\",\n\tȨ: \"E\",\n\tȩ: \"e\",\n\tƐ̧: \"E\",\n\tɛ̧: \"e\",\n\tḨ: \"H\",\n\tḩ: \"h\",\n\tI̧: \"I\",\n\ti̧: \"i\",\n\tƗ̧: \"I\",\n\tɨ̧: \"i\",\n\tM̧: \"M\",\n\tm̧: \"m\",\n\tO̧: \"O\",\n\to̧: \"o\",\n\tQ̧: \"Q\",\n\tq̧: \"q\",\n\tU̧: \"U\",\n\tu̧: \"u\",\n\tX̧: \"X\",\n\tx̧: \"x\",\n\tZ̧: \"Z\",\n\tz̧: \"z\"\n};\nconst chars = Object.keys(characterMap).join(\"|\");\nconst allAccents = new RegExp(chars, \"g\");\nfunction removeAccents(str) {\n\treturn str.replace(allAccents, (match) => {\n\t\treturn characterMap[match];\n\t});\n}\n\n//#endregion\nexport { removeAccents };","import { removeAccents } from \"./remove-accents.js\";\n\n//#region src/index.ts\n/**\n* @name match-sorter\n* @license MIT license.\n* @copyright (c) 2099 Kent C. Dodds\n* @author Kent C. Dodds <me@kentcdodds.com> (https://kentcdodds.com)\n*/\nconst rankings = {\n\tCASE_SENSITIVE_EQUAL: 7,\n\tEQUAL: 6,\n\tSTARTS_WITH: 5,\n\tWORD_STARTS_WITH: 4,\n\tCONTAINS: 3,\n\tACRONYM: 2,\n\tMATCHES: 1,\n\tNO_MATCH: 0\n};\n/**\n* Gets the highest ranking value for the given item based on its values for the given keys\n* @param {*} item - the item to rank\n* @param {String} value - the value to rank against\n* @param {Object} options - options to control the ranking\n* @return {{rank: Number, accessorIndex: Number, accessorThreshold: Number}} - the highest ranking\n*/\nfunction rankItem(item, value, options) {\n\toptions = options || {};\n\toptions.threshold = options.threshold ?? rankings.MATCHES;\n\tif (!options.accessors) {\n\t\tconst rank = getMatchRanking(item, value, options);\n\t\treturn {\n\t\t\trankedValue: item,\n\t\t\trank,\n\t\t\taccessorIndex: -1,\n\t\t\taccessorThreshold: options.threshold,\n\t\t\tpassed: rank >= options.threshold\n\t\t};\n\t}\n\tconst valuesToRank = getAllValuesToRank(item, options.accessors);\n\tconst rankingInfo = {\n\t\trankedValue: item,\n\t\trank: rankings.NO_MATCH,\n\t\taccessorIndex: -1,\n\t\taccessorThreshold: options.threshold,\n\t\tpassed: false\n\t};\n\tfor (let i = 0; i < valuesToRank.length; i++) {\n\t\tconst rankValue = valuesToRank[i];\n\t\tlet newRank = getMatchRanking(rankValue.itemValue, value, options);\n\t\tconst { minRanking, maxRanking, threshold = options.threshold } = rankValue.attributes;\n\t\tif (newRank < minRanking && newRank >= rankings.MATCHES) newRank = minRanking;\n\t\telse if (newRank > maxRanking) newRank = maxRanking;\n\t\tnewRank = Math.min(newRank, maxRanking);\n\t\tif (newRank >= threshold && newRank > rankingInfo.rank) {\n\t\t\trankingInfo.rank = newRank;\n\t\t\trankingInfo.passed = true;\n\t\t\trankingInfo.accessorIndex = i;\n\t\t\trankingInfo.accessorThreshold = threshold;\n\t\t\trankingInfo.rankedValue = rankValue.itemValue;\n\t\t}\n\t}\n\treturn rankingInfo;\n}\n/**\n* Gives a rankings score based on how well the two strings match.\n* @param {String} testString - the string to test against\n* @param {String} stringToRank - the string to rank\n* @param {Object} options - options for the match (like keepDiacritics for comparison)\n* @returns {Number} the ranking for how well stringToRank matches testString\n*/\nfunction getMatchRanking(testString, stringToRank, options) {\n\ttestString = prepareValueForComparison(testString, options);\n\tstringToRank = prepareValueForComparison(stringToRank, options);\n\tif (stringToRank.length > testString.length) return rankings.NO_MATCH;\n\tif (testString === stringToRank) return rankings.CASE_SENSITIVE_EQUAL;\n\ttestString = testString.toLowerCase();\n\tstringToRank = stringToRank.toLowerCase();\n\tif (testString === stringToRank) return rankings.EQUAL;\n\tif (testString.startsWith(stringToRank)) return rankings.STARTS_WITH;\n\tif (testString.includes(` ${stringToRank}`)) return rankings.WORD_STARTS_WITH;\n\tif (testString.includes(stringToRank)) return rankings.CONTAINS;\n\telse if (stringToRank.length === 1) return rankings.NO_MATCH;\n\tif (getAcronym(testString).includes(stringToRank)) return rankings.ACRONYM;\n\treturn getClosenessRanking(testString, stringToRank);\n}\n/**\n* Generates an acronym for a string.\n*\n* @param {String} string the string for which to produce the acronym\n* @returns {String} the acronym\n*/\nfunction getAcronym(string) {\n\tlet acronym = \"\";\n\tstring.split(\" \").forEach((wordInString) => {\n\t\twordInString.split(\"-\").forEach((splitByHyphenWord) => {\n\t\t\tacronym += splitByHyphenWord.substr(0, 1);\n\t\t});\n\t});\n\treturn acronym;\n}\n/**\n* Returns a score based on how spread apart the\n* characters from the stringToRank are within the testString.\n* A number close to rankings.MATCHES represents a loose match. A number close\n* to rankings.MATCHES + 1 represents a tighter match.\n* @param {String} testString - the string to test against\n* @param {String} stringToRank - the string to rank\n* @returns {Number} the number between rankings.MATCHES and\n* rankings.MATCHES + 1 for how well stringToRank matches testString\n*/\nfunction getClosenessRanking(testString, stringToRank) {\n\tlet matchingInOrderCharCount = 0;\n\tlet charNumber = 0;\n\tfunction findMatchingCharacter(matchChar, string, index) {\n\t\tfor (let j = index, J = string.length; j < J; j++) if (string[j] === matchChar) {\n\t\t\tmatchingInOrderCharCount += 1;\n\t\t\treturn j + 1;\n\t\t}\n\t\treturn -1;\n\t}\n\tfunction getRanking(spread) {\n\t\tconst spreadPercentage = 1 / spread;\n\t\tconst inOrderPercentage = matchingInOrderCharCount / stringToRank.length;\n\t\treturn rankings.MATCHES + inOrderPercentage * spreadPercentage;\n\t}\n\tconst firstIndex = findMatchingCharacter(stringToRank[0], testString, 0);\n\tif (firstIndex < 0) return rankings.NO_MATCH;\n\tcharNumber = firstIndex;\n\tfor (let i = 1, I = stringToRank.length; i < I; i++) {\n\t\tconst matchChar = stringToRank[i];\n\t\tcharNumber = findMatchingCharacter(matchChar, testString, charNumber);\n\t\tif (!(charNumber > -1)) return rankings.NO_MATCH;\n\t}\n\treturn getRanking(charNumber - firstIndex);\n}\n/**\n* Sorts items that have a rank, index, and accessorIndex\n* @param {Object} a - the first item to sort\n* @param {Object} b - the second item to sort\n* @return {Number} -1 if a should come first, 1 if b should come first, 0 if equal\n*/\nfunction compareItems(a, b) {\n\treturn a.rank === b.rank ? 0 : a.rank > b.rank ? -1 : 1;\n}\n/**\n* Prepares value for comparison by stringifying it, removing diacritics (if specified)\n* @param {String} value - the value to clean\n* @param {Object} options - {keepDiacritics: whether to remove diacritics}\n* @return {String} the prepared value\n*/\nfunction prepareValueForComparison(value, { keepDiacritics }) {\n\tvalue = `${value}`;\n\tif (!keepDiacritics) value = removeAccents(value);\n\treturn value;\n}\n/**\n* Gets value for key in item at arbitrarily nested keypath\n* @param {Object} item - the item\n* @param {Object|Function} key - the potentially nested keypath or property callback\n* @return {Array} - an array containing the value(s) at the nested keypath\n*/\nfunction getItemValues(item, accessor) {\n\tlet accessorFn = accessor;\n\tif (typeof accessor === \"object\") accessorFn = accessor.accessor;\n\tconst value = accessorFn(item);\n\tif (value == null) return [];\n\tif (Array.isArray(value)) return value;\n\treturn [String(value)];\n}\n/**\n* Gets all the values for the given keys in the given item and returns an array of those values\n* @param item - the item from which the values will be retrieved\n* @param keys - the keys to use to retrieve the values\n* @return objects with {itemValue, attributes}\n*/\nfunction getAllValuesToRank(item, accessors) {\n\tconst allValues = [];\n\tfor (let j = 0, J = accessors.length; j < J; j++) {\n\t\tconst accessor = accessors[j];\n\t\tconst attributes = getAccessorAttributes(accessor);\n\t\tconst itemValues = getItemValues(item, accessor);\n\t\tfor (let i = 0, I = itemValues.length; i < I; i++) allValues.push({\n\t\t\titemValue: itemValues[i],\n\t\t\tattributes\n\t\t});\n\t}\n\treturn allValues;\n}\nconst defaultKeyAttributes = {\n\tmaxRanking: Infinity,\n\tminRanking: -Infinity\n};\n/**\n* Gets all the attributes for the given accessor\n* @param accessor - the accessor from which the attributes will be retrieved\n* @return object containing the accessor's attributes\n*/\nfunction getAccessorAttributes(accessor) {\n\tif (typeof accessor === \"function\") return defaultKeyAttributes;\n\treturn {\n\t\t...defaultKeyAttributes,\n\t\t...accessor\n\t};\n}\n\n//#endregion\nexport { compareItems, rankItem, rankings };","// ── <sken-datatable> — framework-ready data table (M1 shell) ─────────\n//\n// M1 status: ALPHA. The component renders a table from `rows` + `columns`\n// props. Sorting, filtering, and pagination arrive in M1.x/M2 — see the\n// research report at /tmp/sken-datatable-research.md and the roadmap.\n//\n// Substrate: `@tanstack/lit-table` (Lit ReactiveController + headless\n// TanStack Table). This primitive owns ONLY the visual layer; the consumer\n// owns data fetching, sorting state, pagination state, server-side work.\n// Nord DS is the reference architecture (see §1 of the research report).\n//\n// API contract (M1):\n// - `rows`: Array<RowData> — JS property, NOT attribute (arrays can't be\n// serialized as HTML attributes without lossy JSON round-trips).\n// - `columns`: Array<ColumnDef> — JS property, same reason.\n// - `getRowId`: required for row identity (selection, expansion, server-side\n// filtering all depend on it). We throw a dev-mode console error if\n// missing — but DON'T throw in prod (M1 doesn't have a state machine that\n// requires it, only M1.x selection/expansion will).\n// - `loading`: boolean — shows a skeleton overlay.\n// - `empty`: string | undefined — text shown when rows is empty.\n// - Slot `empty` (optional): custom empty content. Overrides `empty` prop.\n//\n// Theme: tokens come from the light DOM via `var(--sken-*)`. CSS Custom\n// Properties cross the shadow boundary by spec — no adoptStyleSheets\n// bridge needed.\n\nimport {\n TableController,\n columnFilteringFeature,\n createFilteredRowModel,\n createPaginatedRowModel,\n createSortedRowModel,\n globalFilteringFeature,\n rowPaginationFeature,\n rowSortingFeature,\n tableFeatures,\n type ColumnDef,\n type RowData,\n type SortingState,\n type TableFeatures,\n} from '@tanstack/lit-table'\nimport { LitElement, css, html, nothing, type TemplateResult } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\n// Side-effect namespace import to defeat Rollup tree-shaking.\n// `@tanstack/table-core` declares \"sideEffects\": false, so a\n// direct named import + a void call is dead-code-eliminated\n// by Rollup. Importing the namespace forces Rollup to keep the\n// module in the bundle (the namespace binding is observable\n// to the bundler even if the named imports are not used). The\n// named import then resolves to the same function and is used\n// at the call site below.\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport { rankItem } from '@tanstack/match-sorter-utils'\nimport * as _tableCoreStaticNS from '@tanstack/table-core/static-functions'\n\n/**\n * Sken-specific column def. We re-export the relevant TanStack shape so\n * the contract doesn't leak `import type` to consumers.\n */\nexport type SkenColumnDef<TData extends RowData> = ColumnDef<TableFeatures, TData>\n\n/**\n * Options that are required at construction time but can be passed as\n * either a property (preferred) or constructor arg.\n */\nexport interface SkenDataTableOptions<TData extends RowData> {\n rows: TData[]\n columns: SkenColumnDef<TData>[]\n getRowId: (row: TData, index: number) => string\n loading?: boolean\n empty?: string\n}\n\n@customElement('sken-datatable')\nexport class SkenDataTable<TData extends RowData> extends LitElement {\n /**\n * The rows to display. JS property, NOT attribute.\n * @example el.rows = [{ id: 1, name: 'Alice' }]\n */\n @property({ attribute: false }) rows: TData[] = []\n\n /**\n * Column definitions. JS property, NOT attribute.\n * @example el.columns = [{ accessorKey: 'name', header: 'Name' }]\n */\n @property({ attribute: false }) columns: SkenColumnDef<TData>[] = []\n\n /**\n * Required for row identity. Pass a function that returns a stable\n * unique id per row.\n * @example el.getRowId = (row) => row.id\n */\n @property({ attribute: false }) getRowId: ((row: TData, index: number) => string) | undefined =\n undefined\n\n /** Shows a skeleton overlay when true. */\n @property({ reflect: true, type: Boolean }) loading = false\n\n /** Text shown when `rows` is empty. Use the `empty` slot for richer content. */\n @property() empty: string | undefined = undefined\n\n /**\n * Current sorting state. JS property, NOT attribute.\n * Pass `undefined` (or omit) for uncontrolled mode — the primitive\n * keeps the state internally and the table reflects clicks on\n * sortable headers. Pass an array for controlled mode — the consumer\n * owns the state and reacts to `sken-sort-change` events.\n */\n @property({ attribute: false }) sorting: SortingState | undefined = undefined\n\n /**\n * Current global filter value. JS property, NOT attribute.\n * Pass `undefined` (or omit) for uncontrolled mode (state is kept\n * inside the primitive). Pass a string for controlled mode.\n */\n @property({ attribute: false }) globalFilter: string | undefined = undefined\n\n /**\n * Placeholder for the auto-generated filter input. The primitive\n * renders a built-in `<input>` above the table when this is set\n * (default). Pass `false` to hide it (consumer renders their own via\n * the `filter` slot). Pass a string to use as placeholder.\n */\n @property() filterPlaceholder: string = 'Filter…'\n\n /**\n * Current pagination state. JS property, NOT attribute.\n * Pass `undefined` for uncontrolled mode (default pageSize = 10,\n * pageIndex = 0). Pass an object for controlled mode.\n */\n @property({ attribute: false }) pagination: { pageIndex: number; pageSize: number } | undefined =\n undefined\n\n /** Default page size when uncontrolled. Default: 10. */\n @property({ attribute: 'default-page-size', type: Number }) defaultPageSize: number = 10\n\n /**\n * Internal state: the TanStack table instance, owned by `TableController`.\n * Re-renders on any state change. We keep a private field instead of\n * recomputing per render to avoid re-allocating on every Lit update.\n */\n // Internal state for uncontrolled mode. When the consumer passes\n // `undefined` for `sorting` / `globalFilter` / `pagination`, we keep\n // the state here as plain fields. We trigger Lit re-renders\n // explicitly in the `on*Change` callbacks via `this.requestUpdate()`\n // (the change callback fires outside Lit's reactive context, so the\n // `@state` decorator doesn't pick it up across the `controller.table`\n // call boundary).\n #uncontrolledSorting: SortingState = []\n #uncontrolledGlobalFilter: string = ''\n #uncontrolledPagination: { pageIndex: number; pageSize: number } = {\n pageIndex: 0,\n pageSize: 10,\n }\n\n // The full feature set we use, built with the v9 `tableFeatures()`\n // factory. Per the v9 migration SKILL: each `create*RowModel`\n // factory is a sibling of its feature in the same object, not\n // nested under the feature key.\n #features = tableFeatures({\n rowSortingFeature,\n sortedRowModel: createSortedRowModel(),\n columnFilteringFeature,\n filteredRowModel: createFilteredRowModel(),\n globalFilteringFeature,\n rowPaginationFeature,\n paginatedRowModel: createPaginatedRowModel(),\n })\n\n // We initialise the TableController lazily on first connection. The\n // field-initializer approach breaks when the host element is created\n // via `document.createElement` in a non-Lit context (some test runners\n // do that), because `this.host` is undefined at field-init time.\n //\n // The `Features` type is computed from `tableFeatures({...})`'s\n // return type. We can't use `typeof this.#features` in a field\n // initializer (no `this` available), so the `as` cast on the\n // constructor call covers the same ground at the use site.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n #tableController: TableController<any, TData> | undefined = undefined\n\n #getTableController() {\n if (this.#tableController === undefined) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n this.#tableController = new TableController<any, TData>(this)\n }\n return this.#tableController\n }\n\n /**\n * Fuzzy global filter: ranks each row against the filter value\n * using `@tanstack/match-sorter-utils`. Returns true if the row\n * \"passes\" the rank threshold (any character sequence match).\n *\n * Note: `rankItem` ranks strings (or values returned by an\n * `accessors` fn), not plain objects — passing the row directly\n * coerces it to `\"[object Object]\"` and never matches. We flatten\n * the row to a space-joined string of its values, which is the\n * standard TanStack v8 + match-sorter-utils recipe (see the\n * TanStack docs: `globalFilterFn: (row, _id, value) =>\n * rankItem(Object.values(row.original).join(' '), value).passed`).\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n #fuzzyFilter = (row: any, _columnId: string, filterValue: unknown): boolean => {\n const flat = Object.values(row.original ?? {})\n .map((v) => (v === null || v === undefined ? '' : String(v)))\n .join(' ')\n const itemRank = rankItem(flat, String(filterValue ?? ''))\n return itemRank.passed\n }\n\n /**\n * Dev-mode warning if `getRowId` is missing. We don't throw in prod\n * because M1 doesn't need it; M1.x (selection/expansion) will.\n */\n #warnIfNoGetRowId(): void {\n if (this.getRowId === undefined && globalThis.console !== undefined) {\n globalThis.console.warn(\n '[sken-datatable] Missing `getRowId`. This is required in M1.x once ' +\n 'row selection, expansion, or server-side filtering are added. ' +\n 'See ADR-0006 §4 and the research report §1.',\n )\n }\n }\n\n override connectedCallback(): void {\n super.connectedCallback()\n this.#warnIfNoGetRowId()\n // Initialise uncontrolled pagination with the configured\n // `defaultPageSize`. Field initializers can't read `this` so we\n // do it here on first connection.\n if (this.#uncontrolledPagination.pageSize === 10 && this.defaultPageSize !== 10) {\n this.#uncontrolledPagination = {\n pageIndex: 0,\n pageSize: this.defaultPageSize,\n }\n }\n }\n\n override render(): TemplateResult {\n if (this.loading) {\n // Loading state. The primitive provides the container\n // (role=\"status\" + aria-busy=\"true\") and a styled slot for\n // the actual spinner. The datatable does NOT pull in the\n // <sken-icon> primitive itself — that's the consumer's job\n // (ADR-0011: the icon family is Sken-owned, but the\n // datatable is not the place to depend on it). The CSS\n // animation below uses ::slotted(sken-icon) so the consumer\n // can drop in <sken-icon name=\"spinner\"> and get the spin\n // for free.\n return html`\n <div class=\"loading\" role=\"status\" aria-busy=\"true\">\n <slot name=\"loading\"></slot>\n </div>\n `\n }\n\n if (this.rows.length === 0) {\n return this.#renderEmpty()\n }\n\n // Controlled vs uncontrolled pattern. The primitive ALWAYS\n // passes a fully-populated `state` object to TanStack. For\n // controlled slices, the value comes from the consumer's prop;\n // for uncontrolled slices, the value comes from the primitive's\n // State plumbing (v9 + Lit + TableController):\n //\n // For controlled slices (consumer provides a value), we pass\n // it in both `state` and `initialState` so the row model\n // reflects the consumer's value on the same render that\n // receives the new props.\n //\n // For uncontrolled slices, we pass `initialState` ONLY when\n // the slice is non-empty. The reason: in v9, including\n // `sorting: []` in `state` or `initialState` makes\n // `atoms.sorting.get()` return null and breaks the\n // `getSortedRowModel` pipeline. The safe path is to omit the\n // key entirely and let TanStack initialise the atom lazily\n // on the first state mutation (click on a sortable header).\n const state: Record<string, unknown> = {}\n const initialState: Record<string, unknown> = {}\n if (this.sorting !== undefined && this.sorting.length > 0) {\n state.sorting = this.sorting\n initialState.sorting = this.sorting\n }\n if (this.globalFilter !== undefined && this.globalFilter.length > 0) {\n state.globalFilter = this.globalFilter\n initialState.globalFilter = this.globalFilter\n }\n if (this.pagination !== undefined) {\n state.pagination = this.pagination\n initialState.pagination = this.pagination\n } else {\n // Pagination always has a default (pageIndex 0, pageSize\n // defaultPageSize). It's safe to seed unconditionally because\n // the pagination atom accepts an object — unlike sorting\n // which fails on an empty array.\n initialState.pagination = this.#uncontrolledPagination\n }\n\n // The `as` cast is required because TanStack's `TableOptions<TFeatures, TData>`\n // narrows TFeatures from the `features` field, but we pass the full\n // core + stock features object. Runtime is correct; the cast just\n // bypasses the over-strict feature inference.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const table = this.#getTableController().table({\n data: this.rows,\n columns: this.columns,\n getRowId: this.getRowId ?? ((_row, index) => String(index)),\n features: this.#features,\n globalFilterFn: this.#fuzzyFilter,\n state,\n initialState,\n onSortingChange: (updater: unknown) => {\n const current = this.sorting ?? this.#uncontrolledSorting\n const nextSorting =\n typeof updater === 'function'\n ? (updater as (old: SortingState) => SortingState)(current)\n : (updater as SortingState)\n if (this.sorting === undefined) {\n this.#uncontrolledSorting = nextSorting\n this.requestUpdate()\n }\n this.dispatchEvent(\n new CustomEvent<SortingState>('sken-sort-change', {\n detail: nextSorting,\n bubbles: true,\n composed: true,\n }),\n )\n },\n onGlobalFilterChange: (updater: unknown) => {\n const current = this.globalFilter ?? this.#uncontrolledGlobalFilter\n const nextFilter =\n typeof updater === 'function'\n ? (updater as (old: string) => string)(current)\n : (updater as string)\n if (this.globalFilter === undefined) {\n this.#uncontrolledGlobalFilter = nextFilter\n this.requestUpdate()\n }\n this.dispatchEvent(\n new CustomEvent<string>('sken-global-filter-change', {\n detail: nextFilter,\n bubbles: true,\n composed: true,\n }),\n )\n },\n onPaginationChange: (updater: unknown) => {\n const current = this.pagination ?? this.#uncontrolledPagination\n const next =\n typeof updater === 'function'\n ? (updater as (old: typeof current) => typeof current)(current)\n : (updater as typeof current)\n if (this.pagination === undefined) {\n this.#uncontrolledPagination = next\n this.requestUpdate()\n }\n this.dispatchEvent(\n new CustomEvent<typeof current>('sken-pagination-change', {\n detail: next,\n bubbles: true,\n composed: true,\n }),\n )\n },\n } as any)\n\n // TanStack's `TableController` deliberately defers the external `state`\n // → internal store sync to `hostUpdated()` (after Lit has patched the\n // DOM). That's the right move for React/Solid (the store commit is\n // async) but the wrong one for our render path: we read\n // `table.getRowModel()` here, and that read needs the sorted /\n // filtered / paginated model to be live *in this render* — not one\n // commit later. Without this, every controlled sort/filter/page\n // action lags a render and tests + the browser probe see the\n // pre-sync state. We re-publish the captured state before reading\n // the row model; the controller's own `hostUpdated` call later is a\n // safe no-op (the compare function is `===`, the values match).\n //\n // TanStack v9's `TableController.table_setOptions(..., { syncExternalState: false })`\n // defers the external `state` to internal store sync to\n // `hostUpdated()` (after Lit has patched the DOM). The render\n // reads `table.getRowModel()` with the OLD snapshot, so the\n // first render with `state.sorting = [{id, desc}]` does not\n // reflect the sort. Fix: call `table_publishExternalState` from\n // `@tanstack/table-core/static-functions` (subpath, not\n // re-exported from the main index) in `render()` right after\n // building the `table` and before the first `getHeaderGroups()`\n // / `getRowModel()`. The controller's own `hostUpdated` call\n // later is a safe no-op (the compare function is `===`, the\n // values match).\n //\n // **Tree-shake guard**: `@tanstack/table-core` declares\n // `\"sideEffects\": false` in its package.json. Rollup treats\n // every import from that package as pure, and `table_publishExternalState`\n // returns `void` — so an isolated expression-statement call is\n // tree-shaken away in the production bundle. The symptom is\n // silent: tests pass (happy-dom happens to flush in a way that\n // hides the lag), the bundle drops ~150 bytes, and the browser\n // stops reflecting controlled sort/filter/page. We defeat\n // the tree-shake by assigning the call's return value to a\n // module-level `Reflect`-style sink — Rollup treats\n // `Reflect.set` as side-effectful and keeps the call. The cast\n // through `any` covers the `TFeatures` mismatch (the public\n // type is open).\n // Use the namespace import (not the named one) to call the\n // function. The named import is still here for type-only\n // reasons, but the actual call goes through the namespace\n // binding — which Rollup cannot tree-shake because the\n // namespace import is a side-effect anchor (any other code\n // path that reads `_tableCoreStaticNS` would force the\n // module to stay; here the IIFE reads the namespace and so\n // the call survives the bundler).\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ;(_tableCoreStaticNS as any).table_publishExternalState(\n table as any,\n state,\n (a: unknown, b: unknown) => a === b,\n )\n\n return html`\n <div class=\"filter-bar\">\n <slot name=\"filter\">\n <input\n class=\"filter-input\"\n type=\"search\"\n placeholder=${this.filterPlaceholder}\n aria-label=\"Filter rows\"\n .value=${this.globalFilter ?? this.#uncontrolledGlobalFilter}\n @input=${(e: Event) => {\n const input = e.target as HTMLInputElement\n if (this.globalFilter === undefined) {\n this.#uncontrolledGlobalFilter = input.value\n this.requestUpdate()\n }\n this.dispatchEvent(\n new CustomEvent<string>('sken-global-filter-change', {\n detail: input.value,\n bubbles: true,\n composed: true,\n }),\n )\n }}\n />\n </slot>\n </div>\n <table>\n <thead>\n ${table.getHeaderGroups().map((headerGroup: unknown) => {\n const group = headerGroup as unknown as {\n id: string\n headers: ReadonlyArray<{\n id: string\n column: {\n id: string\n columnDef: { header?: unknown; enableSorting?: boolean }\n getCanSort: () => boolean\n getIsSorted: () => false | 'asc' | 'desc'\n getToggleSortingHandler: () => undefined | ((e: unknown) => void)\n }\n }>\n }\n return html`\n <tr>\n ${group.headers.map((header) => {\n const headerRenderable = header.column.columnDef.header\n const headerText =\n typeof headerRenderable === 'string' ? headerRenderable : header.column.id\n const canSort = header.column.getCanSort()\n const isSorted = header.column.getIsSorted()\n const sortIndicator = isSorted === 'asc' ? '▲' : isSorted === 'desc' ? '▼' : ''\n const handler = header.column.getToggleSortingHandler()\n return html`\n <th\n scope=\"col\"\n part=\"header-cell\"\n data-column-id=${header.column.id}\n class=${canSort ? 'sortable' : ''}\n aria-sort=${\n isSorted === 'asc'\n ? 'ascending'\n : isSorted === 'desc'\n ? 'descending'\n : 'none'\n }\n @click=${canSort && handler ? handler : null}\n >\n <span class=\"header-text\">${headerText}</span>\n ${\n canSort\n ? html`<span\n class=\"sort-indicator\"\n data-state=${isSorted || 'none'}\n aria-hidden=\"true\"\n >${sortIndicator}</span\n >`\n : nothing\n }\n </th>\n `\n })}\n </tr>\n `\n })}\n </thead>\n <tbody>\n ${table.getRowModel().rows.map((row: unknown) => {\n const r = row as unknown as {\n id: string\n getAllCells: () => ReadonlyArray<{\n id: string\n column: { id: string }\n getValue: () => unknown\n }>\n }\n return html`\n <tr part=\"row\" data-row-id=${r.id}>\n ${r.getAllCells().map((cell) => {\n const cellValue = cell.getValue()\n return html`\n <td part=\"cell\" data-column-id=${cell.column.id}>\n ${cellValue === null || cellValue === undefined ? nothing : String(cellValue)}\n </td>\n `\n })}\n </tr>\n `\n })}\n </tbody>\n </table>\n\n <div class=\"pagination-bar\" part=\"pagination\">\n <slot name=\"pagination\">\n ${(() => {\n const t = table as unknown as {\n state: { pagination: { pageIndex: number; pageSize: number } }\n getPageCount: () => number\n getCanPreviousPage: () => boolean\n getCanNextPage: () => boolean\n previousPage: () => void\n nextPage: () => void\n setPageIndex: (i: number) => void\n }\n const { pageIndex, pageSize } = t.state.pagination\n const pageCount = t.getPageCount()\n return html`\n <button\n type=\"button\"\n class=\"page-btn\"\n ?disabled=${!t.getCanPreviousPage()}\n @click=${() => t.previousPage()}\n aria-label=\"Previous page\"\n >\n ← Prev\n </button>\n <span class=\"page-info\"> Page ${pageIndex + 1} of ${Math.max(pageCount, 1)} </span>\n <button\n type=\"button\"\n class=\"page-btn\"\n ?disabled=${!t.getCanNextPage()}\n @click=${() => t.nextPage()}\n aria-label=\"Next page\"\n >\n Next →\n </button>\n <span class=\"page-size-info\">${pageSize} per page</span>\n `\n })()}\n </slot>\n </div>\n `\n }\n\n #renderEmpty(): TemplateResult {\n return html`\n <div class=\"empty\" role=\"status\">\n <slot name=\"empty\">${this.empty ?? 'No rows'}</slot>\n </div>\n `\n }\n\n static styles = css`\n :host {\n display: block;\n inline-size: 100%;\n font-family: var(--sken-family-sans);\n color: var(--sken-foreground);\n }\n\n table {\n inline-size: 100%;\n border-collapse: collapse;\n border: 1px solid var(--sken-border);\n border-radius: var(--sken-md);\n overflow: hidden;\n }\n\n thead {\n background: var(--sken-muted);\n }\n\n th,\n td {\n padding-block: var(--sken-2);\n padding-inline: var(--sken-3);\n text-align: start;\n border-block-end: 1px solid var(--sken-border);\n }\n\n th {\n font-weight: var(--sken-weight-semibold);\n color: var(--sken-foreground);\n }\n\n th.sortable {\n cursor: pointer;\n user-select: none;\n }\n\n th.sortable:hover {\n background: var(--sken-muted);\n }\n\n th .header-text {\n margin-inline-end: 0.25rem;\n }\n\n th .sort-indicator {\n display: inline-block;\n min-inline-size: 0.75rem;\n color: var(--sken-muted-foreground);\n font-size: 0.75em;\n }\n\n th .sort-indicator[data-state='asc'],\n th .sort-indicator[data-state='desc'] {\n color: var(--sken-primary);\n }\n\n tbody tr:last-child td {\n border-block-end: none;\n }\n\n tbody tr:hover {\n background: var(--sken-muted);\n }\n\n .empty {\n padding-block: var(--sken-4);\n padding-inline: var(--sken-3);\n text-align: center;\n color: var(--sken-muted-foreground);\n border: 1px solid var(--sken-border);\n border-radius: var(--sken-md);\n }\n\n .loading {\n display: flex;\n align-items: center;\n justify-content: center;\n padding-block: var(--sken-6);\n min-block-size: 12rem;\n border: 1px solid var(--sken-border);\n border-radius: var(--sken-md);\n color: var(--sken-muted-foreground);\n }\n\n /* The loading region renders a loading slot. The consumer\n supplies the spinner (typically a sken-icon with name\n spinner, which animates itself per its name) and the\n datatable provides the layout + accessible status region.\n The keyframe is owned by the icon package, not here,\n because the rotation is part of what spinner means: a\n static spinner would be a different icon. */\n\n .filter-bar {\n margin-block-end: 0.75rem;\n }\n\n .filter-input {\n box-sizing: border-box;\n inline-size: 100%;\n max-inline-size: 20rem;\n padding-block: var(--sken-2);\n padding-inline: var(--sken-3);\n border: 1px solid var(--sken-border);\n border-radius: var(--sken-md);\n background: var(--sken-background);\n color: var(--sken-foreground);\n font-family: var(--sken-family-sans);\n font-size: var(--sken-size-md);\n }\n\n .filter-input::placeholder {\n color: var(--sken-muted-foreground);\n }\n\n .filter-input:focus-visible {\n outline: 2px solid var(--sken-primary);\n outline-offset: 1px;\n }\n\n .pagination-bar {\n display: flex;\n align-items: center;\n gap: 0.75rem;\n margin-block-start: 0.75rem;\n font-size: 0.875rem;\n color: var(--sken-muted-foreground);\n }\n\n .page-btn {\n padding-block: var(--sken-1);\n padding-inline: var(--sken-3);\n border: 1px solid var(--sken-border);\n border-radius: var(--sken-sm);\n background: var(--sken-background);\n color: var(--sken-foreground);\n font-family: inherit;\n font-size: inherit;\n cursor: pointer;\n }\n\n .page-btn:hover:not(:disabled) {\n background: var(--sken-muted);\n }\n\n .page-btn:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n }\n\n .page-info {\n color: var(--sken-foreground);\n }\n `\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'sken-datatable': SkenDataTable<RowData>\n }\n}\n"],"x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAaA,SAAS,EAAW,GAAM,GAAO;CAGhC,OAFI,KAAS,OAAgC,OACzC,OAAO,KAAS,aAAmB,EAAK,CAAK,IAC1C;AACR;AAkBA,SAAS,EAAW,GAAO;CAC1B,IAAI,UAAU,KAAS,EAAM,MAAM;EAClC,IAAM,IAAO,EAAM,MACb,IAAY,EAAK,OAAO,WACxB,IAAe,GACf,IAAoB;EAG1B,OAFI,EAAa,kBAAkB,IAAU,EAAW,EAAkB,kBAAkB,EAAU,MAAM,EAAK,WAAW,CAAC,IACzH,EAAa,mBAAmB,IAAU,OACvC,EAAW,EAAU,MAAM,EAAK,WAAW,CAAC;CACpD;CAGA,OAFI,YAAY,KAAS,EAAM,SAAe,EAA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;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,IAAI;CACJ,IAAI;CACJ,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,IAAI;CACJ,IAAI;CACJ,GAAG;CAC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A,WAAA,KAAA,CAAA,GAO7B,EAAA,CAAA,EAAS,EAAE,WAAW,GAAM,CAAC,CAAA,GAAA,EAAA,WAAA,gBAAA,KAAA,CAAA,GAQ7B,EAAA,CAAA,EAAS,CAAA,GAAA,EAAA,WAAA,qBAAA,KAAA,CAAA,GAOT,EAAA,CAAA,EAAS,EAAE,WAAW,GAAM,CAAC,CAAA,GAAA,EAAA,WAAA,cAAA,KAAA,CAAA,GAI7B,EAAA,CAAA,EAAS;CAAE,WAAW;CAAqB,MAAM;AAAO,CAAC,CAAA,GAAA,EAAA,WAAA,mBAAA,KAAA,CAAA,GA7D3D,IAAA,EAAA,CAAA,EAAc,gBAAgB,CAAA,GAAA,CAAA"}
|
|
1
|
+
{"version":3,"file":"sken-datatable-CEXcvhM-.js","names":["#host","#getStore","#selector","#compare","#lastSelected","#subscribedStore","#unsubscribe","#hasSelected","o","i","n","e","c","f","r","s","h","s","n","e","t","i","AsyncDirective","directive","s","s","t","t","createContext","ContextConsumer","ContextProvider","#tableController","#warnIfNoGetRowId","#uncontrolledPagination","#renderEmpty","#getTableController","#features","#fuzzyFilter","#uncontrolledSorting","#uncontrolledGlobalFilter"],"sources":["../../../node_modules/.pnpm/@tanstack+lit-table@9.0.0_@lit+context@1.1.6_lit@3.3.3/node_modules/@tanstack/lit-table/dist/flexRender.js","../../../node_modules/.pnpm/@tanstack+lit-store@0.14.0_lit@3.3.3/node_modules/@tanstack/lit-store/dist/tan-stack-store-selector.js","../../../node_modules/.pnpm/@tanstack+store@0.11.0/node_modules/@tanstack/store/dist/alien.js","../../../node_modules/.pnpm/@tanstack+store@0.11.0/node_modules/@tanstack/store/dist/atom.js","../../../node_modules/.pnpm/@tanstack+store@0.11.0/node_modules/@tanstack/store/dist/shallow.js","../../../node_modules/.pnpm/lit-html@3.3.3/node_modules/lit-html/directive-helpers.js","../../../node_modules/.pnpm/lit-html@3.3.3/node_modules/lit-html/async-directive.js","../../../node_modules/.pnpm/@tanstack+lit-table@9.0.0_@lit+context@1.1.6_lit@3.3.3/node_modules/@tanstack/lit-table/dist/subscribe-directive.js","../../../node_modules/.pnpm/@tanstack+table-core@9.0.0/node_modules/@tanstack/table-core/dist/core/reactivity/renderPhaseReactivity.js","../../../node_modules/.pnpm/@tanstack+lit-table@9.0.0_@lit+context@1.1.6_lit@3.3.3/node_modules/@tanstack/lit-table/dist/reactivity.js","../../../node_modules/.pnpm/@tanstack+lit-table@9.0.0_@lit+context@1.1.6_lit@3.3.3/node_modules/@tanstack/lit-table/dist/TableController.js","../../../node_modules/.pnpm/@lit+context@1.1.6/node_modules/@lit/context/lib/context-request-event.js","../../../node_modules/.pnpm/@lit+context@1.1.6/node_modules/@lit/context/lib/create-context.js","../../../node_modules/.pnpm/@lit+context@1.1.6/node_modules/@lit/context/lib/controllers/context-consumer.js","../../../node_modules/.pnpm/@lit+context@1.1.6/node_modules/@lit/context/lib/value-notifier.js","../../../node_modules/.pnpm/@lit+context@1.1.6/node_modules/@lit/context/lib/controllers/context-provider.js","../../../node_modules/.pnpm/@tanstack+lit-table@9.0.0_@lit+context@1.1.6_lit@3.3.3/node_modules/@tanstack/lit-table/dist/createTableHook.js","../../../node_modules/.pnpm/@tanstack+lit-table@9.0.0_@lit+context@1.1.6_lit@3.3.3/node_modules/@tanstack/lit-table/dist/index.js","../../../node_modules/.pnpm/@tanstack+match-sorter-utils@9.0.0/node_modules/@tanstack/match-sorter-utils/dist/remove-accents.js","../../../node_modules/.pnpm/@tanstack+match-sorter-utils@9.0.0/node_modules/@tanstack/match-sorter-utils/dist/index.js","../src/components/sken-datatable.ts"],"sourcesContent":["//#region src/flexRender.ts\n/**\n* Renders a Lit table template value with the provided context props.\n*\n* Use this lower-level helper for custom header, cell, or footer renderers when\n* you already have the render function and context. `FlexRender` is the\n* convenience wrapper for table cell/header/footer objects.\n*\n* @example\n* ```ts\n* flexRender(cell.column.columnDef.cell, cell.getContext())\n* ```\n*/\nfunction flexRender(Comp, props) {\n\tif (Comp === null || Comp === void 0) return null;\n\tif (typeof Comp === \"function\") return Comp(props);\n\treturn Comp;\n}\n/**\n* Simplified component wrapper of `flexRender`. Use this utility function to render headers, cells, or footers with custom markup.\n* Only one prop (`cell`, `header`, or `footer`) may be passed.\n* @example\n* ```ts\n* ${FlexRender({ cell })}\n* ${FlexRender({ header })}\n* ${FlexRender({ footer: header })}\n* ```\n*\n* This replaces calling `flexRender` directly like this:\n* ```ts\n* flexRender(cell.column.columnDef.cell, cell.getContext())\n* flexRender(header.column.columnDef.header, header.getContext())\n* flexRender(footer.column.columnDef.footer, footer.getContext())\n* ```\n*/\nfunction FlexRender(props) {\n\tif (\"cell\" in props && props.cell) {\n\t\tconst cell = props.cell;\n\t\tconst columnDef = cell.column.columnDef;\n\t\tconst groupingCell = cell;\n\t\tconst groupingColumnDef = columnDef;\n\t\tif (groupingCell.getIsAggregated?.()) return flexRender(groupingColumnDef.aggregatedCell ?? columnDef.cell, cell.getContext());\n\t\tif (groupingCell.getIsPlaceholder?.()) return null;\n\t\treturn flexRender(columnDef.cell, cell.getContext());\n\t}\n\tif (\"header\" in props && props.header) return flexRender(props.header.column.columnDef.header, props.header.getContext());\n\tif (\"footer\" in props && props.footer) return flexRender(props.footer.column.columnDef.footer, props.footer.getContext());\n\treturn null;\n}\n\n//#endregion\nexport { FlexRender, flexRender };","//#region src/tan-stack-store-selector.ts\nfunction defaultCompare(a, b) {\n\treturn a === b;\n}\nfunction defaultSelector(snapshot) {\n\treturn snapshot;\n}\n/**\n* Subscribes a Lit host to a TanStack Store and exposes a selected slice of its state.\n*\n* The host will only re-render when the selected value actually changes\n* (according to the configured `compare` function).\n*\n* @example\n* ```ts\n* class UserNameEl extends LitElement {\n* #name = new TanStackStoreSelector(\n* this,\n* () => userStore,\n* (snapshot) => snapshot.name,\n* )\n*\n* render() {\n* return html`<p>${this.#name.value}</p>`\n* }\n* }\n* ```\n*\n* @example\n* ```ts\n* class UserNameEl extends LitElement {\n* _ = new TanStackStoreAtom(\n* this,\n* () => userStore,\n* (snapshot) => snapshot.name,\n* )\n*\n* render() {\n* return html`<p>${userStore.state.name}</p>`\n* }\n* }\n* ```\n*\n*/\nvar TanStackStoreSelector = class {\n\t#host;\n\t#getStore;\n\t#selector;\n\t#compare;\n\t#unsubscribe;\n\t#subscribedStore;\n\t#hasSelected = false;\n\t#lastSelected;\n\tconstructor(host, getStore, selector = defaultSelector, options) {\n\t\tthis.#host = host;\n\t\tthis.#getStore = getStore;\n\t\tthis.#selector = selector;\n\t\tthis.#compare = options?.compare ?? defaultCompare;\n\t\thost.addController(this);\n\t}\n\tget value() {\n\t\treturn this.#lastSelected;\n\t}\n\thostUpdate() {\n\t\tconst store = this.#getStore();\n\t\tif (store === this.#subscribedStore) return;\n\t\tthis.#unsubscribe?.();\n\t\tthis.#subscribedStore = store;\n\t\tif (!store) {\n\t\t\tthis.#unsubscribe = void 0;\n\t\t\tthis.#hasSelected = false;\n\t\t\tthis.#lastSelected = void 0;\n\t\t\treturn;\n\t\t}\n\t\tthis.#lastSelected = this.#selector(store.get());\n\t\tthis.#hasSelected = true;\n\t\tthis.#unsubscribe = store.subscribe((value) => {\n\t\t\tconst next = this.#selector(value);\n\t\t\tif (this.#hasSelected && this.#compare(this.#lastSelected, next)) return;\n\t\t\tthis.#lastSelected = next;\n\t\t\tthis.#hasSelected = true;\n\t\t\tthis.#host.requestUpdate();\n\t\t}).unsubscribe;\n\t}\n\thostDisconnected() {\n\t\tthis.#unsubscribe?.();\n\t\tthis.#unsubscribe = void 0;\n\t\tthis.#subscribedStore = void 0;\n\t\tthis.#hasSelected = false;\n\t\tthis.#lastSelected = void 0;\n\t}\n};\n\n//#endregion\nexport { TanStackStoreSelector };\n//# sourceMappingURL=tan-stack-store-selector.js.map","//#region src/alien.ts\nlet ReactiveFlags = /* @__PURE__ */ function(ReactiveFlags) {\n\tReactiveFlags[ReactiveFlags[\"None\"] = 0] = \"None\";\n\tReactiveFlags[ReactiveFlags[\"Mutable\"] = 1] = \"Mutable\";\n\tReactiveFlags[ReactiveFlags[\"Watching\"] = 2] = \"Watching\";\n\tReactiveFlags[ReactiveFlags[\"RecursedCheck\"] = 4] = \"RecursedCheck\";\n\tReactiveFlags[ReactiveFlags[\"Recursed\"] = 8] = \"Recursed\";\n\tReactiveFlags[ReactiveFlags[\"Dirty\"] = 16] = \"Dirty\";\n\tReactiveFlags[ReactiveFlags[\"Pending\"] = 32] = \"Pending\";\n\treturn ReactiveFlags;\n}({});\n/* @__NO_SIDE_EFFECTS__ */\nfunction createReactiveSystem({ update, notify, unwatched }) {\n\treturn {\n\t\tlink,\n\t\tunlink,\n\t\tpropagate,\n\t\tcheckDirty,\n\t\tshallowPropagate\n\t};\n\tfunction link(dep, sub, version) {\n\t\tconst prevDep = sub.depsTail;\n\t\tif (prevDep !== void 0 && prevDep.dep === dep) return;\n\t\tconst nextDep = prevDep !== void 0 ? prevDep.nextDep : sub.deps;\n\t\tif (nextDep !== void 0 && nextDep.dep === dep) {\n\t\t\tnextDep.version = version;\n\t\t\tsub.depsTail = nextDep;\n\t\t\treturn;\n\t\t}\n\t\tconst prevSub = dep.subsTail;\n\t\tif (prevSub !== void 0 && prevSub.version === version && prevSub.sub === sub) return;\n\t\tconst newLink = sub.depsTail = dep.subsTail = {\n\t\t\tversion,\n\t\t\tdep,\n\t\t\tsub,\n\t\t\tprevDep,\n\t\t\tnextDep,\n\t\t\tprevSub,\n\t\t\tnextSub: void 0\n\t\t};\n\t\tif (nextDep !== void 0) nextDep.prevDep = newLink;\n\t\tif (prevDep !== void 0) prevDep.nextDep = newLink;\n\t\telse sub.deps = newLink;\n\t\tif (prevSub !== void 0) prevSub.nextSub = newLink;\n\t\telse dep.subs = newLink;\n\t}\n\tfunction unlink(link, sub = link.sub) {\n\t\tconst dep = link.dep;\n\t\tconst prevDep = link.prevDep;\n\t\tconst nextDep = link.nextDep;\n\t\tconst nextSub = link.nextSub;\n\t\tconst prevSub = link.prevSub;\n\t\tif (nextDep !== void 0) nextDep.prevDep = prevDep;\n\t\telse sub.depsTail = prevDep;\n\t\tif (prevDep !== void 0) prevDep.nextDep = nextDep;\n\t\telse sub.deps = nextDep;\n\t\tif (nextSub !== void 0) nextSub.prevSub = prevSub;\n\t\telse dep.subsTail = prevSub;\n\t\tif (prevSub !== void 0) prevSub.nextSub = nextSub;\n\t\telse if ((dep.subs = nextSub) === void 0) unwatched(dep);\n\t\treturn nextDep;\n\t}\n\tfunction propagate(link) {\n\t\tlet next = link.nextSub;\n\t\tlet stack;\n\t\ttop: do {\n\t\t\tconst sub = link.sub;\n\t\t\tlet flags = sub.flags;\n\t\t\tif (!(flags & (ReactiveFlags.RecursedCheck | ReactiveFlags.Recursed | ReactiveFlags.Dirty | ReactiveFlags.Pending))) sub.flags = flags | ReactiveFlags.Pending;\n\t\t\telse if (!(flags & (ReactiveFlags.RecursedCheck | ReactiveFlags.Recursed))) flags = ReactiveFlags.None;\n\t\t\telse if (!(flags & ReactiveFlags.RecursedCheck)) sub.flags = flags & ~ReactiveFlags.Recursed | ReactiveFlags.Pending;\n\t\t\telse if (!(flags & (ReactiveFlags.Dirty | ReactiveFlags.Pending)) && isValidLink(link, sub)) {\n\t\t\t\tsub.flags = flags | (ReactiveFlags.Recursed | ReactiveFlags.Pending);\n\t\t\t\tflags &= ReactiveFlags.Mutable;\n\t\t\t} else flags = ReactiveFlags.None;\n\t\t\tif (flags & ReactiveFlags.Watching) notify(sub);\n\t\t\tif (flags & ReactiveFlags.Mutable) {\n\t\t\t\tconst subSubs = sub.subs;\n\t\t\t\tif (subSubs !== void 0) {\n\t\t\t\t\tconst nextSub = (link = subSubs).nextSub;\n\t\t\t\t\tif (nextSub !== void 0) {\n\t\t\t\t\t\tstack = {\n\t\t\t\t\t\t\tvalue: next,\n\t\t\t\t\t\t\tprev: stack\n\t\t\t\t\t\t};\n\t\t\t\t\t\tnext = nextSub;\n\t\t\t\t\t}\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ((link = next) !== void 0) {\n\t\t\t\tnext = link.nextSub;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\twhile (stack !== void 0) {\n\t\t\t\tlink = stack.value;\n\t\t\t\tstack = stack.prev;\n\t\t\t\tif (link !== void 0) {\n\t\t\t\t\tnext = link.nextSub;\n\t\t\t\t\tcontinue top;\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\t} while (true);\n\t}\n\tfunction checkDirty(link, sub) {\n\t\tlet stack;\n\t\tlet checkDepth = 0;\n\t\tlet dirty = false;\n\t\ttop: do {\n\t\t\tconst dep = link.dep;\n\t\t\tconst flags = dep.flags;\n\t\t\tif (sub.flags & ReactiveFlags.Dirty) dirty = true;\n\t\t\telse if ((flags & (ReactiveFlags.Mutable | ReactiveFlags.Dirty)) === (ReactiveFlags.Mutable | ReactiveFlags.Dirty)) {\n\t\t\t\tif (update(dep)) {\n\t\t\t\t\tconst subs = dep.subs;\n\t\t\t\t\tif (subs.nextSub !== void 0) shallowPropagate(subs);\n\t\t\t\t\tdirty = true;\n\t\t\t\t}\n\t\t\t} else if ((flags & (ReactiveFlags.Mutable | ReactiveFlags.Pending)) === (ReactiveFlags.Mutable | ReactiveFlags.Pending)) {\n\t\t\t\tif (link.nextSub !== void 0 || link.prevSub !== void 0) stack = {\n\t\t\t\t\tvalue: link,\n\t\t\t\t\tprev: stack\n\t\t\t\t};\n\t\t\t\tlink = dep.deps;\n\t\t\t\tsub = dep;\n\t\t\t\t++checkDepth;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (!dirty) {\n\t\t\t\tconst nextDep = link.nextDep;\n\t\t\t\tif (nextDep !== void 0) {\n\t\t\t\t\tlink = nextDep;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\t\t\twhile (checkDepth--) {\n\t\t\t\tconst firstSub = sub.subs;\n\t\t\t\tconst hasMultipleSubs = firstSub.nextSub !== void 0;\n\t\t\t\tif (hasMultipleSubs) {\n\t\t\t\t\tlink = stack.value;\n\t\t\t\t\tstack = stack.prev;\n\t\t\t\t} else link = firstSub;\n\t\t\t\tif (dirty) {\n\t\t\t\t\tif (update(sub)) {\n\t\t\t\t\t\tif (hasMultipleSubs) shallowPropagate(firstSub);\n\t\t\t\t\t\tsub = link.sub;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tdirty = false;\n\t\t\t\t} else sub.flags &= ~ReactiveFlags.Pending;\n\t\t\t\tsub = link.sub;\n\t\t\t\tconst nextDep = link.nextDep;\n\t\t\t\tif (nextDep !== void 0) {\n\t\t\t\t\tlink = nextDep;\n\t\t\t\t\tcontinue top;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn dirty;\n\t\t} while (true);\n\t}\n\tfunction shallowPropagate(link) {\n\t\tdo {\n\t\t\tconst sub = link.sub;\n\t\t\tconst flags = sub.flags;\n\t\t\tif ((flags & (ReactiveFlags.Pending | ReactiveFlags.Dirty)) === ReactiveFlags.Pending) {\n\t\t\t\tsub.flags = flags | ReactiveFlags.Dirty;\n\t\t\t\tif ((flags & (ReactiveFlags.Watching | ReactiveFlags.RecursedCheck)) === ReactiveFlags.Watching) notify(sub);\n\t\t\t}\n\t\t} while ((link = link.nextSub) !== void 0);\n\t}\n\tfunction isValidLink(checkLink, sub) {\n\t\tlet link = sub.depsTail;\n\t\twhile (link !== void 0) {\n\t\t\tif (link === checkLink) return true;\n\t\t\tlink = link.prevDep;\n\t\t}\n\t\treturn false;\n\t}\n}\n\n//#endregion\nexport { ReactiveFlags, createReactiveSystem };\n//# sourceMappingURL=alien.js.map","import { ReactiveFlags, createReactiveSystem } from \"./alien.js\";\n\n//#region src/atom.ts\nfunction toObserver(nextHandler, errorHandler, completionHandler) {\n\tconst isObserver = typeof nextHandler === \"object\";\n\tconst self = isObserver ? nextHandler : void 0;\n\treturn {\n\t\tnext: (isObserver ? nextHandler.next : nextHandler)?.bind(self),\n\t\terror: (isObserver ? nextHandler.error : errorHandler)?.bind(self),\n\t\tcomplete: (isObserver ? nextHandler.complete : completionHandler)?.bind(self)\n\t};\n}\nconst queuedEffects = [];\nlet cycle = 0;\nconst { link, unlink, propagate, checkDirty, shallowPropagate } = /* @__PURE__ */ createReactiveSystem({\n\tupdate(atom) {\n\t\treturn atom._update();\n\t},\n\tnotify(effect) {\n\t\tqueuedEffects[queuedEffectsLength++] = effect;\n\t\teffect.flags &= ~ReactiveFlags.Watching;\n\t},\n\tunwatched(atom) {\n\t\tif (atom.depsTail !== void 0) {\n\t\t\tatom.depsTail = void 0;\n\t\t\tatom.flags = ReactiveFlags.Mutable | ReactiveFlags.Dirty;\n\t\t\tpurgeDeps(atom);\n\t\t}\n\t}\n});\nlet notifyIndex = 0;\nlet queuedEffectsLength = 0;\nlet activeSub;\nlet batchDepth = 0;\nfunction batch(fn) {\n\ttry {\n\t\t++batchDepth;\n\t\tfn();\n\t} finally {\n\t\tif (!--batchDepth) flush();\n\t}\n}\nfunction purgeDeps(sub) {\n\tconst depsTail = sub.depsTail;\n\tlet dep = depsTail !== void 0 ? depsTail.nextDep : sub.deps;\n\twhile (dep !== void 0) dep = unlink(dep, sub);\n}\nfunction flush() {\n\tif (batchDepth > 0) return;\n\twhile (notifyIndex < queuedEffectsLength) {\n\t\tconst effect = queuedEffects[notifyIndex];\n\t\tqueuedEffects[notifyIndex++] = void 0;\n\t\teffect.notify();\n\t}\n\tnotifyIndex = 0;\n\tqueuedEffectsLength = 0;\n}\nfunction createAsyncAtom(getValue, options) {\n\tconst ref = {};\n\tconst atom = createAtom(() => {\n\t\tgetValue().then((data) => {\n\t\t\tconst internalAtom = ref.current;\n\t\t\tif (internalAtom._update({\n\t\t\t\tstatus: \"done\",\n\t\t\t\tdata\n\t\t\t})) {\n\t\t\t\tconst subs = internalAtom.subs;\n\t\t\t\tif (subs !== void 0) {\n\t\t\t\t\tpropagate(subs);\n\t\t\t\t\tshallowPropagate(subs);\n\t\t\t\t\tflush();\n\t\t\t\t}\n\t\t\t}\n\t\t}, (error) => {\n\t\t\tconst internalAtom = ref.current;\n\t\t\tif (internalAtom._update({\n\t\t\t\tstatus: \"error\",\n\t\t\t\terror\n\t\t\t})) {\n\t\t\t\tconst subs = internalAtom.subs;\n\t\t\t\tif (subs !== void 0) {\n\t\t\t\t\tpropagate(subs);\n\t\t\t\t\tshallowPropagate(subs);\n\t\t\t\t\tflush();\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\treturn { status: \"pending\" };\n\t}, options);\n\tref.current = atom;\n\treturn atom;\n}\nfunction createAtom(valueOrFn, options) {\n\tconst isComputed = typeof valueOrFn === \"function\";\n\tconst getter = valueOrFn;\n\tconst atom = {\n\t\t_snapshot: isComputed ? void 0 : valueOrFn,\n\t\tsubs: void 0,\n\t\tsubsTail: void 0,\n\t\tdeps: void 0,\n\t\tdepsTail: void 0,\n\t\tflags: isComputed ? ReactiveFlags.None : ReactiveFlags.Mutable,\n\t\tget() {\n\t\t\tif (activeSub !== void 0) link(atom, activeSub, cycle);\n\t\t\treturn atom._snapshot;\n\t\t},\n\t\tsubscribe(observerOrFn) {\n\t\t\tconst obs = toObserver(observerOrFn);\n\t\t\tconst observed = { current: false };\n\t\t\tconst e = effect(() => {\n\t\t\t\tatom.get();\n\t\t\t\tif (!observed.current) observed.current = true;\n\t\t\t\telse obs.next?.(atom._snapshot);\n\t\t\t});\n\t\t\treturn { unsubscribe: () => {\n\t\t\t\te.stop();\n\t\t\t} };\n\t\t},\n\t\t_update(getValue) {\n\t\t\tconst prevSub = activeSub;\n\t\t\tconst compare = options?.compare ?? Object.is;\n\t\t\tif (isComputed) {\n\t\t\t\tactiveSub = atom;\n\t\t\t\t++cycle;\n\t\t\t\tatom.depsTail = void 0;\n\t\t\t} else if (getValue === void 0) return false;\n\t\t\tif (isComputed) atom.flags = ReactiveFlags.Mutable | ReactiveFlags.RecursedCheck;\n\t\t\ttry {\n\t\t\t\tconst oldValue = atom._snapshot;\n\t\t\t\tconst newValue = typeof getValue === \"function\" ? getValue(oldValue) : getValue === void 0 && isComputed ? getter(oldValue) : getValue;\n\t\t\t\tif (oldValue === void 0 || !compare(oldValue, newValue)) {\n\t\t\t\t\tatom._snapshot = newValue;\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t} finally {\n\t\t\t\tactiveSub = prevSub;\n\t\t\t\tif (isComputed) atom.flags &= ~ReactiveFlags.RecursedCheck;\n\t\t\t\tpurgeDeps(atom);\n\t\t\t}\n\t\t}\n\t};\n\tif (isComputed) {\n\t\tatom.flags = ReactiveFlags.Mutable | ReactiveFlags.Dirty;\n\t\tatom.get = function() {\n\t\t\tconst flags = atom.flags;\n\t\t\tif (flags & ReactiveFlags.Dirty || flags & ReactiveFlags.Pending && checkDirty(atom.deps, atom)) {\n\t\t\t\tif (atom._update()) {\n\t\t\t\t\tconst subs = atom.subs;\n\t\t\t\t\tif (subs !== void 0) shallowPropagate(subs);\n\t\t\t\t}\n\t\t\t} else if (flags & ReactiveFlags.Pending) atom.flags = flags & ~ReactiveFlags.Pending;\n\t\t\tif (activeSub !== void 0) link(atom, activeSub, cycle);\n\t\t\treturn atom._snapshot;\n\t\t};\n\t} else atom.set = function(valueOrFn) {\n\t\tif (atom._update(valueOrFn)) {\n\t\t\tconst subs = atom.subs;\n\t\t\tif (subs !== void 0) {\n\t\t\t\tpropagate(subs);\n\t\t\t\tshallowPropagate(subs);\n\t\t\t\tflush();\n\t\t\t}\n\t\t}\n\t};\n\treturn atom;\n}\nfunction effect(fn) {\n\tconst run = () => {\n\t\tconst prevSub = activeSub;\n\t\tactiveSub = effectObj;\n\t\t++cycle;\n\t\teffectObj.depsTail = void 0;\n\t\teffectObj.flags = ReactiveFlags.Watching | ReactiveFlags.RecursedCheck;\n\t\ttry {\n\t\t\treturn fn();\n\t\t} finally {\n\t\t\tactiveSub = prevSub;\n\t\t\teffectObj.flags &= ~ReactiveFlags.RecursedCheck;\n\t\t\tpurgeDeps(effectObj);\n\t\t}\n\t};\n\tconst effectObj = {\n\t\tdeps: void 0,\n\t\tdepsTail: void 0,\n\t\tsubs: void 0,\n\t\tsubsTail: void 0,\n\t\tflags: ReactiveFlags.Watching | ReactiveFlags.RecursedCheck,\n\t\tnotify() {\n\t\t\tconst flags = this.flags;\n\t\t\tif (flags & ReactiveFlags.Dirty || flags & ReactiveFlags.Pending && checkDirty(this.deps, this)) run();\n\t\t\telse this.flags = ReactiveFlags.Watching;\n\t\t},\n\t\tstop() {\n\t\t\tthis.flags = ReactiveFlags.None;\n\t\t\tthis.depsTail = void 0;\n\t\t\tpurgeDeps(this);\n\t\t}\n\t};\n\trun();\n\treturn effectObj;\n}\n\n//#endregion\nexport { batch, createAsyncAtom, createAtom, flush, toObserver };\n//# sourceMappingURL=atom.js.map","//#region src/shallow.ts\nfunction shallow(objA, objB) {\n\tif (Object.is(objA, objB)) return true;\n\tif (typeof objA !== \"object\" || objA === null || typeof objB !== \"object\" || objB === null) return false;\n\tif (objA instanceof Map && objB instanceof Map) {\n\t\tif (objA.size !== objB.size) return false;\n\t\tfor (const [k, v] of objA) if (!objB.has(k) || !Object.is(v, objB.get(k))) return false;\n\t\treturn true;\n\t}\n\tif (objA instanceof Set && objB instanceof Set) {\n\t\tif (objA.size !== objB.size) return false;\n\t\tfor (const v of objA) if (!objB.has(v)) return false;\n\t\treturn true;\n\t}\n\tif (objA instanceof Date && objB instanceof Date) {\n\t\tif (objA.getTime() !== objB.getTime()) return false;\n\t\treturn true;\n\t}\n\tconst keysA = getOwnKeys(objA);\n\tif (keysA.length !== getOwnKeys(objB).length) return false;\n\tfor (let i = 0; i < keysA.length; i++) if (!Object.prototype.hasOwnProperty.call(objB, keysA[i]) || !Object.is(objA[keysA[i]], objB[keysA[i]])) return false;\n\treturn true;\n}\nfunction getOwnKeys(obj) {\n\treturn Object.keys(obj).concat(Object.getOwnPropertySymbols(obj));\n}\n\n//#endregion\nexport { shallow };\n//# sourceMappingURL=shallow.js.map","import{_$LH as o}from\"./lit-html.js\";\n/**\n * @license\n * Copyright 2020 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */const{I:t}=o,i=o=>o,n=o=>null===o||\"object\"!=typeof o&&\"function\"!=typeof o,e={HTML:1,SVG:2,MATHML:3},l=(o,t)=>void 0===t?void 0!==o?._$litType$:o?._$litType$===t,d=o=>null!=o?._$litType$?.h,c=o=>void 0!==o?._$litDirective$,f=o=>o?._$litDirective$,r=o=>void 0===o.strings,s=()=>document.createComment(\"\"),v=(o,n,e)=>{const l=o._$AA.parentNode,d=void 0===n?o._$AB:n._$AA;if(void 0===e){const i=l.insertBefore(s(),d),n=l.insertBefore(s(),d);e=new t(i,n,o,o.options)}else{const t=e._$AB.nextSibling,n=e._$AM,c=n!==o;if(c){let t;e._$AQ?.(o),e._$AM=o,void 0!==e._$AP&&(t=o._$AU)!==n._$AU&&e._$AP(t)}if(t!==d||c){let o=e._$AA;for(;o!==t;){const t=i(o).nextSibling;i(l).insertBefore(o,d),o=t}}}return e},u=(o,t,i=o)=>(o._$AI(t,i),o),m={},p=(o,t=m)=>o._$AH=t,M=o=>o._$AH,h=o=>{o._$AR(),o._$AA.remove()},j=o=>{o._$AR()};export{e as TemplateResultType,j as clearPart,M as getCommittedValue,f as getDirectiveClass,v as insertPart,d as isCompiledTemplateResult,c as isDirectiveResult,n as isPrimitive,r as isSingleExpression,l as isTemplateResult,h as removePart,u as setChildPartValue,p as setCommittedValue};\n//# sourceMappingURL=directive-helpers.js.map\n","import{isSingleExpression as i}from\"./directive-helpers.js\";import{Directive as t,PartType as e}from\"./directive.js\";export{directive}from\"./directive.js\";\n/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */const s=(i,t)=>{const e=i._$AN;if(void 0===e)return!1;for(const i of e)i._$AO?.(t,!1),s(i,t);return!0},o=i=>{let t,e;do{if(void 0===(t=i._$AM))break;e=t._$AN,e.delete(i),i=t}while(0===e?.size)},r=i=>{for(let t;t=i._$AM;i=t){let e=t._$AN;if(void 0===e)t._$AN=e=new Set;else if(e.has(i))break;e.add(i),c(t)}};function h(i){void 0!==this._$AN?(o(this),this._$AM=i,r(this)):this._$AM=i}function n(i,t=!1,e=0){const r=this._$AH,h=this._$AN;if(void 0!==h&&0!==h.size)if(t)if(Array.isArray(r))for(let i=e;i<r.length;i++)s(r[i],!1),o(r[i]);else null!=r&&(s(r,!1),o(r));else s(this,i)}const c=i=>{i.type==e.CHILD&&(i._$AP??=n,i._$AQ??=h)};class f extends t{constructor(){super(...arguments),this._$AN=void 0}_$AT(i,t,e){super._$AT(i,t,e),r(this),this.isConnected=i._$AU}_$AO(i,t=!0){i!==this.isConnected&&(this.isConnected=i,i?this.reconnected?.():this.disconnected?.()),t&&(s(this,i),o(this))}setValue(t){if(i(this._$Ct))this._$Ct._$AI(t,this);else{const i=[...this._$Ct._$AH];i[this._$Ci]=t,this._$Ct._$AI(i,this,0)}}disconnected(){}reconnected(){}}export{f as AsyncDirective,t as Directive,e as PartType};\n//# sourceMappingURL=async-directive.js.map\n","import { TanStackStoreSelector } from \"@tanstack/lit-store\";\nimport { AsyncDirective, directive } from \"lit/async-directive.js\";\nimport { noChange } from \"lit\";\n\n//#region src/subscribe-directive.ts\n/**\n* A simple identity selector used when no specific selection is needed,\n* allowing the directive to subscribe to the entire state of the source.\n* @template T - The type of the state being passed through unchanged.\n*/\nconst identitySelector = (state) => state;\n/**\n* An asynchronous Lit directive that subscribes to a `@tanstack/lit-store`\n* source and triggers re-renders specifically for the template portion it wraps.\n* * It uses a \"fake\" `ReactiveControllerHost` to bridge the gap between\n* TanStack's standard controller requirements and the `AsyncDirective` lifecycle.\n*/\nvar SubscribeDirective = class extends AsyncDirective {\n\t/** The `TanStackStoreSelector` controller that manages the subscription to the store/atom */\n\tcontroller;\n\t/** The latest source and selector used to determine if a new subscription is needed on updates */\n\tlatestSource;\n\tlatestSelector;\n\tresolvedTemplate;\n\tinitialized = false;\n\trender(_source, _selectorOrTemplate, _template) {\n\t\t/** The actual rendering is handled in the {@link update} method to ensure that template is only evaluated if needed */\n\t\treturn noChange;\n\t}\n\tupdate(_part, args) {\n\t\tconst [source, selectorOrTemplate, template] = args;\n\t\tconst isIdentitySubscription = template === void 0;\n\t\tconst selector = isIdentitySubscription ? identitySelector : selectorOrTemplate;\n\t\tconst actualTemplate = isIdentitySubscription ? selectorOrTemplate : template;\n\t\tconst sourceChanged = this.latestSource !== source;\n\t\tconst selectorChanged = this.latestSelector !== selector;\n\t\tconst shouldReinitialize = !this.initialized || sourceChanged || selectorChanged;\n\t\tthis.resolvedTemplate = actualTemplate;\n\t\tif (shouldReinitialize) {\n\t\t\tif (this.initialized) {\n\t\t\t\tthis.controller?.hostDisconnected();\n\t\t\t\tthis.controller = void 0;\n\t\t\t}\n\t\t\tthis.latestSource = source;\n\t\t\tthis.latestSelector = selector;\n\t\t\tif (!this.controller) this.controller = new TanStackStoreSelector(this.createFakeHost(), () => this.latestSource, (state) => this.latestSelector?.(state));\n\t\t\tthis.controller.hostUpdate();\n\t\t\tthis.initialized = true;\n\t\t}\n\t\treturn this.resolvedTemplate?.(this.latestSelector(this.latestSource.get()));\n\t}\n\t/** Cleans up the controller subscription when the directive is removed from the DOM. */\n\tdisconnected() {\n\t\tthis.controller?.hostDisconnected();\n\t}\n\t/** Restores the controller subscription when the directive is re-attached to the DOM. */\n\treconnected() {\n\t\tthis.controller?.hostUpdate();\n\t\tif (this.resolvedTemplate && this.controller) this.setValue(this.resolvedTemplate(this.controller.value));\n\t}\n\t/**\n\t* Creates a mock `ReactiveControllerHost` allowing the `TanStackStoreSelector`\n\t* to plug into the `AsyncDirective`'s update cycle using `setValue()`.\n\t*/\n\tcreateFakeHost() {\n\t\treturn {\n\t\t\taddController: () => {},\n\t\t\tremoveController: () => {},\n\t\t\trequestUpdate: () => {\n\t\t\t\tif (this.resolvedTemplate && this.controller) this.setValue(this.resolvedTemplate(this.controller.value));\n\t\t\t},\n\t\t\tget updateComplete() {\n\t\t\t\treturn Promise.resolve(true);\n\t\t\t}\n\t\t};\n\t}\n};\n/**\n* A Lit directive that subscribes to a source (Store or Atom)\n* and efficiently updates only the wrapped template\n* when the state or selected slice changes.\n* @example\n* ```ts\n* // Without a selector (subscribes to entire state)\n* html`<div>${subscribe(myStore, (state) => html`<span>${state.count}</span>`)}</div>`\n* * // With a selector (only updates when `count` changes)\n* html`<div>${subscribe(myStore, state => state.count, (count) => html`<span>${count}</span>`)}</div>`\n* ```\n*/\nconst subscribe = directive(SubscribeDirective);\n\n//#endregion\nexport { SubscribeDirective, subscribe };","//#region src/core/reactivity/renderPhaseReactivity.ts\n/**\n* Creates reactivity bindings for render-phase adapters (React, Preact, Lit):\n* frameworks with plain, non-reactive options that are re-synchronized during\n* component render, where store notifications must not fire until the host\n* commits.\n*\n* Readonly atoms are exposed as live facades. `get()` re-evaluates the\n* resolver against the options of the render in progress — a normal computed\n* cannot know that plain `options.state` changed — and caches the result\n* through the configured comparator so external-store consumers (e.g. React's\n* `useSyncExternalStore`) see referentially stable snapshots. `subscribe()`\n* goes through a hidden computed that tracks the resolver's real atom\n* dependencies plus a commit version, so subscribers are invalidated by\n* actual reactive writes and by the adapter's post-commit publication.\n*\n* @example\n* ```ts\n* import { batch, createAtom } from '@tanstack/react-store'\n*\n* export const reactReactivity = () =>\n* renderPhaseReactivity({ createAtom, batch })\n* ```\n*/\nfunction renderPhaseReactivity(primitives) {\n\tconst { createAtom, batch } = primitives;\n\tconst commitAtom = createAtom(0);\n\treturn {\n\t\tcreateOptionsStore: false,\n\t\twrapExternalAtoms: false,\n\t\taddSubscription: () => {\n\t\t\tthrow new Error(\"Feature not supported in current reactivity implementation\");\n\t\t},\n\t\tunmount: () => {\n\t\t\tthrow new Error(\"Feature not supported in current reactivity implementation\");\n\t\t},\n\t\tschedule: primitives.schedule ?? ((fn) => queueMicrotask(fn)),\n\t\tbatch,\n\t\tuntrack: (fn) => fn(),\n\t\tcreateReadonlyAtom: (fn, atomOptions) => {\n\t\t\tconst compare = atomOptions?.compare ?? Object.is;\n\t\t\tlet hasSnapshot = false;\n\t\t\tlet snapshot;\n\t\t\tconst getSnapshot = () => {\n\t\t\t\tconst nextSnapshot = fn();\n\t\t\t\tif (!hasSnapshot || !compare(snapshot, nextSnapshot)) {\n\t\t\t\t\tsnapshot = nextSnapshot;\n\t\t\t\t\thasSnapshot = true;\n\t\t\t\t}\n\t\t\t\treturn snapshot;\n\t\t\t};\n\t\t\tconst reactiveAtom = createAtom(() => {\n\t\t\t\tcommitAtom.get();\n\t\t\t\treturn getSnapshot();\n\t\t\t}, { compare });\n\t\t\treturn {\n\t\t\t\tget: getSnapshot,\n\t\t\t\tsubscribe: reactiveAtom.subscribe.bind(reactiveAtom)\n\t\t\t};\n\t\t},\n\t\tcreateWritableAtom: (value, atomOptions) => {\n\t\t\treturn createAtom(value, { compare: atomOptions?.compare });\n\t\t},\n\t\tcommit: () => {\n\t\t\tcommitAtom.set((version) => version + 1);\n\t\t}\n\t};\n}\n/**\n* Creates a render-phase source with an explicit commit baseline.\n*\n* Render-phase adapters publish controlled state after the host framework\n* commits so isolated subscribers update, but the component that owns the\n* table already rendered that exact snapshot — forwarding the notification to\n* its root subscription would produce a redundant render. Unlike a last-read\n* filter, speculative reads do not change notification behavior: only\n* `markCommitted()` advances the baseline.\n*/\nfunction createRenderPhaseSource(source, compare = Object.is) {\n\tlet hasCommittedSnapshot = false;\n\tlet committedSnapshot;\n\treturn {\n\t\tget: source.get,\n\t\tmarkCommitted: (snapshot) => {\n\t\t\tcommittedSnapshot = snapshot;\n\t\t\thasCommittedSnapshot = true;\n\t\t},\n\t\tsubscribe: (listener) => source.subscribe((value) => {\n\t\t\tif (!hasCommittedSnapshot || !compare(committedSnapshot, value)) listener(value);\n\t\t})\n\t};\n}\n\n//#endregion\nexport { createRenderPhaseSource, renderPhaseReactivity };","import { renderPhaseReactivity } from \"@tanstack/table-core/reactivity\";\nimport { batch, createAtom } from \"@tanstack/lit-store\";\n\n//#region src/reactivity.ts\n/**\n* Creates the table-core reactivity bindings used by the Lit adapter.\n*\n* Lit calls `controller.table(options)` from the host's `render()`, so options\n* are plain values synchronized during the update cycle — writing a reactive\n* options store there would schedule a second update per interaction. The\n* render-phase preset supplies the live readonly-atom facades and the `commit`\n* hook; `TableController` publishes its captured controlled state from\n* `hostUpdated()`. Store primitives come from `@tanstack/lit-store` so all\n* atoms share one store instance with user-provided external atoms.\n*/\nfunction litReactivity() {\n\treturn renderPhaseReactivity({\n\t\tcreateAtom,\n\t\tbatch\n\t});\n}\n\n//#endregion\nexport { litReactivity };","import { FlexRender } from \"./flexRender.js\";\nimport { litReactivity } from \"./reactivity.js\";\nimport { subscribe } from \"./subscribe-directive.js\";\nimport { constructTable } from \"@tanstack/table-core\";\nimport { createRenderPhaseSource } from \"@tanstack/table-core/reactivity\";\nimport { table_publishExternalState, table_setOptions } from \"@tanstack/table-core/static-functions\";\nimport { shallow } from \"@tanstack/lit-store\";\n\n//#region src/TableController.ts\n/**\n* A Lit ReactiveController for TanStack Table integration.\n*\n* Uses `constructReactivityFeature` from table-core to properly integrate\n* with the TanStack Store reactivity system, matching the pattern used by\n* all other framework adapters (React, Vue, Solid, Svelte, Angular).\n*\n* @example\n* ```ts\n* @customElement('my-table')\n* class MyTable extends LitElement {\n* private tableController = new TableController<typeof features, Person>(this)\n*\n* protected render() {\n* const table = this.tableController.table(\n* {\n* features,\n* columns,\n* data,\n* },\n* (state) => ({ sorting: state.sorting }),\n* )\n* // use table in your template...\n* }\n* }\n* ```\n*/\nvar TableController = class {\n\thost;\n\t_table = null;\n\t_rootSource;\n\t_storeSubscription;\n\t_capturedState;\n\t_capturedSnapshot;\n\t_hasSelector = false;\n\t_latestSelector;\n\t_lastSelected;\n\tconstructor(host) {\n\t\t(this.host = host).addController(this);\n\t}\n\t/**\n\t* Returns the Lit-backed table instance for the current render pass.\n\t*\n\t* The first call constructs the table with Lit reactivity bindings and\n\t* subscribes the host to table state/options changes. Later calls merge new\n\t* options into the same table instance and expose selected state through\n\t* `table.state`.\n\t*\n\t* @example\n\t* ```ts\n\t* const table = this.tableController.table(\n\t* { features, columns, data },\n\t* (state) => ({ sorting: state.sorting }),\n\t* )\n\t* ```\n\t*/\n\ttable(tableOptions, selector) {\n\t\tif (!this._table) {\n\t\t\tconst mergedOptions = {\n\t\t\t\t...tableOptions,\n\t\t\t\tfeatures: {\n\t\t\t\t\tcoreReactivityFeature: litReactivity(),\n\t\t\t\t\t...tableOptions.features\n\t\t\t\t},\n\t\t\t\tmergeOptions: (defaultOptions, newOptions) => {\n\t\t\t\t\treturn {\n\t\t\t\t\t\t...defaultOptions,\n\t\t\t\t\t\t...newOptions\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t};\n\t\t\tthis._table = constructTable(mergedOptions);\n\t\t\tthis._rootSource = createRenderPhaseSource(this._table.store, shallow);\n\t\t\tthis._setupSubscriptions();\n\t\t}\n\t\ttable_setOptions(this._table, (prev) => ({\n\t\t\t...prev,\n\t\t\t...tableOptions\n\t\t}), { syncExternalState: false });\n\t\tthis._capturedState = this._table.options.state;\n\t\tconst renderSnapshot = this._rootSource.get();\n\t\tthis._capturedSnapshot = renderSnapshot;\n\t\tthis._hasSelector = selector !== void 0;\n\t\tthis._latestSelector = selector;\n\t\tthis._lastSelected = selector ? selector(renderSnapshot) : renderSnapshot;\n\t\treturn {\n\t\t\t...this._table,\n\t\t\tsubscribe,\n\t\t\tFlexRender,\n\t\t\tget state() {\n\t\t\t\treturn selector?.(renderSnapshot) ?? renderSnapshot;\n\t\t\t}\n\t\t};\n\t}\n\t_setupSubscriptions() {\n\t\tif (this._table && !this._storeSubscription) this._storeSubscription = this._rootSource.subscribe((state) => {\n\t\t\tif (this._hasSelector) {\n\t\t\t\tconst nextSelected = this._latestSelector(state);\n\t\t\t\tif (shallow(this._lastSelected, nextSelected)) return;\n\t\t\t\tthis._lastSelected = nextSelected;\n\t\t\t}\n\t\t\tthis.host.requestUpdate();\n\t\t});\n\t}\n\thostConnected() {\n\t\tthis._setupSubscriptions();\n\t\tif (this._table) this.host.requestUpdate();\n\t}\n\thostUpdated() {\n\t\tif (!this._table) return;\n\t\tthis._rootSource.markCommitted(this._capturedSnapshot);\n\t\ttable_publishExternalState(this._table, this._capturedState ?? null, shallow);\n\t}\n\thostDisconnected() {\n\t\tthis._storeSubscription?.unsubscribe();\n\t\tthis._storeSubscription = void 0;\n\t}\n};\n\n//#endregion\nexport { TableController };","/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nclass s extends Event{constructor(s,t,e,o){super(\"context-request\",{bubbles:!0,composed:!0}),this.context=s,this.contextTarget=t,this.callback=e,this.subscribe=o??!1}}export{s as ContextRequestEvent};\n//# sourceMappingURL=context-request-event.js.map\n","/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nfunction n(n){return n}export{n as createContext};\n//# sourceMappingURL=create-context.js.map\n","import{ContextRequestEvent as t}from\"../context-request-event.js\";\n/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */class s{constructor(t,s,i,h){if(this.subscribe=!1,this.provided=!1,this.value=void 0,this.t=(t,s)=>{this.unsubscribe&&(this.unsubscribe!==s&&(this.provided=!1,this.unsubscribe()),this.subscribe||this.unsubscribe()),this.value=t,this.host.requestUpdate(),this.provided&&!this.subscribe||(this.provided=!0,this.callback&&this.callback(t,s)),this.unsubscribe=s},this.host=t,void 0!==s.context){const t=s;this.context=t.context,this.callback=t.callback,this.subscribe=t.subscribe??!1}else this.context=s,this.callback=i,this.subscribe=h??!1;this.host.addController(this)}hostConnected(){this.dispatchRequest()}hostDisconnected(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=void 0)}dispatchRequest(){this.host.dispatchEvent(new t(this.context,this.host,this.t,this.subscribe))}}export{s as ContextConsumer};\n//# sourceMappingURL=context-consumer.js.map\n","/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nclass s{get value(){return this.o}set value(s){this.setValue(s)}setValue(s,t=!1){const i=t||!Object.is(s,this.o);this.o=s,i&&this.updateObservers()}constructor(s){this.subscriptions=new Map,this.updateObservers=()=>{for(const[s,{disposer:t}]of this.subscriptions)s(this.o,t)},void 0!==s&&(this.value=s)}addCallback(s,t,i){if(!i)return void s(this.value);this.subscriptions.has(s)||this.subscriptions.set(s,{disposer:()=>{this.subscriptions.delete(s)},consumerHost:t});const{disposer:h}=this.subscriptions.get(s);s(this.value,h)}clearCallbacks(){this.subscriptions.clear()}}export{s as ValueNotifier};\n//# sourceMappingURL=value-notifier.js.map\n","import{ContextRequestEvent as t}from\"../context-request-event.js\";import{ValueNotifier as s}from\"../value-notifier.js\";\n/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */class e extends Event{constructor(t,s){super(\"context-provider\",{bubbles:!0,composed:!0}),this.context=t,this.contextTarget=s}}class i extends s{constructor(s,e,i){super(void 0!==e.context?e.initialValue:i),this.onContextRequest=t=>{if(t.context!==this.context)return;const s=t.contextTarget??t.composedPath()[0];s!==this.host&&(t.stopPropagation(),this.addCallback(t.callback,s,t.subscribe))},this.onProviderRequest=s=>{if(s.context!==this.context)return;if((s.contextTarget??s.composedPath()[0])===this.host)return;const e=new Set;for(const[s,{consumerHost:i}]of this.subscriptions)e.has(s)||(e.add(s),i.dispatchEvent(new t(this.context,i,s,!0)));s.stopPropagation()},this.host=s,void 0!==e.context?this.context=e.context:this.context=e,this.attachListeners(),this.host.addController?.(this)}attachListeners(){this.host.addEventListener(\"context-request\",this.onContextRequest),this.host.addEventListener(\"context-provider\",this.onProviderRequest)}hostConnected(){this.host.dispatchEvent(new e(this.context,this.host))}}export{i as ContextProvider,e as ContextProviderEvent};\n//# sourceMappingURL=context-provider.js.map\n","import { FlexRender, flexRender } from \"./flexRender.js\";\nimport { TableController } from \"./TableController.js\";\nimport { createColumnHelper } from \"@tanstack/table-core\";\nimport { ContextConsumer, ContextProvider, createContext } from \"@lit/context\";\n\n//#region src/createTableHook.ts\n/**\n* Creates a custom table hook with pre-bound components for composition.\n*\n* This is the table equivalent of TanStack Form's `createFormHook`. It allows you to:\n* - Define features, row models, and default options once, shared across all tables\n* - Register reusable table, cell, and header components\n* - Access table/cell/header instances via `@lit/context` in those components\n* - Get a `useAppTable` hook that returns an extended table with App wrapper functions\n* - Get a `createAppColumnHelper` function pre-bound to your features\n*\n* @example\n* ```ts\n* // hooks/table.ts\n* export const {\n* createAppColumnHelper,\n* useAppTable,\n* useTableContext,\n* useCellContext,\n* useHeaderContext,\n* } = createTableHook({\n* features: tableFeatures({\n* rowPaginationFeature,\n* rowSortingFeature,\n* columnFilteringFeature,\n* paginatedRowModel: createPaginatedRowModel(),\n* sortedRowModel: createSortedRowModel(),\n* filteredRowModel: createFilteredRowModel(),\n* sortFns,\n* filterFns,\n* }),\n* tableComponents: { PaginationControls, RowCount },\n* cellComponents: { TextCell, NumberCell },\n* headerComponents: { SortIndicator, ColumnFilter },\n* })\n*\n* // Create column helper with TFeatures already bound\n* const columnHelper = createAppColumnHelper<Person>()\n*\n* // my-table.ts\n* @customElement('my-table')\n* class MyTable extends LitElement {\n* private appTable = useAppTable(this, {\n* columns,\n* data: this.data,\n* })\n*\n* protected render() {\n* const table = this.appTable.table()\n*\n* return html`\n* <table>\n* <thead>\n* ${repeat(table.getHeaderGroups(), (hg) => hg.id, (hg) => html`\n* <tr>\n* ${hg.headers.map((h) => table.AppHeader(h, (header) => html`\n* <th>${header.FlexRender()}</th>\n* `))}\n* </tr>\n* `)}\n* </thead>\n* <tbody>\n* ${table.getRowModel().rows.map((row) => html`\n* <tr>\n* ${row.getAllCells().map((c) => table.AppCell(c, (cell) => html`\n* <td>${cell.FlexRender()}</td>\n* `))}\n* </tr>\n* `)}\n* </tbody>\n* </table>\n* `\n* }\n* }\n* ```\n*/\nfunction createTableHook({ tableComponents, cellComponents, headerComponents, ...defaultTableOptions }) {\n\tconst tableContext = createContext(Symbol(\"tanstack-table\"));\n\tconst cellContext = createContext(Symbol(\"tanstack-cell\"));\n\tconst headerContext = createContext(Symbol(\"tanstack-header\"));\n\t/**\n\t* Create a column helper pre-bound to the features and components configured in this table hook.\n\t* The cell, header, and footer contexts include pre-bound components (e.g., `cell.TextCell`).\n\t* @example\n\t* ```ts\n\t* const columnHelper = createAppColumnHelper<Person>()\n\t*\n\t* const columns = [\n\t* columnHelper.accessor('firstName', {\n\t* header: 'First Name',\n\t* cell: ({ cell }) => cell.FlexRender(), // cell has pre-bound components!\n\t* }),\n\t* columnHelper.accessor('age', {\n\t* header: 'Age',\n\t* cell: ({ cell }) => cell.NumberCell(),\n\t* }),\n\t* ]\n\t* ```\n\t*/\n\tfunction createAppColumnHelper() {\n\t\treturn createColumnHelper();\n\t}\n\t/**\n\t* Access the table instance from within a custom element that is a descendant\n\t* of the element using `useAppTable`.\n\t* Uses `@lit/context` ContextConsumer to retrieve the table from the nearest ancestor provider.\n\t* TFeatures is already known from the createTableHook call.\n\t*\n\t* @example\n\t* ```ts\n\t* @customElement('pagination-controls')\n\t* class PaginationControls extends LitElement {\n\t* private _table = useTableContext(this)\n\t*\n\t* protected render() {\n\t* const table = this._table.value\n\t* if (!table) return html``\n\t* return html`\n\t* <button @click=${() => table.previousPage()}>Prev</button>\n\t* <button @click=${() => table.nextPage()}>Next</button>\n\t* `\n\t* }\n\t* }\n\t* ```\n\t*/\n\tfunction useTableContext(host) {\n\t\treturn new ContextConsumer(host, {\n\t\t\tcontext: tableContext,\n\t\t\tsubscribe: true\n\t\t});\n\t}\n\t/**\n\t* Access the cell instance from within a custom element that is a descendant\n\t* of an element providing cell context.\n\t* Uses `@lit/context` ContextConsumer to retrieve the cell.\n\t* TFeatures is already known from the createTableHook call.\n\t*\n\t* @example\n\t* ```ts\n\t* @customElement('text-cell')\n\t* class TextCell extends LitElement {\n\t* private _cell = useCellContext(this)\n\t*\n\t* protected render() {\n\t* const cell = this._cell.value\n\t* if (!cell) return html``\n\t* return html`<span>${cell.getValue()}</span>`\n\t* }\n\t* }\n\t* ```\n\t*/\n\tfunction useCellContext(host) {\n\t\treturn new ContextConsumer(host, {\n\t\t\tcontext: cellContext,\n\t\t\tsubscribe: true\n\t\t});\n\t}\n\t/**\n\t* Access the header instance from within a custom element that is a descendant\n\t* of an element providing header context.\n\t* Uses `@lit/context` ContextConsumer to retrieve the header.\n\t* TFeatures is already known from the createTableHook call.\n\t*\n\t* @example\n\t* ```ts\n\t* @customElement('sort-indicator')\n\t* class SortIndicator extends LitElement {\n\t* private _header = useHeaderContext(this)\n\t*\n\t* protected render() {\n\t* const header = this._header.value\n\t* if (!header) return html``\n\t* const sorted = header.column.getIsSorted()\n\t* return html`${sorted === 'asc' ? '🔼' : sorted === 'desc' ? '🔽' : ''}`\n\t* }\n\t* }\n\t* ```\n\t*/\n\tfunction useHeaderContext(host) {\n\t\treturn new ContextConsumer(host, {\n\t\t\tcontext: headerContext,\n\t\t\tsubscribe: true\n\t\t});\n\t}\n\t/**\n\t* Enhanced table hook that returns a controller-like object with a `table()` method.\n\t* The returned table has App wrapper functions and pre-bound tableComponents\n\t* attached directly to the table object.\n\t*\n\t* Default options from createTableHook are automatically merged with\n\t* the options passed here. Options passed here take precedence.\n\t*\n\t* TFeatures is already known from the createTableHook call; TData is inferred from the data prop.\n\t*\n\t* @example\n\t* ```ts\n\t* @customElement('my-table')\n\t* class MyTable extends LitElement {\n\t* private appTable = useAppTable(this, {\n\t* columns,\n\t* data: this.data,\n\t* })\n\t*\n\t* protected render() {\n\t* const table = this.appTable.table()\n\t* return html`...`\n\t* }\n\t* }\n\t* ```\n\t*/\n\tfunction useAppTable(host, tableOptions, selector) {\n\t\tconst controller = new TableController(host);\n\t\tconst provider = new ContextProvider(host, { context: tableContext });\n\t\treturn { table() {\n\t\t\tconst mergedOptions = {\n\t\t\t\t...defaultTableOptions,\n\t\t\t\t...tableOptions\n\t\t\t};\n\t\t\tconst table = controller.table(mergedOptions, selector);\n\t\t\tprovider.setValue(table);\n\t\t\tfunction AppCell(cell, renderFn) {\n\t\t\t\tconst cellFlexRender = () => FlexRender({ cell });\n\t\t\t\tconst boundCellComponents = {};\n\t\t\t\tfor (const [key, fn] of Object.entries(cellComponents ?? {})) boundCellComponents[key] = () => fn(cell);\n\t\t\t\treturn renderFn(Object.assign(cell, {\n\t\t\t\t\tFlexRender: cellFlexRender,\n\t\t\t\t\t...boundCellComponents\n\t\t\t\t}));\n\t\t\t}\n\t\t\tfunction AppHeader(header, renderFn) {\n\t\t\t\tconst headerFlexRender = () => flexRender(header.column.columnDef.header, header.getContext());\n\t\t\t\tconst boundHeaderComponents = {};\n\t\t\t\tfor (const [key, fn] of Object.entries(headerComponents ?? {})) boundHeaderComponents[key] = () => fn(header);\n\t\t\t\treturn renderFn(Object.assign(header, {\n\t\t\t\t\tFlexRender: headerFlexRender,\n\t\t\t\t\t...boundHeaderComponents\n\t\t\t\t}));\n\t\t\t}\n\t\t\tfunction AppFooter(header, renderFn) {\n\t\t\t\tconst footerFlexRender = () => flexRender(header.column.columnDef.footer, header.getContext());\n\t\t\t\tconst boundFooterComponents = {};\n\t\t\t\tfor (const [key, fn] of Object.entries(headerComponents ?? {})) boundFooterComponents[key] = () => fn(header);\n\t\t\t\treturn renderFn(Object.assign(header, {\n\t\t\t\t\tFlexRender: footerFlexRender,\n\t\t\t\t\t...boundFooterComponents\n\t\t\t\t}));\n\t\t\t}\n\t\t\treturn Object.assign(table, {\n\t\t\t\tAppCell,\n\t\t\t\tAppHeader,\n\t\t\t\tAppFooter,\n\t\t\t\tFlexRender,\n\t\t\t\t...tableComponents ?? {}\n\t\t\t});\n\t\t} };\n\t}\n\treturn {\n\t\tappFeatures: defaultTableOptions.features,\n\t\tcreateAppColumnHelper,\n\t\tuseAppTable,\n\t\tuseTableContext,\n\t\tuseCellContext,\n\t\tuseHeaderContext\n\t};\n}\n\n//#endregion\nexport { createTableHook };","import { FlexRender, flexRender } from \"./flexRender.js\";\nimport { SubscribeDirective, subscribe } from \"./subscribe-directive.js\";\nimport { TableController } from \"./TableController.js\";\nimport { createTableHook } from \"./createTableHook.js\";\n\nexport * from \"@tanstack/table-core\"\n\nexport { FlexRender, SubscribeDirective, TableController, createTableHook, flexRender, subscribe };","//#region src/remove-accents.ts\nconst characterMap = {\n\tÀ: \"A\",\n\tÁ: \"A\",\n\tÂ: \"A\",\n\tÃ: \"A\",\n\tÄ: \"A\",\n\tÅ: \"A\",\n\tẤ: \"A\",\n\tẮ: \"A\",\n\tẲ: \"A\",\n\tẴ: \"A\",\n\tẶ: \"A\",\n\tÆ: \"AE\",\n\tẦ: \"A\",\n\tẰ: \"A\",\n\tȂ: \"A\",\n\tÇ: \"C\",\n\tḈ: \"C\",\n\tÈ: \"E\",\n\tÉ: \"E\",\n\tÊ: \"E\",\n\tË: \"E\",\n\tẾ: \"E\",\n\tḖ: \"E\",\n\tỀ: \"E\",\n\tḔ: \"E\",\n\tḜ: \"E\",\n\tȆ: \"E\",\n\tÌ: \"I\",\n\tÍ: \"I\",\n\tÎ: \"I\",\n\tÏ: \"I\",\n\tḮ: \"I\",\n\tȊ: \"I\",\n\tÐ: \"D\",\n\tÑ: \"N\",\n\tÒ: \"O\",\n\tÓ: \"O\",\n\tÔ: \"O\",\n\tÕ: \"O\",\n\tÖ: \"O\",\n\tØ: \"O\",\n\tỐ: \"O\",\n\tṌ: \"O\",\n\tṒ: \"O\",\n\tȎ: \"O\",\n\tÙ: \"U\",\n\tÚ: \"U\",\n\tÛ: \"U\",\n\tÜ: \"U\",\n\tÝ: \"Y\",\n\tà: \"a\",\n\tá: \"a\",\n\tâ: \"a\",\n\tã: \"a\",\n\tä: \"a\",\n\tå: \"a\",\n\tấ: \"a\",\n\tắ: \"a\",\n\tẳ: \"a\",\n\tẵ: \"a\",\n\tặ: \"a\",\n\tæ: \"ae\",\n\tầ: \"a\",\n\tằ: \"a\",\n\tȃ: \"a\",\n\tç: \"c\",\n\tḉ: \"c\",\n\tè: \"e\",\n\té: \"e\",\n\tê: \"e\",\n\të: \"e\",\n\tế: \"e\",\n\tḗ: \"e\",\n\tề: \"e\",\n\tḕ: \"e\",\n\tḝ: \"e\",\n\tȇ: \"e\",\n\tì: \"i\",\n\tí: \"i\",\n\tî: \"i\",\n\tï: \"i\",\n\tḯ: \"i\",\n\tȋ: \"i\",\n\tð: \"d\",\n\tñ: \"n\",\n\tò: \"o\",\n\tó: \"o\",\n\tô: \"o\",\n\tõ: \"o\",\n\tö: \"o\",\n\tø: \"o\",\n\tố: \"o\",\n\tṍ: \"o\",\n\tṓ: \"o\",\n\tȏ: \"o\",\n\tù: \"u\",\n\tú: \"u\",\n\tû: \"u\",\n\tü: \"u\",\n\tý: \"y\",\n\tÿ: \"y\",\n\tĀ: \"A\",\n\tā: \"a\",\n\tĂ: \"A\",\n\tă: \"a\",\n\tĄ: \"A\",\n\tą: \"a\",\n\tĆ: \"C\",\n\tć: \"c\",\n\tĈ: \"C\",\n\tĉ: \"c\",\n\tĊ: \"C\",\n\tċ: \"c\",\n\tČ: \"C\",\n\tč: \"c\",\n\tC̆: \"C\",\n\tc̆: \"c\",\n\tĎ: \"D\",\n\tď: \"d\",\n\tĐ: \"D\",\n\tđ: \"d\",\n\tĒ: \"E\",\n\tē: \"e\",\n\tĔ: \"E\",\n\tĕ: \"e\",\n\tĖ: \"E\",\n\tė: \"e\",\n\tĘ: \"E\",\n\tę: \"e\",\n\tĚ: \"E\",\n\tě: \"e\",\n\tĜ: \"G\",\n\tǴ: \"G\",\n\tĝ: \"g\",\n\tǵ: \"g\",\n\tĞ: \"G\",\n\tğ: \"g\",\n\tĠ: \"G\",\n\tġ: \"g\",\n\tĢ: \"G\",\n\tģ: \"g\",\n\tĤ: \"H\",\n\tĥ: \"h\",\n\tĦ: \"H\",\n\tħ: \"h\",\n\tḪ: \"H\",\n\tḫ: \"h\",\n\tĨ: \"I\",\n\tĩ: \"i\",\n\tĪ: \"I\",\n\tī: \"i\",\n\tĬ: \"I\",\n\tĭ: \"i\",\n\tĮ: \"I\",\n\tį: \"i\",\n\tİ: \"I\",\n\tı: \"i\",\n\tIJ: \"IJ\",\n\tij: \"ij\",\n\tĴ: \"J\",\n\tĵ: \"j\",\n\tĶ: \"K\",\n\tķ: \"k\",\n\tḰ: \"K\",\n\tḱ: \"k\",\n\tK̆: \"K\",\n\tk̆: \"k\",\n\tĹ: \"L\",\n\tĺ: \"l\",\n\tĻ: \"L\",\n\tļ: \"l\",\n\tĽ: \"L\",\n\tľ: \"l\",\n\tĿ: \"L\",\n\tŀ: \"l\",\n\tŁ: \"l\",\n\tł: \"l\",\n\tḾ: \"M\",\n\tḿ: \"m\",\n\tM̆: \"M\",\n\tm̆: \"m\",\n\tŃ: \"N\",\n\tń: \"n\",\n\tŅ: \"N\",\n\tņ: \"n\",\n\tŇ: \"N\",\n\tň: \"n\",\n\tʼn: \"n\",\n\tN̆: \"N\",\n\tn̆: \"n\",\n\tŌ: \"O\",\n\tō: \"o\",\n\tŎ: \"O\",\n\tŏ: \"o\",\n\tŐ: \"O\",\n\tő: \"o\",\n\tŒ: \"OE\",\n\tœ: \"oe\",\n\tP̆: \"P\",\n\tp̆: \"p\",\n\tŔ: \"R\",\n\tŕ: \"r\",\n\tŖ: \"R\",\n\tŗ: \"r\",\n\tŘ: \"R\",\n\tř: \"r\",\n\tR̆: \"R\",\n\tr̆: \"r\",\n\tȒ: \"R\",\n\tȓ: \"r\",\n\tŚ: \"S\",\n\tś: \"s\",\n\tŜ: \"S\",\n\tŝ: \"s\",\n\tŞ: \"S\",\n\tȘ: \"S\",\n\tș: \"s\",\n\tş: \"s\",\n\tŠ: \"S\",\n\tš: \"s\",\n\tŢ: \"T\",\n\tţ: \"t\",\n\tț: \"t\",\n\tȚ: \"T\",\n\tŤ: \"T\",\n\tť: \"t\",\n\tŦ: \"T\",\n\tŧ: \"t\",\n\tT̆: \"T\",\n\tt̆: \"t\",\n\tŨ: \"U\",\n\tũ: \"u\",\n\tŪ: \"U\",\n\tū: \"u\",\n\tŬ: \"U\",\n\tŭ: \"u\",\n\tŮ: \"U\",\n\tů: \"u\",\n\tŰ: \"U\",\n\tű: \"u\",\n\tŲ: \"U\",\n\tų: \"u\",\n\tȖ: \"U\",\n\tȗ: \"u\",\n\tV̆: \"V\",\n\tv̆: \"v\",\n\tŴ: \"W\",\n\tŵ: \"w\",\n\tẂ: \"W\",\n\tẃ: \"w\",\n\tX̆: \"X\",\n\tx̆: \"x\",\n\tŶ: \"Y\",\n\tŷ: \"y\",\n\tŸ: \"Y\",\n\tY̆: \"Y\",\n\ty̆: \"y\",\n\tŹ: \"Z\",\n\tź: \"z\",\n\tŻ: \"Z\",\n\tż: \"z\",\n\tŽ: \"Z\",\n\tž: \"z\",\n\tſ: \"s\",\n\tƒ: \"f\",\n\tƠ: \"O\",\n\tơ: \"o\",\n\tƯ: \"U\",\n\tư: \"u\",\n\tǍ: \"A\",\n\tǎ: \"a\",\n\tǏ: \"I\",\n\tǐ: \"i\",\n\tǑ: \"O\",\n\tǒ: \"o\",\n\tǓ: \"U\",\n\tǔ: \"u\",\n\tǕ: \"U\",\n\tǖ: \"u\",\n\tǗ: \"U\",\n\tǘ: \"u\",\n\tǙ: \"U\",\n\tǚ: \"u\",\n\tǛ: \"U\",\n\tǜ: \"u\",\n\tỨ: \"U\",\n\tứ: \"u\",\n\tṸ: \"U\",\n\tṹ: \"u\",\n\tǺ: \"A\",\n\tǻ: \"a\",\n\tǼ: \"AE\",\n\tǽ: \"ae\",\n\tǾ: \"O\",\n\tǿ: \"o\",\n\tÞ: \"TH\",\n\tþ: \"th\",\n\tṔ: \"P\",\n\tṕ: \"p\",\n\tṤ: \"S\",\n\tṥ: \"s\",\n\tX́: \"X\",\n\tx́: \"x\",\n\tЃ: \"Г\",\n\tѓ: \"г\",\n\tЌ: \"К\",\n\tќ: \"к\",\n\tA̋: \"A\",\n\ta̋: \"a\",\n\tE̋: \"E\",\n\te̋: \"e\",\n\tI̋: \"I\",\n\ti̋: \"i\",\n\tǸ: \"N\",\n\tǹ: \"n\",\n\tỒ: \"O\",\n\tồ: \"o\",\n\tṐ: \"O\",\n\tṑ: \"o\",\n\tỪ: \"U\",\n\từ: \"u\",\n\tẀ: \"W\",\n\tẁ: \"w\",\n\tỲ: \"Y\",\n\tỳ: \"y\",\n\tȀ: \"A\",\n\tȁ: \"a\",\n\tȄ: \"E\",\n\tȅ: \"e\",\n\tȈ: \"I\",\n\tȉ: \"i\",\n\tȌ: \"O\",\n\tȍ: \"o\",\n\tȐ: \"R\",\n\tȑ: \"r\",\n\tȔ: \"U\",\n\tȕ: \"u\",\n\tB̌: \"B\",\n\tb̌: \"b\",\n\tČ̣: \"C\",\n\tč̣: \"c\",\n\tÊ̌: \"E\",\n\tê̌: \"e\",\n\tF̌: \"F\",\n\tf̌: \"f\",\n\tǦ: \"G\",\n\tǧ: \"g\",\n\tȞ: \"H\",\n\tȟ: \"h\",\n\tJ̌: \"J\",\n\tǰ: \"j\",\n\tǨ: \"K\",\n\tǩ: \"k\",\n\tM̌: \"M\",\n\tm̌: \"m\",\n\tP̌: \"P\",\n\tp̌: \"p\",\n\tQ̌: \"Q\",\n\tq̌: \"q\",\n\tŘ̩: \"R\",\n\tř̩: \"r\",\n\tṦ: \"S\",\n\tṧ: \"s\",\n\tV̌: \"V\",\n\tv̌: \"v\",\n\tW̌: \"W\",\n\tw̌: \"w\",\n\tX̌: \"X\",\n\tx̌: \"x\",\n\tY̌: \"Y\",\n\ty̌: \"y\",\n\tA̧: \"A\",\n\ta̧: \"a\",\n\tB̧: \"B\",\n\tb̧: \"b\",\n\tḐ: \"D\",\n\tḑ: \"d\",\n\tȨ: \"E\",\n\tȩ: \"e\",\n\tƐ̧: \"E\",\n\tɛ̧: \"e\",\n\tḨ: \"H\",\n\tḩ: \"h\",\n\tI̧: \"I\",\n\ti̧: \"i\",\n\tƗ̧: \"I\",\n\tɨ̧: \"i\",\n\tM̧: \"M\",\n\tm̧: \"m\",\n\tO̧: \"O\",\n\to̧: \"o\",\n\tQ̧: \"Q\",\n\tq̧: \"q\",\n\tU̧: \"U\",\n\tu̧: \"u\",\n\tX̧: \"X\",\n\tx̧: \"x\",\n\tZ̧: \"Z\",\n\tz̧: \"z\"\n};\nconst chars = Object.keys(characterMap).join(\"|\");\nconst allAccents = new RegExp(chars, \"g\");\nfunction removeAccents(str) {\n\treturn str.replace(allAccents, (match) => {\n\t\treturn characterMap[match];\n\t});\n}\n\n//#endregion\nexport { removeAccents };","import { removeAccents } from \"./remove-accents.js\";\n\n//#region src/index.ts\n/**\n* @name match-sorter\n* @license MIT license.\n* @copyright (c) 2099 Kent C. Dodds\n* @author Kent C. Dodds <me@kentcdodds.com> (https://kentcdodds.com)\n*/\nconst rankings = {\n\tCASE_SENSITIVE_EQUAL: 7,\n\tEQUAL: 6,\n\tSTARTS_WITH: 5,\n\tWORD_STARTS_WITH: 4,\n\tCONTAINS: 3,\n\tACRONYM: 2,\n\tMATCHES: 1,\n\tNO_MATCH: 0\n};\n/**\n* Gets the highest ranking value for the given item based on its values for the given keys\n* @param {*} item - the item to rank\n* @param {String} value - the value to rank against\n* @param {Object} options - options to control the ranking\n* @return {{rank: Number, accessorIndex: Number, accessorThreshold: Number}} - the highest ranking\n*/\nfunction rankItem(item, value, options) {\n\toptions = options || {};\n\toptions.threshold = options.threshold ?? rankings.MATCHES;\n\tif (!options.accessors) {\n\t\tconst rank = getMatchRanking(item, value, options);\n\t\treturn {\n\t\t\trankedValue: item,\n\t\t\trank,\n\t\t\taccessorIndex: -1,\n\t\t\taccessorThreshold: options.threshold,\n\t\t\tpassed: rank >= options.threshold\n\t\t};\n\t}\n\tconst valuesToRank = getAllValuesToRank(item, options.accessors);\n\tconst rankingInfo = {\n\t\trankedValue: item,\n\t\trank: rankings.NO_MATCH,\n\t\taccessorIndex: -1,\n\t\taccessorThreshold: options.threshold,\n\t\tpassed: false\n\t};\n\tfor (let i = 0; i < valuesToRank.length; i++) {\n\t\tconst rankValue = valuesToRank[i];\n\t\tlet newRank = getMatchRanking(rankValue.itemValue, value, options);\n\t\tconst { minRanking, maxRanking, threshold = options.threshold } = rankValue.attributes;\n\t\tif (newRank < minRanking && newRank >= rankings.MATCHES) newRank = minRanking;\n\t\telse if (newRank > maxRanking) newRank = maxRanking;\n\t\tnewRank = Math.min(newRank, maxRanking);\n\t\tif (newRank >= threshold && newRank > rankingInfo.rank) {\n\t\t\trankingInfo.rank = newRank;\n\t\t\trankingInfo.passed = true;\n\t\t\trankingInfo.accessorIndex = i;\n\t\t\trankingInfo.accessorThreshold = threshold;\n\t\t\trankingInfo.rankedValue = rankValue.itemValue;\n\t\t}\n\t}\n\treturn rankingInfo;\n}\n/**\n* Gives a rankings score based on how well the two strings match.\n* @param {String} testString - the string to test against\n* @param {String} stringToRank - the string to rank\n* @param {Object} options - options for the match (like keepDiacritics for comparison)\n* @returns {Number} the ranking for how well stringToRank matches testString\n*/\nfunction getMatchRanking(testString, stringToRank, options) {\n\ttestString = prepareValueForComparison(testString, options);\n\tstringToRank = prepareValueForComparison(stringToRank, options);\n\tif (stringToRank.length > testString.length) return rankings.NO_MATCH;\n\tif (testString === stringToRank) return rankings.CASE_SENSITIVE_EQUAL;\n\ttestString = testString.toLowerCase();\n\tstringToRank = stringToRank.toLowerCase();\n\tif (testString === stringToRank) return rankings.EQUAL;\n\tif (testString.startsWith(stringToRank)) return rankings.STARTS_WITH;\n\tif (testString.includes(` ${stringToRank}`)) return rankings.WORD_STARTS_WITH;\n\tif (testString.includes(stringToRank)) return rankings.CONTAINS;\n\telse if (stringToRank.length === 1) return rankings.NO_MATCH;\n\tif (getAcronym(testString).includes(stringToRank)) return rankings.ACRONYM;\n\treturn getClosenessRanking(testString, stringToRank);\n}\n/**\n* Generates an acronym for a string.\n*\n* @param {String} string the string for which to produce the acronym\n* @returns {String} the acronym\n*/\nfunction getAcronym(string) {\n\tlet acronym = \"\";\n\tstring.split(\" \").forEach((wordInString) => {\n\t\twordInString.split(\"-\").forEach((splitByHyphenWord) => {\n\t\t\tacronym += splitByHyphenWord.substr(0, 1);\n\t\t});\n\t});\n\treturn acronym;\n}\n/**\n* Returns a score based on how spread apart the\n* characters from the stringToRank are within the testString.\n* A number close to rankings.MATCHES represents a loose match. A number close\n* to rankings.MATCHES + 1 represents a tighter match.\n* @param {String} testString - the string to test against\n* @param {String} stringToRank - the string to rank\n* @returns {Number} the number between rankings.MATCHES and\n* rankings.MATCHES + 1 for how well stringToRank matches testString\n*/\nfunction getClosenessRanking(testString, stringToRank) {\n\tlet matchingInOrderCharCount = 0;\n\tlet charNumber = 0;\n\tfunction findMatchingCharacter(matchChar, string, index) {\n\t\tfor (let j = index, J = string.length; j < J; j++) if (string[j] === matchChar) {\n\t\t\tmatchingInOrderCharCount += 1;\n\t\t\treturn j + 1;\n\t\t}\n\t\treturn -1;\n\t}\n\tfunction getRanking(spread) {\n\t\tconst spreadPercentage = 1 / spread;\n\t\tconst inOrderPercentage = matchingInOrderCharCount / stringToRank.length;\n\t\treturn rankings.MATCHES + inOrderPercentage * spreadPercentage;\n\t}\n\tconst firstIndex = findMatchingCharacter(stringToRank[0], testString, 0);\n\tif (firstIndex < 0) return rankings.NO_MATCH;\n\tcharNumber = firstIndex;\n\tfor (let i = 1, I = stringToRank.length; i < I; i++) {\n\t\tconst matchChar = stringToRank[i];\n\t\tcharNumber = findMatchingCharacter(matchChar, testString, charNumber);\n\t\tif (!(charNumber > -1)) return rankings.NO_MATCH;\n\t}\n\treturn getRanking(charNumber - firstIndex);\n}\n/**\n* Sorts items that have a rank, index, and accessorIndex\n* @param {Object} a - the first item to sort\n* @param {Object} b - the second item to sort\n* @return {Number} -1 if a should come first, 1 if b should come first, 0 if equal\n*/\nfunction compareItems(a, b) {\n\treturn a.rank === b.rank ? 0 : a.rank > b.rank ? -1 : 1;\n}\n/**\n* Prepares value for comparison by stringifying it, removing diacritics (if specified)\n* @param {String} value - the value to clean\n* @param {Object} options - {keepDiacritics: whether to remove diacritics}\n* @return {String} the prepared value\n*/\nfunction prepareValueForComparison(value, { keepDiacritics }) {\n\tvalue = `${value}`;\n\tif (!keepDiacritics) value = removeAccents(value);\n\treturn value;\n}\n/**\n* Gets value for key in item at arbitrarily nested keypath\n* @param {Object} item - the item\n* @param {Object|Function} key - the potentially nested keypath or property callback\n* @return {Array} - an array containing the value(s) at the nested keypath\n*/\nfunction getItemValues(item, accessor) {\n\tlet accessorFn = accessor;\n\tif (typeof accessor === \"object\") accessorFn = accessor.accessor;\n\tconst value = accessorFn(item);\n\tif (value == null) return [];\n\tif (Array.isArray(value)) return value;\n\treturn [String(value)];\n}\n/**\n* Gets all the values for the given keys in the given item and returns an array of those values\n* @param item - the item from which the values will be retrieved\n* @param keys - the keys to use to retrieve the values\n* @return objects with {itemValue, attributes}\n*/\nfunction getAllValuesToRank(item, accessors) {\n\tconst allValues = [];\n\tfor (let j = 0, J = accessors.length; j < J; j++) {\n\t\tconst accessor = accessors[j];\n\t\tconst attributes = getAccessorAttributes(accessor);\n\t\tconst itemValues = getItemValues(item, accessor);\n\t\tfor (let i = 0, I = itemValues.length; i < I; i++) allValues.push({\n\t\t\titemValue: itemValues[i],\n\t\t\tattributes\n\t\t});\n\t}\n\treturn allValues;\n}\nconst defaultKeyAttributes = {\n\tmaxRanking: Infinity,\n\tminRanking: -Infinity\n};\n/**\n* Gets all the attributes for the given accessor\n* @param accessor - the accessor from which the attributes will be retrieved\n* @return object containing the accessor's attributes\n*/\nfunction getAccessorAttributes(accessor) {\n\tif (typeof accessor === \"function\") return defaultKeyAttributes;\n\treturn {\n\t\t...defaultKeyAttributes,\n\t\t...accessor\n\t};\n}\n\n//#endregion\nexport { compareItems, rankItem, rankings };","// ── <sken-datatable> — framework-ready data table (M1 shell) ─────────\n//\n// M1 status: ALPHA. The component renders a table from `rows` + `columns`\n// props. Sorting, filtering, and pagination arrive in M1.x/M2 — see the\n// research report at /tmp/sken-datatable-research.md and the roadmap.\n//\n// Substrate: `@tanstack/lit-table` (Lit ReactiveController + headless\n// TanStack Table). This primitive owns ONLY the visual layer; the consumer\n// owns data fetching, sorting state, pagination state, server-side work.\n// Nord DS is the reference architecture (see §1 of the research report).\n//\n// API contract (M1):\n// - `rows`: Array<RowData> — JS property, NOT attribute (arrays can't be\n// serialized as HTML attributes without lossy JSON round-trips).\n// - `columns`: Array<ColumnDef> — JS property, same reason.\n// - `getRowId`: required for row identity (selection, expansion, server-side\n// filtering all depend on it). We throw a dev-mode console error if\n// missing — but DON'T throw in prod (M1 doesn't have a state machine that\n// requires it, only M1.x selection/expansion will).\n// - `loading`: boolean — shows a skeleton overlay.\n// - `empty`: string | undefined — text shown when rows is empty.\n// - Slot `empty` (optional): custom empty content. Overrides `empty` prop.\n//\n// Theme: tokens come from the light DOM via `var(--sken-*)`. CSS Custom\n// Properties cross the shadow boundary by spec — no adoptStyleSheets\n// bridge needed.\n\nimport {\n TableController,\n columnFilteringFeature,\n createFilteredRowModel,\n createPaginatedRowModel,\n createSortedRowModel,\n globalFilteringFeature,\n rowPaginationFeature,\n rowSortingFeature,\n tableFeatures,\n type ColumnDef,\n type RowData,\n type SortingState,\n type TableFeatures,\n} from '@tanstack/lit-table'\nimport { LitElement, css, html, nothing, type TemplateResult } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\n// Side-effect namespace import to defeat Rollup tree-shaking.\n// `@tanstack/table-core` declares \"sideEffects\": false, so a\n// direct named import + a void call is dead-code-eliminated\n// by Rollup. Importing the namespace forces Rollup to keep the\n// module in the bundle (the namespace binding is observable\n// to the bundler even if the named imports are not used). The\n// named import then resolves to the same function and is used\n// at the call site below.\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport { rankItem } from '@tanstack/match-sorter-utils'\nimport * as _tableCoreStaticNS from '@tanstack/table-core/static-functions'\n\n/**\n * Sken-specific column def. We re-export the relevant TanStack shape so\n * the contract doesn't leak `import type` to consumers.\n */\nexport type SkenColumnDef<TData extends RowData> = ColumnDef<TableFeatures, TData>\n\n/**\n * Options that are required at construction time but can be passed as\n * either a property (preferred) or constructor arg.\n */\nexport interface SkenDataTableOptions<TData extends RowData> {\n rows: TData[]\n columns: SkenColumnDef<TData>[]\n getRowId: (row: TData, index: number) => string\n loading?: boolean\n empty?: string\n}\n\n@customElement('sken-datatable')\nexport class SkenDataTable<TData extends RowData> extends LitElement {\n /**\n * The rows to display. JS property, NOT attribute.\n * @example el.rows = [{ id: 1, name: 'Alice' }]\n */\n @property({ attribute: false }) rows: TData[] = []\n\n /**\n * Column definitions. JS property, NOT attribute.\n * @example el.columns = [{ accessorKey: 'name', header: 'Name' }]\n */\n @property({ attribute: false }) columns: SkenColumnDef<TData>[] = []\n\n /**\n * Required for row identity. Pass a function that returns a stable\n * unique id per row.\n * @example el.getRowId = (row) => row.id\n */\n @property({ attribute: false }) getRowId: ((row: TData, index: number) => string) | undefined =\n undefined\n\n /** Shows a skeleton overlay when true. */\n @property({ reflect: true, type: Boolean }) loading = false\n\n /** Text shown when `rows` is empty. Use the `empty` slot for richer content. */\n @property() empty: string | undefined = undefined\n\n /**\n * Current sorting state. JS property, NOT attribute.\n * Pass `undefined` (or omit) for uncontrolled mode — the primitive\n * keeps the state internally and the table reflects clicks on\n * sortable headers. Pass an array for controlled mode — the consumer\n * owns the state and reacts to `sken-sort-change` events.\n */\n @property({ attribute: false }) sorting: SortingState | undefined = undefined\n\n /**\n * Current global filter value. JS property, NOT attribute.\n * Pass `undefined` (or omit) for uncontrolled mode (state is kept\n * inside the primitive). Pass a string for controlled mode.\n */\n @property({ attribute: false }) globalFilter: string | undefined = undefined\n\n /**\n * Placeholder for the auto-generated filter input. The primitive\n * renders a built-in `<input>` above the table when this is set\n * (default). Pass `false` to hide it (consumer renders their own via\n * the `filter` slot). Pass a string to use as placeholder.\n */\n @property() filterPlaceholder: string = 'Filter…'\n\n /**\n * Current pagination state. JS property, NOT attribute.\n * Pass `undefined` for uncontrolled mode (default pageSize = 10,\n * pageIndex = 0). Pass an object for controlled mode.\n */\n @property({ attribute: false }) pagination: { pageIndex: number; pageSize: number } | undefined =\n undefined\n\n /** Default page size when uncontrolled. Default: 10. */\n @property({ attribute: 'default-page-size', type: Number }) defaultPageSize: number = 10\n\n /**\n * Internal state: the TanStack table instance, owned by `TableController`.\n * Re-renders on any state change. We keep a private field instead of\n * recomputing per render to avoid re-allocating on every Lit update.\n */\n // Internal state for uncontrolled mode. When the consumer passes\n // `undefined` for `sorting` / `globalFilter` / `pagination`, we keep\n // the state here as plain fields. We trigger Lit re-renders\n // explicitly in the `on*Change` callbacks via `this.requestUpdate()`\n // (the change callback fires outside Lit's reactive context, so the\n // `@state` decorator doesn't pick it up across the `controller.table`\n // call boundary).\n #uncontrolledSorting: SortingState = []\n #uncontrolledGlobalFilter: string = ''\n #uncontrolledPagination: { pageIndex: number; pageSize: number } = {\n pageIndex: 0,\n pageSize: 10,\n }\n\n // The full feature set we use, built with the v9 `tableFeatures()`\n // factory. Per the v9 migration SKILL: each `create*RowModel`\n // factory is a sibling of its feature in the same object, not\n // nested under the feature key.\n #features = tableFeatures({\n rowSortingFeature,\n sortedRowModel: createSortedRowModel(),\n columnFilteringFeature,\n filteredRowModel: createFilteredRowModel(),\n globalFilteringFeature,\n rowPaginationFeature,\n paginatedRowModel: createPaginatedRowModel(),\n })\n\n // We initialise the TableController lazily on first connection. The\n // field-initializer approach breaks when the host element is created\n // via `document.createElement` in a non-Lit context (some test runners\n // do that), because `this.host` is undefined at field-init time.\n //\n // The `Features` type is computed from `tableFeatures({...})`'s\n // return type. We can't use `typeof this.#features` in a field\n // initializer (no `this` available), so the `as` cast on the\n // constructor call covers the same ground at the use site.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n #tableController: TableController<any, TData> | undefined = undefined\n\n #getTableController() {\n if (this.#tableController === undefined) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n this.#tableController = new TableController<any, TData>(this)\n }\n return this.#tableController\n }\n\n /**\n * Fuzzy global filter: ranks each row against the filter value\n * using `@tanstack/match-sorter-utils`. Returns true if the row\n * \"passes\" the rank threshold (any character sequence match).\n *\n * Note: `rankItem` ranks strings (or values returned by an\n * `accessors` fn), not plain objects — passing the row directly\n * coerces it to `\"[object Object]\"` and never matches. We flatten\n * the row to a space-joined string of its values, which is the\n * standard TanStack v8 + match-sorter-utils recipe (see the\n * TanStack docs: `globalFilterFn: (row, _id, value) =>\n * rankItem(Object.values(row.original).join(' '), value).passed`).\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n #fuzzyFilter = (row: any, _columnId: string, filterValue: unknown): boolean => {\n const flat = Object.values(row.original ?? {})\n .map((v) => (v === null || v === undefined ? '' : String(v)))\n .join(' ')\n const itemRank = rankItem(flat, String(filterValue ?? ''))\n return itemRank.passed\n }\n\n /**\n * Dev-mode warning if `getRowId` is missing. We don't throw in prod\n * because M1 doesn't need it; M1.x (selection/expansion) will.\n */\n #warnIfNoGetRowId(): void {\n if (this.getRowId === undefined && globalThis.console !== undefined) {\n globalThis.console.warn(\n '[sken-datatable] Missing `getRowId`. This is required in M1.x once ' +\n 'row selection, expansion, or server-side filtering are added. ' +\n 'See ADR-0006 §4 and the research report §1.',\n )\n }\n }\n\n override connectedCallback(): void {\n super.connectedCallback()\n this.#warnIfNoGetRowId()\n // Initialise uncontrolled pagination with the configured\n // `defaultPageSize`. Field initializers can't read `this` so we\n // do it here on first connection.\n if (this.#uncontrolledPagination.pageSize === 10 && this.defaultPageSize !== 10) {\n this.#uncontrolledPagination = {\n pageIndex: 0,\n pageSize: this.defaultPageSize,\n }\n }\n }\n\n override render(): TemplateResult {\n if (this.loading) {\n // Loading state. The primitive provides the container\n // (role=\"status\" + aria-busy=\"true\") and a styled slot for\n // the actual spinner. The datatable does NOT pull in the\n // <sken-icon> primitive itself — that's the consumer's job\n // (ADR-0011: the icon family is Sken-owned, but the\n // datatable is not the place to depend on it). The CSS\n // animation below uses ::slotted(sken-icon) so the consumer\n // can drop in <sken-icon name=\"spinner\"> and get the spin\n // for free.\n return html`\n <div class=\"loading\" role=\"status\" aria-busy=\"true\">\n <slot name=\"loading\"></slot>\n </div>\n `\n }\n\n if (this.rows.length === 0) {\n return this.#renderEmpty()\n }\n\n // Controlled vs uncontrolled pattern. The primitive ALWAYS\n // passes a fully-populated `state` object to TanStack. For\n // controlled slices, the value comes from the consumer's prop;\n // for uncontrolled slices, the value comes from the primitive's\n // State plumbing (v9 + Lit + TableController):\n //\n // For controlled slices (consumer provides a value), we pass\n // it in both `state` and `initialState` so the row model\n // reflects the consumer's value on the same render that\n // receives the new props.\n //\n // For uncontrolled slices, we pass `initialState` ONLY when\n // the slice is non-empty. The reason: in v9, including\n // `sorting: []` in `state` or `initialState` makes\n // `atoms.sorting.get()` return null and breaks the\n // `getSortedRowModel` pipeline. The safe path is to omit the\n // key entirely and let TanStack initialise the atom lazily\n // on the first state mutation (click on a sortable header).\n const state: Record<string, unknown> = {}\n const initialState: Record<string, unknown> = {}\n if (this.sorting !== undefined && this.sorting.length > 0) {\n state.sorting = this.sorting\n initialState.sorting = this.sorting\n }\n if (this.globalFilter !== undefined) {\n state.globalFilter = this.globalFilter\n initialState.globalFilter = this.globalFilter\n }\n if (this.pagination !== undefined) {\n state.pagination = this.pagination\n initialState.pagination = this.pagination\n } else {\n // Pagination always has a default (pageIndex 0, pageSize\n // defaultPageSize). It's safe to seed unconditionally because\n // the pagination atom accepts an object — unlike sorting\n // which fails on an empty array.\n initialState.pagination = this.#uncontrolledPagination\n }\n\n // The `as` cast is required because TanStack's `TableOptions<TFeatures, TData>`\n // narrows TFeatures from the `features` field, but we pass the full\n // core + stock features object. Runtime is correct; the cast just\n // bypasses the over-strict feature inference.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const table = this.#getTableController().table({\n data: this.rows,\n columns: this.columns,\n getRowId: this.getRowId ?? ((_row, index) => String(index)),\n features: this.#features,\n globalFilterFn: this.#fuzzyFilter,\n state,\n initialState,\n onSortingChange: (updater: unknown) => {\n const current = this.sorting ?? this.#uncontrolledSorting\n const nextSorting =\n typeof updater === 'function'\n ? (updater as (old: SortingState) => SortingState)(current)\n : (updater as SortingState)\n if (this.sorting === undefined) {\n this.#uncontrolledSorting = nextSorting\n this.requestUpdate()\n }\n this.dispatchEvent(\n new CustomEvent<SortingState>('sken-sort-change', {\n detail: nextSorting,\n bubbles: true,\n composed: true,\n }),\n )\n },\n onGlobalFilterChange: (updater: unknown) => {\n const current = this.globalFilter ?? this.#uncontrolledGlobalFilter\n const nextFilter =\n typeof updater === 'function'\n ? (updater as (old: string) => string)(current)\n : (updater as string)\n if (this.globalFilter === undefined) {\n this.#uncontrolledGlobalFilter = nextFilter\n this.requestUpdate()\n }\n this.dispatchEvent(\n new CustomEvent<string>('sken-global-filter-change', {\n detail: nextFilter,\n bubbles: true,\n composed: true,\n }),\n )\n },\n onPaginationChange: (updater: unknown) => {\n const current = this.pagination ?? this.#uncontrolledPagination\n const next =\n typeof updater === 'function'\n ? (updater as (old: typeof current) => typeof current)(current)\n : (updater as typeof current)\n if (this.pagination === undefined) {\n this.#uncontrolledPagination = next\n this.requestUpdate()\n }\n this.dispatchEvent(\n new CustomEvent<typeof current>('sken-pagination-change', {\n detail: next,\n bubbles: true,\n composed: true,\n }),\n )\n },\n } as any)\n\n // TanStack's `TableController` deliberately defers the external `state`\n // → internal store sync to `hostUpdated()` (after Lit has patched the\n // DOM). That's the right move for React/Solid (the store commit is\n // async) but the wrong one for our render path: we read\n // `table.getRowModel()` here, and that read needs the sorted /\n // filtered / paginated model to be live *in this render* — not one\n // commit later. Without this, every controlled sort/filter/page\n // action lags a render and tests + the browser probe see the\n // pre-sync state. We re-publish the captured state before reading\n // the row model; the controller's own `hostUpdated` call later is a\n // safe no-op (the compare function is `===`, the values match).\n //\n // TanStack v9's `TableController.table_setOptions(..., { syncExternalState: false })`\n // defers the external `state` to internal store sync to\n // `hostUpdated()` (after Lit has patched the DOM). The render\n // reads `table.getRowModel()` with the OLD snapshot, so the\n // first render with `state.sorting = [{id, desc}]` does not\n // reflect the sort. Fix: call `table_publishExternalState` from\n // `@tanstack/table-core/static-functions` (subpath, not\n // re-exported from the main index) in `render()` right after\n // building the `table` and before the first `getHeaderGroups()`\n // / `getRowModel()`. The controller's own `hostUpdated` call\n // later is a safe no-op (the compare function is `===`, the\n // values match).\n //\n // **Tree-shake guard**: `@tanstack/table-core` declares\n // `\"sideEffects\": false` in its package.json. Rollup treats\n // every import from that package as pure, and `table_publishExternalState`\n // returns `void` — so an isolated expression-statement call is\n // tree-shaken away in the production bundle. The symptom is\n // silent: tests pass (happy-dom happens to flush in a way that\n // hides the lag), the bundle drops ~150 bytes, and the browser\n // stops reflecting controlled sort/filter/page. We defeat\n // the tree-shake by assigning the call's return value to a\n // module-level `Reflect`-style sink — Rollup treats\n // `Reflect.set` as side-effectful and keeps the call. The cast\n // through `any` covers the `TFeatures` mismatch (the public\n // type is open).\n // Use the namespace import (not the named one) to call the\n // function. The named import is still here for type-only\n // reasons, but the actual call goes through the namespace\n // binding — which Rollup cannot tree-shake because the\n // namespace import is a side-effect anchor (any other code\n // path that reads `_tableCoreStaticNS` would force the\n // module to stay; here the IIFE reads the namespace and so\n // the call survives the bundler).\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ;(_tableCoreStaticNS as any).table_publishExternalState(\n table as any,\n state,\n (a: unknown, b: unknown) => a === b,\n )\n\n return html`\n <div class=\"filter-bar\">\n <slot name=\"filter\">\n <input\n class=\"filter-input\"\n type=\"search\"\n placeholder=${this.filterPlaceholder}\n aria-label=\"Filter rows\"\n .value=${this.globalFilter ?? this.#uncontrolledGlobalFilter}\n @input=${(e: Event) => {\n const input = e.target as HTMLInputElement\n if (this.globalFilter === undefined) {\n this.#uncontrolledGlobalFilter = input.value\n this.requestUpdate()\n }\n this.dispatchEvent(\n new CustomEvent<string>('sken-global-filter-change', {\n detail: input.value,\n bubbles: true,\n composed: true,\n }),\n )\n }}\n />\n </slot>\n </div>\n <table>\n <thead>\n ${table.getHeaderGroups().map((headerGroup: unknown) => {\n const group = headerGroup as unknown as {\n id: string\n headers: ReadonlyArray<{\n id: string\n column: {\n id: string\n columnDef: { header?: unknown; enableSorting?: boolean }\n getCanSort: () => boolean\n getIsSorted: () => false | 'asc' | 'desc'\n getToggleSortingHandler: () => undefined | ((e: unknown) => void)\n }\n }>\n }\n return html`\n <tr>\n ${group.headers.map((header) => {\n const headerRenderable = header.column.columnDef.header\n const headerText =\n typeof headerRenderable === 'string' ? headerRenderable : header.column.id\n const canSort = header.column.getCanSort()\n const isSorted = header.column.getIsSorted()\n const sortIndicator = isSorted === 'asc' ? '▲' : isSorted === 'desc' ? '▼' : ''\n const handler = header.column.getToggleSortingHandler()\n return html`\n <th\n scope=\"col\"\n part=\"header-cell\"\n data-column-id=${header.column.id}\n class=${canSort ? 'sortable' : ''}\n aria-sort=${\n isSorted === 'asc'\n ? 'ascending'\n : isSorted === 'desc'\n ? 'descending'\n : 'none'\n }\n @click=${canSort && handler ? handler : null}\n >\n <span class=\"header-text\">${headerText}</span>\n ${\n canSort\n ? html`<span\n class=\"sort-indicator\"\n data-state=${isSorted || 'none'}\n aria-hidden=\"true\"\n >${sortIndicator}</span\n >`\n : nothing\n }\n </th>\n `\n })}\n </tr>\n `\n })}\n </thead>\n <tbody>\n ${table.getRowModel().rows.map((row: unknown) => {\n const r = row as unknown as {\n id: string\n getAllCells: () => ReadonlyArray<{\n id: string\n column: { id: string }\n getValue: () => unknown\n }>\n }\n return html`\n <tr part=\"row\" data-row-id=${r.id}>\n ${r.getAllCells().map((cell) => {\n const cellValue = cell.getValue()\n return html`\n <td part=\"cell\" data-column-id=${cell.column.id}>\n ${cellValue === null || cellValue === undefined ? nothing : String(cellValue)}\n </td>\n `\n })}\n </tr>\n `\n })}\n </tbody>\n </table>\n\n <div class=\"pagination-bar\" part=\"pagination\">\n <slot name=\"pagination\">\n ${(() => {\n const t = table as unknown as {\n state: { pagination: { pageIndex: number; pageSize: number } }\n getPageCount: () => number\n getCanPreviousPage: () => boolean\n getCanNextPage: () => boolean\n previousPage: () => void\n nextPage: () => void\n setPageIndex: (i: number) => void\n }\n const { pageIndex, pageSize } = t.state.pagination\n const pageCount = t.getPageCount()\n return html`\n <button\n type=\"button\"\n class=\"page-btn\"\n ?disabled=${!t.getCanPreviousPage()}\n @click=${() => t.previousPage()}\n aria-label=\"Previous page\"\n >\n ← Prev\n </button>\n <span class=\"page-info\"> Page ${pageIndex + 1} of ${Math.max(pageCount, 1)} </span>\n <button\n type=\"button\"\n class=\"page-btn\"\n ?disabled=${!t.getCanNextPage()}\n @click=${() => t.nextPage()}\n aria-label=\"Next page\"\n >\n Next →\n </button>\n <span class=\"page-size-info\">${pageSize} per page</span>\n `\n })()}\n </slot>\n </div>\n `\n }\n\n #renderEmpty(): TemplateResult {\n return html`\n <div class=\"empty\" role=\"status\">\n <slot name=\"empty\">${this.empty ?? 'No rows'}</slot>\n </div>\n `\n }\n\n static styles = css`\n :host {\n display: block;\n inline-size: 100%;\n font-family: var(--sken-family-sans);\n color: var(--sken-foreground);\n }\n\n table {\n inline-size: 100%;\n border-collapse: collapse;\n border: 1px solid var(--sken-border);\n border-radius: var(--sken-md);\n overflow: hidden;\n }\n\n thead {\n background: var(--sken-muted);\n }\n\n th,\n td {\n padding-block: var(--sken-2);\n padding-inline: var(--sken-3);\n text-align: start;\n border-block-end: 1px solid var(--sken-border);\n }\n\n th {\n font-weight: var(--sken-weight-semibold);\n color: var(--sken-foreground);\n }\n\n th.sortable {\n cursor: pointer;\n user-select: none;\n }\n\n th.sortable:hover {\n background: var(--sken-muted);\n }\n\n th .header-text {\n margin-inline-end: 0.25rem;\n }\n\n th .sort-indicator {\n display: inline-block;\n min-inline-size: 0.75rem;\n color: var(--sken-muted-foreground);\n font-size: 0.75em;\n }\n\n th .sort-indicator[data-state='asc'],\n th .sort-indicator[data-state='desc'] {\n color: var(--sken-primary);\n }\n\n tbody tr:last-child td {\n border-block-end: none;\n }\n\n tbody tr:hover {\n background: var(--sken-muted);\n }\n\n .empty {\n padding-block: var(--sken-4);\n padding-inline: var(--sken-3);\n text-align: center;\n color: var(--sken-muted-foreground);\n border: 1px solid var(--sken-border);\n border-radius: var(--sken-md);\n }\n\n .loading {\n display: flex;\n align-items: center;\n justify-content: center;\n padding-block: var(--sken-6);\n min-block-size: 12rem;\n border: 1px solid var(--sken-border);\n border-radius: var(--sken-md);\n color: var(--sken-muted-foreground);\n }\n\n /* The loading region renders a loading slot. The consumer\n supplies the spinner (typically a sken-icon with name\n spinner, which animates itself per its name) and the\n datatable provides the layout + accessible status region.\n The keyframe is owned by the icon package, not here,\n because the rotation is part of what spinner means: a\n static spinner would be a different icon. */\n\n .filter-bar {\n margin-block-end: 0.75rem;\n }\n\n .filter-input {\n box-sizing: border-box;\n inline-size: 100%;\n max-inline-size: 20rem;\n padding-block: var(--sken-2);\n padding-inline: var(--sken-3);\n border: 1px solid var(--sken-border);\n border-radius: var(--sken-md);\n background: var(--sken-background);\n color: var(--sken-foreground);\n font-family: var(--sken-family-sans);\n font-size: var(--sken-size-md);\n }\n\n .filter-input::placeholder {\n color: var(--sken-muted-foreground);\n }\n\n .filter-input:focus-visible {\n outline: 2px solid var(--sken-primary);\n outline-offset: 1px;\n }\n\n .pagination-bar {\n display: flex;\n align-items: center;\n gap: 0.75rem;\n margin-block-start: 0.75rem;\n font-size: 0.875rem;\n color: var(--sken-muted-foreground);\n }\n\n .page-btn {\n padding-block: var(--sken-1);\n padding-inline: var(--sken-3);\n border: 1px solid var(--sken-border);\n border-radius: var(--sken-sm);\n background: var(--sken-background);\n color: var(--sken-foreground);\n font-family: inherit;\n font-size: inherit;\n cursor: pointer;\n }\n\n .page-btn:hover:not(:disabled) {\n background: var(--sken-muted);\n }\n\n .page-btn:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n }\n\n .page-info {\n color: var(--sken-foreground);\n }\n `\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'sken-datatable': SkenDataTable<RowData>\n }\n}\n"],"x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAaA,SAAS,EAAW,GAAM,GAAO;CAGhC,OAFI,KAAS,OAAgC,OACzC,OAAO,KAAS,aAAmB,EAAK,CAAK,IAC1C;A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G;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,IAAI;CACJ,IAAI;CACJ,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH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EAAS,EAAE,WAAW,GAAM,CAAC,CAAA,GAAA,EAAA,WAAA,YAAA,KAAA,CAAA,GAI7B,EAAA,CAAA,EAAS;CAAE,SAAS;CAAM,MAAM;AAAQ,CAAC,CAAA,GAAA,EAAA,WAAA,WAAA,KAAA,CAAA,GAGzC,EAAA,CAAA,EAAS,CAAA,GAAA,EAAA,WAAA,SAAA,KAAA,CAAA,GAST,EAAA,CAAA,EAAS,EAAE,WAAW,GAAM,CAAC,CAAA,GAAA,EAAA,WAAA,WAAA,KAAA,CAAA,GAO7B,EAAA,CAAA,EAAS,EAAE,WAAW,GAAM,CAAC,CAAA,GAAA,EAAA,WAAA,gBAAA,KAAA,CAAA,GAQ7B,EAAA,CAAA,EAAS,CAAA,GAAA,EAAA,WAAA,qBAAA,KAAA,CAAA,GAOT,EAAA,CAAA,EAAS,EAAE,WAAW,GAAM,CAAC,CAAA,GAAA,EAAA,WAAA,cAAA,KAAA,CAAA,GAI7B,EAAA,CAAA,EAAS;CAAE,WAAW;CAAqB,MAAM;AAAO,CAAC,CAAA,GAAA,EAAA,WAAA,mBAAA,KAAA,CAAA,GA7D3D,IAAA,EAAA,CAAA,EAAc,gBAAgB,CAAA,GAAA,CAAA"}
|
package/dist/sken-datatable.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as e } from "./sken-datatable-
|
|
1
|
+
import { t as e } from "./sken-datatable-CEXcvhM-.js";
|
|
2
2
|
export { e as SkenDataTable };
|
package/dist/sken-layout.js
CHANGED
|
@@ -108,14 +108,8 @@ var c = {
|
|
|
108
108
|
the header-content variant; the inline style overrides
|
|
109
109
|
them for variants with more or fewer roles, and for
|
|
110
110
|
consumers that have unfilled regions. */
|
|
111
|
-
grid-template-areas: var(
|
|
112
|
-
|
|
113
|
-
'topbar' 'body'
|
|
114
|
-
);
|
|
115
|
-
grid-template-rows: var(
|
|
116
|
-
--sken-layout-grid-rows,
|
|
117
|
-
'auto 1fr'
|
|
118
|
-
);
|
|
111
|
+
grid-template-areas: var(--sken-layout-grid-areas, 'topbar' 'body');
|
|
112
|
+
grid-template-rows: var(--sken-layout-grid-rows, 'auto 1fr');
|
|
119
113
|
}
|
|
120
114
|
|
|
121
115
|
/* ── Per-cell grid items ─────────────────────────────────────
|
|
@@ -147,6 +141,7 @@ var c = {
|
|
|
147
141
|
border-bottom: 1px solid var(--sken-border);
|
|
148
142
|
}
|
|
149
143
|
.body {
|
|
144
|
+
grid-area: body;
|
|
150
145
|
display: grid;
|
|
151
146
|
grid-template-columns: 1fr;
|
|
152
147
|
grid-template-areas: 'content';
|
|
@@ -172,7 +167,6 @@ var c = {
|
|
|
172
167
|
border-inline-end: 1px solid var(--sken-border);
|
|
173
168
|
}
|
|
174
169
|
.content {
|
|
175
|
-
grid-area: content;
|
|
176
170
|
min-block-size: 0;
|
|
177
171
|
background: var(
|
|
178
172
|
--sken-layout-region-content-background,
|
|
@@ -286,11 +280,11 @@ var c = {
|
|
|
286
280
|
`;
|
|
287
281
|
}
|
|
288
282
|
render() {
|
|
289
|
-
let e = this.#n, t = e.includes("content"), n = e.includes("sidebar"), i = e.map((e) => e === "content" ? "\"body\"" : `"${e}"`).join("\n
|
|
283
|
+
let e = this.#n, t = e.includes("content"), n = e.includes("sidebar"), i = e.map((e) => e === "content" ? "\"body\"" : `"${e}"`).join("\n"), a = e.map((e) => e === "content" ? "1fr" : "auto").join(" "), o = [
|
|
290
284
|
"body",
|
|
291
285
|
n ? "with-sidebar" : "",
|
|
292
286
|
n && this.sidebarPosition === "end" ? "sidebar-end" : ""
|
|
293
|
-
].filter(Boolean).join(" "), s = `--sken-layout-grid-areas:
|
|
287
|
+
].filter(Boolean).join(" "), s = `--sken-layout-grid-areas: ${i}; --sken-layout-grid-rows: ${a};`;
|
|
294
288
|
return r`
|
|
295
289
|
<div class="grid" style=${s} part="grid">
|
|
296
290
|
${e.includes("topbar") ? r`<div class="topbar" part="topbar">
|
package/dist/sken-layout.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sken-layout.js","names":["#activeRoles","#visibleRoles","#syncRegionSlotAttributes","#regionSlotObserver","#recomputeVisibleRoles","#wireSlotChangeListeners","#unwireSlotChangeListeners","#slotChangeHandlers"],"sources":["../src/components/sken-layout.ts"],"sourcesContent":["// ── <sken-layout> — structural layout primitive ────────────────────\n// Defines the page-level structure of a multi-region interface\n// (topbar, primary nav, sidebar, content, footer) without imposing\n// what lives inside each region. Composition by contract:\n//\n// <sken-layout variant=\"header-sidebar\">\n// <sken-layout-region name=\"topbar\">…</sken-layout-region>\n// <sken-layout-region name=\"primary-nav\">…</sken-layout-region>\n// <sken-layout-region name=\"sidebar\">…</sken-layout-region>\n// <sken-layout-region name=\"content\">…</sken-layout-region>\n// </sken-layout>\n//\n// Design notes (v0.4.2 — fix for SKEN-LAYOUT-EMPTY-REGIONS.md):\n// - The shadow root projects the consumer's light-DOM regions via\n// NAMED slots, one per role. Each named slot sits inside a wrapper\n// element (e.g. <div class=\"topbar\">…</div>) that is the actual\n// grid item of the host's CSS grid.\n// - Roles the active variant does not include are not rendered at\n// all (the variant drives which slots exist in the shadow root).\n// - Roles the active variant includes but the consumer did not\n// fill are also not rendered. The host's `grid-template-areas`\n// is computed dynamically to exclude the empty rows/columns, so\n// the grid re-flows to fill the available space. This is the\n// third in a series of layout-rendering fixes:\n// - 0.4.0: variant-aware region rendering (only roles the\n// variant includes are emitted).\n// - 0.4.1: slot= attribute on the regions, so the browser\n// projects them to the named slots.\n// - 0.4.2 (this): content-aware grid template, so empty\n// rows/columns collapse.\n// - We detect which slots have content via `slot.assignedElements()`\n// on first render (after the browser has projected the\n// consumer's regions) and on every `slotchange` event (for\n// dynamic content — e.g. a sidebar the consumer can empty at\n// runtime). The result is stored in `#visibleRoles`, which\n// drives both the shadow template and the host's inline\n// `grid-template-areas` style.\n//\n// See ADR-0006 for the substrate decision. See the\n// @sken-ds/contracts types `SkenLayoutProps`, `SkenLayoutSlots`,\n// `SkenLayoutVariant`, `SkenLayoutVariantRoles` for the contract\n// surface.\n\nimport type {\n SkenLayoutDensity,\n SkenLayoutRegionRole,\n SkenLayoutSidebarPosition,\n SkenLayoutSidebarSize,\n SkenLayoutTopbarMode,\n SkenLayoutVariant,\n SkenLayoutVariantRolesMap,\n} from '@sken-ds/contracts'\nimport { SkenLayoutVariantRoles } from '@sken-ds/contracts'\nimport { LitElement, css, html, unsafeCSS, type PropertyValues } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\nimport './sken-layout-region.js'\n\n/**\n * Sidebar width in `rem` per size concept. The product can\n * override with `--sken-layout-sidebar-width` (CSS custom\n * property) if it needs a different value.\n */\nconst SIDEBAR_WIDTH: Record<SkenLayoutSidebarSize, string> = {\n sm: '12rem',\n md: '16rem',\n lg: '20rem',\n}\n\n/**\n * Per-cell background tokens. The values reference the\n * Sken color tokens, not raw colors, so a theme switch\n * (`data-theme=\"dark\"`) recolors every cell without the\n * primitive knowing about it.\n *\n * Mapping rationale:\n * - topbar is on `--sken-card` (white) because it is the\n * \"elevated\" chrome; the border-bottom separates it from\n * the page below.\n * - primary-nav is on `--sken-background` (page colour) so\n * it sits flush with the page; the border-bottom separates\n * it from the workspace.\n * - sidebar is on `--sken-muted` (subtle off-white) with a\n * border-inline-end; it is a \"rail\", not a \"page\".\n * - content is on `--sken-background`; no border (the\n * workspace is unbounded).\n * - footer is on `--sken-muted` with a border-top; it is\n * the same role as the sidebar (chrome).\n */\nconst REGION_BACKGROUND: Record<SkenLayoutRegionRole, string> = {\n topbar: 'var(--sken-card)',\n 'primary-nav': 'var(--sken-background)',\n sidebar: 'var(--sken-muted)',\n content: 'var(--sken-background)',\n footer: 'var(--sken-muted)',\n}\n\n@customElement('sken-layout')\nexport class SkenLayout extends LitElement {\n @property({ reflect: true }) variant: SkenLayoutVariant = 'header-content'\n @property({ attribute: 'topbar-mode', reflect: true }) topbarMode: SkenLayoutTopbarMode = 'fixed'\n @property({ attribute: 'sidebar-position', reflect: true })\n sidebarPosition: SkenLayoutSidebarPosition = 'start'\n @property({ attribute: 'sidebar-size', reflect: true }) sidebarSize: SkenLayoutSidebarSize = 'md'\n @property({ reflect: true }) density: SkenLayoutDensity = 'none'\n\n /**\n * MutationObserver that watches the host's light DOM for\n * `<sken-layout-region>` children. For each region, if the\n * consumer (or a framework adapter) did not set the HTML\n * `slot=\"<role>\"` attribute, we set it ourselves. This is\n * defense-in-depth: the host's shadow root uses 5 named\n * `<slot>` elements (one per role) and the browser's\n * slot-projection mechanism only projects a light-DOM child\n * into a named slot if the child carries the matching\n * `slot=\"<name>\"` attribute. Without it, every named slot\n * receives zero assigned elements and the regions render\n * as empty wrappers — the page looks almost empty.\n *\n * A future framework adapter (React, Svelte, plain HTML) can\n * either set the `slot` attribute on its own (the documented\n * contract) or rely on this observer to do it. Setting it\n * explicitly is still preferred for clarity, but the\n * observer is the safety net that prevents the silent\n * \"everything renders empty\" failure mode that v0.4.0\n * shipped with.\n */\n #regionSlotObserver: MutationObserver | null = null\n\n /**\n * Roles the active variant renders in the shadow root. Sourced\n * from {@link SkenLayoutVariantRoles}. Used to drive the\n * template (only the slots the variant includes are projected)\n * and to apply the per-variant `with-sidebar` class on the\n * body sub-grid wrapper.\n */\n get #activeRoles(): readonly SkenLayoutRegionRole[] {\n return (SkenLayoutVariantRoles as SkenLayoutVariantRolesMap)[this.variant]\n }\n\n /**\n * Roles the host grid should render in the shadow root AND\n * reserve space for in the grid template. This is the\n * intersection of the active variant's roles and the roles\n * whose slot actually has content (i.e. the consumer filled\n * the corresponding `<sken-layout-region>`). When a role is\n * in the variant but the consumer did not fill the slot, the\n * role is excluded — the wrapper is not rendered, and the\n * corresponding row/column in `grid-template-areas` is removed\n * so the surrounding regions re-flow.\n *\n * Updated on `firstUpdated` (after the browser has projected\n * the initial set of regions into the named slots) and on\n * every `slotchange` event (for dynamic content).\n */\n #visibleRoles: readonly SkenLayoutRegionRole[] = this.#activeRoles\n\n /**\n * Compute the current set of visible roles by walking the\n * host's light-DOM children and checking which ones carry\n * a `slot=\"<role>\"` attribute that matches one of the active\n * variant's roles.\n *\n * We deliberately do NOT use `slot.assignedElements()` (which\n * requires the browser to have done the slot projection and\n * is therefore timing-sensitive in shadow-DOM tests) — we\n * read the slot attribute directly on the children. This is\n * observable at any point, including during the first\n * `firstUpdated` call.\n *\n * The `#syncRegionSlotAttributes` method (called from\n * `connectedCallback` and again in `firstUpdated`) ensures\n * that the slot attribute is in place on every child region\n * before this method runs. The slotchange listener is\n * responsible for re-running this method when the consumer\n * mutates the slot attribute at runtime.\n */\n #recomputeVisibleRoles(): void {\n const visible: SkenLayoutRegionRole[] = []\n for (const role of this.#activeRoles) {\n // A role is \"filled\" if at least one direct child of\n // the host has slot=\"<role>\". We do not care about the\n // child's own children (an empty region is still a\n // filled region — the consumer can render a placeholder\n // inside an otherwise empty slot).\n const filled = Array.from(this.children).some(\n (c) => c.getAttribute && c.getAttribute('slot') === role,\n )\n if (filled) visible.push(role)\n }\n // Avoid re-renders if nothing changed.\n if (\n visible.length === this.#visibleRoles.length &&\n visible.every((r, i) => r === this.#visibleRoles[i])\n ) {\n return\n }\n this.#visibleRoles = visible\n this.requestUpdate()\n }\n\n override connectedCallback(): void {\n super.connectedCallback()\n // Walk the current children synchronously (so the first\n // render after connection already has the slot= attribute\n // in place), then attach the observer to catch future\n // mutations (the consumer can add or remove regions\n // dynamically, e.g. when switching the active variant in\n // a shared layout component).\n //\n // The observer also re-runs `#recomputeVisibleRoles`. The\n // MutationObserver fires on every add/remove of a direct\n // child, which is exactly the signal we need to refresh\n // the visible-roles set (the slotchange event is a poor\n // substitute because it only fires for slots that already\n // exist in the shadow root — a region the consumer adds\n // for a slot that the previous render omitted will not\n // fire slotchange because the slot does not exist yet).\n this.#syncRegionSlotAttributes()\n this.#regionSlotObserver = new MutationObserver(() => {\n this.#syncRegionSlotAttributes()\n this.#recomputeVisibleRoles()\n })\n this.#regionSlotObserver.observe(this, { childList: true, subtree: false })\n }\n\n /**\n * Lit lifecycle hook called after the first render. Three\n * things happen here, in order:\n *\n * 1. `#syncRegionSlotAttributes()` — second-pass sync point\n * for regions whose `name` was set as a property (not as\n * an attribute) before the region was connected. The\n * `name` property is `reflect: true`, so the attribute is\n * written only after the region is connected and Lit runs\n * its first render. Without this second pass, a region\n * whose `name` was set as a property (not as an attribute)\n * would not have its `slot` attribute set by the time the\n * browser tries to project it.\n *\n * 2. `#recomputeVisibleRoles()` — first pass at discovering\n * which slots have content. This MUST happen after the\n * browser has done its first slot projection, which is\n * exactly what `firstUpdated` is. Without this, the\n * initial render would assume all variant roles are\n * visible, and the grid template would reserve rows for\n * empty regions. The render that follows this call\n * produces the correct (collapsed) grid template.\n *\n * 3. Wire up `slotchange` listeners on the named slots, so\n * dynamic content (a consumer emptying or filling a slot\n * at runtime) re-triggers the same re-computation.\n */\n protected override firstUpdated(_changedProperties: PropertyValues): void {\n super.firstUpdated(_changedProperties)\n this.#syncRegionSlotAttributes()\n this.#recomputeVisibleRoles()\n this.#wireSlotChangeListeners()\n }\n\n /**\n * Lit lifecycle hook called after every render (including the\n * first). We re-run `#recomputeVisibleRoles` when the variant\n * changes because the set of valid roles (`#activeRoles`)\n * depends on the variant, and a region that was visible under\n * the previous variant may no longer be a member of the new\n * variant. Without this, switching the variant prop would\n * leave stale roles in `#visibleRoles` until the next\n * `slotchange` event.\n *\n * We do NOT call `requestUpdate` here — `#recomputeVisibleRoles`\n * already does that when the visible set actually changed. If\n * the set did not change, no extra render is needed.\n */\n protected override updated(_changedProperties: PropertyValues): void {\n super.updated(_changedProperties)\n if (_changedProperties.has('variant')) {\n this.#recomputeVisibleRoles()\n }\n }\n\n /**\n * Attach a `slotchange` listener to every named slot in the\n * shadow root. The browser fires `slotchange` on a slot\n * whenever the set of light-DOM children projected into it\n * changes (add, remove, or replace). This is a defense in\n * depth alongside the `MutationObserver` (which is the\n * primary signal for adds/removes): the slotchange listener\n * catches a consumer who replaces a region's content with\n * another consumer-defined element while keeping the same\n * `slot=\"<role>\"` attribute (the MutationObserver on\n * childList would not fire for a same-tag-name replacement\n * that swaps the element in place, though in practice the\n * browser usually fires childList anyway for new nodes).\n *\n * The listeners are attached in `firstUpdated` (so the slots\n * exist) and torn down in `disconnectedCallback`.\n */\n #slotChangeHandlers: Array<{ slot: HTMLSlotElement; handler: () => void }> = []\n\n #wireSlotChangeListeners(): void {\n // Tear down the previous batch first (in case the variant\n // changed and the shadow root was re-rendered, replacing\n // the old slot elements with new ones).\n this.#unwireSlotChangeListeners()\n const shadow = this.shadowRoot\n if (!shadow) return\n for (const slot of Array.from(shadow.querySelectorAll('slot'))) {\n const handler = () => this.#recomputeVisibleRoles()\n slot.addEventListener('slotchange', handler)\n this.#slotChangeHandlers.push({ slot, handler })\n }\n }\n\n #unwireSlotChangeListeners(): void {\n for (const { slot, handler } of this.#slotChangeHandlers) {\n slot.removeEventListener('slotchange', handler)\n }\n this.#slotChangeHandlers = []\n }\n\n override disconnectedCallback(): void {\n super.disconnectedCallback()\n this.#regionSlotObserver?.disconnect()\n this.#regionSlotObserver = null\n this.#unwireSlotChangeListeners()\n }\n\n /**\n * For each direct `<sken-layout-region>` child of the host,\n * set the `slot=\"<name>\"` HTML attribute if it is missing\n * or does not match the region's role. The browser's\n * slot-projection mechanism reads this attribute to project\n * the child into the matching named `<slot>` inside the\n * shadow root.\n *\n * We only touch direct children (not the entire subtree)\n * because the contract is that `<sken-layout-region>` lives\n * as a direct child of `<sken-layout>`; nested regions\n * are not a supported pattern.\n */\n #syncRegionSlotAttributes(): void {\n for (const child of Array.from(this.children)) {\n if (!(child instanceof HTMLElement)) continue\n if (child.tagName.toLowerCase() !== 'sken-layout-region') continue\n const role = child.getAttribute('name')\n if (!role) continue\n if (child.getAttribute('slot') === role) continue\n child.setAttribute('slot', role)\n }\n }\n\n static styles = css`\n /* ── The host ────────────────────────────────────────────────\n The host owns the page-level grid. The topbar / primary-nav\n / footer sit in their own rows; the body is a sub-grid that\n holds the sidebar (when present) and the content. */\n :host {\n display: block;\n block-size: 100dvh;\n background: var(--sken-background, Canvas);\n color: var(--sken-foreground, CanvasText);\n font-family: var(--sken-family-sans, system-ui, sans-serif);\n }\n\n /* The actual grid is a child <div class=\"grid\">. We use a\n child rather than the host itself for two reasons:\n\n 1. The grid template is computed per-render based on\n which roles have content (see #visibleRoles and\n render()). Setting grid-template-areas on the host\n via an inline style would work, but the host has a\n handful of other responsibilities (background, color,\n font) and keeping the grid in a child makes the\n separation cleaner.\n\n 2. CSS grid in shadow DOM: putting the grid on a child\n avoids any quirks of the host element's display\n behaviour (the host is a custom element with its own\n display semantics). */\n .grid {\n display: grid;\n block-size: 100%;\n grid-template-columns: 1fr;\n /* The grid template is set per-render via inline style\n using the --sken-layout-grid-areas and\n --sken-layout-grid-rows custom properties (set by the\n render() function). The default values below match\n the header-content variant; the inline style overrides\n them for variants with more or fewer roles, and for\n consumers that have unfilled regions. */\n grid-template-areas: var(\n --sken-layout-grid-areas,\n 'topbar' 'body'\n );\n grid-template-rows: var(\n --sken-layout-grid-rows,\n 'auto 1fr'\n );\n }\n\n /* ── Per-cell grid items ─────────────────────────────────────\n Each named slot sits inside a wrapper element that is the\n actual grid item. The wrapper's class matches the role\n (topbar, primary-nav, body, footer). The variant rules\n below assign the right 'grid-area' to each role. The\n 'display: contents' <sken-layout-region> is projected\n through the named <slot> and inherits the wrapper's\n background, border, and padding. */\n .topbar {\n grid-area: topbar;\n background: var(\n --sken-layout-region-topbar-background,\n ${unsafeCSS(REGION_BACKGROUND.topbar)}\n );\n padding-block: var(--sken-layout-region-topbar-padding-block, 0);\n padding-inline: var(--sken-layout-region-topbar-padding-inline, 0);\n border-bottom: 1px solid var(--sken-border);\n }\n .primary-nav {\n grid-area: primary-nav;\n background: var(\n --sken-layout-region-primary-nav-background,\n ${unsafeCSS(REGION_BACKGROUND['primary-nav'])}\n );\n padding-block: var(--sken-layout-region-primary-nav-padding-block, 0);\n padding-inline: var(--sken-layout-region-primary-nav-padding-inline, 0);\n border-bottom: 1px solid var(--sken-border);\n }\n .body {\n display: grid;\n grid-template-columns: 1fr;\n grid-template-areas: 'content';\n min-block-size: 0; /* allow children to shrink + scroll */\n }\n .body.with-sidebar {\n grid-template-columns: var(--sken-layout-sidebar-width, 16rem) 1fr;\n grid-template-areas: 'sidebar content';\n }\n .body.with-sidebar.sidebar-end {\n grid-template-columns: 1fr var(--sken-layout-sidebar-width, 16rem);\n grid-template-areas: 'content sidebar';\n }\n .sidebar {\n grid-area: sidebar;\n min-block-size: 0;\n background: var(\n --sken-layout-region-sidebar-background,\n ${unsafeCSS(REGION_BACKGROUND.sidebar)}\n );\n padding-block: var(--sken-layout-region-sidebar-padding-block, 0);\n padding-inline: var(--sken-layout-region-sidebar-padding-inline, 0);\n border-inline-end: 1px solid var(--sken-border);\n }\n .content {\n grid-area: content;\n min-block-size: 0;\n background: var(\n --sken-layout-region-content-background,\n ${unsafeCSS(REGION_BACKGROUND.content)}\n );\n padding-block: var(--sken-layout-region-content-padding-block, 0);\n padding-inline: var(--sken-layout-region-content-padding-inline, 0);\n }\n .footer {\n grid-area: footer;\n background: var(\n --sken-layout-region-footer-background,\n ${unsafeCSS(REGION_BACKGROUND.footer)}\n );\n padding-block: var(--sken-layout-region-footer-padding-block, 0);\n padding-inline: var(--sken-layout-region-footer-padding-inline, 0);\n border-top: 1px solid var(--sken-border);\n }\n\n /* ── Density: comfortable ─────────────────────────────────────\n When density=comfortable, the layout applies the Sken\n default rhythm: 8/16px on chrome cells, 16/24px on the\n content area, 12/16px on the footer. The values come\n from the spacing scale (--sken-2, --sken-3, --sken-4,\n --sken-6) so a single token change ripples through\n every cell. A consumer override on any\n --sken-layout-region-{role}-padding-{block|inline}\n always wins over the density preset. */\n :host([density='comfortable']) .topbar,\n :host([density='comfortable']) .primary-nav,\n :host([density='comfortable']) .content,\n :host([density='comfortable']) .sidebar,\n :host([density='comfortable']) .footer {\n --sken-layout-region-topbar-padding-block: var(--sken-2);\n --sken-layout-region-topbar-padding-inline: var(--sken-4);\n --sken-layout-region-primary-nav-padding-block: var(--sken-2);\n --sken-layout-region-primary-nav-padding-inline: var(--sken-4);\n --sken-layout-region-sidebar-padding-block: var(--sken-4);\n --sken-layout-region-sidebar-padding-inline: var(--sken-4);\n --sken-layout-region-content-padding-block: var(--sken-6);\n --sken-layout-region-content-padding-inline: var(--sken-6);\n --sken-layout-region-footer-padding-block: var(--sken-3);\n --sken-layout-region-footer-padding-inline: var(--sken-4);\n }\n\n /* ── Density: compact ────────────────────────────────────────\n When density=compact, every per-cell padding is halved\n from the comfortable value. We use calc(var(--sken-N) *\n 0.5) instead of hardcoded half-values so a future\n token change automatically cascades. As with\n comfortable, a consumer override on any\n --sken-layout-region-{role}-padding-{block|inline}\n always wins. */\n :host([density='compact']) .topbar,\n :host([density='compact']) .primary-nav,\n :host([density='compact']) .content,\n :host([density='compact']) .sidebar,\n :host([density='compact']) .footer {\n --sken-layout-region-topbar-padding-block: calc(var(--sken-2) * 0.5);\n --sken-layout-region-topbar-padding-inline: calc(var(--sken-4) * 0.5);\n --sken-layout-region-primary-nav-padding-block: calc(var(--sken-2) * 0.5);\n --sken-layout-region-primary-nav-padding-inline: calc(var(--sken-4) * 0.5);\n --sken-layout-region-sidebar-padding-block: calc(var(--sken-4) * 0.5);\n --sken-layout-region-sidebar-padding-inline: calc(var(--sken-4) * 0.5);\n --sken-layout-region-content-padding-block: calc(var(--sken-6) * 0.5);\n --sken-layout-region-content-padding-inline: calc(var(--sken-6) * 0.5);\n --sken-layout-region-footer-padding-block: calc(var(--sken-3) * 0.5);\n --sken-layout-region-footer-padding-inline: calc(var(--sken-4) * 0.5);\n }\n\n /* ── Grid templates per variant ───────────────────────────────\n The grid template is set per-render as an inline style\n (via --sken-layout-grid-areas and\n --sken-layout-grid-rows) based on the visible roles (the\n intersection of the active variant and the roles whose\n slot has content). See render() for the computation.\n The default values on the .grid selector above cover\n header-content (the default variant) when no inline\n style is set (e.g. before the first render completes). */\n\n /* ── Topbar mode ──────────────────────────────────────────────\n 'fixed': the host is 100dvh and the body scrolls under the\n topbar. This is the default for admin consoles.\n 'auto': the topbar scrolls away with the page (marketing,\n landing). */\n :host([topbar-mode='auto']) {\n block-size: auto;\n min-block-size: 100dvh;\n }\n\n /* ── Sidebar position ─────────────────────────────────────────\n When the sidebar sits on the inline-end side, the border\n moves to the inline-start side. The default rule above\n already paints the border on the inline-end; here we\n swap it. */\n :host([sidebar-position='end']) .sidebar {\n border-inline-end: none;\n border-inline-start: 1px solid var(--sken-border);\n }\n\n /* ── Sidebar width override ─────────────────────────────────── */\n :host([sidebar-size='sm']) {\n --sken-layout-sidebar-width: ${unsafeCSS(SIDEBAR_WIDTH.sm)};\n }\n :host([sidebar-size='md']) {\n --sken-layout-sidebar-width: ${unsafeCSS(SIDEBAR_WIDTH.md)};\n }\n :host([sidebar-size='lg']) {\n --sken-layout-sidebar-width: ${unsafeCSS(SIDEBAR_WIDTH.lg)};\n }\n `\n\n override render() {\n // Use #visibleRoles (not #activeRoles) so empty regions\n // are not emitted. #visibleRoles is the active variant\n // intersected with the roles whose slot has content; it\n // is updated by firstUpdated and slotchange handlers.\n const visibleRoles = this.#visibleRoles\n const hasContent = visibleRoles.includes('content')\n const hasSidebar = visibleRoles.includes('sidebar')\n\n // ── Compute the host's grid template ───────────────────────\n // We declare the area names in the order they should appear\n // in the grid (top to bottom). The browser uses this\n // template to lay out the wrappers: each wrapper has\n // `grid-area: <role>`, and the template maps that area to a\n // row. Excluded roles do not appear in the template, and\n // the corresponding wrapper is not rendered, so the row\n // simply does not exist.\n //\n // The order is the same as #activeRoles (which is the\n // order from SkenLayoutVariantRoles). That order is the\n // structural shape of the variant — the consumer picks the\n // variant, we project the order.\n //\n // For the row that holds the main content, the area name\n // is \"body\" (because the wrapper that owns that row is the\n // .body sub-grid, not a .content div). The SSoT for\n // \"which row is the body\" is \"the row whose role is\n // 'content'\" — the wrapper .body is rendered whenever\n // 'content' is visible, and it lives in the row we name\n // \"body\" in the template. This keeps the wrapper\n // structure (one .body that holds sidebar+content) in sync\n // with the grid template (one row named \"body\" that\n // stretches to fill the remaining space).\n const gridTemplateAreas = visibleRoles\n .map((r) => (r === 'content' ? '\"body\"' : `\"${r}\"`))\n .join('\\n ')\n\n // Compute grid-template-rows to match. We need one row per\n // visible role. The \"1fr\" row is the body (it stretches to\n // fill the remaining space); the others are \"auto\" (they\n // take the height of their content). The body row is the\n // one whose role in #visibleRoles is 'content'.\n const gridTemplateRows = visibleRoles\n .map((r) => (r === 'content' ? '1fr' : 'auto'))\n .join(' ')\n\n const bodyClasses = [\n 'body',\n hasSidebar ? 'with-sidebar' : '',\n hasSidebar && this.sidebarPosition === 'end' ? 'sidebar-end' : '',\n ]\n .filter(Boolean)\n .join(' ')\n\n // The grid template is applied as an inline style because\n // it is computed per render (the visible roles change when\n // the consumer adds or removes regions). The CSS in\n // `static styles` sets the default per-variant template, but\n // the inline style overrides it when the visible set\n // differs from the variant's full set.\n const hostStyle =\n `--sken-layout-grid-areas: '${gridTemplateAreas}'; ` +\n `--sken-layout-grid-rows: ${gridTemplateRows};`\n\n return html`\n <div class=\"grid\" style=${hostStyle} part=\"grid\">\n ${\n visibleRoles.includes('topbar')\n ? html`<div class=\"topbar\" part=\"topbar\">\n <slot name=\"topbar\"></slot>\n </div>`\n : ''\n }\n ${\n visibleRoles.includes('primary-nav')\n ? html`<div class=\"primary-nav\" part=\"primary-nav\">\n <slot name=\"primary-nav\"></slot>\n </div>`\n : ''\n }\n ${\n hasContent\n ? html`<div class=${bodyClasses} part=\"body\">\n ${\n hasSidebar\n ? html`<div class=\"sidebar\" part=\"sidebar\">\n <slot name=\"sidebar\"></slot>\n </div>`\n : ''\n }\n <div class=\"content\" part=\"content\">\n <slot name=\"content\"></slot>\n </div>\n </div>`\n : ''\n }\n ${\n visibleRoles.includes('footer')\n ? html`<div class=\"footer\" part=\"footer\">\n <slot name=\"footer\"></slot>\n </div>`\n : ''\n }\n </div>\n `\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'sken-layout': SkenLayout\n }\n}\n"],"mappings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A,EAAS,EAAE,SAAS,GAAK,CAAC,CAAA,GAAA,EAAA,WAAA,WAAA,KAAA,CAAA,GAP5B,IAAA,EAAA,CAAA,EAAc,aAAa,CAAA,GAAA,CAAA"}
|
|
1
|
+
{"version":3,"file":"sken-layout.js","names":["#activeRoles","#visibleRoles","#syncRegionSlotAttributes","#regionSlotObserver","#recomputeVisibleRoles","#wireSlotChangeListeners","#unwireSlotChangeListeners","#slotChangeHandlers"],"sources":["../src/components/sken-layout.ts"],"sourcesContent":["// ── <sken-layout> — structural layout primitive ────────────────────\n// Defines the page-level structure of a multi-region interface\n// (topbar, primary nav, sidebar, content, footer) without imposing\n// what lives inside each region. Composition by contract:\n//\n// <sken-layout variant=\"header-sidebar\">\n// <sken-layout-region name=\"topbar\">…</sken-layout-region>\n// <sken-layout-region name=\"primary-nav\">…</sken-layout-region>\n// <sken-layout-region name=\"sidebar\">…</sken-layout-region>\n// <sken-layout-region name=\"content\">…</sken-layout-region>\n// </sken-layout>\n//\n// Design notes (v0.4.2 — fix for SKEN-LAYOUT-EMPTY-REGIONS.md):\n// - The shadow root projects the consumer's light-DOM regions via\n// NAMED slots, one per role. Each named slot sits inside a wrapper\n// element (e.g. <div class=\"topbar\">…</div>) that is the actual\n// grid item of the host's CSS grid.\n// - Roles the active variant does not include are not rendered at\n// all (the variant drives which slots exist in the shadow root).\n// - Roles the active variant includes but the consumer did not\n// fill are also not rendered. The host's `grid-template-areas`\n// is computed dynamically to exclude the empty rows/columns, so\n// the grid re-flows to fill the available space. This is the\n// third in a series of layout-rendering fixes:\n// - 0.4.0: variant-aware region rendering (only roles the\n// variant includes are emitted).\n// - 0.4.1: slot= attribute on the regions, so the browser\n// projects them to the named slots.\n// - 0.4.2 (this): content-aware grid template, so empty\n// rows/columns collapse.\n// - We detect which slots have content via `slot.assignedElements()`\n// on first render (after the browser has projected the\n// consumer's regions) and on every `slotchange` event (for\n// dynamic content — e.g. a sidebar the consumer can empty at\n// runtime). The result is stored in `#visibleRoles`, which\n// drives both the shadow template and the host's inline\n// `grid-template-areas` style.\n//\n// See ADR-0006 for the substrate decision. See the\n// @sken-ds/contracts types `SkenLayoutProps`, `SkenLayoutSlots`,\n// `SkenLayoutVariant`, `SkenLayoutVariantRoles` for the contract\n// surface.\n\nimport type {\n SkenLayoutDensity,\n SkenLayoutRegionRole,\n SkenLayoutSidebarPosition,\n SkenLayoutSidebarSize,\n SkenLayoutTopbarMode,\n SkenLayoutVariant,\n SkenLayoutVariantRolesMap,\n} from '@sken-ds/contracts'\nimport { SkenLayoutVariantRoles } from '@sken-ds/contracts'\nimport { LitElement, css, html, unsafeCSS, type PropertyValues } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\nimport './sken-layout-region.js'\n\n/**\n * Sidebar width in `rem` per size concept. The product can\n * override with `--sken-layout-sidebar-width` (CSS custom\n * property) if it needs a different value.\n */\nconst SIDEBAR_WIDTH: Record<SkenLayoutSidebarSize, string> = {\n sm: '12rem',\n md: '16rem',\n lg: '20rem',\n}\n\n/**\n * Per-cell background tokens. The values reference the\n * Sken color tokens, not raw colors, so a theme switch\n * (`data-theme=\"dark\"`) recolors every cell without the\n * primitive knowing about it.\n *\n * Mapping rationale:\n * - topbar is on `--sken-card` (white) because it is the\n * \"elevated\" chrome; the border-bottom separates it from\n * the page below.\n * - primary-nav is on `--sken-background` (page colour) so\n * it sits flush with the page; the border-bottom separates\n * it from the workspace.\n * - sidebar is on `--sken-muted` (subtle off-white) with a\n * border-inline-end; it is a \"rail\", not a \"page\".\n * - content is on `--sken-background`; no border (the\n * workspace is unbounded).\n * - footer is on `--sken-muted` with a border-top; it is\n * the same role as the sidebar (chrome).\n */\nconst REGION_BACKGROUND: Record<SkenLayoutRegionRole, string> = {\n topbar: 'var(--sken-card)',\n 'primary-nav': 'var(--sken-background)',\n sidebar: 'var(--sken-muted)',\n content: 'var(--sken-background)',\n footer: 'var(--sken-muted)',\n}\n\n@customElement('sken-layout')\nexport class SkenLayout extends LitElement {\n @property({ reflect: true }) variant: SkenLayoutVariant = 'header-content'\n @property({ attribute: 'topbar-mode', reflect: true }) topbarMode: SkenLayoutTopbarMode = 'fixed'\n @property({ attribute: 'sidebar-position', reflect: true })\n sidebarPosition: SkenLayoutSidebarPosition = 'start'\n @property({ attribute: 'sidebar-size', reflect: true }) sidebarSize: SkenLayoutSidebarSize = 'md'\n @property({ reflect: true }) density: SkenLayoutDensity = 'none'\n\n /**\n * MutationObserver that watches the host's light DOM for\n * `<sken-layout-region>` children. For each region, if the\n * consumer (or a framework adapter) did not set the HTML\n * `slot=\"<role>\"` attribute, we set it ourselves. This is\n * defense-in-depth: the host's shadow root uses 5 named\n * `<slot>` elements (one per role) and the browser's\n * slot-projection mechanism only projects a light-DOM child\n * into a named slot if the child carries the matching\n * `slot=\"<name>\"` attribute. Without it, every named slot\n * receives zero assigned elements and the regions render\n * as empty wrappers — the page looks almost empty.\n *\n * A future framework adapter (React, Svelte, plain HTML) can\n * either set the `slot` attribute on its own (the documented\n * contract) or rely on this observer to do it. Setting it\n * explicitly is still preferred for clarity, but the\n * observer is the safety net that prevents the silent\n * \"everything renders empty\" failure mode that v0.4.0\n * shipped with.\n */\n #regionSlotObserver: MutationObserver | null = null\n\n /**\n * Roles the active variant renders in the shadow root. Sourced\n * from {@link SkenLayoutVariantRoles}. Used to drive the\n * template (only the slots the variant includes are projected)\n * and to apply the per-variant `with-sidebar` class on the\n * body sub-grid wrapper.\n */\n get #activeRoles(): readonly SkenLayoutRegionRole[] {\n return (SkenLayoutVariantRoles as SkenLayoutVariantRolesMap)[this.variant]\n }\n\n /**\n * Roles the host grid should render in the shadow root AND\n * reserve space for in the grid template. This is the\n * intersection of the active variant's roles and the roles\n * whose slot actually has content (i.e. the consumer filled\n * the corresponding `<sken-layout-region>`). When a role is\n * in the variant but the consumer did not fill the slot, the\n * role is excluded — the wrapper is not rendered, and the\n * corresponding row/column in `grid-template-areas` is removed\n * so the surrounding regions re-flow.\n *\n * Updated on `firstUpdated` (after the browser has projected\n * the initial set of regions into the named slots) and on\n * every `slotchange` event (for dynamic content).\n */\n #visibleRoles: readonly SkenLayoutRegionRole[] = this.#activeRoles\n\n /**\n * Compute the current set of visible roles by walking the\n * host's light-DOM children and checking which ones carry\n * a `slot=\"<role>\"` attribute that matches one of the active\n * variant's roles.\n *\n * We deliberately do NOT use `slot.assignedElements()` (which\n * requires the browser to have done the slot projection and\n * is therefore timing-sensitive in shadow-DOM tests) — we\n * read the slot attribute directly on the children. This is\n * observable at any point, including during the first\n * `firstUpdated` call.\n *\n * The `#syncRegionSlotAttributes` method (called from\n * `connectedCallback` and again in `firstUpdated`) ensures\n * that the slot attribute is in place on every child region\n * before this method runs. The slotchange listener is\n * responsible for re-running this method when the consumer\n * mutates the slot attribute at runtime.\n */\n #recomputeVisibleRoles(): void {\n const visible: SkenLayoutRegionRole[] = []\n for (const role of this.#activeRoles) {\n // A role is \"filled\" if at least one direct child of\n // the host has slot=\"<role>\". We do not care about the\n // child's own children (an empty region is still a\n // filled region — the consumer can render a placeholder\n // inside an otherwise empty slot).\n const filled = Array.from(this.children).some(\n (c) => c.getAttribute && c.getAttribute('slot') === role,\n )\n if (filled) visible.push(role)\n }\n // Avoid re-renders if nothing changed.\n if (\n visible.length === this.#visibleRoles.length &&\n visible.every((r, i) => r === this.#visibleRoles[i])\n ) {\n return\n }\n this.#visibleRoles = visible\n this.requestUpdate()\n }\n\n override connectedCallback(): void {\n super.connectedCallback()\n // Walk the current children synchronously (so the first\n // render after connection already has the slot= attribute\n // in place), then attach the observer to catch future\n // mutations (the consumer can add or remove regions\n // dynamically, e.g. when switching the active variant in\n // a shared layout component).\n //\n // The observer also re-runs `#recomputeVisibleRoles`. The\n // MutationObserver fires on every add/remove of a direct\n // child, which is exactly the signal we need to refresh\n // the visible-roles set (the slotchange event is a poor\n // substitute because it only fires for slots that already\n // exist in the shadow root — a region the consumer adds\n // for a slot that the previous render omitted will not\n // fire slotchange because the slot does not exist yet).\n this.#syncRegionSlotAttributes()\n this.#regionSlotObserver = new MutationObserver(() => {\n this.#syncRegionSlotAttributes()\n this.#recomputeVisibleRoles()\n })\n this.#regionSlotObserver.observe(this, { childList: true, subtree: false })\n }\n\n /**\n * Lit lifecycle hook called after the first render. Three\n * things happen here, in order:\n *\n * 1. `#syncRegionSlotAttributes()` — second-pass sync point\n * for regions whose `name` was set as a property (not as\n * an attribute) before the region was connected. The\n * `name` property is `reflect: true`, so the attribute is\n * written only after the region is connected and Lit runs\n * its first render. Without this second pass, a region\n * whose `name` was set as a property (not as an attribute)\n * would not have its `slot` attribute set by the time the\n * browser tries to project it.\n *\n * 2. `#recomputeVisibleRoles()` — first pass at discovering\n * which slots have content. This MUST happen after the\n * browser has done its first slot projection, which is\n * exactly what `firstUpdated` is. Without this, the\n * initial render would assume all variant roles are\n * visible, and the grid template would reserve rows for\n * empty regions. The render that follows this call\n * produces the correct (collapsed) grid template.\n *\n * 3. Wire up `slotchange` listeners on the named slots, so\n * dynamic content (a consumer emptying or filling a slot\n * at runtime) re-triggers the same re-computation.\n */\n protected override firstUpdated(_changedProperties: PropertyValues): void {\n super.firstUpdated(_changedProperties)\n this.#syncRegionSlotAttributes()\n this.#recomputeVisibleRoles()\n this.#wireSlotChangeListeners()\n }\n\n /**\n * Lit lifecycle hook called after every render (including the\n * first). We re-run `#recomputeVisibleRoles` when the variant\n * changes because the set of valid roles (`#activeRoles`)\n * depends on the variant, and a region that was visible under\n * the previous variant may no longer be a member of the new\n * variant. Without this, switching the variant prop would\n * leave stale roles in `#visibleRoles` until the next\n * `slotchange` event.\n *\n * We do NOT call `requestUpdate` here — `#recomputeVisibleRoles`\n * already does that when the visible set actually changed. If\n * the set did not change, no extra render is needed.\n */\n protected override updated(_changedProperties: PropertyValues): void {\n super.updated(_changedProperties)\n if (_changedProperties.has('variant')) {\n this.#recomputeVisibleRoles()\n }\n }\n\n /**\n * Attach a `slotchange` listener to every named slot in the\n * shadow root. The browser fires `slotchange` on a slot\n * whenever the set of light-DOM children projected into it\n * changes (add, remove, or replace). This is a defense in\n * depth alongside the `MutationObserver` (which is the\n * primary signal for adds/removes): the slotchange listener\n * catches a consumer who replaces a region's content with\n * another consumer-defined element while keeping the same\n * `slot=\"<role>\"` attribute (the MutationObserver on\n * childList would not fire for a same-tag-name replacement\n * that swaps the element in place, though in practice the\n * browser usually fires childList anyway for new nodes).\n *\n * The listeners are attached in `firstUpdated` (so the slots\n * exist) and torn down in `disconnectedCallback`.\n */\n #slotChangeHandlers: Array<{ slot: HTMLSlotElement; handler: () => void }> = []\n\n #wireSlotChangeListeners(): void {\n // Tear down the previous batch first (in case the variant\n // changed and the shadow root was re-rendered, replacing\n // the old slot elements with new ones).\n this.#unwireSlotChangeListeners()\n const shadow = this.shadowRoot\n if (!shadow) return\n for (const slot of Array.from(shadow.querySelectorAll('slot'))) {\n const handler = () => this.#recomputeVisibleRoles()\n slot.addEventListener('slotchange', handler)\n this.#slotChangeHandlers.push({ slot, handler })\n }\n }\n\n #unwireSlotChangeListeners(): void {\n for (const { slot, handler } of this.#slotChangeHandlers) {\n slot.removeEventListener('slotchange', handler)\n }\n this.#slotChangeHandlers = []\n }\n\n override disconnectedCallback(): void {\n super.disconnectedCallback()\n this.#regionSlotObserver?.disconnect()\n this.#regionSlotObserver = null\n this.#unwireSlotChangeListeners()\n }\n\n /**\n * For each direct `<sken-layout-region>` child of the host,\n * set the `slot=\"<name>\"` HTML attribute if it is missing\n * or does not match the region's role. The browser's\n * slot-projection mechanism reads this attribute to project\n * the child into the matching named `<slot>` inside the\n * shadow root.\n *\n * We only touch direct children (not the entire subtree)\n * because the contract is that `<sken-layout-region>` lives\n * as a direct child of `<sken-layout>`; nested regions\n * are not a supported pattern.\n */\n #syncRegionSlotAttributes(): void {\n for (const child of Array.from(this.children)) {\n if (!(child instanceof HTMLElement)) continue\n if (child.tagName.toLowerCase() !== 'sken-layout-region') continue\n const role = child.getAttribute('name')\n if (!role) continue\n if (child.getAttribute('slot') === role) continue\n child.setAttribute('slot', role)\n }\n }\n\n static styles = css`\n /* ── The host ────────────────────────────────────────────────\n The host owns the page-level grid. The topbar / primary-nav\n / footer sit in their own rows; the body is a sub-grid that\n holds the sidebar (when present) and the content. */\n :host {\n display: block;\n block-size: 100dvh;\n background: var(--sken-background, Canvas);\n color: var(--sken-foreground, CanvasText);\n font-family: var(--sken-family-sans, system-ui, sans-serif);\n }\n\n /* The actual grid is a child <div class=\"grid\">. We use a\n child rather than the host itself for two reasons:\n\n 1. The grid template is computed per-render based on\n which roles have content (see #visibleRoles and\n render()). Setting grid-template-areas on the host\n via an inline style would work, but the host has a\n handful of other responsibilities (background, color,\n font) and keeping the grid in a child makes the\n separation cleaner.\n\n 2. CSS grid in shadow DOM: putting the grid on a child\n avoids any quirks of the host element's display\n behaviour (the host is a custom element with its own\n display semantics). */\n .grid {\n display: grid;\n block-size: 100%;\n grid-template-columns: 1fr;\n /* The grid template is set per-render via inline style\n using the --sken-layout-grid-areas and\n --sken-layout-grid-rows custom properties (set by the\n render() function). The default values below match\n the header-content variant; the inline style overrides\n them for variants with more or fewer roles, and for\n consumers that have unfilled regions. */\n grid-template-areas: var(--sken-layout-grid-areas, 'topbar' 'body');\n grid-template-rows: var(--sken-layout-grid-rows, 'auto 1fr');\n }\n\n /* ── Per-cell grid items ─────────────────────────────────────\n Each named slot sits inside a wrapper element that is the\n actual grid item. The wrapper's class matches the role\n (topbar, primary-nav, body, footer). The variant rules\n below assign the right 'grid-area' to each role. The\n 'display: contents' <sken-layout-region> is projected\n through the named <slot> and inherits the wrapper's\n background, border, and padding. */\n .topbar {\n grid-area: topbar;\n background: var(\n --sken-layout-region-topbar-background,\n ${unsafeCSS(REGION_BACKGROUND.topbar)}\n );\n padding-block: var(--sken-layout-region-topbar-padding-block, 0);\n padding-inline: var(--sken-layout-region-topbar-padding-inline, 0);\n border-bottom: 1px solid var(--sken-border);\n }\n .primary-nav {\n grid-area: primary-nav;\n background: var(\n --sken-layout-region-primary-nav-background,\n ${unsafeCSS(REGION_BACKGROUND['primary-nav'])}\n );\n padding-block: var(--sken-layout-region-primary-nav-padding-block, 0);\n padding-inline: var(--sken-layout-region-primary-nav-padding-inline, 0);\n border-bottom: 1px solid var(--sken-border);\n }\n .body {\n grid-area: body;\n display: grid;\n grid-template-columns: 1fr;\n grid-template-areas: 'content';\n min-block-size: 0; /* allow children to shrink + scroll */\n }\n .body.with-sidebar {\n grid-template-columns: var(--sken-layout-sidebar-width, 16rem) 1fr;\n grid-template-areas: 'sidebar content';\n }\n .body.with-sidebar.sidebar-end {\n grid-template-columns: 1fr var(--sken-layout-sidebar-width, 16rem);\n grid-template-areas: 'content sidebar';\n }\n .sidebar {\n grid-area: sidebar;\n min-block-size: 0;\n background: var(\n --sken-layout-region-sidebar-background,\n ${unsafeCSS(REGION_BACKGROUND.sidebar)}\n );\n padding-block: var(--sken-layout-region-sidebar-padding-block, 0);\n padding-inline: var(--sken-layout-region-sidebar-padding-inline, 0);\n border-inline-end: 1px solid var(--sken-border);\n }\n .content {\n min-block-size: 0;\n background: var(\n --sken-layout-region-content-background,\n ${unsafeCSS(REGION_BACKGROUND.content)}\n );\n padding-block: var(--sken-layout-region-content-padding-block, 0);\n padding-inline: var(--sken-layout-region-content-padding-inline, 0);\n }\n .footer {\n grid-area: footer;\n background: var(\n --sken-layout-region-footer-background,\n ${unsafeCSS(REGION_BACKGROUND.footer)}\n );\n padding-block: var(--sken-layout-region-footer-padding-block, 0);\n padding-inline: var(--sken-layout-region-footer-padding-inline, 0);\n border-top: 1px solid var(--sken-border);\n }\n\n /* ── Density: comfortable ─────────────────────────────────────\n When density=comfortable, the layout applies the Sken\n default rhythm: 8/16px on chrome cells, 16/24px on the\n content area, 12/16px on the footer. The values come\n from the spacing scale (--sken-2, --sken-3, --sken-4,\n --sken-6) so a single token change ripples through\n every cell. A consumer override on any\n --sken-layout-region-{role}-padding-{block|inline}\n always wins over the density preset. */\n :host([density='comfortable']) .topbar,\n :host([density='comfortable']) .primary-nav,\n :host([density='comfortable']) .content,\n :host([density='comfortable']) .sidebar,\n :host([density='comfortable']) .footer {\n --sken-layout-region-topbar-padding-block: var(--sken-2);\n --sken-layout-region-topbar-padding-inline: var(--sken-4);\n --sken-layout-region-primary-nav-padding-block: var(--sken-2);\n --sken-layout-region-primary-nav-padding-inline: var(--sken-4);\n --sken-layout-region-sidebar-padding-block: var(--sken-4);\n --sken-layout-region-sidebar-padding-inline: var(--sken-4);\n --sken-layout-region-content-padding-block: var(--sken-6);\n --sken-layout-region-content-padding-inline: var(--sken-6);\n --sken-layout-region-footer-padding-block: var(--sken-3);\n --sken-layout-region-footer-padding-inline: var(--sken-4);\n }\n\n /* ── Density: compact ────────────────────────────────────────\n When density=compact, every per-cell padding is halved\n from the comfortable value. We use calc(var(--sken-N) *\n 0.5) instead of hardcoded half-values so a future\n token change automatically cascades. As with\n comfortable, a consumer override on any\n --sken-layout-region-{role}-padding-{block|inline}\n always wins. */\n :host([density='compact']) .topbar,\n :host([density='compact']) .primary-nav,\n :host([density='compact']) .content,\n :host([density='compact']) .sidebar,\n :host([density='compact']) .footer {\n --sken-layout-region-topbar-padding-block: calc(var(--sken-2) * 0.5);\n --sken-layout-region-topbar-padding-inline: calc(var(--sken-4) * 0.5);\n --sken-layout-region-primary-nav-padding-block: calc(var(--sken-2) * 0.5);\n --sken-layout-region-primary-nav-padding-inline: calc(var(--sken-4) * 0.5);\n --sken-layout-region-sidebar-padding-block: calc(var(--sken-4) * 0.5);\n --sken-layout-region-sidebar-padding-inline: calc(var(--sken-4) * 0.5);\n --sken-layout-region-content-padding-block: calc(var(--sken-6) * 0.5);\n --sken-layout-region-content-padding-inline: calc(var(--sken-6) * 0.5);\n --sken-layout-region-footer-padding-block: calc(var(--sken-3) * 0.5);\n --sken-layout-region-footer-padding-inline: calc(var(--sken-4) * 0.5);\n }\n\n /* ── Grid templates per variant ───────────────────────────────\n The grid template is set per-render as an inline style\n (via --sken-layout-grid-areas and\n --sken-layout-grid-rows) based on the visible roles (the\n intersection of the active variant and the roles whose\n slot has content). See render() for the computation.\n The default values on the .grid selector above cover\n header-content (the default variant) when no inline\n style is set (e.g. before the first render completes). */\n\n /* ── Topbar mode ──────────────────────────────────────────────\n 'fixed': the host is 100dvh and the body scrolls under the\n topbar. This is the default for admin consoles.\n 'auto': the topbar scrolls away with the page (marketing,\n landing). */\n :host([topbar-mode='auto']) {\n block-size: auto;\n min-block-size: 100dvh;\n }\n\n /* ── Sidebar position ─────────────────────────────────────────\n When the sidebar sits on the inline-end side, the border\n moves to the inline-start side. The default rule above\n already paints the border on the inline-end; here we\n swap it. */\n :host([sidebar-position='end']) .sidebar {\n border-inline-end: none;\n border-inline-start: 1px solid var(--sken-border);\n }\n\n /* ── Sidebar width override ─────────────────────────────────── */\n :host([sidebar-size='sm']) {\n --sken-layout-sidebar-width: ${unsafeCSS(SIDEBAR_WIDTH.sm)};\n }\n :host([sidebar-size='md']) {\n --sken-layout-sidebar-width: ${unsafeCSS(SIDEBAR_WIDTH.md)};\n }\n :host([sidebar-size='lg']) {\n --sken-layout-sidebar-width: ${unsafeCSS(SIDEBAR_WIDTH.lg)};\n }\n `\n\n override render() {\n // Use #visibleRoles (not #activeRoles) so empty regions\n // are not emitted. #visibleRoles is the active variant\n // intersected with the roles whose slot has content; it\n // is updated by firstUpdated and slotchange handlers.\n const visibleRoles = this.#visibleRoles\n const hasContent = visibleRoles.includes('content')\n const hasSidebar = visibleRoles.includes('sidebar')\n\n // ── Compute the host's grid template ───────────────────────\n // We declare the area names in the order they should appear\n // in the grid (top to bottom). The browser uses this\n // template to lay out the wrappers: each wrapper has\n // `grid-area: <role>`, and the template maps that area to a\n // row. Excluded roles do not appear in the template, and\n // the corresponding wrapper is not rendered, so the row\n // simply does not exist.\n //\n // The order is the same as #activeRoles (which is the\n // order from SkenLayoutVariantRoles). That order is the\n // structural shape of the variant — the consumer picks the\n // variant, we project the order.\n //\n // For the row that holds the main content, the area name\n // is \"body\" (because the wrapper that owns that row is the\n // .body sub-grid, not a .content div). The SSoT for\n // \"which row is the body\" is \"the row whose role is\n // 'content'\" — the wrapper .body is rendered whenever\n // 'content' is visible, and it lives in the row we name\n // \"body\" in the template. This keeps the wrapper\n // structure (one .body that holds sidebar+content) in sync\n // with the grid template (one row named \"body\" that\n // stretches to fill the remaining space).\n const gridTemplateAreas = visibleRoles\n .map((r) => (r === 'content' ? '\"body\"' : `\"${r}\"`))\n .join('\\n')\n\n // Compute grid-template-rows to match. We need one row per\n // visible role. The \"1fr\" row is the body (it stretches to\n // fill the remaining space); the others are \"auto\" (they\n // take the height of their content). The body row is the\n // one whose role in #visibleRoles is 'content'.\n const gridTemplateRows = visibleRoles.map((r) => (r === 'content' ? '1fr' : 'auto')).join(' ')\n\n const bodyClasses = [\n 'body',\n hasSidebar ? 'with-sidebar' : '',\n hasSidebar && this.sidebarPosition === 'end' ? 'sidebar-end' : '',\n ]\n .filter(Boolean)\n .join(' ')\n\n // The grid template is applied as an inline style because\n // it is computed per render (the visible roles change when\n // the consumer adds or removes regions). The CSS in\n // `static styles` sets the default per-variant template, but\n // the inline style overrides it when the visible set\n // differs from the variant's full set.\n const hostStyle =\n `--sken-layout-grid-areas: ${gridTemplateAreas}; ` +\n `--sken-layout-grid-rows: ${gridTemplateRows};`\n\n return html`\n <div class=\"grid\" style=${hostStyle} part=\"grid\">\n ${\n visibleRoles.includes('topbar')\n ? html`<div class=\"topbar\" part=\"topbar\">\n <slot name=\"topbar\"></slot>\n </div>`\n : ''\n }\n ${\n visibleRoles.includes('primary-nav')\n ? html`<div class=\"primary-nav\" part=\"primary-nav\">\n <slot name=\"primary-nav\"></slot>\n </div>`\n : ''\n }\n ${\n hasContent\n ? html`<div class=${bodyClasses} part=\"body\">\n ${\n hasSidebar\n ? html`<div class=\"sidebar\" part=\"sidebar\">\n <slot name=\"sidebar\"></slot>\n </div>`\n : ''\n }\n <div class=\"content\" part=\"content\">\n <slot name=\"content\"></slot>\n </div>\n </div>`\n : ''\n }\n ${\n visibleRoles.includes('footer')\n ? html`<div class=\"footer\" part=\"footer\">\n <slot name=\"footer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AAS;CAAE,WAAW;CAAgB,SAAS;AAAK,CAAC,CAAA,GAAA,EAAA,WAAA,eAAA,KAAA,CAAA,GACrD,EAAA,CAAA,EAAS,EAAE,SAAS,GAAK,CAAC,CAAA,GAAA,EAAA,WAAA,WAAA,KAAA,CAAA,GAP5B,IAAA,EAAA,CAAA,EAAc,aAAa,CAAA,GAAA,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sken-ds/primitives",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.6",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"registry": "https://registry.npmjs.org",
|
|
6
6
|
"access": "public"
|
|
@@ -9,7 +9,8 @@
|
|
|
9
9
|
"type": "module",
|
|
10
10
|
"sideEffects": [
|
|
11
11
|
"**/*.ts",
|
|
12
|
-
"**/*.css"
|
|
12
|
+
"**/*.css",
|
|
13
|
+
"dist/**/*.js"
|
|
13
14
|
],
|
|
14
15
|
"main": "./dist/index.js",
|
|
15
16
|
"types": "./dist/index.d.ts",
|
|
@@ -92,7 +93,7 @@
|
|
|
92
93
|
"@tanstack/match-sorter-utils": "^9.0.0",
|
|
93
94
|
"@tanstack/table-core": "^9.0.0",
|
|
94
95
|
"lit": "^3.3.3",
|
|
95
|
-
"@sken-ds/contracts": "0.4.
|
|
96
|
+
"@sken-ds/contracts": "0.4.3"
|
|
96
97
|
},
|
|
97
98
|
"devDependencies": {
|
|
98
99
|
"@vitest/coverage-v8": "^4.1.10",
|