@qikdev/vue-ui 0.2.70 → 0.2.73

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/lib.es.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import './style.css';
2
2
  import { defineComponent as ki, ref as Wt, toRefs as la, onMounted as oa, onBeforeUnmount as wo, watch as xi, computed as ai, openBlock as o, createElementBlock as d, renderSlot as G, createCommentVNode as _, useSlots as So, reactive as kr, provide as Fr, resolveComponent as y, normalizeClass as P, Fragment as S, unref as jn, createBlock as k, withCtx as h, createVNode as m, renderList as N, toDisplayString as b, withModifiers as W, createTextVNode as O, createElementVNode as w, h as li, resolveDynamicComponent as It, mergeProps as wi, toHandlers as ua, withDirectives as X, vModelSelect as kt, pushScopeId as it, popScopeId as st, normalizeStyle as xt, Teleport as Oo, vModelText as ge, withKeys as ve, TransitionGroup as To, nextTick as da, vModelDynamic as Rn, vShow as qi } from "vue";
3
3
  import { EventDispatcher as Eo } from "@qikdev/sdk";
4
- const Co = "0.2.70", lr = {
4
+ const Co = "0.2.73", lr = {
5
5
  STRIPE_NOT_LOADED: "Stripe v3 library is not loaded",
6
6
  INSTANCE_NOT_DEFINED: "Instance object is not defined. Make sure you initialized Stripe before creating elements",
7
7
  ELEMENTS_NOT_DEFINED: "Elements object is not defined. You can't create stripe element without it",
@@ -174,14 +174,14 @@ function iu(e, t, n, i, s, r) {
174
174
  G(e.$slots, "default", {}, void 0, !0)
175
175
  ]);
176
176
  }
177
- const su = /* @__PURE__ */ E(nu, [["render", iu], ["__scopeId", "data-v-c7bb49df"]]);
177
+ const su = /* @__PURE__ */ E(nu, [["render", iu], ["__scopeId", "data-v-ceefef08"]]);
178
178
  const au = {}, lu = { class: "flex-row" };
179
179
  function ou(e, t, n, i, s, r) {
180
180
  return o(), d("div", lu, [
181
181
  G(e.$slots, "default", {}, void 0, !0)
182
182
  ]);
183
183
  }
184
- const uu = /* @__PURE__ */ E(au, [["render", ou], ["__scopeId", "data-v-b6434689"]]);
184
+ const uu = /* @__PURE__ */ E(au, [["render", ou], ["__scopeId", "data-v-45182a00"]]);
185
185
  const du = {}, cu = { class: "flex-spacer" };
186
186
  function fu(e, t, n, i, s, r) {
187
187
  return o(), d("div", cu);
@@ -6912,7 +6912,12 @@ const Dy = {
6912
6912
  return this.multiValue ? e.push("multiple") : e.push("single"), e;
6913
6913
  },
6914
6914
  summary() {
6915
- return this.multiValue ? "Select an option" : this.model ? this.getLabel(this.optionLookup[this.model]) : this.title || "Click to select";
6915
+ if (this.multiValue)
6916
+ return "Select an option";
6917
+ const e = this.selectableOptions.find(function(n) {
6918
+ return n.none;
6919
+ }), t = (e == null ? void 0 : e.title) || (e == null ? void 0 : e.label);
6920
+ return this.model ? this.getLabel(this.optionLookup[this.model]) : t || this.title || "Click to select";
6916
6921
  },
6917
6922
  grouped() {
6918
6923
  const e = this, { values: t } = e.selectableOptions.reduce(function(n, i) {
@@ -6937,12 +6942,12 @@ const Dy = {
6937
6942
  }) : this.options;
6938
6943
  },
6939
6944
  showNoneOption() {
6940
- return this.singleValue && !this.minimum ? this.selectableOptions.find(function(n) {
6945
+ return !(!(this.singleValue && !this.minimum) || this.selectableOptions.find(function(n) {
6941
6946
  return n.none;
6942
- }) ? (console.log("has custom none option"), !1) : !0 : !1;
6947
+ }));
6943
6948
  }
6944
6949
  }
6945
- }, $y = (e) => (it("data-v-271e784a"), e = e(), st(), e), Ny = {
6950
+ }, $y = (e) => (it("data-v-9772b96a"), e = e(), st(), e), Ny = {
6946
6951
  key: 0,
6947
6952
  class: "ux-field-title"
6948
6953
  }, Ly = {
@@ -7061,7 +7066,7 @@ function Qy(e, t, n, i, s, r) {
7061
7066
  ]))
