@govtechsg/sgds-web-component 3.18.0 → 3.18.1-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 (47) hide show
  1. package/components/Stepper/index.d.ts +2 -0
  2. package/components/Stepper/index.js +2 -0
  3. package/components/Stepper/index.js.map +1 -1
  4. package/components/Stepper/index.umd.min.js +46 -23
  5. package/components/Stepper/index.umd.min.js.map +1 -1
  6. package/components/Stepper/sgds-step.d.ts +42 -0
  7. package/components/Stepper/sgds-step.js +117 -0
  8. package/components/Stepper/sgds-step.js.map +1 -0
  9. package/components/Stepper/sgds-stepper.d.ts +23 -2
  10. package/components/Stepper/sgds-stepper.js +87 -13
  11. package/components/Stepper/sgds-stepper.js.map +1 -1
  12. package/components/Stepper/step.js +6 -0
  13. package/components/Stepper/step.js.map +1 -0
  14. package/components/Stepper/stepper.js +1 -1
  15. package/components/Stepper/types.d.ts +1 -0
  16. package/components/index.umd.min.js +4 -2
  17. package/components/index.umd.min.js.map +1 -1
  18. package/css/fouc.css +1 -0
  19. package/custom-elements.json +201 -5
  20. package/index.umd.min.js +62 -39
  21. package/index.umd.min.js.map +1 -1
  22. package/package.json +1 -1
  23. package/react/components/Stepper/sgds-step.cjs.js +123 -0
  24. package/react/components/Stepper/sgds-step.cjs.js.map +1 -0
  25. package/react/components/Stepper/sgds-step.js +118 -0
  26. package/react/components/Stepper/sgds-step.js.map +1 -0
  27. package/react/components/Stepper/sgds-stepper.cjs.js +86 -12
  28. package/react/components/Stepper/sgds-stepper.cjs.js.map +1 -1
  29. package/react/components/Stepper/sgds-stepper.js +87 -13
  30. package/react/components/Stepper/sgds-stepper.js.map +1 -1
  31. package/react/components/Stepper/step.cjs.js +11 -0
  32. package/react/components/Stepper/step.cjs.js.map +1 -0
  33. package/react/components/Stepper/step.js +7 -0
  34. package/react/components/Stepper/step.js.map +1 -0
  35. package/react/components/Stepper/stepper.cjs.js +1 -1
  36. package/react/components/Stepper/stepper.js +1 -1
  37. package/react/index.cjs.js +40 -38
  38. package/react/index.cjs.js.map +1 -1
  39. package/react/index.d.ts +1 -0
  40. package/react/index.js +1 -0
  41. package/react/index.js.map +1 -1
  42. package/react/step/index.cjs.js +40 -0
  43. package/react/step/index.cjs.js.map +1 -0
  44. package/react/step/index.d.ts +2 -0
  45. package/react/step/index.js +16 -0
  46. package/react/step/index.js.map +1 -0
  47. package/types/react.d.ts +18 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@govtechsg/sgds-web-component",
3
- "version": "3.18.0",
3
+ "version": "3.18.1-rc.0",
4
4
  "description": "",
5
5
  "main": "./index.umd.js",
6
6
  "module": "./index.js",
