najwer23morsels 1.10.9 → 1.10.11

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.
@@ -10,4 +10,9 @@ export declare const generateDaysArray: (inputDate: string | Date) => {
10
10
  dayValue: string;
11
11
  cssClass: string;
12
12
  }[];
13
- export declare const isYYYYMMDD: (inputDate: string) => boolean;
13
+ export declare const parseTypedDate: (value: string, today?: Date) => {
14
+ year: number;
15
+ month: number;
16
+ day: number;
17
+ iso: string;
18
+ };
@@ -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";
1
+ export{C as Calendar}from"../Calendar-BkDrBfRy.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-Bl7_BOs4.js";import"../validator/index.js";
@@ -0,0 +1 @@
1
+ import{jsxs as e,jsx as a,Fragment as t}from"react/jsx-runtime";import{useRef as r,useState as o,useMemo as n}from"react";import{B as l}from"./Button-QC014EKI.js";import{I as d,a as i}from"./IconLocate-CQda7FAB.js";import{I as s}from"./Input-Bl7_BOs4.js";import{T as c}from"./TextBox-__k4jPYK.js";import{s as p}from"./style-inject.es-CrVRO2OA.js";var h={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{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:1px;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 u=(e,a,t)=>{const r=new Date(0);return r.setFullYear(e,a,t),r.setHours(0,0,0,0),r},m=e=>{const a="string"==typeof e?new Date(e):e,t=a.getFullYear(),r=a.getMonth();return u(t,r+1,0).getDate()},y=e=>{const a="string"==typeof e?new Date(e):e;return`${String(a.getFullYear()).padStart(4,"0")}-${String(a.getMonth()+1).padStart(2,"0")}-${String(a.getDate()).padStart(2,"0")}`},g=e=>{const a="string"==typeof e?new Date(e):e,t=a.getDate(),r=((e=>{const a="string"==typeof e?new Date(e):e,t=a.getFullYear(),r=a.getMonth();return u(t,r,1).getDay()})(a)+6)%7,o=m(a);return Array.from({length:o+r},(e,a)=>{let o="",n="";return a<=r-1?(o="",n="blank"):a===t+r-1?(o=String(a-r+1),n="active"):(o=String(a-r+1),n="clickable"),{day:a-r+1,dayValue:o,cssClass:n}})},_=({children:p,name:_,placeholder:C,label:w="Calendar",initialValue:v,disabled:b,onBlur:x,validatorOptions:f,className:k,style:D,...S})=>{const F=r(null),[N,M]=o({value:v??y(new Date),open:!1,dropDwonState:"days"}),{year:j,month:Y,day:T,iso:E}=((e,a=new Date)=>{const[t="",r="",o=""]=e.split("-"),n=/^\d{4}$/.test(t)?Number(t):a.getFullYear(),l=/^\d{1,2}$/.test(r)&&Number(r)>=1&&Number(r)<=12?Number(r)-1:a.getMonth(),d=/^\d{1,2}$/.test(o)&&Number(o)>=1&&Number(o)<=31?Number(o):a.getDate(),i=Math.min(d,m(u(n,l,1)));return{year:n,month:l,day:i,iso:`${String(n).padStart(4,"0")}-${String(l+1).padStart(2,"0")}-${String(i).padStart(2,"0")}`}})(N.value),V=e=>{M(a=>({...a,value:y(e),open:!0}))},A=e=>{V(((e,a)=>{const t="string"==typeof e?new Date(e):e,r=t.getFullYear(),o=t.getMonth(),n=u(r,o+1,0).getDate(),l=Math.max(1,Math.min(a,n));return u(r,o,l)})(E,e))},z=e=>{V(((e,a)=>{const t="string"==typeof e?new Date(e):e,r=t.getFullYear(),o=t.getMonth()+a,n=t.getDate(),l=u(r,o,n);if(l.getDate()!==n){const e=u(r,o+1,0).getDate();return u(r,o,e)}return l})(E,e))},H=e=>{V(((e,a)=>{const t="string"==typeof e?new Date(e):e,r=a,o=t.getMonth(),n=t.getDate();return u(r,o,n)})(E,e))},W=n(()=>Array.from({length:7},(e,a)=>new Date(2021,0,(a+4)%7).toLocaleString("en-US",{weekday:"short"})),[]),B=n(()=>Array.from({length:12},(e,a)=>new Date(2021,a+1,0).toLocaleString("en-US",{month:"short"})),[]),$=g(E),P=(e=>{const a="string"==typeof e?new Date(e):e,t=a.getFullYear()-4,r=a.getFullYear()+4;return Array.from({length:r-t+1},(e,a)=>t+a).filter(e=>e>=0)})(E);return e("div",{className:[h.n23mCalendar,"n23mCalendar",k].filter(Boolean).join(" "),...S,style:{...D},children:[a("div",{className:h.icon,onMouseDown:e=>{b||(e.preventDefault(),F.current?.focus(),M(e=>({...e,open:!e.open,dropDwonState:"days"})))}}),a(s,{inputRef:F,label:w,type:"text",kind:"input",name:_,autoComplete:"off",placeholder:C,onChange:e=>{const a=e.currentTarget.value;M(e=>({...e,value:a}))},onBlur:e=>{M(e=>({...e,open:!1})),x?.(e)},onClick:()=>{b||M(e=>({...e,open:!0,dropDwonState:"days"}))},disabled:b,value:N.value,validatorOptions:[...f??[],{type:"date"}],className:h.arrowUp,"aria-expanded":N.open,role:"combobox"}),a("div",{className:[h.dropdownWrapper,N.open?h.open:""].join(" "),children:e("div",{className:[h.dropdown].join(" "),onMouseDown:e=>e.preventDefault(),children:["years"===N.dropDwonState&&e(t,{children:[e("div",{className:h.controls,style:{marginBottom:"10px"},children:[a("div",{style:{width:"30px"},children:a(l,{type:"button",padding:"3px 0 0 0",height:"30px",width:"30px",title:"Prev Month",backgroundColor:"#F2F0EF",borderColor:"black",onClick:()=>H(j-9),children:a(d,{color:"black",height:22,width:22})})}),a("div",{style:{width:"60%"},className:h.controlsDate,children:a("div",{style:{cursor:"pointer"},onClick:()=>M(e=>({...e,dropDwonState:"days"})),children:j})}),a("div",{style:{width:"30px"},children:a(l,{type:"button",padding:"3px 0 0 0",height:"30px",width:"30px",title:"Prev Month",backgroundColor:"#F2F0EF",borderColor:"black",onClick:()=>H(j+9),children:a(i,{color:"black",height:22,width:22})})})]}),a("div",{className:h.years,children:P.map(e=>a("div",{className:h.yearsChild,children:a(l,{type:"button",height:"40px",width:"80px",color:"black",backgroundColor:j==e?"white":"#F2F0EF",borderColor:"black",title:"year",onClick:()=>{H(e),M(e=>({...e,dropDwonState:"days"}))},children:a(c,{mobileSize:14,desktopSize:14,children:e})},e+N.value)},e+N.value))})]}),"months"===N.dropDwonState&&a("div",{className:h.months,children:B.map((e,t)=>a("div",{className:h.monthsChild,children:a(l,{type:"button",height:"40px",width:"80px",backgroundColor:Y==t?"white":"#F2F0EF",borderColor:"black",title:"month",onClick:()=>{z(t-Y),M(e=>({...e,dropDwonState:"days"}))},children:a(c,{mobileSize:14,desktopSize:14,children:e})},e+N.value)},e+N.value))}),"days"===N.dropDwonState&&e(t,{children:[e("div",{className:h.controls,children:[a("div",{style:{width:"30px"},children:a(l,{type:"button",padding:"3px 0 0 0",height:"30px",width:"30px",title:"Prev Month",backgroundColor:"#F2F0EF",borderColor:"black",onClick:()=>z(-1),children:a(d,{color:"black",height:22,width:22})})}),e("div",{style:{width:"60%"},className:h.controlsDate,children:[a("div",{style:{cursor:"pointer"},onClick:()=>M(e=>({...e,dropDwonState:"years"})),children:j}),a("div",{children:"-"}),a("div",{style:{cursor:"pointer"},onClick:()=>M(e=>({...e,dropDwonState:"months"})),children:String(Y+1).padStart(2,"0")}),a("div",{children:"-"}),a("div",{children:String(T).padStart(2,"0")})]}),a("div",{style:{width:"30px"},children:a(l,{type:"button",padding:"3px 0 0 0",height:"30px",width:"30px",title:"Prev Month",backgroundColor:"#F2F0EF",borderColor:"black",onClick:()=>z(1),children:a(i,{color:"black",height:22,width:22})})})]}),a("div",{className:h.weekdays,children:W.map(e=>a("div",{className:h.weekdaysChild,children:e},e))}),a("div",{className:h.days,children:$.map(e=>a("div",{className:[h.weekdaysChild,h.daysChild,"active"==e.cssClass&&h.daysActive,"clickable"==e.cssClass&&h.daysClickable].join(" "),onMouseDown:()=>{e.day>0&&A(e.day),M(e=>({...e,open:!1})),setTimeout(()=>{F.current?.blur()})},children:e.day<=0||e.day>m(E)?" ":e.day},e.day+N.value))})]})]})})]})};_.displayName="Calendar";export{_ as C};
@@ -1 +1 @@
1
- import{jsx as o,jsxs as r}from"react/jsx-runtime";import{B as e}from"../Button-QC014EKI.js";import{F as t}from"../Form-CgTuTB2Q.js";import{G as s}from"../Grid-DmI4tqqG.js";import{I as i}from"../Input-D8c36JF7.js";import{T as a}from"../TextBox-__k4jPYK.js";import{s as n}from"../style-inject.es-CrVRO2OA.js";import"react";import"../Loader-ZYEBOkbx.js";import"../LoaderDots-BoEg_zlZ.js";import"../index-uD0K440h.js";var l={n23mFormForgotPass:"FormForgotPass-module_n23mFormForgotPass__sI7QJ",forogotPasswordWrapper:"FormForgotPass-module_forogotPasswordWrapper__LCDpp"};n("@layer n23mFormForgotPass{.FormForgotPass-module_n23mFormForgotPass__sI7QJ{.FormForgotPass-module_forogotPasswordWrapper__LCDpp{corner-shape:squircle;background-color:#fff;border:1px solid grey;border-radius:12px}}}");const m=({className:n,style:m,onSubmit:p,isPending:d,isError:c,isSuccess:g,errorMsg:x,successMsg:f,onNavigate:h,footerHeight:u="100px",linkMainPage:F,linkLogin:b,...y})=>{const P=o=>{h?h(o):window.location.href=o};return o("div",{className:[l.n23mFormForgotPass,"n23mFormForgotPass",n].filter(Boolean).join(" "),...y,style:{...m},children:o(s,{layout:"flex",flexWrap:"wrap",justifyContent:"center",alignItems:"center",widthMax:"1400px",minHeight:`calc(100dvb - ${u})`,children:r(s,{layout:"container",minHeight:0,widthMin:"min(450px, calc(100% - 40px))",padding:"20px",margin:"20px",className:l.forogotPasswordWrapper,children:[F&&o(a,{desktopSize:20,mobileSize:20,fontWeight:500,tag:"a",href:F.link,color:"grey",colorHover:"var(--n23mTextBoxColorHover, black)",onClick:o=>{o.preventDefault(),P(F.link)},children:F.text}),o(a,{tag:"h3",desktopSize:14,mobileSize:14,fontWeight:500,margin:"12px 0 18px",children:"Forgot Password"}),r(t,{onSubmit:p,isError:c,isPending:d,isSuccess:g,errorMsg:x,successMsg:f,children:[o(i,{validatorOptions:[{type:"empty"},{type:"email"}],label:"Email",name:"email",type:"text",placeholder:"you@example.com"}),r(s,{layout:"flex",justifyContent:"space-between",alignItems:"flex-start",children:[o(e,{type:"submit",disabled:d,height:"40px",width:"80px",padding:0,backgroundColor:"orangered",backgroundColorDisabled:"grey",children:o(a,{tag:"span",desktopSize:16,mobileSize:16,fontWeight:400,color:"white",children:"Send"})}),b&&o(a,{tag:"a",href:b.link,desktopSize:12,mobileSize:12,fontWeight:400,color:"var(--n23mTextBoxColor, orangered)",colorHover:"var(--n23mTextBoxColorHover, black)",onClick:o=>{o.preventDefault(),P(b.link)},children:b.text})]})]})]})})})};m.displayName="FormForgotPass";export{m as FormForgotPass};
1
+ import{jsx as o,jsxs as r}from"react/jsx-runtime";import{B as e}from"../Button-QC014EKI.js";import{F as t}from"../Form-CgTuTB2Q.js";import{G as s}from"../Grid-DmI4tqqG.js";import{I as i}from"../Input-Bl7_BOs4.js";import{T as a}from"../TextBox-__k4jPYK.js";import{s as n}from"../style-inject.es-CrVRO2OA.js";import"react";import"../Loader-ZYEBOkbx.js";import"../LoaderDots-BoEg_zlZ.js";import"../validator/index.js";var l={n23mFormForgotPass:"FormForgotPass-module_n23mFormForgotPass__sI7QJ",forogotPasswordWrapper:"FormForgotPass-module_forogotPasswordWrapper__LCDpp"};n("@layer n23mFormForgotPass{.FormForgotPass-module_n23mFormForgotPass__sI7QJ{.FormForgotPass-module_forogotPasswordWrapper__LCDpp{corner-shape:squircle;background-color:#fff;border:1px solid grey;border-radius:12px}}}");const m=({className:n,style:m,onSubmit:p,isPending:d,isError:c,isSuccess:g,errorMsg:x,successMsg:f,onNavigate:h,footerHeight:u="100px",linkMainPage:F,linkLogin:b,...y})=>{const P=o=>{h?h(o):window.location.href=o};return o("div",{className:[l.n23mFormForgotPass,"n23mFormForgotPass",n].filter(Boolean).join(" "),...y,style:{...m},children:o(s,{layout:"flex",flexWrap:"wrap",justifyContent:"center",alignItems:"center",widthMax:"1400px",minHeight:`calc(100dvb - ${u})`,children:r(s,{layout:"container",minHeight:0,widthMin:"min(450px, calc(100% - 40px))",padding:"20px",margin:"20px",className:l.forogotPasswordWrapper,children:[F&&o(a,{desktopSize:20,mobileSize:20,fontWeight:500,tag:"a",href:F.link,color:"grey",colorHover:"var(--n23mTextBoxColorHover, black)",onClick:o=>{o.preventDefault(),P(F.link)},children:F.text}),o(a,{tag:"h3",desktopSize:14,mobileSize:14,fontWeight:500,margin:"12px 0 18px",children:"Forgot Password"}),r(t,{onSubmit:p,isError:c,isPending:d,isSuccess:g,errorMsg:x,successMsg:f,children:[o(i,{validatorOptions:[{type:"empty"},{type:"email"}],label:"Email",name:"email",type:"text",placeholder:"you@example.com"}),r(s,{layout:"flex",justifyContent:"space-between",alignItems:"flex-start",children:[o(e,{type:"submit",disabled:d,height:"40px",width:"80px",padding:0,backgroundColor:"orangered",backgroundColorDisabled:"grey",children:o(a,{tag:"span",desktopSize:16,mobileSize:16,fontWeight:400,color:"white",children:"Send"})}),b&&o(a,{tag:"a",href:b.link,desktopSize:12,mobileSize:12,fontWeight:400,color:"var(--n23mTextBoxColor, orangered)",colorHover:"var(--n23mTextBoxColorHover, black)",onClick:o=>{o.preventDefault(),P(b.link)},children:b.text})]})]})]})})})};m.displayName="FormForgotPass";export{m as FormForgotPass};
@@ -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 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
+ 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-Bl7_BOs4.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"../validator/index.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 m=({className:p,style:m,onSubmit:c,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:{...m},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:c,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"})})]})]})})})};m.displayName="FormForgotPassOtp";export{m as FormForgotPassOtp};
@@ -1 +1 @@
1
- import{jsx as e,jsxs as o}from"react/jsx-runtime";import{B as r}from"../Button-QC014EKI.js";import{F as i}from"../Form-CgTuTB2Q.js";import{G as t}from"../Grid-DmI4tqqG.js";import{I as n}from"../Input-D8c36JF7.js";import{T as l}from"../TextBox-__k4jPYK.js";import{s as a}from"../style-inject.es-CrVRO2OA.js";import"react";import"../Loader-ZYEBOkbx.js";import"../LoaderDots-BoEg_zlZ.js";import"../index-uD0K440h.js";var s={n23mFormLogin:"FormLogin-module_n23mFormLogin__1mOEk",loginWrapper:"FormLogin-module_loginWrapper__HOEgv"};a("@layer n23mFormLogin{.FormLogin-module_n23mFormLogin__1mOEk{.FormLogin-module_loginWrapper__HOEgv{corner-shape:squircle;background-color:#fff;border:1px solid grey;border-radius:12px}}}");const m=({className:a,style:m,onSubmit:p,isPending:d,isError:c,isSuccess:g,errorMsg:x,successMsg:h,onNavigate:u,linkMainPage:f,linkForgotPassword:y,linkSignUp:k,footerHeight:v="100px",...b})=>{const j=e=>{u?u(e):window.location.href=e};return e("div",{className:[s.n23mFormLogin,"n23mFormLogin",a].filter(Boolean).join(" "),...b,style:{...m},children:e(t,{layout:"flex",flexWrap:"wrap",justifyContent:"center",alignItems:"center",widthMax:"1400px",minHeight:`calc(100dvb - ${v})`,children:o(t,{layout:"container",minHeight:0,widthMin:"min(450px, calc(100% - 40px))",padding:"20px",margin:"20px",className:s.loginWrapper,children:[f&&e(l,{desktopSize:20,mobileSize:20,fontWeight:500,tag:"a",href:f.link,color:"grey",colorHover:"var(--n23mTextBoxColorHover, black)",onClick:e=>{e.preventDefault(),j("/")},children:f.text}),e(l,{tag:"h3",desktopSize:14,mobileSize:14,fontWeight:500,margin:"12px 0 18px",children:"Good to see you!"}),o(i,{onSubmit:p,isError:c,isPending:d,isSuccess:g,errorMsg:x,successMsg:h,children:[e(n,{validatorOptions:[{type:"empty"},{type:"email"}],label:"Email",name:"email",type:"text",placeholder:"you@example.com"}),e(n,{label:"Password",type:"password",name:"pass",validatorOptions:[{type:"empty"}],placeholder:"Enter your password"}),o(t,{layout:"flex",justifyContent:"space-between",alignItems:"flex-start",children:[e(r,{type:"submit",disabled:d,height:"40px",width:"80px",padding:0,backgroundColor:"orangered",backgroundColorDisabled:"grey",children:e(l,{tag:"span",desktopSize:16,mobileSize:16,fontWeight:400,color:"white",children:"Log in"})}),o("div",{children:[y&&e("div",{children:e(l,{tag:"a",href:y.link,desktopSize:12,mobileSize:12,fontWeight:400,color:"var(--n23mTextBoxColor, orangered)",colorHover:"var(--n23mTextBoxColorHover, black)",onClick:e=>{e.preventDefault(),j(y.link)},children:y.text})}),k&&e(t,{layout:"flex",justifyContent:"right",children:e(l,{tag:"a",href:k.link,desktopSize:12,mobileSize:12,fontWeight:400,color:"var(--n23mTextBoxColor, orangered)",colorHover:"var(--n23mTextBoxColorHover, black)",onClick:e=>{e.preventDefault(),j(k.link)},children:k.text})})]})]})]})]})})})};m.displayName="FormLogin";export{m as FormLogin};
1
+ import{jsx as e,jsxs as o}from"react/jsx-runtime";import{B as r}from"../Button-QC014EKI.js";import{F as i}from"../Form-CgTuTB2Q.js";import{G as t}from"../Grid-DmI4tqqG.js";import{I as n}from"../Input-Bl7_BOs4.js";import{T as l}from"../TextBox-__k4jPYK.js";import{s as a}from"../style-inject.es-CrVRO2OA.js";import"react";import"../Loader-ZYEBOkbx.js";import"../LoaderDots-BoEg_zlZ.js";import"../validator/index.js";var s={n23mFormLogin:"FormLogin-module_n23mFormLogin__1mOEk",loginWrapper:"FormLogin-module_loginWrapper__HOEgv"};a("@layer n23mFormLogin{.FormLogin-module_n23mFormLogin__1mOEk{.FormLogin-module_loginWrapper__HOEgv{corner-shape:squircle;background-color:#fff;border:1px solid grey;border-radius:12px}}}");const m=({className:a,style:m,onSubmit:p,isPending:d,isError:c,isSuccess:g,errorMsg:x,successMsg:h,onNavigate:u,linkMainPage:f,linkForgotPassword:y,linkSignUp:v,footerHeight:k="100px",...b})=>{const j=e=>{u?u(e):window.location.href=e};return e("div",{className:[s.n23mFormLogin,"n23mFormLogin",a].filter(Boolean).join(" "),...b,style:{...m},children:e(t,{layout:"flex",flexWrap:"wrap",justifyContent:"center",alignItems:"center",widthMax:"1400px",minHeight:`calc(100dvb - ${k})`,children:o(t,{layout:"container",minHeight:0,widthMin:"min(450px, calc(100% - 40px))",padding:"20px",margin:"20px",className:s.loginWrapper,children:[f&&e(l,{desktopSize:20,mobileSize:20,fontWeight:500,tag:"a",href:f.link,color:"grey",colorHover:"var(--n23mTextBoxColorHover, black)",onClick:e=>{e.preventDefault(),j("/")},children:f.text}),e(l,{tag:"h3",desktopSize:14,mobileSize:14,fontWeight:500,margin:"12px 0 18px",children:"Good to see you!"}),o(i,{onSubmit:p,isError:c,isPending:d,isSuccess:g,errorMsg:x,successMsg:h,children:[e(n,{validatorOptions:[{type:"empty"},{type:"email"}],label:"Email",name:"email",type:"text",placeholder:"you@example.com"}),e(n,{label:"Password",type:"password",name:"pass",validatorOptions:[{type:"empty"}],placeholder:"Enter your password"}),o(t,{layout:"flex",justifyContent:"space-between",alignItems:"flex-start",children:[e(r,{type:"submit",disabled:d,height:"40px",width:"80px",padding:0,backgroundColor:"orangered",backgroundColorDisabled:"grey",children:e(l,{tag:"span",desktopSize:16,mobileSize:16,fontWeight:400,color:"white",children:"Log in"})}),o("div",{children:[y&&e("div",{children:e(l,{tag:"a",href:y.link,desktopSize:12,mobileSize:12,fontWeight:400,color:"var(--n23mTextBoxColor, orangered)",colorHover:"var(--n23mTextBoxColorHover, black)",onClick:e=>{e.preventDefault(),j(y.link)},children:y.text})}),v&&e(t,{layout:"flex",justifyContent:"right",children:e(l,{tag:"a",href:v.link,desktopSize:12,mobileSize:12,fontWeight:400,color:"var(--n23mTextBoxColor, orangered)",colorHover:"var(--n23mTextBoxColorHover, black)",onClick:e=>{e.preventDefault(),j(v.link)},children:v.text})})]})]})]})]})})})};m.displayName="FormLogin";export{m as FormLogin};
@@ -1 +1 @@
1
- import{jsx as e,jsxs as r}from"react/jsx-runtime";import{B as o}from"../Button-QC014EKI.js";import{F as i}from"../Form-CgTuTB2Q.js";import{G as n}from"../Grid-DmI4tqqG.js";import{I as t}from"../Input-D8c36JF7.js";import{T as a}from"../TextBox-__k4jPYK.js";import{s}from"../style-inject.es-CrVRO2OA.js";import"react";import"../Loader-ZYEBOkbx.js";import"../LoaderDots-BoEg_zlZ.js";import"../index-uD0K440h.js";var l={n23mFormSignUp:"FormSignUp-module_n23mFormSignUp__p9dT2",signUpWrapper:"FormSignUp-module_signUpWrapper__PcjYN"};s("@layer n23mFormSignUp{.FormSignUp-module_n23mFormSignUp__p9dT2{.FormSignUp-module_signUpWrapper__PcjYN{corner-shape:squircle;background-color:#fff;border:1px solid grey;border-radius:12px}}}");const p=({className:s,style:p,onSubmit:m,isPending:c,isError:d,isSuccess:g,errorMsg:x,successMsg:h,onNavigate:u,footerHeight:f="100px",linkMainPage:S,linkLogin:y,...b})=>{const k=e=>{u?u(e):window.location.href=e};return e("div",{className:[l.n23mFormSignUp,"n23mFormSignUp",s].filter(Boolean).join(" "),...b,style:{...p},children:e(n,{layout:"flex",flexWrap:"wrap",justifyContent:"center",alignItems:"center",widthMax:"1400px",minHeight:`calc(100dvb - ${f})`,children:r(n,{layout:"container",minHeight:0,widthMin:"min(450px, calc(100% - 40px))",padding:"20px",margin:"20px",className:l.signUpWrapper,children:[S&&e(a,{desktopSize:20,mobileSize:20,fontWeight:500,tag:"a",href:S.link,color:"grey",colorHover:"var(--n23mTextBoxColorHover, black)",onClick:e=>{e.preventDefault(),k(S.link)},children:S.text}),e(a,{tag:"h3",desktopSize:14,mobileSize:14,fontWeight:500,margin:"12px 0 18px",children:"Create an account now!"}),r(i,{onSubmit:m,isError:d,isPending:c,isSuccess:g,errorMsg:x,successMsg:h,children:[e(t,{validatorOptions:[{type:"empty"},{type:"email"}],label:"Email",name:"email",type:"text",placeholder:"you@example.com"}),e(t,{label:"Password",type:"password",name:"pass",validatorOptions:[{type:"empty"}],placeholder:"Enter your password"}),r(n,{layout:"flex",justifyContent:"space-between",alignItems:"flex-start",children:[e(o,{type:"submit",disabled:c,height:"40px",width:"80px",padding:0,backgroundColor:"orangered",backgroundColorDisabled:"grey",children:e(a,{tag:"span",desktopSize:16,mobileSize:16,fontWeight:400,color:"white",children:"Sign up"})}),y&&e("div",{children:e(a,{tag:"a",href:y.link,desktopSize:12,mobileSize:12,fontWeight:400,color:"var(--n23mTextBoxColor, orangered)",colorHover:"var(--n23mTextBoxColorHover, black)",onClick:e=>{e.preventDefault(),k(y.link)},children:y.text})})]})]})]})})})};p.displayName="FormSignUp";export{p as FormSignUp};
1
+ import{jsx as e,jsxs as r}from"react/jsx-runtime";import{B as o}from"../Button-QC014EKI.js";import{F as i}from"../Form-CgTuTB2Q.js";import{G as n}from"../Grid-DmI4tqqG.js";import{I as t}from"../Input-Bl7_BOs4.js";import{T as a}from"../TextBox-__k4jPYK.js";import{s as l}from"../style-inject.es-CrVRO2OA.js";import"react";import"../Loader-ZYEBOkbx.js";import"../LoaderDots-BoEg_zlZ.js";import"../validator/index.js";var s={n23mFormSignUp:"FormSignUp-module_n23mFormSignUp__p9dT2",signUpWrapper:"FormSignUp-module_signUpWrapper__PcjYN"};l("@layer n23mFormSignUp{.FormSignUp-module_n23mFormSignUp__p9dT2{.FormSignUp-module_signUpWrapper__PcjYN{corner-shape:squircle;background-color:#fff;border:1px solid grey;border-radius:12px}}}");const p=({className:l,style:p,onSubmit:m,isPending:d,isError:c,isSuccess:g,errorMsg:x,successMsg:h,onNavigate:u,footerHeight:f="100px",linkMainPage:S,linkLogin:y,...b})=>{const k=e=>{u?u(e):window.location.href=e};return e("div",{className:[s.n23mFormSignUp,"n23mFormSignUp",l].filter(Boolean).join(" "),...b,style:{...p},children:e(n,{layout:"flex",flexWrap:"wrap",justifyContent:"center",alignItems:"center",widthMax:"1400px",minHeight:`calc(100dvb - ${f})`,children:r(n,{layout:"container",minHeight:0,widthMin:"min(450px, calc(100% - 40px))",padding:"20px",margin:"20px",className:s.signUpWrapper,children:[S&&e(a,{desktopSize:20,mobileSize:20,fontWeight:500,tag:"a",href:S.link,color:"grey",colorHover:"var(--n23mTextBoxColorHover, black)",onClick:e=>{e.preventDefault(),k(S.link)},children:S.text}),e(a,{tag:"h3",desktopSize:14,mobileSize:14,fontWeight:500,margin:"12px 0 18px",children:"Create an account now!"}),r(i,{onSubmit:m,isError:c,isPending:d,isSuccess:g,errorMsg:x,successMsg:h,children:[e(t,{validatorOptions:[{type:"empty"},{type:"email"}],label:"Email",name:"email",type:"text",placeholder:"you@example.com"}),e(t,{label:"Password",type:"password",name:"pass",validatorOptions:[{type:"empty"}],placeholder:"Enter your password"}),r(n,{layout:"flex",justifyContent:"space-between",alignItems:"flex-start",children:[e(o,{type:"submit",disabled:d,height:"40px",width:"80px",padding:0,backgroundColor:"orangered",backgroundColorDisabled:"grey",children:e(a,{tag:"span",desktopSize:16,mobileSize:16,fontWeight:400,color:"white",children:"Sign up"})}),y&&e("div",{children:e(a,{tag:"a",href:y.link,desktopSize:12,mobileSize:12,fontWeight:400,color:"var(--n23mTextBoxColor, orangered)",colorHover:"var(--n23mTextBoxColorHover, black)",onClick:e=>{e.preventDefault(),k(y.link)},children:y.text})})]})]})]})})})};p.displayName="FormSignUp";export{p as FormSignUp};
@@ -1 +1 @@
1
- export{I as Input}from"../Input-D8c36JF7.js";import"react/jsx-runtime";import"react";import"../TextBox-__k4jPYK.js";import"../style-inject.es-CrVRO2OA.js";import"../index-uD0K440h.js";
1
+ export{I as Input}from"../Input-Bl7_BOs4.js";import"react/jsx-runtime";import"react";import"../TextBox-__k4jPYK.js";import"../style-inject.es-CrVRO2OA.js";import"../validator/index.js";
@@ -0,0 +1 @@
1
+ import{jsxs as e,jsx as t}from"react/jsx-runtime";import{useRef as n,useEffect as r}from"react";import{T as o}from"./TextBox-__k4jPYK.js";import{s as a,g as i}from"./style-inject.es-CrVRO2OA.js";import{validator as l}from"./validator/index.js";var p={n23mInput:"Input-module_n23mInput__6WopW",n23mInputInput:"Input-module_n23mInputInput__djmAy"};a("@layer n23mInput{.Input-module_n23mInput__6WopW{--iff:-apple-system,BlinkMacSystemFont,avenir next,avenir,segoe ui,helvetica neue,helvetica,Cantarell,Ubuntu,roboto,noto,arial,sans-serif;margin-top:0;&:not(:has(input[type=hidden])){margin-bottom:10px}.Input-module_n23mInputInput__djmAy{display:grid;& input,& textarea{corner-shape:squircle;border:1px solid var(--input-cb,#000);border-radius:12px;box-sizing:border-box;color:var(--input-c,#000);font-family:var(--n23mFontFamily,var(--iff));font-size:16px;font-weight:500;&:disabled{-webkit-text-fill-color:#8a8a8a;background-color:#f3f3f3;border-color:#cfcfcf;color:#8a8a8a;cursor:not-allowed;opacity:1}}& input{height:40px;padding:20px 10px;width:100%}& textarea{field-sizing:content;block-size:100%;max-height:400px;min-height:200px;padding:10px;resize:vertical}&input[type=hidden]{margin:0;padding:0}& ::placeholder{filter:brightness(125%);font-weight:300}}.Input-module_n23mInputError__0yrzG{color:var(--najwer23snacks-input-error-font-color);font-family:var(--najwer23snacks-input-error-font-family);font-size:var(--najwer23snacks-input-error-font-size);font-weight:var(--najwer23snacks-input-error-font-weight);line-height:1;margin:2px}}}");const u=e=>{for(const t of[":autofill",":-webkit-autofill"])try{if(e.matches(t))return!0}catch{}return!1},s=({className:a,style:s,name:c,label:d,inputRef:m,placeholder:f,type:h="text",labelColor:g="black",kind:x="input",inputColor:v,inputColorBorder:b,defaultValue:y,disabled:I,validatorOptions:_,value:C,autoComplete:k,id:j,onBlur:w,onChange:z,step:B,...S})=>{const T=n(null),W=n(null),F=e=>{if(T.current&&(T.current.textContent=""),!_)return;const t=l(e.value,_);t.length>0?(T.current&&(T.current.textContent=t[0]),e.classList.add("error")):e.classList.remove("error")},N=e=>{w?.(e);const t=e.target;document.activeElement!==t&&F(t)},V=e=>{z?.(e);const t=e.target;((e=>{const{inputType:t}=e.nativeEvent;return!t||"insertReplacementText"===t||u(e.target)})(e)||t.classList.contains("error"))&&F(t)};return r(()=>{const e=setTimeout(()=>{const e=W.current?.querySelector("input, textarea");e&&e.value&&u(e)&&F(e)},300);return()=>clearTimeout(e)},[]),e("div",{ref:W,className:[p.n23mInput,"n23mInput",a].filter(Boolean).join(" "),...S,style:{...i({"--input-c":v,"--input-cb":b}),...s},children:["hidden"!==h&&t(o,{mobileSize:14,desktopSize:14,tag:"label",fontWeight:400,color:g,htmlFor:"select"===x?j:c,children:d}),e("div",{className:p.n23mInputInput,children:["input"===x&&t("input",{ref:m,id:c,name:c,type:h,onBlur:N,onChange:V,placeholder:f,defaultValue:y,disabled:I,value:C,autoComplete:k,step:B}),"textarea"===x&&t("textarea",{autoComplete:k,id:c,name:c,onBlur:N,onChange:V,placeholder:f,defaultValue:y,disabled:I,value:C,ref:m}),"select"===x&&t("input",{id:j,autoComplete:"off",ref:m,type:h,onBlur:N,onChange:V,placeholder:f,defaultValue:y,disabled:I,value:C,step:B})]}),"hidden"!==h&&t(o,{ref:T,mobileSize:12,desktopSize:12,tag:"p",fontWeight:400,color:"#ff3333",lineHeight:"14px",margin:"2px 0 2px"})]})};s.displayName="Input";export{s as I};
@@ -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-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
+ 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-CWkGtNHu.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-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
+ export{N as NavigationTabs}from"../NavigationTabs-CWkGtNHu.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 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};
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 d={urlChangeTimeoutMs:1500,settleMs:150,maxWaitMs:4e3},c=n=>/^#!?\//.test(n),h=n=>n.replace(/\/+$/,"")||"/",g=(n,e,a={})=>{const{urlChangeTimeoutMs:t,settleMs:i,maxWaitMs:o}={...d,...a},r=window.location.href,s=performance.now();let m,l,u,c=!1,h=0,g=0;const _=()=>{cancelAnimationFrame(h),cancelAnimationFrame(g),clearTimeout(m),clearTimeout(l),u?.disconnect()},v=()=>{c||(c=!0,_(),g=requestAnimationFrame(()=>{g=requestAnimationFrame(()=>e())}))};l=window.setTimeout(v,o);const p=()=>{clearTimeout(m),m=window.setTimeout(v,i)},b=()=>{if(!c)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),()=>{c=!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:d,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",d].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&&(c(t.hash)||c(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};
@@ -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";
1
+ export{S as Select}from"../Select-QBTZllFj.js";import"react/jsx-runtime";import"react";import"../Input-Bl7_BOs4.js";import"../TextBox-__k4jPYK.js";import"../style-inject.es-CrVRO2OA.js";import"../validator/index.js";
@@ -1 +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};
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-Bl7_BOs4.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:180px;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,z]=t(!1),j=n(null),C=r(),O=l(()=>I?u.filter(e=>e.label.toLowerCase().includes(v.toLowerCase())):u,[u,v,I]);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(),j.current?.focus(),p||(z(!1),y(e=>!e))}}),o(a,{name:d,type:"hidden",kind:"input",validatorOptions:[...b??[],{type:"existsInOptions",options:{options:u,matchBy:"value"}}],value:f}),o(a,{id:C,inputRef:j,label:x,type:"text",kind:"select",disabled:p,placeholder:h,value:v,onChange:e=>{const o=e.currentTarget.value;w(o),k(""),z(!0),y(!0)},onClick:()=>{p||(z(!1),y(!0))},onBlur:e=>{y(!1),z(!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:O.map(e=>o("div",{className:s.dropdownItem,onMouseDown:()=>{(e=>{k(e.value),w(e.label),z(!1),y(!1)})(e)},children:e.label},e.value))})})]})};export{d as S};
@@ -7,7 +7,7 @@ export type TableColumn = {
7
7
  cellName: string;
8
8
  cellType: 'select';
9
9
  options: SelectOption[];
10
- initialValue: SelectOption;
10
+ initialValue?: SelectOption;
11
11
  thAlign?: 'left' | 'right';
12
12
  tdAlign?: 'left' | 'right';
13
13
  } | {
@@ -15,7 +15,7 @@ export type TableColumn = {
15
15
  cellName: string;
16
16
  cellType: 'date';
17
17
  options?: never;
18
- initialValue: '' | `${number}-${number}-${number}`;
18
+ initialValue?: '' | `${number}-${number}-${number}`;
19
19
  thAlign?: 'left' | 'right';
20
20
  tdAlign?: 'left' | 'right';
21
21
  } | {
@@ -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{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:y=!1,isSuccessCellEdit:_=!1,errorMsgCellEdit:j,successMsgCellEdit:C,style:S,...N})=>{const[v,w]=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:v,onCancel:()=>{w(!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:y,isSuccess:_,errorMsg:j,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:e.cellType,step:"number"===e.cellType?.01:void 0,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:y,backgroundColor:"red",backgroundColorDisabled:"grey",onClick:()=>{x&&D&&(x(D.id),w(!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:y,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),w(!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};
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-BkDrBfRy.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 d}from"../Input-Bl7_BOs4.js";import{S as s}from"../Select-QBTZllFj.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"../validator/index.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:y=!1,isSuccessCellEdit:_=!1,errorMsgCellEdit:j,successMsgCellEdit:C,style:S,...N})=>{const[v,w]=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:v,onCancel:()=>{w(!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:y,isSuccess:_,errorMsg:j,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(s,{name:e.cellName,options:e.options,initialValue:a},e.cellName)}return l(d,{label:e.cellText,name:e.cellName,type:e.cellType,step:"number"===e.cellType?.01:void 0,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:y,backgroundColor:"red",backgroundColorDisabled:"grey",onClick:()=>{x&&D&&(x(D.id),w(!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:y,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),w(!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};
@@ -1 +1 @@
1
- export{v as validator}from"../index-uD0K440h.js";
1
+ const e={empty:e=>""===e.trim()||null===e.trim()?"The field cannot be empty.":null,equal:(e,t)=>{const n=t?.ref?.current?.value;return e&&n&&e!==n?"Values do not match.":null},email:e=>/^(?!.*\.{2})(?!.*\.$)(?!^\.)([a-zA-Z0-9._%+-]+)@([a-zA-Z0-9.-]+\.[a-zA-Z]{2,})$/.test(e)?null:"Incorrect email address.",numberInRange:(e,t)=>{const n=Number(e),r=t?.min??0,u=t?.max??1e4;return isNaN(n)||n<r||n>u?`The number must be between ${r} and ${u}.`:null},date:e=>(e=>{const t=/^(\d{4})-(\d{2})-(\d{2})$/.exec(e);if(!t)return!1;const n=Number(t[1]),r=Number(t[2]),u=Number(t[3]);if(r<1||r>12)return!1;const l=[31,28,31,30,31,30,31,31,30,31,30,31];return(n%400==0||n%100!=0&&n%4==0)&&(l[1]=29),u>=1&&u<=l[r-1]})(e)?null:"The date is invalid.",existsInOptions:(e,t)=>{const n=t?.options??[],r=t?.matchBy??"value";return n.some(t=>"value"===r?t.value===e:t.label===e)?null:"Please select a value from the list."},json:e=>{try{const t=JSON.parse(e);return null===t||"object"!=typeof t&&!Array.isArray(t)?"The value must be a valid JSON":null}catch{return"The value must be a valid JSON."}},naturalNumber:e=>{if(!/^([1-9][0-9]*|0)$/.test(e))return"The number must be a natural number (positive integer).";const t=Number(e);return isNaN(t)||t<=0||!Number.isInteger(t)?"The number must be a natural number (positive integer).":null},decimalDigits:(e,t)=>{const n=Number(e);if(isNaN(n))return"The value must be a valid number.";if(void 0===t?.digits)return null;if(!e.includes("."))return`The number must have exactly ${t.digits} digit(s) after the decimal point.`;return e.split(".")[1].length!==t.digits?`The number must have exactly ${t.digits} digit(s) after the decimal point.`:null}},t=(t,n)=>n.map(n=>"options"in n?e[n.type](t,n.options):e[n.type](t)).filter(e=>null!=e);export{t as validator};
@@ -0,0 +1 @@
1
+ export declare const isYYYYMMDD: (inputDate: string) => boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "najwer23morsels",
3
- "version": "1.10.9",
3
+ "version": "1.10.11",
4
4
  "exports": {
5
5
  "./lib/*": {
6
6
  "types": "./lib/*/index.d.ts",
@@ -1 +0,0 @@
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 +0,0 @@
1
- import{jsxs as e,jsx as t}from"react/jsx-runtime";import{useRef as n,useEffect as r}from"react";import{T as a}from"./TextBox-__k4jPYK.js";import{s as o,g as i}from"./style-inject.es-CrVRO2OA.js";import{v as l}from"./index-uD0K440h.js";var p={n23mInput:"Input-module_n23mInput__6WopW",n23mInputInput:"Input-module_n23mInputInput__djmAy"};o("@layer n23mInput{.Input-module_n23mInput__6WopW{--iff:-apple-system,BlinkMacSystemFont,avenir next,avenir,segoe ui,helvetica neue,helvetica,Cantarell,Ubuntu,roboto,noto,arial,sans-serif;margin-top:0;&:not(:has(input[type=hidden])){margin-bottom:10px}.Input-module_n23mInputInput__djmAy{display:grid;& input,& textarea{corner-shape:squircle;border:1px solid var(--input-cb,#000);border-radius:12px;box-sizing:border-box;color:var(--input-c,#000);font-family:var(--n23mFontFamily,var(--iff));font-size:16px;font-weight:500}& input{height:40px;padding:20px 10px;width:100%}& textarea{field-sizing:content;block-size:100%;max-height:400px;min-height:200px;padding:10px;resize:vertical}&input[type=hidden]{margin:0;padding:0}& ::placeholder{filter:brightness(125%);font-weight:300}}.Input-module_n23mInputError__0yrzG{color:var(--najwer23snacks-input-error-font-color);font-family:var(--najwer23snacks-input-error-font-family);font-size:var(--najwer23snacks-input-error-font-size);font-weight:var(--najwer23snacks-input-error-font-weight);line-height:1;margin:2px}}}");const u=e=>{for(const t of[":autofill",":-webkit-autofill"])try{if(e.matches(t))return!0}catch{}return!1},s=({className:o,style:s,name:d,label:m,inputRef:c,placeholder:f,type:h="text",labelColor:g="black",kind:x="input",inputColor:v,inputColorBorder:b,defaultValue:y,disabled:I,validatorOptions:_,value:C,autoComplete:j,id:z,onBlur:k,onChange:w,step:B,...S})=>{const T=n(null),W=n(null),F=e=>{if(T.current&&(T.current.textContent=""),!_)return;const t=l(e.value,_);t.length>0?(T.current&&(T.current.textContent=t[0]),e.classList.add("error")):e.classList.remove("error")},N=e=>{k?.(e);const t=e.target;document.activeElement!==t&&F(t)},V=e=>{w?.(e);const t=e.target;((e=>{const{inputType:t}=e.nativeEvent;return!t||"insertReplacementText"===t||u(e.target)})(e)||t.classList.contains("error"))&&F(t)};return r(()=>{const e=setTimeout(()=>{const e=W.current?.querySelector("input, textarea");e&&e.value&&u(e)&&F(e)},300);return()=>clearTimeout(e)},[]),e("div",{ref:W,className:[p.n23mInput,"n23mInput",o].filter(Boolean).join(" "),...S,style:{...i({"--input-c":v,"--input-cb":b}),...s},children:["hidden"!==h&&t(a,{mobileSize:14,desktopSize:14,tag:"label",fontWeight:400,color:g,htmlFor:"select"===x?z:d,children:m}),e("div",{className:p.n23mInputInput,children:["input"===x&&t("input",{ref:c,id:d,name:d,type:h,onBlur:N,onChange:V,placeholder:f,defaultValue:y,disabled:I,value:C,autoComplete:j,step:B}),"textarea"===x&&t("textarea",{autoComplete:j,id:d,name:d,onBlur:N,onChange:V,placeholder:f,defaultValue:y,disabled:I,value:C,ref:c}),"select"===x&&t("input",{id:z,autoComplete:"off",ref:c,type:h,onBlur:N,onChange:V,placeholder:f,defaultValue:y,disabled:I,value:C,step:B})]}),"hidden"!==h&&t(a,{ref:T,mobileSize:12,desktopSize:12,tag:"p",fontWeight:400,color:"#ff3333",lineHeight:"14px",margin:"2px 0 2px"})]})};s.displayName="Input";export{s as I};
@@ -1 +0,0 @@
1
- const e=(e,t,n)=>{const r=new Date(0);return r.setFullYear(e,t,n),r.setHours(0,0,0,0),r},t=(t,n)=>{const r="string"==typeof t?new Date(t):t,a=r.getFullYear(),l=r.getMonth(),s=e(a,l+1,0).getDate(),u=Math.max(1,Math.min(n,s));return e(a,l,u)},n=e=>{const t="string"==typeof e?new Date(e):e,n=t.getFullYear()-4,r=t.getFullYear()+4;return Array.from({length:r-n+1},(e,t)=>n+t).filter(e=>e>=0)},r=(t,n)=>{const r="string"==typeof t?new Date(t):t,a=n,l=r.getMonth(),s=r.getDate();return e(a,l,s)},a=(t,n)=>{const r="string"==typeof t?new Date(t):t,a=r.getFullYear(),l=r.getMonth()+n,s=r.getDate(),u=e(a,l,s);if(u.getDate()!==s){const t=e(a,l+1,0).getDate();return e(a,l,t)}return u},l=t=>{const n="string"==typeof t?new Date(t):t,r=n.getFullYear(),a=n.getMonth();return e(r,a+1,0).getDate()},s=e=>{const t="string"==typeof e?new Date(e):e;return`${String(t.getFullYear()).padStart(4,"0")}-${String(t.getMonth()+1).padStart(2,"0")}-${String(t.getDate()).padStart(2,"0")}`},u=t=>{const n="string"==typeof t?new Date(t):t,r=n.getDate(),a=((t=>{const n="string"==typeof t?new Date(t):t,r=n.getFullYear(),a=n.getMonth();return e(r,a,1).getDay()})(n)+6)%7,s=l(n);return Array.from({length:s+a},(e,t)=>{let n="",l="";return t<=a-1?(n="",l="blank"):t===r+a-1?(n=String(t-a+1),l="active"):(n=String(t-a+1),l="clickable"),{day:t-a+1,dayValue:n,cssClass:l}})},i=e=>{if("string"==typeof e){if(!/^(\d{4})-(\d{2})-(\d{2})$/.exec(e))return!1}const t="string"==typeof e?new Date(e):e,n=t.getFullYear(),r=t.getMonth(),a=t.getDate();let l=[31,28,31,30,31,30,31,31,30,31,30,31];return(n%400==0||n%100!=0&&n%4==0)&&(l[1]=29),a>0&&a<=l[r]&&10==e.length},o={empty:e=>""===e.trim()||null===e.trim()?"The field cannot be empty.":null,equal:(e,t)=>{const n=t?.ref?.current?.value;return e&&n&&e!==n?"Values do not match.":null},email:e=>/^(?!.*\.{2})(?!.*\.$)(?!^\.)([a-zA-Z0-9._%+-]+)@([a-zA-Z0-9.-]+\.[a-zA-Z]{2,})$/.test(e)?null:"Incorrect email address.",numberInRange:(e,t)=>{const n=Number(e),r=t?.min??0,a=t?.max??1e4;return isNaN(n)||n<r||n>a?`The number must be between ${r} and ${a}.`:null},date:e=>i(e)?null:"The date is invalid.",existsInOptions:(e,t)=>{const n=t?.options??[],r=t?.matchBy??"value";return n.some(t=>"value"===r?t.value===e:t.label===e)?null:"Please select a value from the list."},json:e=>{try{const t=JSON.parse(e);return null===t||"object"!=typeof t&&!Array.isArray(t)?"The value must be a valid JSON":null}catch{return"The value must be a valid JSON."}},naturalNumber:e=>{if(!/^([1-9][0-9]*|0)$/.test(e))return"The number must be a natural number (positive integer).";const t=Number(e);return isNaN(t)||t<=0||!Number.isInteger(t)?"The number must be a natural number (positive integer).":null},decimalDigits:(e,t)=>{const n=Number(e);if(isNaN(n))return"The value must be a valid number.";if(void 0===t?.digits)return null;if(!e.includes("."))return`The number must have exactly ${t.digits} digit(s) after the decimal point.`;return e.split(".")[1].length!==t.digits?`The number must have exactly ${t.digits} digit(s) after the decimal point.`:null}},g=(e,t)=>t.map(t=>"options"in t?o[t.type](e,t.options):o[t.type](e)).filter(e=>null!=e);export{u as a,n as b,l as c,r as d,a as e,t as f,s as g,i,g as v};