@telperion/elements 5.3.1 → 5.4.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.
package/index.d.cts CHANGED
@@ -4,8 +4,9 @@ export { DetailsSetElement } from './details-set/index.cjs';
4
4
  export { PopoverElement } from './popover/index.cjs';
5
5
  export { OptionElement, SelectChangeEvent, SelectElement, SelectedContentElement } from './select/index.cjs';
6
6
  export { ButtonElement, ButtonType, ButtonVariant } from './button/index.cjs';
7
- import './_chunks/signal-watcher-lit-element-B9xodkLt.cjs';
7
+ import './_chunks/signal-watcher-lit-element-B5xCaa26.cjs';
8
8
  import 'lit';
9
+ import './_chunks/shade-mixer-lit-element-sw8t_VC5.cjs';
9
10
  import '@lit-labs/signals';
10
11
  import 'history';
11
12
  import '@telperion/extra-ts-types/polyfills/url-pattern';
package/index.d.ts CHANGED
@@ -4,8 +4,9 @@ export { DetailsSetElement } from './details-set/index.js';
4
4
  export { PopoverElement } from './popover/index.js';
5
5
  export { OptionElement, SelectChangeEvent, SelectElement, SelectedContentElement } from './select/index.js';
6
6
  export { ButtonElement, ButtonType, ButtonVariant } from './button/index.js';
7
- import './_chunks/signal-watcher-lit-element-B9xodkLt.js';
7
+ import './_chunks/signal-watcher-lit-element-B-vV0yNG.js';
8
8
  import 'lit';
9
+ import './_chunks/shade-mixer-lit-element-sw8t_VC5.js';
9
10
  import '@lit-labs/signals';
10
11
  import 'history';
11
12
  import '@telperion/extra-ts-types/polyfills/url-pattern';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@telperion/elements",
3
- "version": "5.3.1",
3
+ "version": "5.4.1",
4
4
  "description": "Framework-agnostic web components built with Lit: Material Symbols / Simple Icons / theSVG icons, declarative client-side router, drag-and-drop primitives, details accordion with FIFO open caps, a CSS-anchored popover, a form-associated selectbox with single/multi-select, and a form-associated button.",
