@redvars/peacock 4.5.1 → 4.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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/code-editor.js +56 -5
- package/dist/code-editor.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 +29 -23
- package/dist/custom-elements.json +758 -93
- 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/code-editor/code-editor.d.ts +3 -3
- 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/code-editor/code-editor.scss +70 -1
- package/src/code-editor/code-editor.ts +12 -4
- 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/link-button.js
CHANGED
|
@@ -4,13 +4,14 @@ import { e } from './query-CHb9Ft_d.js';
|
|
|
4
4
|
import { o } from './if-defined-D9DEJR_6.js';
|
|
5
5
|
import { n } from './when-DEJm_QN9.js';
|
|
6
6
|
import { o as observerSlotChangesWithCallback } from './observe-slot-change-DPxaZrZF.js';
|
|
7
|
-
import { i as isActivationClick, d as dispatchActivationClick } from './
|
|
7
|
+
import { i as isActivationClick, d as dispatchActivationClick } from './dispatch-event-utils-DfgqVBK8.js';
|
|
8
8
|
import { D as DISABLED_REASON_ID } from './ButtonConstants-CahP2_NA.js';
|
|
9
9
|
import { m as mixinDelegatesAria } from './delegate-Bw2wdPFP.js';
|
|
10
10
|
import { m as mixinElementInternals } from './element-internals-QME0yEz4.js';
|
|
11
11
|
import { m as mixinHyperlink } from './hyperlink-DycWPKwU.js';
|
|
12
|
-
import { m as mixinButtonLevel, a as mixinBaseButton } from './base-button-
|
|
12
|
+
import { m as mixinButtonLevel, a as mixinBaseButton } from './base-button-9tGu5RSC.js';
|
|
13
13
|
import './base-Cl6v8-BZ.js';
|
|
14
|
+
import './activation-gate-D4IpmwyD.js';
|
|
14
15
|
import './warn-once-BNxX1Y98.js';
|
|
15
16
|
|
|
16
17
|
var css_248z = i`.button {
|
|
@@ -924,9 +925,9 @@ var css_248z = i`.button {
|
|
|
924
925
|
* @tags display
|
|
925
926
|
*/
|
|
926
927
|
let LinkButton = class LinkButton extends mixinButtonLevel(mixinBaseButton(mixinHyperlink(mixinDelegatesAria(mixinElementInternals(i$1))))) {
|
|
927
|
-
// ── Constructor ───────────────────────────────────────────────────────────
|
|
928
928
|
constructor() {
|
|
929
|
-
|
|
929
|
+
// ── Static ───────────────────────────────────────────────────────────────
|
|
930
|
+
super(...arguments);
|
|
930
931
|
// ── Properties ───────────────────────────────────────────────────────────
|
|
931
932
|
/**
|
|
932
933
|
* When `true`, the icon is placed after the label (trailing).
|
|
@@ -945,22 +946,13 @@ let LinkButton = class LinkButton extends mixinButtonLevel(mixinBaseButton(mixin
|
|
|
945
946
|
// ── Private fields ────────────────────────────────────────────────────────
|
|
946
947
|
this.__iconSlotCleanup = null;
|
|
947
948
|
this.__labelSlotCleanup = null;
|
|
948
|
-
// ── Private methods ───────────────────────────────────────────────────────
|
|
949
949
|
this.__dispatchClick = (event) => {
|
|
950
|
-
// A link has no native disabled state, so a disabled, soft-disabled or
|
|
951
|
-
// skeleton link swallows the click and stops the navigation.
|
|
952
|
-
if (this.disabled || this.softDisabled || this.skeleton) {
|
|
953
|
-
event.stopImmediatePropagation();
|
|
954
|
-
event.preventDefault();
|
|
955
|
-
return;
|
|
956
|
-
}
|
|
957
950
|
if (!isActivationClick(event) || !this.linkElement) {
|
|
958
951
|
return;
|
|
959
952
|
}
|
|
960
953
|
this.focus();
|
|
961
954
|
dispatchActivationClick(this.linkElement);
|
|
962
955
|
};
|
|
963
|
-
this.addEventListener('click', this.__dispatchClickWithThrottle);
|
|
964
956
|
}
|
|
965
957
|
// ── Lifecycle ─────────────────────────────────────────────────────────────
|
|
966
958
|
disconnectedCallback() {
|
|
@@ -988,6 +980,14 @@ let LinkButton = class LinkButton extends mixinButtonLevel(mixinBaseButton(mixin
|
|
|
988
980
|
blur() {
|
|
989
981
|
this.linkElement?.blur();
|
|
990
982
|
}
|
|
983
|
+
// ── Private methods ───────────────────────────────────────────────────────
|
|
984
|
+
/**
|
|
985
|
+
* A link has no native disabled state, so a disabled, soft-disabled or skeleton link swallows
|
|
986
|
+
* the click and stops the navigation.
|
|
987
|
+
*/
|
|
988
|
+
__isClickBlocked() {
|
|
989
|
+
return this.disabled || this.softDisabled || this.skeleton;
|
|
990
|
+
}
|
|
991
991
|
// ── Render helpers ────────────────────────────────────────────────────────
|
|
992
992
|
renderDisabledReason() {
|
|
993
993
|
if (!this.softDisabled)
|
|
@@ -1044,7 +1044,6 @@ let LinkButton = class LinkButton extends mixinButtonLevel(mixinBaseButton(mixin
|
|
|
1044
1044
|
`;
|
|
1045
1045
|
}
|
|
1046
1046
|
};
|
|
1047
|
-
// ── Static ───────────────────────────────────────────────────────────────
|
|
1048
1047
|
/** @nocollapse */ // eslint-disable-next-line
|
|
1049
1048
|
LinkButton.shadowRootOptions = {
|
|
1050
1049
|
mode: 'open',
|
package/dist/link-button.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"link-button.js","sources":["../../src/button/link-button/link-button.ts"],"sourcesContent":["import { html, LitElement, nothing, type PropertyValues } from 'lit';\nimport { property, query } from 'lit/decorators.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { when } from 'lit/directives/when.js';\nimport IndividualComponent from '@/IndividualComponent.js';\nimport styles from './link-button.scss';\n\nimport type { ButtonShape, ButtonSize } from '@/button/ButtonTypes.js';\nimport { observerSlotChangesWithCallback } from '@/__internal/utils/observe-slot-change.js';\nimport {\n dispatchActivationClick,\n isActivationClick,\n} from '@/__internal/utils/dispatch-event-utils.js';\nimport { DISABLED_REASON_ID } from '@/button/ButtonConstants.js';\nimport { mixinDelegatesAria } from '@/__internal/aria/delegate.js';\nimport { ARIAMixinStrict } from '@/__internal/aria/aria.js';\nimport { mixinElementInternals } from '@/__internal/mixins/element-internals.js';\nimport { mixinHyperlink } from '@/__internal/mixins/hyperlink.js';\nimport {\n mixinBaseButton,\n mixinButtonLevel,\n} from '../base-button/base-button.js';\n\n/**\n * @label Link Button\n * @tag wc-link-button\n * @rawTag link-button\n *\n * @summary A link that looks like a button, for navigation that should read as a call to action.\n * @overview\n * <p>The link button renders a native <code><a></code> with the button's look: the same <code>variant</code>, <code>color</code>, <code>level</code>, <code>size</code>, <code>shape</code> and icon slot as <code>wc-button</code>. Use it when activating the control navigates (<code>href</code>, <code>target</code>, <code>rel</code>, <code>download</code>); use <code>wc-button</code> when it performs an action or submits a form.</p>\n * @cssprop --button-container-shape - Defines the border radius of the button container shape.\n * @cssprop --filled-button-container-color - Color of the filled button container.\n * @cssprop --filled-button-label-text-color - Text color of the filled button label.\n * @cssprop --outlined-button-label-text-color - Text color of the outlined button label.\n * @cssprop --text-button-label-text-color - Text color of the text button label.\n * @cssprop --tonal-button-container-color - Color of the tonal button container.\n * @cssprop --tonal-button-label-text-color - Text color of the tonal button label.\n *\n * @fires {MouseEvent} click - Dispatched when the link is clicked. Not dispatched while `disabled`, `soft-disabled` or `skeleton`.\n *\n * @example\n * ```html\n * <wc-link-button href=\"/docs\">Read the docs</wc-link-button>\n * ```\n * @tags display\n */\n@IndividualComponent\nexport class LinkButton extends mixinButtonLevel(\n mixinBaseButton(\n mixinHyperlink(mixinDelegatesAria(mixinElementInternals(LitElement))),\n ),\n) {\n // ── Static ───────────────────────────────────────────────────────────────\n\n /** @nocollapse */ // eslint-disable-next-line\n static override shadowRootOptions: ShadowRootInit = {\n mode: 'open',\n delegatesFocus: true,\n };\n\n static override styles = [styles];\n\n // ── Properties ───────────────────────────────────────────────────────────\n\n /**\n * When `true`, the icon is placed after the label (trailing).\n * When `false` (default), the icon is placed before the label (leading).\n */\n @property({ type: Boolean, reflect: true, attribute: 'trailing-icon' })\n trailingIcon = false;\n\n /**\n * Button size.\n * Possible values are `\"xs\"`, `\"sm\"`, `\"md\"`, `\"lg\"`, `\"xl\"`. Defaults to `\"sm\"`.\n */\n @property({ reflect: true }) size: ButtonSize = 'sm';\n\n /** Shape of the button container. */\n @property({ type: String, reflect: true }) shape: ButtonShape = 'square';\n\n /** When true, renders the link as a placeholder skeleton while the page loads. */\n @property({ type: Boolean, reflect: true }) skeleton: boolean = false;\n\n /** Optional tooltip text displayed on hover. */\n @property() tooltip?: string;\n\n // ── Queries ───────────────────────────────────────────────────────────────\n\n @query('.button') private readonly linkElement!: HTMLElement | null;\n\n // ── Private fields ────────────────────────────────────────────────────────\n\n private __iconSlotCleanup: (() => void) | null = null;\n\n private __labelSlotCleanup: (() => void) | null = null;\n\n // ── Constructor ───────────────────────────────────────────────────────────\n\n constructor() {\n super();\n this.addEventListener('click', this.__dispatchClickWithThrottle);\n }\n\n // ── Lifecycle ─────────────────────────────────────────────────────────────\n\n override disconnectedCallback() {\n this.__iconSlotCleanup?.();\n this.__labelSlotCleanup?.();\n this.__iconSlotCleanup = null;\n this.__labelSlotCleanup = null;\n super.disconnectedCallback();\n }\n\n override firstUpdated(changedProperties: PropertyValues<this>) {\n super.firstUpdated(changedProperties);\n const iconSlot =\n this.renderRoot.querySelector<HTMLSlotElement>('slot[name=\"icon\"]');\n const labelSlot =\n this.renderRoot.querySelector<HTMLSlotElement>('slot.label');\n if (iconSlot) {\n this.__iconSlotCleanup = observerSlotChangesWithCallback(iconSlot, has =>\n this.toggleAttribute('has-icon', has),\n );\n }\n if (labelSlot) {\n this.__labelSlotCleanup = observerSlotChangesWithCallback(\n labelSlot,\n has => this.toggleAttribute('has-label', has),\n );\n }\n }\n\n // ── Public methods ────────────────────────────────────────────────────────\n\n override focus() {\n this.linkElement?.focus();\n }\n\n override blur() {\n this.linkElement?.blur();\n }\n\n // ── Private methods ───────────────────────────────────────────────────────\n\n __dispatchClick = (event: MouseEvent | KeyboardEvent) => {\n // A link has no native disabled state, so a disabled, soft-disabled or\n // skeleton link swallows the click and stops the navigation.\n if (this.disabled || this.softDisabled || this.skeleton) {\n event.stopImmediatePropagation();\n event.preventDefault();\n return;\n }\n\n if (!isActivationClick(event) || !this.linkElement) {\n return;\n }\n\n this.focus();\n dispatchActivationClick(this.linkElement);\n };\n\n // ── Render helpers ────────────────────────────────────────────────────────\n\n renderDisabledReason() {\n if (!this.softDisabled) return nothing;\n return html`<div\n id=${DISABLED_REASON_ID}\n role=\"tooltip\"\n aria-label=${this.disabledReason}\n class=\"screen-reader-only\"\n >\n ${this.disabledReason}\n </div>`;\n }\n\n renderTooltip() {\n if (!this.tooltip) return nothing;\n return html`<wc-tooltip class=\"tooltip\" for=\"link\"\n >${this.tooltip}</wc-tooltip\n >`;\n }\n\n // ── Render ────────────────────────────────────────────────────────────────\n\n override render() {\n const { ariaLabel, ariaHasPopup, ariaExpanded } = this as ARIAMixinStrict;\n const inert = this.disabled || this.softDisabled;\n\n return html`\n <wc-focus-ring class=\"focus-ring\" for=\"link\"></wc-focus-ring>\n <wc-elevation class=\"elevation\"></wc-elevation>\n ${when(\n this.variant === 'neo',\n () => html`<div class=\"neo-background\"></div>`,\n )}\n <div class=\"background\"></div>\n ${when(\n this.variant === 'outlined' || this.variant === 'neo',\n () => html`<div class=\"outline\"></div>`,\n )}\n <wc-ripple class=\"ripple\" for=\"link\"></wc-ripple>\n <wc-skeleton class=\"skeleton\"></wc-skeleton>\n\n <a\n class=\"button native-link\"\n id=\"link\"\n href=${ifDefined(this.href)}\n target=${this.target || nothing}\n rel=${this.rel || nothing}\n download=${this.download || nothing}\n tabindex=${this.disabled ? '-1' : nothing}\n aria-label=${ariaLabel || nothing}\n aria-haspopup=${ariaHasPopup || nothing}\n aria-expanded=${ariaExpanded || nothing}\n aria-describedby=${ifDefined(\n this.softDisabled ? DISABLED_REASON_ID : undefined,\n )}\n aria-disabled=${inert ? 'true' : nothing}\n >\n <slot class=\"icon-slot\" name=\"icon\"></slot>\n <slot class=\"label\"></slot>\n <div class=\"touch\"></div>\n ${this.renderDisabledReason()}\n </a>\n ${this.renderTooltip()}\n `;\n }\n}\n"],"names":["LitElement","nothing","html","when","ifDefined","styles","property","query"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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UAAA,CAAA;AAAX,IAAAA,GAAQ;AAAoB,CAAA,EAAA,UAAA,CAAA,SAAA,EAAA,SAAA,EAAA,MAAA,CAAA;AAIM,UAAA,CAAA;IAAlCC,CAAK,CAAC,SAAS;AAAoD,CAAA,EAAA,UAAA,CAAA,SAAA,EAAA,aAAA,EAAA,MAAA,CAAA;AAzCzD,UAAU,GAAA,UAAA,CAAA;IADtB;AACY,CAAA,EAAA,UAAU,CAoLtB;;;;"}
|
|
1
|
+
{"version":3,"file":"link-button.js","sources":["../../src/button/link-button/link-button.ts"],"sourcesContent":["import { html, LitElement, nothing, type PropertyValues } from 'lit';\nimport { property, query } from 'lit/decorators.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { when } from 'lit/directives/when.js';\nimport IndividualComponent from '@/IndividualComponent.js';\nimport styles from './link-button.scss';\n\nimport type { ButtonShape, ButtonSize } from '@/button/ButtonTypes.js';\nimport { observerSlotChangesWithCallback } from '@/__internal/utils/observe-slot-change.js';\nimport {\n dispatchActivationClick,\n isActivationClick,\n} from '@/__internal/utils/dispatch-event-utils.js';\nimport { DISABLED_REASON_ID } from '@/button/ButtonConstants.js';\nimport { mixinDelegatesAria } from '@/__internal/aria/delegate.js';\nimport { ARIAMixinStrict } from '@/__internal/aria/aria.js';\nimport { mixinElementInternals } from '@/__internal/mixins/element-internals.js';\nimport { mixinHyperlink } from '@/__internal/mixins/hyperlink.js';\nimport {\n mixinBaseButton,\n mixinButtonLevel,\n} from '../base-button/base-button.js';\n\n/**\n * @label Link Button\n * @tag wc-link-button\n * @rawTag link-button\n *\n * @summary A link that looks like a button, for navigation that should read as a call to action.\n * @overview\n * <p>The link button renders a native <code><a></code> with the button's look: the same <code>variant</code>, <code>color</code>, <code>level</code>, <code>size</code>, <code>shape</code> and icon slot as <code>wc-button</code>. Use it when activating the control navigates (<code>href</code>, <code>target</code>, <code>rel</code>, <code>download</code>); use <code>wc-button</code> when it performs an action or submits a form.</p>\n * @cssprop --button-container-shape - Defines the border radius of the button container shape.\n * @cssprop --filled-button-container-color - Color of the filled button container.\n * @cssprop --filled-button-label-text-color - Text color of the filled button label.\n * @cssprop --outlined-button-label-text-color - Text color of the outlined button label.\n * @cssprop --text-button-label-text-color - Text color of the text button label.\n * @cssprop --tonal-button-container-color - Color of the tonal button container.\n * @cssprop --tonal-button-label-text-color - Text color of the tonal button label.\n *\n * @fires {MouseEvent} click - Dispatched when the link is clicked. Not dispatched while `disabled`, `soft-disabled` or `skeleton`.\n *\n * @example\n * ```html\n * <wc-link-button href=\"/docs\">Read the docs</wc-link-button>\n * ```\n * @tags display\n */\n@IndividualComponent\nexport class LinkButton extends mixinButtonLevel(\n mixinBaseButton(\n mixinHyperlink(mixinDelegatesAria(mixinElementInternals(LitElement))),\n ),\n) {\n // ── Static ───────────────────────────────────────────────────────────────\n\n /** @nocollapse */ // eslint-disable-next-line\n static override shadowRootOptions: ShadowRootInit = {\n mode: 'open',\n delegatesFocus: true,\n };\n\n static override styles = [styles];\n\n // ── Properties ───────────────────────────────────────────────────────────\n\n /**\n * When `true`, the icon is placed after the label (trailing).\n * When `false` (default), the icon is placed before the label (leading).\n */\n @property({ type: Boolean, reflect: true, attribute: 'trailing-icon' })\n trailingIcon = false;\n\n /**\n * Button size.\n * Possible values are `\"xs\"`, `\"sm\"`, `\"md\"`, `\"lg\"`, `\"xl\"`. Defaults to `\"sm\"`.\n */\n @property({ reflect: true }) size: ButtonSize = 'sm';\n\n /** Shape of the button container. */\n @property({ type: String, reflect: true }) shape: ButtonShape = 'square';\n\n /** When true, renders the link as a placeholder skeleton while the page loads. */\n @property({ type: Boolean, reflect: true }) skeleton: boolean = false;\n\n /** Optional tooltip text displayed on hover. */\n @property() tooltip?: string;\n\n // ── Queries ───────────────────────────────────────────────────────────────\n\n @query('.button') private readonly linkElement!: HTMLElement | null;\n\n // ── Private fields ────────────────────────────────────────────────────────\n\n private __iconSlotCleanup: (() => void) | null = null;\n\n private __labelSlotCleanup: (() => void) | null = null;\n\n // ── Lifecycle ─────────────────────────────────────────────────────────────\n\n override disconnectedCallback() {\n this.__iconSlotCleanup?.();\n this.__labelSlotCleanup?.();\n this.__iconSlotCleanup = null;\n this.__labelSlotCleanup = null;\n super.disconnectedCallback();\n }\n\n override firstUpdated(changedProperties: PropertyValues<this>) {\n super.firstUpdated(changedProperties);\n const iconSlot =\n this.renderRoot.querySelector<HTMLSlotElement>('slot[name=\"icon\"]');\n const labelSlot =\n this.renderRoot.querySelector<HTMLSlotElement>('slot.label');\n if (iconSlot) {\n this.__iconSlotCleanup = observerSlotChangesWithCallback(iconSlot, has =>\n this.toggleAttribute('has-icon', has),\n );\n }\n if (labelSlot) {\n this.__labelSlotCleanup = observerSlotChangesWithCallback(\n labelSlot,\n has => this.toggleAttribute('has-label', has),\n );\n }\n }\n\n // ── Public methods ────────────────────────────────────────────────────────\n\n override focus() {\n this.linkElement?.focus();\n }\n\n override blur() {\n this.linkElement?.blur();\n }\n\n // ── Private methods ───────────────────────────────────────────────────────\n\n /**\n * A link has no native disabled state, so a disabled, soft-disabled or skeleton link swallows\n * the click and stops the navigation.\n */\n override __isClickBlocked() {\n return this.disabled || this.softDisabled || this.skeleton;\n }\n\n __dispatchClick = (event: MouseEvent | KeyboardEvent) => {\n if (!isActivationClick(event) || !this.linkElement) {\n return;\n }\n\n this.focus();\n dispatchActivationClick(this.linkElement);\n };\n\n // ── Render helpers ────────────────────────────────────────────────────────\n\n renderDisabledReason() {\n if (!this.softDisabled) return nothing;\n return html`<div\n id=${DISABLED_REASON_ID}\n role=\"tooltip\"\n aria-label=${this.disabledReason}\n class=\"screen-reader-only\"\n >\n ${this.disabledReason}\n </div>`;\n }\n\n renderTooltip() {\n if (!this.tooltip) return nothing;\n return html`<wc-tooltip class=\"tooltip\" for=\"link\"\n >${this.tooltip}</wc-tooltip\n >`;\n }\n\n // ── Render ────────────────────────────────────────────────────────────────\n\n override render() {\n const { ariaLabel, ariaHasPopup, ariaExpanded } = this as ARIAMixinStrict;\n const inert = this.disabled || this.softDisabled;\n\n return html`\n <wc-focus-ring class=\"focus-ring\" for=\"link\"></wc-focus-ring>\n <wc-elevation class=\"elevation\"></wc-elevation>\n ${when(\n this.variant === 'neo',\n () => html`<div class=\"neo-background\"></div>`,\n )}\n <div class=\"background\"></div>\n ${when(\n this.variant === 'outlined' || this.variant === 'neo',\n () => html`<div class=\"outline\"></div>`,\n )}\n <wc-ripple class=\"ripple\" for=\"link\"></wc-ripple>\n <wc-skeleton class=\"skeleton\"></wc-skeleton>\n\n <a\n class=\"button native-link\"\n id=\"link\"\n href=${ifDefined(this.href)}\n target=${this.target || nothing}\n rel=${this.rel || nothing}\n download=${this.download || nothing}\n tabindex=${this.disabled ? '-1' : nothing}\n aria-label=${ariaLabel || nothing}\n aria-haspopup=${ariaHasPopup || nothing}\n aria-expanded=${ariaExpanded || nothing}\n aria-describedby=${ifDefined(\n this.softDisabled ? DISABLED_REASON_ID : undefined,\n )}\n aria-disabled=${inert ? 'true' : nothing}\n >\n <slot class=\"icon-slot\" name=\"icon\"></slot>\n <slot class=\"label\"></slot>\n <div class=\"touch\"></div>\n ${this.renderDisabledReason()}\n </a>\n ${this.renderTooltip()}\n `;\n }\n}\n"],"names":["LitElement","nothing","html","when","ifDefined","styles","property","query"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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}
|
package/dist/list-item.js
CHANGED
|
@@ -2,14 +2,16 @@ import { i, a as i$1, A, b, _ as __decorate, I as IndividualComponent } from './
|
|
|
2
2
|
import { n } from './property-B2TG3KEE.js';
|
|
3
3
|
import { e as e$1 } from './query-CHb9Ft_d.js';
|
|
4
4
|
import { e } from './class-map-NDIkZErE.js';
|
|
5
|
+
import { o } from './if-defined-D9DEJR_6.js';
|
|
5
6
|
import { i as isLink } from './is-link-Dk2OV3PM.js';
|
|
6
|
-
import { i as isActivationClick, d as dispatchActivationClick } from './
|
|
7
|
-
import { a as mixinBaseButton } from './base-button-
|
|
7
|
+
import { i as isActivationClick, d as dispatchActivationClick } from './dispatch-event-utils-DfgqVBK8.js';
|
|
8
|
+
import { a as mixinBaseButton } from './base-button-9tGu5RSC.js';
|
|
8
9
|
import { m as mixinHyperlink } from './hyperlink-DycWPKwU.js';
|
|
9
10
|
import { m as mixinDelegatesAria } from './delegate-Bw2wdPFP.js';
|
|
10
11
|
import { m as mixinElementInternals } from './element-internals-QME0yEz4.js';
|
|
11
12
|
import './base-Cl6v8-BZ.js';
|
|
12
13
|
import './directive-ZPhl09Yt.js';
|
|
14
|
+
import './activation-gate-D4IpmwyD.js';
|
|
13
15
|
import './warn-once-BNxX1Y98.js';
|
|
14
16
|
|
|
15
17
|
var css_248z = i`* {
|
|
@@ -98,6 +100,10 @@ var css_248z = i`* {
|
|
|
98
100
|
--item-multiline-height: 3rem;
|
|
99
101
|
--item-label-text-color: var(--_label-text-color);
|
|
100
102
|
--item-label-text-opacity: var(--_label-text-opacity);
|
|
103
|
+
/* In a button or link, clicks land on the control, not on its content. */
|
|
104
|
+
}
|
|
105
|
+
.list-item .list-item-content.clickable {
|
|
106
|
+
pointer-events: none;
|
|
101
107
|
}
|
|
102
108
|
.list-item .icon-slot {
|
|
103
109
|
color: var(--_icon-color);
|
|
@@ -242,7 +248,8 @@ var css_248z = i`* {
|
|
|
242
248
|
*/
|
|
243
249
|
let ListItem = class ListItem extends mixinBaseButton(mixinHyperlink(mixinDelegatesAria(mixinElementInternals(i$1)))) {
|
|
244
250
|
constructor() {
|
|
245
|
-
|
|
251
|
+
// ── Static ───────────────────────────────────────────────────────────────
|
|
252
|
+
super(...arguments);
|
|
246
253
|
// ── Properties ───────────────────────────────────────────────────────────
|
|
247
254
|
/**
|
|
248
255
|
* Marks the row of the current page or location in a navigation list: `aria-current="page"`
|
|
@@ -262,10 +269,9 @@ let ListItem = class ListItem extends mixinBaseButton(mixinHyperlink(mixinDelega
|
|
|
262
269
|
this.requestUpdate();
|
|
263
270
|
});
|
|
264
271
|
this.__dispatchClick = (event) => {
|
|
265
|
-
//
|
|
266
|
-
//
|
|
267
|
-
|
|
268
|
-
if (this.softDisabled || (this.disabled && this.href) || this.skeleton) {
|
|
272
|
+
// The inner control calls this directly as well as through the host
|
|
273
|
+
// listener, so it repeats the block.
|
|
274
|
+
if (this.__isClickBlocked()) {
|
|
269
275
|
event.stopImmediatePropagation();
|
|
270
276
|
event.preventDefault();
|
|
271
277
|
return;
|
|
@@ -276,7 +282,6 @@ let ListItem = class ListItem extends mixinBaseButton(mixinHyperlink(mixinDelega
|
|
|
276
282
|
this.focus();
|
|
277
283
|
dispatchActivationClick(this.itemElement);
|
|
278
284
|
};
|
|
279
|
-
this.addEventListener('click', this.__dispatchClickWithThrottle);
|
|
280
285
|
}
|
|
281
286
|
connectedCallback() {
|
|
282
287
|
// eslint-disable-next-line wc/guard-super-call
|
|
@@ -306,6 +311,10 @@ let ListItem = class ListItem extends mixinBaseButton(mixinHyperlink(mixinDelega
|
|
|
306
311
|
blur() {
|
|
307
312
|
this.itemElement?.blur();
|
|
308
313
|
}
|
|
314
|
+
/** A soft-disabled or skeleton item, or a disabled link, swallows clicks. */
|
|
315
|
+
__isClickBlocked() {
|
|
316
|
+
return this.softDisabled || (this.disabled && !!this.href) || this.skeleton;
|
|
317
|
+
}
|
|
309
318
|
__hasNamedSlot(...names) {
|
|
310
319
|
return names.some(name => Array.from(this.children).some(child => child.getAttribute('slot') === name));
|
|
311
320
|
}
|
|
@@ -375,8 +384,13 @@ let ListItem = class ListItem extends mixinBaseButton(mixinHyperlink(mixinDelega
|
|
|
375
384
|
const hasStart = this.__hasNamedSlot('start');
|
|
376
385
|
const hasEnd = this.__hasNamedSlot('end');
|
|
377
386
|
const hasTrailingSupportingText = this.__hasNamedSlot('trailing-supporting-text');
|
|
387
|
+
// In a clickable item the content gives the button or link its name, so it
|
|
388
|
+
// must stay in the accessibility tree; `inert` would remove it. Slots with a
|
|
389
|
+
// negative tabindex take the slotted content out of the tab order instead,
|
|
390
|
+
// and `.clickable` makes it ignore the pointer (see list-item.scss).
|
|
391
|
+
const slotTabindex = clickable ? '-1' : undefined;
|
|
378
392
|
return b `
|
|
379
|
-
<wc-item class
|
|
393
|
+
<wc-item class=${e({ 'list-item-content': true, clickable })}>
|
|
380
394
|
<div class="background" slot="container"></div>
|
|
381
395
|
${clickable
|
|
382
396
|
? b `<wc-focus-ring
|
|
@@ -393,26 +407,48 @@ let ListItem = class ListItem extends mixinBaseButton(mixinHyperlink(mixinDelega
|
|
|
393
407
|
<wc-skeleton class="skeleton" slot="container"></wc-skeleton>
|
|
394
408
|
|
|
395
409
|
${hasStart
|
|
396
|
-
? b `<slot
|
|
410
|
+
? b `<slot
|
|
411
|
+
class="icon-slot"
|
|
412
|
+
name="start"
|
|
413
|
+
slot="start"
|
|
414
|
+
tabindex=${o(slotTabindex)}
|
|
415
|
+
></slot>`
|
|
397
416
|
: A}
|
|
398
|
-
<slot
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
417
|
+
<slot
|
|
418
|
+
name="overline"
|
|
419
|
+
slot="overline"
|
|
420
|
+
tabindex=${o(slotTabindex)}
|
|
421
|
+
></slot>
|
|
422
|
+
<slot
|
|
423
|
+
name="headline"
|
|
424
|
+
slot="headline"
|
|
425
|
+
tabindex=${o(slotTabindex)}
|
|
426
|
+
></slot>
|
|
427
|
+
<slot tabindex=${o(slotTabindex)}></slot>
|
|
428
|
+
<slot
|
|
429
|
+
name="supporting-text"
|
|
430
|
+
slot="supporting-text"
|
|
431
|
+
tabindex=${o(slotTabindex)}
|
|
432
|
+
></slot>
|
|
402
433
|
${hasTrailingSupportingText
|
|
403
434
|
? b `<slot
|
|
404
435
|
name="trailing-supporting-text"
|
|
405
436
|
slot="trailing-supporting-text"
|
|
437
|
+
tabindex=${o(slotTabindex)}
|
|
406
438
|
></slot>`
|
|
407
439
|
: A}
|
|
408
440
|
${hasEnd
|
|
409
|
-
? b `<slot
|
|
441
|
+
? b `<slot
|
|
442
|
+
class="icon-slot"
|
|
443
|
+
name="end"
|
|
444
|
+
slot="end"
|
|
445
|
+
tabindex=${o(slotTabindex)}
|
|
446
|
+
></slot>`
|
|
410
447
|
: A}
|
|
411
448
|
</wc-item>
|
|
412
449
|
`;
|
|
413
450
|
}
|
|
414
451
|
};
|
|
415
|
-
// ── Static ───────────────────────────────────────────────────────────────
|
|
416
452
|
/** @nocollapse */ // eslint-disable-next-line
|
|
417
453
|
ListItem.shadowRootOptions = {
|
|
418
454
|
mode: 'open',
|
package/dist/list-item.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list-item.js","sources":["../../src/list/list-item.ts"],"sourcesContent":["import { html, LitElement, nothing } from 'lit';\nimport { property, query } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport IndividualComponent from '@/IndividualComponent.js';\nimport styles from './list-item.scss';\nimport { isLink } from '@/__internal/utils/is-link.js';\nimport {\n dispatchActivationClick,\n isActivationClick,\n} from '@/__internal/utils/dispatch-event-utils.js';\nimport { ARIAMixinStrict } from '@/__internal/aria/aria.js';\nimport { mixinBaseButton } from '@/button/base-button/base-button.js';\nimport { mixinHyperlink } from '@/__internal/mixins/hyperlink.js';\nimport { mixinDelegatesAria } from '@/__internal/aria/delegate.js';\nimport { mixinElementInternals } from '@/__internal/mixins/element-internals.js';\n\n/** Where a list item sits among its sibling items; set by `wc-list`. */\nexport type ListItemPosition = 'first' | 'middle' | 'last' | 'only';\n\n/**\n * @label List Item\n * @tag wc-list-item\n * @rawTag list-item\n *\n * @summary One row of a list, with a label, optional text above and below it, and leading and trailing content.\n *\n * @slot - The item's label.\n * @slot start - Leading content, such as an icon or avatar.\n * @slot end - Trailing content, such as an icon.\n * @slot overline - Text above the label.\n * @slot headline - The label, as an alternative to the default slot.\n * @slot supporting-text - Text below the label.\n * @slot trailing-supporting-text - Short text before the `end` slot, such as a count.\n *\n * @cssprop --list-item-container-color - Row background.\n * @cssprop --list-item-label-text-color - Label color.\n * @cssprop --list-item-icon-color - Color of the `start` and `end` content.\n * @cssprop --list-item-state-color - Hover and press state layer color.\n * @cssprop --list-item-selected-container-color - Row background when current.\n * @cssprop --list-item-selected-label-text-color - Label color when current.\n * @cssprop --list-item-selected-icon-color - `start` and `end` color when current.\n * @cssprop --list-item-container-shape - Corner radius of the row.\n * @cssprop --list-item-outer-container-shape - Corner radius of the outer corners of the first and last rows (set by `wc-list` in the segmented variant).\n *\n * @overview\n * <p>Use <code>current</code> for the row of the current page in a navigation list, or\n * <code>wc-listbox</code> to let the person choose items.</p>\n *\n * @example\n * ```html\n * <wc-list-item href=\"/profile\" current>\n * <wc-icon slot=\"start\" name=\"person\"></wc-icon>\n * Profile\n * <wc-icon slot=\"end\" name=\"chevron_right\"></wc-icon>\n * </wc-list-item>\n * ```\n * @tags display\n */\n@IndividualComponent\nexport class ListItem extends mixinBaseButton(\n mixinHyperlink(mixinDelegatesAria(mixinElementInternals(LitElement))),\n) {\n // ── Static ───────────────────────────────────────────────────────────────\n\n /** @nocollapse */ // eslint-disable-next-line\n static override shadowRootOptions: ShadowRootInit = {\n mode: 'open',\n delegatesFocus: true,\n };\n\n static styles = [styles];\n\n // ── Properties ───────────────────────────────────────────────────────────\n\n /**\n * Marks the row of the current page or location in a navigation list: `aria-current=\"page\"`\n * on a link row, `aria-current=\"true\"` otherwise.\n */\n @property({ type: Boolean, reflect: true }) current = false;\n\n /**\n * When true, renders the list-item as a placeholder (a skeleton) while its content is not known\n * yet, and ignores clicks. It is a look, not a busy state (which components spell `loading`).\n */\n @property({ type: Boolean, reflect: true }) skeleton: boolean = false;\n\n /** Renders the row as a button, with hover, press and focus states. */\n @property({ type: Boolean, reflect: true })\n actionable: boolean = false;\n\n /**\n * Where the item sits among its siblings. `wc-list` sets this; the segmented\n * variant rounds the outer corners of the first and last rows with it.\n */\n @property({ type: String, reflect: true, attribute: 'list-position' })\n listPosition?: ListItemPosition;\n\n // ── Queries ───────────────────────────────────────────────────────────────\n\n @query('#list-item') readonly itemElement!: HTMLElement | null;\n\n // ── Private fields ────────────────────────────────────────────────────────\n\n /** Re-renders when slotted children are added, removed or re-slotted. */\n private readonly _contentObserver = new MutationObserver(() => {\n this.requestUpdate();\n });\n\n constructor() {\n super();\n this.addEventListener('click', this.__dispatchClickWithThrottle);\n }\n\n connectedCallback() {\n // eslint-disable-next-line wc/guard-super-call\n super.connectedCallback();\n\n if (!this.hasAttribute('role')) {\n this.setAttribute('role', 'listitem');\n }\n\n this._contentObserver.observe(this, {\n childList: true,\n attributes: true,\n subtree: true,\n attributeFilter: ['slot'],\n });\n }\n\n disconnectedCallback() {\n this._contentObserver.disconnect();\n super.disconnectedCallback();\n }\n\n protected override updated() {\n // wc-item shows its start / end columns from its own light children (our\n // slot elements), which it does not observe; nudge it when ours change.\n this.renderRoot.querySelector<LitElement>('wc-item')?.requestUpdate();\n }\n\n override focus() {\n this.itemElement?.focus();\n }\n\n override blur() {\n this.itemElement?.blur();\n }\n\n __dispatchClick = (event: MouseEvent | KeyboardEvent) => {\n // If the button is soft-disabled or a disabled link, we need to explicitly\n // prevent the click from propagating to other event listeners as well as\n // prevent the default action.\n if (this.softDisabled || (this.disabled && this.href) || this.skeleton) {\n event.stopImmediatePropagation();\n event.preventDefault();\n return;\n }\n\n if (!isActivationClick(event) || !this.itemElement) {\n return;\n }\n\n this.focus();\n dispatchActivationClick(this.itemElement);\n };\n\n private __hasNamedSlot(...names: string[]) {\n return names.some(name =>\n Array.from(this.children).some(\n child => child.getAttribute('slot') === name,\n ),\n );\n }\n\n isClickable() {\n return this.actionable || isLink(this);\n }\n\n render() {\n const isElementLink = isLink(this);\n const clickable = this.isClickable();\n\n const cssClasses = {\n 'list-item': true,\n 'native-button': !isElementLink,\n 'native-link': isElementLink,\n };\n\n // Needed for closure conformance\n const { ariaLabel } = this as ARIAMixinStrict;\n let ariaCurrent: 'page' | 'true' | typeof nothing = nothing;\n if (this.current) ariaCurrent = isElementLink ? 'page' : 'true';\n\n if (!clickable) {\n return html`\n <div\n id=\"list-item\"\n class=${classMap(cssClasses)}\n aria-label=\"${ariaLabel || nothing}\"\n aria-current=${ariaCurrent}\n >\n ${this.renderContent(clickable)}\n </div>\n `;\n }\n\n if (!isElementLink) {\n return html`\n <button\n id=\"list-item\"\n class=${classMap(cssClasses)}\n ?disabled=${this.disabled}\n aria-label=\"${ariaLabel || nothing}\"\n aria-disabled=${this.softDisabled ? 'true' : nothing}\n aria-current=${ariaCurrent}\n @click=${this.__dispatchClick}\n >\n ${this.renderContent(clickable)}\n </button>\n `;\n }\n\n return html`\n <a\n id=\"list-item\"\n class=${classMap(cssClasses)}\n href=${this.href}\n target=${this.target}\n rel=${this.rel || nothing}\n download=${this.download || nothing}\n tabindex=${this.disabled ? '-1' : '0'}\n aria-disabled=${String(this.disabled || this.softDisabled)}\n aria-current=${ariaCurrent}\n @click=${this.__dispatchClick}\n >\n ${this.renderContent(clickable)}\n </a>\n `;\n }\n\n renderContent(clickable: boolean) {\n // The start and end slots are rendered only when used so an empty start or\n // end column does not take up space.\n const hasStart = this.__hasNamedSlot('start');\n const hasEnd = this.__hasNamedSlot('end');\n const hasTrailingSupportingText = this.__hasNamedSlot(\n 'trailing-supporting-text',\n );\n\n return html`\n <wc-item class=\"list-item-content\" ?inert=${clickable}>\n <div class=\"background\" slot=\"container\"></div>\n ${clickable\n ? html`<wc-focus-ring\n class=\"focus-ring\"\n for=\"list-item\"\n slot=\"container\"\n ></wc-focus-ring>\n <wc-ripple\n class=\"ripple\"\n for=\"list-item\"\n slot=\"container\"\n ></wc-ripple>`\n : nothing}\n <wc-skeleton class=\"skeleton\" slot=\"container\"></wc-skeleton>\n\n ${hasStart\n ? html`<slot class=\"icon-slot\" name=\"start\" slot=\"start\"></slot>`\n : nothing}\n <slot name=\"overline\" slot=\"overline\"></slot>\n <slot name=\"headline\" slot=\"headline\"></slot>\n <slot></slot>\n <slot name=\"supporting-text\" slot=\"supporting-text\"></slot>\n ${hasTrailingSupportingText\n ? html`<slot\n name=\"trailing-supporting-text\"\n slot=\"trailing-supporting-text\"\n ></slot>`\n : nothing}\n ${hasEnd\n ? html`<slot class=\"icon-slot\" name=\"end\" slot=\"end\"></slot>`\n : nothing}\n </wc-item>\n `;\n }\n}\n"],"names":["LitElement","nothing","html","classMap","styles","property","query"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmBA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsCG;AAEI,IAAM,QAAQ,GAAd,MAAM,QAAS,SAAQ,eAAe,CAC3C,cAAc,CAAC,kBAAkB,CAAC,qBAAqB,CAACA,GAAU,CAAC,CAAC,CAAC,CACtE,CAAA;AA+CC,IAAA,WAAA,GAAA;AACE,QAAA,KAAK,EAAE;;AAnCT;;;AAGG;QACyC,IAAA,CAAA,OAAO,GAAG,KAAK;AAE3D;;;AAGG;QACyC,IAAA,CAAA,QAAQ,GAAY,KAAK;;QAIrE,IAAA,CAAA,UAAU,GAAY,KAAK;;;AAgBV,QAAA,IAAA,CAAA,gBAAgB,GAAG,IAAI,gBAAgB,CAA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AClD,IAAA,IAAI,EAAE,MAAM;AACZ,IAAA,cAAc,EAAE,IAAI;AACrB,CAHgC;AAK1B,QAAA,CAAA,MAAM,GAAG,CAACG,QAAM,CAAC;AAQoB,UAAA,CAAA;IAA3CC,CAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE;AAAkB,CAAA,EAAA,QAAA,CAAA,SAAA,EAAA,SAAA,EAAA,MAAA,CAAA;AAMhB,UAAA,CAAA;IAA3CA,CAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE;AAA4B,CAAA,EAAA,QAAA,CAAA,SAAA,EAAA,UAAA,EAAA,MAAA,CAAA;AAItE,UAAA,CAAA;IADCA,CAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE;AACd,CAAA,EAAA,QAAA,CAAA,SAAA,EAAA,YAAA,EAAA,MAAA,CAAA;AAO5B,UAAA,CAAA;AADC,IAAAA,CAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,eAAe,EAAE;AACrC,CAAA,EAAA,QAAA,CAAA,SAAA,EAAA,cAAA,EAAA,MAAA,CAAA;AAIF,UAAA,CAAA;IAA7BC,GAAK,CAAC,YAAY;AAA4C,CAAA,EAAA,QAAA,CAAA,SAAA,EAAA,aAAA,EAAA,MAAA,CAAA;AAxCpD,QAAQ,GAAA,UAAA,CAAA;IADpB;AACY,CAAA,EAAA,QAAQ,CAkOpB;;;;"}
|
|
1
|
+
{"version":3,"file":"list-item.js","sources":["../../src/list/list-item.ts"],"sourcesContent":["import { html, LitElement, nothing } from 'lit';\nimport { property, query } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport IndividualComponent from '@/IndividualComponent.js';\nimport styles from './list-item.scss';\nimport { isLink } from '@/__internal/utils/is-link.js';\nimport {\n dispatchActivationClick,\n isActivationClick,\n} from '@/__internal/utils/dispatch-event-utils.js';\nimport { ARIAMixinStrict } from '@/__internal/aria/aria.js';\nimport { mixinBaseButton } from '@/button/base-button/base-button.js';\nimport { mixinHyperlink } from '@/__internal/mixins/hyperlink.js';\nimport { mixinDelegatesAria } from '@/__internal/aria/delegate.js';\nimport { mixinElementInternals } from '@/__internal/mixins/element-internals.js';\n\n/** Where a list item sits among its sibling items; set by `wc-list`. */\nexport type ListItemPosition = 'first' | 'middle' | 'last' | 'only';\n\n/**\n * @label List Item\n * @tag wc-list-item\n * @rawTag list-item\n *\n * @summary One row of a list, with a label, optional text above and below it, and leading and trailing content.\n *\n * @slot - The item's label.\n * @slot start - Leading content, such as an icon or avatar.\n * @slot end - Trailing content, such as an icon.\n * @slot overline - Text above the label.\n * @slot headline - The label, as an alternative to the default slot.\n * @slot supporting-text - Text below the label.\n * @slot trailing-supporting-text - Short text before the `end` slot, such as a count.\n *\n * @cssprop --list-item-container-color - Row background.\n * @cssprop --list-item-label-text-color - Label color.\n * @cssprop --list-item-icon-color - Color of the `start` and `end` content.\n * @cssprop --list-item-state-color - Hover and press state layer color.\n * @cssprop --list-item-selected-container-color - Row background when current.\n * @cssprop --list-item-selected-label-text-color - Label color when current.\n * @cssprop --list-item-selected-icon-color - `start` and `end` color when current.\n * @cssprop --list-item-container-shape - Corner radius of the row.\n * @cssprop --list-item-outer-container-shape - Corner radius of the outer corners of the first and last rows (set by `wc-list` in the segmented variant).\n *\n * @overview\n * <p>Use <code>current</code> for the row of the current page in a navigation list, or\n * <code>wc-listbox</code> to let the person choose items.</p>\n *\n * @example\n * ```html\n * <wc-list-item href=\"/profile\" current>\n * <wc-icon slot=\"start\" name=\"person\"></wc-icon>\n * Profile\n * <wc-icon slot=\"end\" name=\"chevron_right\"></wc-icon>\n * </wc-list-item>\n * ```\n * @tags display\n */\n@IndividualComponent\nexport class ListItem extends mixinBaseButton(\n mixinHyperlink(mixinDelegatesAria(mixinElementInternals(LitElement))),\n) {\n // ── Static ───────────────────────────────────────────────────────────────\n\n /** @nocollapse */ // eslint-disable-next-line\n static override shadowRootOptions: ShadowRootInit = {\n mode: 'open',\n delegatesFocus: true,\n };\n\n static styles = [styles];\n\n // ── Properties ───────────────────────────────────────────────────────────\n\n /**\n * Marks the row of the current page or location in a navigation list: `aria-current=\"page\"`\n * on a link row, `aria-current=\"true\"` otherwise.\n */\n @property({ type: Boolean, reflect: true }) current = false;\n\n /**\n * When true, renders the list-item as a placeholder (a skeleton) while its content is not known\n * yet, and ignores clicks. It is a look, not a busy state (which components spell `loading`).\n */\n @property({ type: Boolean, reflect: true }) skeleton: boolean = false;\n\n /** Renders the row as a button, with hover, press and focus states. */\n @property({ type: Boolean, reflect: true })\n actionable: boolean = false;\n\n /**\n * Where the item sits among its siblings. `wc-list` sets this; the segmented\n * variant rounds the outer corners of the first and last rows with it.\n */\n @property({ type: String, reflect: true, attribute: 'list-position' })\n listPosition?: ListItemPosition;\n\n // ── Queries ───────────────────────────────────────────────────────────────\n\n @query('#list-item') readonly itemElement!: HTMLElement | null;\n\n // ── Private fields ────────────────────────────────────────────────────────\n\n /** Re-renders when slotted children are added, removed or re-slotted. */\n private readonly _contentObserver = new MutationObserver(() => {\n this.requestUpdate();\n });\n\n connectedCallback() {\n // eslint-disable-next-line wc/guard-super-call\n super.connectedCallback();\n\n if (!this.hasAttribute('role')) {\n this.setAttribute('role', 'listitem');\n }\n\n this._contentObserver.observe(this, {\n childList: true,\n attributes: true,\n subtree: true,\n attributeFilter: ['slot'],\n });\n }\n\n disconnectedCallback() {\n this._contentObserver.disconnect();\n super.disconnectedCallback();\n }\n\n protected override updated() {\n // wc-item shows its start / end columns from its own light children (our\n // slot elements), which it does not observe; nudge it when ours change.\n this.renderRoot.querySelector<LitElement>('wc-item')?.requestUpdate();\n }\n\n override focus() {\n this.itemElement?.focus();\n }\n\n override blur() {\n this.itemElement?.blur();\n }\n\n /** A soft-disabled or skeleton item, or a disabled link, swallows clicks. */\n override __isClickBlocked() {\n return this.softDisabled || (this.disabled && !!this.href) || this.skeleton;\n }\n\n __dispatchClick = (event: MouseEvent | KeyboardEvent) => {\n // The inner control calls this directly as well as through the host\n // listener, so it repeats the block.\n if (this.__isClickBlocked()) {\n event.stopImmediatePropagation();\n event.preventDefault();\n return;\n }\n\n if (!isActivationClick(event) || !this.itemElement) {\n return;\n }\n\n this.focus();\n dispatchActivationClick(this.itemElement);\n };\n\n private __hasNamedSlot(...names: string[]) {\n return names.some(name =>\n Array.from(this.children).some(\n child => child.getAttribute('slot') === name,\n ),\n );\n }\n\n isClickable() {\n return this.actionable || isLink(this);\n }\n\n render() {\n const isElementLink = isLink(this);\n const clickable = this.isClickable();\n\n const cssClasses = {\n 'list-item': true,\n 'native-button': !isElementLink,\n 'native-link': isElementLink,\n };\n\n // Needed for closure conformance\n const { ariaLabel } = this as ARIAMixinStrict;\n let ariaCurrent: 'page' | 'true' | typeof nothing = nothing;\n if (this.current) ariaCurrent = isElementLink ? 'page' : 'true';\n\n if (!clickable) {\n return html`\n <div\n id=\"list-item\"\n class=${classMap(cssClasses)}\n aria-label=\"${ariaLabel || nothing}\"\n aria-current=${ariaCurrent}\n >\n ${this.renderContent(clickable)}\n </div>\n `;\n }\n\n if (!isElementLink) {\n return html`\n <button\n id=\"list-item\"\n class=${classMap(cssClasses)}\n ?disabled=${this.disabled}\n aria-label=\"${ariaLabel || nothing}\"\n aria-disabled=${this.softDisabled ? 'true' : nothing}\n aria-current=${ariaCurrent}\n @click=${this.__dispatchClick}\n >\n ${this.renderContent(clickable)}\n </button>\n `;\n }\n\n return html`\n <a\n id=\"list-item\"\n class=${classMap(cssClasses)}\n href=${this.href}\n target=${this.target}\n rel=${this.rel || nothing}\n download=${this.download || nothing}\n tabindex=${this.disabled ? '-1' : '0'}\n aria-disabled=${String(this.disabled || this.softDisabled)}\n aria-current=${ariaCurrent}\n @click=${this.__dispatchClick}\n >\n ${this.renderContent(clickable)}\n </a>\n `;\n }\n\n renderContent(clickable: boolean) {\n // The start and end slots are rendered only when used so an empty start or\n // end column does not take up space.\n const hasStart = this.__hasNamedSlot('start');\n const hasEnd = this.__hasNamedSlot('end');\n const hasTrailingSupportingText = this.__hasNamedSlot(\n 'trailing-supporting-text',\n );\n // In a clickable item the content gives the button or link its name, so it\n // must stay in the accessibility tree; `inert` would remove it. Slots with a\n // negative tabindex take the slotted content out of the tab order instead,\n // and `.clickable` makes it ignore the pointer (see list-item.scss).\n const slotTabindex = clickable ? '-1' : undefined;\n\n return html`\n <wc-item class=${classMap({ 'list-item-content': true, clickable })}>\n <div class=\"background\" slot=\"container\"></div>\n ${clickable\n ? html`<wc-focus-ring\n class=\"focus-ring\"\n for=\"list-item\"\n slot=\"container\"\n ></wc-focus-ring>\n <wc-ripple\n class=\"ripple\"\n for=\"list-item\"\n slot=\"container\"\n ></wc-ripple>`\n : nothing}\n <wc-skeleton class=\"skeleton\" slot=\"container\"></wc-skeleton>\n\n ${hasStart\n ? html`<slot\n class=\"icon-slot\"\n name=\"start\"\n slot=\"start\"\n tabindex=${ifDefined(slotTabindex)}\n ></slot>`\n : nothing}\n <slot\n name=\"overline\"\n slot=\"overline\"\n tabindex=${ifDefined(slotTabindex)}\n ></slot>\n <slot\n name=\"headline\"\n slot=\"headline\"\n tabindex=${ifDefined(slotTabindex)}\n ></slot>\n <slot tabindex=${ifDefined(slotTabindex)}></slot>\n <slot\n name=\"supporting-text\"\n slot=\"supporting-text\"\n tabindex=${ifDefined(slotTabindex)}\n ></slot>\n ${hasTrailingSupportingText\n ? html`<slot\n name=\"trailing-supporting-text\"\n slot=\"trailing-supporting-text\"\n tabindex=${ifDefined(slotTabindex)}\n ></slot>`\n : nothing}\n ${hasEnd\n ? html`<slot\n class=\"icon-slot\"\n name=\"end\"\n slot=\"end\"\n tabindex=${ifDefined(slotTabindex)}\n ></slot>`\n : nothing}\n </wc-item>\n `;\n }\n}\n"],"names":["LitElement","nothing","html","classMap","ifDefined","styles","property","query"],"mappings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CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE;AAAkB,CAAA,EAAA,QAAA,CAAA,SAAA,EAAA,SAAA,EAAA,MAAA,CAAA;AAMhB,UAAA,CAAA;IAA3CA,CAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE;AAA4B,CAAA,EAAA,QAAA,CAAA,SAAA,EAAA,UAAA,EAAA,MAAA,CAAA;AAItE,UAAA,CAAA;IADCA,CAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE;AACd,CAAA,EAAA,QAAA,CAAA,SAAA,EAAA,YAAA,EAAA,MAAA,CAAA;AAO5B,UAAA,CAAA;AADC,IAAAA,CAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,eAAe,EAAE;AACrC,CAAA,EAAA,QAAA,CAAA,SAAA,EAAA,cAAA,EAAA,MAAA,CAAA;AAIF,UAAA,CAAA;IAA7BC,GAAK,CAAC,YAAY;AAA4C,CAAA,EAAA,QAAA,CAAA,SAAA,EAAA,aAAA,EAAA,MAAA,CAAA;AAxCpD,QAAQ,GAAA,UAAA,CAAA;IADpB;AACY,CAAA,EAAA,QAAQ,CA6PpB;;;;"}
|
package/dist/list.js
CHANGED
|
@@ -2,13 +2,15 @@ import { i, _ as __decorate, I as IndividualComponent, a as i$1, b } from './Ind
|
|
|
2
2
|
import { n } from './property-B2TG3KEE.js';
|
|
3
3
|
import { e } from './class-map-NDIkZErE.js';
|
|
4
4
|
import { ListItem } from './list-item.js';
|
|
5
|
-
import { R as RovingFocusController } from './roving-focus-controller-
|
|
5
|
+
import { R as RovingFocusController } from './roving-focus-controller-YtNbxH95.js';
|
|
6
6
|
import './directive-ZPhl09Yt.js';
|
|
7
7
|
import './query-CHb9Ft_d.js';
|
|
8
8
|
import './base-Cl6v8-BZ.js';
|
|
9
|
+
import './if-defined-D9DEJR_6.js';
|
|
9
10
|
import './is-link-Dk2OV3PM.js';
|
|
10
|
-
import './
|
|
11
|
-
import './base-button-
|
|
11
|
+
import './dispatch-event-utils-DfgqVBK8.js';
|
|
12
|
+
import './base-button-9tGu5RSC.js';
|
|
13
|
+
import './activation-gate-D4IpmwyD.js';
|
|
12
14
|
import './warn-once-BNxX1Y98.js';
|
|
13
15
|
import './hyperlink-DycWPKwU.js';
|
|
14
16
|
import './delegate-Bw2wdPFP.js';
|
package/dist/list.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list.js","sources":["../../src/list/list.ts"],"sourcesContent":["import { LitElement, html } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport styles from './list.scss';\nimport { ListItem, type ListItemPosition } from './list-item.js';\nimport IndividualComponent from '@/IndividualComponent.js';\nimport { RovingFocusController } from '@/__internal/controllers/roving-focus-controller.js';\n\n/**\n * @label List\n * @tag wc-list\n * @rawTag list\n *\n * @summary A vertical list of rows, such as contacts or settings; rows that act are reached with the arrow keys.\n * @overview\n * <p>A list shows rows of content. Rows that act (<code>actionable</code> or with an\n * <code>href</code>) form one tab stop: the Up and Down arrow keys move between them, Home and\n * End jump to the first and last, and disabled rows are skipped.</p>\n * <p>For a navigation list, mark the row of the page the person is on with\n * <code>current</code> (<code>aria-current</code>). To let the person choose items, use\n * <code>wc-listbox</code>.</p>\n *\n * @example\n * ```html\n * <wc-list>\n * <wc-list-item href=\"/inbox\" current>\n * <wc-icon slot=\"start\" name=\"inbox\"></wc-icon>\n * Inbox\n * <span slot=\"trailing-supporting-text\">24</span>\n * </wc-list-item>\n * <wc-list-item actionable>\n * <wc-avatar slot=\"start\" name=\"Ada Lovelace\"></wc-avatar>\n * Ada Lovelace\n * <span slot=\"supporting-text\">Software Engineer</span>\n * <wc-icon slot=\"end\" name=\"chevron_right\"></wc-icon>\n * </wc-list-item>\n * </wc-list>\n * ```\n * @tags display\n */\n@IndividualComponent\nexport class List extends LitElement {\n // ── Static\n\n static styles = [styles];\n\n static Item = ListItem;\n\n // ── Properties\n\n /**\n * `standard` rows sit on the surface; `segmented` rows each get a\n * surface-container fill, a small gap and rounded outer corners.\n */\n @property({ type: String, reflect: true }) variant: 'standard' | 'segmented' =\n 'standard';\n\n // ── Private fields\n\n /** One tab stop across the actionable rows, moved with Up/Down, Home and End. */\n private readonly roving = new RovingFocusController(this, {\n items: () => this.items,\n orientation: () => 'vertical',\n isFocusable: item => {\n const row = item as ListItem;\n return row.isClickable() && !row.disabled && !row.hidden;\n },\n });\n\n // ── Lifecycle\n\n connectedCallback() {\n super.connectedCallback();\n this.setAttribute('role', 'list');\n }\n\n // ── Public\n\n override focus(options?: Parameters<HTMLElement['focus']>[0]) {\n this.roving.sync();\n this.roving.activeItem?.focus(options);\n }\n\n get items(): ListItem[] {\n const slot = this.shadowRoot?.querySelector('slot');\n const elements = slot?.assignedElements({ flatten: true }) ?? [];\n return elements.filter(el => el instanceof ListItem) as ListItem[];\n }\n\n // ── Private\n\n /** Only keys from this list's own rows, not from a nested list. */\n private __handleKeyDown = (event: KeyboardEvent) => {\n const owner = event.composedPath().find(target => target instanceof List);\n if (owner !== this) return;\n this.roving.handleKeyDown(event);\n };\n\n private __handleSlotChange = () => {\n this.__syncPositions();\n this.roving.sync();\n };\n\n /** Marks each item first / middle / last / only, for the segmented shape. */\n private __syncPositions() {\n const { items } = this;\n const last = items.length - 1;\n items.forEach((item, index) => {\n let position: ListItemPosition = 'middle';\n if (last === 0) position = 'only';\n else if (index === 0) position = 'first';\n else if (index === last) position = 'last';\n // eslint-disable-next-line no-param-reassign\n item.listPosition = position;\n });\n }\n\n // ── Render\n\n render() {\n const cssClasses = {\n list: true,\n [`variant-${this.variant}`]: true,\n };\n\n return html`\n <div\n class=${classMap(cssClasses)}\n @keydown=${this.__handleKeyDown}\n @focusin=${this.roving.handleFocusIn}\n >\n <slot @slotchange=${this.__handleSlotChange}></slot>\n </div>\n `;\n }\n}\n"],"names":["LitElement","html","classMap","styles","property"],"mappings":"
|
|
1
|
+
{"version":3,"file":"list.js","sources":["../../src/list/list.ts"],"sourcesContent":["import { LitElement, html } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport styles from './list.scss';\nimport { ListItem, type ListItemPosition } from './list-item.js';\nimport IndividualComponent from '@/IndividualComponent.js';\nimport { RovingFocusController } from '@/__internal/controllers/roving-focus-controller.js';\n\n/**\n * @label List\n * @tag wc-list\n * @rawTag list\n *\n * @summary A vertical list of rows, such as contacts or settings; rows that act are reached with the arrow keys.\n * @overview\n * <p>A list shows rows of content. Rows that act (<code>actionable</code> or with an\n * <code>href</code>) form one tab stop: the Up and Down arrow keys move between them, Home and\n * End jump to the first and last, and disabled rows are skipped.</p>\n * <p>For a navigation list, mark the row of the page the person is on with\n * <code>current</code> (<code>aria-current</code>). To let the person choose items, use\n * <code>wc-listbox</code>.</p>\n *\n * @example\n * ```html\n * <wc-list>\n * <wc-list-item href=\"/inbox\" current>\n * <wc-icon slot=\"start\" name=\"inbox\"></wc-icon>\n * Inbox\n * <span slot=\"trailing-supporting-text\">24</span>\n * </wc-list-item>\n * <wc-list-item actionable>\n * <wc-avatar slot=\"start\" name=\"Ada Lovelace\"></wc-avatar>\n * Ada Lovelace\n * <span slot=\"supporting-text\">Software Engineer</span>\n * <wc-icon slot=\"end\" name=\"chevron_right\"></wc-icon>\n * </wc-list-item>\n * </wc-list>\n * ```\n * @tags display\n */\n@IndividualComponent\nexport class List extends LitElement {\n // ── Static\n\n static styles = [styles];\n\n static Item = ListItem;\n\n // ── Properties\n\n /**\n * `standard` rows sit on the surface; `segmented` rows each get a\n * surface-container fill, a small gap and rounded outer corners.\n */\n @property({ type: String, reflect: true }) variant: 'standard' | 'segmented' =\n 'standard';\n\n // ── Private fields\n\n /** One tab stop across the actionable rows, moved with Up/Down, Home and End. */\n private readonly roving = new RovingFocusController(this, {\n items: () => this.items,\n orientation: () => 'vertical',\n isFocusable: item => {\n const row = item as ListItem;\n return row.isClickable() && !row.disabled && !row.hidden;\n },\n });\n\n // ── Lifecycle\n\n connectedCallback() {\n super.connectedCallback();\n this.setAttribute('role', 'list');\n }\n\n // ── Public\n\n override focus(options?: Parameters<HTMLElement['focus']>[0]) {\n this.roving.sync();\n this.roving.activeItem?.focus(options);\n }\n\n get items(): ListItem[] {\n const slot = this.shadowRoot?.querySelector('slot');\n const elements = slot?.assignedElements({ flatten: true }) ?? [];\n return elements.filter(el => el instanceof ListItem) as ListItem[];\n }\n\n // ── Private\n\n /** Only keys from this list's own rows, not from a nested list. */\n private __handleKeyDown = (event: KeyboardEvent) => {\n const owner = event.composedPath().find(target => target instanceof List);\n if (owner !== this) return;\n this.roving.handleKeyDown(event);\n };\n\n private __handleSlotChange = () => {\n this.__syncPositions();\n this.roving.sync();\n };\n\n /** Marks each item first / middle / last / only, for the segmented shape. */\n private __syncPositions() {\n const { items } = this;\n const last = items.length - 1;\n items.forEach((item, index) => {\n let position: ListItemPosition = 'middle';\n if (last === 0) position = 'only';\n else if (index === 0) position = 'first';\n else if (index === last) position = 'last';\n // eslint-disable-next-line no-param-reassign\n item.listPosition = position;\n });\n }\n\n // ── Render\n\n render() {\n const cssClasses = {\n list: true,\n [`variant-${this.variant}`]: true,\n };\n\n return html`\n <div\n class=${classMap(cssClasses)}\n @keydown=${this.__handleKeyDown}\n @focusin=${this.roving.handleFocusIn}\n >\n <slot @slotchange=${this.__handleSlotChange}></slot>\n </div>\n `;\n }\n}\n"],"names":["LitElement","html","classMap","styles","property"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+BG;AAEI,IAAM,IAAI,GAAA,MAAA,GAAV,MAAM,IAAK,SAAQA,GAAU,CAAA;AAA7B,IAAA,WAAA,GAAA;;;;AASL;;;AAGG;QAC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AAdF,IAAI,GAAA,MAAA,GAAA,UAAA,CAAA;IADhB;AACY,CAAA,EAAA,IAAI,CA8FhB;;;;"}
|
package/dist/listbox.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { i, _ as __decorate, I as IndividualComponent, b } from './IndividualComponent-BK7XZjE2.js';
|
|
2
2
|
import { n } from './property-B2TG3KEE.js';
|
|
3
3
|
import { B as BaseInput } from './BaseInput-Cv03GZLu.js';
|
|
4
|
-
import { R as RovingFocusController } from './roving-focus-controller-
|
|
4
|
+
import { R as RovingFocusController } from './roving-focus-controller-YtNbxH95.js';
|
|
5
5
|
import { g as getFormValue } from './form-associated-BHbg72PG.js';
|
|
6
6
|
import { p as peacockString } from './strings-DeiQWMd9.js';
|
|
7
7
|
import { ListboxOption } from './listbox-option.js';
|
package/dist/loader-full.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import './shipped-icons.js';
|
|
2
2
|
import './loader.js';
|
|
3
|
-
import './datasource-
|
|
3
|
+
import './datasource-DxEA6jHW.js';
|
|
4
4
|
import './elevation.js';
|
|
5
5
|
import './IndividualComponent-BK7XZjE2.js';
|
|
6
6
|
import './focus-ring.js';
|
|
@@ -22,12 +22,14 @@ import './observe-slot-change-DPxaZrZF.js';
|
|
|
22
22
|
import './button.js';
|
|
23
23
|
import './if-defined-D9DEJR_6.js';
|
|
24
24
|
import './when-DEJm_QN9.js';
|
|
25
|
-
import './
|
|
25
|
+
import './dispatch-event-utils-DfgqVBK8.js';
|
|
26
26
|
import './ButtonConstants-CahP2_NA.js';
|
|
27
27
|
import './delegate-Bw2wdPFP.js';
|
|
28
|
-
import './form-submitter-
|
|
28
|
+
import './form-submitter-BIFqZ0wq.js';
|
|
29
|
+
import './dispatch-hooks-J_godlHh.js';
|
|
29
30
|
import './element-internals-QME0yEz4.js';
|
|
30
|
-
import './base-button-
|
|
31
|
+
import './base-button-9tGu5RSC.js';
|
|
32
|
+
import './activation-gate-D4IpmwyD.js';
|
|
31
33
|
import './warn-once-BNxX1Y98.js';
|
|
32
34
|
import './form-associated-BHbg72PG.js';
|
|
33
35
|
import './button-group.js';
|
|
@@ -46,7 +48,9 @@ import './menu-trigger-controller-CEJq1ugC.js';
|
|
|
46
48
|
import './dropdown-button.js';
|
|
47
49
|
import './input.js';
|
|
48
50
|
import './spread-B5cgadZl.js';
|
|
49
|
-
import './
|
|
51
|
+
import './implicit-submission-ChLdbxaR.js';
|
|
52
|
+
import './form-submission-h40coUI8.js';
|
|
53
|
+
import './BaseField-DOCmylob.js';
|
|
50
54
|
import './BaseInput-Cv03GZLu.js';
|
|
51
55
|
import './suggestion-controller-7YRQqkaI.js';
|
|
52
56
|
import './ai-controller-DR_Tg0sN.js';
|
|
@@ -55,12 +59,12 @@ import './url-field.js';
|
|
|
55
59
|
import './field.js';
|
|
56
60
|
import './number-field.js';
|
|
57
61
|
import './date-picker.js';
|
|
58
|
-
import './date-
|
|
59
|
-
import './utils-
|
|
62
|
+
import './date-DPQOY8Zd.js';
|
|
63
|
+
import './utils-CQzycr9J.js';
|
|
60
64
|
import './time-picker.js';
|
|
61
65
|
import './date-field.js';
|
|
62
|
-
import './picker-field-
|
|
63
|
-
import './range-utils-
|
|
66
|
+
import './picker-field-BiM3iXAQ.js';
|
|
67
|
+
import './range-utils-vgG1SJ2o.js';
|
|
64
68
|
import './date-range-field.js';
|
|
65
69
|
import './time-field.js';
|
|
66
70
|
import './datetime-field.js';
|
|
@@ -81,7 +85,7 @@ import './item.js';
|
|
|
81
85
|
import './query-all-ThKhg-Lp.js';
|
|
82
86
|
import './list.js';
|
|
83
87
|
import './list-item.js';
|
|
84
|
-
import './roving-focus-controller-
|
|
88
|
+
import './roving-focus-controller-YtNbxH95.js';
|
|
85
89
|
import './timeline.js';
|
|
86
90
|
import './timeline-item.js';
|
|
87
91
|
import './accordion.js';
|
|
@@ -119,6 +123,7 @@ import './clipboard-C7hBdUXP.js';
|
|
|
119
123
|
import './virtual-window-5OYyIqZh.js';
|
|
120
124
|
import './pagination.js';
|
|
121
125
|
import './card.js';
|
|
126
|
+
import './throttle-C7ZAPqtu.js';
|
|
122
127
|
import './card-content.js';
|
|
123
128
|
import './alert.js';
|
|
124
129
|
import './notification-manager.js';
|
|
@@ -204,8 +209,8 @@ import './toolbar.js';
|
|
|
204
209
|
import './app-bar.js';
|
|
205
210
|
import './navigation-rail.js';
|
|
206
211
|
import './navigation-rail-item.js';
|
|
207
|
-
import './indicator-navigation-item-
|
|
208
|
-
import './navigation-item-base-
|
|
212
|
+
import './indicator-navigation-item-BsQE3kUr.js';
|
|
213
|
+
import './navigation-item-base-5ljwtLG_.js';
|
|
209
214
|
import './navigation-bar.js';
|
|
210
215
|
import './navigation-bar-item.js';
|
|
211
216
|
import './navigation-drawer.js';
|
package/dist/loader-full.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loader-full.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"loader-full.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/loader.js
CHANGED
|
@@ -170,16 +170,18 @@ import './class-map-NDIkZErE.js';
|
|
|
170
170
|
import './directive-ZPhl09Yt.js';
|
|
171
171
|
import './sanitize-svg-zWrzQaZj.js';
|
|
172
172
|
import './unsafe-html-Cy_JqoPT.js';
|
|
173
|
-
import './datasource-
|
|
173
|
+
import './datasource-DxEA6jHW.js';
|
|
174
174
|
import './observe-slot-change-DPxaZrZF.js';
|
|
175
175
|
import './if-defined-D9DEJR_6.js';
|
|
176
176
|
import './when-DEJm_QN9.js';
|
|
177
|
-
import './
|
|
177
|
+
import './dispatch-event-utils-DfgqVBK8.js';
|
|
178
178
|
import './ButtonConstants-CahP2_NA.js';
|
|
179
179
|
import './delegate-Bw2wdPFP.js';
|
|
180
|
-
import './form-submitter-
|
|
180
|
+
import './form-submitter-BIFqZ0wq.js';
|
|
181
|
+
import './dispatch-hooks-J_godlHh.js';
|
|
181
182
|
import './element-internals-QME0yEz4.js';
|
|
182
|
-
import './base-button-
|
|
183
|
+
import './base-button-9tGu5RSC.js';
|
|
184
|
+
import './activation-gate-D4IpmwyD.js';
|
|
183
185
|
import './warn-once-BNxX1Y98.js';
|
|
184
186
|
import './form-associated-BHbg72PG.js';
|
|
185
187
|
import './is-link-Dk2OV3PM.js';
|
|
@@ -188,20 +190,22 @@ import './i18n-controller-BTeChxE0.js';
|
|
|
188
190
|
import './locale-DEsJZCQG.js';
|
|
189
191
|
import './menu-trigger-controller-CEJq1ugC.js';
|
|
190
192
|
import './spread-B5cgadZl.js';
|
|
191
|
-
import './
|
|
193
|
+
import './implicit-submission-ChLdbxaR.js';
|
|
194
|
+
import './form-submission-h40coUI8.js';
|
|
195
|
+
import './BaseField-DOCmylob.js';
|
|
192
196
|
import './BaseInput-Cv03GZLu.js';
|
|
193
197
|
import './suggestion-controller-7YRQqkaI.js';
|
|
194
|
-
import './date-
|
|
195
|
-
import './utils-
|
|
196
|
-
import './picker-field-
|
|
197
|
-
import './range-utils-
|
|
198
|
+
import './date-DPQOY8Zd.js';
|
|
199
|
+
import './utils-CQzycr9J.js';
|
|
200
|
+
import './picker-field-BiM3iXAQ.js';
|
|
201
|
+
import './range-utils-vgG1SJ2o.js';
|
|
198
202
|
import './style-map-CHOg6N_R.js';
|
|
199
203
|
import './toggle-base-BtjRAZ5z.js';
|
|
200
204
|
import './floating-controller-CABF4tBT.js';
|
|
201
205
|
import './placement-C4GO0JP9.js';
|
|
202
206
|
import './query-assigned-elements-BJaGSqM0.js';
|
|
203
207
|
import './query-all-ThKhg-Lp.js';
|
|
204
|
-
import './roving-focus-controller-
|
|
208
|
+
import './roving-focus-controller-YtNbxH95.js';
|
|
205
209
|
import './accordion-item.js';
|
|
206
210
|
import './NativeHyperlinkMixin-WdY0fM-H.js';
|
|
207
211
|
import './base-progress-CqsyiVOV.js';
|
|
@@ -211,6 +215,7 @@ import './repeat-D_ERDRYT.js';
|
|
|
211
215
|
import './directive-helpers-Bx3mu42O.js';
|
|
212
216
|
import './clipboard-C7hBdUXP.js';
|
|
213
217
|
import './virtual-window-5OYyIqZh.js';
|
|
218
|
+
import './throttle-C7ZAPqtu.js';
|
|
214
219
|
import './modal-B78gUfEO.js';
|
|
215
220
|
import './live-D_5OfuGD.js';
|
|
216
221
|
import './sparkle-BmtM0vbq.js';
|
|
@@ -218,8 +223,8 @@ import './platform-BUuoTAmr.js';
|
|
|
218
223
|
import './relative-time-BNxqvEbg.js';
|
|
219
224
|
import './url-BFUh__RO.js';
|
|
220
225
|
import './diff-CT416thw.js';
|
|
221
|
-
import './navigation-item-base-
|
|
222
|
-
import './indicator-navigation-item-
|
|
226
|
+
import './navigation-item-base-5ljwtLG_.js';
|
|
227
|
+
import './indicator-navigation-item-BsQE3kUr.js';
|
|
223
228
|
import './site-nav-shared-BDR2HG8e.js';
|
|
224
229
|
|
|
225
230
|
/** Marks `Element.prototype` once its `attachShadow` is wrapped. */
|