@bagelink/vue 1.8.76 → 1.8.78

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/index.mjs CHANGED
@@ -36705,14 +36705,14 @@ var _hoisted_1$6 = {
36705
36705
  errors: {}
36706
36706
  },
36707
36707
  emits: ["update:modelValue"],
36708
- setup(e, { emit: j }) {
36709
- let M = e, N = j;
36710
- function V(e, t) {
36708
+ setup(e, { expose: j, emit: M }) {
36709
+ let N = e, V = M;
36710
+ function $N(e, t) {
36711
36711
  let j = t.split("."), M = e;
36712
36712
  for (let e of j) M = M?.[e];
36713
36713
  return M;
36714
36714
  }
36715
- function $N(e, t, j) {
36715
+ function eP(e, t, j) {
36716
36716
  let M = t.split("."), N = e;
36717
36717
  for (let e = 0; e < M.length - 1; e++) {
36718
36718
  let t = M[e];
@@ -36720,98 +36720,98 @@ var _hoisted_1$6 = {
36720
36720
  }
36721
36721
  N[M[M.length - 1]] = j;
36722
36722
  }
36723
- function eP(e) {
36723
+ function tP(e) {
36724
36724
  let t = { ...e || {} };
36725
- for (let [e, j] of Object.entries(M.schema._fields)) {
36725
+ for (let [e, j] of Object.entries(N.schema._fields)) {
36726
36726
  let M = j._config.default;
36727
- M !== void 0 && V(t, e) === void 0 && $N(t, e, M);
36727
+ M !== void 0 && $N(t, e) === void 0 && eP(t, e, M);
36728
36728
  }
36729
36729
  return t;
36730
36730
  }
36731
- let tP = ref(eP(M.modelValue)), rP = ref({}), iP = !1;
36732
- watch(() => M.modelValue, (e) => {
36733
- iP || (tP.value = eP(e));
36734
- }, { deep: !0 }), watch(tP, (e) => {
36735
- iP = !0, N("update:modelValue", e), setTimeout(() => {
36736
- iP = !1;
36731
+ let rP = ref(tP(N.modelValue)), iP = ref({}), aP = !1;
36732
+ watch(() => N.modelValue, (e) => {
36733
+ aP || (rP.value = tP(e));
36734
+ }, { deep: !0 }), watch(rP, (e) => {
36735
+ aP = !0, V("update:modelValue", e), setTimeout(() => {
36736
+ aP = !1;
36737
36737
  }, 0);
36738
36738
  }, { deep: !0 });
36739
- function aP(e, t) {
36739
+ function oP(e, t) {
36740
36740
  if (!e) return !0;
36741
36741
  try {
36742
36742
  let j = parseQuery(e);
36743
36743
  if (j.length === 0) return !0;
36744
36744
  let M = !0, N = null;
36745
36745
  for (let e = 0; e < j.length; e++) {
36746
- let I = j[e], U = V(t, I.field), { op: J, value: QN, connector: $N } = I, eP = !1;
36747
- switch (J) {
36746
+ let I = j[e], V = $N(t, I.field), { op: U, value: J, connector: QN } = I, eP = !1;
36747
+ switch (U) {
36748
36748
  case "eq":
36749
- eP = U === QN;
36749
+ eP = V === J;
36750
36750
  break;
36751
36751
  case "ne":
36752
- eP = U !== QN;
36752
+ eP = V !== J;
36753
36753
  break;
36754
36754
  case "gt":
36755
- eP = QN != null && U > QN;
36755
+ eP = J != null && V > J;
36756
36756
  break;
36757
36757
  case "ge":
36758
- eP = QN != null && U >= QN;
36758
+ eP = J != null && V >= J;
36759
36759
  break;
36760
36760
  case "lt":
36761
- eP = QN != null && U < QN;
36761
+ eP = J != null && V < J;
36762
36762
  break;
36763
36763
  case "le":
36764
- eP = QN != null && U <= QN;
36764
+ eP = J != null && V <= J;
36765
36765
  break;
36766
36766
  case "co":
36767
- eP = QN != null && String(U).includes(String(QN));
36767
+ eP = J != null && String(V).includes(String(J));
36768
36768
  break;
36769
36769
  case "sw":
36770
- eP = QN != null && String(U).startsWith(String(QN));
36770
+ eP = J != null && String(V).startsWith(String(J));
36771
36771
  break;
36772
36772
  case "ew":
36773
- eP = QN != null && String(U).endsWith(String(QN));
36773
+ eP = J != null && String(V).endsWith(String(J));
36774
36774
  break;
36775
36775
  case "pr":
36776
- eP = U != null;
36776
+ eP = V != null;
36777
36777
  break;
36778
36778
  default: eP = !1;
36779
36779
  }
36780
- e === 0 ? (M = eP, N = eP) : ($N === "or" ? M = (N ?? !1) || eP : $N === "and" && (M = (N ?? !1) && eP), N = M);
36780
+ e === 0 ? (M = eP, N = eP) : (QN === "or" ? M = (N ?? !1) || eP : QN === "and" && (M = (N ?? !1) && eP), N = M);
36781
36781
  }
36782
36782
  return M;
36783
36783
  } catch (t) {
36784
36784
  return console.warn("Failed to evaluate condition:", e, t), !0;
36785
36785
  }
36786
36786
  }
36787
- function oP(e) {
36788
- return e._condition == null ? !0 : aP(e._condition, tP.value);
36787
+ function sP(e) {
36788
+ return e._condition == null ? !0 : oP(e._condition, rP.value);
36789
36789
  }
36790
- let sP = computed(() => {
36790
+ let cP = computed(() => {
36791
36791
  let e = [];
36792
- for (let [t, j] of Object.entries(M.schema._fields)) oP(j) && e.push({
36792
+ for (let [t, j] of Object.entries(N.schema._fields)) sP(j) && e.push({
36793
36793
  key: t,
36794
36794
  field: j
36795
36795
  });
36796
36796
  return e;
36797
36797
  });
36798
- function cP(e, t, j) {
36798
+ function lP(e, t, j) {
36799
36799
  if (j._validations != null) for (let M of j._validations) {
36800
36800
  let j = M(t);
36801
36801
  if (j !== !0) {
36802
- rP.value[e] = j;
36802
+ iP.value[e] = j;
36803
36803
  return;
36804
36804
  }
36805
36805
  }
36806
- rP.value = { ...rP.value }, rP.value[e] = "", $N(tP.value, e, t);
36806
+ iP.value = { ...iP.value }, iP.value[e] = "", eP(rP.value, e, t);
36807
36807
  }
36808
- function lP(e) {
36809
- return V(tP.value, e);
36808
+ function uP(e) {
36809
+ return $N(rP.value, e);
36810
36810
  }
36811
- function uP(e, t) {
36811
+ function dP(e, t) {
36812
36812
  return t._config.label == null ? e.split(/[._-]/).map((e) => e.charAt(0).toUpperCase() + e.slice(1)).join(" ") : t._config.label;
36813
36813
  }
36814
- function dP(e) {
36814
+ function fP(e) {
36815
36815
  return {
36816
36816
  text: TextInput_default,
36817
36817
  email: EmailInput_default,
@@ -36832,18 +36832,18 @@ var _hoisted_1$6 = {
36832
36832
  array: ArrayInput_default
36833
36833
  }[e] || TextInput_default;
36834
36834
  }
36835
- let fP = computed(() => ({
36836
- ...rP.value,
36837
- ...M.errors || {}
36835
+ let mP = computed(() => ({
36836
+ ...iP.value,
36837
+ ...N.errors || {}
36838
36838
  }));
36839
- function mP(e, t) {
36839
+ function gP(e, t) {
36840
36840
  let j = {
36841
- label: uP(t, e),
36842
- modelValue: lP(t),
36841
+ label: dP(t, e),
36842
+ modelValue: uP(t),
36843
36843
  "onUpdate:modelValue": (j) => {
36844
- cP(t, j, e);
36844
+ lP(t, j, e);
36845
36845
  },
36846
- error: fP.value[t],
36846
+ error: mP.value[t],
36847
36847
  ...e._config
36848
36848
  };
36849
36849
  if (e._type === "textarea" && (j.multiline = !0), e._type === "multiselect" && (j.multiple = !0), e._type === "array") {
@@ -36853,16 +36853,16 @@ var _hoisted_1$6 = {
36853
36853
  }
36854
36854
  return j;
36855
36855
  }
36856
- function gP(e) {
36857
- return typeof e == "string" ? M.components?.[e] == null ? e : M.components[e] : e;
36858
- }
36859
36856
  function _P(e) {
36857
+ return typeof e == "string" ? N.components?.[e] == null ? e : N.components[e] : e;
36858
+ }
36859
+ function vP(e) {
36860
36860
  return e._component != null;
36861
36861
  }
36862
- function vP() {
36862
+ function yP() {
36863
36863
  let e = !0, t = {};
36864
- for (let { key: j, field: M } of sP.value) {
36865
- let N = lP(j);
36864
+ for (let { key: j, field: M } of cP.value) {
36865
+ let N = uP(j);
36866
36866
  if (M._validations != null) for (let I of M._validations) {
36867
36867
  let M = I(N);
36868
36868
  if (M !== !0) {
@@ -36871,28 +36871,36 @@ var _hoisted_1$6 = {
36871
36871
  }
36872
36872
  }
36873
36873
  }
36874
- return rP.value = t, e;
36874
+ return iP.value = t, e;
36875
36875
  }
36876
- function yP() {
36877
- return vP();
36876
+ function bP(e) {
36877
+ e && e.preventDefault();
36878
+ let t = yP();
36879
+ return t || e?.stopPropagation(), t;
36878
36880
  }
36879
- return (e, j) => {
36881
+ return j({
36882
+ validate: yP,
36883
+ handleSubmit: bP
36884
+ }), (e, j) => {
36880
36885
  let M = resolveComponent("FormFlow", !0);
36881
- return openBlock(), createElementBlock("div", { class: normalizeClass(e.schema._class) }, [(openBlock(!0), createElementBlock(Fragment, null, renderList(sP.value, ({ key: t, field: j }) => (openBlock(), createElementBlock("div", {
36886
+ return openBlock(), createElementBlock("form", {
36887
+ class: normalizeClass(e.schema._class),
36888
+ onSubmit: bP
36889
+ }, [(openBlock(!0), createElementBlock(Fragment, null, renderList(cP.value, ({ key: t, field: j }) => (openBlock(), createElementBlock("div", {
36882
36890
  key: t,
36883
36891
  class: normalizeClass([j._class, j._config.class])
36884
36892
  }, [renderSlot(e.$slots, `field:${t}`, {
36885
- value: lP(t),
36893
+ value: uP(t),
36886
36894
  field: j,
36887
- formData: tP.value,
36888
- error: rP.value[t],
36895
+ formData: rP.value,
36896
+ error: iP.value[t],
36889
36897
  onChange: (e) => {
36890
- cP(t, e, j);
36898
+ lP(t, e, j);
36891
36899
  }
36892
36900
  }, () => [j._type === "array" && j._config.schema?._isSchema ? (openBlock(), createBlock(ArrayInput_default, mergeProps({
36893
36901
  key: 0,
36894
36902
  ref_for: !0
36895
- }, mP(j, t)), {
36903
+ }, gP(j, t)), {
36896
36904
  default: withCtx(({ item: t }) => [createVNode(M, {
36897
36905
  modelValue: t.value,
36898
36906
  "onUpdate:modelValue": (e) => t.value = e,
@@ -36908,27 +36916,27 @@ var _hoisted_1$6 = {
36908
36916
  }, 1040)) : j._type === "array" && j._config.schema ? (openBlock(), createBlock(ArrayInput_default, mergeProps({
36909
36917
  key: 1,
36910
36918
  ref_for: !0
36911
- }, mP(j, t)), {
36912
- default: withCtx(({ item: e }) => [(openBlock(), createBlock(resolveDynamicComponent(gP(j._config.schema)), {
36919
+ }, gP(j, t)), {
36920
+ default: withCtx(({ item: e }) => [(openBlock(), createBlock(resolveDynamicComponent(_P(j._config.schema)), {
36913
36921
  modelValue: e.value,
36914
36922
  "onUpdate:modelValue": (t) => e.value = t
36915
36923
  }, null, 8, ["modelValue", "onUpdate:modelValue"]))]),
36916
36924
  _: 2
36917
- }, 1040)) : _P(j) ? (openBlock(), createBlock(resolveDynamicComponent(gP(j._component.component)), mergeProps({
36925
+ }, 1040)) : vP(j) ? (openBlock(), createBlock(resolveDynamicComponent(_P(j._component.component)), mergeProps({
36918
36926
  key: 2,
36919
- "model-value": lP(t)
36920
- }, { ref_for: !0 }, j._component.props, { "onUpdate:modelValue": (e) => cP(t, e, j) }), null, 16, ["model-value", "onUpdate:modelValue"])) : (openBlock(), createBlock(resolveDynamicComponent(dP(j._type)), mergeProps({
36927
+ "model-value": uP(t)
36928
+ }, { ref_for: !0 }, j._component.props, { "onUpdate:modelValue": (e) => lP(t, e, j) }), null, 16, ["model-value", "onUpdate:modelValue"])) : (openBlock(), createBlock(resolveDynamicComponent(fP(j._type)), mergeProps({
36921
36929
  key: 3,
36922
36930
  ref_for: !0
36923
- }, mP(j, t)), null, 16))], !0), rP.value[t] ? (openBlock(), createElementBlock("div", _hoisted_1$5, toDisplayString(rP.value[t]), 1)) : createCommentVNode("", !0)], 2))), 128)), renderSlot(e.$slots, "submit", {
36924
- submit: yP,
36925
- validate: vP,
36926
- formData: tP.value,
36927
- errors: fP.value
36928
- }, void 0, !0)], 2);
36931
+ }, gP(j, t)), null, 16))], !0), iP.value[t] ? (openBlock(), createElementBlock("div", _hoisted_1$5, toDisplayString(iP.value[t]), 1)) : createCommentVNode("", !0)], 2))), 128)), renderSlot(e.$slots, "submit", {
36932
+ submit: bP,
36933
+ validate: yP,
36934
+ formData: rP.value,
36935
+ errors: mP.value
36936
+ }, void 0, !0)], 34);
36929
36937
  };
36930
36938
  }
36931
- }), [["__scopeId", "data-v-46d8e9bc"]]), _hoisted_1$4 = {
36939
+ }), [["__scopeId", "data-v-d5230ce5"]]), _hoisted_1$4 = {
36932
36940
  key: 0,
36933
36941
  class: "dialog-form-error bg-red-30 color-red radius-1 mb-1 txt14 px-1 py-075"
36934
36942
  }, DialogForm_default = /* @__PURE__ */ defineComponent({