najwer23morsels 1.10.5 → 1.10.7
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/lib/Calendar/Calendar.d.ts +1 -0
- package/lib/Calendar/index.js +1 -1
- package/lib/Calendar-D7QM1Jwl.js +1 -0
- package/lib/FormForgotPassOtp/index.js +1 -1
- package/lib/NavigationDashboard/index.js +1 -1
- package/lib/NavigationTabs/index.js +1 -1
- package/lib/{NavigationTabs-CWkGtNHu.js → NavigationTabs-C-zZU9Qp.js} +1 -1
- package/lib/Select/Select.d.ts +3 -6
- package/lib/Select/Select.types.d.ts +4 -0
- package/lib/Select/index.d.ts +2 -1
- package/lib/Select/index.js +1 -1
- package/lib/Select-DSRwzuLg.js +1 -0
- package/lib/Table/Table.d.ts +2 -9
- package/lib/Table/Table.types.d.ts +29 -0
- package/lib/Table/index.d.ts +2 -1
- package/lib/Table/index.js +1 -1
- package/package.json +1 -1
|
@@ -3,6 +3,7 @@ interface CalendarProps extends React.HTMLAttributes<HTMLElement> {
|
|
|
3
3
|
style?: React.CSSProperties;
|
|
4
4
|
name: string;
|
|
5
5
|
label: string;
|
|
6
|
+
disabled?: boolean;
|
|
6
7
|
placeholder?: string;
|
|
7
8
|
validatorOptions?: ValidatorOptions;
|
|
8
9
|
initialValue?: '' | `${number}-${number}-${number}`;
|
package/lib/Calendar/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
export{C as Calendar}from"../Calendar-D7QM1Jwl.js";import"react/jsx-runtime";import"react";import"../Button-QC014EKI.js";import"../Loader-ZYEBOkbx.js";import"../LoaderDots-BoEg_zlZ.js";import"../TextBox-__k4jPYK.js";import"../style-inject.es-CrVRO2OA.js";import"../IconLocate-CQda7FAB.js";import"../Input-D8c36JF7.js";import"../index-uD0K440h.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsxs as e,jsx as a,Fragment as o}from"react/jsx-runtime";import{useRef as l,useState as d,useMemo as r}from"react";import{B as n}from"./Button-QC014EKI.js";import{I as t,a as i}from"./IconLocate-CQda7FAB.js";import{I as s}from"./Input-D8c36JF7.js";import{T as c}from"./TextBox-__k4jPYK.js";import{s as p}from"./style-inject.es-CrVRO2OA.js";import{g as h,a as u,i as m,b as y,c as _,d as v,e as C,f as w}from"./index-uD0K440h.js";var x={n23mCalendar:"Calendar-module_n23mCalendar__6E2X7",icon:"Calendar-module_icon__ye4Dl",dropdownWrapper:"Calendar-module_dropdownWrapper__KryyT",open:"Calendar-module_open__Y-JWN",dropdown:"Calendar-module_dropdown__RPTTl",controls:"Calendar-module_controls__XGi-Q",controlsDate:"Calendar-module_controlsDate__L1Wp6",weekdays:"Calendar-module_weekdays__t9VRM",weekdaysChild:"Calendar-module_weekdaysChild__owTwc",days:"Calendar-module_days__D03p-",daysChild:"Calendar-module_daysChild__Jbjrd",daysActive:"Calendar-module_daysActive__Y7Fsv",daysClickable:"Calendar-module_daysClickable__THEm1",months:"Calendar-module_months__NOLDP",years:"Calendar-module_years__li-uY",monthsChild:"Calendar-module_monthsChild__4gx-0",yearsChild:"Calendar-module_yearsChild__mRWoZ"};p("@layer n23mCalendar{.Calendar-module_n23mCalendar__6E2X7{--iff:-apple-system,BlinkMacSystemFont,avenir next,avenir,segoe ui,helvetica neue,helvetica,Cantarell,Ubuntu,roboto,noto,arial,sans-serif;position:relative;& input{cursor:pointer;padding-right:40px}.Calendar-module_icon__ye4Dl{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 25 25'%3E%3Cpath fill='%23231f20' d='M22.5 3H21V2a1 1 0 0 0-1-1h-1a1 1 0 0 0-1 1v1h-4V2a1 1 0 0 0-1-1h-1a1 1 0 0 0-1 1v1H7V2a1 1 0 0 0-1-1H5a1 1 0 0 0-1 1v1H2.5A1.5 1.5 0 0 0 1 4.5v18A1.5 1.5 0 0 0 2.5 24h20a1.5 1.5 0 0 0 1.5-1.5v-18A1.5 1.5 0 0 0 22.5 3ZM19 2h1v3h-1Zm-7 0h1v3h-1ZM5 2h1v3H5ZM2.5 4H4v1a1 1 0 0 0 1 1h1a1 1 0 0 0 1-1V4h4v1a1 1 0 0 0 1 1h1a1 1 0 0 0 1-1V4h4v1a1 1 0 0 0 1 1h1a1 1 0 0 0 1-1V4h1.5a.5.5 0 0 1 .5.5V8H2V4.5a.5.5 0 0 1 .5-.5Zm20 19h-20a.5.5 0 0 1-.5-.5V9h21v13.5a.5.5 0 0 1-.5.5Z'/%3E%3C/svg%3E\");background-position:100%;background-position:calc(100% - 10px) 50%;background-repeat:no-repeat;background-size:18px;cursor:pointer;display:inline-block;height:40px;position:absolute;right:2px;top:21px;width:40px}.Calendar-module_dropdownWrapper__KryyT{background-color:transparent;display:none;margin-top:65px;padding-bottom:40px;position:absolute;top:0;width:318px;z-index:3;&.Calendar-module_open__Y-JWN{display:block}.Calendar-module_dropdown__RPTTl{corner-shape:squircle;background:#fff;border:1px solid var(--input-cb,#000);border-radius:12px;box-shadow:0 4px 8px 0 rgba(0,0,0,.24),0 6px 20px 0 rgba(0,0,0,.19);box-sizing:border-box;overflow-y:auto;padding:20px;& .Calendar-module_controls__XGi-Q{align-items:center;display:flex;height:40px;justify-content:space-between;padding:0 7px}& .Calendar-module_controlsDate__L1Wp6{display:flex;font-family:var(--n23mFontFamily,var(--iff));font-size:20px;justify-content:center}& .Calendar-module_weekdays__t9VRM{display:flex;justify-content:center;width:100%}& .Calendar-module_weekdaysChild__owTwc{align-items:center;display:flex;font-family:var(--n23mFontFamily,var(--iff));font-size:12px;height:30px;justify-content:center;width:14.28571%}& .Calendar-module_days__D03p-{display:flex;flex-wrap:wrap;justify-content:flex-start;width:100%}& .Calendar-module_daysChild__Jbjrd{font-size:16px}& .Calendar-module_daysChild__Jbjrd:nth-child(7n){color:red;font-weight:700}& .Calendar-module_daysActive__Y7Fsv{corner-shape:squircle;background-color:#f2f2f2;border-radius:12px;cursor:pointer}& .Calendar-module_daysClickable__THEm1{cursor:pointer}& .Calendar-module_months__NOLDP,& .Calendar-module_years__li-uY{display:flex;flex-wrap:wrap;gap:12px;justify-content:center}& .Calendar-module_monthsChild__4gx-0,& .Calendar-module_yearsChild__mRWoZ{display:flex;justify-content:center}}}}}");const b=({children:p,name:b,placeholder:g,label:f="Calendar",initialValue:k,disabled:D,onBlur:F,validatorOptions:S,className:N,style:j,...M})=>{const T=l(null),[E,V]=d({value:""==k?"":h(k??new Date),open:!1,dropDwonState:"days"}),z=e=>{V(a=>({...a,value:h(e),open:!0}))},W=e=>{z(C(m(E.value)?E.value:h(new Date),e))},A=e=>{z(v(m(E.value)?E.value:h(new Date),e))},B=r(()=>Array.from({length:7},(e,a)=>new Date(2021,0,(a+4)%7).toLocaleString("en-US",{weekday:"short"})),[]),H=r(()=>Array.from({length:12},(e,a)=>new Date(2021,a+1,0).toLocaleString("en-US",{month:"short"})),[]),P=u(m(E.value)?E.value:h(new Date)),Z=y(m(E.value)?E.value:h(new Date)),L=m(E.value)?new Date(E.value):new Date,R=L.getFullYear(),Y=L.getMonth(),J=L.getDate();return e("div",{className:[x.n23mCalendar,"n23mCalendar",N].filter(Boolean).join(" "),...M,style:{...j},children:[a("div",{className:x.icon,onMouseDown:e=>{D||(e.preventDefault(),T.current?.focus(),V(e=>({...e,value:"",open:!e.open,dropDwonState:"days"})))}}),a(s,{inputRef:T,label:f,type:"text",kind:"input",name:b,autoComplete:"off",placeholder:g,onChange:e=>{const a=e.currentTarget.value;V(e=>({...e,value:a}))},onBlur:e=>{V(e=>({...e,open:!1})),F?.(e)},onClick:()=>{D||V(e=>({...e,value:"",open:!0,dropDwonState:"days"}))},disabled:D,value:E.value,validatorOptions:[...S??[],{type:"date"}],className:x.arrowUp,"aria-expanded":E.open,role:"combobox"}),a("div",{className:[x.dropdownWrapper,E.open?x.open:""].join(" "),children:e("div",{className:[x.dropdown].join(" "),onMouseDown:e=>e.preventDefault(),children:["years"===E.dropDwonState&&e(o,{children:[e("div",{className:x.controls,style:{marginBottom:"10px"},children:[a("div",{style:{width:"30px"},children:a(n,{type:"button",padding:"3px 0 0 0",height:"30px",width:"30px",title:"Prev Month",backgroundColor:"#F2F0EF",borderColor:"black",onClick:()=>A(R-9),children:a(t,{color:"black",height:22,width:22})})}),a("div",{style:{width:"60%"},className:x.controlsDate,children:a("div",{style:{cursor:"pointer"},onClick:()=>V(e=>({...e,dropDwonState:"days"})),children:R})}),a("div",{style:{width:"30px"},children:a(n,{type:"button",padding:"3px 0 0 0",height:"30px",width:"30px",title:"Prev Month",backgroundColor:"#F2F0EF",borderColor:"black",onClick:()=>A(R+9),children:a(i,{color:"black",height:22,width:22})})})]}),a("div",{className:x.years,children:Z.map(e=>a("div",{className:x.yearsChild,children:a(n,{type:"button",height:"40px",width:"80px",color:"black",backgroundColor:R==e?"white":"#F2F0EF",borderColor:"black",title:"year",onClick:()=>{A(e),V(e=>({...e,dropDwonState:"days"}))},children:a(c,{mobileSize:14,desktopSize:14,children:e})},e+E.value)},e+E.value))})]}),"months"===E.dropDwonState&&a("div",{className:x.months,children:H.map((e,o)=>a("div",{className:x.monthsChild,children:a(n,{type:"button",height:"40px",width:"80px",backgroundColor:Y==o?"white":"#F2F0EF",borderColor:"black",title:"month",onClick:()=>{W(o-Y),V(e=>({...e,dropDwonState:"days"}))},children:a(c,{mobileSize:14,desktopSize:14,children:e})},e+E.value)},e+E.value))}),"days"===E.dropDwonState&&e(o,{children:[e("div",{className:x.controls,children:[a("div",{style:{width:"30px"},children:a(n,{type:"button",padding:"3px 0 0 0",height:"30px",width:"30px",title:"Prev Month",backgroundColor:"#F2F0EF",borderColor:"black",onClick:()=>W(-1),children:a(t,{color:"black",height:22,width:22})})}),e("div",{style:{width:"60%"},className:x.controlsDate,children:[a("div",{style:{cursor:"pointer"},onClick:()=>V(e=>({...e,dropDwonState:"years"})),children:R}),a("div",{children:"-"}),a("div",{style:{cursor:"pointer"},onClick:()=>V(e=>({...e,dropDwonState:"months"})),children:String(Y+1).padStart(2,"0")}),a("div",{children:"-"}),a("div",{children:String(J).padStart(2,"0")})]}),a("div",{style:{width:"30px"},children:a(n,{type:"button",padding:"3px 0 0 0",height:"30px",width:"30px",title:"Prev Month",backgroundColor:"#F2F0EF",borderColor:"black",onClick:()=>W(1),children:a(i,{color:"black",height:22,width:22})})})]}),a("div",{className:x.weekdays,children:B.map(e=>a("div",{className:x.weekdaysChild,children:e},e))}),a("div",{className:x.days,children:P.map(e=>a("div",{className:[x.weekdaysChild,x.daysChild,"active"==e.cssClass&&x.daysActive,"clickable"==e.cssClass&&x.daysClickable].join(" "),onMouseDown:()=>{var a;e.day>0&&(a=e.day,z(w(m(E.value)?E.value:h(new Date),a))),V(e=>({...e,open:!1})),setTimeout(()=>{T.current?.blur()})},children:e.day<=0||e.day>_(E.value)?" ":e.day},e.day+E.value))})]})]})})]})};b.displayName="Calendar";export{b as C};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as r,jsxs as o}from"react/jsx-runtime";import{useRef as e}from"react";import{B as t}from"../Button-QC014EKI.js";import{F as s}from"../Form-CgTuTB2Q.js";import{G as a}from"../Grid-DmI4tqqG.js";import{I as n}from"../Input-D8c36JF7.js";import{T as i}from"../TextBox-__k4jPYK.js";import{s as p}from"../style-inject.es-CrVRO2OA.js";import"../Loader-ZYEBOkbx.js";import"../LoaderDots-BoEg_zlZ.js";import"../index-uD0K440h.js";var l={n23mFormForgotPassOtp:"FormForgotPassOtp-module_n23mFormForgotPassOtp__898ki",forogotPasswordOtpWrapper:"FormForgotPassOtp-module_forogotPasswordOtpWrapper__3s-uz"};p("@layer n23mFormForgotPassOtp{.FormForgotPassOtp-module_n23mFormForgotPassOtp__898ki{.FormForgotPassOtp-module_forogotPasswordOtpWrapper__3s-uz{corner-shape:squircle;background-color:#fff;border:1px solid grey;border-radius:12px}}}");const
|
|
1
|
+
import{jsx as r,jsxs as o}from"react/jsx-runtime";import{useRef as e}from"react";import{B as t}from"../Button-QC014EKI.js";import{F as s}from"../Form-CgTuTB2Q.js";import{G as a}from"../Grid-DmI4tqqG.js";import{I as n}from"../Input-D8c36JF7.js";import{T as i}from"../TextBox-__k4jPYK.js";import{s as p}from"../style-inject.es-CrVRO2OA.js";import"../Loader-ZYEBOkbx.js";import"../LoaderDots-BoEg_zlZ.js";import"../index-uD0K440h.js";var l={n23mFormForgotPassOtp:"FormForgotPassOtp-module_n23mFormForgotPassOtp__898ki",forogotPasswordOtpWrapper:"FormForgotPassOtp-module_forogotPasswordOtpWrapper__3s-uz"};p("@layer n23mFormForgotPassOtp{.FormForgotPassOtp-module_n23mFormForgotPassOtp__898ki{.FormForgotPassOtp-module_forogotPasswordOtpWrapper__3s-uz{corner-shape:squircle;background-color:#fff;border:1px solid grey;border-radius:12px}}}");const c=({className:p,style:c,onSubmit:m,isPending:d,isError:u,isSuccess:g,errorMsg:f,successMsg:h,onNavigate:F,footerHeight:b="100px",linkMainPage:w,...x})=>{const y=e(null),v=e(null),P=e(!1);return r("div",{className:[l.n23mFormForgotPassOtp,"n23mFormForgotPassOtp",p].filter(Boolean).join(" "),...x,style:{...c},children:r(a,{layout:"flex",flexWrap:"wrap",justifyContent:"center",alignItems:"center",widthMax:"1400px",minHeight:`calc(100dvb - ${b})`,children:o(a,{layout:"container",minHeight:0,widthMin:"min(450px, calc(100% - 40px))",padding:"20px",margin:"20px",className:l.forogotPasswordOtpWrapper,children:[w&&r(i,{desktopSize:20,mobileSize:20,fontWeight:500,tag:"a",href:w.link,color:"grey",colorHover:"var(--n23mTextBoxColorHover, black)",onClick:r=>{var o;r.preventDefault(),o=w.link,F?F(o):window.location.href=o},children:w.text}),r(i,{tag:"h3",desktopSize:14,mobileSize:14,fontWeight:500,margin:"12px 0 18px",children:"Change password"}),o(s,{onSubmit:m,isError:u,isPending:d,isSuccess:g,errorMsg:f,successMsg:h,children:[r(n,{inputRef:y,label:"New password",type:"password",name:"pass",validatorOptions:[{type:"empty"},{type:"equal",options:{ref:v}}],placeholder:"Create a new password",onBlur:()=>{P.current||y.current?.value&&v.current?.value&&(P.current=!0,v.current?.dispatchEvent(new FocusEvent("focusout",{bubbles:!0})),P.current=!1)}}),r(n,{inputRef:v,label:"Confirm new password",type:"password",name:"confirmPass",validatorOptions:[{type:"empty"},{type:"equal",options:{ref:y}}],placeholder:"Re-enter your new password",onBlur:()=>{P.current||y.current?.value&&v.current?.value&&(P.current=!0,y.current?.dispatchEvent(new FocusEvent("focusout",{bubbles:!0})),P.current=!1)}}),r(t,{type:"submit",disabled:d,height:"40px",width:"80px",padding:0,backgroundColor:"orangered",backgroundColorDisabled:"grey",children:r(i,{tag:"span",desktopSize:16,mobileSize:16,fontWeight:400,color:"white",children:"Send"})})]})]})})})};c.displayName="FormForgotPassOtp";export{c as FormForgotPassOtp};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as a,jsx as o,Fragment as i}from"react/jsx-runtime";import{useRef as e,useState as r,useLayoutEffect as n}from"react";import{B as t}from"../Button-QC014EKI.js";import{G as d}from"../Grid-DmI4tqqG.js";import{u as s}from"../useWindowSize-CAQRbyxi.js";import{b as l}from"../IconLocate-CQda7FAB.js";import{N as g}from"../NavigationTabs-
|
|
1
|
+
import{jsxs as a,jsx as o,Fragment as i}from"react/jsx-runtime";import{useRef as e,useState as r,useLayoutEffect as n}from"react";import{B as t}from"../Button-QC014EKI.js";import{G as d}from"../Grid-DmI4tqqG.js";import{u as s}from"../useWindowSize-CAQRbyxi.js";import{b as l}from"../IconLocate-CQda7FAB.js";import{N as g}from"../NavigationTabs-C-zZU9Qp.js";import{T as h}from"../TextBox-__k4jPYK.js";import{s as b,g as m}from"../style-inject.es-CrVRO2OA.js";import"../Loader-ZYEBOkbx.js";import"../LoaderDots-BoEg_zlZ.js";var v={n23mNavigationDashboard:"NavigationDashboard-module_n23mNavigationDashboard__DaVvB",dragging:"NavigationDashboard-module_dragging__gT3R-",row:"NavigationDashboard-module_row__0hfcb",sidebarContainer:"NavigationDashboard-module_sidebarContainer__yDMvb",sticky:"NavigationDashboard-module_sticky__mJ3qk",rowOpen:"NavigationDashboard-module_rowOpen__R8X9U",sidebarContainerOpen:"NavigationDashboard-module_sidebarContainerOpen__a5s0j",sidebarContainerClosed:"NavigationDashboard-module_sidebarContainerClosed__MtEom",asideInner:"NavigationDashboard-module_asideInner__6XAWJ",sidebarOpen:"NavigationDashboard-module_sidebarOpen__p8DGE",sidebarClosed:"NavigationDashboard-module_sidebarClosed__WCDNU",outlet:"NavigationDashboard-module_outlet__ZDTtw",outletContent:"NavigationDashboard-module_outletContent__d1Xs6",toggleAnchor:"NavigationDashboard-module_toggleAnchor__s9fbs",toggleOpen:"NavigationDashboard-module_toggleOpen__m8fxh",toggleClosed:"NavigationDashboard-module_toggleClosed__efOTE",rowNoAside:"NavigationDashboard-module_rowNoAside__v3MDd",outletNoAside:"NavigationDashboard-module_outletNoAside__whzV-"};b("@layer n23mNavigationDashboard{.NavigationDashboard-module_n23mNavigationDashboard__DaVvB{--navigationdashboard-sidebar-w:300px;--navigationdashboard-sidebar-min:200px;--navigationdashboard-sidebar-border:2px;--navigationdashboard-toggle-nudge:0px;--navigationdashboard-sidebar-duration:450ms;--navigationdashboard-sidebar-easing:cubic-bezier(0.22,1,0.36,1);&.NavigationDashboard-module_dragging__gT3R-{cursor:col-resize;user-select:none}&.NavigationDashboard-module_dragging__gT3R- .NavigationDashboard-module_row__0hfcb,&.NavigationDashboard-module_dragging__gT3R- .NavigationDashboard-module_sidebarContainer__yDMvb,&.NavigationDashboard-module_dragging__gT3R- .NavigationDashboard-module_sticky__mJ3qk{transition:none}&[data-collapsing=true] .NavigationDashboard-module_sticky__mJ3qk{opacity:.45}.NavigationDashboard-module_row__0hfcb{display:grid;grid-template-columns:0 minmax(0,1fr);min-width:0;overflow-x:clip;transition:grid-template-columns var(--navigationdashboard-sidebar-duration) var(--navigationdashboard-sidebar-easing);width:100%}.NavigationDashboard-module_rowOpen__R8X9U{grid-template-columns:var(--navigationdashboard-sidebar-w) minmax(0,1fr)}.NavigationDashboard-module_sidebarContainer__yDMvb{border-right:var(--navigationdashboard-sidebar-border) solid transparent;box-sizing:border-box;min-width:0;overflow:clip;position:relative;transition:border-right-color var(--navigationdashboard-sidebar-duration) var(--navigationdashboard-sidebar-easing)}.NavigationDashboard-module_sidebarContainerOpen__a5s0j{border-right-color:#e1dfdf}.NavigationDashboard-module_sidebarContainerClosed__MtEom{border-right-color:transparent}.NavigationDashboard-module_sticky__mJ3qk{box-sizing:border-box;height:calc(100dvh - var(--navigationdashboard-h, 0px));min-width:0;opacity:1;overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain;padding:20px 30px 20px 20px;position:sticky;top:var(--navigationdashboard-h,0);transform:translateZ(0);transition:transform var(--navigationdashboard-sidebar-duration) var(--navigationdashboard-sidebar-easing),opacity .3s ease;width:100%;will-change:transform}.NavigationDashboard-module_asideInner__6XAWJ{box-sizing:border-box;min-width:0;width:calc(max(var(--navigationdashboard-sidebar-min), var(--navigationdashboard-sidebar-w)) - 52px)}.NavigationDashboard-module_asideInner__6XAWJ>*{height:auto;max-height:none;overflow:visible}.NavigationDashboard-module_sidebarOpen__p8DGE{opacity:1}.NavigationDashboard-module_sidebarClosed__WCDNU{opacity:0;pointer-events:none}.NavigationDashboard-module_outlet__ZDTtw{box-sizing:border-box;min-width:0;padding:20px 0 20px 20px;position:relative;width:100%}.NavigationDashboard-module_outletContent__d1Xs6{min-width:0;width:100%}.NavigationDashboard-module_toggleAnchor__s9fbs{height:0;margin-left:-20px;position:sticky;top:calc(var(--navigationdashboard-h, 0px) + (100dvh - var(--navigationdashboard-h, 0px))/2);width:0}.NavigationDashboard-module_toggleOpen__m8fxh{cursor:col-resize;transform:translate(calc(-50% - var(--navigationdashboard-sidebar-border)/2 + var(--navigationdashboard-toggle-nudge)),-50%)}.NavigationDashboard-module_toggleClosed__efOTE{cursor:col-resize;transform:translate(-4px,-50%)}.NavigationDashboard-module_rowNoAside__v3MDd{grid-template-columns:minmax(0,1fr);transition:none}.NavigationDashboard-module_outletNoAside__whzV-{min-width:0}}}");const c=768,u=({children:b,className:u,style:_,menuTopLeftColumn:p=o(i,{children:"menuTopLeftColumn"}),menuTopRightColumn:w=o(i,{children:"menuTopRightColumn"}),menuMobile:N=o(i,{children:"menuMobile"}),outlet:D=o(i,{children:"outlet"}),aside:x=o(i,{children:"aside"}),...f})=>{const C=e(null),y=e(null),{width:O}=s(),j=null!=x&&!1!==x&&O>=c,[k,T]=r(O>=c),[M,z]=r(300),[A,E]=r(!1),L=j&&k,R=e(null),F=e(300),X=e(!1),P=()=>{T(!(O<c)&&(a=>!a))},B=()=>{const a=R.current,o=C.current;if(R.current=null,!a?.moved||!o)return;X.current=!0,o.dataset.collapsing="false";const i=F.current;if(i<220)o.style.setProperty("--navigationdashboard-sidebar-w",`${M}px`),T(!1);else{const a=Math.min(480,Math.max(300,i));o.style.setProperty("--navigationdashboard-sidebar-w",`${a}px`),F.current=a,z(a),T(!0)}E(!1)};return n(()=>{O<c&&T(!1)},[O]),n(()=>{const a=C.current;a&&a.style.setProperty("--navigationdashboard-sidebar-w",`${M}px`)},[M]),n(()=>{const a=C.current,o=y.current;if(!a||!o)return;let i=0;const e=()=>{i=0;const e=Math.max(0,o.getBoundingClientRect().bottom);a.style.setProperty("--navigationdashboard-h",`${e}px`)},r=()=>{i||(i=requestAnimationFrame(e))};e(),window.addEventListener("scroll",r,{passive:!0}),window.addEventListener("resize",r),window.addEventListener("pageshow",r),window.visualViewport?.addEventListener("resize",r);const n=new ResizeObserver(r);return n.observe(o),()=>{window.removeEventListener("scroll",r),window.removeEventListener("resize",r),window.removeEventListener("pageshow",r),window.visualViewport?.removeEventListener("resize",r),n.disconnect(),cancelAnimationFrame(i)}},[]),a("div",{ref:C,className:[v.n23mNavigationDashboard,"n23mNavigationDashboard",A&&v.dragging,u].filter(Boolean).join(" "),...f,style:{...m({"--navigationdashboard-sidebar-w":`${M}px`,"--navigationdashboard-sidebar-min":"300px"}),..._},children:[o("div",{ref:y,children:o(g,{widthInnerContainer:"100%",widthMainContainer:"100%",menuOnlyTop:!0,menuTopLeftColumn:a(d,{layout:"flex",justifyContent:"flex-start",gap:{col:"15px",row:"0px"},alignItems:"center",minHeight:"100%",children:[j&&o(d,{layout:"flex",justifyContent:"flex-start",margin:0,children:o(t,{onClick:P,height:"40px",width:"40px",backgroundColor:"#F2F0EF",backgroundColorDisabled:"#F2F0EF",borderColor:"black",children:o(h,{tag:"div",mobileSize:0,desktopSize:0,margin:"2px 0 0",children:o(l,{open:k,width:20,height:20})})})}),o("div",{children:p})]}),menuTopRightColumn:w,menuMobile:N})}),o(d,{layout:"container",padding:"0 20px 0 0",widthMin:"100%",children:a("div",{className:[v.row,j?L&&v.rowOpen:v.rowNoAside].filter(Boolean).join(" "),children:[j&&o("div",{className:[v.sidebarContainer,L?v.sidebarContainerOpen:v.sidebarContainerClosed].join(" "),children:o("div",{className:[v.sticky,L?v.sidebarOpen:v.sidebarClosed].join(" "),children:o("div",{className:v.asideInner,children:x})})}),a("div",{className:[v.outlet,!j&&v.outletNoAside].filter(Boolean).join(" "),children:[j&&o("div",{className:v.toggleAnchor,children:o(t,{height:"60px",width:"10px",backgroundColor:"#F2F0EF",borderColor:"black",type:"button",onClick:()=>{X.current?X.current=!1:P()},onPointerDown:a=>{if(X.current=!1,0!==a.button||O<c)return;a.currentTarget.setPointerCapture(a.pointerId);const o=L?M:0;R.current={startX:a.clientX,startWidth:o,moved:!1,wasOpen:L},F.current=o},onPointerMove:a=>{const o=R.current,i=C.current;if(!o||!i)return;const e=a.clientX-o.startX;if(!o.moved){if(Math.abs(e)<4)return;o.moved=!0,E(!0)}const r=Math.min(480,Math.max(0,o.startWidth+e));F.current=r,i.style.setProperty("--navigationdashboard-sidebar-w",`${r}px`),i.dataset.collapsing=r<220?"true":"false",!o.wasOpen&&r>0&&T(!0)},onPointerUp:B,onPointerCancel:B,className:[L?v.toggleOpen:v.toggleClosed].join(" "),children:o("div",{children:"|"})})}),o("div",{className:v.outletContent,children:D})]})]})})]})};u.displayName="NavigationDashboard";export{u as NavigationDashboard};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{N as NavigationTabs}from"../NavigationTabs-
|
|
1
|
+
export{N as NavigationTabs}from"../NavigationTabs-C-zZU9Qp.js";import"react/jsx-runtime";import"react";import"../Button-QC014EKI.js";import"../Loader-ZYEBOkbx.js";import"../LoaderDots-BoEg_zlZ.js";import"../TextBox-__k4jPYK.js";import"../style-inject.es-CrVRO2OA.js";import"../Grid-DmI4tqqG.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as n,jsxs as e,Fragment as a}from"react/jsx-runtime";import{useId as t,useRef as i,useCallback as o,useEffect as r}from"react";import{B as s}from"./Button-QC014EKI.js";import{G as m}from"./Grid-DmI4tqqG.js";import{T as l}from"./TextBox-__k4jPYK.js";import{s as u}from"./style-inject.es-CrVRO2OA.js";const
|
|
1
|
+
import{jsx as n,jsxs as e,Fragment as a}from"react/jsx-runtime";import{useId as t,useRef as i,useCallback as o,useEffect as r}from"react";import{B as s}from"./Button-QC014EKI.js";import{G as m}from"./Grid-DmI4tqqG.js";import{T as l}from"./TextBox-__k4jPYK.js";import{s as u}from"./style-inject.es-CrVRO2OA.js";const c={urlChangeTimeoutMs:1500,settleMs:150,maxWaitMs:4e3},d=n=>/^#!?\//.test(n),h=n=>n.replace(/\/+$/,"")||"/",g=(n,e,a={})=>{const{urlChangeTimeoutMs:t,settleMs:i,maxWaitMs:o}={...c,...a},r=window.location.href,s=performance.now();let m,l,u,d=!1,h=0,g=0;const _=()=>{cancelAnimationFrame(h),cancelAnimationFrame(g),clearTimeout(m),clearTimeout(l),u?.disconnect()},v=()=>{d||(d=!0,_(),g=requestAnimationFrame(()=>{g=requestAnimationFrame(()=>e())}))};l=window.setTimeout(v,o);const p=()=>{clearTimeout(m),m=window.setTimeout(v,i)},b=()=>{if(!d)return window.location.href!==r?(u=new MutationObserver(e=>{e.some(e=>!n?.contains(e.target))&&p()}),u.observe(document.body,{childList:!0,subtree:!0,characterData:!0}),void p()):void(performance.now()-s>t?v():h=requestAnimationFrame(b))};return h=requestAnimationFrame(b),()=>{d=!0,_()}};var _={n23mNavigationTabs:"NavigationTabs-module_n23mNavigationTabs__ZW-sA",navigationLine:"NavigationTabs-module_navigationLine__0GXrl",menuPlaceholder:"NavigationTabs-module_menuPlaceholder__4e0gb",menu:"NavigationTabs-module_menu__RyLBY",menuContent:"NavigationTabs-module_menuContent__bVzSY",menuAnimation:"NavigationTabs-module_menuAnimation__RvppI",menuOpen:"NavigationTabs-module_menuOpen__H7d5G",noAnimation:"NavigationTabs-module_noAnimation__Wxndt",menuItemMobile:"NavigationTabs-module_menuItemMobile__xblea",navigationTabMenu:"NavigationTabs-module_navigationTabMenu__sH02E",menuItemDesktop:"NavigationTabs-module_menuItemDesktop__CgUIw"};u("@layer n23mNavigationTabs{.NavigationTabs-module_n23mNavigationTabs__ZW-sA{.NavigationTabs-module_navigationLine__0GXrl{background-color:#e1dfdf;height:2px;width:100%}.NavigationTabs-module_menuPlaceholder__4e0gb{position:fixed;right:calc(50% - clamp(0px, 100%, 1440px)/2 + 20px);z-index:9999}.NavigationTabs-module_menu__RyLBY{background-color:#e1dfdf;contain:strict;height:100dvh;left:0;overflow-y:auto;overscroll-behavior:contain;position:fixed;top:0;transform:scale(0);transform-origin:top right;transition:transform .25s ease-out;width:100vw;will-change:transform;z-index:9998;.NavigationTabs-module_menuContent__bVzSY{display:flex;flex-direction:column;opacity:0;padding:150px 20px;&.NavigationTabs-module_menuAnimation__RvppI{opacity:1;transition:opacity .2s ease-in .3s}a{-webkit-touch-callout:none;-webkit-tap-highlight-color:rgba(0,0,0,0);user-select:none}}}.NavigationTabs-module_menuOpen__H7d5G{transform:scale(1);transition:transform .25s ease-in}.NavigationTabs-module_menuContent__bVzSY.NavigationTabs-module_noAnimation__Wxndt,.NavigationTabs-module_menu__RyLBY.NavigationTabs-module_noAnimation__Wxndt{transition:none}.NavigationTabs-module_menuItemMobile__xblea{display:none}@media (max-width:767.98px){.NavigationTabs-module_menuItemDesktop__CgUIw,.NavigationTabs-module_navigationTabMenu__sH02E{display:none}.NavigationTabs-module_menuItemMobile__xblea{align-items:center;display:flex;min-height:40px}body:has(.NavigationTabs-module_menuItemMobile__xblea .NavigationTabs-module_menuOpen__H7d5G){overflow:hidden}}}}");const v=({children:u,className:c,style:v,menuTopLeftColumn:p=n(a,{children:"menuTopLeftColumn"}),menuTopRightColumn:b=n(a,{children:"menuTopRightColumn"}),menuMobile:w,menuBottomTabs:T=n(a,{children:"menuBottomTabs"}),menuOnlyTop:f=!1,widthMainContainer:x="1600px",widthInnerContainer:N="1400px",...y})=>{const L=t(),A=i(null),M=i(null),C=i(!1),k=i(null),I=i(null),E=o(()=>{null!==k.current&&(cancelAnimationFrame(k.current),k.current=null)},[]),B=o(()=>{I.current?.(),I.current=null},[]),F=o(()=>{const n=A.current,e=M.current;n&&e&&(B(),E(),C.current=!0,n.classList.remove(_.noAnimation),e.classList.remove(_.noAnimation),k.current=requestAnimationFrame(()=>{k.current=requestAnimationFrame(()=>{C.current&&(n.classList.add(_.menuOpen),e.classList.add(_.menuAnimation),k.current=null)})}))},[E,B]),j=o((n=!1)=>{const e=A.current,a=M.current;e&&a&&(B(),E(),C.current=!1,n&&(e.classList.add(_.noAnimation),a.classList.add(_.noAnimation)),e.classList.remove(_.menuOpen),a.classList.remove(_.menuAnimation))},[E,B]);r(()=>{const n=n=>{"Escape"===n.key&&C.current&&j()},e=window.matchMedia("(max-width: 767.98px)"),a=n=>{!n.matches&&C.current&&j(!0)};return document.addEventListener("keydown",n),e.addEventListener("change",a),()=>{document.removeEventListener("keydown",n),e.removeEventListener("change",a),B(),E()}},[j,B,E]),r(()=>{const n=()=>{I.current||C.current&&j(!0)};return window.addEventListener("popstate",n),window.addEventListener("hashchange",n),()=>{window.removeEventListener("popstate",n),window.removeEventListener("hashchange",n)}},[j]);return n("div",{className:[_.n23mNavigationTabs,"n23mNavigationTabs",c].filter(Boolean).join(" "),style:v,...y,children:e(m,{layout:"container",widthMax:x,children:[n(m,{layout:"container",widthMax:N,padding:"20px",margin:"auto",children:e(m,{layout:"columns",gap:{col:"20px",row:"20px"},col:{smallDesktop:2,desktop:2,mobile:2,tablet:2},children:[n("div",{children:p}),n("div",{className:w?_.menuItemDesktop:void 0,children:b}),w&&e("div",{className:_.menuItemMobile,children:[n("div",{className:_.menuPlaceholder,children:n(s,{height:"40px",width:"70px",padding:0,backgroundColor:"orangered",onClick:()=>{C.current?j():F()},"aria-label":"Menu","aria-controls":L,children:n(l,{tag:"span",desktopSize:20,mobileSize:20,fontWeight:400,color:"white",children:"Menu"})})}),n("div",{id:L,ref:A,className:_.menu,children:n("div",{ref:M,className:_.menuContent,onClickCapture:n=>{const e=n.target;if(!(e instanceof Element))return;const a=e.closest("a");if(!a)return;if(0!==n.button||n.metaKey||n.ctrlKey||n.shiftKey||n.altKey)return;if("_blank"===a.getAttribute("target")||a.hasAttribute("download"))return void B();const t=new URL(a.href,window.location.href);if(t.origin!==window.location.origin)return void B();const i=h(t.pathname)===h(window.location.pathname)&&t.search===window.location.search,o=t.hash!==window.location.hash&&(d(t.hash)||d(window.location.hash));if(i&&!o)return B(),void j();B(),I.current=g(A.current,()=>{I.current=null,j()})},children:w})})]})]})}),n("div",{className:_.navigationLine}),!f&&n(m,{layout:"container",widthMax:N,padding:"20px",margin:"auto",className:_.navigationTabMenu,children:n(m,{layout:"flex",justifyContent:"center",widthMax:N,gap:{col:"30px",row:"20px"},children:T})})]})})};v.displayName="NavigationTabs";export{v as N};
|
package/lib/Select/Select.d.ts
CHANGED
|
@@ -1,15 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { ValidatorOptions } from '../validator';
|
|
3
|
-
|
|
4
|
-
value: string;
|
|
5
|
-
label: string;
|
|
6
|
-
};
|
|
3
|
+
import { SelectOption } from './Select.types';
|
|
7
4
|
interface SelectProps extends Omit<React.HTMLAttributes<HTMLElement>, 'onBlur'> {
|
|
8
5
|
style?: React.CSSProperties;
|
|
9
6
|
name: string;
|
|
10
|
-
options:
|
|
7
|
+
options: SelectOption[];
|
|
11
8
|
inputRef?: React.RefObject<HTMLInputElement | null>;
|
|
12
|
-
initialValue?:
|
|
9
|
+
initialValue?: SelectOption;
|
|
13
10
|
validatorOptions?: ValidatorOptions;
|
|
14
11
|
label?: string;
|
|
15
12
|
placeholder?: string;
|
package/lib/Select/index.d.ts
CHANGED
package/lib/Select/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
export{S as Select}from"../Select-DSRwzuLg.js";import"react/jsx-runtime";import"react";import"../Input-D8c36JF7.js";import"../TextBox-__k4jPYK.js";import"../style-inject.es-CrVRO2OA.js";import"../index-uD0K440h.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsxs as e,jsx as o}from"react/jsx-runtime";import{useState as t,useRef as n,useId as r,useMemo as l}from"react";import{I as a}from"./Input-D8c36JF7.js";import{s as i}from"./style-inject.es-CrVRO2OA.js";var s={n23mSelect:"Select-module_n23mSelect__awO8y",icon:"Select-module_icon__jzEHa",iconRotate:"Select-module_iconRotate__NvZVj",dropdownWrapper:"Select-module_dropdownWrapper__IUKRC",open:"Select-module_open__JxM1W",dropdown:"Select-module_dropdown__DZBqH",dropdownItem:"Select-module_dropdownItem__COzLI"};i('@layer n23mSelect{.Select-module_n23mSelect__awO8y{--iff:-apple-system,BlinkMacSystemFont,avenir next,avenir,segoe ui,helvetica neue,helvetica,Cantarell,Ubuntu,roboto,noto,arial,sans-serif;position:relative;& input{cursor:pointer;padding-right:40px}.Select-module_icon__jzEHa{-webkit-touch-callout:none;-webkit-tap-highlight-color:rgba(0,0,0,0);background:url(\'data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="256" height="256" xml:space="preserve"><g style="stroke:none;stroke-width:1px;fill-rule:nonzero;opacity:1"><path d="M90 24.25a3.499 3.499 0 0 0-5.974-2.475L45 60.8 5.975 21.775a3.5 3.5 0 1 0-4.95 4.95l41.5 41.5a3.499 3.499 0 0 0 4.949 0l41.5-41.5A3.487 3.487 0 0 0 90 24.25z" style="stroke:none;stroke-width:1" transform="matrix(2.81 0 0 2.81 1.407 1.407)"/></g></svg>\') no-repeat 100%;background-position:calc(100% - 10px) 50%;background-size:18px;cursor:pointer;display:inline-block;height:40px;position:absolute;right:2px;top:22px;transform:rotate(0deg);transition:transform .1s ease-in-out;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;width:40px;&.Select-module_iconRotate__NvZVj{transform:rotate(180deg);transition:transform .1s ease-in-out}}.Select-module_dropdownWrapper__IUKRC{corner-shape:squircle;background:transparent;border-radius:12px;display:none;margin-top:65px;padding-bottom:40px;position:absolute;top:0;width:100%;z-index:3;&.Select-module_open__JxM1W{display:block}.Select-module_dropdown__DZBqH{corner-shape:squircle;-webkit-touch-callout:none;-webkit-tap-highlight-color:rgba(0,0,0,0);background:#fff;border-radius:12px;box-shadow:0 4px 8px 0 rgba(0,0,0,.24),0 6px 20px 0 rgba(0,0,0,.19);cursor:pointer;max-height:200px;overflow-y:auto;overscroll-behavior:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;&:has(.Select-module_dropdownItem__COzLI){border:1px solid var(--input-cb,#000)}.Select-module_dropdownItem__COzLI{background:#fff;border-bottom:1px solid var(--input-cb,#000);box-sizing:border-box;color:var(--input-c,#000);font-family:var(--n23mFontFamily,var(--iff));font-size:16px;font-weight:500;padding:10px;width:100%;&:hover{background-color:#f5f5f5}&:not(:first-child){border-top:none}&:last-child{border-bottom:unset}}}}}}');const d=({className:i,name:d,disabled:p,style:c,options:u,initialValue:m,validatorOptions:b,placeholder:h,onBlur:_,label:x="Select",...g})=>{const[v,w]=t(m?.label??""),[f,k]=t(m?.value??""),[S,y]=t(!1),I=n(null),z=r(),j=l(()=>u.filter(e=>e.label.toLowerCase().includes(v.toLowerCase())),[u,v]),C=()=>{y(e=>!e),w(""),k("")};return e("div",{className:[s.n23mSelect,"n23mSelect",i].filter(Boolean).join(" "),...g,style:{...c},children:[o("div",{className:[s.icon,S?s.iconRotate:""].join(" "),onMouseDown:e=>{e.preventDefault(),I.current?.focus(),C()}}),o(a,{name:d,type:"hidden",kind:"input",validatorOptions:[...b??[],{type:"existsInOptions",options:{options:u,matchBy:"value"}}],value:f}),o(a,{id:z,inputRef:I,label:x,type:"text",kind:"select",disabled:p,placeholder:h,value:v,onChange:e=>{const o=e.currentTarget.value;w(o),k(""),y(!0)},onClick:C,onBlur:e=>{y(!1),_?.(e,{value:f,label:v})},validatorOptions:[...b??[],{type:"existsInOptions",options:{options:u,matchBy:"label"}}],"aria-autocomplete":"list","aria-expanded":S,"aria-controls":`${d}-listbox`,role:"combobox"}),o("div",{className:[s.dropdownWrapper,S?s.open:""].join(" "),children:o("div",{className:[s.dropdown].join(" "),children:j.map(e=>o("div",{className:s.dropdownItem,onMouseDown:()=>{(e=>{k(e.value),w(e.label),y(!1)})(e)},children:e.label},e.value))})})]})};export{d as S};
|
package/lib/Table/Table.d.ts
CHANGED
|
@@ -1,15 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
id: string | number;
|
|
3
|
-
};
|
|
1
|
+
import { TableColumn, TableRow } from './Table.types';
|
|
4
2
|
interface TableProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
5
3
|
style?: React.CSSProperties;
|
|
6
4
|
jsonSchema: {
|
|
7
|
-
cols:
|
|
8
|
-
cellText: string;
|
|
9
|
-
cellName: string;
|
|
10
|
-
thAlign?: 'left' | 'right';
|
|
11
|
-
tdAlign?: 'left' | 'right';
|
|
12
|
-
}[];
|
|
5
|
+
cols: TableColumn[];
|
|
13
6
|
};
|
|
14
7
|
jsonData: {
|
|
15
8
|
rows: TableRow[];
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { SelectOption } from '../Select';
|
|
2
|
+
export type TableRow = Record<string, string | number | boolean> & {
|
|
3
|
+
id: string | number;
|
|
4
|
+
};
|
|
5
|
+
export type TableColumn = {
|
|
6
|
+
cellText: string;
|
|
7
|
+
cellName: string;
|
|
8
|
+
cellType: 'select';
|
|
9
|
+
options: SelectOption[];
|
|
10
|
+
initialValue: SelectOption;
|
|
11
|
+
thAlign?: 'left' | 'right';
|
|
12
|
+
tdAlign?: 'left' | 'right';
|
|
13
|
+
} | {
|
|
14
|
+
cellText: string;
|
|
15
|
+
cellName: string;
|
|
16
|
+
cellType: 'date';
|
|
17
|
+
options?: never;
|
|
18
|
+
initialValue: '' | `${number}-${number}-${number}`;
|
|
19
|
+
thAlign?: 'left' | 'right';
|
|
20
|
+
tdAlign?: 'left' | 'right';
|
|
21
|
+
} | {
|
|
22
|
+
cellText: string;
|
|
23
|
+
cellName: string;
|
|
24
|
+
cellType: 'text' | 'number';
|
|
25
|
+
initialValue?: never;
|
|
26
|
+
options?: never;
|
|
27
|
+
thAlign?: 'left' | 'right';
|
|
28
|
+
tdAlign?: 'left' | 'right';
|
|
29
|
+
};
|
package/lib/Table/index.d.ts
CHANGED
package/lib/Table/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as e,jsx as l}from"react/jsx-runtime";import{useState as a}from"react";import{B as t}from"../Button-QC014EKI.js";import{D as r}from"../Dialog-BSO4ohVZ.js";import{F as
|
|
1
|
+
import{jsxs as e,jsx as l}from"react/jsx-runtime";import{useState as a}from"react";import{B as t}from"../Button-QC014EKI.js";import{C as i}from"../Calendar-D7QM1Jwl.js";import{D as r}from"../Dialog-BSO4ohVZ.js";import{F as o}from"../Form-CgTuTB2Q.js";import{G as n}from"../Grid-DmI4tqqG.js";import{I as s}from"../Input-D8c36JF7.js";import{S as d}from"../Select-DSRwzuLg.js";import{T as c}from"../TextBox-__k4jPYK.js";import{T as m}from"../Typography-CZqNLAT7.js";import{s as p,g as b}from"../style-inject.es-CrVRO2OA.js";import"../Loader-ZYEBOkbx.js";import"../LoaderDots-BoEg_zlZ.js";import"../IconLocate-CQda7FAB.js";import"../index-uD0K440h.js";var u={n23mTable:"Table-module_n23mTable__kKVd9",table:"Table-module_table__hJFsY"};p("@layer n23mTable{.Table-module_n23mTable__kKVd9{background-attachment:local,local,scroll,scroll;background-color:#fff;background-image:linear-gradient(90deg,#fff 20px,hsla(0,0%,100%,0)),linear-gradient(270deg,#fff 20px,hsla(0,0%,100%,0)),radial-gradient(farthest-side at 0 50%,rgba(0,0,0,.25),transparent),radial-gradient(farthest-side at 100% 50%,rgba(0,0,0,.25),transparent);background-position:0,100%,0,100%;background-repeat:no-repeat;background-size:40px 100%,40px 100%,14px 100%,14px 100%;overflow-x:auto}.Table-module_n23mTable__kKVd9:focus-visible{outline:2px solid currentcolor;outline-offset:2px}.Table-module_table__hJFsY{border-collapse:collapse;min-width:max-content;width:100%}.Table-module_table__hJFsY td,.Table-module_table__hJFsY th{border:1px solid grey;padding:10px 12px}.Table-module_table__hJFsY td[data-clickable=true]{cursor:pointer}}");const h=({className:p,jsonSchema:h,jsonData:g,handleCellEdit:f,handelCellDel:x,resetQueryCellEdit:T,isErrorCellEdit:k=!1,isPendingCellEdit:_=!1,isSuccessCellEdit:j=!1,errorMsgCellEdit:y,successMsgCellEdit:C,style:S,...N})=>{const[w,v]=a(!1),[E,z]=a(0),[D,V]=a(null),B=Boolean(f),F=h.cols.filter(e=>"id"!==e.cellName);return e("div",{className:[u.n23mTable,"n23mTable",p].filter(Boolean).join(" "),...N,style:{...b({}),...S},children:[B&&l(r,{open:w,onCancel:()=>{v(!1),T?.()},widthMax:"900px",children:e(n,{layout:"container",widthMin:"min(800px, calc(100vw - 25px))",padding:"0px 30px 30px 30px",margin:"auto",children:[l(m,{appearance:"light",variant:"subheading",style:{margin:"0 0 20px 0"},children:"Edit Cell"}),e(o,{onSubmit:e=>{if(!f)return;if(Object.values(e).some(({error:e})=>e))return;const l=Object.fromEntries(Object.entries(e).map(([e,{value:l}])=>[e,l]));f(l)},isError:k,isPending:_,isSuccess:j,errorMsg:y,successMsg:C,children:[l(n,{layout:"columns",col:{smallDesktop:2},gap:{col:"20px"},children:D&&h.cols.map(e=>{const a="id"===e.cellName,t=D[e.cellName];if("date"===e.cellType){const a=t||e.initialValue;return l(i,{label:e.cellText,name:e.cellName,initialValue:a,placeholder:e.cellText},e.cellName)}if("select"===e.cellType){const a=e.options.find(e=>e.value===String(t??""))??e.initialValue;return l(d,{name:e.cellName,options:e.options,initialValue:a},e.cellName)}return l(s,{label:e.cellText,name:e.cellName,type:"text",defaultValue:String(t??""),disabled:a,placeholder:e.cellText},e.cellName)})}),e(n,{layout:"flex",widthMax:"100%",padding:"0",justifyContent:x?"space-between":"flex-end",alignItems:"right",margin:"20px 0 0 0",children:[x&&l(t,{type:"button",height:"40px",width:"80px",padding:0,disabled:_,backgroundColor:"red",backgroundColorDisabled:"grey",onClick:()=>{x&&D&&(x(D.id),v(!1))},children:l(c,{tag:"span",desktopSize:16,mobileSize:16,fontWeight:400,color:"white",children:"Delete"})}),l(t,{type:"submit",height:"40px",width:"80px",padding:0,disabled:_,backgroundColor:"#4BB543",backgroundColorDisabled:"grey",children:l(c,{tag:"span",desktopSize:16,mobileSize:16,fontWeight:400,color:"white",children:"Save"})})]})]},E)]})}),e("table",{className:u.table,children:[l("thead",{children:l("tr",{children:F.map(e=>l("th",{scope:"col",children:l(c,{mobileSize:16,desktopSize:20,color:"black",textAlign:e.thAlign??"left",children:e.cellText})},e.cellName))})}),l("tbody",{children:g.rows.map(e=>l("tr",{children:F.map(a=>{const t=e[a.cellName];return l("td",{"data-clickable":B,onClick:B?()=>(e=>{V(e),v(!0),z(e=>e+1)})(e):void 0,children:l(c,{fontWeight:400,mobileSize:16,desktopSize:16,color:"black",textAlign:a.tdAlign??"left",children:void 0===t?"":String(t)})},a.cellName)})},e.id))})]})]})};h.displayName="Table";export{h as Table};
|