ovirt-ui-toolkit 0.0.59 → 0.0.60

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.
@@ -5,6 +5,7 @@ interface GroupButtonContainerProps {
5
5
  onChange: (item: DropdownItem) => void;
6
6
  items: DropdownItem[];
7
7
  selected?: number | string;
8
+ className?: string;
8
9
  }
9
10
  declare const GroupButtonContainer: React.FC<GroupButtonContainerProps>;
10
11
  export default GroupButtonContainer;
@@ -1,4 +1,4 @@
1
- import Se, { forwardRef as mr, useState as Q, useEffect as br } from "react";
1
+ import Se, { forwardRef as hr, useState as Q, useEffect as br } from "react";
2
2
  var U = { exports: {} }, A = {};
3
3
  /**
4
4
  * @license React
@@ -14,14 +14,14 @@ function xr() {
14
14
  if (Ce) return A;
15
15
  Ce = 1;
16
16
  var a = Se, s = Symbol.for("react.element"), o = Symbol.for("react.fragment"), l = Object.prototype.hasOwnProperty, c = a.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, p = { key: !0, ref: !0, __self: !0, __source: !0 };
17
- function h(C, m, T) {
17
+ function m(C, h, T) {
18
18
  var j, b = {}, R = null, W = null;
19
- T !== void 0 && (R = "" + T), m.key !== void 0 && (R = "" + m.key), m.ref !== void 0 && (W = m.ref);
20
- for (j in m) l.call(m, j) && !p.hasOwnProperty(j) && (b[j] = m[j]);
21
- if (C && C.defaultProps) for (j in m = C.defaultProps, m) b[j] === void 0 && (b[j] = m[j]);
19
+ T !== void 0 && (R = "" + T), h.key !== void 0 && (R = "" + h.key), h.ref !== void 0 && (W = h.ref);
20
+ for (j in h) l.call(h, j) && !p.hasOwnProperty(j) && (b[j] = h[j]);
21
+ if (C && C.defaultProps) for (j in h = C.defaultProps, h) b[j] === void 0 && (b[j] = h[j]);
22
22
  return { $$typeof: s, type: C, key: R, ref: W, props: b, _owner: c.current };
23
23
  }
24
- return A.Fragment = o, A.jsx = h, A.jsxs = h, A;
24
+ return A.Fragment = o, A.jsx = m, A.jsxs = m, A;
25
25
  }
26
26
  var I = {};
27
27
  /**
@@ -36,7 +36,7 @@ var I = {};
36
36
  var Te;
37
37
  function gr() {
38
38
  return Te || (Te = 1, process.env.NODE_ENV !== "production" && function() {
39
- var a = Se, s = Symbol.for("react.element"), o = Symbol.for("react.portal"), l = Symbol.for("react.fragment"), c = Symbol.for("react.strict_mode"), p = Symbol.for("react.profiler"), h = Symbol.for("react.provider"), C = Symbol.for("react.context"), m = Symbol.for("react.forward_ref"), T = Symbol.for("react.suspense"), j = Symbol.for("react.suspense_list"), b = Symbol.for("react.memo"), R = Symbol.for("react.lazy"), W = Symbol.for("react.offscreen"), K = Symbol.iterator, $e = "@@iterator";
39
+ var a = Se, s = Symbol.for("react.element"), o = Symbol.for("react.portal"), l = Symbol.for("react.fragment"), c = Symbol.for("react.strict_mode"), p = Symbol.for("react.profiler"), m = Symbol.for("react.provider"), C = Symbol.for("react.context"), h = Symbol.for("react.forward_ref"), T = Symbol.for("react.suspense"), j = Symbol.for("react.suspense_list"), b = Symbol.for("react.memo"), R = Symbol.for("react.lazy"), W = Symbol.for("react.offscreen"), K = Symbol.iterator, $e = "@@iterator";
40
40
  function De(e) {
41
41
  if (e === null || typeof e != "object")
42
42
  return null;
@@ -64,7 +64,7 @@ function gr() {
64
64
  var Ae = !1, Ie = !1, We = !1, Ye = !1, Ve = !1, ee;
65
65
  ee = Symbol.for("react.module.reference");
66
66
  function Me(e) {
67
- return !!(typeof e == "string" || typeof e == "function" || e === l || e === p || Ve || e === c || e === T || e === j || Ye || e === W || Ae || Ie || We || typeof e == "object" && e !== null && (e.$$typeof === R || e.$$typeof === b || e.$$typeof === h || e.$$typeof === C || e.$$typeof === m || // This needs to include all possible module reference object
67
+ return !!(typeof e == "string" || typeof e == "function" || e === l || e === p || Ve || e === c || e === T || e === j || Ye || e === W || Ae || Ie || We || typeof e == "object" && e !== null && (e.$$typeof === R || e.$$typeof === b || e.$$typeof === m || e.$$typeof === C || e.$$typeof === h || // This needs to include all possible module reference object
68
68
  // types supported by any Flight configuration anywhere since
69
69
  // we don't know which Flight build this will end up being used
70
70
  // with.
@@ -106,10 +106,10 @@ function gr() {
106
106
  case C:
107
107
  var r = e;
108
108
  return re(r) + ".Consumer";
109
- case h:
109
+ case m:
110
110
  var n = e;
111
111
  return re(n._context) + ".Provider";
112
- case m:
112
+ case h:
113
113
  return Le(e, e.render, "ForwardRef");
114
114
  case b:
115
115
  var i = e.displayName || null;
@@ -299,7 +299,7 @@ function gr() {
299
299
  }
300
300
  if (typeof e == "object")
301
301
  switch (e.$$typeof) {
302
- case m:
302
+ case h:
303
303
  return qe(e.render);
304
304
  case b:
305
305
  return M(e.type, r, n);
@@ -364,12 +364,12 @@ function gr() {
364
364
  if (Ze(e))
365
365
  return y("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Xe(e)), ve(e);
366
366
  }
367
- var he = k.ReactCurrentOwner, Qe = {
367
+ var me = k.ReactCurrentOwner, Qe = {
368
368
  key: !0,
369
369
  ref: !0,
370
370
  __self: !0,
371
371
  __source: !0
372
- }, me, be;
372
+ }, he, be;
373
373
  function Ke(e) {
374
374
  if (F.call(e, "ref")) {
375
375
  var r = Object.getOwnPropertyDescriptor(e, "ref").get;
@@ -387,12 +387,12 @@ function gr() {
387
387
  return e.key !== void 0;
388
388
  }
389
389
  function rr(e, r) {
390
- typeof e.ref == "string" && he.current;
390
+ typeof e.ref == "string" && me.current;
391
391
  }
392
392
  function tr(e, r) {
393
393
  {
394
394
  var n = function() {
395
- me || (me = !0, y("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
395
+ he || (he = !0, y("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
396
396
  };
397
397
  n.isReactWarning = !0, Object.defineProperty(e, "key", {
398
398
  get: n,
@@ -455,7 +455,7 @@ function gr() {
455
455
  var g = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
456
456
  u && tr(f, g), E && nr(f, g);
457
457
  }
458
- return ar(e, u, E, d, i, he.current, f);
458
+ return ar(e, u, E, d, i, me.current, f);
459
459
  }
460
460
  }
461
461
  var G = k.ReactCurrentOwner, xe = k.ReactDebugCurrentFrame;
@@ -539,7 +539,7 @@ Check the top-level render call using <` + n + ">.");
539
539
  var n;
540
540
  if (typeof r == "function")
541
541
  n = r.propTypes;
542
- else if (typeof r == "object" && (r.$$typeof === m || // Note: Memo only checks outer props here.
542
+ else if (typeof r == "object" && (r.$$typeof === h || // Note: Memo only checks outer props here.
543
543
  // Inner props are checked in the reconciler.
544
544
  r.$$typeof === b))
545
545
  n = r.propTypes;
@@ -597,8 +597,8 @@ Check the top-level render call using <` + n + ">.");
597
597
  Ee(w, e);
598
598
  }
599
599
  if (F.call(r, "key")) {
600
- var N = O(e), _ = Object.keys(r).filter(function(hr) {
601
- return hr !== "key";
600
+ var N = O(e), _ = Object.keys(r).filter(function(mr) {
601
+ return mr !== "key";
602
602
  }), Z = _.length > 0 ? "{key: someKey, " + _.join(": ..., ") + ": ...}" : "{key: someKey}";
603
603
  if (!Re[N + Z]) {
604
604
  var pr = _.length > 0 ? "{" + _.join(": ..., ") + ": ...}" : "{}";
@@ -664,9 +664,9 @@ const Tr = () => /* @__PURE__ */ t.jsx("div", { className: "toolbar-pf" }), yr =
664
664
  label: l,
