frontile 0.18.5 → 0.18.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.
Files changed (46) hide show
  1. package/declarations/-private/reveal-within.d.ts +19 -0
  2. package/declarations/-private/reveal-within.d.ts.map +1 -0
  3. package/declarations/components/collections/calendar/year-grid.d.ts.map +1 -1
  4. package/declarations/components/forms/date-input/segment-group.d.ts +2 -1
  5. package/declarations/components/forms/date-input/segment-group.d.ts.map +1 -1
  6. package/declarations/components/forms/date-input/segments.d.ts +3 -1
  7. package/declarations/components/forms/date-input/segments.d.ts.map +1 -1
  8. package/declarations/components/forms/date-picker/date-picker.d.ts +119 -1
  9. package/declarations/components/forms/date-picker/date-picker.d.ts.map +1 -1
  10. package/declarations/components/forms/date-picker/time-columns.d.ts +87 -0
  11. package/declarations/components/forms/date-picker/time-columns.d.ts.map +1 -0
  12. package/declarations/components/forms/date-picker/types.d.ts +28 -0
  13. package/declarations/components/forms/date-picker/types.d.ts.map +1 -1
  14. package/declarations/components/forms/select/native-mirror.d.ts +3 -2
  15. package/declarations/components/forms/select/native-mirror.d.ts.map +1 -1
  16. package/declarations/components/forms/select/select.d.ts +14 -2
  17. package/declarations/components/forms/select/select.d.ts.map +1 -1
  18. package/declarations/components/forms/select/types.d.ts +3 -2
  19. package/declarations/components/forms/select/types.d.ts.map +1 -1
  20. package/declarations/components/overlays/overlay.d.ts +17 -2
  21. package/declarations/components/overlays/overlay.d.ts.map +1 -1
  22. package/declarations/test-support.d.ts.map +1 -1
  23. package/dist/components/collections/calendar/year-grid.js +1 -30
  24. package/dist/components/collections/calendar/year-grid.js.map +1 -1
  25. package/dist/components/forms/date-input/segment-group.js +1 -1
  26. package/dist/components/forms/date-input/segment-group.js.map +1 -1
  27. package/dist/components/forms/date-input/segments.js +1 -1
  28. package/dist/components/forms/date-input/segments.js.map +1 -1
  29. package/dist/components/forms/date-input.js +1 -1
  30. package/dist/components/forms/date-picker/date-picker.js +57 -6
  31. package/dist/components/forms/date-picker/date-picker.js.map +1 -1
  32. package/dist/components/forms/date-picker/time-columns.js +238 -0
  33. package/dist/components/forms/date-picker/time-columns.js.map +1 -0
  34. package/dist/components/forms/index.js +1 -1
  35. package/dist/components/forms/select/native-mirror.js.map +1 -1
  36. package/dist/components/forms/select/select.js +22 -4
  37. package/dist/components/forms/select/select.js.map +1 -1
  38. package/dist/components/overlays/overlay.js +55 -7
  39. package/dist/components/overlays/overlay.js.map +1 -1
  40. package/dist/forms.js +1 -1
  41. package/dist/index.js +1 -1
  42. package/dist/reveal-within-BcqpOmSI.js +33 -0
  43. package/dist/reveal-within-BcqpOmSI.js.map +1 -0
  44. package/dist/test-support.js +3 -1
  45. package/dist/test-support.js.map +1 -1
  46. package/package.json +3 -3
