vi-grid-builder 2.3.7 → 2.3.9

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.
@@ -1,4 +1,4 @@
1
- import { openBlock as b, createElementBlock as _, mergeProps as ne, toDisplayString as V, createElementVNode as A, withModifiers as rn, defineComponent as de, computed as C, watch as $t, h as Pe, resolveComponent as W, createVNode as N, Fragment as _e, renderList as je, createCommentVNode as j, reactive as Ze, toRaw as ae, nextTick as si, normalizeClass as te, createBlock as U, renderSlot as z, isVNode as li, createApp as Ko, onMounted as Sa, onUnmounted as Pa, ref as Y, watchEffect as Ft, cloneVNode as Xo, resolveDynamicComponent as Rt, withCtx as st, createTextVNode as Qo } from "vue";
1
+ import { openBlock as b, createElementBlock as _, mergeProps as Z, toDisplayString as V, createElementVNode as A, withModifiers as rn, defineComponent as de, computed as C, watch as $t, h as Pe, resolveComponent as W, createVNode as N, Fragment as _e, renderList as je, createCommentVNode as j, reactive as Ze, toRaw as ne, nextTick as si, normalizeClass as ie, createBlock as U, renderSlot as z, isVNode as li, createApp as Ko, onMounted as Sa, onUnmounted as Pa, ref as Y, watchEffect as Ft, cloneVNode as Xo, resolveDynamicComponent as Rt, withCtx as st, createTextVNode as Qo } from "vue";
2
2
  const K = (e, t) => {
3
3
  const n = e.__vccOpts || e;
4
4
  for (const [a, r] of t)
@@ -11,7 +11,7 @@ const K = (e, t) => {
11
11
  }
12
12
  };
13
13
  function Zo(e, t, n, a, r, i) {
14
- return b(), _("div", ne({ class: "vi-grid-badge" }, e.$attrs, { class: n.value }), V(n.value), 17);
14
+ return b(), _("div", Z({ class: "vi-grid-badge" }, e.$attrs, { class: n.value }), V(n.value), 17);
15
15
  }
16
16
  const es = /* @__PURE__ */ K(Jo, [["render", Zo]]);
17
17
  const ts = {
@@ -60,7 +60,7 @@ const is = /* @__PURE__ */ K(ts, [["render", rs]]), os = (e, t = 300) => {
60
60
  }
61
61
  }, ls = ["value"];
