energy-components 1.11.0 → 1.13.0

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.
Files changed (37) hide show
  1. package/dist/components/checkbox.es.js +67 -45
  2. package/dist/components/datepicker.es.js +2276 -2251
  3. package/dist/components/dropdown.es.js +148 -141
  4. package/dist/components/filterTag.es.js +70 -0
  5. package/dist/components/index.es.js +94 -91
  6. package/dist/components/modal.es.js +29 -27
  7. package/dist/components/style/actionButton.css +1 -1
  8. package/dist/components/style/button.css +1 -1
  9. package/dist/components/style/checkbox.css +1 -1
  10. package/dist/components/style/datepicker.css +1 -1
  11. package/dist/components/style/directAccess.css +1 -1
  12. package/dist/components/style/dropdown.css +1 -1
  13. package/dist/components/style/filterTag.css +1 -0
  14. package/dist/components/style/modal.css +1 -1
  15. package/dist/components/style/sidedrawer.css +1 -1
  16. package/dist/components/style/tabBar.css +1 -1
  17. package/dist/components/style/textArea.css +1 -1
  18. package/dist/components/style/textField.css +1 -1
  19. package/dist/components/tabBar.es.js +103 -98
  20. package/dist/components/textArea.es.js +96 -86
  21. package/dist/components/textField.es.js +118 -110
  22. package/dist/components/tooltip.es.js +50 -50
  23. package/dist/energy-components.es.js +14684 -14541
  24. package/dist/energy-components.umd.js +2 -2
  25. package/dist/style.css +1 -1
  26. package/dist/types/src/components/content/avatar/avatar.vue.d.ts +2 -2
  27. package/dist/types/src/components/content/collapsable/collapsable.vue.d.ts +2 -2
  28. package/dist/types/src/components/index.d.ts +1 -0
  29. package/dist/types/src/components/input/checkbox/checkbox.vue.d.ts +15 -0
  30. package/dist/types/src/components/input/datepicker/datepicker.vue.d.ts +4 -2
  31. package/dist/types/src/components/input/drag-and-drop/drag-and-drop.vue.d.ts +1 -1
  32. package/dist/types/src/components/input/dropdown/dropdown.vue.d.ts +13 -13
  33. package/dist/types/src/components/input/filter-tag/filter-tag.vue.d.ts +53 -0
  34. package/dist/types/src/components/input/text-field/text-field.vue.d.ts +1 -1
  35. package/dist/types/src/components/overlay/tooltip/tooltip.vue.d.ts +2 -2
  36. package/dist/types/tsconfig.tsbuildinfo +1 -1
  37. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- import { unref as at, defineComponent as Ft, toRefs as Ht, ref as U, computed as jt, createElementBlock as vt, openBlock as bt, createElementVNode as Z, renderSlot as At, normalizeClass as Ct, createCommentVNode as It, createVNode as Yt, toDisplayString as Rt, createTextVNode as zt } from "vue";
1
+ import { unref as at, defineComponent as Ft, toRefs as Ht, ref as U, computed as jt, createElementBlock as vt, openBlock as bt, createElementVNode as Z, renderSlot as At, normalizeClass as Rt, createCommentVNode as It, createVNode as Yt, toDisplayString as Ct, createTextVNode as zt } from "vue";
2
2
  import { R as Xt } from "./icon-svg-DuzOdbk1.js";
3
3
  import { _ as Kt } from "./_plugin-vue_export-helper-CHgC5LLL.js";
