ovirt-ui-toolkit 0.0.45 → 0.0.46
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.
|
@@ -833,7 +833,7 @@ const Tr = () => /* @__PURE__ */ t.jsx("div", { className: "toolbar-pf" }), gr =
|
|
|
833
833
|
a(h.data);
|
|
834
834
|
}, u = (p = Oe.find((h) => h.data === s)) == null ? void 0 : p.id;
|
|
835
835
|
return /* @__PURE__ */ t.jsxs("div", { className: "flex", children: [
|
|
836
|
-
/* @__PURE__ */ t.jsx(K, { className: "m-0", type: "default", onClick: l, children: /* @__PURE__ */ t.jsx("i", { className: "fa fa-refresh" }) }),
|
|
836
|
+
/* @__PURE__ */ t.jsx("div", { children: /* @__PURE__ */ t.jsx(K, { className: "m-0", type: "default", onClick: l, children: /* @__PURE__ */ t.jsx("i", { className: "fa fa-refresh" }) }) }),
|
|
837
837
|
/* @__PURE__ */ t.jsx(yr, { className: "m-0", onChange: o, items: Oe, selected: u })
|
|
838
838
|
] });
|
|
839
839
|
}, Wr = ({
|
|
@@ -27,4 +27,4 @@ Check the top-level render call using <`+n+">.")}return r}}function Ne(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,D,Yr,D),De[D+re]=!0}}return e===o?Ar(j):Dr(j),j}}function Ir(e,r,n){return Ae(e,r,n,!0)}function Fr(e,r,n){return Ae(e,r,n,!1)}var $r=Fr,Wr=Ir;W.Fragment=o,W.jsx=$r,W.jsxs=Wr}()),W}var ae;function $e(){return ae||(ae=1,process.env.NODE_ENV==="production"?V.exports=Ie():V.exports=Fe()),V.exports}var t=$e();const We=()=>t.jsx("div",{className:"toolbar-pf"}),se=({items:a,className:s})=>t.jsx("ol",{className:`breadcrumb ${s||""}`.trim(),children:a.map((l,o)=>t.jsx("li",{className:l.active?"active":"",children:l.active?l.title:t.jsx("a",{href:l.href,children:l.title})},o))}),Ye=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"})]})}),B=({type:a="default",title:s,size:l,label:o,onClick:u,isDisabled:h=!1,children:b,className:E="",isLoading:m=!1})=>{const S=`btn-${a}`,x=l?`btn-${l}`:"",T=`${`btn ${S} ${x}`.trim()} ${E}`.trim();return t.jsx("button",{className:T,type:"button",onClick:u,disabled:h||m,children:t.jsxs("div",{className:"flex items-center justify-center",children:[m&&Ye,b||o," ",s&&t.jsx("span",{children:s})]})})},Me=({children:a,eventKey:s,active:l})=>t.jsx("div",{className:`tab-pane ${l?"active":""}`,id:`${s}-panel`,role:"tabpanel","aria-labelledby":`${s}-tab`,children:a},s),Ve=({activeKey:a,onSelect:s,children:l})=>t.jsxs("div",{className:"tabs-container",children:[t.jsx("ul",{className:"nav nav-tabs",role:"tablist",children:l.map(({props:{eventKey:o,title:u}})=>t.jsx("li",{className:a===o?"active":"",children:t.jsx("a",{href:`#${o}`,onClick:h=>{h.preventDefault(),s(o)},children:u})},o))}),t.jsx("div",{className:"tabs-container",children:t.jsx("div",{className:"tab-content pf-c-tab-content",children:l.map(({props:{eventKey:o,children:u}})=>t.jsx("div",{className:`tab-pane ${a===o?"active":""}`,id:`${o}-panel`,role:"tabpanel","aria-labelledby":`${o}-tab`,children:u},o))})})]}),Be=k.forwardRef(({id:a,type:s,placeholder:l="",value:o,onChange:u,className:h="form-control"},b)=>t.jsx("input",{type:s,id:a,className:h,placeholder:l,value:o,onChange:u,ref:b})),Le=({title:a,isOpen:s,onClose:l,children:o,size:u})=>{if(!s)return null;const h=u?`modal-${u}`:"";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:l,"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:o})]})})})},Ue=({variant:a,children:s,className:l=""})=>{const o={warning:"text-yellow-600",success:"text-green-600",error:"text-red-600"},u=l+" "+o[a]||"";return t.jsx("p",{className:u,children:s})},Je=({children:a,...s})=>t.jsx("table",{...s,children:a}),He=({children:a,...s})=>t.jsx("tbody",{...s,children:a}),ze=({children:a,...s})=>t.jsx("td",{...s,children:a}),Ge=({children:a,...s})=>t.jsx("th",{...s,children:a}),qe=({children:a,...s})=>t.jsx("thead",{...s,children:a}),Xe=({children:a,...s})=>t.jsx("tr",{...s,children:a}),ie=({items:a,selected:s,title:l,onChange:o,isDisabled:u,className:h=""})=>{const[b,E]=k.useState(!1),m=`btn btn-default dropdown-toggle h-full ${h}`,S=()=>{E(w=>!w)},x=w=>{E(!1),o(w)},_=w=>{const L=w.id===s;return t.jsx("li",{onClick:()=>x(w),className:L?"active":"",children:t.jsx("a",{href:"#",children:w.title})},w.id)},T=b?"dropdown open":"dropdown";return t.jsxs("div",{className:T,style:{display:"inline-block"},children:[t.jsx("button",{type:"button",disabled:u,className:m,onClick:S,children:t.jsxs("div",{className:"flex items-center",children:[l&&t.jsx("div",{className:"mr-2",children:l}),t.jsx("span",{className:"caret"})]})}),b&&t.jsx("ul",{className:"dropdown-menu",children:a.map(_)})]})},oe=({currentPage:a,total:s,onPageChange:l,pageSize:o})=>{const u=Math.ceil(s/o),h=()=>{a>1&&l(a-1)},b=()=>{a<u&&l(a+1)};return t.jsxs("div",{children:[t.jsx("span",{children:t.jsxs("span",{className:"pagination-pf-items-current",children:[a," - ",u]})}),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===u?"disabled":""}`,disabled:a===u,onClick:b,children:t.jsx("i",{className:"fa fa-angle-right"})})]})]})},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:l})=>{var h;const o=b=>{a(b.data)},u=(h=le.find(b=>b.data===s))==null?void 0:h.id;return t.jsxs("div",{className:"flex",children:[t.jsx(B,{className:"m-0",type:"default",onClick:l,children:t.jsx("i",{className:"fa fa-refresh"})}),t.jsx(ie,{className:"m-0",onChange:o,items:le,selected:u})]})},Ze=({interval:a,page:s,total:l,onRefresh:o,onChangeInterval:u,onPageChange:h,pageSize:b})=>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:u,onRefresh:o})}),t.jsx("div",{className:"m-[5px]",children:t.jsx(oe,{pageSize:b,currentPage:s,total:l,onPageChange:h})})]}),Qe=({id:a,label:s,isChecked:l=!1,onChange:o,className:u="checkbox"})=>t.jsx("div",{className:u,children:t.jsxs("label",{htmlFor:a,children:[t.jsx("input",{type:"checkbox",id:a,checked:l,onChange:o}),` ${s}`]})}),Ke=({placeholder:a="",rows:s=3,maxLength:l,value:o,onChange:u,isDisabled:h=!1,className:b=""})=>{const[E,m]=k.useState(o||""),S=o!==void 0?o:E,x=_=>{const T=_.target.value;u?u(T):m(T)};return t.jsx("textarea",{className:b,placeholder:a,rows:s,maxLength:l,value:S,onChange:x,disabled:h})},er=({variant:a,title:s,className:l})=>{const o=`alert alert-${a} ${l||""}`;return["success","info","warning","danger"].includes(a)||(console.warn(`Unsupported alert variant: "${a}". Defaulting to "info".`),a="info"),t.jsx("div",{className:o.trim(),role:"alert",children:s})};function rr(a,s){k.useEffect(()=>{if(!a)return;const l=setInterval(()=>{s()},a);return()=>clearInterval(l)},[a])}const tr=({children:a})=>t.jsx("div",{className:"btn-group",children:a}),nr=()=>t.jsxs("div",{children:[t.jsx(se,{items:[{title:"Дополнения",active:!0},{title:"Название плагина",href:"#Название плагина"}]}),t.jsxs(tr,{children:[t.jsx(B,{children:"Hello"}),t.jsx(B,{children:"Hello"})]})]});v.Alert=er,v.Breadcrumb=se,v.Button=B,v.Checkbox=Qe,v.Dropdown=ie,v.HelpText=Ue,v.Input=Be,v.Modal=Le,v.Pagination=oe,v.ReloadButton=ce,v.SampleComp=nr,v.Tab=Me,v.Table=Je,v.TableToolbar=Ze,v.Tabs=Ve,v.Tbody=He,v.Td=ze,v.TextArea=Ke,v.Th=Ge,v.Thead=qe,v.ToolbarContainer=We,v.Tr=Xe,v.useIntervalLoader=rr,Object.defineProperty(v,Symbol.toStringTag,{value:"Module"})});
|
|
30
|
+
<%s key={someKey} {...props} />`,re,D,Yr,D),De[D+re]=!0}}return e===o?Ar(j):Dr(j),j}}function Ir(e,r,n){return Ae(e,r,n,!0)}function Fr(e,r,n){return Ae(e,r,n,!1)}var $r=Fr,Wr=Ir;W.Fragment=o,W.jsx=$r,W.jsxs=Wr}()),W}var ae;function $e(){return ae||(ae=1,process.env.NODE_ENV==="production"?V.exports=Ie():V.exports=Fe()),V.exports}var t=$e();const We=()=>t.jsx("div",{className:"toolbar-pf"}),se=({items:a,className:s})=>t.jsx("ol",{className:`breadcrumb ${s||""}`.trim(),children:a.map((l,o)=>t.jsx("li",{className:l.active?"active":"",children:l.active?l.title:t.jsx("a",{href:l.href,children:l.title})},o))}),Ye=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"})]})}),B=({type:a="default",title:s,size:l,label:o,onClick:u,isDisabled:h=!1,children:b,className:E="",isLoading:m=!1})=>{const S=`btn-${a}`,x=l?`btn-${l}`:"",T=`${`btn ${S} ${x}`.trim()} ${E}`.trim();return t.jsx("button",{className:T,type:"button",onClick:u,disabled:h||m,children:t.jsxs("div",{className:"flex items-center justify-center",children:[m&&Ye,b||o," ",s&&t.jsx("span",{children:s})]})})},Me=({children:a,eventKey:s,active:l})=>t.jsx("div",{className:`tab-pane ${l?"active":""}`,id:`${s}-panel`,role:"tabpanel","aria-labelledby":`${s}-tab`,children:a},s),Ve=({activeKey:a,onSelect:s,children:l})=>t.jsxs("div",{className:"tabs-container",children:[t.jsx("ul",{className:"nav nav-tabs",role:"tablist",children:l.map(({props:{eventKey:o,title:u}})=>t.jsx("li",{className:a===o?"active":"",children:t.jsx("a",{href:`#${o}`,onClick:h=>{h.preventDefault(),s(o)},children:u})},o))}),t.jsx("div",{className:"tabs-container",children:t.jsx("div",{className:"tab-content pf-c-tab-content",children:l.map(({props:{eventKey:o,children:u}})=>t.jsx("div",{className:`tab-pane ${a===o?"active":""}`,id:`${o}-panel`,role:"tabpanel","aria-labelledby":`${o}-tab`,children:u},o))})})]}),Be=k.forwardRef(({id:a,type:s,placeholder:l="",value:o,onChange:u,className:h="form-control"},b)=>t.jsx("input",{type:s,id:a,className:h,placeholder:l,value:o,onChange:u,ref:b})),Le=({title:a,isOpen:s,onClose:l,children:o,size:u})=>{if(!s)return null;const h=u?`modal-${u}`:"";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:l,"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:o})]})})})},Ue=({variant:a,children:s,className:l=""})=>{const o={warning:"text-yellow-600",success:"text-green-600",error:"text-red-600"},u=l+" "+o[a]||"";return t.jsx("p",{className:u,children:s})},Je=({children:a,...s})=>t.jsx("table",{...s,children:a}),He=({children:a,...s})=>t.jsx("tbody",{...s,children:a}),ze=({children:a,...s})=>t.jsx("td",{...s,children:a}),Ge=({children:a,...s})=>t.jsx("th",{...s,children:a}),qe=({children:a,...s})=>t.jsx("thead",{...s,children:a}),Xe=({children:a,...s})=>t.jsx("tr",{...s,children:a}),ie=({items:a,selected:s,title:l,onChange:o,isDisabled:u,className:h=""})=>{const[b,E]=k.useState(!1),m=`btn btn-default dropdown-toggle h-full ${h}`,S=()=>{E(w=>!w)},x=w=>{E(!1),o(w)},_=w=>{const L=w.id===s;return t.jsx("li",{onClick:()=>x(w),className:L?"active":"",children:t.jsx("a",{href:"#",children:w.title})},w.id)},T=b?"dropdown open":"dropdown";return t.jsxs("div",{className:T,style:{display:"inline-block"},children:[t.jsx("button",{type:"button",disabled:u,className:m,onClick:S,children:t.jsxs("div",{className:"flex items-center",children:[l&&t.jsx("div",{className:"mr-2",children:l}),t.jsx("span",{className:"caret"})]})}),b&&t.jsx("ul",{className:"dropdown-menu",children:a.map(_)})]})},oe=({currentPage:a,total:s,onPageChange:l,pageSize:o})=>{const u=Math.ceil(s/o),h=()=>{a>1&&l(a-1)},b=()=>{a<u&&l(a+1)};return t.jsxs("div",{children:[t.jsx("span",{children:t.jsxs("span",{className:"pagination-pf-items-current",children:[a," - ",u]})}),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===u?"disabled":""}`,disabled:a===u,onClick:b,children:t.jsx("i",{className:"fa fa-angle-right"})})]})]})},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:l})=>{var h;const o=b=>{a(b.data)},u=(h=le.find(b=>b.data===s))==null?void 0:h.id;return t.jsxs("div",{className:"flex",children:[t.jsx("div",{children:t.jsx(B,{className:"m-0",type:"default",onClick:l,children:t.jsx("i",{className:"fa fa-refresh"})})}),t.jsx(ie,{className:"m-0",onChange:o,items:le,selected:u})]})},Ze=({interval:a,page:s,total:l,onRefresh:o,onChangeInterval:u,onPageChange:h,pageSize:b})=>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:u,onRefresh:o})}),t.jsx("div",{className:"m-[5px]",children:t.jsx(oe,{pageSize:b,currentPage:s,total:l,onPageChange:h})})]}),Qe=({id:a,label:s,isChecked:l=!1,onChange:o,className:u="checkbox"})=>t.jsx("div",{className:u,children:t.jsxs("label",{htmlFor:a,children:[t.jsx("input",{type:"checkbox",id:a,checked:l,onChange:o}),` ${s}`]})}),Ke=({placeholder:a="",rows:s=3,maxLength:l,value:o,onChange:u,isDisabled:h=!1,className:b=""})=>{const[E,m]=k.useState(o||""),S=o!==void 0?o:E,x=_=>{const T=_.target.value;u?u(T):m(T)};return t.jsx("textarea",{className:b,placeholder:a,rows:s,maxLength:l,value:S,onChange:x,disabled:h})},er=({variant:a,title:s,className:l})=>{const o=`alert alert-${a} ${l||""}`;return["success","info","warning","danger"].includes(a)||(console.warn(`Unsupported alert variant: "${a}". Defaulting to "info".`),a="info"),t.jsx("div",{className:o.trim(),role:"alert",children:s})};function rr(a,s){k.useEffect(()=>{if(!a)return;const l=setInterval(()=>{s()},a);return()=>clearInterval(l)},[a])}const tr=({children:a})=>t.jsx("div",{className:"btn-group",children:a}),nr=()=>t.jsxs("div",{children:[t.jsx(se,{items:[{title:"Дополнения",active:!0},{title:"Название плагина",href:"#Название плагина"}]}),t.jsxs(tr,{children:[t.jsx(B,{children:"Hello"}),t.jsx(B,{children:"Hello"})]})]});v.Alert=er,v.Breadcrumb=se,v.Button=B,v.Checkbox=Qe,v.Dropdown=ie,v.HelpText=Ue,v.Input=Be,v.Modal=Le,v.Pagination=oe,v.ReloadButton=ce,v.SampleComp=nr,v.Tab=Me,v.Table=Je,v.TableToolbar=Ze,v.Tabs=Ve,v.Tbody=He,v.Td=ze,v.TextArea=Ke,v.Th=Ge,v.Thead=qe,v.ToolbarContainer=We,v.Tr=Xe,v.useIntervalLoader=rr,Object.defineProperty(v,Symbol.toStringTag,{value:"Module"})});
|