@govtechsg/sgds-web-component 3.19.0 → 3.20.0-rc.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.
Files changed (89) hide show
  1. package/base/select-element.d.ts +2 -0
  2. package/base/select-element.js +12 -0
  3. package/base/select-element.js.map +1 -1
  4. package/components/Alert/alert.js +1 -1
  5. package/components/Alert/index.umd.min.js +1 -1
  6. package/components/Alert/index.umd.min.js.map +1 -1
  7. package/components/ComboBox/index.umd.min.js +4 -4
  8. package/components/ComboBox/index.umd.min.js.map +1 -1
  9. package/components/ComboBox/sgds-combo-box.d.ts +4 -0
  10. package/components/ComboBox/sgds-combo-box.js +9 -0
  11. package/components/ComboBox/sgds-combo-box.js.map +1 -1
  12. package/components/Select/index.umd.min.js +15 -15
  13. package/components/Select/index.umd.min.js.map +1 -1
  14. package/components/Stepper/index.d.ts +2 -0
  15. package/components/Stepper/index.js +2 -0
  16. package/components/Stepper/index.js.map +1 -1
  17. package/components/Stepper/index.umd.min.js +61 -39
  18. package/components/Stepper/index.umd.min.js.map +1 -1
  19. package/components/Stepper/sgds-step.d.ts +42 -0
  20. package/components/Stepper/sgds-step.js +123 -0
  21. package/components/Stepper/sgds-step.js.map +1 -0
  22. package/components/Stepper/sgds-stepper.d.ts +33 -2
  23. package/components/Stepper/sgds-stepper.js +132 -36
  24. package/components/Stepper/sgds-stepper.js.map +1 -1
  25. package/components/Stepper/step.js +6 -0
  26. package/components/Stepper/step.js.map +1 -0
  27. package/components/Stepper/stepper.js +1 -1
  28. package/components/Stepper/types.d.ts +1 -0
  29. package/components/Textarea/index.umd.min.js.map +1 -1
  30. package/components/Textarea/sgds-textarea.d.ts +2 -0
  31. package/components/Textarea/sgds-textarea.js +2 -0
  32. package/components/Textarea/sgds-textarea.js.map +1 -1
  33. package/components/index.d.ts +1 -0
  34. package/components/index.js +1 -0
  35. package/components/index.js.map +1 -1
  36. package/components/index.umd.min.js +90 -68
  37. package/components/index.umd.min.js.map +1 -1
  38. package/css/fouc.css +1 -0
  39. package/custom-elements.json +301 -5
  40. package/index.umd.min.js +187 -165
  41. package/index.umd.min.js.map +1 -1
  42. package/package.json +1 -1
  43. package/react/base/select-element.cjs.js +12 -0
  44. package/react/base/select-element.cjs.js.map +1 -1
  45. package/react/base/select-element.js +12 -0
  46. package/react/base/select-element.js.map +1 -1
  47. package/react/combo-box/index.cjs.js +2 -0
  48. package/react/combo-box/index.cjs.js.map +1 -1
  49. package/react/combo-box/index.js +2 -0
  50. package/react/combo-box/index.js.map +1 -1
  51. package/react/components/Alert/alert.cjs.js +1 -1
  52. package/react/components/Alert/alert.js +1 -1
  53. package/react/components/ComboBox/sgds-combo-box.cjs.js +9 -0
  54. package/react/components/ComboBox/sgds-combo-box.cjs.js.map +1 -1
  55. package/react/components/ComboBox/sgds-combo-box.js +9 -0
  56. package/react/components/ComboBox/sgds-combo-box.js.map +1 -1
  57. package/react/components/Stepper/sgds-step.cjs.js +129 -0
  58. package/react/components/Stepper/sgds-step.cjs.js.map +1 -0
  59. package/react/components/Stepper/sgds-step.js +124 -0
  60. package/react/components/Stepper/sgds-step.js.map +1 -0
  61. package/react/components/Stepper/sgds-stepper.cjs.js +130 -34
  62. package/react/components/Stepper/sgds-stepper.cjs.js.map +1 -1
  63. package/react/components/Stepper/sgds-stepper.js +132 -36
  64. package/react/components/Stepper/sgds-stepper.js.map +1 -1
  65. package/react/components/Stepper/step.cjs.js +11 -0
  66. package/react/components/Stepper/step.cjs.js.map +1 -0
  67. package/react/components/Stepper/step.js +7 -0
  68. package/react/components/Stepper/step.js.map +1 -0
  69. package/react/components/Stepper/stepper.cjs.js +1 -1
  70. package/react/components/Stepper/stepper.js +1 -1
  71. package/react/components/Textarea/sgds-textarea.cjs.js +2 -0
  72. package/react/components/Textarea/sgds-textarea.cjs.js.map +1 -1
  73. package/react/components/Textarea/sgds-textarea.js +2 -0
  74. package/react/components/Textarea/sgds-textarea.js.map +1 -1
  75. package/react/index.cjs.js +40 -38
  76. package/react/index.cjs.js.map +1 -1
  77. package/react/index.d.ts +1 -0
  78. package/react/index.js +1 -0
  79. package/react/index.js.map +1 -1
  80. package/react/step/index.cjs.js +40 -0
  81. package/react/step/index.cjs.js.map +1 -0
  82. package/react/step/index.d.ts +4 -0
  83. package/react/step/index.js +16 -0
  84. package/react/step/index.js.map +1 -0
  85. package/react/textarea/index.cjs.js +3 -1
  86. package/react/textarea/index.cjs.js.map +1 -1
  87. package/react/textarea/index.js +3 -1
  88. package/react/textarea/index.js.map +1 -1
  89. package/types/react.d.ts +23 -2
