@redvars/peacock 4.5.1 → 4.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{BaseField-BbOj212R.js → BaseField-DOCmylob.js} +16 -3
- package/dist/BaseField-DOCmylob.js.map +1 -0
- package/dist/accordion.js +1 -1
- package/dist/activation-gate-D4IpmwyD.js +23 -0
- package/dist/activation-gate-D4IpmwyD.js.map +1 -0
- package/dist/avatar-group.js +2 -1
- package/dist/avatar-group.js.map +1 -1
- package/dist/avatar.js +3 -0
- package/dist/avatar.js.map +1 -1
- package/dist/{base-button-BJMGMcMv.js → base-button-9tGu5RSC.js} +30 -10
- package/dist/base-button-9tGu5RSC.js.map +1 -0
- package/dist/button-group.js +5 -3
- package/dist/button-group.js.map +1 -1
- package/dist/button.js +12 -16
- package/dist/button.js.map +1 -1
- package/dist/calendar-column-view.js +4 -4
- package/dist/{calendar-drag-IXMPZrTN.js → calendar-drag-DdJwSpEz.js} +2 -2
- package/dist/{calendar-drag-IXMPZrTN.js.map → calendar-drag-DdJwSpEz.js.map} +1 -1
- package/dist/{calendar-event-BQChlMXy.js → calendar-event-BvbYZHx1.js} +2 -2
- package/dist/{calendar-event-BQChlMXy.js.map → calendar-event-BvbYZHx1.js.map} +1 -1
- package/dist/calendar-month-view.js +65 -14
- package/dist/calendar-month-view.js.map +1 -1
- package/dist/calendar-timeline.js +9 -4
- package/dist/calendar-timeline.js.map +1 -1
- package/dist/calendar.js +21 -6
- package/dist/calendar.js.map +1 -1
- package/dist/card.js +29 -16
- package/dist/card.js.map +1 -1
- package/dist/chart-doughnut.js +3 -1
- package/dist/chart-doughnut.js.map +1 -1
- package/dist/chart-pie.js +9 -1
- package/dist/chart-pie.js.map +1 -1
- package/dist/chip-set.js +1 -1
- package/dist/chip.js +10 -19
- package/dist/chip.js.map +1 -1
- package/dist/color-field.js +4 -1
- package/dist/color-field.js.map +1 -1
- package/dist/currency-field.js +4 -1
- package/dist/currency-field.js.map +1 -1
- package/dist/custom-elements-jsdocs.json +26 -20
- package/dist/custom-elements.json +755 -90
- package/dist/{datasource-OwvH7SVq.js → datasource-DxEA6jHW.js} +6 -4
- package/dist/datasource-DxEA6jHW.js.map +1 -0
- package/dist/{date-cfPx3alz.js → date-DPQOY8Zd.js} +2 -2
- package/dist/{date-cfPx3alz.js.map → date-DPQOY8Zd.js.map} +1 -1
- package/dist/date-field.js +8 -5
- package/dist/date-field.js.map +1 -1
- package/dist/date-picker.js +2 -2
- package/dist/date-range-field.js +8 -5
- package/dist/date-range-field.js.map +1 -1
- package/dist/datetime-field.js +7 -4
- package/dist/datetime-field.js.map +1 -1
- package/dist/diagram-controls.js +1 -1
- package/dist/{throttle-SQ9t-HL7.js → dispatch-event-utils-DfgqVBK8.js} +2 -24
- package/dist/dispatch-event-utils-DfgqVBK8.js.map +1 -0
- package/dist/{form-submitter-beG1CXAn.js → dispatch-hooks-J_godlHh.js} +2 -87
- package/dist/dispatch-hooks-J_godlHh.js.map +1 -0
- package/dist/dropdown-button.js +11 -7
- package/dist/dropdown-button.js.map +1 -1
- package/dist/{event-manager-KGMT2x2Q.js → event-manager-DYfeN3VE.js} +3 -3
- package/dist/{event-manager-KGMT2x2Q.js.map → event-manager-DYfeN3VE.js.map} +1 -1
- package/dist/fab.js +15 -19
- package/dist/fab.js.map +1 -1
- package/dist/filter-bar.js +3 -3
- package/dist/form-submission-h40coUI8.js +13 -0
- package/dist/form-submission-h40coUI8.js.map +1 -0
- package/dist/form-submitter-BIFqZ0wq.js +88 -0
- package/dist/form-submitter-BIFqZ0wq.js.map +1 -0
- package/dist/form.js +1 -9
- package/dist/form.js.map +1 -1
- package/dist/icon-button.js +15 -19
- package/dist/icon-button.js.map +1 -1
- package/dist/icon.js +1 -1
- package/dist/implicit-submission-ChLdbxaR.js +100 -0
- package/dist/implicit-submission-ChLdbxaR.js.map +1 -0
- package/dist/index.js +20 -15
- package/dist/index.js.map +1 -1
- package/dist/{indicator-navigation-item-CmyhsOmy.js → indicator-navigation-item-BsQE3kUr.js} +2 -2
- package/dist/{indicator-navigation-item-CmyhsOmy.js.map → indicator-navigation-item-BsQE3kUr.js.map} +1 -1
- package/dist/input.js +13 -4
- package/dist/input.js.map +1 -1
- package/dist/json-viewer.js +1 -1
- package/dist/kanban.js +8 -7
- package/dist/kanban.js.map +1 -1
- package/dist/link-button.js +13 -14
- package/dist/link-button.js.map +1 -1
- package/dist/list-item.js +52 -16
- package/dist/list-item.js.map +1 -1
- package/dist/list.js +5 -3
- package/dist/list.js.map +1 -1
- package/dist/listbox.js +1 -1
- package/dist/loader-full.js +17 -12
- package/dist/loader-full.js.map +1 -1
- package/dist/loader.js +17 -12
- package/dist/loader.js.map +1 -1
- package/dist/locale-DEsJZCQG.js.map +1 -1
- package/dist/mention-input.js +8 -1
- package/dist/mention-input.js.map +1 -1
- package/dist/menu-item.js +12 -12
- package/dist/menu-item.js.map +1 -1
- package/dist/menu.js +7 -3
- package/dist/menu.js.map +1 -1
- package/dist/navigation-bar-item.js +4 -3
- package/dist/navigation-bar-item.js.map +1 -1
- package/dist/navigation-bar.js +4 -3
- package/dist/navigation-bar.js.map +1 -1
- package/dist/navigation-drawer-item.js +3 -2
- package/dist/navigation-drawer-item.js.map +1 -1
- package/dist/navigation-drawer.js +3 -2
- package/dist/navigation-drawer.js.map +1 -1
- package/dist/{navigation-item-base-kUrvJgCx.js → navigation-item-base-5ljwtLG_.js} +3 -2
- package/dist/{navigation-item-base-kUrvJgCx.js.map → navigation-item-base-5ljwtLG_.js.map} +1 -1
- package/dist/navigation-rail-item.js +4 -3
- package/dist/navigation-rail-item.js.map +1 -1
- package/dist/navigation-rail.js +6 -5
- package/dist/navigation-rail.js.map +1 -1
- package/dist/number-field.js +4 -1
- package/dist/number-field.js.map +1 -1
- package/dist/option.js +3 -2
- package/dist/option.js.map +1 -1
- package/dist/password-field.js +11 -4
- package/dist/password-field.js.map +1 -1
- package/dist/phone-field.js +4 -1
- package/dist/phone-field.js.map +1 -1
- package/dist/{picker-field-DmXYPvbF.js → picker-field-BiM3iXAQ.js} +2 -2
- package/dist/{picker-field-DmXYPvbF.js.map → picker-field-BiM3iXAQ.js.map} +1 -1
- package/dist/pin-input.js +4 -1
- package/dist/pin-input.js.map +1 -1
- package/dist/{range-utils-DZe96GnO.js → range-utils-vgG1SJ2o.js} +2 -2
- package/dist/{range-utils-DZe96GnO.js.map → range-utils-vgG1SJ2o.js.map} +1 -1
- package/dist/{roving-focus-controller-fm95JkZJ.js → roving-focus-controller-YtNbxH95.js} +30 -7
- package/dist/roving-focus-controller-YtNbxH95.js.map +1 -0
- package/dist/search.js +12 -6
- package/dist/search.js.map +1 -1
- package/dist/select.js +11 -3
- package/dist/select.js.map +1 -1
- package/dist/shipped-icons.js +1 -1
- package/dist/split-button.js +9 -1
- package/dist/split-button.js.map +1 -1
- package/dist/src/__internal/controllers/roving-focus-controller.d.ts +14 -2
- package/dist/src/__internal/implicit-submission.d.ts +25 -0
- package/dist/src/__internal/utils/activation-gate.d.ts +8 -0
- package/dist/src/__internal/utils/form-submission.d.ts +2 -0
- package/dist/src/avatar-group/avatar-group.d.ts +1 -1
- package/dist/src/button/base-button/base-button.d.ts +1 -1
- package/dist/src/button/button/button.d.ts +2 -1
- package/dist/src/button/fab/fab.d.ts +2 -1
- package/dist/src/button/icon-button/icon-button.d.ts +2 -1
- package/dist/src/button/link-button/link-button.d.ts +5 -1
- package/dist/src/calendar/calendar-month-view.d.ts +5 -1
- package/dist/src/calendar/calendar.d.ts +6 -1
- package/dist/src/card/card.d.ts +19 -9
- package/dist/src/chart-pie/chart-pie.d.ts +5 -0
- package/dist/src/chip/chip/chip.d.ts +4 -4
- package/dist/src/dropdown-button/dropdown-button.d.ts +5 -1
- package/dist/src/input/BaseField.d.ts +7 -0
- package/dist/src/input/input.d.ts +5 -1
- package/dist/src/list/list-item.d.ts +2 -1
- package/dist/src/mention-input/mention-input.d.ts +2 -0
- package/dist/src/menu/menu-item/menu-item.d.ts +6 -4
- package/dist/src/password-field/password-field.d.ts +3 -1
- package/dist/src/search/search.d.ts +1 -0
- package/dist/src/select/select.d.ts +2 -0
- package/dist/src/split-button/split-button.d.ts +6 -1
- package/dist/src/stepper/step.d.ts +3 -1
- package/dist/src/tabs/tab.d.ts +12 -2
- package/dist/src/textarea/textarea.d.ts +2 -0
- package/dist/src/toolbar/toolbar.d.ts +13 -2
- package/dist/step.js +7 -1
- package/dist/step.js.map +1 -1
- package/dist/stepper.js +10 -1
- package/dist/stepper.js.map +1 -1
- package/dist/sub-menu.js +3 -2
- package/dist/sub-menu.js.map +1 -1
- package/dist/svg.js +1 -1
- package/dist/tab-group.js +3 -2
- package/dist/tab-group.js.map +1 -1
- package/dist/tab.js +17 -12
- package/dist/tab.js.map +1 -1
- package/dist/tabs.js +3 -2
- package/dist/tabs.js.map +1 -1
- package/dist/test/accessible-name.test.d.ts +1 -0
- package/dist/test/helpers/count-activations.d.ts +9 -0
- package/dist/test/navigation-rail.test.d.ts +1 -0
- package/dist/test/throttle-delay.test.d.ts +1 -0
- package/dist/textarea.js +8 -1
- package/dist/textarea.js.map +1 -1
- package/dist/throttle-C7ZAPqtu.js +24 -0
- package/dist/throttle-C7ZAPqtu.js.map +1 -0
- package/dist/time-field.js +7 -4
- package/dist/time-field.js.map +1 -1
- package/dist/time-picker.js +2 -2
- package/dist/toolbar.js +25 -8
- package/dist/toolbar.js.map +1 -1
- package/dist/tree.js +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/url-field.js +4 -1
- package/dist/url-field.js.map +1 -1
- package/dist/{utils-DcvLgexs.js → utils-CQzycr9J.js} +2 -1
- package/dist/utils-CQzycr9J.js.map +1 -0
- package/package.json +2 -1
- package/src/__internal/controllers/roving-focus-controller.ts +35 -7
- package/src/__internal/i18n/locale.ts +1 -1
- package/src/__internal/implicit-submission.ts +102 -0
- package/src/__internal/utils/activation-gate.ts +20 -0
- package/src/__internal/utils/cache-fetch.ts +6 -3
- package/src/__internal/utils/form-submission.ts +11 -0
- package/src/avatar/avatar.scss +5 -0
- package/src/avatar-group/avatar-group.scss +3 -0
- package/src/avatar-group/avatar-group.ts +1 -1
- package/src/button/base-button/base-button.ts +41 -16
- package/src/button/button/button.ts +5 -16
- package/src/button/fab/fab.ts +7 -18
- package/src/button/icon-button/icon-button.ts +7 -18
- package/src/button/link-button/link-button.ts +8 -15
- package/src/calendar/_calendar-header.scss +7 -1
- package/src/calendar/calendar-month-view.scss +36 -2
- package/src/calendar/calendar-month-view.ts +33 -8
- package/src/calendar/calendar.ts +17 -2
- package/src/calendar/utils.ts +1 -0
- package/src/card/card.ts +27 -16
- package/src/chart-doughnut/chart-doughnut.ts +6 -1
- package/src/chart-pie/chart-pie.ts +10 -1
- package/src/chip/chip/chip.ts +6 -26
- package/src/dropdown-button/dropdown-button.ts +7 -2
- package/src/form/form.ts +1 -9
- package/src/input/BaseField.ts +17 -0
- package/src/input/input.ts +13 -1
- package/src/kanban/kanban.scss +11 -7
- package/src/list/list-item.scss +5 -0
- package/src/list/list-item.ts +44 -16
- package/src/mention-input/mention-input.ts +5 -0
- package/src/menu/menu/menu.ts +4 -1
- package/src/menu/menu-item/menu-item.ts +9 -14
- package/src/navigation-rail/navigation-rail.scss +3 -2
- package/src/password-field/password-field.ts +11 -1
- package/src/search/search.ts +9 -0
- package/src/select/select.ts +5 -0
- package/src/split-button/split-button.ts +10 -1
- package/src/stepper/step.ts +7 -1
- package/src/stepper/stepper.scss +13 -0
- package/src/tabs/tab.ts +21 -17
- package/src/textarea/textarea.ts +5 -0
- package/src/toolbar/toolbar.ts +26 -7
- package/dist/BaseField-BbOj212R.js.map +0 -1
- package/dist/base-button-BJMGMcMv.js.map +0 -1
- package/dist/datasource-OwvH7SVq.js.map +0 -1
- package/dist/form-submitter-beG1CXAn.js.map +0 -1
- package/dist/roving-focus-controller-fm95JkZJ.js.map +0 -1
- package/dist/throttle-SQ9t-HL7.js.map +0 -1
- package/dist/utils-DcvLgexs.js.map +0 -1
package/dist/search.js
CHANGED
|
@@ -5,6 +5,7 @@ import { e } from './query-CHb9Ft_d.js';
|
|
|
5
5
|
import { e as e$1 } from './class-map-NDIkZErE.js';
|
|
6
6
|
import { l } from './live-D_5OfuGD.js';
|
|
7
7
|
import { I as I18nController } from './i18n-controller-BTeChxE0.js';
|
|
8
|
+
import { r as registerTextField } from './implicit-submission-ChLdbxaR.js';
|
|
8
9
|
import { A as AiController } from './ai-controller-DR_Tg0sN.js';
|
|
9
10
|
import { s as sparkle } from './sparkle-BmtM0vbq.js';
|
|
10
11
|
import { B as BaseInput, n as nativeValidity } from './BaseInput-Cv03GZLu.js';
|
|
@@ -13,6 +14,8 @@ import './directive-ZPhl09Yt.js';
|
|
|
13
14
|
import './directive-helpers-Bx3mu42O.js';
|
|
14
15
|
import './strings-DeiQWMd9.js';
|
|
15
16
|
import './locale-DEsJZCQG.js';
|
|
17
|
+
import './dispatch-hooks-J_godlHh.js';
|
|
18
|
+
import './form-submission-h40coUI8.js';
|
|
16
19
|
import './element-internals-QME0yEz4.js';
|
|
17
20
|
import './form-associated-BHbg72PG.js';
|
|
18
21
|
import './suggestion-controller-7YRQqkaI.js';
|
|
@@ -360,9 +363,13 @@ const clearableConverter = {
|
|
|
360
363
|
* @tags form
|
|
361
364
|
*/
|
|
362
365
|
let Search = class Search extends BaseInput {
|
|
366
|
+
/** Whether Ask is offered now: `ask`, and AI on for the page. */
|
|
367
|
+
get __asking() {
|
|
368
|
+
return this.ask && this.ai.available;
|
|
369
|
+
}
|
|
370
|
+
// ── Lifecycle ────────────────────────────────────────────────────────────
|
|
363
371
|
constructor() {
|
|
364
|
-
|
|
365
|
-
super(...arguments);
|
|
372
|
+
super();
|
|
366
373
|
// ── Properties ───────────────────────────────────────────────────────────
|
|
367
374
|
/**
|
|
368
375
|
* Visual style, as on fields: `default` (a filled container), `filled` or `outlined`.
|
|
@@ -402,10 +409,8 @@ let Search = class Search extends BaseInput {
|
|
|
402
409
|
this.__handleFocusChange = (event) => {
|
|
403
410
|
this.focused = event.type === 'focus';
|
|
404
411
|
};
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
get __asking() {
|
|
408
|
-
return this.ask && this.ai.available;
|
|
412
|
+
// Counts like a native search input when Enter decides whether to submit a form.
|
|
413
|
+
registerTextField(this);
|
|
409
414
|
}
|
|
410
415
|
// ── Public methods ───────────────────────────────────────────────────────
|
|
411
416
|
focus() {
|
|
@@ -564,6 +569,7 @@ let Search = class Search extends BaseInput {
|
|
|
564
569
|
`;
|
|
565
570
|
}
|
|
566
571
|
};
|
|
572
|
+
// ── Static ───────────────────────────────────────────────────────────────
|
|
567
573
|
Search.styles = [css_248z$1, css_248z];
|
|
568
574
|
__decorate([
|
|
569
575
|
n({ type: String, reflect: true })
|
package/dist/search.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search.js","sources":["../../src/search/search.ts"],"sourcesContent":["import { html, nothing } from 'lit';\nimport { property, query, state } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { live } from 'lit/directives/live.js';\nimport IndividualComponent from '@/IndividualComponent.js';\nimport { I18nController } from '@/__internal/i18n/i18n-controller.js';\nimport { AiController } from '@/__internal/ai/ai-controller.js';\nimport { sparkle } from '@/__internal/ai/sparkle.js';\nimport BaseInput, {\n type ControlValidity,\n nativeValidity,\n} from '../input/BaseInput.js';\nimport styles from './search.scss';\nimport colorStyles from './search-colors.scss';\n\n/** Reads `clearable=\"false\"` as false, so the default-on button can be turned off in HTML. */\nconst clearableConverter = {\n fromAttribute: (value: string | null) => value !== null && value !== 'false',\n toAttribute: (value: boolean) => (value ? '' : 'false'),\n};\n\n/**\n * @label Search\n * @tag wc-search\n * @rawTag search\n *\n * @summary A search box with a search icon and a clear button, for finding or filtering content.\n * @overview\n * <p>Search has the field variants (<code>default</code>, <code>filled</code>, <code>outlined</code>), a\n * clear button, and <code>start</code>/<code>end</code> slots for icons and actions.</p>\n * <p><code>label</code> is the accessible name of the search box (it is not shown); without it the\n * placeholder names it.</p>\n * <p>The clear button is on by default (<code>clearable</code> is <code>true</code>), unlike on\n * fields, because a search box is cleared often; turn it off with <code>clearable=\"false\"</code>\n * or <code>.clearable=${false}</code>. Escape clears the value too; when there is nothing to clear,\n * Escape is left to the page, so a dialog around the search still closes.</p>\n * <p>Search is form-associated: inside a <code><form></code> its <code>value</code> is\n * submitted under its <code>name</code>, and <code>form.reset()</code> restores the starting value.\n * It shows no validation message, so use <code>wc-input</code> for a search term that must be\n * validated.</p>\n * <p><b>Ask.</b> With <code>ask</code>, the box is also where people ask the assistant\n * (ADR-030002): an <strong>Ask</strong> button and Ctrl+Enter (⌘Enter) fire <code>ask</code> with\n * the text, while Enter still searches. <code>ask-placeholder</code> replaces the placeholder, such\n * as \"Ask for something, or search apps and records\". With AI off for the page, the box is a plain\n * search: no button, the usual placeholder, and no <code>ask</code>.</p>\n *\n * @slot start - Leading content; replaces the search icon.\n * @slot end - Trailing content, after the clear button.\n *\n * @cssprop --search-container-shape - Border radius of the search bar. Defaults to full (pill shape).\n * @cssprop --search-container-color - Background color of the search container.\n * @cssprop --search-input-text-color - Color of the input text.\n * @cssprop --search-placeholder-color - Color of the placeholder text.\n * @cssprop --search-icon-color - Color of the leading and trailing icons.\n * @cssprop --search-outline-color - Border color for the outlined variant.\n * @cssprop --search-outline-width - Border width for the outlined variant.\n *\n * @fires {CustomEvent<{value: string}>} input - Dispatched when the search value changes.\n * @fires {CustomEvent<{value: string}>} change - Dispatched when the value is committed: on blur, Enter, or when it is cleared.\n * @fires {CustomEvent} clear - Dispatched when the value is cleared with the clear button or Escape.\n * @fires {CustomEvent<{value: string}>} search - Dispatched when the user submits the search (presses Enter).\n * @fires {CustomEvent<{value: string}>} ask - With `ask`: the person pressed Ask or Ctrl+Enter (⌘Enter) to ask the assistant.\n *\n * @example\n * ```html\n * <wc-search label=\"Search products\" placeholder=\"Search...\"></wc-search>\n * ```\n * @tags form\n */\n@IndividualComponent\nexport class Search extends BaseInput {\n // ── Static ───────────────────────────────────────────────────────────────\n\n static styles = [styles, colorStyles];\n\n // ── Properties ───────────────────────────────────────────────────────────\n\n /**\n * Visual style, as on fields: `default` (a filled container), `filled` or `outlined`.\n * `default` and `filled` look the same.\n */\n @property({ type: String, reflect: true })\n variant: 'default' | 'filled' | 'outlined' = 'default';\n\n /** Accessible name of the search box; the placeholder names it when it is empty. */\n @property({ type: String })\n label = '';\n\n /**\n * Placeholder text shown when the input is empty. Defaults to Peacock's \"Search\".\n */\n @property({ type: String })\n placeholder: string = '';\n\n /**\n * Current search value.\n */\n @property({ type: String })\n value: string = '';\n\n /**\n * Whether a clear button is shown when the input has a value. On by default; set\n * `clearable=\"false\"` to hide it.\n */\n @property({ converter: clearableConverter })\n clearable: boolean = true;\n\n /**\n * Size of the search bar.\n * Possible values: `\"sm\"`, `\"md\"`, `\"lg\"`. Defaults to `\"md\"`.\n */\n @property({ type: String, reflect: true })\n size: 'sm' | 'md' | 'lg' = 'md';\n\n /** Lets people ask the assistant from the box: an Ask button and Ctrl+Enter fire `ask`. */\n @property({ type: Boolean, reflect: true })\n ask = false;\n\n /** Placeholder while asking is offered, such as \"Ask for something, or search apps and records\". */\n @property({ type: String, attribute: 'ask-placeholder' })\n askPlaceholder = '';\n\n // ── State ────────────────────────────────────────────────────────────────\n\n @state()\n private focused: boolean = false;\n\n // ── Queries ──────────────────────────────────────────────────────────────\n\n @query('.search-input')\n private inputElement?: HTMLInputElement;\n\n // ── Private fields ───────────────────────────────────────────────────────\n\n /** Peacock's strings for the placeholder and clear button. */\n private readonly i18n = new I18nController(this);\n\n private readonly ai = new AiController(this);\n\n /** Whether Ask is offered now: `ask`, and AI on for the page. */\n private get __asking(): boolean {\n return this.ask && this.ai.available;\n }\n\n // ── Public methods ───────────────────────────────────────────────────────\n\n override focus() {\n this.inputElement?.focus();\n }\n\n override blur() {\n this.inputElement?.blur();\n }\n\n // ── Protected methods ────────────────────────────────────────────────────\n\n protected override computeValidity(): ControlValidity {\n return this.inputElement\n ? nativeValidity(this.inputElement)\n : super.computeValidity();\n }\n\n protected override validityAnchor() {\n return this.inputElement;\n }\n\n // ── Private methods ──────────────────────────────────────────────────────\n\n private __emit(type: 'input' | 'change' | 'search' | 'ask') {\n this.dispatchEvent(\n new CustomEvent(type, {\n detail: { value: this.value },\n bubbles: true,\n composed: true,\n }),\n );\n }\n\n private __handleInput(event: InputEvent) {\n const input = event.target as HTMLInputElement;\n this.value = input.value;\n // Prevent the native input event from escaping in addition to our API event.\n event.stopPropagation();\n this.__emit('input');\n }\n\n private __handleChange(event: Event) {\n const input = event.target as HTMLInputElement;\n this.value = input.value;\n // Prevent the native change event from escaping in addition to our API event.\n event.stopPropagation();\n this.__emit('change');\n }\n\n private __handleKeydown(event: KeyboardEvent) {\n if (event.key === 'Enter' && (event.ctrlKey || event.metaKey)) {\n if (this.__asking) {\n event.preventDefault();\n this.__ask();\n return;\n }\n }\n if (event.key === 'Enter') {\n this.__emit('search');\n }\n if (event.key === 'Escape' && this.value && !this.readonly) {\n // Only take Escape when there is something to clear; otherwise a dialog may want it.\n event.preventDefault();\n event.stopPropagation();\n this.__clearValue();\n }\n }\n\n private __handleFocusChange = (event: FocusEvent) => {\n this.focused = event.type === 'focus';\n };\n\n private __clearValue() {\n this.value = '';\n this.inputElement?.focus();\n this.dispatchEvent(\n new CustomEvent('clear', {\n bubbles: true,\n composed: true,\n }),\n );\n this.__emit('input');\n this.__emit('change');\n }\n\n private __ask() {\n if (!this.value.trim() || this.disabled) return;\n this.__emit('ask');\n }\n\n // ── Render helpers ───────────────────────────────────────────────────────\n\n private __renderAskButton() {\n if (!this.__asking) return nothing;\n return html`<button\n class=\"ask-button\"\n type=\"button\"\n aria-label=${this.i18n.t('searchAskLabel')}\n ?disabled=${this.disabled || !this.value.trim()}\n @click=${this.__ask}\n >\n ${sparkle}<span>${this.i18n.t('searchAsk')}</span>\n </button>`;\n }\n\n private __renderClearButton() {\n if (!this.clearable || !this.value || this.readonly) return nothing;\n\n return html`\n <button\n class=\"clear-button\"\n aria-label=${this.i18n.t('clearSearch')}\n tabindex=\"-1\"\n @click=${this.__clearValue}\n ?disabled=${this.disabled}\n >\n <wc-icon name=\"close\"></wc-icon>\n </button>\n `;\n }\n\n private __renderLeadingIcon() {\n return html`\n <div class=\"leading-icon\">\n <slot name=\"start\">\n <wc-icon name=\"search\"></wc-icon>\n </slot>\n </div>\n `;\n }\n\n // ── Render ───────────────────────────────────────────────────────────────\n\n override render() {\n // `default` keeps the filled look the search has always had.\n const variant = this.variant === 'outlined' ? 'outlined' : 'filled';\n const cssClasses = {\n search: true,\n [`variant-${variant}`]: true,\n [`size-${this.size}`]: true,\n focused: this.focused,\n disabled: this.disabled,\n 'has-value': !!this.value,\n };\n\n const placeholder =\n (this.__asking && this.askPlaceholder) ||\n this.placeholder ||\n this.i18n.t('search');\n\n return html`\n <div class=${classMap(cssClasses)} role=\"search\">\n <div class=\"background\"></div>\n <div class=\"outline\"></div>\n\n ${this.__renderLeadingIcon()}\n\n <input\n class=\"search-input\"\n type=\"search\"\n role=\"searchbox\"\n .value=${live(this.value)}\n placeholder=${placeholder}\n ?disabled=${this.disabled}\n ?readonly=${this.readonly}\n ?required=${this.required}\n aria-label=${this.label || placeholder}\n @input=${this.__handleInput}\n @change=${this.__handleChange}\n @keydown=${this.__handleKeydown}\n @focus=${this.__handleFocusChange}\n @blur=${this.__handleFocusChange}\n />\n\n <div class=\"trailing-actions\">\n ${this.__renderClearButton()}\n <slot name=\"end\"></slot>\n ${this.__renderAskButton()}\n </div>\n </div>\n `;\n }\n}\n"],"names":["nothing","html","classMap","live","styles","colorStyles","property","state","query"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AAE,SAAS,EAAE,kBAAkB,EAAE;AACjB,CAAA,EAAA,MAAA,CAAA,SAAA,EAAA,WAAA,EAAA,MAAA,CAAA;AAO1B,UAAA,CAAA;IADCA,CAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE;AACT,CAAA,EAAA,MAAA,CAAA,SAAA,EAAA,MAAA,EAAA,MAAA,CAAA;AAIhC,UAAA,CAAA;IADCA,CAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE;AAC9B,CAAA,EAAA,MAAA,CAAA,SAAA,EAAA,KAAA,EAAA,MAAA,CAAA;AAIZ,UAAA,CAAA;IADCA,CAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,iBAAiB,EAAE;AACpC,CAAA,EAAA,MAAA,CAAA,SAAA,EAAA,gBAAA,EAAA,MAAA,CAAA;AAKZ,UAAA,CAAA;AADP,IAAAC,CAAK;AAC2B,CAAA,EAAA,MAAA,CAAA,SAAA,EAAA,SAAA,EAAA,MAAA,CAAA;AAKzB,UAAA,CAAA;IADPC,CAAK,CAAC,eAAe;AACkB,CAAA,EAAA,MAAA,CAAA,SAAA,EAAA,cAAA,EAAA,MAAA,CAAA;AA5D7B,MAAM,GAAA,UAAA,CAAA;IADlB;AACY,CAAA,EAAA,MAAM,CAiQlB;;;;"}
|
|
1
|
+
{"version":3,"file":"search.js","sources":["../../src/search/search.ts"],"sourcesContent":["import { html, nothing } from 'lit';\nimport { property, query, state } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { live } from 'lit/directives/live.js';\nimport IndividualComponent from '@/IndividualComponent.js';\nimport { I18nController } from '@/__internal/i18n/i18n-controller.js';\nimport { registerTextField } from '@/__internal/implicit-submission.js';\nimport { AiController } from '@/__internal/ai/ai-controller.js';\nimport { sparkle } from '@/__internal/ai/sparkle.js';\nimport BaseInput, {\n type ControlValidity,\n nativeValidity,\n} from '../input/BaseInput.js';\nimport styles from './search.scss';\nimport colorStyles from './search-colors.scss';\n\n/** Reads `clearable=\"false\"` as false, so the default-on button can be turned off in HTML. */\nconst clearableConverter = {\n fromAttribute: (value: string | null) => value !== null && value !== 'false',\n toAttribute: (value: boolean) => (value ? '' : 'false'),\n};\n\n/**\n * @label Search\n * @tag wc-search\n * @rawTag search\n *\n * @summary A search box with a search icon and a clear button, for finding or filtering content.\n * @overview\n * <p>Search has the field variants (<code>default</code>, <code>filled</code>, <code>outlined</code>), a\n * clear button, and <code>start</code>/<code>end</code> slots for icons and actions.</p>\n * <p><code>label</code> is the accessible name of the search box (it is not shown); without it the\n * placeholder names it.</p>\n * <p>The clear button is on by default (<code>clearable</code> is <code>true</code>), unlike on\n * fields, because a search box is cleared often; turn it off with <code>clearable=\"false\"</code>\n * or <code>.clearable=${false}</code>. Escape clears the value too; when there is nothing to clear,\n * Escape is left to the page, so a dialog around the search still closes.</p>\n * <p>Search is form-associated: inside a <code><form></code> its <code>value</code> is\n * submitted under its <code>name</code>, and <code>form.reset()</code> restores the starting value.\n * It shows no validation message, so use <code>wc-input</code> for a search term that must be\n * validated.</p>\n * <p><b>Ask.</b> With <code>ask</code>, the box is also where people ask the assistant\n * (ADR-030002): an <strong>Ask</strong> button and Ctrl+Enter (⌘Enter) fire <code>ask</code> with\n * the text, while Enter still searches. <code>ask-placeholder</code> replaces the placeholder, such\n * as \"Ask for something, or search apps and records\". With AI off for the page, the box is a plain\n * search: no button, the usual placeholder, and no <code>ask</code>.</p>\n *\n * @slot start - Leading content; replaces the search icon.\n * @slot end - Trailing content, after the clear button.\n *\n * @cssprop --search-container-shape - Border radius of the search bar. Defaults to full (pill shape).\n * @cssprop --search-container-color - Background color of the search container.\n * @cssprop --search-input-text-color - Color of the input text.\n * @cssprop --search-placeholder-color - Color of the placeholder text.\n * @cssprop --search-icon-color - Color of the leading and trailing icons.\n * @cssprop --search-outline-color - Border color for the outlined variant.\n * @cssprop --search-outline-width - Border width for the outlined variant.\n *\n * @fires {CustomEvent<{value: string}>} input - Dispatched when the search value changes.\n * @fires {CustomEvent<{value: string}>} change - Dispatched when the value is committed: on blur, Enter, or when it is cleared.\n * @fires {CustomEvent} clear - Dispatched when the value is cleared with the clear button or Escape.\n * @fires {CustomEvent<{value: string}>} search - Dispatched when the user submits the search (presses Enter).\n * @fires {CustomEvent<{value: string}>} ask - With `ask`: the person pressed Ask or Ctrl+Enter (⌘Enter) to ask the assistant.\n *\n * @example\n * ```html\n * <wc-search label=\"Search products\" placeholder=\"Search...\"></wc-search>\n * ```\n * @tags form\n */\n@IndividualComponent\nexport class Search extends BaseInput {\n // ── Static ───────────────────────────────────────────────────────────────\n\n static styles = [styles, colorStyles];\n\n // ── Properties ───────────────────────────────────────────────────────────\n\n /**\n * Visual style, as on fields: `default` (a filled container), `filled` or `outlined`.\n * `default` and `filled` look the same.\n */\n @property({ type: String, reflect: true })\n variant: 'default' | 'filled' | 'outlined' = 'default';\n\n /** Accessible name of the search box; the placeholder names it when it is empty. */\n @property({ type: String })\n label = '';\n\n /**\n * Placeholder text shown when the input is empty. Defaults to Peacock's \"Search\".\n */\n @property({ type: String })\n placeholder: string = '';\n\n /**\n * Current search value.\n */\n @property({ type: String })\n value: string = '';\n\n /**\n * Whether a clear button is shown when the input has a value. On by default; set\n * `clearable=\"false\"` to hide it.\n */\n @property({ converter: clearableConverter })\n clearable: boolean = true;\n\n /**\n * Size of the search bar.\n * Possible values: `\"sm\"`, `\"md\"`, `\"lg\"`. Defaults to `\"md\"`.\n */\n @property({ type: String, reflect: true })\n size: 'sm' | 'md' | 'lg' = 'md';\n\n /** Lets people ask the assistant from the box: an Ask button and Ctrl+Enter fire `ask`. */\n @property({ type: Boolean, reflect: true })\n ask = false;\n\n /** Placeholder while asking is offered, such as \"Ask for something, or search apps and records\". */\n @property({ type: String, attribute: 'ask-placeholder' })\n askPlaceholder = '';\n\n // ── State ────────────────────────────────────────────────────────────────\n\n @state()\n private focused: boolean = false;\n\n // ── Queries ──────────────────────────────────────────────────────────────\n\n @query('.search-input')\n private inputElement?: HTMLInputElement;\n\n // ── Private fields ───────────────────────────────────────────────────────\n\n /** Peacock's strings for the placeholder and clear button. */\n private readonly i18n = new I18nController(this);\n\n private readonly ai = new AiController(this);\n\n /** Whether Ask is offered now: `ask`, and AI on for the page. */\n private get __asking(): boolean {\n return this.ask && this.ai.available;\n }\n\n // ── Lifecycle ────────────────────────────────────────────────────────────\n\n constructor() {\n super();\n // Counts like a native search input when Enter decides whether to submit a form.\n registerTextField(this);\n }\n\n // ── Public methods ───────────────────────────────────────────────────────\n\n override focus() {\n this.inputElement?.focus();\n }\n\n override blur() {\n this.inputElement?.blur();\n }\n\n // ── Protected methods ────────────────────────────────────────────────────\n\n protected override computeValidity(): ControlValidity {\n return this.inputElement\n ? nativeValidity(this.inputElement)\n : super.computeValidity();\n }\n\n protected override validityAnchor() {\n return this.inputElement;\n }\n\n // ── Private methods ──────────────────────────────────────────────────────\n\n private __emit(type: 'input' | 'change' | 'search' | 'ask') {\n this.dispatchEvent(\n new CustomEvent(type, {\n detail: { value: this.value },\n bubbles: true,\n composed: true,\n }),\n );\n }\n\n private __handleInput(event: InputEvent) {\n const input = event.target as HTMLInputElement;\n this.value = input.value;\n // Prevent the native input event from escaping in addition to our API event.\n event.stopPropagation();\n this.__emit('input');\n }\n\n private __handleChange(event: Event) {\n const input = event.target as HTMLInputElement;\n this.value = input.value;\n // Prevent the native change event from escaping in addition to our API event.\n event.stopPropagation();\n this.__emit('change');\n }\n\n private __handleKeydown(event: KeyboardEvent) {\n if (event.key === 'Enter' && (event.ctrlKey || event.metaKey)) {\n if (this.__asking) {\n event.preventDefault();\n this.__ask();\n return;\n }\n }\n if (event.key === 'Enter') {\n this.__emit('search');\n }\n if (event.key === 'Escape' && this.value && !this.readonly) {\n // Only take Escape when there is something to clear; otherwise a dialog may want it.\n event.preventDefault();\n event.stopPropagation();\n this.__clearValue();\n }\n }\n\n private __handleFocusChange = (event: FocusEvent) => {\n this.focused = event.type === 'focus';\n };\n\n private __clearValue() {\n this.value = '';\n this.inputElement?.focus();\n this.dispatchEvent(\n new CustomEvent('clear', {\n bubbles: true,\n composed: true,\n }),\n );\n this.__emit('input');\n this.__emit('change');\n }\n\n private __ask() {\n if (!this.value.trim() || this.disabled) return;\n this.__emit('ask');\n }\n\n // ── Render helpers ───────────────────────────────────────────────────────\n\n private __renderAskButton() {\n if (!this.__asking) return nothing;\n return html`<button\n class=\"ask-button\"\n type=\"button\"\n aria-label=${this.i18n.t('searchAskLabel')}\n ?disabled=${this.disabled || !this.value.trim()}\n @click=${this.__ask}\n >\n ${sparkle}<span>${this.i18n.t('searchAsk')}</span>\n </button>`;\n }\n\n private __renderClearButton() {\n if (!this.clearable || !this.value || this.readonly) return nothing;\n\n return html`\n <button\n class=\"clear-button\"\n aria-label=${this.i18n.t('clearSearch')}\n tabindex=\"-1\"\n @click=${this.__clearValue}\n ?disabled=${this.disabled}\n >\n <wc-icon name=\"close\"></wc-icon>\n </button>\n `;\n }\n\n private __renderLeadingIcon() {\n return html`\n <div class=\"leading-icon\">\n <slot name=\"start\">\n <wc-icon name=\"search\"></wc-icon>\n </slot>\n </div>\n `;\n }\n\n // ── Render ───────────────────────────────────────────────────────────────\n\n override render() {\n // `default` keeps the filled look the search has always had.\n const variant = this.variant === 'outlined' ? 'outlined' : 'filled';\n const cssClasses = {\n search: true,\n [`variant-${variant}`]: true,\n [`size-${this.size}`]: true,\n focused: this.focused,\n disabled: this.disabled,\n 'has-value': !!this.value,\n };\n\n const placeholder =\n (this.__asking && this.askPlaceholder) ||\n this.placeholder ||\n this.i18n.t('search');\n\n return html`\n <div class=${classMap(cssClasses)} role=\"search\">\n <div class=\"background\"></div>\n <div class=\"outline\"></div>\n\n ${this.__renderLeadingIcon()}\n\n <input\n class=\"search-input\"\n type=\"search\"\n role=\"searchbox\"\n .value=${live(this.value)}\n placeholder=${placeholder}\n ?disabled=${this.disabled}\n ?readonly=${this.readonly}\n ?required=${this.required}\n aria-label=${this.label || placeholder}\n @input=${this.__handleInput}\n @change=${this.__handleChange}\n @keydown=${this.__handleKeydown}\n @focus=${this.__handleFocusChange}\n @blur=${this.__handleFocusChange}\n />\n\n <div class=\"trailing-actions\">\n ${this.__renderClearButton()}\n <slot name=\"end\"></slot>\n ${this.__renderAskButton()}\n </div>\n </div>\n `;\n }\n}\n"],"names":["nothing","html","classMap","live","styles","colorStyles","property","state","query"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgBA;AACA,MAAM,kBAAkB,GAAG;AACzB,IAAA,aAAa,EAAE,CAAC,KAAoB,KAAK,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,OAAO;AAC5E,IAAA,WAAW,EAAE,CAAC,KAAc,MAAM,KAAK,GAAG,EAAE,GAAG,OAAO,CAAC;CACxD;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+CG;AAEI,IAAM,MAAM,GAAZ,MAAM,MAAO,SAAQ,SAAS,CAAA;;AAsEnC,IAAA,IAAY,QAAQ,GAAA;QAClB,OAAO,IAAI,CAAC,GAAG,IAAI,IAAI,CAAC,EAAE,CAAC,SAAS;IACtC;;AAIA,IAAA,WAAA,GAAA;AACE,QAAA,KAAK,EAAE;;AAtET;;;AAGG;QAEH,IAAA,CAAA,OAAO,GAAsC,SAAS;;QAItD,IAAA,CAAA,KAAK,GAAG,EAAE;AAEV;;AAEG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A,MAAA,CAAA;AAKzB,UAAA,CAAA;IADPC,CAAK,CAAC,eAAe;AACkB,CAAA,EAAA,MAAA,CAAA,SAAA,EAAA,cAAA,EAAA,MAAA,CAAA;AA5D7B,MAAM,GAAA,UAAA,CAAA;IADlB;AACY,CAAA,EAAA,MAAM,CAyQlB;;;;"}
|
package/dist/select.js
CHANGED
|
@@ -7,21 +7,25 @@ import { g as getFormValue } from './form-associated-BHbg72PG.js';
|
|
|
7
7
|
import { s as spread } from './spread-B5cgadZl.js';
|
|
8
8
|
import { I as I18nController } from './i18n-controller-BTeChxE0.js';
|
|
9
9
|
import { p as peacockString } from './strings-DeiQWMd9.js';
|
|
10
|
-
import { B as BaseField } from './BaseField-
|
|
10
|
+
import { B as BaseField } from './BaseField-DOCmylob.js';
|
|
11
11
|
import { SelectOptionElement } from './option.js';
|
|
12
12
|
import './base-Cl6v8-BZ.js';
|
|
13
13
|
import './directive-ZPhl09Yt.js';
|
|
14
14
|
import './element-internals-QME0yEz4.js';
|
|
15
15
|
import './locale-DEsJZCQG.js';
|
|
16
|
+
import './implicit-submission-ChLdbxaR.js';
|
|
17
|
+
import './dispatch-hooks-J_godlHh.js';
|
|
18
|
+
import './form-submission-h40coUI8.js';
|
|
16
19
|
import './BaseInput-Cv03GZLu.js';
|
|
17
20
|
import './suggestion-controller-7YRQqkaI.js';
|
|
18
21
|
import './ai-controller-DR_Tg0sN.js';
|
|
19
22
|
import './menu-item.js';
|
|
20
23
|
import './if-defined-D9DEJR_6.js';
|
|
21
|
-
import './base-button-
|
|
22
|
-
import './
|
|
24
|
+
import './base-button-9tGu5RSC.js';
|
|
25
|
+
import './activation-gate-D4IpmwyD.js';
|
|
23
26
|
import './warn-once-BNxX1Y98.js';
|
|
24
27
|
import './hyperlink-DycWPKwU.js';
|
|
28
|
+
import './dispatch-event-utils-DfgqVBK8.js';
|
|
25
29
|
import './is-link-Dk2OV3PM.js';
|
|
26
30
|
|
|
27
31
|
var css_248z = i`* {
|
|
@@ -383,6 +387,10 @@ let Select = Select_1 = class Select extends BaseField {
|
|
|
383
387
|
}
|
|
384
388
|
}
|
|
385
389
|
// ── Protected ──────────────────────────────────────────────────────────────
|
|
390
|
+
/** Like a native select, it does not count for implicit submission. */
|
|
391
|
+
get singleLineTextField() {
|
|
392
|
+
return false;
|
|
393
|
+
}
|
|
386
394
|
valueMissingText() {
|
|
387
395
|
return peacockString('valueMissingSelect');
|
|
388
396
|
}
|
package/dist/select.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select.js","sources":["../../src/select/select.ts"],"sourcesContent":["import { html, nothing, type PropertyValues } from 'lit';\nimport { property, query, state } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport {\n type FormValue,\n getFormValue,\n} from '@/__internal/mixins/form-associated.js';\nimport IndividualComponent from '@/IndividualComponent.js';\nimport { spread } from '@/__internal/directive/spread.js';\nimport { I18nController } from '@/__internal/i18n/i18n-controller.js';\nimport {\n type PeacockStrings,\n peacockString,\n} from '@/__internal/i18n/strings.js';\nimport BaseField from '../input/BaseField.js';\nimport styles from './select.scss';\nimport type { Field } from '../field/field.js';\nimport type { Menu, MenuFocusTarget } from '../menu/menu/menu.js';\nimport { SelectOptionElement } from './option.js';\n\nexport interface SelectOption {\n label: string;\n value: string;\n icon?: string;\n}\n\n/** Space kept for the \"+N\" chip when the selected chips do not all fit. */\nconst OVERFLOW_CHIP_RESERVE_PX = 56;\n\n/**\n * @label Select\n * @tag wc-select\n * @rawTag select\n *\n * @summary A field that opens a list of options to pick one or several from, with optional search as you type.\n * @overview\n * <p>Select builds on <code>wc-field</code> and <code>wc-menu</code> to provide a fully-featured\n * dropdown picker.</p>\n * <ul>\n * <li>Single and multi-select modes; a multi-select shows a checkbox on every option.</li>\n * <li>Client-side typeahead with <code>search=\"contains\"</code>.</li>\n * <li>Server-side typeahead with <code>search=\"managed\"</code>: listen to <code>search</code>,\n * replace the options and set <code>loading</code> while they load; \"No results\" shows when the\n * search leaves no option.</li>\n * <li><code>allow-custom</code> keeps typed text that matches no option as the value, through a\n * \"Create …\" row (or Enter in the search input) that fires <code>create</code>.</li>\n * <li>Multi-select chips on one row, with a \"+N\" chip for the ones that do not fit.</li>\n * <li><code>clearable</code> adds a button that clears the value.</li>\n * <li>Form-associated: submits the value under <code>name</code> (one entry per value with\n * <code>multiple</code>).</li>\n * <li>Validates like a native select: <code>required</code> with nothing selected blocks form\n * submission, and the message shows under the field once a value is committed or the form is\n * submitted.</li>\n * <li>The options open in the top layer, so a select works inside a <code>wc-modal</code>.</li>\n * </ul>\n * <p>Options come from <code><wc-option></code> children or from the <code>options</code>\n * property; use one or the other. When both are given, both are shown: the options built from\n * <code>options</code> follow the children, and for a value present in both, the child (first in\n * order) gives the label.</p>\n * <p><strong>Keyboard:</strong> Enter, Space, Arrow Down or Arrow Up open the options and focus the\n * selected one. While closed, typing a letter selects the next option starting with it and Home or\n * End select the first or last option (single select, like a native select). In the list, the\n * arrows move, typing a letter jumps to the next option starting with it, Enter or Space picks,\n * Escape closes and returns focus to the field. With <code>search</code>, typing goes to the search\n * input; Arrow Down moves into the list and Enter picks the first match (with\n * <code>allow-custom</code>, the typed text unless an option's label matches it exactly).</p>\n *\n * @slot start - Leading content, such as an icon.\n * @slot end - Trailing content, before the dropdown arrow.\n *\n * @fires {CustomEvent<{value: string, values: string[]}>} change - Dispatched when the selection changes. `values` is set with `multiple`.\n * @fires {CustomEvent<{value: string}>} search - Dispatched as the user types when `search=\"managed\"`.\n * @fires {CustomEvent<{value: string}>} create - Dispatched when the person keeps typed text that matches no option (`allow-custom`). Cancel it to keep the value unchanged, for example to add the option yourself.\n *\n * @example\n * ```html\n * <wc-select label=\"Fruit\" placeholder=\"Pick a fruit...\">\n * <wc-option value=\"apple\">Apple</wc-option>\n * <wc-option value=\"banana\">Banana</wc-option>\n * </wc-select>\n * ```\n * @tags form\n */\n@IndividualComponent\nexport class Select extends BaseField {\n static styles = [styles];\n\n private readonly _menuId = `wc-select-menu-${Math.random().toString(36).slice(2, 9)}`;\n\n /** Peacock's strings for labels and empty states. */\n private readonly _i18n = new I18nController(this);\n\n /**\n * Array of options to display in the dropdown.\n * Setting this property creates matching `<wc-option>` children automatically, after any\n * `<wc-option>` children of your own. Give options one way or the other.\n */\n @property({ type: Array })\n options: SelectOption[] = [];\n\n /**\n * The selected value. For multi-select, a comma-separated list of values.\n */\n @property({ type: String })\n value: string = '';\n\n /**\n * Enable multi-select mode.\n */\n @property({ type: Boolean, reflect: true })\n multiple: boolean = false;\n\n /**\n * Enable typeahead search.\n * - `'contains'`: filters options client-side.\n * - `'managed'`: emits a `search` event for server-controlled filtering.\n */\n @property({ type: String })\n search: '' | 'contains' | 'managed' = '';\n\n /**\n * Lets typed text that matches no option become the value (or one of the values with\n * `multiple`). Turns on the search input (as `search=\"contains\"` when `search` is not set).\n * With `multiple`, custom values must not contain commas.\n */\n @property({ type: Boolean, attribute: 'allow-custom' })\n allowCustom = false;\n\n /** Shows a progress row in the options, for example while `search=\"managed\"` fetches them. */\n @property({ type: Boolean, reflect: true })\n loading = false;\n\n /** Overrides Peacock's strings for this instance only. */\n @property({ attribute: false }) strings?: Partial<PeacockStrings>;\n\n @state()\n private _open: boolean = false;\n\n @state()\n private _focused: boolean = false;\n\n @state()\n private _searchQuery: string = '';\n\n /** True when all options are filtered out by the current search query. */\n @state()\n private _noOptionsVisible: boolean = false;\n\n /** How many selected chips fit on the row; the rest collapse into a \"+N\" chip. */\n @state()\n private _visibleChipCount = Number.POSITIVE_INFINITY;\n\n @query('.select-trigger')\n private _triggerEl?: HTMLElement;\n\n @query('wc-field')\n private _fieldEl?: Field;\n\n @query('wc-menu')\n private _menu?: Menu;\n\n @query('.search-input')\n private _searchInputEl?: HTMLInputElement;\n\n @query('.chips-container')\n private _chipsContainer?: HTMLElement;\n\n private _chipsObserver?: ResizeObserver;\n\n private _chipsMeasureFrame = 0;\n\n /** Characters typed on the closed combobox, matched against option labels. */\n private _typeaheadBuffer = '';\n\n private _typeaheadTimer = 0;\n\n /** Whether the last render showed the \"Create …\" row, so the menu re-reads its items. */\n private _createShown = false;\n\n /**\n * The selected values, kept in sync with `value` (comma-separated). Use it with `multiple`;\n * for a single select it holds at most one value. The form gets one entry per value.\n */\n get values(): string[] {\n return this._selectedValues;\n }\n\n set values(next: string[]) {\n this.value = (this.multiple ? next : next.slice(0, 1)).join(',');\n }\n\n override focus() {\n this._triggerEl?.focus();\n }\n\n override blur() {\n this._triggerEl?.blur();\n }\n\n // ── Form association ──────────────────────────────────────────────────────\n\n override [getFormValue](): FormValue | null {\n if (!this.multiple) return this.value;\n // One entry per selected value, like a native <select multiple>.\n const data = new FormData();\n for (const value of this._selectedValues) data.append(this.name, value);\n return data;\n }\n\n // ── Lifecycle ─────────────────────────────────────────────────────────────\n\n override disconnectedCallback() {\n this._chipsObserver?.disconnect();\n this._chipsObserver = undefined;\n cancelAnimationFrame(this._chipsMeasureFrame);\n window.clearTimeout(this._typeaheadTimer);\n super.disconnectedCallback();\n }\n\n protected override willUpdate(changed: PropertyValues<this>) {\n super.willUpdate(changed);\n if (changed.has('value') || changed.has('multiple')) {\n this._visibleChipCount = Number.POSITIVE_INFINITY;\n }\n }\n\n protected override updated(changedProperties: PropertyValues<this>) {\n super.updated(changedProperties);\n if (changedProperties.has('options')) {\n this._syncProgrammaticOptions();\n }\n this._syncOptionStates();\n\n if (changedProperties.has('value') || changedProperties.has('multiple')) {\n this._observeChips();\n this._scheduleChipMeasure();\n }\n\n const createShown = this._showCreateOption;\n if (createShown !== this._createShown) {\n this._createShown = createShown;\n this.updateComplete.then(() => this._menu?.syncItems());\n }\n }\n\n // ── Protected ──────────────────────────────────────────────────────────────\n\n protected override valueMissingText(): string {\n return peacockString('valueMissingSelect');\n }\n\n protected override validityAnchor() {\n return this._triggerEl;\n }\n\n /** Clears the selection (every value of a multi-select) and fires `change`. */\n protected override clearValue() {\n if (!this.value) return;\n this.value = '';\n this._dispatchChange();\n }\n\n /** A multi-select also takes a suggestion as an array of values. */\n protected override writeSuggestionValue(value: unknown) {\n this.value = Array.isArray(value)\n ? value.map(String).join(',')\n : String(value ?? '');\n }\n\n /** The field event contract, plus `values` for a multi-select. */\n protected override emitValue(type: 'input' | 'change') {\n this.dispatchEvent(\n new CustomEvent(type, {\n detail: this.multiple\n ? { value: this.value, values: this._selectedValues }\n : { value: this.value },\n bubbles: true,\n composed: true,\n }),\n );\n }\n\n // ── Programmatic options ───────────────────────────────────────────────────\n\n /**\n * Reconciles the `options` property with auto-generated `<wc-option>` light-DOM\n * children (marked `data-generated`). Declarative children placed by the\n * consumer are left untouched.\n */\n private _syncProgrammaticOptions() {\n this.querySelectorAll('wc-option[data-generated]').forEach(el =>\n el.remove(),\n );\n for (const opt of this.options) {\n const el = new SelectOptionElement();\n el.value = opt.value;\n if (opt.icon) el.icon = opt.icon;\n el.textContent =\n opt.label || (opt.value === '' ? this._i18n.t('none') : opt.value);\n el.dataset.generated = '';\n this.appendChild(el);\n }\n }\n\n // ── Option state sync ──────────────────────────────────────────────────────\n\n private get _optionElements(): SelectOptionElement[] {\n return Array.from(this.querySelectorAll<SelectOptionElement>('wc-option'));\n }\n\n /**\n * Pushes `selected`, `multiple` and `filtered` state onto every `<wc-option>`\n * child element so each one can render itself correctly.\n */\n private _syncOptionStates() {\n const filtering =\n this._searchMode === 'contains' && this._searchQuery !== '';\n const searchText = this._searchQuery.toLowerCase();\n let visibleCount = 0;\n let filterChanged = false;\n\n const suggestedValues = this._suggestedValues;\n for (const opt of this._optionElements) {\n opt.selected = this._isSelected(opt.value);\n opt.multiple = this.multiple;\n opt.suggested = suggestedValues.includes(opt.value);\n const filtered =\n filtering &&\n !(opt.textContent?.trim().toLowerCase() ?? '').includes(searchText);\n if (opt.filtered !== filtered) {\n opt.filtered = filtered;\n filterChanged = true;\n }\n if (!filtered) visibleCount += 1;\n }\n\n this._noOptionsVisible = visibleCount === 0;\n if (filterChanged) {\n // Filtered options are hidden after their own update; then re-read the menu's items.\n Promise.all(this._optionElements.map(opt => opt.updateComplete)).then(\n () => this._menu?.syncItems(),\n );\n }\n }\n\n // ── Helpers ────────────────────────────────────────────────────────────────\n\n /** The values the assistant suggested, while the suggestion shows; marked in the list. */\n private get _suggestedValues(): string[] {\n if (!this.suggestionVisible) return [];\n const value = this.suggestion?.value;\n if (Array.isArray(value)) return value.map(String);\n const text = String(value ?? '');\n if (!this.multiple) return [text];\n return text\n .split(',')\n .map(v => v.trim())\n .filter(Boolean);\n }\n\n private get _selectedValues(): string[] {\n if (!this.value) return [];\n if (!this.multiple) return [this.value];\n return this.value\n .split(',')\n .map(v => v.trim())\n .filter(Boolean);\n }\n\n private _isSelected(value: string): boolean {\n if (value === '') {\n // An empty \"None\" option is only shown as chosen when no placeholder stands in for it.\n return !this.multiple && this.value === '' && !this.placeholder;\n }\n return this._selectedValues.includes(value);\n }\n\n /** Returns the display label for a given option value. */\n private _getLabelForValue(val: string): string {\n for (const opt of this._optionElements) {\n if (opt.value === val) {\n const label = opt.textContent?.trim();\n if (label) return label;\n return val === '' ? this._i18n.t('none') : val;\n }\n }\n // Fallback to options array (before wc-option children are created)\n const programmaticLabel = this.options.find(o => o.value === val)?.label;\n if (programmaticLabel) return programmaticLabel;\n return val === '' ? this._i18n.t('none') : val;\n }\n\n private get _displayLabel(): string {\n const firstValue = this._selectedValues[0];\n if (!firstValue) return '';\n return this._getLabelForValue(firstValue);\n }\n\n private get _isPopulated(): boolean {\n return !!this.value;\n }\n\n private get _isInteractive(): boolean {\n return !this.disabled && !this.readonly && !this.skeleton;\n }\n\n /** How the search input filters; `allow-custom` turns on `contains` when `search` is unset. */\n private get _searchMode(): '' | 'contains' | 'managed' {\n return this.search || (this.allowCustom ? 'contains' : '');\n }\n\n /** The enabled option whose label (or value) is the given text, ignoring case. */\n private _findOptionByText(text: string): SelectOptionElement | undefined {\n const wanted = text.trim().toLowerCase();\n if (!wanted) return undefined;\n return this._optionElements.find(\n opt =>\n !opt.disabled &&\n ((opt.textContent?.trim().toLowerCase() ?? '') === wanted ||\n opt.value.toLowerCase() === wanted),\n );\n }\n\n /** Whether to offer the \"Create …\" row: typed text that is no option and no chosen value. */\n private get _showCreateOption(): boolean {\n const text = this._searchQuery.trim();\n if (!this.allowCustom || !this._open || !text || this.loading) {\n return false;\n }\n if (this._findOptionByText(text)) return false;\n return !this._selectedValues.some(\n value => value.toLowerCase() === text.toLowerCase(),\n );\n }\n\n // ── Menu open/close ────────────────────────────────────────────────────────\n\n private _openMenu(focusTarget: MenuFocusTarget = 'active') {\n if (!this._isInteractive) return;\n const menu = this._menu;\n if (!menu) return;\n\n this._open = true;\n this._focused = true;\n this._searchQuery = '';\n\n // Anchor to the field's bordered box so the menu lines up with its edge\n // and is at least as wide as the field.\n const anchor = this._fieldEl?.fieldBodyElement ?? this._triggerEl ?? this;\n menu.anchorElement = anchor;\n menu.style.setProperty(\n '--menu-min-width',\n `${Math.ceil(anchor.getBoundingClientRect().width)}px`,\n );\n // With search, focus goes to the input; otherwise the menu focuses the selected option.\n menu.noAutofocus = this._searchMode !== '';\n menu.show(focusTarget);\n\n if (this._searchMode) {\n this.updateComplete.then(() => {\n this._searchInputEl?.focus();\n });\n }\n }\n\n private _closeMenu() {\n if (!this._open) return;\n this._open = false;\n this._focused = false;\n this._searchQuery = '';\n this._menu?.close();\n }\n\n // ── Event handlers ─────────────────────────────────────────────────────────\n\n private _toggleMenu() {\n if (this._open) {\n this._closeMenu();\n } else {\n this._openMenu();\n }\n }\n\n private _handleTriggerClick(event: MouseEvent) {\n event.stopPropagation();\n // Clicks inside the search input must not toggle the menu while the user types.\n if (event.target instanceof HTMLInputElement) {\n return;\n }\n this._toggleMenu();\n }\n\n private _handleFieldClick(event: MouseEvent) {\n const eventPath = event.composedPath();\n\n if (\n eventPath.includes(this._triggerEl as EventTarget) ||\n eventPath.some(\n target =>\n target instanceof HTMLInputElement ||\n (target instanceof HTMLElement && target.matches('wc-icon-button')),\n )\n ) {\n return;\n }\n\n this._toggleMenu();\n }\n\n private _handleTriggerKeyDown(event: KeyboardEvent) {\n if (event.target instanceof HTMLInputElement) {\n this._handleSearchKeyDown(event);\n return;\n }\n\n switch (event.key) {\n case 'Enter':\n case ' ':\n case 'ArrowDown':\n case 'ArrowUp':\n event.preventDefault();\n if (this._open) {\n this._menu?.focus(event.key === 'ArrowUp' ? 'last' : 'active');\n } else {\n this._openMenu();\n }\n break;\n case 'Escape':\n if (this._open) {\n event.preventDefault();\n this._closeMenu();\n }\n break;\n case 'Home':\n case 'End':\n if (!this._open && !this.multiple && this._isInteractive) {\n event.preventDefault();\n const options = this._selectableOptions;\n const target =\n event.key === 'Home' ? options[0] : options[options.length - 1];\n if (target) this._selectWhileClosed(target.value);\n }\n break;\n default:\n if (!this._open && this._isPrintableKey(event) && event.key !== ' ') {\n this._handleClosedTypeahead(event);\n }\n break;\n }\n }\n\n /** Options the keyboard can choose while the list is closed. */\n private get _selectableOptions(): SelectOptionElement[] {\n return this._optionElements.filter(opt => !opt.disabled && !opt.filtered);\n }\n\n private _isPrintableKey(event: KeyboardEvent): boolean {\n return (\n event.key.length === 1 &&\n !event.ctrlKey &&\n !event.metaKey &&\n !event.altKey\n );\n }\n\n /**\n * Typing on the closed combobox: with search, opens the list with the character in the search\n * input; a single select moves the selection to the next option starting with the typed text,\n * like a native select.\n */\n private _handleClosedTypeahead(event: KeyboardEvent) {\n if (!this._isInteractive) return;\n if (this._searchMode) {\n event.preventDefault();\n this._openMenu();\n this._setSearchQuery(event.key);\n this.updateComplete.then(() => {\n const input = this._searchInputEl;\n if (!input) return;\n input.focus();\n input.setSelectionRange(input.value.length, input.value.length);\n });\n return;\n }\n if (this.multiple) return;\n event.preventDefault();\n\n window.clearTimeout(this._typeaheadTimer);\n this._typeaheadTimer = window.setTimeout(() => {\n this._typeaheadBuffer = '';\n }, 500);\n\n const key = event.key.toLowerCase();\n const repeated =\n this._typeaheadBuffer.length > 0 &&\n [...this._typeaheadBuffer].every(char => char === key);\n this._typeaheadBuffer += key;\n // Typing the same letter again cycles through the options that start with it.\n const prefix = repeated ? key : this._typeaheadBuffer;\n\n const options = this._selectableOptions;\n const current = options.findIndex(opt => opt.value === this.value);\n const start = Math.max(current, 0);\n const firstOffset = prefix.length === 1 && current >= 0 ? 1 : 0;\n for (\n let step = firstOffset;\n step < options.length + firstOffset;\n step += 1\n ) {\n const option = options[(start + step) % options.length];\n if (option.typeaheadText.startsWith(prefix)) {\n this._selectWhileClosed(option.value);\n return;\n }\n }\n }\n\n /** Selects a value from the closed combobox and fires `change` when it differs. */\n private _selectWhileClosed(value: string) {\n if (value === this.value) return;\n this.value = value;\n this._dispatchChange();\n }\n\n /** Keys in the search input: arrows move into the list, Enter picks the first match. */\n private _handleSearchKeyDown(event: KeyboardEvent) {\n switch (event.key) {\n case 'Escape':\n event.preventDefault();\n this._closeMenu();\n this._triggerEl?.focus();\n break;\n case 'ArrowDown':\n case 'ArrowUp':\n event.preventDefault();\n this._menu?.focus(event.key === 'ArrowDown' ? 'first' : 'last');\n break;\n case 'Enter': {\n event.preventDefault();\n const text = this._searchQuery.trim();\n if (this.allowCustom && text) {\n // Free text: an option whose label is the text, else the text itself.\n const exact = this._findOptionByText(text);\n if (exact) {\n this._pick(exact.value);\n } else {\n this._create(text);\n }\n break;\n }\n const first = this._optionElements.find(\n opt => !opt.filtered && !opt.disabled,\n );\n if (first) this._pick(first.value);\n break;\n }\n case 'Tab':\n this._closeMenu();\n break;\n default:\n break;\n }\n }\n\n /** With search, typing while an option has focus goes back to the input. */\n private _handleMenuKeyDownCapture = {\n handleEvent: (event: KeyboardEvent) => {\n if (!this._searchMode || !this._open) return;\n if (!this._isPrintableKey(event) && event.key !== 'Backspace') return;\n if (event.key === ' ') return;\n // Stop the menu's own typeahead; the character lands in the input once it has focus.\n event.stopPropagation();\n this._searchInputEl?.focus();\n },\n capture: true,\n };\n\n /** The menu's `open`/`close` bubble and are composed; they are internal to the select. */\n private static _stopMenuEvent(event: Event) {\n event.stopPropagation();\n }\n\n /** The menu's `close` is internal too; when the list itself closes, reset the open state. */\n private _handleMenuClose(event: Event) {\n event.stopPropagation();\n // A sub-menu's `close` bubbles through the list; only the list's own counts.\n if (event.target !== event.currentTarget) return;\n this._open = false;\n this._focused = false;\n this._searchQuery = '';\n }\n\n private _handleMenuItemActivate(event: CustomEvent) {\n const item = event.detail?.item as\n | { value?: string; keepOpen?: boolean }\n | undefined;\n if (!item || item.value === undefined) return;\n event.stopPropagation();\n if (item instanceof Element && item.classList.contains('create-option')) {\n // A multi-select stays open after creating, as after picking.\n item.keepOpen = this.multiple;\n this._create(this._searchQuery);\n return;\n }\n this._pick(item.value);\n }\n\n /**\n * Keeps typed text as a value (`allow-custom`): fires a cancelable `create`, then picks the\n * text unless the consumer cancelled it.\n */\n private _create(text: string) {\n const value = text.trim();\n if (!value) return;\n const keep = this.dispatchEvent(\n new CustomEvent('create', {\n detail: { value },\n bubbles: true,\n composed: true,\n cancelable: true,\n }),\n );\n if (this.multiple) this._searchQuery = '';\n if (keep) {\n this._pick(value);\n } else if (!this.multiple) {\n this._closeMenu();\n this._triggerEl?.focus();\n }\n }\n\n /** Selects a value (toggles it for a multi-select) and fires `change`. */\n private _pick(val: string) {\n if (this.multiple) {\n if (val === '') return;\n const values = this._selectedValues;\n const idx = values.indexOf(val);\n if (idx >= 0) {\n values.splice(idx, 1);\n } else {\n values.push(val);\n }\n this.value = values.join(',');\n } else {\n this.value = val;\n this._closeMenu();\n this._triggerEl?.focus();\n }\n\n this._dispatchChange();\n }\n\n private _dispatchChange() {\n this.emitValue('change');\n }\n\n private _handleSearchInput(event: InputEvent) {\n // The native event escapes the shadow root; the search box is internal to the select.\n event.stopPropagation();\n this._setSearchQuery((event.target as HTMLInputElement).value);\n }\n\n /** Sets the search text; with `search=\"managed\"`, tells the consumer through `search`. */\n private _setSearchQuery(text: string) {\n this._searchQuery = text;\n if (this.search !== 'managed') return;\n this.dispatchEvent(\n new CustomEvent('search', {\n detail: { value: text },\n bubbles: true,\n composed: true,\n }),\n );\n }\n\n /** Options added or removed as children: update their state and the empty-state row. */\n private _handleSlotChange() {\n this._syncOptionStates();\n this._menu?.syncItems();\n }\n\n private _handleChipDismiss(event: CustomEvent, chipValue: string) {\n event.stopPropagation();\n const values = this._selectedValues.filter(v => v !== chipValue);\n this.value = values.join(',');\n this._dispatchChange();\n }\n\n // ── Chips overflow ─────────────────────────────────────────────────────────\n\n private _observeChips() {\n if (!this.multiple || typeof ResizeObserver === 'undefined') return;\n if (!this._chipsObserver) {\n this._chipsObserver = new ResizeObserver(() => {\n this._visibleChipCount = Number.POSITIVE_INFINITY;\n this._scheduleChipMeasure();\n });\n }\n this._chipsObserver.disconnect();\n if (this._triggerEl) this._chipsObserver.observe(this._triggerEl);\n }\n\n private _scheduleChipMeasure() {\n cancelAnimationFrame(this._chipsMeasureFrame);\n this._chipsMeasureFrame = requestAnimationFrame(() => {\n this.updateComplete.then(() => this._measureChips());\n });\n }\n\n /** Counts how many chips fit on one row, keeping room for the \"+N\" chip when some do not. */\n private _measureChips() {\n const container = this._chipsContainer;\n if (!container || !this.multiple) return;\n const chips = Array.from(\n container.querySelectorAll<HTMLElement>('wc-chip.value-chip'),\n );\n if (!chips.length) return;\n\n const available = container.clientWidth;\n const containerLeft = container.getBoundingClientRect().left;\n const rightEdge = (chip: HTMLElement) =>\n chip.getBoundingClientRect().right - containerLeft;\n\n if (rightEdge(chips[chips.length - 1]) <= available) {\n return;\n }\n\n let count = 0;\n for (const chip of chips) {\n if (rightEdge(chip) > available - OVERFLOW_CHIP_RESERVE_PX) break;\n count += 1;\n }\n this._visibleChipCount = Math.max(count, 1);\n }\n\n // ── Render helpers ─────────────────────────────────────────────────────────\n\n /** The row under the options: progress while `loading`, else the empty state. */\n private _renderStatusRow() {\n if (this.loading) {\n return html`<div class=\"loading-row\" role=\"status\">\n <wc-circular-progress\n class=\"loading-indicator\"\n indeterminate\n aria-hidden=\"true\"\n ></wc-circular-progress>\n <span>${this._i18n.t('loading')}</span>\n </div>`;\n }\n if (!this._noOptionsVisible) return nothing;\n const hasSearchQuery = this._searchQuery.trim().length > 0;\n return html`<div class=\"no-results\" role=\"presentation\">\n ${this._i18n.t(hasSearchQuery ? 'noResults' : 'noOptions')}\n </div>`;\n }\n\n /** The \"Create …\" row of `allow-custom`. */\n private _renderCreateOption() {\n if (!this._showCreateOption) return nothing;\n const text = this._searchQuery.trim();\n return html`<wc-option class=\"create-option\" icon=\"add\" .value=${text}\n >${this._i18n.t('createOption')(text)}</wc-option\n >`;\n }\n\n private _renderChips() {\n const values = this._selectedValues;\n const visible = values.slice(0, this._visibleChipCount);\n const hidden = values.length - visible.length;\n\n return html`<div class=\"chips-container\">\n ${visible.map(\n val => html`\n <wc-chip\n class=\"value-chip\"\n dismissible\n value=${val}\n ?disabled=${!this._isInteractive}\n @dismiss=${(e: CustomEvent) => this._handleChipDismiss(e, val)}\n >${this._getLabelForValue(val)}</wc-chip\n >\n `,\n )}\n ${hidden > 0\n ? html`<wc-chip\n class=\"overflow-chip\"\n title=${values\n .slice(visible.length)\n .map(val => this._getLabelForValue(val))\n .join(', ')}\n >${new Intl.NumberFormat(this._i18n.locale, {\n signDisplay: 'always',\n }).format(hidden)}</wc-chip\n >`\n : nothing}\n </div>`;\n }\n\n private _renderTriggerContent() {\n // Typeahead: when open, show a text input for filtering\n if (this._searchMode && this._open) {\n return html`<input\n class=\"search-input\"\n .value=${this._searchQuery}\n placeholder=${this._displayLabel || this.placeholder}\n aria-label=${this.label ||\n this.placeholder ||\n this._i18n.t('searchOptions')}\n aria-controls=${this._menuId}\n aria-autocomplete=\"list\"\n @input=${this._handleSearchInput}\n />`;\n }\n\n // Multi-select: show chips for selected items\n if (this.multiple && this._selectedValues.length > 0) {\n return this._renderChips();\n }\n\n // Single select: show selected label or placeholder\n const label = this._displayLabel;\n if (!label) {\n return html`<span class=\"placeholder\">${this.placeholder}</span>`;\n }\n return html`<span class=\"display-value\">${label}</span>`;\n }\n\n private _renderFieldEnd() {\n return html`<div slot=\"field-end\" class=\"field-end-wrapper\">\n <wc-icon\n class=${classMap({\n 'dropdown-icon': true,\n 'dropdown-icon--open': this._open,\n })}\n name=\"arrow_drop_down\"\n aria-hidden=\"true\"\n ></wc-icon>\n </div>`;\n }\n\n private _renderTrigger() {\n const { 'aria-label': name, tabindex, ...aria } = this.fieldAria();\n return html`<div\n class=\"select-trigger\"\n role=\"combobox\"\n tabindex=${this.disabled ? '-1' : (tabindex ?? '0')}\n aria-label=${name || this.placeholder || this._i18n.t('selectOption')}\n aria-controls=${this._menuId}\n aria-expanded=${String(this._open)}\n aria-haspopup=\"listbox\"\n aria-required=${this.required ? 'true' : nothing}\n aria-disabled=${this.disabled ? 'true' : nothing}\n aria-readonly=${this.readonly ? 'true' : nothing}\n @click=${this._handleTriggerClick}\n @keydown=${this._handleTriggerKeyDown}\n ${spread(aria)}\n >\n ${this._renderTriggerContent()}\n </div>`;\n }\n\n render() {\n // The wrapper takes clicks anywhere on the field, so they open the options; keys are handled\n // on the combobox.\n /* eslint-disable lit-a11y/click-events-have-key-events */\n return html`\n <div class=\"select-field\" @click=${this._handleFieldClick}>\n ${this.renderField(this._renderTrigger(), {\n populated: this._isPopulated,\n focused: this._focused,\n end: this._renderFieldEnd(),\n })}\n </div>\n\n <wc-menu\n id=${this._menuId}\n role=\"listbox\"\n placement=\"bottom-start\"\n aria-label=${this.label || this._i18n.t('options')}\n aria-multiselectable=${this.multiple ? 'true' : nothing}\n aria-busy=${this.loading ? 'true' : nothing}\n @open=${Select._stopMenuEvent}\n @close=${this._handleMenuClose}\n @menu-item-activate=${this._handleMenuItemActivate}\n @keydown=${this._handleMenuKeyDownCapture}\n >\n <slot @slotchange=${this._handleSlotChange}></slot>\n ${this._renderCreateOption()} ${this._renderStatusRow()}\n </wc-menu>\n `;\n /* eslint-enable lit-a11y/click-events-have-key-events */\n }\n}\n"],"names":["html","nothing","classMap","styles","property","state","query"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AA,CAAA;IADPC,CAAK,CAAC,iBAAiB;AACS,CAAA,EAAA,MAAA,CAAA,SAAA,EAAA,YAAA,EAAA,MAAA,CAAA;AAGzB,UAAA,CAAA;IADPA,CAAK,CAAC,UAAU;AACQ,CAAA,EAAA,MAAA,CAAA,SAAA,EAAA,UAAA,EAAA,MAAA,CAAA;AAGjB,UAAA,CAAA;IADPA,CAAK,CAAC,SAAS;AACK,CAAA,EAAA,MAAA,CAAA,SAAA,EAAA,OAAA,EAAA,MAAA,CAAA;AAGb,UAAA,CAAA;IADPA,CAAK,CAAC,eAAe;AACoB,CAAA,EAAA,MAAA,CAAA,SAAA,EAAA,gBAAA,EAAA,MAAA,CAAA;AAGlC,UAAA,CAAA;IADPA,CAAK,CAAC,kBAAkB;AACa,CAAA,EAAA,MAAA,CAAA,SAAA,EAAA,iBAAA,EAAA,MAAA,CAAA;AAjF3B,MAAM,GAAA,QAAA,GAAA,UAAA,CAAA;IADlB;AACY,CAAA,EAAA,MAAM,CA44BlB;;;;"}
|
|
1
|
+
{"version":3,"file":"select.js","sources":["../../src/select/select.ts"],"sourcesContent":["import { html, nothing, type PropertyValues } from 'lit';\nimport { property, query, state } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport {\n type FormValue,\n getFormValue,\n} from '@/__internal/mixins/form-associated.js';\nimport IndividualComponent from '@/IndividualComponent.js';\nimport { spread } from '@/__internal/directive/spread.js';\nimport { I18nController } from '@/__internal/i18n/i18n-controller.js';\nimport {\n type PeacockStrings,\n peacockString,\n} from '@/__internal/i18n/strings.js';\nimport BaseField from '../input/BaseField.js';\nimport styles from './select.scss';\nimport type { Field } from '../field/field.js';\nimport type { Menu, MenuFocusTarget } from '../menu/menu/menu.js';\nimport { SelectOptionElement } from './option.js';\n\nexport interface SelectOption {\n label: string;\n value: string;\n icon?: string;\n}\n\n/** Space kept for the \"+N\" chip when the selected chips do not all fit. */\nconst OVERFLOW_CHIP_RESERVE_PX = 56;\n\n/**\n * @label Select\n * @tag wc-select\n * @rawTag select\n *\n * @summary A field that opens a list of options to pick one or several from, with optional search as you type.\n * @overview\n * <p>Select builds on <code>wc-field</code> and <code>wc-menu</code> to provide a fully-featured\n * dropdown picker.</p>\n * <ul>\n * <li>Single and multi-select modes; a multi-select shows a checkbox on every option.</li>\n * <li>Client-side typeahead with <code>search=\"contains\"</code>.</li>\n * <li>Server-side typeahead with <code>search=\"managed\"</code>: listen to <code>search</code>,\n * replace the options and set <code>loading</code> while they load; \"No results\" shows when the\n * search leaves no option.</li>\n * <li><code>allow-custom</code> keeps typed text that matches no option as the value, through a\n * \"Create …\" row (or Enter in the search input) that fires <code>create</code>.</li>\n * <li>Multi-select chips on one row, with a \"+N\" chip for the ones that do not fit.</li>\n * <li><code>clearable</code> adds a button that clears the value.</li>\n * <li>Form-associated: submits the value under <code>name</code> (one entry per value with\n * <code>multiple</code>).</li>\n * <li>Validates like a native select: <code>required</code> with nothing selected blocks form\n * submission, and the message shows under the field once a value is committed or the form is\n * submitted.</li>\n * <li>The options open in the top layer, so a select works inside a <code>wc-modal</code>.</li>\n * </ul>\n * <p>Options come from <code><wc-option></code> children or from the <code>options</code>\n * property; use one or the other. When both are given, both are shown: the options built from\n * <code>options</code> follow the children, and for a value present in both, the child (first in\n * order) gives the label.</p>\n * <p><strong>Keyboard:</strong> Enter, Space, Arrow Down or Arrow Up open the options and focus the\n * selected one. While closed, typing a letter selects the next option starting with it and Home or\n * End select the first or last option (single select, like a native select). In the list, the\n * arrows move, typing a letter jumps to the next option starting with it, Enter or Space picks,\n * Escape closes and returns focus to the field. With <code>search</code>, typing goes to the search\n * input; Arrow Down moves into the list and Enter picks the first match (with\n * <code>allow-custom</code>, the typed text unless an option's label matches it exactly).</p>\n *\n * @slot start - Leading content, such as an icon.\n * @slot end - Trailing content, before the dropdown arrow.\n *\n * @fires {CustomEvent<{value: string, values: string[]}>} change - Dispatched when the selection changes. `values` is set with `multiple`.\n * @fires {CustomEvent<{value: string}>} search - Dispatched as the user types when `search=\"managed\"`.\n * @fires {CustomEvent<{value: string}>} create - Dispatched when the person keeps typed text that matches no option (`allow-custom`). Cancel it to keep the value unchanged, for example to add the option yourself.\n *\n * @example\n * ```html\n * <wc-select label=\"Fruit\" placeholder=\"Pick a fruit...\">\n * <wc-option value=\"apple\">Apple</wc-option>\n * <wc-option value=\"banana\">Banana</wc-option>\n * </wc-select>\n * ```\n * @tags form\n */\n@IndividualComponent\nexport class Select extends BaseField {\n static styles = [styles];\n\n private readonly _menuId = `wc-select-menu-${Math.random().toString(36).slice(2, 9)}`;\n\n /** Peacock's strings for labels and empty states. */\n private readonly _i18n = new I18nController(this);\n\n /**\n * Array of options to display in the dropdown.\n * Setting this property creates matching `<wc-option>` children automatically, after any\n * `<wc-option>` children of your own. Give options one way or the other.\n */\n @property({ type: Array })\n options: SelectOption[] = [];\n\n /**\n * The selected value. For multi-select, a comma-separated list of values.\n */\n @property({ type: String })\n value: string = '';\n\n /**\n * Enable multi-select mode.\n */\n @property({ type: Boolean, reflect: true })\n multiple: boolean = false;\n\n /**\n * Enable typeahead search.\n * - `'contains'`: filters options client-side.\n * - `'managed'`: emits a `search` event for server-controlled filtering.\n */\n @property({ type: String })\n search: '' | 'contains' | 'managed' = '';\n\n /**\n * Lets typed text that matches no option become the value (or one of the values with\n * `multiple`). Turns on the search input (as `search=\"contains\"` when `search` is not set).\n * With `multiple`, custom values must not contain commas.\n */\n @property({ type: Boolean, attribute: 'allow-custom' })\n allowCustom = false;\n\n /** Shows a progress row in the options, for example while `search=\"managed\"` fetches them. */\n @property({ type: Boolean, reflect: true })\n loading = false;\n\n /** Overrides Peacock's strings for this instance only. */\n @property({ attribute: false }) strings?: Partial<PeacockStrings>;\n\n @state()\n private _open: boolean = false;\n\n @state()\n private _focused: boolean = false;\n\n @state()\n private _searchQuery: string = '';\n\n /** True when all options are filtered out by the current search query. */\n @state()\n private _noOptionsVisible: boolean = false;\n\n /** How many selected chips fit on the row; the rest collapse into a \"+N\" chip. */\n @state()\n private _visibleChipCount = Number.POSITIVE_INFINITY;\n\n @query('.select-trigger')\n private _triggerEl?: HTMLElement;\n\n @query('wc-field')\n private _fieldEl?: Field;\n\n @query('wc-menu')\n private _menu?: Menu;\n\n @query('.search-input')\n private _searchInputEl?: HTMLInputElement;\n\n @query('.chips-container')\n private _chipsContainer?: HTMLElement;\n\n private _chipsObserver?: ResizeObserver;\n\n private _chipsMeasureFrame = 0;\n\n /** Characters typed on the closed combobox, matched against option labels. */\n private _typeaheadBuffer = '';\n\n private _typeaheadTimer = 0;\n\n /** Whether the last render showed the \"Create …\" row, so the menu re-reads its items. */\n private _createShown = false;\n\n /**\n * The selected values, kept in sync with `value` (comma-separated). Use it with `multiple`;\n * for a single select it holds at most one value. The form gets one entry per value.\n */\n get values(): string[] {\n return this._selectedValues;\n }\n\n set values(next: string[]) {\n this.value = (this.multiple ? next : next.slice(0, 1)).join(',');\n }\n\n override focus() {\n this._triggerEl?.focus();\n }\n\n override blur() {\n this._triggerEl?.blur();\n }\n\n // ── Form association ──────────────────────────────────────────────────────\n\n override [getFormValue](): FormValue | null {\n if (!this.multiple) return this.value;\n // One entry per selected value, like a native <select multiple>.\n const data = new FormData();\n for (const value of this._selectedValues) data.append(this.name, value);\n return data;\n }\n\n // ── Lifecycle ─────────────────────────────────────────────────────────────\n\n override disconnectedCallback() {\n this._chipsObserver?.disconnect();\n this._chipsObserver = undefined;\n cancelAnimationFrame(this._chipsMeasureFrame);\n window.clearTimeout(this._typeaheadTimer);\n super.disconnectedCallback();\n }\n\n protected override willUpdate(changed: PropertyValues<this>) {\n super.willUpdate(changed);\n if (changed.has('value') || changed.has('multiple')) {\n this._visibleChipCount = Number.POSITIVE_INFINITY;\n }\n }\n\n protected override updated(changedProperties: PropertyValues<this>) {\n super.updated(changedProperties);\n if (changedProperties.has('options')) {\n this._syncProgrammaticOptions();\n }\n this._syncOptionStates();\n\n if (changedProperties.has('value') || changedProperties.has('multiple')) {\n this._observeChips();\n this._scheduleChipMeasure();\n }\n\n const createShown = this._showCreateOption;\n if (createShown !== this._createShown) {\n this._createShown = createShown;\n this.updateComplete.then(() => this._menu?.syncItems());\n }\n }\n\n // ── Protected ──────────────────────────────────────────────────────────────\n\n /** Like a native select, it does not count for implicit submission. */\n protected override get singleLineTextField(): boolean {\n return false;\n }\n\n protected override valueMissingText(): string {\n return peacockString('valueMissingSelect');\n }\n\n protected override validityAnchor() {\n return this._triggerEl;\n }\n\n /** Clears the selection (every value of a multi-select) and fires `change`. */\n protected override clearValue() {\n if (!this.value) return;\n this.value = '';\n this._dispatchChange();\n }\n\n /** A multi-select also takes a suggestion as an array of values. */\n protected override writeSuggestionValue(value: unknown) {\n this.value = Array.isArray(value)\n ? value.map(String).join(',')\n : String(value ?? '');\n }\n\n /** The field event contract, plus `values` for a multi-select. */\n protected override emitValue(type: 'input' | 'change') {\n this.dispatchEvent(\n new CustomEvent(type, {\n detail: this.multiple\n ? { value: this.value, values: this._selectedValues }\n : { value: this.value },\n bubbles: true,\n composed: true,\n }),\n );\n }\n\n // ── Programmatic options ───────────────────────────────────────────────────\n\n /**\n * Reconciles the `options` property with auto-generated `<wc-option>` light-DOM\n * children (marked `data-generated`). Declarative children placed by the\n * consumer are left untouched.\n */\n private _syncProgrammaticOptions() {\n this.querySelectorAll('wc-option[data-generated]').forEach(el =>\n el.remove(),\n );\n for (const opt of this.options) {\n const el = new SelectOptionElement();\n el.value = opt.value;\n if (opt.icon) el.icon = opt.icon;\n el.textContent =\n opt.label || (opt.value === '' ? this._i18n.t('none') : opt.value);\n el.dataset.generated = '';\n this.appendChild(el);\n }\n }\n\n // ── Option state sync ──────────────────────────────────────────────────────\n\n private get _optionElements(): SelectOptionElement[] {\n return Array.from(this.querySelectorAll<SelectOptionElement>('wc-option'));\n }\n\n /**\n * Pushes `selected`, `multiple` and `filtered` state onto every `<wc-option>`\n * child element so each one can render itself correctly.\n */\n private _syncOptionStates() {\n const filtering =\n this._searchMode === 'contains' && this._searchQuery !== '';\n const searchText = this._searchQuery.toLowerCase();\n let visibleCount = 0;\n let filterChanged = false;\n\n const suggestedValues = this._suggestedValues;\n for (const opt of this._optionElements) {\n opt.selected = this._isSelected(opt.value);\n opt.multiple = this.multiple;\n opt.suggested = suggestedValues.includes(opt.value);\n const filtered =\n filtering &&\n !(opt.textContent?.trim().toLowerCase() ?? '').includes(searchText);\n if (opt.filtered !== filtered) {\n opt.filtered = filtered;\n filterChanged = true;\n }\n if (!filtered) visibleCount += 1;\n }\n\n this._noOptionsVisible = visibleCount === 0;\n if (filterChanged) {\n // Filtered options are hidden after their own update; then re-read the menu's items.\n Promise.all(this._optionElements.map(opt => opt.updateComplete)).then(\n () => this._menu?.syncItems(),\n );\n }\n }\n\n // ── Helpers ────────────────────────────────────────────────────────────────\n\n /** The values the assistant suggested, while the suggestion shows; marked in the list. */\n private get _suggestedValues(): string[] {\n if (!this.suggestionVisible) return [];\n const value = this.suggestion?.value;\n if (Array.isArray(value)) return value.map(String);\n const text = String(value ?? '');\n if (!this.multiple) return [text];\n return text\n .split(',')\n .map(v => v.trim())\n .filter(Boolean);\n }\n\n private get _selectedValues(): string[] {\n if (!this.value) return [];\n if (!this.multiple) return [this.value];\n return this.value\n .split(',')\n .map(v => v.trim())\n .filter(Boolean);\n }\n\n private _isSelected(value: string): boolean {\n if (value === '') {\n // An empty \"None\" option is only shown as chosen when no placeholder stands in for it.\n return !this.multiple && this.value === '' && !this.placeholder;\n }\n return this._selectedValues.includes(value);\n }\n\n /** Returns the display label for a given option value. */\n private _getLabelForValue(val: string): string {\n for (const opt of this._optionElements) {\n if (opt.value === val) {\n const label = opt.textContent?.trim();\n if (label) return label;\n return val === '' ? this._i18n.t('none') : val;\n }\n }\n // Fallback to options array (before wc-option children are created)\n const programmaticLabel = this.options.find(o => o.value === val)?.label;\n if (programmaticLabel) return programmaticLabel;\n return val === '' ? this._i18n.t('none') : val;\n }\n\n private get _displayLabel(): string {\n const firstValue = this._selectedValues[0];\n if (!firstValue) return '';\n return this._getLabelForValue(firstValue);\n }\n\n private get _isPopulated(): boolean {\n return !!this.value;\n }\n\n private get _isInteractive(): boolean {\n return !this.disabled && !this.readonly && !this.skeleton;\n }\n\n /** How the search input filters; `allow-custom` turns on `contains` when `search` is unset. */\n private get _searchMode(): '' | 'contains' | 'managed' {\n return this.search || (this.allowCustom ? 'contains' : '');\n }\n\n /** The enabled option whose label (or value) is the given text, ignoring case. */\n private _findOptionByText(text: string): SelectOptionElement | undefined {\n const wanted = text.trim().toLowerCase();\n if (!wanted) return undefined;\n return this._optionElements.find(\n opt =>\n !opt.disabled &&\n ((opt.textContent?.trim().toLowerCase() ?? '') === wanted ||\n opt.value.toLowerCase() === wanted),\n );\n }\n\n /** Whether to offer the \"Create …\" row: typed text that is no option and no chosen value. */\n private get _showCreateOption(): boolean {\n const text = this._searchQuery.trim();\n if (!this.allowCustom || !this._open || !text || this.loading) {\n return false;\n }\n if (this._findOptionByText(text)) return false;\n return !this._selectedValues.some(\n value => value.toLowerCase() === text.toLowerCase(),\n );\n }\n\n // ── Menu open/close ────────────────────────────────────────────────────────\n\n private _openMenu(focusTarget: MenuFocusTarget = 'active') {\n if (!this._isInteractive) return;\n const menu = this._menu;\n if (!menu) return;\n\n this._open = true;\n this._focused = true;\n this._searchQuery = '';\n\n // Anchor to the field's bordered box so the menu lines up with its edge\n // and is at least as wide as the field.\n const anchor = this._fieldEl?.fieldBodyElement ?? this._triggerEl ?? this;\n menu.anchorElement = anchor;\n menu.style.setProperty(\n '--menu-min-width',\n `${Math.ceil(anchor.getBoundingClientRect().width)}px`,\n );\n // With search, focus goes to the input; otherwise the menu focuses the selected option.\n menu.noAutofocus = this._searchMode !== '';\n menu.show(focusTarget);\n\n if (this._searchMode) {\n this.updateComplete.then(() => {\n this._searchInputEl?.focus();\n });\n }\n }\n\n private _closeMenu() {\n if (!this._open) return;\n this._open = false;\n this._focused = false;\n this._searchQuery = '';\n this._menu?.close();\n }\n\n // ── Event handlers ─────────────────────────────────────────────────────────\n\n private _toggleMenu() {\n if (this._open) {\n this._closeMenu();\n } else {\n this._openMenu();\n }\n }\n\n private _handleTriggerClick(event: MouseEvent) {\n event.stopPropagation();\n // Clicks inside the search input must not toggle the menu while the user types.\n if (event.target instanceof HTMLInputElement) {\n return;\n }\n this._toggleMenu();\n }\n\n private _handleFieldClick(event: MouseEvent) {\n const eventPath = event.composedPath();\n\n if (\n eventPath.includes(this._triggerEl as EventTarget) ||\n eventPath.some(\n target =>\n target instanceof HTMLInputElement ||\n (target instanceof HTMLElement && target.matches('wc-icon-button')),\n )\n ) {\n return;\n }\n\n this._toggleMenu();\n }\n\n private _handleTriggerKeyDown(event: KeyboardEvent) {\n if (event.target instanceof HTMLInputElement) {\n this._handleSearchKeyDown(event);\n return;\n }\n\n switch (event.key) {\n case 'Enter':\n case ' ':\n case 'ArrowDown':\n case 'ArrowUp':\n event.preventDefault();\n if (this._open) {\n this._menu?.focus(event.key === 'ArrowUp' ? 'last' : 'active');\n } else {\n this._openMenu();\n }\n break;\n case 'Escape':\n if (this._open) {\n event.preventDefault();\n this._closeMenu();\n }\n break;\n case 'Home':\n case 'End':\n if (!this._open && !this.multiple && this._isInteractive) {\n event.preventDefault();\n const options = this._selectableOptions;\n const target =\n event.key === 'Home' ? options[0] : options[options.length - 1];\n if (target) this._selectWhileClosed(target.value);\n }\n break;\n default:\n if (!this._open && this._isPrintableKey(event) && event.key !== ' ') {\n this._handleClosedTypeahead(event);\n }\n break;\n }\n }\n\n /** Options the keyboard can choose while the list is closed. */\n private get _selectableOptions(): SelectOptionElement[] {\n return this._optionElements.filter(opt => !opt.disabled && !opt.filtered);\n }\n\n private _isPrintableKey(event: KeyboardEvent): boolean {\n return (\n event.key.length === 1 &&\n !event.ctrlKey &&\n !event.metaKey &&\n !event.altKey\n );\n }\n\n /**\n * Typing on the closed combobox: with search, opens the list with the character in the search\n * input; a single select moves the selection to the next option starting with the typed text,\n * like a native select.\n */\n private _handleClosedTypeahead(event: KeyboardEvent) {\n if (!this._isInteractive) return;\n if (this._searchMode) {\n event.preventDefault();\n this._openMenu();\n this._setSearchQuery(event.key);\n this.updateComplete.then(() => {\n const input = this._searchInputEl;\n if (!input) return;\n input.focus();\n input.setSelectionRange(input.value.length, input.value.length);\n });\n return;\n }\n if (this.multiple) return;\n event.preventDefault();\n\n window.clearTimeout(this._typeaheadTimer);\n this._typeaheadTimer = window.setTimeout(() => {\n this._typeaheadBuffer = '';\n }, 500);\n\n const key = event.key.toLowerCase();\n const repeated =\n this._typeaheadBuffer.length > 0 &&\n [...this._typeaheadBuffer].every(char => char === key);\n this._typeaheadBuffer += key;\n // Typing the same letter again cycles through the options that start with it.\n const prefix = repeated ? key : this._typeaheadBuffer;\n\n const options = this._selectableOptions;\n const current = options.findIndex(opt => opt.value === this.value);\n const start = Math.max(current, 0);\n const firstOffset = prefix.length === 1 && current >= 0 ? 1 : 0;\n for (\n let step = firstOffset;\n step < options.length + firstOffset;\n step += 1\n ) {\n const option = options[(start + step) % options.length];\n if (option.typeaheadText.startsWith(prefix)) {\n this._selectWhileClosed(option.value);\n return;\n }\n }\n }\n\n /** Selects a value from the closed combobox and fires `change` when it differs. */\n private _selectWhileClosed(value: string) {\n if (value === this.value) return;\n this.value = value;\n this._dispatchChange();\n }\n\n /** Keys in the search input: arrows move into the list, Enter picks the first match. */\n private _handleSearchKeyDown(event: KeyboardEvent) {\n switch (event.key) {\n case 'Escape':\n event.preventDefault();\n this._closeMenu();\n this._triggerEl?.focus();\n break;\n case 'ArrowDown':\n case 'ArrowUp':\n event.preventDefault();\n this._menu?.focus(event.key === 'ArrowDown' ? 'first' : 'last');\n break;\n case 'Enter': {\n event.preventDefault();\n const text = this._searchQuery.trim();\n if (this.allowCustom && text) {\n // Free text: an option whose label is the text, else the text itself.\n const exact = this._findOptionByText(text);\n if (exact) {\n this._pick(exact.value);\n } else {\n this._create(text);\n }\n break;\n }\n const first = this._optionElements.find(\n opt => !opt.filtered && !opt.disabled,\n );\n if (first) this._pick(first.value);\n break;\n }\n case 'Tab':\n this._closeMenu();\n break;\n default:\n break;\n }\n }\n\n /** With search, typing while an option has focus goes back to the input. */\n private _handleMenuKeyDownCapture = {\n handleEvent: (event: KeyboardEvent) => {\n if (!this._searchMode || !this._open) return;\n if (!this._isPrintableKey(event) && event.key !== 'Backspace') return;\n if (event.key === ' ') return;\n // Stop the menu's own typeahead; the character lands in the input once it has focus.\n event.stopPropagation();\n this._searchInputEl?.focus();\n },\n capture: true,\n };\n\n /** The menu's `open`/`close` bubble and are composed; they are internal to the select. */\n private static _stopMenuEvent(event: Event) {\n event.stopPropagation();\n }\n\n /** The menu's `close` is internal too; when the list itself closes, reset the open state. */\n private _handleMenuClose(event: Event) {\n event.stopPropagation();\n // A sub-menu's `close` bubbles through the list; only the list's own counts.\n if (event.target !== event.currentTarget) return;\n this._open = false;\n this._focused = false;\n this._searchQuery = '';\n }\n\n private _handleMenuItemActivate(event: CustomEvent) {\n const item = event.detail?.item as\n | { value?: string; keepOpen?: boolean }\n | undefined;\n if (!item || item.value === undefined) return;\n event.stopPropagation();\n if (item instanceof Element && item.classList.contains('create-option')) {\n // A multi-select stays open after creating, as after picking.\n item.keepOpen = this.multiple;\n this._create(this._searchQuery);\n return;\n }\n this._pick(item.value);\n }\n\n /**\n * Keeps typed text as a value (`allow-custom`): fires a cancelable `create`, then picks the\n * text unless the consumer cancelled it.\n */\n private _create(text: string) {\n const value = text.trim();\n if (!value) return;\n const keep = this.dispatchEvent(\n new CustomEvent('create', {\n detail: { value },\n bubbles: true,\n composed: true,\n cancelable: true,\n }),\n );\n if (this.multiple) this._searchQuery = '';\n if (keep) {\n this._pick(value);\n } else if (!this.multiple) {\n this._closeMenu();\n this._triggerEl?.focus();\n }\n }\n\n /** Selects a value (toggles it for a multi-select) and fires `change`. */\n private _pick(val: string) {\n if (this.multiple) {\n if (val === '') return;\n const values = this._selectedValues;\n const idx = values.indexOf(val);\n if (idx >= 0) {\n values.splice(idx, 1);\n } else {\n values.push(val);\n }\n this.value = values.join(',');\n } else {\n this.value = val;\n this._closeMenu();\n this._triggerEl?.focus();\n }\n\n this._dispatchChange();\n }\n\n private _dispatchChange() {\n this.emitValue('change');\n }\n\n private _handleSearchInput(event: InputEvent) {\n // The native event escapes the shadow root; the search box is internal to the select.\n event.stopPropagation();\n this._setSearchQuery((event.target as HTMLInputElement).value);\n }\n\n /** Sets the search text; with `search=\"managed\"`, tells the consumer through `search`. */\n private _setSearchQuery(text: string) {\n this._searchQuery = text;\n if (this.search !== 'managed') return;\n this.dispatchEvent(\n new CustomEvent('search', {\n detail: { value: text },\n bubbles: true,\n composed: true,\n }),\n );\n }\n\n /** Options added or removed as children: update their state and the empty-state row. */\n private _handleSlotChange() {\n this._syncOptionStates();\n this._menu?.syncItems();\n }\n\n private _handleChipDismiss(event: CustomEvent, chipValue: string) {\n event.stopPropagation();\n const values = this._selectedValues.filter(v => v !== chipValue);\n this.value = values.join(',');\n this._dispatchChange();\n }\n\n // ── Chips overflow ─────────────────────────────────────────────────────────\n\n private _observeChips() {\n if (!this.multiple || typeof ResizeObserver === 'undefined') return;\n if (!this._chipsObserver) {\n this._chipsObserver = new ResizeObserver(() => {\n this._visibleChipCount = Number.POSITIVE_INFINITY;\n this._scheduleChipMeasure();\n });\n }\n this._chipsObserver.disconnect();\n if (this._triggerEl) this._chipsObserver.observe(this._triggerEl);\n }\n\n private _scheduleChipMeasure() {\n cancelAnimationFrame(this._chipsMeasureFrame);\n this._chipsMeasureFrame = requestAnimationFrame(() => {\n this.updateComplete.then(() => this._measureChips());\n });\n }\n\n /** Counts how many chips fit on one row, keeping room for the \"+N\" chip when some do not. */\n private _measureChips() {\n const container = this._chipsContainer;\n if (!container || !this.multiple) return;\n const chips = Array.from(\n container.querySelectorAll<HTMLElement>('wc-chip.value-chip'),\n );\n if (!chips.length) return;\n\n const available = container.clientWidth;\n const containerLeft = container.getBoundingClientRect().left;\n const rightEdge = (chip: HTMLElement) =>\n chip.getBoundingClientRect().right - containerLeft;\n\n if (rightEdge(chips[chips.length - 1]) <= available) {\n return;\n }\n\n let count = 0;\n for (const chip of chips) {\n if (rightEdge(chip) > available - OVERFLOW_CHIP_RESERVE_PX) break;\n count += 1;\n }\n this._visibleChipCount = Math.max(count, 1);\n }\n\n // ── Render helpers ─────────────────────────────────────────────────────────\n\n /** The row under the options: progress while `loading`, else the empty state. */\n private _renderStatusRow() {\n if (this.loading) {\n return html`<div class=\"loading-row\" role=\"status\">\n <wc-circular-progress\n class=\"loading-indicator\"\n indeterminate\n aria-hidden=\"true\"\n ></wc-circular-progress>\n <span>${this._i18n.t('loading')}</span>\n </div>`;\n }\n if (!this._noOptionsVisible) return nothing;\n const hasSearchQuery = this._searchQuery.trim().length > 0;\n return html`<div class=\"no-results\" role=\"presentation\">\n ${this._i18n.t(hasSearchQuery ? 'noResults' : 'noOptions')}\n </div>`;\n }\n\n /** The \"Create …\" row of `allow-custom`. */\n private _renderCreateOption() {\n if (!this._showCreateOption) return nothing;\n const text = this._searchQuery.trim();\n return html`<wc-option class=\"create-option\" icon=\"add\" .value=${text}\n >${this._i18n.t('createOption')(text)}</wc-option\n >`;\n }\n\n private _renderChips() {\n const values = this._selectedValues;\n const visible = values.slice(0, this._visibleChipCount);\n const hidden = values.length - visible.length;\n\n return html`<div class=\"chips-container\">\n ${visible.map(\n val => html`\n <wc-chip\n class=\"value-chip\"\n dismissible\n value=${val}\n ?disabled=${!this._isInteractive}\n @dismiss=${(e: CustomEvent) => this._handleChipDismiss(e, val)}\n >${this._getLabelForValue(val)}</wc-chip\n >\n `,\n )}\n ${hidden > 0\n ? html`<wc-chip\n class=\"overflow-chip\"\n title=${values\n .slice(visible.length)\n .map(val => this._getLabelForValue(val))\n .join(', ')}\n >${new Intl.NumberFormat(this._i18n.locale, {\n signDisplay: 'always',\n }).format(hidden)}</wc-chip\n >`\n : nothing}\n </div>`;\n }\n\n private _renderTriggerContent() {\n // Typeahead: when open, show a text input for filtering\n if (this._searchMode && this._open) {\n return html`<input\n class=\"search-input\"\n .value=${this._searchQuery}\n placeholder=${this._displayLabel || this.placeholder}\n aria-label=${this.label ||\n this.placeholder ||\n this._i18n.t('searchOptions')}\n aria-controls=${this._menuId}\n aria-autocomplete=\"list\"\n @input=${this._handleSearchInput}\n />`;\n }\n\n // Multi-select: show chips for selected items\n if (this.multiple && this._selectedValues.length > 0) {\n return this._renderChips();\n }\n\n // Single select: show selected label or placeholder\n const label = this._displayLabel;\n if (!label) {\n return html`<span class=\"placeholder\">${this.placeholder}</span>`;\n }\n return html`<span class=\"display-value\">${label}</span>`;\n }\n\n private _renderFieldEnd() {\n return html`<div slot=\"field-end\" class=\"field-end-wrapper\">\n <wc-icon\n class=${classMap({\n 'dropdown-icon': true,\n 'dropdown-icon--open': this._open,\n })}\n name=\"arrow_drop_down\"\n aria-hidden=\"true\"\n ></wc-icon>\n </div>`;\n }\n\n private _renderTrigger() {\n const { 'aria-label': name, tabindex, ...aria } = this.fieldAria();\n return html`<div\n class=\"select-trigger\"\n role=\"combobox\"\n tabindex=${this.disabled ? '-1' : (tabindex ?? '0')}\n aria-label=${name || this.placeholder || this._i18n.t('selectOption')}\n aria-controls=${this._menuId}\n aria-expanded=${String(this._open)}\n aria-haspopup=\"listbox\"\n aria-required=${this.required ? 'true' : nothing}\n aria-disabled=${this.disabled ? 'true' : nothing}\n aria-readonly=${this.readonly ? 'true' : nothing}\n @click=${this._handleTriggerClick}\n @keydown=${this._handleTriggerKeyDown}\n ${spread(aria)}\n >\n ${this._renderTriggerContent()}\n </div>`;\n }\n\n render() {\n // The wrapper takes clicks anywhere on the field, so they open the options; keys are handled\n // on the combobox.\n /* eslint-disable lit-a11y/click-events-have-key-events */\n return html`\n <div class=\"select-field\" @click=${this._handleFieldClick}>\n ${this.renderField(this._renderTrigger(), {\n populated: this._isPopulated,\n focused: this._focused,\n end: this._renderFieldEnd(),\n })}\n </div>\n\n <wc-menu\n id=${this._menuId}\n role=\"listbox\"\n placement=\"bottom-start\"\n aria-label=${this.label || this._i18n.t('options')}\n aria-multiselectable=${this.multiple ? 'true' : nothing}\n aria-busy=${this.loading ? 'true' : nothing}\n @open=${Select._stopMenuEvent}\n @close=${this._handleMenuClose}\n @menu-item-activate=${this._handleMenuItemActivate}\n @keydown=${this._handleMenuKeyDownCapture}\n >\n <slot @slotchange=${this._handleSlotChange}></slot>\n ${this._renderCreateOption()} ${this._renderStatusRow()}\n </wc-menu>\n `;\n /* eslint-enable lit-a11y/click-events-have-key-events */\n }\n}\n"],"names":["html","nothing","classMap","styles","property","state","query"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA;AACA,MAAM,wBAAwB,GAAG,EAAE;AAEnC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqDG;AAEI,IAAM,MAAM,GAAA,QAAA,GAAZ,MAAM,MAAO,SAAQ,SAAS,CAAA;AAA9B,IAAA,WAAA,GAAA;;AAGY,QAAA,IAAA,CAAA,OAAO,GAAG,CAAA,eAAA,EAAkB,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE;;AAGpE,QAAA,IAAA,CAAA,KAAK,GAAG,IAAI,cAAc,CAAC,IAAI,CAAC;AAEjD;;;;AAIG;QAEH,IAAA,CAAA,OAAO,GAAmB,EAAE;AAE5B;;AAEG;QAEH,IAAA,CAAA,KAAK,GAAW,EAAE;AAElB;;AAEG;QAEH,IAAA,CAAA,QAAQ,GAAY,KAAK;AAEzB;;;;AAIG;QAEH,IAAA,CAAA,MAAM,GAAgC,EAAE;AAExC;;;;AAIG;QAEH,IAAA,CAA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// The build copies Material Symbols into dist/icons/material-symbols/, beside this module.
|
|
4
4
|
setIconBase('material-symbols', new URL('./icons/material-symbols/', import.meta.url));
|
package/dist/split-button.js
CHANGED
|
@@ -307,7 +307,7 @@ var css_248z = i`:host([size=xs]) {
|
|
|
307
307
|
* @cssprop --elevated-split-button-container-color: Color of the elevated split button container.
|
|
308
308
|
* @cssprop --elevated-split-button-label-text-color: Text color of the elevated split button label.
|
|
309
309
|
*
|
|
310
|
-
* @fires {MouseEvent} click - Dispatched when the primary action button is clicked.
|
|
310
|
+
* @fires {MouseEvent} click - Dispatched when the primary action button is clicked, and only then: a menu item's click does not bubble past the split button. Listen on the item, or for the `menu-item-activate` event (`detail.item`) that the menu fires through the split button.
|
|
311
311
|
* @fires {CustomEvent} open - Dispatched after the menu opens.
|
|
312
312
|
* @fires {CustomEvent<{reason: 'escape' | 'light-dismiss' | 'action' | 'api'}>} close - Dispatched after the menu closes: an item pick is `action`, Escape `escape`, a press outside or Tab `light-dismiss`, `close()` or the primary action `api`.
|
|
313
313
|
*
|
|
@@ -387,6 +387,13 @@ let SplitButton = class SplitButton extends i$1 {
|
|
|
387
387
|
this._trigger.close();
|
|
388
388
|
}
|
|
389
389
|
}
|
|
390
|
+
/**
|
|
391
|
+
* The split button's `click` means the primary action, so a menu item's click stops here: the
|
|
392
|
+
* item's own listeners and the menu have seen it, and the host still gets `menu-item-activate`.
|
|
393
|
+
*/
|
|
394
|
+
_onMenuClick(event) {
|
|
395
|
+
event.stopPropagation();
|
|
396
|
+
}
|
|
390
397
|
render() {
|
|
391
398
|
const actionClasses = {
|
|
392
399
|
'action-button': true,
|
|
@@ -437,6 +444,7 @@ let SplitButton = class SplitButton extends i$1 {
|
|
|
437
444
|
id=${this._trigger.menuId}
|
|
438
445
|
.placement=${this.placement}
|
|
439
446
|
variant=${this.menuVariant}
|
|
447
|
+
@click=${this._onMenuClick}
|
|
440
448
|
@open=${this._trigger.handleMenuOpen}
|
|
441
449
|
@close=${this._trigger.handleMenuClose}
|
|
442
450
|
>
|
package/dist/split-button.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"split-button.js","sources":["../../src/split-button/split-button.ts"],"sourcesContent":["import { html, LitElement } from 'lit';\nimport { property, query } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport IndividualComponent from '@/IndividualComponent.js';\nimport { I18nController } from '@/__internal/i18n/i18n-controller.js';\nimport { MenuTriggerController } from '@/__internal/menu-trigger-controller.js';\nimport type { OverlayPlacement } from '@/__internal/utils/placement.js';\nimport styles from './split-button.scss';\nimport colorStyles from './split-button-colors.scss';\nimport sizeStyles from './split-button-sizes.scss';\nimport type { Menu, MenuFocusTarget } from '../menu/menu/menu.js';\n\n/**\n * @label Split Button\n * @tag wc-split-button\n * @rawTag split-button\n *\n * @summary A button for a default action joined to an arrow that opens a menu of related actions.\n * @overview\n * <p>The main button runs the default action; the arrow beside it opens a menu of related actions.</p>\n *\n * @cssprop --split-button-container-shape: Radius of the split button's outer corners. Defaults to fully round; the inner corners follow the M3 size tokens.\n * @cssprop --split-button-gap: Space between the main button and the menu button. Defaults to 2px.\n *\n * @cssprop --filled-split-button-container-color: Color of the filled split button container.\n * @cssprop --filled-split-button-label-text-color: Text color of the filled split button label.\n *\n * @cssprop --outlined-split-button-container-color: Color of the outlined split button container.\n * @cssprop --outlined-split-button-label-text-color: Text color of the outlined split button label.\n *\n * @cssprop --tonal-split-button-container-color: Color of the tonal split button container.\n * @cssprop --tonal-split-button-label-text-color: Text color of the tonal split button label.\n *\n * @cssprop --elevated-split-button-container-color: Color of the elevated split button container.\n * @cssprop --elevated-split-button-label-text-color: Text color of the elevated split button label.\n *\n * @fires {MouseEvent} click - Dispatched when the primary action button is clicked.\n * @fires {CustomEvent} open - Dispatched after the menu opens.\n * @fires {CustomEvent<{reason: 'escape' | 'light-dismiss' | 'action' | 'api'}>} close - Dispatched after the menu closes: an item pick is `action`, Escape `escape`, a press outside or Tab `light-dismiss`, `close()` or the primary action `api`.\n *\n * @example\n * ```html\n * <wc-split-button>\n * Save\n * <wc-menu-item slot=\"menu\">Save as draft</wc-menu-item>\n * <wc-menu-item slot=\"menu\">Save and publish</wc-menu-item>\n * </wc-split-button>\n * ```\n * @tags controls\n */\n@IndividualComponent\nexport class SplitButton extends LitElement {\n static override styles = [styles, colorStyles, sizeStyles];\n\n /**\n * Button size.\n * Possible values are `\"xs\"`, `\"sm\"`, `\"md\"`, `\"lg\"`, `\"xl\"`. Defaults to `\"sm\"`.\n */\n @property({ reflect: true }) size: 'xs' | 'sm' | 'md' | 'lg' | 'xl' = 'sm';\n\n /**\n * The visual style of the split button.\n *\n * Possible variant values:\n * `\"filled\"` is a filled button.\n * `\"outlined\"` is an outlined button.\n * `\"tonal\"` is a light color button.\n * `\"elevated\"` is a raised button on a low surface.\n */\n @property({ reflect: true }) variant:\n | 'filled'\n | 'tonal'\n | 'elevated'\n | 'outlined' = 'filled';\n\n /**\n * Defines the primary color of the split button.\n */\n @property({ reflect: true }) color:\n | 'primary'\n | 'secondary'\n | 'tertiary'\n | 'success'\n | 'danger'\n | 'warning'\n | 'surface'\n | 'on-surface' = 'primary';\n\n /**\n * Whether the split button is disabled.\n */\n @property({ type: Boolean, reflect: true }) disabled = false;\n\n /** Visual variant of the menu: one surface (`\"standard\"`) or segmented groups (`\"expressive\"`). */\n @property({ attribute: 'menu-variant' }) menuVariant:\n | 'standard'\n | 'expressive' = 'standard';\n\n /**\n * Where the menu opens relative to the button: `top`, `bottom`, `start` or `end`, optionally\n * followed by `-start` or `-end` (ADR-030001). `start` and `end` follow the writing direction.\n * Defaults to `\"bottom-end\"`.\n */\n @property({ reflect: true }) placement: OverlayPlacement = 'bottom-end';\n\n @query('wc-menu') private readonly _menu?: Menu;\n\n /** Peacock's strings for the menu trigger label. */\n private readonly i18n = new I18nController(this);\n\n /** Opens and closes the menu and fires `open` / `close`. */\n private readonly _trigger = new MenuTriggerController(this, {\n menu: () => this._menu,\n disabled: () => this.disabled,\n idPrefix: 'split-menu',\n });\n\n override focus() {\n const btn = this.shadowRoot?.querySelector<HTMLElement>('.action-button');\n btn?.focus();\n }\n\n /** Opens the menu and focuses its first (or last) item. */\n show(focusTarget: MenuFocusTarget = 'first') {\n this._trigger.show(focusTarget);\n }\n\n /** Closes the menu. */\n close() {\n this._trigger.close();\n }\n\n private _onActionClick(event: MouseEvent) {\n if (this.disabled) {\n event.stopImmediatePropagation();\n event.preventDefault();\n return;\n }\n\n // The primary action closes the menu if it is open.\n if (this._menu?.open) {\n this._trigger.close();\n }\n }\n\n override render() {\n const actionClasses = {\n 'action-button': true,\n disabled: this.disabled,\n };\n\n const dropdownClasses = {\n 'dropdown-trigger': true,\n active: this._trigger.open,\n disabled: this.disabled,\n };\n\n const containerClasses = {\n 'split-button': true,\n [`variant-${this.variant}`]: true,\n disabled: this.disabled,\n };\n\n return html`\n <div class=${classMap(containerClasses)}>\n <wc-button\n class=${classMap(actionClasses)}\n size=${this.size}\n variant=${this.variant}\n ?disabled=${this.disabled}\n @click=${this._onActionClick}\n >\n <slot></slot>\n </wc-button>\n\n <wc-icon-button\n class=${classMap(dropdownClasses)}\n size=${this.size}\n variant=${this.variant}\n ?disabled=${this.disabled}\n aria-label=${this.i18n.t('openSplitButtonMenu')}\n aria-haspopup=\"menu\"\n aria-expanded=${String(this._trigger.open)}\n @click=${this._trigger.handleTriggerClick}\n @keydown=${this._trigger.handleTriggerKeyDown}\n >\n <wc-icon\n class=\"dropdown-icon\"\n name=\"keyboard_arrow_down\"\n aria-hidden=\"true\"\n ></wc-icon>\n </wc-icon-button>\n </div>\n\n <wc-menu\n id=${this._trigger.menuId}\n .placement=${this.placement}\n variant=${this.menuVariant}\n @open=${this._trigger.handleMenuOpen}\n @close=${this._trigger.handleMenuClose}\n >\n <slot name=\"menu\"></slot>\n </wc-menu>\n `;\n }\n}\n"],"names":["LitElement","html","classMap","styles","colorStyles","sizeStyles","property","query"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;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A,EAAA,WAAA,CAAA,SAAA,EAAA,aAAA,EAAA,MAAA,CAAA;AAOD,UAAA,CAAA;AAA5B,IAAAA,CAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE;AAA6C,CAAA,EAAA,WAAA,CAAA,SAAA,EAAA,WAAA,EAAA,MAAA,CAAA;AAErC,UAAA,CAAA;IAAlCC,CAAK,CAAC,SAAS;AAAgC,CAAA,EAAA,WAAA,CAAA,SAAA,EAAA,OAAA,EAAA,MAAA,CAAA;AAtDrC,WAAW,GAAA,UAAA,CAAA;IADvB;AACY,CAAA,EAAA,WAAW,CA0JvB;;;;"}
|
|
1
|
+
{"version":3,"file":"split-button.js","sources":["../../src/split-button/split-button.ts"],"sourcesContent":["import { html, LitElement } from 'lit';\nimport { property, query } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport IndividualComponent from '@/IndividualComponent.js';\nimport { I18nController } from '@/__internal/i18n/i18n-controller.js';\nimport { MenuTriggerController } from '@/__internal/menu-trigger-controller.js';\nimport type { OverlayPlacement } from '@/__internal/utils/placement.js';\nimport styles from './split-button.scss';\nimport colorStyles from './split-button-colors.scss';\nimport sizeStyles from './split-button-sizes.scss';\nimport type { Menu, MenuFocusTarget } from '../menu/menu/menu.js';\n\n/**\n * @label Split Button\n * @tag wc-split-button\n * @rawTag split-button\n *\n * @summary A button for a default action joined to an arrow that opens a menu of related actions.\n * @overview\n * <p>The main button runs the default action; the arrow beside it opens a menu of related actions.</p>\n *\n * @cssprop --split-button-container-shape: Radius of the split button's outer corners. Defaults to fully round; the inner corners follow the M3 size tokens.\n * @cssprop --split-button-gap: Space between the main button and the menu button. Defaults to 2px.\n *\n * @cssprop --filled-split-button-container-color: Color of the filled split button container.\n * @cssprop --filled-split-button-label-text-color: Text color of the filled split button label.\n *\n * @cssprop --outlined-split-button-container-color: Color of the outlined split button container.\n * @cssprop --outlined-split-button-label-text-color: Text color of the outlined split button label.\n *\n * @cssprop --tonal-split-button-container-color: Color of the tonal split button container.\n * @cssprop --tonal-split-button-label-text-color: Text color of the tonal split button label.\n *\n * @cssprop --elevated-split-button-container-color: Color of the elevated split button container.\n * @cssprop --elevated-split-button-label-text-color: Text color of the elevated split button label.\n *\n * @fires {MouseEvent} click - Dispatched when the primary action button is clicked, and only then: a menu item's click does not bubble past the split button. Listen on the item, or for the `menu-item-activate` event (`detail.item`) that the menu fires through the split button.\n * @fires {CustomEvent} open - Dispatched after the menu opens.\n * @fires {CustomEvent<{reason: 'escape' | 'light-dismiss' | 'action' | 'api'}>} close - Dispatched after the menu closes: an item pick is `action`, Escape `escape`, a press outside or Tab `light-dismiss`, `close()` or the primary action `api`.\n *\n * @example\n * ```html\n * <wc-split-button>\n * Save\n * <wc-menu-item slot=\"menu\">Save as draft</wc-menu-item>\n * <wc-menu-item slot=\"menu\">Save and publish</wc-menu-item>\n * </wc-split-button>\n * ```\n * @tags controls\n */\n@IndividualComponent\nexport class SplitButton extends LitElement {\n static override styles = [styles, colorStyles, sizeStyles];\n\n /**\n * Button size.\n * Possible values are `\"xs\"`, `\"sm\"`, `\"md\"`, `\"lg\"`, `\"xl\"`. Defaults to `\"sm\"`.\n */\n @property({ reflect: true }) size: 'xs' | 'sm' | 'md' | 'lg' | 'xl' = 'sm';\n\n /**\n * The visual style of the split button.\n *\n * Possible variant values:\n * `\"filled\"` is a filled button.\n * `\"outlined\"` is an outlined button.\n * `\"tonal\"` is a light color button.\n * `\"elevated\"` is a raised button on a low surface.\n */\n @property({ reflect: true }) variant:\n | 'filled'\n | 'tonal'\n | 'elevated'\n | 'outlined' = 'filled';\n\n /**\n * Defines the primary color of the split button.\n */\n @property({ reflect: true }) color:\n | 'primary'\n | 'secondary'\n | 'tertiary'\n | 'success'\n | 'danger'\n | 'warning'\n | 'surface'\n | 'on-surface' = 'primary';\n\n /**\n * Whether the split button is disabled.\n */\n @property({ type: Boolean, reflect: true }) disabled = false;\n\n /** Visual variant of the menu: one surface (`\"standard\"`) or segmented groups (`\"expressive\"`). */\n @property({ attribute: 'menu-variant' }) menuVariant:\n | 'standard'\n | 'expressive' = 'standard';\n\n /**\n * Where the menu opens relative to the button: `top`, `bottom`, `start` or `end`, optionally\n * followed by `-start` or `-end` (ADR-030001). `start` and `end` follow the writing direction.\n * Defaults to `\"bottom-end\"`.\n */\n @property({ reflect: true }) placement: OverlayPlacement = 'bottom-end';\n\n @query('wc-menu') private readonly _menu?: Menu;\n\n /** Peacock's strings for the menu trigger label. */\n private readonly i18n = new I18nController(this);\n\n /** Opens and closes the menu and fires `open` / `close`. */\n private readonly _trigger = new MenuTriggerController(this, {\n menu: () => this._menu,\n disabled: () => this.disabled,\n idPrefix: 'split-menu',\n });\n\n override focus() {\n const btn = this.shadowRoot?.querySelector<HTMLElement>('.action-button');\n btn?.focus();\n }\n\n /** Opens the menu and focuses its first (or last) item. */\n show(focusTarget: MenuFocusTarget = 'first') {\n this._trigger.show(focusTarget);\n }\n\n /** Closes the menu. */\n close() {\n this._trigger.close();\n }\n\n private _onActionClick(event: MouseEvent) {\n if (this.disabled) {\n event.stopImmediatePropagation();\n event.preventDefault();\n return;\n }\n\n // The primary action closes the menu if it is open.\n if (this._menu?.open) {\n this._trigger.close();\n }\n }\n\n /**\n * The split button's `click` means the primary action, so a menu item's click stops here: the\n * item's own listeners and the menu have seen it, and the host still gets `menu-item-activate`.\n */\n private _onMenuClick(event: MouseEvent) {\n event.stopPropagation();\n }\n\n override render() {\n const actionClasses = {\n 'action-button': true,\n disabled: this.disabled,\n };\n\n const dropdownClasses = {\n 'dropdown-trigger': true,\n active: this._trigger.open,\n disabled: this.disabled,\n };\n\n const containerClasses = {\n 'split-button': true,\n [`variant-${this.variant}`]: true,\n disabled: this.disabled,\n };\n\n return html`\n <div class=${classMap(containerClasses)}>\n <wc-button\n class=${classMap(actionClasses)}\n size=${this.size}\n variant=${this.variant}\n ?disabled=${this.disabled}\n @click=${this._onActionClick}\n >\n <slot></slot>\n </wc-button>\n\n <wc-icon-button\n class=${classMap(dropdownClasses)}\n size=${this.size}\n variant=${this.variant}\n ?disabled=${this.disabled}\n aria-label=${this.i18n.t('openSplitButtonMenu')}\n aria-haspopup=\"menu\"\n aria-expanded=${String(this._trigger.open)}\n @click=${this._trigger.handleTriggerClick}\n @keydown=${this._trigger.handleTriggerKeyDown}\n >\n <wc-icon\n class=\"dropdown-icon\"\n name=\"keyboard_arrow_down\"\n aria-hidden=\"true\"\n ></wc-icon>\n </wc-icon-button>\n </div>\n\n <wc-menu\n id=${this._trigger.menuId}\n .placement=${this.placement}\n variant=${this.menuVariant}\n @click=${this._onMenuClick}\n @open=${this._trigger.handleMenuOpen}\n @close=${this._trigger.handleMenuClose}\n >\n <slot name=\"menu\"></slot>\n </wc-menu>\n `;\n }\n}\n"],"names":["LitElement","html","classMap","styles","colorStyles","sizeStyles","property","query"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAYA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqCG;AAEI,IAAM,WAAW,GAAjB,MAAM,WAAY,SAAQA,GAAU,CAAA;AAApC,IAAA,WAAA,GAAA;;AAGL;;;AAGG;QAC0B,IAAA,CAAA,IAAI,GAAqC,IAAI;AAE1E;;;;;;;;AAQG;QAC0B,IAAA,CAAA,OAAO,GAInB,QAAQ;AAEzB;;AAEG;QAC0B,IAAA,CAAA,KAAK,GAQf,SAAS;AAE5B;;AAEG;QACyC,IAAA,CAAA,QAAQ,GAAG,KAAK;;QAGnB,IAAA,CAAA,WAA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