enerdot-front-system 0.0.28-beta.5 → 0.0.28
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.
- package/dist/index.cjs.js +1 -1
- package/dist/index.es.js +6 -3
- package/package.json +3 -3
package/dist/index.cjs.js
CHANGED
|
@@ -73,4 +73,4 @@ m.version="2.30.1";ac(Q);m.fn=g;m.min=qu;m.max=zu;m.now=Zu;m.utc=Te;m.unix=Sf;m.
|
|
|
73
73
|
${Ve.itemButton}
|
|
74
74
|
${n&&Ve.itemButtonSelected}
|
|
75
75
|
${i&&Ve.itemButtonLarge}
|
|
76
|
-
`,style:{minHeight:l+"px"},onClick:u,children:[e==null?void 0:e.element,a]})},Lm=({options:e,values:t,onChange:r,type:n,input:s,level:a,isAllChecked:i,allCheckText:l,onHideTooltip:u,containerRef:f})=>{const d=Br[a],{showCount:_,showFirstIndex:h}=Tm({rowHeight:d,overScanCount:10,ref:f}),x=e==null?void 0:e.map((p,k)=>{if(!(k>=h&&k<=_+h))return o.jsx("div",{style:{minHeight:d+"px"}},k);const j=t.some(q=>q.value===p.value),{startValue:O,validValue:T,endValue:H}=s_(p.label,s),C=o.jsxs("div",{children:[O,o.jsx("span",{style:{color:v.blue400},children:T}),H]});switch(n){case"checkbox":return o.jsx(Dm,{option:p,values:t,onChange:r,level:a,isSelected:j,children:C});case"radio":return o.jsx(Fm,{option:p,onChange:r,level:a,isSelected:j,children:C});case"select":return o.jsx(Wm,{option:p,onChange:r,level:a,isSelected:j,onHideTooltip:u,children:C})}});if(i&&n==="checkbox"){const p=a==="large",k=(e==null?void 0:e.length)===(t==null?void 0:t.length),M=()=>k?r==null?void 0:r([]):r==null?void 0:r(e);x.unshift(o.jsx("button",{style:{minHeight:d+"px"},className:`${Ve.itemButton} ${p&&Ve.itemButtonLarge}`,onClick:M,children:o.jsx(zt,{checked:k,children:l})}))}return o.jsx(o.Fragment,{children:x})},Im=({initialPlaceholder:e,level:t="medium",type:r="checkbox",options:n=[],values:s=[],onChange:a,isAllChecked:i,allCheckText:l="전체선택",unit:u,width:f="100%"})=>{var ye;const d=$.useRef(null),_=$.useRef(null),[h,x]=$.useState(""),[p,k]=Mr(d),M=jr({isOpen:p,containerRef:d,tooltipRef:_}),{height:j}=qe[t],O=t==="large",T=h.length>0?n.filter(ie=>n_(h,ie.label)):n,H=()=>k(ie=>!ie),C=ie=>{x(ie.target.value)},q=ie=>{if(ie.preventDefault(),(T==null?void 0:T.length)>0){const I=r==="checkbox",S=s.find(R=>R.value===T[0].value);a(S?s.filter(R=>R.value!==T[0].value):I?[...s,T[0]]:[T[0]]),r==="select"&&k(!1)}},ue=s.length>0,re=ue?s.length>1?`${s==null?void 0:s[0].label} 외 ${s.length-1}개`:s==null?void 0:s[0].label:e,me=(ye=n==null?void 0:n.find(ie=>{var I;return((I=s==null?void 0:s[0])==null?void 0:I.value)===ie.value}))==null?void 0:ye.element;return $.useEffect(()=>{p||x("")},[p]),o.jsxs("div",{className:ut.container,style:{width:f},ref:d,children:[o.jsxs(Sm,{onClick:H,isOpen:p,level:t,width:"100%",children:[me,o.jsx("form",{onSubmit:q,className:ut.input,children:o.jsx("input",{className:`${ut.input} ${O&&ut.inputLarge} ${ue&&ut.inputActivePlaceholder}`,placeholder:re,value:h,onChange:C})}),u&&o.jsx("span",{className:ut.unit,children:u}),p?o.jsx(vn,{}):o.jsx(xn,{})]}),p&&o.jsx("div",{ref:_,className:ut.tooltip,style:{top:j+8+"px",minWidth:"300px",...M==="right"?{right:0}:{left:0}},children:o.jsx(Lm,{options:T,values:s,onChange:a,type:r,input:h,level:t,isAllChecked:i,allCheckText:l,onHideTooltip:()=>k(!1),containerRef:_})})]})},Am="_leftWrapper_glkyo_1",Bm="_rightWrapper_glkyo_8",Hm="_disabled_glkyo_15",yr={leftWrapper:Am,rightWrapper:Bm,disabled:Hm},Um=({children:e,iconPosition:t="right",icon:r,level:n="small",...s})=>{const a=t==="right",i=Vm[n];return o.jsxs(Es,{...s,pl:a?i.default:i.iconSide,pr:a?i.iconSide:i.default,level:n,children:[!a&&o.jsx("div",{className:`${yr.leftWrapper} ${s.disabled&&yr.disabled}`,children:r}),e,a&&o.jsx("div",{className:`${yr.rightWrapper} ${s.disabled&&yr.disabled}`,children:r})]})},Vm={small:{default:16,iconSide:8},medium:{default:20,iconSide:12},large:{default:20,iconSide:16}},Gm="_input_2r9bm_1",qm="_container_2r9bm_30",zm="_iconWrapper_2r9bm_35",Zm="_iconButton_2r9bm_46",Jm="_cancelWrapper_2r9bm_55",Ut={input:Gm,container:qm,iconWrapper:zm,iconButton:Zm,cancelWrapper:Jm},Qm=({width:e,level:t="large",value:r,disabled:n,onCancel:s,...a})=>{const[i,l]=$.useState(!1),u=$.useRef(null),f=$.useRef(null),[d]=Lr(u),_=t==="small";return o.jsxs("div",{className:Ut.container,style:{width:e??"100%",height:(_?32:48)+"px"},children:[o.jsx("div",{className:Ut.iconWrapper,ref:u,children:o.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:o.jsx("g",{id:"ic/search",children:o.jsx("path",{id:"Vector",d:"M21 21L15 15M3 10C3 10.9193 3.18106 11.8295 3.53284 12.6788C3.88463 13.5281 4.40024 14.2997 5.05025 14.9497C5.70026 15.5998 6.47194 16.1154 7.32122 16.4672C8.1705 16.8189 9.08075 17 10 17C10.9193 17 11.8295 16.8189 12.6788 16.4672C13.5281 16.1154 14.2997 15.5998 14.9497 14.9497C15.5998 14.2997 16.1154 13.5281 16.4672 12.6788C16.8189 11.8295 17 10.9193 17 10C17 9.08075 16.8189 8.1705 16.4672 7.32122C16.1154 6.47194 15.5998 5.70026 14.9497 5.05025C14.2997 4.40024 13.5281 3.88463 12.6788 3.53284C11.8295 3.18106 10.9193 3 10 3C9.08075 3 8.1705 3.18106 7.32122 3.53284C6.47194 3.88463 5.70026 4.40024 5.05025 5.05025C4.40024 5.70026 3.88463 6.47194 3.53284 7.32122C3.18106 8.1705 3 9.08075 3 10Z",stroke:"#A3A8B4",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})}),o.jsx("input",{className:Ut.input,style:{fontSize:_?"16px":"18px",paddingLeft:d&&d+"px",paddingRight:12+(i&&s&&32)+"px"},ref:f,onFocus:()=>l(!0),onBlur:()=>l(!1),type:"search",value:r,disabled:n,...a}),i&&s&&o.jsx("div",{className:Ut.iconButton,onClick:()=>s(a==null?void 0:a.name),onMouseDown:h=>h.preventDefault(),children:o.jsx("div",{className:Ut.cancelWrapper,children:o.jsx("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:o.jsxs("g",{id:"Frame 48096259",children:[o.jsx("circle",{id:"Ellipse 52",cx:"9",cy:"9",r:"9",fill:"#DADEE5"}),o.jsx("path",{id:"Vector",d:"M5 5L13 13",stroke:"white",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),o.jsx("path",{id:"Vector_2",d:"M13 5L5 13",stroke:"white",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})})})})]})},Km=({color:e=v.gray800})=>o.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:o.jsx("path",{d:"M7 7L12 12L7 17M13 7L18 12L13 17",stroke:e,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),Xm=({color:e=v.gray800})=>o.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:o.jsx("path",{d:"M11 7L6 12L11 17M17 7L12 12L17 17",stroke:e,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),ey=({color:e=v.gray800})=>o.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:o.jsx("path",{d:"M9 6L15 12L9 18",stroke:e,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),ty=({color:e=v.gray800})=>o.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:o.jsx("path",{d:"M15 6L9 12L15 18",stroke:e,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),ry="_container_16f79_1",ny="_button_16f79_7",sy="_circle_16f79_23",dt={container:ry,button:ny,circle:sy},ay=e=>{const{totalPageCount:t,currentPage:r,displayRangeCount:n=5,onChange:s,isMoveToEndButton:a}=e,i=r===1,l=r===t,u=Math.ceil(r/n),f=t<u*n?t:u*n,d=(u-1)*n+1,_=Array.from({length:f-d+1},(x,p)=>d+p),h=_==null?void 0:_.map(x=>{const p=r===x;return o.jsx("button",{type:"button",className:dt.button,onClick:()=>s(x),children:p?o.jsx("div",{className:dt.circle,children:x}):x},x)});return o.jsxs("div",{className:dt.container,children:[a&&o.jsx("button",{"aria-label":"first",type:"button",className:dt.button,onClick:()=>s(1),disabled:i,children:o.jsx(Xm,{color:i?v.gray300:v.gray800})}),o.jsx("button",{"aria-label":"previous",type:"button",className:dt.button,onClick:()=>s(r-1),disabled:i,children:o.jsx(ty,{color:i?v.gray300:v.gray800})}),h,o.jsx("button",{"aria-label":"next",type:"button",className:dt.button,onClick:()=>s(r+1),disabled:l,children:o.jsx(ey,{color:l?v.gray300:v.gray800})}),a&&o.jsx("button",{"aria-label":"end",type:"button",className:dt.button,onClick:()=>s(t),disabled:l,children:o.jsx(Km,{color:l?v.gray300:v.gray800})})]})},iy=({options:e,value:t,onClick:r,disabled:n})=>{const s=e.map(a=>{const i=a.value===t.value,l=()=>r(a);return o.jsx(Yr,{checked:i,label:a.label,name:a.value,onClick:l,disabled:n},a.value)});return o.jsx("div",{style:{display:"flex",gap:"20px"},children:s})},Wa=({selectId:e,segments:t,containerWidth:r})=>{const[n,s]=$.useState({}),a=$.useRef([]);return $.useEffect(()=>{var i;if(a.current[e]){const l=a.current[e],u=(i=a.current[0])==null?void 0:i.parentElement;if(l&&u){const f=l.offsetLeft,d=l.offsetWidth;s({left:`${f}px`,width:`${d}px`})}}},[e,t,r]),{indicatorStyle:n,ref:a}},oy="_container_cdfnt_1",ly="_itemButton_cdfnt_12",cy="_disabled_cdfnt_28",uy="_active_cdfnt_32",dy="_activeIndicator_cdfnt_44",fy="_large_cdfnt_58",hy="_segmentItem_cdfnt_61",_y="_medium_cdfnt_65",my="_small_cdfnt_72",Mt={container:oy,itemButton:ly,disabled:cy,active:uy,activeIndicator:dy,large:fy,segmentItem:hy,medium:_y,small:my},yy=({segments:e,selectId:t,level:r="small",onClick:n})=>{const s=$.useRef(null),[a]=Lr(s),{indicatorStyle:i,ref:l}=Wa({selectId:t,segments:e,containerWidth:a});return o.jsxs("div",{ref:s,className:`${Mt.container} ${Mt[r]}`,children:[e.map((u,f)=>o.jsx("button",{ref:d=>l.current[f]=d,className:`${Mt.itemButton} ${t===f?Mt.active:""} ${u.isDisabled?Mt.disabled:""}`,onClick:()=>!u.isDisabled&&n(f),disabled:u.isDisabled,type:"button",children:u.label},f)),o.jsx("div",{className:Mt.activeIndicator,style:i})]})},gy="_container_1jucs_1",py="_wrapper_1jucs_5",xy="_tabScroller_1jucs_15",vy="_itemButton_1jucs_28",wy="_active_1jucs_53",by="_disabled_1jucs_56",ky="_newBadge_1jucs_63",Sy="_activeIndicator_1jucs_76",My="_large_1jucs_84",jy="_medium_1jucs_89",Yy="_small_1jucs_94",De={container:gy,wrapper:py,tabScroller:xy,itemButton:vy,active:wy,disabled:by,newBadge:ky,activeIndicator:Sy,large:My,medium:jy,small:Yy},Oy=({tabs:e,selectId:t,level:r="small",onClick:n})=>{const{indicatorStyle:s,ref:a}=Wa({selectId:Number(t),segments:e});return o.jsx("div",{className:De.container,children:o.jsx("div",{className:De.wrapper,children:o.jsxs("div",{className:De.tabScroller,children:[e.map((i,l)=>{const u=t===l;return o.jsxs("button",{ref:f=>a.current[l]=f,className:`${De.itemButton} ${De[r]} ${u?De.active:""} ${i.isDisabled?De.disabled:""}`,onClick:()=>!i.isDisabled&&(n==null?void 0:n(l)),disabled:i.isDisabled,type:"button",children:[i.isNew&&o.jsx("div",{className:De.newBadge,children:"N"}),o.jsx("span",{children:i.label})]},l)}),o.jsx("div",{className:De.activeIndicator,style:s})]})})})},$y="_textarea_1mxm9_1",Ry="_textareaError_1mxm9_24",Ny="_textareaShutdown_1mxm9_28",Ty="_container_1mxm9_33",Cy="_wrapper_1mxm9_41",Ey="_errorLabel_1mxm9_46",Py="_textCounter_1mxm9_50",Dy="_requiredStar_1mxm9_58",Fy="_label_1mxm9_62",Fe={textarea:$y,textareaError:Ry,textareaShutdown:Ny,container:Ty,wrapper:Cy,errorLabel:Ey,textCounter:Py,requiredStar:Dy,label:Fy},Wy=({errorText:e,width:t,label:r,isShutdown:n,value:s,disabled:a,isRequired:i,...l})=>{const u=typeof s=="string"&&l.maxLength;return o.jsxs("div",{className:Fe.container,style:{width:t??"100%"},children:[r&&o.jsxs("div",{className:Fe.label,children:[i&&o.jsx("div",{className:Fe.requiredStar,children:"*"}),r]}),o.jsxs("div",{className:Fe.wrapper,children:[o.jsx("textarea",{className:`${Fe.textarea} ${e&&Fe.textareaError} ${n&&Fe.textareaShutdown}`,value:n?"Disable":s,disabled:a||n,...l}),u&&o.jsxs("div",{className:Fe.textCounter,children:[s.length,"/",l.maxLength.toString()]})]}),e&&o.jsx("div",{className:Fe.errorLabel,children:e})]})};exports.Button=Es;exports.ButtonFilter=ql;exports.Checkbox=zt;exports.Chip=sc;exports.CustomButtonFilter=zl;exports.DatePicker=H_;exports.DatePickerCalendar=Da;exports.DateRangePicker=gm;exports.DateRangePickerCalendar=Fa;exports.Divider=wm;exports.Dropdown=Im;exports.IconButton=mt;exports.IconWithButton=Um;exports.Input=qn;exports.Pagination=ay;exports.RadioButton=Yr;exports.RadioButtons=iy;exports.SearchInput=Qm;exports.Segment=yy;exports.Tab=Oy;exports.Textarea=Wy;exports.themeColors=v;
|
|
76
|
+
`,style:{minHeight:l+"px"},onClick:u,children:[e==null?void 0:e.element,a]})},Lm=({options:e,values:t,onChange:r,type:n,input:s,level:a,isAllChecked:i,allCheckText:l,onHideTooltip:u,containerRef:f})=>{const d=Br[a],{showCount:_,showFirstIndex:h}=Tm({rowHeight:d,overScanCount:10,ref:f}),x=e==null?void 0:e.map((p,k)=>{if(!(k>=h&&k<=_+h))return o.jsx("div",{style:{minHeight:d+"px"}},k);const j=t.some(q=>q.value===p.value),{startValue:O,validValue:T,endValue:H}=s_(p.label,s),C=o.jsxs("div",{children:[O,o.jsx("span",{style:{color:v.blue400},children:T}),H]});switch(n){case"checkbox":return o.jsx(Dm,{option:p,values:t,onChange:r,level:a,isSelected:j,children:C},k);case"radio":return o.jsx(Fm,{option:p,onChange:r,level:a,isSelected:j,children:C},k);case"select":return o.jsx(Wm,{option:p,onChange:r,level:a,isSelected:j,onHideTooltip:u,children:C},k)}});if(i&&n==="checkbox"){const p=a==="large",k=(e==null?void 0:e.length)===(t==null?void 0:t.length),M=()=>k?r==null?void 0:r([]):r==null?void 0:r(e);x.unshift(o.jsx("button",{style:{minHeight:d+"px"},className:`${Ve.itemButton} ${p&&Ve.itemButtonLarge}`,onClick:M,children:o.jsx(zt,{checked:k,children:l})}))}return o.jsx(o.Fragment,{children:x})},Im=({initialPlaceholder:e,level:t="medium",type:r="checkbox",options:n=[],values:s=[],onChange:a,isAllChecked:i,allCheckText:l="전체선택",unit:u,width:f="100%"})=>{var ye;const d=$.useRef(null),_=$.useRef(null),[h,x]=$.useState(""),[p,k]=Mr(d),M=jr({isOpen:p,containerRef:d,tooltipRef:_}),{height:j}=qe[t],O=t==="large",T=h.length>0?n.filter(ie=>n_(h,ie.label)):n,H=()=>k(ie=>!ie),C=ie=>{x(ie.target.value)},q=ie=>{if(ie.preventDefault(),(T==null?void 0:T.length)>0){const I=r==="checkbox",S=s.find(R=>R.value===T[0].value);a(S?s.filter(R=>R.value!==T[0].value):I?[...s,T[0]]:[T[0]]),r==="select"&&k(!1)}},ue=s.length>0,re=ue?s.length>1?`${s==null?void 0:s[0].label} 외 ${s.length-1}개`:s==null?void 0:s[0].label:e,me=(ye=n==null?void 0:n.find(ie=>{var I;return((I=s==null?void 0:s[0])==null?void 0:I.value)===ie.value}))==null?void 0:ye.element;return $.useEffect(()=>{p||x("")},[p]),o.jsxs("div",{className:ut.container,style:{width:f},ref:d,children:[o.jsxs(Sm,{onClick:H,isOpen:p,level:t,width:"100%",children:[me,o.jsx("form",{onSubmit:q,className:ut.input,children:o.jsx("input",{className:`${ut.input} ${O&&ut.inputLarge} ${ue&&ut.inputActivePlaceholder}`,placeholder:re,value:h,onChange:C})}),u&&o.jsx("span",{className:ut.unit,children:u}),p?o.jsx(vn,{}):o.jsx(xn,{})]}),p&&o.jsx("div",{ref:_,className:ut.tooltip,style:{top:j+8+"px",minWidth:"300px",...M==="right"?{right:0}:{left:0}},children:o.jsx(Lm,{options:T,values:s,onChange:a,type:r,input:h,level:t,isAllChecked:i,allCheckText:l,onHideTooltip:()=>k(!1),containerRef:_})})]})},Am="_leftWrapper_glkyo_1",Bm="_rightWrapper_glkyo_8",Hm="_disabled_glkyo_15",yr={leftWrapper:Am,rightWrapper:Bm,disabled:Hm},Um=({children:e,iconPosition:t="right",icon:r,level:n="small",...s})=>{const a=t==="right",i=Vm[n];return o.jsxs(Es,{...s,pl:a?i.default:i.iconSide,pr:a?i.iconSide:i.default,level:n,children:[!a&&o.jsx("div",{className:`${yr.leftWrapper} ${s.disabled&&yr.disabled}`,children:r}),e,a&&o.jsx("div",{className:`${yr.rightWrapper} ${s.disabled&&yr.disabled}`,children:r})]})},Vm={small:{default:16,iconSide:8},medium:{default:20,iconSide:12},large:{default:20,iconSide:16}},Gm="_input_2r9bm_1",qm="_container_2r9bm_30",zm="_iconWrapper_2r9bm_35",Zm="_iconButton_2r9bm_46",Jm="_cancelWrapper_2r9bm_55",Ut={input:Gm,container:qm,iconWrapper:zm,iconButton:Zm,cancelWrapper:Jm},Qm=({width:e,level:t="large",value:r,disabled:n,onCancel:s,...a})=>{const[i,l]=$.useState(!1),u=$.useRef(null),f=$.useRef(null),[d]=Lr(u),_=t==="small";return o.jsxs("div",{className:Ut.container,style:{width:e??"100%",height:(_?32:48)+"px"},children:[o.jsx("div",{className:Ut.iconWrapper,ref:u,children:o.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:o.jsx("g",{id:"ic/search",children:o.jsx("path",{id:"Vector",d:"M21 21L15 15M3 10C3 10.9193 3.18106 11.8295 3.53284 12.6788C3.88463 13.5281 4.40024 14.2997 5.05025 14.9497C5.70026 15.5998 6.47194 16.1154 7.32122 16.4672C8.1705 16.8189 9.08075 17 10 17C10.9193 17 11.8295 16.8189 12.6788 16.4672C13.5281 16.1154 14.2997 15.5998 14.9497 14.9497C15.5998 14.2997 16.1154 13.5281 16.4672 12.6788C16.8189 11.8295 17 10.9193 17 10C17 9.08075 16.8189 8.1705 16.4672 7.32122C16.1154 6.47194 15.5998 5.70026 14.9497 5.05025C14.2997 4.40024 13.5281 3.88463 12.6788 3.53284C11.8295 3.18106 10.9193 3 10 3C9.08075 3 8.1705 3.18106 7.32122 3.53284C6.47194 3.88463 5.70026 4.40024 5.05025 5.05025C4.40024 5.70026 3.88463 6.47194 3.53284 7.32122C3.18106 8.1705 3 9.08075 3 10Z",stroke:"#A3A8B4",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})}),o.jsx("input",{className:Ut.input,style:{fontSize:_?"16px":"18px",paddingLeft:d&&d+"px",paddingRight:12+(i&&s&&32)+"px"},ref:f,onFocus:()=>l(!0),onBlur:()=>l(!1),type:"search",value:r,disabled:n,...a}),i&&s&&o.jsx("div",{className:Ut.iconButton,onClick:()=>s(a==null?void 0:a.name),onMouseDown:h=>h.preventDefault(),children:o.jsx("div",{className:Ut.cancelWrapper,children:o.jsx("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:o.jsxs("g",{id:"Frame 48096259",children:[o.jsx("circle",{id:"Ellipse 52",cx:"9",cy:"9",r:"9",fill:"#DADEE5"}),o.jsx("path",{id:"Vector",d:"M5 5L13 13",stroke:"white",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),o.jsx("path",{id:"Vector_2",d:"M13 5L5 13",stroke:"white",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})})})})]})},Km=({color:e=v.gray800})=>o.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:o.jsx("path",{d:"M7 7L12 12L7 17M13 7L18 12L13 17",stroke:e,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),Xm=({color:e=v.gray800})=>o.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:o.jsx("path",{d:"M11 7L6 12L11 17M17 7L12 12L17 17",stroke:e,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),ey=({color:e=v.gray800})=>o.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:o.jsx("path",{d:"M9 6L15 12L9 18",stroke:e,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),ty=({color:e=v.gray800})=>o.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:o.jsx("path",{d:"M15 6L9 12L15 18",stroke:e,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),ry="_container_16f79_1",ny="_button_16f79_7",sy="_circle_16f79_23",dt={container:ry,button:ny,circle:sy},ay=e=>{const{totalPageCount:t,currentPage:r,displayRangeCount:n=5,onChange:s,isMoveToEndButton:a}=e,i=r===1,l=r===t,u=Math.ceil(r/n),f=t<u*n?t:u*n,d=(u-1)*n+1,_=Array.from({length:f-d+1},(x,p)=>d+p),h=_==null?void 0:_.map(x=>{const p=r===x;return o.jsx("button",{type:"button",className:dt.button,onClick:()=>s(x),children:p?o.jsx("div",{className:dt.circle,children:x}):x},x)});return o.jsxs("div",{className:dt.container,children:[a&&o.jsx("button",{"aria-label":"first",type:"button",className:dt.button,onClick:()=>s(1),disabled:i,children:o.jsx(Xm,{color:i?v.gray300:v.gray800})}),o.jsx("button",{"aria-label":"previous",type:"button",className:dt.button,onClick:()=>s(r-1),disabled:i,children:o.jsx(ty,{color:i?v.gray300:v.gray800})}),h,o.jsx("button",{"aria-label":"next",type:"button",className:dt.button,onClick:()=>s(r+1),disabled:l,children:o.jsx(ey,{color:l?v.gray300:v.gray800})}),a&&o.jsx("button",{"aria-label":"end",type:"button",className:dt.button,onClick:()=>s(t),disabled:l,children:o.jsx(Km,{color:l?v.gray300:v.gray800})})]})},iy=({options:e,value:t,onClick:r,disabled:n})=>{const s=e.map(a=>{const i=a.value===t.value,l=()=>r(a);return o.jsx(Yr,{checked:i,label:a.label,name:a.value,onClick:l,disabled:n},a.value)});return o.jsx("div",{style:{display:"flex",gap:"20px"},children:s})},Wa=({selectId:e,segments:t,containerWidth:r})=>{const[n,s]=$.useState({}),a=$.useRef([]);return $.useEffect(()=>{var i;if(a.current[e]){const l=a.current[e],u=(i=a.current[0])==null?void 0:i.parentElement;if(l&&u){const f=l.offsetLeft,d=l.offsetWidth;s({left:`${f}px`,width:`${d}px`})}}},[e,t,r]),{indicatorStyle:n,ref:a}},oy="_container_cdfnt_1",ly="_itemButton_cdfnt_12",cy="_disabled_cdfnt_28",uy="_active_cdfnt_32",dy="_activeIndicator_cdfnt_44",fy="_large_cdfnt_58",hy="_segmentItem_cdfnt_61",_y="_medium_cdfnt_65",my="_small_cdfnt_72",Mt={container:oy,itemButton:ly,disabled:cy,active:uy,activeIndicator:dy,large:fy,segmentItem:hy,medium:_y,small:my},yy=({segments:e,selectId:t,level:r="small",onClick:n})=>{const s=$.useRef(null),[a]=Lr(s),{indicatorStyle:i,ref:l}=Wa({selectId:t,segments:e,containerWidth:a});return o.jsxs("div",{ref:s,className:`${Mt.container} ${Mt[r]}`,children:[e.map((u,f)=>o.jsx("button",{ref:d=>l.current[f]=d,className:`${Mt.itemButton} ${t===f?Mt.active:""} ${u.isDisabled?Mt.disabled:""}`,onClick:()=>!u.isDisabled&&n(f),disabled:u.isDisabled,type:"button",children:u.label},f)),o.jsx("div",{className:Mt.activeIndicator,style:i})]})},gy="_container_1jucs_1",py="_wrapper_1jucs_5",xy="_tabScroller_1jucs_15",vy="_itemButton_1jucs_28",wy="_active_1jucs_53",by="_disabled_1jucs_56",ky="_newBadge_1jucs_63",Sy="_activeIndicator_1jucs_76",My="_large_1jucs_84",jy="_medium_1jucs_89",Yy="_small_1jucs_94",De={container:gy,wrapper:py,tabScroller:xy,itemButton:vy,active:wy,disabled:by,newBadge:ky,activeIndicator:Sy,large:My,medium:jy,small:Yy},Oy=({tabs:e,selectId:t,level:r="small",onClick:n})=>{const{indicatorStyle:s,ref:a}=Wa({selectId:Number(t),segments:e});return o.jsx("div",{className:De.container,children:o.jsx("div",{className:De.wrapper,children:o.jsxs("div",{className:De.tabScroller,children:[e.map((i,l)=>{const u=t===l;return o.jsxs("button",{ref:f=>a.current[l]=f,className:`${De.itemButton} ${De[r]} ${u?De.active:""} ${i.isDisabled?De.disabled:""}`,onClick:()=>!i.isDisabled&&(n==null?void 0:n(l)),disabled:i.isDisabled,type:"button",children:[i.isNew&&o.jsx("div",{className:De.newBadge,children:"N"}),o.jsx("span",{children:i.label})]},l)}),o.jsx("div",{className:De.activeIndicator,style:s})]})})})},$y="_textarea_1mxm9_1",Ry="_textareaError_1mxm9_24",Ny="_textareaShutdown_1mxm9_28",Ty="_container_1mxm9_33",Cy="_wrapper_1mxm9_41",Ey="_errorLabel_1mxm9_46",Py="_textCounter_1mxm9_50",Dy="_requiredStar_1mxm9_58",Fy="_label_1mxm9_62",Fe={textarea:$y,textareaError:Ry,textareaShutdown:Ny,container:Ty,wrapper:Cy,errorLabel:Ey,textCounter:Py,requiredStar:Dy,label:Fy},Wy=({errorText:e,width:t,label:r,isShutdown:n,value:s,disabled:a,isRequired:i,...l})=>{const u=typeof s=="string"&&l.maxLength;return o.jsxs("div",{className:Fe.container,style:{width:t??"100%"},children:[r&&o.jsxs("div",{className:Fe.label,children:[i&&o.jsx("div",{className:Fe.requiredStar,children:"*"}),r]}),o.jsxs("div",{className:Fe.wrapper,children:[o.jsx("textarea",{className:`${Fe.textarea} ${e&&Fe.textareaError} ${n&&Fe.textareaShutdown}`,value:n?"Disable":s,disabled:a||n,...l}),u&&o.jsxs("div",{className:Fe.textCounter,children:[s.length,"/",l.maxLength.toString()]})]}),e&&o.jsx("div",{className:Fe.errorLabel,children:e})]})};exports.Button=Es;exports.ButtonFilter=ql;exports.Checkbox=zt;exports.Chip=sc;exports.CustomButtonFilter=zl;exports.DatePicker=H_;exports.DatePickerCalendar=Da;exports.DateRangePicker=gm;exports.DateRangePickerCalendar=Fa;exports.Divider=wm;exports.Dropdown=Im;exports.IconButton=mt;exports.IconWithButton=Um;exports.Input=qn;exports.Pagination=ay;exports.RadioButton=Yr;exports.RadioButtons=iy;exports.SearchInput=Qm;exports.Segment=yy;exports.Tab=Oy;exports.Textarea=Wy;exports.themeColors=v;
|
package/dist/index.es.js
CHANGED
|
@@ -6209,7 +6209,8 @@ const Xh = /^\d+$/, e_ = /^-?\d+(\.\d+)?$/, Rs = (e) => Xh.test(e), t_ = (e) =>
|
|
|
6209
6209
|
level: a,
|
|
6210
6210
|
isSelected: j,
|
|
6211
6211
|
children: T
|
|
6212
|
-
}
|
|
6212
|
+
},
|
|
6213
|
+
k
|
|
6213
6214
|
);
|
|
6214
6215
|
case "radio":
|
|
6215
6216
|
return /* @__PURE__ */ o.jsx(
|
|
@@ -6220,7 +6221,8 @@ const Xh = /^\d+$/, e_ = /^-?\d+(\.\d+)?$/, Rs = (e) => Xh.test(e), t_ = (e) =>
|
|
|
6220
6221
|
level: a,
|
|
6221
6222
|
isSelected: j,
|
|
6222
6223
|
children: T
|
|
6223
|
-
}
|
|
6224
|
+
},
|
|
6225
|
+
k
|
|
6224
6226
|
);
|
|
6225
6227
|
case "select":
|
|
6226
6228
|
return /* @__PURE__ */ o.jsx(
|
|
@@ -6232,7 +6234,8 @@ const Xh = /^\d+$/, e_ = /^-?\d+(\.\d+)?$/, Rs = (e) => Xh.test(e), t_ = (e) =>
|
|
|
6232
6234
|
isSelected: j,
|
|
6233
6235
|
onHideTooltip: u,
|
|
6234
6236
|
children: T
|
|
6235
|
-
}
|
|
6237
|
+
},
|
|
6238
|
+
k
|
|
6236
6239
|
);
|
|
6237
6240
|
}
|
|
6238
6241
|
});
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "enerdot-front-system",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.0.28
|
|
4
|
+
"version": "0.0.28",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"enerdot-front-system",
|
|
@@ -27,8 +27,8 @@
|
|
|
27
27
|
"lint": "eslint .",
|
|
28
28
|
"preview": "vite preview",
|
|
29
29
|
"prepare": "rm -rf dist && tsc && vite build",
|
|
30
|
-
"add:package": "yarn add ./enerdot-front-system-v0.0.28
|
|
31
|
-
"reset:package": "yarn remove enerdot-front-system && yarn cache clean && rm -rf ./enerdot-front-system-v0.0.28
|
|
30
|
+
"add:package": "yarn add ./enerdot-front-system-v0.0.28.tgz",
|
|
31
|
+
"reset:package": "yarn remove enerdot-front-system && yarn cache clean && rm -rf ./enerdot-front-system-v0.0.28.tgz"
|
|
32
32
|
},
|
|
33
33
|
"exports": {
|
|
34
34
|
".": {
|