@m3e/stepper 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.
@@ -0,0 +1,139 @@
1
+ import { CSSResultGroup, LitElement, PropertyValues } from "lit";
2
+ import { SelectionManager, selectionManager } from "@m3e/core/a11y";
3
+ import { M3eStepElement } from "./StepElement";
4
+ import { StepLabelPosition } from "./StepLabelPosition";
5
+ import { StepHeaderPosition } from "./StepHeaderPosition";
6
+ import { StepperOrientation } from "./StepperOrientation";
7
+ declare const M3eStepperElement_base: import("node_modules/@m3e/core/dist/src/shared/mixins/Constructor").Constructor<import("@m3e/core").AttachInternalsMixin> & typeof LitElement;
8
+ /**
9
+ * Provides a wizard-like workflow by dividing content into logical steps.
10
+ *
11
+ * @description
12
+ * The `m3e-stepper` component orchestrates a structured, wizard-like workflow by dividing
13
+ * content into discrete, navigable steps. It supports horizontal and vertical orientations,
14
+ * linear progression, and configurable label and header positioning.
15
+ *
16
+ * @example
17
+ * The following example demonstrates a linear multi-step form flow using the `m3e-stepper`
18
+ * component. Each `m3e-step` defines a navigable step label, linked to its corresponding
19
+ * `m3e-step-panel` via the `for` attribute. Navigation is orchestrated using the
20
+ * `m3e-stepper-next`, `m3e-stepper-previous`, and `m3e-stepper-reset` components.
21
+ *
22
+ * <m3e-stepper>
23
+ * <m3e-step for="step1">Fill out your name</m3e-step>
24
+ * <m3e-step for="step2">Fill out your address</m3e-step>
25
+ * <m3e-step for="step3">Done</m3e-step>
26
+ * <m3e-step-panel id="step1">
27
+ * <form>
28
+ * <m3e-form-field>
29
+ * <label slot="label" for="name">Name</label>
30
+ * <input name="name" id="name" required />
31
+ * </m3e-form-field>
32
+ * </form>
33
+ * <div slot="actions">
34
+ * <m3e-button><m3e-stepper-next>Next</m3e-stepper-next></m3e-button>
35
+ * </div>
36
+ * </m3e-step-panel>
37
+ * <m3e-step-panel id="step2">
38
+ * <form>
39
+ * <m3e-form-field>
40
+ * <label slot="label" for="address">Address</label>
41
+ * <input name="address" id="address" required />
42
+ * </m3e-form-field>
43
+ * </form>
44
+ * <div slot="actions">
45
+ * <m3e-button><m3e-stepper-previous>Back</m3e-stepper-previous></m3e-button>
46
+ * <m3e-button><m3e-stepper-next>Next</m3e-stepper-next></m3e-button>
47
+ * </div>
48
+ * </m3e-step-panel>
49
+ * <m3e-step-panel id="step3">Done
50
+ * <div slot="actions">
51
+ * <m3e-button><m3e-stepper-previous>Back</m3e-stepper-previous></m3e-button>
52
+ * <m3e-button><m3e-stepper-reset>Reset</m3e-stepper-reset></m3e-button>
53
+ * </div>
54
+ * </m3e-step-panel>
55
+ * </m3e-stepper>
56
+ *
57
+ * @tag m3e-stepper
58
+ *
59
+ * @attr header-position - The position of the step header, when oriented horizontally.
60
+ * @attr label-position - The position of the step labels, when oriented horizontally.
61
+ * @attr linear - Whether the validity of previous steps should be checked or not.
62
+ * @attr orientation - The orientation of the stepper.
63
+ *
64
+ * @slot step - Renders a step.
65
+ * @slot panel - Renders a panel.
66
+ *
67
+ * @fires change - Emitted when the selected step changes.
68
+ *
69
+ * @cssprop --m3e-step-divider-thickness - Thickness of the divider line between steps.
70
+ * @cssprop --m3e-step-divider-color - Color of the divider line between steps.
71
+ * @cssprop --m3e-step-divider-inset - Inset offset for divider alignment within step layout.
72
+ */
73
+ export declare class M3eStepperElement extends M3eStepperElement_base {
74
+ #private;
75
+ /** The styles of the element. */
76
+ static styles: CSSResultGroup;
77
+ /** @private */ private _orientation?;
78
+ /** @private */ private _selectedIndex;
79
+ /** @internal */ readonly [selectionManager]: SelectionManager<M3eStepElement>;
80
+ /**
81
+ * The position of the step header, when oriented horizontally.
82
+ * @default "above"
83
+ */
84
+ headerPosition: StepHeaderPosition;
85
+ /**
86
+ * The position of the step labels, when oriented horizontally.
87
+ * @default "end"
88
+ */
89
+ labelPosition: StepLabelPosition;
90
+ /**
91
+ * Whether the validity of previous steps should be checked or not.
92
+ * @default false
93
+ */
94
+ linear: boolean;
95
+ /**
96
+ * The orientation of the stepper.
97
+ * @default "horizontal"
98
+ */
99
+ orientation: StepperOrientation;
100
+ /** The steps. */
101
+ get steps(): readonly M3eStepElement[];
102
+ /** The selected step. */
103
+ get selectedStep(): M3eStepElement | null;
104
+ /** The zero-based index of the selected step. */
105
+ get selectedIndex(): number;
106
+ /**
107
+ * Moves the stepper to the previous step.
108
+ * @returns {boolean} Whether the stepper moved to the previous step.
109
+ */
110
+ movePrevious(): boolean;
111
+ /**
112
+ * Moves the stepper to the next step.
113
+ * @returns {boolean} Whether the stepper moved to the next step.
114
+ */
115
+ moveNext(): boolean;
116
+ /**
117
+ * Moves the stepper to the step with the specified index.
118
+ * @param index The zero-based index of the step to which to move.
119
+ * @returns {boolean} Whether the stepper moved to the specified `index`.
120
+ */
121
+ moveTo(index: number): boolean;
122
+ /** Resets the stepper to its initial state, clearing any form data. */
123
+ reset(): void;
124
+ /** @inheritdoc */
125
+ connectedCallback(): void;
126
+ /** @inheritdoc */
127
+ disconnectedCallback(): void;
128
+ /** @inheritdoc */
129
+ protected update(changedProperties: PropertyValues): void;
130
+ /** @inheritdoc */
131
+ protected render(): unknown;
132
+ }
133
+ declare global {
134
+ interface HTMLElementTagNameMap {
135
+ "m3e-stepper": M3eStepperElement;
136
+ }
137
+ }
138
+ export {};
139
+ //# sourceMappingURL=StepperElement.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StepperElement.d.ts","sourceRoot":"","sources":["../../src/StepperElement.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,cAAc,EAAQ,UAAU,EAAW,cAAc,EAAE,MAAM,KAAK,CAAC;AAKrF,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAGpE,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EA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ElementBase } from "./StepperButtonElementBase";
2
+ /**
3
+ * An element, nested within a clickable element, used to move a stepper to the next step.
4
+ * @tag m3e-stepper-previous
5
+ *
6
+ * @slot - Renders the content of the action.
7
+ */
8
+ export declare class M3eStepperNextElement extends StepperButtonElementBase {
9
+ constructor();
10
+ }
11
+ declare global {
12
+ interface HTMLElementTagNameMap {
13
+ "m3e-stepper-next": M3eStepperNextElement;
14
+ }
15
+ }
16
+ //# sourceMappingURL=StepperNextElement.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StepperNextElement.d.ts","sourceRoot":"","sources":["../../src/StepperNextElement.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AAEtE;;;;;GAKG;AACH,qBACa,qBAAsB,SAAQ,wBAAwB;;CAIlE;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,kBAAkB,EAAE,qBAAqB,CAAC;KAC3C;CACF"}
@@ -0,0 +1,3 @@
1
+ /** Specifies the possible layout orientations of a stepper. */
2
+ export type StepperOrientation = "horizontal" | "vertical" | "auto";
3
+ //# sourceMappingURL=StepperOrientation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StepperOrientation.d.ts","sourceRoot":"","sources":["../../src/StepperOrientation.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,MAAM,MAAM,kBAAkB,GAAG,YAAY,GAAG,UAAU,GAAG,MAAM,CAAC"}
@@ -0,0 +1,16 @@
1
+ import { StepperButtonElementBase } from "./StepperButtonElementBase";
2
+ /**
3
+ * An element, nested within a clickable element, used to move a stepper to the previous step.
4
+ * @tag m3e-stepper-previous
5
+ *
6
+ * @slot - Renders the content of the action.
7
+ */
8
+ export declare class M3eStepperPreviousElement extends StepperButtonElementBase {
9
+ constructor();
10
+ }
11
+ declare global {
12
+ interface HTMLElementTagNameMap {
13
+ "m3e-stepper-previous": M3eStepperPreviousElement;
14
+ }
15
+ }
16
+ //# sourceMappingURL=StepperPreviousElement.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StepperPreviousElement.d.ts","sourceRoot":"","sources":["../../src/StepperPreviousElement.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AAEtE;;;;;GAKG;AACH,qBACa,yBAA0B,SAAQ,wBAAwB;;CAItE;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,sBAAsB,EAAE,yBAAyB,CAAC;KACnD;CACF"}
@@ -0,0 +1,16 @@
1
+ import { StepperButtonElementBase } from "./StepperButtonElementBase";
2
+ /**
3
+ * An element, nested within a clickable element, used to reset a stepper to its initial state.
4
+ * @tag m3e-stepper-reset
5
+ *
6
+ * @slot - Renders the content of the action.
7
+ */
8
+ export declare class M3eStepperResetElement extends StepperButtonElementBase {
9
+ constructor();
10
+ }
11
+ declare global {
12
+ interface HTMLElementTagNameMap {
13
+ "m3e-stepper-reset": M3eStepperResetElement;
14
+ }
15
+ }
16
+ //# sourceMappingURL=StepperResetElement.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StepperResetElement.d.ts","sourceRoot":"","sources":["../../src/StepperResetElement.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AAEtE;;;;;GAKG;AACH,qBACa,sBAAuB,SAAQ,wBAAwB;;CAInE;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,mBAAmB,EAAE,sBAAsB,CAAC;KAC7C;CACF"}
@@ -0,0 +1,10 @@
1
+ export * from "./StepElement";
2
+ export * from "./StepHeaderPosition";
3
+ export * from "./StepLabelPosition";
4
+ export * from "./StepPanelElement";
5
+ export * from "./StepperButtonElementBase";
6
+ export * from "./StepperElement";
7
+ export * from "./StepperNextElement";
8
+ export * from "./StepperPreviousElement";
9
+ export * from "./StepperResetElement";
10
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,kBAAkB,CAAC;AACjC,cAAc,sBAAsB,CAAC;AACrC,cAAc,0BAA0B,CAAC;AACzC,cAAc,uBAAuB,CAAC"}
package/package.json ADDED
@@ -0,0 +1,48 @@
1
+ {
2
+ "name": "@m3e/stepper",
3
+ "version": "1.0.2",
4
+ "description": "Stepper for M3E",
5
+ "author": "matraic <matraic@yahoo.com>",
6
+ "license": "MIT",
7
+ "homepage": "https://matraic.github.io/m3e/#/components/stepper.html",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "git+https://github.com/matraic/m3e.git"
11
+ },
12
+ "keywords": [
13
+ "material design",
14
+ "web components",
15
+ "stepper"
16
+ ],
17
+ "main": "dist/index.js",
18
+ "module": "dist/index.js",
19
+ "browser": "dist/index.min.js",
20
+ "unpkg": "dist/index.min.js",
21
+ "types": "dist/src/index.d.ts",
22
+ "type": "module",
23
+ "scripts": {
24
+ "build": "rollup -c",
25
+ "cem": "cem analyze --config cem.config.mjs",
26
+ "lint": "npx eslint ./src",
27
+ "clean": "rimraf dist"
28
+ },
29
+ "peerDependencies": {
30
+ "@m3e/core": "1.0.2",
31
+ "lit": "^3.3.0"
32
+ },
33
+ "devDependencies": {
34
+ "@custom-elements-manifest/analyzer": "^0.10.4",
35
+ "@eslint/js": "^9.30.1",
36
+ "@rollup/plugin-node-resolve": "^16.0.0",
37
+ "@rollup/plugin-terser": "^0.4.4",
38
+ "@rollup/plugin-typescript": "12.1.0",
39
+ "custom-element-vs-code-integration": "^1.5.0",
40
+ "eslint": "^9.32.0",
41
+ "rimraf": "^6.0.1",
42
+ "rollup": "^4.44.2",
43
+ "tslib": "^2.8.1",
44
+ "typescript": "~5.8.2",
45
+ "typescript-eslint": "^8.38.0"
46
+ },
47
+ "customElements": "dist/custom-elements.json"
48
+ }