@m3e/core 1.0.0 → 1.0.2

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.
@@ -118,11 +118,6 @@
118
118
  "description": "Whether the ripple always originates from the center of the element's bounds, rather\r\nthan originating from the location of the click event.",
119
119
  "values": []
120
120
  },
121
- {
122
- "name": "disable-enter",
123
- "description": "Whether the ripple is disabled when the enter key is pressed.",
124
- "values": []
125
- },
126
121
  {
127
122
  "name": "disabled",
128
123
  "description": "Whether click events will not trigger the ripple.\r\nRipples can be still controlled manually by using the `show` and 'hide' methods.",
package/dist/index.js CHANGED
@@ -543,13 +543,15 @@ _PressedController_capture = new WeakMap(), _PressedController_callback = new We
543
543
  if (e.target !== e.currentTarget)
544
544
  return;
545
545
  const target = e.currentTarget;
546
- if (!__classPrivateFieldGet(this, _PressedController_pressedTargets, "f").has(target) && __classPrivateFieldGet(this, _PressedController_isPressedKey, "f")?.call(this, e.key)) {
546
+ if (__classPrivateFieldGet(this, _PressedController_isPressedKey, "f")?.call(this, e.key)) {
547
547
  if (e.key === " ") {
548
548
  e.preventDefault();
549
549
  }
550
- __classPrivateFieldGet(this, _PressedController_pressedTargets, "f").set(target, performance.now());
551
- const bounds = target.getBoundingClientRect();
552
- __classPrivateFieldGet(this, _PressedController_callback, "f").call(this, true, { x: bounds.x + bounds.width / 2, y: bounds.y + bounds.height / 2 }, target);
550
+ if (!__classPrivateFieldGet(this, _PressedController_pressedTargets, "f").has(target)) {
551
+ __classPrivateFieldGet(this, _PressedController_pressedTargets, "f").set(target, performance.now());
552
+ const bounds = target.getBoundingClientRect();
553
+ __classPrivateFieldGet(this, _PressedController_callback, "f").call(this, true, { x: bounds.x + bounds.width / 2, y: bounds.y + bounds.height / 2 }, target);
554
+ }
553
555
  }
554
556
  }, _PressedController_handleKeyUp = function _PressedController_handleKeyUp(e) {
555
557
  const target = e.target;
@@ -3785,8 +3787,7 @@ var _M3eRippleElement_instances, _M3eRippleElement_ripple, _M3eRippleElement_pre
3785
3787
  * The component can be attached to an interactive element using the `for` attribute or programmatically using the `attach` method.
3786
3788
  * The ripple is displayed when the interactive element is pressed and hidden when released. This can be disabled using the `disabled` attribute.
3787
3789
  *
3788
- * The pressed state actives either using both pointer and keyboard events. For keyboard events, `SPACE` and `ENTER` activate a ripple.
3789
- * You can disabled whether the `ENTER` key actives a ripple using the `disable-enter` attribute.
3790
+ * The pressed state actives either using both pointer and keyboard events. For keyboard events, `SPACE` activate a ripple.
3790
3791
  *
3791
3792
  * Alternately, you can use the `show` and `hide` methods to programmatically control the ripple.
3792
3793
  *
@@ -3804,7 +3805,6 @@ var _M3eRippleElement_instances, _M3eRippleElement_ripple, _M3eRippleElement_pre
3804
3805
  * @tag m3e-ripple
3805
3806
  *
3806
3807
  * @attr centered - Whether the ripple always originates from the center of the element's bounds, rather than originating from the location of the click event.
3807
- * @attr disable-enter - Whether the ripple is disabled when the enter key is pressed.
3808
3808
  * @attr disabled - Whether click events will not trigger the ripple. Ripples can be still controlled manually by using the `show` and 'hide' methods.
3809
3809
  * @attr for - The identifier of the interactive control to which this element is attached.
3810
3810
  * @attr radius - The radius, in pixels, of the ripple.
@@ -3825,7 +3825,7 @@ let M3eRippleElement = class M3eRippleElement extends HtmlFor(Role(LitElement, "
3825
3825
  /** @private */ _M3eRippleElement_pressedController.set(this, new PressedController(this, {
3826
3826
  target: null,
3827
3827
  minPressedDuration: 150,
3828
- isPressedKey: (key) => key === " " || (!this.disableEnter && key === "Enter"),
3828
+ isPressedKey: (key) => key === " ",
3829
3829
  callback: (pressed, { x, y }) => __classPrivateFieldGet(this, _M3eRippleElement_instances, "m", _M3eRippleElement_handlePressedChange).call(this, pressed, x, y),
3830
3830
  }));
3831
3831
  /**
@@ -3834,11 +3834,6 @@ let M3eRippleElement = class M3eRippleElement extends HtmlFor(Role(LitElement, "
3834
3834
  * @default false
3835
3835
  */
3836
3836
  this.disabled = false;
3837
- /**
3838
- * Whether the ripple is disabled when the enter key is pressed.
3839
- * @default false
3840
- */
3841
- this.disableEnter = false;
3842
3837
  /**
3843
3838
  * Whether the ripple always originates from the center of the element's bounds, rather
3844
3839
  * than originating from the location of the click event.
@@ -4030,9 +4025,6 @@ M3eRippleElement.styles = css `
4030
4025
  __decorate([
4031
4026
  n$1({ type: Boolean, reflect: true })
4032
4027
  ], M3eRippleElement.prototype, "disabled", void 0);
4033
- __decorate([
4034
- n$1({ attribute: "disable-enter", type: Boolean, reflect: true })
4035
- ], M3eRippleElement.prototype, "disableEnter", void 0);
4036
4028
  __decorate([
4037
4029
  n$1({ type: Boolean, reflect: true })
4038
4030
  ], M3eRippleElement.prototype, "centered", void 0);
@@ -4367,7 +4359,7 @@ let M3eStateLayerElement = class M3eStateLayerElement extends HtmlFor(Role(LitEl
4367
4359
  /** @private */
4368
4360
  _M3eStateLayerElement_focusController.set(this, new FocusController(this, {
4369
4361
  target: null,
4370
- callback: (focused) => __classPrivateFieldGet(this, _M3eStateLayerElement_instances, "m", _M3eStateLayerElement_handleFocusChange).call(this, focused),
4362
+ callback: (focused, focusVisible) => __classPrivateFieldGet(this, _M3eStateLayerElement_instances, "m", _M3eStateLayerElement_handleFocusChange).call(this, focused && focusVisible),
4371
4363
  }));
4372
4364
  /**
4373
4365
  * Whether hover and focus event will not trigger the state layer. State layers can still