665
665
  onClick: c,
666
666
  isDisabled: p = !1,
667
- children: h,
667
+ children: m,
668
668
  className: C = "",
669
- isLoading: m = !1
669
+ isLoading: h = !1
670
670
  }) => {
671
671
  const T = `btn-${a}`, j = o ? `btn-${o}` : "", R = `${`btn ${T} ${j}`.trim()} ${C}`.trim();
672
672
  return /* @__PURE__ */ t.jsx(
@@ -675,10 +675,10 @@ const Tr = () => /* @__PURE__ */ t.jsx("div", { className: "toolbar-pf" }), yr =
675
675
  className: R,
676
676
  type: "button",
677
677
  onClick: c,
678
- disabled: p || m,
678
+ disabled: p || h,
679
679
  children: /* @__PURE__ */ t.jsxs("div", { className: "flex items-center justify-center", children: [
680
- m && Er,
681
- h || l,
680
+ h && Er,
681
+ m || l,
682
682
  " ",
683
683
  s && /* @__PURE__ */ t.jsx("span", { children: s })
684
684
  ] })
@@ -716,7 +716,7 @@ const Tr = () => /* @__PURE__ */ t.jsx("div", { className: "toolbar-pf" }), yr =
716
716
  },
717
717
  l
718
718
  )) }) })
