@sondor-technology/sondor-components 1.0.1-develop.10 → 1.0.1-develop.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/button-group/button-group.d.ts +5 -0
- package/dist/components/button-group/button-group.d.ts.map +1 -1
- package/dist/components/code-block/code-block.d.ts +5 -0
- package/dist/components/code-block/code-block.d.ts.map +1 -1
- package/dist/components/form/form-step.d.ts +1 -0
- package/dist/components/form/form-step.d.ts.map +1 -1
- package/dist/components/form/form-step.js +3 -0
- package/dist/components/form/form.d.ts +7 -2
- package/dist/components/form/form.d.ts.map +1 -1
- package/dist/components/form/form.js +134 -42
- package/dist/components/input/input.d.ts +5 -0
- package/dist/components/input/input.d.ts.map +1 -1
- package/dist/components/page-layout/page-layout.js +1 -1
- package/dist/components/select/select.d.ts +42 -11
- package/dist/components/select/select.d.ts.map +1 -1
- package/dist/components/select/select.js +458 -150
- package/dist/components/tabs/tab-panel.d.ts +5 -0
- package/dist/components/tabs/tab-panel.d.ts.map +1 -1
- package/dist/components/tabs/tab.d.ts +5 -0
- package/dist/components/tabs/tab.d.ts.map +1 -1
- package/dist/components/tabs/tabs.d.ts +5 -0
- package/dist/components/tabs/tabs.d.ts.map +1 -1
- package/dist/styles/index.css +2 -0
- package/package.json +1 -1
- package/src/components/button-group/button-group.ts +6 -0
- package/src/components/code-block/code-block.ts +6 -0
- package/src/components/form/form-step.ts +5 -1
- package/src/components/form/form.ts +153 -46
- package/src/components/input/input.ts +6 -0
- package/src/components/page-layout/page-layout.ts +1 -1
- package/src/components/select/select.ts +499 -133
- package/src/components/tabs/tab-panel.ts +5 -0
- package/src/components/tabs/tab.ts +6 -0
- package/src/components/tabs/tabs.ts +6 -0
- package/src/styles/theme.css +2 -0
|
@@ -3,4 +3,9 @@ export declare class StButtonGroup extends LitElement {
|
|
|
3
3
|
static styles: import("lit").CSSResult[];
|
|
4
4
|
render(): import("lit-html").TemplateResult<1>;
|
|
5
5
|
}
|
|
6
|
+
declare global {
|
|
7
|
+
interface HTMLElementTagNameMap {
|
|
8
|
+
"st-button-group": StButtonGroup;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
6
11
|
//# sourceMappingURL=button-group.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button-group.d.ts","sourceRoot":"","sources":["../../../src/components/button-group/button-group.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAY,MAAM,KAAK,CAAC;AAI1C,qBACa,aAAc,SAAQ,UAAU;IAC3C,MAAM,CAAC,MAAM,4BAmDX;IAEF,MAAM,yCAML;CACF"}
|
|
1
|
+
{"version":3,"file":"button-group.d.ts","sourceRoot":"","sources":["../../../src/components/button-group/button-group.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAY,MAAM,KAAK,CAAC;AAI1C,qBACa,aAAc,SAAQ,UAAU;IAC3C,MAAM,CAAC,MAAM,4BAmDX;IAEF,MAAM,yCAML;CACF;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,iBAAiB,EAAE,aAAa,CAAC;KAClC;CACF"}
|
|
@@ -17,4 +17,9 @@ export declare class StCodeBlock extends LitElement {
|
|
|
17
17
|
private _copyToClipboard;
|
|
18
18
|
render(): import("lit-html").TemplateResult<1>;
|
|
19
19
|
}
|
|
20
|
+
declare global {
|
|
21
|
+
interface HTMLElementTagNameMap {
|
|
22
|
+
"st-code-block": StCodeBlock;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
20
25
|
//# sourceMappingURL=code-block.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"code-block.d.ts","sourceRoot":"","sources":["../../../src/components/code-block/code-block.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAa,MAAM,KAAK,CAAC;AAM5C,OAAO,wCAAwC,CAAC;AAChD,OAAO,wCAAwC,CAAC;AAChD,OAAO,iCAAiC,CAAC;AACzC,OAAO,kCAAkC,CAAC;AAC1C,OAAO,kCAAkC,CAAC;AAC1C,OAAO,oCAAoC,CAAC;AAS5C,qBACa,WAAY,SAAQ,UAAU;IAEb,QAAQ,SAAgB;IAE3C,OAAO,CAAC,SAAS,CAAqB;IACtC,OAAO,CAAC,YAAY,CAAK;IACzB,OAAO,CAAC,OAAO,CAAS;IAEN,OAAO,CAAC,KAAK,CAAmB;IAE3D,MAAM,CAAC,MAAM,4BAyHX;IAEF,OAAO,CAAC,iBAAiB;IAkCzB,OAAO,CAAC,OAAO;YAaD,gBAAgB;IAc9B,MAAM,yCAwCL;CACF"}
|
|
1
|
+
{"version":3,"file":"code-block.d.ts","sourceRoot":"","sources":["../../../src/components/code-block/code-block.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAa,MAAM,KAAK,CAAC;AAM5C,OAAO,wCAAwC,CAAC;AAChD,OAAO,wCAAwC,CAAC;AAChD,OAAO,iCAAiC,CAAC;AACzC,OAAO,kCAAkC,CAAC;AAC1C,OAAO,kCAAkC,CAAC;AAC1C,OAAO,oCAAoC,CAAC;AAS5C,qBACa,WAAY,SAAQ,UAAU;IAEb,QAAQ,SAAgB;IAE3C,OAAO,CAAC,SAAS,CAAqB;IACtC,OAAO,CAAC,YAAY,CAAK;IACzB,OAAO,CAAC,OAAO,CAAS;IAEN,OAAO,CAAC,KAAK,CAAmB;IAE3D,MAAM,CAAC,MAAM,4BAyHX;IAEF,OAAO,CAAC,iBAAiB;IAkCzB,OAAO,CAAC,OAAO;YAaD,gBAAgB;IAc9B,MAAM,yCAwCL;CACF;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,eAAe,EAAE,WAAW,CAAC;KAC9B;CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form-step.d.ts","sourceRoot":"","sources":["../../../src/components/form/form-step.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAY,MAAM,KAAK,CAAC;AAI1C,qBACa,UAAW,SAAQ,UAAU;IACd,KAAK,SAAM;IACK,MAAM,UAAS;
|
|
1
|
+
{"version":3,"file":"form-step.d.ts","sourceRoot":"","sources":["../../../src/components/form/form-step.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAY,MAAM,KAAK,CAAC;AAI1C,qBACa,UAAW,SAAQ,UAAU;IACd,KAAK,SAAM;IACK,MAAM,UAAS;IAIzD,QAAQ,CAAC,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC;IAE5C,MAAM,CAAC,MAAM,4BAWX;IAEF,MAAM,yCAEL;CACF;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,cAAc,EAAE,UAAU,CAAC;KAC5B;CACF"}
|
|
@@ -35,6 +35,9 @@ __decorate([
|
|
|
35
35
|
__decorate([
|
|
36
36
|
property({ type: Boolean, reflect: true })
|
|
37
37
|
], StFormStep.prototype, "active", void 0);
|
|
38
|
+
__decorate([
|
|
39
|
+
property({ attribute: false })
|
|
40
|
+
], StFormStep.prototype, "validate", void 0);
|
|
38
41
|
StFormStep = __decorate([
|
|
39
42
|
customElement("st-form-step")
|
|
40
43
|
], StFormStep);
|
|
@@ -1,13 +1,18 @@
|
|
|
1
|
-
import { LitElement } from "lit";
|
|
1
|
+
import { LitElement, PropertyValues } from "lit";
|
|
2
2
|
export type FormLayout = "vertical" | "horizontal" | "inline";
|
|
3
3
|
export declare class StForm extends LitElement {
|
|
4
4
|
layout: FormLayout;
|
|
5
5
|
loading: boolean;
|
|
6
6
|
error: string;
|
|
7
7
|
private _currentStepIndex;
|
|
8
|
-
private _stepElements;
|
|
9
8
|
private _formEl;
|
|
9
|
+
private _modalFooterEl;
|
|
10
|
+
private get _steps();
|
|
10
11
|
static styles: import("lit").CSSResult[];
|
|
12
|
+
connectedCallback(): void;
|
|
13
|
+
disconnectedCallback(): void;
|
|
14
|
+
updated(changedProperties: PropertyValues<this>): void;
|
|
15
|
+
private _updateModalFooter;
|
|
11
16
|
private _handleSlotChange;
|
|
12
17
|
private _updateStepVisibility;
|
|
13
18
|
private _validateCurrentContext;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form.d.ts","sourceRoot":"","sources":["../../../src/components/form/form.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,
|
|
1
|
+
{"version":3,"file":"form.d.ts","sourceRoot":"","sources":["../../../src/components/form/form.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAa,cAAc,EAAC,MAAM,KAAK,CAAC;AAK1D,MAAM,MAAM,UAAU,GAAG,UAAU,GAAG,YAAY,GAAG,QAAQ,CAAC;AAE9D,qBACa,MAAO,SAAQ,UAAU;IACK,MAAM,EAAE,UAAU,CAAc;IAC/B,OAAO,UAAS;IAChC,KAAK,SAAM;IAE5B,OAAO,CAAC,iBAAiB,CAAK;IAExB,OAAO,CAAC,OAAO,CAAmB;IAEjD,OAAO,CAAC,cAAc,CAA4B;IAElD,OAAO,KAAK,MAAM,GAEjB;IAED,MAAM,CAAC,MAAM,4BAqIX;IAEO,iBAAiB,SAMzB;IAEQ,oBAAoB,SAM5B;IAEQ,OAAO,CAAC,iBAAiB,EAAE,cAAc,CAAC,IAAI,CAAC,QAGvD;IAED,OAAO,CAAC,kBAAkB;IAmD1B,OAAO,CAAC,iBAAiB;IAKzB,OAAO,CAAC,qBAAqB;YAQf,uBAAuB;IAiFrC,OAAO,CAAC,kBAAkB;IAI1B,OAAO,CAAC,SAAS;IAOjB,OAAO,CAAC,gBAAgB;YAkCV,aAAa;IA6B3B,MAAM,yCAsFL;CACF;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,SAAS,EAAE,MAAM,CAAC;KACnB;CACF"}
|
|
@@ -5,7 +5,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
7
|
import { LitElement, html, css } from "lit";
|
|
8
|
-
import { customElement, property, state,
|
|
8
|
+
import { customElement, property, state, query } from "lit/decorators.js";
|
|
9
9
|
import { resetStyles } from "../../styles/reset.js";
|
|
10
10
|
let StForm = class StForm extends LitElement {
|
|
11
11
|
constructor() {
|
|
@@ -14,43 +14,132 @@ let StForm = class StForm extends LitElement {
|
|
|
14
14
|
this.loading = false;
|
|
15
15
|
this.error = "";
|
|
16
16
|
this._currentStepIndex = 0;
|
|
17
|
+
this._modalFooterEl = null;
|
|
17
18
|
}
|
|
18
|
-
|
|
19
|
-
|
|
19
|
+
get _steps() {
|
|
20
|
+
return Array.from(this.querySelectorAll("st-form-step"));
|
|
21
|
+
}
|
|
22
|
+
connectedCallback() {
|
|
23
|
+
super.connectedCallback();
|
|
24
|
+
this.updateComplete.then(() => {
|
|
20
25
|
this._updateStepVisibility();
|
|
26
|
+
this._updateModalFooter();
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
disconnectedCallback() {
|
|
30
|
+
super.disconnectedCallback();
|
|
31
|
+
if (this._modalFooterEl) {
|
|
32
|
+
this._modalFooterEl.remove();
|
|
33
|
+
this._modalFooterEl = null;
|
|
21
34
|
}
|
|
22
35
|
}
|
|
36
|
+
updated(changedProperties) {
|
|
37
|
+
super.updated(changedProperties);
|
|
38
|
+
this._updateModalFooter();
|
|
39
|
+
}
|
|
40
|
+
_updateModalFooter() {
|
|
41
|
+
const modal = this.closest("st-modal");
|
|
42
|
+
if (modal) {
|
|
43
|
+
if (!this._modalFooterEl) {
|
|
44
|
+
this._modalFooterEl = document.createElement("div");
|
|
45
|
+
this._modalFooterEl.setAttribute("slot", "footer");
|
|
46
|
+
this._modalFooterEl.style.display = "flex";
|
|
47
|
+
this._modalFooterEl.style.gap = "var(--st-spacing-md)";
|
|
48
|
+
this._modalFooterEl.style.width = "100%";
|
|
49
|
+
this._modalFooterEl.style.justifyContent = "flex-end";
|
|
50
|
+
this._modalFooterEl.style.alignItems = "center";
|
|
51
|
+
modal.appendChild(this._modalFooterEl);
|
|
52
|
+
}
|
|
53
|
+
const steps = this._steps;
|
|
54
|
+
const hasSteps = steps.length > 0;
|
|
55
|
+
const isLastStep = hasSteps ? this._currentStepIndex === steps.length - 1 : true;
|
|
56
|
+
// Imperative DOM management prevents event listener loss and re-rendering conflicts
|
|
57
|
+
this._modalFooterEl.innerHTML = "";
|
|
58
|
+
if (hasSteps && this._currentStepIndex > 0) {
|
|
59
|
+
const backBtn = document.createElement("st-button");
|
|
60
|
+
backBtn.setAttribute("variant", "secondary");
|
|
61
|
+
backBtn.setAttribute("type", "button");
|
|
62
|
+
if (this.loading)
|
|
63
|
+
backBtn.setAttribute("disabled", "");
|
|
64
|
+
backBtn.textContent = "Back";
|
|
65
|
+
backBtn.addEventListener("click", (e) => {
|
|
66
|
+
e.preventDefault();
|
|
67
|
+
this._prevStep();
|
|
68
|
+
});
|
|
69
|
+
this._modalFooterEl.appendChild(backBtn);
|
|
70
|
+
}
|
|
71
|
+
const submitBtn = document.createElement("st-button");
|
|
72
|
+
submitBtn.setAttribute("color", "primary");
|
|
73
|
+
submitBtn.setAttribute("type", "button");
|
|
74
|
+
if (this.loading)
|
|
75
|
+
submitBtn.setAttribute("disabled", "");
|
|
76
|
+
submitBtn.textContent = this.loading ? "Submitting..." : (isLastStep ? "Submit" : "Continue");
|
|
77
|
+
submitBtn.addEventListener("click", (e) => {
|
|
78
|
+
e.preventDefault();
|
|
79
|
+
this._triggerSubmission();
|
|
80
|
+
});
|
|
81
|
+
this._modalFooterEl.appendChild(submitBtn);
|
|
82
|
+
}
|
|
83
|
+
else if (this._modalFooterEl) {
|
|
84
|
+
this._modalFooterEl.remove();
|
|
85
|
+
this._modalFooterEl = null;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
_handleSlotChange() {
|
|
89
|
+
this._updateStepVisibility();
|
|
90
|
+
this._updateModalFooter();
|
|
91
|
+
}
|
|
23
92
|
_updateStepVisibility() {
|
|
24
|
-
|
|
93
|
+
const steps = this._steps;
|
|
94
|
+
steps.forEach((step, index) => {
|
|
25
95
|
step.active = index === this._currentStepIndex;
|
|
26
96
|
});
|
|
27
97
|
this.requestUpdate();
|
|
28
98
|
}
|
|
29
99
|
async _validateCurrentContext() {
|
|
30
|
-
const
|
|
31
|
-
|
|
100
|
+
const steps = this._steps;
|
|
101
|
+
const scope = steps.length > 0
|
|
102
|
+
? steps[this._currentStepIndex]
|
|
32
103
|
: this;
|
|
33
104
|
let isValid = true;
|
|
34
|
-
|
|
35
|
-
const inputs = Array.from(scope.querySelectorAll("*"));
|
|
105
|
+
const inputs = Array.from(scope.querySelectorAll("st-input, st-select, st-textarea, st-checkbox, st-radio, input, select, textarea"));
|
|
36
106
|
for (const input of inputs) {
|
|
107
|
+
if (input.hasAttribute("disabled") || input.disabled)
|
|
108
|
+
continue;
|
|
109
|
+
let fieldValid = true;
|
|
37
110
|
if (typeof input.checkValidity === "function") {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
111
|
+
fieldValid = input.checkValidity();
|
|
112
|
+
}
|
|
113
|
+
else {
|
|
114
|
+
const isRequired = input.hasAttribute("required") || input.required;
|
|
115
|
+
if (isRequired) {
|
|
116
|
+
const isToggle = input.tagName === "ST-CHECKBOX" || input.tagName === "ST-RADIO";
|
|
117
|
+
const val = isToggle ? input.checked : input.value;
|
|
118
|
+
if (val === undefined || val === null || val === "" || val === false) {
|
|
119
|
+
fieldValid = false;
|
|
41
120
|
}
|
|
42
|
-
isValid = false;
|
|
43
121
|
}
|
|
44
122
|
}
|
|
123
|
+
if (!fieldValid) {
|
|
124
|
+
if (typeof input.reportValidity === "function") {
|
|
125
|
+
input.reportValidity();
|
|
126
|
+
}
|
|
127
|
+
else if ("invalid" in input) {
|
|
128
|
+
input.invalid = true;
|
|
129
|
+
}
|
|
130
|
+
if (isValid && typeof input.focus === "function") {
|
|
131
|
+
input.focus();
|
|
132
|
+
}
|
|
133
|
+
isValid = false;
|
|
134
|
+
}
|
|
45
135
|
}
|
|
46
|
-
if (
|
|
136
|
+
if (steps.length === 0 && this._formEl) {
|
|
47
137
|
if (!this._formEl.checkValidity()) {
|
|
48
138
|
isValid = false;
|
|
49
139
|
}
|
|
50
140
|
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
const currentStep = this._stepElements[this._currentStepIndex];
|
|
141
|
+
if (isValid && steps.length > 0) {
|
|
142
|
+
const currentStep = steps[this._currentStepIndex];
|
|
54
143
|
if (typeof currentStep.validate === "function") {
|
|
55
144
|
try {
|
|
56
145
|
this.loading = true;
|
|
@@ -59,7 +148,7 @@ let StForm = class StForm extends LitElement {
|
|
|
59
148
|
isValid = false;
|
|
60
149
|
}
|
|
61
150
|
}
|
|
62
|
-
catch
|
|
151
|
+
catch {
|
|
63
152
|
isValid = false;
|
|
64
153
|
}
|
|
65
154
|
finally {
|
|
@@ -110,8 +199,9 @@ let StForm = class StForm extends LitElement {
|
|
|
110
199
|
const isValid = await this._validateCurrentContext();
|
|
111
200
|
if (!isValid)
|
|
112
201
|
return;
|
|
113
|
-
const
|
|
114
|
-
const
|
|
202
|
+
const steps = this._steps;
|
|
203
|
+
const hasSteps = steps.length > 0;
|
|
204
|
+
const isLastStep = hasSteps ? this._currentStepIndex === steps.length - 1 : true;
|
|
115
205
|
if (hasSteps && !isLastStep) {
|
|
116
206
|
this._currentStepIndex++;
|
|
117
207
|
this._updateStepVisibility();
|
|
@@ -126,8 +216,9 @@ let StForm = class StForm extends LitElement {
|
|
|
126
216
|
}));
|
|
127
217
|
}
|
|
128
218
|
render() {
|
|
129
|
-
const
|
|
130
|
-
const
|
|
219
|
+
const steps = this._steps;
|
|
220
|
+
const hasSteps = steps.length > 0;
|
|
221
|
+
const isInModal = !!this.closest("st-modal");
|
|
131
222
|
return html `
|
|
132
223
|
<div class="${hasSteps ? "has-steps" : ""}" aria-busy=${this.loading}>
|
|
133
224
|
${this.loading
|
|
@@ -140,7 +231,7 @@ let StForm = class StForm extends LitElement {
|
|
|
140
231
|
${hasSteps
|
|
141
232
|
? html `
|
|
142
233
|
<div class="progress-nav" role="tablist">
|
|
143
|
-
${
|
|
234
|
+
${steps.map((step, index) => {
|
|
144
235
|
const isActive = index === this._currentStepIndex;
|
|
145
236
|
const isCompleted = index < this._currentStepIndex;
|
|
146
237
|
return html `
|
|
@@ -158,7 +249,7 @@ let StForm = class StForm extends LitElement {
|
|
|
158
249
|
</div>
|
|
159
250
|
<span>${step.title || `Step ${index + 1}`}</span>
|
|
160
251
|
</div>
|
|
161
|
-
${index <
|
|
252
|
+
${index < steps.length - 1
|
|
162
253
|
? html ` <div class="step-connector ${isCompleted ? "completed" : ""}"></div> `
|
|
163
254
|
: ""}
|
|
164
255
|
`;
|
|
@@ -178,29 +269,33 @@ let StForm = class StForm extends LitElement {
|
|
|
178
269
|
<form @submit=${this._handleSubmit}>
|
|
179
270
|
<slot @slotchange=${this._handleSlotChange}></slot>
|
|
180
271
|
|
|
181
|
-
|
|
182
|
-
${hasSteps && this._currentStepIndex > 0
|
|
272
|
+
${!isInModal
|
|
183
273
|
? html `
|
|
274
|
+
<div class="form-actions">
|
|
275
|
+
${hasSteps && this._currentStepIndex > 0
|
|
276
|
+
? html `
|
|
277
|
+
<st-button
|
|
278
|
+
variant="secondary"
|
|
279
|
+
type="button"
|
|
280
|
+
@click=${this._prevStep}
|
|
281
|
+
?disabled=${this.loading}
|
|
282
|
+
>
|
|
283
|
+
Back
|
|
284
|
+
</st-button>
|
|
285
|
+
`
|
|
286
|
+
: ""}
|
|
287
|
+
|
|
184
288
|
<st-button
|
|
185
|
-
|
|
289
|
+
color="primary"
|
|
186
290
|
type="button"
|
|
187
|
-
@click=${this.
|
|
291
|
+
@click=${this._triggerSubmission}
|
|
188
292
|
?disabled=${this.loading}
|
|
189
293
|
>
|
|
190
|
-
|
|
294
|
+
${this.loading ? "Submitting..." : hasSteps && this._currentStepIndex === steps.length - 1 ? "Submit" : hasSteps ? "Continue" : "Submit"}
|
|
191
295
|
</st-button>
|
|
192
|
-
|
|
296
|
+
</div>
|
|
297
|
+
`
|
|
193
298
|
: ""}
|
|
194
|
-
|
|
195
|
-
<st-button
|
|
196
|
-
color="primary"
|
|
197
|
-
type="button"
|
|
198
|
-
@click=${this._triggerSubmission}
|
|
199
|
-
?disabled=${this.loading}
|
|
200
|
-
>
|
|
201
|
-
${this.loading ? "Submitting..." : isLastStep ? "Submit" : "Continue"}
|
|
202
|
-
</st-button>
|
|
203
|
-
</div>
|
|
204
299
|
</form>
|
|
205
300
|
</div>
|
|
206
301
|
`;
|
|
@@ -352,9 +447,6 @@ __decorate([
|
|
|
352
447
|
__decorate([
|
|
353
448
|
state()
|
|
354
449
|
], StForm.prototype, "_currentStepIndex", void 0);
|
|
355
|
-
__decorate([
|
|
356
|
-
queryAssignedElements({ selector: "st-form-step" })
|
|
357
|
-
], StForm.prototype, "_stepElements", void 0);
|
|
358
450
|
__decorate([
|
|
359
451
|
query("form")
|
|
360
452
|
], StForm.prototype, "_formEl", void 0);
|
|
@@ -28,4 +28,9 @@ export declare class StInput extends LitElement {
|
|
|
28
28
|
private _handleChange;
|
|
29
29
|
render(): import("lit-html").TemplateResult<1>;
|
|
30
30
|
}
|
|
31
|
+
declare global {
|
|
32
|
+
interface HTMLElementTagNameMap {
|
|
33
|
+
"st-input": StInput;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
31
36
|
//# sourceMappingURL=input.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input.d.ts","sourceRoot":"","sources":["../../../src/components/input/input.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAa,cAAc,EAAC,MAAM,KAAK,CAAC;AAK1D,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,UAAU,GAAG,OAAO,GAAG,QAAQ,GAAG,QAAQ,GAAG,KAAK,CAAC;AAEpF,qBACa,OAAQ,SAAQ,UAAU;IACrC,MAAM,CAAC,cAAc,UAAQ;IAC7B,OAAO,CAA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C;IAED,QAAQ,UAAS;IACjB,OAAO,UAAS;IAChB,QAAQ,UAAS;IAE3D,cAaC;IAED,MAAM,CAAC,MAAM,4BAmHX;IAEO,OAAO,CAAC,iBAAiB,EAAE,cAAc,CAAC,IAAI,CAAC,QAUvD;IAED,OAAO,CAAC,aAAa;IAWrB,iBAAiB,SAKhB;IAGD,aAAa,YAEZ;IAED,cAAc,YAEb;IAED,OAAO,CAAC,YAAY;IAWpB,OAAO,CAAC,aAAa;IAIrB,MAAM,yCA8BL;CACF;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,UAAU,EAAE,OAAO,CAAC;KACrB;CACF"}
|
|
@@ -276,7 +276,7 @@ StPageLayout.styles = [
|
|
|
276
276
|
--layout-surface-color: var(--st-color-surface, #f8fafc);
|
|
277
277
|
--layout-border-color: var(--st-color-border, #e2e8f0);
|
|
278
278
|
--layout-sidebar-width: 16rem;
|
|
279
|
-
--layout-right-sidebar-width:
|
|
279
|
+
--layout-right-sidebar-width: 16rem;
|
|
280
280
|
--layout-main-max-width: none;
|
|
281
281
|
--layout-nav-height: 4rem;
|
|
282
282
|
}
|
|
@@ -1,16 +1,47 @@
|
|
|
1
|
-
import { LitElement } from
|
|
1
|
+
import { LitElement, PropertyValues } from "lit";
|
|
2
|
+
export interface SelectOption {
|
|
3
|
+
label: string;
|
|
4
|
+
value: string;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Standard WHATWG Autocomplete tokens.
|
|
8
|
+
*/
|
|
9
|
+
export type SelectAutocomplete = "on" | "off" | "name" | "honorific-prefix" | "given-name" | "additional-name" | "family-name" | "honorific-suffix" | "nickname" | "email" | "username" | "new-password" | "current-password" | "one-time-code" | "organization" | "organization-title" | "url" | "photo" | "webauthn" | "street-address" | "address-line1" | "address-line2" | "address-line3" | "address-level1" | "address-level2" | "address-level3" | "address-level4" | "country" | "country-name" | "postal-code" | "cc-name" | "cc-given-name" | "cc-additional-name" | "cc-family-name" | "cc-number" | "cc-exp" | "cc-exp-month" | "cc-exp-year" | "cc-csc" | "cc-type" | "transaction-currency" | "transaction-amount" | "language" | "bday" | "bday-day" | "bday-month" | "bday-year" | "sex" | "tel" | "tel-country-code" | "tel-national" | "tel-area-code" | "tel-local" | "tel-local-prefix" | "tel-local-suffix" | "tel-extension" | "impp" | (string & {});
|
|
2
10
|
export declare class StSelect extends LitElement {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
11
|
+
static formAssociated: boolean;
|
|
12
|
+
private internals;
|
|
13
|
+
name: string;
|
|
14
|
+
label: string;
|
|
15
|
+
value: string;
|
|
16
|
+
required: boolean;
|
|
17
|
+
multiple: boolean;
|
|
18
|
+
searchable: boolean;
|
|
19
|
+
options: SelectOption[];
|
|
20
|
+
error: string;
|
|
21
|
+
disabled: boolean;
|
|
22
|
+
invalid: boolean;
|
|
23
|
+
autocomplete: SelectAutocomplete;
|
|
24
|
+
private open;
|
|
25
|
+
private filterText;
|
|
26
|
+
private nativeError;
|
|
27
|
+
private touched;
|
|
28
|
+
private buttonElement;
|
|
29
|
+
private searchInputEl?;
|
|
30
|
+
static styles: import("lit").CSSResult;
|
|
7
31
|
constructor();
|
|
8
|
-
|
|
32
|
+
checkValidity(): boolean;
|
|
33
|
+
reportValidity(): boolean;
|
|
34
|
+
focus(options?: FocusOptions): void;
|
|
35
|
+
connectedCallback(): void;
|
|
36
|
+
disconnectedCallback(): void;
|
|
37
|
+
willUpdate(changedProperties: PropertyValues): void;
|
|
38
|
+
private get selectedValues();
|
|
39
|
+
private validate;
|
|
40
|
+
private handleClickOutside;
|
|
41
|
+
private toggleOpen;
|
|
42
|
+
private handleOptionClick;
|
|
43
|
+
private handleSearchInput;
|
|
44
|
+
private handleButtonKeydown;
|
|
9
45
|
render(): import("lit-html").TemplateResult<1>;
|
|
10
46
|
}
|
|
11
|
-
declare global {
|
|
12
|
-
interface HTMLElementTagNameMap {
|
|
13
|
-
'st-select': StSelect;
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
47
|
//# sourceMappingURL=select.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select.d.ts","sourceRoot":"","sources":["../../../src/components/select/select.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"select.d.ts","sourceRoot":"","sources":["../../../src/components/select/select.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAa,cAAc,EAAC,MAAM,KAAK,CAAC;AAI1D,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAC1B,IAAI,GACJ,KAAK,GAEL,MAAM,GACN,kBAAkB,GAClB,YAAY,GACZ,iBAAiB,GACjB,aAAa,GACb,kBAAkB,GAClB,UAAU,GAEV,OAAO,GACP,UAAU,GACV,cAAc,GACd,kBAAkB,GAClB,eAAe,GACf,cAAc,GACd,oBAAoB,GACpB,KAAK,GACL,OAAO,GACP,UAAU,GAEV,gBAAgB,GAChB,eAAe,GACf,eAAe,GACf,eAAe,GACf,gBAAgB,GAChB,gBAAgB,GAChB,gBAAgB,GAChB,gBAAgB,GAChB,SAAS,GACT,cAAc,GACd,aAAa,GAEb,SAAS,GACT,eAAe,GACf,oBAAoB,GACpB,gBAAgB,GAChB,WAAW,GACX,QAAQ,GACR,cAAc,GACd,aAAa,GACb,QAAQ,GACR,SAAS,GACT,sBAAsB,GACtB,oBAAoB,GAEpB,UAAU,GACV,MAAM,GACN,UAAU,GACV,YAAY,GACZ,WAAW,GACX,KAAK,GAEL,KAAK,GACL,kBAAkB,GAClB,cAAc,GACd,eAAe,GACf,WAAW,GACX,kBAAkB,GAClB,kBAAkB,GAClB,eAAe,GACf,MAAM,GAEN,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;AAElB,qBACa,QAAS,SAAQ,UAAU;IACtC,MAAM,CAAC,cAAc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