@@ -0,0 +1,238 @@
1
+ import Component from '@glimmer/component';
2
+ import { cached } from '@glimmer/tracking';
3
+ import { fn } from '@ember/helper';
4
+ import { on } from '@ember/modifier';
5
+ import { htmlSafe } from '@ember/template';
6
+ import { modifier } from 'ember-modifier';
7
+ import { isSegment, seedFrom } from '../date-input/segments.js';
8
+ import { r as revealWithin } from '../../../reveal-within-BcqpOmSI.js';
9
+ import { precompileTemplate } from '@ember/template-compilation';
10
+ import { setComponentTemplate } from '@ember/component';
11
+ import { a as decorateMethodV2 } from '../../../runtime--fcdnjmJ-BOdRhmsS.js';
12
+
13
+ const TIME_TYPES = ['hour', 'minute', 'dayPeriod'];
14
+ /** How far PageUp and PageDown move, in options. */
15
+ const PAGE_STEP = 5;
16
+ /** How long typed characters keep adding up to one search, in ms. */
17
+ const TYPEAHEAD_TIMEOUT = 1000;
18
+ const pad = value => String(value).padStart(2, '0');
19
+ function range(min, max, step = 1) {
20
+ const out = [];
21
+ for (let value = min; value <= max; value += step) out.push(value);
22
+ return out;
23
+ }
24
+ /**
25
+ * The values a column offers, in the order they are listed.
26
+ *
27
+ * A 12-hour clock lists 12 first, the way it reads from midnight. Minutes
28
+ * follow `minuteStep`, plus the current minute when it is off the step: a
29
+ * 10:07 typed into the segments must still show as picked, not as nothing.
30
+ */
31
+ function valuesFor(segment, minuteStep) {
32
+ if (segment.type === 'hour' && segment.hourCycle === 'h12') {
33
+ return [12, ...range(1, 11)];
34
+ }
35
+ if (segment.type === 'minute') {
36
+ const values = range(segment.min, segment.max, minuteStep);
37
+ const current = segment.value;
38
+ if (current !== null && !values.includes(current)) {
39
+ values.push(current);
40
+ values.sort((a, b) => a - b);
41
+ }
42
+ return values;
43
+ }
44
+ return range(segment.min, segment.max);
45
+ }
46
+ /**
47
+ * The option an empty column starts from: the placeholder's, or for minutes
48
+ * the step at or before it, so a keyboard user tabbing in lands near now
49
+ * rather than at the top of the list.
50
+ */
51
+ function startingValue(segment, values, placeholderValue) {
52
+ const seed = seedFrom(segment, placeholderValue);
53
+ if (values.includes(seed)) return seed;
54
+ return values.filter(value => value <= seed).pop() ?? values[0];
55
+ }
56
+ /** One column's options, in order. */
57
+ function optionsOf(list) {
58
+ return [...list.querySelectorAll('[data-part="time-option"]')];
59
+ }
60
+ /**
61
+ * The time part of a date picker's popover: a scrolling list per time
62
+ * segment -- hours, minutes, and AM/PM on a 12-hour clock -- in the order the
63
+ * locale writes them.
64
+ *
65
+ * Each list is a single-select `listbox` with roving focus, the same pattern
66
+ * as the calendar's year panel: one tab stop per column, the arrow keys move
67
+ * and pick together (selection follows focus, as in a native `<select>`),
68
+ * and typing jumps to a value. The columns edit the very segments the field
69
+ * renders, so there is still one value: picking here shows there at once,
70
+ * and what was typed there is what is picked here.
71
+ */
72
+ class DatePickerTimeColumns extends Component {
73
+ #typed = '';
74
+ #typedAt = 0;
75
+ /**
76
+ * The key that is about to click an option, if any. Enter and Space are
77
+ * left to the button, which clicks on Enter's keydown and Space's keyup in
78
+ * every browser; preventing them on keydown instead does not stop Space's
79
+ * click everywhere. The click then knows how it came about.
80
+ */
81
+ #activationKey = null;
82
+ get columns() {
83
+ const segments = this.args.parts.filter(part => isSegment(part) && TIME_TYPES.includes(part.type));
84
+ return segments.map((segment, index) => {
85
+ const values = valuesFor(segment, this.args.minuteStep);
86
+ const selected = segment.value !== null && values.includes(segment.value) ? segment.value : null;
87
+ const tabbable = selected ?? startingValue(segment, values, this.args.placeholderValue);
88
+ return {
89
+ type: segment.type,
90
+ label: this.args.columnLabel(segment.type),
91
+ labelId: `${this.args.idPrefix}-${segment.type}`,
92
+ selected,
93
+ isLast: index === segments.length - 1,
94
+ options: values.map(value => ({
95
+ value,
96
+ label: segment.labels?.[value] ?? pad(value),
97
+ isSelected: value === selected,
98
+ isTabbable: value === tabbable
99
+ }))
100
+ };
101
+ });
102
+ }
103
+ /** Reserves the columns' width; see the `time` slot. */
104
+ static {
105
+ decorateMethodV2(this.prototype, "columns", [cached]);
106
+ }
107
+ get style() {
108
+ return htmlSafe(`--time-columns: ${this.columns.length}`);
109
+ }
110
+ /**
111
+ * Keeps the picked option in view: centred when the popover opens, and
112
+ * just far enough when it moves after that. Runs again whenever the
113
+ * column's pick changes, whoever changed it.
114
+ */
115
+ reveal = modifier((list, [selected]) => {
116
+ const target = optionsOf(list).find(option => option.tabIndex === 0) ?? optionsOf(list)[0];
117
+ if (!target) return;
118
+ const isFirstRun = !list.dataset['revealed'];
119
+ list.dataset['revealed'] = 'true';
120
+ revealWithin(list, target, isFirstRun);
121
+ });
122
+ select = (column, value, commit) => {
123
+ if (this.args.isReadOnly) return;
124
+ this.args.onSelect(column.type, value, commit);
125
+ };
126
+ /**
127
+ * Picks the option. Enter also finishes the time, from any column; Space
128
+ * only picks; a pointer finishes it in the last column, so hour then minute
129
+ * is two clicks and done.
130
+ */
131
+ handleClick = (column, value) => {
132
+ const key = this.#activationKey;
133
+ this.#activationKey = null;
134
+ const commit = key === 'Enter' ? true : key === ' ' ? false : column.isLast;
135
+ this.select(column, value, commit);
136
+ };
137
+ /**
138
+ * Moves focus, and with it the tab stop. Set imperatively, as the year
139
+ * panel does, so focus and `tabindex` move in the same turn -- and so a
140
+ * read-only column, where moving picks nothing, still moves.
141
+ */
142
+ #moveTo(options, next) {
143
+ for (const option of options) option.tabIndex = -1;
144
+ next.tabIndex = 0;
145
+ next.focus({
146
+ preventScroll: true
147
+ });
148
+ const list = next.closest('[data-part="time-list"]');
149
+ if (list) revealWithin(list, next, false);
150
+ }
151
+ /** The option typing points at: an exact value first, then a prefix. */
152
+ #match(column, typed) {
153
+ const text = typed.toLocaleLowerCase();
154
+ const number = /^\d+$/.test(text) ? Number(text) : NaN;
155
+ return column.options.find(option => option.value === number) ?? column.options.find(option => option.label.toLocaleLowerCase().startsWith(text) || String(option.value).startsWith(text));
156
+ }
157
+ #typeahead(column, key) {
158
+ const now = Date.now();
159
+ this.#typed = now - this.#typedAt > TYPEAHEAD_TIMEOUT ? key : this.#typed + key;
160
+ this.#typedAt = now;
161
+ const match = this.#match(column, this.#typed);
162
+ if (match || this.#typed.length === 1) return match;
163
+ // `1` then `7` finds no 17 in a list stepping by five: start over from
164
+ // the `7` rather than ignoring every key from here on.
165
+ this.#typed = key;
166
+ return this.#match(column, key);
167
+ }
168
+ handleKeydown = (column, event) => {
169
+ const list = event.currentTarget;
170
+ const options = optionsOf(list);
171
+ const index = options.indexOf(event.target);
172
+ if (index < 0) return;
173
+ if (event.key === 'ArrowLeft' || event.key === 'ArrowRight') {
174
+ this.#focusColumn(list, event.key === 'ArrowLeft' ? -1 : 1, event);
175
+ return;
176
+ }
177
+ if (event.key === 'Enter' || event.key === ' ') {
178
+ this.#activationKey = event.key;
179
+ return;
180
+ }
181
+ let next;
182
+ const last = options.length - 1;
183
+ switch (event.key) {
184
+ case 'ArrowDown':
185
+ next = Math.min(index + 1, last);
186
+ break;
187
+ case 'ArrowUp':
188
+ next = Math.max(index - 1, 0);
189
+ break;
190
+ case 'PageDown':
191
+ next = Math.min(index + PAGE_STEP, last);
192
+ break;
193
+ case 'PageUp':
194
+ next = Math.max(index - PAGE_STEP, 0);
195
+ break;
196
+ case 'Home':
197
+ next = 0;
198
+ break;
199
+ case 'End':
200
+ next = last;
201
+ break;
202
+ default:
203
+ if (event.key.length === 1 && !event.metaKey && !event.ctrlKey && !event.altKey) {
204
+ const match = this.#typeahead(column, event.key);
205
+ if (match) next = column.options.indexOf(match);
206
+ }
207
+ }
208
+ if (next === undefined) return;
209
+ event.preventDefault();
210
+ this.#moveTo(options, options[next]);
211
+ this.select(column, column.options[next].value, false);
212
+ };
213
+ /** ArrowLeft and ArrowRight go to the neighbouring column's tab stop. */
214
+ #focusColumn(list, delta, event) {
215
+ const group = list.closest('[data-part="time-columns"]');
216
+ if (!group) return;
217
+ const lists = [...group.querySelectorAll('[data-part="time-list"]')];
218
+ const neighbour = lists[lists.indexOf(list) + delta];
219
+ if (!neighbour) return;
220
+ event.preventDefault();
221
+ const target = optionsOf(neighbour).find(option => option.tabIndex === 0) ?? optionsOf(neighbour)[0];
222
+ target?.focus({
223
+ preventScroll: true
224
+ });
225
+ }
226
+ static {
227
+ setComponentTemplate(precompileTemplate("<div data-part=\"time\" class={{@classes.time class=@userClasses.time}} style={{this.style}}>\n <div role=\"group\" aria-label={{@label}} data-part=\"time-columns\" class={{@classes.timeColumns class=@userClasses.timeColumns}}>\n {{#each this.columns key=\"type\" as |column|}}\n <div data-part=\"time-column\" data-type={{column.type}} class={{@classes.timeColumn class=@userClasses.timeColumn}}>\n <div id={{column.labelId}} data-part=\"time-column-label\" class={{@classes.timeColumnLabel class=@userClasses.timeColumnLabel}}>{{column.label}}</div>\n {{!-- template-lint-disable no-invalid-interactive --}}\n {{!-- The keydown listener is the listbox's roving keyboard\n behavior; the options themselves are the focusable elements. --}}\n <div role=\"listbox\" aria-labelledby={{column.labelId}} aria-readonly={{if @isReadOnly \"true\"}} data-part=\"time-list\" data-type={{column.type}} class={{@classes.timeList class=@userClasses.timeList}} {{this.reveal column.selected}} {{on \"keydown\" (fn this.handleKeydown column)}}>\n {{#each column.options key=\"value\" as |option|}}\n <button type=\"button\" role=\"option\" data-part=\"time-option\" data-value={{option.value}} data-selected={{if option.isSelected \"true\" \"false\"}} aria-selected={{if option.isSelected \"true\" \"false\"}} tabindex={{if option.isTabbable \"0\" \"-1\"}} class={{@classes.timeOption class=@userClasses.timeOption}} {{on \"click\" (fn this.handleClick column option.value)}}>{{option.label}}</button>\n {{/each}}\n </div>\n </div>\n {{/each}}\n </div>\n</div>", {
228
+ strictMode: true,
229
+ scope: () => ({
230
+ on,
231
+ fn
232
+ })
233
+ }), this);
234
+ }
235
+ }
236
+
237
+ export { DatePickerTimeColumns, DatePickerTimeColumns as default };
238
+ //# sourceMappingURL=time-columns.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"time-columns.js","sources":["../../../../src/components/forms/date-picker/time-columns.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { cached } from '@glimmer/tracking';\nimport { fn } from '@ember/helper';\nimport { on } from '@ember/modifier';\nimport { htmlSafe } from '@ember/template';\nimport { modifier } from 'ember-modifier';\nimport { isSegment, seedFrom } from '../date-input/segments';\nimport { revealWithin } from '../../../-private/reveal-within';\nimport type { Part, Segment, SegmentType } from '../date-input/types';\nimport type { DatePickerClasses } from './types';\nimport type { SlotsToClasses, DatePickerSlots } from '@frontile/theme';\n\nconst TIME_TYPES: SegmentType[] = ['hour', 'minute', 'dayPeriod'];\n\n/** How far PageUp and PageDown move, in options. */\nconst PAGE_STEP = 5;\n\n/** How long typed characters keep adding up to one search, in ms. */\nconst TYPEAHEAD_TIMEOUT = 1000;\n\ninterface TimeOption {\n value: number;\n label: string;\n isSelected: boolean;\n /** The column's one tab stop. */\n isTabbable: boolean;\n}\n\ninterface TimeColumn {\n type: SegmentType;\n label: string;\n labelId: string;\n /** The value the column shows as picked, or `null`. Re-reveals on change. */\n selected: number | null;\n options: TimeOption[];\n /** Picking here finishes the time, so a click on it closes the popover. */\n isLast: boolean;\n}\n\ninterface DatePickerTimeColumnsSignature {\n Args: {\n /** The field's segments; the columns render its time ones. */\n parts: Part[];\n /** The minutes offered, as a step from :00. */\n minuteStep: number;\n /** What an empty column offers to start from. */\n placeholderValue: Date;\n /** The group's accessible name. */\n label: string;\n /** Each column's visible name, which is also its accessible one. */\n columnLabel: (type: SegmentType) => string;\n /** Prefix for the column names' ids. */\n idPrefix: string;\n isReadOnly?: boolean;\n /**\n * An option was picked. `commit` is true when the pick finishes the\n * time -- Enter, or a click in the last column -- and the popover should\n * close.\n */\n onSelect: (type: SegmentType, value: number, commit: boolean) => void;\n classes: DatePickerClasses;\n userClasses?: SlotsToClasses<DatePickerSlots>;\n };\n}\n\nconst pad = (value: number): string => String(value).padStart(2, '0');\n\nfunction range(min: number, max: number, step = 1): number[] {\n const out: number[] = [];\n for (let value = min; value <= max; value += step) out.push(value);\n return out;\n}\n\n/**\n * The values a column offers, in the order they are listed.\n *\n * A 12-hour clock lists 12 first, the way it reads from midnight. Minutes\n * follow `minuteStep`, plus the current minute when it is off the step: a\n * 10:07 typed into the segments must still show as picked, not as nothing.\n */\nfunction valuesFor(segment: Segment, minuteStep: number): number[] {\n if (segment.type === 'hour' && segment.hourCycle === 'h12') {\n return [12, ...range(1, 11)];\n }\n\n if (segment.type === 'minute') {\n const values = range(segment.min, segment.max, minuteStep);\n const current = segment.value;\n if (current !== null && !values.includes(current)) {\n values.push(current);\n values.sort((a, b) => a - b);\n }\n return values;\n }\n\n return range(segment.min, segment.max);\n}\n\n/**\n * The option an empty column starts from: the placeholder's, or for minutes\n * the step at or before it, so a keyboard user tabbing in lands near now\n * rather than at the top of the list.\n */\nfunction startingValue(\n segment: Segment,\n values: number[],\n placeholderValue: Date\n): number | undefined {\n const seed = seedFrom(segment, placeholderValue);\n if (values.includes(seed)) return seed;\n return values.filter((value) => value <= seed).pop() ?? values[0];\n}\n\n/** One column's options, in order. */\nfunction optionsOf(list: HTMLElement): HTMLElement[] {\n return [...list.querySelectorAll<HTMLElement>('[data-part=\"time-option\"]')];\n}\n\n/**\n * The time part of a date picker's popover: a scrolling list per time\n * segment -- hours, minutes, and AM/PM on a 12-hour clock -- in the order the\n * locale writes them.\n *\n * Each list is a single-select `listbox` with roving focus, the same pattern\n * as the calendar's year panel: one tab stop per column, the arrow keys move\n * and pick together (selection follows focus, as in a native `<select>`),\n * and typing jumps to a value. The columns edit the very segments the field\n * renders, so there is still one value: picking here shows there at once,\n * and what was typed there is what is picked here.\n */\nclass DatePickerTimeColumns extends Component<DatePickerTimeColumnsSignature> {\n #typed = '';\n #typedAt = 0;\n\n /**\n * The key that is about to click an option, if any. Enter and Space are\n * left to the button, which clicks on Enter's keydown and Space's keyup in\n * every browser; preventing them on keydown instead does not stop Space's\n * click everywhere. The click then knows how it came about.\n */\n #activationKey: string | null = null;\n\n @cached\n get columns(): TimeColumn[] {\n const segments = this.args.parts.filter(\n (part): part is Segment =>\n isSegment(part) && TIME_TYPES.includes(part.type)\n );\n\n return segments.map((segment, index) => {\n const values = valuesFor(segment, this.args.minuteStep);\n const selected =\n segment.value !== null && values.includes(segment.value)\n ? segment.value\n : null;\n const tabbable =\n selected ?? startingValue(segment, values, this.args.placeholderValue);\n\n return {\n type: segment.type,\n label: this.args.columnLabel(segment.type),\n labelId: `${this.args.idPrefix}-${segment.type}`,\n selected,\n isLast: index === segments.length - 1,\n options: values.map((value) => ({\n value,\n label: segment.labels?.[value] ?? pad(value),\n isSelected: value === selected,\n isTabbable: value === tabbable\n }))\n };\n });\n }\n\n /** Reserves the columns' width; see the `time` slot. */\n get style() {\n return htmlSafe(`--time-columns: ${this.columns.length}`);\n }\n\n /**\n * Keeps the picked option in view: centred when the popover opens, and\n * just far enough when it moves after that. Runs again whenever the\n * column's pick changes, whoever changed it.\n */\n reveal = modifier((list: HTMLElement, [selected]: [number | null]) => {\n const target =\n optionsOf(list).find((option) => option.tabIndex === 0) ??\n optionsOf(list)[0];\n if (!target) return;\n\n const isFirstRun = !list.dataset['revealed'];\n list.dataset['revealed'] = 'true';\n revealWithin(list, target, isFirstRun);\n // `selected` is read only to re-run on a change.\n void selected;\n });\n\n select = (column: TimeColumn, value: number, commit: boolean): void => {\n if (this.args.isReadOnly) return;\n this.args.onSelect(column.type, value, commit);\n };\n\n /**\n * Picks the option. Enter also finishes the time, from any column; Space\n * only picks; a pointer finishes it in the last column, so hour then minute\n * is two clicks and done.\n */\n handleClick = (column: TimeColumn, value: number): void => {\n const key = this.#activationKey;\n this.#activationKey = null;\n\n const commit = key === 'Enter' ? true : key === ' ' ? false : column.isLast;\n this.select(column, value, commit);\n };\n\n /**\n * Moves focus, and with it the tab stop. Set imperatively, as the year\n * panel does, so focus and `tabindex` move in the same turn -- and so a\n * read-only column, where moving picks nothing, still moves.\n */\n #moveTo(options: HTMLElement[], next: HTMLElement): void {\n for (const option of options) option.tabIndex = -1;\n next.tabIndex = 0;\n next.focus({ preventScroll: true });\n\n const list = next.closest<HTMLElement>('[data-part=\"time-list\"]');\n if (list) revealWithin(list, next, false);\n }\n\n /** The option typing points at: an exact value first, then a prefix. */\n #match(column: TimeColumn, typed: string): TimeOption | undefined {\n const text = typed.toLocaleLowerCase();\n const number = /^\\d+$/.test(text) ? Number(text) : NaN;\n\n return (\n column.options.find((option) => option.value === number) ??\n column.options.find(\n (option) =>\n option.label.toLocaleLowerCase().startsWith(text) ||\n String(option.value).startsWith(text)\n )\n );\n }\n\n #typeahead(column: TimeColumn, key: string): TimeOption | undefined {\n const now = Date.now();\n this.#typed =\n now - this.#typedAt > TYPEAHEAD_TIMEOUT ? key : this.#typed + key;\n this.#typedAt = now;\n\n const match = this.#match(column, this.#typed);\n if (match || this.#typed.length === 1) return match;\n\n // `1` then `7` finds no 17 in a list stepping by five: start over from\n // the `7` rather than ignoring every key from here on.\n this.#typed = key;\n return this.#match(column, key);\n }\n\n handleKeydown = (column: TimeColumn, event: KeyboardEvent): void => {\n const list = event.currentTarget as HTMLElement;\n const options = optionsOf(list);\n const index = options.indexOf(event.target as HTMLElement);\n if (index < 0) return;\n\n if (event.key === 'ArrowLeft' || event.key === 'ArrowRight') {\n this.#focusColumn(list, event.key === 'ArrowLeft' ? -1 : 1, event);\n return;\n }\n\n if (event.key === 'Enter' || event.key === ' ') {\n this.#activationKey = event.key;\n return;\n }\n\n let next: number | undefined;\n const last = options.length - 1;\n\n switch (event.key) {\n case 'ArrowDown':\n next = Math.min(index + 1, last);\n break;\n case 'ArrowUp':\n next = Math.max(index - 1, 0);\n break;\n case 'PageDown':\n next = Math.min(index + PAGE_STEP, last);\n break;\n case 'PageUp':\n next = Math.max(index - PAGE_STEP, 0);\n break;\n case 'Home':\n next = 0;\n break;\n case 'End':\n next = last;\n break;\n default:\n if (\n event.key.length === 1 &&\n !event.metaKey &&\n !event.ctrlKey &&\n !event.altKey\n ) {\n const match = this.#typeahead(column, event.key);\n if (match) next = column.options.indexOf(match);\n }\n }\n\n if (next === undefined) return;\n event.preventDefault();\n\n this.#moveTo(options, options[next]!);\n this.select(column, column.options[next]!.value, false);\n };\n\n /** ArrowLeft and ArrowRight go to the neighbouring column's tab stop. */\n #focusColumn(list: HTMLElement, delta: number, event: KeyboardEvent): void {\n const group = list.closest('[data-part=\"time-columns\"]');\n if (!group) return;\n\n const lists = [\n ...group.querySelectorAll<HTMLElement>('[data-part=\"time-list\"]')\n ];\n const neighbour = lists[lists.indexOf(list) + delta];\n if (!neighbour) return;\n\n event.preventDefault();\n const target =\n optionsOf(neighbour).find((option) => option.tabIndex === 0) ??\n optionsOf(neighbour)[0];\n target?.focus({ preventScroll: true });\n }\n\n <template>\n <div\n data-part=\"time\"\n class={{@classes.time class=@userClasses.time}}\n style={{this.style}}\n >\n <div\n role=\"group\"\n aria-label={{@label}}\n data-part=\"time-columns\"\n class={{@classes.timeColumns class=@userClasses.timeColumns}}\n >\n {{#each this.columns key=\"type\" as |column|}}\n <div\n data-part=\"time-column\"\n data-type={{column.type}}\n class={{@classes.timeColumn class=@userClasses.timeColumn}}\n >\n <div\n id={{column.labelId}}\n data-part=\"time-column-label\"\n class={{@classes.timeColumnLabel\n class=@userClasses.timeColumnLabel\n }}\n >{{column.label}}</div>\n {{! template-lint-disable no-invalid-interactive }}\n {{! The keydown listener is the listbox's roving keyboard\n behavior; the options themselves are the focusable elements. }}\n <div\n role=\"listbox\"\n aria-labelledby={{column.labelId}}\n aria-readonly={{if @isReadOnly \"true\"}}\n data-part=\"time-list\"\n data-type={{column.type}}\n class={{@classes.timeList class=@userClasses.timeList}}\n {{this.reveal column.selected}}\n {{on \"keydown\" (fn this.handleKeydown column)}}\n >\n {{#each column.options key=\"value\" as |option|}}\n <button\n type=\"button\"\n role=\"option\"\n data-part=\"time-option\"\n data-value={{option.value}}\n data-selected={{if option.isSelected \"true\" \"false\"}}\n aria-selected={{if option.isSelected \"true\" \"false\"}}\n tabindex={{if option.isTabbable \"0\" \"-1\"}}\n class={{@classes.timeOption class=@userClasses.timeOption}}\n {{on \"click\" (fn this.handleClick column option.value)}}\n >{{option.label}}</button>\n {{/each}}\n </div>\n </div>\n {{/each}}\n </div>\n </div>\n </template>\n}\n\nexport { DatePickerTimeColumns, type DatePickerTimeColumnsSignature };\nexport default DatePickerTimeColumns;\n"],"names":["TIME_TYPES","PAGE_STEP","TYPEAHEAD_TIMEOUT","pad","value","String","padStart","range","min","max","step","out","push","valuesFor","segment","minuteStep","type","hourCycle","values","current","includes","sort","a","b","startingValue","placeholderValue","seed","seedFrom","filter","pop","optionsOf","list","querySelectorAll","DatePickerTimeColumns","Component","columns","segments","args","parts","part","isSegment","map","index","selected","tabbable","label","columnLabel","labelId","idPrefix","isLast","length","options","labels","isSelected","isTabbable","n","prototype","cached","style","htmlSafe","reveal","modifier","target","find","option","tabIndex","isFirstRun","dataset","revealWithin","select","column","commit","isReadOnly","onSelect","handleClick","key","#moveTo","next","focus","preventScroll","closest","#match","typed","text","toLocaleLowerCase","number","test","Number","NaN","startsWith","#typeahead","now","Date","match","handleKeydown","event","currentTarget","indexOf","last","Math","metaKey","ctrlKey","altKey","undefined","preventDefault","#focusColumn","delta","group","lists","neighbour","setComponentTemplate","precompileTemplate","strictMode","scope","on","fn"],"mappings":";;;;;;;;;;;;AAYA,MAAMA,UAAY,GAAgB,CAAC,MAAA,EAAQ,QAAA,E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AAA,IAAWA,MAAA,CAAOC,QAAQ,KAAK,CAAA,CAAA,IAC1DnC,SAAA,CAAU+E,SAAA,CAAU,CAAC,CAAA,CAAE;IACzB/C,MAAA,EAAQgB,KAAA,CAAM;AAAEC,MAAAA,aAAA,EAAe;AAAK,KAAA,CAAA;AACtC,EAAA;AAEA,EAAA;IAAA+B,oBAAA,CAAAC,kBAAA,CAAA,omDAAA,EAwDA;MAAAC,UAAA,EAAA,IAAA;AAAAC,MAAAA,KAAA,EAAAA,OAAA;QAAAC,EAAA;AAAAC,QAAAA;AAAA,OAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;"}
@@ -17,7 +17,7 @@ export { FormControl } from './form-control.js';
17
17
  export { Switch } from './switch.js';