7062
7067
  ], 2);
7063
7068
  }
7064
- const Nt = /* @__PURE__ */ E(Dy, [["render", Qy], ["__scopeId", "data-v-271e784a"]]);
7069
+ const Nt = /* @__PURE__ */ E(Dy, [["render", Qy], ["__scopeId", "data-v-9772b96a"]]);
7065
7070
  const e_ = {
7066
7071
  props: {
7067
7072
  total: {
@@ -7444,7 +7449,7 @@ function __(e, t, n, i, s, r) {
7444
7449
  _: 3
7445
7450
  }, 8, ["active", "loading", "to", "href", "target", "style", "class", "disabled"]);
7446
7451
  }
7447
- const g_ = /* @__PURE__ */ E(p_, [["render", __], ["__scopeId", "data-v-2048752e"]]);
7452
+ const g_ = /* @__PURE__ */ E(p_, [["render", __], ["__scopeId", "data-v-66b9c2a8"]]);
7448
7453
  const v_ = {
7449
7454
  props: {
7450
7455
  value: {
@@ -7768,20 +7773,60 @@ const I_ = /* @__PURE__ */ E(A_, [["render", M_], ["__scopeId", "data-v-db935124
7768
7773
  default: "none"
7769
7774
  }
7770
7775
  },
7776
+ mounted() {
7777
+ this.mounted = !0;
7778
+ },
7779
+ beforeUnmount() {
7780
+ this.mounted = !1, this.removeListeners();
7781
+ },
7771
7782
  computed: {
7772
7783
  filteredItems() {
7773
- return this.items.filter(function(e) {
7784
+ return this.tree.filter(function(e) {
7774
7785
  return !e.disabled;
7775
7786
  });
7787
+ },
7788
+ expandedItem: {
7789
+ get() {
7790
+ return this.currentExpandedItem;
7791
+ },
7792
+ set(e) {
7793
+ this.currentExpandedItem && (this.currentExpandedItem.expanded = !1, this.currentExpandedItem.collapsed = !0), this.currentExpandedItem = e, this.currentExpandedItem ? (this.currentExpandedItem.expanded = !0, this.currentExpandedItem.collapsed = !1, this.addListeners()) : this.removeListeners();
7794
+ }
7776
7795
  }
7777
7796
  },
7797
+ data() {
7798
+ return {
7799
+ currentExpandedItem: null,
7800
+ tree: JSON.parse(JSON.stringify(this.items))
7801
+ };
7802
+ },
7778
7803
  methods: {
7804
+ globalClick(e) {
7805
+ this.expandedItem = null;
7806
+ },
7807
+ addListeners() {
7808
+ var t;
7809
+ this.$sdk.addEventListener("route:change", this.globalClick);
7810
+ const e = (t = this.$el) == null ? void 0 : t.ownerDocument;
7811
+ e && e.body.addEventListener("click", this.globalClick);
7812
+ },
7813
+ removeListeners() {
7814
+ var t;
7815
+ this.$sdk.removeEventListener("route:change", this.globalClick);
7816
+ const e = (t = this.$el) == null ? void 0 : t.ownerDocument;
7817
+ e && e.body.removeEventListener("click", this.globalClick);
7818
+ },
7779
7819
  toggle(e) {
7780
- e.expanded = !e.expanded, e.collapsed = !e.expanded;
7820
+ this.currentExpandedItem === e ? this.expandedItem = null : this.expandedItem = e;
7781
7821
  }
7782
7822
  },
7783
- data() {
7784
- return {};
7823
+ watch: {
7824
+ items: {
7825
+ handler(e) {
7826
+ this.tree = JSON.parse(JSON.stringify(e));
7827
+ },
7828
+ deep: !0
7829
+ }
7785
7830
  }
7786
7831
  };
7787
7832
  function D_(e, t, n, i, s, r) {
@@ -7883,6 +7928,11 @@ const N_ = {
7883
7928
  model: this.item
7884
7929
  };
7885
7930
  },
7931
+ watch: {
7932
+ item(e) {
7933
+ this.model = e;
7934
+ }
7935
+ },
7886
7936
  computed: {
7887
7937
  altText() {
7888
7938
  var e;
@@ -7973,7 +8023,7 @@ function U_(e, t, n, i, s, r) {
7973
8023
  }, null, 12, P_))
7974
8024
  ], 6);
7975
8025
  }
7976
- const j_ = /* @__PURE__ */ E(N_, [["render", U_], ["__scopeId", "data-v-089b6795"]]);
8026
+ const j_ = /* @__PURE__ */ E(N_, [["render", U_], ["__scopeId", "data-v-03c1a2af"]]);
7977
8027
  const R_ = {
7978
8028
  props: {
7979
8029
  item: {
@@ -9058,10 +9108,20 @@ const Pg = {
9058
9108
  required: !0
9059
9109
  }
9060
9110
  },
9111
+ data() {
9112
+ return {
9113
+ model: this.item
9114
+ };
9115
+ },
9116
+ watch: {
9117
+ item(e) {
9118
+ this.model = e;
9119
+ }
9120
+ },
9061
9121
  computed: {
9062
9122
  basicType() {
9063
9123
  var e, t;
9064
- return (t = (e = this.item) == null ? void 0 : e.meta) == null ? void 0 : t.type;
9124
+ return (t = (e = this.model) == null ? void 0 : e.meta) == null ? void 0 : t.type;
9065
9125
  },
9066
9126
  hasImage() {
9067
9127
  switch (this.basicType) {
@@ -9072,12 +9132,12 @@ const Pg = {
9072
9132
  }
9073
9133
  },
9074
9134
  title() {
9075
- return this.item.title || this.item.name || this.item.label || (this.item.firstName ? `${this.item.firstName} ${this.item.lastName}` : "(Title unknown)");
9135
+ return this.model.title || this.model.name || this.model.label || (this.model.firstName ? `${this.model.firstName} ${this.model.lastName}` : "(Title unknown)");
9076
9136
  }
9077
9137
  },
9078
9138
  methods: {
9079
9139
  clicked() {
9080
- this.$sdk.dispatch("item:view", this.item);
9140
+ this.$sdk.dispatch("item:view", this.model);
9081
9141
  }
9082
9142
  }
9083
9143
  };
@@ -9101,7 +9161,7 @@ function Ug(e, t, n, i, s, r) {
9101
9161
  class: P(["image-wrapper", r.basicType])
9102
9162
  }, [
9103
9163
  m(a, {
9104
- item: n.item,
9164
+ item: s.model,
9105
9165
  width: 100,
9106
9166
  height: 100
9107
9167
  }, null, 8, ["item"])
@@ -9130,7 +9190,7 @@ function Ug(e, t, n, i, s, r) {
9130
9190
  })
9131
9191
  ]);
9132
9192
  }
9133
- const wl = /* @__PURE__ */ E(Pg, [["render", Ug], ["__scopeId", "data-v-923011b3"]]);
9193
+ const wl = /* @__PURE__ */ E(Pg, [["render", Ug], ["__scopeId", "data-v-805b5945"]]);
9134
9194
  /**!
9135
9195
  * Sortable 1.14.0
9136
9196
  * @author RubaXa <trash@rubaxa.org>
@@ -10958,13 +11018,8 @@ const Dv = {
10958
11018
  summary() {
10959
11019
  if (this.multiValue)
10960
11020
  if (this.model && this.model.length) {
10961
- var e = this.model.length;
10962
- if (!this.showList)
10963
- return e === 1 ? this.model[0].title || this.model[0].name || this.model[0].firstName : `${e} selected`;
10964
- var t = Math.max(e - 3, 0), n, i = this.model.slice(0, 3);
10965
- return n = i.map(function(s) {
10966
- return s.firstName || s.name || s.title;
10967
- }).join(", "), t && (n = `${n}... +${t} more...`), n || "Click to select";
11021
+ var e = "Click to select", t = this.model.length;
11022
+ return this.showList ? (t && (e = `Adjust selection (${t})`), e) : t === 1 ? this.model[0].title || this.model[0].name || this.model[0].firstName : `${t} selected`;
10968
11023
  } else
10969
11024
  return "Click to select";
10970
11025
  else
@@ -11121,7 +11176,7 @@ function Uv(e, t, n, i, s, r) {
11121
11176
  })) : _("", !0)
11122
11177
  ], 64);
11123
11178
  }
11124
- const ql = /* @__PURE__ */ E(Dv, [["render", Uv], ["__scopeId", "data-v-aaba4058"]]);
11179
+ const ql = /* @__PURE__ */ E(Dv, [["render", Uv], ["__scopeId", "data-v-5f830d28"]]);
11125
11180
  function jv(e) {
11126
11181
  return e === void 0 || typeof e > "u" || e === null || String(e) === "null" || String(e) === "undefined";
11127
11182
  }
@@ -18605,7 +18660,7 @@ function WO(e, t, n, i, s, r) {
18605
18660
  ])
18606
18661
  ]);
