@telperion/elements 3.0.3 → 4.1.0

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.
Files changed (78) hide show
  1. package/.build-manifest.json +12 -1
  2. package/README.md +45 -0
  3. package/_chunks/signal-watcher-lit-element-B9xodkLt.d.cts +29 -0
  4. package/_chunks/signal-watcher-lit-element-B9xodkLt.d.ts +29 -0
  5. package/drag-drop/drag-handle-element.cjs +1 -1
  6. package/drag-drop/drag-handle-element.js +1 -1
  7. package/fesm/elements.mjs +610 -30
  8. package/fesm/elements.mjs.map +1 -1
  9. package/iife/elements.js +192 -21
  10. package/iife/elements.js.map +1 -1
  11. package/iife/popover/index.js +44 -6
  12. package/iife/popover/index.js.map +1 -1
  13. package/iife/router/index.js.map +1 -1
  14. package/iife/select/index.js +278 -0
  15. package/iife/select/index.js.map +1 -0
  16. package/index.cjs +17 -0
  17. package/index.cjs.map +1 -1
  18. package/index.d.cts +2 -0
  19. package/index.d.ts +2 -0
  20. package/index.js +4 -0
  21. package/index.js.map +1 -1
  22. package/package.json +32 -5
  23. package/popover/index.d.cts +1 -1
  24. package/popover/index.d.ts +1 -1
  25. package/popover/popover-element.cjs +28 -18
  26. package/popover/popover-element.cjs.map +1 -1
  27. package/popover/popover-element.js +29 -19
  28. package/popover/popover-element.js.map +1 -1
  29. package/router/index.d.cts +2 -26
  30. package/router/index.d.ts +2 -26
  31. package/router/tha-router-config.cjs +2 -2
  32. package/router/tha-router-config.cjs.map +1 -1
  33. package/router/tha-router-config.js +2 -2
  34. package/router/tha-router-config.js.map +1 -1
  35. package/router/tha-router-link.cjs +1 -1
  36. package/router/tha-router-link.js +1 -1
  37. package/router/tha-router-outlet.cjs +1 -1
  38. package/router/tha-router-outlet.js +1 -1
  39. package/router/tha-router-param.cjs +1 -1
  40. package/router/tha-router-param.js +1 -1
  41. package/router/tha-router.cjs +1 -1
  42. package/router/tha-router.js +1 -1
  43. package/select/index.cjs +23 -0
  44. package/select/index.cjs.map +1 -0
  45. package/select/index.d.cts +284 -0
  46. package/select/index.d.ts +284 -0
  47. package/select/index.js +5 -0
  48. package/select/index.js.map +1 -0
  49. package/select/internal-props.cjs +10 -0
  50. package/select/internal-props.cjs.map +1 -0
  51. package/select/internal-props.js +6 -0
  52. package/select/internal-props.js.map +1 -0
  53. package/select/option.element.cjs +88 -0
  54. package/select/option.element.cjs.map +1 -0
  55. package/select/option.element.js +88 -0
  56. package/select/option.element.js.map +1 -0
  57. package/select/select-change-event.cjs +30 -0
  58. package/select/select-change-event.cjs.map +1 -0
  59. package/select/select-change-event.js +28 -0
  60. package/select/select-change-event.js.map +1 -0
  61. package/select/select-context.cjs +14 -0
  62. package/select/select-context.cjs.map +1 -0
  63. package/select/select-context.js +12 -0
  64. package/select/select-context.js.map +1 -0
  65. package/select/select.element.cjs +414 -0
  66. package/select/select.element.cjs.map +1 -0
  67. package/select/select.element.js +414 -0
  68. package/select/select.element.js.map +1 -0
  69. package/select/selected-content.element.cjs +65 -0
  70. package/select/selected-content.element.cjs.map +1 -0
  71. package/select/selected-content.element.js +65 -0
  72. package/select/selected-content.element.js.map +1 -0
  73. package/utils/signal-watcher-lit-element.cjs.map +1 -0
  74. package/utils/signal-watcher-lit-element.js.map +1 -0
  75. package/router/signal-watcher-lit-element.cjs.map +0 -1
  76. package/router/signal-watcher-lit-element.js.map +0 -1
  77. /package/{router → utils}/signal-watcher-lit-element.cjs +0 -0
  78. /package/{router → utils}/signal-watcher-lit-element.js +0 -0
