@zitadel/components 0.1.0-alpha.3 → 0.1.0-alpha.5
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/README.md +4 -0
- package/dist/atoms/index.d.mts +1 -1
- package/dist/atoms/index.mjs +1 -1
- package/dist/atoms/zl-button.d.ts +10 -0
- package/dist/atoms/zl-button.d.ts.map +1 -1
- package/dist/atoms/zl-field.d.ts +4 -0
- package/dist/atoms/zl-field.d.ts.map +1 -1
- package/dist/{atoms-eOxuoGDq.mjs → atoms-Dh5J7QwT.mjs} +115 -19
- package/dist/atoms-Dh5J7QwT.mjs.map +1 -0
- package/dist/default-DD6GYdEe.mjs +6 -0
- package/dist/default-DD6GYdEe.mjs.map +1 -0
- package/dist/{index-QC-a9dn0.d.mts → index-AOp9ms-2.d.mts} +6 -3
- package/dist/{index-QC-a9dn0.d.mts.map → index-AOp9ms-2.d.mts.map} +1 -1
- package/dist/{index-DmtnqUIY.d.mts → index-B1nizGvK.d.mts} +70 -26
- package/dist/index-B1nizGvK.d.mts.map +1 -0
- package/dist/index.d.mts +3 -3
- package/dist/index.mjs +3 -3
- package/dist/manifests.mjs +1 -1
- package/dist/orchestrator/font-loader.d.ts.map +1 -1
- package/dist/orchestrator/index.d.mts +2 -2
- package/dist/orchestrator/index.mjs +2 -2
- package/dist/orchestrator/locales/de.d.ts.map +1 -1
- package/dist/orchestrator/locales/en.d.ts.map +1 -1
- package/dist/orchestrator/locales/it.d.ts.map +1 -1
- package/dist/orchestrator/sanitiser.d.ts.map +1 -1
- package/dist/orchestrator/zitadel-login.d.ts +3 -0
- package/dist/orchestrator/zitadel-login.d.ts.map +1 -1
- package/dist/{orchestrator-Dds72XrU.mjs → orchestrator-e33w1C7V.mjs} +83 -24
- package/dist/orchestrator-e33w1C7V.mjs.map +1 -0
- package/dist/standalone.mjs +195 -40
- package/dist/tsconfig.lib.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/dist/atoms-eOxuoGDq.mjs.map +0 -1
- package/dist/default-DP74t2io.mjs +0 -6
- package/dist/default-DP74t2io.mjs.map +0 -1
- package/dist/index-DmtnqUIY.d.mts.map +0 -1
- package/dist/orchestrator-Dds72XrU.mjs.map +0 -1
package/dist/standalone.mjs
CHANGED
|
@@ -1561,6 +1561,13 @@ let ZlButton = class ZlButton extends i$2 {
|
|
|
1561
1561
|
set label(value) {
|
|
1562
1562
|
this.#_label_accessor_storage = value;
|
|
1563
1563
|
}
|
|
1564
|
+
#_testId_accessor_storage = void 0;
|
|
1565
|
+
get testId() {
|
|
1566
|
+
return this.#_testId_accessor_storage;
|
|
1567
|
+
}
|
|
1568
|
+
set testId(value) {
|
|
1569
|
+
this.#_testId_accessor_storage = value;
|
|
1570
|
+
}
|
|
1564
1571
|
#_forcedState_accessor_storage = null;
|
|
1565
1572
|
get forcedState() {
|
|
1566
1573
|
return this.#_forcedState_accessor_storage;
|
|
@@ -1573,50 +1580,97 @@ let ZlButton = class ZlButton extends i$2 {
|
|
|
1573
1580
|
super();
|
|
1574
1581
|
this.internals = this.attachInternals();
|
|
1575
1582
|
}
|
|
1583
|
+
connectedCallback() {
|
|
1584
|
+
super.connectedCallback();
|
|
1585
|
+
this.addEventListener("click", this.handleHostClick);
|
|
1586
|
+
}
|
|
1587
|
+
disconnectedCallback() {
|
|
1588
|
+
this.removeEventListener("click", this.handleHostClick);
|
|
1589
|
+
super.disconnectedCallback();
|
|
1590
|
+
}
|
|
1576
1591
|
focus(options) {
|
|
1577
1592
|
this.shadowRoot?.querySelector("button")?.focus(options);
|
|
1578
1593
|
}
|
|
1579
1594
|
render() {
|
|
1580
|
-
const
|
|
1581
|
-
const
|
|
1595
|
+
const hierarchy = this.stringOption("hierarchy", this.hierarchy, "primary");
|
|
1596
|
+
const size = this.stringOption("size", this.size, "medium");
|
|
1597
|
+
const type = this.buttonType();
|
|
1598
|
+
const loading = this.booleanOption("loading", this.loading);
|
|
1599
|
+
const disabled = this.booleanOption("disabled", this.disabled);
|
|
1600
|
+
const block = this.booleanOption("block", this.block);
|
|
1601
|
+
const label = this.stringOption("label", this.label);
|
|
1602
|
+
const blocked = disabled || loading;
|
|
1603
|
+
const body = label !== void 0 ? b`<span>${label}</span>` : b`<slot></slot>`;
|
|
1582
1604
|
return b`
|
|
1583
1605
|
<button
|
|
1584
1606
|
class=${e$2({
|
|
1585
1607
|
root: true,
|
|
1586
1608
|
"zr-btn": true,
|
|
1587
|
-
[`zr-btn--${
|
|
1588
|
-
[`zr-btn--${
|
|
1589
|
-
"zr-btn--block":
|
|
1609
|
+
[`zr-btn--${hierarchy}`]: true,
|
|
1610
|
+
[`zr-btn--${size}`]: true,
|
|
1611
|
+
"zr-btn--block": block
|
|
1590
1612
|
})}
|
|
1591
1613
|
part="root"
|
|
1592
|
-
type=${
|
|
1614
|
+
type=${type}
|
|
1593
1615
|
?disabled=${blocked}
|
|
1594
|
-
aria-busy=${
|
|
1616
|
+
aria-busy=${loading ? "true" : "false"}
|
|
1617
|
+
data-testid=${this.nativeButtonTestId() ?? A}
|
|
1595
1618
|
data-state=${this.forcedState ?? A}
|
|
1596
1619
|
@click=${this.handleClick}
|
|
1597
1620
|
>
|
|
1598
1621
|
<slot name="leading"></slot>
|
|
1599
1622
|
${body}
|
|
1600
|
-
${
|
|
1623
|
+
${loading ? b`<span class="spinner" part="spinner"><zl-icon name="spinner" size=${size === "small" ? "16" : "24"} spin decorative></zl-icon></span>` : b`<slot name="trailing"></slot>`}
|
|
1601
1624
|
</button>
|
|
1602
1625
|
`;
|
|
1603
1626
|
}
|
|
1604
1627
|
handleClick = (event) => {
|
|
1605
|
-
|
|
1628
|
+
this.activate(event);
|
|
1629
|
+
};
|
|
1630
|
+
handleHostClick = (event) => {
|
|
1631
|
+
if (event.composedPath()[0] !== this) return;
|
|
1632
|
+
this.activate(event);
|
|
1633
|
+
};
|
|
1634
|
+
nativeButtonTestId() {
|
|
1635
|
+
const testId = this.stringOption("data-testid", this.testId);
|
|
1636
|
+
if (testId) return `${testId}-button`;
|
|
1637
|
+
const action = this.buttonAction();
|
|
1638
|
+
return action ? `zitadel-action-${action}` : void 0;
|
|
1639
|
+
}
|
|
1640
|
+
buttonType() {
|
|
1641
|
+
const type = this.stringOption("type", this.type, "button");
|
|
1642
|
+
return type === "submit" || type === "reset" ? type : "button";
|
|
1643
|
+
}
|
|
1644
|
+
buttonAction() {
|
|
1645
|
+
return this.stringOption("action", this.action);
|
|
1646
|
+
}
|
|
1647
|
+
activate(event) {
|
|
1648
|
+
const type = this.buttonType();
|
|
1649
|
+
const action = this.buttonAction();
|
|
1650
|
+
if (this.booleanOption("disabled", this.disabled) || this.booleanOption("loading", this.loading)) {
|
|
1606
1651
|
event.preventDefault();
|
|
1607
1652
|
event.stopImmediatePropagation();
|
|
1608
1653
|
return;
|
|
1609
1654
|
}
|
|
1610
1655
|
const form = this.internals.form;
|
|
1611
|
-
if (
|
|
1656
|
+
if (type === "submit" && form) {
|
|
1612
1657
|
event.preventDefault();
|
|
1613
1658
|
form.requestSubmit();
|
|
1614
|
-
} else if (
|
|
1659
|
+
} else if (type === "reset" && form) {
|
|
1615
1660
|
event.preventDefault();
|
|
1616
1661
|
form.reset();
|
|
1617
1662
|
}
|
|
1618
|
-
emit(this, "zl-submit", { action:
|
|
1619
|
-
}
|
|
1663
|
+
emit(this, "zl-submit", { action: action ?? null });
|
|
1664
|
+
}
|
|
1665
|
+
stringOption(attribute, value, fallback) {
|
|
1666
|
+
if (typeof value === "string" && value.length > 0) return value;
|
|
1667
|
+
const attr = this.getAttribute(attribute);
|
|
1668
|
+
if (attr !== null && attr.length > 0) return attr;
|
|
1669
|
+
return fallback;
|
|
1670
|
+
}
|
|
1671
|
+
booleanOption(attribute, value) {
|
|
1672
|
+
return value === true || this.hasAttribute(attribute);
|
|
1673
|
+
}
|
|
1620
1674
|
};
|
|
1621
1675
|
__decorate([n$1({ reflect: true })], ZlButton.prototype, "hierarchy", null);
|
|
1622
1676
|
__decorate([n$1({ reflect: true })], ZlButton.prototype, "size", null);
|
|
@@ -1632,6 +1686,7 @@ __decorate([n$1({
|
|
|
1632
1686
|
reflect: true
|
|
1633
1687
|
})], ZlButton.prototype, "block", null);
|
|
1634
1688
|
__decorate([n$1()], ZlButton.prototype, "label", null);
|
|
1689
|
+
__decorate([n$1({ attribute: "data-testid" })], ZlButton.prototype, "testId", null);
|
|
1635
1690
|
__decorate([n$1({ attribute: "data-state" })], ZlButton.prototype, "forcedState", null);
|
|
1636
1691
|
ZlButton = __decorate([t$4("zl-button")], ZlButton);
|
|
1637
1692
|
const zlButtonManifest = {
|
|
@@ -1648,7 +1703,8 @@ const zlButtonManifest = {
|
|
|
1648
1703
|
"loading",
|
|
1649
1704
|
"disabled",
|
|
1650
1705
|
"block",
|
|
1651
|
-
"label"
|
|
1706
|
+
"label",
|
|
1707
|
+
"data-testid"
|
|
1652
1708
|
],
|
|
1653
1709
|
parts: ["root", "spinner"],
|
|
1654
1710
|
slots: [
|
|
@@ -1857,6 +1913,13 @@ let ZlField = class ZlField extends i$2 {
|
|
|
1857
1913
|
set success(value) {
|
|
1858
1914
|
this.#_success_accessor_storage = value;
|
|
1859
1915
|
}
|
|
1916
|
+
#_testId_accessor_storage = void 0;
|
|
1917
|
+
get testId() {
|
|
1918
|
+
return this.#_testId_accessor_storage;
|
|
1919
|
+
}
|
|
1920
|
+
set testId(value) {
|
|
1921
|
+
this.#_testId_accessor_storage = value;
|
|
1922
|
+
}
|
|
1860
1923
|
#_forgotPasswordHref_accessor_storage = void 0;
|
|
1861
1924
|
get forgotPasswordHref() {
|
|
1862
1925
|
return this.#_forgotPasswordHref_accessor_storage;
|
|
@@ -1975,6 +2038,7 @@ let ZlField = class ZlField extends i$2 {
|
|
|
1975
2038
|
class="zr-field__input"
|
|
1976
2039
|
part="input"
|
|
1977
2040
|
id=${this.inputId}
|
|
2041
|
+
data-testid=${o(this.nativeInputTestId())}
|
|
1978
2042
|
name=${this.name}
|
|
1979
2043
|
type=${this.type}
|
|
1980
2044
|
.value=${l(this.value)}
|
|
@@ -2081,23 +2145,26 @@ let ZlField = class ZlField extends i$2 {
|
|
|
2081
2145
|
value: this.value
|
|
2082
2146
|
});
|
|
2083
2147
|
this.syncFormState();
|
|
2148
|
+
this.dispatchNativeInput();
|
|
2084
2149
|
this.inputEl?.focus();
|
|
2085
2150
|
};
|
|
2086
2151
|
handleInput = (event) => {
|
|
2152
|
+
event.stopPropagation();
|
|
2087
2153
|
const input = event.target;
|
|
2088
2154
|
this.value = input.value;
|
|
2155
|
+
this.syncFormState();
|
|
2089
2156
|
emit(this, "zl-input", {
|
|
2090
2157
|
name: this.name,
|
|
2091
2158
|
value: this.value
|
|
2092
2159
|
});
|
|
2160
|
+
this.dispatchNativeInput(event);
|
|
2093
2161
|
};
|
|
2094
2162
|
handleChange = (event) => {
|
|
2163
|
+
event.stopPropagation();
|
|
2095
2164
|
const input = event.target;
|
|
2096
2165
|
this.value = input.value;
|
|
2097
|
-
this.
|
|
2098
|
-
|
|
2099
|
-
composed: true
|
|
2100
|
-
}));
|
|
2166
|
+
this.syncFormState();
|
|
2167
|
+
this.dispatchNativeChange();
|
|
2101
2168
|
};
|
|
2102
2169
|
handleKeyDown = (event) => {
|
|
2103
2170
|
if (event.key === "Enter" && !event.isComposing && !event.shiftKey && !event.altKey && !event.metaKey && !event.ctrlKey) {
|
|
@@ -2108,6 +2175,33 @@ let ZlField = class ZlField extends i$2 {
|
|
|
2108
2175
|
}
|
|
2109
2176
|
}
|
|
2110
2177
|
};
|
|
2178
|
+
nativeInputTestId() {
|
|
2179
|
+
if (this.testId) return `${this.testId}-input`;
|
|
2180
|
+
return this.name ? `zitadel-input-${this.name}` : void 0;
|
|
2181
|
+
}
|
|
2182
|
+
dispatchNativeInput(source) {
|
|
2183
|
+
if (typeof InputEvent === "function") {
|
|
2184
|
+
const input = source instanceof InputEvent ? source : void 0;
|
|
2185
|
+
this.dispatchEvent(new InputEvent("input", {
|
|
2186
|
+
bubbles: true,
|
|
2187
|
+
composed: true,
|
|
2188
|
+
data: input?.data ?? null,
|
|
2189
|
+
inputType: input?.inputType ?? "",
|
|
2190
|
+
isComposing: input?.isComposing ?? false
|
|
2191
|
+
}));
|
|
2192
|
+
return;
|
|
2193
|
+
}
|
|
2194
|
+
this.dispatchEvent(new Event("input", {
|
|
2195
|
+
bubbles: true,
|
|
2196
|
+
composed: true
|
|
2197
|
+
}));
|
|
2198
|
+
}
|
|
2199
|
+
dispatchNativeChange() {
|
|
2200
|
+
this.dispatchEvent(new Event("change", {
|
|
2201
|
+
bubbles: true,
|
|
2202
|
+
composed: true
|
|
2203
|
+
}));
|
|
2204
|
+
}
|
|
2111
2205
|
};
|
|
2112
2206
|
__decorate([n$1()], ZlField.prototype, "label", null);
|
|
2113
2207
|
__decorate([n$1()], ZlField.prototype, "type", null);
|
|
@@ -2117,6 +2211,7 @@ __decorate([n$1()], ZlField.prototype, "autocomplete", null);
|
|
|
2117
2211
|
__decorate([n$1()], ZlField.prototype, "pattern", null);
|
|
2118
2212
|
__decorate([n$1()], ZlField.prototype, "error", null);
|
|
2119
2213
|
__decorate([n$1()], ZlField.prototype, "success", null);
|
|
2214
|
+
__decorate([n$1({ attribute: "data-testid" })], ZlField.prototype, "testId", null);
|
|
2120
2215
|
__decorate([n$1({ attribute: "forgot-password-href" })], ZlField.prototype, "forgotPasswordHref", null);
|
|
2121
2216
|
__decorate([n$1({ attribute: "forgot-password-label" })], ZlField.prototype, "forgotPasswordLabel", null);
|
|
2122
2217
|
__decorate([n$1({
|
|
@@ -2147,6 +2242,7 @@ const zlFieldManifest = {
|
|
|
2147
2242
|
"placeholder",
|
|
2148
2243
|
"autocomplete",
|
|
2149
2244
|
"pattern",
|
|
2245
|
+
"data-testid",
|
|
2150
2246
|
"required",
|
|
2151
2247
|
"disabled",
|
|
2152
2248
|
"invalid",
|
|
@@ -4129,30 +4225,35 @@ function sanitiseUrl(value, field, issues) {
|
|
|
4129
4225
|
//#endregion
|
|
4130
4226
|
//#region src/orchestrator/font-loader.ts
|
|
4131
4227
|
/**
|
|
4132
|
-
* Inject `branding.font_url` as `<link rel="stylesheet">`
|
|
4133
|
-
* `<
|
|
4228
|
+
* Inject `branding.font_url` as `<link rel="stylesheet">` into the host
|
|
4229
|
+
* document's `<head>`. Per `docs/design/branding/templates.md`:
|
|
4134
4230
|
*
|
|
4135
4231
|
* "The `font_url` stylesheet is injected by the orchestrator; the template
|
|
4136
4232
|
* does not emit the `<link>` tag itself."
|
|
4137
4233
|
*
|
|
4234
|
+
* The link must live at document level, not inside the shadow root:
|
|
4235
|
+
* browsers ignore `@font-face` rules declared in shadow-tree stylesheets,
|
|
4236
|
+
* so a shadow-scoped link would never register the font faces and every
|
|
4237
|
+
* branded font silently falls back to the system stack. `font-family`
|
|
4238
|
+
* references inside the shadow tree resolve against document-level faces.
|
|
4239
|
+
*
|
|
4138
4240
|
* Idempotent: calling with the same URL is a no-op; calling with a new URL
|
|
4139
4241
|
* replaces the previous link. Calling with `null`/`undefined` removes any
|
|
4140
4242
|
* previously injected link.
|
|
4141
4243
|
*/
|
|
4142
4244
|
const LINK_ID = "zl-font-link";
|
|
4143
4245
|
function applyFontUrl(shadowRoot, fontUrl) {
|
|
4144
|
-
const
|
|
4246
|
+
const ownerDocument = shadowRoot.ownerDocument ?? document;
|
|
4247
|
+
const existing = ownerDocument.head.querySelector(`link#${LINK_ID}`);
|
|
4145
4248
|
if (!fontUrl) {
|
|
4146
4249
|
existing?.remove();
|
|
4147
4250
|
return;
|
|
4148
4251
|
}
|
|
4149
|
-
|
|
4150
|
-
existing?.remove();
|
|
4151
|
-
const link = (shadowRoot.ownerDocument ?? document).createElement("link");
|
|
4252
|
+
const link = existing ?? ownerDocument.createElement("link");
|
|
4152
4253
|
link.id = LINK_ID;
|
|
4153
4254
|
link.rel = "stylesheet";
|
|
4154
|
-
link.href = fontUrl;
|
|
4155
|
-
|
|
4255
|
+
if (link.href !== fontUrl) link.href = fontUrl;
|
|
4256
|
+
if (!existing) ownerDocument.head.appendChild(link);
|
|
4156
4257
|
}
|
|
4157
4258
|
//#endregion
|
|
4158
4259
|
//#region src/internal/escape-html.ts
|
|
@@ -8677,7 +8778,7 @@ function lookup(locale, key) {
|
|
|
8677
8778
|
}
|
|
8678
8779
|
//#endregion
|
|
8679
8780
|
//#region src/orchestrator/templates/default.liquid
|
|
8680
|
-
var default_default = "<zl-page-shell data-zl-template-root>\n {% if branding.logo_url %}\n <img slot=\"header\" class=\"zl-card-logo\" src=\"{{ branding.logo_url }}\" alt=\"\" />\n {% endif %}\n <zl-card>\n <h1 slot=\"header\" class=\"zl-card-title\">{{ step.texts.title_key | t: identity.display_name }}</h1>\n {% if step.texts.description_key %}\n <p slot=\"header\" class=\"zl-card-subtitle\">{{
|
|
8781
|
+
var default_default = "<zl-page-shell data-zl-template-root>\n {% if branding.logo_url %}\n <img slot=\"header\" class=\"zl-card-logo\" src=\"{{ branding.logo_url }}\" alt=\"\" />\n {% endif %}\n <zl-card>\n <h1 slot=\"header\" class=\"zl-card-title\">{{ step.texts.title_key | t: identity.display_name }}</h1>\n {% if step.texts.description_key %}\n {% assign card_subtitle = step.texts.description_key | t: identity.display_name %}\n {% if card_subtitle != \"\" %}\n <p slot=\"header\" class=\"zl-card-subtitle\">{{ card_subtitle }}</p>\n {% endif %}\n {% endif %}\n\n {% if errors and errors.size > 0 %}\n {% for err in errors %}\n {% if err | formLevelError %}\n {% assign alert_heading = err.text_key | alertHeading %}\n {% assign alert_body = err.text_key | alertBody %}\n <zl-alert severity=\"error\"{% if alert_heading != \"\" %} heading=\"{{ alert_heading | t }}\"{% endif %}>\n {% if alert_body != \"\" %}{{ alert_body | t }}{% elsif err.text_key %}{{ err.text_key | t }}{% else %}{{ err.message }}{% endif %}\n </zl-alert>\n {% endif %}\n {% endfor %}\n {% endif %}\n\n {% for entry in fields %}\n {% assign field_placeholder = entry[1].text_key | fieldPlaceholder %}\n {% assign field_help = entry[1].text_key | fieldHelp %}\n {% assign field_err = entry[0] | fieldError: errors %}\n {% assign autocomplete_val = '' %}\n {% if entry[0] == 'email' %}\n {% assign autocomplete_val = 'email' %}\n {% elsif entry[1].type == 'password' and step.name contains 'register' %}\n {% assign autocomplete_val = 'new-password' %}\n {% elsif entry[1].type == 'password' %}\n {% assign autocomplete_val = 'current-password' %}\n {% endif %}\n <zl-field\n name=\"{{ entry[0] }}\"\n data-testid=\"zitadel-field-{{ entry[0] }}\"\n label=\"{{ entry[1].text_key | t }}\"\n type=\"{{ entry[1].type }}\"\n value=\"{{ entry[1].value }}\"\n {% if autocomplete_val != '' %}autocomplete=\"{{ autocomplete_val }}\"{% endif %}\n {% if entry[1].required %}required{% endif %}\n {% if field_placeholder != \"\" %}placeholder=\"{{ field_placeholder }}\"{% endif %}\n {% if field_err != \"\" %}invalid error=\"{{ field_err }}\"{% endif %}\n >\n {% if field_help != \"\" %}\n <span slot=\"help\">{{ field_help }}</span>\n {% endif %}\n </zl-field>\n {% endfor %}\n\n {% if actions.recover %}\n <p class=\"zl-card-forgot\">\n <a href=\"#\" class=\"zl-card-forgot__link\" data-action=\"recover\">{{ actions.recover.text_key | t }}</a>\n </p>\n {% endif %}\n\n {% for entry in actions %}\n {% if entry[1].primary %}\n <zl-button\n hierarchy=\"primary\"\n size=\"medium\"\n type=\"submit\"\n block\n action=\"{{ entry[0] }}\"\n data-testid=\"zitadel-action-{{ entry[0] }}\"\n label=\"{{ entry[1].text_key | t }}\"\n {% if loading %}loading{% endif %}\n ></zl-button>\n {% endif %}\n {% endfor %}\n\n {% for entry in actions %}\n {% unless entry[1].primary or entry[0] == 'passkey' or entry[0] == 'register' or entry[0] == 'sign_in' or entry[0] == 'recover' %}\n <zl-button\n hierarchy=\"secondary\"\n size=\"medium\"\n type=\"button\"\n block\n action=\"{{ entry[0] }}\"\n data-testid=\"zitadel-action-{{ entry[0] }}\"\n label=\"{{ entry[1].text_key | t }}\"\n ></zl-button>\n {% endunless %}\n {% endfor %}\n\n {% if actions.passkey %}\n <zl-button\n hierarchy=\"secondary\"\n size=\"medium\"\n block\n action=\"passkey\"\n data-testid=\"zitadel-action-passkey\"\n label=\"{{ actions.passkey.text_key | t }}\"\n ></zl-button>\n {% endif %}\n\n\n {% if actions.register %}\n <p class=\"zl-card-nav\">\n {{ 'identifier.action.register.lead' | t }}<a href=\"#\" class=\"zl-card-nav__link\" data-action=\"register\" data-testid=\"zitadel-action-register-link\">{{ 'identifier.action.register.link' | t }}</a>\n </p>\n {% endif %}\n\n {% if actions.sign_in %}\n <p class=\"zl-card-nav\">\n {{ 'register.action.sign_in.lead' | t }}<a href=\"#\" class=\"zl-card-nav__link\" data-action=\"sign_in\" data-testid=\"zitadel-action-sign_in-link\">{{ 'register.action.sign_in.link' | t }}</a>\n </p>\n {% endif %}\n\n {% if challenge %}\n {% if challenge.method == \"passkey\" or challenge.method == \"passkey_register\" %}\n {% assign ceremony = \"authenticate\" %}\n {% if challenge.method == \"passkey_register\" %}{% assign ceremony = \"register\" %}{% endif %}\n <zl-passkey\n ceremony=\"{{ ceremony }}\"\n method=\"{{ challenge.method }}\"\n challenge-id=\"{{ challenge.challenge_id }}\"\n options='{{ challenge.options | json }}'\n ></zl-passkey>\n {% endif %}\n {% endif %}\n\n {% mandatory_gates %}\n </zl-card>\n</zl-page-shell>\n";
|
|
8681
8782
|
//#endregion
|
|
8682
8783
|
//#region src/orchestrator/liquid.ts
|
|
8683
8784
|
/**
|
|
@@ -8822,8 +8923,9 @@ const en = {
|
|
|
8822
8923
|
"identifier.description": "Enter your email to continue",
|
|
8823
8924
|
"identifier.field.email": "Work email",
|
|
8824
8925
|
"identifier.field.email.placeholder": "you@company.com",
|
|
8825
|
-
"identifier.
|
|
8826
|
-
"identifier.action.
|
|
8926
|
+
"identifier.field.password": "Password",
|
|
8927
|
+
"identifier.action.submit": "Sign in",
|
|
8928
|
+
"identifier.action.continue": "Sign in",
|
|
8827
8929
|
"identifier.action.passkey": "Sign in with a passkey",
|
|
8828
8930
|
"identifier.action.register.lead": "Don't have an account? ",
|
|
8829
8931
|
"identifier.action.register.link": "Sign up",
|
|
@@ -8872,7 +8974,7 @@ const en = {
|
|
|
8872
8974
|
"password.action.register.lead": "Don't have an account? ",
|
|
8873
8975
|
"password.action.register.link": "Sign up",
|
|
8874
8976
|
"register.title": "Create your account",
|
|
8875
|
-
"register.description": "
|
|
8977
|
+
"register.description": "",
|
|
8876
8978
|
"register.field.email": "Work email",
|
|
8877
8979
|
"register.field.email.placeholder": "you@company.com",
|
|
8878
8980
|
"register.field.password": "Password",
|
|
@@ -8880,8 +8982,10 @@ const en = {
|
|
|
8880
8982
|
"register.field.givenName": "Given name",
|
|
8881
8983
|
"register.field.familyName": "Family name",
|
|
8882
8984
|
"register.field.dateOfBirth": "Date of birth",
|
|
8985
|
+
"register.field.dateOfBirth.placeholder": "YYYY-MM-DD",
|
|
8986
|
+
"register.field.dateOfBirth.help": "Use YYYY-MM-DD.",
|
|
8883
8987
|
"register.action.password": "Continue with password",
|
|
8884
|
-
"register.action.passkey": "
|
|
8988
|
+
"register.action.passkey": "Continue with a passkey",
|
|
8885
8989
|
"register.action.submit": "Sign up",
|
|
8886
8990
|
"register.action.sign_in.lead": "Already have an account? ",
|
|
8887
8991
|
"register.action.sign_in.link": "Sign in",
|
|
@@ -8920,8 +9024,9 @@ const de = {
|
|
|
8920
9024
|
"identifier.description": "Gib deine E-Mail-Adresse ein, um fortzufahren",
|
|
8921
9025
|
"identifier.field.email": "E-Mail",
|
|
8922
9026
|
"identifier.field.email.placeholder": "du@unternehmen.com",
|
|
8923
|
-
"identifier.
|
|
8924
|
-
"identifier.action.
|
|
9027
|
+
"identifier.field.password": "Passwort",
|
|
9028
|
+
"identifier.action.submit": "Anmelden",
|
|
9029
|
+
"identifier.action.continue": "Anmelden",
|
|
8925
9030
|
"identifier.action.passkey": "Mit Passkey anmelden",
|
|
8926
9031
|
"identifier.action.register.lead": "Noch kein Konto? ",
|
|
8927
9032
|
"identifier.action.register.link": "Registrieren",
|
|
@@ -8970,13 +9075,18 @@ const de = {
|
|
|
8970
9075
|
"password.action.register.lead": "Noch kein Konto? ",
|
|
8971
9076
|
"password.action.register.link": "Registrieren",
|
|
8972
9077
|
"register.title": "Konto erstellen",
|
|
8973
|
-
"register.description": "
|
|
9078
|
+
"register.description": "",
|
|
8974
9079
|
"register.field.email": "E-Mail",
|
|
8975
9080
|
"register.field.email.placeholder": "du@unternehmen.com",
|
|
8976
9081
|
"register.field.password": "Passwort",
|
|
8977
9082
|
"register.field.password.help": "Mindestens 8 Zeichen, einschließlich eines Sonderzeichens und einer Zahl.",
|
|
9083
|
+
"register.field.givenName": "Vorname",
|
|
9084
|
+
"register.field.familyName": "Nachname",
|
|
9085
|
+
"register.field.dateOfBirth": "Geburtsdatum",
|
|
9086
|
+
"register.field.dateOfBirth.placeholder": "JJJJ-MM-TT",
|
|
9087
|
+
"register.field.dateOfBirth.help": "Verwende JJJJ-MM-TT.",
|
|
8978
9088
|
"register.action.password": "Mit Passwort fortfahren",
|
|
8979
|
-
"register.action.passkey": "
|
|
9089
|
+
"register.action.passkey": "Weiter mit Passkey",
|
|
8980
9090
|
"register.action.submit": "Registrieren",
|
|
8981
9091
|
"register.action.sign_in.lead": "Bereits ein Konto? ",
|
|
8982
9092
|
"register.action.sign_in.link": "Anmelden",
|
|
@@ -9017,8 +9127,9 @@ const builtinLocales = {
|
|
|
9017
9127
|
"identifier.description": "Inserisci la tua e-mail per continuare",
|
|
9018
9128
|
"identifier.field.email": "E-mail aziendale",
|
|
9019
9129
|
"identifier.field.email.placeholder": "tu@azienda.com",
|
|
9020
|
-
"identifier.
|
|
9021
|
-
"identifier.action.
|
|
9130
|
+
"identifier.field.password": "Password",
|
|
9131
|
+
"identifier.action.submit": "Accedi",
|
|
9132
|
+
"identifier.action.continue": "Accedi",
|
|
9022
9133
|
"identifier.action.passkey": "Accedi con passkey",
|
|
9023
9134
|
"identifier.action.register.lead": "Non hai un account? ",
|
|
9024
9135
|
"identifier.action.register.link": "Registrati",
|
|
@@ -9067,13 +9178,18 @@ const builtinLocales = {
|
|
|
9067
9178
|
"password.action.register.lead": "Non hai un account? ",
|
|
9068
9179
|
"password.action.register.link": "Registrati",
|
|
9069
9180
|
"register.title": "Crea il tuo account",
|
|
9070
|
-
"register.description": "
|
|
9181
|
+
"register.description": "",
|
|
9071
9182
|
"register.field.email": "E-mail aziendale",
|
|
9072
9183
|
"register.field.email.placeholder": "tu@azienda.com",
|
|
9073
9184
|
"register.field.password": "Password",
|
|
9074
9185
|
"register.field.password.help": "Almeno 8 caratteri, incluso un simbolo e un numero.",
|
|
9186
|
+
"register.field.givenName": "Nome",
|
|
9187
|
+
"register.field.familyName": "Cognome",
|
|
9188
|
+
"register.field.dateOfBirth": "Data di nascita",
|
|
9189
|
+
"register.field.dateOfBirth.placeholder": "AAAA-MM-GG",
|
|
9190
|
+
"register.field.dateOfBirth.help": "Usa AAAA-MM-GG.",
|
|
9075
9191
|
"register.action.password": "Continua con password",
|
|
9076
|
-
"register.action.passkey": "
|
|
9192
|
+
"register.action.passkey": "Continua con passkey",
|
|
9077
9193
|
"register.action.submit": "Registrati",
|
|
9078
9194
|
"register.action.sign_in.lead": "Hai già un account? ",
|
|
9079
9195
|
"register.action.sign_in.link": "Accedi",
|
|
@@ -10898,6 +11014,7 @@ const COMMON_ATTRS = [
|
|
|
10898
11014
|
"style",
|
|
10899
11015
|
"name",
|
|
10900
11016
|
"for",
|
|
11017
|
+
"data-testid",
|
|
10901
11018
|
"data-theme",
|
|
10902
11019
|
"hidden"
|
|
10903
11020
|
];
|
|
@@ -11405,6 +11522,31 @@ let ZitadelLogin = class ZitadelLogin extends i$2 {
|
|
|
11405
11522
|
if (field.value !== next) field.value = next;
|
|
11406
11523
|
}
|
|
11407
11524
|
}
|
|
11525
|
+
captureValuesFromFields() {
|
|
11526
|
+
const root = this.shadowRoot;
|
|
11527
|
+
if (!root) return this.formValues;
|
|
11528
|
+
const fields = root.querySelectorAll("zl-field");
|
|
11529
|
+
if (fields.length === 0) return this.formValues;
|
|
11530
|
+
const next = { ...this.formValues };
|
|
11531
|
+
let changed = false;
|
|
11532
|
+
for (const field of fields) {
|
|
11533
|
+
const name = field.getAttribute("name");
|
|
11534
|
+
const value = this.currentFieldValue(field);
|
|
11535
|
+
if (!name || value === void 0) continue;
|
|
11536
|
+
if (field.value !== value) field.value = value;
|
|
11537
|
+
if (next[name] !== value) {
|
|
11538
|
+
next[name] = value;
|
|
11539
|
+
changed = true;
|
|
11540
|
+
}
|
|
11541
|
+
}
|
|
11542
|
+
if (changed) this.formValues = next;
|
|
11543
|
+
return next;
|
|
11544
|
+
}
|
|
11545
|
+
currentFieldValue(field) {
|
|
11546
|
+
const native = field.shadowRoot?.querySelector("input");
|
|
11547
|
+
if (native && native.value !== field.value) return native.value;
|
|
11548
|
+
return typeof field.value === "string" ? field.value : void 0;
|
|
11549
|
+
}
|
|
11408
11550
|
handleAtomInput = (event) => {
|
|
11409
11551
|
if (!event.detail) return;
|
|
11410
11552
|
const { name, value } = event.detail;
|
|
@@ -11413,11 +11555,23 @@ let ZitadelLogin = class ZitadelLogin extends i$2 {
|
|
|
11413
11555
|
...this.formValues,
|
|
11414
11556
|
[name]: value
|
|
11415
11557
|
};
|
|
11558
|
+
this.syncFieldElementValue(name, value);
|
|
11416
11559
|
emit(this, "zitadel-flow-input", {
|
|
11417
11560
|
name,
|
|
11418
11561
|
value
|
|
11419
11562
|
});
|
|
11420
11563
|
};
|
|
11564
|
+
syncFieldElementValue(name, value) {
|
|
11565
|
+
const root = this.shadowRoot;
|
|
11566
|
+
if (!root) return;
|
|
11567
|
+
const fields = root.querySelectorAll("zl-field");
|
|
11568
|
+
for (const field of fields) {
|
|
11569
|
+
if (field.getAttribute("name") !== name) continue;
|
|
11570
|
+
if (field.value !== value) field.value = value;
|
|
11571
|
+
const native = field.shadowRoot?.querySelector("input");
|
|
11572
|
+
if (native && native.value !== value) native.value = value;
|
|
11573
|
+
}
|
|
11574
|
+
}
|
|
11421
11575
|
handleAtomSubmit = (event) => {
|
|
11422
11576
|
if (this.loading) return;
|
|
11423
11577
|
this.submit(event.detail?.action ?? null);
|
|
@@ -11495,10 +11649,11 @@ let ZitadelLogin = class ZitadelLogin extends i$2 {
|
|
|
11495
11649
|
const { id, session_token } = this.response;
|
|
11496
11650
|
this.loading = true;
|
|
11497
11651
|
try {
|
|
11652
|
+
const formValues = this.captureValuesFromFields();
|
|
11498
11653
|
const stepFieldKeys = Object.keys(this.response.step.fields ?? {});
|
|
11499
11654
|
const fields = {};
|
|
11500
11655
|
for (const key of stepFieldKeys) {
|
|
11501
|
-
const value =
|
|
11656
|
+
const value = formValues[key];
|
|
11502
11657
|
if (value !== void 0) fields[key] = value;
|
|
11503
11658
|
}
|
|
11504
11659
|
const body = {
|