719
- ] }), Sr = mr(
719
+ ] }), Sr = hr(
720
720
  ({
721
721
  id: a,
722
722
  type: s,
@@ -724,7 +724,7 @@ const Tr = () => /* @__PURE__ */ t.jsx("div", { className: "toolbar-pf" }), yr =
724
724
  value: l,
725
725
  onChange: c,
726
726
  className: p = "form-control"
727
- }, h) => /* @__PURE__ */ t.jsx(
727
+ }, m) => /* @__PURE__ */ t.jsx(
728
728
  "input",
729
729
  {
730
730
  type: s,
@@ -733,7 +733,7 @@ const Tr = () => /* @__PURE__ */ t.jsx("div", { className: "toolbar-pf" }), yr =
733
733
  placeholder: o,
734
734
  value: l,
735
735
  onChange: c,
736
- ref: h
736
+ ref: m
737
737
  }
738
738
  )
739
739
  ), Nr = ({ title: a, isOpen: s, onClose: o, children: l, size: c }) => {
@@ -760,24 +760,24 @@ const Tr = () => /* @__PURE__ */ t.jsx("div", { className: "toolbar-pf" }), yr =
760
760
  isOpen: l,
761
761
  setIsOpen: c,
762
762
  onChange: p,
763
- className: h = ""
763
+ className: m = ""
764
764
  }) => {
765
765
  const C = (b) => {
766
766
  c(!b);
767
- }, m = (b) => {
767
+ }, h = (b) => {
768
768
  c(!1), p(b);
769
769
  }, T = (b) => {
770
770
  const R = b.id === s;
771
771
  return /* @__PURE__ */ t.jsx(
772
772
  "li",
773
773
  {
774
- onClick: () => m(b),
774
+ onClick: () => h(b),
775
775
  className: R ? "active" : "",
776
776
  children: /* @__PURE__ */ t.jsx("a", { href: "#", children: b.title })
777
777
  },
778
778
  b.id
779
779
  );
780
- }, j = `btn btn-default dropdown-toggle flex-1 ${h}`;
780
+ }, j = `btn btn-default dropdown-toggle flex-1 ${m}`;
781
781
  return /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
