ovirt-ui-toolkit 0.0.38 → 0.0.39
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.
|
@@ -668,6 +668,7 @@ const Tr = () => /* @__PURE__ */ t.jsx("div", { className: "toolbar-pf" }), gr =
|
|
|
668
668
|
className: C = "",
|
|
669
669
|
isLoading: b = !1
|
|
670
670
|
}) => {
|
|
671
|
+
console.log("🪚 isLoa", b);
|
|
671
672
|
const T = `btn-${a}`, j = l ? `btn-${l}` : "", R = `${`btn ${T} ${j}`.trim()} ${C}`.trim();
|
|
672
673
|
return /* @__PURE__ */ t.jsx(
|
|
673
674
|
"button",
|
|
@@ -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} />`,ee,P,Yr,P),De[P+ee]=!0}}return e===o?Ar(x):Dr(x),x}}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;$.Fragment=o,$.jsx=$r,$.jsxs=Wr}()),$}var ne;function $e(){return ne||(ne=1,process.env.NODE_ENV==="production"?M.exports=Ie():M.exports=Fe()),M.exports}var t=$e();const We=()=>t.jsx("div",{className:"toolbar-pf"}),ae=({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"})]})}),V=({type:a="default",title:s,size:l,label:o,onClick:f,isDisabled:b=!1,children:h,className:C="",isLoading:m=!1})=>{const w=`btn-${a}`,y=l?`btn-${l}`:"",_=`${`btn ${w} ${y}`.trim()} ${C}`.trim();return t.jsx("button",{className:_,type:"button",onClick:f,disabled:b||m,children:t.jsxs("div",{className:"flex items-center justify-center",children:[m&&Ye,h||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:f}})=>t.jsx("li",{className:a===o?"active":"",children:t.jsx("a",{href:`#${o}`,onClick:b=>{b.preventDefault(),s(o)},children:f})},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:f}})=>t.jsx("div",{className:`tab-pane ${a===o?"active":""}`,id:`${o}-panel`,role:"tabpanel","aria-labelledby":`${o}-tab`,children:f},o))})})]}),Be=O.forwardRef(({id:a,type:s,placeholder:l="",value:o,onChange:f,className:b="form-control"},h)=>t.jsx("input",{type:s,id:a,className:b,placeholder:l,value:o,onChange:f,ref:h})),Le=({title:a,isOpen:s,onClose:l,children:o,size:f})=>{if(!s)return null;const b=f?`modal-${f}`:"";return t.jsx("div",{className:"modal fade in",style:{display:"block"},tabIndex:-1,role:"dialog",children:t.jsx("div",{className:`modal-dialog ${b}`,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})=>{const o={warning:"text-yellow-600",success:"text-green-600",error:"text-red-600"}[a]||"";return t.jsx("p",{className:o,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}),se=({items:a,selected:s,title:l,onChange:o,isDisabled:f})=>{const[b,h]=O.useState(!1),C=()=>{h(g=>!g)},m=g=>{h(!1),o(g)},w=g=>{const _=g.id===s;return t.jsx("li",{onClick:()=>m(g),className:_?"active":"",children:t.jsx("a",{href:"#",children:g.title})},g.id)},y=b?"dropdown open":"dropdown";return t.jsxs("div",{className:y,style:{display:"inline-block"},children:[t.jsx("button",{type:"button",disabled:f,className:"btn btn-default dropdown-toggle",onClick:C,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(w)})]})},ie=({currentPage:a,total:s,onPageChange:l,pageSize:o})=>{const f=Math.ceil(s/o),b=()=>{a>1&&l(a-1)},h=()=>{a<f&&l(a+1)};return t.jsxs("div",{children:[t.jsx("span",{children:t.jsxs("span",{className:"pagination-pf-items-current",children:[a," - ",f]})}),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:b,children:t.jsx("i",{className:"fa fa-angle-left"})}),t.jsx("button",{type:"button",className:`btn btn-default ${a===f?"disabled":""}`,disabled:a===f,onClick:h,children:t.jsx("i",{className:"fa fa-angle-right"})})]})]})},oe=[{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}],le=({onChange:a,value:s,onRefresh:l})=>{var b;const o=h=>{a(h.data)},f=(b=oe.find(h=>h.data===s))==null?void 0:b.id;return t.jsxs("div",{className:"flex",children:[t.jsx(V,{type:"default",onClick:l,children:t.jsx("i",{className:"fa fa-refresh"})}),t.jsx(se,{onChange:o,items:oe,selected:f})]})},Ze=({interval:a,page:s,total:l,onRefresh:o,onChangeInterval:f,onPageChange:b,pageSize:h})=>t.jsxs("div",{className:"flex justify-between bg-[#f5f5f5] border border-[#d1d1d1]",children:[t.jsx("div",{className:"m-[5px]",children:t.jsx(le,{value:a,onChange:f,onRefresh:o})}),t.jsx("div",{className:"m-[5px]",children:t.jsx(ie,{pageSize:h,currentPage:s,total:l,onPageChange:b})})]}),Qe=({id:a,label:s,isChecked:l=!1,onChange:o,className:f="checkbox"})=>t.jsx("div",{className:f,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:f,isDisabled:b=!1,className:h=""})=>{const[C,m]=O.useState(o||""),w=o!==void 0?o:C,y=g=>{const _=g.target.value;f?f(_):m(_)};return t.jsx("textarea",{className:h,placeholder:a,rows:s,maxLength:l,value:w,onChange:y,disabled:b})},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){O.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(ae,{items:[{title:"Дополнения",active:!0},{title:"Название плагина",href:"#Название плагина"}]}),t.jsxs(tr,{children:[t.jsx(V,{children:"Hello"}),t.jsx(V,{children:"Hello"})]})]});v.Alert=er,v.Breadcrumb=ae,v.Button=V,v.Checkbox=Qe,v.Dropdown=se,v.HelpText=Ue,v.Input=Be,v.Modal=Le,v.Pagination=ie,v.ReloadButton=le,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} />`,ee,P,Yr,P),De[P+ee]=!0}}return e===o?Ar(x):Dr(x),x}}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;$.Fragment=o,$.jsx=$r,$.jsxs=Wr}()),$}var ne;function $e(){return ne||(ne=1,process.env.NODE_ENV==="production"?M.exports=Ie():M.exports=Fe()),M.exports}var t=$e();const We=()=>t.jsx("div",{className:"toolbar-pf"}),ae=({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"})]})}),V=({type:a="default",title:s,size:l,label:o,onClick:f,isDisabled:b=!1,children:h,className:C="",isLoading:m=!1})=>{console.log("🪚 isLoa",m);const w=`btn-${a}`,y=l?`btn-${l}`:"",_=`${`btn ${w} ${y}`.trim()} ${C}`.trim();return t.jsx("button",{className:_,type:"button",onClick:f,disabled:b||m,children:t.jsxs("div",{className:"flex items-center justify-center",children:[m&&Ye,h||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:f}})=>t.jsx("li",{className:a===o?"active":"",children:t.jsx("a",{href:`#${o}`,onClick:b=>{b.preventDefault(),s(o)},children:f})},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:f}})=>t.jsx("div",{className:`tab-pane ${a===o?"active":""}`,id:`${o}-panel`,role:"tabpanel","aria-labelledby":`${o}-tab`,children:f},o))})})]}),Be=O.forwardRef(({id:a,type:s,placeholder:l="",value:o,onChange:f,className:b="form-control"},h)=>t.jsx("input",{type:s,id:a,className:b,placeholder:l,value:o,onChange:f,ref:h})),Le=({title:a,isOpen:s,onClose:l,children:o,size:f})=>{if(!s)return null;const b=f?`modal-${f}`:"";return t.jsx("div",{className:"modal fade in",style:{display:"block"},tabIndex:-1,role:"dialog",children:t.jsx("div",{className:`modal-dialog ${b}`,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})=>{const o={warning:"text-yellow-600",success:"text-green-600",error:"text-red-600"}[a]||"";return t.jsx("p",{className:o,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}),se=({items:a,selected:s,title:l,onChange:o,isDisabled:f})=>{const[b,h]=O.useState(!1),C=()=>{h(g=>!g)},m=g=>{h(!1),o(g)},w=g=>{const _=g.id===s;return t.jsx("li",{onClick:()=>m(g),className:_?"active":"",children:t.jsx("a",{href:"#",children:g.title})},g.id)},y=b?"dropdown open":"dropdown";return t.jsxs("div",{className:y,style:{display:"inline-block"},children:[t.jsx("button",{type:"button",disabled:f,className:"btn btn-default dropdown-toggle",onClick:C,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(w)})]})},ie=({currentPage:a,total:s,onPageChange:l,pageSize:o})=>{const f=Math.ceil(s/o),b=()=>{a>1&&l(a-1)},h=()=>{a<f&&l(a+1)};return t.jsxs("div",{children:[t.jsx("span",{children:t.jsxs("span",{className:"pagination-pf-items-current",children:[a," - ",f]})}),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:b,children:t.jsx("i",{className:"fa fa-angle-left"})}),t.jsx("button",{type:"button",className:`btn btn-default ${a===f?"disabled":""}`,disabled:a===f,onClick:h,children:t.jsx("i",{className:"fa fa-angle-right"})})]})]})},oe=[{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}],le=({onChange:a,value:s,onRefresh:l})=>{var b;const o=h=>{a(h.data)},f=(b=oe.find(h=>h.data===s))==null?void 0:b.id;return t.jsxs("div",{className:"flex",children:[t.jsx(V,{type:"default",onClick:l,children:t.jsx("i",{className:"fa fa-refresh"})}),t.jsx(se,{onChange:o,items:oe,selected:f})]})},Ze=({interval:a,page:s,total:l,onRefresh:o,onChangeInterval:f,onPageChange:b,pageSize:h})=>t.jsxs("div",{className:"flex justify-between bg-[#f5f5f5] border border-[#d1d1d1]",children:[t.jsx("div",{className:"m-[5px]",children:t.jsx(le,{value:a,onChange:f,onRefresh:o})}),t.jsx("div",{className:"m-[5px]",children:t.jsx(ie,{pageSize:h,currentPage:s,total:l,onPageChange:b})})]}),Qe=({id:a,label:s,isChecked:l=!1,onChange:o,className:f="checkbox"})=>t.jsx("div",{className:f,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:f,isDisabled:b=!1,className:h=""})=>{const[C,m]=O.useState(o||""),w=o!==void 0?o:C,y=g=>{const _=g.target.value;f?f(_):m(_)};return t.jsx("textarea",{className:h,placeholder:a,rows:s,maxLength:l,value:w,onChange:y,disabled:b})},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){O.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(ae,{items:[{title:"Дополнения",active:!0},{title:"Название плагина",href:"#Название плагина"}]}),t.jsxs(tr,{children:[t.jsx(V,{children:"Hello"}),t.jsx(V,{children:"Hello"})]})]});v.Alert=er,v.Breadcrumb=ae,v.Button=V,v.Checkbox=Qe,v.Dropdown=se,v.HelpText=Ue,v.Input=Be,v.Modal=Le,v.Pagination=ie,v.ReloadButton=le,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"})});
|