18607
18662
  }
18608
- const ho = /* @__PURE__ */ E(HO, [["render", WO], ["__scopeId", "data-v-d88923bc"]]), KO = {
18663
+ const ho = /* @__PURE__ */ E(HO, [["render", WO], ["__scopeId", "data-v-9cf5026c"]]), KO = {
18609
18664
  props: {
18610
18665
  field: {
18611
18666
  type: Object,
@@ -20749,18 +20804,19 @@ function oE(e, t, n, i, s, r) {
20749
20804
  ]),
20750
20805
  _: 1
20751
20806
  })) : _("", !0),
20752
- s.showFilters ? _("", !0) : (o(), k(l, { key: 1 }, {
20807
+ m(l, null, {
20753
20808
  default: h(() => [
20754
- m(u, {
20809
+ s.showFilters ? _("", !0) : (o(), k(u, {
20810
+ key: 0,
20755
20811
  modelValue: s.search,
20756
20812
  "onUpdate:modelValue": t[0] || (t[0] = (x) => s.search = x),
20757
20813
  loading: s.searching,
20758
20814
  debounce: 500,
20759
20815
  placeholder: "Keyword Search"
20760
- }, null, 8, ["modelValue", "loading"])
20816
+ }, null, 8, ["modelValue", "loading"]))
20761
20817
  ]),
20762
20818
  _: 1
20763
- })),
20819
+ }),
20764
20820
  m(l, { shrink: "" }, {
20765
20821
  default: h(() => [
20766
20822
  m(f, {
@@ -20853,7 +20909,7 @@ function oE(e, t, n, i, s, r) {
20853
20909
  _: 1
20854
20910
  });
20855
20911
  }
20856
- const uE = /* @__PURE__ */ E(iE, [["render", oE], ["__scopeId", "data-v-09ee3a9e"]]);
20912
+ const uE = /* @__PURE__ */ E(iE, [["render", oE], ["__scopeId", "data-v-7eedb824"]]);
20857
20913
  const dE = {
20858
20914
  components: {
20859
20915
  ScopeSelect: ib