4
4
  import './style/tooltip.css';const X = Math.min, S = Math.max, nt = Math.round, $ = (t) => ({
@@ -282,16 +282,16 @@ const ne = (t) => ({
282
282
  x: o,
283
283
  y: n
284
284
  }, d = pt(i), m = mt(d), g = await s.getDimensions(a), h = d === "y", w = h ? "top" : "left", x = h ? "bottom" : "right", y = h ? "clientHeight" : "clientWidth", b = r.reference[m] + r.reference[d] - p[d] - r.floating[m], v = p[d] - r.reference[d], E = await (s.getOffsetParent == null ? void 0 : s.getOffsetParent(a));
285
- let C = E ? E[y] : 0;
286
- (!C || !await (s.isElement == null ? void 0 : s.isElement(E))) && (C = l.floating[y] || r.floating[m]);
287
- const W = b / 2 - v / 2, P = C / 2 - g[m] / 2 - 1, O = X(u[w], P), F = X(u[x], P), k = O, H = C - g[m] - F, A = C / 2 - g[m] / 2 + W, z = ft(k, A, H), M = !c.arrow && Q(i) != null && A !== z && r.reference[m] / 2 - (A < k ? O : F) - g[m] / 2 < 0, _ = M ? A < k ? A - k : A - H : 0;
285
+ let R = E ? E[y] : 0;
286
+ (!R || !await (s.isElement == null ? void 0 : s.isElement(E))) && (R = l.floating[y] || r.floating[m]);
287
+ const W = b / 2 - v / 2, P = R / 2 - g[m] / 2 - 1, O = X(u[w], P), F = X(u[x], P), k = O, H = R - g[m] - F, A = R / 2 - g[m] / 2 + W, z = ft(k, A, H), M = !c.arrow && Q(i) != null && A !== z && r.reference[m] / 2 - (A < k ? O : F) - g[m] / 2 < 0, T = M ? A < k ? A - k : A - H : 0;
288
288
  return {
289
- [d]: p[d] + _,
289
+ [d]: p[d] + T,
290
290
  data: {
291
291
  [d]: z,
292
- centerOffset: A - z - _,
292
+ centerOffset: A - z - T,
293
293
  ...M && {
294
- alignmentOffset: _
294
+ alignmentOffset: T
295
295
  }
296
296
  },
297
297
  reset: M
@@ -323,7 +323,7 @@ const ne = (t) => ({
323
323
  return {};
324
324
  const w = I(i), x = V(l), y = I(l) === l, b = await (c.isRTL == null ? void 0 : c.isRTL(a.floating)), v = p || (y || !g ? [ot(l)] : Qt(l)), E = m !== "none";
325
325
  !p && E && v.push(...Zt(l, g, m, b));
326
- const C = [l, ...v], W = await gt(e, h), P = [];
326
+ const R = [l, ...v], W = await gt(e, h), P = [];
327
327
  let O = ((n = r.flip) == null ? void 0 : n.overflows) || [];
328
328
  if (f && P.push(W[w]), u) {
329
329
  const A = Jt(i, s, b);
@@ -334,10 +334,10 @@ const ne = (t) => ({
334
334
  overflows: P
335
335
  }], !P.every((A) => A <= 0)) {
336
336
  var F, k;
337
- const A = (((F = r.flip) == null ? void 0 : F.index) || 0) + 1, z = C[A];
337
+ const A = (((F = r.flip) == null ? void 0 : F.index) || 0) + 1, z = R[A];
338
338
  if (z && (!(u === "alignment" ? x !== V(z) : !1) || // We leave the current main axis only if every placement on that axis
339
339
  // overflows the main axis.
340
- O.every((T) => T.overflows[0] > 0 && V(T.placement) === x)))
340
+ O.every((_) => _.overflows[0] > 0 && V(_.placement) === x)))
341
341
  return {
342
342
  data: {
343
343
  index: A,
@@ -347,21 +347,21 @@ const ne = (t) => ({
347
347
  placement: z
348
348
  }
349
349
  };
350
- let M = (k = O.filter((_) => _.overflows[0] <= 0).sort((_, T) => _.overflows[1] - T.overflows[1])[0]) == null ? void 0 : k.placement;
350
+ let M = (k = O.filter((T) => T.overflows[0] <= 0).sort((T, _) => T.overflows[1] - _.overflows[1])[0]) == null ? void 0 : k.placement;
351
351
  if (!M)
352
352
  switch (d) {
353
353
  case "bestFit": {
354
354
  var H;
355
- const _ = (H = O.filter((T) => {
355
+ const T = (H = O.filter((_) => {
356
356
  if (E) {
357
- const j = V(T.placement);
357
+ const j = V(_.placement);
358
358
  return j === x || // Create a bias to the `y` side axis due to horizontal
359
359
  // reading directions favoring greater width.
360
360
  j === "y";
361
361
  }
362
362
  return !0;
363
- }).map((T) => [T.placement, T.overflows.filter((j) => j > 0).reduce((j, Bt) => j + Bt, 0)]).sort((T, j) => T[1] - j[1])[0]) == null ? void 0 : H[0];
364
- _ && (M = _);
363
+ }).map((_) => [_.placement, _.overflows.filter((j) => j > 0).reduce((j, Bt) => j + Bt, 0)]).sort((_, j) => _[1] - j[1])[0]) == null ? void 0 : H[0];
364
+ T && (M = T);
365
365
  break;
366
366
  }
367
367
  case "initialPlacement":
@@ -506,15 +506,15 @@ const se = function(t) {
506
506
  let h, w;
507
507
  u === "top" || u === "bottom" ? (h = u, w = p === (await (s.isRTL == null ? void 0 : s.isRTL(l.floating)) ? "start" : "end") ? "left" : "right") : (w = u, h = p === "end" ? "top" : "bottom");
508
508
  const x = g - f.top - f.bottom, y = m - f.left - f.right, b = X(g - f[h], x), v = X(m - f[w], y), E = !e.middlewareData.shift;
509
- let C = b, W = v;
510
- if ((o = e.middlewareData.shift) != null && o.enabled.x && (W = y), (n = e.middlewareData.shift) != null && n.enabled.y && (C = x), E && !p) {
509
+ let R = b, W = v;
510
+ if ((o = e.middlewareData.shift) != null && o.enabled.x && (W = y), (n = e.middlewareData.shift) != null && n.enabled.y && (R = x), E && !p) {
511
511
  const O = S(f.left, 0), F = S(f.right, 0), k = S(f.top, 0), H = S(f.bottom, 0);
512
- d ? W = m - 2 * (O !== 0 || F !== 0 ? O + F : S(f.left, f.right)) : C = g - 2 * (k !== 0 || H !== 0 ? k + H : S(f.top, f.bottom));
512
+ d ? W = m - 2 * (O !== 0 || F !== 0 ? O + F : S(f.left, f.right)) : R = g - 2 * (k !== 0 || H !== 0 ? k + H : S(f.top, f.bottom));
513
513
  }
514
514
  await c({
515
515
  ...e,
516
516
  availableWidth: W,
517
- availableHeight: C
517
+ availableHeight: R
518
518
  });
519
519
  const P = await s.getDimensions(l.floating);
520
520
  return m !== P.width || g !== P.height ? {
@@ -531,7 +531,7 @@ function st() {
531
531
  function K(t) {
532
532
  return ht(t) ? (t.nodeName || "").toLowerCase() : "#document";
533
533
  }
534
- function R(t) {
534
+ function C(t) {
535
535
  var e;
536
536
  return (t == null || (e = t.ownerDocument) == null ? void 0 : e.defaultView) || window;
537
537
  }
@@ -540,16 +540,16 @@ function B(t) {
540
540
  return (e = (ht(t) ? t.ownerDocument : t.document) || window.document) == null ? void 0 : e.documentElement;
541
541
  }
542
542
  function ht(t) {
543
- return st() ? t instanceof Node || t instanceof R(t).Node : !1;
543
+ return st() ? t instanceof Node || t instanceof C(t).Node : !1;
544
544
  }
545
545
  function D(t) {
546
- return st() ? t instanceof Element || t instanceof R(t).Element : !1;
546
+ return st() ? t instanceof Element || t instanceof C(t).Element : !1;
547
547
  }
548
548
  function N(t) {
549
- return st() ? t instanceof HTMLElement || t instanceof R(t).HTMLElement : !1;
549
+ return st() ? t instanceof HTMLElement || t instanceof C(t).HTMLElement : !1;
550
550
  }
551
551
  function St(t) {
552
- return !st() || typeof ShadowRoot > "u" ? !1 : t instanceof ShadowRoot || t instanceof R(t).ShadowRoot;
552
+ return !st() || typeof ShadowRoot > "u" ? !1 : t instanceof ShadowRoot || t instanceof C(t).ShadowRoot;
553
553
  }
554
554
  function et(t) {
555
555
  const {
@@ -594,7 +594,7 @@ function G(t) {
594
594
  return ["html", "body", "#document"].includes(K(t));
595
595
  }
596
596
  function L(t) {
597
- return R(t).getComputedStyle(t);
597
+ return C(t).getComputedStyle(t);
598
598
  }
599
599
  function lt(t) {
600
600
  return D(t) ? {
@@ -624,7 +624,7 @@ function Et(t) {
624
624
  function Pt(t, e, o) {
625
625
  var n;
626
626
  e === void 0 && (e = []);
627
- const i = Et(t), r = i === ((n = t.ownerDocument) == null ? void 0 : n.body), s = R(i);
627
+ const i = Et(t), r = i === ((n = t.ownerDocument) == null ? void 0 : n.body), s = C(i);
628
628
  return r ? (dt(s), e.concat(s, s.visualViewport || [], et(i) ? i : [], [])) : e.concat(i, Pt(i, []));
629
629
  }
630
630
  function dt(t) {
@@ -660,14 +660,14 @@ function q(t) {
660
660
  }
661
661
  const fe = /* @__PURE__ */ $(0);
662
662
  function Nt(t) {
663
- const e = R(t);
663
+ const e = C(t);
664
664
  return !xt() || !e.visualViewport ? fe : {
665
665
  x: e.visualViewport.offsetLeft,
666
666
  y: e.visualViewport.offsetTop
667
667
  };
668
668
  }
669
669
  function ue(t, e, o) {
670
- return e === void 0 && (e = !1), !o || e && o !== R(t) ? !1 : e;
670
+ return e === void 0 && (e = !1), !o || e && o !== C(t) ? !1 : e;
671
671
  }
672
672
  function tt(t, e, o, n) {
673
673
  e === void 0 && (e = !1), o === void 0 && (o = !1);
@@ -677,11 +677,11 @@ function tt(t, e, o, n) {
677
677
  const l = ue(r, o, n) ? Nt(r) : $(0);
678
678
  let c = (i.left + l.x) / s.x, a = (i.top + l.y) / s.y, f = i.width / s.x, u = i.height / s.y;
679
679
  if (r) {
680
- const p = R(r), d = n && D(n) ? R(n) : n;
680
+ const p = C(r), d = n && D(n) ? C(n) : n;
681
681
  let m = p, g = dt(m);
682
682
  for (; g && n && d !== m; ) {
683
683
  const h = q(g), w = g.getBoundingClientRect(), x = L(g), y = w.left + (g.clientLeft + parseFloat(x.paddingLeft)) * h.x, b = w.top + (g.clientTop + parseFloat(x.paddingTop)) * h.y;
684
- c *= h.x, a *= h.y, f *= h.x, u *= h.y, c += y, a += b, m = R(g), g = dt(m);
684
+ c *= h.x, a *= h.y, f *= h.x, u *= h.y, c += y, a += b, m = C(g), g = dt(m);
685
685
  }
686
686
  }
687
687
  return it({
@@ -748,7 +748,7 @@ function pe(t) {
748
748
  };
749
749
  }
750
750
  function ge(t, e) {
751
- const o = R(t), n = B(t), i = o.visualViewport;
751
+ const o = C(t), n = B(t), i = o.visualViewport;
752
752
  let r = n.clientWidth, s = n.clientHeight, l = 0, c = 0;
753
753
  if (i) {
754
754
  r = i.width, s = i.height;
@@ -771,7 +771,7 @@ function he(t, e) {
771
771
  y: a
772
772
  };
773
773
  }
774
- function _t(t, e, o) {
774
+ function Tt(t, e, o) {
775
775
  let n;
776
776
  if (e === "viewport")
777
777
  n = ge(t, o);
@@ -815,9 +815,9 @@ function xe(t) {
815
815
  strategy: i
816
816
  } = t;
817
817
  const s = [...o === "clippingAncestors" ? rt(e) ? [] : we(e, this._c) : [].concat(o), n], l = s[0], c = s.reduce((a, f) => {
818
- const u = _t(e, f, i);
818
+ const u = Tt(e, f, i);
819
819
  return a.top = S(u.top, a.top), a.right = X(u.right, a.right), a.bottom = X(u.bottom, a.bottom), a.left = S(u.left, a.left), a;
820
- }, _t(e, l, i));
820
+ }, Tt(e, l, i));
821
821
  return {
822
822
  width: c.right - c.left,
823
823
  height: c.bottom - c.top,
@@ -862,7 +862,7 @@ function ve(t, e, o) {
862
862
  function ct(t) {
863
863
  return L(t).position === "static";
864
864
  }
865
- function Tt(t, e) {
865
+ function _t(t, e) {
866
866
  if (!N(t) || L(t).position === "fixed")
867
867
  return null;
868
868
  if (e)
@@ -871,7 +871,7 @@ function Tt(t, e) {
871
871
  return B(t) === o && (o = o.ownerDocument.body), o;
872
872
  }
873
873
  function Vt(t, e) {
874
- const o = R(t);
874
+ const o = C(t);
875
875
  if (rt(t))
876
876
  return o;
877
877
  if (!N(t)) {
@@ -883,9 +883,9 @@ function Vt(t, e) {
883
883
  }
884
884
  return o;
885
885
  }
886
- let n = Tt(t, e);
886
+ let n = _t(t, e);
887
887
  for (; n && ce(n) && ct(n); )
888
- n = Tt(n, e);
888
+ n = _t(n, e);
889
889
  return n && G(n) && ct(n) && !wt(n) ? o : n || ae(t) || o;
890
890
  }
891
891
  const be = async function(t) {
@@ -903,7 +903,7 @@ const be = async function(t) {
903
903
  function Ae(t) {
904
904
  return L(t).direction === "rtl";
905
905
  }
906
- const Ce = {
906
+ const Re = {
907
907
  convertOffsetParentRelativeRectToViewportRelativeRect: de,
908
908
  getDocumentElement: B,
909
909
  getClippingRect: xe,
@@ -914,9 +914,9 @@ const Ce = {
914
914
  getScale: q,
915
915
  isElement: D,
916
916
  isRTL: Ae
917
- }, Re = se, Oe = re, Se = oe, _e = le, Te = ne, De = (t, e, o) => {
917
+ }, Ce = se, Oe = re, Se = oe, Te = le, _e = ne, De = (t, e, o) => {
918
918
  const n = /* @__PURE__ */ new Map(), i = {
919
- platform: Ce,
919
+ platform: Re,
920
920
  ...o
921
921
  }, r = {
922
922
  ...i.platform,
@@ -946,7 +946,7 @@ function ke(t) {
946
946
  options: t,
947
947
  fn(e) {
948
948
  const o = Ee(Pe(t.element));
949
- return o == null ? {} : Te({
949
+ return o == null ? {} : _e({
950
950
  element: o,
951
951
  padding: t.padding
952
952
  }).fn(e);
@@ -1010,12 +1010,12 @@ const $e = { class: "rds-e-tooltip" }, Ne = {
1010
1010
  {
1011
1011
  placement: e.placement,
1012
1012
  middleware: [
1013
- Re(e.offsetSpace),
1013
+ Ce(e.offsetSpace),
1014
1014
  Se(),
1015
1015
  Oe(),
1016
- _e({
1017
- apply({ availableHeight: v, availableWidth: E, elements: C }) {
1018
- Object.assign(C.floating.style, {
1016
+ Te({
1017
+ apply({ availableHeight: v, availableWidth: E, elements: R }) {
1018
+ Object.assign(R.floating.style, {
1019
1019
  maxWidth: n.value ? `${Math.max(0, E)}px` : "380px",
1020
1020
  width: "max-content",
1021
1021
  maxHeight: `${Math.max(0, v)}px`
@@ -1066,10 +1066,10 @@ const $e = { class: "rds-e-tooltip" }, Ne = {
1066
1066
  Z("div", {
1067
1067
  ref_key: "floatingRef",
1068
1068
  ref: s,
1069
- class: Ct(d.value)
1069
+ class: Rt(d.value)
1070
1070
  }, [
1071
1071
  at(i) ? (bt(), vt("div", Ne, [
1072
- Z("h3", We, Rt(at(i)), 1),
1072
+ Z("h3", We, Ct(at(i)), 1),
1073
1073
  Yt(Xt, {
1074
1074
  name: "close",
1075
1075
  "aria-hidden": "true",
@@ -1079,13 +1079,13 @@ const $e = { class: "rds-e-tooltip" }, Ne = {
1079
1079
  ])) : It("", !0),
1080
1080
  Z("div", Me, [
1081
1081
  At(m.$slots, "tooltip-content", {}, () => [
1082
- zt(Rt(t.content), 1)
1082
+ zt(Ct(t.content), 1)
1083
1083
  ], !0)
1084
1084
  ]),
1085
1085
  Z("div", {
1086
1086
  ref_key: "arrowRef",
1087
1087
  ref: l,
1088
- class: Ct(["rds-e-tooltip__tooltip-arrow", a.value])
1088
+ class: Rt(["rds-e-tooltip__tooltip-arrow", a.value])
1089
1089
  }, null, 2)
1090
1090
  ], 2)
1091
1091
  ]));