@@ -0,0 +1,42 @@
1
+ import SgdsElement from "../../base/sgds-element";
2
+ import SgdsIcon from "../Icon/sgds-icon";
3
+ /**
4
+ * @summary A step within a stepper component
5
+ * @slot default - Additional content to display under the step header
6
+ *
7
+ */
8
+ export declare class SgdsStep extends SgdsElement {
9
+ static styles: import("lit").CSSResult[];
10
+ /** @internal */
11
+ static dependencies: {
12
+ "sgds-icon": typeof SgdsIcon;
13
+ };
14
+ /** The header text for the step */
15
+ stepHeader: string;
16
+ /** Optional icon name to display instead of step number */
17
+ iconName: string | undefined;
18
+ /** Optional component to render for this step */
19
+ component: unknown;
20
+ /** @internal The index of this step within the stepper */
21
+ stepIndex: number;
22
+ /** @internal Whether this step is currently active */
23
+ active: boolean;
24
+ /** @internal Whether this step is currently disabled */
25
+ disabled: boolean;
26
+ /** @internal Whether this step is completed */
27
+ completed: boolean;
28
+ /** @internal Whether this step is clickable */
29
+ isClickable: boolean;
30
+ /** @internal Orientation of parent stepper (horizontal or vertical) */
31
+ orientation: "horizontal" | "vertical";
32
+ /** @internal Whether this step is the first sgds-step of its type in the slot */
33
+ isFirstOfType: boolean;
34
+ /** @internal Whether this step is completed */
35
+ _isCompleted: boolean;
36
+ render(): import("lit").TemplateResult<1>;
37
+ /**@internal */
38
+ _handleClick(e?: PointerEvent): void;
39
+ /**@internal */
40
+ _handleKeyDown(event: KeyboardEvent): void;
41
+ }
42
+ export default SgdsStep;
@@ -0,0 +1,123 @@
1
+ import { __decorate } from 'tslib';
2
+ import { html } from 'lit';
3
+ import { property } from 'lit/decorators.js';
4
+ import { classMap } from 'lit/directives/class-map.js';
5
+ import SgdsElement from '../../base/sgds-element.js';
6
+ import { SgdsIcon } from '../Icon/sgds-icon.js';
7
+ import css_248z from './step.js';
8
+
9
+ /**
10
+ * @summary A step within a stepper component
11
+ * @slot default - Additional content to display under the step header
12
+ *
13
+ */
14
+ class SgdsStep extends SgdsElement {
15
+ constructor() {
16
+ super(...arguments);
17
+ /** The header text for the step */
18
+ this.stepHeader = "";
19
+ /** @internal The index of this step within the stepper */
20
+ this.stepIndex = 0;
21
+ /** @internal Whether this step is currently active */
22
+ this.active = false;
23
+ /** @internal Whether this step is currently disabled */
24
+ this.disabled = false;
25
+ /** @internal Whether this step is completed */
26
+ this.completed = false;
27
+ /** @internal Whether this step is clickable */
28
+ this.isClickable = false;
29
+ /** @internal Orientation of parent stepper (horizontal or vertical) */
30
+ this.orientation = "horizontal";
31
+ /** @internal Whether this step is the first sgds-step of its type in the slot */
32
+ this.isFirstOfType = false;
33
+ /** @internal Whether this step is completed */
34
+ this._isCompleted = false;
35
+ }
36
+ render() {
37
+ const isValidClickable = !this.disabled && this.isClickable;
38
+ return html `
39
+ <div class="stepper-item-container">
40
+ <div
41
+ class="stepper-item ${classMap({
42
+ first: this.isFirstOfType,
43
+ active: this.active,
44
+ completed: this._isCompleted,
45
+ clickable: this.isClickable,
46
+ vertical: this.orientation === "vertical",
47
+ disabled: this.disabled
48
+ })}"
49
+ tabindex=${isValidClickable ? "0" : "-1"}
50
+ aria-current=${this.active ? "step" : "false"}
51
+ aria-disabled=${this.disabled || (!this.active && !this._isCompleted) ? "true" : "false"}
52
+ @click="${isValidClickable ? e => this._handleClick(e) : null}"
53
+ @keydown=${isValidClickable ? (e) => this._handleKeyDown(e) : null}
54
+ >
55
+ <div class="stepper-marker">
56
+ ${this.iconName ? html `<sgds-icon name=${this.iconName} size="md"></sgds-icon>` : this.stepIndex + 1}
57
+ </div>
58
+
59
+ <div class="stepper-detail">
60
+ <div class="stepper-label">${this.stepHeader}</div>
61
+ <slot class="stepper-slot"></slot>
62
+ </div>
63
+ </div>
64
+ </div>
65
+ `;
66
+ }
67
+ /**@internal */
68
+ _handleClick(e) {
69
+ if (e) {
70
+ const ele = e.target;
71
+ // Allow user to have custom slotted item with attribute 'data-clickable' to skip i-sgds-click
72
+ // To handle if there are clickable objects within the slot
73
+ if (ele.hasAttribute("data-clickable"))
74
+ return;
75
+ }
76
+ this.emit("i-sgds-click", { detail: { stepIndex: this.stepIndex } });
77
+ }
78
+ /**@internal */
79
+ _handleKeyDown(event) {
80
+ if (event.key === "Enter") {
81
+ this._handleClick();
82
+ }
83
+ }
84
+ }
85
+ SgdsStep.styles = [...SgdsElement.styles, css_248z];
86
+ /** @internal */
87
+ SgdsStep.dependencies = { "sgds-icon": SgdsIcon };
88
+ __decorate([
89
+ property({ type: String, reflect: true })
90
+ ], SgdsStep.prototype, "stepHeader", void 0);
91
+ __decorate([
92
+ property({ type: String, reflect: true })
93
+ ], SgdsStep.prototype, "iconName", void 0);
94
+ __decorate([
95
+ property({ type: Object })
96
+ ], SgdsStep.prototype, "component", void 0);
97
+ __decorate([
98
+ property({ type: Number })
99
+ ], SgdsStep.prototype, "stepIndex", void 0);
100
+ __decorate([
101
+ property({ type: Boolean, reflect: true })
102
+ ], SgdsStep.prototype, "active", void 0);
103
+ __decorate([
104
+ property({ type: Boolean, reflect: true })
105
+ ], SgdsStep.prototype, "disabled", void 0);
106
+ __decorate([
107
+ property({ type: Boolean, reflect: true })
108
+ ], SgdsStep.prototype, "completed", void 0);
109
+ __decorate([
110
+ property({ type: Boolean })
111
+ ], SgdsStep.prototype, "isClickable", void 0);
112
+ __decorate([
113
+ property({ type: String })
114
+ ], SgdsStep.prototype, "orientation", void 0);
115
+ __decorate([
116
+ property({ type: Boolean })
117
+ ], SgdsStep.prototype, "isFirstOfType", void 0);
118
+ __decorate([
119
+ property({ type: Boolean })
120
+ ], SgdsStep.prototype, "_isCompleted", void 0);
121
+
122
+ export { SgdsStep, SgdsStep as default };
123
+ //# sourceMappingURL=sgds-step.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sgds-step.js","sources":["../../../src/components/Stepper/sgds-step.ts"],"sourcesContent":["import { html } from \"lit\";\nimport { property } from \"lit/decorators.js\";\nimport { classMap } from \"lit/directives/class-map.js\";\nimport SgdsElement from \"../../base/sgds-element\";\nimport SgdsIcon from \"../Icon/sgds-icon\";\nimport stepStyle from \"./step.css\";\n\n/**\n * @summary A step within a stepper component\n * @slot default - Additional content to display under the step header\n *\n */\nexport class SgdsStep extends SgdsElement {\n static styles = [...SgdsElement.styles, stepStyle];\n /** @internal */\n static dependencies = { \"sgds-icon\": SgdsIcon };\n\n /** The header text for the step */\n @property({ type: String, reflect: true })\n stepHeader = \"\";\n\n /** Optional icon name to display instead of step number */\n @property({ type: String, reflect: true })\n iconName: string | undefined;\n\n /** Optional component to render for this step */\n @property({ type: Object })\n component: unknown;\n\n /** @internal The index of this step within the stepper */\n @property({ type: Number })\n stepIndex = 0;\n\n /** @internal Whether this step is currently active */\n @property({ type: Boolean, reflect: true })\n active = false;\n\n /** @internal Whether this step is currently disabled */\n @property({ type: Boolean, reflect: true })\n disabled = false;\n\n /** @internal Whether this step is completed */\n @property({ type: Boolean, reflect: true })\n completed = false;\n\n /** @internal Whether this step is clickable */\n @property({ type: Boolean })\n isClickable = false;\n\n /** @internal Orientation of parent stepper (horizontal or vertical) */\n @property({ type: String })\n orientation: \"horizontal\" | \"vertical\" = \"horizontal\";\n\n /** @internal Whether this step is the first sgds-step of its type in the slot */\n @property({ type: Boolean })\n isFirstOfType = false;\n\n /** @internal Whether this step is completed */\n @property({ type: Boolean })\n _isCompleted = false;\n\n render() {\n const isValidClickable = !this.disabled && this.isClickable;\n\n return html`\n <div class=\"stepper-item-container\">\n <div\n class=\"stepper-item ${classMap({\n first: this.isFirstOfType,\n active: this.active,\n completed: this._isCompleted,\n clickable: this.isClickable,\n vertical: this.orientation === \"vertical\",\n disabled: this.disabled\n })}\"\n tabindex=${isValidClickable ? \"0\" : \"-1\"}\n aria-current=${this.active ? \"step\" : \"false\"}\n aria-disabled=${this.disabled || (!this.active && !this._isCompleted) ? \"true\" : \"false\"}\n @click=\"${isValidClickable ? e => this._handleClick(e) : null}\"\n @keydown=${isValidClickable ? (e: KeyboardEvent) => this._handleKeyDown(e) : null}\n >\n <div class=\"stepper-marker\">\n ${this.iconName ? html`<sgds-icon name=${this.iconName} size=\"md\"></sgds-icon>` : this.stepIndex + 1}\n </div>\n\n <div class=\"stepper-detail\">\n <div class=\"stepper-label\">${this.stepHeader}</div>\n <slot class=\"stepper-slot\"></slot>\n </div>\n </div>\n </div>\n `;\n }\n\n /**@internal */\n _handleClick(e?: PointerEvent) {\n if (e) {\n const ele = e.target as HTMLElement;\n\n // Allow user to have custom slotted item with attribute 'data-clickable' to skip i-sgds-click\n // To handle if there are clickable objects within the slot\n if (ele.hasAttribute(\"data-clickable\")) return;\n }\n\n this.emit(\"i-sgds-click\", { detail: { stepIndex: this.stepIndex } });\n }\n\n /**@internal */\n _handleKeyDown(event: KeyboardEvent) {\n if (event.key === \"Enter\") {\n this._handleClick();\n }\n }\n}\n\nexport default SgdsStep;\n"],"names":["stepStyle"],"mappings":";;;;;;;;AAOA;;;;AAIG;AACG,MAAO,QAAS,SAAQ,WAAW,CAAA;AAAzC,IAAA,WAAA,GAAA;;;QAOE,IAAU,CAAA,UAAA,GAAG,EAAE,CAAC;;QAYhB,IAAS,CAAA,SAAA,GAAG,CAAC,CAAC;;QAId,IAAM,CAAA,MAAA,GAAG,KAAK,CAAC;;QAIf,IAAQ,CAAA,QAAA,GAAG,KAAK,CAAC;;QAIjB,IAAS,CAAA,SAAA,GAAG,KAAK,CAAC;;QAIlB,IAAW,CAAA,WAAA,GAAG,KAAK,CAAC;;QAIpB,IAAW,CAAA,WAAA,GAA8B,YAAY,CAAC;;QAItD,IA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ted on hide after animation has completed. Event is fired when firstStep method is called.
12
12
  * @event sgds-arrived - Emitted right after the activeStep has updated its state, when upcoming step has arrived. Call `getMethod()` on this event to get the current step's component.