62
62
  function cs(e, t, n, a, r, i) {
63
- return n.editable ? (b(), _("div", ne({
63
+ return n.editable ? (b(), _("div", Z({
64
64
  key: 1,
65
65
  class: "vi-grid-text editable"
66
66
  }, e.$attrs), [
@@ -70,7 +70,7 @@ function cs(e, t, n, a, r, i) {
70
70
  onClick: t[0] || (t[0] = rn((o) => o.stopPropagation(), ["stop"])),
71
71
  onInput: t[1] || (t[1] = (...o) => i.emitValue && i.emitValue(...o))
72
72
  }, null, 40, ls)
73
- ], 16)) : (b(), _("div", ne({
73
+ ], 16)) : (b(), _("div", Z({
74
74
  key: 0,
75
75
  class: "vi-grid-text"
76
76
  }, e.$attrs), V(n.value), 17));
@@ -2974,7 +2974,7 @@ const Vi = new tu(), ru = () => {
2974
2974
  };
2975
2975
  }
2976
2976
  }
2977
- }, Z = {
2977
+ }, ee = {
2978
2978
  noAuto: ru,
2979
2979
  config: S,
2980
2980
  dom: iu,
@@ -2987,7 +2987,7 @@ const Vi = new tu(), ru = () => {
2987
2987
  const {
2988
2988
  autoReplaceSvgRoot: t = L
2989
2989
  } = e;
2990
- (Object.keys(se.styles).length > 0 || S.autoFetchSvg) && ye && S.autoReplaceSvg && Z.dom.i2svg({
2990
+ (Object.keys(se.styles).length > 0 || S.autoFetchSvg) && ye && S.autoReplaceSvg && ee.dom.i2svg({
2991
2991
  node: t
2992
2992
  });
2993
2993
  };
@@ -4157,18 +4157,18 @@ var Yu = {
4157
4157
  }
4158
4158
  }, Gu = [jc, Nu, Tu, Mu, Iu, Bu, Uu, Vu, Yu, $u, qu];
4159
4159
  au(Gu, {
4160
- mixoutsTo: Z
4160
+ mixoutsTo: ee
4161
4161
  });
4162
- Z.noAuto;
4163
- const Hi = Z.config, Ki = Z.library;
4164
- Z.dom;
4165
- const Qt = Z.parse;
4166
- Z.findIconDefinition;
4167
- Z.toHtml;
4168
- const Hu = Z.icon;
4169
- Z.layer;
4170
- const Ku = Z.text;
4171
- Z.counter;
4162
+ ee.noAuto;
4163
+ const Hi = ee.config, Ki = ee.library;
4164
+ ee.dom;
4165
+ const Qt = ee.parse;
4166
+ ee.findIconDefinition;
4167
+ ee.toHtml;
4168
+ const Hu = ee.icon;
4169
+ ee.layer;
4170
+ const Ku = ee.text;
4171
+ ee.counter;
4172
4172
  function Ar(e, t) {
4173
4173
  var n = Object.keys(e);
4174
4174
  if (Object.getOwnPropertySymbols) {
@@ -4179,7 +4179,7 @@ function Ar(e, t) {
4179
4179
  }
4180
4180
  return n;
4181
4181
  }
4182
- function re(e) {
4182
+ function ae(e) {
4183
4183
  for (var t = 1; t < arguments.length; t++) {
4184
4184
  var n = arguments[t] != null ? arguments[t] : {};
4185
4185
  t % 2 ? Ar(Object(n), !0).forEach(function(a) {
@@ -4388,9 +4388,9 @@ function Fa(e) {
4388
4388
  });
4389
4389
  n.class;
4390
4390
  var i = n.style, o = i === void 0 ? {} : i, s = Zu(n, sf);
4391
- return Pe(e.tag, re(re(re({}, t), {}, {
4391
+ return Pe(e.tag, ae(ae(ae({}, t), {}, {
4392
4392
  class: r.class,
4393
- style: re(re({}, r.style), o)
4393
+ style: ae(ae({}, r.style), o)
4394
4394
  }, r.attrs), s), a);
4395
4395
  }
4396
4396
  var Qi = !1;
@@ -4575,7 +4575,7 @@ var tt = de({
4575
4575
  }), s = C(function() {
4576
4576
  return dt("mask", Er(t.mask));
4577
4577
  }), l = C(function() {
4578
- return Hu(r.value, re(re(re(re({}, i.value), o.value), s.value), {}, {
4578
+ return Hu(r.value, ae(ae(ae(ae({}, i.value), o.value), s.value), {}, {
4579
4579
  symbol: t.symbol,
4580
4580
  title: t.title,
4581
4581
  titleId: t.titleId,
@@ -4644,7 +4644,7 @@ de({
4644
4644
  }), o = C(function() {
4645
4645
  return dt("transform", typeof t.transform == "string" ? Qt.transform(t.transform) : t.transform);
4646
4646
  }), s = C(function() {
4647
- var c = Ku(t.value.toString(), re(re({}, o.value), i.value)), u = c.abstract;
4647
+ var c = Ku(t.value.toString(), ae(ae({}, o.value), i.value)), u = c.abstract;
4648
4648
  return t.counter && (u[0].attributes.class = u[0].attributes.class.replace("fa-layers-text", "")), u[0];
4649
4649
  }), l = C(function() {
4650
4650
  return Fa(s.value, {}, a);
@@ -6181,7 +6181,7 @@ const Oo = new Pd(), Od = () => {
6181
6181
  };
6182
6182
  }
6183
6183
  }
6184
- }, ee = {
6184
+ }, te = {
6185
6185
  noAuto: Od,
6186
6186
  config: P,
6187
6187
  dom: Ad,
@@ -6194,7 +6194,7 @@ const Oo = new Pd(), Od = () => {
6194
6194
  const {
6195
6195
  autoReplaceSvgRoot: t = F
6196
6196
  } = e;
6197
- (Object.keys(ce.styles).length > 0 || P.autoFetchSvg) && be && P.autoReplaceSvg && ee.dom.i2svg({
6197
+ (Object.keys(ce.styles).length > 0 || P.autoFetchSvg) && be && P.autoReplaceSvg && te.dom.i2svg({
6198
6198
  node: t
6199
6199
  });
6200
6200
  };
@@ -7364,18 +7364,18 @@ var mm = {
7364
7364
  }
7365
7365
  }, hm = [ld, Zd, em, tm, nm, cm, um, fm, mm, gm, pm];
7366
7366
  Cd(hm, {
7367
- mixoutsTo: ee
7367
+ mixoutsTo: te
7368
7368
  });
7369
- ee.noAuto;
7370
- const Io = ee.config, vm = ee.library;
7371
- ee.dom;
7372
- const tn = ee.parse;
7373
- ee.findIconDefinition;
7374
- ee.toHtml;
7375
- const ym = ee.icon;
7376
- ee.layer;
7377
- const bm = ee.text;
7378
- ee.counter;
7369
+ te.noAuto;
7370
+ const Io = te.config, vm = te.library;
7371
+ te.dom;
7372
+ const tn = te.parse;
7373
+ te.findIconDefinition;
7374
+ te.toHtml;
7375
+ const ym = te.icon;
7376
+ te.layer;
7377
+ const bm = te.text;
7378
+ te.counter;
7379
7379
  function ai(e, t) {
7380
7380
  var n = Object.keys(e);
7381
7381
  if (Object.getOwnPropertySymbols) {
@@ -7386,7 +7386,7 @@ function ai(e, t) {
7386
7386
  }
7387
7387
  return n;
7388
7388
  }
7389
- function ie(e) {
7389
+ function re(e) {
7390
7390
  for (var t = 1; t < arguments.length; t++) {
7391
7391
  var n = arguments[t] != null ? arguments[t] : {};
7392
7392
  t % 2 ? ai(Object(n), !0).forEach(function(a) {
@@ -7595,9 +7595,9 @@ function Ha(e) {
7595
7595
  });
7596
7596
  n.class;
7597
7597
  var i = n.style, o = i === void 0 ? {} : i, s = Sm(n, Nm);
7598
- return Pe(e.tag, ie(ie(ie({}, t), {}, {
7598
+ return Pe(e.tag, re(re(re({}, t), {}, {
7599
7599
  class: r.class,
7600
- style: ie(ie({}, r.style), o)
7600
+ style: re(re({}, r.style), o)
7601
7601
  }, r.attrs), s), a);
7602
7602
  }
7603
7603
  var Lo = !1;
@@ -7782,7 +7782,7 @@ var Fo = de({
7782
7782
  }), o = C(function() {
7783
7783
  return pt("mask", ri(e.mask));
7784
7784
  }), s = C(function() {
7785
- return ym(a.value, ie(ie(ie(ie({}, r.value), i.value), o.value), {}, {
7785
+ return ym(a.value, re(re(re(re({}, r.value), i.value), o.value), {}, {
7786
7786
  symbol: e.symbol,
7787
7787
  title: e.title,
7788
7788
  titleId: e.titleId,
@@ -7851,7 +7851,7 @@ de({
7851
7851
  }), i = C(function() {
7852
7852
  return pt("transform", typeof e.transform == "string" ? tn.transform(e.transform) : e.transform);
7853
7853
  }), o = C(function() {
7854
- var l = bm(e.value.toString(), ie(ie({}, i.value), r.value)), c = l.abstract;
7854
+ var l = bm(e.value.toString(), re(re({}, i.value), r.value)), c = l.abstract;
7855
7855
  return e.counter && (c[0].attributes.class = c[0].attributes.class.replace("fa-layers-text", "")), c[0];
7856
7856
  }), s = C(function() {
7857
7857
  return Ha(o.value, {}, n);
@@ -7942,7 +7942,7 @@ function Wm(e, t, n, a, r, i) {
7942
7942
  key: 0,
7943
7943
  href: n.link,
7944
7944
  target: "_blank",
7945
- class: te(["vi-button", [{ "icon-right": n.iconRight }, { "is-disabled": n.isDisabled }, { "is-loading": n.isLoading }, i.buttonSize, i.buttonMode]])
7945
+ class: ie(["vi-button", [{ "icon-right": n.iconRight }, { "is-disabled": n.isDisabled }, { "is-loading": n.isLoading }, i.buttonSize, i.buttonMode]])
7946
7946
  }, [
7947
7947
  i.icon ? (b(), U(o, {
7948
7948
  key: 0,
@@ -7959,7 +7959,7 @@ function Wm(e, t, n, a, r, i) {
7959
7959
  n.isLoading ? (b(), _("div", zm)) : j("", !0)
7960
7960
  ], 10, Fm)) : (b(), _("button", {
7961
7961
  key: 1,
7962
- class: te(["vi-button", [{ "icon-right": n.iconRight }, { "is-disabled": n.isDisabled }, { "is-loading": n.isLoading }, i.buttonSize, i.buttonMode]]),
7962
+ class: ie(["vi-button", [{ "icon-right": n.iconRight }, { "is-disabled": n.isDisabled }, { "is-loading": n.isLoading }, i.buttonSize, i.buttonMode]]),
7963
7963
  type: n.type,
7964
7964
  onClick: t[0] || (t[0] = (s) => e.$emit("click", s))
7965
7965
  }, [
@@ -8103,7 +8103,7 @@ function og(e, t, n, a, r, i) {
8103
8103
  const o = W("vi-button");
8104
8104
  return n.modelValue ? (b(), _("div", ng, [
8105
8105
  A("div", {
8106
- class: te(["dialog-container", [i.dialogEnterAnimationPosition, i.dialogSize]])
8106
+ class: ie(["dialog-container", [i.dialogEnterAnimationPosition, i.dialogSize]])
8107
8107
  }, [
8108
8108
  A("div", ag, V(n.label), 1),
8109
8109
  A("div", rg, [
@@ -8170,7 +8170,7 @@ function mg(e, t, n, a, r, i) {
8170
8170
  const o = W("font-awesome-icon");
8171
8171
  return n.modelValue ? (b(), _("div", cg, [
8172
8172
  A("div", {
8173
- class: te(["dialog-container", [i.dialogEnterAnimationPosition, i.dialogSize]])
8173
+ class: ie(["dialog-container", [i.dialogEnterAnimationPosition, i.dialogSize]])
8174
8174
  }, [
8175
8175
  A("div", ug, [
8176
8176
  A("div", {
@@ -8370,7 +8370,7 @@ function Ng(e) {
8370
8370
  }
8371
8371
  function ii(e) {
8372
8372
  var t;
8373
- return (li(e.content) ? ae(e.content.props) : null) ?? ae((t = e.data) != null ? t : {});
8373
+ return (li(e.content) ? ne(e.content.props) : null) ?? ne((t = e.data) != null ? t : {});
8374
8374
  }
8375
8375
  function Tg(e) {
8376
8376
  return e ? fe.items.filter((t) => t.containerId === e).length > 0 : fe.items.length > 0;
@@ -8385,7 +8385,7 @@ const B = Ze({}), fe = Ze({
8385
8385
  items: []
8386
8386
  });
8387
8387
  function At() {
8388
- const e = ae(B);
8388
+ const e = ne(B);
8389
8389
  return Object.values(e).reduce((t, n) => [...t, ...n], []);
8390
8390
  }
8391
8391
  function Ig(e) {
@@ -8497,7 +8497,7 @@ function Ke(e) {
8497
8497
  return typeof e == "function";
8498
8498
  }
8499
8499
  function bn(...e) {
8500
- return ne(...e);
8500
+ return Z(...e);
8501
8501
  }
8502
8502
  function Wt(e) {
8503
8503
  return typeof e == "object" && (!!(e != null && e.render) || !!(e != null && e.setup) || typeof (e == null ? void 0 : e.type) == "object");
@@ -8814,7 +8814,7 @@ const Wo = {
8814
8814
  type: t,
8815
8815
  path: n,
8816
8816
  ...a
8817
- }) => N("svg", ne({
8817
+ }) => N("svg", Z({
8818
8818
  viewBox: "0 0 24 24",
8819
8819
  width: "100%",
8820
8820
  height: "100%",
@@ -8823,22 +8823,22 @@ const Wo = {
8823
8823
  d: n
8824
8824
  }, null)]);
8825
8825
  function Ug(e) {
8826
- return N(wn, ne(e, {
8826
+ return N(wn, Z(e, {
8827
8827
  path: "M23.32 17.191L15.438 2.184C14.728.833 13.416 0 11.996 0c-1.42 0-2.733.833-3.443 2.184L.533 17.448a4.744 4.744 0 000 4.368C1.243 23.167 2.555 24 3.975 24h16.05C22.22 24 24 22.044 24 19.632c0-.904-.251-1.746-.68-2.44zm-9.622 1.46c0 1.033-.724 1.823-1.698 1.823s-1.698-.79-1.698-1.822v-.043c0-1.028.724-1.822 1.698-1.822s1.698.79 1.698 1.822v.043zm.039-12.285l-.84 8.06c-.057.581-.408.943-.897.943-.49 0-.84-.367-.896-.942l-.84-8.065c-.057-.624.25-1.095.779-1.095h1.91c.528.005.84.476.784 1.1z"
8828
8828
  }), null);
8829
8829
  }
8830
8830
  function Vg(e) {
8831
- return N(wn, ne(e, {
8831
+ return N(wn, Z(e, {
8832
8832
  path: "M12 0a12 12 0 1012 12A12.013 12.013 0 0012 0zm.25 5a1.5 1.5 0 11-1.5 1.5 1.5 1.5 0 011.5-1.5zm2.25 13.5h-4a1 1 0 010-2h.75a.25.25 0 00.25-.25v-4.5a.25.25 0 00-.25-.25h-.75a1 1 0 010-2h1a2 2 0 012 2v4.75a.25.25 0 00.25.25h.75a1 1 0 110 2z"
8833
8833
  }), null);
8834
8834
  }
8835
8835
  function Wg(e) {
8836
- return N(wn, ne(e, {
8836
+ return N(wn, Z(e, {
8837
8837
  path: "M12 0a12 12 0 1012 12A12.014 12.014 0 0012 0zm6.927 8.2l-6.845 9.289a1.011 1.011 0 01-1.43.188l-4.888-3.908a1 1 0 111.25-1.562l4.076 3.261 6.227-8.451a1 1 0 111.61 1.183z"
8838
8838
  }), null);
8839
8839
  }
8840
8840
  function Yg(e) {
8841
- return N(wn, ne(e, {
8841
+ return N(wn, Z(e, {
8842
8842
  path: "M11.983 0a12.206 12.206 0 00-8.51 3.653A11.8 11.8 0 000 12.207 11.779 11.779 0 0011.8 24h.214A12.111 12.111 0 0024 11.791 11.766 11.766 0 0011.983 0zM10.5 16.542a1.476 1.476 0 011.449-1.53h.027a1.527 1.527 0 011.523 1.47 1.475 1.475 0 01-1.449 1.53h-.027a1.529 1.529 0 01-1.523-1.47zM11 12.5v-6a1 1 0 012 0v6a1 1 0 11-2 0z"
8843
8843
  }), null);
8844
8844
  }
@@ -8865,7 +8865,7 @@ function Gg({
8865
8865
  theme: e,
8866
8866
  type: t
8867
8867
  };
8868
- return n ? r = ka.spinner() : a === !1 ? r = void 0 : Wt(a) ? r = ae(a) : Ke(a) ? r = a(i) : li(a) ? r = Xo(a, i) : xa(a) || Dg(a) ? r = a : qg(t) && (r = ka[t](i)), r;
8868
+ return n ? r = ka.spinner() : a === !1 ? r = void 0 : Wt(a) ? r = ne(a) : Ke(a) ? r = a(i) : li(a) ? r = Xo(a, i) : xa(a) || Dg(a) ? r = a : qg(t) && (r = ka[t](i)), r;
8869
8869
  }
8870
8870
  const Hg = () => {
8871
8871
  };
@@ -8967,7 +8967,7 @@ const Qg = /* @__PURE__ */ de({
8967
8967
  ...zo(e.transition),
8968
8968
  ...e
8969
8969
  });
8970
- return () => N("div", ne({
8970
+ return () => N("div", Z({
8971
8971
  id: e.toastId,
8972
8972
  class: i.value,
8973
8973
  style: e.toastStyle || {},
@@ -8983,7 +8983,7 @@ const Qg = /* @__PURE__ */ de({
8983
8983
  }, [r.value != null && N("div", {
8984
8984
  "data-testid": "toast-icon-".concat(e.type),
8985
8985
  class: ["".concat(T.CSS_NAMESPACE, "__toast-icon"), e.isLoading ? "" : "".concat(T.CSS_NAMESPACE, "--animate-icon ").concat(T.CSS_NAMESPACE, "__zoom-enter")].join(" ")
8986
- }, [Wt(r.value) ? Pe(ae(r.value), {
8986
+ }, [Wt(r.value) ? Pe(ne(r.value), {
8987
8987
  theme: e.theme,
8988
8988
  type: e.type
8989
8989
  }) : Ke(r.value) ? r.value({
@@ -8991,12 +8991,12 @@ const Qg = /* @__PURE__ */ de({
8991
8991
  type: e.type
8992
8992
  }) : r.value]), N("div", {
8993
8993
  "data-testid": "toast-content"
8994
- }, [Wt(e.content) ? Pe(ae(e.content), {
8995
- toastProps: ae(e),
8994
+ }, [Wt(e.content) ? Pe(ne(e.content), {
8995
+ toastProps: ne(e),
8996
8996
  closeToast: l,
8997
8997
  data: e.data
8998
8998
  }) : Ke(e.content) ? e.content({
8999
- toastProps: ae(e),
8999
+ toastProps: ne(e),
9000
9000
  closeToast: l,
9001
9001
  data: e.data
9002
9002
  }) : e.dangerouslyHTMLString ? Pe("div", {
@@ -9006,7 +9006,7 @@ const Qg = /* @__PURE__ */ de({
9006
9006
  closeToast: (u) => {
9007
9007
  u.stopPropagation(), u.preventDefault(), l();
9008
9008
  }
9009
- }, null), Wt(e.closeButton) ? Pe(ae(e.closeButton), {
9009
+ }, null), Wt(e.closeButton) ? Pe(ne(e.closeButton), {
9010
9010
  closeToast: l,
9011
9011
  type: e.type,
9012
9012
  theme: e.theme
@@ -9049,7 +9049,7 @@ const Jg = /* @__PURE__ */ de({
9049
9049
  const {
9050
9050
  toastId: i = ""
9051
9051
  } = r;
9052
- return N(Qg, ne({
9052
+ return N(Qg, Z({
9053
9053
  key: i
9054
9054
  }, r), null);
9055
9055
  })]);
@@ -9080,7 +9080,7 @@ function Ie(e, t, n = {}) {
9080
9080
  return;
9081
9081
  n = bn(Fg(), {
9082
9082
  type: t
9083
- }, ae(n)), (!n.toastId || typeof n.toastId != "string" && typeof n.toastId != "number") && (n.toastId = Vo()), n = {
9083
+ }, ne(n)), (!n.toastId || typeof n.toastId != "string" && typeof n.toastId != "number") && (n.toastId = Vo()), n = {
9084
9084
  ...n,
9085
9085
  content: e,
9086
9086
  containerId: n.containerId || String(n.position)
@@ -9134,7 +9134,7 @@ I.update = (e, t = {}) => {
9134
9134
  setTimeout(() => {
9135
9135
  const n = Ig(e);
9136
9136
  if (n) {
9137
- const a = ae(n), {
9137
+ const a = ne(n), {
9138
9138
  content: r
9139
9139
  } = a, i = {
9140
9140
  ...a,
@@ -9432,7 +9432,7 @@ const N1 = {
9432
9432
  }, T1 = { class: "vi-grid-field" };
9433
9433
  function M1(e, t, n, a, r, i) {
9434
9434
  return b(), _("div", T1, [
9435
- (b(), U(Rt(i.fieldComponent), ne({
9435
+ (b(), U(Rt(i.fieldComponent), Z({
9436
9436
  ...n.field,
9437
9437
  ...e.$attrs
9438
9438
  }, {
@@ -9630,7 +9630,7 @@ function G1(e, t, n, a, r, i) {
9630
9630
  colspan: n.colspan
9631
9631
  }, [
9632
9632
  A("div", {
9633
- class: te(["vi-header-cell-content", n.align])
9633
+ class: ie(["vi-header-cell-content", n.align])
9634
9634
  }, [
9635
9635
  z(e.$slots, "default")
9636
9636
  ], 2)
@@ -9686,7 +9686,7 @@ const K1 = {
9686
9686
  function Q1(e, t, n, a, r, i) {
9687
9687
  const o = W("font-awesome-icon"), s = W("vi-grid-head-cell");
9688
9688
  return b(), U(s, {
9689
- class: te([n.sortableState, "vi-grid-header-column-cell"]),
9689
+ class: ie([n.sortableState, "vi-grid-header-column-cell"]),
9690
9690
  align: n.column.align ?? n.align
9691
9691
  }, {
9692
9692
  default: st(() => [
@@ -9732,6 +9732,7 @@ function Z1(e) {
9732
9732
  }
9733
9733
  const ep = {
9734
9734
  name: "ViGridBuilder",
9735
+ inheritAttrs: !1,
9735
9736
  components: { ViGridHeadColumnCell: J1, ViGridHeadCell: Go, ViGridCheckbox: j1, ViGridField: I1 },
9736
9737
  props: {
9737
9738
  rows: {
@@ -9937,10 +9938,10 @@ function vp(e, t, n, a, r, i) {
9937
9938
  z(e.$slots, "top")
9938
9939
  ])) : j("", !0),
9939
9940
  A("div", {
9940
- class: te(["vi-table-container", { loading: a.isDataLoading }])
9941
+ class: ie(["vi-table-container", { loading: a.isDataLoading }])
9941
9942
  }, [
9942
9943
  A("table", {
9943
- class: te(["vi-table", { stripped: a.settings.stripped, bordered: a.settings.bordered }])
9944
+ class: ie(["vi-table", { stripped: a.settings.stripped, bordered: a.settings.bordered }])
9944
9945
  }, [
9945
9946
  A("thead", ap, [
9946
9947
  n.title ? (b(), _("tr", rp, [
@@ -10016,12 +10017,12 @@ function vp(e, t, n, a, r, i) {
10016
10017
  ])) : (b(), _("tbody", dp, [
10017
10018
  (b(!0), _(_e, null, je(a.currentVisibleRows, (m) => (b(), _("tr", {
10018
10019
  key: m[n.rowKey],
10019
- class: te([{ clickable: n.clickableRow, selected: a.isRowSelected(m) }, "vi-body-row vi-table-row"]),
10020
+ class: ie([{ clickable: n.clickableRow, selected: a.isRowSelected(m) }, "vi-body-row vi-table-row"]),
10020
10021
  onClick: (g) => a.onRowClicked(m)
10021
10022
  }, [
10022
10023
  n.selectable ? (b(), _("td", gp, [
10023
10024
  A("div", {
10024
- class: te(["vi-grid-field", a.settings.align])
10025
+ class: ie(["vi-grid-field", a.settings.align])
10025
10026
  }, [
10026
10027
  N(s, {
10027
10028
  row: m,
@@ -10035,18 +10036,20 @@ function vp(e, t, n, a, r, i) {
10035
10036
  key: g.name,
10036
10037
  class: "vi-body-cell vi-cell"
10037
10038
  }, [
10038
- N(c, {
10039
+ N(c, Z({
10039
10040
  "row-menu-opened": a.rowMenuOpened,
10040
10041
  "onUpdate:rowMenuOpened": t[1] || (t[1] = (y) => a.rowMenuOpened = y),
10041
- class: te(g.align ?? a.settings.align),
10042
+ class: g.align ?? a.settings.align,
10042
10043
  field: g,
10043
10044
  "field-value": g.transform ? g.transform(m) : m[g.name],
10044
10045
  "row-value": m,
10045
10046
  "row-key": n.rowKey,
10047
+ ref_for: !0
10048
+ }, e.$attrs, {
10046
10049
  onActionClicked: (y) => e.$emit(y.action, y.row),
10047
10050
  onCheckboxClicked: (y) => a.toggleRowSelect(m, y.value),
10048
10051
  onRowValueUpdated: t[2] || (t[2] = (...y) => e.$emit("rowValueUpdated", ...y))
10049
- }, null, 8, ["row-menu-opened", "class", "field", "field-value", "row-value", "row-key", "onActionClicked", "onCheckboxClicked"])
10052
+ }), null, 16, ["row-menu-opened", "class", "field", "field-value", "row-value", "row-key", "onActionClicked", "onCheckboxClicked"])
10050
10053
  ]))), 128))
10051
10054
  ], 10, mp))), 128)),
10052
10055
  A("tr", pp, [
@@ -10244,7 +10247,7 @@ function Np(e, t, n, a, r, i) {
10244
10247
  ]),
10245
10248
  i.compactPagination ? j("", !0) : (b(), _("div", Op, [
10246
10249
  (b(!0), _(_e, null, je(i.visiblePages, (s) => (b(), _("div", {
10247
- class: te(["vi-page-number", { active: s === n.currentPage }]),
10250
+ class: ie(["vi-page-number", { active: s === n.currentPage }]),
10248
10251
  key: s,
10249
10252
  onClick: (l) => i.pageChange(s)
10250
10253
  }, V(s), 11, Ap))), 128))
@@ -1122,7 +1122,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
1122
1122
  * Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com
1123
1123
  * License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
1124
1124
  * Copyright 2024 Fonticons, Inc.
1125
- */const Sg={prefix:"fas",iconName:"pen-to-square",icon:[512,512,["edit"],"f044","M471.6 21.7c-21.9-21.9-57.3-21.9-79.2 0L362.3 51.7l97.9 97.9 30.1-30.1c21.9-21.9 21.9-57.3 0-79.2L471.6 21.7zm-299.2 220c-6.1 6.1-10.8 13.6-13.5 21.9l-29.6 88.8c-2.9 8.6-.6 18.1 5.8 24.6s15.9 8.7 24.6 5.8l88.8-29.6c8.2-2.7 15.7-7.4 21.9-13.5L437.7 172.3 339.7 74.3 172.4 241.7zM96 64C43 64 0 107 0 160L0 416c0 53 43 96 96 96l256 0c53 0 96-43 96-96l0-96c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 96c0 17.7-14.3 32-32 32L96 448c-17.7 0-32-14.3-32-32l0-256c0-17.7 14.3-32 32-32l96 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L96 64z"]},Cg=Sg,Pg={prefix:"fas",iconName:"arrow-right",icon:[448,512,[8594],"f061","M438.6 278.6c12.5-12.5 12.5-32.8 0-45.3l-160-160c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L338.8 224 32 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l306.7 0L233.4 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l160-160z"]},_g={prefix:"fas",iconName:"trash",icon:[448,512,[],"f1f8","M135.2 17.7L128 32 32 32C14.3 32 0 46.3 0 64S14.3 96 32 96l384 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-96 0-7.2-14.3C307.4 6.8 296.3 0 284.2 0L163.8 0c-12.1 0-23.2 6.8-28.6 17.7zM416 128L32 128 53.2 467c1.6 25.3 22.6 45 47.9 45l245.8 0c25.3 0 46.3-19.7 47.9-45L416 128z"]},Og={prefix:"fas",iconName:"arrow-left",icon:[448,512,[8592],"f060","M9.4 233.4c-12.5 12.5-12.5 32.8 0 45.3l160 160c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L109.2 288 416 288c17.7 0 32-14.3 32-32s-14.3-32-32-32l-306.7 0L214.6 118.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-160 160z"]},Ag={prefix:"fas",iconName:"plus",icon:[448,512,[10133,61543,"add"],"2b","M256 80c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 144L48 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l144 0 0 144c0 17.7 14.3 32 32 32s32-14.3 32-32l0-144 144 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-144 0 0-144z"]},Eg={prefix:"fas",iconName:"x",icon:[384,512,[120],"58","M376.6 84.5c11.3-13.6 9.5-33.8-4.1-45.1s-33.8-9.5-45.1 4.1L192 206 56.6 43.5C45.3 29.9 25.1 28.1 11.5 39.4S-3.9 70.9 7.4 84.5L150.3 256 7.4 427.5c-11.3 13.6-9.5 33.8 4.1 45.1s33.8 9.5 45.1-4.1L192 306 327.4 468.5c11.3 13.6 31.5 15.4 45.1 4.1s15.4-31.5 4.1-45.1L233.7 256 376.6 84.5z"]},Ng={install(e,{style:t,toastify:n,registerComponentGlobally:a=!1}={}){Fd.add(Ag,_g,Cg,Pg,Og,Eg),a&&(e.component("ViPage",wm),e.component("ViMainHeader",gm),e.component("ViDialog",Im),e.component("ViConfirmationDialog",Om),e.component("ViButton",Ut)),e.use(vi,n??{}),e.config.globalProperties.$toast=E,e.mixin({mounted(){if(t)for(const[r,o]of Object.entries(t))document.documentElement.style.setProperty(`--vi-common-${r}`,o)}})}},g1="",Tg={name:"ViGridSimpleActions",components:{ViButton:Ut},emits:["action-clicked"],props:{actions:{type:Array}}},Mg={class:"vi-grid-builder-actions"};function Dg(e,t,n,a,r,o){const s=i.resolveComponent("vi-button");return i.openBlock(),i.createElementBlock("div",Mg,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(n.actions,(l,c)=>(i.openBlock(),i.createBlock(s,{key:c,label:l.name,mode:l.mode,action:l.action,size:"small",onClick:i.withModifiers(f=>e.$emit("action-clicked",l.action),["prevent"])},null,8,["label","mode","action","onClick"]))),128))])}const Ig=R(Tg,[["render",Dg]]);function Lg(e,t){return{visibleActions:i.computed(()=>e.actions.filter(o=>o.isVisible===void 0?!0:o.isVisible(e.row))),onActionClicked:o=>{t("action-clicked",{action:o,row:e.row})},toggleRowMenu:o=>{e.rowMenuOpened===o[e.rowKey]?t("update:rowMenuOpened",null):t("update:rowMenuOpened",o[e.rowKey])}}}const p1="",Bg={name:"ViGridActions",components:{ViGridSimpleActions:Ig,ViGridKebabMenu:Bf},props:{kebab:{type:Boolean,default:!1},row:{},rowKey:String,actions:{type:Array,default:function(){return[]}},rowMenuOpened:{}},setup(e,{emit:t}){const{visibleActions:n,onActionClicked:a,toggleRowMenu:r}=Lg(e,t);let o=i.ref(null);return i.onMounted(()=>{o.clickOutsideHandler=s=>{e.rowMenuOpened&&o.value&&!(o.value===s.target||o.value.contains(s.target))&&t("update:rowMenuOpened",null)},document.addEventListener("click",o.clickOutsideHandler)}),i.onUnmounted(()=>{document.removeEventListener("click",o.clickOutsideHandler)}),{visibleActions:n,onActionClicked:a,toggleRowMenu:r,gridActions:o}}},Fg={class:"vi-grid-actions",ref:"gridActions"};function Rg(e,t,n,a,r,o){const s=i.resolveComponent("vi-grid-kebab-menu"),l=i.resolveComponent("vi-grid-simple-actions");return i.openBlock(),i.createElementBlock("div",Fg,[n.kebab?(i.openBlock(),i.createBlock(s,{key:0,actions:a.visibleActions,"row-key":n.rowKey,row:n.row,"show-menu":n.row[n.rowKey]===n.rowMenuOpened,onActionClicked:a.onActionClicked,onToggleMenu:t[0]||(t[0]=c=>a.toggleRowMenu(n.row))},null,8,["actions","row-key","row","show-menu","onActionClicked"])):(i.openBlock(),i.createBlock(l,{key:1,actions:a.visibleActions,"row-key":n.rowKey,row:n.row,onActionClicked:a.onActionClicked},null,8,["actions","row-key","row","onActionClicked"]))],512)}const Vg=R(Bg,[["render",Rg]]),h1="",zg={name:"ViGridLink",props:{link:{type:String},row:{type:Object,required:!0},value:{}}},jg={class:"vi-grid-link"},Ug=["href"],Wg={key:1};function Yg(e,t,n,a,r,o){return i.openBlock(),i.createElementBlock("div",jg,[n.link&&n.row[n.link]||!n.link&&n.value?(i.openBlock(),i.createElementBlock("a",{key:0,href:n.row[n.link]??n.value,target:"_blank",onClick:t[0]||(t[0]=s=>s.stopPropagation())},i.toDisplayString(n.value),9,Ug)):(i.openBlock(),i.createElementBlock("div",Wg,i.toDisplayString(n.value),1))])}const $g=R(zg,[["render",Yg]]),y1="",qg={name:"ViGridNumber",props:{value:{},format:{type:Object}},computed:{formattedNumber(){return this.format?new Intl.NumberFormat(void 0,this.format).format(Number(this.value)):this.value}}},Gg={class:"vi-grid-number"};function Hg(e,t,n,a,r,o){return i.openBlock(),i.createElementBlock("div",Gg,i.toDisplayString(o.formattedNumber),1)}const Kg=R(qg,[["render",Hg]]),b1="",Xg={name:"ViGridField",inheritAttrs:!1,components:{ViGridBadge:Ci,ViGridImage:Ei,ViGridText:Ii,ViGridDate:pl,ViGridActions:Vg,ViGridLink:$g,ViGridNumber:Kg},props:{field:{type:Object,required:!0},fieldValue:{},rowValue:{},rowKey:String,rowMenuOpened:{},noDataLabel:{type:String,default:"/"}},computed:{filedValueFormatted(){return this.fieldValue??this.noDataLabel},fieldComponent(){return this.field.type?`vi-grid-${this.field.type}`:"vi-grid-text"}}},Qg={class:"vi-grid-field"};function Jg(e,t,n,a,r,o){return i.openBlock(),i.createElementBlock("div",Qg,[(i.openBlock(),i.createBlock(i.resolveDynamicComponent(o.fieldComponent),i.mergeProps({...n.field,...e.$attrs},{value:o.filedValueFormatted,"original-value":n.fieldValue,row:n.rowValue,"row-key":n.rowKey,"row-menu-opened":n.rowMenuOpened}),null,16,["value","original-value","row","row-key","row-menu-opened"]))])}const Zg=R(Xg,[["render",Jg]]),v1="",ep={name:"ViGridCheckbox",props:{value:{type:Boolean},name:{type:String},row:{type:Object}}},tp={class:"vi-grid-checkbox"},np=["checked"];function ap(e,t,n,a,r,o){return i.openBlock(),i.createElementBlock("div",tp,[i.createElementVNode("input",{type:"checkbox",checked:n.value,onChange:t[0]||(t[0]=s=>e.$emit("checkbox-clicked",{row:this.row,field:this.name,value:s.target.checked})),onClick:t[1]||(t[1]=i.withModifiers(()=>{},["stop"]))},null,40,np)])}const rp=R(ep,[["render",ap]]);function op(e){const t=i.computed(()=>e.columns.filter(a=>a.isVisible===void 0||a.isVisible)),n=i.computed(()=>e.selectable?1+t.value.length:t.value.length);return{visibleColumns:t,totalColumns:n}}const ip={align:"center",bordered:!1,stripped:!0,disablePagination:!1,noDataLabel:"No data",noCellDataLabel:"/",compactPagination:!0,rowsPerPageOptions:[{label:5,value:5},{label:10,value:10},{label:15,value:15},{label:20,value:20}],rowsPerPage:10,defaultSlots:{}},Ca=i.ref({});function sp(e){const t=["align","disablePagination","defaultSlots","noDataLabel","noCellDataLabel","stripped","bordered","compactPagination","rowsPerPageOptions","rowsPerPage"];return{settings:i.computed(()=>{const a=t.reduce((r,o)=>(e[o]!==void 0&&(r[o]=e[o]),r),{});return{...ip,...Ca.value,...a}})}}function lp(e,t,n){const a=i.computed(()=>{var s;return e.serverMode?(s=e.pagination)==null?void 0:s.rowsNumber:e.rows.length}),r=i.computed(()=>{var f;if(e.serverMode||e.disablePagination)return n.value;let s=((f=e.pagination)==null?void 0:f.rowsPerPage)??Ca.value.rowsPerPage;if(s===0)return n.value;const l=(e.pagination.page-1)*s,c=l+s;return n.value.slice(l,c)});return{totalRows:a,currentVisibleRows:r,onRowClicked:s=>{e.clickableRow&&t("rowClicked",s)}}}function cp(e){let t=i.ref(!0),n=i.ref(null),a=i.ref(null),r=i.ref(null);const o=function(b){return r.value!==b?"ascending":n.value==="ascending"?"descending":null},s=function(b,k="text",w="auto"){if(w!=="auto")r.value=b,a.value=k,n.value=w;else{const d=o(b);r.value=d===null?null:b,a.value=d===null?null:k,n.value=d}return{field:r.value,direction:n.value}},l=()=>n.value===null?{}:t.value?{sortBy:[{field:r.value,descending:n.value==="descending"}]}:{sortBy:r.value,descending:n.value==="descending"},c=(b,k,w)=>w==="ascending"?b.sort((d,m)=>Number(d[k])-Number(m[k])):w==="descending"?b.sort((d,m)=>Number(m[k])-Number(d[k])):b,f=(b,k,w)=>w==="ascending"?b.sort((d,m)=>d[k].toString().localeCompare(m[k].toString())):w==="descending"?b.sort((d,m)=>m[k].toString().localeCompare(d[k].toString())):b,u=function(b,k,w,d){return d?w==="number"?c(b,k,d):f(b,k,d):b},g=b=>{t.value=Array.isArray(b.sortBy);const k=b.sortBy?Array.isArray(b.sortBy)?b.sortBy[0].field:b.sortBy:null,w=k?Array.isArray(b.sortBy)?b.sortBy[0].descending:b.descending:null;if(!k)r.value=null,a.value=null,n.value=null;else{let d=e.columns.find(m=>m.name===k);d?s(d.name,d.type,w?"descending":"ascending"):s(k,"text",w?"descending":"ascending")}},p=b=>r.value!==b.name?"unsorted":n.value,v=i.computed(()=>e.serverMode?e.rows??[]:u([...e.rows??[]],r.value,a.value,n.value));return{setSortFieldsFromPagination:g,getSortableState:p,setSortFields:s,formatSortFields:l,clientSort:u,sortedRows:v,sortField:r,sortDirection:n,sortFieldType:a}}function fp(e,t,n){const a=i.computed({get(){var o,s;return{page:(o=e.pagination)==null?void 0:o.page,rowsPerPage:(s=e.pagination)==null?void 0:s.rowsPerPage}},set(o){t("update:pagination",{...e.pagination,...o})}});return{localPagination:a,onPaginationChange:({currentPage:o,rowsPerPage:s})=>{let l={...a.value,...o&&{page:o},...s!==void 0&&{rowsPerPage:s}};a.value=l,e.serverMode&&n({pagination:l})}}}const up={components:{FontAwesomeIcon:Te},props:{align:{type:String,default:"left"},colspan:{type:Number}}},dp=["colspan"];function mp(e,t,n,a,r,o){return i.openBlock(),i.createElementBlock("th",{class:"vi-header-cell vi-cell",colspan:n.colspan},[i.createElementVNode("div",{class:i.normalizeClass(["vi-header-cell-content",n.align])},[i.renderSlot(e.$slots,"default")],2)],8,dp)}const wi=R(up,[["render",mp]]);function gp(e,t,n){let a=i.ref([]);const r=(c,f)=>{f?a.value.push(c[e.rowKey]):a.value=a.value.filter(u=>u!==c[e.rowKey]),t("selectedRowsUpdate",a.value)},o=c=>{if(c)a.value=[...a.value,...n.value.filter(f=>!a.value.includes(f[e.rowKey])).map(f=>f[e.rowKey])];else{const f=n.value.map(u=>u[e.rowKey]);a.value=a.value.filter(u=>!f.includes(u))}t("selectedRowsUpdate",a.value)},s=c=>a.value.includes(c[e.rowKey]),l=i.computed(()=>{const c=n.value.filter(f=>a.value.includes(f[e.rowKey]));return c.length>0&&c.length===n.value.length});return{selectedRows:a,toggleRowSelect:r,toggleMasterSelect:o,isRowSelected:s,areAllRowsSelected:l}}const w1="",pp={components:{ViGridHeadCell:wi,FontAwesomeIcon:Te},props:{column:{type:Object,required:!0},align:{type:String},sortableState:{type:String,required:!0}}},hp={key:0,class:"sort-button"};function yp(e,t,n,a,r,o){const s=i.resolveComponent("font-awesome-icon"),l=i.resolveComponent("vi-grid-head-cell");return i.openBlock(),i.createBlock(l,{class:i.normalizeClass([n.sortableState,"vi-grid-header-column-cell"]),align:n.column.align??n.align},{default:i.withCtx(()=>[i.renderSlot(e.$slots,"default",{},()=>[i.createTextVNode(i.toDisplayString(n.column.label),1)],!0),n.column.sortable?(i.openBlock(),i.createElementBlock("div",hp,[n.sortableState==="descending"?(i.openBlock(),i.createBlock(s,{key:0,icon:["fas","chevron-down"],onClick:t[0]||(t[0]=c=>e.$emit("sort",n.column))})):(i.openBlock(),i.createBlock(s,{key:1,icon:["fas","chevron-up"],onClick:t[1]||(t[1]=c=>e.$emit("sort",n.column))}))])):i.createCommentVNode("",!0)]),_:3},8,["class","align"])}const bp=R(pp,[["render",yp],["__scopeId","data-v-025d85ee"]]);function vp(e){let t=i.ref(null),n=i.ref(!1);const a=({pagination:s,filter:l,search:c}={})=>{const f=s??e.pagination;return n.value=!0,e.fetchServerData({...f&&{pagination:f},filter:l??e.filter,search:c??e.search}).finally(()=>n.value=!1)};return{isFetchingData:n,fetchData:a,reloadData:()=>a({pagination:e.pagination,filter:e.filter,search:t.value}),loadFirstPage:()=>a({pagination:{...e.pagination,page:1},filter:e.filter,search:t.value}),search:t}}const k1="",wp={name:"ViGridBuilder",components:{ViGridHeadColumnCell:bp,ViGridHeadCell:wi,ViGridCheckbox:rp,ViGridField:Zg},props:{rows:{type:Array},rowKey:{type:String},columns:{type:Array,required:!0},title:{type:String},align:{type:String},pagination:{type:Object},disablePagination:{type:Boolean,default:void 0},fetchServerData:{type:Function},fetchOnInit:{type:Boolean,default:!0},filter:{type:Object},loading:{type:Boolean,default:!1},noDataLabel:{type:String},noCellDataLabel:{type:String},clickableRow:{type:Boolean,default:!1},selectable:{type:Boolean,default:!1},serverMode:{type:Boolean,default:!0},stripped:{type:Boolean,default:void 0},bordered:{type:Boolean,default:void 0},compactPagination:{type:Boolean,default:void 0},rowsPerPageOptions:{type:Array}},setup(e,{emit:t}){let n=i.ref(null);const{isFetchingData:a,fetchData:r,search:o,loadFirstPage:s,reloadData:l}=vp(e),{visibleColumns:c,totalColumns:f}=op(e),{setSortFieldsFromPagination:u,getSortableState:g,setSortFields:p,sortField:v,sortDirection:b,formatSortFields:k,sortedRows:w}=cp(e);u(e.pagination);const{localPagination:d,onPaginationChange:m}=fp(e,t,({pagination:Xt})=>r({pagination:{...Xt,...k()}}));i.watch([v,b],(...Xt)=>{e.serverMode?r({pagination:{...e.pagination,page:1,...k()}}):d.value={...d.value,page:1}}),i.watch(()=>e.filter,()=>{s()});const{currentVisibleRows:C,totalRows:P,onRowClicked:_}=lp(e,t,w),{selectedRows:M,toggleMasterSelect:D,toggleRowSelect:Pe,areAllRowsSelected:ct,isRowSelected:Re}=gp(e,t,C),Pa=i.computed(()=>e.loading||a.value);e.serverMode&&e.fetchOnInit&&r();const{settings:_a}=sp(e);return{search:o,isFetchingData:a,totalRows:P,currentVisibleRows:C,visibleColumns:c,totalColumns:f,selectedRows:M,toggleMasterSelect:D,areAllRowsSelected:ct,toggleRowSelect:Pe,setSortFields:p,fetchData:r,isDataLoading:Pa,onRowClicked:_,isRowSelected:Re,getSortableState:g,sortDirection:b,localPagination:d,onPaginationChange:m,rowMenuOpened:n,settings:_a,sortedRows:w,loadFirstPage:s,reloadData:l}}},kp={class:"vi-grid-builder"},xp={key:0,class:"top-container"},Sp={class:"vi-table-head"},Cp={key:0,class:"vi-header-row vi-table-row vi-title-row"},Pp={class:"vi-header-row vi-table-row"},_p={key:1,class:"vi-body-row vi-table-row vi-loading-row"},Op={key:1,class:"loading-bar-container"},Ap={key:0,class:"vi-table-body"},Ep={class:"vi-body-row vi-table-row vi-no-data-row"},Np=["colspan"],Tp={key:1},Mp={key:1,class:"vi-table-body"},Dp=["onClick"],Ip={key:0,class:"vi-cell vi-select-cell"},Lp={class:"vi-body-row vi-table-row vi-footer-row"},Bp=["colspan"];function Fp(e,t,n,a,r,o){const s=i.resolveComponent("vi-grid-head-cell"),l=i.resolveComponent("vi-grid-checkbox"),c=i.resolveComponent("vi-grid-head-column-cell"),f=i.resolveComponent("vi-grid-field"),u=i.resolveComponent("vi-pagination");return i.openBlock(),i.createElementBlock("div",kp,[e.$slots.top?(i.openBlock(),i.createElementBlock("div",xp,[i.renderSlot(e.$slots,"top")])):i.createCommentVNode("",!0),i.createElementVNode("div",{class:i.normalizeClass(["vi-table-container",{loading:a.isDataLoading}])},[i.createElementVNode("table",{class:i.normalizeClass(["vi-table",{stripped:a.settings.stripped,bordered:a.settings.bordered}])},[i.createElementVNode("thead",Sp,[n.title?(i.openBlock(),i.createElementBlock("tr",Cp,[n.title?(i.openBlock(),i.createBlock(s,{key:0,colspan:a.visibleColumns.length,align:"left",class:"vi-title-cell"},{default:i.withCtx(()=>[i.renderSlot(e.$slots,"title",{title:n.title},()=>[i.createElementVNode("span",null,i.toDisplayString(n.title),1)])]),_:3},8,["colspan"])):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0),i.createElementVNode("tr",Pp,[n.selectable?(i.openBlock(),i.createBlock(s,{key:0,class:"vi-select-cell",align:a.settings.align},{default:i.withCtx(()=>[i.createVNode(l,{name:"masterSelect",value:a.areAllRowsSelected,onCheckboxClicked:t[0]||(t[0]=g=>a.toggleMasterSelect(g.value))},null,8,["value"])]),_:1},8,["align"])):i.createCommentVNode("",!0),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(a.visibleColumns,g=>(i.openBlock(),i.createBlock(c,{key:g.name,column:g,align:a.settings.align,"sortable-state":a.getSortableState(g),onSort:a.setSortFields},{default:i.withCtx(()=>[i.renderSlot(e.$slots,`vi-header-cell-${g.name}`,{column:g})]),_:2},1032,["column","align","sortable-state","onSort"]))),128))]),a.isDataLoading?(i.openBlock(),i.createElementBlock("tr",_p,[i.createVNode(s,{colspan:a.totalColumns,class:"vi-loading-cell"},{default:i.withCtx(()=>[i.renderSlot(e.$slots,"loading",{},()=>[a.settings.defaultSlots.loading?(i.openBlock(),i.createBlock(i.resolveDynamicComponent(a.settings.defaultSlots.loading),{key:0})):(i.openBlock(),i.createElementBlock("div",Op,t[3]||(t[3]=[i.createElementVNode("div",{class:"loading-bar"},null,-1)])))])]),_:3},8,["colspan"])])):i.createCommentVNode("",!0)]),!a.currentVisibleRows.length&&!a.isDataLoading?(i.openBlock(),i.createElementBlock("tbody",Ap,[i.createElementVNode("tr",Ep,[i.createElementVNode("td",{class:"vi-body-cell vi-cell",colspan:a.totalColumns},[i.renderSlot(e.$slots,"empty-data",{},()=>[a.settings.defaultSlots.noRows?(i.openBlock(),i.createBlock(i.resolveDynamicComponent(a.settings.defaultSlots.noRows),{key:0})):(i.openBlock(),i.createElementBlock("span",Tp,i.toDisplayString(a.settings.noDataLabel),1))])],8,Np)])])):(i.openBlock(),i.createElementBlock("tbody",Mp,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(a.currentVisibleRows,g=>(i.openBlock(),i.createElementBlock("tr",{key:g[n.rowKey],class:i.normalizeClass([{clickable:n.clickableRow,selected:a.isRowSelected(g)},"vi-body-row vi-table-row"]),onClick:p=>a.onRowClicked(g)},[n.selectable?(i.openBlock(),i.createElementBlock("td",Ip,[i.createElementVNode("div",{class:i.normalizeClass(["vi-grid-field",a.settings.align])},[i.createVNode(l,{row:g,name:n.rowKey,value:a.selectedRows.includes(g[n.rowKey]),onCheckboxClicked:p=>a.toggleRowSelect(g,p.value)},null,8,["row","name","value","onCheckboxClicked"])],2)])):i.createCommentVNode("",!0),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(a.visibleColumns,p=>(i.openBlock(),i.createElementBlock("td",{key:p.name,class:"vi-body-cell vi-cell"},[i.createVNode(f,{"row-menu-opened":a.rowMenuOpened,"onUpdate:rowMenuOpened":t[1]||(t[1]=v=>a.rowMenuOpened=v),class:i.normalizeClass(p.align??a.settings.align),field:p,"field-value":p.transform?p.transform(g):g[p.name],"row-value":g,"row-key":n.rowKey,onActionClicked:v=>e.$emit(v.action,v.row),onCheckboxClicked:v=>a.toggleRowSelect(g,v.value),onRowValueUpdated:t[2]||(t[2]=(...v)=>e.$emit("rowValueUpdated",...v))},null,8,["row-menu-opened","class","field","field-value","row-value","row-key","onActionClicked","onCheckboxClicked"])]))),128))],10,Dp))),128)),i.createElementVNode("tr",Lp,[i.createElementVNode("td",{colspan:a.totalColumns,class:"vi-body-cell vi-cell vi-footer-cell"},[i.renderSlot(e.$slots,"footer",{pagination:{...n.pagination,totalRows:a.totalRows}},()=>[a.settings.defaultSlots.footer?(i.openBlock(),i.createBlock(i.resolveDynamicComponent(a.settings.defaultSlots.footer),{key:0,pagination:{...n.pagination,totalRows:a.totalRows}},null,8,["pagination"])):i.createCommentVNode("",!0),a.settings.disablePagination?i.createCommentVNode("",!0):(i.openBlock(),i.createBlock(u,{key:1,"rows-per-page":a.localPagination.rowsPerPage??a.settings.rowsPerPage,"current-page":a.localPagination.page,"total-rows":a.totalRows,"max-pages-displayed":3,compact:a.settings.compactPagination,"rows-per-page-options":a.settings.rowsPerPageOptions,onUpdate:a.onPaginationChange},null,8,["rows-per-page","current-page","total-rows","compact","rows-per-page-options","onUpdate"]))])],8,Bp)])]))],2)],2),i.renderSlot(e.$slots,"bottom")])}const Rp=R(wp,[["render",Fp]]),ki={format:{date:"yyyy-MM-dd",dateTime:"yyyy-MM-dd HH:mm:ss",time:"HH:mm:ss"},mode:"dateTime"},x1="",Vp={name:"ViPagination",components:{FontAwesomeIcon:Te},props:{rowsPerPage:{type:Number,required:!0},rowsPerPageOptions:{type:Array},totalRows:{type:Number,required:!0},currentPage:{type:Number,required:!0},maxPagesDisplayed:{type:Number,default:3},options:{type:Object,default:function(){return{rowsPerPageOptions:[{label:5,value:5},{label:10,value:10},{label:15,value:15},{label:20,value:20}]}}},compact:{type:Boolean}},computed:{totalPages(){return Math.ceil(this.totalRows/this.rowsOnPage)},firsVisiblePage(){return this.visiblePages[0]},lastVisiblePage(){return this.visiblePages[this.visiblePages.length-1]},firstVisibleRow(){return this.currentPage===1?1:(this.currentPage-1)*this.rowsOnPage},lastVisibleRow(){return this.currentPage===this.totalPages?this.totalRows:this.currentPage*this.rowsOnPage},visiblePages(){let e,t;if(this.totalPages<=this.maxPagesDisplayed)e=1,t=this.totalPages;else{const n=Math.floor(this.maxPagesDisplayed/2);e=Math.max(this.currentPage-n,1),t=e+this.maxPagesDisplayed-1,t>this.totalPages&&(t=this.totalPages,e=t-this.maxPagesDisplayed+1)}return Array.from({length:t-e+1},(n,a)=>e+a)},rowsOnPage(){return this.rowsPerPage>0?this.rowsPerPage:this.totalRows},compactPagination(){var e;return this.compact!==void 0?this.compact:((e=this.ViPaginationSettings)==null?void 0:e.compact)??!1}},methods:{paginationChange({currentPage:e,rowsPerPage:t}){let n={currentPage:e!==void 0?parseInt(e):this.currentPage,rowsPerPage:t!==void 0?parseInt(t):this.rowsPerPage};this.$emit("update",n)},pageChange(e){if(e===this.currentPage||e>this.totalPages||e<1)return!1;this.$emit("update:currentPage",parseInt(e)),this.paginationChange({currentPage:e})},rowsPerPageChange(e){const t=e.target.value;if(t===this.rowsPerPage)return!1;this.$emit("update:rowsPerPage",parseInt(t)),this.paginationChange({rowsPerPage:t,currentPage:1})}}},zp={class:"vi-pagination"},jp={class:"vi-rows-per-page"},Up=["value"],Wp=["value"],Yp={key:0},$p={class:"vi-pages-navigator"},qp={class:"page-actions"},Gp={key:0,class:"page-numbers-container"},Hp=["onClick"],Kp={class:"page-actions"};function Xp(e,t,n,a,r,o){const s=i.resolveComponent("font-awesome-icon");return i.openBlock(),i.createElementBlock("div",zp,[i.createElementVNode("div",jp,[i.renderSlot(e.$slots,"rows-per-page",{rowsPerPage:o.rowsOnPage,rowsPerPageUpdate:o.rowsPerPageChange},()=>[t[5]||(t[5]=i.createElementVNode("span",null,"Rows per page ",-1)),i.createElementVNode("select",{value:n.rowsPerPage,onChange:t[0]||(t[0]=(...l)=>o.rowsPerPageChange&&o.rowsPerPageChange(...l))},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(n.rowsPerPageOptions,l=>(i.openBlock(),i.createElementBlock("option",{key:l.value,value:l.value},i.toDisplayString(l.label),9,Wp))),128))],40,Up)])]),i.renderSlot(e.$slots,"visible-rows-info",{totalRows:n.totalRows,firstVisibleRow:o.firstVisibleRow,lastVisibleRow:o.lastVisibleRow},()=>[n.totalRows>0?(i.openBlock(),i.createElementBlock("div",Yp," Showing "+i.toDisplayString(o.firstVisibleRow)+" - "+i.toDisplayString(o.lastVisibleRow)+" of "+i.toDisplayString(n.totalRows),1)):i.createCommentVNode("",!0)]),i.createElementVNode("div",$p,[i.renderSlot(e.$slots,"navigation-prev",{},()=>[i.createElementVNode("div",qp,[i.createElementVNode("div",{onClick:t[1]||(t[1]=l=>o.pageChange(1)),class:"vi-page-nav vi-page-first"},[i.createVNode(s,{icon:["fas","angles-left"],size:"lg"})]),i.createElementVNode("div",{onClick:t[2]||(t[2]=l=>o.pageChange(n.currentPage-1)),class:"vi-page-nav vi-page-prev"},[i.createVNode(s,{icon:["fas","angle-left"]})])])]),o.compactPagination?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",Gp,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(o.visiblePages,l=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(["vi-page-number",{active:l===n.currentPage}]),key:l,onClick:c=>o.pageChange(l)},i.toDisplayString(l),11,Hp))),128))])),i.renderSlot(e.$slots,"navigation-next",{},()=>[i.createElementVNode("div",Kp,[i.createElementVNode("div",{onClick:t[3]||(t[3]=l=>o.pageChange(n.currentPage+1)),class:"vi-page-nav vi-page-next"},[i.createVNode(s,{icon:["fas","angle-right"]})]),i.createElementVNode("div",{onClick:t[4]||(t[4]=l=>o.pageChange(o.totalPages)),class:"vi-page-nav vi-page-last"},[i.createVNode(s,{icon:["fas","angles-right"],size:"lg"})])])])])])}const Qp=R(Vp,[["render",Xp]]);/*!
1125
+ */const Sg={prefix:"fas",iconName:"pen-to-square",icon:[512,512,["edit"],"f044","M471.6 21.7c-21.9-21.9-57.3-21.9-79.2 0L362.3 51.7l97.9 97.9 30.1-30.1c21.9-21.9 21.9-57.3 0-79.2L471.6 21.7zm-299.2 220c-6.1 6.1-10.8 13.6-13.5 21.9l-29.6 88.8c-2.9 8.6-.6 18.1 5.8 24.6s15.9 8.7 24.6 5.8l88.8-29.6c8.2-2.7 15.7-7.4 21.9-13.5L437.7 172.3 339.7 74.3 172.4 241.7zM96 64C43 64 0 107 0 160L0 416c0 53 43 96 96 96l256 0c53 0 96-43 96-96l0-96c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 96c0 17.7-14.3 32-32 32L96 448c-17.7 0-32-14.3-32-32l0-256c0-17.7 14.3-32 32-32l96 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L96 64z"]},Cg=Sg,Pg={prefix:"fas",iconName:"arrow-right",icon:[448,512,[8594],"f061","M438.6 278.6c12.5-12.5 12.5-32.8 0-45.3l-160-160c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L338.8 224 32 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l306.7 0L233.4 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l160-160z"]},_g={prefix:"fas",iconName:"trash",icon:[448,512,[],"f1f8","M135.2 17.7L128 32 32 32C14.3 32 0 46.3 0 64S14.3 96 32 96l384 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-96 0-7.2-14.3C307.4 6.8 296.3 0 284.2 0L163.8 0c-12.1 0-23.2 6.8-28.6 17.7zM416 128L32 128 53.2 467c1.6 25.3 22.6 45 47.9 45l245.8 0c25.3 0 46.3-19.7 47.9-45L416 128z"]},Og={prefix:"fas",iconName:"arrow-left",icon:[448,512,[8592],"f060","M9.4 233.4c-12.5 12.5-12.5 32.8 0 45.3l160 160c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L109.2 288 416 288c17.7 0 32-14.3 32-32s-14.3-32-32-32l-306.7 0L214.6 118.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-160 160z"]},Ag={prefix:"fas",iconName:"plus",icon:[448,512,[10133,61543,"add"],"2b","M256 80c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 144L48 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l144 0 0 144c0 17.7 14.3 32 32 32s32-14.3 32-32l0-144 144 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-144 0 0-144z"]},Eg={prefix:"fas",iconName:"x",icon:[384,512,[120],"58","M376.6 84.5c11.3-13.6 9.5-33.8-4.1-45.1s-33.8-9.5-45.1 4.1L192 206 56.6 43.5C45.3 29.9 25.1 28.1 11.5 39.4S-3.9 70.9 7.4 84.5L150.3 256 7.4 427.5c-11.3 13.6-9.5 33.8 4.1 45.1s33.8 9.5 45.1-4.1L192 306 327.4 468.5c11.3 13.6 31.5 15.4 45.1 4.1s15.4-31.5 4.1-45.1L233.7 256 376.6 84.5z"]},Ng={install(e,{style:t,toastify:n,registerComponentGlobally:a=!1}={}){Fd.add(Ag,_g,Cg,Pg,Og,Eg),a&&(e.component("ViPage",wm),e.component("ViMainHeader",gm),e.component("ViDialog",Im),e.component("ViConfirmationDialog",Om),e.component("ViButton",Ut)),e.use(vi,n??{}),e.config.globalProperties.$toast=E,e.mixin({mounted(){if(t)for(const[r,o]of Object.entries(t))document.documentElement.style.setProperty(`--vi-common-${r}`,o)}})}},g1="",Tg={name:"ViGridSimpleActions",components:{ViButton:Ut},emits:["action-clicked"],props:{actions:{type:Array}}},Mg={class:"vi-grid-builder-actions"};function Dg(e,t,n,a,r,o){const s=i.resolveComponent("vi-button");return i.openBlock(),i.createElementBlock("div",Mg,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(n.actions,(l,c)=>(i.openBlock(),i.createBlock(s,{key:c,label:l.name,mode:l.mode,action:l.action,size:"small",onClick:i.withModifiers(f=>e.$emit("action-clicked",l.action),["prevent"])},null,8,["label","mode","action","onClick"]))),128))])}const Ig=R(Tg,[["render",Dg]]);function Lg(e,t){return{visibleActions:i.computed(()=>e.actions.filter(o=>o.isVisible===void 0?!0:o.isVisible(e.row))),onActionClicked:o=>{t("action-clicked",{action:o,row:e.row})},toggleRowMenu:o=>{e.rowMenuOpened===o[e.rowKey]?t("update:rowMenuOpened",null):t("update:rowMenuOpened",o[e.rowKey])}}}const p1="",Bg={name:"ViGridActions",components:{ViGridSimpleActions:Ig,ViGridKebabMenu:Bf},props:{kebab:{type:Boolean,default:!1},row:{},rowKey:String,actions:{type:Array,default:function(){return[]}},rowMenuOpened:{}},setup(e,{emit:t}){const{visibleActions:n,onActionClicked:a,toggleRowMenu:r}=Lg(e,t);let o=i.ref(null);return i.onMounted(()=>{o.clickOutsideHandler=s=>{e.rowMenuOpened&&o.value&&!(o.value===s.target||o.value.contains(s.target))&&t("update:rowMenuOpened",null)},document.addEventListener("click",o.clickOutsideHandler)}),i.onUnmounted(()=>{document.removeEventListener("click",o.clickOutsideHandler)}),{visibleActions:n,onActionClicked:a,toggleRowMenu:r,gridActions:o}}},Fg={class:"vi-grid-actions",ref:"gridActions"};function Rg(e,t,n,a,r,o){const s=i.resolveComponent("vi-grid-kebab-menu"),l=i.resolveComponent("vi-grid-simple-actions");return i.openBlock(),i.createElementBlock("div",Fg,[n.kebab?(i.openBlock(),i.createBlock(s,{key:0,actions:a.visibleActions,"row-key":n.rowKey,row:n.row,"show-menu":n.row[n.rowKey]===n.rowMenuOpened,onActionClicked:a.onActionClicked,onToggleMenu:t[0]||(t[0]=c=>a.toggleRowMenu(n.row))},null,8,["actions","row-key","row","show-menu","onActionClicked"])):(i.openBlock(),i.createBlock(l,{key:1,actions:a.visibleActions,"row-key":n.rowKey,row:n.row,onActionClicked:a.onActionClicked},null,8,["actions","row-key","row","onActionClicked"]))],512)}const Vg=R(Bg,[["render",Rg]]),h1="",zg={name:"ViGridLink",props:{link:{type:String},row:{type:Object,required:!0},value:{}}},jg={class:"vi-grid-link"},Ug=["href"],Wg={key:1};function Yg(e,t,n,a,r,o){return i.openBlock(),i.createElementBlock("div",jg,[n.link&&n.row[n.link]||!n.link&&n.value?(i.openBlock(),i.createElementBlock("a",{key:0,href:n.row[n.link]??n.value,target:"_blank",onClick:t[0]||(t[0]=s=>s.stopPropagation())},i.toDisplayString(n.value),9,Ug)):(i.openBlock(),i.createElementBlock("div",Wg,i.toDisplayString(n.value),1))])}const $g=R(zg,[["render",Yg]]),y1="",qg={name:"ViGridNumber",props:{value:{},format:{type:Object}},computed:{formattedNumber(){return this.format?new Intl.NumberFormat(void 0,this.format).format(Number(this.value)):this.value}}},Gg={class:"vi-grid-number"};function Hg(e,t,n,a,r,o){return i.openBlock(),i.createElementBlock("div",Gg,i.toDisplayString(o.formattedNumber),1)}const Kg=R(qg,[["render",Hg]]),b1="",Xg={name:"ViGridField",inheritAttrs:!1,components:{ViGridBadge:Ci,ViGridImage:Ei,ViGridText:Ii,ViGridDate:pl,ViGridActions:Vg,ViGridLink:$g,ViGridNumber:Kg},props:{field:{type:Object,required:!0},fieldValue:{},rowValue:{},rowKey:String,rowMenuOpened:{},noDataLabel:{type:String,default:"/"}},computed:{filedValueFormatted(){return this.fieldValue??this.noDataLabel},fieldComponent(){return this.field.type?`vi-grid-${this.field.type}`:"vi-grid-text"}}},Qg={class:"vi-grid-field"};function Jg(e,t,n,a,r,o){return i.openBlock(),i.createElementBlock("div",Qg,[(i.openBlock(),i.createBlock(i.resolveDynamicComponent(o.fieldComponent),i.mergeProps({...n.field,...e.$attrs},{value:o.filedValueFormatted,"original-value":n.fieldValue,row:n.rowValue,"row-key":n.rowKey,"row-menu-opened":n.rowMenuOpened}),null,16,["value","original-value","row","row-key","row-menu-opened"]))])}const Zg=R(Xg,[["render",Jg]]),v1="",ep={name:"ViGridCheckbox",props:{value:{type:Boolean},name:{type:String},row:{type:Object}}},tp={class:"vi-grid-checkbox"},np=["checked"];function ap(e,t,n,a,r,o){return i.openBlock(),i.createElementBlock("div",tp,[i.createElementVNode("input",{type:"checkbox",checked:n.value,onChange:t[0]||(t[0]=s=>e.$emit("checkbox-clicked",{row:this.row,field:this.name,value:s.target.checked})),onClick:t[1]||(t[1]=i.withModifiers(()=>{},["stop"]))},null,40,np)])}const rp=R(ep,[["render",ap]]);function op(e){const t=i.computed(()=>e.columns.filter(a=>a.isVisible===void 0||a.isVisible)),n=i.computed(()=>e.selectable?1+t.value.length:t.value.length);return{visibleColumns:t,totalColumns:n}}const ip={align:"center",bordered:!1,stripped:!0,disablePagination:!1,noDataLabel:"No data",noCellDataLabel:"/",compactPagination:!0,rowsPerPageOptions:[{label:5,value:5},{label:10,value:10},{label:15,value:15},{label:20,value:20}],rowsPerPage:10,defaultSlots:{}},Ca=i.ref({});function sp(e){const t=["align","disablePagination","defaultSlots","noDataLabel","noCellDataLabel","stripped","bordered","compactPagination","rowsPerPageOptions","rowsPerPage"];return{settings:i.computed(()=>{const a=t.reduce((r,o)=>(e[o]!==void 0&&(r[o]=e[o]),r),{});return{...ip,...Ca.value,...a}})}}function lp(e,t,n){const a=i.computed(()=>{var s;return e.serverMode?(s=e.pagination)==null?void 0:s.rowsNumber:e.rows.length}),r=i.computed(()=>{var f;if(e.serverMode||e.disablePagination)return n.value;let s=((f=e.pagination)==null?void 0:f.rowsPerPage)??Ca.value.rowsPerPage;if(s===0)return n.value;const l=(e.pagination.page-1)*s,c=l+s;return n.value.slice(l,c)});return{totalRows:a,currentVisibleRows:r,onRowClicked:s=>{e.clickableRow&&t("rowClicked",s)}}}function cp(e){let t=i.ref(!0),n=i.ref(null),a=i.ref(null),r=i.ref(null);const o=function(b){return r.value!==b?"ascending":n.value==="ascending"?"descending":null},s=function(b,k="text",w="auto"){if(w!=="auto")r.value=b,a.value=k,n.value=w;else{const d=o(b);r.value=d===null?null:b,a.value=d===null?null:k,n.value=d}return{field:r.value,direction:n.value}},l=()=>n.value===null?{}:t.value?{sortBy:[{field:r.value,descending:n.value==="descending"}]}:{sortBy:r.value,descending:n.value==="descending"},c=(b,k,w)=>w==="ascending"?b.sort((d,m)=>Number(d[k])-Number(m[k])):w==="descending"?b.sort((d,m)=>Number(m[k])-Number(d[k])):b,f=(b,k,w)=>w==="ascending"?b.sort((d,m)=>d[k].toString().localeCompare(m[k].toString())):w==="descending"?b.sort((d,m)=>m[k].toString().localeCompare(d[k].toString())):b,u=function(b,k,w,d){return d?w==="number"?c(b,k,d):f(b,k,d):b},g=b=>{t.value=Array.isArray(b.sortBy);const k=b.sortBy?Array.isArray(b.sortBy)?b.sortBy[0].field:b.sortBy:null,w=k?Array.isArray(b.sortBy)?b.sortBy[0].descending:b.descending:null;if(!k)r.value=null,a.value=null,n.value=null;else{let d=e.columns.find(m=>m.name===k);d?s(d.name,d.type,w?"descending":"ascending"):s(k,"text",w?"descending":"ascending")}},p=b=>r.value!==b.name?"unsorted":n.value,v=i.computed(()=>e.serverMode?e.rows??[]:u([...e.rows??[]],r.value,a.value,n.value));return{setSortFieldsFromPagination:g,getSortableState:p,setSortFields:s,formatSortFields:l,clientSort:u,sortedRows:v,sortField:r,sortDirection:n,sortFieldType:a}}function fp(e,t,n){const a=i.computed({get(){var o,s;return{page:(o=e.pagination)==null?void 0:o.page,rowsPerPage:(s=e.pagination)==null?void 0:s.rowsPerPage}},set(o){t("update:pagination",{...e.pagination,...o})}});return{localPagination:a,onPaginationChange:({currentPage:o,rowsPerPage:s})=>{let l={...a.value,...o&&{page:o},...s!==void 0&&{rowsPerPage:s}};a.value=l,e.serverMode&&n({pagination:l})}}}const up={components:{FontAwesomeIcon:Te},props:{align:{type:String,default:"left"},colspan:{type:Number}}},dp=["colspan"];function mp(e,t,n,a,r,o){return i.openBlock(),i.createElementBlock("th",{class:"vi-header-cell vi-cell",colspan:n.colspan},[i.createElementVNode("div",{class:i.normalizeClass(["vi-header-cell-content",n.align])},[i.renderSlot(e.$slots,"default")],2)],8,dp)}const wi=R(up,[["render",mp]]);function gp(e,t,n){let a=i.ref([]);const r=(c,f)=>{f?a.value.push(c[e.rowKey]):a.value=a.value.filter(u=>u!==c[e.rowKey]),t("selectedRowsUpdate",a.value)},o=c=>{if(c)a.value=[...a.value,...n.value.filter(f=>!a.value.includes(f[e.rowKey])).map(f=>f[e.rowKey])];else{const f=n.value.map(u=>u[e.rowKey]);a.value=a.value.filter(u=>!f.includes(u))}t("selectedRowsUpdate",a.value)},s=c=>a.value.includes(c[e.rowKey]),l=i.computed(()=>{const c=n.value.filter(f=>a.value.includes(f[e.rowKey]));return c.length>0&&c.length===n.value.length});return{selectedRows:a,toggleRowSelect:r,toggleMasterSelect:o,isRowSelected:s,areAllRowsSelected:l}}const w1="",pp={components:{ViGridHeadCell:wi,FontAwesomeIcon:Te},props:{column:{type:Object,required:!0},align:{type:String},sortableState:{type:String,required:!0}}},hp={key:0,class:"sort-button"};function yp(e,t,n,a,r,o){const s=i.resolveComponent("font-awesome-icon"),l=i.resolveComponent("vi-grid-head-cell");return i.openBlock(),i.createBlock(l,{class:i.normalizeClass([n.sortableState,"vi-grid-header-column-cell"]),align:n.column.align??n.align},{default:i.withCtx(()=>[i.renderSlot(e.$slots,"default",{},()=>[i.createTextVNode(i.toDisplayString(n.column.label),1)],!0),n.column.sortable?(i.openBlock(),i.createElementBlock("div",hp,[n.sortableState==="descending"?(i.openBlock(),i.createBlock(s,{key:0,icon:["fas","chevron-down"],onClick:t[0]||(t[0]=c=>e.$emit("sort",n.column))})):(i.openBlock(),i.createBlock(s,{key:1,icon:["fas","chevron-up"],onClick:t[1]||(t[1]=c=>e.$emit("sort",n.column))}))])):i.createCommentVNode("",!0)]),_:3},8,["class","align"])}const bp=R(pp,[["render",yp],["__scopeId","data-v-025d85ee"]]);function vp(e){let t=i.ref(null),n=i.ref(!1);const a=({pagination:s,filter:l,search:c}={})=>{const f=s??e.pagination;return n.value=!0,e.fetchServerData({...f&&{pagination:f},filter:l??e.filter,search:c??e.search}).finally(()=>n.value=!1)};return{isFetchingData:n,fetchData:a,reloadData:()=>a({pagination:e.pagination,filter:e.filter,search:t.value}),loadFirstPage:()=>a({pagination:{...e.pagination,page:1},filter:e.filter,search:t.value}),search:t}}const k1="",wp={name:"ViGridBuilder",inheritAttrs:!1,components:{ViGridHeadColumnCell:bp,ViGridHeadCell:wi,ViGridCheckbox:rp,ViGridField:Zg},props:{rows:{type:Array},rowKey:{type:String},columns:{type:Array,required:!0},title:{type:String},align:{type:String},pagination:{type:Object},disablePagination:{type:Boolean,default:void 0},fetchServerData:{type:Function},fetchOnInit:{type:Boolean,default:!0},filter:{type:Object},loading:{type:Boolean,default:!1},noDataLabel:{type:String},noCellDataLabel:{type:String},clickableRow:{type:Boolean,default:!1},selectable:{type:Boolean,default:!1},serverMode:{type:Boolean,default:!0},stripped:{type:Boolean,default:void 0},bordered:{type:Boolean,default:void 0},compactPagination:{type:Boolean,default:void 0},rowsPerPageOptions:{type:Array}},setup(e,{emit:t}){let n=i.ref(null);const{isFetchingData:a,fetchData:r,search:o,loadFirstPage:s,reloadData:l}=vp(e),{visibleColumns:c,totalColumns:f}=op(e),{setSortFieldsFromPagination:u,getSortableState:g,setSortFields:p,sortField:v,sortDirection:b,formatSortFields:k,sortedRows:w}=cp(e);u(e.pagination);const{localPagination:d,onPaginationChange:m}=fp(e,t,({pagination:Xt})=>r({pagination:{...Xt,...k()}}));i.watch([v,b],(...Xt)=>{e.serverMode?r({pagination:{...e.pagination,page:1,...k()}}):d.value={...d.value,page:1}}),i.watch(()=>e.filter,()=>{s()});const{currentVisibleRows:C,totalRows:P,onRowClicked:_}=lp(e,t,w),{selectedRows:M,toggleMasterSelect:D,toggleRowSelect:Pe,areAllRowsSelected:ct,isRowSelected:Re}=gp(e,t,C),Pa=i.computed(()=>e.loading||a.value);e.serverMode&&e.fetchOnInit&&r();const{settings:_a}=sp(e);return{search:o,isFetchingData:a,totalRows:P,currentVisibleRows:C,visibleColumns:c,totalColumns:f,selectedRows:M,toggleMasterSelect:D,areAllRowsSelected:ct,toggleRowSelect:Pe,setSortFields:p,fetchData:r,isDataLoading:Pa,onRowClicked:_,isRowSelected:Re,getSortableState:g,sortDirection:b,localPagination:d,onPaginationChange:m,rowMenuOpened:n,settings:_a,sortedRows:w,loadFirstPage:s,reloadData:l}}},kp={class:"vi-grid-builder"},xp={key:0,class:"top-container"},Sp={class:"vi-table-head"},Cp={key:0,class:"vi-header-row vi-table-row vi-title-row"},Pp={class:"vi-header-row vi-table-row"},_p={key:1,class:"vi-body-row vi-table-row vi-loading-row"},Op={key:1,class:"loading-bar-container"},Ap={key:0,class:"vi-table-body"},Ep={class:"vi-body-row vi-table-row vi-no-data-row"},Np=["colspan"],Tp={key:1},Mp={key:1,class:"vi-table-body"},Dp=["onClick"],Ip={key:0,class:"vi-cell vi-select-cell"},Lp={class:"vi-body-row vi-table-row vi-footer-row"},Bp=["colspan"];function Fp(e,t,n,a,r,o){const s=i.resolveComponent("vi-grid-head-cell"),l=i.resolveComponent("vi-grid-checkbox"),c=i.resolveComponent("vi-grid-head-column-cell"),f=i.resolveComponent("vi-grid-field"),u=i.resolveComponent("vi-pagination");return i.openBlock(),i.createElementBlock("div",kp,[e.$slots.top?(i.openBlock(),i.createElementBlock("div",xp,[i.renderSlot(e.$slots,"top")])):i.createCommentVNode("",!0),i.createElementVNode("div",{class:i.normalizeClass(["vi-table-container",{loading:a.isDataLoading}])},[i.createElementVNode("table",{class:i.normalizeClass(["vi-table",{stripped:a.settings.stripped,bordered:a.settings.bordered}])},[i.createElementVNode("thead",Sp,[n.title?(i.openBlock(),i.createElementBlock("tr",Cp,[n.title?(i.openBlock(),i.createBlock(s,{key:0,colspan:a.visibleColumns.length,align:"left",class:"vi-title-cell"},{default:i.withCtx(()=>[i.renderSlot(e.$slots,"title",{title:n.title},()=>[i.createElementVNode("span",null,i.toDisplayString(n.title),1)])]),_:3},8,["colspan"])):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0),i.createElementVNode("tr",Pp,[n.selectable?(i.openBlock(),i.createBlock(s,{key:0,class:"vi-select-cell",align:a.settings.align},{default:i.withCtx(()=>[i.createVNode(l,{name:"masterSelect",value:a.areAllRowsSelected,onCheckboxClicked:t[0]||(t[0]=g=>a.toggleMasterSelect(g.value))},null,8,["value"])]),_:1},8,["align"])):i.createCommentVNode("",!0),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(a.visibleColumns,g=>(i.openBlock(),i.createBlock(c,{key:g.name,column:g,align:a.settings.align,"sortable-state":a.getSortableState(g),onSort:a.setSortFields},{default:i.withCtx(()=>[i.renderSlot(e.$slots,`vi-header-cell-${g.name}`,{column:g})]),_:2},1032,["column","align","sortable-state","onSort"]))),128))]),a.isDataLoading?(i.openBlock(),i.createElementBlock("tr",_p,[i.createVNode(s,{colspan:a.totalColumns,class:"vi-loading-cell"},{default:i.withCtx(()=>[i.renderSlot(e.$slots,"loading",{},()=>[a.settings.defaultSlots.loading?(i.openBlock(),i.createBlock(i.resolveDynamicComponent(a.settings.defaultSlots.loading),{key:0})):(i.openBlock(),i.createElementBlock("div",Op,t[3]||(t[3]=[i.createElementVNode("div",{class:"loading-bar"},null,-1)])))])]),_:3},8,["colspan"])])):i.createCommentVNode("",!0)]),!a.currentVisibleRows.length&&!a.isDataLoading?(i.openBlock(),i.createElementBlock("tbody",Ap,[i.createElementVNode("tr",Ep,[i.createElementVNode("td",{class:"vi-body-cell vi-cell",colspan:a.totalColumns},[i.renderSlot(e.$slots,"empty-data",{},()=>[a.settings.defaultSlots.noRows?(i.openBlock(),i.createBlock(i.resolveDynamicComponent(a.settings.defaultSlots.noRows),{key:0})):(i.openBlock(),i.createElementBlock("span",Tp,i.toDisplayString(a.settings.noDataLabel),1))])],8,Np)])])):(i.openBlock(),i.createElementBlock("tbody",Mp,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(a.currentVisibleRows,g=>(i.openBlock(),i.createElementBlock("tr",{key:g[n.rowKey],class:i.normalizeClass([{clickable:n.clickableRow,selected:a.isRowSelected(g)},"vi-body-row vi-table-row"]),onClick:p=>a.onRowClicked(g)},[n.selectable?(i.openBlock(),i.createElementBlock("td",Ip,[i.createElementVNode("div",{class:i.normalizeClass(["vi-grid-field",a.settings.align])},[i.createVNode(l,{row:g,name:n.rowKey,value:a.selectedRows.includes(g[n.rowKey]),onCheckboxClicked:p=>a.toggleRowSelect(g,p.value)},null,8,["row","name","value","onCheckboxClicked"])],2)])):i.createCommentVNode("",!0),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(a.visibleColumns,p=>(i.openBlock(),i.createElementBlock("td",{key:p.name,class:"vi-body-cell vi-cell"},[i.createVNode(f,i.mergeProps({"row-menu-opened":a.rowMenuOpened,"onUpdate:rowMenuOpened":t[1]||(t[1]=v=>a.rowMenuOpened=v),class:p.align??a.settings.align,field:p,"field-value":p.transform?p.transform(g):g[p.name],"row-value":g,"row-key":n.rowKey,ref_for:!0},e.$attrs,{onActionClicked:v=>e.$emit(v.action,v.row),onCheckboxClicked:v=>a.toggleRowSelect(g,v.value),onRowValueUpdated:t[2]||(t[2]=(...v)=>e.$emit("rowValueUpdated",...v))}),null,16,["row-menu-opened","class","field","field-value","row-value","row-key","onActionClicked","onCheckboxClicked"])]))),128))],10,Dp))),128)),i.createElementVNode("tr",Lp,[i.createElementVNode("td",{colspan:a.totalColumns,class:"vi-body-cell vi-cell vi-footer-cell"},[i.renderSlot(e.$slots,"footer",{pagination:{...n.pagination,totalRows:a.totalRows}},()=>[a.settings.defaultSlots.footer?(i.openBlock(),i.createBlock(i.resolveDynamicComponent(a.settings.defaultSlots.footer),{key:0,pagination:{...n.pagination,totalRows:a.totalRows}},null,8,["pagination"])):i.createCommentVNode("",!0),a.settings.disablePagination?i.createCommentVNode("",!0):(i.openBlock(),i.createBlock(u,{key:1,"rows-per-page":a.localPagination.rowsPerPage??a.settings.rowsPerPage,"current-page":a.localPagination.page,"total-rows":a.totalRows,"max-pages-displayed":3,compact:a.settings.compactPagination,"rows-per-page-options":a.settings.rowsPerPageOptions,onUpdate:a.onPaginationChange},null,8,["rows-per-page","current-page","total-rows","compact","rows-per-page-options","onUpdate"]))])],8,Bp)])]))],2)],2),i.renderSlot(e.$slots,"bottom")])}const Rp=R(wp,[["render",Fp]]),ki={format:{date:"yyyy-MM-dd",dateTime:"yyyy-MM-dd HH:mm:ss",time:"HH:mm:ss"},mode:"dateTime"},x1="",Vp={name:"ViPagination",components:{FontAwesomeIcon:Te},props:{rowsPerPage:{type:Number,required:!0},rowsPerPageOptions:{type:Array},totalRows:{type:Number,required:!0},currentPage:{type:Number,required:!0},maxPagesDisplayed:{type:Number,default:3},options:{type:Object,default:function(){return{rowsPerPageOptions:[{label:5,value:5},{label:10,value:10},{label:15,value:15},{label:20,value:20}]}}},compact:{type:Boolean}},computed:{totalPages(){return Math.ceil(this.totalRows/this.rowsOnPage)},firsVisiblePage(){return this.visiblePages[0]},lastVisiblePage(){return this.visiblePages[this.visiblePages.length-1]},firstVisibleRow(){return this.currentPage===1?1:(this.currentPage-1)*this.rowsOnPage},lastVisibleRow(){return this.currentPage===this.totalPages?this.totalRows:this.currentPage*this.rowsOnPage},visiblePages(){let e,t;if(this.totalPages<=this.maxPagesDisplayed)e=1,t=this.totalPages;else{const n=Math.floor(this.maxPagesDisplayed/2);e=Math.max(this.currentPage-n,1),t=e+this.maxPagesDisplayed-1,t>this.totalPages&&(t=this.totalPages,e=t-this.maxPagesDisplayed+1)}return Array.from({length:t-e+1},(n,a)=>e+a)},rowsOnPage(){return this.rowsPerPage>0?this.rowsPerPage:this.totalRows},compactPagination(){var e;return this.compact!==void 0?this.compact:((e=this.ViPaginationSettings)==null?void 0:e.compact)??!1}},methods:{paginationChange({currentPage:e,rowsPerPage:t}){let n={currentPage:e!==void 0?parseInt(e):this.currentPage,rowsPerPage:t!==void 0?parseInt(t):this.rowsPerPage};this.$emit("update",n)},pageChange(e){if(e===this.currentPage||e>this.totalPages||e<1)return!1;this.$emit("update:currentPage",parseInt(e)),this.paginationChange({currentPage:e})},rowsPerPageChange(e){const t=e.target.value;if(t===this.rowsPerPage)return!1;this.$emit("update:rowsPerPage",parseInt(t)),this.paginationChange({rowsPerPage:t,currentPage:1})}}},zp={class:"vi-pagination"},jp={class:"vi-rows-per-page"},Up=["value"],Wp=["value"],Yp={key:0},$p={class:"vi-pages-navigator"},qp={class:"page-actions"},Gp={key:0,class:"page-numbers-container"},Hp=["onClick"],Kp={class:"page-actions"};function Xp(e,t,n,a,r,o){const s=i.resolveComponent("font-awesome-icon");return i.openBlock(),i.createElementBlock("div",zp,[i.createElementVNode("div",jp,[i.renderSlot(e.$slots,"rows-per-page",{rowsPerPage:o.rowsOnPage,rowsPerPageUpdate:o.rowsPerPageChange},()=>[t[5]||(t[5]=i.createElementVNode("span",null,"Rows per page ",-1)),i.createElementVNode("select",{value:n.rowsPerPage,onChange:t[0]||(t[0]=(...l)=>o.rowsPerPageChange&&o.rowsPerPageChange(...l))},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(n.rowsPerPageOptions,l=>(i.openBlock(),i.createElementBlock("option",{key:l.value,value:l.value},i.toDisplayString(l.label),9,Wp))),128))],40,Up)])]),i.renderSlot(e.$slots,"visible-rows-info",{totalRows:n.totalRows,firstVisibleRow:o.firstVisibleRow,lastVisibleRow:o.lastVisibleRow},()=>[n.totalRows>0?(i.openBlock(),i.createElementBlock("div",Yp," Showing "+i.toDisplayString(o.firstVisibleRow)+" - "+i.toDisplayString(o.lastVisibleRow)+" of "+i.toDisplayString(n.totalRows),1)):i.createCommentVNode("",!0)]),i.createElementVNode("div",$p,[i.renderSlot(e.$slots,"navigation-prev",{},()=>[i.createElementVNode("div",qp,[i.createElementVNode("div",{onClick:t[1]||(t[1]=l=>o.pageChange(1)),class:"vi-page-nav vi-page-first"},[i.createVNode(s,{icon:["fas","angles-left"],size:"lg"})]),i.createElementVNode("div",{onClick:t[2]||(t[2]=l=>o.pageChange(n.currentPage-1)),class:"vi-page-nav vi-page-prev"},[i.createVNode(s,{icon:["fas","angle-left"]})])])]),o.compactPagination?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",Gp,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(o.visiblePages,l=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(["vi-page-number",{active:l===n.currentPage}]),key:l,onClick:c=>o.pageChange(l)},i.toDisplayString(l),11,Hp))),128))])),i.renderSlot(e.$slots,"navigation-next",{},()=>[i.createElementVNode("div",Kp,[i.createElementVNode("div",{onClick:t[3]||(t[3]=l=>o.pageChange(n.currentPage+1)),class:"vi-page-nav vi-page-next"},[i.createVNode(s,{icon:["fas","angle-right"]})]),i.createElementVNode("div",{onClick:t[4]||(t[4]=l=>o.pageChange(o.totalPages)),class:"vi-page-nav vi-page-last"},[i.createVNode(s,{icon:["fas","angles-right"],size:"lg"})])])])])])}const Qp=R(Vp,[["render",Xp]]);/*!
1126
1126
  * Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com
1127
1127
  * License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
1128
1128
  * Copyright 2024 Fonticons, Inc.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "vi-grid-builder",
3
3
  "main": "./dist/vi-grid-builder.umd.cjs",
4
- "version": "2.3.7",
4
+ "version": "2.3.9",
5
5
  "type": "module",
6
6
  "files": [
7
7
  "dist",