@saasbase-io/core-elements 2.0.0 → 2.0.1
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/renderers/provider/_provider-field.d.ts +7 -0
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +155 -145
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1571,23 +1571,23 @@ oe.elementStyles = [], oe.shadowRootOptions = { mode: "open" }, oe[Ee("elementPr
|
|
|
1571
1571
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
1572
1572
|
*/
|
|
1573
1573
|
const Ce = globalThis, Wr = (e) => e, Ue = Ce.trustedTypes, Zr = Ue ? Ue.createPolicy("lit-html", { createHTML: (e) => e }) : void 0, bi = "$lit$", Lt = `lit$${Math.random().toFixed(9).slice(2)}$`, mi = "?" + Lt, ts = `<${mi}>`, Wt = document, Se = () => Wt.createComment(""), Re = (e) => e === null || typeof e != "object" && typeof e != "function", Ar = Array.isArray, es = (e) => Ar(e) || typeof (e == null ? void 0 : e[Symbol.iterator]) == "function", ur = `[
|
|
1574
|
-
\f\r]`,
|
|
1575
|
-
\f\r"'\`<>=]|("|')|))|$)`, "g"), Jr = /'/g, Qr = /"/g, vi = /^(?:script|style|textarea|title)$/i,
|
|
1576
|
-
function
|
|
1574
|
+
\f\r]`, ye = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, Yr = /-->/g, Xr = />/g, Ht = RegExp(`>|${ur}(?:([^\\s"'>=/]+)(${ur}*=${ur}*(?:[^
|
|
1575
|
+
\f\r"'\`<>=]|("|')|))|$)`, "g"), Jr = /'/g, Qr = /"/g, vi = /^(?:script|style|textarea|title)$/i, _i = (e) => (t, ...r) => ({ _$litType$: e, strings: t, values: r }), c = _i(1), Qt = _i(2), Zt = Symbol.for("lit-noChange"), u = Symbol.for("lit-nothing"), ti = /* @__PURE__ */ new WeakMap(), Kt = Wt.createTreeWalker(Wt, 129);
|
|
1576
|
+
function yi(e, t) {
|
|
1577
1577
|
if (!Ar(e) || !e.hasOwnProperty("raw")) throw Error("invalid template strings array");
|
|
1578
1578
|
return Zr !== void 0 ? Zr.createHTML(t) : t;
|
|
1579
1579
|
}
|
|
1580
1580
|
const rs = (e, t) => {
|
|
1581
1581
|
const r = e.length - 1, s = [];
|
|
1582
|
-
let i, n = t === 2 ? "<svg>" : t === 3 ? "<math>" : "", o =
|
|
1582
|
+
let i, n = t === 2 ? "<svg>" : t === 3 ? "<math>" : "", o = ye;
|
|
1583
1583
|
for (let l = 0; l < r; l++) {
|
|
1584
1584
|
const d = e[l];
|
|
1585
1585
|
let h, p, g = -1, C = 0;
|
|
1586
|
-
for (; C < d.length && (o.lastIndex = C, p = o.exec(d), p !== null); ) C = o.lastIndex, o ===
|
|
1586
|
+
for (; C < d.length && (o.lastIndex = C, p = o.exec(d), p !== null); ) C = o.lastIndex, o === ye ? p[1] === "!--" ? o = Yr : p[1] !== void 0 ? o = Xr : p[2] !== void 0 ? (vi.test(p[2]) && (i = RegExp("</" + p[2], "g")), o = Ht) : p[3] !== void 0 && (o = Ht) : o === Ht ? p[0] === ">" ? (o = i ?? ye, g = -1) : p[1] === void 0 ? g = -2 : (g = o.lastIndex - p[2].length, h = p[1], o = p[3] === void 0 ? Ht : p[3] === '"' ? Qr : Jr) : o === Qr || o === Jr ? o = Ht : o === Yr || o === Xr ? o = ye : (o = Ht, i = void 0);
|
|
1587
1587
|
const x = o === Ht && e[l + 1].startsWith("/>") ? " " : "";
|
|
1588
|
-
n += o ===
|
|
1588
|
+
n += o === ye ? d + ts : g >= 0 ? (s.push(h), d.slice(0, g) + bi + d.slice(g) + Lt + x) : d + Lt + (g === -2 ? l : x);
|
|
1589
1589
|
}
|
|
1590
|
-
return [
|
|
1590
|
+
return [yi(e, n + (e[r] || "<?>") + (t === 2 ? "</svg>" : t === 3 ? "</math>" : "")), s];
|
|
1591
1591
|
};
|
|
1592
1592
|
class Ie {
|
|
1593
1593
|
constructor({ strings: t, _$litType$: r }, s) {
|
|
@@ -1694,7 +1694,7 @@ class Te {
|
|
|
1694
1694
|
}
|
|
1695
1695
|
$(t) {
|
|
1696
1696
|
var n;
|
|
1697
|
-
const { values: r, _$litType$: s } = t, i = typeof s == "number" ? this._$AC(t) : (s.el === void 0 && (s.el = Ie.createElement(
|
|
1697
|
+
const { values: r, _$litType$: s } = t, i = typeof s == "number" ? this._$AC(t) : (s.el === void 0 && (s.el = Ie.createElement(yi(s.h, s.h[0]), this.options)), s);
|
|
1698
1698
|
if (((n = this._$AH) == null ? void 0 : n._$AD) === i) this._$AH.p(r);
|
|
1699
1699
|
else {
|
|
1700
1700
|
const o = new is(i, this), l = o.u(this.options);
|
|
@@ -2210,7 +2210,7 @@ function te({ context: e, subscribe: t }) {
|
|
|
2210
2210
|
}));
|
|
2211
2211
|
};
|
|
2212
2212
|
}
|
|
2213
|
-
const wi = "sb:env", Ge = "sb:auth", ms = "customizations", Pr = Symbol("renderSpecContext"), vs = "sb-relative sb-overflow-hidden sb-w-1/3 sb-h-2 sb-linear-bar",
|
|
2213
|
+
const wi = "sb:env", Ge = "sb:auth", ms = "customizations", Pr = Symbol("renderSpecContext"), vs = "sb-relative sb-overflow-hidden sb-w-1/3 sb-h-2 sb-linear-bar", _s = "sb-min-w-[375px] sb-max-w-[609px] sb-w-[calc(100%-30px)] sm:sb-max-w-[735px] md:sb-w-[calc(100%-32px)] md:sb-max-w-[800px] lg:sb-min-w-[800px]", ys = "sb-h-[100%] sb-min-w-[375px] sb-max-w-[609px] sb-w-[calc(100vw-30px)] sm:sb-max-w-[735px] md:sb-w-[calc(100vw-32px)] md:sb-max-w-[800px] lg:sb-min-w-[800px]", $s = "sb-fixed sb-inset-0 sb-z-[9999] sb-flex sb-items-center sb-justify-center sb-p-4 sb-overflow-auto", ws = "sb-w-fit sb-flex sb-max-h-[calc(100vh-60px)] sb-bg-background sb-shadow-2xl sb-ring-1 sb-ring-border sb-rounded-xl sb-overflow-hidden", Es = "sb-justify-self-center sb-rotate-0", Cs = "sb-border-0 sb-bg-background !sb-m-0", Ss = "sb-border sb-rounded-2xl sb-relative sb-py-6", Rs = "!sb-text-left sb-text-foreground sb-font-normal hover:!sb-bg-muted !sb-text-sm sb-rounded-md !sb-shadow-none data-[state=active]:!sb-bg-muted", Is = "!sb-flex !sb-justify-start !sb-flex-nowrap !sb-w-full !rtg-grid-cols-2 !sb-gap-2 sb-mx-6", xs = "!sb-w-[160px] sb-gap-4 ";
|
|
2214
2214
|
var E = /* @__PURE__ */ ((e) => (e.USER_PROFILE_CARD_HEADER_CONTAINER = "sb-user-profile-card-header-container", e.USER_PROFILE_CONTAINER = "sb-user-profile", e.USER_PROFILE_SIDEBAR = "sb-user-profile-sidebar-tabs", e.USER_PROFILE_SIDEBAR_TABS = "sb-user-profile-sidebar-tabs", e.USER_PROFILE_SIDEBAR_BURGER_MENU = "sb-user-profile-sidebar-burger-menu", e.USER_PROFILE_INPUT_LABEL = "sb-user-profile-input-label", e.USER_PROFILE_INPUT_FIELD = "sb-user-profile-input-field", e.USER_PROFILE_EDIT_FORM = "sb-user-profile-edit-form", e.USER_PROFILE_CARD_CONTAINER = "sb-user-profile-card-container", e.USER_PROFILE_EDITABLE_INPUT_FIELD = "sb-user-profile-editable-input-field", e.USER_PROFILE_DEFAULT_BUTTON = "sb-user-profile-default-button", e.USER_PROFILE_OUTLINE_BUTTON = "sb-user-profile-outline-button", e.USER_PROFILE_OTP = "sb-user-profile-otp", e.USER_PROFILE_EDIT_BUTTON = "sb-user-profile-edit-button", e))(E || {});
|
|
2215
2215
|
function Ei(e) {
|
|
2216
2216
|
var t, r, s = "";
|
|
@@ -2454,7 +2454,7 @@ const D = (e) => {
|
|
|
2454
2454
|
// I could also use lookbehind assertion in `lengthUnitRegex` but that isn't supported widely enough.
|
|
2455
2455
|
Ks.test(e) && !Gs.test(e)
|
|
2456
2456
|
), xi = () => !1, nn = (e) => Ws.test(e), on = (e) => Zs.test(e), an = () => {
|
|
2457
|
-
const e = D("colors"), t = D("spacing"), r = D("blur"), s = D("brightness"), i = D("borderColor"), n = D("borderRadius"), o = D("borderSpacing"), l = D("borderWidth"), d = D("contrast"), h = D("grayscale"), p = D("hueRotate"), g = D("invert"), C = D("gap"), x = D("gradientColorStops"), A = D("gradientColorStopPositions"), L = D("inset"), N = D("margin"), k = D("opacity"), K = D("padding"), lt = D("saturate"), nt = D("scale"), gt = D("sepia"), vt = D("skew"), me = D("space"), ve = D("translate"), or = () => ["auto", "contain", "none"], ar = () => ["auto", "hidden", "clip", "visible", "scroll"], lr = () => ["auto", S, t], U = () => [S, t], zr = () => ["", xt, Tt], Ne = () => ["auto", de, S], Br = () => ["bottom", "center", "left", "left-bottom", "left-top", "right", "right-bottom", "right-top", "top"], Fe = () => ["solid", "dashed", "dotted", "double", "none"], jr = () => ["normal", "multiply", "screen", "overlay", "darken", "lighten", "color-dodge", "color-burn", "hard-light", "soft-light", "difference", "exclusion", "hue", "saturation", "color", "luminosity"], dr = () => ["start", "end", "center", "between", "around", "evenly", "stretch"],
|
|
2457
|
+
const e = D("colors"), t = D("spacing"), r = D("blur"), s = D("brightness"), i = D("borderColor"), n = D("borderRadius"), o = D("borderSpacing"), l = D("borderWidth"), d = D("contrast"), h = D("grayscale"), p = D("hueRotate"), g = D("invert"), C = D("gap"), x = D("gradientColorStops"), A = D("gradientColorStopPositions"), L = D("inset"), N = D("margin"), k = D("opacity"), K = D("padding"), lt = D("saturate"), nt = D("scale"), gt = D("sepia"), vt = D("skew"), me = D("space"), ve = D("translate"), or = () => ["auto", "contain", "none"], ar = () => ["auto", "hidden", "clip", "visible", "scroll"], lr = () => ["auto", S, t], U = () => [S, t], zr = () => ["", xt, Tt], Ne = () => ["auto", de, S], Br = () => ["bottom", "center", "left", "left-bottom", "left-top", "right", "right-bottom", "right-top", "top"], Fe = () => ["solid", "dashed", "dotted", "double", "none"], jr = () => ["normal", "multiply", "screen", "overlay", "darken", "lighten", "color-dodge", "color-burn", "hard-light", "soft-light", "difference", "exclusion", "hue", "saturation", "color", "luminosity"], dr = () => ["start", "end", "center", "between", "around", "evenly", "stretch"], _e = () => ["", "0", S], Vr = () => ["auto", "avoid", "all", "avoid-page", "page", "left", "right", "column"], It = () => [de, S];
|
|
2458
2458
|
return {
|
|
2459
2459
|
cacheSize: 500,
|
|
2460
2460
|
separator: ":",
|
|
@@ -2468,9 +2468,9 @@ const D = (e) => {
|
|
|
2468
2468
|
borderSpacing: U(),
|
|
2469
2469
|
borderWidth: zr(),
|
|
2470
2470
|
contrast: It(),
|
|
2471
|
-
grayscale:
|
|
2471
|
+
grayscale: _e(),
|
|
2472
2472
|
hueRotate: It(),
|
|
2473
|
-
invert:
|
|
2473
|
+
invert: _e(),
|
|
2474
2474
|
gap: U(),
|
|
2475
2475
|
gradientColorStops: [e],
|
|
2476
2476
|
gradientColorStopPositions: [Ys, Tt],
|
|
@@ -2480,7 +2480,7 @@ const D = (e) => {
|
|
|
2480
2480
|
padding: U(),
|
|
2481
2481
|
saturate: It(),
|
|
2482
2482
|
scale: It(),
|
|
2483
|
-
sepia:
|
|
2483
|
+
sepia: _e(),
|
|
2484
2484
|
skew: It(),
|
|
2485
2485
|
space: U(),
|
|
2486
2486
|
translate: U()
|
|
@@ -2735,14 +2735,14 @@ const D = (e) => {
|
|
|
2735
2735
|
* @see https://tailwindcss.com/docs/flex-grow
|
|
2736
2736
|
*/
|
|
2737
2737
|
grow: [{
|
|
2738
|
-
grow:
|
|
2738
|
+
grow: _e()
|
|
2739
2739
|
}],
|
|
2740
2740
|
/**
|
|
2741
2741
|
* Flex Shrink
|
|
2742
2742
|
* @see https://tailwindcss.com/docs/flex-shrink
|
|
2743
2743
|
*/
|
|
2744
2744
|
shrink: [{
|
|
2745
|
-
shrink:
|
|
2745
|
+
shrink: _e()
|
|
2746
2746
|
}],
|
|
2747
2747
|
/**
|
|
2748
2748
|
* Order
|
|
@@ -4515,7 +4515,7 @@ function Ai(e, t) {
|
|
|
4515
4515
|
}
|
|
4516
4516
|
return r;
|
|
4517
4517
|
}
|
|
4518
|
-
function
|
|
4518
|
+
function yt(e, t) {
|
|
4519
4519
|
var r, s, i, n, o, l, d, h, p, g, C, x;
|
|
4520
4520
|
return {
|
|
4521
4521
|
default: (s = (r = t.byType) == null ? void 0 : r.buttons) == null ? void 0 : s.defaultButton,
|
|
@@ -4637,8 +4637,8 @@ Pe([
|
|
|
4637
4637
|
he = Pe([
|
|
4638
4638
|
R("sb-provider")
|
|
4639
4639
|
], he);
|
|
4640
|
-
var vn = Object.defineProperty,
|
|
4641
|
-
for (var i = s > 1 ? void 0 : s ?
|
|
4640
|
+
var vn = Object.defineProperty, _n = Object.getOwnPropertyDescriptor, Oi = (e, t, r, s) => {
|
|
4641
|
+
for (var i = s > 1 ? void 0 : s ? _n(t, r) : t, n = e.length - 1, o; n >= 0; n--)
|
|
4642
4642
|
(o = e[n]) && (i = (s ? o(t, r, i) : o(i)) || i);
|
|
4643
4643
|
return s && i && vn(t, r, i), i;
|
|
4644
4644
|
};
|
|
@@ -4665,12 +4665,12 @@ Oi([
|
|
|
4665
4665
|
vr = Oi([
|
|
4666
4666
|
R("sb-signed-out")
|
|
4667
4667
|
], vr);
|
|
4668
|
-
var
|
|
4668
|
+
var yn = Object.defineProperty, $n = Object.getOwnPropertyDescriptor, Ti = (e, t, r, s) => {
|
|
4669
4669
|
for (var i = s > 1 ? void 0 : s ? $n(t, r) : t, n = e.length - 1, o; n >= 0; n--)
|
|
4670
4670
|
(o = e[n]) && (i = (s ? o(t, r, i) : o(i)) || i);
|
|
4671
|
-
return s && i &&
|
|
4671
|
+
return s && i && yn(t, r, i), i;
|
|
4672
4672
|
};
|
|
4673
|
-
let
|
|
4673
|
+
let _r = class extends O {
|
|
4674
4674
|
constructor() {
|
|
4675
4675
|
super(...arguments), this._cachedChildren = [];
|
|
4676
4676
|
}
|
|
@@ -4689,10 +4689,10 @@ let yr = class extends O {
|
|
|
4689
4689
|
Ti([
|
|
4690
4690
|
te({ context: Ge, subscribe: !0 }),
|
|
4691
4691
|
a({ attribute: !1 })
|
|
4692
|
-
],
|
|
4693
|
-
|
|
4692
|
+
], _r.prototype, "auth", 2);
|
|
4693
|
+
_r = Ti([
|
|
4694
4694
|
R("sb-signed-in")
|
|
4695
|
-
],
|
|
4695
|
+
], _r);
|
|
4696
4696
|
var wn = Object.defineProperty, En = Object.getOwnPropertyDescriptor, We = (e, t, r, s) => {
|
|
4697
4697
|
for (var i = s > 1 ? void 0 : s ? En(t, r) : t, n = e.length - 1, o; n >= 0; n--)
|
|
4698
4698
|
(o = e[n]) && (i = (s ? o(t, r, i) : o(i)) || i);
|
|
@@ -4727,7 +4727,7 @@ We([
|
|
|
4727
4727
|
xe = We([
|
|
4728
4728
|
R("sb-authenticated")
|
|
4729
4729
|
], xe);
|
|
4730
|
-
var Pi = /* @__PURE__ */ ((e) => (e.PROFILE = "Profile", e.SECURITY = "Security", e.APPEARANCE = "Appearance", e.NOTIFICATION = "Notification", e))(Pi || {}),
|
|
4730
|
+
var Pi = /* @__PURE__ */ ((e) => (e.PROFILE = "Profile", e.SECURITY = "Security", e.APPEARANCE = "Appearance", e.NOTIFICATION = "Notification", e))(Pi || {}), yr = /* @__PURE__ */ ((e) => (e.PROFILE = "Profile", e.SECURITY = "Security", e.APPEARANCE = "Appearance", e.NOTIFICATION = "Notification", e))(yr || {}), kt = /* @__PURE__ */ ((e) => (e.MODAL = "MODAL", e.PAGE = "PAGE", e))(kt || {}), bt = /* @__PURE__ */ ((e) => (e.BURGER = "BURGER", e.REGULAR = "REGULAR", e))(bt || {}), _t = /* @__PURE__ */ ((e) => (e.VERTICAL = "VERTICAL", e.HORIZONTAL = "HORIZONTAL", e))(_t || {}), ht = /* @__PURE__ */ ((e) => (e.COLUMN = "COLUMN", e.ROW = "ROW", e))(ht || {});
|
|
4731
4731
|
function Ae() {
|
|
4732
4732
|
return Qt`<svg
|
|
4733
4733
|
width="16"
|
|
@@ -4872,7 +4872,7 @@ let it = class extends O {
|
|
|
4872
4872
|
}
|
|
4873
4873
|
// Helpers to centralize customization mappings
|
|
4874
4874
|
getButtonStyles() {
|
|
4875
|
-
const e =
|
|
4875
|
+
const e = yt("default", this.customizations), t = yt("outline", this.customizations), r = T(
|
|
4876
4876
|
rr,
|
|
4877
4877
|
{},
|
|
4878
4878
|
e,
|
|
@@ -5263,7 +5263,7 @@ let Dt = class extends O {
|
|
|
5263
5263
|
return this;
|
|
5264
5264
|
}
|
|
5265
5265
|
getButtonStyles() {
|
|
5266
|
-
const e =
|
|
5266
|
+
const e = yt("default", this.customizations), t = yt("outline", this.customizations), r = yt("ghost", this.customizations), s = T(
|
|
5267
5267
|
rr,
|
|
5268
5268
|
{},
|
|
5269
5269
|
e,
|
|
@@ -5483,7 +5483,7 @@ let Mt = class extends O {
|
|
|
5483
5483
|
return this;
|
|
5484
5484
|
}
|
|
5485
5485
|
getButtonStyles() {
|
|
5486
|
-
const e =
|
|
5486
|
+
const e = yt("default", this.customizations), t = yt("outline", this.customizations), r = yt("ghost", this.customizations), s = T(
|
|
5487
5487
|
rr,
|
|
5488
5488
|
{},
|
|
5489
5489
|
e,
|
|
@@ -5698,7 +5698,7 @@ let Ut = class extends O {
|
|
|
5698
5698
|
return this;
|
|
5699
5699
|
}
|
|
5700
5700
|
getButtonStyles() {
|
|
5701
|
-
const e =
|
|
5701
|
+
const e = yt("default", this.customizations), t = yt("outline", this.customizations), r = yt("ghost", this.customizations), s = T(
|
|
5702
5702
|
rr,
|
|
5703
5703
|
{},
|
|
5704
5704
|
e,
|
|
@@ -5895,7 +5895,7 @@ var Un = Object.defineProperty, zn = Object.getOwnPropertyDescriptor, st = (e, t
|
|
|
5895
5895
|
};
|
|
5896
5896
|
let rt = class extends O {
|
|
5897
5897
|
constructor() {
|
|
5898
|
-
super(...arguments), this.showAvatarMenu = !1, this.customizations = null, this.showIcons = !0, this.orientation =
|
|
5898
|
+
super(...arguments), this.showAvatarMenu = !1, this.customizations = null, this.showIcons = !0, this.orientation = _t.HORIZONTAL, this.sidebarDisplayType = bt.REGULAR, this.mode = kt == null ? void 0 : kt.PAGE, this.widgetsLayout = ht.ROW, this.content = null;
|
|
5899
5899
|
}
|
|
5900
5900
|
createRenderRoot() {
|
|
5901
5901
|
return this;
|
|
@@ -5903,7 +5903,7 @@ let rt = class extends O {
|
|
|
5903
5903
|
render() {
|
|
5904
5904
|
var r, s, i, n;
|
|
5905
5905
|
return c`
|
|
5906
|
-
${this.orientation ===
|
|
5906
|
+
${this.orientation === _t.VERTICAL || this.sidebarDisplayType === bt.BURGER ? null : c`
|
|
5907
5907
|
<div class=${"sb-flex sb-items-center sb-justify-between sb-mb-4"}>
|
|
5908
5908
|
<div class=${"sb-font-medium sb-text-[18px] sb-text-foreground"}>Profile</div>
|
|
5909
5909
|
</div>
|
|
@@ -6000,12 +6000,12 @@ var Kn = Object.defineProperty, Gn = Object.getOwnPropertyDescriptor, se = (e, t
|
|
|
6000
6000
|
return s && i && Kn(t, r, i), i;
|
|
6001
6001
|
};
|
|
6002
6002
|
const br = [
|
|
6003
|
-
{ label: "Profile", value:
|
|
6004
|
-
{ label: "Security", value:
|
|
6003
|
+
{ label: "Profile", value: yr.PROFILE },
|
|
6004
|
+
{ label: "Security", value: yr.SECURITY }
|
|
6005
6005
|
];
|
|
6006
6006
|
let zt = class extends O {
|
|
6007
6007
|
constructor() {
|
|
6008
|
-
super(...arguments), this.orientation =
|
|
6008
|
+
super(...arguments), this.orientation = _t.HORIZONTAL, this.displayType = bt.REGULAR, this.mode = kt.PAGE, this.config = { showIcons: !0 }, this.customizations = null, this.isMenuOpen = !1;
|
|
6009
6009
|
}
|
|
6010
6010
|
createRenderRoot() {
|
|
6011
6011
|
return this;
|
|
@@ -6103,7 +6103,7 @@ let zt = class extends O {
|
|
|
6103
6103
|
}
|
|
6104
6104
|
render() {
|
|
6105
6105
|
var i, n, o;
|
|
6106
|
-
const e = this.orientation ===
|
|
6106
|
+
const e = this.orientation === _t.VERTICAL, t = this.orientation === _t.HORIZONTAL, { class: r, style: s } = T(
|
|
6107
6107
|
"",
|
|
6108
6108
|
{},
|
|
6109
6109
|
(o = (n = (i = this.customizations) == null ? void 0 : i.byType) == null ? void 0 : n.userProfile) == null ? void 0 : o.sidebar,
|
|
@@ -6163,7 +6163,7 @@ const li = {
|
|
|
6163
6163
|
};
|
|
6164
6164
|
class wt extends O {
|
|
6165
6165
|
constructor() {
|
|
6166
|
-
super(...arguments), this.showAvatarMenu = !1, this.orientation =
|
|
6166
|
+
super(...arguments), this.showAvatarMenu = !1, this.orientation = _t.HORIZONTAL, this.mobileDisplay = bt.REGULAR, this.mode = kt.PAGE, this.widgetsLayout = ht.ROW, this.content = null, this.customizations = null, this.providedCustomizations = null, this.isOpen = !0, this.currentBreakpoint = "md", this.account = {
|
|
6167
6167
|
email: "J.Doe@gmail.com",
|
|
6168
6168
|
phone: "+989390717800",
|
|
6169
6169
|
avatar: "https://github.com/shadcn.png"
|
|
@@ -6228,21 +6228,21 @@ class wt extends O {
|
|
|
6228
6228
|
return this.mode === kt.MODAL;
|
|
6229
6229
|
}
|
|
6230
6230
|
get sidebarDisplayType() {
|
|
6231
|
-
return this.orientation ===
|
|
6231
|
+
return this.orientation === _t.VERTICAL || this.currentBreakpoint === "md" ? bt.REGULAR : bt.BURGER;
|
|
6232
6232
|
}
|
|
6233
6233
|
get containerClasses() {
|
|
6234
6234
|
return V(
|
|
6235
6235
|
Es,
|
|
6236
6236
|
this.isModal ? Ss : Cs,
|
|
6237
|
-
this.isModal ?
|
|
6238
|
-
this.sidebarDisplayType === bt.BURGER || this.orientation ===
|
|
6237
|
+
this.isModal ? ys : _s,
|
|
6238
|
+
this.sidebarDisplayType === bt.BURGER || this.orientation === _t.VERTICAL ? "!sb-flex-col" : "!sb-flex-row"
|
|
6239
6239
|
);
|
|
6240
6240
|
}
|
|
6241
6241
|
get contentClasses() {
|
|
6242
6242
|
return V(
|
|
6243
6243
|
"sb-flex-grow",
|
|
6244
6244
|
this.isModal ? "sb-max-h-[864px] sb-mx-4 sb-px-2 md:sb-mx-0 md:sb-px-6 md:sb-pl-0 sb-overflow-auto" : "md:sb-max-h-[100%]",
|
|
6245
|
-
this.orientation ===
|
|
6245
|
+
this.orientation === _t.VERTICAL ? "md:sb-pl-6 sb-mb-16" : ""
|
|
6246
6246
|
);
|
|
6247
6247
|
}
|
|
6248
6248
|
// === Render Helpers ===
|
|
@@ -6262,7 +6262,7 @@ class wt extends O {
|
|
|
6262
6262
|
` : u;
|
|
6263
6263
|
}
|
|
6264
6264
|
renderWatermark() {
|
|
6265
|
-
return this.orientation !==
|
|
6265
|
+
return this.orientation !== _t.VERTICAL ? u : c`
|
|
6266
6266
|
<div
|
|
6267
6267
|
class="sb-fixed sb-bottom-0 sb-w-[-webkit-fill-available] sb-py-4 sb-bg-background"
|
|
6268
6268
|
>
|
|
@@ -7332,10 +7332,10 @@ M([
|
|
|
7332
7332
|
f = M([
|
|
7333
7333
|
R("sb-password-field")
|
|
7334
7334
|
], f);
|
|
7335
|
-
var
|
|
7336
|
-
for (var i = s > 1 ? void 0 : s ?
|
|
7335
|
+
var _o = Object.defineProperty, yo = Object.getOwnPropertyDescriptor, Z = (e, t, r, s) => {
|
|
7336
|
+
for (var i = s > 1 ? void 0 : s ? yo(t, r) : t, n = e.length - 1, o; n >= 0; n--)
|
|
7337
7337
|
(o = e[n]) && (i = (s ? o(t, r, i) : o(i)) || i);
|
|
7338
|
-
return s && i &&
|
|
7338
|
+
return s && i && _o(t, r, i), i;
|
|
7339
7339
|
};
|
|
7340
7340
|
let v = class extends O {
|
|
7341
7341
|
constructor() {
|
|
@@ -7676,16 +7676,16 @@ var $o = Object.defineProperty, wo = Object.getOwnPropertyDescriptor, Q = (e, t,
|
|
|
7676
7676
|
(o = e[n]) && (i = (s ? o(t, r, i) : o(i)) || i);
|
|
7677
7677
|
return s && i && $o(t, r, i), i;
|
|
7678
7678
|
};
|
|
7679
|
-
let
|
|
7679
|
+
let _ = class extends O {
|
|
7680
7680
|
constructor() {
|
|
7681
7681
|
super(...arguments), this.seed = ot(), this.name = "email", this.content = "split", this.label = "Email", this.validation = "default", this.requiredError = "Email is a required field.", this.formatError = "Enter a valid email address.", this._invalid = !1, this._error = "", this._value = "", this._form = null, this._handleInput = (e) => {
|
|
7682
7682
|
const t = e.target;
|
|
7683
|
-
t.matches(`[part="${
|
|
7683
|
+
t.matches(`[part="${_.parts.input}"]>input`) && (this._value = t.value);
|
|
7684
7684
|
}, this._handleFormSubmit = (e) => {
|
|
7685
7685
|
this._validate() || e.preventDefault();
|
|
7686
7686
|
}, this._handleFormReset = () => {
|
|
7687
7687
|
const e = this.querySelector(
|
|
7688
|
-
`rtg-input[part="${
|
|
7688
|
+
`rtg-input[part="${_.parts.input}"]`
|
|
7689
7689
|
);
|
|
7690
7690
|
e && (e.value = ""), this._value = "", this._invalid = !1, this._error = "";
|
|
7691
7691
|
};
|
|
@@ -7714,49 +7714,49 @@ let y = class extends O {
|
|
|
7714
7714
|
* derived from the component's part name and `seed`.
|
|
7715
7715
|
*/
|
|
7716
7716
|
get rootId() {
|
|
7717
|
-
return this.childId ?? `sb-${
|
|
7717
|
+
return this.childId ?? `sb-${_.parts.root}-${this.seed}`;
|
|
7718
7718
|
}
|
|
7719
7719
|
/**
|
|
7720
7720
|
* The `id` of the field content element, derived from `rootId` with the
|
|
7721
7721
|
* content part name appended.
|
|
7722
7722
|
*/
|
|
7723
7723
|
get contentId() {
|
|
7724
|
-
return `${this.rootId}-${
|
|
7724
|
+
return `${this.rootId}-${_._CONTENT}`;
|
|
7725
7725
|
}
|
|
7726
7726
|
/**
|
|
7727
7727
|
* The `id` of the field label element, derived from `rootId` with the label
|
|
7728
7728
|
* part name appended.
|
|
7729
7729
|
*/
|
|
7730
7730
|
get labelId() {
|
|
7731
|
-
return `${this.rootId}-${
|
|
7731
|
+
return `${this.rootId}-${_._LABEL}`;
|
|
7732
7732
|
}
|
|
7733
7733
|
/**
|
|
7734
7734
|
* The `id` of the field description element, derived from `rootId` with the
|
|
7735
7735
|
* description part name appended.
|
|
7736
7736
|
*/
|
|
7737
7737
|
get descriptionId() {
|
|
7738
|
-
return `${this.rootId}-${
|
|
7738
|
+
return `${this.rootId}-${_._DESCRIPTION}`;
|
|
7739
7739
|
}
|
|
7740
7740
|
/**
|
|
7741
7741
|
* The `id` of the mark element, derived from `rootId` with the mark part name
|
|
7742
7742
|
* appended.
|
|
7743
7743
|
*/
|
|
7744
7744
|
get markId() {
|
|
7745
|
-
return `${this.rootId}-${
|
|
7745
|
+
return `${this.rootId}-${_._MARK}`;
|
|
7746
7746
|
}
|
|
7747
7747
|
/**
|
|
7748
7748
|
* The `id` of the input element, equal to `fieldId` when provided, otherwise
|
|
7749
7749
|
* derived from `rootId` with the input part name appended.
|
|
7750
7750
|
*/
|
|
7751
7751
|
get inputId() {
|
|
7752
|
-
return this.fieldId ?? `${this.rootId}-${
|
|
7752
|
+
return this.fieldId ?? `${this.rootId}-${_._INPUT}`;
|
|
7753
7753
|
}
|
|
7754
7754
|
/**
|
|
7755
7755
|
* The `id` of the field error element, derived from `rootId` with the error
|
|
7756
7756
|
* part name appended.
|
|
7757
7757
|
*/
|
|
7758
7758
|
get errorId() {
|
|
7759
|
-
return `${this.rootId}-${
|
|
7759
|
+
return `${this.rootId}-${_._ERROR}`;
|
|
7760
7760
|
}
|
|
7761
7761
|
/**
|
|
7762
7762
|
* Returns a the normalized value of `_value` by trimming whitespace and
|
|
@@ -7790,7 +7790,7 @@ let y = class extends O {
|
|
|
7790
7790
|
* Defines and dispatches the validate event.
|
|
7791
7791
|
*/
|
|
7792
7792
|
_dispatchValidate(e, t, r, s) {
|
|
7793
|
-
const i = this.inputId, n = this.rootId, o = this.name, l = new CustomEvent(
|
|
7793
|
+
const i = this.inputId, n = this.rootId, o = this.name, l = new CustomEvent(_.validateEventName, {
|
|
7794
7794
|
detail: { id: i, parentId: n, name: o, value: r, valid: e, type: t, message: s },
|
|
7795
7795
|
bubbles: !0,
|
|
7796
7796
|
composed: !0
|
|
@@ -7815,7 +7815,7 @@ let y = class extends O {
|
|
|
7815
7815
|
*/
|
|
7816
7816
|
_validate() {
|
|
7817
7817
|
const e = this._normalizedValue;
|
|
7818
|
-
return this.required && !e ? (this._handleValidateError("required", e, this.requiredError), !1) : !e || this.validation === "simple" ? (this._handleValidateSuccess(e), !0) :
|
|
7818
|
+
return this.required && !e ? (this._handleValidateError("required", e, this.requiredError), !1) : !e || this.validation === "simple" ? (this._handleValidateSuccess(e), !0) : _._PATTERN.test(e) ? (this._handleValidateSuccess(e), !0) : (this._handleValidateError("format", e, this.formatError), !1);
|
|
7819
7819
|
}
|
|
7820
7820
|
/**
|
|
7821
7821
|
* Conditionally returns the mark template for the field label. When `caret`
|
|
@@ -7828,7 +7828,7 @@ let y = class extends O {
|
|
|
7828
7828
|
return !this.mark && (!this.caret || !this.required) ? u : c`
|
|
7829
7829
|
<span
|
|
7830
7830
|
id="${this.markId}"
|
|
7831
|
-
part="${
|
|
7831
|
+
part="${_.parts.mark}"
|
|
7832
7832
|
data-content="${this.mark ? "text" : "caret"}"
|
|
7833
7833
|
>
|
|
7834
7834
|
${this.mark ? this.mark : c`*`}
|
|
@@ -7842,7 +7842,7 @@ let y = class extends O {
|
|
|
7842
7842
|
return c`
|
|
7843
7843
|
<rtg-field-label
|
|
7844
7844
|
id="${this.labelId}"
|
|
7845
|
-
part="${
|
|
7845
|
+
part="${_.parts.label}"
|
|
7846
7846
|
for="${this.inputId}"
|
|
7847
7847
|
>
|
|
7848
7848
|
${this.label} ${this._renderMark()}
|
|
@@ -7856,7 +7856,7 @@ let y = class extends O {
|
|
|
7856
7856
|
return this.description ? c`
|
|
7857
7857
|
<rtg-field-description
|
|
7858
7858
|
id="${this.descriptionId}"
|
|
7859
|
-
part="${
|
|
7859
|
+
part="${_.parts.description}"
|
|
7860
7860
|
>
|
|
7861
7861
|
${this.description}
|
|
7862
7862
|
</rtg-field-description>
|
|
@@ -7870,7 +7870,7 @@ let y = class extends O {
|
|
|
7870
7870
|
return this._invalid ? c`
|
|
7871
7871
|
<rtg-field-error
|
|
7872
7872
|
id="${this.errorId}"
|
|
7873
|
-
part="${
|
|
7873
|
+
part="${_.parts.error}"
|
|
7874
7874
|
.errors=${[{ message: this._error }]}
|
|
7875
7875
|
></rtg-field-error>
|
|
7876
7876
|
` : u;
|
|
@@ -7879,7 +7879,7 @@ let y = class extends O {
|
|
|
7879
7879
|
return c`
|
|
7880
7880
|
<rtg-field
|
|
7881
7881
|
id="${this.rootId}"
|
|
7882
|
-
part="${
|
|
7882
|
+
part="${_.parts.root}"
|
|
7883
7883
|
data-content="${this.content}"
|
|
7884
7884
|
?disabled="${this.disabled}"
|
|
7885
7885
|
?invalid="${this._invalid}"
|
|
@@ -7887,7 +7887,7 @@ let y = class extends O {
|
|
|
7887
7887
|
${this.content === "group" ? c`
|
|
7888
7888
|
<rtg-field-content
|
|
7889
7889
|
id="${this.contentId}"
|
|
7890
|
-
part="${
|
|
7890
|
+
part="${_.parts.content}"
|
|
7891
7891
|
>
|
|
7892
7892
|
${this._renderLabel()} ${this._renderDescription()}
|
|
7893
7893
|
</rtg-field-content>
|
|
@@ -7895,7 +7895,7 @@ let y = class extends O {
|
|
|
7895
7895
|
|
|
7896
7896
|
<rtg-input
|
|
7897
7897
|
id="${this.inputId}"
|
|
7898
|
-
part="${
|
|
7898
|
+
part="${_.parts.input}"
|
|
7899
7899
|
type="email"
|
|
7900
7900
|
name="${this.name}"
|
|
7901
7901
|
placeholder="${this.placeholder ?? u}"
|
|
@@ -7910,72 +7910,72 @@ let y = class extends O {
|
|
|
7910
7910
|
`;
|
|
7911
7911
|
}
|
|
7912
7912
|
};
|
|
7913
|
-
|
|
7914
|
-
|
|
7915
|
-
|
|
7916
|
-
|
|
7917
|
-
|
|
7918
|
-
|
|
7919
|
-
|
|
7920
|
-
|
|
7921
|
-
|
|
7913
|
+
_._ROOT = "email-field";
|
|
7914
|
+
_._CONTENT = "content";
|
|
7915
|
+
_._LABEL = "label";
|
|
7916
|
+
_._MARK = "mark";
|
|
7917
|
+
_._DESCRIPTION = "description";
|
|
7918
|
+
_._INPUT = "input";
|
|
7919
|
+
_._ERROR = "error";
|
|
7920
|
+
_.TAG = `sb-${_._ROOT}`;
|
|
7921
|
+
_._PATTERN = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
|
7922
7922
|
Q([
|
|
7923
7923
|
a({ type: String })
|
|
7924
|
-
],
|
|
7924
|
+
], _.prototype, "seed", 2);
|
|
7925
7925
|
Q([
|
|
7926
7926
|
a({ attribute: "child-id", type: String })
|
|
7927
|
-
],
|
|
7927
|
+
], _.prototype, "childId", 2);
|
|
7928
7928
|
Q([
|
|
7929
7929
|
a({ attribute: "field-id", type: String })
|
|
7930
|
-
],
|
|
7930
|
+
], _.prototype, "fieldId", 2);
|
|
7931
7931
|
Q([
|
|
7932
7932
|
a({ type: String })
|
|
7933
|
-
],
|
|
7933
|
+
], _.prototype, "name", 2);
|
|
7934
7934
|
Q([
|
|
7935
7935
|
a({ type: String })
|
|
7936
|
-
],
|
|
7936
|
+
], _.prototype, "content", 2);
|
|
7937
7937
|
Q([
|
|
7938
7938
|
a({ type: String })
|
|
7939
|
-
],
|
|
7939
|
+
], _.prototype, "label", 2);
|
|
7940
7940
|
Q([
|
|
7941
7941
|
a({ type: String })
|
|
7942
|
-
],
|
|
7942
|
+
], _.prototype, "placeholder", 2);
|
|
7943
7943
|
Q([
|
|
7944
7944
|
a({ type: String })
|
|
7945
|
-
],
|
|
7945
|
+
], _.prototype, "description", 2);
|
|
7946
7946
|
Q([
|
|
7947
7947
|
a({ type: String })
|
|
7948
|
-
],
|
|
7948
|
+
], _.prototype, "mark", 2);
|
|
7949
7949
|
Q([
|
|
7950
7950
|
a({ type: Boolean })
|
|
7951
|
-
],
|
|
7951
|
+
], _.prototype, "caret", 2);
|
|
7952
7952
|
Q([
|
|
7953
7953
|
a({ type: Boolean })
|
|
7954
|
-
],
|
|
7954
|
+
], _.prototype, "disabled", 2);
|
|
7955
7955
|
Q([
|
|
7956
7956
|
a({ type: Boolean })
|
|
7957
|
-
],
|
|
7957
|
+
], _.prototype, "required", 2);
|
|
7958
7958
|
Q([
|
|
7959
7959
|
a({ type: String })
|
|
7960
|
-
],
|
|
7960
|
+
], _.prototype, "validation", 2);
|
|
7961
7961
|
Q([
|
|
7962
7962
|
a({ attribute: "required-error", type: String })
|
|
7963
|
-
],
|
|
7963
|
+
], _.prototype, "requiredError", 2);
|
|
7964
7964
|
Q([
|
|
7965
7965
|
a({ attribute: "format-error", type: String })
|
|
7966
|
-
],
|
|
7966
|
+
], _.prototype, "formatError", 2);
|
|
7967
7967
|
Q([
|
|
7968
7968
|
I()
|
|
7969
|
-
],
|
|
7969
|
+
], _.prototype, "_invalid", 2);
|
|
7970
7970
|
Q([
|
|
7971
7971
|
I()
|
|
7972
|
-
],
|
|
7972
|
+
], _.prototype, "_error", 2);
|
|
7973
7973
|
Q([
|
|
7974
7974
|
I()
|
|
7975
|
-
],
|
|
7976
|
-
|
|
7975
|
+
], _.prototype, "_value", 2);
|
|
7976
|
+
_ = Q([
|
|
7977
7977
|
R("sb-email-field")
|
|
7978
|
-
],
|
|
7978
|
+
], _);
|
|
7979
7979
|
var Eo = Object.defineProperty, Co = Object.getOwnPropertyDescriptor, Y = (e, t, r, s) => {
|
|
7980
7980
|
for (var i = s > 1 ? void 0 : s ? Co(t, r) : t, n = e.length - 1, o; n >= 0; n--)
|
|
7981
7981
|
(o = e[n]) && (i = (s ? o(t, r, i) : o(i)) || i);
|
|
@@ -8665,16 +8665,16 @@ var Io = Object.defineProperty, xo = Object.getOwnPropertyDescriptor, tt = (e, t
|
|
|
8665
8665
|
(o = e[n]) && (i = (s ? o(t, r, i) : o(i)) || i);
|
|
8666
8666
|
return s && i && Io(t, r, i), i;
|
|
8667
8667
|
};
|
|
8668
|
-
let
|
|
8668
|
+
let y = class extends O {
|
|
8669
8669
|
constructor() {
|
|
8670
8670
|
super(...arguments), this.seed = ot(), this.name = "phone", this.content = "split", this.label = "Phone", this.validation = "default", this.requiredError = "Phone is a required field.", this.formatError = "Enter a valid phone number.", this._invalid = !1, this._error = "", this._value = "", this._form = null, this._handleInput = (e) => {
|
|
8671
8671
|
const t = e.target;
|
|
8672
|
-
t.matches(`[part="${
|
|
8672
|
+
t.matches(`[part="${y.parts.input}"]>input`) && (this._value = t.value);
|
|
8673
8673
|
}, this._handleFormSubmit = (e) => {
|
|
8674
8674
|
this._validate() || e.preventDefault();
|
|
8675
8675
|
}, this._handleFormReset = () => {
|
|
8676
8676
|
const e = this.querySelector(
|
|
8677
|
-
`rtg-input[part="${
|
|
8677
|
+
`rtg-input[part="${y.parts.input}"]`
|
|
8678
8678
|
);
|
|
8679
8679
|
e && (e.value = ""), this._value = "", this._invalid = !1, this._error = "";
|
|
8680
8680
|
};
|
|
@@ -8703,49 +8703,49 @@ let _ = class extends O {
|
|
|
8703
8703
|
* derived from the component's part name and `seed`.
|
|
8704
8704
|
*/
|
|
8705
8705
|
get rootId() {
|
|
8706
|
-
return this.childId ?? `sb-${
|
|
8706
|
+
return this.childId ?? `sb-${y.parts.root}-${this.seed}`;
|
|
8707
8707
|
}
|
|
8708
8708
|
/**
|
|
8709
8709
|
* The `id` of the field content element, derived from `rootId` with the
|
|
8710
8710
|
* content part name appended.
|
|
8711
8711
|
*/
|
|
8712
8712
|
get contentId() {
|
|
8713
|
-
return `${this.rootId}-${
|
|
8713
|
+
return `${this.rootId}-${y._CONTENT}`;
|
|
8714
8714
|
}
|
|
8715
8715
|
/**
|
|
8716
8716
|
* The `id` of the field label element, derived from `rootId` with the label
|
|
8717
8717
|
* part name appended.
|
|
8718
8718
|
*/
|
|
8719
8719
|
get labelId() {
|
|
8720
|
-
return `${this.rootId}-${
|
|
8720
|
+
return `${this.rootId}-${y._LABEL}`;
|
|
8721
8721
|
}
|
|
8722
8722
|
/**
|
|
8723
8723
|
* The `id` of the field description element, derived from `rootId` with the
|
|
8724
8724
|
* description part name appended.
|
|
8725
8725
|
*/
|
|
8726
8726
|
get descriptionId() {
|
|
8727
|
-
return `${this.rootId}-${
|
|
8727
|
+
return `${this.rootId}-${y._DESCRIPTION}`;
|
|
8728
8728
|
}
|
|
8729
8729
|
/**
|
|
8730
8730
|
* The `id` of the mark element, derived from `rootId` with the mark part name
|
|
8731
8731
|
* appended.
|
|
8732
8732
|
*/
|
|
8733
8733
|
get markId() {
|
|
8734
|
-
return `${this.rootId}-${
|
|
8734
|
+
return `${this.rootId}-${y._MARK}`;
|
|
8735
8735
|
}
|
|
8736
8736
|
/**
|
|
8737
8737
|
* The `id` of the input element, equal to `fieldId` when provided, otherwise
|
|
8738
8738
|
* derived from `rootId` with the input part name appended.
|
|
8739
8739
|
*/
|
|
8740
8740
|
get inputId() {
|
|
8741
|
-
return this.fieldId ?? `${this.rootId}-${
|
|
8741
|
+
return this.fieldId ?? `${this.rootId}-${y._INPUT}`;
|
|
8742
8742
|
}
|
|
8743
8743
|
/**
|
|
8744
8744
|
* The `id` of the field error element, derived from `rootId` with the error
|
|
8745
8745
|
* part name appended.
|
|
8746
8746
|
*/
|
|
8747
8747
|
get errorId() {
|
|
8748
|
-
return `${this.rootId}-${
|
|
8748
|
+
return `${this.rootId}-${y._ERROR}`;
|
|
8749
8749
|
}
|
|
8750
8750
|
/**
|
|
8751
8751
|
* Returns the normalized value of `_value` by stripping all whitespace.
|
|
@@ -8778,7 +8778,7 @@ let _ = class extends O {
|
|
|
8778
8778
|
* Defines and dispatches the validate event.
|
|
8779
8779
|
*/
|
|
8780
8780
|
_dispatchValidate(e, t, r, s) {
|
|
8781
|
-
const i = this.inputId, n = this.rootId, o = this.name, l = new CustomEvent(
|
|
8781
|
+
const i = this.inputId, n = this.rootId, o = this.name, l = new CustomEvent(y.validateEventName, {
|
|
8782
8782
|
detail: { id: i, parentId: n, name: o, value: r, valid: e, type: t, message: s },
|
|
8783
8783
|
bubbles: !0,
|
|
8784
8784
|
composed: !0
|
|
@@ -8803,7 +8803,7 @@ let _ = class extends O {
|
|
|
8803
8803
|
*/
|
|
8804
8804
|
_validate() {
|
|
8805
8805
|
const e = this._normalizedValue;
|
|
8806
|
-
return this.required && !e ? (this._handleValidateError("required", e, this.requiredError), !1) : !e || this.validation === "simple" ? (this._handleValidateSuccess(e), !0) :
|
|
8806
|
+
return this.required && !e ? (this._handleValidateError("required", e, this.requiredError), !1) : !e || this.validation === "simple" ? (this._handleValidateSuccess(e), !0) : y._PATTERN.test(e) ? (this._handleValidateSuccess(e), !0) : (this._handleValidateError("format", e, this.formatError), !1);
|
|
8807
8807
|
}
|
|
8808
8808
|
/**
|
|
8809
8809
|
* Conditionally returns the mark template for the field label. When `caret`
|
|
@@ -8816,7 +8816,7 @@ let _ = class extends O {
|
|
|
8816
8816
|
return !this.mark && (!this.caret || !this.required) ? u : c`
|
|
8817
8817
|
<span
|
|
8818
8818
|
id="${this.markId}"
|
|
8819
|
-
part="${
|
|
8819
|
+
part="${y.parts.mark}"
|
|
8820
8820
|
data-content="${this.mark ? "text" : "caret"}"
|
|
8821
8821
|
>
|
|
8822
8822
|
${this.mark ? this.mark : c`*`}
|
|
@@ -8830,7 +8830,7 @@ let _ = class extends O {
|
|
|
8830
8830
|
return c`
|
|
8831
8831
|
<rtg-field-label
|
|
8832
8832
|
id="${this.labelId}"
|
|
8833
|
-
part="${
|
|
8833
|
+
part="${y.parts.label}"
|
|
8834
8834
|
for="${this.inputId}"
|
|
8835
8835
|
>
|
|
8836
8836
|
${this.label} ${this._renderMark()}
|
|
@@ -8844,7 +8844,7 @@ let _ = class extends O {
|
|
|
8844
8844
|
return this.description ? c`
|
|
8845
8845
|
<rtg-field-description
|
|
8846
8846
|
id="${this.descriptionId}"
|
|
8847
|
-
part="${
|
|
8847
|
+
part="${y.parts.description}"
|
|
8848
8848
|
>
|
|
8849
8849
|
${this.description}
|
|
8850
8850
|
</rtg-field-description>
|
|
@@ -8858,7 +8858,7 @@ let _ = class extends O {
|
|
|
8858
8858
|
return this._invalid ? c`
|
|
8859
8859
|
<rtg-field-error
|
|
8860
8860
|
id="${this.errorId}"
|
|
8861
|
-
part="${
|
|
8861
|
+
part="${y.parts.error}"
|
|
8862
8862
|
.errors=${[{ message: this._error }]}
|
|
8863
8863
|
></rtg-field-error>
|
|
8864
8864
|
` : u;
|
|
@@ -8867,7 +8867,7 @@ let _ = class extends O {
|
|
|
8867
8867
|
return c`
|
|
8868
8868
|
<rtg-field
|
|
8869
8869
|
id="${this.rootId}"
|
|
8870
|
-
part="${
|
|
8870
|
+
part="${y.parts.root}"
|
|
8871
8871
|
data-content="${this.content}"
|
|
8872
8872
|
?disabled="${this.disabled}"
|
|
8873
8873
|
?invalid="${this._invalid}"
|
|
@@ -8875,7 +8875,7 @@ let _ = class extends O {
|
|
|
8875
8875
|
${this.content === "group" ? c`
|
|
8876
8876
|
<rtg-field-content
|
|
8877
8877
|
id="${this.contentId}"
|
|
8878
|
-
part="${
|
|
8878
|
+
part="${y.parts.content}"
|
|
8879
8879
|
>
|
|
8880
8880
|
${this._renderLabel()} ${this._renderDescription()}
|
|
8881
8881
|
</rtg-field-content>
|
|
@@ -8883,7 +8883,7 @@ let _ = class extends O {
|
|
|
8883
8883
|
|
|
8884
8884
|
<rtg-input
|
|
8885
8885
|
id="${this.inputId}"
|
|
8886
|
-
part="${
|
|
8886
|
+
part="${y.parts.input}"
|
|
8887
8887
|
type="tel"
|
|
8888
8888
|
name="${this.name}"
|
|
8889
8889
|
placeholder="${this.placeholder ?? u}"
|
|
@@ -8898,72 +8898,72 @@ let _ = class extends O {
|
|
|
8898
8898
|
`;
|
|
8899
8899
|
}
|
|
8900
8900
|
};
|
|
8901
|
-
|
|
8902
|
-
|
|
8903
|
-
|
|
8904
|
-
|
|
8905
|
-
|
|
8906
|
-
|
|
8907
|
-
|
|
8908
|
-
|
|
8909
|
-
|
|
8901
|
+
y._ROOT = "phone-field";
|
|
8902
|
+
y._CONTENT = "content";
|
|
8903
|
+
y._LABEL = "label";
|
|
8904
|
+
y._MARK = "mark";
|
|
8905
|
+
y._DESCRIPTION = "description";
|
|
8906
|
+
y._INPUT = "input";
|
|
8907
|
+
y._ERROR = "error";
|
|
8908
|
+
y.TAG = `sb-${y._ROOT}`;
|
|
8909
|
+
y._PATTERN = /^\+?(\d[\d-.() ]+)?(\([\d-.() ]+\))?[\d-.() ]+\d$/;
|
|
8910
8910
|
tt([
|
|
8911
8911
|
a({ type: String })
|
|
8912
|
-
],
|
|
8912
|
+
], y.prototype, "seed", 2);
|
|
8913
8913
|
tt([
|
|
8914
8914
|
a({ attribute: "child-id", type: String })
|
|
8915
|
-
],
|
|
8915
|
+
], y.prototype, "childId", 2);
|
|
8916
8916
|
tt([
|
|
8917
8917
|
a({ attribute: "field-id", type: String })
|
|
8918
|
-
],
|
|
8918
|
+
], y.prototype, "fieldId", 2);
|
|
8919
8919
|
tt([
|
|
8920
8920
|
a({ type: String })
|
|
8921
|
-
],
|
|
8921
|
+
], y.prototype, "name", 2);
|
|
8922
8922
|
tt([
|
|
8923
8923
|
a({ type: String })
|
|
8924
|
-
],
|
|
8924
|
+
], y.prototype, "content", 2);
|
|
8925
8925
|
tt([
|
|
8926
8926
|
a({ type: String })
|
|
8927
|
-
],
|
|
8927
|
+
], y.prototype, "label", 2);
|
|
8928
8928
|
tt([
|
|
8929
8929
|
a({ type: String })
|
|
8930
|
-
],
|
|
8930
|
+
], y.prototype, "placeholder", 2);
|
|
8931
8931
|
tt([
|
|
8932
8932
|
a({ type: String })
|
|
8933
|
-
],
|
|
8933
|
+
], y.prototype, "description", 2);
|
|
8934
8934
|
tt([
|
|
8935
8935
|
a({ type: String })
|
|
8936
|
-
],
|
|
8936
|
+
], y.prototype, "mark", 2);
|
|
8937
8937
|
tt([
|
|
8938
8938
|
a({ type: Boolean })
|
|
8939
|
-
],
|
|
8939
|
+
], y.prototype, "caret", 2);
|
|
8940
8940
|
tt([
|
|
8941
8941
|
a({ type: Boolean })
|
|
8942
|
-
],
|
|
8942
|
+
], y.prototype, "disabled", 2);
|
|
8943
8943
|
tt([
|
|
8944
8944
|
a({ type: Boolean })
|
|
8945
|
-
],
|
|
8945
|
+
], y.prototype, "required", 2);
|
|
8946
8946
|
tt([
|
|
8947
8947
|
a({ type: String })
|
|
8948
|
-
],
|
|
8948
|
+
], y.prototype, "validation", 2);
|
|
8949
8949
|
tt([
|
|
8950
8950
|
a({ attribute: "required-error", type: String })
|
|
8951
|
-
],
|
|
8951
|
+
], y.prototype, "requiredError", 2);
|
|
8952
8952
|
tt([
|
|
8953
8953
|
a({ attribute: "format-error", type: String })
|
|
8954
|
-
],
|
|
8954
|
+
], y.prototype, "formatError", 2);
|
|
8955
8955
|
tt([
|
|
8956
8956
|
I()
|
|
8957
|
-
],
|
|
8957
|
+
], y.prototype, "_invalid", 2);
|
|
8958
8958
|
tt([
|
|
8959
8959
|
I()
|
|
8960
|
-
],
|
|
8960
|
+
], y.prototype, "_error", 2);
|
|
8961
8961
|
tt([
|
|
8962
8962
|
I()
|
|
8963
|
-
],
|
|
8964
|
-
|
|
8963
|
+
], y.prototype, "_value", 2);
|
|
8964
|
+
y = tt([
|
|
8965
8965
|
R("sb-phone-field")
|
|
8966
|
-
],
|
|
8966
|
+
], y);
|
|
8967
8967
|
var Ao = Object.defineProperty, Oo = Object.getOwnPropertyDescriptor, j = (e, t, r, s) => {
|
|
8968
8968
|
for (var i = s > 1 ? void 0 : s ? Oo(t, r) : t, n = e.length - 1, o; n >= 0; n--)
|
|
8969
8969
|
(o = e[n]) && (i = (s ? o(t, r, i) : o(i)) || i);
|
|
@@ -9455,8 +9455,8 @@ z = Et([
|
|
|
9455
9455
|
R("sb-form-submit")
|
|
9456
9456
|
], z);
|
|
9457
9457
|
const ki = [
|
|
9458
|
-
y,
|
|
9459
9458
|
_,
|
|
9459
|
+
y,
|
|
9460
9460
|
m,
|
|
9461
9461
|
$,
|
|
9462
9462
|
b,
|
|
@@ -10248,6 +10248,15 @@ let W = class extends O {
|
|
|
10248
10248
|
const e = this._providers.length;
|
|
10249
10249
|
return e < 3 ? "one" : e % 3 === 0 ? "three" : e === 5 ? "two-three" : e === 7 ? "three-four" : "four";
|
|
10250
10250
|
}
|
|
10251
|
+
/**
|
|
10252
|
+
* Returns the correct event for a provider:
|
|
10253
|
+
* 1. Override event (if provided)
|
|
10254
|
+
* 2. Global event prop
|
|
10255
|
+
* 3. Fallback: `signin_with_oauth(${provider})`
|
|
10256
|
+
*/
|
|
10257
|
+
_getEventForProvider(e, t) {
|
|
10258
|
+
return t || (this.event ? this.event : `signin_with_oauth(${e})`);
|
|
10259
|
+
}
|
|
10251
10260
|
/**
|
|
10252
10261
|
* The `providers` array without any duplicates.
|
|
10253
10262
|
*/
|
|
@@ -10269,6 +10278,7 @@ let W = class extends O {
|
|
|
10269
10278
|
* given, otherwise the general prop given to this field component.
|
|
10270
10279
|
*/
|
|
10271
10280
|
_renderButton(e) {
|
|
10281
|
+
const t = this._getEventForProvider(e.provider, e.event);
|
|
10272
10282
|
return c`
|
|
10273
10283
|
<sb-provider-button
|
|
10274
10284
|
id="${this.buttonId}"
|
|
@@ -10284,7 +10294,7 @@ let W = class extends O {
|
|
|
10284
10294
|
label="${e.label ?? this.label ?? u}"
|
|
10285
10295
|
?disabled="${e.disabled || this.disabled}"
|
|
10286
10296
|
?loading="${e.loading || this.loading}"
|
|
10287
|
-
event="${
|
|
10297
|
+
event="${t}"
|
|
10288
10298
|
></sb-provider-button>
|
|
10289
10299
|
`;
|
|
10290
10300
|
}
|
|
@@ -11044,7 +11054,7 @@ export {
|
|
|
11044
11054
|
v as SbConfirmField,
|
|
11045
11055
|
Xt as SbContainer,
|
|
11046
11056
|
Jt as SbCountdown,
|
|
11047
|
-
|
|
11057
|
+
_ as SbEmailField,
|
|
11048
11058
|
J as SbError,
|
|
11049
11059
|
G as SbForm,
|
|
11050
11060
|
Bt as SbFormSeparator,
|
|
@@ -11061,7 +11071,7 @@ export {
|
|
|
11061
11071
|
H as SbPasskeyButton,
|
|
11062
11072
|
f as SbPasswordField,
|
|
11063
11073
|
Dt as SbPersonalInfo,
|
|
11064
|
-
|
|
11074
|
+
y as SbPhoneField,
|
|
11065
11075
|
he as SbProvider,
|
|
11066
11076
|
q as SbProviderButton,
|
|
11067
11077
|
W as SbProviderField,
|
|
@@ -11074,7 +11084,7 @@ export {
|
|
|
11074
11084
|
wt as SbUserProfile,
|
|
11075
11085
|
m as SbUsernameField,
|
|
11076
11086
|
ct as SbWatermark,
|
|
11077
|
-
|
|
11087
|
+
_r as SignedIn,
|
|
11078
11088
|
vr as SignedOut,
|
|
11079
11089
|
Ia as useAuthProvider
|
|
11080
11090
|
};
|