782
782
  /* @__PURE__ */ t.jsx(
783
783
  "button",
@@ -810,7 +810,7 @@ const Tr = () => /* @__PURE__ */ t.jsx("div", { className: "toolbar-pf" }), yr =
810
810
  }, Rr = ({ currentPage: a, total: s, onPageChange: o, pageSize: l }) => {
811
811
  const c = Math.ceil(s / l), p = () => {
812
812
  a > 1 && o(a - 1);
813
- }, h = () => {
813
+ }, m = () => {
814
814
  a < c && o(a + 1);
815
815
  };
816
816
  return /* @__PURE__ */ t.jsxs("div", { children: [
@@ -836,7 +836,7 @@ const Tr = () => /* @__PURE__ */ t.jsx("div", { className: "toolbar-pf" }), yr =
836
836
  type: "button",
837
837
  className: `btn btn-default ${a === c ? "disabled" : ""}`,
838
838
  disabled: a === c,
839
- onClick: h,
839
+ onClick: m,
840
840
  children: /* @__PURE__ */ t.jsx("i", { className: "fa fa-angle-right" })
841
841
  }
842
842
  )
@@ -846,16 +846,17 @@ const Tr = () => /* @__PURE__ */ t.jsx("div", { className: "toolbar-pf" }), yr =
846
846
  children: a,
847
847
  onChange: s,
848
848
  items: o,
849
- selected: l
849
+ selected: l,
850
+ className: c = ""
850
851
  }) => {
851
- const [c, p] = Q(!1);
852
- return /* @__PURE__ */ t.jsx("div", { className: `btn-group ${c ? "open" : ""}`, children: /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
852
+ const [p, m] = Q(!1);
853
+ return /* @__PURE__ */ t.jsx("div", { className: `btn-group ${c} ${p ? "open" : ""}`, children: /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
853
854
  a,
854
855
  /* @__PURE__ */ t.jsx(
855
856
  ke,
856
857
  {
857
- setIsOpen: p,
858
- isOpen: c,
858
+ setIsOpen: m,
859
+ isOpen: p,
859
860
  onChange: s,
860
861
  items: o,
861
862
  selected: l
@@ -870,10 +871,10 @@ const Tr = () => /* @__PURE__ */ t.jsx("div", { className: "toolbar-pf" }), yr =
870
871
  { id: 5, title: "60 сек", data: 6e4 }
871
872
  ], _r = ({ onChange: a, value: s, onRefresh: o }) => {
872
873
  var p;
873
- const l = (h) => {
874
- a(h.data);
875
- }, c = (p = Oe.find((h) => h.data === s)) == null ? void 0 : p.id;
876
- return /* @__PURE__ */ t.jsx(Pe, { items: Oe, onChange: l, selected: c, children: /* @__PURE__ */ t.jsx(Ne, { className: "m-0", type: "default", onClick: o, children: /* @__PURE__ */ t.jsx("i", { className: "fa fa-refresh" }) }) });
874
+ const l = (m) => {
875
+ a(m.data);
876
+ }, c = (p = Oe.find((m) => m.data === s)) == null ? void 0 : p.id;
877
+ return /* @__PURE__ */ t.jsx(Pe, { className: "flex", items: Oe, onChange: l, selected: c, children: /* @__PURE__ */ t.jsx(Ne, { className: "m-0", type: "default", onClick: o, children: /* @__PURE__ */ t.jsx("i", { className: "fa fa-refresh" }) }) });
877
878
  }, Yr = ({
878
879
  interval: a,
879
880
  page: s,
@@ -881,7 +882,7 @@ const Tr = () => /* @__PURE__ */ t.jsx("div", { className: "toolbar-pf" }), yr =
881
882
  onRefresh: l,
882
883
  onChangeInterval: c,
883
884
  onPageChange: p,
884
- pageSize: h
885
+ pageSize: m
885
886
  }) => /* @__PURE__ */ t.jsxs("div", { className: "flex justify-between bg-[#f5f5f5] border border-[#d1d1d1]", children: [
886
887
  /* @__PURE__ */ t.jsx("div", { className: "m-[5px]", children: /* @__PURE__ */ t.jsx(
887
888
  _r,
@@ -894,7 +895,7 @@ const Tr = () => /* @__PURE__ */ t.jsx("div", { className: "toolbar-pf" }), yr =
894
895
  /* @__PURE__ */ t.jsx("div", { className: "m-[5px]", children: /* @__PURE__ */ t.jsx(
895
896
  Rr,
896
897
  {
897
- pageSize: h,
898
+ pageSize: m,
898
899
  currentPage: s,
899
900
  total: o,
900
901
  onPageChange: p
@@ -924,16 +925,16 @@ const Tr = () => /* @__PURE__ */ t.jsx("div", { className: "toolbar-pf" }), yr =
924
925
  value: l,
925
926
  onChange: c,
926
927
  isDisabled: p = !1,
927
- className: h = ""
928
+ className: m = ""
928
929
  }) => {
929
- const [C, m] = Q(l || ""), T = l !== void 0 ? l : C, j = (b) => {
930
+ const [C, h] = Q(l || ""), T = l !== void 0 ? l : C, j = (b) => {
930
931
  const R = b.target.value;
931
- c ? c(R) : m(R);
932
+ c ? c(R) : h(R);
932
933
  };
933
934
  return /* @__PURE__ */ t.jsx(
934
935
  "textarea",
935
936
  {
936
- className: h,
937
+ className: m,
937
938
  placeholder: a,
938
939
  rows: s,
939
940
  maxLength: o,
@@ -27,4 +27,4 @@ Check the top-level render call using <`+n+">.")}return r}}function Pe(e,r){{if(
27
27
  <%s {...props} />
28
28
  React keys must be passed directly to JSX without using spread:
29
29
  let props = %s;
30
- <%s key={someKey} {...props} />`,te,P,Mr,P),Ae[P+te]=!0}}return e===l?Fr(x):Ar(x),x}}function Ir(e,r,n){return Fe(e,r,n,!0)}function $r(e,r,n){return Fe(e,r,n,!1)}var Wr=$r,Yr=Ir;$.Fragment=l,$.jsx=Wr,$.jsxs=Yr}()),$}var se;function We(){return se||(se=1,process.env.NODE_ENV==="production"?M.exports=Ie():M.exports=$e()),M.exports}var t=We();const Ye=()=>t.jsx("div",{className:"toolbar-pf"}),ie=({items:a,className:s})=>t.jsx("ol",{className:`breadcrumb ${s||""}`.trim(),children:a.map((o,l)=>t.jsx("li",{className:o.active?"active":"",children:o.active?o.title:t.jsx("a",{href:o.href,children:o.title})},l))}),Me=t.jsx("span",{className:"loading-spinner mr-2",children:t.jsxs("svg",{className:"animate-spin h-5 w-5 text-current",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[t.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),t.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]})}),G=({type:a="default",title:s,size:o,label:l,onClick:c,isDisabled:h=!1,children:m,className:C="",isLoading:b=!1})=>{const w=`btn-${a}`,y=o?`btn-${o}`:"",_=`${`btn ${w} ${y}`.trim()} ${C}`.trim();return t.jsx("button",{className:_,type:"button",onClick:c,disabled:h||b,children:t.jsxs("div",{className:"flex items-center justify-center",children:[b&&Me,m||l," ",s&&t.jsx("span",{children:s})]})})},Ve=({children:a,eventKey:s,active:o})=>t.jsx("div",{className:`tab-pane ${o?"active":""}`,id:`${s}-panel`,role:"tabpanel","aria-labelledby":`${s}-tab`,children:a},s),Be=({activeKey:a,onSelect:s,children:o})=>t.jsxs("div",{className:"tabs-container",children:[t.jsx("ul",{className:"nav nav-tabs",role:"tablist",children:o.map(({props:{eventKey:l,title:c}})=>t.jsx("li",{className:a===l?"active":"",children:t.jsx("a",{href:`#${l}`,onClick:h=>{h.preventDefault(),s(l)},children:c})},l))}),t.jsx("div",{className:"tabs-container",children:t.jsx("div",{className:"tab-content pf-c-tab-content",children:o.map(({props:{eventKey:l,children:c}})=>t.jsx("div",{className:`tab-pane ${a===l?"active":""}`,id:`${l}-panel`,role:"tabpanel","aria-labelledby":`${l}-tab`,children:c},l))})})]}),Le=O.forwardRef(({id:a,type:s,placeholder:o="",value:l,onChange:c,className:h="form-control"},m)=>t.jsx("input",{type:s,id:a,className:h,placeholder:o,value:l,onChange:c,ref:m})),Ue=({title:a,isOpen:s,onClose:o,children:l,size:c})=>{if(!s)return null;const h=c?`modal-${c}`:"";return t.jsx("div",{className:"modal fade in",style:{display:"block"},tabIndex:-1,role:"dialog",children:t.jsx("div",{className:`modal-dialog ${h}`,role:"document",children:t.jsxs("div",{className:"modal-content",children:[t.jsxs("div",{className:"modal-header",children:[t.jsx("button",{type:"button",className:"close",onClick:o,"aria-hidden":"true",children:t.jsx("span",{className:"pficon pficon-close"})}),t.jsx("h4",{className:"modal-title",children:a})]}),t.jsx("div",{className:"modal-body",children:l})]})})})},Je=({variant:a,children:s,className:o=""})=>{const l={warning:"text-yellow-600",success:"text-green-600",error:"text-red-600"},c=o+" "+l[a]||"";return t.jsx("p",{className:c,children:s})},Ge=({children:a,...s})=>t.jsx("table",{...s,children:a}),ze=({children:a,...s})=>t.jsx("tbody",{...s,children:a}),He=({children:a,...s})=>t.jsx("td",{...s,children:a}),Xe=({children:a,...s})=>t.jsx("th",{...s,children:a}),qe=({children:a,...s})=>t.jsx("thead",{...s,children:a}),Ze=({children:a,...s})=>t.jsx("tr",{...s,children:a}),z=({items:a,selected:s,title:o,isOpen:l,setIsOpen:c,onChange:h,className:m=""})=>{const C=g=>{c(!g)},b=g=>{c(!1),h(g)},w=g=>{const _=g.id===s;return t.jsx("li",{onClick:()=>b(g),className:_?"active":"",children:t.jsx("a",{href:"#",children:g.title})},g.id)},y=`btn btn-default dropdown-toggle flex-1 ${m}`;return t.jsxs(t.Fragment,{children:[t.jsx("button",{style:{marginLeft:"0px",left:"-1px"},className:y,onClick:()=>C(l),"data-toggle":"dropdown",type:"button",children:t.jsxs("div",{className:"flex items-center justify-center",children:[o&&t.jsx("div",{className:"mr-2",children:o})," ",t.jsx("span",{className:"caret"})," "]})}),t.jsx("ul",{className:"dropdown-menu",role:"menu",children:a.map(w)})]})},Qe=a=>{const[s,o]=O.useState(!1);return t.jsx("div",{className:`btn-group ${s?"open":""}`,children:t.jsx(z,{...a,setIsOpen:o,isOpen:s})})},oe=({currentPage:a,total:s,onPageChange:o,pageSize:l})=>{const c=Math.ceil(s/l),h=()=>{a>1&&o(a-1)},m=()=>{a<c&&o(a+1)};return t.jsxs("div",{children:[t.jsx("span",{children:t.jsxs("span",{className:"pagination-pf-items-current",children:[a," - ",c]})}),t.jsxs("div",{className:"btn-group ml-2",children:[t.jsx("button",{type:"button",className:`btn btn-default ${a===1?"disabled":""}`,disabled:a===1,onClick:h,children:t.jsx("i",{className:"fa fa-angle-left"})}),t.jsx("button",{type:"button",className:`btn btn-default ${a===c?"disabled":""}`,disabled:a===c,onClick:m,children:t.jsx("i",{className:"fa fa-angle-right"})})]})]})},H=({children:a,onChange:s,items:o,selected:l})=>{const[c,h]=O.useState(!1);return t.jsx("div",{className:`btn-group ${c?"open":""}`,children:t.jsxs(t.Fragment,{children:[a,t.jsx(z,{setIsOpen:h,isOpen:c,onChange:s,items:o,selected:l})]})})},le=[{id:1,title:"5 сек",data:5e3},{id:2,title:"10 сек",data:1e4},{id:3,title:"20 сек",data:2e4},{id:4,title:"30 сек",data:3e4},{id:5,title:"60 сек",data:6e4}],ce=({onChange:a,value:s,onRefresh:o})=>{var h;const l=m=>{a(m.data)},c=(h=le.find(m=>m.data===s))==null?void 0:h.id;return t.jsx(H,{items:le,onChange:l,selected:c,children:t.jsx(G,{className:"m-0",type:"default",onClick:o,children:t.jsx("i",{className:"fa fa-refresh"})})})},Ke=({interval:a,page:s,total:o,onRefresh:l,onChangeInterval:c,onPageChange:h,pageSize:m})=>t.jsxs("div",{className:"flex justify-between bg-[#f5f5f5] border border-[#d1d1d1]",children:[t.jsx("div",{className:"m-[5px]",children:t.jsx(ce,{value:a,onChange:c,onRefresh:l})}),t.jsx("div",{className:"m-[5px]",children:t.jsx(oe,{pageSize:m,currentPage:s,total:o,onPageChange:h})})]}),er=({id:a,label:s,isChecked:o=!1,onChange:l,className:c="checkbox"})=>t.jsx("div",{className:c,children:t.jsxs("label",{htmlFor:a,children:[t.jsx("input",{type:"checkbox",id:a,checked:o,onChange:l}),` ${s}`]})}),rr=({placeholder:a="",rows:s=3,maxLength:o,value:l,onChange:c,isDisabled:h=!1,className:m=""})=>{const[C,b]=O.useState(l||""),w=l!==void 0?l:C,y=g=>{const _=g.target.value;c?c(_):b(_)};return t.jsx("textarea",{className:m,placeholder:a,rows:s,maxLength:o,value:w,onChange:y,disabled:h})},tr=({variant:a,title:s,className:o})=>{const l=`alert alert-${a} ${o||""}`;return["success","info","warning","danger"].includes(a)||(console.warn(`Unsupported alert variant: "${a}". Defaulting to "info".`),a="info"),t.jsx("div",{className:l.trim(),role:"alert",children:s})};function nr(a,s){O.useEffect(()=>{if(!a)return;const o=setInterval(()=>{s()},a);return()=>clearInterval(o)},[a])}const ar=()=>t.jsxs("div",{children:[t.jsx(ie,{items:[{title:"Дополнения",active:!0},{title:"Название плагина",href:"#Название плагина"}]}),t.jsx(H,{onChange:()=>{},items:[{id:0,title:"5 сек"},{id:1,title:"10 сек"},{id:2,title:"20 сек"}],children:t.jsx(G,{children:"Hello"})})]});d.Alert=tr,d.Breadcrumb=ie,d.Button=G,d.Checkbox=er,d.Dropdown=z,d.DropdownSelect=Qe,d.GroupButtonContainer=H,d.HelpText=Je,d.Input=Le,d.Modal=Ue,d.Pagination=oe,d.ReloadButton=ce,d.SampleComp=ar,d.Tab=Ve,d.Table=Ge,d.TableToolbar=Ke,d.Tabs=Be,d.Tbody=ze,d.Td=He,d.TextArea=rr,d.Th=Xe,d.Thead=qe,d.ToolbarContainer=Ye,d.Tr=Ze,d.useIntervalLoader=nr,Object.defineProperty(d,Symbol.toStringTag,{value:"Module"})});
30
+ <%s key={someKey} {...props} />`,te,P,Mr,P),Ae[P+te]=!0}}return e===l?Fr(x):Ar(x),x}}function Ir(e,r,n){return Fe(e,r,n,!0)}function $r(e,r,n){return Fe(e,r,n,!1)}var Wr=$r,Yr=Ir;$.Fragment=l,$.jsx=Wr,$.jsxs=Yr}()),$}var se;function We(){return se||(se=1,process.env.NODE_ENV==="production"?M.exports=Ie():M.exports=$e()),M.exports}var t=We();const Ye=()=>t.jsx("div",{className:"toolbar-pf"}),ie=({items:a,className:s})=>t.jsx("ol",{className:`breadcrumb ${s||""}`.trim(),children:a.map((o,l)=>t.jsx("li",{className:o.active?"active":"",children:o.active?o.title:t.jsx("a",{href:o.href,children:o.title})},l))}),Me=t.jsx("span",{className:"loading-spinner mr-2",children:t.jsxs("svg",{className:"animate-spin h-5 w-5 text-current",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[t.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),t.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]})}),G=({type:a="default",title:s,size:o,label:l,onClick:c,isDisabled:h=!1,children:m,className:C="",isLoading:b=!1})=>{const w=`btn-${a}`,y=o?`btn-${o}`:"",_=`${`btn ${w} ${y}`.trim()} ${C}`.trim();return t.jsx("button",{className:_,type:"button",onClick:c,disabled:h||b,children:t.jsxs("div",{className:"flex items-center justify-center",children:[b&&Me,m||l," ",s&&t.jsx("span",{children:s})]})})},Ve=({children:a,eventKey:s,active:o})=>t.jsx("div",{className:`tab-pane ${o?"active":""}`,id:`${s}-panel`,role:"tabpanel","aria-labelledby":`${s}-tab`,children:a},s),Be=({activeKey:a,onSelect:s,children:o})=>t.jsxs("div",{className:"tabs-container",children:[t.jsx("ul",{className:"nav nav-tabs",role:"tablist",children:o.map(({props:{eventKey:l,title:c}})=>t.jsx("li",{className:a===l?"active":"",children:t.jsx("a",{href:`#${l}`,onClick:h=>{h.preventDefault(),s(l)},children:c})},l))}),t.jsx("div",{className:"tabs-container",children:t.jsx("div",{className:"tab-content pf-c-tab-content",children:o.map(({props:{eventKey:l,children:c}})=>t.jsx("div",{className:`tab-pane ${a===l?"active":""}`,id:`${l}-panel`,role:"tabpanel","aria-labelledby":`${l}-tab`,children:c},l))})})]}),Le=O.forwardRef(({id:a,type:s,placeholder:o="",value:l,onChange:c,className:h="form-control"},m)=>t.jsx("input",{type:s,id:a,className:h,placeholder:o,value:l,onChange:c,ref:m})),Ue=({title:a,isOpen:s,onClose:o,children:l,size:c})=>{if(!s)return null;const h=c?`modal-${c}`:"";return t.jsx("div",{className:"modal fade in",style:{display:"block"},tabIndex:-1,role:"dialog",children:t.jsx("div",{className:`modal-dialog ${h}`,role:"document",children:t.jsxs("div",{className:"modal-content",children:[t.jsxs("div",{className:"modal-header",children:[t.jsx("button",{type:"button",className:"close",onClick:o,"aria-hidden":"true",children:t.jsx("span",{className:"pficon pficon-close"})}),t.jsx("h4",{className:"modal-title",children:a})]}),t.jsx("div",{className:"modal-body",children:l})]})})})},Je=({variant:a,children:s,className:o=""})=>{const l={warning:"text-yellow-600",success:"text-green-600",error:"text-red-600"},c=o+" "+l[a]||"";return t.jsx("p",{className:c,children:s})},Ge=({children:a,...s})=>t.jsx("table",{...s,children:a}),ze=({children:a,...s})=>t.jsx("tbody",{...s,children:a}),He=({children:a,...s})=>t.jsx("td",{...s,children:a}),Xe=({children:a,...s})=>t.jsx("th",{...s,children:a}),qe=({children:a,...s})=>t.jsx("thead",{...s,children:a}),Ze=({children:a,...s})=>t.jsx("tr",{...s,children:a}),z=({items:a,selected:s,title:o,isOpen:l,setIsOpen:c,onChange:h,className:m=""})=>{const C=g=>{c(!g)},b=g=>{c(!1),h(g)},w=g=>{const _=g.id===s;return t.jsx("li",{onClick:()=>b(g),className:_?"active":"",children:t.jsx("a",{href:"#",children:g.title})},g.id)},y=`btn btn-default dropdown-toggle flex-1 ${m}`;return t.jsxs(t.Fragment,{children:[t.jsx("button",{style:{marginLeft:"0px",left:"-1px"},className:y,onClick:()=>C(l),"data-toggle":"dropdown",type:"button",children:t.jsxs("div",{className:"flex items-center justify-center",children:[o&&t.jsx("div",{className:"mr-2",children:o})," ",t.jsx("span",{className:"caret"})," "]})}),t.jsx("ul",{className:"dropdown-menu",role:"menu",children:a.map(w)})]})},Qe=a=>{const[s,o]=O.useState(!1);return t.jsx("div",{className:`btn-group ${s?"open":""}`,children:t.jsx(z,{...a,setIsOpen:o,isOpen:s})})},oe=({currentPage:a,total:s,onPageChange:o,pageSize:l})=>{const c=Math.ceil(s/l),h=()=>{a>1&&o(a-1)},m=()=>{a<c&&o(a+1)};return t.jsxs("div",{children:[t.jsx("span",{children:t.jsxs("span",{className:"pagination-pf-items-current",children:[a," - ",c]})}),t.jsxs("div",{className:"btn-group ml-2",children:[t.jsx("button",{type:"button",className:`btn btn-default ${a===1?"disabled":""}`,disabled:a===1,onClick:h,children:t.jsx("i",{className:"fa fa-angle-left"})}),t.jsx("button",{type:"button",className:`btn btn-default ${a===c?"disabled":""}`,disabled:a===c,onClick:m,children:t.jsx("i",{className:"fa fa-angle-right"})})]})]})},H=({children:a,onChange:s,items:o,selected:l,className:c=""})=>{const[h,m]=O.useState(!1);return t.jsx("div",{className:`btn-group ${c} ${h?"open":""}`,children:t.jsxs(t.Fragment,{children:[a,t.jsx(z,{setIsOpen:m,isOpen:h,onChange:s,items:o,selected:l})]})})},le=[{id:1,title:"5 сек",data:5e3},{id:2,title:"10 сек",data:1e4},{id:3,title:"20 сек",data:2e4},{id:4,title:"30 сек",data:3e4},{id:5,title:"60 сек",data:6e4}],ce=({onChange:a,value:s,onRefresh:o})=>{var h;const l=m=>{a(m.data)},c=(h=le.find(m=>m.data===s))==null?void 0:h.id;return t.jsx(H,{className:"flex",items:le,onChange:l,selected:c,children:t.jsx(G,{className:"m-0",type:"default",onClick:o,children:t.jsx("i",{className:"fa fa-refresh"})})})},Ke=({interval:a,page:s,total:o,onRefresh:l,onChangeInterval:c,onPageChange:h,pageSize:m})=>t.jsxs("div",{className:"flex justify-between bg-[#f5f5f5] border border-[#d1d1d1]",children:[t.jsx("div",{className:"m-[5px]",children:t.jsx(ce,{value:a,onChange:c,onRefresh:l})}),t.jsx("div",{className:"m-[5px]",children:t.jsx(oe,{pageSize:m,currentPage:s,total:o,onPageChange:h})})]}),er=({id:a,label:s,isChecked:o=!1,onChange:l,className:c="checkbox"})=>t.jsx("div",{className:c,children:t.jsxs("label",{htmlFor:a,children:[t.jsx("input",{type:"checkbox",id:a,checked:o,onChange:l}),` ${s}`]})}),rr=({placeholder:a="",rows:s=3,maxLength:o,value:l,onChange:c,isDisabled:h=!1,className:m=""})=>{const[C,b]=O.useState(l||""),w=l!==void 0?l:C,y=g=>{const _=g.target.value;c?c(_):b(_)};return t.jsx("textarea",{className:m,placeholder:a,rows:s,maxLength:o,value:w,onChange:y,disabled:h})},tr=({variant:a,title:s,className:o})=>{const l=`alert alert-${a} ${o||""}`;return["success","info","warning","danger"].includes(a)||(console.warn(`Unsupported alert variant: "${a}". Defaulting to "info".`),a="info"),t.jsx("div",{className:l.trim(),role:"alert",children:s})};function nr(a,s){O.useEffect(()=>{if(!a)return;const o=setInterval(()=>{s()},a);return()=>clearInterval(o)},[a])}const ar=()=>t.jsxs("div",{children:[t.jsx(ie,{items:[{title:"Дополнения",active:!0},{title:"Название плагина",href:"#Название плагина"}]}),t.jsx(H,{onChange:()=>{},items:[{id:0,title:"5 сек"},{id:1,title:"10 сек"},{id:2,title:"20 сек"}],children:t.jsx(G,{children:"Hello"})})]});d.Alert=tr,d.Breadcrumb=ie,d.Button=G,d.Checkbox=er,d.Dropdown=z,d.DropdownSelect=Qe,d.GroupButtonContainer=H,d.HelpText=Je,d.Input=Le,d.Modal=Ue,d.Pagination=oe,d.ReloadButton=ce,d.SampleComp=ar,d.Tab=Ve,d.Table=Ge,d.TableToolbar=Ke,d.Tabs=Be,d.Tbody=ze,d.Td=He,d.TextArea=rr,d.Th=Xe,d.Thead=qe,d.ToolbarContainer=Ye,d.Tr=Ze,d.useIntervalLoader=nr,Object.defineProperty(d,Symbol.toStringTag,{value:"Module"})});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ovirt-ui-toolkit",
3
- "version": "0.0.59",
3
+ "version": "0.0.60",
4
4
  "type": "module",
5
5
  "main": "./dist/ovirt-ui-toolkit.umd.js",
6
6
  "module": "./dist/ovirt-ui-toolkit.es.js",