@redvars/peacock 3.6.3 → 3.7.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/ButtonConstants-D06bY4uy.js +114 -0
- package/dist/ButtonConstants-D06bY4uy.js.map +1 -0
- package/dist/{BaseHyperlinkMixin-BNuwbiEf.js → NativeHyperlinkMixin-DrYXyfMQ.js} +8 -10
- package/dist/NativeHyperlinkMixin-DrYXyfMQ.js.map +1 -0
- package/dist/assets/components.css +1 -1
- package/dist/assets/components.css.map +1 -1
- package/dist/assets/styles.css +1 -1
- package/dist/assets/styles.css.map +1 -1
- package/dist/{button-colors-Cg6oxiz-.js → button-colors-Dwnez1tR.js} +201 -186
- package/dist/button-colors-Dwnez1tR.js.map +1 -0
- package/dist/button-group.js +8 -8
- package/dist/button-group.js.map +1 -1
- package/dist/button.js +224 -124
- package/dist/button.js.map +1 -1
- package/dist/calendar-column-view.js +0 -1
- package/dist/calendar-column-view.js.map +1 -1
- package/dist/calendar-month-view.js +0 -1
- package/dist/calendar-month-view.js.map +1 -1
- package/dist/card-content.js +0 -1
- package/dist/card-content.js.map +1 -1
- package/dist/card.js +96 -90
- package/dist/card.js.map +1 -1
- package/dist/cb-compound-expression.js +4 -1
- package/dist/cb-compound-expression.js.map +1 -1
- package/dist/cb-divider.js +0 -1
- package/dist/cb-divider.js.map +1 -1
- package/dist/cb-expression.js +0 -2
- package/dist/cb-expression.js.map +1 -1
- package/dist/cb-predicate.js +0 -1
- package/dist/cb-predicate.js.map +1 -1
- package/dist/code-highlighter.js +23 -6
- package/dist/code-highlighter.js.map +1 -1
- package/dist/custom-elements-jsdocs.json +5102 -18408
- package/dist/custom-elements.json +19630 -20205
- package/dist/fab.js +181 -117
- package/dist/fab.js.map +1 -1
- package/dist/{flow-designer-node-9Bqyn6qx.js → flow-designer-node-BWrPuxAR.js} +1 -2
- package/dist/flow-designer-node-BWrPuxAR.js.map +1 -0
- package/dist/flow-designer-node.js +1 -1
- package/dist/flow-designer.js +5 -5
- package/dist/icon-button-DJ0kZXYr.js +318 -0
- package/dist/icon-button-DJ0kZXYr.js.map +1 -0
- package/dist/index.js +8 -8
- package/dist/{navigation-rail-DAUuJ_Yp.js → navigation-rail-CM_svs5_.js} +511 -295
- package/dist/navigation-rail-CM_svs5_.js.map +1 -0
- package/dist/observe-slot-change-D8Xg-kSS.js +60 -0
- package/dist/observe-slot-change-D8Xg-kSS.js.map +1 -0
- package/dist/peacock-loader.js +7 -7
- package/dist/peacock-loader.js.map +1 -1
- package/dist/popover-content.js +0 -1
- package/dist/popover-content.js.map +1 -1
- package/dist/search.js +4 -1
- package/dist/search.js.map +1 -1
- package/dist/src/__controllers/attachable-controller.d.ts +109 -0
- package/dist/src/__mixins/{BaseButtonMixin.d.ts → NativeButtonMixin.d.ts} +3 -3
- package/dist/src/__mixins/{BaseHyperlinkMixin.d.ts → NativeHyperlinkMixin.d.ts} +3 -4
- package/dist/src/__utils/is-link.d.ts +1 -0
- package/dist/src/__utils/observe-slot-change.d.ts +1 -1
- package/dist/src/accordion/accordion-item.d.ts +0 -1
- package/dist/src/breadcrumb/breadcrumb-item/breadcrumb-item.d.ts +0 -1
- package/dist/src/button/ButtonConstants.d.ts +1 -0
- package/dist/src/button/GroupButtonInterface.d.ts +4 -0
- package/dist/src/button/button/button.d.ts +32 -7
- package/dist/src/button/button-group/button-group.d.ts +2 -1
- package/dist/src/button/icon-button/icon-button.d.ts +26 -5
- package/dist/src/button/index.d.ts +1 -1
- package/dist/src/calendar/calendar-column-view.d.ts +0 -1
- package/dist/src/calendar/calendar-month-view.d.ts +0 -1
- package/dist/src/card/card-content.d.ts +0 -1
- package/dist/src/card/card.d.ts +9 -6
- package/dist/src/chip/chip/chip.d.ts +22 -3
- package/dist/src/condition-builder/cb-compound-expression.d.ts +0 -1
- package/dist/src/condition-builder/cb-divider.d.ts +0 -1
- package/dist/src/condition-builder/cb-expression.d.ts +0 -1
- package/dist/src/condition-builder/cb-predicate.d.ts +0 -1
- package/dist/src/fab/fab.d.ts +20 -6
- package/dist/src/flow-designer/flow-designer-node.d.ts +0 -1
- package/dist/src/focus-ring/focus-ring.d.ts +26 -20
- package/dist/src/item/item.d.ts +2 -1
- package/dist/src/link/link.d.ts +1 -1
- package/dist/src/list/list-item.d.ts +1 -2
- package/dist/src/menu/menu-item/menu-item.d.ts +1 -2
- package/dist/src/menu/sub-menu/sub-menu.d.ts +0 -1
- package/dist/src/navigation-rail/navigation-rail-item.d.ts +0 -2
- package/dist/src/popover/popover-content.d.ts +0 -1
- package/dist/src/ripple/ripple.d.ts +9 -1
- package/dist/src/segmented-button/segmented-button.d.ts +0 -1
- package/dist/src/select/option.d.ts +0 -1
- package/dist/src/sidebar-menu/sidebar-menu-item.d.ts +0 -1
- package/dist/src/sidebar-menu/sidebar-sub-menu.d.ts +0 -1
- package/dist/src/tabs/tab-panel.d.ts +0 -1
- package/dist/src/tabs/tab.d.ts +4 -6
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +4 -2
- package/readme.md +2 -2
- package/scss/components.scss +0 -1
- package/scss/mixin.scss +10 -13
- package/scss/styles.scss +1 -3
- package/src/__controllers/attachable-controller.ts +198 -0
- package/src/__mixins/NativeButtonMixin.ts +87 -0
- package/src/__mixins/{BaseHyperlinkMixin.ts → NativeHyperlinkMixin.ts} +15 -15
- package/src/__utils/is-link.ts +3 -0
- package/src/__utils/observe-slot-change.ts +46 -14
- package/src/accordion/accordion-item.scss +1 -1
- package/src/accordion/accordion-item.ts +0 -1
- package/src/breadcrumb/breadcrumb-item/breadcrumb-item.ts +0 -1
- package/src/button/ButtonConstants.ts +1 -0
- package/src/button/GroupButtonInterface.ts +4 -0
- package/src/button/button/button-colors.scss +2 -2
- package/src/button/button/button-layers.scss +124 -0
- package/src/button/button/button-sizes.scss +20 -42
- package/src/button/button/button.scss +72 -169
- package/src/button/button/button.ts +229 -78
- package/src/button/button/only-button.scss +13 -0
- package/src/button/button-group/button-group.ts +59 -17
- package/src/button/icon-button/icon-button-sizes.scss +6 -21
- package/src/button/icon-button/icon-button.ts +198 -93
- package/src/button/index.ts +1 -1
- package/src/calendar/calendar-column-view.ts +0 -1
- package/src/calendar/calendar-month-view.ts +0 -1
- package/src/card/card-content.ts +2 -3
- package/src/card/card.scss +87 -95
- package/src/card/card.ts +62 -60
- package/src/chip/chip/chip.scss +65 -70
- package/src/chip/chip/chip.ts +155 -56
- package/src/code-highlighter/code-highlighter.scss +1 -1
- package/src/code-highlighter/code-highlighter.ts +20 -5
- package/src/condition-builder/cb-compound-expression.scss +4 -0
- package/src/condition-builder/cb-compound-expression.ts +0 -1
- package/src/condition-builder/cb-divider.ts +0 -1
- package/src/condition-builder/cb-expression.scss +0 -1
- package/src/condition-builder/cb-expression.ts +0 -1
- package/src/condition-builder/cb-predicate.ts +0 -1
- package/src/elevation/elevation.scss +5 -1
- package/src/fab/fab-colors.scss +2 -2
- package/src/fab/fab-sizes.scss +24 -34
- package/src/fab/fab.scss +77 -71
- package/src/fab/fab.ts +141 -65
- package/src/flow-designer/flow-designer-node.ts +0 -1
- package/src/focus-ring/focus-ring.ts +81 -72
- package/src/item/item.scss +77 -66
- package/src/item/item.ts +61 -39
- package/src/link/link.scss +1 -10
- package/src/link/link.ts +4 -2
- package/src/list/list-item.ts +8 -8
- package/src/menu/menu-item/menu-item.ts +17 -8
- package/src/menu/sub-menu/sub-menu.ts +0 -1
- package/src/navigation-rail/navigation-rail-item.scss +5 -0
- package/src/navigation-rail/navigation-rail-item.ts +10 -15
- package/src/peacock-loader.ts +1 -1
- package/src/popover/popover-content.ts +0 -1
- package/src/ripple/ripple.ts +52 -20
- package/src/search/search.scss +3 -0
- package/src/segmented-button/segmented-button.ts +0 -1
- package/src/select/option.ts +0 -1
- package/src/sidebar-menu/sidebar-menu-item.ts +0 -1
- package/src/sidebar-menu/sidebar-sub-menu.ts +0 -1
- package/src/skeleton/skeleton.scss +5 -1
- package/src/tabs/tab-panel.ts +0 -1
- package/src/tabs/tab.ts +60 -70
- package/src/text/text.css-component.scss +3 -21
- package/src/tooltip/tooltip.scss +5 -8
- package/src/tooltip/tooltip.ts +1 -2
- package/dist/BaseButton-BNFAYn-S.js +0 -219
- package/dist/BaseButton-BNFAYn-S.js.map +0 -1
- package/dist/BaseHyperlinkMixin-BNuwbiEf.js.map +0 -1
- package/dist/button-colors-Cg6oxiz-.js.map +0 -1
- package/dist/flow-designer-node-9Bqyn6qx.js.map +0 -1
- package/dist/icon-button-AdJBEoNy.js +0 -251
- package/dist/icon-button-AdJBEoNy.js.map +0 -1
- package/dist/navigation-rail-DAUuJ_Yp.js.map +0 -1
- package/dist/observe-slot-change-BGJfgg2E.js +0 -31
- package/dist/observe-slot-change-BGJfgg2E.js.map +0 -1
- package/dist/src/button/BaseButton.d.ts +0 -28
- package/dist/src/focus-ring/FocusAttachableController.d.ts +0 -8
- package/src/__mixins/BaseButtonMixin.ts +0 -83
- package/src/button/BaseButton.ts +0 -113
- package/src/focus-ring/FocusAttachableController.ts +0 -28
- package/src/popover/tooltip.css-component.scss +0 -19
|
@@ -2,12 +2,12 @@ import { a as i, _ as __decorate, i as i$1, b, A, c as __classPrivateFieldGet, w
|
|
|
2
2
|
import { n } from './property-1psGvXOq.js';
|
|
3
3
|
import { e as e$1 } from './class-map-YU7g0o3B.js';
|
|
4
4
|
import { r } from './state-DwbEjqVk.js';
|
|
5
|
-
import { o as observerSlotChangesWithCallback } from './observe-slot-change-
|
|
5
|
+
import { o as observerSlotChangesWithCallback } from './observe-slot-change-D8Xg-kSS.js';
|
|
6
6
|
import { a as e, e as e$2 } from './query-QBcUV-L_.js';
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
7
|
+
import { N as NativeHyperlinkMixin, i as isLink, t as throttle } from './NativeHyperlinkMixin-DrYXyfMQ.js';
|
|
8
|
+
import { N as NativeButtonMixin, D as DISABLED_REASON_ID, o as o$1, s as spread } from './ButtonConstants-D06bY4uy.js';
|
|
9
|
+
import { i as isActivationClick, d as dispatchActivationClick, r as redispatchEvent } from './dispatch-event-utils-CuEqjlPT.js';
|
|
9
10
|
import { o as o$2 } from './style-map-DVmWOuYy.js';
|
|
10
|
-
import { r as redispatchEvent, i as isActivationClick, d as dispatchActivationClick } from './dispatch-event-utils-CuEqjlPT.js';
|
|
11
11
|
import { B as BaseInput } from './BaseInput-14YmcfK7.js';
|
|
12
12
|
import { F as FloatingController } from './popover-DUPmMVWS.js';
|
|
13
13
|
import { i as isDarkMode, o as observeThemeChange } from './is-dark-mode-DOcaw4Yq.js';
|
|
@@ -516,7 +516,6 @@ var css_248z$R = i`* {
|
|
|
516
516
|
* @tag wc-segmented-button
|
|
517
517
|
* @rawTag segmented-button
|
|
518
518
|
* @summary An individual segment within a segmented button group.
|
|
519
|
-
* @parentRawTag segmented-button-group
|
|
520
519
|
* @overview
|
|
521
520
|
* <p>Segmented buttons help people select options, switch views, or sort elements. They are used within a <code>wc-segmented-button-group</code>.</p>
|
|
522
521
|
*
|
|
@@ -812,6 +811,126 @@ var css_248z$P = i`:host {
|
|
|
812
811
|
outline: 3px solid var(--focus-ring-color);
|
|
813
812
|
}`;
|
|
814
813
|
|
|
814
|
+
/**
|
|
815
|
+
* A key to retrieve an `Attachable` element's `AttachableController` from a
|
|
816
|
+
* global `MutationObserver`.
|
|
817
|
+
*/
|
|
818
|
+
const ATTACHABLE_CONTROLLER = Symbol('attachableController');
|
|
819
|
+
let FOR_ATTRIBUTE_OBSERVER;
|
|
820
|
+
{
|
|
821
|
+
/**
|
|
822
|
+
* A global `MutationObserver` that reacts to `for` attribute changes on
|
|
823
|
+
* `Attachable` elements. If the `for` attribute changes, the controller will
|
|
824
|
+
* re-attach to the new referenced element.
|
|
825
|
+
*/
|
|
826
|
+
FOR_ATTRIBUTE_OBSERVER = new MutationObserver(records => {
|
|
827
|
+
for (const record of records) {
|
|
828
|
+
// When a control's `for` attribute changes, inform its
|
|
829
|
+
// `AttachableController` to update to a new control.
|
|
830
|
+
record.target[ATTACHABLE_CONTROLLER]?.hostConnected();
|
|
831
|
+
}
|
|
832
|
+
});
|
|
833
|
+
}
|
|
834
|
+
/**
|
|
835
|
+
* A controller that provides an implementation for `Attachable` elements.
|
|
836
|
+
*
|
|
837
|
+
* @example
|
|
838
|
+
* ```ts
|
|
839
|
+
* class MyElement extends LitElement implements Attachable {
|
|
840
|
+
* get control() { return this.attachableController.control; }
|
|
841
|
+
*
|
|
842
|
+
* private readonly attachableController = new AttachableController(
|
|
843
|
+
* this,
|
|
844
|
+
* (previousControl, newControl) => {
|
|
845
|
+
* previousControl?.removeEventListener('click', this.handleClick);
|
|
846
|
+
* newControl?.addEventListener('click', this.handleClick);
|
|
847
|
+
* }
|
|
848
|
+
* );
|
|
849
|
+
*
|
|
850
|
+
* // Implement remaining `Attachable` properties/methods that call the
|
|
851
|
+
* // controller's properties/methods.
|
|
852
|
+
* }
|
|
853
|
+
* ```
|
|
854
|
+
*/
|
|
855
|
+
class AttachableController {
|
|
856
|
+
get htmlFor() {
|
|
857
|
+
return this.host.getAttribute('for');
|
|
858
|
+
}
|
|
859
|
+
set htmlFor(htmlFor) {
|
|
860
|
+
if (htmlFor === null) {
|
|
861
|
+
this.host.removeAttribute('for');
|
|
862
|
+
}
|
|
863
|
+
else {
|
|
864
|
+
this.host.setAttribute('for', htmlFor);
|
|
865
|
+
}
|
|
866
|
+
}
|
|
867
|
+
get control() {
|
|
868
|
+
if (this.host.hasAttribute('for')) {
|
|
869
|
+
if (!this.htmlFor || !this.host.isConnected) {
|
|
870
|
+
return null;
|
|
871
|
+
}
|
|
872
|
+
return this.host.getRootNode().querySelector(`#${this.htmlFor}`);
|
|
873
|
+
}
|
|
874
|
+
return this.currentControl || this.host.parentElement;
|
|
875
|
+
}
|
|
876
|
+
set control(control) {
|
|
877
|
+
if (control) {
|
|
878
|
+
this.attach(control);
|
|
879
|
+
}
|
|
880
|
+
else {
|
|
881
|
+
this.detach();
|
|
882
|
+
}
|
|
883
|
+
}
|
|
884
|
+
/**
|
|
885
|
+
* Creates a new controller for an `Attachable` element.
|
|
886
|
+
*
|
|
887
|
+
* @param host The `Attachable` element.
|
|
888
|
+
* @param onControlChange A callback with two parameters for the previous and
|
|
889
|
+
* next control. An `Attachable` element may perform setup or teardown
|
|
890
|
+
* logic whenever the control changes.
|
|
891
|
+
*/
|
|
892
|
+
constructor(host, onControlChange) {
|
|
893
|
+
this.host = host;
|
|
894
|
+
this.onControlChange = onControlChange;
|
|
895
|
+
this.currentControl = null;
|
|
896
|
+
host.addController(this);
|
|
897
|
+
host[ATTACHABLE_CONTROLLER] = this;
|
|
898
|
+
FOR_ATTRIBUTE_OBSERVER?.observe(host, { attributeFilter: ['for'] });
|
|
899
|
+
}
|
|
900
|
+
attach(control) {
|
|
901
|
+
if (control === this.currentControl) {
|
|
902
|
+
return;
|
|
903
|
+
}
|
|
904
|
+
this.setCurrentControl(control);
|
|
905
|
+
// When imperatively attaching, remove the `for` attribute so
|
|
906
|
+
// that the attached control is used instead of a referenced one.
|
|
907
|
+
this.host.removeAttribute('for');
|
|
908
|
+
}
|
|
909
|
+
detach() {
|
|
910
|
+
this.setCurrentControl(null);
|
|
911
|
+
// When imperatively detaching, add an empty `for=""` attribute. This will
|
|
912
|
+
// ensure the control is `null` rather than the `parentElement`.
|
|
913
|
+
this.host.setAttribute('for', '');
|
|
914
|
+
}
|
|
915
|
+
/** @private */
|
|
916
|
+
hostConnected() {
|
|
917
|
+
this.setCurrentControl(this.control);
|
|
918
|
+
}
|
|
919
|
+
/** @private */
|
|
920
|
+
hostDisconnected() {
|
|
921
|
+
this.setCurrentControl(null);
|
|
922
|
+
}
|
|
923
|
+
setCurrentControl(control) {
|
|
924
|
+
this.onControlChange(this.currentControl, control);
|
|
925
|
+
this.currentControl = control;
|
|
926
|
+
}
|
|
927
|
+
}
|
|
928
|
+
|
|
929
|
+
/**
|
|
930
|
+
* Events that the focus ring listens to.
|
|
931
|
+
*/
|
|
932
|
+
const EVENTS$1 = ['focusin', 'focusout', 'pointerdown'];
|
|
933
|
+
const HANDLED_BY_FOCUS_RING = Symbol('handledByFocusRing');
|
|
815
934
|
/**
|
|
816
935
|
* @label Focus Ring
|
|
817
936
|
*
|
|
@@ -822,90 +941,80 @@ var css_248z$P = i`:host {
|
|
|
822
941
|
*
|
|
823
942
|
*
|
|
824
943
|
* @tags display
|
|
944
|
+
*
|
|
945
|
+
* @fires visibility-changed {Event} Fired whenever `visible` changes.
|
|
825
946
|
*/
|
|
826
947
|
class FocusRing extends i$1 {
|
|
827
948
|
constructor() {
|
|
828
949
|
super(...arguments);
|
|
950
|
+
/**
|
|
951
|
+
* Makes the focus ring visible.
|
|
952
|
+
*/
|
|
829
953
|
this.visible = false;
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
this.
|
|
954
|
+
/**
|
|
955
|
+
* Makes the focus ring animate inwards instead of outwards.
|
|
956
|
+
*/
|
|
957
|
+
this.inward = false;
|
|
958
|
+
this.attachableController = new AttachableController(this, this.onControlChange.bind(this));
|
|
834
959
|
}
|
|
835
|
-
|
|
836
|
-
return
|
|
960
|
+
get htmlFor() {
|
|
961
|
+
return this.attachableController.htmlFor;
|
|
837
962
|
}
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
this.attach();
|
|
963
|
+
set htmlFor(htmlFor) {
|
|
964
|
+
this.attachableController.htmlFor = htmlFor;
|
|
841
965
|
}
|
|
842
|
-
|
|
843
|
-
this.
|
|
844
|
-
super.disconnectedCallback();
|
|
966
|
+
get control() {
|
|
967
|
+
return this.attachableController.control;
|
|
845
968
|
}
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
const prevId = changed.get('for');
|
|
849
|
-
if (prevId) {
|
|
850
|
-
const root = this.parentElement?.getRootNode();
|
|
851
|
-
const prevEl = root?.getElementById(prevId) ?? document.getElementById(prevId);
|
|
852
|
-
if (prevEl) {
|
|
853
|
-
prevEl.removeEventListener('focusin', this.__boundFocusin);
|
|
854
|
-
prevEl.removeEventListener('focusout', this.__boundFocusout);
|
|
855
|
-
prevEl.removeEventListener('pointerdown', this.__boundPointerdown);
|
|
856
|
-
}
|
|
857
|
-
}
|
|
858
|
-
this.attach();
|
|
859
|
-
}
|
|
969
|
+
set control(control) {
|
|
970
|
+
this.attachableController.control = control;
|
|
860
971
|
}
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
this.visible = focusTarget?.matches(':focus-visible') ?? false;
|
|
972
|
+
attach(control) {
|
|
973
|
+
this.attachableController.attach(control);
|
|
864
974
|
}
|
|
865
|
-
|
|
866
|
-
this.
|
|
975
|
+
detach() {
|
|
976
|
+
this.attachableController.detach();
|
|
867
977
|
}
|
|
868
|
-
|
|
869
|
-
|
|
978
|
+
connectedCallback() {
|
|
979
|
+
super.connectedCallback();
|
|
980
|
+
// Needed for VoiceOver, which will create a "group" if the element is a
|
|
981
|
+
// sibling to other content.
|
|
982
|
+
this.setAttribute('aria-hidden', 'true');
|
|
870
983
|
}
|
|
871
|
-
/**
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
if (focusTarget) {
|
|
889
|
-
return focusTarget;
|
|
890
|
-
}
|
|
984
|
+
/** @private */
|
|
985
|
+
handleEvent(event) {
|
|
986
|
+
if (event[HANDLED_BY_FOCUS_RING]) {
|
|
987
|
+
// This ensures the focus ring does not activate when multiple focus rings
|
|
988
|
+
// are used within a single component.
|
|
989
|
+
return;
|
|
990
|
+
}
|
|
991
|
+
switch (event.type) {
|
|
992
|
+
case 'focusin':
|
|
993
|
+
this.visible = this.control?.matches(':focus-visible') ?? false;
|
|
994
|
+
break;
|
|
995
|
+
case 'focusout':
|
|
996
|
+
case 'pointerdown':
|
|
997
|
+
this.visible = false;
|
|
998
|
+
break;
|
|
999
|
+
default:
|
|
1000
|
+
return;
|
|
891
1001
|
}
|
|
892
|
-
|
|
1002
|
+
// eslint-disable-next-line no-param-reassign
|
|
1003
|
+
event[HANDLED_BY_FOCUS_RING] = true;
|
|
893
1004
|
}
|
|
894
|
-
|
|
895
|
-
const
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
focusTarget.addEventListener('focusout', this.__boundFocusout);
|
|
899
|
-
focusTarget.addEventListener('pointerdown', this.__boundPointerdown);
|
|
1005
|
+
onControlChange(prev, next) {
|
|
1006
|
+
for (const event of EVENTS$1) {
|
|
1007
|
+
prev?.removeEventListener(event, this);
|
|
1008
|
+
next?.addEventListener(event, this);
|
|
900
1009
|
}
|
|
901
1010
|
}
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
focusTarget.removeEventListener('pointerdown', this.__boundPointerdown);
|
|
1011
|
+
update(changed) {
|
|
1012
|
+
if (changed.has('visible')) {
|
|
1013
|
+
// This logic can be removed once the `:has` selector has been introduced
|
|
1014
|
+
// to Firefox. This is necessary to allow correct submenu styles.
|
|
1015
|
+
this.dispatchEvent(new Event('visibility-changed'));
|
|
908
1016
|
}
|
|
1017
|
+
super.update(changed);
|
|
909
1018
|
}
|
|
910
1019
|
}
|
|
911
1020
|
FocusRing.styles = [css_248z$P];
|
|
@@ -913,8 +1022,8 @@ __decorate([
|
|
|
913
1022
|
n({ type: Boolean, reflect: true })
|
|
914
1023
|
], FocusRing.prototype, "visible", void 0);
|
|
915
1024
|
__decorate([
|
|
916
|
-
n({ type:
|
|
917
|
-
], FocusRing.prototype, "
|
|
1025
|
+
n({ type: Boolean, reflect: true })
|
|
1026
|
+
], FocusRing.prototype, "inward", void 0);
|
|
918
1027
|
|
|
919
1028
|
const PRESS_GROW_MS = 450;
|
|
920
1029
|
const MINIMUM_PRESS_MS = 225;
|
|
@@ -1037,38 +1146,50 @@ class Ripple extends i$1 {
|
|
|
1037
1146
|
this.rippleScale = '';
|
|
1038
1147
|
this.initialSize = 0;
|
|
1039
1148
|
this.state = State.INACTIVE;
|
|
1149
|
+
this._boundHandleEvent = this.handleEvent.bind(this);
|
|
1150
|
+
this.attachableController = new AttachableController(
|
|
1151
|
+
// `LitElement` satisfies the ReactiveControllerHost & HTMLElement shape
|
|
1152
|
+
// required by the controller.
|
|
1153
|
+
this, this.onControlChange.bind(this));
|
|
1154
|
+
}
|
|
1155
|
+
get htmlFor() {
|
|
1156
|
+
return this.attachableController.htmlFor;
|
|
1157
|
+
}
|
|
1158
|
+
set htmlFor(htmlFor) {
|
|
1159
|
+
this.attachableController.htmlFor = htmlFor;
|
|
1160
|
+
}
|
|
1161
|
+
get control() {
|
|
1162
|
+
return this.attachableController.control;
|
|
1163
|
+
}
|
|
1164
|
+
set control(control) {
|
|
1165
|
+
this.attachableController.control = control;
|
|
1040
1166
|
}
|
|
1041
1167
|
connectedCallback() {
|
|
1042
1168
|
super.connectedCallback();
|
|
1043
1169
|
// Needed for VoiceOver, which will create a "group" if the element is a
|
|
1044
1170
|
// sibling to other content.
|
|
1045
1171
|
this.setAttribute('aria-hidden', 'true');
|
|
1046
|
-
// Attach to parent
|
|
1047
|
-
this.attach(this.parentElement);
|
|
1048
1172
|
}
|
|
1049
1173
|
disconnectedCallback() {
|
|
1050
1174
|
super.disconnectedCallback();
|
|
1051
1175
|
this.detach();
|
|
1052
1176
|
}
|
|
1053
1177
|
attach(control) {
|
|
1054
|
-
|
|
1055
|
-
return;
|
|
1056
|
-
EVENTS.forEach(event => {
|
|
1057
|
-
control.addEventListener(event, this.handleEvent.bind(this));
|
|
1058
|
-
});
|
|
1178
|
+
this.attachableController.attach(control);
|
|
1059
1179
|
}
|
|
1060
1180
|
detach() {
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1181
|
+
this.attachableController.detach();
|
|
1182
|
+
}
|
|
1183
|
+
onControlChange(prev, next) {
|
|
1184
|
+
for (const event of EVENTS) {
|
|
1185
|
+
prev?.removeEventListener(event, this._boundHandleEvent);
|
|
1186
|
+
next?.addEventListener(event, this._boundHandleEvent);
|
|
1187
|
+
}
|
|
1067
1188
|
}
|
|
1068
1189
|
render() {
|
|
1069
1190
|
const classes = {
|
|
1070
|
-
|
|
1071
|
-
|
|
1191
|
+
hovered: this.hovered,
|
|
1192
|
+
pressed: this.pressed,
|
|
1072
1193
|
};
|
|
1073
1194
|
return b `<div class="surface ${e$1(classes)}"></div>`;
|
|
1074
1195
|
}
|
|
@@ -1121,7 +1242,7 @@ class Ripple extends i$1 {
|
|
|
1121
1242
|
}
|
|
1122
1243
|
// Wait for a hold after touch delay
|
|
1123
1244
|
this.state = State.TOUCH_DELAY;
|
|
1124
|
-
await new Promise(
|
|
1245
|
+
await new Promise(resolve => {
|
|
1125
1246
|
setTimeout(resolve, TOUCH_DELAY_MS);
|
|
1126
1247
|
});
|
|
1127
1248
|
if (this.state !== State.TOUCH_DELAY) {
|
|
@@ -1233,7 +1354,7 @@ class Ripple extends i$1 {
|
|
|
1233
1354
|
this.pressed = false;
|
|
1234
1355
|
return;
|
|
1235
1356
|
}
|
|
1236
|
-
await new Promise(
|
|
1357
|
+
await new Promise(resolve => {
|
|
1237
1358
|
setTimeout(resolve, MINIMUM_PRESS_MS - pressAnimationPlayState);
|
|
1238
1359
|
});
|
|
1239
1360
|
if (this.growAnimation !== animation) {
|
|
@@ -1349,13 +1470,16 @@ Ripple.styles = i `
|
|
|
1349
1470
|
&::before {
|
|
1350
1471
|
background-color: var(--ripple-pressed-color, var(--color-on-surface));
|
|
1351
1472
|
inset: 0;
|
|
1352
|
-
transition:
|
|
1473
|
+
transition:
|
|
1474
|
+
opacity 15ms linear,
|
|
1475
|
+
background-color 15ms linear;
|
|
1353
1476
|
}
|
|
1354
1477
|
|
|
1355
1478
|
&::after {
|
|
1356
1479
|
background: radial-gradient(
|
|
1357
1480
|
closest-side,
|
|
1358
|
-
var(--ripple-pressed-color, var(--color-on-surface))
|
|
1481
|
+
var(--ripple-pressed-color, var(--color-on-surface))
|
|
1482
|
+
max(calc(100% - 70px), 65%),
|
|
1359
1483
|
transparent 100%
|
|
1360
1484
|
);
|
|
1361
1485
|
transform-origin: center center;
|
|
@@ -1518,7 +1642,7 @@ var css_248z$O = i`* {
|
|
|
1518
1642
|
border-block-start: 1px solid var(--color-outline-variant);
|
|
1519
1643
|
}
|
|
1520
1644
|
.expansion-panel.open .content-inner {
|
|
1521
|
-
padding:
|
|
1645
|
+
padding: var(--spacing-200) var(--spacing-300);
|
|
1522
1646
|
}
|
|
1523
1647
|
.expansion-panel.open .toggle-icon {
|
|
1524
1648
|
transform: rotate(180deg);
|
|
@@ -1542,7 +1666,6 @@ var _AccordionItem_id;
|
|
|
1542
1666
|
* @tag wc-accordion-item
|
|
1543
1667
|
* @rawTag accordion-item
|
|
1544
1668
|
* @summary An expansion panel with a header that reveals or hides associated content. Follows Material Design 3 expansion panel guidelines.
|
|
1545
|
-
* @parentRawTag accordion
|
|
1546
1669
|
*
|
|
1547
1670
|
* @slot - The body content revealed when the panel is expanded.
|
|
1548
1671
|
* @slot heading - The panel title. Renders as `body-large` text.
|
|
@@ -1853,9 +1976,7 @@ var css_248z$M = i`* {
|
|
|
1853
1976
|
}
|
|
1854
1977
|
|
|
1855
1978
|
:host {
|
|
1856
|
-
display: inline
|
|
1857
|
-
border-radius: inherit;
|
|
1858
|
-
corner-shape: inherit;
|
|
1979
|
+
display: inline;
|
|
1859
1980
|
color: var(--color-primary);
|
|
1860
1981
|
}
|
|
1861
1982
|
|
|
@@ -1873,12 +1994,6 @@ var css_248z$M = i`* {
|
|
|
1873
1994
|
:host(.inherit) .link {
|
|
1874
1995
|
color: inherit;
|
|
1875
1996
|
text-decoration: none !important;
|
|
1876
|
-
}
|
|
1877
|
-
|
|
1878
|
-
:host(.with-icon) .link {
|
|
1879
|
-
display: inline-flex;
|
|
1880
|
-
align-items: center;
|
|
1881
|
-
gap: 0.5em;
|
|
1882
1997
|
}`;
|
|
1883
1998
|
|
|
1884
1999
|
/**
|
|
@@ -1894,14 +2009,16 @@ var css_248z$M = i`* {
|
|
|
1894
2009
|
* <wc-link href="#">Link</wc-link>
|
|
1895
2010
|
* ```
|
|
1896
2011
|
*/
|
|
1897
|
-
class Link extends
|
|
2012
|
+
class Link extends NativeHyperlinkMixin(i$1) {
|
|
1898
2013
|
render() {
|
|
1899
2014
|
return b `<a
|
|
1900
2015
|
class=${e$1({
|
|
1901
2016
|
link: true,
|
|
1902
2017
|
})}
|
|
1903
2018
|
href=${this.href}
|
|
2019
|
+
?download=${this.download}
|
|
1904
2020
|
target=${this.target}
|
|
2021
|
+
?rel=${this.rel}
|
|
1905
2022
|
?tabindex=${this.parentElement?.tabIndex}
|
|
1906
2023
|
>
|
|
1907
2024
|
<slot></slot>
|
|
@@ -2235,6 +2352,7 @@ var css_248z$I = i`* {
|
|
|
2235
2352
|
}
|
|
2236
2353
|
|
|
2237
2354
|
:host {
|
|
2355
|
+
position: relative;
|
|
2238
2356
|
display: inline-flex;
|
|
2239
2357
|
--chip-container-color: var(--color-surface);
|
|
2240
2358
|
--chip-label-text-color: var(--color-on-surface);
|
|
@@ -2258,12 +2376,12 @@ var css_248z$I = i`* {
|
|
|
2258
2376
|
}
|
|
2259
2377
|
|
|
2260
2378
|
.chip {
|
|
2261
|
-
position: relative;
|
|
2262
2379
|
display: inline-flex;
|
|
2263
2380
|
align-items: center;
|
|
2264
2381
|
height: var(--chip-height, var(--_chip-height, 2rem));
|
|
2265
2382
|
width: 100%;
|
|
2266
2383
|
cursor: pointer;
|
|
2384
|
+
z-index: 0;
|
|
2267
2385
|
}
|
|
2268
2386
|
.chip .tag-content {
|
|
2269
2387
|
position: relative;
|
|
@@ -2315,17 +2433,6 @@ var css_248z$I = i`* {
|
|
|
2315
2433
|
--icon-size: 1rem;
|
|
2316
2434
|
--icon-color: var(--color-primary);
|
|
2317
2435
|
}
|
|
2318
|
-
.chip .focus-ring {
|
|
2319
|
-
z-index: 2;
|
|
2320
|
-
display: block;
|
|
2321
|
-
--focus-ring-container-shape: var(--chip-container-shape);
|
|
2322
|
-
}
|
|
2323
|
-
.chip .ripple {
|
|
2324
|
-
display: block;
|
|
2325
|
-
border-radius: var(--chip-container-shape);
|
|
2326
|
-
--ripple-state-opacity: var(--_chip-state-opacity, 0);
|
|
2327
|
-
--ripple-pressed-color: var(--_chip-state-color);
|
|
2328
|
-
}
|
|
2329
2436
|
.chip.disabled {
|
|
2330
2437
|
cursor: not-allowed;
|
|
2331
2438
|
}
|
|
@@ -2341,14 +2448,27 @@ var css_248z$I = i`* {
|
|
|
2341
2448
|
.chip.icon-slot-has-content .icon-slot-container, .chip.selected .icon-slot-container {
|
|
2342
2449
|
padding-inline: calc(var(--chip-container-padding) / 2);
|
|
2343
2450
|
}
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
|
|
2451
|
+
|
|
2452
|
+
/*
|
|
2453
|
+
Background layers
|
|
2454
|
+
*/
|
|
2455
|
+
.focus-ring {
|
|
2456
|
+
z-index: 2;
|
|
2457
|
+
display: block;
|
|
2458
|
+
--focus-ring-container-shape: var(--chip-container-shape);
|
|
2348
2459
|
}
|
|
2349
|
-
|
|
2460
|
+
|
|
2461
|
+
.ripple {
|
|
2462
|
+
display: block;
|
|
2463
|
+
border-radius: var(--chip-container-shape);
|
|
2464
|
+
--ripple-state-opacity: var(--_chip-state-opacity, 0);
|
|
2465
|
+
--ripple-pressed-color: var(--_chip-state-color);
|
|
2466
|
+
}
|
|
2467
|
+
|
|
2468
|
+
.background {
|
|
2350
2469
|
display: block;
|
|
2351
2470
|
position: absolute;
|
|
2471
|
+
top: 0;
|
|
2352
2472
|
left: 0;
|
|
2353
2473
|
width: 100%;
|
|
2354
2474
|
height: 100%;
|
|
@@ -2356,45 +2476,52 @@ var css_248z$I = i`* {
|
|
|
2356
2476
|
background: var(--_chip-container-color);
|
|
2357
2477
|
pointer-events: none;
|
|
2358
2478
|
}
|
|
2359
|
-
|
|
2479
|
+
|
|
2480
|
+
.outline {
|
|
2360
2481
|
z-index: 0;
|
|
2361
2482
|
display: block;
|
|
2362
2483
|
position: absolute;
|
|
2484
|
+
top: 0;
|
|
2363
2485
|
left: 0;
|
|
2364
2486
|
width: 100%;
|
|
2365
2487
|
height: 100%;
|
|
2366
2488
|
border-radius: var(--chip-container-shape);
|
|
2367
2489
|
border: 1px solid var(--chip-outline-color);
|
|
2368
2490
|
}
|
|
2369
|
-
|
|
2491
|
+
|
|
2492
|
+
.elevation {
|
|
2370
2493
|
--elevation-level: 0;
|
|
2371
2494
|
transition-duration: 280ms;
|
|
2372
2495
|
--elevation-container-shape: var(--chip-container-shape);
|
|
2373
2496
|
}
|
|
2374
2497
|
|
|
2375
|
-
|
|
2376
|
-
|
|
2498
|
+
/* Color/state management */
|
|
2499
|
+
:host {
|
|
2377
2500
|
--_chip-container-color: var(--chip-container-color);
|
|
2378
2501
|
--_chip-text-color: var(--chip-label-text-color);
|
|
2379
2502
|
--_chip-state-color: var(--_chip-text-color);
|
|
2380
2503
|
}
|
|
2381
|
-
|
|
2504
|
+
|
|
2505
|
+
:host:hover {
|
|
2382
2506
|
--_chip-state-opacity: 0.08;
|
|
2383
2507
|
}
|
|
2384
|
-
|
|
2508
|
+
|
|
2509
|
+
:host([pressed]) {
|
|
2385
2510
|
--_chip-state-opacity: 0.12;
|
|
2386
2511
|
}
|
|
2387
|
-
|
|
2512
|
+
|
|
2513
|
+
:host([selected]) {
|
|
2388
2514
|
--_chip-container-color: var(--color-secondary-container);
|
|
2389
2515
|
--_chip-text-color: var(--color-on-secondary-container);
|
|
2390
2516
|
}
|
|
2391
|
-
|
|
2517
|
+
|
|
2518
|
+
:host([disabled]) {
|
|
2392
2519
|
--_chip-container-color: var(--color-on-surface);
|
|
2393
2520
|
--_chip-container-opacity: 0.1;
|
|
2394
2521
|
--_chip-text-color: var(--color-on-surface);
|
|
2395
2522
|
--_chip-text-opacity: 0.38;
|
|
2396
2523
|
}
|
|
2397
|
-
|
|
2524
|
+
:host([disabled]) .ripple {
|
|
2398
2525
|
display: none;
|
|
2399
2526
|
}`;
|
|
2400
2527
|
|
|
@@ -2468,13 +2595,86 @@ var css_248z$H = i`.tag {
|
|
|
2468
2595
|
* <wc-chip>Chip content</wc-chip>
|
|
2469
2596
|
* ```
|
|
2470
2597
|
*/
|
|
2471
|
-
class Chip extends
|
|
2598
|
+
class Chip extends NativeButtonMixin(NativeHyperlinkMixin(i$1)) {
|
|
2472
2599
|
constructor() {
|
|
2473
2600
|
super(...arguments);
|
|
2474
2601
|
/** If true, the tag will have a close icon. */
|
|
2475
2602
|
this.dismissible = false;
|
|
2476
2603
|
this._hasIconSlotContent = false;
|
|
2477
|
-
this.
|
|
2604
|
+
this.skeleton = false;
|
|
2605
|
+
this.toggle = false;
|
|
2606
|
+
this.selected = false;
|
|
2607
|
+
/**
|
|
2608
|
+
* Sets the delay for throttle in milliseconds. Defaults to 200 milliseconds.
|
|
2609
|
+
*/
|
|
2610
|
+
this.throttleDelay = 200;
|
|
2611
|
+
this.pressed = false;
|
|
2612
|
+
this.__handlePress = (event) => {
|
|
2613
|
+
if (this.disabled || this.skeleton || this.softDisabled)
|
|
2614
|
+
return;
|
|
2615
|
+
if (event instanceof KeyboardEvent &&
|
|
2616
|
+
event.type === 'keydown' &&
|
|
2617
|
+
(event.key === 'Enter' || event.key === ' ')) {
|
|
2618
|
+
this.pressed = true;
|
|
2619
|
+
}
|
|
2620
|
+
else if (event.type === 'mousedown') {
|
|
2621
|
+
this.pressed = true;
|
|
2622
|
+
}
|
|
2623
|
+
else {
|
|
2624
|
+
this.pressed = false;
|
|
2625
|
+
}
|
|
2626
|
+
};
|
|
2627
|
+
this.__dispatchClickWithThrottle = event => {
|
|
2628
|
+
this.__dispatchClick(event);
|
|
2629
|
+
};
|
|
2630
|
+
this.__dispatchClick = (event) => {
|
|
2631
|
+
// If the button is soft-disabled or a disabled link, we need to explicitly
|
|
2632
|
+
// prevent the click from propagating to other event listeners as well as
|
|
2633
|
+
// prevent the default action.
|
|
2634
|
+
if (this.softDisabled || (this.disabled && this.href) || this.skeleton) {
|
|
2635
|
+
event.stopImmediatePropagation();
|
|
2636
|
+
event.preventDefault();
|
|
2637
|
+
return;
|
|
2638
|
+
}
|
|
2639
|
+
if (!isActivationClick(event) || !this.buttonElement) {
|
|
2640
|
+
return;
|
|
2641
|
+
}
|
|
2642
|
+
if (this.toggle) {
|
|
2643
|
+
this.selected = !this.selected;
|
|
2644
|
+
}
|
|
2645
|
+
this.focus();
|
|
2646
|
+
dispatchActivationClick(this.buttonElement);
|
|
2647
|
+
};
|
|
2648
|
+
}
|
|
2649
|
+
connectedCallback() {
|
|
2650
|
+
super.connectedCallback();
|
|
2651
|
+
this.addEventListener('click', this.__dispatchClickWithThrottle);
|
|
2652
|
+
window.addEventListener('mouseup', this.__handlePress);
|
|
2653
|
+
}
|
|
2654
|
+
disconnectedCallback() {
|
|
2655
|
+
window.removeEventListener('mouseup', this.__handlePress);
|
|
2656
|
+
this.removeEventListener('click', this.__dispatchClickWithThrottle);
|
|
2657
|
+
super.disconnectedCallback();
|
|
2658
|
+
}
|
|
2659
|
+
__renderDisabledReason(softDisabled) {
|
|
2660
|
+
if (softDisabled)
|
|
2661
|
+
return b `<div
|
|
2662
|
+
id=${DISABLED_REASON_ID}
|
|
2663
|
+
role="tooltip"
|
|
2664
|
+
aria-label=${this.disabledReason}
|
|
2665
|
+
class="screen-reader-only"
|
|
2666
|
+
>
|
|
2667
|
+
${this.disabledReason}
|
|
2668
|
+
</div>`;
|
|
2669
|
+
return A;
|
|
2670
|
+
}
|
|
2671
|
+
__renderTooltip() {
|
|
2672
|
+
if (this.tooltip) {
|
|
2673
|
+
return b `<wc-tooltip class="tooltip" for="button"
|
|
2674
|
+
>${this.tooltip}</wc-tooltip
|
|
2675
|
+
>`;
|
|
2676
|
+
}
|
|
2677
|
+
return A;
|
|
2478
2678
|
}
|
|
2479
2679
|
focus() {
|
|
2480
2680
|
this.buttonElement?.focus();
|
|
@@ -2512,63 +2712,63 @@ class Chip extends BaseButton {
|
|
|
2512
2712
|
`;
|
|
2513
2713
|
}
|
|
2514
2714
|
render() {
|
|
2715
|
+
return b `
|
|
2716
|
+
<wc-focus-ring class="focus-ring" for="button"></wc-focus-ring>
|
|
2717
|
+
<wc-elevation class="elevation"></wc-elevation>
|
|
2718
|
+
<div class="background"></div>
|
|
2719
|
+
<div class="outline"></div>
|
|
2720
|
+
<wc-ripple class="ripple" for="button"></wc-ripple>
|
|
2721
|
+
|
|
2722
|
+
${this.renderChipElement()} ${this.__renderTooltip()}
|
|
2723
|
+
`;
|
|
2724
|
+
}
|
|
2725
|
+
renderChipElement() {
|
|
2515
2726
|
const cssClasses = {
|
|
2516
2727
|
chip: true,
|
|
2517
2728
|
button: true,
|
|
2518
2729
|
selected: this.selected,
|
|
2519
2730
|
dismissible: this.dismissible,
|
|
2520
|
-
pressed: this.
|
|
2731
|
+
pressed: this.pressed,
|
|
2521
2732
|
'icon-slot-has-content': this._hasIconSlotContent,
|
|
2522
2733
|
};
|
|
2523
|
-
if (!this
|
|
2734
|
+
if (!isLink(this)) {
|
|
2524
2735
|
return b `<button
|
|
2525
|
-
|
|
2526
|
-
|
|
2527
|
-
|
|
2528
|
-
|
|
2529
|
-
|
|
2530
|
-
|
|
2531
|
-
|
|
2532
|
-
|
|
2533
|
-
|
|
2534
|
-
|
|
2535
|
-
|
|
2536
|
-
|
|
2537
|
-
|
|
2538
|
-
|
|
2539
|
-
${this.renderChipContent()}
|
|
2540
|
-
</button>`;
|
|
2736
|
+
class=${e$1(cssClasses)}
|
|
2737
|
+
id="button"
|
|
2738
|
+
type=${this.htmlType}
|
|
2739
|
+
@click=${this.__dispatchClickWithThrottle}
|
|
2740
|
+
@mousedown=${this.__handlePress}
|
|
2741
|
+
@keydown=${this.__handlePress}
|
|
2742
|
+
@keyup=${this.__handlePress}
|
|
2743
|
+
aria-describedby=${o$1(this.softDisabled ? DISABLED_REASON_ID : undefined)}
|
|
2744
|
+
?aria-disabled=${this.softDisabled}
|
|
2745
|
+
?disabled=${this.disabled}
|
|
2746
|
+
${spread(this.configAria)}
|
|
2747
|
+
>
|
|
2748
|
+
${this.renderChipContent()}
|
|
2749
|
+
</button>`;
|
|
2541
2750
|
}
|
|
2542
2751
|
return b `<a
|
|
2543
|
-
|
|
2544
|
-
|
|
2545
|
-
|
|
2546
|
-
|
|
2547
|
-
|
|
2548
|
-
|
|
2549
|
-
|
|
2550
|
-
|
|
2551
|
-
|
|
2552
|
-
|
|
2553
|
-
|
|
2554
|
-
|
|
2555
|
-
|
|
2556
|
-
|
|
2557
|
-
|
|
2558
|
-
|
|
2559
|
-
>
|
|
2560
|
-
${this.renderChipContent()}
|
|
2561
|
-
</a>`;
|
|
2752
|
+
class=${e$1(cssClasses)}
|
|
2753
|
+
id="button"
|
|
2754
|
+
href=${this.href}
|
|
2755
|
+
target=${this.target}
|
|
2756
|
+
tabindex=${this.disabled ? '-1' : '0'}
|
|
2757
|
+
@click=${this.__dispatchClick}
|
|
2758
|
+
@mousedown=${this.__handlePress}
|
|
2759
|
+
@keydown=${this.__handlePress}
|
|
2760
|
+
@keyup=${this.__handlePress}
|
|
2761
|
+
role="button"
|
|
2762
|
+
aria-describedby=${o$1(this.softDisabled ? DISABLED_REASON_ID : undefined)}
|
|
2763
|
+
?aria-disabled=${this.softDisabled}
|
|
2764
|
+
${spread(this.configAria)}
|
|
2765
|
+
>
|
|
2766
|
+
${this.renderChipContent()}
|
|
2767
|
+
</a>`;
|
|
2562
2768
|
}
|
|
2563
2769
|
renderChipContent() {
|
|
2564
2770
|
return b `
|
|
2565
|
-
<wc-focus-ring class="focus-ring" for="button"></wc-focus-ring>
|
|
2566
|
-
<wc-elevation class="elevation"></wc-elevation>
|
|
2567
|
-
<div class="background"></div>
|
|
2568
|
-
<div class="outline"></div>
|
|
2569
|
-
<wc-ripple class="ripple"></wc-ripple>
|
|
2570
2771
|
<div class="tag-content">
|
|
2571
|
-
|
|
2572
2772
|
<div class="icon-slot-container">
|
|
2573
2773
|
${this.selected
|
|
2574
2774
|
? b `<wc-icon class="selected-icon" name="check"></wc-icon>`
|
|
@@ -2576,8 +2776,7 @@ class Chip extends BaseButton {
|
|
|
2576
2776
|
</div>
|
|
2577
2777
|
<div class="label-container">
|
|
2578
2778
|
<slot></slot>
|
|
2579
|
-
</div>
|
|
2580
|
-
|
|
2779
|
+
</div>
|
|
2581
2780
|
${this._renderCloseButton()}
|
|
2582
2781
|
</div>
|
|
2583
2782
|
`;
|
|
@@ -2596,8 +2795,26 @@ __decorate([
|
|
|
2596
2795
|
r()
|
|
2597
2796
|
], Chip.prototype, "_hasIconSlotContent", void 0);
|
|
2598
2797
|
__decorate([
|
|
2599
|
-
|
|
2600
|
-
], Chip.prototype, "
|
|
2798
|
+
n({ type: Boolean, reflect: true })
|
|
2799
|
+
], Chip.prototype, "skeleton", void 0);
|
|
2800
|
+
__decorate([
|
|
2801
|
+
n({ type: Boolean, reflect: true })
|
|
2802
|
+
], Chip.prototype, "toggle", void 0);
|
|
2803
|
+
__decorate([
|
|
2804
|
+
n({ type: Boolean, reflect: true })
|
|
2805
|
+
], Chip.prototype, "selected", void 0);
|
|
2806
|
+
__decorate([
|
|
2807
|
+
n()
|
|
2808
|
+
], Chip.prototype, "throttleDelay", void 0);
|
|
2809
|
+
__decorate([
|
|
2810
|
+
n()
|
|
2811
|
+
], Chip.prototype, "tooltip", void 0);
|
|
2812
|
+
__decorate([
|
|
2813
|
+
n({ type: Boolean, reflect: true })
|
|
2814
|
+
], Chip.prototype, "pressed", void 0);
|
|
2815
|
+
__decorate([
|
|
2816
|
+
e$2('.button')
|
|
2817
|
+
], Chip.prototype, "buttonElement", void 0);
|
|
2601
2818
|
|
|
2602
2819
|
var css_248z$G = i`* {
|
|
2603
2820
|
box-sizing: border-box;
|
|
@@ -6279,14 +6496,12 @@ var css_248z$q = i`* {
|
|
|
6279
6496
|
position: absolute;
|
|
6280
6497
|
top: 0;
|
|
6281
6498
|
left: 0;
|
|
6282
|
-
}
|
|
6283
|
-
:host(:not([preview])) .tooltip {
|
|
6284
6499
|
pointer-events: none;
|
|
6285
6500
|
transition: transform var(--duration-short2) ease-in-out, opacity var(--duration-short2) ease-in-out;
|
|
6286
6501
|
transform: scale(0);
|
|
6287
6502
|
opacity: 0;
|
|
6288
6503
|
}
|
|
6289
|
-
:host(:not([preview]))
|
|
6504
|
+
:host(:not([preview])):host([open]) {
|
|
6290
6505
|
pointer-events: auto;
|
|
6291
6506
|
transform: scale(1);
|
|
6292
6507
|
opacity: 1;
|
|
@@ -6467,7 +6682,6 @@ class Tooltip extends i$1 {
|
|
|
6467
6682
|
return b ` <div
|
|
6468
6683
|
class=${e$1({
|
|
6469
6684
|
tooltip: true,
|
|
6470
|
-
open: this.open,
|
|
6471
6685
|
[`variant-${this.variant}`]: true,
|
|
6472
6686
|
})}
|
|
6473
6687
|
id="tooltip"
|
|
@@ -6623,7 +6837,6 @@ var css_248z$o = i`* {
|
|
|
6623
6837
|
* @label Breadcrumb Item
|
|
6624
6838
|
* @tag wc-breadcrumb-item
|
|
6625
6839
|
* @rawTag breadcrumb-item
|
|
6626
|
-
* @parentRawTag breadcrumb
|
|
6627
6840
|
* @summary A breadcrumb item component that represents a single item in a breadcrumb navigation.
|
|
6628
6841
|
* @tags navigation
|
|
6629
6842
|
*
|
|
@@ -6918,7 +7131,6 @@ var css_248z$l = i`:host-context([variant=standard]) {
|
|
|
6918
7131
|
* @label Menu Item
|
|
6919
7132
|
* @tag wc-menu-item
|
|
6920
7133
|
* @rawTag menu-item
|
|
6921
|
-
* @parentRawTag menu
|
|
6922
7134
|
* @summary An item in a menu list.
|
|
6923
7135
|
* @tags navigation
|
|
6924
7136
|
*
|
|
@@ -6927,7 +7139,7 @@ var css_248z$l = i`:host-context([variant=standard]) {
|
|
|
6927
7139
|
* <wc-menu-item>Menu Item</wc-menu-item>
|
|
6928
7140
|
* ```
|
|
6929
7141
|
*/
|
|
6930
|
-
class MenuItem extends
|
|
7142
|
+
class MenuItem extends NativeButtonMixin(NativeHyperlinkMixin(i$1)) {
|
|
6931
7143
|
constructor() {
|
|
6932
7144
|
super(...arguments);
|
|
6933
7145
|
this.value = '';
|
|
@@ -7018,7 +7230,9 @@ class MenuItem extends BaseButtonMixin(BaseHyperlinkMixin(i$1)) {
|
|
|
7018
7230
|
${hasOverline
|
|
7019
7231
|
? b `<slot name="overline" slot="overline"></slot>`
|
|
7020
7232
|
: A}
|
|
7021
|
-
${hasHeadline
|
|
7233
|
+
${hasHeadline
|
|
7234
|
+
? b `<slot name="headline" slot="headline"></slot>`
|
|
7235
|
+
: A}
|
|
7022
7236
|
${hasDefault ? b `<slot></slot>` : A}
|
|
7023
7237
|
${hasSupportingText
|
|
7024
7238
|
? b `<slot name="supporting-text" slot="supporting-text"></slot>`
|
|
@@ -7466,7 +7680,6 @@ let subMenuIdCounter = 0;
|
|
|
7466
7680
|
* @label Sub Menu
|
|
7467
7681
|
* @tag wc-sub-menu
|
|
7468
7682
|
* @rawTag sub-menu
|
|
7469
|
-
* @parentRawTag menu
|
|
7470
7683
|
* @summary Connects a menu item to a nested menu.
|
|
7471
7684
|
*/
|
|
7472
7685
|
class SubMenu extends i$1 {
|
|
@@ -7808,7 +8021,6 @@ var css_248z$i = i`* {
|
|
|
7808
8021
|
* @label List Item
|
|
7809
8022
|
* @tag wc-list-item
|
|
7810
8023
|
* @rawTag list-item
|
|
7811
|
-
* @parentRawTag list
|
|
7812
8024
|
*
|
|
7813
8025
|
* @summary A Material 3 list item with leading, trailing and content slots.
|
|
7814
8026
|
*
|
|
@@ -7822,7 +8034,7 @@ var css_248z$i = i`* {
|
|
|
7822
8034
|
* ```
|
|
7823
8035
|
* @tags display
|
|
7824
8036
|
*/
|
|
7825
|
-
class ListItem extends
|
|
8037
|
+
class ListItem extends NativeButtonMixin(NativeHyperlinkMixin(i$1)) {
|
|
7826
8038
|
constructor() {
|
|
7827
8039
|
super(...arguments);
|
|
7828
8040
|
this.selected = false;
|
|
@@ -7849,7 +8061,7 @@ class ListItem extends BaseButtonMixin(BaseHyperlinkMixin(i$1)) {
|
|
|
7849
8061
|
this.itemElement.click();
|
|
7850
8062
|
return;
|
|
7851
8063
|
}
|
|
7852
|
-
if (event.key === 'Enter' && !this
|
|
8064
|
+
if (event.key === 'Enter' && !isLink(this)) {
|
|
7853
8065
|
event.preventDefault();
|
|
7854
8066
|
this.itemElement.click();
|
|
7855
8067
|
}
|
|
@@ -7884,7 +8096,6 @@ class ListItem extends BaseButtonMixin(BaseHyperlinkMixin(i$1)) {
|
|
|
7884
8096
|
this.itemElement?.blur();
|
|
7885
8097
|
}
|
|
7886
8098
|
render() {
|
|
7887
|
-
const isLink = this.__isLink();
|
|
7888
8099
|
const cssClasses = {
|
|
7889
8100
|
'list-item': true,
|
|
7890
8101
|
'item-element': true,
|
|
@@ -7892,7 +8103,7 @@ class ListItem extends BaseButtonMixin(BaseHyperlinkMixin(i$1)) {
|
|
|
7892
8103
|
disabled: this.disabled || this.softDisabled,
|
|
7893
8104
|
pressed: this.isPressed,
|
|
7894
8105
|
};
|
|
7895
|
-
if (!isLink) {
|
|
8106
|
+
if (!isLink(this)) {
|
|
7896
8107
|
return b `
|
|
7897
8108
|
<button
|
|
7898
8109
|
id="item"
|
|
@@ -8014,9 +8225,26 @@ var css_248z$h = i`* {
|
|
|
8014
8225
|
}
|
|
8015
8226
|
|
|
8016
8227
|
:host {
|
|
8228
|
+
position: relative;
|
|
8017
8229
|
display: block;
|
|
8018
8230
|
padding-inline: var(--spacing-050);
|
|
8019
8231
|
--item-height: 3.5rem;
|
|
8232
|
+
--item-container-color: transparent;
|
|
8233
|
+
--item-label-text-color: var(--color-on-surface);
|
|
8234
|
+
--item-leading-trailing-color: var(--color-on-surface-variant);
|
|
8235
|
+
--item-supporting-text-color: var(--color-on-surface-variant);
|
|
8236
|
+
--item-container-selected-color: var(--color-tertiary-container);
|
|
8237
|
+
--item-label-text-selected-color: var(--color-on-tertiary-container);
|
|
8238
|
+
--private-item-container-color: var(--item-container-color);
|
|
8239
|
+
--private-item-label-text-color: var(--item-label-text-color);
|
|
8240
|
+
--private-item-leading-trailing-color: var(--item-leading-trailing-color);
|
|
8241
|
+
--private-item-supporting-text-color: var(--item-supporting-text-color);
|
|
8242
|
+
--private-item-container-state-color: var(--private-item-label-text-color);
|
|
8243
|
+
--private-item-container-shape-start-start: var(--item-container-shape-start-start, var(--shape-corner-extra-small));
|
|
8244
|
+
--private-item-container-shape-start-end: var(--item-container-shape-start-end, var(--shape-corner-extra-small));
|
|
8245
|
+
--private-item-container-shape-end-start: var(--item-container-shape-end-start, var(--shape-corner-extra-small));
|
|
8246
|
+
--private-item-container-shape-end-end: var(--item-container-shape-end-end, var(--shape-corner-extra-small));
|
|
8247
|
+
--private-item-container-shape-variant: var(--item-container-shape-variant, none);
|
|
8020
8248
|
}
|
|
8021
8249
|
|
|
8022
8250
|
/**
|
|
@@ -8042,17 +8270,12 @@ var css_248z$h = i`* {
|
|
|
8042
8270
|
}
|
|
8043
8271
|
|
|
8044
8272
|
.item {
|
|
8045
|
-
position: relative;
|
|
8046
8273
|
min-height: var(--item-height);
|
|
8047
8274
|
width: 100%;
|
|
8048
8275
|
background: transparent;
|
|
8049
8276
|
text-align: initial;
|
|
8050
8277
|
cursor: pointer;
|
|
8051
|
-
|
|
8052
|
-
--private-item-container-shape-start-end: var(--item-container-shape-start-end, var(--shape-corner-extra-small));
|
|
8053
|
-
--private-item-container-shape-end-start: var(--item-container-shape-end-start, var(--shape-corner-extra-small));
|
|
8054
|
-
--private-item-container-shape-end-end: var(--item-container-shape-end-end, var(--shape-corner-extra-small));
|
|
8055
|
-
--private-item-container-shape-variant: var(--item-container-shape-variant, none);
|
|
8278
|
+
z-index: 0;
|
|
8056
8279
|
font-family: var(--item-label-font-family, var(--typography-body-large-font-family)) !important;
|
|
8057
8280
|
font-size: var(--item-label-font-size, var(--typography-body-large-font-size)) !important;
|
|
8058
8281
|
font-weight: var(--item-label-font-weight, var(--typography-body-large-font-weight)) !important;
|
|
@@ -8130,7 +8353,11 @@ var css_248z$h = i`* {
|
|
|
8130
8353
|
white-space: nowrap;
|
|
8131
8354
|
color: var(--private-item-supporting-text-color);
|
|
8132
8355
|
}
|
|
8133
|
-
|
|
8356
|
+
|
|
8357
|
+
/*
|
|
8358
|
+
Background layers
|
|
8359
|
+
*/
|
|
8360
|
+
.background {
|
|
8134
8361
|
position: absolute;
|
|
8135
8362
|
inset: 0;
|
|
8136
8363
|
background-color: var(--private-item-container-color);
|
|
@@ -8142,7 +8369,8 @@ var css_248z$h = i`* {
|
|
|
8142
8369
|
border-end-end-radius: var(--private-item-container-shape-end-end, var(--private-item-container-shape));
|
|
8143
8370
|
corner-shape: var(--private-item-container-shape-variant);
|
|
8144
8371
|
}
|
|
8145
|
-
|
|
8372
|
+
|
|
8373
|
+
.focus-ring {
|
|
8146
8374
|
z-index: 2;
|
|
8147
8375
|
--focus-ring-container-shape-start-start: var(--private-item-container-shape-start-start, var(--private-item-container-shape));
|
|
8148
8376
|
--focus-ring-container-shape-start-end: var(--private-item-container-shape-start-end, var(--private-item-container-shape));
|
|
@@ -8150,7 +8378,8 @@ var css_248z$h = i`* {
|
|
|
8150
8378
|
--focus-ring-container-shape-end-end: var(--private-item-container-shape-end-end, var(--private-item-container-shape));
|
|
8151
8379
|
--focus-ring-container-shape-variant: var(--private-item-container-shape-variant);
|
|
8152
8380
|
}
|
|
8153
|
-
|
|
8381
|
+
|
|
8382
|
+
.ripple {
|
|
8154
8383
|
border-start-start-radius: var(--private-item-container-shape-start-start, var(--private-item-container-shape));
|
|
8155
8384
|
border-start-end-radius: var(--private-item-container-shape-start-end, var(--private-item-container-shape));
|
|
8156
8385
|
border-end-start-radius: var(--private-item-container-shape-end-start, var(--private-item-container-shape));
|
|
@@ -8160,26 +8389,23 @@ var css_248z$h = i`* {
|
|
|
8160
8389
|
--ripple-pressed-color: var(--private-item-container-state-color);
|
|
8161
8390
|
}
|
|
8162
8391
|
|
|
8163
|
-
|
|
8164
|
-
|
|
8165
|
-
--private-item-label-text-color: var(--item-label-text-color);
|
|
8166
|
-
--private-item-leading-trailing-color: var(--item-leading-trailing-color);
|
|
8167
|
-
--private-item-supporting-text-color: var(--item-supporting-text-color);
|
|
8168
|
-
--private-item-container-state-color: var(--private-item-label-text-color);
|
|
8169
|
-
}
|
|
8170
|
-
.item:hover:not(:where(.disabled, .selected)) {
|
|
8392
|
+
/* State management */
|
|
8393
|
+
:host:hover:not([disabled], [selected]) {
|
|
8171
8394
|
--private-item-container-state-opacity: 0.08;
|
|
8172
8395
|
}
|
|
8173
|
-
|
|
8396
|
+
|
|
8397
|
+
:host:has(.item.pressed):not([disabled]) {
|
|
8174
8398
|
--private-item-container-state-opacity: 0.12;
|
|
8175
8399
|
}
|
|
8176
|
-
|
|
8400
|
+
|
|
8401
|
+
:host([selected]) {
|
|
8177
8402
|
--private-item-container-color: var(--item-container-selected-color);
|
|
8178
8403
|
--private-item-label-text-color: var(--item-label-text-selected-color);
|
|
8179
8404
|
--private-item-leading-trailing-color: var(--item-label-text-selected-color);
|
|
8180
8405
|
--private-item-supporting-text-color: var(--item-label-text-selected-color);
|
|
8181
8406
|
}
|
|
8182
|
-
|
|
8407
|
+
|
|
8408
|
+
:host([disabled]) {
|
|
8183
8409
|
cursor: not-allowed;
|
|
8184
8410
|
--private-item-label-text-color: var(--color-on-surface);
|
|
8185
8411
|
--private-item-label-text-opacity: 0.38;
|
|
@@ -8187,17 +8413,8 @@ var css_248z$h = i`* {
|
|
|
8187
8413
|
--private-item-supporting-text-color: var(--color-on-surface);
|
|
8188
8414
|
--private-item-container-opacity: 0.12;
|
|
8189
8415
|
}
|
|
8190
|
-
|
|
8416
|
+
:host([disabled]) .ripple {
|
|
8191
8417
|
display: none;
|
|
8192
|
-
}
|
|
8193
|
-
|
|
8194
|
-
:host {
|
|
8195
|
-
--item-container-color: transparent;
|
|
8196
|
-
--item-label-text-color: var(--color-on-surface);
|
|
8197
|
-
--item-leading-trailing-color: var(--color-on-surface-variant);
|
|
8198
|
-
--item-supporting-text-color: var(--color-on-surface-variant);
|
|
8199
|
-
--item-container-selected-color: var(--color-tertiary-container);
|
|
8200
|
-
--item-label-text-selected-color: var(--color-on-tertiary-container);
|
|
8201
8418
|
}`;
|
|
8202
8419
|
|
|
8203
8420
|
/**
|
|
@@ -8220,7 +8437,7 @@ var css_248z$h = i`* {
|
|
|
8220
8437
|
* ```
|
|
8221
8438
|
* @tags display
|
|
8222
8439
|
*/
|
|
8223
|
-
class Item extends
|
|
8440
|
+
class Item extends NativeButtonMixin(NativeHyperlinkMixin(i$1)) {
|
|
8224
8441
|
constructor() {
|
|
8225
8442
|
super(...arguments);
|
|
8226
8443
|
this.__contentObserver = new MutationObserver(() => {
|
|
@@ -8254,7 +8471,7 @@ class Item extends BaseButtonMixin(BaseHyperlinkMixin(i$1)) {
|
|
|
8254
8471
|
this.itemElement.click();
|
|
8255
8472
|
return;
|
|
8256
8473
|
}
|
|
8257
|
-
if (event.key === 'Enter' && !this
|
|
8474
|
+
if (event.key === 'Enter' && !isLink(this)) {
|
|
8258
8475
|
event.preventDefault();
|
|
8259
8476
|
this.itemElement.click();
|
|
8260
8477
|
}
|
|
@@ -8339,7 +8556,6 @@ class Item extends BaseButtonMixin(BaseHyperlinkMixin(i$1)) {
|
|
|
8339
8556
|
this.__isCapturingTabIndex = false;
|
|
8340
8557
|
}
|
|
8341
8558
|
render() {
|
|
8342
|
-
const isLink = this.__isLink();
|
|
8343
8559
|
const role = this.__getForwardedAttribute('role');
|
|
8344
8560
|
const tabIndex = this.__capturedTabIndex;
|
|
8345
8561
|
const ariaHasPopup = this.__getForwardedAttribute('aria-haspopup');
|
|
@@ -8351,7 +8567,16 @@ class Item extends BaseButtonMixin(BaseHyperlinkMixin(i$1)) {
|
|
|
8351
8567
|
disabled: this.disabled || this.softDisabled,
|
|
8352
8568
|
pressed: this.isPressed,
|
|
8353
8569
|
};
|
|
8354
|
-
|
|
8570
|
+
return b `
|
|
8571
|
+
<wc-focus-ring class="focus-ring" for="item"></wc-focus-ring>
|
|
8572
|
+
<div class="background"></div>
|
|
8573
|
+
<wc-ripple class="ripple" for="item"></wc-ripple>
|
|
8574
|
+
|
|
8575
|
+
${this.renderItemElement(cssClasses, role, tabIndex, ariaHasPopup, ariaControls, ariaExpanded)}
|
|
8576
|
+
`;
|
|
8577
|
+
}
|
|
8578
|
+
renderItemElement(cssClasses, role, tabIndex, ariaHasPopup, ariaControls, ariaExpanded) {
|
|
8579
|
+
if (!isLink(this)) {
|
|
8355
8580
|
cssClasses['native-button'] = true;
|
|
8356
8581
|
return b `
|
|
8357
8582
|
<button
|
|
@@ -8374,9 +8599,8 @@ class Item extends BaseButtonMixin(BaseHyperlinkMixin(i$1)) {
|
|
|
8374
8599
|
</button>
|
|
8375
8600
|
`;
|
|
8376
8601
|
}
|
|
8377
|
-
|
|
8378
|
-
|
|
8379
|
-
return b `
|
|
8602
|
+
cssClasses['native-link'] = true;
|
|
8603
|
+
return b `
|
|
8380
8604
|
<a
|
|
8381
8605
|
id="item"
|
|
8382
8606
|
class=${e$1(cssClasses)}
|
|
@@ -8398,7 +8622,6 @@ class Item extends BaseButtonMixin(BaseHyperlinkMixin(i$1)) {
|
|
|
8398
8622
|
${this.renderContent()}
|
|
8399
8623
|
</a>
|
|
8400
8624
|
`;
|
|
8401
|
-
}
|
|
8402
8625
|
}
|
|
8403
8626
|
renderContent() {
|
|
8404
8627
|
const hasStart = this.__hasNamedSlot('start');
|
|
@@ -8409,24 +8632,25 @@ class Item extends BaseButtonMixin(BaseHyperlinkMixin(i$1)) {
|
|
|
8409
8632
|
const hasSupportingText = this.__hasNamedSlot('supporting-text');
|
|
8410
8633
|
const hasTrailingSupportingText = this.__hasNamedSlot('trailing-supporting-text');
|
|
8411
8634
|
return b `
|
|
8412
|
-
<wc-focus-ring class="focus-ring" for="item"></wc-focus-ring>
|
|
8413
|
-
<div class="background"></div>
|
|
8414
|
-
<wc-ripple class="ripple"></wc-ripple>
|
|
8415
|
-
|
|
8416
8635
|
<div class="item-content">
|
|
8417
8636
|
${hasStart
|
|
8418
8637
|
? b `
|
|
8419
8638
|
<div class="start">
|
|
8420
|
-
<slot
|
|
8639
|
+
<slot
|
|
8640
|
+
name="start"
|
|
8641
|
+
@slotchange=${this.__handleSlotChange}
|
|
8642
|
+
></slot>
|
|
8421
8643
|
</div>
|
|
8422
8644
|
`
|
|
8423
8645
|
: A}
|
|
8424
8646
|
<div class="content">
|
|
8425
|
-
|
|
8426
8647
|
${hasOverline
|
|
8427
8648
|
? b `
|
|
8428
8649
|
<div class="overline">
|
|
8429
|
-
<slot
|
|
8650
|
+
<slot
|
|
8651
|
+
name="overline"
|
|
8652
|
+
@slotchange=${this.__handleSlotChange}
|
|
8653
|
+
></slot>
|
|
8430
8654
|
</div>
|
|
8431
8655
|
`
|
|
8432
8656
|
: A}
|
|
@@ -8437,10 +8661,15 @@ class Item extends BaseButtonMixin(BaseHyperlinkMixin(i$1)) {
|
|
|
8437
8661
|
? b `
|
|
8438
8662
|
<div class="headline">
|
|
8439
8663
|
${hasHeadline
|
|
8440
|
-
? b `<slot
|
|
8664
|
+
? b `<slot
|
|
8665
|
+
name="headline"
|
|
8666
|
+
@slotchange=${this.__handleSlotChange}
|
|
8667
|
+
></slot>`
|
|
8441
8668
|
: A}
|
|
8442
8669
|
${hasDefault
|
|
8443
|
-
? b `<slot
|
|
8670
|
+
? b `<slot
|
|
8671
|
+
@slotchange=${this.__handleSlotChange}
|
|
8672
|
+
></slot>`
|
|
8444
8673
|
: A}
|
|
8445
8674
|
</div>
|
|
8446
8675
|
`
|
|
@@ -9285,7 +9514,6 @@ var _Tab_id;
|
|
|
9285
9514
|
* @label Tab
|
|
9286
9515
|
* @tag wc-tab
|
|
9287
9516
|
* @rawTag tab
|
|
9288
|
-
* @parentRawTag tabs
|
|
9289
9517
|
*
|
|
9290
9518
|
* @summary A tab component for use within tabs.
|
|
9291
9519
|
* @overview
|
|
@@ -9311,8 +9539,8 @@ class Tab extends i$1 {
|
|
|
9311
9539
|
this.disabled = false;
|
|
9312
9540
|
this.disabledReason = '';
|
|
9313
9541
|
/**
|
|
9314
|
-
|
|
9315
|
-
|
|
9542
|
+
* Sets or retrieves the window or frame at which to target content.
|
|
9543
|
+
*/
|
|
9316
9544
|
this.target = '_self';
|
|
9317
9545
|
/**
|
|
9318
9546
|
* Sets the delay for throttle in milliseconds. Defaults to 200 milliseconds.
|
|
@@ -9323,8 +9551,8 @@ class Tab extends i$1 {
|
|
|
9323
9551
|
this.slotHasIcon = false;
|
|
9324
9552
|
this.slotHasBadge = false;
|
|
9325
9553
|
/**
|
|
9326
|
-
|
|
9327
|
-
|
|
9554
|
+
* States
|
|
9555
|
+
*/
|
|
9328
9556
|
this.isPressed = false;
|
|
9329
9557
|
this._tabindex = 0;
|
|
9330
9558
|
this.__dispatchClickWithThrottle = event => {
|
|
@@ -9377,9 +9605,6 @@ class Tab extends i$1 {
|
|
|
9377
9605
|
this.requestUpdate();
|
|
9378
9606
|
});
|
|
9379
9607
|
}
|
|
9380
|
-
__isLink() {
|
|
9381
|
-
return !!this.href;
|
|
9382
|
-
}
|
|
9383
9608
|
__getParentTabsVariant() {
|
|
9384
9609
|
return this.closest('wc-tabs')?.variant ?? 'primary';
|
|
9385
9610
|
}
|
|
@@ -9392,7 +9617,6 @@ class Tab extends i$1 {
|
|
|
9392
9617
|
// }
|
|
9393
9618
|
// }
|
|
9394
9619
|
render() {
|
|
9395
|
-
const isLink = this.__isLink();
|
|
9396
9620
|
const variant = this.__getParentTabsVariant();
|
|
9397
9621
|
const cssClasses = {
|
|
9398
9622
|
tab: true,
|
|
@@ -9405,38 +9629,38 @@ class Tab extends i$1 {
|
|
|
9405
9629
|
'has-icon': this.slotHasIcon,
|
|
9406
9630
|
'has-badge': this.slotHasBadge,
|
|
9407
9631
|
};
|
|
9408
|
-
if (!isLink) {
|
|
9632
|
+
if (!isLink(this)) {
|
|
9409
9633
|
return b `<button
|
|
9410
|
-
id="button"
|
|
9411
|
-
class=${e$1(cssClasses)}
|
|
9412
|
-
tabindex="0"
|
|
9413
|
-
@mousedown=${this.__handlePress}
|
|
9414
|
-
@keydown=${this.__handlePress}
|
|
9415
|
-
@keyup=${this.__handlePress}
|
|
9416
|
-
?aria-describedby=${this.__getDisabledReasonID()}
|
|
9417
|
-
aria-disabled=${`${this.disabled}`}
|
|
9418
|
-
?disabled=${this.disabled}
|
|
9419
|
-
${spread(this.configAria)}
|
|
9420
|
-
>
|
|
9421
|
-
${this.renderTabContent(variant)}
|
|
9422
|
-
</button>`;
|
|
9423
|
-
}
|
|
9424
|
-
return b `<a
|
|
9425
|
-
class=${e$1(cssClasses)}
|
|
9426
9634
|
id="button"
|
|
9635
|
+
class=${e$1(cssClasses)}
|
|
9427
9636
|
tabindex="0"
|
|
9428
|
-
href=${this.href}
|
|
9429
|
-
target=${this.target}
|
|
9430
9637
|
@mousedown=${this.__handlePress}
|
|
9431
9638
|
@keydown=${this.__handlePress}
|
|
9432
9639
|
@keyup=${this.__handlePress}
|
|
9433
|
-
role="button"
|
|
9434
9640
|
?aria-describedby=${this.__getDisabledReasonID()}
|
|
9435
9641
|
aria-disabled=${`${this.disabled}`}
|
|
9642
|
+
?disabled=${this.disabled}
|
|
9436
9643
|
${spread(this.configAria)}
|
|
9437
9644
|
>
|
|
9438
9645
|
${this.renderTabContent(variant)}
|
|
9439
|
-
</
|
|
9646
|
+
</button>`;
|
|
9647
|
+
}
|
|
9648
|
+
return b `<a
|
|
9649
|
+
class=${e$1(cssClasses)}
|
|
9650
|
+
id="button"
|
|
9651
|
+
tabindex="0"
|
|
9652
|
+
href=${this.href}
|
|
9653
|
+
target=${this.target}
|
|
9654
|
+
@mousedown=${this.__handlePress}
|
|
9655
|
+
@keydown=${this.__handlePress}
|
|
9656
|
+
@keyup=${this.__handlePress}
|
|
9657
|
+
role="button"
|
|
9658
|
+
?aria-describedby=${this.__getDisabledReasonID()}
|
|
9659
|
+
aria-disabled=${`${this.disabled}`}
|
|
9660
|
+
${spread(this.configAria)}
|
|
9661
|
+
>
|
|
9662
|
+
${this.renderTabContent(variant)}
|
|
9663
|
+
</a>`;
|
|
9440
9664
|
}
|
|
9441
9665
|
renderTabContent(variant) {
|
|
9442
9666
|
switch (variant) {
|
|
@@ -9453,14 +9677,13 @@ class Tab extends i$1 {
|
|
|
9453
9677
|
}
|
|
9454
9678
|
renderPrimaryTabContent() {
|
|
9455
9679
|
return b `
|
|
9456
|
-
<wc-focus-ring class="focus-ring" for=
|
|
9680
|
+
<wc-focus-ring class="focus-ring" for="button"></wc-focus-ring>
|
|
9457
9681
|
<wc-elevation class="elevation"></wc-elevation>
|
|
9458
9682
|
<div class="background"></div>
|
|
9459
9683
|
<div class="outline"></div>
|
|
9460
9684
|
<wc-ripple class="ripple"></wc-ripple>
|
|
9461
|
-
|
|
9462
|
-
<div class="tab-content">
|
|
9463
9685
|
|
|
9686
|
+
<div class="tab-content">
|
|
9464
9687
|
<div class="icon-section">
|
|
9465
9688
|
<slot name="badge"></slot>
|
|
9466
9689
|
<slot name="icon"></slot>
|
|
@@ -9470,7 +9693,6 @@ class Tab extends i$1 {
|
|
|
9470
9693
|
</div>
|
|
9471
9694
|
|
|
9472
9695
|
<div class="indicator"></div>
|
|
9473
|
-
|
|
9474
9696
|
</div>
|
|
9475
9697
|
|
|
9476
9698
|
${this.__renderDisabledReason()}
|
|
@@ -9478,14 +9700,13 @@ class Tab extends i$1 {
|
|
|
9478
9700
|
}
|
|
9479
9701
|
renderSecondaryTabContent() {
|
|
9480
9702
|
return b `
|
|
9481
|
-
<wc-focus-ring class="focus-ring" for=
|
|
9703
|
+
<wc-focus-ring class="focus-ring" for="button"></wc-focus-ring>
|
|
9482
9704
|
<wc-elevation class="elevation"></wc-elevation>
|
|
9483
9705
|
<div class="background"></div>
|
|
9484
9706
|
<div class="outline"></div>
|
|
9485
9707
|
<wc-ripple class="ripple"></wc-ripple>
|
|
9486
|
-
|
|
9487
|
-
<div class="tab-content">
|
|
9488
9708
|
|
|
9709
|
+
<div class="tab-content">
|
|
9489
9710
|
<slot name="icon"></slot>
|
|
9490
9711
|
|
|
9491
9712
|
<div class="slot-container">
|
|
@@ -9508,7 +9729,7 @@ class Tab extends i$1 {
|
|
|
9508
9729
|
}
|
|
9509
9730
|
renderSegmentedTabContent() {
|
|
9510
9731
|
return b `
|
|
9511
|
-
<wc-focus-ring class="focus-ring" for=
|
|
9732
|
+
<wc-focus-ring class="focus-ring" for="button"></wc-focus-ring>
|
|
9512
9733
|
<wc-elevation class="elevation"></wc-elevation>
|
|
9513
9734
|
<div class="background"></div>
|
|
9514
9735
|
<div class="outline"></div>
|
|
@@ -9842,7 +10063,6 @@ var css_248z$b = i`* {
|
|
|
9842
10063
|
* @label Tab Panel
|
|
9843
10064
|
* @tag wc-tab-panel
|
|
9844
10065
|
* @rawTag tab-panel
|
|
9845
|
-
* @parentRawTag tab-group
|
|
9846
10066
|
*
|
|
9847
10067
|
* @summary Content panel for tabs.
|
|
9848
10068
|
* @overview
|
|
@@ -11291,7 +11511,6 @@ var css_248z$7 = i`* {
|
|
|
11291
11511
|
* @label Sidebar Menu Item
|
|
11292
11512
|
* @tag wc-sidebar-menu-item
|
|
11293
11513
|
* @rawTag sidebar-menu-item
|
|
11294
|
-
* @parentRawTag sidebar-menu
|
|
11295
11514
|
* @summary A sidebar menu item represents a selectable leaf item in the sidebar navigation tree.
|
|
11296
11515
|
*
|
|
11297
11516
|
* @example
|
|
@@ -11572,7 +11791,6 @@ var css_248z$6 = i`* {
|
|
|
11572
11791
|
* @label Sidebar Sub Menu
|
|
11573
11792
|
* @tag wc-sidebar-sub-menu
|
|
11574
11793
|
* @rawTag sidebar-sub-menu
|
|
11575
|
-
* @parentRawTag sidebar-menu
|
|
11576
11794
|
* @summary A sidebar sub menu groups sidebar menu items and handles expand/collapse behavior.
|
|
11577
11795
|
*
|
|
11578
11796
|
* @example
|
|
@@ -12787,7 +13005,6 @@ var css_248z$2 = i`@charset "UTF-8";
|
|
|
12787
13005
|
* @label Select Option
|
|
12788
13006
|
* @tag wc-option
|
|
12789
13007
|
* @rawTag option
|
|
12790
|
-
* @parentRawTag select
|
|
12791
13008
|
*
|
|
12792
13009
|
* @summary A declarative option element for use inside wc-select.
|
|
12793
13010
|
*
|
|
@@ -13553,6 +13770,12 @@ var css_248z = i`* {
|
|
|
13553
13770
|
z-index: 1;
|
|
13554
13771
|
transition: color var(--duration-short4, 200ms) var(--easing-standard, ease), font-weight var(--duration-short4, 200ms) var(--easing-standard, ease);
|
|
13555
13772
|
}
|
|
13773
|
+
.item {
|
|
13774
|
+
/* Hide label when collapsed via class */
|
|
13775
|
+
}
|
|
13776
|
+
.item .label.hidden {
|
|
13777
|
+
display: none;
|
|
13778
|
+
}
|
|
13556
13779
|
.item {
|
|
13557
13780
|
/* Active icon slot: hidden by default */
|
|
13558
13781
|
}
|
|
@@ -13630,7 +13853,6 @@ var _NavigationRailItem_id;
|
|
|
13630
13853
|
* @label Navigation Rail Item
|
|
13631
13854
|
* @tag wc-navigation-rail-item
|
|
13632
13855
|
* @rawTag navigation-rail-item
|
|
13633
|
-
* @parentRawTag navigation-rail
|
|
13634
13856
|
*
|
|
13635
13857
|
* @summary An individual item within a navigation rail.
|
|
13636
13858
|
* @overview
|
|
@@ -13703,18 +13925,15 @@ class NavigationRailItem extends i$1 {
|
|
|
13703
13925
|
}
|
|
13704
13926
|
firstUpdated() {
|
|
13705
13927
|
this.__dispatchClickWithThrottle = throttle(this.__dispatchClick, this.throttleDelay);
|
|
13706
|
-
observerSlotChangesWithCallback(this.renderRoot.querySelector('slot
|
|
13928
|
+
observerSlotChangesWithCallback(this.renderRoot.querySelector('slot.label'), hasContent => {
|
|
13707
13929
|
this._hasLabel = hasContent;
|
|
13708
13930
|
this.requestUpdate();
|
|
13709
13931
|
});
|
|
13710
|
-
observerSlotChangesWithCallback(this.renderRoot.querySelector('slot
|
|
13932
|
+
observerSlotChangesWithCallback(this.renderRoot.querySelector('slot.active-icon-slot'), hasContent => {
|
|
13711
13933
|
this._hasActiveIcon = hasContent;
|
|
13712
13934
|
this.requestUpdate();
|
|
13713
13935
|
});
|
|
13714
13936
|
}
|
|
13715
|
-
__isLink() {
|
|
13716
|
-
return !!this.href;
|
|
13717
|
-
}
|
|
13718
13937
|
__getDisabledReasonID() {
|
|
13719
13938
|
return this.disabled && this.disabledReason
|
|
13720
13939
|
? `disabled-reason-${__classPrivateFieldGet(this, _NavigationRailItem_id, "f")}`
|
|
@@ -13735,7 +13954,7 @@ class NavigationRailItem extends i$1 {
|
|
|
13735
13954
|
}
|
|
13736
13955
|
__renderItemContent() {
|
|
13737
13956
|
return b `
|
|
13738
|
-
<wc-focus-ring class="focus-ring" for=
|
|
13957
|
+
<wc-focus-ring class="focus-ring" for="item"></wc-focus-ring>
|
|
13739
13958
|
|
|
13740
13959
|
<div class="item-content">
|
|
13741
13960
|
<div class="indicator">
|
|
@@ -13745,16 +13964,13 @@ class NavigationRailItem extends i$1 {
|
|
|
13745
13964
|
<slot name="icon" class="icon-slot"></slot>
|
|
13746
13965
|
</div>
|
|
13747
13966
|
</div>
|
|
13748
|
-
${this.
|
|
13749
|
-
? b `<div class="label"><slot></slot></div>`
|
|
13750
|
-
: b `<slot class="hidden-slot"></slot>`}
|
|
13967
|
+
<div class="label ${this.collapsed ? 'hidden' : ''}"><slot></slot></div>
|
|
13751
13968
|
</div>
|
|
13752
13969
|
|
|
13753
13970
|
${this.__renderDisabledReason()}
|
|
13754
13971
|
`;
|
|
13755
13972
|
}
|
|
13756
13973
|
render() {
|
|
13757
|
-
const isLink = this.__isLink();
|
|
13758
13974
|
const cssClasses = {
|
|
13759
13975
|
item: true,
|
|
13760
13976
|
'item-element': true,
|
|
@@ -13764,7 +13980,7 @@ class NavigationRailItem extends i$1 {
|
|
|
13764
13980
|
'has-label': this._hasLabel,
|
|
13765
13981
|
'has-active-icon': this._hasActiveIcon,
|
|
13766
13982
|
};
|
|
13767
|
-
if (!isLink) {
|
|
13983
|
+
if (!isLink(this)) {
|
|
13768
13984
|
return b `<button
|
|
13769
13985
|
id="item"
|
|
13770
13986
|
class=${e$1(cssClasses)}
|
|
@@ -13965,4 +14181,4 @@ __decorate([
|
|
|
13965
14181
|
], NavigationRail.prototype, "showDivider", void 0);
|
|
13966
14182
|
|
|
13967
14183
|
export { Tooltip as $, Accordion as A, Badge as B, Checkbox as C, DatePicker as D, Elevation as E, Field as F, Slider as G, Snackbar as H, Image as I, Spinner as J, SubMenu as K, LinearProgress as L, Menu as M, NavigationRail as N, Svg as O, Pagination as P, Switch as Q, Radio as R, SegmentedButton as S, Tab as T, TabGroup as U, TabPanel as V, Table as W, Tabs as X, Tag as Y, Textarea as Z, TimePicker as _, Avatar as a, UrlField as a0, Breadcrumb as b, BreadcrumbItem as c, Chip as d, ChipSet as e, CircularProgress as f, Container as g, Divider as h, EmptyState as i, FocusRing as j, Input as k, Item as l, Link as m, List as n, ListItem as o, MenuItem as p, NavigationRailItem as q, NumberField as r, Ripple as s, SegmentedButtonGroup as t, Select as u, SelectOptionElement as v, SidebarMenu as w, SidebarMenuItem as x, SidebarSubMenu as y, Skeleton as z };
|
|
13968
|
-
//# sourceMappingURL=navigation-rail-
|
|
14184
|
+
//# sourceMappingURL=navigation-rail-CM_svs5_.js.map
|