18
18
  export { DatePicker } from './date-picker/date-picker.js';
19
19
  export { DEFAULT_TIME_FORMAT, formatValue, isEmptyValue, parseDate, parseRange, toWire, withTimeOf } from './date-picker/value.js';
20
- export { BOUNDS, DEFAULT_FORMAT, applyDigit, applyLetter, buildParts, carryOver, clearSegment, commitSegment, daysInMonth, deleteDigit, displaySegment, emptySegment, findSegment, fromDate, hasDateChanged, hasTextualMonth, hourOfDay, hourOnCycle, isSegment, resolveSegmentFormat, resolveTwoDigitYear, step, timeOf, toDate, toNumericFormat, withTime, withValue } from './date-input/segments.js';
20
+ export { BOUNDS, DEFAULT_FORMAT, applyDigit, applyLetter, buildParts, carryOver, clearSegment, commitSegment, daysInMonth, deleteDigit, displaySegment, emptySegment, findSegment, fromDate, hasDateChanged, hasTextualMonth, hourOfDay, hourOnCycle, isSegment, resolveSegmentFormat, resolveTwoDigitYear, seedFrom, step, timeOf, toDate, toNumericFormat, withTime, withValue } from './date-input/segments.js';
21
21
  export { formatForClipboard, parsePasted, splitRange } from './date-input/clipboard.js';
