@feedmepos/mf-connect 0.0.12-beta.5 → 0.0.13-prod
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/Analytic-DMbCeTaO.js +612 -0
- package/dist/{Broadcast-BFHQPSXL.js → Broadcast-bVaOzrys.js} +7 -7
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-B1DYJDOy.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-Cd2midth.js} +8 -8
- package/dist/{Card-rOJ8yJg_.js → Card-CdCTfDuP.js} +127 -127
- package/dist/{Collections-BT8ihCOa.js → Collections-CQIHkJ4W.js} +129 -141
- package/dist/{Credit-D83Jsn7v.js → Credit-DuIm1c4_.js} +7 -7
- package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang--L-LP0DV.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-DljWmOEP.js} +258 -242
- package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-HLzZirO_.js → EffectSheet.vue_vue_type_style_index_0_lang-BuJL01zR.js} +6 -6
- package/dist/{Experience-C6uBhQod.js → Experience-DEnMLbsA.js} +7 -7
- package/dist/{Game-5P5HWqAL.js → Game-BYS0nrH6.js} +7 -7
- package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-DTDcpMpW.js → ImageInput.vue_vue_type_script_setup_true_lang-DW2tVaY0.js} +1 -1
- package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-CQIJ54m1.js → MainLayout-BkFJubzZ.js} +53 -20
- package/dist/{Marketing-ONuItJ_B.js → Marketing-Da0HTlaz.js} +25 -25
- package/dist/{Member-SB2IySXY.js → Member-CVe_bRGx.js} +2 -2
- package/dist/MemberList-DpUy4gFd.js +1718 -0
- package/dist/{MemberTransactions-DPQ6M7eR.js → MemberTransactions-DWdTDUIJ.js} +2 -2
- package/dist/MessageInput.vue_vue_type_script_setup_true_lang-1KjmvWsp.js +203 -0
- package/dist/{Mission-rdnU6erJ.js → Mission-0eSMWCls.js} +7 -7
- package/dist/{Point-C2M66ORj.js → Point-ju1eHI9Z.js} +7 -7
- package/dist/{Promotion-DixbjmMJ.js → Promotion-DZjWvnQa.js} +8 -8
- package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-CJsIBnGp.js → RuleGroup.vue_vue_type_script_setup_true_lang-CDPvpj10.js} +14 -14
- package/dist/{Segment-j_zQSV7O.js → Segment-Da_kMLWC.js} +18 -19
- package/dist/{Setting-ClhkF-bT.js → Setting-CxX35f3G.js} +541 -571
- package/dist/Store-DjUI3S8V.js +1442 -0
- package/dist/{StoreRewards-Bh90Ml4z.js → StoreRewards-92k0Bvp_.js} +74 -75
- package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-DlbNMiw9.js → StoreTransactions.vue_vue_type_script_setup_true_lang-Bsrz-oMi.js} +79 -82
- package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-DNkJ-pFL.js +124 -0
- package/dist/{Tier-vxsDt3Kj.js → Tier-2J4GN90t.js} +68 -71
- package/dist/{Title-IFyz9vfW.js → Title-B3Dw3w_5.js} +75 -78
- package/dist/{Transaction-ETa-y_H9.js → Transaction-Dz6WT5Hb.js} +1 -1
- package/dist/{Voucher-BMYcuaPn.js → Voucher-Bf3oSOKc.js} +37 -37
- package/dist/ZodTextField.vue_vue_type_script_setup_true_lang-3LlSDiq0.js +140 -0
- package/dist/{app-Bl9KwQq5.js → app-BSmDH0M7.js} +46 -46
- package/dist/{app-BqWTxQI-.js → app-C7I-jK_l.js} +1 -1
- package/dist/app.js +1 -1
- package/dist/{campaign-DI8CmTo2.js → campaign-CmvlWUoI.js} +11 -13
- package/dist/{collection.fn-CTEuol1r.js → collection.fn-DHlfGYAC.js} +2 -4
- package/dist/{dto-Bdlgo-8k.js → dto-rs6D-mtj.js} +239 -239
- package/dist/{effect-BdgYZfgW.js → effect-D8eQcTDU.js} +1 -1
- package/dist/{export-Dr_7YvBE.js → export-Bf2h8rMP.js} +3 -3
- package/dist/{helper-BygQ4tND.js → helper-BSlBLPdy.js} +1 -1
- package/dist/{index-CstgquVp.js → index-B64Y4rdW.js} +2 -2
- package/dist/{index-Djv3w5gV.js → index-BVSAl8E2.js} +37 -46
- package/dist/{index-DzQwND7p.js → index-CdMMIVsr.js} +217 -232
- package/dist/index-CuW8ePVX.js +244 -0
- package/dist/{index-DPYzF8No.js → index-D0nFU6ln.js} +1 -1
- package/dist/{index-Cv0dYoWA.js → index-fFL3EyTx.js} +68 -105
- package/dist/{index-Dhl0c4JQ.js → index-jqxAE4Rp.js} +1 -1
- package/dist/{index-BPdhkx4l.js → index-sIR31szI.js} +1 -1
- package/dist/{index-BtG8YOzi.js → index-wIa5WSXJ.js} +27 -28
- package/dist/{index-CpxxO2-G.js → index-x9e-DyDf.js} +1 -1
- package/dist/{loading-DlPkAkzK.js → loading-BxJj39Hj.js} +3156 -3156
- package/dist/{lodash-Cjf6EG_s.js → lodash-CrYvSLZb.js} +1 -1
- package/dist/{membership-B4-9J74r.js → membership-DKQL_Qp9.js} +73 -84
- package/dist/{money-il542E4J.js → money-B1P0wtzb.js} +1 -1
- package/dist/{number-WhKft9Yv.js → number-Bc1eguaq.js} +3 -3
- package/dist/{rule-XS2i1LKt.js → rule-BblG87FW.js} +2 -2
- package/dist/{rule-builder-CdK4IIT9.js → rule-builder-BQdKD4Gy.js} +1 -1
- package/dist/style.css +1 -1
- package/dist/{template-owB8rrou.js → template-o2RQUsfw.js} +6 -6
- package/dist/{usePagination-CxpwPyMW.js → usePagination-BaqNzQhm.js} +1 -1
- package/dist/{xlsx-CbJTFamj.js → xlsx-DqRMXFBK.js} +309 -309
- package/package.json +1 -1
- package/dist/Analytic-CCtweUZA.js +0 -757
- package/dist/MainLayout-CWfQ53Qr.js +0 -41
- package/dist/MemberList-C2X8fM7F.js +0 -1729
- package/dist/MessageInput.vue_vue_type_script_setup_true_lang-CE03Mh2P.js +0 -432
- package/dist/Store-CaWIsSZ3.js +0 -1506
- package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-DkpguWBa.js +0 -136
- package/dist/ZodTextField.vue_vue_type_script_setup_true_lang-CWt4tVdk.js +0 -55
- package/dist/index-_8VUWoAN.js +0 -245
- package/dist/zod-W_PvIofQ.js +0 -90
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent as _, ref as d, resolveComponent as c, openBlock as o, createElementBlock as v, Fragment as f, createVNode as s, createElementVNode as b, unref as t, createBlock as a, KeepAlive as k, resolveDynamicComponent as m, createCommentVNode as x } from "vue";
|
|
2
|
-
import { _ as C, a as F } from "./StoreTransactions.vue_vue_type_script_setup_true_lang-
|
|
2
|
+
import { _ as C, a as F } from "./StoreTransactions.vue_vue_type_script_setup_true_lang-Bsrz-oMi.js";
|
|
3
3
|
const T = { class: "px-24 flex flex-col gap-y-32 pb-24" }, N = /* @__PURE__ */ _({
|
|
4
4
|
__name: "Transaction",
|
|
5
5
|
setup(g) {
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import { defineComponent as X, ref as y, watch as N, onMounted as J, resolveComponent as p, openBlock as g, createBlock as V, unref as t, isRef as j, withCtx as I, createElementVNode as s, createVNode as r, toDisplayString as
|
|
1
|
+
import { defineComponent as X, ref as y, watch as N, onMounted as J, resolveComponent as p, openBlock as g, createBlock as V, unref as t, isRef as j, withCtx as I, createElementVNode as s, createVNode as r, toDisplayString as M, computed as ee, createElementBlock as O, Fragment as T, renderList as ae, resolveDynamicComponent as te, createCommentVNode as K, h as _ } from "vue";
|
|
2
2
|
import { _ as oe } from "./campaign-CpzFl8Vr.js";
|
|
3
3
|
import { useDialog as ne, components as x } from "@feedmepos/ui-library";
|
|
4
|
-
import { u as Q, p as z, a as se } from "./loading-
|
|
4
|
+
import { u as Q, p as z, a as se } from "./loading-BxJj39Hj.js";
|
|
5
5
|
import { useCoreStore as le } from "@feedmepos/mf-common";
|
|
6
|
-
import { u as ie, J as re, a as ce, R as ue, b as D } from "./app-
|
|
7
|
-
import { u as me } from "./campaign-
|
|
8
|
-
import { g as q, b as G } from "./dto-
|
|
9
|
-
import { u as de } from "./template-
|
|
10
|
-
import { _ as pe } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang
|
|
6
|
+
import { u as ie, J as re, a as ce, R as ue, b as D } from "./app-BSmDH0M7.js";
|
|
7
|
+
import { u as me } from "./campaign-CmvlWUoI.js";
|
|
8
|
+
import { g as q, b as G } from "./dto-rs6D-mtj.js";
|
|
9
|
+
import { u as de } from "./template-o2RQUsfw.js";
|
|
10
|
+
import { _ as pe } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-DljWmOEP.js";
|
|
11
11
|
import { _ as fe } from "./ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js";
|
|
12
|
-
import { l as he } from "./lodash-
|
|
13
|
-
import { m as ge } from "./index-
|
|
14
|
-
import { c as F } from "./index-
|
|
12
|
+
import { l as he } from "./lodash-CrYvSLZb.js";
|
|
13
|
+
import { m as ge } from "./index-D0nFU6ln.js";
|
|
14
|
+
import { c as F } from "./index-jqxAE4Rp.js";
|
|
15
15
|
import { useRouter as ye } from "vue-router";
|
|
16
|
-
const
|
|
16
|
+
const _e = { class: "space-y-16" }, ve = { class: "fm-typo-en-body-md-600" }, Ce = { class: "flex items-center justify-end" }, be = { class: "flex items-center gap-8" }, we = /* @__PURE__ */ X({
|
|
17
17
|
__name: "SendVoucherSheet",
|
|
18
18
|
emits: ["success"],
|
|
19
|
-
setup(W, { expose:
|
|
19
|
+
setup(W, { expose: U, emit: L }) {
|
|
20
20
|
const { minor: P } = Q, R = y(""), i = y({}), E = L, f = y(!1), u = y([]);
|
|
21
21
|
function m(e) {
|
|
22
22
|
f.value = !0, R.value = e.campaignId, u.value = [];
|
|
23
23
|
}
|
|
24
|
-
function
|
|
24
|
+
function v() {
|
|
25
25
|
f.value = !1;
|
|
26
26
|
}
|
|
27
27
|
const A = [
|
|
@@ -73,7 +73,7 @@ const ve = { class: "space-y-16" }, _e = { class: "fm-typo-en-body-md-600" }, Ce
|
|
|
73
73
|
async () => {
|
|
74
74
|
await F.sendCollection(R.value, {
|
|
75
75
|
memberId: u.value
|
|
76
|
-
}), await E("success"),
|
|
76
|
+
}), await E("success"), v();
|
|
77
77
|
},
|
|
78
78
|
{
|
|
79
79
|
message: "Sending claim(s)",
|
|
@@ -86,9 +86,9 @@ const ve = { class: "space-y-16" }, _e = { class: "fm-typo-en-body-md-600" }, Ce
|
|
|
86
86
|
he.debounce(async () => {
|
|
87
87
|
await C({ pageSize: 10, pageIndex: 0 });
|
|
88
88
|
}, 500)
|
|
89
|
-
),
|
|
89
|
+
), U({
|
|
90
90
|
showSheet: m,
|
|
91
|
-
hideSheet:
|
|
91
|
+
hideSheet: v
|
|
92
92
|
}), J(async () => {
|
|
93
93
|
await C(l.value);
|
|
94
94
|
}), (e, a) => {
|
|
@@ -120,8 +120,8 @@ const ve = { class: "space-y-16" }, _e = { class: "fm-typo-en-body-md-600" }, Ce
|
|
|
120
120
|
]),
|
|
121
121
|
default: I(() => [
|
|
122
122
|
r(re, { json: t(u) }, null, 8, ["json"]),
|
|
123
|
-
s("div",
|
|
124
|
-
s("div",
|
|
123
|
+
s("div", _e, [
|
|
124
|
+
s("div", ve, M(t(u).length) + " members selected ", 1),
|
|
125
125
|
s("div", Ce, [
|
|
126
126
|
r(o, {
|
|
127
127
|
class: "mt-4",
|
|
@@ -150,8 +150,8 @@ const ve = { class: "space-y-16" }, _e = { class: "fm-typo-en-body-md-600" }, Ce
|
|
|
150
150
|
};
|
|
151
151
|
}
|
|
152
152
|
});
|
|
153
|
-
var Se = { authUrl: "https://portal-v2
|
|
154
|
-
const xe = { class: "px-24 flex flex-col gap-y-16" }, Ve = { class: "flex items-center justify-between w-full" }, ke = { class: "flex gap-8 overflow-x-auto" }, Fe = { class: "space-y-8" }, Ie = { class: "flex w-full gap-4 items-center" }, Le = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Re = { class: "space-y-4" },
|
|
153
|
+
var Se = { authUrl: "https://portal-v2.feedmeapi.com/", slackWebhookUrl: "https://hooks.slack.com/services/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", appUrl: "member.feedme.cc", crmUrl: "crm.feedme.cc", marketingV1Portal: "https://marketing-v1.feedme.cc" };
|
|
154
|
+
const xe = { class: "px-24 flex flex-col gap-y-16" }, Ve = { class: "flex items-center justify-between w-full" }, ke = { class: "flex gap-8 overflow-x-auto" }, Fe = { class: "space-y-8" }, Ie = { class: "flex w-full gap-4 items-center" }, Le = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Re = { class: "space-y-4" }, Me = { class: "fm-typo-en-body-lg-600" }, Ue = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Pe = { class: "flex gap-8 items-center" }, Ee = /* @__PURE__ */ s("img", {
|
|
155
155
|
src: oe,
|
|
156
156
|
class: "aspect-square w-[150px]"
|
|
157
157
|
}, null, -1), Ae = /* @__PURE__ */ s("div", { class: "flex flex-col gap-16 text-center" }, [
|
|
@@ -160,7 +160,7 @@ const xe = { class: "px-24 flex flex-col gap-y-16" }, Ve = { class: "flex items-
|
|
|
160
160
|
], -1), We = /* @__PURE__ */ X({
|
|
161
161
|
__name: "Voucher",
|
|
162
162
|
setup(W) {
|
|
163
|
-
const
|
|
163
|
+
const U = {
|
|
164
164
|
label: "Create campaign",
|
|
165
165
|
value: "create",
|
|
166
166
|
isPrimary: !0,
|
|
@@ -168,7 +168,7 @@ const xe = { class: "px-24 flex flex-col gap-y-16" }, Ve = { class: "flex items-
|
|
|
168
168
|
}, L = ne(), P = de("VOUCHER", L), R = ce(), i = me(), { global: E, minor: f } = Q, u = ye(), m = y({
|
|
169
169
|
searchKey: "",
|
|
170
170
|
location: null
|
|
171
|
-
}),
|
|
171
|
+
}), v = ee(
|
|
172
172
|
() => i.campaigns.voucher.filter(
|
|
173
173
|
(e) => !m.value.location || !e.targetLocation || e.targetLocation.includes(m.value.location)
|
|
174
174
|
)
|
|
@@ -204,8 +204,8 @@ const xe = { class: "px-24 flex flex-col gap-y-16" }, Ve = { class: "flex items-
|
|
|
204
204
|
{
|
|
205
205
|
header: "Actions",
|
|
206
206
|
cell(e) {
|
|
207
|
-
return
|
|
208
|
-
|
|
207
|
+
return _("div", { class: "flex items-center justify-end" }, [
|
|
208
|
+
_(x.FmButton, {
|
|
209
209
|
icon: "visibility",
|
|
210
210
|
variant: "tertiary",
|
|
211
211
|
iconColor: "neutral-gray-400",
|
|
@@ -216,7 +216,7 @@ const xe = { class: "px-24 flex flex-col gap-y-16" }, Ve = { class: "flex items-
|
|
|
216
216
|
});
|
|
217
217
|
}
|
|
218
218
|
}),
|
|
219
|
-
|
|
219
|
+
_(
|
|
220
220
|
x.FmMenu,
|
|
221
221
|
{
|
|
222
222
|
placement: "bottom-end",
|
|
@@ -225,14 +225,14 @@ const xe = { class: "px-24 flex flex-col gap-y-16" }, Ve = { class: "flex items-
|
|
|
225
225
|
}
|
|
226
226
|
},
|
|
227
227
|
{
|
|
228
|
-
"menu-button": () =>
|
|
228
|
+
"menu-button": () => _(x.FmButton, {
|
|
229
229
|
icon: "more_vert",
|
|
230
230
|
iconColor: "neutral-gray-400",
|
|
231
231
|
variant: "tertiary"
|
|
232
232
|
}),
|
|
233
233
|
default: () => {
|
|
234
234
|
const a = [
|
|
235
|
-
|
|
235
|
+
_(
|
|
236
236
|
x.FmMenuItem,
|
|
237
237
|
{
|
|
238
238
|
onClick: async (o) => {
|
|
@@ -240,7 +240,7 @@ const xe = { class: "px-24 flex flex-col gap-y-16" }, Ve = { class: "flex items-
|
|
|
240
240
|
}
|
|
241
241
|
},
|
|
242
242
|
{
|
|
243
|
-
label:
|
|
243
|
+
label: _(
|
|
244
244
|
"div",
|
|
245
245
|
{
|
|
246
246
|
class: "text-fm-color-typo-error fm-typo-en-body-md-400"
|
|
@@ -251,7 +251,7 @@ const xe = { class: "px-24 flex flex-col gap-y-16" }, Ve = { class: "flex items-
|
|
|
251
251
|
)
|
|
252
252
|
];
|
|
253
253
|
return e.row.original.event.type === "SIMPLE_CLAIM" && (a.unshift(
|
|
254
|
-
|
|
254
|
+
_(x.FmMenuItem, {
|
|
255
255
|
label: "Send",
|
|
256
256
|
onClick: async (o) => {
|
|
257
257
|
var c;
|
|
@@ -261,7 +261,7 @@ const xe = { class: "px-24 flex flex-col gap-y-16" }, Ve = { class: "flex items-
|
|
|
261
261
|
}
|
|
262
262
|
})
|
|
263
263
|
), a.unshift(
|
|
264
|
-
|
|
264
|
+
_(x.FmMenuItem, {
|
|
265
265
|
label: "Share",
|
|
266
266
|
onClick: async (o) => {
|
|
267
267
|
if (o.stopPropagation(), e.row.original.event.type !== "SIMPLE_CLAIM")
|
|
@@ -343,7 +343,7 @@ const xe = { class: "px-24 flex flex-col gap-y-16" }, Ve = { class: "flex items-
|
|
|
343
343
|
return g(), O(T, null, [
|
|
344
344
|
r(o, {
|
|
345
345
|
title: "Voucher",
|
|
346
|
-
actions: t(
|
|
346
|
+
actions: t(v).length > 0 ? [U] : [],
|
|
347
347
|
"onClick:action": a[0] || (a[0] = () => b())
|
|
348
348
|
}, null, 8, ["actions"]),
|
|
349
349
|
s("div", xe, [
|
|
@@ -377,16 +377,16 @@ const xe = { class: "px-24 flex flex-col gap-y-16" }, Ve = { class: "flex items-
|
|
|
377
377
|
]),
|
|
378
378
|
r(w, {
|
|
379
379
|
class: "xs:hidden",
|
|
380
|
-
"row-data": t(
|
|
380
|
+
"row-data": t(v),
|
|
381
381
|
"column-defs": A,
|
|
382
382
|
"search-value": t(m).searchKey,
|
|
383
383
|
"column-filter": [],
|
|
384
384
|
onRowClick: a[4] || (a[4] = (n) => b(n.original)),
|
|
385
|
-
"hide-footer": t(
|
|
385
|
+
"hide-footer": t(v).length < 10
|
|
386
386
|
}, null, 8, ["row-data", "search-value", "hide-footer"]),
|
|
387
387
|
r(Z, { class: "hidden xs:flex flex-col mx-[-24px]" }, {
|
|
388
388
|
default: I(() => [
|
|
389
|
-
(g(!0), O(T, null, ae(t(
|
|
389
|
+
(g(!0), O(T, null, ae(t(v).filter(
|
|
390
390
|
(n) => n.name.toLowerCase().includes(t(m).searchKey.toLowerCase())
|
|
391
391
|
), (n) => (g(), V(h, {
|
|
392
392
|
key: n._id.toString(),
|
|
@@ -399,11 +399,11 @@ const xe = { class: "px-24 flex flex-col gap-y-16" }, Ve = { class: "flex items-
|
|
|
399
399
|
s("div", Fe, [
|
|
400
400
|
s("div", Ie, [
|
|
401
401
|
(g(), V(te(t(q)(n)))),
|
|
402
|
-
s("div", Le,
|
|
402
|
+
s("div", Le, M(((B = n.pf_collectible) == null ? void 0 : B.currentReceive) ?? 0) + " claimed ", 1)
|
|
403
403
|
]),
|
|
404
404
|
s("div", Re, [
|
|
405
|
-
s("div",
|
|
406
|
-
s("div",
|
|
405
|
+
s("div", Me, M(n.name), 1),
|
|
406
|
+
s("div", Ue, M(t(G)(n)), 1)
|
|
407
407
|
])
|
|
408
408
|
]),
|
|
409
409
|
s("div", Pe, [
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import { h as a, defineComponent as y, useAttrs as j, resolveComponent as v, openBlock as u, createBlock as N, mergeProps as O, unref as s, createSlots as x, withCtx as _, createElementVNode as c, toDisplayString as k, renderSlot as T, createElementBlock as R, createCommentVNode as U } from "vue";
|
|
2
|
+
function m(e, t) {
|
|
3
|
+
return e.path.join(".") === t;
|
|
4
|
+
}
|
|
5
|
+
function E(e, t) {
|
|
6
|
+
return e.some((n) => t == "" || m(n, t)) ? "error" : "none";
|
|
7
|
+
}
|
|
8
|
+
function I(e, t) {
|
|
9
|
+
return e.filter((n) => t == "" || m(n, t)).map((n) => n.message).join(",") || void 0;
|
|
10
|
+
}
|
|
11
|
+
const r = {
|
|
12
|
+
ZodIntersection: (e) => e._def.typeName == "ZodIntersection",
|
|
13
|
+
ZodNullable: (e) => e._def.typeName == "ZodNullable",
|
|
14
|
+
ZodOptional: (e) => e._def.typeName == "ZodOptional",
|
|
15
|
+
ZodEffects: (e) => e._def.typeName == "ZodEffects",
|
|
16
|
+
ZodDiscriminatedUnion: (e) => e._def.typeName == "ZodDiscriminatedUnion",
|
|
17
|
+
ZodUnion: (e) => e._def.typeName == "ZodUnion",
|
|
18
|
+
ZodLazy: (e) => e._def.typeName == "ZodLazy",
|
|
19
|
+
ZodRecord: (e) => e._def.typeName == "ZodRecord",
|
|
20
|
+
ZodObject: (e) => e._def.typeName == "ZodObject"
|
|
21
|
+
};
|
|
22
|
+
function p(e) {
|
|
23
|
+
return !(r.ZodNullable(e) || r.ZodOptional(e));
|
|
24
|
+
}
|
|
25
|
+
function i(e, t = []) {
|
|
26
|
+
function n(d) {
|
|
27
|
+
const o = [d._def.left, d._def.right];
|
|
28
|
+
return r.ZodObject(o[0]) && r.ZodObject(o[1]) ? Object.keys(o[0].shape).length > Object.keys(o[1].shape).length ? o[0] : o[1] : o.find((l) => r.ZodDiscriminatedUnion(l)) || o.find((l) => r.ZodObject(l)) || o[1];
|
|
29
|
+
}
|
|
30
|
+
if ((r.ZodNullable(e) || r.ZodOptional(e)) && (e = i(e.unwrap(), t)), r.ZodEffects(e) && (e = i(e.sourceType(), t)), r.ZodDiscriminatedUnion(e)) {
|
|
31
|
+
const d = Object.fromEntries(e.optionsMap.entries());
|
|
32
|
+
if (t.length) {
|
|
33
|
+
const o = t.shift(), l = d[o];
|
|
34
|
+
return i(l, t);
|
|
35
|
+
}
|
|
36
|
+
return console.log(
|
|
37
|
+
"discriminatedUnion found but no KEY supplied, keys:",
|
|
38
|
+
Object.keys(d)
|
|
39
|
+
), e;
|
|
40
|
+
}
|
|
41
|
+
return r.ZodLazy(e) && (e = i(e._def.getter(), t)), r.ZodIntersection(e) && (e = i(n(e), t)), e;
|
|
42
|
+
}
|
|
43
|
+
function Z(e, t, n = []) {
|
|
44
|
+
return t === "" ? i(e, n) : t.split(".").reduce((d, o) => {
|
|
45
|
+
const l = i(d, n);
|
|
46
|
+
return r.ZodObject(l) ? l.shape[o] : d;
|
|
47
|
+
}, e);
|
|
48
|
+
}
|
|
49
|
+
function b(e, t) {
|
|
50
|
+
return (n) => {
|
|
51
|
+
const d = e.safeParse(n);
|
|
52
|
+
return d.success ? !0 : d.error.errors.filter((o) => !t || o.path.join(".") === t).map((o) => o.message).join(", ");
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
function S(e, t, n = []) {
|
|
56
|
+
return b(Z(e, t, n));
|
|
57
|
+
}
|
|
58
|
+
function z(e, t) {
|
|
59
|
+
if (!t) return;
|
|
60
|
+
const n = p(e) ? "hidden" : "";
|
|
61
|
+
return a(
|
|
62
|
+
"div",
|
|
63
|
+
{ class: "flex items-center gap-x-4 fm-typo-en-body-lg-400" },
|
|
64
|
+
[
|
|
65
|
+
a("div", t),
|
|
66
|
+
a(
|
|
67
|
+
"div",
|
|
68
|
+
{
|
|
69
|
+
class: `text-fm-color-typo-secondary ${n}`
|
|
70
|
+
},
|
|
71
|
+
"(optional)"
|
|
72
|
+
)
|
|
73
|
+
]
|
|
74
|
+
);
|
|
75
|
+
}
|
|
76
|
+
const f = {
|
|
77
|
+
helperState: E,
|
|
78
|
+
helperText: I,
|
|
79
|
+
typeAtPath: Z,
|
|
80
|
+
toRule: b,
|
|
81
|
+
ruleAtPath: S,
|
|
82
|
+
isRequired: p,
|
|
83
|
+
toInputLabel: z,
|
|
84
|
+
unwrap: i
|
|
85
|
+
}, L = { class: "fm-typo-en-body-lg-400 flex gap-4 text-fm-color-typo-primary items-center" }, P = {
|
|
86
|
+
key: 0,
|
|
87
|
+
class: "text-fm-color-typo-tertiary"
|
|
88
|
+
}, A = /* @__PURE__ */ y({
|
|
89
|
+
__name: "ZodTextField",
|
|
90
|
+
props: {
|
|
91
|
+
label: {
|
|
92
|
+
type: String,
|
|
93
|
+
required: !1
|
|
94
|
+
},
|
|
95
|
+
schema: {
|
|
96
|
+
type: Object,
|
|
97
|
+
required: !0
|
|
98
|
+
},
|
|
99
|
+
modelValue: {
|
|
100
|
+
type: String
|
|
101
|
+
},
|
|
102
|
+
disabled: {
|
|
103
|
+
type: Boolean,
|
|
104
|
+
default: !1
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
emits: ["update:model-value", "focus-changed"],
|
|
108
|
+
setup(e, { emit: t }) {
|
|
109
|
+
const n = t, d = j();
|
|
110
|
+
return (o, l) => {
|
|
111
|
+
const g = v("FmTextField");
|
|
112
|
+
return u(), N(g, O({
|
|
113
|
+
"model-value": e.modelValue,
|
|
114
|
+
"onUpdate:modelValue": l[0] || (l[0] = (h) => n("update:model-value", h)),
|
|
115
|
+
disabled: e.disabled
|
|
116
|
+
}, s(d), {
|
|
117
|
+
rules: [s(f).toRule(e.schema)]
|
|
118
|
+
}), x({ _: 2 }, [
|
|
119
|
+
e.label ? {
|
|
120
|
+
name: "label",
|
|
121
|
+
fn: _(() => [
|
|
122
|
+
c("div", L, [
|
|
123
|
+
c("div", null, k(e.label), 1),
|
|
124
|
+
T(o.$slots, "append-label", {}, () => [
|
|
125
|
+
s(f).isRequired(e.schema) ? U("", !0) : (u(), R("div", P, " (optional) "))
|
|
126
|
+
])
|
|
127
|
+
])
|
|
128
|
+
]),
|
|
129
|
+
key: "0"
|
|
130
|
+
} : void 0
|
|
131
|
+
]), 1040, ["model-value", "disabled", "rules"]);
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
});
|
|
135
|
+
export {
|
|
136
|
+
f as Z,
|
|
137
|
+
A as _,
|
|
138
|
+
I as a,
|
|
139
|
+
E as g
|
|
140
|
+
};
|