5
5
  "keywords": [
6
6
  "web-components",
@@ -1,8 +1,9 @@
1
- import { S as SignalWatcherLitElement, E as EffectOptions } from '../_chunks/signal-watcher-lit-element-B9xodkLt.cjs';
1
+ import { S as SignalWatcherLitElement, E as EffectOptions } from '../_chunks/signal-watcher-lit-element-B5xCaa26.cjs';
2
2
  import { Signal as Signal$1 } from '@lit-labs/signals';
3
3
  import { History } from 'history';
4
4
  import { LitElement } from 'lit';
5
5
  import { URLPattern } from '@telperion/extra-ts-types/polyfills/url-pattern';
6
+ import '../_chunks/shade-mixer-lit-element-sw8t_VC5.cjs';
6
7
 
7
8
  /**
8
9
  * Supported history types for the router.
package/router/index.d.ts CHANGED
@@ -1,8 +1,9 @@
1
- import { S as SignalWatcherLitElement, E as EffectOptions } from '../_chunks/signal-watcher-lit-element-B9xodkLt.js';
1
+ import { S as SignalWatcherLitElement, E as EffectOptions } from '../_chunks/signal-watcher-lit-element-B-vV0yNG.js';
2
2
  import { Signal as Signal$1 } from '@lit-labs/signals';
3
3
  import { History } from 'history';
4
4
  import { LitElement } from 'lit';
5
5
  import { URLPattern } from '@telperion/extra-ts-types/polyfills/url-pattern';
6
+ import '../_chunks/shade-mixer-lit-element-sw8t_VC5.js';
6
7
 
7
8
  /**
8
9
  * Supported history types for the router.
@@ -1,5 +1,6 @@
1
1
  import { PropertyValues } from 'lit';
2
- import { S as SignalWatcherLitElement } from '../_chunks/signal-watcher-lit-element-B9xodkLt.cjs';
2
+ import { S as SignalWatcherLitElement, a as ShadeMixerSignalWatcherLitElement } from '../_chunks/signal-watcher-lit-element-B5xCaa26.cjs';
3
+ import '../_chunks/shade-mixer-lit-element-sw8t_VC5.cjs';
3
4
 
4
5
  declare const REGISTER_OPTION: unique symbol;
5
6
  declare const UNREGISTER_OPTION: unique symbol;
@@ -87,10 +88,28 @@ declare global {
87
88
  * @attr max - `1` (default) for single-select, any positive integer
88
89
  * for multi-select with FIFO eviction, or `infinite`
89
90
  * for unbounded selection.
91
+ * @attr min - Minimum number of options that must remain selected
92
+ * (`0` by default). When the current selection size is
93
+ * at or below `min`, further deselection attempts are
94
+ * ignored — the option stays selected.
90
95
  * @attr name - Form field name.
91
96
  * @attr disabled - Non-interactive; excluded from form submission.
92
97
  * @attr required - Empty selection triggers `valueMissing`.
93
98
  * @attr open - Reflects the popover's open state (read-only).
99
+ * @attr color - Palette token from the shared shade-mixer system
100
+ * (`primary`, `secondary`, `success`, … or any
101
+ * custom token defined via `--tp-element-color`).
102
+ * Drives the selected-option highlight color
103
+ * (`--tp-select-selection-color`) and its contrast
104
+ * text color. Inherited from
105
+ * `ShadeMixerLitElement`.
106
+ * @attr shade - `0`–`1000` (default `500`). Lightens (`<500`,
107
+ * mixes white) or darkens (`>500`, mixes black) the
108
+ * resolved `color` before it feeds the selection
109
+ * highlight. Inherited from `ShadeMixerLitElement`.
110
+ * @attr mixer - Read-only output (`none` / `black` / `white`)
111
+ * auto-derived from `shade`. Inherited from
112
+ * `ShadeMixerLitElement`.
94
113
  *
95
114
  * @method togglePopover - Open, close, or toggle the dropdown popover.
96
115
  * Overrides the native
@@ -159,7 +178,7 @@ declare global {
159
178
  "tp-select": SelectElement;
160
179
  }
161
180
  }
162
- declare class SelectElement extends SignalWatcherLitElement {
181
+ declare class SelectElement extends ShadeMixerSignalWatcherLitElement {
163
182
  #private;
164
183
  static formAssociated: boolean;
165
184
  private static ALLOWED_OPTION_ELEMENTS;
@@ -172,7 +191,7 @@ declare class SelectElement extends SignalWatcherLitElement {
172
191
  readonly self: SelectElement;
173
192
  readonly selectedOptions: Signal.State<T>;
174
193
  get value(): string;
175
- set value(next: string);
194
+ set value(next: string | null);
176
195
  get placeholder(): string;
177
196
  set placeholder(next: string);
178
197
  /**
@@ -189,6 +208,17 @@ declare class SelectElement extends SignalWatcherLitElement {
189
208
  * down to size from the end.
190
209
  */
191
210
  max: number;
211
+ /**
212
+ * Minimum number of options that must remain selected.
213
+ *
214
+ * Defaults to `0` (no lower bound). When the current selection size is at
215
+ * or below `min`, calls to {@link deselectOption} (and the click-driven
216
+ * toggle inside the popover) become no-ops, so the user can't drop below
217
+ * the floor by interacting with the control. Programmatic writes to
218
+ * `value` and `selectedOptions` are not policed — `min` is purely an
219
+ * interaction guard.
220
+ */
221
+ min: number;
192
222
  /** Form field name. Submitted with the owning `<form>`. */
193
223
  name: string | null;
194
224
  /** When true, the element is non-interactive and excluded from form submission. */
package/select/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import { PropertyValues } from 'lit';
2
- import { S as SignalWatcherLitElement } from '../_chunks/signal-watcher-lit-element-B9xodkLt.js';
2
+ import { S as SignalWatcherLitElement, a as ShadeMixerSignalWatcherLitElement } from '../_chunks/signal-watcher-lit-element-B-vV0yNG.js';
3
+ import '../_chunks/shade-mixer-lit-element-sw8t_VC5.js';
3
4
 
4
5
  declare const REGISTER_OPTION: unique symbol;
5
6
  declare const UNREGISTER_OPTION: unique symbol;
@@ -87,10 +88,28 @@ declare global {
87
88
  * @attr max - `1` (default) for single-select, any positive integer
88
89
  * for multi-select with FIFO eviction, or `infinite`
89
90
  * for unbounded selection.
91
+ * @attr min - Minimum number of options that must remain selected
92
+ * (`0` by default). When the current selection size is
93
+ * at or below `min`, further deselection attempts are
94
+ * ignored — the option stays selected.
90
95
  * @attr name - Form field name.
91
96
  * @attr disabled - Non-interactive; excluded from form submission.
92
97
  * @attr required - Empty selection triggers `valueMissing`.
93
98
  * @attr open - Reflects the popover's open state (read-only).
99
+ * @attr color - Palette token from the shared shade-mixer system
100
+ * (`primary`, `secondary`, `success`, … or any
101
+ * custom token defined via `--tp-element-color`).
102
+ * Drives the selected-option highlight color
103
+ * (`--tp-select-selection-color`) and its contrast
104
+ * text color. Inherited from
105
+ * `ShadeMixerLitElement`.
106
+ * @attr shade - `0`–`1000` (default `500`). Lightens (`<500`,
107
+ * mixes white) or darkens (`>500`, mixes black) the
108
+ * resolved `color` before it feeds the selection
109
+ * highlight. Inherited from `ShadeMixerLitElement`.
110
+ * @attr mixer - Read-only output (`none` / `black` / `white`)
111
+ * auto-derived from `shade`. Inherited from
112
+ * `ShadeMixerLitElement`.
94
113
  *
95
114
  * @method togglePopover - Open, close, or toggle the dropdown popover.
96
115
  * Overrides the native
@@ -159,7 +178,7 @@ declare global {
159
178
  "tp-select": SelectElement;
160
179
  }
161
180
  }
162
- declare class SelectElement extends SignalWatcherLitElement {
181
+ declare class SelectElement extends ShadeMixerSignalWatcherLitElement {
163
182
  #private;
164
183
  static formAssociated: boolean;
165
184
  private static ALLOWED_OPTION_ELEMENTS;
@@ -172,7 +191,7 @@ declare class SelectElement extends SignalWatcherLitElement {
172
191
  readonly self: SelectElement;
173
192
  readonly selectedOptions: Signal.State<T>;
174
193
  get value(): string;
175
- set value(next: string);
194
+ set value(next: string | null);
176
195
  get placeholder(): string;
177
196
  set placeholder(next: string);
178
197
  /**
@@ -189,6 +208,17 @@ declare class SelectElement extends SignalWatcherLitElement {
189
208
  * down to size from the end.
190
209
  */
191
210
  max: number;
211
+ /**
212
+ * Minimum number of options that must remain selected.
213
+ *
214
+ * Defaults to `0` (no lower bound). When the current selection size is at
215
+ * or below `min`, calls to {@link deselectOption} (and the click-driven
216
+ * toggle inside the popover) become no-ops, so the user can't drop below
217
+ * the floor by interacting with the control. Programmatic writes to
218
+ * `value` and `selectedOptions` are not policed — `min` is purely an
219
+ * interaction guard.
220
+ */
221
+ min: number;
192
222
  /** Form field name. Submitted with the owning `<form>`. */
193
223
  name: string | null;
194
224
  /** When true, the element is non-interactive and excluded from form submission. */
@@ -1,69 +1,85 @@
1
1
  'use strict';
2
2
 
3
3
  var tslib = require('tslib');
4
- var popoverElement = require('../popover/popover-element.cjs');
5
4
  var context = require('@lit/context');
6
5
  var signals = require('@lit-labs/signals');
7
6
  var lit = require('lit');
8
7
  var decorators_js = require('lit/decorators.js');
9
8
  var sliceBefore = require('@telperion/js-utils/array/slice-before');
9
+ var defer = require('@telperion/js-utils/function/defer');
10
10
  var selectContext = require('./select-context.cjs');
11
11
  var selectedContent_element = require('./selected-content.element.cjs');
12
12
  var option_element = require('./option.element.cjs');
13
13
  var internalProps = require('./internal-props.cjs');
14
14
  var selectChangeEvent = require('./select-change-event.cjs');
15
- var defer = require('@telperion/js-utils/function/defer');
16
15
  var signalWatcherLitElement = require('../utils/signal-watcher-lit-element.cjs');
16
+ var shadeMixerLitElement = require('../utils/shade-mixer-lit-element.cjs');
17
+ var popoverElement = require('../popover/popover-element.cjs');
17
18
 
18
19
  var SelectElement_1;
19
- exports.SelectElement = class SelectElement extends signalWatcherLitElement.SignalWatcherLitElement {
20
+ exports.SelectElement = class SelectElement extends signalWatcherLitElement.ShadeMixerSignalWatcherLitElement {
20
21
  static { SelectElement_1 = this; }
21
22
  static { this.formAssociated = true; }
22
23
  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
-
24
+ static { this.styles = (() => {
25
+ const variables = lit.css `
26
+ ${shadeMixerLitElement.ShadeMixerLitElement.shadedElementStyles}
29
27
  --tp-select-option-color: white;
30
- --tp-select-selection-color: #0078d4;
28
+ --tp-select-selection-color: var(--tp-calc-element-color);
31
29
  --tp-select-highlight-percent: 20%;
32
- --tp-select-selection-contrast-color: white;
33
- }
30
+ --tp-select-selection-contrast-color: var(--tp-calc-contrast-color);
31
+ `;
32
+ const shadowStyles = lit.css `
33
+ @layer base {
34
+ :host {
35
+ ${variables}
36
+ position: relative;
37
+ display: inline-flex;
38
+ height: fit-content;
39
+ }
34
40
 
35
- :host([disabled]) {
36
- pointer-events: none;
37
- opacity: 0.6;
38
- }
41
+ :host([disabled]) {
42
+ pointer-events: none;
43
+ opacity: 0.6;
44
+ }
39
45
 
40
- :host([open]) {
41
- [pseudo="indicator"] {
42
- transform: rotateX(180deg);
43
- }
44
- }
46
+ :host([open]) {
47
+ [pseudo="indicator"] {
48
+ transform: rotateX(180deg);
49
+ }
50
+ }
45
51
 
46
- [pseudo="button"] {
47
- background: white;
48
- cursor: pointer;
49
- display: inline-flex;
50
- align-items: center;
51
- padding: 0.25em 0.5em;
52
+ [pseudo="button"] {
53
+ background: white;
54
+ cursor: pointer;
55
+ display: inline-flex;
56
+ align-items: center;
57
+ padding: 0.25em 0.5em;
52
58
 
53
- tp-selected-content {
54
- margin-inline-end: 0.5em;
55
- }
56
- }
59
+ tp-selected-content {
60
+ margin-inline-end: 0.5em;
61
+ }
62
+ }
57
63
 
58
- [pseudo="indicator"] {
59
- margin-inline-start: auto;
60
- }
64
+ [pseudo="indicator"] {
65
+ margin-inline-start: auto;
66
+ }
61
67
 
62
- tp-popover {
63
- border: none;
64
- padding: 0;
65
- }
66
- `; }
68
+ tp-popover {
69
+ border: none;
70
+ padding: 0;
71
+ }
72
+ }`;
73
+ const documentStyles = lit.css `
74
+ @layer base {
75
+ tp-select {
76
+ ${variables}
77
+ }
78
+ }
79
+ `;
80
+ document.adoptedStyleSheets = [...document.adoptedStyleSheets, documentStyles.styleSheet];
81
+ return shadowStyles;
82
+ })(); }
67
83
  #options;
68
84
  get #popover() {
69
85
  return this.shadowRoot?.querySelector("tp-popover");
@@ -74,7 +90,7 @@ exports.SelectElement = class SelectElement extends signalWatcherLitElement.Sign
74
90
  }
75
91
  set value(next) {
76
92
  defer.defer(() => {
77
- const values = next.split(",").map((s) => s.trim());
93
+ const values = next?.split(",").map((s) => s.trim()) ?? [];
78
94
  const options = Array.from(this.#options);
79
95
  this.selectedOptions.set(values
80
96
  .map((value) => options.find((option) => option.value === value))
@@ -128,6 +144,17 @@ exports.SelectElement = class SelectElement extends signalWatcherLitElement.Sign
128
144
  * down to size from the end.
129
145
  */
130
146
  this.max = 1;
147
+ /**
148
+ * Minimum number of options that must remain selected.
149
+ *
150
+ * Defaults to `0` (no lower bound). When the current selection size is at
151
+ * or below `min`, calls to {@link deselectOption} (and the click-driven
152
+ * toggle inside the popover) become no-ops, so the user can't drop below
153
+ * the floor by interacting with the control. Programmatic writes to
154
+ * `value` and `selectedOptions` are not policed — `min` is purely an
155
+ * interaction guard.
156
+ */
157
+ this.min = 0;
131
158
  /** Form field name. Submitted with the owning `<form>`. */
132
159
  this.name = null;
133
160
  /** When true, the element is non-interactive and excluded from form submission. */
@@ -307,10 +334,13 @@ exports.SelectElement = class SelectElement extends signalWatcherLitElement.Sign
307
334
  this.selectedOptions.set(trimmed);
308
335
  }
309
336
  deselectOption(option) {
310
- const optionRef = this.selectedOptions.get().find(ref => ref.deref() === option);
337
+ const current = this.selectedOptions.get();
338
+ const optionRef = current.find(ref => ref.deref() === option);
311
339
  if (!optionRef)
312
340
  return;
313
- this.selectedOptions.set(this.selectedOptions.get().filter(ref => ref !== optionRef));
341
+ if (current.length <= this.min)
342
+ return;
343
+ this.selectedOptions.set(current.filter(ref => ref !== optionRef));
314
344
  }
315
345
  toggleOption(option) {
316
346
  const ref = this.selectedOptions.get().find(ref => ref.deref() === option);
@@ -430,8 +460,8 @@ tslib.__decorate([
430
460
  ], exports.SelectElement.prototype, "self", void 0);
431
461
  tslib.__decorate([
432
462
  decorators_js.property({ type: String, reflect: true, noAccessor: true }),
433
- tslib.__metadata("design:type", String),
434
- tslib.__metadata("design:paramtypes", [String])
463
+ tslib.__metadata("design:type", Object),
464
+ tslib.__metadata("design:paramtypes", [Object])
435
465
  ], exports.SelectElement.prototype, "value", null);
436
466
  tslib.__decorate([
437
467
  decorators_js.property({ type: String, reflect: true, noAccessor: true }),
@@ -460,6 +490,22 @@ tslib.__decorate([
460
490
  }),
461
491
  tslib.__metadata("design:type", Number)
462
492
  ], exports.SelectElement.prototype, "max", void 0);
493
+ tslib.__decorate([
494
+ decorators_js.property({
495
+ type: Number,
496
+ reflect: true,
497
+ converter: {
498
+ fromAttribute: (value) => {
499
+ if (value === null || value === undefined || value === "")
500
+ return 0;
501
+ const parsed = Number(String(value).trim());
502
+ return Number.isFinite(parsed) && parsed >= 0 ? Math.floor(parsed) : 0;
503
+ },
504
+ toAttribute: (value) => String(value),
505
+ },
506
+ }),
507
+ tslib.__metadata("design:type", Number)
508
+ ], exports.SelectElement.prototype, "min", void 0);
463
509
  tslib.__decorate([
464
510
  decorators_js.property({ type: String, reflect: true }),
465
511
  tslib.__metadata("design:type", Object)
@@ -1 +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":";;;;;;;;;;;;;;;;;;AA+HaA,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;AACR,IAAA,IAAI,QAAQ,GAAA;QACV,OAAO,IAAI,CAAC,UAAU,EAAE,aAAa,CAAC,YAAY,CAAE;IACtD;AAYS,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,CAAC,CAAC,IAAI,EAAE,CAAC;YACnD,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC;AAEzC,YAAA,IAAI,CAAC,eAAe,CAAC,GAAG,CACtB;iBACG,GAAG,CAAC,CAAC,KAAK,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC,MAAM,KA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AAO,EAAE,IAAI,EAAE,CAAC;;AACf,CAAA,EAAAjB,qBAAA,CAAA,SAAA,EAAA,MAAA,EAAA,MAAA,CAAA;AAI3Bc,gBAAA,CAAA;IADCG,sBAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;AAC1B,CAAA,EAAAjB,qBAAA,CAAA,SAAA,EAAA,UAAA,EAAA,MAAA,CAAA;AAIjBc,gBAAA,CAAA;IADCG,sBAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;AAC1B,CAAA,EAAAjB,qBAAA,CAAA,SAAA,EAAA,UAAA,EAAA,MAAA,CAAA;AAGjBc,gBAAA,CAAA;IADCG,sBAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;AAC9B,CAAA,EAAAjB,qBAAA,CAAA,SAAA,EAAA,MAAA,EAAA,MAAA,CAAA;AAjJFA,qBAAa,GAAA,eAAA,GAAAc,gBAAA,CAAA;IADzBI,2BAAa,CAAC,WAAW,CAAC;;AACd,CAAA,EAAAlB,qBAAa,CAwdzB;;"}
1
+ {"version":3,"file":"select.element.cjs","sources":["../../../../libs/elements/src/select/select.element.ts"],"sourcesContent":[null],"names":["SelectElement","ShadeMixerSignalWatcherLitElement","OptionElement","css","ShadeMixerLitElement","defer","signal","computed","PopoverElement","SelectedContentElement","html","SelectChangeEvent","REGISTER_OPTION","UNREGISTER_OPTION","sliceBefore","__decorate","provide","selectContext","property","customElement"],"mappings":";;;;;;;;;;;;;;;;;;;AAkJaA,qBAAa,GAAnB,MAAM,aAAc,SAAQC,yDAAiC,CAAA;;aAC3D,IAAA,CAAA,cAAc,GAAG,IAAH,CAAQ;AAEd,IAAA,SAAA,IAAA,CAAA,uBAAuB,GAAG,CAACC,4BAAa,CAAC,CAAC;aAClD,IAAA,CAAA,MAAM,GAAG,CAAC,MAAK;QACpB,MA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AA,MAAA,CAAA;AA5LFA,qBAAa,GAAA,eAAA,GAAAe,gBAAA,CAAA;IADzBI,2BAAa,CAAC,WAAW,CAAC;;AACd,CAAA,EAAAnB,qBAAa,CAqgBzB;;"}
@@ -1,67 +1,83 @@
1
1
  import { __decorate, __metadata } from 'tslib';
2
- import { PopoverElement } from '../popover/popover-element.js';
3
2
  import { provide } from '@lit/context';
4
3
  import { signal, computed } from '@lit-labs/signals';
5
4
  import { css, html } from 'lit';
6
5
  import { property, customElement } from 'lit/decorators.js';
7
6
  import { sliceBefore } from '@telperion/js-utils/array/slice-before';
7
+ import { defer } from '@telperion/js-utils/function/defer';
8
8
  import { selectContext } from './select-context.js';
9
9
  import { SelectedContentElement } from './selected-content.element.js';
10
10
  import { OptionElement } from './option.element.js';
11
11
  import { REGISTER_OPTION, UNREGISTER_OPTION } from './internal-props.js';
12
12
  import { SelectChangeEvent } from './select-change-event.js';
13
- import { defer } from '@telperion/js-utils/function/defer';
14
- import { SignalWatcherLitElement } from '../utils/signal-watcher-lit-element.js';
13
+ import { ShadeMixerSignalWatcherLitElement } from '../utils/signal-watcher-lit-element.js';
14
+ import { ShadeMixerLitElement } from '../utils/shade-mixer-lit-element.js';
15
+ import { PopoverElement } from '../popover/popover-element.js';
15
16
 
16
17
  var SelectElement_1;
17
- let SelectElement = class SelectElement extends SignalWatcherLitElement {
18
+ let SelectElement = class SelectElement extends ShadeMixerSignalWatcherLitElement {
18
19
  static { SelectElement_1 = this; }
19
20
  static { this.formAssociated = true; }
20
21
  static { this.ALLOWED_OPTION_ELEMENTS = [OptionElement]; }
21
- static { this.styles = css `
22
- :host {
23
- position: relative;
24
- display: inline-flex;
25
- height: fit-content;
26
-
22
+ static { this.styles = (() => {
23
+ const variables = css `
24
+ ${ShadeMixerLitElement.shadedElementStyles}
27
25
  --tp-select-option-color: white;
28
- --tp-select-selection-color: #0078d4;
26
+ --tp-select-selection-color: var(--tp-calc-element-color);
29
27
  --tp-select-highlight-percent: 20%;
30
- --tp-select-selection-contrast-color: white;
31
- }
28
+ --tp-select-selection-contrast-color: var(--tp-calc-contrast-color);
29
+ `;
30
+ const shadowStyles = css `
31
+ @layer base {
32
+ :host {
33
+ ${variables}
34
+ position: relative;
35
+ display: inline-flex;
36
+ height: fit-content;
37
+ }
32
38
 
33
- :host([disabled]) {
34
- pointer-events: none;
35
- opacity: 0.6;
36
- }
39
+ :host([disabled]) {
40
+ pointer-events: none;
41
+ opacity: 0.6;
42
+ }
37
43
 
38
- :host([open]) {
39
- [pseudo="indicator"] {
40
- transform: rotateX(180deg);
41
- }
42
- }
44
+ :host([open]) {
45
+ [pseudo="indicator"] {
46
+ transform: rotateX(180deg);
47
+ }
48
+ }
43
49
 
44
- [pseudo="button"] {
45
- background: white;
46
- cursor: pointer;
47
- display: inline-flex;
48
- align-items: center;
49
- padding: 0.25em 0.5em;
50
+ [pseudo="button"] {
51
+ background: white;
52
+ cursor: pointer;
53
+ display: inline-flex;
54
+ align-items: center;
55
+ padding: 0.25em 0.5em;
50
56
 
51
- tp-selected-content {
52
- margin-inline-end: 0.5em;
53
- }
54
- }
57
+ tp-selected-content {
58
+ margin-inline-end: 0.5em;
59
+ }
60
+ }
55
61
 
56
- [pseudo="indicator"] {
57
- margin-inline-start: auto;
58
- }
62
+ [pseudo="indicator"] {
63
+ margin-inline-start: auto;
64
+ }
59
65
 
60
- tp-popover {
61
- border: none;
62
- padding: 0;
63
- }
64
- `; }
66
+ tp-popover {
67
+ border: none;
68
+ padding: 0;
69
+ }
70
+ }`;
71
+ const documentStyles = css `
72
+ @layer base {
73
+ tp-select {
74
+ ${variables}
75
+ }
76
+ }
77
+ `;
78
+ document.adoptedStyleSheets = [...document.adoptedStyleSheets, documentStyles.styleSheet];
79
+ return shadowStyles;
80
+ })(); }
65
81
  #options;
66
82
  get #popover() {
67
83
  return this.shadowRoot?.querySelector("tp-popover");
@@ -72,7 +88,7 @@ let SelectElement = class SelectElement extends SignalWatcherLitElement {
72
88
  }
73
89
  set value(next) {
74
90
  defer(() => {
75
- const values = next.split(",").map((s) => s.trim());
91
+ const values = next?.split(",").map((s) => s.trim()) ?? [];
76
92
  const options = Array.from(this.#options);
77
93
  this.selectedOptions.set(values
78
94
  .map((value) => options.find((option) => option.value === value))
@@ -126,6 +142,17 @@ let SelectElement = class SelectElement extends SignalWatcherLitElement {
126
142
  * down to size from the end.
127
143
  */
128
144
  this.max = 1;
145
+ /**
146
+ * Minimum number of options that must remain selected.
147
+ *
148
+ * Defaults to `0` (no lower bound). When the current selection size is at
149
+ * or below `min`, calls to {@link deselectOption} (and the click-driven
150
+ * toggle inside the popover) become no-ops, so the user can't drop below
151
+ * the floor by interacting with the control. Programmatic writes to
152
+ * `value` and `selectedOptions` are not policed — `min` is purely an
153
+ * interaction guard.
154
+ */
155
+ this.min = 0;
129
156
  /** Form field name. Submitted with the owning `<form>`. */
130
157
  this.name = null;
131
158
  /** When true, the element is non-interactive and excluded from form submission. */
@@ -305,10 +332,13 @@ let SelectElement = class SelectElement extends SignalWatcherLitElement {
305
332
  this.selectedOptions.set(trimmed);
306
333
  }
307
334
  deselectOption(option) {
308
- const optionRef = this.selectedOptions.get().find(ref => ref.deref() === option);
335
+ const current = this.selectedOptions.get();
336
+ const optionRef = current.find(ref => ref.deref() === option);
309
337
  if (!optionRef)
310
338
  return;
311
- this.selectedOptions.set(this.selectedOptions.get().filter(ref => ref !== optionRef));
339
+ if (current.length <= this.min)
340
+ return;
341
+ this.selectedOptions.set(current.filter(ref => ref !== optionRef));
312
342
  }
313
343
  toggleOption(option) {
314
344
  const ref = this.selectedOptions.get().find(ref => ref.deref() === option);
@@ -428,8 +458,8 @@ __decorate([
428
458
  ], SelectElement.prototype, "self", void 0);
429
459
  __decorate([
430
460
  property({ type: String, reflect: true, noAccessor: true }),
431
- __metadata("design:type", String),
432
- __metadata("design:paramtypes", [String])
461
+ __metadata("design:type", Object),
462
+ __metadata("design:paramtypes", [Object])
433
463
  ], SelectElement.prototype, "value", null);
434
464
  __decorate([
435
465
  property({ type: String, reflect: true, noAccessor: true }),
@@ -458,6 +488,22 @@ __decorate([
458
488
  }),
459
489
  __metadata("design:type", Number)
460
490
  ], SelectElement.prototype, "max", void 0);
491
+ __decorate([
492
+ property({
493
+ type: Number,
494
+ reflect: true,
495
+ converter: {
496
+ fromAttribute: (value) => {
497
+ if (value === null || value === undefined || value === "")
498
+ return 0;
499
+ const parsed = Number(String(value).trim());
500
+ return Number.isFinite(parsed) && parsed >= 0 ? Math.floor(parsed) : 0;
501
+ },
502
+ toAttribute: (value) => String(value),
503
+ },
504
+ }),
505
+ __metadata("design:type", Number)
506
+ ], SelectElement.prototype, "min", void 0);
461
507
  __decorate([
462
508
  property({ type: String, reflect: true }),
463
509
  __metadata("design:type", Object)