ezux 1.1.11 → 1.1.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{EzContextMenu-C3eDRS7E.cjs → EzContextMenu-B6HBUjWv.cjs} +1 -1
- package/dist/{EzContextMenu-BsHdOgtL.js → EzContextMenu-BSA_B6Pr.js} +1 -1
- package/dist/{EzEventModal-FP2rs1pp.js → EzEventModal-BUMp_BFi.js} +6 -6
- package/dist/{EzEventModal-DkowH9rh.cjs → EzEventModal-xzHfzi0O.cjs} +1 -1
- package/dist/{EzGroupingPanel-DuKrZuqq.js → EzGroupingPanel-BUsIYDRi.js} +5 -5
- package/dist/EzGroupingPanel-D0HdSomF.cjs +1 -0
- package/dist/{EzSchedulerQuickAdd-s2jtG8vH.js → EzSchedulerQuickAdd-C653LTGh.js} +5 -5
- package/dist/{EzSchedulerQuickAdd-BLF22CDh.cjs → EzSchedulerQuickAdd-UnOWCpJd.cjs} +1 -1
- package/dist/{EzSchedulerToolbar-CaVVmnjt.cjs → EzSchedulerToolbar-C-5OdRY6.cjs} +1 -1
- package/dist/{EzSchedulerToolbar-tz6h80GC.js → EzSchedulerToolbar-CO5jjDQg.js} +15 -15
- package/dist/{EzSignature-CPoQLAyS.cjs → EzSignature-BaNesxwC.cjs} +1 -1
- package/dist/{EzSignature-D7134EQo.js → EzSignature-D4EYwo9W.js} +2 -2
- package/dist/{EzTableEditDialog-3eU6i9cv.js → EzTableEditDialog-Cd948V1C.js} +3 -3
- package/dist/{EzTableEditDialog-ftpeOKI_.cjs → EzTableEditDialog-NiOubaMT.cjs} +1 -1
- package/dist/{EzTableFooter-BiyI1m1O.cjs → EzTableFooter-CWjfGCjL.cjs} +1 -1
- package/dist/{EzTableFooter-DuAaOcLd.js → EzTableFooter-DveD12RC.js} +1 -1
- package/dist/{EzTableToolbar-DmAb94U-.js → EzTableToolbar-Bz8UWv6j.js} +50 -54
- package/dist/EzTableToolbar-DHE7Bb1R.cjs +1 -0
- package/dist/{HighlightText-C0sUEoCH.js → HighlightText-8D6KEyBw.js} +9 -11
- package/dist/HighlightText-LtZmzCle.cjs +1 -0
- package/dist/{NotificationPanel-xjIHKnlE.js → NotificationPanel-D2Y-_ahk.js} +3 -3
- package/dist/NotificationPanel-zLxrtTGf.cjs +1 -0
- package/dist/{TooltipWrapper-Bv7F-Gk4.js → TooltipWrapper-BrRTi5EJ.js} +1 -1
- package/dist/{TooltipWrapper-CgYlx0Jq.cjs → TooltipWrapper-DWts4bAI.cjs} +1 -1
- package/dist/{avatar-BkA_3sri.js → avatar-BeK0E4mn.js} +1 -1
- package/dist/{avatar-CJH7L2Or.cjs → avatar-DZAaTK2f.cjs} +1 -1
- package/dist/bell-DAz8P0BR.js +14 -0
- package/dist/bell-DOX2y38e.cjs +1 -0
- package/dist/{calendar-ChRJyGvt.cjs → calendar-BMZ8ddOf.cjs} +1 -1
- package/dist/{calendar-CCxXqG5a.js → calendar-Dy3rVMW2.js} +4 -4
- package/dist/{checkbox-_Uxyw6xN.cjs → checkbox-B0lGHUyy.cjs} +1 -1
- package/dist/{checkbox-DTLp-Oqj.js → checkbox-boJRxICT.js} +1 -1
- package/dist/circle-x-Cv7bfIC_.js +9 -0
- package/dist/circle-x-DwVXxhXr.cjs +1 -0
- package/dist/{date-time-picker-BPwpIWxg.cjs → date-time-picker-DTxHdPgQ.cjs} +1 -1
- package/dist/{date-time-picker-B9QBboUX.js → date-time-picker-Dj2eftJI.js} +6 -6
- package/dist/ezux.css +1 -1
- package/dist/grip-vertical-CSyDKBul.js +12 -0
- package/dist/grip-vertical-DZNBW1Dn.cjs +1 -0
- package/dist/{index-BmjgUrNF.cjs → index-B3ipEEhH.cjs} +2 -2
- package/dist/index-BPPb7bcs.js +3220 -0
- package/dist/{index-pr_yrvsV.js → index-BQKw_Vho.js} +4026 -1904
- package/dist/{index-B7foCkRR.js → index-C5STgBSy.js} +678 -677
- package/dist/{index-CpEN0z3t.js → index-C6NfgycP.js} +357 -357
- package/dist/index-D4f2ZdrG.cjs +2 -0
- package/dist/index-DUY1SqMo.cjs +1 -0
- package/dist/index-c1Zg--dt.cjs +7 -0
- package/dist/index.cjs +2 -2
- package/dist/index.d.ts +67 -14
- package/dist/index.es.js +136 -135
- package/dist/{input-D1zXv4Kl.cjs → input-BgM_la4k.cjs} +1 -1
- package/dist/{input-DG8ycH6m.js → input-jYQ5VKNR.js} +1 -1
- package/dist/{isBefore-DdLSsf0_.js → isBefore-C3Y_wbk3.js} +1 -1
- package/dist/{isBefore-BAixcVtb.cjs → isBefore-Cp1ttk6q.cjs} +1 -1
- package/dist/kanban.cjs +1 -1
- package/dist/kanban.es.js +4 -4
- package/dist/{label-Ch1wkGGP.js → label-ClOW9UCt.js} +2 -2
- package/dist/{label-DrUloKDN.cjs → label-Dx6oDB-X.cjs} +1 -1
- package/dist/layout.cjs +1 -1
- package/dist/layout.d.ts +29 -1
- package/dist/layout.es.js +3 -3
- package/dist/{popover-4Ng-GmwM.cjs → popover-BJq1CKmi.cjs} +1 -1
- package/dist/{popover-DstiJFa3.js → popover-Cmlb7w3R.js} +1 -1
- package/dist/scheduler.cjs +1 -1
- package/dist/scheduler.es.js +5 -5
- package/dist/{scroll-area-mGPAChYm.js → scroll-area-9fwpVNxT.js} +1 -1
- package/dist/{scroll-area-B_yufXtG.cjs → scroll-area-CwwZSSA4.cjs} +1 -1
- package/dist/select-GxA46anr.cjs +1 -0
- package/dist/select-mDCun_IR.js +35 -0
- package/dist/{settings-HCrwja-A.js → settings-CvyjK75A.js} +14 -14
- package/dist/settings-DKPknrt8.cjs +1 -0
- package/dist/signature.cjs +1 -1
- package/dist/signature.es.js +1 -1
- package/dist/{sortable.esm-DDmDbyCC.cjs → sortable.esm-CsRPuXyD.cjs} +1 -1
- package/dist/{sortable.esm-eBjUK76c.js → sortable.esm-CzMCDPet.js} +1 -1
- package/dist/table.cjs +1 -1
- package/dist/table.d.ts +18 -0
- package/dist/table.es.js +10 -9
- package/dist/theme-vars.css +2 -2
- package/dist/{tooltip-CDLAzCi8.cjs → tooltip-B41iztKT.cjs} +1 -1
- package/dist/{tooltip-C216fkmP.js → tooltip-BCtrEe0z.js} +1 -1
- package/dist/treeview.cjs +1 -2
- package/dist/treeview.es.js +558 -543
- package/dist/{useInitCoreServices-DSudhSFo.cjs → useInitCoreServices-CwXv2p4S.cjs} +1 -1
- package/dist/{useInitCoreServices-BC7QMeLn.js → useInitCoreServices-D1WaWlaI.js} +4 -3
- package/dist/{useService-DBnjCLOu.cjs → useService-8OoezWr8.cjs} +1 -1
- package/dist/{useService-BKWyN7jJ.js → useService-BUi3uAqE.js} +1 -1
- package/dist/{useServiceState-MlrHzngO.cjs → useServiceState-BjpCjUn2.cjs} +1 -1
- package/dist/{useServiceState-DWb3cncq.js → useServiceState-VE-viK8b.js} +1 -1
- package/package.json +21 -20
- package/dist/EzGroupingPanel-Dw4bbefz.cjs +0 -1
- package/dist/EzTableToolbar-qlNVxvsL.cjs +0 -1
- package/dist/HighlightText-BDclEh_K.cjs +0 -1
- package/dist/NotificationPanel-juBrjjOY.cjs +0 -1
- package/dist/index-BKsqtcvu.cjs +0 -2
- package/dist/index-D2HX-sbl.js +0 -3092
- package/dist/index-DEIRrhVY.cjs +0 -1
- package/dist/index-DGhcUfqi.cjs +0 -7
- package/dist/info-BY2cfl1l.cjs +0 -1
- package/dist/info-BuURqzhx.js +0 -14
- package/dist/select-BxcAKVaB.cjs +0 -1
- package/dist/select-BxiFqo8j.js +0 -35
- package/dist/settings-BuS8Pqjb.cjs +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const c=require("react"),We=require("@tanstack/react-virtual"),Z=require("./useInitCoreServices-
|
|
1
|
+
"use strict";const c=require("react"),We=require("@tanstack/react-virtual"),Z=require("./useInitCoreServices-CwXv2p4S.cjs"),Ut=require("@tanstack/virtual-core"),M=require("./EzErrorBoundary-CEdz_hDo.cjs"),Ae=require("react-dom"),g=require("react/jsx-runtime");function pr(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const E=pr(c);class vr{name="VirtualizationService";virtualizers=new Map;createVirtualizer(t,n){const r=new Ut.Virtualizer({count:n.count,getScrollElement:n.getScrollElement,estimateSize:n.estimateSize,overscan:n.overscan??5,horizontal:n.horizontal??!1,scrollToFn:Ut.elementScroll,observeElementRect:(o,s)=>{const a=o.scrollElement;if(!a||a===window)return;const i=new ResizeObserver(l=>{s(l[0].contentRect)});return i.observe(a),()=>i.disconnect()},observeElementOffset:(o,s)=>{const a=o.scrollElement;if(!a)return;const i=()=>{s(a===window?window.scrollY:a.scrollTop,!0)};return a.addEventListener("scroll",i,{passive:!0}),s(a===window?window.scrollY:a.scrollTop,!1),()=>a.removeEventListener("scroll",i)}});return this.virtualizers.set(t,r),r}registerVirtualizer(t,n){this.virtualizers.set(t,n)}getVirtualizer(t){return this.virtualizers.get(t)}cleanup(){this.virtualizers.clear()}}const br=e=>{const{rowCount:t,rowHeight:n=48,overscanCount:r=5,enableRowVirtualization:o=!0,columnCount:s=0,columnWidth:a=150,enableColumnVirtualization:i=!1,scrollMargin:l=0,scrollPaddingStart:u=0,scrollPaddingEnd:f=0,progressiveRendering:d=!1,prefetchDistance:h=5,adaptiveSizing:p=!1,languageDirection:R="ltr",debug:v=!1,customRangeExtractor:b,onScroll:y,onScrollStart:w,onScrollStop:C}=e,A=c.useRef(null),[S,D]=c.useState(d?1:r||h),x=c.useRef(null),m=c.useRef(null),N=c.useRef(!1),z="lanugageDirection";c.useEffect(()=>{if(!d)return;let T;const k=()=>{D(1),clearTimeout(T),T=setTimeout(()=>{D(r||h)},150)},se=A.current;if(se)return se.addEventListener("scroll",k,{passive:!0}),()=>{se.removeEventListener("scroll",k),clearTimeout(T)}},[d,r,h]);const O=c.useMemo(()=>b||(T=>{const k=We.defaultRangeExtractor(T);return k.length===0&&T.count>0?[0]:k}),[b]),U=c.useCallback((T,k,se)=>{We.elementScroll(T,k,se)},[]),Y=c.useMemo(()=>({count:t,getScrollElement:()=>A.current,estimateSize:typeof n=="function"?n:()=>n,overscan:S,scrollMargin:l,scrollPaddingStart:u,scrollPaddingEnd:f,rangeExtractor:O,scrollToFn:U,[z]:R,onChange:T=>{const k=T.scrollOffset??0;m.current!==null&&cancelAnimationFrame(m.current),m.current=requestAnimationFrame(()=>{y?.(k),m.current=null}),T.isScrolling?N.current||(N.current=!0,w?.()):N.current&&(N.current=!1,C?.())}}),[t,n,S,p,l,u,f,O,U,y,w,C]),I=We.useVirtualizer(Y);c.useEffect(()=>{v&&console.log("[DEBUG_VIRTUAL] Virtualizer instance changed")},[I,v]);const $e=Z.useEzServiceRegistry(),pe=c.useMemo(()=>M.getOrRegisterService($e,"VirtualizationService",()=>new vr),[]);c.useEffect(()=>{e.id&&pe&&pe.registerVirtualizer(e.id,I)},[e.id,I,pe]);const W=c.useMemo(()=>({horizontal:!0,count:i&&s?s:0,getScrollElement:()=>A.current,estimateSize:typeof a=="function"?a:()=>a,overscan:S,rangeExtractor:O,[z]:R}),[i,s,a,S,O]),Ue=We.useVirtualizer(W),H=i&&s?Ue:void 0;c.useEffect(()=>()=>{x.current&&clearTimeout(x.current),m.current!==null&&cancelAnimationFrame(m.current)},[]),c.useEffect(()=>{v&&process.env.NODE_ENV!=="production"&&console.log("Virtualization Debug:",{rowCount:t,visibleRows:I.getVirtualItems().length,activeOverscan:S,scrollOffset:I.scrollOffset})},[v,t,I,S]);const ve=(T,k)=>{I.scrollToIndex(T,k)};return{parentRef:A,rowVirtualizer:I,columnVirtualizer:H,scrollToIndex:ve,scrollToRow:ve,scrollToColumn:H?(T,k)=>{H.scrollToIndex(T,k)}:void 0,getVirtualItems:()=>I.getVirtualItems(),scrollOffset:I.scrollOffset??0}};function mr(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return c.useMemo(()=>r=>{t.forEach(o=>o(r))},t)}const nt=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Se(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function Ct(e){return"nodeType"in e}function B(e){var t,n;return e?Se(e)?e:Ct(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function wt(e){const{Document:t}=B(e);return e instanceof t}function Ke(e){return Se(e)?!1:e instanceof B(e).HTMLElement}function on(e){return e instanceof B(e).SVGElement}function Re(e){return e?Se(e)?e.document:Ct(e)?wt(e)?e:Ke(e)||on(e)?e.ownerDocument:document:document:document}const ne=nt?c.useLayoutEffect:c.useEffect;function rt(e){const t=c.useRef(e);return ne(()=>{t.current=e}),c.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t.current==null?void 0:t.current(...r)},[])}function xr(){const e=c.useRef(null),t=c.useCallback((r,o)=>{e.current=setInterval(r,o)},[]),n=c.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function je(e,t){t===void 0&&(t=[e]);const n=c.useRef(e);return ne(()=>{n.current!==e&&(n.current=e)},t),n}function Be(e,t){const n=c.useRef();return c.useMemo(()=>{const r=e(n.current);return n.current=r,r},[...t])}function Je(e){const t=rt(e),n=c.useRef(null),r=c.useCallback(o=>{o!==n.current&&t?.(o,n.current),n.current=o},[]);return[n,r]}function Qe(e){const t=c.useRef();return c.useEffect(()=>{t.current=e},[e]),t.current}let ht={};function Fe(e,t){return c.useMemo(()=>{if(t)return t;const n=ht[e]==null?0:ht[e]+1;return ht[e]=n,e+"-"+n},[e,t])}function sn(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return r.reduce((s,a)=>{const i=Object.entries(a);for(const[l,u]of i){const f=s[l];f!=null&&(s[l]=f+e*u)}return s},{...t})}}const Ce=sn(1),Le=sn(-1);function yr(e){return"clientX"in e&&"clientY"in e}function ot(e){if(!e)return!1;const{KeyboardEvent:t}=B(e.target);return t&&e instanceof t}function Cr(e){if(!e)return!1;const{TouchEvent:t}=B(e.target);return t&&e instanceof t}function Ze(e){if(Cr(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return yr(e)?{x:e.clientX,y:e.clientY}:null}const we=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[we.Translate.toString(e),we.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),Xt="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function wr(e){return e.matches(Xt)?e:e.querySelector(Xt)}const Sr={display:"none"};function Rr(e){let{id:t,value:n}=e;return c.createElement("div",{id:t,style:Sr},n)}function Mr(e){let{id:t,announcement:n,ariaLiveType:r="assertive"}=e;const o={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return c.createElement("div",{id:t,style:o,role:"status","aria-live":r,"aria-atomic":!0},n)}function Er(){const[e,t]=c.useState("");return{announce:c.useCallback(r=>{r!=null&&t(r)},[]),announcement:e}}const an=c.createContext(null);function Dr(e){const t=c.useContext(an);c.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function Nr(){const[e]=c.useState(()=>new Set),t=c.useCallback(r=>(e.add(r),()=>e.delete(r)),[e]);return[c.useCallback(r=>{let{type:o,event:s}=r;e.forEach(a=>{var i;return(i=a[o])==null?void 0:i.call(a,s)})},[e]),t]}const Or={draggable:`
|
|
2
2
|
To pick up a draggable item, press the space bar.
|
|
3
3
|
While dragging, use the arrow keys to move the item.
|
|
4
4
|
Press space again to drop the item in its new position, or press escape to cancel.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as R from "react";
|
|
2
2
|
import P, { useRef as N, useState as X, useEffect as E, useMemo as M, useCallback as V, useLayoutEffect as mr, createContext as je, memo as br, useReducer as xr, useContext as we, cloneElement as yr, forwardRef as wr } from "react";
|
|
3
3
|
import { defaultRangeExtractor as Cr, elementScroll as Sr, useVirtualizer as qt } from "@tanstack/react-virtual";
|
|
4
|
-
import { u as dn, c as le } from "./useInitCoreServices-
|
|
4
|
+
import { u as dn, c as le } from "./useInitCoreServices-D1WaWlaI.js";
|
|
5
5
|
import { Virtualizer as Rr, elementScroll as Dr } from "@tanstack/virtual-core";
|
|
6
6
|
import { g as Er, f as Mr, R as Nr, A as Ar, P as Or, e as Le, l as fn, m as Tr, n as zr, S as Ir, I as Pr, d as Lr, G as kr, q as _r, i as Br, r as Fr, o as $r, p as Vr, L as jr, s as Ur, t as Xr, v as Gr, w as Yr, x as Kr, y as Wr, C as Hr } from "./EzErrorBoundary-D4NBadES.js";
|
|
7
7
|
import { unstable_batchedUpdates as Qe, createPortal as qr } from "react-dom";
|
|
@@ -2,12 +2,12 @@ import { jsxs as a, jsx as r, Fragment as E } from "react/jsx-runtime";
|
|
|
2
2
|
import { useEffect as A } from "react";
|
|
3
3
|
import { useForm as z } from "@tanstack/react-form";
|
|
4
4
|
import { createPortal as S } from "react-dom";
|
|
5
|
-
import { B as u, X as T } from "./tooltip-
|
|
6
|
-
import { I as v } from "./input-
|
|
7
|
-
import { L as o } from "./label-
|
|
8
|
-
import { c as h } from "./useInitCoreServices-
|
|
9
|
-
import { D as x, P as f } from "./date-time-picker-
|
|
10
|
-
import { T as I } from "./calendar-
|
|
5
|
+
import { B as u, X as T } from "./tooltip-BCtrEe0z.js";
|
|
6
|
+
import { I as v } from "./input-jYQ5VKNR.js";
|
|
7
|
+
import { L as o } from "./label-ClOW9UCt.js";
|
|
8
|
+
import { c as h } from "./useInitCoreServices-D1WaWlaI.js";
|
|
9
|
+
import { D as x, P as f } from "./date-time-picker-Dj2eftJI.js";
|
|
10
|
+
import { T as I } from "./calendar-Dy3rVMW2.js";
|
|
11
11
|
const B = [
|
|
12
12
|
{ label: "S", value: "SU" },
|
|
13
13
|
{ label: "M", value: "MO" },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),k=require("react"),F=require("@tanstack/react-form"),D=require("react-dom"),c=require("./tooltip-CDLAzCi8.cjs"),b=require("./input-D1zXv4Kl.cjs"),i=require("./label-DrUloKDN.cjs"),x=require("./useInitCoreServices-DSudhSFo.cjs"),m=require("./date-time-picker-BPwpIWxg.cjs"),E=require("./calendar-ChRJyGvt.cjs"),A=[{label:"S",value:"SU"},{label:"M",value:"MO"},{label:"T",value:"TU"},{label:"W",value:"WE"},{label:"T",value:"TH"},{label:"F",value:"FR"},{label:"S",value:"SA"}],z=({isOpen:h,onClose:u,mode:d,event:n,onSave:C,onDelete:v,locale:p,editorTemplate:f,headerTemplate:j,footerTemplate:y})=>{const a=F.useForm({defaultValues:{title:n?.title||"",start:n?.start,end:n?.end,resourceIds:n?.resourceIds||(n?.resourceId?[n.resourceId]:[])||[],location:n?.location||"",isAllDay:!!n?.allDay||!!n?.isAllDay||!1,description:n?.description||"",isTimezoneEnabled:!!n?.timezone,startTimezone:n?.timezone?.start||"Asia/Calcutta",endTimezone:n?.timezone?.end||"Asia/Calcutta",repeatFrequency:n?.recurrence?.frequency||"Never",repeatInterval:n?.recurrence?.interval||1,repeatDays:n?.recurrence?.days||[],repeatBy:n?.recurrence?.repeatBy||"day",repeatEndLevel:n?.recurrence?.end||"Never",repeatEndCount:n?.recurrence?.endCount||1,repeatEndUntil:n?.recurrence?.endUntil,attachments:n?.attachments||[]},onSubmit:async({value:r})=>{C({...n,title:r.title,start:r.start,end:r.end,resourceId:r.resourceIds[0],resourceIds:r.resourceIds,location:r.location,allDay:r.isAllDay,description:r.description,timezone:r.isTimezoneEnabled?{start:r.startTimezone,end:r.endTimezone}:void 0,recurrence:r.repeatFrequency!=="Never"?{frequency:r.repeatFrequency,interval:r.repeatInterval,unit:r.repeatFrequency.replace("ly","")+"(s)",end:r.repeatEndLevel,endCount:r.repeatEndLevel==="Count"?r.repeatEndCount:void 0,endUntil:r.repeatEndLevel==="Until"?r.repeatEndUntil:void 0,days:r.repeatFrequency==="Weekly"?r.repeatDays:void 0,repeatBy:r.repeatFrequency==="Monthly"||r.repeatFrequency==="Yearly"?r.repeatBy:void 0}:void 0,attachments:r.attachments}),u()}});if(k.useEffect(()=>{h&&a.reset()},[h,n,a]),!h)return null;const N=r=>{r.preventDefault(),r.stopPropagation(),a.handleSubmit()},o=d==="view",w=e.jsxs("div",{"data-testid":"ez-event-modal",style:{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",zIndex:1e4,backgroundColor:"rgba(0, 0, 0, 0.4)",backdropFilter:"blur(2px)",pointerEvents:"auto"},children:[e.jsx("div",{style:{position:"absolute",inset:0},onClick:u}),e.jsxs("div",{className:x.cn("bg-background rounded-xl shadow-2xl flex flex-col border border-border overflow-hidden","animate-in zoom-in-95 fade-in duration-300 ease-out"),style:{backgroundColor:"white",width:"650px",maxWidth:"95vw",maxHeight:"92vh",position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",zIndex:10001},children:[e.jsx("div",{className:"flex items-center justify-between shrink-0 bg-background",style:{padding:"16px 40px"},children:j?j(n||{},d):e.jsxs(e.Fragment,{children:[e.jsxs("h2",{className:"text-xl font-bold tracking-tight text-foreground",children:[d==="create"&&"New Event",d==="edit"&&"Edit Event",d==="view"&&"Event Details"]}),e.jsx(c.Button,{variant:"ghost",size:"icon",className:"h-9 w-9 rounded-full hover:bg-muted text-muted-foreground mr-[-8px]",onClick:u,children:e.jsx(c.X,{className:"w-5 h-5"})})]})}),f?e.jsx("div",{className:"overflow-y-auto custom-scrollbar flex-1 bg-background",style:{padding:"8px 40px 32px 40px"},children:f(n||{})}):e.jsxs("form",{onSubmit:N,className:"space-y-6 overflow-y-auto custom-scrollbar flex-1 bg-background",style:{padding:"8px 40px 32px 40px"},children:[e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[e.jsx(a.Field,{name:"title",validators:{onChange:({value:r})=>r?void 0:"Title is required"},children:r=>e.jsxs("div",{className:"space-y-2",children:[e.jsx(i.Label,{htmlFor:"title",className:"text-[13px] font-semibold text-foreground/70",children:"Title"}),e.jsx(b.Input,{id:"title",placeholder:"Add title",value:r.state.value,onChange:t=>r.handleChange(t.target.value),onBlur:r.handleBlur,disabled:o,className:x.cn("h-10 rounded-md border-border focus-visible:border-primary focus-visible:ring-1 focus-visible:ring-primary/20 bg-background transition-all",r.state.meta.errors.length>0&&"border-destructive focus-visible:border-destructive ring-destructive/20")}),r.state.meta.errors.length>0&&e.jsx("p",{className:"text-[12px] font-medium text-destructive mt-1.5 animate-in fade-in slide-in-from-top-1",children:r.state.meta.errors.join(", ")})]})}),e.jsx(a.Field,{name:"location",children:r=>e.jsxs("div",{className:"space-y-2",children:[e.jsx(i.Label,{htmlFor:"location",className:"text-[13px] font-semibold text-foreground/70",children:"Location"}),e.jsx(b.Input,{id:"location",placeholder:"Add location",value:r.state.value,onChange:t=>r.handleChange(t.target.value),disabled:o,className:"h-10 rounded-md border-border focus-visible:border-primary focus-visible:ring-1 focus-visible:ring-primary/20 bg-background transition-all"})]})})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[e.jsx(a.Field,{name:"start",validators:{onChange:({value:r})=>r?void 0:"Start date is required"},children:r=>e.jsxs("div",{className:"space-y-2",children:[e.jsx(i.Label,{className:"text-[13px] font-semibold text-foreground/70",children:"Start"}),e.jsx(m.DateTimePicker,{date:r.state.value,setDate:t=>r.handleChange(t),disabled:o,required:!0,locale:p,mode:a.getFieldValue("isAllDay")?"date":"datetime",className:"border-border focus-visible:border-primary focus-visible:ring-1 focus-visible:ring-primary/20"}),r.state.meta.errors.length>0&&e.jsx("p",{className:"text-[12px] font-medium text-destructive mt-1.5",children:r.state.meta.errors.join(", ")})]})}),e.jsx(a.Field,{name:"end",validators:{onChange:({value:r,fieldApi:t})=>{if(!r)return"End date is required";const s=t.form.getFieldValue("start");if(s&&r<=s)return"End time must be after start time"}},children:r=>e.jsxs("div",{className:"space-y-2",children:[e.jsx(i.Label,{className:"text-[13px] font-semibold text-foreground/70",children:"End"}),e.jsx(m.DateTimePicker,{date:r.state.value,setDate:t=>r.handleChange(t),disabled:o,required:!0,locale:p,mode:a.getFieldValue("isAllDay")?"date":"datetime",minDate:a.getFieldValue("start"),className:x.cn("border-border focus-visible:border-primary focus-visible:ring-1 focus-visible:ring-primary/20",r.state.meta.errors.length>0&&"border-destructive focus-visible:border-destructive ring-destructive/20")}),r.state.meta.errors.length>0&&e.jsx("p",{className:"text-[12px] font-medium text-destructive mt-1.5 animate-in fade-in slide-in-from-top-1",children:r.state.meta.errors.join(", ")})]})})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[e.jsx(a.Field,{name:"isAllDay",children:r=>e.jsx("div",{className:"flex items-center h-10",children:e.jsxs("label",{className:"flex items-center space-x-3 cursor-pointer group select-none",children:[e.jsx("input",{type:"checkbox",checked:r.state.value,onChange:t=>r.handleChange(t.target.checked),disabled:o,className:"h-4 w-4 rounded border-border/50 text-primary focus:ring-primary/30 accent-primary transition-all cursor-pointer"}),e.jsx("span",{className:"text-[14px] font-medium text-foreground/70 group-hover:text-foreground",children:"All day event"})]})})}),e.jsx(a.Field,{name:"isTimezoneEnabled",children:r=>e.jsx("div",{className:"flex items-center h-10",children:e.jsxs("label",{className:"flex items-center space-x-3 cursor-pointer group select-none",children:[e.jsx("input",{type:"checkbox",checked:r.state.value,onChange:t=>r.handleChange(t.target.checked),disabled:o,className:"h-4 w-4 rounded border-border/50 text-primary focus:ring-primary/30 accent-primary transition-all cursor-pointer"}),e.jsx("span",{className:"text-[14px] font-medium text-foreground/70 group-hover:text-foreground",children:"Enable timezone"})]})})})]}),e.jsx(a.Subscribe,{selector:r=>[r.values.isTimezoneEnabled],children:([r])=>r&&e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6 p-6 bg-highlight/50 rounded-lg border border-border animate-in slide-in-from-top-2 duration-300",children:[e.jsx(a.Field,{name:"startTimezone",children:t=>e.jsxs("div",{className:"space-y-2",children:[e.jsx(i.Label,{className:"text-[13px] font-semibold text-foreground/70",children:"Start Timezone"}),e.jsxs("select",{className:"w-full h-10 px-3 rounded-md border-border bg-background text-sm focus:outline-none focus-visible:ring-1 focus-visible:ring-primary/20 focus-visible:border-primary appearance-none bg-[url('data:image/svg+xml;charset=utf-8,%3Csvg%20xlmns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20fill%3D%27none%27%20viewBox%3D%270%200%2020%2020%27%3E%3Cpath%20stroke%3D%27%236b7280%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%20stroke-width%3D%271.5%27%20d%3D%27m6%208%204%204%204-4%27%2F%3E%3C%2Fsvg%3E')] bg-[length:20px] bg-[right_8px_center] bg-no-repeat transition-all",value:t.state.value,onChange:s=>t.handleChange(s.target.value),children:[e.jsx("option",{value:"Asia/Calcutta",children:"Asia/Calcutta"}),e.jsx("option",{value:"UTC",children:"UTC"}),e.jsx("option",{value:"America/New_York",children:"America/New_York"})]})]})}),e.jsx(a.Field,{name:"endTimezone",children:t=>e.jsxs("div",{className:"space-y-2",children:[e.jsx(i.Label,{className:"text-[13px] font-semibold text-foreground/70",children:"End Timezone"}),e.jsxs("select",{className:"w-full h-10 px-3 rounded-md border-border bg-background text-sm focus:outline-none focus-visible:ring-1 focus-visible:ring-primary/20 focus-visible:border-primary appearance-none bg-[url('data:image/svg+xml;charset=utf-8,%3Csvg%20xlmns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20fill%3D%27none%27%20viewBox%3D%270%200%2020%2020%27%3E%3Cpath%20stroke%3D%27%236b7280%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%20stroke-width%3D%271.5%27%20d%3D%27m6%208%204%204%204-4%27%2F%3E%3C%2Fsvg%3E')] bg-[length:20px] bg-[right_8px_center] bg-no-repeat transition-all",value:t.state.value,onChange:s=>t.handleChange(s.target.value),children:[e.jsx("option",{value:"Asia/Calcutta",children:"Asia/Calcutta"}),e.jsx("option",{value:"UTC",children:"UTC"}),e.jsx("option",{value:"America/New_York",children:"America/New_York"})]})]})})]})}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[e.jsx(a.Field,{name:"repeatFrequency",children:r=>e.jsxs("div",{className:"space-y-2",children:[e.jsx(i.Label,{className:"text-[13px] font-semibold text-foreground/70",children:"Repeat"}),e.jsxs("select",{className:"w-full h-10 px-3 rounded-md border-border bg-background text-sm focus:outline-none focus-visible:ring-1 focus-visible:ring-primary/20 focus-visible:border-primary appearance-none bg-[url('data:image/svg+xml;charset=utf-8,%3Csvg%20xlmns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20fill%3D%27none%27%20viewBox%3D%270%200%2020%2020%27%3E%3Cpath%20stroke%3D%27%236b7280%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%20stroke-width%3D%271.5%27%20d%3D%27m6%208%204%204%204-4%27%2F%3E%3C%2Fsvg%3E')] bg-[length:20px] bg-[right_8px_center] bg-no-repeat transition-all",value:r.state.value,onChange:t=>r.handleChange(t.target.value),children:[e.jsx("option",{value:"Never",children:"Never"}),e.jsx("option",{value:"Daily",children:"Daily"}),e.jsx("option",{value:"Weekly",children:"Weekly"}),e.jsx("option",{value:"Monthly",children:"Monthly"}),e.jsx("option",{value:"Yearly",children:"Yearly"})]})]})}),e.jsx(a.Subscribe,{selector:r=>[r.values.repeatFrequency],children:([r])=>r!=="Never"&&e.jsx(a.Field,{name:"repeatEndLevel",children:t=>e.jsxs("div",{className:"space-y-2 animate-in slide-in-from-top-2 duration-300",children:[e.jsx(i.Label,{className:"text-[13px] font-semibold text-foreground/70",children:"End"}),e.jsxs("select",{className:"w-full h-10 px-3 rounded-md border-border bg-background text-sm focus:outline-none focus-visible:ring-1 focus-visible:ring-primary/20 focus-visible:border-primary appearance-none bg-[url('data:image/svg+xml;charset=utf-8,%3Csvg%20xlmns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20fill%3D%27none%27%20viewBox%3D%270%200%2020%2020%27%3E%3Cpath%20stroke%3D%27%236b7280%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%20stroke-width%3D%271.5%27%20d%3D%27m6%208%204%204%204-4%27%2F%3E%3C%2Fsvg%3E')] bg-[length:20px] bg-[right_8px_center] bg-no-repeat transition-all",value:t.state.value,onChange:s=>t.handleChange(s.target.value),children:[e.jsx("option",{value:"Never",children:"Never"}),e.jsx("option",{value:"Until",children:"Until"}),e.jsx("option",{value:"Count",children:"Count"})]})]})})})]}),e.jsx(a.Subscribe,{selector:r=>[r.values.repeatFrequency,r.values.repeatEndLevel],children:([r,t])=>r!=="Never"&&e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6 animate-in slide-in-from-top-2 duration-300",children:[e.jsx(a.Field,{name:"repeatInterval",children:s=>e.jsxs("div",{className:"space-y-2",children:[e.jsx(i.Label,{className:"text-[13px] font-semibold text-foreground/70",children:"Repeat every"}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("select",{className:"flex-1 h-10 px-3 rounded-md border-border bg-background text-sm focus:outline-none focus-visible:ring-1 focus-visible:ring-primary/20 focus-visible:border-primary appearance-none bg-[url('data:image/svg+xml;charset=utf-8,%3Csvg%20xlmns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20fill%3D%27none%27%20viewBox%3D%270%200%2020%2020%27%3E%3Cpath%20stroke%3D%27%236b7280%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%20stroke-width%3D%271.5%27%20d%3D%27m6%208%204%204%204-4%27%2F%3E%3C%2Fsvg%3E')] bg-[length:20px] bg-[right_8px_center] bg-no-repeat transition-all",value:s.state.value,onChange:l=>s.handleChange(parseInt(l.target.value)),children:[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,20,30].map(l=>e.jsx("option",{value:l,children:l},l))}),e.jsx("span",{className:"text-sm font-medium text-muted-foreground whitespace-nowrap",children:r==="Daily"?"Day(s)":r.replace("ly","")+"(s)"})]})]})}),t==="Until"&&e.jsx(a.Field,{name:"repeatEndUntil",children:s=>e.jsxs("div",{className:"space-y-2 animate-in slide-in-from-top-1",children:[e.jsx(i.Label,{className:"text-[13px] font-semibold text-foreground/70",children:"Until"}),e.jsx(m.DateTimePicker,{date:s.state.value,setDate:l=>s.handleChange(l),disabled:o,locale:p,mode:"date",minDate:a.getFieldValue("start"),className:"border-border focus:border-primary"})]})}),t==="Count"&&e.jsx(a.Field,{name:"repeatEndCount",children:s=>e.jsxs("div",{className:"space-y-2 animate-in slide-in-from-top-1",children:[e.jsx(i.Label,{className:"text-[13px] font-semibold text-foreground/70",children:"Occurrences"}),e.jsx(b.Input,{type:"number",min:1,value:s.state.value,onChange:l=>s.handleChange(parseInt(l.target.value)),className:"h-10 rounded-md border-border focus-visible:border-primary focus-visible:ring-1 focus-visible:ring-primary/20 bg-background transition-all"})]})})]})}),e.jsx(a.Subscribe,{selector:r=>[r.values.repeatFrequency],children:([r])=>r==="Weekly"&&e.jsx(a.Field,{name:"repeatDays",children:t=>e.jsxs("div",{className:"space-y-3 animate-in fade-in duration-300",children:[e.jsx(i.Label,{className:"text-[13px] font-semibold text-foreground/70",children:"Repeat On"}),e.jsx("div",{className:"flex flex-wrap gap-2",children:A.map(s=>e.jsx("button",{type:"button",onClick:()=>{const l=t.state.value||[];l.includes(s.value)?t.handleChange(l.filter(g=>g!==s.value)):t.handleChange([...l,s.value])},className:x.cn("w-9 h-9 rounded-full flex items-center justify-center text-sm font-bold transition-all border",(t.state.value||[]).includes(s.value)?"bg-primary text-white border-primary shadow-sm":"bg-background text-foreground/60 border-border/60 hover:border-primary/40 hover:text-primary"),children:s.label},s.value))})]})})}),e.jsx(a.Subscribe,{selector:r=>[r.values.repeatFrequency],children:([r])=>(r==="Monthly"||r==="Yearly")&&e.jsx(a.Field,{name:"repeatBy",children:t=>e.jsxs("div",{className:"space-y-4 animate-in fade-in duration-300",children:[e.jsx(i.Label,{className:"text-[13px] font-semibold text-foreground/70",children:"Repeat On"}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("label",{className:"flex items-center space-x-3 cursor-pointer group",children:[e.jsx("input",{type:"radio",name:"repeatBy",checked:t.state.value==="day",onChange:()=>t.handleChange("day"),className:"h-4 w-4 border-border text-primary focus:ring-primary"}),e.jsx("span",{className:"text-sm text-foreground/80",children:"Day of the month"})]}),e.jsxs("label",{className:"flex items-center space-x-3 cursor-pointer group",children:[e.jsx("input",{type:"radio",name:"repeatBy",checked:t.state.value==="ordinal",onChange:()=>t.handleChange("ordinal"),className:"h-4 w-4 border-border text-primary focus:ring-primary"}),e.jsx("span",{className:"text-sm text-foreground/80",children:"Ordinal position"})]})]})]})})}),e.jsx(a.Field,{name:"description",children:r=>e.jsxs("div",{className:"space-y-2",children:[e.jsx(i.Label,{htmlFor:"description",className:"text-[13px] font-semibold text-foreground/70",children:"Description"}),e.jsx("textarea",{id:"description",placeholder:"Add description",className:"flex min-h-[100px] w-full rounded-md border-border bg-background px-4 py-3 text-sm placeholder:text-muted-foreground focus:outline-none focus-visible:ring-1 focus-visible:ring-primary/20 focus-visible:border-primary disabled:cursor-not-allowed disabled:opacity-50 resize-none transition-all hover:border-border",value:r.state.value,onChange:t=>r.handleChange(t.target.value),disabled:o})]})}),e.jsx(a.Field,{name:"attachments",children:r=>e.jsxs("div",{className:"space-y-4 pt-4 pb-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs(i.Label,{className:"text-[13px] font-semibold text-foreground/70 flex items-center gap-2",children:[e.jsx(m.Paperclip,{className:"w-4 h-4"})," Attachments"]}),e.jsx("input",{type:"file",id:"file-upload",multiple:!0,className:"hidden",onChange:t=>{t.target.files&&r.handleChange([...r.state.value||[],...Array.from(t.target.files)])}}),e.jsxs(c.Button,{type:"button",variant:"outline",size:"sm",className:"h-8 text-xs font-semibold gap-2 border-dashed border-border/50 hover:border-primary/40 hover:text-primary transition-all",onClick:()=>document.getElementById("file-upload")?.click(),children:[e.jsx(m.Paperclip,{className:"w-3 h-3"})," Add Files"]})]}),(r.state.value||[]).length>0&&e.jsx("div",{className:"grid grid-cols-1 gap-3",children:(r.state.value||[]).map((t,s)=>e.jsxs("div",{className:"flex items-center justify-between p-3 rounded-lg bg-highlight border border-border group hover:border-border transition-all",children:[e.jsxs("div",{className:"flex items-center gap-3 overflow-hidden",children:[e.jsx("div",{className:"w-9 h-9 rounded-md bg-white border border-border flex items-center justify-center shrink-0 shadow-sm",children:e.jsx(m.Paperclip,{className:"w-4 h-4 text-muted-foreground"})}),e.jsxs("div",{className:"flex flex-col overflow-hidden",children:[e.jsx("span",{className:"text-[13px] font-medium text-foreground truncate",children:t.name}),e.jsxs("span",{className:"text-[11px] text-muted-foreground font-medium",children:[(t.size/1024).toFixed(1)," KB"]})]})]}),e.jsx(c.Button,{type:"button",variant:"ghost",size:"icon",className:"h-8 w-8 text-muted-foreground/50 hover:text-destructive hover:bg-destructive/10 opacity-0 group-hover:opacity-100 transition-all",onClick:()=>r.handleChange((r.state.value||[]).filter((l,g)=>g!==s)),children:e.jsx(E.Trash2,{className:"w-4 h-4"})})]},s))})]})})]}),y?y(n||{},d,()=>N({}),u):e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"flex-end",padding:"24px 40px",backgroundColor:"var(--highlight)",gap:"12px",width:"100%",flexShrink:0},children:[!o&&v&&d==="edit"&&e.jsx(c.Button,{type:"button",variant:"ghost",className:"text-destructive hover:bg-destructive/10 hover:text-destructive h-10 px-5 font-bold mr-auto",onClick:()=>{v(n?.id),u()},children:"Delete"}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px"},children:[!o&&e.jsx(a.Subscribe,{selector:r=>[r.canSubmit,r.isSubmitting],children:([r,t])=>e.jsx(c.Button,{type:"submit",variant:"default",className:"h-10 px-10 font-bold rounded-md shrink-0 flex items-center justify-center transition-all hover:opacity-90",style:{minWidth:"120px"},disabled:!r||t,onClick:s=>{s.preventDefault(),s.stopPropagation(),a.handleSubmit()},children:t?"Saving...":"Save"})}),e.jsx(c.Button,{type:"button",variant:"outline",className:"h-10 px-8 font-bold border border-border hover:bg-highlight text-foreground shrink-0 rounded-md transition-all",style:{minWidth:"100px"},onClick:u,children:"Cancel"})]})]})]})]});return D.createPortal(w,document.body)};exports.EzEventModal=z;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),k=require("react"),F=require("@tanstack/react-form"),D=require("react-dom"),c=require("./tooltip-B41iztKT.cjs"),b=require("./input-BgM_la4k.cjs"),i=require("./label-Dx6oDB-X.cjs"),x=require("./useInitCoreServices-CwXv2p4S.cjs"),m=require("./date-time-picker-DTxHdPgQ.cjs"),E=require("./calendar-BMZ8ddOf.cjs"),A=[{label:"S",value:"SU"},{label:"M",value:"MO"},{label:"T",value:"TU"},{label:"W",value:"WE"},{label:"T",value:"TH"},{label:"F",value:"FR"},{label:"S",value:"SA"}],z=({isOpen:h,onClose:u,mode:d,event:n,onSave:C,onDelete:v,locale:p,editorTemplate:f,headerTemplate:j,footerTemplate:y})=>{const a=F.useForm({defaultValues:{title:n?.title||"",start:n?.start,end:n?.end,resourceIds:n?.resourceIds||(n?.resourceId?[n.resourceId]:[])||[],location:n?.location||"",isAllDay:!!n?.allDay||!!n?.isAllDay||!1,description:n?.description||"",isTimezoneEnabled:!!n?.timezone,startTimezone:n?.timezone?.start||"Asia/Calcutta",endTimezone:n?.timezone?.end||"Asia/Calcutta",repeatFrequency:n?.recurrence?.frequency||"Never",repeatInterval:n?.recurrence?.interval||1,repeatDays:n?.recurrence?.days||[],repeatBy:n?.recurrence?.repeatBy||"day",repeatEndLevel:n?.recurrence?.end||"Never",repeatEndCount:n?.recurrence?.endCount||1,repeatEndUntil:n?.recurrence?.endUntil,attachments:n?.attachments||[]},onSubmit:async({value:r})=>{C({...n,title:r.title,start:r.start,end:r.end,resourceId:r.resourceIds[0],resourceIds:r.resourceIds,location:r.location,allDay:r.isAllDay,description:r.description,timezone:r.isTimezoneEnabled?{start:r.startTimezone,end:r.endTimezone}:void 0,recurrence:r.repeatFrequency!=="Never"?{frequency:r.repeatFrequency,interval:r.repeatInterval,unit:r.repeatFrequency.replace("ly","")+"(s)",end:r.repeatEndLevel,endCount:r.repeatEndLevel==="Count"?r.repeatEndCount:void 0,endUntil:r.repeatEndLevel==="Until"?r.repeatEndUntil:void 0,days:r.repeatFrequency==="Weekly"?r.repeatDays:void 0,repeatBy:r.repeatFrequency==="Monthly"||r.repeatFrequency==="Yearly"?r.repeatBy:void 0}:void 0,attachments:r.attachments}),u()}});if(k.useEffect(()=>{h&&a.reset()},[h,n,a]),!h)return null;const N=r=>{r.preventDefault(),r.stopPropagation(),a.handleSubmit()},o=d==="view",w=e.jsxs("div",{"data-testid":"ez-event-modal",style:{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",zIndex:1e4,backgroundColor:"rgba(0, 0, 0, 0.4)",backdropFilter:"blur(2px)",pointerEvents:"auto"},children:[e.jsx("div",{style:{position:"absolute",inset:0},onClick:u}),e.jsxs("div",{className:x.cn("bg-background rounded-xl shadow-2xl flex flex-col border border-border overflow-hidden","animate-in zoom-in-95 fade-in duration-300 ease-out"),style:{backgroundColor:"white",width:"650px",maxWidth:"95vw",maxHeight:"92vh",position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",zIndex:10001},children:[e.jsx("div",{className:"flex items-center justify-between shrink-0 bg-background",style:{padding:"16px 40px"},children:j?j(n||{},d):e.jsxs(e.Fragment,{children:[e.jsxs("h2",{className:"text-xl font-bold tracking-tight text-foreground",children:[d==="create"&&"New Event",d==="edit"&&"Edit Event",d==="view"&&"Event Details"]}),e.jsx(c.Button,{variant:"ghost",size:"icon",className:"h-9 w-9 rounded-full hover:bg-muted text-muted-foreground mr-[-8px]",onClick:u,children:e.jsx(c.X,{className:"w-5 h-5"})})]})}),f?e.jsx("div",{className:"overflow-y-auto custom-scrollbar flex-1 bg-background",style:{padding:"8px 40px 32px 40px"},children:f(n||{})}):e.jsxs("form",{onSubmit:N,className:"space-y-6 overflow-y-auto custom-scrollbar flex-1 bg-background",style:{padding:"8px 40px 32px 40px"},children:[e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[e.jsx(a.Field,{name:"title",validators:{onChange:({value:r})=>r?void 0:"Title is required"},children:r=>e.jsxs("div",{className:"space-y-2",children:[e.jsx(i.Label,{htmlFor:"title",className:"text-[13px] font-semibold text-foreground/70",children:"Title"}),e.jsx(b.Input,{id:"title",placeholder:"Add title",value:r.state.value,onChange:t=>r.handleChange(t.target.value),onBlur:r.handleBlur,disabled:o,className:x.cn("h-10 rounded-md border-border focus-visible:border-primary focus-visible:ring-1 focus-visible:ring-primary/20 bg-background transition-all",r.state.meta.errors.length>0&&"border-destructive focus-visible:border-destructive ring-destructive/20")}),r.state.meta.errors.length>0&&e.jsx("p",{className:"text-[12px] font-medium text-destructive mt-1.5 animate-in fade-in slide-in-from-top-1",children:r.state.meta.errors.join(", ")})]})}),e.jsx(a.Field,{name:"location",children:r=>e.jsxs("div",{className:"space-y-2",children:[e.jsx(i.Label,{htmlFor:"location",className:"text-[13px] font-semibold text-foreground/70",children:"Location"}),e.jsx(b.Input,{id:"location",placeholder:"Add location",value:r.state.value,onChange:t=>r.handleChange(t.target.value),disabled:o,className:"h-10 rounded-md border-border focus-visible:border-primary focus-visible:ring-1 focus-visible:ring-primary/20 bg-background transition-all"})]})})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[e.jsx(a.Field,{name:"start",validators:{onChange:({value:r})=>r?void 0:"Start date is required"},children:r=>e.jsxs("div",{className:"space-y-2",children:[e.jsx(i.Label,{className:"text-[13px] font-semibold text-foreground/70",children:"Start"}),e.jsx(m.DateTimePicker,{date:r.state.value,setDate:t=>r.handleChange(t),disabled:o,required:!0,locale:p,mode:a.getFieldValue("isAllDay")?"date":"datetime",className:"border-border focus-visible:border-primary focus-visible:ring-1 focus-visible:ring-primary/20"}),r.state.meta.errors.length>0&&e.jsx("p",{className:"text-[12px] font-medium text-destructive mt-1.5",children:r.state.meta.errors.join(", ")})]})}),e.jsx(a.Field,{name:"end",validators:{onChange:({value:r,fieldApi:t})=>{if(!r)return"End date is required";const s=t.form.getFieldValue("start");if(s&&r<=s)return"End time must be after start time"}},children:r=>e.jsxs("div",{className:"space-y-2",children:[e.jsx(i.Label,{className:"text-[13px] font-semibold text-foreground/70",children:"End"}),e.jsx(m.DateTimePicker,{date:r.state.value,setDate:t=>r.handleChange(t),disabled:o,required:!0,locale:p,mode:a.getFieldValue("isAllDay")?"date":"datetime",minDate:a.getFieldValue("start"),className:x.cn("border-border focus-visible:border-primary focus-visible:ring-1 focus-visible:ring-primary/20",r.state.meta.errors.length>0&&"border-destructive focus-visible:border-destructive ring-destructive/20")}),r.state.meta.errors.length>0&&e.jsx("p",{className:"text-[12px] font-medium text-destructive mt-1.5 animate-in fade-in slide-in-from-top-1",children:r.state.meta.errors.join(", ")})]})})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[e.jsx(a.Field,{name:"isAllDay",children:r=>e.jsx("div",{className:"flex items-center h-10",children:e.jsxs("label",{className:"flex items-center space-x-3 cursor-pointer group select-none",children:[e.jsx("input",{type:"checkbox",checked:r.state.value,onChange:t=>r.handleChange(t.target.checked),disabled:o,className:"h-4 w-4 rounded border-border/50 text-primary focus:ring-primary/30 accent-primary transition-all cursor-pointer"}),e.jsx("span",{className:"text-[14px] font-medium text-foreground/70 group-hover:text-foreground",children:"All day event"})]})})}),e.jsx(a.Field,{name:"isTimezoneEnabled",children:r=>e.jsx("div",{className:"flex items-center h-10",children:e.jsxs("label",{className:"flex items-center space-x-3 cursor-pointer group select-none",children:[e.jsx("input",{type:"checkbox",checked:r.state.value,onChange:t=>r.handleChange(t.target.checked),disabled:o,className:"h-4 w-4 rounded border-border/50 text-primary focus:ring-primary/30 accent-primary transition-all cursor-pointer"}),e.jsx("span",{className:"text-[14px] font-medium text-foreground/70 group-hover:text-foreground",children:"Enable timezone"})]})})})]}),e.jsx(a.Subscribe,{selector:r=>[r.values.isTimezoneEnabled],children:([r])=>r&&e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6 p-6 bg-highlight/50 rounded-lg border border-border animate-in slide-in-from-top-2 duration-300",children:[e.jsx(a.Field,{name:"startTimezone",children:t=>e.jsxs("div",{className:"space-y-2",children:[e.jsx(i.Label,{className:"text-[13px] font-semibold text-foreground/70",children:"Start Timezone"}),e.jsxs("select",{className:"w-full h-10 px-3 rounded-md border-border bg-background text-sm focus:outline-none focus-visible:ring-1 focus-visible:ring-primary/20 focus-visible:border-primary appearance-none bg-[url('data:image/svg+xml;charset=utf-8,%3Csvg%20xlmns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20fill%3D%27none%27%20viewBox%3D%270%200%2020%2020%27%3E%3Cpath%20stroke%3D%27%236b7280%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%20stroke-width%3D%271.5%27%20d%3D%27m6%208%204%204%204-4%27%2F%3E%3C%2Fsvg%3E')] bg-[length:20px] bg-[right_8px_center] bg-no-repeat transition-all",value:t.state.value,onChange:s=>t.handleChange(s.target.value),children:[e.jsx("option",{value:"Asia/Calcutta",children:"Asia/Calcutta"}),e.jsx("option",{value:"UTC",children:"UTC"}),e.jsx("option",{value:"America/New_York",children:"America/New_York"})]})]})}),e.jsx(a.Field,{name:"endTimezone",children:t=>e.jsxs("div",{className:"space-y-2",children:[e.jsx(i.Label,{className:"text-[13px] font-semibold text-foreground/70",children:"End Timezone"}),e.jsxs("select",{className:"w-full h-10 px-3 rounded-md border-border bg-background text-sm focus:outline-none focus-visible:ring-1 focus-visible:ring-primary/20 focus-visible:border-primary appearance-none bg-[url('data:image/svg+xml;charset=utf-8,%3Csvg%20xlmns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20fill%3D%27none%27%20viewBox%3D%270%200%2020%2020%27%3E%3Cpath%20stroke%3D%27%236b7280%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%20stroke-width%3D%271.5%27%20d%3D%27m6%208%204%204%204-4%27%2F%3E%3C%2Fsvg%3E')] bg-[length:20px] bg-[right_8px_center] bg-no-repeat transition-all",value:t.state.value,onChange:s=>t.handleChange(s.target.value),children:[e.jsx("option",{value:"Asia/Calcutta",children:"Asia/Calcutta"}),e.jsx("option",{value:"UTC",children:"UTC"}),e.jsx("option",{value:"America/New_York",children:"America/New_York"})]})]})})]})}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[e.jsx(a.Field,{name:"repeatFrequency",children:r=>e.jsxs("div",{className:"space-y-2",children:[e.jsx(i.Label,{className:"text-[13px] font-semibold text-foreground/70",children:"Repeat"}),e.jsxs("select",{className:"w-full h-10 px-3 rounded-md border-border bg-background text-sm focus:outline-none focus-visible:ring-1 focus-visible:ring-primary/20 focus-visible:border-primary appearance-none bg-[url('data:image/svg+xml;charset=utf-8,%3Csvg%20xlmns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20fill%3D%27none%27%20viewBox%3D%270%200%2020%2020%27%3E%3Cpath%20stroke%3D%27%236b7280%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%20stroke-width%3D%271.5%27%20d%3D%27m6%208%204%204%204-4%27%2F%3E%3C%2Fsvg%3E')] bg-[length:20px] bg-[right_8px_center] bg-no-repeat transition-all",value:r.state.value,onChange:t=>r.handleChange(t.target.value),children:[e.jsx("option",{value:"Never",children:"Never"}),e.jsx("option",{value:"Daily",children:"Daily"}),e.jsx("option",{value:"Weekly",children:"Weekly"}),e.jsx("option",{value:"Monthly",children:"Monthly"}),e.jsx("option",{value:"Yearly",children:"Yearly"})]})]})}),e.jsx(a.Subscribe,{selector:r=>[r.values.repeatFrequency],children:([r])=>r!=="Never"&&e.jsx(a.Field,{name:"repeatEndLevel",children:t=>e.jsxs("div",{className:"space-y-2 animate-in slide-in-from-top-2 duration-300",children:[e.jsx(i.Label,{className:"text-[13px] font-semibold text-foreground/70",children:"End"}),e.jsxs("select",{className:"w-full h-10 px-3 rounded-md border-border bg-background text-sm focus:outline-none focus-visible:ring-1 focus-visible:ring-primary/20 focus-visible:border-primary appearance-none bg-[url('data:image/svg+xml;charset=utf-8,%3Csvg%20xlmns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20fill%3D%27none%27%20viewBox%3D%270%200%2020%2020%27%3E%3Cpath%20stroke%3D%27%236b7280%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%20stroke-width%3D%271.5%27%20d%3D%27m6%208%204%204%204-4%27%2F%3E%3C%2Fsvg%3E')] bg-[length:20px] bg-[right_8px_center] bg-no-repeat transition-all",value:t.state.value,onChange:s=>t.handleChange(s.target.value),children:[e.jsx("option",{value:"Never",children:"Never"}),e.jsx("option",{value:"Until",children:"Until"}),e.jsx("option",{value:"Count",children:"Count"})]})]})})})]}),e.jsx(a.Subscribe,{selector:r=>[r.values.repeatFrequency,r.values.repeatEndLevel],children:([r,t])=>r!=="Never"&&e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6 animate-in slide-in-from-top-2 duration-300",children:[e.jsx(a.Field,{name:"repeatInterval",children:s=>e.jsxs("div",{className:"space-y-2",children:[e.jsx(i.Label,{className:"text-[13px] font-semibold text-foreground/70",children:"Repeat every"}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("select",{className:"flex-1 h-10 px-3 rounded-md border-border bg-background text-sm focus:outline-none focus-visible:ring-1 focus-visible:ring-primary/20 focus-visible:border-primary appearance-none bg-[url('data:image/svg+xml;charset=utf-8,%3Csvg%20xlmns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20fill%3D%27none%27%20viewBox%3D%270%200%2020%2020%27%3E%3Cpath%20stroke%3D%27%236b7280%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%20stroke-width%3D%271.5%27%20d%3D%27m6%208%204%204%204-4%27%2F%3E%3C%2Fsvg%3E')] bg-[length:20px] bg-[right_8px_center] bg-no-repeat transition-all",value:s.state.value,onChange:l=>s.handleChange(parseInt(l.target.value)),children:[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,20,30].map(l=>e.jsx("option",{value:l,children:l},l))}),e.jsx("span",{className:"text-sm font-medium text-muted-foreground whitespace-nowrap",children:r==="Daily"?"Day(s)":r.replace("ly","")+"(s)"})]})]})}),t==="Until"&&e.jsx(a.Field,{name:"repeatEndUntil",children:s=>e.jsxs("div",{className:"space-y-2 animate-in slide-in-from-top-1",children:[e.jsx(i.Label,{className:"text-[13px] font-semibold text-foreground/70",children:"Until"}),e.jsx(m.DateTimePicker,{date:s.state.value,setDate:l=>s.handleChange(l),disabled:o,locale:p,mode:"date",minDate:a.getFieldValue("start"),className:"border-border focus:border-primary"})]})}),t==="Count"&&e.jsx(a.Field,{name:"repeatEndCount",children:s=>e.jsxs("div",{className:"space-y-2 animate-in slide-in-from-top-1",children:[e.jsx(i.Label,{className:"text-[13px] font-semibold text-foreground/70",children:"Occurrences"}),e.jsx(b.Input,{type:"number",min:1,value:s.state.value,onChange:l=>s.handleChange(parseInt(l.target.value)),className:"h-10 rounded-md border-border focus-visible:border-primary focus-visible:ring-1 focus-visible:ring-primary/20 bg-background transition-all"})]})})]})}),e.jsx(a.Subscribe,{selector:r=>[r.values.repeatFrequency],children:([r])=>r==="Weekly"&&e.jsx(a.Field,{name:"repeatDays",children:t=>e.jsxs("div",{className:"space-y-3 animate-in fade-in duration-300",children:[e.jsx(i.Label,{className:"text-[13px] font-semibold text-foreground/70",children:"Repeat On"}),e.jsx("div",{className:"flex flex-wrap gap-2",children:A.map(s=>e.jsx("button",{type:"button",onClick:()=>{const l=t.state.value||[];l.includes(s.value)?t.handleChange(l.filter(g=>g!==s.value)):t.handleChange([...l,s.value])},className:x.cn("w-9 h-9 rounded-full flex items-center justify-center text-sm font-bold transition-all border",(t.state.value||[]).includes(s.value)?"bg-primary text-white border-primary shadow-sm":"bg-background text-foreground/60 border-border/60 hover:border-primary/40 hover:text-primary"),children:s.label},s.value))})]})})}),e.jsx(a.Subscribe,{selector:r=>[r.values.repeatFrequency],children:([r])=>(r==="Monthly"||r==="Yearly")&&e.jsx(a.Field,{name:"repeatBy",children:t=>e.jsxs("div",{className:"space-y-4 animate-in fade-in duration-300",children:[e.jsx(i.Label,{className:"text-[13px] font-semibold text-foreground/70",children:"Repeat On"}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("label",{className:"flex items-center space-x-3 cursor-pointer group",children:[e.jsx("input",{type:"radio",name:"repeatBy",checked:t.state.value==="day",onChange:()=>t.handleChange("day"),className:"h-4 w-4 border-border text-primary focus:ring-primary"}),e.jsx("span",{className:"text-sm text-foreground/80",children:"Day of the month"})]}),e.jsxs("label",{className:"flex items-center space-x-3 cursor-pointer group",children:[e.jsx("input",{type:"radio",name:"repeatBy",checked:t.state.value==="ordinal",onChange:()=>t.handleChange("ordinal"),className:"h-4 w-4 border-border text-primary focus:ring-primary"}),e.jsx("span",{className:"text-sm text-foreground/80",children:"Ordinal position"})]})]})]})})}),e.jsx(a.Field,{name:"description",children:r=>e.jsxs("div",{className:"space-y-2",children:[e.jsx(i.Label,{htmlFor:"description",className:"text-[13px] font-semibold text-foreground/70",children:"Description"}),e.jsx("textarea",{id:"description",placeholder:"Add description",className:"flex min-h-[100px] w-full rounded-md border-border bg-background px-4 py-3 text-sm placeholder:text-muted-foreground focus:outline-none focus-visible:ring-1 focus-visible:ring-primary/20 focus-visible:border-primary disabled:cursor-not-allowed disabled:opacity-50 resize-none transition-all hover:border-border",value:r.state.value,onChange:t=>r.handleChange(t.target.value),disabled:o})]})}),e.jsx(a.Field,{name:"attachments",children:r=>e.jsxs("div",{className:"space-y-4 pt-4 pb-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs(i.Label,{className:"text-[13px] font-semibold text-foreground/70 flex items-center gap-2",children:[e.jsx(m.Paperclip,{className:"w-4 h-4"})," Attachments"]}),e.jsx("input",{type:"file",id:"file-upload",multiple:!0,className:"hidden",onChange:t=>{t.target.files&&r.handleChange([...r.state.value||[],...Array.from(t.target.files)])}}),e.jsxs(c.Button,{type:"button",variant:"outline",size:"sm",className:"h-8 text-xs font-semibold gap-2 border-dashed border-border/50 hover:border-primary/40 hover:text-primary transition-all",onClick:()=>document.getElementById("file-upload")?.click(),children:[e.jsx(m.Paperclip,{className:"w-3 h-3"})," Add Files"]})]}),(r.state.value||[]).length>0&&e.jsx("div",{className:"grid grid-cols-1 gap-3",children:(r.state.value||[]).map((t,s)=>e.jsxs("div",{className:"flex items-center justify-between p-3 rounded-lg bg-highlight border border-border group hover:border-border transition-all",children:[e.jsxs("div",{className:"flex items-center gap-3 overflow-hidden",children:[e.jsx("div",{className:"w-9 h-9 rounded-md bg-white border border-border flex items-center justify-center shrink-0 shadow-sm",children:e.jsx(m.Paperclip,{className:"w-4 h-4 text-muted-foreground"})}),e.jsxs("div",{className:"flex flex-col overflow-hidden",children:[e.jsx("span",{className:"text-[13px] font-medium text-foreground truncate",children:t.name}),e.jsxs("span",{className:"text-[11px] text-muted-foreground font-medium",children:[(t.size/1024).toFixed(1)," KB"]})]})]}),e.jsx(c.Button,{type:"button",variant:"ghost",size:"icon",className:"h-8 w-8 text-muted-foreground/50 hover:text-destructive hover:bg-destructive/10 opacity-0 group-hover:opacity-100 transition-all",onClick:()=>r.handleChange((r.state.value||[]).filter((l,g)=>g!==s)),children:e.jsx(E.Trash2,{className:"w-4 h-4"})})]},s))})]})})]}),y?y(n||{},d,()=>N({}),u):e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"flex-end",padding:"24px 40px",backgroundColor:"var(--highlight)",gap:"12px",width:"100%",flexShrink:0},children:[!o&&v&&d==="edit"&&e.jsx(c.Button,{type:"button",variant:"ghost",className:"text-destructive hover:bg-destructive/10 hover:text-destructive h-10 px-5 font-bold mr-auto",onClick:()=>{v(n?.id),u()},children:"Delete"}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px"},children:[!o&&e.jsx(a.Subscribe,{selector:r=>[r.canSubmit,r.isSubmitting],children:([r,t])=>e.jsx(c.Button,{type:"submit",variant:"default",className:"h-10 px-10 font-bold rounded-md shrink-0 flex items-center justify-center transition-all hover:opacity-90",style:{minWidth:"120px"},disabled:!r||t,onClick:s=>{s.preventDefault(),s.stopPropagation(),a.handleSubmit()},children:t?"Saving...":"Save"})}),e.jsx(c.Button,{type:"button",variant:"outline",className:"h-10 px-8 font-bold border border-border hover:bg-highlight text-foreground shrink-0 rounded-md transition-all",style:{minWidth:"100px"},onClick:u,children:"Cancel"})]})]})]})]});return D.createPortal(w,document.body)};exports.EzEventModal=z;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsx as e, jsxs as p } from "react/jsx-runtime";
|
|
2
|
-
import { k as b, l as f, D as v, m as N, n as S, P as y, c as w, C } from "./EzContextMenu-
|
|
3
|
-
import { S as D, v as G, a as L, s as R, h as k, u as z } from "./sortable.esm-
|
|
4
|
-
import { c as g } from "./useInitCoreServices-
|
|
2
|
+
import { k as b, l as f, D as v, m as N, n as S, P as y, c as w, C } from "./EzContextMenu-BSA_B6Pr.js";
|
|
3
|
+
import { S as D, v as G, a as L, s as R, h as k, u as z } from "./sortable.esm-CzMCDPet.js";
|
|
4
|
+
import { c as g } from "./useInitCoreServices-D1WaWlaI.js";
|
|
5
5
|
import { L as E } from "./layers-BA4i1fYX.js";
|
|
6
6
|
import { C as P } from "./EzErrorBoundary-D4NBadES.js";
|
|
7
|
-
import { G as j } from "./
|
|
8
|
-
import { X as I } from "./tooltip-
|
|
7
|
+
import { G as j } from "./grip-vertical-CSyDKBul.js";
|
|
8
|
+
import { X as I } from "./tooltip-BCtrEe0z.js";
|
|
9
9
|
function K({
|
|
10
10
|
items: t,
|
|
11
11
|
onReorder: i,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),o=require("./EzContextMenu-B6HBUjWv.cjs"),l=require("./sortable.esm-CsRPuXyD.cjs"),p=require("./useInitCoreServices-CwXv2p4S.cjs"),f=require("./layers-xSPd-hz3.cjs"),v=require("./EzErrorBoundary-CEdz_hDo.cjs"),j=require("./grip-vertical-DZNBW1Dn.cjs"),y=require("./tooltip-B41iztKT.cjs");function S({items:t,onReorder:d,renderItem:u,getId:n,strategy:i=l.verticalListSortingStrategy,className:m}){const r=o.useSensors(o.useSensor(o.PointerSensor,{activationConstraint:{distance:8}}),o.useSensor(o.KeyboardSensor,{coordinateGetter:l.sortableKeyboardCoordinates}));function c(s){const{active:a,over:x}=s;if(x&&a.id!==x.id){const g=t.findIndex(h=>n(h)===a.id),b=t.findIndex(h=>n(h)===x.id);d(l.arrayMove(t,g,b))}}return e.jsx(o.DndContext,{sensors:r,collisionDetection:o.closestCenter,onDragEnd:c,children:e.jsx(l.SortableContext,{items:t.map(n),strategy:i,children:e.jsx("div",{className:m,children:t.map((s,a)=>u(s,a))})})})}const N=({id:t,label:d,onRemove:u,showSeparator:n})=>{const{attributes:i,listeners:m,setNodeRef:r,transform:c,transition:s,isDragging:a}=l.useSortable({id:t}),x={transform:o.CSS.Transform.toString(c),transition:s,zIndex:a?50:void 0};return e.jsxs("div",{ref:r,style:x,className:"flex items-center",children:[n&&e.jsx("div",{className:"flex items-center text-muted-foreground mr-2",children:e.jsx(v.ChevronRight,{className:"w-4 h-4"})}),e.jsxs("div",{className:p.cn("flex items-center gap-1.5 px-2 py-1 bg-card border border-border rounded-md shadow-sm transition-all duration-200",a?"opacity-50 scale-105 border-primary shadow-lg":"hover:border-primary/50"),children:[e.jsx("div",{...i,...m,className:"cursor-grab active:cursor-grabbing text-muted-foreground/50 hover:text-primary transition-colors",children:e.jsx(j.GripVertical,{className:"w-3.5 h-3.5"})}),e.jsx("span",{className:"text-sm font-medium text-foreground",children:d}),e.jsx("button",{onClick:g=>{g.stopPropagation(),u()},className:"p-0.5 hover:bg-muted rounded transition-colors",children:e.jsx(y.X,{className:"w-3 h-3 text-muted-foreground hover:text-destructive"})})]})]})},w=({grouping:t,onGroupingChange:d,columns:u})=>{const{setNodeRef:n,isOver:i}=o.useDroppable({id:"grouping-panel"}),m=r=>u.find(s=>s.id===r)?.columnDef.header||r;return e.jsxs("div",{ref:n,className:p.cn("flex items-center gap-2 p-2 min-h-[40px] border rounded-md transition-all duration-200","bg-muted/40 border-dashed border-border",i&&"bg-highlight border-selection ring-1 ring-selection"),children:[e.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground mr-2",children:[e.jsx(f.Layers,{className:"w-4 h-4"}),e.jsx("span",{className:"text-[10px] font-black uppercase tracking-wider",children:"Group By"})]}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[t.length===0&&!i&&e.jsx("span",{className:"text-sm text-muted-foreground/70 italic",children:"Drag columns here to group"}),e.jsx(S,{items:t,onReorder:d,getId:r=>r,strategy:l.horizontalListSortingStrategy,className:"flex flex-wrap gap-y-2",renderItem:(r,c)=>e.jsx(N,{id:r,label:m(r),onRemove:()=>d(t.filter(s=>s!==r)),showSeparator:c>0},r)}),i&&e.jsx("div",{className:"px-2 py-1 border border-selection border-dashed bg-highlight/50 rounded-md text-sm text-selection animate-pulse",children:"Drop to Group"})]})]})};exports.EzGroupingPanel=w;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsxs as r, jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import { useState as E, useRef as p, useEffect as x } from "react";
|
|
3
|
-
import { B as i, X as C } from "./tooltip-
|
|
4
|
-
import { I as z } from "./input-
|
|
5
|
-
import { c as M } from "./useInitCoreServices-
|
|
6
|
-
import { i as j, C as S } from "./isBefore-
|
|
7
|
-
import { f as m, C as A } from "./index-
|
|
3
|
+
import { B as i, X as C } from "./tooltip-BCtrEe0z.js";
|
|
4
|
+
import { I as z } from "./input-jYQ5VKNR.js";
|
|
5
|
+
import { c as M } from "./useInitCoreServices-D1WaWlaI.js";
|
|
6
|
+
import { i as j, C as S } from "./isBefore-C3Y_wbk3.js";
|
|
7
|
+
import { f as m, C as A } from "./index-C6NfgycP.js";
|
|
8
8
|
import { C as B } from "./circle-alert-B2AMDd8N.js";
|
|
9
9
|
import { E as D } from "./ellipsis-CuqNthAj.js";
|
|
10
10
|
const P = ({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),i=require("react"),a=require("./tooltip-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),i=require("react"),a=require("./tooltip-B41iztKT.cjs"),k=require("./input-BgM_la4k.cjs"),y=require("./useInitCoreServices-CwXv2p4S.cjs"),f=require("./isBefore-Cp1ttk6q.cjs"),l=require("./index-B3ipEEhH.cjs"),E=require("./circle-alert-77QqFR-z.cjs"),q=require("./ellipsis-CzlqJf-i.cjs"),z=({start:t,end:c,resourceId:o,resources:p,onSave:g,onCancel:r,onMoreOptions:j,position:m})=>{const[n,v]=i.useState(""),x=i.useRef(null),d=i.useRef(null);i.useEffect(()=>{x.current?.focus()},[]),i.useEffect(()=>{const s=N=>{d.current&&!d.current.contains(N.target)&&r()};return document.addEventListener("mousedown",s),()=>document.removeEventListener("mousedown",s)},[r]);const h=()=>{n.trim()&&g({title:n,start:t,end:c,resourceId:o})},b=s=>{s.key==="Enter"&&h(),s.key==="Escape"&&r()},u=p?.find(s=>s.id===o),w=f.isBefore(t,new Date);return e.jsxs("div",{ref:d,className:y.cn("fixed z-[100] w-[320px] p-4 rounded-xl shadow-2xl animate-in fade-in zoom-in duration-200","bg-background/80 backdrop-blur-xl border border-white/20 dark:border-white/10","shadow-[0_8px_32px_rgba(0,0,0,0.12)]"),style:{left:Math.min(m.x,window.innerWidth-340),top:Math.min(m.y,window.innerHeight-200)},children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-2 h-2 rounded-full bg-primary animate-pulse"}),e.jsx("span",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground",children:"Quick Add"})]}),e.jsx(a.Button,{variant:"ghost",size:"icon",className:"h-6 w-6 rounded-full",onClick:r,children:e.jsx(a.X,{className:"h-3 w-3"})})]}),e.jsx(k.Input,{ref:x,placeholder:"What's the plan?",value:n,onChange:s=>v(s.target.value),onKeyDown:b,className:"mb-4 bg-transparent border-none text-lg font-bold p-0 focus-visible:ring-0 placeholder:text-muted-foreground/50 h-auto"}),e.jsxs("div",{className:"space-y-2 mb-6",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[e.jsx(f.Calendar,{className:"h-3.5 w-3.5"}),e.jsx("span",{children:l.format(t,"EEE, MMM d")})]}),e.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[e.jsx(l.Clock,{className:"h-3.5 w-3.5"}),e.jsxs("span",{children:[l.format(t,"h:mm a")," - ",l.format(c,"h:mm a")]})]}),u&&e.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[e.jsx("div",{className:"w-3.5 h-3.5 rounded-full",style:{backgroundColor:u.color||"hsl(var(--primary))"}}),e.jsx("span",{children:u.name})]}),w&&e.jsxs("div",{className:"flex items-center gap-2 text-xs text-warning-foreground font-medium",children:[e.jsx(E.CircleAlert,{className:"h-3 w-3"}),e.jsx("span",{children:"This event is in the past"})]})]}),e.jsxs("div",{className:"flex items-center justify-between pt-2 border-t border-border/50",children:[e.jsxs(a.Button,{variant:"ghost",size:"sm",className:"h-8 gap-2 text-muted-foreground hover:text-foreground",onClick:()=>j({title:n,start:t,end:c,resourceId:o}),children:[e.jsx(q.Ellipsis,{className:"h-4 w-4"}),"More"]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(a.Button,{variant:"ghost",size:"sm",onClick:r,className:"h-8",children:"Cancel"}),e.jsx(a.Button,{size:"sm",onClick:h,className:"h-8 px-4",disabled:!n.trim(),children:"Save"})]})]})]})};exports.EzSchedulerQuickAdd=z;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const e=require("react/jsx-runtime"),x=require("react"),r=require("./tooltip-
|
|
1
|
+
"use strict";const e=require("react/jsx-runtime"),x=require("react"),r=require("./tooltip-B41iztKT.cjs"),D=require("./input-BgM_la4k.cjs"),P=require("./useInitCoreServices-CwXv2p4S.cjs"),s=require("./select-GxA46anr.cjs"),l=require("./popover-BJq1CKmi.cjs"),M=require("./calendar-BMZ8ddOf.cjs"),_=require("./scroll-area-CwwZSSA4.cjs"),I=require("./bell-DOX2y38e.cjs"),g=require("./settings-DKPknrt8.cjs"),m=require("./EzErrorBoundary-CEdz_hDo.cjs"),L=require("./circle-alert-77QqFR-z.cjs"),z=require("./chevron-left-HWhRo6IH.cjs"),A=require("./isBefore-Cp1ttk6q.cjs"),k=require("./index-B3ipEEhH.cjs"),R=require("./download-0ZhO2XaW.cjs"),V=()=>{const n=P.useEzServiceRegistry(),[o,v]=x.useState([]),[j,p]=x.useState(!1);x.useEffect(()=>{let t;const i=()=>{const h=n.get("NotificationService");h&&!t&&(t=h.subscribe(w=>v(w)))};i();const u=n.subscribe(()=>{i()});return()=>{t&&t(),u()}},[]);const f=()=>{n.get("NotificationService")?.clearAll()},N=(t,i)=>{i.stopPropagation(),n.get("NotificationService")?.remove(t)},b=t=>{switch(t){case"success":return e.jsx(g.CircleCheckBig,{className:"h-4 w-4 text-green-600"});case"error":return e.jsx(L.CircleAlert,{className:"h-4 w-4 text-red-600"});case"warning":return e.jsx(m.TriangleAlert,{className:"h-4 w-4 text-amber-600"});default:return e.jsx(g.Info,{className:"h-4 w-4 text-blue-600"})}};return e.jsxs(l.Popover,{open:j,onOpenChange:p,children:[e.jsx(l.PopoverTrigger,{asChild:!0,children:e.jsxs(r.Button,{variant:"ghost",size:"icon",className:"h-9 w-9 text-muted-foreground hover:text-foreground relative",children:[e.jsx(I.Bell,{className:"w-5 h-5"}),o.length>0&&e.jsx("span",{className:"absolute -top-1 -right-1 flex h-4 w-4 items-center justify-center rounded-full bg-red-500 text-[10px] font-bold text-white ring-2 ring-background animate-in zoom-in duration-300",children:o.length>9?"9+":o.length})]})}),e.jsxs(l.PopoverContent,{className:"w-80 p-0 mr-4",align:"end",children:[e.jsxs("div",{className:"flex items-center justify-between p-4 border-b",children:[e.jsx("h4",{className:"font-semibold text-sm",children:"Notifications"}),o.length>0&&e.jsxs(r.Button,{variant:"ghost",size:"sm",className:"h-auto px-2 py-1 text-xs text-muted-foreground hover:text-destructive",onClick:f,children:[e.jsx(M.Trash2,{className:"w-3 h-3 mr-1"}),"Clear all"]})]}),e.jsx(_.ScrollArea,{className:"h-[300px]",children:o.length===0?e.jsxs("div",{className:"flex flex-col items-center justify-center h-[200px] text-muted-foreground",children:[e.jsx(I.Bell,{className:"w-8 h-8 mb-2 opacity-20"}),e.jsx("p",{className:"text-xs",children:"No notifications"})]}):e.jsx("div",{className:"flex flex-col divide-y",children:o.map(t=>e.jsx("div",{className:"p-4 hover:bg-muted/50 transition-colors relative group",children:e.jsxs("div",{className:"flex gap-3",children:[e.jsx("div",{className:"shrink-0 mt-0.5",children:b(t.type)}),e.jsxs("div",{className:"space-y-1 flex-1 min-w-0",children:[e.jsx("p",{className:"text-xs leading-relaxed text-foreground/90 break-words",children:t.message}),e.jsx("p",{className:"text-[10px] text-muted-foreground",children:"Just now"})]}),e.jsx("button",{onClick:i=>N(t.id,i),className:"opacity-0 group-hover:opacity-100 transition-opacity absolute top-2 right-2 p-1 hover:bg-background rounded-md text-muted-foreground hover:text-foreground",children:e.jsx(r.X,{className:"w-3 h-3"})})]})},t.id))})})]})]})},$=n=>n.replace(/([A-Z])/g," $1").trim(),G=(n,o)=>k.format(n,"MMMM yyyy"),B=x.memo(({currentDate:n,next:o,prev:v,today:j,slotDuration:p,setSlotDuration:f,setCurrentDate:N,onPrev:b,onNext:t,onToday:i,currentView:u,onViewChange:h,views:w=[],onExportExcel:T,onExportCSV:q,onExportICS:E,dir:O})=>{const S=O==="rtl",C=(c,a)=>{if(typeof c=="string")switch(c){case"Previous":return e.jsx(r.Button,{variant:"ghost",size:"icon",onClick:b,children:e.jsx(z.ChevronLeft,{className:"h-4 w-4"})},a);case"Next":return e.jsx(r.Button,{variant:"ghost",size:"icon",onClick:t,children:e.jsx(m.ChevronRight,{className:"h-4 w-4"})},a);case"Today":return e.jsx(r.Button,{variant:"outline",onClick:i,children:"Today"},a);case"DateRange":return e.jsx("div",{className:"flex items-center gap-2",children:e.jsx("span",{className:"text-lg font-semibold min-w-[200px] text-center",children:G(n)})},a);case"Search":return e.jsxs("div",{className:"relative w-48 hidden md:block",children:[e.jsx(s.Search,{className:P.cn("absolute top-2.5 h-4 w-4 text-muted-foreground",S?"right-2":"left-2")}),e.jsx(D.Input,{placeholder:"Search...",className:"ps-8 h-9"})]},a);case"Timezone":return e.jsxs(r.Button,{variant:"ghost",size:"sm",className:"hidden lg:flex gap-1 text-xs text-muted-foreground",children:[e.jsx(g.Globe,{className:"h-3.5 w-3.5"}),e.jsx("span",{children:"UTC"})]},a);case"ActiveView":return e.jsxs(s.Select,{value:u,onValueChange:d=>h(d),children:[e.jsx(s.SelectTrigger,{className:"w-[140px]",children:e.jsx(s.SelectValue,{placeholder:"Select view"})}),e.jsx(s.SelectContent,{children:w.map(d=>{const y=typeof d=="string"?d:d.option;return e.jsx(s.SelectItem,{value:y,children:$(y)},y)})})]});default:return null}return e.jsx("div",{className:c.cssClass,children:c.text},a)};return e.jsxs("div",{"data-testid":"scheduler-toolbar",className:"flex items-center justify-between p-4 border-b border-border shrink-0 bg-background h-16",children:[e.jsxs("div",{className:"flex items-center gap-6",children:[e.jsxs("div",{className:"flex items-center gap-1.5 ",children:[e.jsx(r.Button,{variant:"ghost",size:"icon",onClick:v,className:"h-8 w-8 text-muted-foreground hover:text-foreground hover:bg-muted",children:S?e.jsx(m.ChevronRight,{className:"w-5 h-5"}):e.jsx(z.ChevronLeft,{className:"w-5 h-5"})}),e.jsx(r.Button,{variant:"ghost",size:"icon",onClick:o,className:"h-8 w-8 text-muted-foreground hover:text-foreground hover:bg-muted",children:S?e.jsx(z.ChevronLeft,{className:"w-5 h-5"}):e.jsx(m.ChevronRight,{className:"w-5 h-5"})}),e.jsxs(l.Popover,{children:[e.jsx(l.PopoverTrigger,{asChild:!0,children:e.jsx(r.Button,{variant:"ghost",size:"icon",className:"h-8 w-8 text-muted-foreground hover:text-foreground hover:bg-muted",children:e.jsx(A.Calendar,{className:"h-4 w-4"})})}),e.jsx(l.PopoverContent,{className:"w-auto p-0",align:"start",children:e.jsx(M.Calendar,{selected:n,onSelect:c=>c&&N(c)})})]})]}),e.jsx("div",{className:"text-xl font-bold tracking-tight text-foreground cursor-pointer hover:text-primary transition-colors ms-4",onClick:()=>{},children:k.format(n,"EEEE, MMM d yyyy")})]}),e.jsxs("div",{className:"flex items-center gap-4",children:[C("Search",0)," ",C("Timezone",1)," ",C("ActiveView",2),e.jsx(r.Button,{variant:"outline",onClick:j,className:"h-9 px-4 text-xs font-bold uppercase tracking-wider border-border hover:bg-muted transition-colors rounded-md",children:"TODAY"}),e.jsxs("div",{className:"flex items-center gap-2 bg-muted/30 px-2 py-1 rounded-lg border border-border/50",children:[e.jsx(k.Clock,{className:"w-3.5 h-3.5 text-muted-foreground"}),e.jsxs(s.Select,{value:String(p),onValueChange:c=>f(Number(c)),children:[e.jsx(s.SelectTrigger,{className:"h-7 w-[90px] text-[10px] font-bold uppercase tracking-tight bg-transparent border-none shadow-none focus:ring-0",children:e.jsx(s.SelectValue,{placeholder:"Interval"})}),e.jsxs(s.SelectContent,{children:[e.jsx(s.SelectItem,{value:"5",children:"5 minutes"}),e.jsx(s.SelectItem,{value:"10",children:"10 minutes"}),e.jsx(s.SelectItem,{value:"15",children:"15 minutes"}),e.jsx(s.SelectItem,{value:"30",children:"30 minutes"}),e.jsx(s.SelectItem,{value:"45",children:"45 minutes"}),e.jsx(s.SelectItem,{value:"60",children:"1 hour"})]})]})]}),e.jsx(V,{}),e.jsxs("div",{className:"flex items-center gap-1 border-s border-border ps-2",children:[T&&e.jsx(r.Button,{variant:"ghost",size:"icon",onClick:T,title:"Export to Excel",children:e.jsx(R.Download,{className:"w-4 h-4"})}),q&&e.jsx(r.Button,{variant:"ghost",size:"icon",onClick:q,title:"Export to CSV",children:e.jsx(R.Download,{className:"w-4 h-4 text-primary"})}),E&&e.jsx(r.Button,{variant:"ghost",size:"icon",onClick:E,title:"Export to ICS",children:e.jsx(A.Calendar,{className:"w-4 h-4"})})]}),e.jsx(r.Button,{variant:"ghost",size:"icon",className:"h-9 w-9 text-muted-foreground hover:text-foreground rounded-full",children:e.jsx(g.Settings,{className:"w-5 h-5"})})]})]})});B.displayName="EzSchedulerToolbar";const J=Object.freeze(Object.defineProperty({__proto__:null,EzSchedulerToolbar:B},Symbol.toStringTag,{value:"Module"}));exports.EzNotificationDropdown=V;exports.EzSchedulerToolbar=B;exports.EzSchedulerToolbar$1=J;
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { jsxs as r, jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import { useState as E, useEffect as J, memo as L } from "react";
|
|
3
|
-
import { B as s, X as U } from "./tooltip-
|
|
4
|
-
import { I as X } from "./input-
|
|
5
|
-
import { u as Y, c as Z } from "./useInitCoreServices-
|
|
6
|
-
import { S as A, a as j, b as M, c as I, d as l, e as q } from "./select-
|
|
7
|
-
import { P as R, a as B, b as _ } from "./popover-
|
|
8
|
-
import { T as F, C as H } from "./calendar-
|
|
9
|
-
import { S as K } from "./scroll-area-
|
|
10
|
-
import { B as P
|
|
11
|
-
import { I as
|
|
3
|
+
import { B as s, X as U } from "./tooltip-BCtrEe0z.js";
|
|
4
|
+
import { I as X } from "./input-jYQ5VKNR.js";
|
|
5
|
+
import { u as Y, c as Z } from "./useInitCoreServices-D1WaWlaI.js";
|
|
6
|
+
import { S as A, a as j, b as M, c as I, d as l, e as q } from "./select-mDCun_IR.js";
|
|
7
|
+
import { P as R, a as B, b as _ } from "./popover-Cmlb7w3R.js";
|
|
8
|
+
import { T as F, C as H } from "./calendar-Dy3rVMW2.js";
|
|
9
|
+
import { S as K } from "./scroll-area-9fwpVNxT.js";
|
|
10
|
+
import { B as P } from "./bell-DAz8P0BR.js";
|
|
11
|
+
import { I as Q, C as W, S as ee, G as re } from "./settings-CvyjK75A.js";
|
|
12
12
|
import { T as te, C as y } from "./EzErrorBoundary-D4NBadES.js";
|
|
13
13
|
import { C as se } from "./circle-alert-B2AMDd8N.js";
|
|
14
14
|
import { C as S } from "./chevron-left-BFr8XZyF.js";
|
|
15
|
-
import { C as V } from "./isBefore-
|
|
16
|
-
import { f as D, C as ae } from "./index-
|
|
15
|
+
import { C as V } from "./isBefore-C3Y_wbk3.js";
|
|
16
|
+
import { f as D, C as ae } from "./index-C6NfgycP.js";
|
|
17
17
|
import { D as O } from "./download-panVHmk6.js";
|
|
18
18
|
const oe = () => {
|
|
19
19
|
const a = Y(), [o, u] = E([]), [g, p] = E(!1);
|
|
@@ -38,13 +38,13 @@ const oe = () => {
|
|
|
38
38
|
}, x = (t) => {
|
|
39
39
|
switch (t) {
|
|
40
40
|
case "success":
|
|
41
|
-
return /* @__PURE__ */ e(
|
|
41
|
+
return /* @__PURE__ */ e(W, { className: "h-4 w-4 text-green-600" });
|
|
42
42
|
case "error":
|
|
43
43
|
return /* @__PURE__ */ e(se, { className: "h-4 w-4 text-red-600" });
|
|
44
44
|
case "warning":
|
|
45
45
|
return /* @__PURE__ */ e(te, { className: "h-4 w-4 text-amber-600" });
|
|
46
46
|
default:
|
|
47
|
-
return /* @__PURE__ */ e(
|
|
47
|
+
return /* @__PURE__ */ e(Q, { className: "h-4 w-4 text-blue-600" });
|
|
48
48
|
}
|
|
49
49
|
};
|
|
50
50
|
return /* @__PURE__ */ r(R, { open: g, onOpenChange: p, children: [
|
|
@@ -129,7 +129,7 @@ const oe = () => {
|
|
|
129
129
|
] }, c);
|
|
130
130
|
case "Timezone":
|
|
131
131
|
return /* @__PURE__ */ r(s, { variant: "ghost", size: "sm", className: "hidden lg:flex gap-1 text-xs text-muted-foreground", children: [
|
|
132
|
-
/* @__PURE__ */ e(
|
|
132
|
+
/* @__PURE__ */ e(re, { className: "h-3.5 w-3.5" }),
|
|
133
133
|
/* @__PURE__ */ e("span", { children: "UTC" })
|
|
134
134
|
] }, c);
|
|
135
135
|
case "ActiveView":
|
|
@@ -224,7 +224,7 @@ const oe = () => {
|
|
|
224
224
|
z && /* @__PURE__ */ e(s, { variant: "ghost", size: "icon", onClick: z, title: "Export to CSV", children: /* @__PURE__ */ e(O, { className: "w-4 h-4 text-primary" }) }),
|
|
225
225
|
T && /* @__PURE__ */ e(s, { variant: "ghost", size: "icon", onClick: T, title: "Export to ICS", children: /* @__PURE__ */ e(V, { className: "w-4 h-4" }) })
|
|
226
226
|
] }),
|
|
227
|
-
/* @__PURE__ */ e(s, { variant: "ghost", size: "icon", className: "h-9 w-9 text-muted-foreground hover:text-foreground rounded-full", children: /* @__PURE__ */ e(
|
|
227
|
+
/* @__PURE__ */ e(s, { variant: "ghost", size: "icon", className: "h-9 w-9 text-muted-foreground hover:text-foreground rounded-full", children: /* @__PURE__ */ e(ee, { className: "w-5 h-5" }) })
|
|
228
228
|
] })
|
|
229
229
|
] });
|
|
230
230
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const ne=require("react/jsx-runtime"),D=require("react"),re=require("./useInitCoreServices-
|
|
1
|
+
"use strict";const ne=require("react/jsx-runtime"),D=require("react"),re=require("./useInitCoreServices-CwXv2p4S.cjs"),me=require("./useServiceState-BjpCjUn2.cjs"),ye=require("./useImperativeAPI-DbZ3owSV.cjs");function Pe(e){return[-e[0],-e[1]]}function U(e,t){return[e[0]+t[0],e[1]+t[1]]}function k(e,t){return[e[0]-t[0],e[1]-t[1]]}function j(e,t){return[e[0]*t,e[1]*t]}function xe(e,t){return[e[0]/t,e[1]/t]}function A(e){return[e[1],-e[0]]}function ae(e,t){return e[0]*t[0]+e[1]*t[1]}function ue(e,t){return e[0]===t[0]&&e[1]===t[1]}function Ee(e){return Math.hypot(e[0],e[1])}function we(e){return e[0]*e[0]+e[1]*e[1]}function le(e,t){return we(k(e,t))}function ce(e){return xe(e,Ee(e))}function fe(e,t){return Math.hypot(e[1]-t[1],e[0]-t[0])}function ee(e,t,o){const v=Math.sin(o),S=Math.cos(o),g=e[0]-t[0],s=e[1]-t[1],h=g*S-s*v,m=g*v+s*S;return[h+t[0],m+t[1]]}function se(e,t,o){return U(e,j(k(t,e),o))}function he(e,t,o){return U(e,j(t,o))}function pe(e,t,o,v=S=>S){return e*v(.5-t*(.5-o))}function Ce(e,t={}){const{streamline:o=.5,size:v=16,last:S=!1}=t;if(e.length===0)return[];const g=.15+(1-o)*.85;let s=Array.isArray(e[0])?e:e.map(({x:u,y:x,pressure:R=.5})=>[u,x,R]);if(s.length===2){const u=s[1];s=s.slice(0,-1);for(let x=1;x<5;x++)s.push(se(s[0],u,x/4))}s.length===1&&(s=[...s,[...U(s[0],[1,1]),...s[0].slice(2)]]);const h=[{point:[s[0][0],s[0][1]],pressure:s[0][2]>=0?s[0][2]:.25,vector:[1,1],distance:0,runningLength:0}];let m=!1,q=0,E=h[0];const T=s.length-1;for(let u=1;u<s.length;u++){const x=S&&u===T?s[u].slice(0,2):se(E.point,s[u],g);if(ue(E.point,x))continue;const R=fe(x,E.point);if(q+=R,u<T&&!m){if(q<v)continue;m=!0;let p=h[h.length-1],w=p.runningLength;for(let F=1;F<=u;F++){const C=s[F],I=se(p.point,C,g);if(ue(p.point,I))continue;const J=fe(I,p.point);w+=J,p={point:I,pressure:C[2]>=0?C[2]:.5,vector:ce(k(p.point,I)),distance:J,runningLength:w},h.push(p)}E=p,q=w;continue}E={point:x,pressure:s[u][2]>=0?s[u][2]:.5,vector:ce(k(E.point,x)),distance:R,runningLength:q},h.push(E)}return h[0].vector=h[1]?.vector||[0,0],h}const{min:Q,PI:Ie}=Math,ge=.275,te=Ie+1e-4;function Me(e,t={}){const{size:o=16,smoothing:v=.5,thinning:S=.5,simulatePressure:g=!0,easing:s=n=>n,start:h={},end:m={},last:q=!1}=t,{cap:E=!0,easing:T=n=>n*(2-n)}=h,{cap:u=!0,easing:x=n=>--n*n*n+1}=m;if(e.length===0||o<=0)return[];const R=e[e.length-1].runningLength,p=h.taper===!1?0:h.taper===!0?Math.max(o,R):h.taper,w=m.taper===!1?0:m.taper===!0?Math.max(o,R):m.taper,F=Math.pow(o*v,2),C=[],I=[];let J=e.slice(0,10).reduce((n,f)=>{let i=f.pressure;if(g){const c=Q(1,f.distance/o),K=Q(1,1-c);i=Q(1,n+(K-n)*(c*ge))}return(n+i)/2},e[0].pressure),d=pe(o,S,e[e.length-1].pressure,s),Z,b=e[0].vector,O=e[0].point,z=O,y=O,P=z,$=!1;for(let n=0;n<e.length;n++){let{pressure:f}=e[n];const{point:i,vector:c,distance:K,runningLength:V}=e[n];if(n<e.length-1&&R-V<3)continue;if(S){if(g){const H=Q(1,K/o),G=Q(1,1-H);f=Q(1,J+(G-J)*(H*ge))}d=pe(o,S,f,s)}else d=o/2;Z===void 0&&(Z=d);const oe=V<p?T(V/p):1,ie=R-V<w?x((R-V)/w):1;d=Math.max(.01,d*Math.min(oe,ie));const r=(n<e.length-1?e[n+1]:e[n]).vector,a=n<e.length-1?ae(c,r):1,Y=ae(c,b)<0&&!$,W=a!==null&&a<0;if(Y||W){const H=j(A(b),d);for(let G=1/13,N=0;N<=1;N+=G)y=ee(k(i,H),i,te*N),C.push(y),P=ee(U(i,H),i,te*-N),I.push(P);O=y,z=P,W&&($=!0);continue}if($=!1,n===e.length-1){const H=j(A(c),d);C.push(k(i,H)),I.push(U(i,H));continue}const B=j(A(se(r,c,a)),d);y=k(i,B),(n<=1||le(O,y)>F)&&(C.push(y),O=y),P=U(i,B),(n<=1||le(z,P)>F)&&(I.push(P),z=P),J=f,b=c}const l=e[0].point.slice(0,2),M=e.length>1?e[e.length-1].point.slice(0,2):U(e[0].point,[1,1]),X=[],_=[];if(e.length===1){if(!(p||w)||q){const n=he(l,ce(A(k(l,M))),-(Z||d)),f=[];for(let i=1/13,c=i;c<=1;c+=i)f.push(ee(n,l,te*2*c));return f}}else{if(!(p||w&&e.length===1))if(E)for(let f=1/13,i=f;i<=1;i+=f){const c=ee(I[0],l,te*i);X.push(c)}else{const f=k(C[0],I[0]),i=j(f,.5),c=j(f,.51);X.push(k(l,i),k(l,c),U(l,c),U(l,i))}const n=A(Pe(e[e.length-1].vector));if(w||p&&e.length===1)_.push(M);else if(u){const f=he(M,n,d);for(let i=1/29,c=i;c<1;c+=i)_.push(ee(f,M,te*3*c))}else _.push(U(M,j(n,d)),U(M,j(n,d*.99)),k(M,j(n,d*.99)),k(M,j(n,d)))}return C.concat(_,I.reverse(),X)}function de(e,t={}){return Me(Ce(e,t),t)}function ve(e){if(!e.length)return"";const t=e.reduce((o,[v,S],g,s)=>{const[h,m]=s[(g+1)%s.length];return o.push(v,S,(v+h)/2,(S+m)/2),o},["M",...e[0],"Q"]);return t.push("Z"),t.join(" ")}const ke=D.memo(({stroke:e,options:t,color:o})=>{const v=de(e,t);return ne.jsx("path",{d:ve(v),fill:o})}),Se=D.forwardRef((e,t)=>{const o=re.useEzServiceRegistry(),{width:v="100%",height:S=300,backgroundColor:g="transparent",strokeColor:s,minStrokeWidth:h=2.5,maxStrokeWidth:m=5,smoothing:q=.5,thinning:E=0,readOnly:T=!1,disabled:u=!1,className:x,style:R,onEnd:p,onChange:w,onSave:F,dir:C,...I}=e,d=me.useServiceState("I18nService")?.dir||"ltr",Z=C==="auto"||!C?d:C;re.useBaseComponent(e),re.useInitCoreServices();const[b,O]=D.useState([]),[z,y]=D.useState([]),[P,$]=D.useState([]),[l,M]=D.useState(-1),X=D.useRef(null),_=s||"#0321ab",n=D.useCallback(r=>{const a=P.slice(0,l+1);a.push(r),$(a),M(a.length-1),w&&w(r.map(L=>JSON.stringify(L)))},[P,l,w]),f=r=>{if(T||u)return;r.currentTarget.setPointerCapture(r.pointerId);const a=[r.nativeEvent.offsetX,r.nativeEvent.offsetY,r.pressure];O([a])},i=r=>{if(T||u||r.buttons!==1)return;const a=[r.nativeEvent.offsetX,r.nativeEvent.offsetY,r.pressure];O(L=>[...L,a])},c=r=>{if(!(T||u)&&b.length>0){const a=[...z,b];y(a),n(a),O([]),p&&p(r)}},K=D.useMemo(()=>({clear:()=>{y([]),O([]),n([]),o.get("NotificationService")?.show({type:"info",message:"Signature Cleared",duration:2e3})},undo:()=>{if(l>0){const r=l-1;M(r),y(P[r])}else l===0&&(M(-1),y([]))},redo:()=>{if(l<P.length-1){const r=l+1;M(r),y(P[r])}},canUndo:()=>l>=0,canRedo:()=>l<P.length-1,isEmpty:()=>z.length===0&&b.length===0,getSignature:()=>z,load:r=>{if(typeof r=="string"){try{const a=JSON.parse(r);Array.isArray(a)&&(y(a),n(a))}catch(a){console.error("Failed to parse signature data",a)}return}Array.isArray(r)&&(y(r),n(r))},save:async(r="png")=>{if(!X.current)return"";const a=new XMLSerializer().serializeToString(X.current),L=document.createElement("canvas"),Y=L.getContext("2d"),W=new Image,B=X.current.getBoundingClientRect();return L.width=B.width,L.height=B.height,new Promise((H,G)=>{W.onload=()=>{if(Y){g&&g!=="transparent"&&(Y.fillStyle=g,Y.fillRect(0,0,L.width,L.height)),Y.drawImage(W,0,0);const N=L.toDataURL(`image/${r}`);F&&F(N,r),o.get("NotificationService")?.show({type:"success",message:"Signature Saved Successfully",duration:3e3}),H(N)}else{const N=new Error("Canvas context not defined");o.get("NotificationService")?.show({type:"error",message:"Failed to Save Signature",duration:3e3}),G(N)}},W.onerror=N=>{o.get("NotificationService")?.show({type:"error",message:"Failed to Process Signature Image",duration:3e3}),G(N)},W.src="data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(a)))})}}),[P,l,z,b,g,F,n]);ye.useImperativeAPI(t,K);const V=D.useMemo(()=>({size:m,thinning:E,smoothing:q,start:{cap:!0,taper:!1},end:{cap:!0,taper:10}}),[m,E,q]),oe=D.useMemo(()=>z.map((r,a)=>ne.jsx(ke,{stroke:r,options:V,color:_},a)),[z,V,_]),ie=b.length>0&&ne.jsx("path",{d:ve(de(b,{size:m,thinning:E,smoothing:q,start:{cap:!0,taper:!1},end:{cap:!0,taper:10},simulatePressure:b.length>2})),fill:_,opacity:.8});return ne.jsx("div",{className:re.cn("ez-signature-container relative overflow-hidden select-none touch-none",x),style:{width:v,height:S,...R},dir:Z,...I,children:ne.jsxs("svg",{ref:X,className:"w-full h-full",style:{backgroundColor:g,touchAction:"none"},onPointerDown:f,onPointerMove:i,onPointerUp:c,onPointerLeave:c,children:[oe,ie]})})});Se.displayName="EzSignature";exports.EzSignature=Se;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as nt, jsxs as St } from "react/jsx-runtime";
|
|
2
2
|
import dt, { useState as et, useRef as yt, useCallback as Pt, useMemo as it } from "react";
|
|
3
|
-
import { u as Et, a as wt, b as xt, c as kt } from "./useInitCoreServices-
|
|
4
|
-
import { u as Ct } from "./useServiceState-
|
|
3
|
+
import { u as Et, a as wt, b as xt, c as kt } from "./useInitCoreServices-D1WaWlaI.js";
|
|
4
|
+
import { u as Ct } from "./useServiceState-VE-viK8b.js";
|
|
5
5
|
import { u as Mt } from "./useImperativeAPI-DXmCQvPL.js";
|
|
6
6
|
function Rt(t) {
|
|
7
7
|
return [-t[0], -t[1]];
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as a, jsxs as s } from "react/jsx-runtime";
|
|
2
2
|
import { useState as v, useEffect as y } from "react";
|
|
3
|
-
import { B as h } from "./tooltip-
|
|
4
|
-
import { I as N } from "./input-
|
|
5
|
-
import { L as k } from "./label-
|
|
3
|
+
import { B as h } from "./tooltip-BCtrEe0z.js";
|
|
4
|
+
import { I as N } from "./input-jYQ5VKNR.js";
|
|
5
|
+
import { L as k } from "./label-ClOW9UCt.js";
|
|
6
6
|
const S = ({
|
|
7
7
|
open: l,
|
|
8
8
|
onClose: o,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),u=require("react"),x=require("./tooltip-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),u=require("react"),x=require("./tooltip-B41iztKT.cjs"),p=require("./input-BgM_la4k.cjs"),v=require("./label-Dx6oDB-X.cjs"),y=({open:r,onClose:d,onSave:f,columns:l,initialData:i,isNew:a,onFormRender:c})=>{const[o,m]=u.useState({});if(u.useEffect(()=>{r&&(m(i||{}),c?.({form:{data:i||{},columns:l},mode:a?"Add":"Edit"}))},[r,i,l,a,c]),!r)return null;const g=()=>{f(o),d()},h=(t,s)=>{m(n=>({...n,[t]:s}))},b=l.filter(t=>t.accessorKey&&t.meta?.isEditable!==!1&&t.id!=="actions"&&t.id!=="select");return e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/50 backdrop-blur-sm animate-in fade-in-0",children:e.jsxs("div",{className:"bg-background w-full max-w-lg rounded-lg border shadow-lg p-6 space-y-6 animate-in zoom-in-95 slide-in-from-bottom-2",role:"dialog","aria-modal":"true",children:[e.jsxs("div",{className:"flex flex-col space-y-1.5 text-center sm:text-left",children:[e.jsx("h2",{className:"text-lg font-semibold leading-none tracking-tight",children:a?"Add New Record":"Edit Record"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:a?"Enter details for the new record.":"Make changes to the record below."})]}),e.jsx("div",{className:"grid gap-4 py-4 max-h-[60vh] overflow-y-auto pr-2",children:b.map(t=>{const s=t.accessorKey,n=o[s]??"";return e.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[e.jsx(v.Label,{htmlFor:s,className:"text-right",children:typeof t.header=="string"?t.header:s}),e.jsx(p.Input,{id:s,value:n,onChange:j=>h(s,j.target.value),className:"col-span-3"})]},s)})}),e.jsxs("div",{className:"flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",children:[e.jsx(x.Button,{variant:"outline",onClick:d,children:"Cancel"}),e.jsx(x.Button,{onClick:g,children:"Save Changes"})]})]})})};exports.EzTableEditDialog=y;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),g=require("@tanstack/react-table"),m=require("./useInitCoreServices-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),g=require("@tanstack/react-table"),m=require("./useInitCoreServices-CwXv2p4S.cjs"),u=({table:o,columnVirtualizer:t,density:l})=>{const c=o.getFooterGroups();if(c.length===0)return null;const f=t?.getVirtualItems()||o.getVisibleLeafColumns().map((n,s)=>({index:s})),i=t?.getVirtualItems()[0]?.start||0,d=t?t.getTotalSize()-(t.getVirtualItems()[t.getVirtualItems().length-1]?.end||0):0;return r.jsx(r.Fragment,{children:c.map(n=>r.jsxs("div",{className:m.cn("flex w-full border-t border-border bg-background/95 backdrop-blur-sm font-bold z-20","sticky bottom-0 shadow-[0_-2px_10px_rgba(0,0,0,0.05)]"),role:"rowgroup",children:[i>0&&r.jsx("div",{style:{flex:`0 0 ${i}px`}}),f.map(s=>{const e=n.headers[s.index];if(!e)return null;const a=o.options.meta;return r.jsx("div",{className:m.cn("px-4 flex items-center",a?.dir==="rtl"?"border-l border-border/50":"border-r border-border/50",l==="compact"&&"py-2 text-xs",l==="standard"&&"py-4 text-sm",l==="comfortable"&&"py-6 text-base",(e.column.columnDef.meta?.align==="right"||a?.dir==="rtl"&&!e.column.columnDef.meta?.align)&&"justify-end text-right",e.column.columnDef.meta?.align==="center"&&"justify-center text-center",(e.column.columnDef.meta?.align==="left"||!e.column.columnDef.meta?.align&&a?.dir!=="rtl")&&"justify-start text-left"),style:{width:e.getSize(),flex:`0 0 ${e.getSize()}px`},role:"cell",children:e.isPlaceholder?null:g.flexRender(e.column.columnDef.footer,e.getContext())},e.id)}),d>0&&r.jsx("div",{style:{flex:`0 0 ${d}px`}})]},n.id))})};u.displayName="EzTableFooter";exports.EzTableFooter=u;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as r, Fragment as g, jsxs as x } from "react/jsx-runtime";
|
|
2
2
|
import { flexRender as u } from "@tanstack/react-table";
|
|
3
|
-
import { c } from "./useInitCoreServices-
|
|
3
|
+
import { c } from "./useInitCoreServices-D1WaWlaI.js";
|
|
4
4
|
const p = ({ table: o, columnVirtualizer: t, density: l }) => {
|
|
5
5
|
const m = o.getFooterGroups();
|
|
6
6
|
if (m.length === 0) return null;
|