@telperion/elements 1.2.1 → 2.0.1

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.
@@ -55,7 +55,18 @@
55
55
  "dts": "icon/index.d.ts",
56
56
  "dcts": "icon/index.d.cts"
57
57
  }
58
+ },
59
+ {
60
+ "name": "details-set/index",
61
+ "sourcePath": "src/details-set/index.ts",
62
+ "outputs": {
63
+ "esm": "details-set/index.js",
64
+ "cjs": "details-set/index.cjs",
65
+ "iife": "iife/details-set/index.js",
66
+ "dts": "details-set/index.d.ts",
67
+ "dcts": "details-set/index.d.cts"
68
+ }
58
69
  }
59
70
  ],
60
- "generatedAt": "2026-04-29T20:30:53.967Z"
71
+ "generatedAt": "2026-04-30T11:34:29.707Z"
61
72
  }
package/README.md CHANGED
@@ -56,6 +56,9 @@ Use the **explicit `/iife/...` path** so the CDN serves the standalone bundle (s
56
56
 
57
57
  <!-- Or just the drag-and-drop module (TelperionElements.DragDrop) -->
58
58
  <script src="https://unpkg.com/@telperion/elements/iife/drag-drop/index.js"></script>
59
+
60
+ <!-- Or just the details-set module (TelperionElements.DetailsSet) -->
61
+ <script src="https://unpkg.com/@telperion/elements/iife/details-set/index.js"></script>
59
62
  ```
60
63
 
61
64
  Each per-module bundle is fully self-contained: side-effect imports register the custom elements as soon as the script is evaluated. jsDelivr (`https://cdn.jsdelivr.net/npm/@telperion/elements/iife/...`) and other npm CDNs work the same way.
@@ -123,6 +126,40 @@ A complete client-side routing solution for single-page applications, built with
123
126
 
124
127
  ---
125
128
 
129
+ ### Details Set
130
+
131
+ A grouping element for native `<details>` that caps how many can be open at
132
+ once, supports cloned summary markers, and offers marker-only toggling.
133
+
134
+ **Includes:**
135
+ - `<tp-details-set>` &mdash; manages direct-child `<details>` elements
136
+
137
+ **Features:**
138
+ - `max-open-items` attribute &mdash; FIFO eviction when the cap is exceeded (`0` = unlimited)
139
+ - Declarative summary markers via `<template summary-marker index="…">` direct children &mdash; cloned into every direct-child `<summary>` at the requested splice index; multiple templates and dynamic add/remove supported
140
+ - Cloned marker elements are auto-tagged with `tp-summary-marker` so the native disclosure triangle is hidden and CSS can style markers state-aware (`details[open] > summary > [tp-summary-marker]`)
141
+ - `toggle-on="summary" | "marker"` (set-level + per-`<details>` override) &mdash; restrict toggling to clicks on the marker (keyboard activation always works; falls back to summary-toggle when no marker is present)
142
+ - `tp-details-set-change` event with `{ opened, closed }` arrays
143
+ - Light-DOM rendering; modern CSS (`::details-content`, `interpolate-size`) opt-in for animated open/close
144
+
145
+ #### JS/TS
146
+ ```ts
147
+ import "@telperion/elements/details-set";
148
+ ```
149
+
150
+ #### HTML
151
+ ```html
152
+ <tp-details-set max-open-items="1" toggle-on="marker">
153
+ <template summary-marker index="0"><span class="chev">▸</span></template>
154
+ <details><summary>One</summary>...</details>
155
+ <details><summary>Two</summary>...</details>
156
+ </tp-details-set>
157
+ ```
158
+
159
+ [Details Set Documentation →](./src/details-set/README.md)
160
+
161
+ ---
162
+
126
163
  This library is actively being developed. More components will be added over time.
127
164
 
128
165
  ## 🤝 Contributing
@@ -0,0 +1,394 @@
1
+ 'use strict';
2
+
3
+ var tslib = require('tslib');
4
+ var lit = require('lit');
5
+ var decorators_js = require('lit/decorators.js');
6
+
7
+ /**
8
+ * Index resolution for `<template summary-marker index="…">`.
9
+ * - Missing / non-finite ⇒ `0` (prepend).
10
+ * - `>= 0` ⇒ clamped to `[0, length]`.
11
+ * - `< 0` ⇒ counts from the end where `-1` is the end (append),
12
+ * `-2` is before the last child, etc. Computed as `length + raw + 1`,
13
+ * clamped to `[0, length]` (so over-negative values prepend).
14
+ */
15
+ function resolveMarkerIndex(raw, length) {
16
+ if (raw === null || raw === "")
17
+ return 0;
18
+ const n = Number(raw);
19
+ if (!Number.isFinite(n))
20
+ return 0;
21
+ const i = Math.trunc(n);
22
+ if (i >= 0)
23
+ return Math.min(i, length);
24
+ return Math.max(0, length + i + 1);
25
+ }
26
+ exports.DetailsSetElement = class DetailsSetElement extends lit.LitElement {
27
+ constructor() {
28
+ super(...arguments);
29
+ /**
30
+ * Maximum number of direct-child `<details>` allowed open at the same time.
31
+ * `0` (the default) means unlimited.
32
+ */
33
+ this.maxOpenItems = 0;
34
+ /**
35
+ * Default trigger for toggling direct-child `<details>` elements:
36
+ *
37
+ * - `"summary"` (default): clicking anywhere on the `<summary>` toggles
38
+ * the details (native behavior).
39
+ * - `"marker"`: only clicks on (or inside) an element carrying the
40
+ * `tp-summary-marker` attribute toggle the details. If the summary has
41
+ * no marker, this falls back to summary toggle for that details so the
42
+ * details never becomes un-toggleable.
43
+ *
44
+ * Per-`<details>` `toggle-on` attribute overrides this set-level default.
45
+ * Keyboard activation (Enter/Space on a focused summary) is **never**
46
+ * suppressed, regardless of mode.
47
+ */
48
+ this.toggleOn = "summary";
49
+ /** FIFO queue of currently-open direct-child `<details>` elements. */
50
+ this.#openOrder = [];
51
+ /** Per-child observers watching the `open` attribute. */
52
+ this.#childObservers = new Map();
53
+ /** Per-marker-template observers (content + `index` attribute changes). */
54
+ this.#markerObservers = new Map();
55
+ /**
56
+ * Tracks raw cloned marker nodes inserted into each summary, keyed by the
57
+ * source template, so re-syncs can remove and re-insert without leaving
58
+ * stale DOM behind.
59
+ */
60
+ this.#insertedMarkers = new WeakMap();
61
+ this.#handleMarkerTemplateMutation = () => {
62
+ this.#syncAllMarkers();
63
+ };
64
+ this.#handleChildListMutation = () => {
65
+ this.#syncDirectChildren();
66
+ };
67
+ this.#handleToggle = (event) => {
68
+ const target = event.target;
69
+ if (!(target instanceof HTMLDetailsElement))
70
+ return;
71
+ if (target.parentElement !== this)
72
+ return;
73
+ this.#applyOpenState(target);
74
+ };
75
+ this.#handleChildOpenMutation = (child) => {
76
+ // Reconcile in case the `toggle` event was missed (e.g. in jsdom or when
77
+ // the `open` attribute is mutated programmatically without a toggle).
78
+ this.#applyOpenState(child);
79
+ };
80
+ /**
81
+ * Capture-phase click handler that suppresses the native toggle when a
82
+ * `<summary>` is clicked outside its marker(s) and the effective
83
+ * `toggle-on` mode is `"marker"`.
84
+ *
85
+ * Resolution per `<details>`:
86
+ * - per-`<details>` `toggle-on` attribute (if `"summary"` or `"marker"`),
87
+ * else
88
+ * - the host's `toggle-on` property/attribute, else
89
+ * - `"summary"`.
90
+ *
91
+ * Carve-outs:
92
+ * - Keyboard activation (Enter/Space) produces a synthetic click with
93
+ * `event.detail === 0`; we never suppress those.
94
+ * - If the summary contains no `[tp-summary-marker]` element, fall back to
95
+ * summary-click toggle so the details cannot become un-toggleable.
96
+ */
97
+ this.#handleSummaryClick = (event) => {
98
+ if (event.defaultPrevented)
99
+ return;
100
+ const target = event.target;
101
+ if (!(target instanceof Element))
102
+ return;
103
+ const summary = target.closest("summary");
104
+ if (!summary)
105
+ return;
106
+ const details = summary.parentElement;
107
+ if (!(details instanceof HTMLDetailsElement))
108
+ return;
109
+ if (details.parentElement !== this)
110
+ return;
111
+ // Only intercept clicks targeting the details' own first summary.
112
+ if (summary !== details.querySelector(":scope > summary"))
113
+ return;
114
+ const mode = this.#resolveToggleOn(details);
115
+ if (mode !== "marker")
116
+ return;
117
+ // Keyboard-originated synthetic click: never suppress.
118
+ if (event.detail === 0)
119
+ return;
120
+ // Fallback: if there is no marker in the summary, allow the native toggle
121
+ // so the details never becomes un-toggleable.
122
+ if (!summary.querySelector("[tp-summary-marker]"))
123
+ return;
124
+ if (target.closest("[tp-summary-marker]"))
125
+ return;
126
+ event.preventDefault();
127
+ };
128
+ }
129
+ static {
130
+ const style = (this.GLOBAL_STYLE = document.createElement("style"));
131
+ style.textContent = `
132
+ tp-details-set {
133
+ display: block;
134
+ interpolate-size: allow-keywords;
135
+ }
136
+
137
+ tp-details-set > details::details-content {
138
+ block-size: 0;
139
+ overflow: clip;
140
+ transition:
141
+ block-size var(--tp-details-set-transition-duration, 0.3s)
142
+ var(--tp-details-set-transition-easing, ease),
143
+ content-visibility var(--tp-details-set-transition-duration, 0.3s)
144
+ var(--tp-details-set-transition-easing, ease)
145
+ allow-discrete;
146
+ }
147
+
148
+ tp-details-set > details[open]::details-content {
149
+ block-size: auto;
150
+ }
151
+
152
+ /* Hide the native disclosure marker when the consumer has supplied at
153
+ least one custom marker via <template summary-marker>. */
154
+ tp-details-set > details > summary:has(> [tp-summary-marker]) {
155
+ list-style: none;
156
+ }
157
+ tp-details-set > details > summary:has(> [tp-summary-marker])::-webkit-details-marker {
158
+ display: none;
159
+ }
160
+ tp-details-set > details > summary:has(> [tp-summary-marker])::marker {
161
+ content: "";
162
+ }
163
+ `;
164
+ document.head.appendChild(style);
165
+ }
166
+ /** FIFO queue of currently-open direct-child `<details>` elements. */
167
+ #openOrder;
168
+ /** Per-child observers watching the `open` attribute. */
169
+ #childObservers;
170
+ /** Observer watching `childList` changes on the host. */
171
+ #childListObserver;
172
+ /** Per-marker-template observers (content + `index` attribute changes). */
173
+ #markerObservers;
174
+ /**
175
+ * Tracks raw cloned marker nodes inserted into each summary, keyed by the
176
+ * source template, so re-syncs can remove and re-insert without leaving
177
+ * stale DOM behind.
178
+ */
179
+ #insertedMarkers;
180
+ createRenderRoot() {
181
+ return this;
182
+ }
183
+ connectedCallback() {
184
+ super.connectedCallback();
185
+ // Capture-phase `toggle` listener: `toggle` does not bubble, but capture
186
+ // phase still reaches ancestors.
187
+ this.addEventListener("toggle", this.#handleToggle, { capture: true });
188
+ // Capture-phase click listener implements `toggle-on="marker"` by calling
189
+ // `preventDefault()` for non-marker clicks on summaries.
190
+ this.addEventListener("click", this.#handleSummaryClick, { capture: true });
191
+ this.#childListObserver = new MutationObserver(this.#handleChildListMutation);
192
+ this.#childListObserver.observe(this, { childList: true });
193
+ this.#syncDirectChildren();
194
+ }
195
+ disconnectedCallback() {
196
+ super.disconnectedCallback();
197
+ this.removeEventListener("toggle", this.#handleToggle, { capture: true });
198
+ this.removeEventListener("click", this.#handleSummaryClick, { capture: true });
199
+ this.#childListObserver?.disconnect();
200
+ this.#childListObserver = undefined;
201
+ for (const observer of this.#childObservers.values()) {
202
+ observer.disconnect();
203
+ }
204
+ this.#childObservers.clear();
205
+ for (const observer of this.#markerObservers.values()) {
206
+ observer.disconnect();
207
+ }
208
+ this.#markerObservers.clear();
209
+ this.#openOrder = [];
210
+ }
211
+ updated(changed) {
212
+ if (changed.has("maxOpenItems")) {
213
+ this.#enforceLimit();
214
+ }
215
+ }
216
+ render() {
217
+ return lit.html ``;
218
+ }
219
+ /**
220
+ * Reconcile observers and the FIFO queue with the current direct children.
221
+ * Called on connect and whenever the host's child list mutates.
222
+ */
223
+ #syncDirectChildren() {
224
+ const current = new Set(this.#directDetails());
225
+ // Drop observers + queue entries for removed children.
226
+ for (const [child, observer] of this.#childObservers) {
227
+ if (!current.has(child)) {
228
+ observer.disconnect();
229
+ this.#childObservers.delete(child);
230
+ }
231
+ }
232
+ this.#openOrder = this.#openOrder.filter((child) => current.has(child));
233
+ // Attach observers for new children, seed the queue with already-open ones.
234
+ for (const child of current) {
235
+ if (!this.#childObservers.has(child)) {
236
+ const observer = new MutationObserver(() => this.#handleChildOpenMutation(child));
237
+ observer.observe(child, { attributes: true, attributeFilter: ["open"] });
238
+ this.#childObservers.set(child, observer);
239
+ if (child.open && !this.#openOrder.includes(child)) {
240
+ this.#openOrder.push(child);
241
+ }
242
+ }
243
+ }
244
+ this.#enforceLimit();
245
+ this.#syncMarkerTemplates();
246
+ this.#syncAllMarkers();
247
+ }
248
+ /** Reconcile per-template observers with the current marker templates. */
249
+ #syncMarkerTemplates() {
250
+ const current = new Set(this.#markerTemplates());
251
+ for (const [template, observer] of this.#markerObservers) {
252
+ if (!current.has(template)) {
253
+ observer.disconnect();
254
+ this.#markerObservers.delete(template);
255
+ }
256
+ }
257
+ for (const template of current) {
258
+ if (!this.#markerObservers.has(template)) {
259
+ const observer = new MutationObserver(this.#handleMarkerTemplateMutation);
260
+ // Watch both the template's own `index` attribute and its content
261
+ // (including nested edits inside `template.content`).
262
+ observer.observe(template, {
263
+ attributes: true,
264
+ attributeFilter: ["index", "summary-marker"],
265
+ });
266
+ observer.observe(template.content, { childList: true, subtree: true, characterData: true, attributes: true });
267
+ this.#markerObservers.set(template, observer);
268
+ }
269
+ }
270
+ }
271
+ #handleMarkerTemplateMutation;
272
+ /** Apply marker templates to every direct-child `<details>`'s `<summary>`. */
273
+ #syncAllMarkers() {
274
+ const templates = this.#markerTemplates();
275
+ for (const details of this.#directDetails()) {
276
+ const summary = details.querySelector(":scope > summary");
277
+ if (summary instanceof HTMLElement) {
278
+ this.#applyMarkersTo(summary, templates);
279
+ }
280
+ }
281
+ }
282
+ #applyMarkersTo(summary, templates) {
283
+ let perTemplate = this.#insertedMarkers.get(summary);
284
+ if (!perTemplate) {
285
+ perTemplate = new Map();
286
+ this.#insertedMarkers.set(summary, perTemplate);
287
+ }
288
+ // Remove all previously-inserted marker nodes for this summary first, so
289
+ // re-application is order-stable and never duplicates.
290
+ for (const nodes of perTemplate.values()) {
291
+ for (const node of nodes) {
292
+ if (node.parentNode === summary)
293
+ summary.removeChild(node);
294
+ }
295
+ }
296
+ perTemplate.clear();
297
+ for (const template of templates) {
298
+ const fragment = template.content.cloneNode(true);
299
+ // Capture nodes BEFORE insertion — the fragment empties on append.
300
+ const inserted = Array.from(fragment.childNodes);
301
+ if (inserted.length === 0)
302
+ continue;
303
+ // Tag every cloned element so consumers can target markers via CSS
304
+ // (e.g. `[tp-summary-marker]`) and so the host stylesheet can hide the
305
+ // native `::marker` on summaries that have a custom marker.
306
+ for (const node of inserted) {
307
+ if (node instanceof Element)
308
+ node.setAttribute("tp-summary-marker", "");
309
+ }
310
+ const idx = resolveMarkerIndex(template.getAttribute("index"), summary.childNodes.length);
311
+ const ref = summary.childNodes[idx] ?? null;
312
+ summary.insertBefore(fragment, ref);
313
+ perTemplate.set(template, inserted);
314
+ }
315
+ }
316
+ /** Direct-child `<template>` elements with the `summary-marker` attribute. */
317
+ #markerTemplates() {
318
+ return Array.from(this.children).filter((c) => c instanceof HTMLTemplateElement && c.hasAttribute("summary-marker"));
319
+ }
320
+ #directDetails() {
321
+ return Array.from(this.children).filter((c) => c instanceof HTMLDetailsElement);
322
+ }
323
+ #handleChildListMutation;
324
+ #handleToggle;
325
+ #handleChildOpenMutation;
326
+ /**
327
+ * Capture-phase click handler that suppresses the native toggle when a
328
+ * `<summary>` is clicked outside its marker(s) and the effective
329
+ * `toggle-on` mode is `"marker"`.
330
+ *
331
+ * Resolution per `<details>`:
332
+ * - per-`<details>` `toggle-on` attribute (if `"summary"` or `"marker"`),
333
+ * else
334
+ * - the host's `toggle-on` property/attribute, else
335
+ * - `"summary"`.
336
+ *
337
+ * Carve-outs:
338
+ * - Keyboard activation (Enter/Space) produces a synthetic click with
339
+ * `event.detail === 0`; we never suppress those.
340
+ * - If the summary contains no `[tp-summary-marker]` element, fall back to
341
+ * summary-click toggle so the details cannot become un-toggleable.
342
+ */
343
+ #handleSummaryClick;
344
+ #resolveToggleOn(details) {
345
+ const own = details.getAttribute("toggle-on");
346
+ if (own === "marker" || own === "summary")
347
+ return own;
348
+ return this.toggleOn === "marker" ? "marker" : "summary";
349
+ }
350
+ #applyOpenState(child) {
351
+ const inQueue = this.#openOrder.includes(child);
352
+ if (child.open && !inQueue) {
353
+ this.#openOrder.push(child);
354
+ this.#enforceLimit();
355
+ }
356
+ else if (!child.open && inQueue) {
357
+ this.#openOrder = this.#openOrder.filter((entry) => entry !== child);
358
+ }
359
+ }
360
+ #enforceLimit() {
361
+ const limit = this.maxOpenItems;
362
+ if (!Number.isFinite(limit) || limit <= 0)
363
+ return;
364
+ const closed = [];
365
+ while (this.#openOrder.length > limit) {
366
+ const oldest = this.#openOrder.shift();
367
+ if (!oldest)
368
+ break;
369
+ if (oldest.open) {
370
+ oldest.open = false;
371
+ closed.push(oldest);
372
+ }
373
+ }
374
+ if (closed.length > 0) {
375
+ this.dispatchEvent(new CustomEvent("tp-details-set-change", {
376
+ bubbles: true,
377
+ composed: true,
378
+ detail: { opened: [], closed },
379
+ }));
380
+ }
381
+ }
382
+ };
383
+ tslib.__decorate([
384
+ decorators_js.property({ type: Number, reflect: true, attribute: "max-open-items" }),
385
+ tslib.__metadata("design:type", Object)
386
+ ], exports.DetailsSetElement.prototype, "maxOpenItems", void 0);
387
+ tslib.__decorate([
388
+ decorators_js.property({ reflect: true, attribute: "toggle-on" }),
389
+ tslib.__metadata("design:type", String)
390
+ ], exports.DetailsSetElement.prototype, "toggleOn", void 0);
391
+ exports.DetailsSetElement = tslib.__decorate([
392
+ decorators_js.customElement("tp-details-set")
393
+ ], exports.DetailsSetElement);
394
+ //# sourceMappingURL=details-set-element.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"details-set-element.cjs","sources":["../../../../libs/elements/src/details-set/details-set-element.ts"],"sourcesContent":[null],"names":["DetailsSetElement","LitElement","html","__decorate","property","customElement"],"mappings":";;;;;;AAIA;;;;;;;AAOG;AACH,SAAS,kBAAkB,CAAC,GAAkB,EAAE,MAAc,EAAA;AAC5D,IAAA,IAAI,GAAG,KAAK,IAAI,IAAI,GAAG,KAAK,EAAE;AAAE,QAAA,OAAO,CAAC;AACxC,IAAA,MAAM,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC;AACrB,IAAA,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC;AAAE,QAAA,OAAO,CAAC;IACjC,MAAM,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;IACvB,IAAI,CAAC,IAAI,CAAC;QAAE,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,MAAM,CAAC;AACtC,IAAA,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,MAAM,GAAG,CAAC,GAAG,CAAC,CAAC;AACpC;AAyFaA,yBAAiB,GAAvB,MAAM,iBAAkB,SAAQC,cAAU,CAAA;AAA1C,IAAA,WAAA,GAAA;;AA0CL;;;AAGG;QAEH,IAAA,CAAA,YAAY,GAAG,CAAC;AAEhB;;;;;;;;;;;;;AAaG;QAEH,IAAA,CAAA,QAAQ,GAAyB,SAAS;;QA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