@@ -0,0 +1,414 @@
1
+ 'use strict';
2
+
3
+ var tslib = require('tslib');
4
+ var popoverElement = require('../popover/popover-element.cjs');
5
+ var context = require('@lit/context');
6
+ var signals = require('@lit-labs/signals');
7
+ var lit = require('lit');
8
+ var decorators_js = require('lit/decorators.js');
9
+ var sliceBefore = require('@telperion/js-utils/array/slice-before');
10
+ var selectContext = require('./select-context.cjs');
11
+ var selectedContent_element = require('./selected-content.element.cjs');
12
+ var option_element = require('./option.element.cjs');
13
+ var internalProps = require('./internal-props.cjs');
14
+ var selectChangeEvent = require('./select-change-event.cjs');
15
+ var defer = require('@telperion/js-utils/function/defer');
16
+ var signalWatcherLitElement = require('../utils/signal-watcher-lit-element.cjs');
17
+
18
+ var SelectElement_1;
19
+ exports.SelectElement = class SelectElement extends signalWatcherLitElement.SignalWatcherLitElement {
20
+ static { SelectElement_1 = this; }
21
+ static { this.formAssociated = true; }
22
+ static { this.ALLOWED_OPTION_ELEMENTS = [option_element.OptionElement]; }
23
+ static { this.styles = lit.css `
24
+ :host {
25
+ position: relative;
26
+ display: inline-flex;
27
+ height: fit-content;
28
+
29
+ --tp-select-option-color: white;
30
+ --tp-select-selection-color: #0078d4;
31
+ --tp-select-highlight-percent: 20%;
32
+ --tp-select-selection-contrast-color: white;
33
+ }
34
+
35
+ :host([disabled]) {
36
+ pointer-events: none;
37
+ opacity: 0.6;
38
+ }
39
+
40
+ :host([open]) {
41
+ [pseudo="indicator"] {
42
+ transform: rotateX(180deg);
43
+ }
44
+ }
45
+
46
+ [pseudo="button"] {
47
+ background: white;
48
+ cursor: pointer;
49
+ display: inline-flex;
50
+ align-items: center;
51
+ padding: 0.25em 0.5em;
52
+
53
+ tp-selected-content {
54
+ margin-inline-end: 0.5em;
55
+ }
56
+ }
57
+
58
+ [pseudo="indicator"] {
59
+ margin-inline-start: auto;
60
+ }
61
+
62
+ tp-popover {
63
+ border: none;
64
+ padding: 0;
65
+ }
66
+ `; }
67
+ #options;
68
+ #value;
69
+ get value() {
70
+ return this.#value.get();
71
+ }
72
+ set value(next) {
73
+ defer.defer(() => {
74
+ const values = next.split(",").map((s) => s.trim());
75
+ const options = Array.from(this.#options);
76
+ this.selectedOptions.set(values
77
+ .map((value) => options.find((option) => option.value === value))
78
+ .filter(Boolean)
79
+ .map((option) => new WeakRef(option)));
80
+ });
81
+ }
82
+ #placeholder;
83
+ get placeholder() {
84
+ return this.#placeholder.get();
85
+ }
86
+ set placeholder(next) {
87
+ this.#signalSetter(this.#placeholder, "placeholder", next);
88
+ }
89
+ #internals;
90
+ /** Initial `value` captured at construction so `formResetCallback` can restore it. */
91
+ #initialValue;
92
+ /**
93
+ * Last `value` for which a `change` event was emitted (or considered for
94
+ * emission). `null` means "no sync has happened yet" — used to suppress
95
+ * the very first `willUpdate` so we don't emit a phantom change on mount.
96
+ */
97
+ #lastEmittedValue;
98
+ constructor() {
99
+ super();
100
+ this.#options = new Set();
101
+ /**
102
+ * Provides this `<tp-select>` instance to descendants via `@lit/context`,
103
+ * so consumers (e.g. `<tp-selected-content>`) can find it across any
104
+ * number of shadow DOM boundaries — not just light-DOM ancestors.
105
+ */
106
+ this.self = this;
107
+ this.selectedOptions = signals.signal([]);
108
+ this.#value = signals.computed(() => this.selectedOptions
109
+ .get()
110
+ .map((ref) => ref.deref()?.value ?? "")
111
+ .filter(Boolean)
112
+ .join(","));
113
+ this.#placeholder = signals.signal("Select an option");
114
+ /**
115
+ * Maximum number of options that can be selected at once.
116
+ *
117
+ * Defaults to `1` (single-select). Any positive integer enables
118
+ * multi-select up to that many entries. Use the literal string
119
+ * `"infinite"` in HTML to allow an unbounded
120
+ * selection — the converter normalises it to `Number.POSITIVE_INFINITY`.
121
+ *
122
+ * When the limit is reached and a new option is selected, the oldest
123
+ * entry in `selectedOptions` is dropped (FIFO) so the new selection can
124
+ * fit. Setting `max` to a smaller number trims the current selection
125
+ * down to size from the end.
126
+ */
127
+ this.max = 1;
128
+ /** Form field name. Submitted with the owning `<form>`. */
129
+ this.name = null;
130
+ /** When true, the element is non-interactive and excluded from form submission. */
131
+ this.disabled = false;
132
+ /** When true, an empty selection makes the element invalid (`valueMissing`). */
133
+ this.required = false;
134
+ this.open = false;
135
+ /** Initial `value` captured at construction so `formResetCallback` can restore it. */
136
+ this.#initialValue = "";
137
+ /**
138
+ * Last `value` for which a `change` event was emitted (or considered for
139
+ * emission). `null` means "no sync has happened yet" — used to suppress
140
+ * the very first `willUpdate` so we don't emit a phantom change on mount.
141
+ */
142
+ this.#lastEmittedValue = null;
143
+ this.#internals = this.attachInternals();
144
+ }
145
+ /** Live `ElementInternals` (validity, form, labels, etc.). */
146
+ get internals() {
147
+ return this.#internals;
148
+ }
149
+ /** Owning `<form>` element, or `null` when not associated. */
150
+ get form() {
151
+ return this.#internals.form;
152
+ }
153
+ /** Native validity state of this control. */
154
+ get validity() {
155
+ return this.#internals.validity;
156
+ }
157
+ get validationMessage() {
158
+ return this.#internals.validationMessage;
159
+ }
160
+ get willValidate() {
161
+ return this.#internals.willValidate;
162
+ }
163
+ checkValidity() {
164
+ return this.#internals.checkValidity();
165
+ }
166
+ reportValidity() {
167
+ return this.#internals.reportValidity();
168
+ }
169
+ createRenderRoot() {
170
+ const root = super.createRenderRoot();
171
+ root.adoptedStyleSheets = [
172
+ ...root.adoptedStyleSheets,
173
+ popoverElement.PopoverElement.styles.styleSheet,
174
+ selectedContent_element.SelectedContentElement.styles.styleSheet,
175
+ option_element.OptionElement.styles.styleSheet,
176
+ ];
177
+ return root;
178
+ }
179
+ connectedCallback() {
180
+ super.connectedCallback();
181
+ this.#initialValue = this.value;
182
+ }
183
+ disconnectedCallback() {
184
+ super.disconnectedCallback();
185
+ }
186
+ render() {
187
+ return lit.html `
188
+ <div pseudo="button" part="button">
189
+ <slot name="button">
190
+ <tp-selected-content part="selected-content"></tp-selected-content>
191
+ <slot name="indicator">
192
+ <span part="indicator" pseudo="indicator">▾</span>
193
+ </slot>
194
+ </slot>
195
+ </div>
196
+ <tp-popover
197
+ position="start to start / bottom"
198
+ target="[pseudo=button]"
199
+ @click=${this.#handlePopoverClick}
200
+ @toggle=${this.#handlePopoverToggle}
201
+ part="popover">
202
+ <slot name="popover">
203
+ <slot></slot>
204
+ </slot>
205
+ </tp-popover>
206
+ `;
207
+ }
208
+ updated(changed) {
209
+ super.updated(changed);
210
+ if (changed.has("max") && Number.isFinite(this.max)) {
211
+ const current = this.selectedOptions.get();
212
+ if (current.length > this.max) {
213
+ this.selectedOptions.set(current.slice(current.length - this.max));
214
+ }
215
+ }
216
+ }
217
+ /**
218
+ * Keep `ElementInternals` in sync with the current value and validity.
219
+ * Reading `this.value` here transitively reads `selectedOptions`, so the
220
+ * `SignalWatcher` base auto-tracks it and re-runs `willUpdate` whenever
221
+ * the selection changes — no `updateEffect` (and no microtask race) needed.
222
+ */
223
+ willUpdate(_changed) {
224
+ this.#syncForm();
225
+ this.#dispatchChange();
226
+ }
227
+ // -- Form-associated callbacks ------------------------------------------
228
+ formResetCallback() {
229
+ this.value = this.#initialValue;
230
+ }
231
+ formDisabledCallback(disabled) {
232
+ this.disabled = disabled;
233
+ }
234
+ formStateRestoreCallback(state) {
235
+ if (state == null) {
236
+ this.value = "";
237
+ return;
238
+ }
239
+ if (typeof state === "string") {
240
+ this.value = state;
241
+ return;
242
+ }
243
+ if (state instanceof FormData) {
244
+ const values = [];
245
+ state.forEach((v) => {
246
+ if (typeof v === "string")
247
+ values.push(v);
248
+ });
249
+ this.value = values.join(",");
250
+ }
251
+ }
252
+ /**
253
+ * Push the current selection into `ElementInternals`. Single-select forms
254
+ * report a string; multi-select forms report a `FormData` with one entry
255
+ * per selected value (so the form serialises the same way as a native
256
+ * `<select multiple>`). Also updates validity for `required`.
257
+ */
258
+ #syncForm() {
259
+ const values = this.value === "" ? [] : this.value.split(",");
260
+ if (this.max === 1) {
261
+ this.#internals.setFormValue(values[0] ?? "");
262
+ }
263
+ else {
264
+ const fd = new FormData();
265
+ const fieldName = this.name ?? "";
266
+ for (const v of values)
267
+ fd.append(fieldName, v);
268
+ this.#internals.setFormValue(fd);
269
+ }
270
+ if (this.required && values.length === 0) {
271
+ this.#internals.setValidity({ valueMissing: true }, "Please select an option.");
272
+ }
273
+ else {
274
+ this.#internals.setValidity({});
275
+ }
276
+ }
277
+ /**
278
+ * Dispatch a `SelectChangeEvent` when the joined value has actually
279
+ * changed. Suppresses the very first sync so consumers don't see a
280
+ * phantom `change` on mount (matches native `<select>` behavior).
281
+ */
282
+ #dispatchChange() {
283
+ const current = this.value;
284
+ if (current === this.#lastEmittedValue)
285
+ return;
286
+ const isInitialSync = this.#lastEmittedValue === null;
287
+ this.#lastEmittedValue = current;
288
+ if (isInitialSync)
289
+ return;
290
+ const selectedOptions = this.selectedOptions
291
+ .get()
292
+ .map(ref => ref.deref())
293
+ .filter(Boolean);
294
+ this.dispatchEvent(new selectChangeEvent.SelectChangeEvent({ value: current, selectedOptions }));
295
+ }
296
+ selectOption(option) {
297
+ const current = this.selectedOptions.get();
298
+ if (current.find(ref => ref.deref() === option))
299
+ return;
300
+ const next = [...current, new WeakRef(option)];
301
+ const trimmed = next.length > this.max
302
+ ? next.slice(next.length - this.max)
303
+ : next;
304
+ this.selectedOptions.set(trimmed);
305
+ }
306
+ deselectOption(option) {
307
+ const optionRef = this.selectedOptions.get().find(ref => ref.deref() === option);
308
+ if (!optionRef)
309
+ return;
310
+ this.selectedOptions.set(this.selectedOptions.get().filter(ref => ref !== optionRef));
311
+ }
312
+ toggleOption(option) {
313
+ const ref = this.selectedOptions.get().find(ref => ref.deref() === option);
314
+ if (ref) {
315
+ this.deselectOption(option);
316
+ }
317
+ else {
318
+ this.selectOption(option);
319
+ }
320
+ }
321
+ [internalProps.REGISTER_OPTION](option) {
322
+ this.#options.add(option);
323
+ }
324
+ [internalProps.UNREGISTER_OPTION](option) {
325
+ this.#options.delete(option);
326
+ const selectedOptions = this.selectedOptions.get();
327
+ const optionRef = selectedOptions.find(ref => ref.deref() === option);
328
+ if (!optionRef)
329
+ return;
330
+ this.selectedOptions.set(selectedOptions.filter(ref => ref !== optionRef));
331
+ }
332
+ #handlePopoverClick(e) {
333
+ if (this.disabled)
334
+ return;
335
+ const option = sliceBefore.sliceBefore(e.composedPath(), this)
336
+ .find(el => SelectElement_1.ALLOWED_OPTION_ELEMENTS.some(allowed => el instanceof allowed));
337
+ if (!option)
338
+ return;
339
+ this.toggleOption(option);
340
+ const count = this.selectedOptions.get().length;
341
+ // Close the popover when a new selection just filled the quota.
342
+ if (count >= this.max) {
343
+ const popover = this.shadowRoot?.querySelector("tp-popover");
344
+ popover?.hidePopover();
345
+ }
346
+ }
347
+ #handlePopoverToggle(e) {
348
+ this.open = e.newState === "open";
349
+ }
350
+ #signalSetter(signal, propName, newValue) {
351
+ const previous = signal.get();
352
+ if (previous === newValue)
353
+ return;
354
+ signal.set(newValue);
355
+ this.requestUpdate(propName, previous);
356
+ }
357
+ };
358
+ tslib.__decorate([
359
+ context.provide({ context: selectContext.selectContext }),
360
+ tslib.__metadata("design:type", exports.SelectElement)
361
+ ], exports.SelectElement.prototype, "self", void 0);
362
+ tslib.__decorate([
363
+ decorators_js.property({ type: String, reflect: true, noAccessor: true }),
364
+ tslib.__metadata("design:type", String),
365
+ tslib.__metadata("design:paramtypes", [String])
366
+ ], exports.SelectElement.prototype, "value", null);
367
+ tslib.__decorate([
368
+ decorators_js.property({ type: String, reflect: true, noAccessor: true }),
369
+ tslib.__metadata("design:type", String),
370
+ tslib.__metadata("design:paramtypes", [String])
371
+ ], exports.SelectElement.prototype, "placeholder", null);
372
+ tslib.__decorate([
373
+ decorators_js.property({
374
+ reflect: true,
375
+ converter: {
376
+ fromAttribute: (value) => {
377
+ if (value === null || value === undefined || value === "")
378
+ return 1;
379
+ const trimmed = String(value).trim().toLowerCase();
380
+ if (trimmed === "infinite")
381
+ return Number.POSITIVE_INFINITY;
382
+ const parsed = Number(trimmed);
383
+ return Number.isFinite(parsed) && parsed >= 1 ? Math.floor(parsed) : 1;
384
+ },
385
+ toAttribute: (value) => {
386
+ if (!Number.isFinite(value))
387
+ return "infinite";
388
+ return String(value);
389
+ },
390
+ },
391
+ }),
392
+ tslib.__metadata("design:type", Number)
393
+ ], exports.SelectElement.prototype, "max", void 0);
394
+ tslib.__decorate([
395
+ decorators_js.property({ type: String, reflect: true }),
396
+ tslib.__metadata("design:type", Object)
397
+ ], exports.SelectElement.prototype, "name", void 0);
398
+ tslib.__decorate([
399
+ decorators_js.property({ type: Boolean, reflect: true }),
400
+ tslib.__metadata("design:type", Object)
401
+ ], exports.SelectElement.prototype, "disabled", void 0);
402
+ tslib.__decorate([
403
+ decorators_js.property({ type: Boolean, reflect: true }),
404
+ tslib.__metadata("design:type", Object)
405
+ ], exports.SelectElement.prototype, "required", void 0);
406
+ tslib.__decorate([
407
+ decorators_js.property({ type: Boolean, reflect: true }),
408
+ tslib.__metadata("design:type", Object)
409
+ ], exports.SelectElement.prototype, "open", void 0);
410
+ exports.SelectElement = SelectElement_1 = tslib.__decorate([
411
+ decorators_js.customElement("tp-select"),
412
+ tslib.__metadata("design:paramtypes", [])
413
+ ], exports.SelectElement);
414
+ //# sourceMappingURL=select.element.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"select.element.cjs","sources":["../../../../libs/elements/src/select/select.element.ts"],"sourcesContent":[null],"names":["SelectElement","SignalWatcherLitElement","OptionElement","css","defer","signal","computed","PopoverElement","SelectedContentElement","html","SelectChangeEvent","REGISTER_OPTION","UNREGISTER_OPTION","sliceBefore","__decorate","provide","selectContext","property","customElement"],"mappings":";;;;;;;;;;;;;;;;;;AAyGaA,qBAAa,GAAnB,MAAM,aAAc,SAAQC,+CAAuB,CAAA;;aACjD,IAAA,CAAA,cAAc,GAAG,IAAH,CAAQ;AAEd,IAAA,SAAA,IAAA,CAAA,uBAAuB,GAAG,CAACC,4BAAa,CAAC,CAAC;aAClD,IAAA,CAAA,MAAM,GAAGC,OAAG,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2ClB,EAAA,CA3CY,CA2CX;AAEF,IAAA,QAAQ;AAaC,IAAA,MAAM;AAOf,IAAA,IACI,KAAK,GAAA;AACP,QAAA,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE;IAC1B;IACA,IAAI,KAAK,CAAC,IAAY,EAAA;QACpBC,WAAK,CAAC,MAAK;YACT,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,CAA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