22
22
  export { DateInput } from './date-input/date-input.js';
23
23
  export { StandardValidator } from '../../utils/standard-validator.js';
@@ -1 +1 @@
1
- {"version":3,"file":"native-mirror.js","sources":["../../../../src/components/forms/select/native-mirror.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport {\n NativeSelect,\n type ListItem,\n type NativeSelectSignature\n} from '../native-select';\n\nconst eq = (a: unknown, b: unknown) => a === b;\n\ninterface SelectNativeMirrorSignature<T> {\n Args: {\n /**\n * The **unfiltered** collection. The mirror carries the form value, which\n * must not shrink to whatever the listbox filter currently shows, so it is\n * deliberately never handed `filteredItems`.\n */\n items?: T[];\n allowEmpty?: boolean;\n disabledKeys?: string[];\n selectionMode?: 'single' | 'multiple';\n\n /** Read in multiple selection mode. */\n selectedKeys: string[];\n /** Read in single selection mode. */\n selectedKey: string | null;\n\n /** Selection handler for multiple selection mode. */\n onSelectionChange: (keys: string[]) => void;\n /** Selection handler for single selection mode. */\n onSingleSelectionChange: (key: string | null) => void;\n\n onItemsChange: (nodes: ListItem[], action: 'add' | 'remove') => void;\n placeholder?: string;\n id?: string;\n name?: string;\n isDisabled?: boolean;\n };\n Blocks: {\n default: NativeSelectSignature<T>['Blocks']['default'];\n };\n}\n\n/**\n * The visually hidden native `<select>` that makes a Select submit with a form.\n *\n * Single and multiple selection mode differ only in three arguments, so those\n * three are curried onto the component and everything else -- the element, its\n * attributes and both blocks -- is written **once**. Two copies of this used to\n * sit side by side in `select.gts`, and a fix to the submitted value landed in\n * one of them and not the other.\n */\nclass SelectNativeMirror<T = unknown> extends Component<\n SelectNativeMirrorSignature<T>\n> {\n <template>\n {{#let\n (if\n (eq @selectionMode \"multiple\")\n (component\n NativeSelect\n selectionMode=\"multiple\"\n selectedKeys=@selectedKeys\n onSelectionChange=@onSelectionChange\n )\n (component\n NativeSelect\n selectionMode=\"single\"\n selectedKey=@selectedKey\n onSelectionChange=@onSingleSelectionChange\n )\n )\n as |Mirror|\n }}\n <Mirror\n @items={{@items}}\n @allowEmpty={{@allowEmpty}}\n @disabledKeys={{@disabledKeys}}\n @onItemsChange={{@onItemsChange}}\n @placeholder={{@placeholder}}\n @id={{@id}}\n @name={{@name}}\n tabindex=\"-1\"\n disabled={{@isDisabled}}\n >\n <:item as |l|>\n <l.Item @key={{l.key}}>\n {{l.label}}\n </l.Item>\n </:item>\n <:default as |l|>\n {{yield l}}\n </:default>\n </Mirror>\n {{/let}}\n </template>\n}\n\nexport { SelectNativeMirror, type SelectNativeMirrorSignature };\nexport default SelectNativeMirror;\n"],"names":["eq","a","b","SelectNativeMirror","Component","setComponentTemplate","precompileTemplate","strictMode","scope","NativeSelect"],"mappings":";;;;;AAOA,MAAMA,EAAA,GAAKA,CAACC,CAAU,EAAEC,CAAU,KAAKD,CAAA,KAAMC,CAAA;AAmC7C;;;;;;;;AAQC;AACD,MAAMC,kBAAA,SAAwCC,UAChB;AAE5B,EAAA;IAAAC,oBAAA,CAAAC,kBAAA,CAAA,8rBAAA,EAwCA;MAAAC,UAAA,EAAA,IAAA;AAAAC,MAAAA,KAAA,EAAAA,OAAA;QAAAR,EAAA;AAAAS,QAAAA;AAAA,OAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;"}
1
+ {"version":3,"file":"native-mirror.js","sources":["../../../../src/components/forms/select/native-mirror.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport {\n NativeSelect,\n type ListItem,\n type NativeSelectSignature\n} from '../native-select';\n\nconst eq = (a: unknown, b: unknown) => a === b;\n\ninterface SelectNativeMirrorSignature<T> {\n Args: {\n /**\n * The **unfiltered** collection, capped by `@displayLimit` (see\n * `Select#mirroredItems`). The mirror carries the form value, which must\n * not shrink to whatever the listbox filter currently shows, so it is\n * deliberately never handed `filteredItems`.\n */\n items?: T[];\n allowEmpty?: boolean;\n disabledKeys?: string[];\n selectionMode?: 'single' | 'multiple';\n\n /** Read in multiple selection mode. */\n selectedKeys: string[];\n /** Read in single selection mode. */\n selectedKey: string | null;\n\n /** Selection handler for multiple selection mode. */\n onSelectionChange: (keys: string[]) => void;\n /** Selection handler for single selection mode. */\n onSingleSelectionChange: (key: string | null) => void;\n\n onItemsChange: (nodes: ListItem[], action: 'add' | 'remove') => void;\n placeholder?: string;\n id?: string;\n name?: string;\n isDisabled?: boolean;\n };\n Blocks: {\n default: NativeSelectSignature<T>['Blocks']['default'];\n };\n}\n\n/**\n * The visually hidden native `<select>` that makes a Select submit with a form.\n *\n * Single and multiple selection mode differ only in three arguments, so those\n * three are curried onto the component and everything else -- the element, its\n * attributes and both blocks -- is written **once**. Two copies of this used to\n * sit side by side in `select.gts`, and a fix to the submitted value landed in\n * one of them and not the other.\n */\nclass SelectNativeMirror<T = unknown> extends Component<\n SelectNativeMirrorSignature<T>\n> {\n <template>\n {{#let\n (if\n (eq @selectionMode \"multiple\")\n (component\n NativeSelect\n selectionMode=\"multiple\"\n selectedKeys=@selectedKeys\n onSelectionChange=@onSelectionChange\n )\n (component\n NativeSelect\n selectionMode=\"single\"\n selectedKey=@selectedKey\n onSelectionChange=@onSingleSelectionChange\n )\n )\n as |Mirror|\n }}\n <Mirror\n @items={{@items}}\n @allowEmpty={{@allowEmpty}}\n @disabledKeys={{@disabledKeys}}\n @onItemsChange={{@onItemsChange}}\n @placeholder={{@placeholder}}\n @id={{@id}}\n @name={{@name}}\n tabindex=\"-1\"\n disabled={{@isDisabled}}\n >\n <:item as |l|>\n <l.Item @key={{l.key}}>\n {{l.label}}\n </l.Item>\n </:item>\n <:default as |l|>\n {{yield l}}\n </:default>\n </Mirror>\n {{/let}}\n </template>\n}\n\nexport { SelectNativeMirror, type SelectNativeMirrorSignature };\nexport default SelectNativeMirror;\n"],"names":["eq","a","b","SelectNativeMirror","Component","setComponentTemplate","precompileTemplate","strictMode","scope","NativeSelect"],"mappings":";;;;;AAOA,MAAMA,EAAA,GAAKA,CAACC,CAAU,EAAEC,CAAU,KAAKD,CAAA,KAAMC,CAAA;AAoC7C;;;;;;;;AAQC;AACD,MAAMC,kBAAA,SAAwCC,UAChB;AAE5B,EAAA;IAAAC,oBAAA,CAAAC,kBAAA,CAAA,8rBAAA,EAwCA;MAAAC,UAAA,EAAA,IAAA;AAAAC,MAAAA,KAAA,EAAAA,OAAA;QAAAR,EAAA;AAAAS,QAAAA;AAAA,OAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;"}
@@ -48,8 +48,9 @@ class Select extends Component {
48
48
  *
49
49
  * The hidden select is deliberately given the *unfiltered* `@items` — it
50
50
  * carries the form value, which must not shrink to the filter — so this
51
- * covers the whole list even while the listbox is filtered down. Chips and
52
- * the joined text value can therefore be resolved straight from it.
51
+ * covers every selected item even while the listbox is filtered down
52
+ * (`mirroredItems` keeps them past `@displayLimit` too). Chips and the
53
+ * joined text value can therefore be resolved straight from it.
53
54
  */
54
55
  static {
55
56
  decorateFieldV2(this.prototype, "isOpen", [tracked], function () {
@@ -570,11 +571,28 @@ class Select extends Component {
570
571
  return limitItems(this.filteredItems, displayLimit, item => selectedKeys.includes(keyAndLabelForItem(item).key));
571
572
  }
572
573
  /**
574
+ * The options the hidden native `<select>` holds: the unfiltered `@items`,
575
+ * capped by `@displayLimit` like the listbox, plus every selected option.
576
+ *
577
+ * The form value is the selected options, so it never needs the others.
578
+ * Holding every item instead costs the same rendering the limit saves in
579
+ * the listbox, and it is paid while the Select is closed: a page with a
580
+ * hundred Selects over a thousand items each built a hundred thousand
581
+ * hidden options. Unfiltered, so a filter can't change what the form sees.
582
+ */
583
+ static {
584
+ decorateMethodV2(this.prototype, "displayedItems", [cached]);
585
+ }
586
+ get mirroredItems() {
587
+ const selectedKeys = this.selectedKeys;
588
+ return limitItems(this.args.items, this.args.displayLimit, item => selectedKeys.includes(keyAndLabelForItem(item).key));
589
+ }
590
+ /**
573
591
  * What the display limit content reports, or `undefined` when nothing is
574
592
  * left out.
575
593
  */
576
594
  static {
577
- decorateMethodV2(this.prototype, "displayedItems", [cached]);
595
+ decorateMethodV2(this.prototype, "mirroredItems", [cached]);
578
596
  }
579
597
  get displayLimitContent() {
580
598
  const shown = this.displayedItems?.length ?? 0;
@@ -608,7 +626,7 @@ class Select extends Component {
608
626
  }
609
627
  });
610
628
  static {
611
- setComponentTemplate(precompileTemplate("<div {{this.updateMultipleSelectValue @selectedKeys}} {{this.updateSingleSelectValue @selectedKey}} {{this.containerRef.setup}} class={{this.classes.base class=@classes.base}} data-component=\"select\" data-part=\"base\" ...attributes>\n <FormControl @id={{@id}} @size={{@inputSize}} @label={{@label}} @isRequired={{@isRequired}} @description={{@description}} @errors={{@errors}} @isInvalid={{@isInvalid}} as |c|>\n <Popover @placement={{@placement}} @flipOptions={{@flipOptions}} @middleware={{@middleware}} @shiftOptions={{@shiftOptions}} @offsetOptions={{@offsetOptions}} @strategy={{@strategy}} @didClose={{this.didClose}} @isOpen={{this.isOpen}} @onOpenChange={{this.onOpenChange}} as |p|>\n <VisuallyHidden>\n <SelectNativeMirror @items={{@items}} @allowEmpty={{@allowEmpty}} @disabledKeys={{@disabledKeys}} @selectionMode={{@selectionMode}} @selectedKeys={{this.selectedKeys}} @selectedKey={{this.getSelectedKey}} @onSelectionChange={{this.onSelectionChange}} @onSingleSelectionChange={{this.onSingleSelectionChange}} @onItemsChange={{this.onItemsChange}} @placeholder={{@placeholder}} @id={{c.id}} @name={{@name}} @isDisabled={{@isDisabled}}>\n <:default as |l|>\n {{!-- @glint-expect-error: the signature of the native select is not the same as the listbox--}}\n {{yield l to=\"default\"}}\n </:default>\n </SelectNativeMirror>\n </VisuallyHidden>\n\n <div class={{this.classes.innerContainer class=@classes.innerContainer}} data-part=\"inner-container\">\n {{#if (has-block \"startContent\")}}\n <div data-part=\"start-content\" class={{this.classes.startContent class=@classes.startContent startContentPointerEvents=(if @startContentPointerEvents @startContentPointerEvents \"auto\")}}>\n {{yield to=\"startContent\"}}\n </div>\n {{/if}}\n {{!-- The wrapper, not the trigger, is the popover's width reference:\n in chips mode the trigger is only as wide as the space left over\n inside the field. The wrapper is a real full-width box in both\n modes, so the dropdown matches the field either way. --}}\n <div {{p.anchor}} {{p.measureWidth}} {{on \"click\" this.handleFieldClick}} data-test-id={{if this.showChips \"chips-field\"}} data-part=\"chips-field\" {{!-- These flags are stringified rather than handed the boolean.\n Glimmer renders a true boolean attribute as an empty value, so\n passing isInvalid straight through produced an empty data-invalid\n and the theme selector keyed on the value true never matched. --}} data-has-chips={{if this.showChips \"true\" \"false\"}} data-invalid={{if c.isInvalid \"true\" \"false\"}} data-disabled={{if @isDisabled \"true\" \"false\"}} class={{this.classes.chipsField class=@classes.chipsField hasStartContent=(has-block \"startContent\") hasEndContent=true}}>\n {{#if (and this.showChips this.hasSelection)}}\n {{!-- A block cannot be passed conditionally in Glimmer, so the\n :item block below is always supplied and the branch lives\n inside it: with no :selectedItem block from the consumer, both\n it and the trigger render exactly what they rendered before. --}}\n <SelectedChips @containerRef={{this.chipsContainerRef.setup}} @items={{this.selectedItems}} @classes={{this.classes}} @userClasses={{@classes}} @chipOptions={{this.chipOptions}} @isDisabled={{@isDisabled}} @isRemovable={{this.chipsRemovable}} @onRemove={{this.removeSelectedKey}}>\n <:item as |selected|>\n {{~#if (has-block \"selectedItem\")~}}\n {{~yield selected to=\"selectedItem\"~}}\n {{~else~}}\n {{~selected.label~}}\n {{~/if~}}\n </:item>\n </SelectedChips>\n {{/if}}\n <SelectTrigger @isFilterable={{@isFilterable}} @trigger={{p.trigger}} @triggerRef={{this.triggerRef.setup}} @isDisabled={{@isDisabled}} @showChips={{this.showChips}} @accessibleName={{this.triggerAccessibleName}} @placeholder={{@placeholder}} @hasSelection={{this.hasSelection}} @hasStartContent={{has-block \"startContent\"}} @classes={{this.classes}} @userClasses={{@classes}} @items={{this.selectedItems}} @filterValue={{this.filterFieldValue}} @onFilterInput={{this.onFilterChange}} @onFilterKeydown={{this.handleFilterKeydown}} @onKeydown={{this.handleTriggerKeydown}} @onFocusOut={{this.blurTracker.handleFocusOut}} @hasCustomContent={{has-block \"selectedItem\"}}>\n <:selectedItem as |selected|>\n {{~#if (has-block \"selectedItem\")~}}\n {{~yield selected to=\"selectedItem\"~}}\n {{~else~}}\n {{~selected.label~}}\n {{~/if~}}\n </:selectedItem>\n </SelectTrigger>\n </div>\n <SelectEndContent @classes={{this.classes}} @userClasses={{@classes}} @endContentPointerEvents={{@endContentPointerEvents}} @inputSize={{@inputSize}} @isLoading={{@isLoading}} @isClearable={{this.isClearable}} @onClear={{this.clearSelectedKeys}}>\n {{yield to=\"endContent\"}}\n </SelectEndContent>\n </div>\n\n <p.Content @size={{if @popoverSize @popoverSize \"trigger\"}} @target={{@target}} @renderInPlace={{@renderInPlace}} @disableFocusTrap={{this.disableFocusTrap}} @blockScroll={{this.blockScroll}} @transitionDuration={{@transitionDuration}} @backdrop={{this.backdrop}} @disableTransitions={{@disableTransitions}} @focusTrapOptions={{@focusTrapOptions}} @closeOnOutsideClick={{@closeOnOutsideClick}} @closeOnEscapeKey={{@closeOnEscapeKey}} @backdropTransition={{@backdropTransition}} @transition={{@transition}} @preventAutoFocus={{true}}>\n <Listbox @items={{this.displayedItems}} @allowEmpty={{@allowEmpty}} @variant={{this.variant}} @disabledKeys={{@disabledKeys}} @color={{this.color}} @isKeyboardEventsEnabled={{true}} @onAction={{this.onAction}} @onSelectionChange={{this.onSelectionChange}} @selectedKeys={{this.selectedKeys}} @selectionMode={{if @selectionMode @selectionMode \"single\"}} @type=\"listbox\" @class={{this.classes.listbox class=@classes.listbox}} @elementToAddKeyboardEvents={{this.triggerRef.current}} @autoActivateMode={{this.autoActivateMode}} data-part=\"listbox\">\n <:item as |l|>\n {{#if (has-block \"item\")}}\n {{yield l to=\"item\"}}\n {{else}}\n <l.Item @key={{l.key}} @variant={{this.variant}} @color={{this.color}}>\n {{l.label}}\n </l.Item>\n {{/if}}\n </:item>\n <:default as |l|>\n {{yield l to=\"default\"}}\n </:default>\n </Listbox>\n {{#if this.showEmptyContent}}\n <div class={{this.classes.emptyContent class=@classes.emptyContent}} data-part=\"empty-content\">\n {{#if (has-block \"emptyContent\")}}\n {{yield to=\"emptyContent\"}}\n {{else}}\n No results found.\n {{/if}}\n </div>\n {{/if}}\n {{#if this.displayLimitContent}}\n <div class={{this.classes.displayLimitContent class=@classes.displayLimitContent}} data-part=\"display-limit-content\">\n {{#if (has-block \"displayLimitContent\")}}\n {{yield this.displayLimitContent to=\"displayLimitContent\"}}\n {{else}}\n Showing\n {{this.displayLimitContent.shown}}\n of\n {{this.displayLimitContent.total}}. Type to narrow down.\n {{/if}}\n </div>\n {{/if}}\n </p.Content>\n </Popover>\n </FormControl>\n</div>", {
629
+ setComponentTemplate(precompileTemplate("<div {{this.updateMultipleSelectValue @selectedKeys}} {{this.updateSingleSelectValue @selectedKey}} {{this.containerRef.setup}} class={{this.classes.base class=@classes.base}} data-component=\"select\" data-part=\"base\" ...attributes>\n <FormControl @id={{@id}} @size={{@inputSize}} @label={{@label}} @isRequired={{@isRequired}} @description={{@description}} @errors={{@errors}} @isInvalid={{@isInvalid}} as |c|>\n <Popover @placement={{@placement}} @flipOptions={{@flipOptions}} @middleware={{@middleware}} @shiftOptions={{@shiftOptions}} @offsetOptions={{@offsetOptions}} @strategy={{@strategy}} @didClose={{this.didClose}} @isOpen={{this.isOpen}} @onOpenChange={{this.onOpenChange}} as |p|>\n <VisuallyHidden>\n <SelectNativeMirror @items={{this.mirroredItems}} @allowEmpty={{@allowEmpty}} @disabledKeys={{@disabledKeys}} @selectionMode={{@selectionMode}} @selectedKeys={{this.selectedKeys}} @selectedKey={{this.getSelectedKey}} @onSelectionChange={{this.onSelectionChange}} @onSingleSelectionChange={{this.onSingleSelectionChange}} @onItemsChange={{this.onItemsChange}} @placeholder={{@placeholder}} @id={{c.id}} @name={{@name}} @isDisabled={{@isDisabled}}>\n <:default as |l|>\n {{!-- @glint-expect-error: the signature of the native select is not the same as the listbox--}}\n {{yield l to=\"default\"}}\n </:default>\n </SelectNativeMirror>\n </VisuallyHidden>\n\n <div class={{this.classes.innerContainer class=@classes.innerContainer}} data-part=\"inner-container\">\n {{#if (has-block \"startContent\")}}\n <div data-part=\"start-content\" class={{this.classes.startContent class=@classes.startContent startContentPointerEvents=(if @startContentPointerEvents @startContentPointerEvents \"auto\")}}>\n {{yield to=\"startContent\"}}\n </div>\n {{/if}}\n {{!-- The wrapper, not the trigger, is the popover's width reference:\n in chips mode the trigger is only as wide as the space left over\n inside the field. The wrapper is a real full-width box in both\n modes, so the dropdown matches the field either way. --}}\n <div {{p.anchor}} {{p.measureWidth}} {{on \"click\" this.handleFieldClick}} data-test-id={{if this.showChips \"chips-field\"}} data-part=\"chips-field\" {{!-- These flags are stringified rather than handed the boolean.\n Glimmer renders a true boolean attribute as an empty value, so\n passing isInvalid straight through produced an empty data-invalid\n and the theme selector keyed on the value true never matched. --}} data-has-chips={{if this.showChips \"true\" \"false\"}} data-invalid={{if c.isInvalid \"true\" \"false\"}} data-disabled={{if @isDisabled \"true\" \"false\"}} class={{this.classes.chipsField class=@classes.chipsField hasStartContent=(has-block \"startContent\") hasEndContent=true}}>\n {{#if (and this.showChips this.hasSelection)}}\n {{!-- A block cannot be passed conditionally in Glimmer, so the\n :item block below is always supplied and the branch lives\n inside it: with no :selectedItem block from the consumer, both\n it and the trigger render exactly what they rendered before. --}}\n <SelectedChips @containerRef={{this.chipsContainerRef.setup}} @items={{this.selectedItems}} @classes={{this.classes}} @userClasses={{@classes}} @chipOptions={{this.chipOptions}} @isDisabled={{@isDisabled}} @isRemovable={{this.chipsRemovable}} @onRemove={{this.removeSelectedKey}}>\n <:item as |selected|>\n {{~#if (has-block \"selectedItem\")~}}\n {{~yield selected to=\"selectedItem\"~}}\n {{~else~}}\n {{~selected.label~}}\n {{~/if~}}\n </:item>\n </SelectedChips>\n {{/if}}\n <SelectTrigger @isFilterable={{@isFilterable}} @trigger={{p.trigger}} @triggerRef={{this.triggerRef.setup}} @isDisabled={{@isDisabled}} @showChips={{this.showChips}} @accessibleName={{this.triggerAccessibleName}} @placeholder={{@placeholder}} @hasSelection={{this.hasSelection}} @hasStartContent={{has-block \"startContent\"}} @classes={{this.classes}} @userClasses={{@classes}} @items={{this.selectedItems}} @filterValue={{this.filterFieldValue}} @onFilterInput={{this.onFilterChange}} @onFilterKeydown={{this.handleFilterKeydown}} @onKeydown={{this.handleTriggerKeydown}} @onFocusOut={{this.blurTracker.handleFocusOut}} @hasCustomContent={{has-block \"selectedItem\"}}>\n <:selectedItem as |selected|>\n {{~#if (has-block \"selectedItem\")~}}\n {{~yield selected to=\"selectedItem\"~}}\n {{~else~}}\n {{~selected.label~}}\n {{~/if~}}\n </:selectedItem>\n </SelectTrigger>\n </div>\n <SelectEndContent @classes={{this.classes}} @userClasses={{@classes}} @endContentPointerEvents={{@endContentPointerEvents}} @inputSize={{@inputSize}} @isLoading={{@isLoading}} @isClearable={{this.isClearable}} @onClear={{this.clearSelectedKeys}}>\n {{yield to=\"endContent\"}}\n </SelectEndContent>\n </div>\n\n <p.Content @size={{if @popoverSize @popoverSize \"trigger\"}} @target={{@target}} @renderInPlace={{@renderInPlace}} @disableFocusTrap={{this.disableFocusTrap}} @blockScroll={{this.blockScroll}} @transitionDuration={{@transitionDuration}} @backdrop={{this.backdrop}} @disableTransitions={{@disableTransitions}} @focusTrapOptions={{@focusTrapOptions}} @closeOnOutsideClick={{@closeOnOutsideClick}} @closeOnEscapeKey={{@closeOnEscapeKey}} @backdropTransition={{@backdropTransition}} @transition={{@transition}} @preventAutoFocus={{true}}>\n <Listbox @items={{this.displayedItems}} @allowEmpty={{@allowEmpty}} @variant={{this.variant}} @disabledKeys={{@disabledKeys}} @color={{this.color}} @isKeyboardEventsEnabled={{true}} @onAction={{this.onAction}} @onSelectionChange={{this.onSelectionChange}} @selectedKeys={{this.selectedKeys}} @selectionMode={{if @selectionMode @selectionMode \"single\"}} @type=\"listbox\" @class={{this.classes.listbox class=@classes.listbox}} @elementToAddKeyboardEvents={{this.triggerRef.current}} @autoActivateMode={{this.autoActivateMode}} data-part=\"listbox\">\n <:item as |l|>\n {{#if (has-block \"item\")}}\n {{yield l to=\"item\"}}\n {{else}}\n <l.Item @key={{l.key}} @variant={{this.variant}} @color={{this.color}}>\n {{l.label}}\n </l.Item>\n {{/if}}\n </:item>\n <:default as |l|>\n {{yield l to=\"default\"}}\n </:default>\n </Listbox>\n {{#if this.showEmptyContent}}\n <div class={{this.classes.emptyContent class=@classes.emptyContent}} data-part=\"empty-content\">\n {{#if (has-block \"emptyContent\")}}\n {{yield to=\"emptyContent\"}}\n {{else}}\n No results found.\n {{/if}}\n </div>\n {{/if}}\n {{#if this.displayLimitContent}}\n <div class={{this.classes.displayLimitContent class=@classes.displayLimitContent}} data-part=\"display-limit-content\">\n {{#if (has-block \"displayLimitContent\")}}\n {{yield this.displayLimitContent to=\"displayLimitContent\"}}\n {{else}}\n Showing\n {{this.displayLimitContent.shown}}\n of\n {{this.displayLimitContent.total}}. Type to narrow down.\n {{/if}}\n </div>\n {{/if}}\n </p.Content>\n </Popover>\n </FormControl>\n</div>", {
612
630
  strictMode: true,
613
631
  scope: () => ({
614
632
  FormControl,