@@ -0,0 +1,123 @@
1
+ 'use client';
2
+ 'use strict';
3
+
4
+ Object.defineProperty(exports, '__esModule', { value: true });
5
+
6
+ var tslib = require('tslib');
7
+ var lit = require('lit');
8
+ var decorators_js = require('lit/decorators.js');
9
+ var classMap_js = require('lit/directives/class-map.js');
10
+ var sgdsElement = require('../../base/sgds-element.cjs.js');
11
+ var sgdsIcon = require('../Icon/sgds-icon.cjs.js');
12
+ var step = require('./step.cjs.js');
13
+
14
+ /**
15
+ * @summary A step within a stepper component
16
+ * @slot default - Additional content to display under the step header
17
+ *
18
+ */
19
+ class SgdsStep extends sgdsElement["default"] {
20
+ constructor() {
21
+ super(...arguments);
22
+ /** The header text for the step */
23
+ this.stepHeader = "";
24
+ /** @internal The index of this step within the stepper */
25
+ this.stepIndex = 0;
26
+ /** @internal Whether this step is currently active */
27
+ this.active = false;
28
+ /** @internal Whether this step is currently disabled */
29
+ this.disabled = false;
30
+ /** @internal Whether this step is completed */
31
+ this.completed = false;
32
+ /** @internal Whether this step is clickable */
33
+ this.isClickable = false;
34
+ /** @internal Orientation of parent stepper (horizontal or vertical) */
35
+ this.orientation = "horizontal";
36
+ /** @internal Whether this step is the first sgds-step of its type in the slot */
37
+ this.isFirstOfType = false;
38
+ /** @internal Whether this step is completed */
39
+ this._isCompleted = false;
40
+ }
41
+ render() {
42
+ const isValidClickable = !this.disabled && this.isClickable;
43
+ return lit.html `
44
+ <div class="stepper-item-container">
45
+ <div
46
+ class="stepper-item ${classMap_js.classMap({
47
+ first: this.isFirstOfType,
48
+ active: this.active,
49
+ completed: this._isCompleted,
50
+ clickable: this.isClickable,
51
+ vertical: this.orientation === "vertical",
52
+ disabled: this.disabled
53
+ })}"
54
+ tabindex=${isValidClickable ? "0" : "-1"}
55
+ aria-current=${this.active ? "step" : "false"}
56
+ aria-disabled=${this.disabled || (!this.active && !this._isCompleted) ? "true" : "false"}
57
+ @click="${isValidClickable ? () => this._handleClick() : null}"
58
+ @keydown=${isValidClickable ? (e) => this._handleKeyDown(e) : null}
59
+ >
60
+ <div class="stepper-marker">
61
+ ${this.iconName ? lit.html `<sgds-icon name=${this.iconName} size="md"></sgds-icon>` : this.stepIndex + 1}
62
+ </div>
63
+
64
+ <div class="stepper-detail">
65
+ <div class="stepper-label">${this.stepHeader}</div>
66
+
67
+ <slot class="stepper-slot"></slot>
68
+ </div>
69
+ </div>
70
+ </div>
71
+ `;
72
+ }
73
+ /**@internal */
74
+ _handleClick() {
75
+ this.emit("i-sgds-click", { detail: { stepIndex: this.stepIndex } });
76
+ }
77
+ /**@internal */
78
+ _handleKeyDown(event) {
79
+ if (event.key === "Enter") {
80
+ this._handleClick();
81
+ }
82
+ }
83
+ }
84
+ SgdsStep.styles = [...sgdsElement["default"].styles, step["default"]];
85
+ /** @internal */
86
+ SgdsStep.dependencies = { "sgds-icon": sgdsIcon.SgdsIcon };
87
+ tslib.__decorate([
88
+ decorators_js.property({ type: String, reflect: true })
89
+ ], SgdsStep.prototype, "stepHeader", void 0);
90
+ tslib.__decorate([
91
+ decorators_js.property({ type: String, reflect: true })
92
+ ], SgdsStep.prototype, "iconName", void 0);
93
+ tslib.__decorate([
94
+ decorators_js.property({ type: Object })
95
+ ], SgdsStep.prototype, "component", void 0);
96
+ tslib.__decorate([
97
+ decorators_js.property({ type: Number })
98
+ ], SgdsStep.prototype, "stepIndex", void 0);
99
+ tslib.__decorate([
100
+ decorators_js.property({ type: Boolean, reflect: true })
101
+ ], SgdsStep.prototype, "active", void 0);
102
+ tslib.__decorate([
103
+ decorators_js.property({ type: Boolean, reflect: true })
104
+ ], SgdsStep.prototype, "disabled", void 0);
105
+ tslib.__decorate([
106
+ decorators_js.property({ type: Boolean, reflect: true })
107
+ ], SgdsStep.prototype, "completed", void 0);
108
+ tslib.__decorate([
109
+ decorators_js.property({ type: Boolean })
110
+ ], SgdsStep.prototype, "isClickable", void 0);
111
+ tslib.__decorate([
112
+ decorators_js.property({ type: String })
113
+ ], SgdsStep.prototype, "orientation", void 0);
114
+ tslib.__decorate([
115
+ decorators_js.property({ type: Boolean })
116
+ ], SgdsStep.prototype, "isFirstOfType", void 0);
117
+ tslib.__decorate([
118
+ decorators_js.property({ type: Boolean })
119
+ ], SgdsStep.prototype, "_isCompleted", void 0);
120
+
121
+ exports.SgdsStep = SgdsStep;
122
+ exports["default"] = SgdsStep;
123
+ //# sourceMappingURL=sgds-step.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sgds-step.cjs.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 ? () => this._handleClick() : 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\n <slot class=\"stepper-slot\"></slot>\n </div>\n </div>\n </div>\n `;\n }\n\n /**@internal */\n _handleClick() {\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"],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CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;AACN,CAAA,EAAA,QAAA,CAAA,SAAA,EAAA,eAAA,EAAA,KAAA,CAAA,CAAA,CAAA;AAItBD,gBAAA,CAAA;AADC,IAAAC,sBAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;AACP,CAAA,EAAA,QAAA,CAAA,SAAA,EAAA,cAAA,EAAA,KAAA,CAAA,CAAA;;;;;"}
@@ -0,0 +1,118 @@
1
+ 'use client';
2
+ import { __decorate } from 'tslib';
3
+ import { html } from 'lit';
4
+ import { property } from 'lit/decorators.js';
5
+ import { classMap } from 'lit/directives/class-map.js';
6
+ import SgdsElement from '../../base/sgds-element.js';
7
+ import { SgdsIcon } from '../Icon/sgds-icon.js';
8
+ import css_248z from './step.js';
9
+
10
+ /**
11
+ * @summary A step within a stepper component
12
+ * @slot default - Additional content to display under the step header
13
+ *
14
+ */
15
+ class SgdsStep extends SgdsElement {
16
+ constructor() {
17
+ super(...arguments);
18
+ /** The header text for the step */
19
+ this.stepHeader = "";
20
+ /** @internal The index of this step within the stepper */
21
+ this.stepIndex = 0;
22
+ /** @internal Whether this step is currently active */
23
+ this.active = false;
24
+ /** @internal Whether this step is currently disabled */
25
+ this.disabled = false;
26
+ /** @internal Whether this step is completed */
27
+ this.completed = false;
28
+ /** @internal Whether this step is clickable */
29
+ this.isClickable = false;
30
+ /** @internal Orientation of parent stepper (horizontal or vertical) */
31
+ this.orientation = "horizontal";
32
+ /** @internal Whether this step is the first sgds-step of its type in the slot */
33
+ this.isFirstOfType = false;
34
+ /** @internal Whether this step is completed */
35
+ this._isCompleted = false;
36
+ }
37
+ render() {
38
+ const isValidClickable = !this.disabled && this.isClickable;
39
+ return html `
40
+ <div class="stepper-item-container">
41
+ <div
42
+ class="stepper-item ${classMap({
43
+ first: this.isFirstOfType,
44
+ active: this.active,
45
+ completed: this._isCompleted,
46
+ clickable: this.isClickable,
47
+ vertical: this.orientation === "vertical",
48
+ disabled: this.disabled
49
+ })}"
50
+ tabindex=${isValidClickable ? "0" : "-1"}
51
+ aria-current=${this.active ? "step" : "false"}
52
+ aria-disabled=${this.disabled || (!this.active && !this._isCompleted) ? "true" : "false"}
53
+ @click="${isValidClickable ? () => this._handleClick() : null}"
54
+ @keydown=${isValidClickable ? (e) => this._handleKeyDown(e) : null}
55
+ >
56
+ <div class="stepper-marker">
57
+ ${this.iconName ? html `<sgds-icon name=${this.iconName} size="md"></sgds-icon>` : this.stepIndex + 1}
58
+ </div>
59
+
60
+ <div class="stepper-detail">
61
+ <div class="stepper-label">${this.stepHeader}</div>
62
+
63
+ <slot class="stepper-slot"></slot>
64
+ </div>
65
+ </div>
66
+ </div>
67
+ `;
68
+ }
69
+ /**@internal */
70
+ _handleClick() {
71
+ this.emit("i-sgds-click", { detail: { stepIndex: this.stepIndex } });
72
+ }
73
+ /**@internal */
74
+ _handleKeyDown(event) {
75
+ if (event.key === "Enter") {
76
+ this._handleClick();
77
+ }
78
+ }
79
+ }
80
+ SgdsStep.styles = [...SgdsElement.styles, css_248z];
81
+ /** @internal */
82
+ SgdsStep.dependencies = { "sgds-icon": SgdsIcon };
83
+ __decorate([
84
+ property({ type: String, reflect: true })
85
+ ], SgdsStep.prototype, "stepHeader", void 0);
86
+ __decorate([
87
+ property({ type: String, reflect: true })
88
+ ], SgdsStep.prototype, "iconName", void 0);
89
+ __decorate([
90
+ property({ type: Object })
91
+ ], SgdsStep.prototype, "component", void 0);
92
+ __decorate([
93
+ property({ type: Number })
94
+ ], SgdsStep.prototype, "stepIndex", void 0);
95
+ __decorate([
96
+ property({ type: Boolean, reflect: true })
97
+ ], SgdsStep.prototype, "active", void 0);
98
+ __decorate([
99
+ property({ type: Boolean, reflect: true })
100
+ ], SgdsStep.prototype, "disabled", void 0);
101
+ __decorate([
102
+ property({ type: Boolean, reflect: true })
103
+ ], SgdsStep.prototype, "completed", void 0);
104
+ __decorate([
105
+ property({ type: Boolean })
106
+ ], SgdsStep.prototype, "isClickable", void 0);
107
+ __decorate([
108
+ property({ type: String })
109
+ ], SgdsStep.prototype, "orientation", void 0);
110
+ __decorate([
111
+ property({ type: Boolean })
112
+ ], SgdsStep.prototype, "isFirstOfType", void 0);
113
+ __decorate([
114
+ property({ type: Boolean })
115
+ ], SgdsStep.prototype, "_isCompleted", void 0);
116
+
117
+ export { SgdsStep, SgdsStep as default };
118
+ //# 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 ? () => this._handleClick() : 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\n <slot class=\"stepper-slot\"></slot>\n </div>\n </div>\n </div>\n `;\n }\n\n /**@internal */\n _handleClick() {\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;;QAIt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A,CAAA;AAIf,UAAA,CAAA;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;AAC1B,CAAA,EAAA,QAAA,CAAA,SAAA,EAAA,UAAA,EAAA,KAAA,CAAA,CAAA,CAAA;AAIjB,UAAA,CAAA;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;AACzB,CAAA,EAAA,QAAA,CAAA,SAAA,EAAA,WAAA,EAAA,KAAA,CAAA,CAAA,CAAA;AAIlB,UAAA,CAAA;AADC,IAAA,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;AACR,CAAA,EAAA,QAAA,CAAA,SAAA,EAAA,aAAA,EAAA,KAAA,CAAA,CAAA,CAAA;AAIpB,UAAA,CAAA;AADC,IAAA,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;AAC2B,CAAA,EAAA,QAAA,CAAA,SAAA,EAAA,aAAA,EAAA,KAAA,CAAA,CAAA,CAAA;AAItD,UAAA,CAAA;AADC,IAAA,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;AACN,CAAA,EAAA,QAAA,CAAA,SAAA,EAAA,eAAA,EAAA,KAAA,CAAA,CAAA,CAAA;AAItB,UAAA,CAAA;AADC,IAAA,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;AACP,CAAA,EAAA,QAAA,CAAA,SAAA,EAAA,cAAA,EAAA,KAAA,CAAA,CAAA;;;;"}
@@ -22,13 +22,14 @@ var sgdsIcon = require('../Icon/sgds-icon.cjs.js');
22
22
  * @event sgds-first-step - Emitted on hide after animation has completed. Event is fired when firstStep method is called.
