ovirt-ui-toolkit 0.0.53 → 0.0.55

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.
@@ -797,7 +797,7 @@ const Tr = () => /* @__PURE__ */ t.jsx("div", { className: "toolbar-pf" }), yr =
797
797
  ] });
798
798
  }, Wr = (a) => {
799
799
  const [s, o] = Q(!1);
800
- return /* @__PURE__ */ t.jsx("div", { className: `${s ? "open" : ""}`, children: /* @__PURE__ */ t.jsx(
800
+ return /* @__PURE__ */ t.jsx("div", { className: `btn-group ${s ? "open" : ""}`, children: /* @__PURE__ */ t.jsx(
801
801
  ke,
802
802
  {
803
803
  ...a,
@@ -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} />`,re,P,Mr,P),Ae[P+re]=!0}}return e===l?Fr(j):Ar(j),j}}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 ae;function We(){return ae||(ae=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"}),se=({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"})]})}),z=({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),Le=({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))})})]}),Be=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})},ze=({children:a,...s})=>t.jsx("table",{...s,children:a}),Ge=({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}),G=({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 ${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",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:`${s?"open":""}`,children:t.jsx(G,{...a,setIsOpen:o,isOpen:s})})},ie=({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"})})]})]})},oe=({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(G,{setIsOpen:h,isOpen:c,onChange:s,items:o,selected:l,className:"h-[20px]"})]})})},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(oe,{items:le,onChange:l,selected:c,children:t.jsx(z,{className:"m-0 h-[20px]",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(ie,{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(se,{items:[{title:"Дополнения",active:!0},{title:"Название плагина",href:"#Название плагина"}]}),t.jsx(oe,{onChange:()=>{},items:[{id:0,title:"5 сек"},{id:1,title:"10 сек"},{id:2,title:"20 сек"}],children:t.jsx(z,{children:"Hello"})})]});d.Alert=tr,d.Breadcrumb=se,d.Button=z,d.Checkbox=er,d.Dropdown=G,d.DropdownSelect=Qe,d.HelpText=Je,d.Input=Be,d.Modal=Ue,d.Pagination=ie,d.ReloadButton=ce,d.SampleComp=ar,d.Tab=Ve,d.Table=ze,d.TableToolbar=Ke,d.Tabs=Le,d.Tbody=Ge,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} />`,re,P,Mr,P),Ae[P+re]=!0}}return e===l?Fr(j):Ar(j),j}}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 ae;function We(){return ae||(ae=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"}),se=({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"})]})}),z=({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),Le=({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))})})]}),Be=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})},ze=({children:a,...s})=>t.jsx("table",{...s,children:a}),Ge=({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}),G=({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 ${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",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(G,{...a,setIsOpen:o,isOpen:s})})},ie=({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"})})]})]})},oe=({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(G,{setIsOpen:h,isOpen:c,onChange:s,items:o,selected:l,className:"h-[20px]"})]})})},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(oe,{items:le,onChange:l,selected:c,children:t.jsx(z,{className:"m-0 h-[20px]",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(ie,{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(se,{items:[{title:"Дополнения",active:!0},{title:"Название плагина",href:"#Название плагина"}]}),t.jsx(oe,{onChange:()=>{},items:[{id:0,title:"5 сек"},{id:1,title:"10 сек"},{id:2,title:"20 сек"}],children:t.jsx(z,{children:"Hello"})})]});d.Alert=tr,d.Breadcrumb=se,d.Button=z,d.Checkbox=er,d.Dropdown=G,d.DropdownSelect=Qe,d.HelpText=Je,d.Input=Be,d.Modal=Ue,d.Pagination=ie,d.ReloadButton=ce,d.SampleComp=ar,d.Tab=Ve,d.Table=ze,d.TableToolbar=Ke,d.Tabs=Le,d.Tbody=Ge,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.53",
3
+ "version": "0.0.55",
4
4
  "type": "module",
5
5
  "main": "./dist/ovirt-ui-toolkit.umd.js",
6
6
  "module": "./dist/ovirt-ui-toolkit.es.js",