@rocketui/vue 0.3.0 → 0.3.1-beta

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.
@@ -8170,9 +8170,9 @@ const D5 = (H) => ({
8170
8170
  const Z = p2(n), o = {
8171
8171
  x: C,
8172
8172
  y: i
8173
- }, a = H2(A), S = C2(a), v = await M.getDimensions(l), B = a === "y", y = B ? "top" : "left", u = B ? "bottom" : "right", w = B ? "clientHeight" : "clientWidth", _ = L.reference[S] + L.reference[a] - o[a] - L.floating[S], D = o[a] - L.reference[a], z = await (M.getOffsetParent == null ? void 0 : M.getOffsetParent(l));
8174
- let W = z ? z[w] : 0;
8175
- (!W || !await (M.isElement == null ? void 0 : M.isElement(z))) && (W = e.floating[w] || L.floating[S]);
8173
+ }, a = H2(A), S = C2(a), v = await M.getDimensions(l), B = a === "y", y = B ? "top" : "left", u = B ? "bottom" : "right", w = B ? "clientHeight" : "clientWidth", _ = L.reference[S] + L.reference[a] - o[a] - L.floating[S], D = o[a] - L.reference[a], U = await (M.getOffsetParent == null ? void 0 : M.getOffsetParent(l));
8174
+ let W = U ? U[w] : 0;
8175
+ (!W || !await (M.isElement == null ? void 0 : M.isElement(U))) && (W = e.floating[w] || L.floating[S]);
8176
8176
  const J = _ / 2 - D / 2, k = W / 2 - v[S] / 2 - 1, N = f1(Z[y], k), Q = f1(Z[u], k), x = N, l1 = W - v[S] - Q, I = W / 2 - v[S] / 2 + J, q = q1(x, I, l1), j = !d.arrow && g1(A) != null && I != q && L.reference[S] / 2 - (I < x ? N : Q) - v[S] / 2 < 0, C1 = j ? I < x ? I - x : I - l1 : 0;
8177
8177
  return {
8178
8178
  [a]: o[a] + C1,
@@ -8212,11 +8212,11 @@ const D5 = (H) => ({
8212
8212
  return {};
8213
8213
  const y = o1(A), u = o1(e) === e, w = await (d.isRTL == null ? void 0 : d.isRTL(l.floating)), _ = o || (u || !v ? [x1(e)] : P5(e));
8214
8214
  !o && S !== "none" && _.push(...F5(e, v, S, w));
8215
- const D = [e, ..._], z = await E1(V, B), W = [];
8215
+ const D = [e, ..._], U = await E1(V, B), W = [];
8216
8216
  let J = ((i = L.flip) == null ? void 0 : i.overflows) || [];
8217
- if (n && W.push(z[y]), Z) {
8217
+ if (n && W.push(U[y]), Z) {
8218
8218
  const x = y5(A, M, w);
8219
- W.push(z[x[0]], z[x[1]]);
8219
+ W.push(U[x[0]], U[x[1]]);
8220
8220
  }
8221
8221
  if (J = [...J, {
8222
8222
  placement: A,
@@ -8857,7 +8857,7 @@ const e3 = ["id", "aria-disabled"], d3 = ["innerHTML"], t3 = ["id"], m3 = ["id"]
8857
8857
  C.triggers.includes(M1.Hover) && B();
8858
8858
  }
8859
8859
  function B() {
8860
- const { placement: u, offset: w, padding: _, disabled: D, showDelay: z, type: W } = C;
8860
+ const { placement: u, offset: w, padding: _, disabled: D, showDelay: U, type: W } = C;
8861
8861
  D || A3(
8862
8862
  A,
8863
8863
  L,
@@ -8865,7 +8865,7 @@ const e3 = ["id", "aria-disabled"], d3 = ["innerHTML"], t3 = ["id"], m3 = ["id"]
8865
8865
  u,
8866
8866
  w,
8867
8867
  _,
8868
- z,
8868
+ U,
8869
8869
  W
8870
8870
  );
8871
8871
  }
@@ -9048,25 +9048,25 @@ const e3 = ["id", "aria-disabled"], d3 = ["innerHTML"], t3 = ["id"], m3 = ["id"]
9048
9048
  u.value && (M.value ? u.value.dataset.rOriginalOverflow || (u.value.dataset.rOriginalOverflow = u.value.style.overflowY || "", u.value.style.overflowY = "hidden") : u.value.dataset.rOriginalOverflow !== void 0 && (u.value.style.overflowY = u.value.dataset.rOriginalOverflow, delete u.value.dataset.rOriginalOverflow));
9049
9049
  }
9050
9050
  function _(t) {
9051
- var X, p, G, B1;
9051
+ var X, p, z, B1;
9052
9052
  if (C.disabled)
9053
9053
  return;
9054
9054
  const c = document.getElementById(t);
9055
- document.querySelectorAll(".r-dropdown--active").forEach((U) => {
9055
+ document.querySelectorAll(".r-dropdown--active").forEach((G) => {
9056
9056
  var b1;
9057
- if (U.id !== ((b1 = a.value) == null ? void 0 : b1.id) && U.classList.contains("r-dropdown--active")) {
9057
+ if (G.id !== ((b1 = a.value) == null ? void 0 : b1.id) && G.classList.contains("r-dropdown--active")) {
9058
9058
  const c1 = l(
9059
- U
9059
+ G
9060
9060
  );
9061
- c1 && c1.dataset.rOriginalOverflow !== void 0 && (c1.style.overflowY = c1.dataset.rOriginalOverflow, delete c1.dataset.rOriginalOverflow), U.childNodes.forEach((L1) => {
9061
+ c1 && c1.dataset.rOriginalOverflow !== void 0 && (c1.style.overflowY = c1.dataset.rOriginalOverflow, delete c1.dataset.rOriginalOverflow), G.childNodes.forEach((L1) => {
9062
9062
  L1 != null && L1.classList && (Object == null || Object.values(L1 == null ? void 0 : L1.classList).filter((U1) => U1.includes("--active")).forEach((U1) => {
9063
9063
  L1 == null || L1.classList.remove(U1);
9064
9064
  }));
9065
- }), U.classList.remove("r-dropdown--active");
9065
+ }), G.classList.remove("r-dropdown--active");
9066
9066
  }
9067
- }), c != null && c.classList.contains("r-dropdown--active") ? (c.classList.remove("r-dropdown--active"), M.value = !1, (X = a.value) == null || X.blur(), (p = S.value) == null || p.blur()) : (c == null || c.classList.add("r-dropdown--active"), M.value = !0, (G = a.value) == null || G.focus(), (B1 = S.value) == null || B1.focus(), c == null || c.childNodes.forEach((U) => {
9068
- U != null && U.classList && (Object == null || Object.values(U == null ? void 0 : U.classList).forEach((b1) => {
9069
- U == null || U.classList.add(`${b1}--active`);
9067
+ }), c != null && c.classList.contains("r-dropdown--active") ? (c.classList.remove("r-dropdown--active"), M.value = !1, (X = a.value) == null || X.blur(), (p = S.value) == null || p.blur()) : (c == null || c.classList.add("r-dropdown--active"), M.value = !0, (z = a.value) == null || z.focus(), (B1 = S.value) == null || B1.focus(), c == null || c.childNodes.forEach((G) => {
9068
+ G != null && G.classList && (Object == null || Object.values(G == null ? void 0 : G.classList).forEach((b1) => {
9069
+ G == null || G.classList.add(`${b1}--active`);
9070
9070
  }));
9071
9071
  }));
9072
9072
  }
@@ -9074,7 +9074,7 @@ const e3 = ["id", "aria-disabled"], d3 = ["innerHTML"], t3 = ["id"], m3 = ["id"]
9074
9074
  const c = document.getElementById(t);
9075
9075
  c == null || c.classList.remove("r-dropdown--active"), M.value = !1;
9076
9076
  }
9077
- function z() {
9077
+ function U() {
9078
9078
  var t;
9079
9079
  (t = B.value) == null || t.call(B);
9080
9080
  }
@@ -9086,15 +9086,10 @@ const e3 = ["id", "aria-disabled"], d3 = ["innerHTML"], t3 = ["id"], m3 = ["id"]
9086
9086
  return;
9087
9087
  }
9088
9088
  if (C.multiple) {
9089
- if (!L.value.find((G) => G.value === c.value))
9090
- L.value.push(c);
9091
- else {
9092
- const G = L.value.findIndex(
9093
- (B1) => B1.value === c.value
9094
- );
9095
- L.value.splice(G, 1), i("removeOption", c);
9096
- }
9097
- e.value = "", C.searchable && ((p = S.value) == null || p.focus());
9089
+ const z = L.value.findIndex(
9090
+ (B1) => B1.value === c.value
9091
+ );
9092
+ z === -1 ? L.value.push({ ...c }) : (L.value.splice(z, 1), i("removeOption", c)), e.value = "", C.searchable && ((p = S.value) == null || p.focus());
9098
9093
  return;
9099
9094
  }
9100
9095
  J(t, c), C.closeOnSelect && P();
@@ -9125,7 +9120,7 @@ const e3 = ["id", "aria-disabled"], d3 = ["innerHTML"], t3 = ["id"], m3 = ["id"]
9125
9120
  if (P === "")
9126
9121
  return;
9127
9122
  Z.value.find(
9128
- (G) => G.label === P
9123
+ (z) => z.label === P
9129
9124
  ) || (L.value.push({ value: P, label: P }), e.value = "", (p = S.value) == null || p.focus());
9130
9125
  }
9131
9126
  function Q(t) {
@@ -9134,7 +9129,7 @@ const e3 = ["id", "aria-disabled"], d3 = ["innerHTML"], t3 = ["id"], m3 = ["id"]
9134
9129
  }
9135
9130
  const x = h(() => !C.searchable || A.value.label === e.value || !C.innerSearch && C.searchable ? Z.value : Z.value.filter((c) => c.label.toLowerCase().includes(e.value.toLowerCase()))), l1 = h(() => !C.searchable);
9136
9131
  function I() {
9137
- o.value ? C.multiple ? L.value = o.value : (A.value = o.value, e.value = o.value.label) : (A.value = {}, L.value.splice(0, L.value.length));
9132
+ o.value ? C.multiple ? L.value = Array.isArray(o.value) ? o.value.map((t) => ({ ...t })) : [] : (A.value = { ...o.value }, e.value = o.value.label) : (A.value = {}, L.value.splice(0, L.value.length));
9138
9133
  }
9139
9134
  function q(t) {
9140
9135
  C.searchable && t(), !C.multiple && e.value === "" && (A.value = {}, i("update:modelValue", ""), i("removeOption", A.value));
@@ -9151,7 +9146,7 @@ const e3 = ["id", "aria-disabled"], d3 = ["innerHTML"], t3 = ["id"], m3 = ["id"]
9151
9146
  L.value.splice(0, L.value.length);
9152
9147
  return;
9153
9148
  }
9154
- L.value = x.value;
9149
+ L.value = [...x.value];
9155
9150
  }
9156
9151
  const Q1 = h(() => !C.multiple || !Array.isArray(C.modelValue) ? [] : C.modelValue.slice(0, C.maxVisibleChips)), G1 = h(() => !C.multiple || !Array.isArray(C.modelValue) ? 0 : Math.max(0, C.modelValue.length - C.maxVisibleChips));
9157
9152
  return a2(() => {
@@ -9195,7 +9190,7 @@ const e3 = ["id", "aria-disabled"], d3 = ["innerHTML"], t3 = ["id"], m3 = ["id"]
9195
9190
  key: 0,
9196
9191
  id: `${t.id}-overlay`,
9197
9192
  class: "r-dropdown-overlay",
9198
- onClick: z
9193
+ onClick: U
9199
9194
  }, null, 8, n3)) : f("", !0)
9200
9195
  ])),
9201
9196
  H1(l3, {
@@ -9271,7 +9266,7 @@ const e3 = ["id", "aria-disabled"], d3 = ["innerHTML"], t3 = ["id"], m3 = ["id"]
9271
9266
  ghost: "",
9272
9267
  label: p.label,
9273
9268
  variant: "primary",
9274
- "onClick:close": (G) => k(G, p, P)
9269
+ "onClick:close": (z) => k(z, p, P)
9275
9270
  }, null, 8, ["id", "label", "onClick:close"]))), 128)),
9276
9271
  g(t.$slots, "remaining-count", {
9277
9272
  id: `${t.id}-remaining-count`,
@@ -9283,10 +9278,10 @@ const e3 = ["id", "aria-disabled"], d3 = ["innerHTML"], t3 = ["id"], m3 = ["id"]
9283
9278
  class: "r-dropdown__remaining-count-text"
9284
9279
  }, " +" + b(G1.value), 9, S3)) : f("", !0)
9285
9280
  ])
