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