@levo-so/studio 0.3.8 → 0.3.10
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/{BillingStep-vBBLXLzk.js → BillingStep-CvRmZGdq.js} +1 -1
- package/{Button-BZDul09m.js → Button-Dza3e6Mv.js} +1 -1
- package/{EntryCard-DLPs2PaP.js → EntryCard-BpcaCqXU.js} +1 -1
- package/{KBChatWidget-B-SNBtoX.js → KBChatWidget-ChIYlltB.js} +389 -382
- package/{LoginCard-EtzpuqYB.js → LoginCard-B_anBE4b.js} +1 -1
- package/{PendingApprovalCard-CCbhY8p3.js → PendingApprovalCard-DbYp0nSk.js} +1 -1
- package/{PopupBody-DZVwDLkg-PiECxgmc.js → PopupBody-BI-MJqmd-BrzdFaaE.js} +47 -44
- package/{PopupRenderer-BjW1jg70-C1UDgSfJ.js → PopupRenderer-D66Gx63H-GHfJebm6.js} +140 -139
- package/{ProfileCard-DzEBPrax.js → ProfileCard-DmAnVf5R.js} +1 -1
- package/{bookingCard-kEYdGZJ-.js → bookingCard-CLhIpOpR.js} +2 -2
- package/collection.js +1 -1
- package/{dist-2bXx8eVI.js → dist-D5mTOitS.js} +74 -57
- package/index.d.ts +14 -0
- package/index.js +2557 -2244
- package/{kbChat-zJcrfsqJ.js → kbChat-BLHDnA-T.js} +15 -15
- package/package.json +41 -41
- package/pillChrome-wmdnlFIE.js +50 -0
- package/studio.css +1 -1
- package/{usePopupRedirect-BThP_YPW-jXtfhYu6.js → usePopupRedirect-CAAdcpaW-DdME0F7f.js} +14 -12
- package/pillChrome-CYoMtUAv.js +0 -30
|
@@ -172,30 +172,22 @@ var Me = Object.defineProperty, Ne = (e, t) => {
|
|
|
172
172
|
n?.field_interface === W.RecordWidget && n?.fields?.length && (t[n.key] = Qe(n.fields));
|
|
173
173
|
}
|
|
174
174
|
return t;
|
|
175
|
-
}, $e = (e) => {
|
|
175
|
+
}, $e = (e) => e === void 0 ? null : e, et = (e) => {
|
|
176
176
|
if (!e?.sections) return {};
|
|
177
177
|
let t = {};
|
|
178
|
-
for (let n of e.sections)
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
let n = {};
|
|
186
|
-
for (let r of e.sections) {
|
|
187
|
-
let e = Qe(r.fields ?? []);
|
|
188
|
-
for (let i of r.fields) {
|
|
189
|
-
let r = et(t?.[i?.key]);
|
|
190
|
-
if (Array.isArray(r) && r?.length > 0 && Array.isArray(i?.values) && i?.values?.length > 0 && !i?.options?.custom_input) {
|
|
191
|
-
let e = Ze(i?.values);
|
|
192
|
-
r = r?.filter((t) => e.includes(t));
|
|
178
|
+
for (let n of e.sections) {
|
|
179
|
+
let e = Qe(n.fields ?? []);
|
|
180
|
+
for (let r of n.fields ?? []) {
|
|
181
|
+
let n = $e(r?.default_value);
|
|
182
|
+
if (n != null && tt(r)) {
|
|
183
|
+
let e = Ze(r?.values);
|
|
184
|
+
Array.isArray(n) ? n = n.filter((t) => e.includes(t)) : typeof n == "string" && !e.includes(n) && (n = null);
|
|
193
185
|
}
|
|
194
|
-
|
|
186
|
+
t[r.key] = n ?? e[r.key];
|
|
195
187
|
}
|
|
196
188
|
}
|
|
197
|
-
return
|
|
198
|
-
}, nt = (e, t, n) => {
|
|
189
|
+
return t;
|
|
190
|
+
}, tt = (e) => Array.isArray(e?.values) && e?.values?.length > 0 && !e?.options?.custom_input, nt = (e, t, n) => {
|
|
199
191
|
let r = n !== void 0;
|
|
200
192
|
if (!t) return {};
|
|
201
193
|
let i = (t?.sections ?? []).flatMap((n) => {
|
|
@@ -206,8 +198,8 @@ var Me = Object.defineProperty, Ne = (e, t) => {
|
|
|
206
198
|
}));
|
|
207
199
|
}), a = {};
|
|
208
200
|
for (let { field: o, sectionHidden: s } of i) {
|
|
209
|
-
let i = r && (s || qe(t, o, e))
|
|
210
|
-
o.field_interface === "CollectionWidget" ?
|
|
201
|
+
let i = r && (s || qe(t, o, e)) ? n[o.key] : e?.[o.key];
|
|
202
|
+
o.field_interface === "CollectionWidget" ? i && typeof i == "object" ? a[o.key] = Array.isArray(i) ? i.map((e) => e && typeof e == "object" ? e._id : e).filter(Boolean) : i._id : typeof i == "string" && i ? a[o.key] = i : a[o.key] = Qe([o])[o.key] : a[o.key] = i;
|
|
211
203
|
}
|
|
212
204
|
return a;
|
|
213
205
|
}, rt = (e) => e.every((e) => {
|
|
@@ -647,76 +639,101 @@ var Me = Object.defineProperty, Ne = (e, t) => {
|
|
|
647
639
|
})]
|
|
648
640
|
});
|
|
649
641
|
}, $t = ({ field: e }) => {
|
|
650
|
-
let { collection: t } = A(), [
|
|
651
|
-
name:
|
|
642
|
+
let { collection: t, logger: n } = A(), [r, i] = B(!1), { key: a = "", label: o = "", helper_text: s = "", readonly: u = !1 } = e, d = a, f = e?.options?.collection_key || "", p = e?.options?.label_field_key || "", { field: { value: m, onBlur: h, onChange: g, ref: _, disabled: v, ...y }, fieldState: b } = Q({
|
|
643
|
+
name: d,
|
|
652
644
|
rules: c(e)
|
|
653
|
-
}),
|
|
654
|
-
|
|
645
|
+
}), { setValue: x } = oe(), S = !!e?.required, C = b?.error?.message, w = z(null);
|
|
646
|
+
L(() => {
|
|
647
|
+
typeof m != "string" || !m || w.current !== m && (w.current = m, i(!0), t?.getCollectionContentList({
|
|
648
|
+
collection_key: f,
|
|
649
|
+
where: { _id: m },
|
|
650
|
+
limit: 1
|
|
651
|
+
}).then((e) => {
|
|
652
|
+
let t = e?.content?.data?.[0];
|
|
653
|
+
t && x(d, {
|
|
654
|
+
_id: t._id,
|
|
655
|
+
slug: t.slug,
|
|
656
|
+
[p]: t[p]
|
|
657
|
+
}, { shouldDirty: !1 });
|
|
658
|
+
}).catch((e) => {
|
|
659
|
+
n?.error("Failed to resolve collection default value", e);
|
|
660
|
+
}).finally(() => {
|
|
661
|
+
i(!1);
|
|
662
|
+
}));
|
|
663
|
+
}, [
|
|
664
|
+
m,
|
|
665
|
+
t,
|
|
666
|
+
f,
|
|
667
|
+
p,
|
|
668
|
+
d
|
|
669
|
+
]);
|
|
670
|
+
let T = async (e, n, { page: r = 1 }) => {
|
|
671
|
+
i(!0);
|
|
655
672
|
try {
|
|
656
673
|
let n = (await t?.getCollectionContentList({
|
|
657
|
-
collection_key:
|
|
658
|
-
page:
|
|
674
|
+
collection_key: f,
|
|
675
|
+
page: r,
|
|
659
676
|
search: e,
|
|
660
677
|
limit: 10,
|
|
661
678
|
where: Yt
|
|
662
|
-
}))?.content?.data,
|
|
663
|
-
let t = e?.[
|
|
679
|
+
}))?.content?.data, i = (n || []).map((e) => {
|
|
680
|
+
let t = e?.[p] ? e?.[p] : Xt(e?.slug || "");
|
|
664
681
|
return {
|
|
665
682
|
value: {
|
|
666
683
|
_id: e?._id,
|
|
667
684
|
slug: e?.slug,
|
|
668
|
-
[
|
|
685
|
+
[p]: e?.[p]
|
|
669
686
|
},
|
|
670
687
|
label: t
|
|
671
688
|
};
|
|
672
689
|
});
|
|
673
690
|
return {
|
|
674
|
-
options: Array.isArray(
|
|
691
|
+
options: Array.isArray(i) ? i : [],
|
|
675
692
|
hasMore: n && !(n?.length < 10),
|
|
676
|
-
additional: { page:
|
|
693
|
+
additional: { page: r + 1 }
|
|
677
694
|
};
|
|
678
695
|
} catch {
|
|
679
696
|
return {
|
|
680
697
|
options: [],
|
|
681
698
|
hasMore: !1,
|
|
682
|
-
additional: { page:
|
|
699
|
+
additional: { page: r }
|
|
683
700
|
};
|
|
684
701
|
} finally {
|
|
685
|
-
|
|
702
|
+
i(!1);
|
|
686
703
|
}
|
|
687
704
|
};
|
|
688
705
|
return /* @__PURE__ */ H(l, {
|
|
689
|
-
ref:
|
|
690
|
-
error:
|
|
691
|
-
helperText:
|
|
692
|
-
readOnly:
|
|
693
|
-
label:
|
|
694
|
-
htmlFor:
|
|
695
|
-
isRequired:
|
|
706
|
+
ref: _,
|
|
707
|
+
error: C,
|
|
708
|
+
helperText: s,
|
|
709
|
+
readOnly: u,
|
|
710
|
+
label: o,
|
|
711
|
+
htmlFor: d,
|
|
712
|
+
isRequired: S,
|
|
696
713
|
children: /* @__PURE__ */ H(Jt, {
|
|
697
|
-
id:
|
|
698
|
-
value:
|
|
699
|
-
label:
|
|
714
|
+
id: d,
|
|
715
|
+
value: m && typeof m == "object" ? {
|
|
716
|
+
label: m?.[p] ? m?.[p] : m?.slug ? Xt(m?.slug || "") : "",
|
|
700
717
|
value: {
|
|
701
|
-
_id:
|
|
702
|
-
slug:
|
|
703
|
-
[
|
|
718
|
+
_id: m?._id,
|
|
719
|
+
slug: m?.slug,
|
|
720
|
+
[p]: m?.[p]
|
|
704
721
|
}
|
|
705
722
|
} : null,
|
|
706
723
|
onChange: (e) => {
|
|
707
|
-
|
|
724
|
+
g(e?.value || null);
|
|
708
725
|
},
|
|
709
|
-
onBlur: () =>
|
|
710
|
-
loadOptions:
|
|
726
|
+
onBlur: () => h(),
|
|
727
|
+
loadOptions: T,
|
|
711
728
|
debounceTimeout: 500,
|
|
712
729
|
getOptionLabel: (e) => e?.label,
|
|
713
730
|
getOptionValue: (e) => e?.value?._id || e?.value?.slug,
|
|
714
|
-
isLoading:
|
|
731
|
+
isLoading: r,
|
|
715
732
|
additional: { page: 1 },
|
|
716
|
-
cacheUniqs: [
|
|
733
|
+
cacheUniqs: [f],
|
|
717
734
|
minMenuHeight: 250,
|
|
718
|
-
isDisabled:
|
|
719
|
-
...
|
|
735
|
+
isDisabled: v,
|
|
736
|
+
...y
|
|
720
737
|
})
|
|
721
738
|
});
|
|
722
739
|
}, en = (e) => {
|
|
@@ -2220,7 +2237,7 @@ var Br = ((e) => (t) => t ? zr(e, t) : e)({
|
|
|
2220
2237
|
L(() => {
|
|
2221
2238
|
if (f) {
|
|
2222
2239
|
let e = {
|
|
2223
|
-
|
|
2240
|
+
...a ? et(a) : {},
|
|
2224
2241
|
...r
|
|
2225
2242
|
};
|
|
2226
2243
|
p.reset(e);
|
|
@@ -2330,7 +2347,7 @@ var Br = ((e) => (t) => t ? zr(e, t) : e)({
|
|
|
2330
2347
|
}
|
|
2331
2348
|
}
|
|
2332
2349
|
} catch {}
|
|
2333
|
-
let t =
|
|
2350
|
+
let t = o ? et(o) : {}, n = {};
|
|
2334
2351
|
h && o && (o.email_field && h.email && (n[o.email_field] = h.email), o.mobile_field && h.mobile && (n[o.mobile_field] = h.mobile));
|
|
2335
2352
|
let r = {
|
|
2336
2353
|
...m || {},
|
|
@@ -3654,4 +3671,4 @@ var Na = ({ hiddenFields: e, fetchedSchema: t, isLoading: n, enableVerification:
|
|
|
3654
3671
|
useLevoFormContext: () => ti
|
|
3655
3672
|
});
|
|
3656
3673
|
//#endregion
|
|
3657
|
-
export { si as a, Qr as c, Aa as i,
|
|
3674
|
+
export { si as a, Qr as c, Aa as i, et as l, Na as n, ei as o, ja as r, ti as s, Pa as t };
|
package/index.d.ts
CHANGED
|
@@ -733,6 +733,20 @@ initialValues?: Record<string, any>;
|
|
|
733
733
|
theme?: ILevoFormContext["theme"];
|
|
734
734
|
}>;
|
|
735
735
|
|
|
736
|
+
/**
|
|
737
|
+
* Replaces variable tokens in a string with values from a flat context map.
|
|
738
|
+
*
|
|
739
|
+
* Supports both legacy `{path}` syntax and pipe-syntax transforms
|
|
740
|
+
* (`{path | default:"X" | upper | …}`). See `variableExpression.ts`.
|
|
741
|
+
*
|
|
742
|
+
* Backward-compat: a token with no transforms whose value is missing/null
|
|
743
|
+
* is left as a literal `{path}` — matches the prior behavior.
|
|
744
|
+
*
|
|
745
|
+
* @example format("Hello {name}", { name: "World" }) => "Hello World"
|
|
746
|
+
* @example format("Hi {name | upper | default:\"there\"}", { name: null }) => "Hi there"
|
|
747
|
+
*/
|
|
748
|
+
export declare const format: (template: string, values: Record<string, unknown>) => string;
|
|
749
|
+
|
|
736
750
|
export declare const FormInput: React_2.ForwardRefExoticComponent<IInputProps & React_2.RefAttributes<HTMLInputElement>>;
|
|
737
751
|
|
|
738
752
|
export declare const FormTextarea: React_2.ForwardRefExoticComponent<ITextareaProps & React_2.RefAttributes<HTMLTextAreaElement>>;
|