@m3e/stepper 1.0.2 → 1.0.4
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/custom-elements.json +6 -0
- package/dist/index.js +10 -9
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +15 -14
- package/dist/index.min.js.map +1 -1
- package/dist/src/StepElement.d.ts.map +1 -1
- package/dist/src/StepPanelElement.d.ts +3 -1
- package/dist/src/StepPanelElement.d.ts.map +1 -1
- package/dist/src/StepperButtonElementBase.d.ts.map +1 -1
- package/dist/src/StepperElement.d.ts.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
* Copyright (c) 2025 matraic
|
|
4
4
|
* See LICENSE file in the project root for full license text.
|
|
5
5
|
*/
|
|
6
|
-
import {
|
|
7
|
-
import { Selected, KeyboardClick, Focusable, HtmlFor, Disabled, AttachInternals,
|
|
6
|
+
import { LitElement, html, css, nothing } from 'lit';
|
|
7
|
+
import { Role, Selected, KeyboardClick, Focusable, HtmlFor, Disabled, AttachInternals, DesignToken } from '@m3e/core';
|
|
8
8
|
import { addAriaReferencedId, removeAriaReferencedId, selectionManager, SelectionManager } from '@m3e/core/a11y';
|
|
9
9
|
import { M3eBreakpointObserver, Breakpoint } from '@m3e/core/layout';
|
|
10
10
|
|
|
@@ -152,7 +152,7 @@ const e$2=(e,t,c)=>(c.configurable=true,c.enumerable=true,Reflect.decorate&&"obj
|
|
|
152
152
|
* @cssprop --m3e-step-panel-spacing - Vertical gap between stacked elements within the step panel.
|
|
153
153
|
* @cssprop --m3e-step-panel-actions-height - Minimum height of the slotted actions container.
|
|
154
154
|
*/
|
|
155
|
-
let M3eStepPanelElement = class M3eStepPanelElement extends LitElement {
|
|
155
|
+
let M3eStepPanelElement = class M3eStepPanelElement extends Role(LitElement, "tabpanel") {
|
|
156
156
|
constructor() {
|
|
157
157
|
super(...arguments);
|
|
158
158
|
/** @internal */
|
|
@@ -160,7 +160,6 @@ let M3eStepPanelElement = class M3eStepPanelElement extends LitElement {
|
|
|
160
160
|
}
|
|
161
161
|
/** @inheritdoc */
|
|
162
162
|
connectedCallback() {
|
|
163
|
-
this.role = this.role || "tabpanel";
|
|
164
163
|
this.slot = "panel";
|
|
165
164
|
super.connectedCallback();
|
|
166
165
|
}
|
|
@@ -439,8 +438,8 @@ _M3eStepElement_handleClick = function _M3eStepElement_handleClick(e) {
|
|
|
439
438
|
if (e.defaultPrevented || this.selected)
|
|
440
439
|
return;
|
|
441
440
|
this.selected = true;
|
|
442
|
-
if (this.dispatchEvent(new Event("input", { bubbles: true, composed: true, cancelable: true }))
|
|
443
|
-
this.closest("m3e-stepper")?.moveTo(this.index)
|
|
441
|
+
if (this.dispatchEvent(new Event("input", { bubbles: true, composed: true, cancelable: true })) &&
|
|
442
|
+
this.closest("m3e-stepper")?.moveTo(this.index)) {
|
|
444
443
|
this.dispatchEvent(new Event("change", { bubbles: true }));
|
|
445
444
|
}
|
|
446
445
|
else {
|
|
@@ -456,10 +455,11 @@ M3eStepElement.styles = css `
|
|
|
456
455
|
min-width: 0px;
|
|
457
456
|
border-radius: var(--m3e-step-shape, ${DesignToken.shape.corner.medium});
|
|
458
457
|
padding: var(--m3e-step-padding, 1.5rem);
|
|
458
|
+
user-select: none;
|
|
459
|
+
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
|
|
459
460
|
}
|
|
460
461
|
:host(:not([aria-disabled="true"])) {
|
|
461
462
|
cursor: pointer;
|
|
462
|
-
user-select: none;
|
|
463
463
|
}
|
|
464
464
|
.icon {
|
|
465
465
|
flex: none;
|
|
@@ -587,7 +587,6 @@ class StepperButtonElementBase extends AttachInternals(LitElement) {
|
|
|
587
587
|
}
|
|
588
588
|
/** @inheritdoc */
|
|
589
589
|
connectedCallback() {
|
|
590
|
-
this.role = this.role || "none";
|
|
591
590
|
super.connectedCallback();
|
|
592
591
|
this.parentElement?.addEventListener("click", __classPrivateFieldGet(this, _StepperButtonElementBase_clickHandler, "f"));
|
|
593
592
|
}
|
|
@@ -772,6 +771,9 @@ let M3eStepperElement = class M3eStepperElement extends AttachInternals(LitEleme
|
|
|
772
771
|
if (selectedStep && selectedStep.index === index) {
|
|
773
772
|
return true;
|
|
774
773
|
}
|
|
774
|
+
if (this.steps[index]?.disabled) {
|
|
775
|
+
return false;
|
|
776
|
+
}
|
|
775
777
|
if (index >= 0 && index < this.steps.length) {
|
|
776
778
|
if (selectedStep) {
|
|
777
779
|
const valid = __classPrivateFieldGet(this, _M3eStepperElement_instances, "m", _M3eStepperElement_checkValidity).call(this);
|
|
@@ -820,7 +822,6 @@ let M3eStepperElement = class M3eStepperElement extends AttachInternals(LitEleme
|
|
|
820
822
|
}
|
|
821
823
|
/** @inheritdoc */
|
|
822
824
|
connectedCallback() {
|
|
823
|
-
this.role = this.role || "none";
|
|
824
825
|
super.connectedCallback();
|
|
825
826
|
this.classList.toggle("-no-animate", true);
|
|
826
827
|
}
|