13
13
  * @event sgds-reset - Emitted right before the step is reset to its defaultActiveStep. Event is fired when reset method is called.
14
+ * @slot default - slot for sgds-step children
14
15
  *
15
16
  */
16
17
  export declare class SgdsStepper extends SgdsElement {
@@ -19,8 +20,8 @@ export declare class SgdsStepper extends SgdsElement {
19
20
  static dependencies: {
20
21
  "sgds-icon": typeof SgdsIcon;
21
22
  };
22
- /** The metadata of stepper, type `IStepMetaData`, that consist of `stepHeader: string`, `component:unknown`, `iconName:string`. `stepHeader` is the name of the step and `component` is the content that should appear at the each step. `component` is set to `unknown` to allow users to pass in their desired component based on the framework of choice. e.g. pass in your own react/angular/vue component or it can also be a text content.
23
- * It is required to populate this array to properly render the stepper. By default, stepper markers will render numbers. For icon stepper markers, pass the name of sgds icon via `iconName` key. `iconName` is optional.
23
+ /** The metadata of stepper, type `IStepMetaData`. Deprecated: use sgds-step child components instead.
24
+ * @deprecated Use sgds-step child components instead of the steps property
24
25
  */
25
26
  steps: IStepMetaData[];
26
27
  /** The current state of active step. Defaults to 0 */
@@ -29,8 +30,32 @@ export declare class SgdsStepper extends SgdsElement {
29
30
  orientation: StepperOrientation;
30
31
  /** When true, the stepper's steps will be clickable */
31
32
  clickable: boolean;
33
+ /** When true, the stepper's steps can only be clicked in a linear manner */
34
+ linear: boolean;
32
35
  /** @internal Gets or sets the default activeStep used to reset this element. The initial value corresponds to the one originally specified in the HTML that created this element. */
33
36
  defaultActiveStep: number;
37
+ /** @internal */
38
+ private _slotNodes;
39
+ /** @internal */
40
+ private _items;
41
+ private _totalSteps;
42
+ /** @internal Bound i-sgds-click handler for proper event listener removal */
43
+ private _boundHandleItemClick;
44
+ /**
45
+ * Indicates the presence of the default slot.
46
+ * Used for server-side rendering to determine table structure.
47
+ * @type {boolean}
48
+ * @internal
49
+ * @default false
50
+ */
51
+ hasDefaultSlot: boolean;
52
+ private readonly hasSlotController;
53
+ connectedCallback(): void;
54
+ /** @internal */
55
+ private _handleSlotChange;
56
+ updated(): void;
57
+ /** @internal Updates step item properties based on active step and clickable state */
58
+ private _updateStepItems;
34
59
  /** By default, it returns the corresponding component of the current activeStep as defined in the steps metadata. To get other components, pass in your desired step number as the parameter*/
35
60
  getComponent(step?: number): unknown;
36
61
  /** Moves the active step forward one step */
@@ -48,7 +73,13 @@ export declare class SgdsStepper extends SgdsElement {
48
73
  /**@internal */
49
74
  _handleActiveStepChange(): void;
50
75
  /**@internal */
76
+ _handleClickableChange(): void;
77
+ /**@internal */
78
+ _handleOrientationChange(): void;
79
+ /**@internal */
51
80
  _handleKeyDown(event: KeyboardEvent, index: number): void;
81
+ /**@internal */
82
+ _handleStepClick(e: Event): void;
52
83
  render(): import("lit").TemplateResult<1>;
53
84
  }
54
85
  export type StepperOrientation = "horizontal" | "vertical";
@@ -1,12 +1,13 @@
1
1
  import { __decorate } from 'tslib';
2
- import { html } from 'lit';
3
- import { property } from 'lit/decorators.js';
2
+ import { html, nothing } from 'lit';
3
+ import { property, queryAssignedElements } from 'lit/decorators.js';
4
4
  import { classMap } from 'lit/directives/class-map.js';
5
5
  import SgdsElement from '../../base/sgds-element.js';
6
6
  import { defaultValue } from '../../utils/defaultvalue.js';
7
7
  import { watch } from '../../utils/watch.js';
8
8
  import css_248z from './stepper.js';
9
9
  import { SgdsIcon } from '../Icon/sgds-icon.js';
10
+ import { HasSlotController } from '../../utils/slot.js';
10
11
 
11
12
  /**
12
13
  * @summary Steppers are used to inform users which step they are at in a form or a process
@@ -17,13 +18,14 @@ import { SgdsIcon } from '../Icon/sgds-icon.js';
17
18
  * @event sgds-first-step - Emitted on hide after animation has completed. Event is fired when firstStep method is called.
18
19
  * @event sgds-arrived - Emitted right after the activeStep has updated its state, when upcoming step has arrived. Call `getMethod()` on this event to get the current step's component.
19
20
  * @event sgds-reset - Emitted right before the step is reset to its defaultActiveStep. Event is fired when reset method is called.
21
+ * @slot default - slot for sgds-step children
20
22
  *
21
23
  */
22
24
  class SgdsStepper extends SgdsElement {
23
25
  constructor() {
24
26
  super(...arguments);
25
- /** The metadata of stepper, type `IStepMetaData`, that consist of `stepHeader: string`, `component:unknown`, `iconName:string`. `stepHeader` is the name of the step and `component` is the content that should appear at the each step. `component` is set to `unknown` to allow users to pass in their desired component based on the framework of choice. e.g. pass in your own react/angular/vue component or it can also be a text content.
26
- * It is required to populate this array to properly render the stepper. By default, stepper markers will render numbers. For icon stepper markers, pass the name of sgds icon via `iconName` key. `iconName` is optional.
27
+ /** The metadata of stepper, type `IStepMetaData`. Deprecated: use sgds-step child components instead.
28
+ * @deprecated Use sgds-step child components instead of the steps property
27
29
  */
28
30
  this.steps = [];
29
31
  /** The current state of active step. Defaults to 0 */
@@ -32,32 +34,93 @@ class SgdsStepper extends SgdsElement {
32
34
  this.orientation = "horizontal";
33
35
  /** When true, the stepper's steps will be clickable */
34
36
  this.clickable = false;
37
+ /** When true, the stepper's steps can only be clicked in a linear manner */
38
+ this.linear = false;
35
39
  /** @internal Gets or sets the default activeStep used to reset this element. The initial value corresponds to the one originally specified in the HTML that created this element. */
36
40
  this.defaultActiveStep = 0;
41
+ /** @internal */
42
+ this._items = [];
43
+ this._totalSteps = 0;
44
+ /** @internal Bound i-sgds-click handler for proper event listener removal */
45
+ this._boundHandleItemClick = this._handleStepClick.bind(this);
46
+ /**
47
+ * Indicates the presence of the default slot.
48
+ * Used for server-side rendering to determine table structure.
49
+ * @type {boolean}
50
+ * @internal
51
+ * @default false
52
+ */
53
+ this.hasDefaultSlot = false;
54
+ this.hasSlotController = new HasSlotController(this, "[default]");
55
+ }
56
+ connectedCallback() {
57
+ super.connectedCallback();
58
+ this._totalSteps = this.steps.length;
59
+ this.addEventListener("i-sgds-click", this._boundHandleItemClick);
60
+ }
61
+ /** @internal */
62
+ _handleSlotChange() {
63
+ this._items = this._slotNodes;
64
+ this._totalSteps = this._items.length;
65
+ this._updateStepItems();
66
+ }
67
+ updated() {
68
+ if (!this.hasDefaultSlot)
69
+ this.hasDefaultSlot = this.hasSlotController.test("[default]");
70
+ }
71
+ /** @internal Updates step item properties based on active step and clickable state */
72
+ _updateStepItems() {
73
+ if (this._items && this._items.length > 0) {
74
+ this._items.forEach((item, index) => {
75
+ item.stepIndex = index;
76
+ item.active = this.activeStep === index;
77
+ item._isCompleted = item.completed || this.activeStep > index;
78
+ item.isClickable = this.linear
79
+ ? !item.disabled && this.clickable && (this.activeStep - 1 == index || this.activeStep + 1 == index)
80
+ : !item.disabled && this.clickable;
81
+ item.orientation = this.orientation;
82
+ if (this._items.length > 1) {
83
+ item.isFirstOfType = index === 0;
84
+ item.classList.toggle("last", index === this._items.length - 1);
85
+ }
86
+ });
87
+ }
37
88
  }
38
89
  /** By default, it returns the corresponding component of the current activeStep as defined in the steps metadata. To get other components, pass in your desired step number as the parameter*/
39
90
  getComponent(step = this.activeStep) {
40
- return this.steps[step].component;
91
+ var _a, _b;
92
+ const items = this.hasDefaultSlot ? this._items : this.steps;
93
+ console.log(step, this._items);
94
+ if (items && items.length > 0) {
95
+ return (_a = items[step]) === null || _a === void 0 ? void 0 : _a.component;
96
+ }
97
+ return (_b = this.steps[step]) === null || _b === void 0 ? void 0 : _b.component;
41
98
  }
42
99
  /** Moves the active step forward one step */
43
100
  nextStep() {
101
+ var _a;
44
102
  this.emit("sgds-next-step");
45
- if (this.activeStep < this.steps.length - 1) {
46
- this.activeStep++;
103
+ if (this.activeStep < this._totalSteps - 1) {
104
+ if (!((_a = this._slotNodes[this.activeStep + 1]) === null || _a === void 0 ? void 0 : _a.disabled)) {
105
+ this.activeStep++;
106
+ }
47
107
  }
48
108
  }
49
109
  /** Moves the active step back one step */
50
110
  previousStep() {
111
+ var _a;
51
112
  this.emit("sgds-previous-step");
52
113
  if (this.activeStep > 0) {
53
- this.activeStep--;
114
+ if (!((_a = this._slotNodes[this.activeStep - 1]) === null || _a === void 0 ? void 0 : _a.disabled)) {
115
+ this.activeStep--;
116
+ }
54
117
  }
55
118
  }
56
119
  /** Changes the active step to the last step */
57
120
  lastStep() {
58
121
  this.emit("sgds-last-step");
59
- if (this.activeStep !== this.steps.length - 1) {
60
- this.activeStep = this.steps.length - 1;
122
+ if (this.activeStep !== this._totalSteps - 1) {
123
+ this.activeStep = this._totalSteps - 1;
61
124
  }
62
125
  }
63
126
  /** Changes active step to the first step */
@@ -74,21 +137,35 @@ class SgdsStepper extends SgdsElement {
74
137
  }
75
138
  /**@internal */
76
139
  _onStepperItemClick(index) {
77
- //emit an event before moving to next step
78
- if (this.activeStep > index) {
79
- this.activeStep = index;
80
- }
140
+ this.activeStep = index;
81
141
  }
82
142
  /**@internal */
83
143
  _handleActiveStepChange() {
144
+ this._updateStepItems();
84
145
  this.emit("sgds-arrived");
85
146
  }
86
147
  /**@internal */
148
+ _handleClickableChange() {
149
+ this._updateStepItems();
150
+ }
151
+ /**@internal */
152
+ _handleOrientationChange() {
153
+ this._updateStepItems();
154
+ }
155
+ /**@internal */
87
156
  _handleKeyDown(event, index) {
88
157
  if (event.key === "Enter") {
89
158
  this._onStepperItemClick(index);
90
159
  }
91
160
  }
161
+ /**@internal */
162
+ _handleStepClick(e) {
163
+ var _a;
164
+ const event = e;
165
+ e.stopPropagation();
166
+ const stepIndex = (_a = event.detail) === null || _a === void 0 ? void 0 : _a.stepIndex;
167
+ this._onStepperItemClick(stepIndex);
168
+ }
92
169
  render() {
93
170
  return html `
94
171
  <div
@@ -97,29 +174,33 @@ class SgdsStepper extends SgdsElement {
97
174
  clickable: this.clickable
98
175
  })}"
99
176
  >
100
- ${this.steps.map(({ stepHeader: step, iconName }, index) => {
101
- return html `
102
- <div class="stepper-item-container">
103
- <div
104
- class="stepper-item ${classMap({
105
- "is-active": this.activeStep === index,
106
- "is-completed": this.activeStep > index,
107
- "is-clickable": this.clickable && this.activeStep > index
108
- })}"
109
- tabindex=${this.clickable && this.activeStep > index ? "0" : "-1"}
110
- aria-current=${this.activeStep === index ? "step" : "false"}
111
- aria-disabled=${this.activeStep <= index ? "true" : "false"}
112
- @click="${this.clickable ? () => this._onStepperItemClick(index) : null}"
113
- @keydown=${this.clickable ? (e) => this._handleKeyDown(e, index) : null}
114
- >
115
- <div class="stepper-marker">
116
- ${iconName ? html `<sgds-icon name=${iconName} size="md"></sgds-icon>` : index + 1}
177
+ <slot @slotchange=${this._handleSlotChange}></slot>
178
+
179
+ ${!this.hasDefaultSlot
180
+ ? this.steps.map(({ stepHeader: step, iconName }, index) => {
181
+ return html `
182
+ <div class="stepper-item-container">
183
+ <div
184
+ class="stepper-item ${classMap({
185
+ "is-active": this.activeStep === index,
186
+ "is-completed": this.activeStep > index,
187
+ "is-clickable": this.clickable && this.activeStep > index
188
+ })}"
189
+ tabindex=${this.clickable && this.activeStep > index ? "0" : "-1"}
190
+ aria-current=${this.activeStep === index ? "step" : "false"}
191
+ aria-disabled=${this.activeStep <= index ? "true" : "false"}
192
+ @click="${this.clickable ? () => this._onStepperItemClick(index) : null}"
193
+ @keydown=${this.clickable ? (e) => this._handleKeyDown(e, index) : null}
194
+ >
195
+ <div class="stepper-marker">
196
+ ${iconName ? html `<sgds-icon name=${iconName} size="md"></sgds-icon>` : index + 1}
197
+ </div>
198
+ <div class="stepper-detail">${step}</div>
199
+ </div>
117
200
  </div>
118
- <div class="stepper-detail">${step}</div>
119
- </div>
120
- </div>
121
- `;
122
- })}
201
+ `;
202
+ })
203
+ : nothing}
123
204
  </div>
124
205
  `;
125
206
  }
@@ -139,12 +220,27 @@ __decorate([
139
220
  __decorate([
140
221
  property({ type: Boolean, reflect: true })
141
222
  ], SgdsStepper.prototype, "clickable", void 0);
223
+ __decorate([
224
+ property({ type: Boolean, reflect: true })
225
+ ], SgdsStepper.prototype, "linear", void 0);
142
226
  __decorate([
143
227
  defaultValue("activeStep")
144
228
  ], SgdsStepper.prototype, "defaultActiveStep", void 0);
229
+ __decorate([
230
+ queryAssignedElements()
231
+ ], SgdsStepper.prototype, "_slotNodes", void 0);
232
+ __decorate([
233
+ property({ type: Boolean })
234
+ ], SgdsStepper.prototype, "hasDefaultSlot", void 0);
145
235
  __decorate([
146
236
  watch("activeStep", { waitUntilFirstUpdate: true })
147
237
  ], SgdsStepper.prototype, "_handleActiveStepChange", null);
238
+ __decorate([
239
+ watch("clickable", { waitUntilFirstUpdate: true })
240
+ ], SgdsStepper.prototype, "_handleClickableChange", null);
241
+ __decorate([
242
+ watch("orientation", { waitUntilFirstUpdate: true })
243
+ ], SgdsStepper.prototype, "_handleOrientationChange", null);
148
244
 
149
245
  export { SgdsStepper, SgdsStepper as default };
150
246
  //# sourceMappingURL=sgds-stepper.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"sgds-stepper.js","sources":["../../../src/components/Stepper/sgds-stepper.ts"],"sourcesContent":["import { html } from \"lit\";\nimport { property } from \"lit/decorators.js\";\nimport { classMap } from \"lit/directives/class-map.js\";\nimport SgdsElement from \"../../base/sgds-element\";\nimport { defaultValue } from \"../../utils/defaultvalue\";\nimport { watch } from \"../../utils/watch\";\nimport stepperStyle from \"./stepper.css\";\nimport SgdsIcon from \"../Icon/sgds-icon\";\nimport { IStepMetaData } from \"./types\";\nexport type { IStepMetaData };\n/**\n * @summary Steppers are used to inform users which step they are at in a form or a process\n *\n * @event sgds-next-step - Emitted right before the next step is reached. Event is fired when nextStep method is called.\n * @event sgds-previous-step - Emitted right before the previous step is reached. Event is fired when previousStep method is called.\n * @event sgds-last-step - Emitted right before the last step is reached. Event is fired when lastStep method is called.\n * @event sgds-first-step - Emitted on hide after animation has completed. Event is fired when firstStep method is called.\n * @event sgds-arrived - Emitted right after the activeStep has updated its state, when upcoming step has arrived. Call `getMethod()` on this event to get the current step's component.\n * @event sgds-reset - Emitted right before the step is reset to its defaultActiveStep. Event is fired when reset method is called.\n *\n */\nexport class SgdsStepper extends SgdsElement {\n static styles = [...SgdsElement.styles, stepperStyle];\n /** @internal */\n static dependencies = { \"sgds-icon\": SgdsIcon };\n /** The metadata of stepper, type `IStepMetaData`, that consist of `stepHeader: string`, `component:unknown`, `iconName:string`. `stepHeader` is the name of the step and `component` is the content that should appear at the each step. `component` is set to `unknown` to allow users to pass in their desired component based on the framework of choice. e.g. pass in your own react/angular/vue component or it can also be a text content.\n * It is required to populate this array to properly render the stepper. By default, stepper markers will render numbers. For icon stepper markers, pass the name of sgds icon via `iconName` key. `iconName` is optional.\n */\n @property({ type: Array })\n steps: IStepMetaData[] = [];\n\n /** The current state of active step. Defaults to 0 */\n @property({ type: Number, reflect: true })\n activeStep = 0;\n\n /** The orientation of stepper. By default, the stepper is of horizontal orientation */\n @property({ type: String, reflect: true }) orientation: StepperOrientation = \"horizontal\";\n\n /** When true, the stepper's steps will be clickable */\n @property({ type: Boolean, reflect: true }) clickable = false;\n\n /** @internal Gets or sets the default activeStep used to reset this element. The initial value corresponds to the one originally specified in the HTML that created this element. */\n @defaultValue(\"activeStep\")\n defaultActiveStep = 0;\n\n /** By default, it returns the corresponding component of the current activeStep as defined in the steps metadata. To get other components, pass in your desired step number as the parameter*/\n public getComponent(step: number = this.activeStep) {\n return this.steps[step].component;\n }\n /** Moves the active step forward one step */\n public nextStep() {\n this.emit(\"sgds-next-step\");\n if (this.activeStep < this.steps.length - 1) {\n this.activeStep++;\n }\n }\n\n /** Moves the active step back one step */\n public previousStep() {\n this.emit(\"sgds-previous-step\");\n\n if (this.activeStep > 0) {\n this.activeStep--;\n }\n }\n\n /** Changes the active step to the last step */\n public lastStep() {\n this.emit(\"sgds-last-step\");\n if (this.activeStep !== this.steps.length - 1) {\n this.activeStep = this.steps.length - 1;\n }\n }\n\n /** Changes active step to the first step */\n public firstStep() {\n this.emit(\"sgds-first-step\");\n if (this.activeStep > 0) {\n this.activeStep = 0;\n }\n }\n\n /** Resets the Stepper to its initial active step state */\n public reset() {\n this.emit(\"sgds-reset\");\n this.activeStep = this.defaultActiveStep;\n }\n\n /**@internal */\n _onStepperItemClick(index: number) {\n //emit an event before moving to next step\n if (this.activeStep > index) {\n this.activeStep = index;\n }\n }\n\n /**@internal */\n @watch(\"activeStep\", { waitUntilFirstUpdate: true })\n _handleActiveStepChange() {\n this.emit(\"sgds-arrived\");\n }\n\n /**@internal */\n _handleKeyDown(event: KeyboardEvent, index: number) {\n if (event.key === \"Enter\") {\n this._onStepperItemClick(index);\n }\n }\n\n render() {\n return html`\n <div\n class=\"stepper ${classMap({\n [`${this.orientation}`]: this.orientation,\n clickable: this.clickable\n })}\"\n >\n ${this.steps.map(({ stepHeader: step, iconName }, index) => {\n return html`\n <div class=\"stepper-item-container\">\n <div\n class=\"stepper-item ${classMap({\n \"is-active\": this.activeStep === index,\n \"is-completed\": this.activeStep > index,\n \"is-clickable\": this.clickable && this.activeStep > index\n })}\"\n tabindex=${this.clickable && this.activeStep > index ? \"0\" : \"-1\"}\n aria-current=${this.activeStep === index ? \"step\" : \"false\"}\n aria-disabled=${this.activeStep <= index ? \"true\" : \"false\"}\n @click=\"${this.clickable ? () => this._onStepperItemClick(index) : null}\"\n @keydown=${this.clickable ? (e: KeyboardEvent) => this._handleKeyDown(e, index) : null}\n >\n <div class=\"stepper-marker\">\n ${iconName ? html`<sgds-icon name=${iconName} size=\"md\"></sgds-icon>` : index + 1}\n </div>\n <div class=\"stepper-detail\">${step}</div>\n </div>\n </div>\n `;\n })}\n </div>\n `;\n }\n}\n\nexport type StepperOrientation = \"horizontal\" | \"vertical\";\n\nexport default SgdsStepper;\n"],"names":["stepperStyle"],"mappings":";;;;;;;;;;AAUA;;;;;;;;;;AAUG;AACG,MAAO,WAAY,SAAQ,WAAW,CAAA;AAA5C,IAAA,WAAA,GAAA;;AAIE;;AAEG;QAEH,IAAK,CAAA,KAAA,GAAoB,EAAE,CAAC;;QAI5B,IAAU,CAAA,UAAA,GAAG,CAAC,CAAC;;QAG4B,IAAW,CAAA,WAAA,GAAuB,YAAY,CAAC;;QAG9C,IAAS,CAAA,SAAA,GAAG,KAAK,CAAC;;QAI9D,IAAiB,CAAA,iBAAA,GAAG,CAAC,CAAC;KAoGvB;;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,CAAC;AACL,CAAA,EAAA,WAAA,CAAA,SAAA,EAAA,mBAAA,EAAA,KAAA,CAAA,CAAA,CAAA;AAuDtB,UAAA,CAAA;IADC,KAAK,CAAC,YAAY,EAAE,EAAE,oBAAoB,EAAE,IAAI,EAAE,CAAC;AAGnD,CAAA,EAAA,WAAA,CAAA,SAAA,EAAA,yBAAA,EAAA,IAAA,CAAA;;;;"}
1
+ {"version":3,"file":"sgds-stepper.js","sources":["../../../src/components/Stepper/sgds-stepper.ts"],"sourcesContent":["import { html, nothing } from \"lit\";\nimport { property, queryAssignedElements } from \"lit/decorators.js\";\nimport { classMap } from \"lit/directives/class-map.js\";\nimport SgdsElement from \"../../base/sgds-element\";\nimport { defaultValue } from \"../../utils/defaultvalue\";\nimport { watch } from \"../../utils/watch\";\nimport stepperStyle from \"./stepper.css\";\nimport SgdsIcon from \"../Icon/sgds-icon\";\nimport { IStepMetaData } from \"./types\";\nimport type SgdsStep from \"./sgds-step\";\nimport { HasSlotController } from \"../../utils/slot\";\nexport type { IStepMetaData };\n\n/**\n * @summary Steppers are used to inform users which step they are at in a form or a process\n *\n * @event sgds-next-step - Emitted right before the next step is reached. Event is fired when nextStep method is called.\n * @event sgds-previous-step - Emitted right before the previous step is reached. Event is fired when previousStep method is called.\n * @event sgds-last-step - Emitted right before the last step is reached. Event is fired when lastStep method is called.\n * @event sgds-first-step - Emitted on hide after animation has completed. Event is fired when firstStep method is called.\n * @event sgds-arrived - Emitted right after the activeStep has updated its state, when upcoming step has arrived. Call `getMethod()` on this event to get the current step's component.\n * @event sgds-reset - Emitted right before the step is reset to its defaultActiveStep. Event is fired when reset method is called.\n * @slot default - slot for sgds-step children\n *\n */\nexport class SgdsStepper extends SgdsElement {\n static styles = [...SgdsElement.styles, stepperStyle];\n /** @internal */\n static dependencies = { \"sgds-icon\": SgdsIcon };\n /** The metadata of stepper, type `IStepMetaData`. Deprecated: use sgds-step child components instead.\n * @deprecated Use sgds-step child components instead of the steps property\n */\n @property({ type: Array })\n steps: IStepMetaData[] = [];\n\n /** The current state of active step. Defaults to 0 */\n @property({ type: Number, reflect: true })\n activeStep = 0;\n\n /** The orientation of stepper. By default, the stepper is of horizontal orientation */\n @property({ type: String, reflect: true }) orientation: StepperOrientation = \"horizontal\";\n\n /** When true, the stepper's steps will be clickable */\n @property({ type: Boolean, reflect: true }) clickable = false;\n\n /** When true, the stepper's steps can only be clicked in a linear manner */\n @property({ type: Boolean, reflect: true }) linear = false;\n\n /** @internal Gets or sets the default activeStep used to reset this element. The initial value corresponds to the one originally specified in the HTML that created this element. */\n @defaultValue(\"activeStep\")\n defaultActiveStep = 0;\n\n /** @internal */\n @queryAssignedElements() private _slotNodes!: SgdsStep[];\n\n /** @internal */\n private _items: SgdsStep[] = [];\n private _totalSteps = 0;\n\n /** @internal Bound i-sgds-click handler for proper event listener removal */\n private _boundHandleItemClick = this._handleStepClick.bind(this);\n\n /**\n * Indicates the presence of the default slot.\n * Used for server-side rendering to determine table structure.\n * @type {boolean}\n * @internal\n * @default false\n */\n @property({ type: Boolean }) hasDefaultSlot = false;\n private readonly hasSlotController = new HasSlotController(this, \"[default]\");\n\n connectedCallback() {\n super.connectedCallback();\n\n this._totalSteps = this.steps.length;\n this.addEventListener(\"i-sgds-click\", this._boundHandleItemClick);\n }\n\n /** @internal */\n private _handleSlotChange() {\n this._items = this._slotNodes;\n this._totalSteps = this._items.length;\n\n this._updateStepItems();\n }\n\n updated() {\n if (!this.hasDefaultSlot) this.hasDefaultSlot = this.hasSlotController.test(\"[default]\");\n }\n\n /** @internal Updates step item properties based on active step and clickable state */\n private _updateStepItems() {\n if (this._items && this._items.length > 0) {\n this._items.forEach((item, index) => {\n item.stepIndex = index;\n item.active = this.activeStep === index;\n item._isCompleted = item.completed || this.activeStep > index;\n item.isClickable = this.linear\n ? !item.disabled && this.clickable && (this.activeStep - 1 == index || this.activeStep + 1 == index)\n : !item.disabled && this.clickable;\n item.orientation = this.orientation;\n\n if (this._items.length > 1) {\n item.isFirstOfType = index === 0;\n item.classList.toggle(\"last\", index === this._items.length - 1);\n }\n });\n }\n }\n\n /** By default, it returns the corresponding component of the current activeStep as defined in the steps metadata. To get other components, pass in your desired step number as the parameter*/\n public getComponent(step: number = this.activeStep) {\n const items = this.hasDefaultSlot ? this._items : this.steps;\n console.log(step, this._items);\n\n if (items && items.length > 0) {\n return items[step]?.component;\n }\n return this.steps[step]?.component;\n }\n\n /** Moves the active step forward one step */\n public nextStep() {\n this.emit(\"sgds-next-step\");\n if (this.activeStep < this._totalSteps - 1) {\n if (!this._slotNodes[this.activeStep + 1]?.disabled) {\n this.activeStep++;\n }\n }\n }\n\n /** Moves the active step back one step */\n public previousStep() {\n this.emit(\"sgds-previous-step\");\n\n if (this.activeStep > 0) {\n if (!this._slotNodes[this.activeStep - 1]?.disabled) {\n this.activeStep--;\n }\n }\n }\n\n /** Changes the active step to the last step */\n public lastStep() {\n this.emit(\"sgds-last-step\");\n if (this.activeStep !== this._totalSteps - 1) {\n this.activeStep = this._totalSteps - 1;\n }\n }\n\n /** Changes active step to the first step */\n public firstStep() {\n this.emit(\"sgds-first-step\");\n if (this.activeStep > 0) {\n this.activeStep = 0;\n }\n }\n\n /** Resets the Stepper to its initial active step state */\n public reset() {\n this.emit(\"sgds-reset\");\n this.activeStep = this.defaultActiveStep;\n }\n\n /**@internal */\n _onStepperItemClick(index: number) {\n this.activeStep = index;\n }\n\n /**@internal */\n @watch(\"activeStep\", { waitUntilFirstUpdate: true })\n _handleActiveStepChange() {\n this._updateStepItems();\n this.emit(\"sgds-arrived\");\n }\n\n /**@internal */\n @watch(\"clickable\", { waitUntilFirstUpdate: true })\n _handleClickableChange() {\n this._updateStepItems();\n }\n\n /**@internal */\n @watch(\"orientation\", { waitUntilFirstUpdate: true })\n _handleOrientationChange() {\n this._updateStepItems();\n }\n\n /**@internal */\n _handleKeyDown(event: KeyboardEvent, index: number) {\n if (event.key === \"Enter\") {\n this._onStepperItemClick(index);\n }\n }\n\n /**@internal */\n _handleStepClick(e: Event) {\n const event = e as CustomEvent;\n e.stopPropagation();\n\n const stepIndex = event.detail?.stepIndex;\n this._onStepperItemClick(stepIndex);\n }\n\n render() {\n return html`\n <div\n class=\"stepper ${classMap({\n [`${this.orientation}`]: this.orientation,\n clickable: this.clickable\n })}\"\n >\n <slot @slotchange=${this._handleSlotChange}></slot>\n\n ${!this.hasDefaultSlot\n ? this.steps.map(({ stepHeader: step, iconName }, index) => {\n return html`\n <div class=\"stepper-item-container\">\n <div\n class=\"stepper-item ${classMap({\n \"is-active\": this.activeStep === index,\n \"is-completed\": this.activeStep > index,\n \"is-clickable\": this.clickable && this.activeStep > index\n })}\"\n tabindex=${this.clickable && this.activeStep > index ? \"0\" : \"-1\"}\n aria-current=${this.activeStep === index ? \"step\" : \"false\"}\n aria-disabled=${this.activeStep <= index ? \"true\" : \"false\"}\n @click=\"${this.clickable ? () => this._onStepperItemClick(index) : null}\"\n @keydown=${this.clickable ? (e: KeyboardEvent) => this._handleKeyDown(e, index) : null}\n >\n <div class=\"stepper-marker\">\n ${iconName ? html`<sgds-icon name=${iconName} size=\"md\"></sgds-icon>` : index + 1}\n </div>\n <div class=\"stepper-detail\">${step}</div>\n </div>\n </div>\n `;\n })\n : nothing}\n </div>\n `;\n }\n}\n\nexport type StepperOrientation = \"horizontal\" | \"vertical\";\n\nexport default SgdsStepper;\n"],"names":["stepperStyle"],"mappings":";;;;;;;;;;;AAaA;;;;;;;;;;;AAWG;AACG,MAAO,WAAY,SAAQ,WAAW,CAAA;AAA5C,IAAA,WAAA,GAAA;;AAIE;;AAEG;QAEH,IAAK,CAAA,KAAA,GAAoB,EAAE,CAAC;;QAI5B,IAAU,CAAA,UAAA,GAAG,CAAC,CAAC;;QAG4B,IAAW,CAAA,WAAA,GAAuB,YAAY,CAAC;;QAG9C,IAAS,CAAA,SAAA,GAAG,KAAK,CAAC;;QAGlB,IAAM,CAAA,MAAA,GAAG,KAAK,CAAC;;QAI3D,IAAiB,CAAA,iBAAA,GAAG,CAAC,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AAA;AAuGpD,UAAA,CAAA;IADC,KAAK,CAAC,YAAY,EAAE,EAAE,oBAAoB,EAAE,IAAI,EAAE,CAAC;AAInD,CAAA,EAAA,WAAA,CAAA,SAAA,EAAA,yBAAA,EAAA,IAAA,CAAA,CAAA;AAID,UAAA,CAAA;IADC,KAAK,CAAC,WAAW,EAAE,EAAE,oBAAoB,EAAE,IAAI,EAAE,CAAC;AAGlD,CAAA,EAAA,WAAA,CAAA,SAAA,EAAA,wBAAA,EAAA,IAAA,CAAA,CAAA;AAID,UAAA,CAAA;IADC,KAAK,CAAC,aAAa,EAAE,EAAE,oBAAoB,EAAE,IAAI,EAAE,CAAC;AAGpD,CAAA,EAAA,WAAA,CAAA,SAAA,EAAA,0BAAA,EAAA,IAAA,CAAA;;;;"}
@@ -0,0 +1,6 @@
1
+ import { css } from 'lit';
2
+
3
+ var css_248z = css`:host{display:contents}.stepper-item-container{flex-basis:1em;flex-grow:1;flex-shrink:1;position:relative;width:fit-content}.stepper-item,.stepper-item-container{align-items:center;display:flex;flex-direction:column}.stepper-item{gap:var(--sgds-gap-sm)}.stepper-item.vertical{align-items:flex-start;flex-direction:row;margin-bottom:var(--sgds-padding-xl)}.stepper-item.clickable:focus-visible{outline:var(--sgds-outline-focus);outline-offset:var(--sgds-outline-offset-focus)}.stepper-item:not(.first):not(.vertical):before{background:var(--sgds-border-color-translucent);content:" ";height:var(--sgds-dimension-2);left:calc(-50% + 16px);position:absolute;top:15px;width:calc(100% - var(--sgds-dimension-32))}:host(:not(.last)) .stepper-item-container .stepper-item.vertical:after{background:var(--sgds-bg-translucent);content:" ";height:calc(100% - var(--sgds-dimension-32));left:15px;position:absolute;top:32px;width:var(--sgds-dimension-2)}.stepper-item-container .stepper-item.active:not(.first):before,.stepper-item-container .stepper-item.completed:not(.first):before,:host(:not(.last)) .stepper-item-container .stepper-item.completed:after{background:var(--sgds-primary-border-color-default)}.stepper-item.clickable{cursor:pointer}.stepper-marker{align-items:center;background:var(--sgds-bg-translucent);border:var(--sgds-border-width-2) solid var(--sgds-border-color-transparent);border-radius:50%;color:var(--sgds-color-default);display:flex;flex-shrink:0;height:var(--sgds-dimension-32);justify-content:center;width:var(--sgds-dimension-32);z-index:1}.stepper-detail{display:flex;flex-direction:column;gap:var(--sgds-gap-2-xs);max-width:var(--sgds-dimension-128);text-align:center}.stepper-item.vertical .stepper-detail{max-width:unset;padding:var(--sgds-padding-2-xs) 0 0;text-align:left}.stepper-item:not(.active):not(.completed) .stepper-label{color:var(--sgds-color-subtle)}.stepper-item.clickable:focus .stepper-marker,.stepper-item.clickable:focus-visible .stepper-marker,.stepper-item.clickable:hover .stepper-marker{background-color:var(--sgds-primary-surface-emphasis);border-color:var(--sgds-border-color-transparent);color:var(--sgds-color-fixed-light)}.stepper-item.clickable:focus .stepper-label,.stepper-item.clickable:focus-visible .stepper-label,.stepper-item.clickable:hover .stepper-label{color:var(--sgds-primary-color-emphasis)}.stepper-item.clickable .stepper-label{color:var(--sgds-primary-color-default)}.stepper-item.completed .stepper-marker{background-color:var(--sgds-bg-transparent);border:var(--sgds-border-width-2) solid var(--sgds-primary-border-color-default);color:var(--sgds-primary-color-default)}.stepper-item.active .stepper-marker{background-color:var(--sgds-primary-surface-default);color:var(--sgds-color-fixed-light)}.stepper-slot{color:var(--sgds-color-subtle);display:flex;flex-direction:column;font-size:var(--sgds-font-size-label-sm);font-weight:var(--sgds-font-weight-regular);gap:var(--sgds-gap-xs);letter-spacing:var(--sgds-letter-spacing-normal);line-height:var(--sgds-line-height-2-xs)}.stepper-item.disabled{opacity:var(--sgds-opacity-40)}`;
4
+
5
+ export { css_248z as default };
6
+ //# sourceMappingURL=step.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"step.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;"}
@@ -1,6 +1,6 @@
1
1
  import { css } from 'lit';
2
2
 
3
- var css_248z = css`.stepper{display:flex;flex-wrap:wrap}.stepper.vertical{flex-direction:column}.stepper.horizontal .stepper-item-container{align-items:center;display:flex;flex-basis:1em;flex-direction:column;flex-grow:1;flex-shrink:1;position:relative}.stepper.vertical .stepper-item-container{position:relative;width:fit-content}.stepper .stepper-item{align-items:center;display:flex;flex-direction:column;gap:var(--sgds-gap-sm)}.stepper.vertical .stepper-item{align-items:flex-start;flex-direction:row}.stepper.vertical .stepper-item-container:not(:last-child) .stepper-item{margin-bottom:var(--sgds-padding-xl)}.stepper .stepper-item.is-clickable:focus-visible{outline:var(--sgds-outline-focus);outline-offset:var(--sgds-outline-offset-focus)}.stepper.horizontal .stepper-item-container:not(:first-child) .stepper-item:before{background:var(--sgds-border-color-translucent);bottom:0;content:" ";height:var(--sgds-dimension-2);left:calc(-50% + 16px);position:absolute;top:15px;width:calc(100% - var(--sgds-dimension-32))}.stepper.vertical .stepper-item-container:not(:last-child) .stepper-item:after{background:var(--sgds-bg-translucent);bottom:0;content:" ";height:calc(100% - var(--sgds-dimension-32));left:15px;position:absolute;top:32px;width:var(--sgds-dimension-2)}.stepper.horizontal .stepper-item-container .stepper-item.is-active:before,.stepper.horizontal .stepper-item-container .stepper-item.is-completed:before,.stepper.vertical .stepper-item-container .stepper-item.is-completed:after{background:var(--sgds-primary-border-color-default)}.stepper .stepper-item.is-clickable{cursor:pointer}.stepper .stepper-marker{align-items:center;background:var(--sgds-bg-translucent);border:var(--sgds-border-width-2) solid var(--sgds-border-color-transparent);border-radius:50%;color:var(--sgds-color-default);display:flex;height:var(--sgds-dimension-32);justify-content:center;width:var(--sgds-dimension-32);z-index:1}.stepper:not(.vertical) .stepper-detail{max-width:var(--sgds-dimension-128);text-align:center}.stepper.vertical .stepper-detail{padding:var(--sgds-padding-2-xs) 0 0;text-align:left}.stepper .stepper-item:not(.is-active):not(.is-completed) .stepper-detail{color:var(--sgds-color-subtle)}.stepper .stepper-item.is-clickable:focus .stepper-marker,.stepper .stepper-item.is-clickable:focus-visible .stepper-marker,.stepper .stepper-item.is-clickable:hover .stepper-marker{background-color:var(--sgds-primary-surface-emphasis);border-color:var(--sgds-border-color-transparent);color:var(--sgds-color-fixed-light)}.stepper .stepper-item.is-clickable:focus .stepper-detail,.stepper .stepper-item.is-clickable:focus-visible .stepper-detail,.stepper .stepper-item.is-clickable:hover .stepper-detail{color:var(--sgds-primary-color-emphasis)}.stepper .stepper-item.is-clickable .stepper-detail,.stepper.clickable .stepper-item.is-active .stepper-detail{color:var(--sgds-primary-color-default)}.stepper .stepper-item.is-active .stepper-marker{background-color:var(--sgds-primary-surface-default);color:var(--sgds-color-fixed-light)}.stepper .stepper-item.is-completed .stepper-marker{background-color:var(--sgds-bg-transparent);border:var(--sgds-border-width-2) solid var(--sgds-primary-border-color-default);color:var(--sgds-primary-color-default)}`;
3
+ var css_248z = css`.stepper{display:flex;flex-wrap:wrap}.stepper.vertical{flex-direction:column}.stepper.horizontal .stepper-item-container{align-items:center;display:flex;flex-basis:1em;flex-direction:column;flex-grow:1;flex-shrink:1;position:relative}.stepper.vertical .stepper-item-container{position:relative;width:fit-content}.stepper .stepper-item{align-items:center;display:flex;flex-direction:column;gap:var(--sgds-gap-sm)}.stepper.vertical .stepper-item{align-items:flex-start;flex-direction:row}.stepper.vertical .stepper-item-container:not(:last-child) .stepper-item{margin-bottom:var(--sgds-padding-xl)}.stepper .stepper-item.is-clickable:focus-visible{outline:var(--sgds-outline-focus);outline-offset:var(--sgds-outline-offset-focus)}.stepper.horizontal .stepper-item-container:not(:first-of-type) .stepper-item:before{background:var(--sgds-border-color-translucent);bottom:0;content:" ";height:var(--sgds-dimension-2);left:calc(-50% + 16px);position:absolute;top:15px;width:calc(100% - var(--sgds-dimension-32))}.stepper.vertical .stepper-item-container:not(:last-child) .stepper-item:after{background:var(--sgds-bg-translucent);bottom:0;content:" ";height:calc(100% - var(--sgds-dimension-32));left:15px;position:absolute;top:32px;width:var(--sgds-dimension-2)}.stepper.horizontal .stepper-item-container .stepper-item.is-active:before,.stepper.horizontal .stepper-item-container .stepper-item.is-completed:before,.stepper.vertical .stepper-item-container .stepper-item.is-completed:after{background:var(--sgds-primary-border-color-default)}.stepper .stepper-item.is-clickable{cursor:pointer}.stepper .stepper-marker{align-items:center;background:var(--sgds-bg-translucent);border:var(--sgds-border-width-2) solid var(--sgds-border-color-transparent);border-radius:50%;color:var(--sgds-color-default);display:flex;height:var(--sgds-dimension-32);justify-content:center;width:var(--sgds-dimension-32);z-index:1}.stepper:not(.vertical) .stepper-detail{max-width:var(--sgds-dimension-128);text-align:center}.stepper.vertical .stepper-detail{padding:var(--sgds-padding-2-xs) 0 0;text-align:left}.stepper .stepper-item:not(.is-active):not(.is-completed) .stepper-detail{color:var(--sgds-color-subtle)}.stepper .stepper-item.is-clickable:focus .stepper-marker,.stepper .stepper-item.is-clickable:focus-visible .stepper-marker,.stepper .stepper-item.is-clickable:hover .stepper-marker{background-color:var(--sgds-primary-surface-emphasis);border-color:var(--sgds-border-color-transparent);color:var(--sgds-color-fixed-light)}.stepper .stepper-item.is-clickable:focus .stepper-detail,.stepper .stepper-item.is-clickable:focus-visible .stepper-detail,.stepper .stepper-item.is-clickable:hover .stepper-detail{color:var(--sgds-primary-color-emphasis)}.stepper .stepper-item.is-clickable .stepper-detail,.stepper.clickable .stepper-item.is-active .stepper-detail{color:var(--sgds-primary-color-default)}.stepper .stepper-item.is-active .stepper-marker{background-color:var(--sgds-primary-surface-default);color:var(--sgds-color-fixed-light)}.stepper .stepper-item.is-completed .stepper-marker{background-color:var(--sgds-bg-transparent);border:var(--sgds-border-width-2) solid var(--sgds-primary-border-color-default);color:var(--sgds-primary-color-default)}`;
4
4
 
5
5
  export { css_248z as default };
6
6
  //# sourceMappingURL=stepper.js.map
@@ -2,4 +2,5 @@ export interface IStepMetaData {
2
2
  component: unknown;
3
3
  stepHeader: string;
4
4
  iconName?: string;
5
+ isCompleted?: boolean;
5
6
  }