23
23
  * @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.
24
24
  * @event sgds-reset - Emitted right before the step is reset to its defaultActiveStep. Event is fired when reset method is called.
25
+ * @slot default - slot for sgds-step children
25
26
  *
26
27
  */
27
28
  class SgdsStepper extends sgdsElement["default"] {
28
29
  constructor() {
29
30
  super(...arguments);
30
- /** 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.
31
- * 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.
31
+ /** The metadata of stepper, type `IStepMetaData`. Deprecated: use sgds-step child components instead.
32
+ * @deprecated Use sgds-step child components instead of the steps property
32
33
  */
33
34
  this.steps = [];
34
35
  /** The current state of active step. Defaults to 0 */
@@ -37,32 +38,77 @@ class SgdsStepper extends sgdsElement["default"] {
37
38
  this.orientation = "horizontal";
38
39
  /** When true, the stepper's steps will be clickable */
39
40
  this.clickable = false;
41
+ /** When true, the stepper's steps can only be clicked in a linear manner */
42
+ this.linear = false;
40
43
  /** @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. */
41
44
  this.defaultActiveStep = 0;
45
+ this._totalSteps = 0;
46
+ /** @internal Bound i-sgds-click handler for proper event listener removal */
47
+ this._boundHandleItemClick = this._handleStepClick.bind(this);
48
+ }
49
+ connectedCallback() {
50
+ super.connectedCallback();
51
+ this._totalSteps = this.steps.length;
52
+ this.addEventListener("i-sgds-click", this._boundHandleItemClick);
53
+ }
54
+ /** @internal */
55
+ _handleSlotChange() {
56
+ this._items = this._slotNodes;
57
+ this._totalSteps = this._items.length;
58
+ this._updateStepItems();
59
+ }
60
+ /** @internal Updates step item properties based on active step and clickable state */
61
+ _updateStepItems() {
62
+ if (this._items && this._items.length > 0) {
63
+ this._items.forEach((item, index) => {
64
+ item.stepIndex = index;
65
+ item.active = this.activeStep === index;
66
+ item._isCompleted = item.completed || this.activeStep > index;
67
+ item.isClickable = this.linear
68
+ ? !item.disabled && this.clickable && (this.activeStep - 1 == index || this.activeStep + 1 == index)
69
+ : !item.disabled && this.clickable;
70
+ item.orientation = this.orientation;
71
+ if (this._items.length > 1) {
72
+ item.isFirstOfType = index === 0;
73
+ item.classList.toggle("last", index === this._items.length - 1);
74
+ }
75
+ });
76
+ }
42
77
  }
43
78
  /** 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*/
44
79
  getComponent(step = this.activeStep) {
45
- return this.steps[step].component;
80
+ var _a, _b;
81
+ const items = this._slotNodes.length > 1 ? this._items : this.steps;
82
+ if (items && items.length > 0) {
83
+ return (_a = items[step]) === null || _a === void 0 ? void 0 : _a.component;
84
+ }
85
+ return (_b = this.steps[step]) === null || _b === void 0 ? void 0 : _b.component;
46
86
  }
47
87
  /** Moves the active step forward one step */
48
88
  nextStep() {
89
+ var _a;
49
90
  this.emit("sgds-next-step");
50
- if (this.activeStep < this.steps.length - 1) {
51
- this.activeStep++;
91
+ if (this.activeStep < this._totalSteps - 1) {
92
+ if (!((_a = this._slotNodes[this.activeStep + 1]) === null || _a === void 0 ? void 0 : _a.disabled)) {
93
+ this.activeStep++;
94
+ }
52
95
  }
53
96
  }
54
97
  /** Moves the active step back one step */
55
98
  previousStep() {
99
+ var _a;
56
100
  this.emit("sgds-previous-step");
57
101
  if (this.activeStep > 0) {
58
- this.activeStep--;
102
+ if (!((_a = this._slotNodes[this.activeStep - 1]) === null || _a === void 0 ? void 0 : _a.disabled)) {
103
+ this.activeStep--;
104
+ }
59
105
  }
60
106
  }
61
107
  /** Changes the active step to the last step */
62
108
  lastStep() {
63
109
  this.emit("sgds-last-step");
64
- if (this.activeStep !== this.steps.length - 1) {
65
- this.activeStep = this.steps.length - 1;
110
+ if (this.activeStep !== this._totalSteps - 1) {
111
+ this.activeStep = this._totalSteps - 1;
66
112
  }
67
113
  }
68
114
  /** Changes active step to the first step */
@@ -79,21 +125,35 @@ class SgdsStepper extends sgdsElement["default"] {
79
125
  }
80
126
  /**@internal */
81
127
  _onStepperItemClick(index) {
82
- //emit an event before moving to next step
83
- if (this.activeStep > index) {
84
- this.activeStep = index;
85
- }
128
+ this.activeStep = index;
86
129
  }
87
130
  /**@internal */
88
131
  _handleActiveStepChange() {
132
+ this._updateStepItems();
89
133
  this.emit("sgds-arrived");
90
134
  }
91
135
  /**@internal */
136
+ _handleClickableChange() {
137
+ this._updateStepItems();
138
+ }
139
+ /**@internal */
140
+ _handleOrientationChange() {
141
+ this._updateStepItems();
142
+ }
143
+ /**@internal */
92
144
  _handleKeyDown(event, index) {
93
145
  if (event.key === "Enter") {
94
146
  this._onStepperItemClick(index);
95
147
  }
96
148
  }
149
+ /**@internal */
150
+ _handleStepClick(e) {
151
+ var _a;
152
+ const event = e;
153
+ e.stopPropagation();
154
+ const stepIndex = (_a = event.detail) === null || _a === void 0 ? void 0 : _a.stepIndex;
155
+ this._onStepperItemClick(stepIndex);
156
+ }
97
157
  render() {
98
158
  return lit.html `
99
159
  <div
@@ -102,6 +162,8 @@ class SgdsStepper extends sgdsElement["default"] {
102
162
  clickable: this.clickable
103
163
  })}"
104
164
  >
165
+ <slot @slotchange=${this._handleSlotChange}></slot>
166
+
105
167
  ${this.steps.map(({ stepHeader: step, iconName }, index) => {
106
168
  return lit.html `
107
169
  <div class="stepper-item-container">
@@ -144,12 +206,24 @@ tslib.__decorate([
144
206
  tslib.__decorate([
145
207
  decorators_js.property({ type: Boolean, reflect: true })
146
208
  ], SgdsStepper.prototype, "clickable", void 0);
209
+ tslib.__decorate([
210
+ decorators_js.property({ type: Boolean, reflect: true })
211
+ ], SgdsStepper.prototype, "linear", void 0);
147
212
  tslib.__decorate([
148
213
  defaultvalue.defaultValue("activeStep")
149
214
  ], SgdsStepper.prototype, "defaultActiveStep", void 0);
215
+ tslib.__decorate([
216
+ decorators_js.queryAssignedElements()
217
+ ], SgdsStepper.prototype, "_slotNodes", void 0);
150
218
  tslib.__decorate([
151
219
  watch.watch("activeStep", { waitUntilFirstUpdate: true })
152
220
  ], SgdsStepper.prototype, "_handleActiveStepChange", null);
221
+ tslib.__decorate([
222
+ watch.watch("clickable", { waitUntilFirstUpdate: true })
223
+ ], SgdsStepper.prototype, "_handleClickableChange", null);
224
+ tslib.__decorate([
225
+ watch.watch("orientation", { waitUntilFirstUpdate: true })
226
+ ], SgdsStepper.prototype, "_handleOrientationChange", null);
153
227
 
154
228
  exports.SgdsStepper = SgdsStepper;
155
229
  exports["default"] = SgdsStepper;
@@ -1 +1 @@
1
- {"version":3,"file":"sgds-stepper.cjs.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":["SgdsElement","html","classMap","stepperStyle","SgdsIcon","__decorate","property","defaultValue","watch"],"mappings":";;;;;;;;;;;;;;;AAUA;;;;;;;;;;AAUG;AACG,MAAO,WAAY,SAAQA,sBAAW,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;;AAjGQ,IAAA,YAAY,C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BAAY,CAAC,YAAY,CAAC;AACL,CAAA,EAAA,WAAA,CAAA,SAAA,EAAA,mBAAA,EAAA,KAAA,CAAA,CAAA,CAAA;AAuDtBF,gBAAA,CAAA;IADCG,WAAK,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.cjs.js","sources":["../../../../src/components/Stepper/sgds-stepper.ts"],"sourcesContent":["import { html } 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\";\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 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 /** @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._slotNodes.length > 1 ? this._items : this.steps;\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.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":["SgdsElement","html","classMap","stepperStyle","SgdsIcon","__decorate","property","defaultValue","queryAssignedElements","watch"],"mappings":";;;;;;;;;;;;;;;AAYA;;;;;;;;;;;AAWG;AACG,MAAO,WAAY,SAAQA,sBAAW,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,CAAC;QAOd,IAAW,CAAA,WAAA,GAAG,CAAC,CAAC;;QAGhB,IAAqB,CAAA,qBAAA,GAAG,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;KAqKlE;IAnKC,iBAAiB,GAAA;QACf,KAAK,CAAC,iBAAiB,EAAE,CAA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