9286
- ], 64)) : C.multiple ? (m(!0), r(A1, { key: 1 }, n1(L.value, (p, G) => (m(), r("span", {
9287
- id: `${t.id}-selected-option-${G}`,
9281
+ ], 64)) : C.multiple ? (m(!0), r(A1, { key: 1 }, n1(L.value, (p, z) => (m(), r("span", {
9282
+ id: `${t.id}-selected-option-${z}`,
9288
9283
  key: p.value
9289
- }, b(p.label) + " " + b(G < L.value.length - 1 ? ", " : ""), 9, s3))), 128)) : f("", !0)
9284
+ }, b(p.label) + " " + b(z < L.value.length - 1 ? ", " : ""), 9, s3))), 128)) : f("", !0)
9290
9285
  ], 8, u3)
9291
9286
  ]),
9292
9287
  Z2(s("input", {
@@ -9407,7 +9402,7 @@ const e3 = ["id", "aria-disabled"], d3 = ["innerHTML"], t3 = ["id"], m3 = ["id"]
9407
9402
  "r-dropdown-options__option--disabled": p.disabled,
9408
9403
  "r-dropdown-options__option--deselect": Q(p) && C.disableDeselect
9409
9404
  }]),
9410
- onClick: a1((G) => W(G, p, P, X), ["prevent"])
9405
+ onClick: a1((z) => W(z, p, P, X), ["prevent"])
9411
9406
  }, [
9412
9407
  g(t.$slots, "option", {
9413
9408
  id: `${t.id}-option-${p.value}`,
@@ -10093,7 +10088,7 @@ const M0 = ["id", "aria-disabled", "aria-selected", "disabled"], i0 = { key: 0 }
10093
10088
  function D(k) {
10094
10089
  L.value = k.target.value, i("input", k);
10095
10090
  }
10096
- function z() {
10091
+ function U() {
10097
10092
  var k;
10098
10093
  if (o.value) {
10099
10094
  L.value = "", (k = A.value) == null || k.focus(), i("click:clear", {
@@ -10186,7 +10181,7 @@ const M0 = ["id", "aria-disabled", "aria-selected", "disabled"], i0 = { key: 0 }
10186
10181
  id: `${u.value}-append-icon`,
10187
10182
  name: M.value === "password" ? "mdiEyeOutline" : "mdiEyeOffOutline",
10188
10183
  size: 20,
10189
- onClick: z
10184
+ onClick: U
10190
10185
  }, null, 8, ["id", "name"])) : f("", !0),
10191
10186
  y.value && !k.$slots.append || Z.value ? (m(), R(T, {
10192
10187
  key: 1,
@@ -10194,7 +10189,7 @@ const M0 = ["id", "aria-disabled", "aria-selected", "disabled"], i0 = { key: 0 }
10194
10189
  class: O(v.value),
10195
10190
  name: `${y.value}`,
10196
10191
  size: 20,
10197
- onClick: z
10192
+ onClick: U
10198
10193
  }, null, 8, ["id", "class", "name"])) : f("", !0)
10199
10194
  ])
10200
10195
  ], 10, Z0),