@lax-wp/design-system 0.13.33-beta.5 → 0.13.33-beta.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/data-display/infinite-table/PendingEditsFloatingBar.cjs.js +1 -1
- package/dist/components/data-display/infinite-table/PendingEditsFloatingBar.cjs.js.map +1 -1
- package/dist/components/data-display/infinite-table/PendingEditsFloatingBar.es.js +57 -56
- package/dist/components/data-display/infinite-table/PendingEditsFloatingBar.es.js.map +1 -1
- package/dist/components/data-display/infinite-table/body/cell/CheckboxCell.cjs.js +1 -1
- package/dist/components/data-display/infinite-table/body/cell/CheckboxCell.cjs.js.map +1 -1
- package/dist/components/data-display/infinite-table/body/cell/CheckboxCell.es.js +43 -42
- package/dist/components/data-display/infinite-table/body/cell/CheckboxCell.es.js.map +1 -1
- package/dist/components/data-display/infinite-table/body/cell/DataCell.cjs.js +1 -1
- package/dist/components/data-display/infinite-table/body/cell/DataCell.cjs.js.map +1 -1
- package/dist/components/data-display/infinite-table/body/cell/DataCell.es.js +141 -138
- package/dist/components/data-display/infinite-table/body/cell/DataCell.es.js.map +1 -1
- package/dist/components/data-display/infinite-table/body/cell/LoaderCell.cjs.js +1 -1
- package/dist/components/data-display/infinite-table/body/cell/LoaderCell.cjs.js.map +1 -1
- package/dist/components/data-display/infinite-table/body/cell/LoaderCell.es.js +10 -9
- package/dist/components/data-display/infinite-table/body/cell/LoaderCell.es.js.map +1 -1
- package/dist/components/data-display/infinite-table/body/cell/PendingEditCell.cjs.js +1 -1
- package/dist/components/data-display/infinite-table/body/cell/PendingEditCell.cjs.js.map +1 -1
- package/dist/components/data-display/infinite-table/body/cell/PendingEditCell.es.js +7 -7
- package/dist/components/data-display/infinite-table/body/cell/PendingEditCell.es.js.map +1 -1
- package/dist/components/data-display/infinite-table/body/cell/RowActionCell.cjs.js +1 -1
- package/dist/components/data-display/infinite-table/body/cell/RowActionCell.cjs.js.map +1 -1
- package/dist/components/data-display/infinite-table/body/cell/RowActionCell.es.js +1 -1
- package/dist/components/data-display/infinite-table/body/cell/RowActionCell.es.js.map +1 -1
- package/dist/components/data-display/infinite-table/body/cell/RowOptionsCell.cjs.js +1 -1
- package/dist/components/data-display/infinite-table/body/cell/RowOptionsCell.cjs.js.map +1 -1
- package/dist/components/data-display/infinite-table/body/cell/RowOptionsCell.es.js +1 -1
- package/dist/components/data-display/infinite-table/body/cell/RowOptionsCell.es.js.map +1 -1
- package/dist/components/data-display/infinite-table/body/rows/row.cjs.js +1 -1
- package/dist/components/data-display/infinite-table/body/rows/row.cjs.js.map +1 -1
- package/dist/components/data-display/infinite-table/body/rows/row.es.js +286 -281
- package/dist/components/data-display/infinite-table/body/rows/row.es.js.map +1 -1
- package/dist/components/data-display/infinite-table/constants.cjs.js +2 -0
- package/dist/components/data-display/infinite-table/constants.cjs.js.map +1 -0
- package/dist/components/data-display/infinite-table/constants.d.ts +41 -0
- package/dist/components/data-display/infinite-table/constants.es.js +27 -0
- package/dist/components/data-display/infinite-table/constants.es.js.map +1 -0
- package/dist/components/data-display/infinite-table/context.cjs.js.map +1 -1
- package/dist/components/data-display/infinite-table/context.d.ts +1 -0
- package/dist/components/data-display/infinite-table/context.es.js.map +1 -1
- package/dist/components/data-display/infinite-table/head/cell/index.cjs.js +1 -1
- package/dist/components/data-display/infinite-table/head/cell/index.cjs.js.map +1 -1
- package/dist/components/data-display/infinite-table/head/cell/index.es.js +36 -35
- package/dist/components/data-display/infinite-table/head/cell/index.es.js.map +1 -1
- package/dist/components/data-display/infinite-table/index.cjs.js +1 -1
- package/dist/components/data-display/infinite-table/index.cjs.js.map +1 -1
- package/dist/components/data-display/infinite-table/index.d.ts +1 -1
- package/dist/components/data-display/infinite-table/index.es.js +410 -406
- package/dist/components/data-display/infinite-table/index.es.js.map +1 -1
- package/dist/components/data-display/infinite-table/types.d.ts +22 -0
- package/dist/components/forms/base-input-field/BaseInputField.cjs.js +2 -2
- package/dist/components/forms/base-input-field/BaseInputField.cjs.js.map +1 -1
- package/dist/components/forms/base-input-field/BaseInputField.es.js +20 -20
- package/dist/components/forms/base-input-field/BaseInputField.es.js.map +1 -1
- package/dist/components/forms/creatable-select/CreatableSelect.cjs.js +1 -1
- package/dist/components/forms/creatable-select/CreatableSelect.cjs.js.map +1 -1
- package/dist/components/forms/creatable-select/CreatableSelect.es.js +7 -7
- package/dist/components/forms/creatable-select/CreatableSelect.es.js.map +1 -1
- package/dist/components/forms/currency-input/CurrencyInputField.cjs.js +1 -1
- package/dist/components/forms/currency-input/CurrencyInputField.cjs.js.map +1 -1
- package/dist/components/forms/currency-input/CurrencyInputField.es.js +12 -12
- package/dist/components/forms/currency-input/CurrencyInputField.es.js.map +1 -1
- package/dist/components/forms/date-time-field/DateTimeField.cjs.js +1 -1
- package/dist/components/forms/date-time-field/DateTimeField.cjs.js.map +1 -1
- package/dist/components/forms/date-time-field/DateTimeField.es.js +1 -1
- package/dist/components/forms/date-time-field/DateTimeField.es.js.map +1 -1
- package/dist/components/forms/dynamic-data-input/DynamicDataInput.cjs.js +1 -1
- package/dist/components/forms/dynamic-data-input/DynamicDataInput.cjs.js.map +1 -1
- package/dist/components/forms/dynamic-data-input/DynamicDataInput.es.js +7 -7
- package/dist/components/forms/dynamic-data-input/DynamicDataInput.es.js.map +1 -1
- package/dist/components/forms/dynamic-data-input/DynamicDataInputField.cjs.js +1 -1
- package/dist/components/forms/dynamic-data-input/DynamicDataInputField.cjs.js.map +1 -1
- package/dist/components/forms/dynamic-data-input/DynamicDataInputField.es.js +1 -1
- package/dist/components/forms/dynamic-data-input/DynamicDataInputField.es.js.map +1 -1
- package/dist/components/forms/formula-input/FormulaInput.cjs.js +1 -1
- package/dist/components/forms/formula-input/FormulaInput.cjs.js.map +1 -1
- package/dist/components/forms/formula-input/FormulaInput.es.js +10 -10
- package/dist/components/forms/formula-input/FormulaInput.es.js.map +1 -1
- package/dist/components/forms/input-field/InputField.cjs.js.map +1 -1
- package/dist/components/forms/input-field/InputField.es.js.map +1 -1
- package/dist/components/forms/master-data-input/MasterDataInputField.cjs.js +1 -1
- package/dist/components/forms/master-data-input/MasterDataInputField.cjs.js.map +1 -1
- package/dist/components/forms/master-data-input/MasterDataInputField.es.js +1 -1
- package/dist/components/forms/master-data-input/MasterDataInputField.es.js.map +1 -1
- package/dist/components/forms/percentage-input/PercentageInputField.cjs.js +2 -2
- package/dist/components/forms/percentage-input/PercentageInputField.cjs.js.map +1 -1
- package/dist/components/forms/percentage-input/PercentageInputField.es.js +19 -19
- package/dist/components/forms/percentage-input/PercentageInputField.es.js.map +1 -1
- package/dist/components/forms/select-field/SelectField.cjs.js +2 -2
- package/dist/components/forms/select-field/SelectField.cjs.js.map +1 -1
- package/dist/components/forms/select-field/SelectField.es.js +1 -1
- package/dist/components/forms/select-field/SelectField.es.js.map +1 -1
- package/dist/components/forms/text-area-field/TextAreaField.cjs.js +1 -1
- package/dist/components/forms/text-area-field/TextAreaField.cjs.js.map +1 -1
- package/dist/components/forms/text-area-field/TextAreaField.es.js +14 -14
- package/dist/components/forms/text-area-field/TextAreaField.es.js.map +1 -1
- package/dist/components/forms/toggle/Toggle.cjs.js +1 -1
- package/dist/components/forms/toggle/Toggle.cjs.js.map +1 -1
- package/dist/components/forms/toggle/Toggle.es.js +23 -23
- package/dist/components/forms/toggle/Toggle.es.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),W=require("../../../utils/formatters.cjs.js"),f=require("@mui/icons-material"),o=require("framer-motion"),r=require("react"),q=require("react-dom"),ee={hidden:{opacity:0,y:-8,scale:.95},visible:{opacity:1,y:0,scale:1,transition:{type:"spring",stiffness:400,damping:25}},exit:{opacity:0,y:-8,scale:.95,transition:{duration:.1}}},L={hidden:{opacity:0},visible:{opacity:1,transition:{staggerChildren:.03,delayChildren:.05}}},R={hidden:{opacity:0,y:-8},visible:{opacity:1,y:0,transition:{type:"spring",stiffness:400,damping:25}}},te=({pendingEditsCount:b,pendingEditsList:m,rowsWithPendingEdits:u,fieldOperationLoading:d,onClearAll:P,onSaveAll:E,onScrollToCell:K})=>{const[_,N]=r.useState(!1),[x,S]=r.useState(!1),[s,I]=r.useState(null),[l,z]=r.useState(null),[D,F]=r.useState(!1),[i,w]=r.useState(""),[h,C]=r.useState(!1),[g,U]=r.useState(null),v=r.useRef(null),c=r.useRef(null),y=r.useRef(null),T=r.useRef(null),M=r.useRef(null),$=r.useRef(null),G=r.useMemo(()=>s?m.filter(e=>e.rowId===s):m,[m,s]),B=r.useMemo(()=>{if(!i)return u;const e=i.toLowerCase();return u.filter(a=>`row ${a.rowIndex+1}`.toLowerCase().includes(e))},[u,i]),J=r.useMemo(()=>{if(!s)return`All Rows (${m.length})`;const e=u.find(a=>a.rowId===s);return e?`Row ${e.rowIndex+1} (${e.editCount})`:`All Rows (${m.length})`},[s,u,m.length]);r.useEffect(()=>{s&&!u.find(e=>e.rowId===s)&&I(null)},[u,s]),r.useEffect(()=>{const e=a=>{const n=a.target;!T.current?.contains(n)&&!$.current?.contains(n)&&(C(!1),w(""))};return h&&document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[h]);const A=r.useCallback(()=>{v.current&&(clearTimeout(v.current),v.current=null),N(!0)},[]),H=r.useCallback(()=>{v.current=setTimeout(()=>N(!1),300)},[]),k=r.useCallback((e,a,n,j)=>{const p=Math.max(0,window.innerWidth-n),O=Math.max(0,window.innerHeight-j);return{x:Math.min(Math.max(e,0),p),y:Math.min(Math.max(a,0),O)}},[]),V=r.useCallback(e=>{e.preventDefault();const a=e.currentTarget.closest(".pending-edits-floating-bar");if(!a)return;const n=a.getBoundingClientRect();c.current={x:e.clientX,y:e.clientY,barX:l?.x??n.left,barY:l?.y??n.top,barWidth:n.width,barHeight:n.height},F(!0)},[l]);r.useEffect(()=>{if(!D)return;const e=n=>{if(!c.current)return;const j=c.current.barX+n.clientX-c.current.x,p=c.current.barY+n.clientY-c.current.y;z(k(j,p,c.current.barWidth,c.current.barHeight))},a=()=>{F(!1),c.current=null};return document.addEventListener("mousemove",e),document.addEventListener("mouseup",a),()=>{document.removeEventListener("mousemove",e),document.removeEventListener("mouseup",a)}},[D,k]),r.useEffect(()=>{if(!l||!y.current)return;const e=()=>{if(!y.current)return;const a=y.current.getBoundingClientRect(),n=k(l.x,l.y,a.width,a.height);(n.x!==l.x||n.y!==l.y)&&z(n)};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[l,k]);const X=(e,a)=>{if(typeof e=="boolean")return e?"Yes":"No";if(e==null||e==="")return"-";const n=String(e);if(/^\d{4}-\d{2}-\d{2}(T\d{2}:\d{2}(:\d{2})?)?/.test(n)){const p=n.includes("T");return W.formatDate(n,{withTime:p,skipTimezone:!0})||n}return a?`${n} ${a}`:n},Q=e=>{N(!1),K(e.rowId,e.columnKey,e.rowIndex)},Y=e=>{I(e),C(!1),w("")};if(b===0)return null;const Z=t.jsxs(o.motion.div,{ref:y,className:"pending-edits-floating-bar fixed z-[9999]",style:{zIndex:2147483646,...l?{left:l.x,top:l.y}:{bottom:24,left:"50%",transform:"translateX(-50%)"}},initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},transition:{type:"spring",stiffness:300,damping:25},children:[t.jsx(o.AnimatePresence,{children:_&&!x&&t.jsx(o.motion.div,{className:"absolute w-80",style:{bottom:"100%",left:"50%",marginLeft:"-160px",marginBottom:"4px"},initial:{opacity:0,y:10,scale:.95},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:10,scale:.95},transition:{type:"spring",stiffness:300,damping:24},onMouseEnter:A,onMouseLeave:H,children:t.jsxs("div",{className:"bg-white dark:bg-black-700 rounded-lg shadow-xl border border-neutral-200 dark:border-black-600 py-2 overflow-hidden",children:[t.jsx("div",{className:"px-3 py-1.5 text-xs font-semibold text-neutral-500 dark:text-neutral-400 uppercase tracking-wider border-b border-neutral-100 dark:border-black-600",children:"Pending Changes"}),u.length>1&&t.jsx("div",{className:"px-3 py-2 border-b border-neutral-100 dark:border-black-600",ref:T,children:t.jsxs("div",{className:"relative",children:[t.jsxs("button",{ref:M,onClick:()=>{M.current&&U(M.current.getBoundingClientRect()),C(!h)},className:"w-full text-xs px-2 py-1.5 rounded border border-neutral-200 dark:border-black-500 bg-neutral-50 dark:bg-black-600 text-neutral-700 dark:text-neutral-200 focus:outline-none focus:ring-1 focus:ring-primary-500 flex items-center justify-between gap-2",children:[t.jsx("span",{className:"truncate",children:J}),t.jsx(o.motion.div,{animate:{rotate:h?180:0},transition:{duration:.2},children:t.jsx(f.KeyboardArrowDownRounded,{sx:{fontSize:16},className:"text-neutral-400"})})]}),h&&g&&q.createPortal(t.jsx(o.AnimatePresence,{children:t.jsxs(o.motion.div,{ref:$,className:"fixed bg-white dark:bg-black-700 rounded-lg shadow-xl border border-neutral-200 dark:border-black-600 overflow-hidden",style:{zIndex:2147483647,top:g.bottom+4,left:g.left,width:g.width},variants:ee,initial:"hidden",animate:"visible",exit:"exit",children:[t.jsx("div",{className:"p-2 border-b border-neutral-100 dark:border-black-600",children:t.jsxs("div",{className:"relative flex items-center",children:[t.jsx(f.SearchRounded,{sx:{fontSize:14},className:"absolute left-2 text-neutral-400 dark:text-neutral-500 z-10 pointer-events-none"}),t.jsx("input",{type:"text",value:i,onChange:e=>w(e.target.value),placeholder:"Search rows...",className:"w-full text-xs pl-7 pr-7 py-1.5 rounded border border-neutral-200 dark:border-black-500 bg-white dark:bg-black-600 text-neutral-700 dark:text-neutral-200 focus:outline-none focus:ring-1 focus:ring-primary-500 placeholder:text-neutral-400",autoFocus:!0}),i&&t.jsx("button",{onClick:()=>w(""),className:"absolute right-2 z-10 text-neutral-400 hover:text-neutral-600 dark:hover:text-neutral-300",children:t.jsx(f.CloseRounded,{sx:{fontSize:14}})})]})}),t.jsxs(o.motion.div,{className:"max-h-40 overflow-y-auto",variants:L,initial:"hidden",animate:"visible",children:[(!i||"all rows".includes(i.toLowerCase()))&&t.jsxs(o.motion.button,{variants:R,onClick:()=>Y(null),className:`w-full text-left px-3 py-2 text-xs transition-colors ${s?"text-neutral-700 dark:text-neutral-200 hover:bg-neutral-50 dark:hover:bg-black-600":"bg-primary-50 dark:bg-primary-900/30 text-primary-700 dark:text-primary-300"}`,children:["All Rows (",m.length," changes)"]}),B.map(e=>t.jsxs(o.motion.button,{variants:R,onClick:()=>Y(e.rowId),className:`w-full text-left px-3 py-2 text-xs transition-colors ${s===e.rowId?"bg-primary-50 dark:bg-primary-900/30 text-primary-700 dark:text-primary-300":"text-neutral-700 dark:text-neutral-200 hover:bg-neutral-50 dark:hover:bg-black-600"}`,children:["Row ",e.rowIndex+1," (",e.editCount," ",e.editCount===1?"change":"changes",")"]},e.rowId)),B.length===0&&i&&!"all rows".includes(i.toLowerCase())&&t.jsx(o.motion.div,{variants:R,className:"px-3 py-2 text-xs text-neutral-500 dark:text-neutral-400",children:"No rows found"})]})]})}),document.body)]})}),t.jsx(o.motion.div,{className:"max-h-52 overflow-y-auto",variants:L,initial:"hidden",animate:"visible",children:G?.map((e,a)=>t.jsxs(o.motion.button,{variants:R,onClick:()=>Q(e),className:"w-full px-3 py-2 text-left hover:bg-neutral-50 dark:hover:bg-black-600 transition-colors",whileHover:{backgroundColor:"rgba(0,0,0,0.03)"},whileTap:{scale:.98},children:[t.jsxs("div",{className:"text-xs font-bold text-neutral-700 dark:text-neutral-300 mb-1",children:[e.fieldName," ",!s&&t.jsxs("span",{className:"font-normal text-neutral-500 dark:text-neutral-400",children:["(Row ",e.rowIndex+1,")"]})]}),t.jsxs("div",{className:"flex items-center gap-1.5 text-sm",children:[t.jsx("span",{className:"text-neutral-400 dark:text-neutral-500 line-through truncate max-w-[100px]",children:X(e.originalValue,e.originalMeta?.currency_code)}),t.jsx("span",{className:"text-neutral-400 dark:text-neutral-500 flex-shrink-0",children:"→"}),t.jsx("span",{className:"text-primary-600 dark:text-primary-400 font-medium truncate max-w-[100px]",children:X(e.value,e.meta?.currency_code)})]})]},`${e.rowId}-${e.columnKey}-${a}`))})]})})}),t.jsxs(o.motion.div,{className:"flex items-center bg-white dark:bg-black-700 shadow-lg border border-neutral-200 dark:border-black-600 overflow-hidden",animate:{padding:x?"8px":"12px 16px",gap:x?"0px":"12px",borderRadius:x?"9999px":"8px"},transition:{type:"spring",stiffness:300,damping:25},children:[t.jsx(o.AnimatePresence,{mode:"wait",children:x?t.jsx(o.motion.div,{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.8},onMouseDown:V,onClick:()=>S(!1),className:"flex items-center justify-center cursor-grab active:cursor-grabbing flex-shrink-0",style:{width:"32px",height:"32px",borderRadius:"9999px",backgroundColor:"var(--color-primary-600)",color:"white"},title:"Drag to move / Click to expand",whileHover:{backgroundColor:"var(--color-primary-700)",scale:1.05},whileTap:{scale:.95},children:t.jsx("span",{className:"text-xs font-bold",children:b})},"minimized"):t.jsx(o.motion.button,{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.8},onClick:()=>S(!0),className:"flex items-center justify-center flex-shrink-0",style:{width:"24px",height:"24px",borderRadius:"4px",backgroundColor:"transparent",color:"var(--color-neutral-400)"},title:"Minimize",whileHover:{backgroundColor:"var(--color-neutral-100)",color:"var(--color-neutral-600)"},whileTap:{scale:.9},children:t.jsx(f.RemoveOutlined,{sx:{fontSize:16}})},"minimize-btn")}),t.jsxs(o.motion.div,{className:"flex items-center gap-3",animate:{width:x?0:"auto",opacity:x?0:1},transition:{type:"spring",stiffness:300,damping:25},style:{overflow:"hidden",pointerEvents:x?"none":"auto"},children:[t.jsx("div",{onMouseDown:V,className:"cursor-grab active:cursor-grabbing text-neutral-400 dark:text-neutral-500 hover:text-neutral-600 dark:hover:text-neutral-300 flex items-center",title:"Drag to move",children:t.jsx(f.DragIndicator,{sx:{fontSize:18}})}),t.jsx("div",{className:"relative",onMouseEnter:A,onMouseLeave:H,children:t.jsxs("span",{className:"text-sm font-medium text-neutral-700 dark:text-neutral-200 cursor-pointer hover:text-primary-600 dark:hover:text-primary-400 whitespace-nowrap",children:[b," unsaved ",b===1?"change":"changes"]})}),t.jsx("div",{className:"h-4 w-px bg-neutral-200 dark:bg-black-600 flex-shrink-0"}),t.jsx(o.motion.button,{onClick:P,disabled:!!d,className:`px-3 py-1.5 text-sm font-medium rounded-md whitespace-nowrap flex-shrink-0 ${d?"text-neutral-400 dark:text-neutral-500 cursor-not-allowed":"text-neutral-600 dark:text-neutral-300 hover:bg-neutral-100 dark:hover:bg-black-600"}`,whileHover:d?void 0:{scale:1.02},whileTap:d?void 0:{scale:.98},children:"Cancel"}),t.jsx(o.motion.button,{onClick:E,disabled:!!d,className:`px-3 py-1.5 text-sm font-medium rounded-md whitespace-nowrap flex-shrink-0 ${d?"text-white bg-primary-400 cursor-not-allowed":"text-white bg-primary-600 hover:bg-primary-700"}`,whileHover:d?void 0:{scale:1.02},whileTap:d?void 0:{scale:.98},children:"Save All"})]})]})]});return q.createPortal(Z,document.body)};exports.PendingEditsFloatingBar=te;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),ee=require("../../../utils/formatters.cjs.js"),f=require("@mui/icons-material"),o=require("framer-motion"),r=require("react"),V=require("react-dom"),q=require("./constants.cjs.js"),te={hidden:{opacity:0,y:-8,scale:.95},visible:{opacity:1,y:0,scale:1,transition:{type:"spring",stiffness:400,damping:25}},exit:{opacity:0,y:-8,scale:.95,transition:{duration:.1}}},X={hidden:{opacity:0},visible:{opacity:1,transition:{staggerChildren:.03,delayChildren:.05}}},R={hidden:{opacity:0,y:-8},visible:{opacity:1,y:0,transition:{type:"spring",stiffness:400,damping:25}}},re=({pendingEditsCount:b,pendingEditsList:m,rowsWithPendingEdits:u,fieldOperationLoading:d,onClearAll:Y,onSaveAll:O,onScrollToCell:E})=>{const[G,N]=r.useState(!1),[x,I]=r.useState(!1),[s,S]=r.useState(null),[l,T]=r.useState(null),[F,z]=r.useState(!1),[i,w]=r.useState(""),[h,C]=r.useState(!1),[g,K]=r.useState(null),v=r.useRef(null),c=r.useRef(null),y=r.useRef(null),D=r.useRef(null),M=r.useRef(null),A=r.useRef(null),U=r.useMemo(()=>s?m.filter(e=>e.rowId===s):m,[m,s]),B=r.useMemo(()=>{if(!i)return u;const e=i.toLowerCase();return u.filter(a=>`row ${a.rowIndex+1}`.toLowerCase().includes(e))},[u,i]),J=r.useMemo(()=>{if(!s)return`All Rows (${m.length})`;const e=u.find(a=>a.rowId===s);return e?`Row ${e.rowIndex+1} (${e.editCount})`:`All Rows (${m.length})`},[s,u,m.length]);r.useEffect(()=>{s&&!u.find(e=>e.rowId===s)&&S(null)},[u,s]),r.useEffect(()=>{const e=a=>{const n=a.target;!D.current?.contains(n)&&!A.current?.contains(n)&&(C(!1),w(""))};return h&&document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[h]);const $=r.useCallback(()=>{v.current&&(clearTimeout(v.current),v.current=null),N(!0)},[]),L=r.useCallback(()=>{v.current=setTimeout(()=>N(!1),300)},[]),k=r.useCallback((e,a,n,j)=>{const p=Math.max(0,window.innerWidth-n),W=Math.max(0,window.innerHeight-j);return{x:Math.min(Math.max(e,0),p),y:Math.min(Math.max(a,0),W)}},[]),_=r.useCallback(e=>{e.preventDefault();const a=e.currentTarget.closest(".pending-edits-floating-bar");if(!a)return;const n=a.getBoundingClientRect();c.current={x:e.clientX,y:e.clientY,barX:l?.x??n.left,barY:l?.y??n.top,barWidth:n.width,barHeight:n.height},z(!0)},[l]);r.useEffect(()=>{if(!F)return;const e=n=>{if(!c.current)return;const j=c.current.barX+n.clientX-c.current.x,p=c.current.barY+n.clientY-c.current.y;T(k(j,p,c.current.barWidth,c.current.barHeight))},a=()=>{z(!1),c.current=null};return document.addEventListener("mousemove",e),document.addEventListener("mouseup",a),()=>{document.removeEventListener("mousemove",e),document.removeEventListener("mouseup",a)}},[F,k]),r.useEffect(()=>{if(!l||!y.current)return;const e=()=>{if(!y.current)return;const a=y.current.getBoundingClientRect(),n=k(l.x,l.y,a.width,a.height);(n.x!==l.x||n.y!==l.y)&&T(n)};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[l,k]);const H=(e,a)=>{if(typeof e=="boolean")return e?"Yes":"No";if(e==null||e==="")return"-";const n=String(e);if(/^\d{4}-\d{2}-\d{2}(T\d{2}:\d{2}(:\d{2})?)?/.test(n)){const p=n.includes("T");return ee.formatDate(n,{withTime:p,skipTimezone:!0})||n}return a?`${n} ${a}`:n},Q=e=>{N(!1),E(e.rowId,e.columnKey,e.rowIndex)},P=e=>{S(e),C(!1),w("")};if(b===0)return null;const Z=t.jsxs(o.motion.div,{ref:y,className:"pending-edits-floating-bar fixed z-[9999]",style:{zIndex:2147483646,...l?{left:l.x,top:l.y}:{bottom:24,left:"50%",transform:"translateX(-50%)"}},initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},transition:{type:"spring",stiffness:300,damping:25},children:[t.jsx(o.AnimatePresence,{children:G&&!x&&t.jsx(o.motion.div,{className:"absolute w-80",style:{bottom:"100%",left:"50%",marginLeft:q.FLOATING_BAR_TOOLTIP_MARGIN_LEFT,marginBottom:q.FLOATING_BAR_TOOLTIP_MARGIN_BOTTOM},initial:{opacity:0,y:10,scale:.95},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:10,scale:.95},transition:{type:"spring",stiffness:300,damping:24},onMouseEnter:$,onMouseLeave:L,children:t.jsxs("div",{className:"bg-white dark:bg-black-700 rounded-lg shadow-xl border border-neutral-200 dark:border-black-600 py-2 overflow-hidden",children:[t.jsx("div",{className:"px-3 py-1.5 text-xs font-semibold text-neutral-500 dark:text-neutral-400 uppercase tracking-wider border-b border-neutral-100 dark:border-black-600",children:"Pending Changes"}),u.length>1&&t.jsx("div",{className:"px-3 py-2 border-b border-neutral-100 dark:border-black-600",ref:D,children:t.jsxs("div",{className:"relative",children:[t.jsxs("button",{ref:M,onClick:()=>{M.current&&K(M.current.getBoundingClientRect()),C(!h)},className:"w-full text-xs px-2 py-1.5 rounded border border-neutral-200 dark:border-black-500 bg-neutral-50 dark:bg-black-600 text-neutral-700 dark:text-neutral-200 focus:outline-none focus:ring-1 focus:ring-primary-500 flex items-center justify-between gap-2",children:[t.jsx("span",{className:"truncate",children:J}),t.jsx(o.motion.div,{animate:{rotate:h?180:0},transition:{duration:.2},children:t.jsx(f.KeyboardArrowDownRounded,{sx:{fontSize:16},className:"text-neutral-400"})})]}),h&&g&&V.createPortal(t.jsx(o.AnimatePresence,{children:t.jsxs(o.motion.div,{ref:A,className:"fixed bg-white dark:bg-black-700 rounded-lg shadow-xl border border-neutral-200 dark:border-black-600 overflow-hidden",style:{zIndex:2147483647,top:g.bottom+4,left:g.left,width:g.width},variants:te,initial:"hidden",animate:"visible",exit:"exit",children:[t.jsx("div",{className:"p-2 border-b border-neutral-100 dark:border-black-600",children:t.jsxs("div",{className:"relative flex items-center",children:[t.jsx(f.SearchRounded,{sx:{fontSize:14},className:"absolute left-2 text-neutral-400 dark:text-neutral-500 z-10 pointer-events-none"}),t.jsx("input",{type:"text",value:i,onChange:e=>w(e.target.value),placeholder:"Search rows...",className:"w-full text-xs pl-7 pr-7 py-1.5 rounded border border-neutral-200 dark:border-black-500 bg-white dark:bg-black-600 text-neutral-700 dark:text-neutral-200 focus:outline-none focus:ring-1 focus:ring-primary-500 placeholder:text-neutral-400",autoFocus:!0}),i&&t.jsx("button",{onClick:()=>w(""),className:"absolute right-2 z-10 text-neutral-400 hover:text-neutral-600 dark:hover:text-neutral-300",children:t.jsx(f.CloseRounded,{sx:{fontSize:14}})})]})}),t.jsxs(o.motion.div,{className:"max-h-40 overflow-y-auto",variants:X,initial:"hidden",animate:"visible",children:[(!i||"all rows".includes(i.toLowerCase()))&&t.jsxs(o.motion.button,{variants:R,onClick:()=>P(null),className:`w-full text-left px-3 py-2 text-xs transition-colors ${s?"text-neutral-700 dark:text-neutral-200 hover:bg-neutral-50 dark:hover:bg-black-600":"bg-primary-50 dark:bg-primary-900/30 text-primary-700 dark:text-primary-300"}`,children:["All Rows (",m.length," changes)"]}),B.map(e=>t.jsxs(o.motion.button,{variants:R,onClick:()=>P(e.rowId),className:`w-full text-left px-3 py-2 text-xs transition-colors ${s===e.rowId?"bg-primary-50 dark:bg-primary-900/30 text-primary-700 dark:text-primary-300":"text-neutral-700 dark:text-neutral-200 hover:bg-neutral-50 dark:hover:bg-black-600"}`,children:["Row ",e.rowIndex+1," (",e.editCount," ",e.editCount===1?"change":"changes",")"]},e.rowId)),B.length===0&&i&&!"all rows".includes(i.toLowerCase())&&t.jsx(o.motion.div,{variants:R,className:"px-3 py-2 text-xs text-neutral-500 dark:text-neutral-400",children:"No rows found"})]})]})}),document.body)]})}),t.jsx(o.motion.div,{className:"max-h-52 overflow-y-auto",variants:X,initial:"hidden",animate:"visible",children:U?.map((e,a)=>t.jsxs(o.motion.button,{variants:R,onClick:()=>Q(e),className:"w-full px-3 py-2 text-left hover:bg-neutral-50 dark:hover:bg-black-600 transition-colors",whileHover:{backgroundColor:"rgba(0,0,0,0.03)"},whileTap:{scale:.98},children:[t.jsxs("div",{className:"text-xs font-bold text-neutral-700 dark:text-neutral-300 mb-1",children:[e.fieldName," ",!s&&t.jsxs("span",{className:"font-normal text-neutral-500 dark:text-neutral-400",children:["(Row ",e.rowIndex+1,")"]})]}),t.jsxs("div",{className:"flex items-center gap-1.5 text-sm",children:[t.jsx("span",{className:"text-neutral-400 dark:text-neutral-500 line-through truncate max-w-[100px]",children:H(e.originalValue,e.originalMeta?.currency_code)}),t.jsx("span",{className:"text-neutral-400 dark:text-neutral-500 flex-shrink-0",children:"→"}),t.jsx("span",{className:"text-primary-600 dark:text-primary-400 font-medium truncate max-w-[100px]",children:H(e.value,e.meta?.currency_code)})]})]},`${e.rowId}-${e.columnKey}-${a}`))})]})})}),t.jsxs(o.motion.div,{className:"flex items-center bg-white dark:bg-black-700 shadow-lg border border-neutral-200 dark:border-black-600 overflow-hidden",animate:{padding:x?"8px":"12px 16px",gap:x?"0px":"12px",borderRadius:x?"9999px":"8px"},transition:{type:"spring",stiffness:300,damping:25},children:[t.jsx(o.AnimatePresence,{mode:"wait",children:x?t.jsx(o.motion.div,{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.8},onMouseDown:_,onClick:()=>I(!1),className:"flex items-center justify-center cursor-grab active:cursor-grabbing flex-shrink-0",style:{width:"32px",height:"32px",borderRadius:"9999px",backgroundColor:"var(--color-primary-600)",color:"white"},title:"Drag to move / Click to expand",whileHover:{backgroundColor:"var(--color-primary-700)",scale:1.05},whileTap:{scale:.95},children:t.jsx("span",{className:"text-xs font-bold",children:b})},"minimized"):t.jsx(o.motion.button,{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.8},onClick:()=>I(!0),className:"flex items-center justify-center flex-shrink-0",style:{width:"24px",height:"24px",borderRadius:"4px",backgroundColor:"transparent",color:"var(--color-neutral-400)"},title:"Minimize",whileHover:{backgroundColor:"var(--color-neutral-100)",color:"var(--color-neutral-600)"},whileTap:{scale:.9},children:t.jsx(f.RemoveOutlined,{sx:{fontSize:16}})},"minimize-btn")}),t.jsxs(o.motion.div,{className:"flex items-center gap-3",animate:{width:x?0:"auto",opacity:x?0:1},transition:{type:"spring",stiffness:300,damping:25},style:{overflow:"hidden",pointerEvents:x?"none":"auto"},children:[t.jsx("div",{onMouseDown:_,className:"cursor-grab active:cursor-grabbing text-neutral-400 dark:text-neutral-500 hover:text-neutral-600 dark:hover:text-neutral-300 flex items-center",title:"Drag to move",children:t.jsx(f.DragIndicator,{sx:{fontSize:18}})}),t.jsx("div",{className:"relative",onMouseEnter:$,onMouseLeave:L,children:t.jsxs("span",{className:"text-sm font-medium text-neutral-700 dark:text-neutral-200 cursor-pointer hover:text-primary-600 dark:hover:text-primary-400 whitespace-nowrap",children:[b," unsaved ",b===1?"change":"changes"]})}),t.jsx("div",{className:"h-4 w-px bg-neutral-200 dark:bg-black-600 flex-shrink-0"}),t.jsx(o.motion.button,{onClick:Y,disabled:!!d,className:`px-3 py-1.5 text-sm font-medium rounded-md whitespace-nowrap flex-shrink-0 ${d?"text-neutral-400 dark:text-neutral-500 cursor-not-allowed":"text-neutral-600 dark:text-neutral-300 hover:bg-neutral-100 dark:hover:bg-black-600"}`,whileHover:d?void 0:{scale:1.02},whileTap:d?void 0:{scale:.98},children:"Cancel"}),t.jsx(o.motion.button,{onClick:O,disabled:!!d,className:`px-3 py-1.5 text-sm font-medium rounded-md whitespace-nowrap flex-shrink-0 ${d?"text-white bg-primary-400 cursor-not-allowed":"text-white bg-primary-600 hover:bg-primary-700"}`,whileHover:d?void 0:{scale:1.02},whileTap:d?void 0:{scale:.98},children:"Save All"})]})]})]});return V.createPortal(Z,document.body)};exports.PendingEditsFloatingBar=re;
|
|
2
2
|
//# sourceMappingURL=PendingEditsFloatingBar.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PendingEditsFloatingBar.cjs.js","sources":["../../../../src/components/data-display/infinite-table/PendingEditsFloatingBar.tsx"],"sourcesContent":["import { formatDate } from '../../../utils/formatters';\nimport { CloseRounded, DragIndicator, KeyboardArrowDownRounded, RemoveOutlined, SearchRounded } from '@mui/icons-material';\nimport { AnimatePresence, motion } from 'framer-motion';\nimport React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport { createPortal } from 'react-dom';\n\ninterface PendingEdit {\n rowId: string;\n columnKey: string;\n fieldName: string;\n value: unknown;\n originalValue: unknown;\n meta?: { currency_code?: string | null; [key: string]: unknown | null } | null;\n originalMeta?: { currency_code?: string | null; [key: string]: unknown | null } | null;\n rowIndex: number;\n}\n\ninterface RowWithPendingEdits {\n rowId: string;\n rowIndex: number;\n editCount: number;\n}\n\ninterface PendingEditsFloatingBarProps {\n pendingEditsCount: number;\n pendingEditsList: PendingEdit[];\n rowsWithPendingEdits: RowWithPendingEdits[];\n fieldOperationLoading: string | null;\n onClearAll: () => void;\n onSaveAll: () => void;\n onScrollToCell: (rowId: string, columnKey: string, rowIndex: number) => void;\n}\n\nconst rowFilterDropdownVariants = {\n hidden: { opacity: 0, y: -8, scale: 0.95 },\n visible: { opacity: 1, y: 0, scale: 1, transition: { type: 'spring' as const, stiffness: 400, damping: 25 } },\n exit: { opacity: 0, y: -8, scale: 0.95, transition: { duration: 0.1 } },\n};\n\nconst listContainerVariants = {\n hidden: { opacity: 0 },\n visible: { opacity: 1, transition: { staggerChildren: 0.03, delayChildren: 0.05 } },\n};\n\nconst listItemVariants = {\n hidden: { opacity: 0, y: -8 },\n visible: { opacity: 1, y: 0, transition: { type: 'spring' as const, stiffness: 400, damping: 25 } },\n};\n\nexport const PendingEditsFloatingBar: React.FC<PendingEditsFloatingBarProps> = ({\n pendingEditsCount, pendingEditsList, rowsWithPendingEdits, fieldOperationLoading, onClearAll, onSaveAll, onScrollToCell,\n}) => {\n const [showDropdown, setShowDropdown] = useState(false);\n const [isMinimized, setIsMinimized] = useState(false);\n const [rowFilter, setRowFilter] = useState<string | null>(null);\n const [position, setPosition] = useState<{ x: number; y: number } | null>(null);\n const [isDragging, setIsDragging] = useState(false);\n const [rowFilterSearch, setRowFilterSearch] = useState('');\n const [showRowFilterDropdown, setShowRowFilterDropdown] = useState(false);\n const [rowFilterButtonRect, setRowFilterButtonRect] = useState<DOMRect | null>(null);\n\n const dropdownTimeoutRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n const dragStartRef = useRef<{ x: number; y: number; barX: number; barY: number; barWidth: number; barHeight: number } | null>(null);\n const floatingBarRef = useRef<HTMLDivElement>(null);\n const rowFilterRef = useRef<HTMLDivElement>(null);\n const rowFilterButtonRef = useRef<HTMLButtonElement>(null);\n const rowFilterDropdownRef = useRef<HTMLDivElement>(null);\n\n const filteredPendingEditsList = useMemo(() => {\n if (!rowFilter) return pendingEditsList;\n return pendingEditsList.filter((edit) => edit.rowId === rowFilter);\n }, [pendingEditsList, rowFilter]);\n\n const filteredRowOptions = useMemo(() => {\n if (!rowFilterSearch) return rowsWithPendingEdits;\n const searchLower = rowFilterSearch.toLowerCase();\n return rowsWithPendingEdits.filter((row) => `row ${row.rowIndex + 1}`.toLowerCase().includes(searchLower));\n }, [rowsWithPendingEdits, rowFilterSearch]);\n\n const selectedRowLabel = useMemo(() => {\n if (!rowFilter) return `All Rows (${pendingEditsList.length})`;\n const row = rowsWithPendingEdits.find((r) => r.rowId === rowFilter);\n if (!row) return `All Rows (${pendingEditsList.length})`;\n return `Row ${row.rowIndex + 1} (${row.editCount})`;\n }, [rowFilter, rowsWithPendingEdits, pendingEditsList.length]);\n\n useEffect(() => {\n if (rowFilter && !rowsWithPendingEdits.find((row) => row.rowId === rowFilter)) setRowFilter(null);\n }, [rowsWithPendingEdits, rowFilter]);\n\n useEffect(() => {\n const handleClickOutside = (e: MouseEvent) => {\n const target = e.target as Node;\n if (!rowFilterRef.current?.contains(target) && !rowFilterDropdownRef.current?.contains(target)) {\n setShowRowFilterDropdown(false);\n setRowFilterSearch('');\n }\n };\n if (showRowFilterDropdown) document.addEventListener('mousedown', handleClickOutside);\n return () => document.removeEventListener('mousedown', handleClickOutside);\n }, [showRowFilterDropdown]);\n\n const handleMouseEnter = useCallback(() => {\n if (dropdownTimeoutRef.current) { clearTimeout(dropdownTimeoutRef.current); dropdownTimeoutRef.current = null; }\n setShowDropdown(true);\n }, []);\n\n const handleMouseLeave = useCallback(() => {\n dropdownTimeoutRef.current = setTimeout(() => setShowDropdown(false), 300);\n }, []);\n\n const clampPositionToViewport = useCallback((nextX: number, nextY: number, barWidth: number, barHeight: number) => {\n const maxX = Math.max(0, window.innerWidth - barWidth);\n const maxY = Math.max(0, window.innerHeight - barHeight);\n\n return {\n x: Math.min(Math.max(nextX, 0), maxX),\n y: Math.min(Math.max(nextY, 0), maxY),\n };\n }, []);\n\n const handleMouseDown = useCallback((e: React.MouseEvent) => {\n e.preventDefault();\n const barElement = e.currentTarget.closest('.pending-edits-floating-bar') as HTMLElement;\n if (!barElement) return;\n const rect = barElement.getBoundingClientRect();\n dragStartRef.current = {\n x: e.clientX,\n y: e.clientY,\n barX: position?.x ?? rect.left,\n barY: position?.y ?? rect.top,\n barWidth: rect.width,\n barHeight: rect.height,\n };\n setIsDragging(true);\n }, [position]);\n\n useEffect(() => {\n if (!isDragging) return;\n const handleMouseMove = (e: MouseEvent) => {\n if (!dragStartRef.current) return;\n const nextX = dragStartRef.current.barX + e.clientX - dragStartRef.current.x;\n const nextY = dragStartRef.current.barY + e.clientY - dragStartRef.current.y;\n setPosition(clampPositionToViewport(nextX, nextY, dragStartRef.current.barWidth, dragStartRef.current.barHeight));\n };\n const handleMouseUp = () => { setIsDragging(false); dragStartRef.current = null; };\n document.addEventListener('mousemove', handleMouseMove);\n document.addEventListener('mouseup', handleMouseUp);\n return () => { document.removeEventListener('mousemove', handleMouseMove); document.removeEventListener('mouseup', handleMouseUp); };\n }, [isDragging, clampPositionToViewport]);\n\n useEffect(() => {\n if (!position || !floatingBarRef.current) return;\n\n const keepBarInViewport = () => {\n if (!floatingBarRef.current) return;\n const rect = floatingBarRef.current.getBoundingClientRect();\n const clampedPosition = clampPositionToViewport(position.x, position.y, rect.width, rect.height);\n if (clampedPosition.x !== position.x || clampedPosition.y !== position.y) {\n setPosition(clampedPosition);\n }\n };\n\n keepBarInViewport();\n window.addEventListener('resize', keepBarInViewport);\n return () => window.removeEventListener('resize', keepBarInViewport);\n }, [position, clampPositionToViewport]);\n\n const formatValue = (val: unknown, currencyCode?: string | null): string => {\n if (typeof val === 'boolean') return val ? 'Yes' : 'No';\n if (val === null || val === undefined || val === '') return '-';\n const strVal = String(val);\n const dateRegex = /^\\d{4}-\\d{2}-\\d{2}(T\\d{2}:\\d{2}(:\\d{2})?)?/;\n if (dateRegex.test(strVal)) {\n const hasTime = strVal.includes('T');\n return formatDate(strVal, { withTime: hasTime, skipTimezone: true }) || strVal;\n }\n if (currencyCode) return `${strVal} ${currencyCode}`;\n return strVal;\n };\n\n const handleCellClick = (edit: PendingEdit) => { setShowDropdown(false); onScrollToCell(edit.rowId, edit.columnKey, edit.rowIndex); };\n const handleRowFilterSelect = (rowId: string | null) => { setRowFilter(rowId); setShowRowFilterDropdown(false); setRowFilterSearch(''); };\n\n if (pendingEditsCount === 0) return null;\n\n const floatingBar = (\n <motion.div\n ref={floatingBarRef}\n className='pending-edits-floating-bar fixed z-[9999]'\n style={{\n zIndex: 2147483646,\n ...(position ? { left: position.x, top: position.y } : { bottom: 24, left: '50%', transform: 'translateX(-50%)' }),\n }}\n initial={{ opacity: 0, scale: 0.9 }}\n animate={{ opacity: 1, scale: 1 }}\n transition={{ type: 'spring', stiffness: 300, damping: 25 }}\n >\n <AnimatePresence>\n {showDropdown && !isMinimized && (\n <motion.div\n className='absolute w-80'\n style={{ bottom: '100%', left: '50%', marginLeft: '-160px', marginBottom: '4px' }}\n initial={{ opacity: 0, y: 10, scale: 0.95 }}\n animate={{ opacity: 1, y: 0, scale: 1 }}\n exit={{ opacity: 0, y: 10, scale: 0.95 }}\n transition={{ type: 'spring', stiffness: 300, damping: 24 }}\n onMouseEnter={handleMouseEnter}\n onMouseLeave={handleMouseLeave}\n >\n <div className='bg-white dark:bg-black-700 rounded-lg shadow-xl border border-neutral-200 dark:border-black-600 py-2 overflow-hidden'>\n <div className='px-3 py-1.5 text-xs font-semibold text-neutral-500 dark:text-neutral-400 uppercase tracking-wider border-b border-neutral-100 dark:border-black-600'>Pending Changes</div>\n {rowsWithPendingEdits.length > 1 && (\n <div className='px-3 py-2 border-b border-neutral-100 dark:border-black-600' ref={rowFilterRef}>\n <div className='relative'>\n <button\n ref={rowFilterButtonRef}\n onClick={() => { if (rowFilterButtonRef.current) setRowFilterButtonRect(rowFilterButtonRef.current.getBoundingClientRect()); setShowRowFilterDropdown(!showRowFilterDropdown); }}\n className='w-full text-xs px-2 py-1.5 rounded border border-neutral-200 dark:border-black-500 bg-neutral-50 dark:bg-black-600 text-neutral-700 dark:text-neutral-200 focus:outline-none focus:ring-1 focus:ring-primary-500 flex items-center justify-between gap-2'\n >\n <span className='truncate'>{selectedRowLabel}</span>\n <motion.div animate={{ rotate: showRowFilterDropdown ? 180 : 0 }} transition={{ duration: 0.2 }}>\n <KeyboardArrowDownRounded sx={{ fontSize: 16 }} className='text-neutral-400' />\n </motion.div>\n </button>\n {showRowFilterDropdown && rowFilterButtonRect && createPortal(\n <AnimatePresence>\n <motion.div\n ref={rowFilterDropdownRef}\n className='fixed bg-white dark:bg-black-700 rounded-lg shadow-xl border border-neutral-200 dark:border-black-600 overflow-hidden'\n style={{ zIndex: 2147483647, top: rowFilterButtonRect.bottom + 4, left: rowFilterButtonRect.left, width: rowFilterButtonRect.width }}\n variants={rowFilterDropdownVariants}\n initial='hidden' animate='visible' exit='exit'\n >\n <div className='p-2 border-b border-neutral-100 dark:border-black-600'>\n <div className='relative flex items-center'>\n <SearchRounded sx={{ fontSize: 14 }} className='absolute left-2 text-neutral-400 dark:text-neutral-500 z-10 pointer-events-none' />\n <input type='text' value={rowFilterSearch} onChange={(e) => setRowFilterSearch(e.target.value)} placeholder='Search rows...' className='w-full text-xs pl-7 pr-7 py-1.5 rounded border border-neutral-200 dark:border-black-500 bg-white dark:bg-black-600 text-neutral-700 dark:text-neutral-200 focus:outline-none focus:ring-1 focus:ring-primary-500 placeholder:text-neutral-400' autoFocus />\n {rowFilterSearch && <button onClick={() => setRowFilterSearch('')} className='absolute right-2 z-10 text-neutral-400 hover:text-neutral-600 dark:hover:text-neutral-300'><CloseRounded sx={{ fontSize: 14 }} /></button>}\n </div>\n </div>\n <motion.div className='max-h-40 overflow-y-auto' variants={listContainerVariants} initial='hidden' animate='visible'>\n {(!rowFilterSearch || 'all rows'.includes(rowFilterSearch.toLowerCase())) && (\n <motion.button variants={listItemVariants} onClick={() => handleRowFilterSelect(null)} className={`w-full text-left px-3 py-2 text-xs transition-colors ${!rowFilter ? 'bg-primary-50 dark:bg-primary-900/30 text-primary-700 dark:text-primary-300' : 'text-neutral-700 dark:text-neutral-200 hover:bg-neutral-50 dark:hover:bg-black-600'}`}>\n All Rows ({pendingEditsList.length} changes)\n </motion.button>\n )}\n {filteredRowOptions.map((row) => (\n <motion.button key={row.rowId} variants={listItemVariants} onClick={() => handleRowFilterSelect(row.rowId)} className={`w-full text-left px-3 py-2 text-xs transition-colors ${rowFilter === row.rowId ? 'bg-primary-50 dark:bg-primary-900/30 text-primary-700 dark:text-primary-300' : 'text-neutral-700 dark:text-neutral-200 hover:bg-neutral-50 dark:hover:bg-black-600'}`}>\n Row {row.rowIndex + 1} ({row.editCount} {row.editCount === 1 ? 'change' : 'changes'})\n </motion.button>\n ))}\n {filteredRowOptions.length === 0 && rowFilterSearch && !'all rows'.includes(rowFilterSearch.toLowerCase()) && (\n <motion.div variants={listItemVariants} className='px-3 py-2 text-xs text-neutral-500 dark:text-neutral-400'>No rows found</motion.div>\n )}\n </motion.div>\n </motion.div>\n </AnimatePresence>,\n document.body,\n )}\n </div>\n </div>\n )}\n <motion.div className='max-h-52 overflow-y-auto' variants={listContainerVariants} initial='hidden' animate='visible'>\n {filteredPendingEditsList?.map((edit, idx) => (\n <motion.button key={`${edit.rowId}-${edit.columnKey}-${idx}`} variants={listItemVariants} onClick={() => handleCellClick(edit)} className='w-full px-3 py-2 text-left hover:bg-neutral-50 dark:hover:bg-black-600 transition-colors' whileHover={{ backgroundColor: 'rgba(0,0,0,0.03)' }} whileTap={{ scale: 0.98 }}>\n <div className='text-xs font-bold text-neutral-700 dark:text-neutral-300 mb-1'>\n {edit.fieldName} {!rowFilter && <span className='font-normal text-neutral-500 dark:text-neutral-400'>(Row {edit.rowIndex + 1})</span>}\n </div>\n <div className='flex items-center gap-1.5 text-sm'>\n <span className='text-neutral-400 dark:text-neutral-500 line-through truncate max-w-[100px]'>{formatValue(edit.originalValue, edit.originalMeta?.currency_code)}</span>\n <span className='text-neutral-400 dark:text-neutral-500 flex-shrink-0'>→</span>\n <span className='text-primary-600 dark:text-primary-400 font-medium truncate max-w-[100px]'>{formatValue(edit.value, edit.meta?.currency_code)}</span>\n </div>\n </motion.button>\n ))}\n </motion.div>\n </div>\n </motion.div>\n )}\n </AnimatePresence>\n\n <motion.div\n className='flex items-center bg-white dark:bg-black-700 shadow-lg border border-neutral-200 dark:border-black-600 overflow-hidden'\n animate={{ padding: isMinimized ? '8px' : '12px 16px', gap: isMinimized ? '0px' : '12px', borderRadius: isMinimized ? '9999px' : '8px' }}\n transition={{ type: 'spring', stiffness: 300, damping: 25 }}\n >\n <AnimatePresence mode='wait'>\n {isMinimized ? (\n <motion.div key='minimized' initial={{ opacity: 0, scale: 0.8 }} animate={{ opacity: 1, scale: 1 }} exit={{ opacity: 0, scale: 0.8 }}\n onMouseDown={handleMouseDown} onClick={() => setIsMinimized(false)}\n className='flex items-center justify-center cursor-grab active:cursor-grabbing flex-shrink-0'\n style={{ width: '32px', height: '32px', borderRadius: '9999px', backgroundColor: 'var(--color-primary-600)', color: 'white' }}\n title='Drag to move / Click to expand' whileHover={{ backgroundColor: 'var(--color-primary-700)', scale: 1.05 }} whileTap={{ scale: 0.95 }}\n >\n <span className='text-xs font-bold'>{pendingEditsCount}</span>\n </motion.div>\n ) : (\n <motion.button key='minimize-btn' initial={{ opacity: 0, scale: 0.8 }} animate={{ opacity: 1, scale: 1 }} exit={{ opacity: 0, scale: 0.8 }}\n onClick={() => setIsMinimized(true)} className='flex items-center justify-center flex-shrink-0'\n style={{ width: '24px', height: '24px', borderRadius: '4px', backgroundColor: 'transparent', color: 'var(--color-neutral-400)' }}\n title='Minimize' whileHover={{ backgroundColor: 'var(--color-neutral-100)', color: 'var(--color-neutral-600)' }} whileTap={{ scale: 0.9 }}\n >\n <RemoveOutlined sx={{ fontSize: 16 }} />\n </motion.button>\n )}\n </AnimatePresence>\n\n <motion.div className='flex items-center gap-3' animate={{ width: isMinimized ? 0 : 'auto', opacity: isMinimized ? 0 : 1 }}\n transition={{ type: 'spring', stiffness: 300, damping: 25 }} style={{ overflow: 'hidden', pointerEvents: isMinimized ? 'none' : 'auto' }}\n >\n <div onMouseDown={handleMouseDown} className='cursor-grab active:cursor-grabbing text-neutral-400 dark:text-neutral-500 hover:text-neutral-600 dark:hover:text-neutral-300 flex items-center' title='Drag to move'>\n <DragIndicator sx={{ fontSize: 18 }} />\n </div>\n <div className='relative' onMouseEnter={handleMouseEnter} onMouseLeave={handleMouseLeave}>\n <span className='text-sm font-medium text-neutral-700 dark:text-neutral-200 cursor-pointer hover:text-primary-600 dark:hover:text-primary-400 whitespace-nowrap'>\n {pendingEditsCount} unsaved {pendingEditsCount === 1 ? 'change' : 'changes'}\n </span>\n </div>\n <div className='h-4 w-px bg-neutral-200 dark:bg-black-600 flex-shrink-0' />\n <motion.button onClick={onClearAll} disabled={!!fieldOperationLoading}\n className={`px-3 py-1.5 text-sm font-medium rounded-md whitespace-nowrap flex-shrink-0 ${fieldOperationLoading ? 'text-neutral-400 dark:text-neutral-500 cursor-not-allowed' : 'text-neutral-600 dark:text-neutral-300 hover:bg-neutral-100 dark:hover:bg-black-600'}`}\n whileHover={!fieldOperationLoading ? { scale: 1.02 } : undefined} whileTap={!fieldOperationLoading ? { scale: 0.98 } : undefined}\n >\n Cancel\n </motion.button>\n <motion.button onClick={onSaveAll} disabled={!!fieldOperationLoading}\n className={`px-3 py-1.5 text-sm font-medium rounded-md whitespace-nowrap flex-shrink-0 ${fieldOperationLoading ? 'text-white bg-primary-400 cursor-not-allowed' : 'text-white bg-primary-600 hover:bg-primary-700'}`}\n whileHover={!fieldOperationLoading ? { scale: 1.02 } : undefined} whileTap={!fieldOperationLoading ? { scale: 0.98 } : undefined}\n >\n Save All\n </motion.button>\n </motion.div>\n </motion.div>\n </motion.div>\n );\n\n return createPortal(floatingBar, document.body);\n};\n"],"names":["rowFilterDropdownVariants","listContainerVariants","listItemVariants","PendingEditsFloatingBar","pendingEditsCount","pendingEditsList","rowsWithPendingEdits","fieldOperationLoading","onClearAll","onSaveAll","onScrollToCell","showDropdown","setShowDropdown","useState","isMinimized","setIsMinimized","rowFilter","setRowFilter","position","setPosition","isDragging","setIsDragging","rowFilterSearch","setRowFilterSearch","showRowFilterDropdown","setShowRowFilterDropdown","rowFilterButtonRect","setRowFilterButtonRect","dropdownTimeoutRef","useRef","dragStartRef","floatingBarRef","rowFilterRef","rowFilterButtonRef","rowFilterDropdownRef","filteredPendingEditsList","useMemo","edit","filteredRowOptions","searchLower","row","selectedRowLabel","r","useEffect","handleClickOutside","e","target","handleMouseEnter","useCallback","handleMouseLeave","clampPositionToViewport","nextX","nextY","barWidth","barHeight","maxX","maxY","handleMouseDown","barElement","rect","handleMouseMove","handleMouseUp","keepBarInViewport","clampedPosition","formatValue","val","currencyCode","strVal","hasTime","formatDate","handleCellClick","handleRowFilterSelect","rowId","floatingBar","jsxs","motion","jsx","AnimatePresence","KeyboardArrowDownRounded","createPortal","SearchRounded","CloseRounded","idx","RemoveOutlined","DragIndicator"],"mappings":"yQAiCMA,GAA4B,CAChC,OAAQ,CAAE,QAAS,EAAG,EAAG,GAAI,MAAO,GAAA,EACpC,QAAS,CAAE,QAAS,EAAG,EAAG,EAAG,MAAO,EAAG,WAAY,CAAE,KAAM,SAAmB,UAAW,IAAK,QAAS,GAAG,EAC1G,KAAM,CAAE,QAAS,EAAG,EAAG,GAAI,MAAO,IAAM,WAAY,CAAE,SAAU,EAAA,CAAI,CACtE,EAEMC,EAAwB,CAC5B,OAAQ,CAAE,QAAS,CAAA,EACnB,QAAS,CAAE,QAAS,EAAG,WAAY,CAAE,gBAAiB,IAAM,cAAe,GAAA,CAAK,CAClF,EAEMC,EAAmB,CACvB,OAAQ,CAAE,QAAS,EAAG,EAAG,EAAA,EACzB,QAAS,CAAE,QAAS,EAAG,EAAG,EAAG,WAAY,CAAE,KAAM,SAAmB,UAAW,IAAK,QAAS,GAAG,CAClG,EAEaC,GAAkE,CAAC,CAC9E,kBAAAC,EAAmB,iBAAAC,EAAkB,qBAAAC,EAAsB,sBAAAC,EAAuB,WAAAC,EAAY,UAAAC,EAAW,eAAAC,CAC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ACF,CAAA,CAAA,EAIJ,OAAOwE,eAAaN,EAAa,SAAS,IAAI,CAChD"}
|
|
1
|
+
{"version":3,"file":"PendingEditsFloatingBar.cjs.js","sources":["../../../../src/components/data-display/infinite-table/PendingEditsFloatingBar.tsx"],"sourcesContent":["import { formatDate } from '../../../utils/formatters';\nimport { CloseRounded, DragIndicator, KeyboardArrowDownRounded, RemoveOutlined, SearchRounded } from '@mui/icons-material';\nimport { AnimatePresence, motion } from 'framer-motion';\nimport React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport { createPortal } from 'react-dom';\n\nimport { FLOATING_BAR_TOOLTIP_MARGIN_BOTTOM, FLOATING_BAR_TOOLTIP_MARGIN_LEFT } from './constants';\n\ninterface PendingEdit {\n rowId: string;\n columnKey: string;\n fieldName: string;\n value: unknown;\n originalValue: unknown;\n meta?: { currency_code?: string | null; [key: string]: unknown | null } | null;\n originalMeta?: { currency_code?: string | null; [key: string]: unknown | null } | null;\n rowIndex: number;\n}\n\ninterface RowWithPendingEdits {\n rowId: string;\n rowIndex: number;\n editCount: number;\n}\n\ninterface PendingEditsFloatingBarProps {\n pendingEditsCount: number;\n pendingEditsList: PendingEdit[];\n rowsWithPendingEdits: RowWithPendingEdits[];\n fieldOperationLoading: string | null;\n onClearAll: () => void;\n onSaveAll: () => void;\n onScrollToCell: (rowId: string, columnKey: string, rowIndex: number) => void;\n}\n\nconst rowFilterDropdownVariants = {\n hidden: { opacity: 0, y: -8, scale: 0.95 },\n visible: { opacity: 1, y: 0, scale: 1, transition: { type: 'spring' as const, stiffness: 400, damping: 25 } },\n exit: { opacity: 0, y: -8, scale: 0.95, transition: { duration: 0.1 } },\n};\n\nconst listContainerVariants = {\n hidden: { opacity: 0 },\n visible: { opacity: 1, transition: { staggerChildren: 0.03, delayChildren: 0.05 } },\n};\n\nconst listItemVariants = {\n hidden: { opacity: 0, y: -8 },\n visible: { opacity: 1, y: 0, transition: { type: 'spring' as const, stiffness: 400, damping: 25 } },\n};\n\nexport const PendingEditsFloatingBar: React.FC<PendingEditsFloatingBarProps> = ({\n pendingEditsCount, pendingEditsList, rowsWithPendingEdits, fieldOperationLoading, onClearAll, onSaveAll, onScrollToCell,\n}) => {\n const [showDropdown, setShowDropdown] = useState(false);\n const [isMinimized, setIsMinimized] = useState(false);\n const [rowFilter, setRowFilter] = useState<string | null>(null);\n const [position, setPosition] = useState<{ x: number; y: number } | null>(null);\n const [isDragging, setIsDragging] = useState(false);\n const [rowFilterSearch, setRowFilterSearch] = useState('');\n const [showRowFilterDropdown, setShowRowFilterDropdown] = useState(false);\n const [rowFilterButtonRect, setRowFilterButtonRect] = useState<DOMRect | null>(null);\n\n const dropdownTimeoutRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n const dragStartRef = useRef<{ x: number; y: number; barX: number; barY: number; barWidth: number; barHeight: number } | null>(null);\n const floatingBarRef = useRef<HTMLDivElement>(null);\n const rowFilterRef = useRef<HTMLDivElement>(null);\n const rowFilterButtonRef = useRef<HTMLButtonElement>(null);\n const rowFilterDropdownRef = useRef<HTMLDivElement>(null);\n\n const filteredPendingEditsList = useMemo(() => {\n if (!rowFilter) return pendingEditsList;\n return pendingEditsList.filter((edit) => edit.rowId === rowFilter);\n }, [pendingEditsList, rowFilter]);\n\n const filteredRowOptions = useMemo(() => {\n if (!rowFilterSearch) return rowsWithPendingEdits;\n const searchLower = rowFilterSearch.toLowerCase();\n return rowsWithPendingEdits.filter((row) => `row ${row.rowIndex + 1}`.toLowerCase().includes(searchLower));\n }, [rowsWithPendingEdits, rowFilterSearch]);\n\n const selectedRowLabel = useMemo(() => {\n if (!rowFilter) return `All Rows (${pendingEditsList.length})`;\n const row = rowsWithPendingEdits.find((r) => r.rowId === rowFilter);\n if (!row) return `All Rows (${pendingEditsList.length})`;\n return `Row ${row.rowIndex + 1} (${row.editCount})`;\n }, [rowFilter, rowsWithPendingEdits, pendingEditsList.length]);\n\n useEffect(() => {\n if (rowFilter && !rowsWithPendingEdits.find((row) => row.rowId === rowFilter)) setRowFilter(null);\n }, [rowsWithPendingEdits, rowFilter]);\n\n useEffect(() => {\n const handleClickOutside = (e: MouseEvent) => {\n const target = e.target as Node;\n if (!rowFilterRef.current?.contains(target) && !rowFilterDropdownRef.current?.contains(target)) {\n setShowRowFilterDropdown(false);\n setRowFilterSearch('');\n }\n };\n if (showRowFilterDropdown) document.addEventListener('mousedown', handleClickOutside);\n return () => document.removeEventListener('mousedown', handleClickOutside);\n }, [showRowFilterDropdown]);\n\n const handleMouseEnter = useCallback(() => {\n if (dropdownTimeoutRef.current) { clearTimeout(dropdownTimeoutRef.current); dropdownTimeoutRef.current = null; }\n setShowDropdown(true);\n }, []);\n\n const handleMouseLeave = useCallback(() => {\n dropdownTimeoutRef.current = setTimeout(() => setShowDropdown(false), 300);\n }, []);\n\n const clampPositionToViewport = useCallback((nextX: number, nextY: number, barWidth: number, barHeight: number) => {\n const maxX = Math.max(0, window.innerWidth - barWidth);\n const maxY = Math.max(0, window.innerHeight - barHeight);\n\n return {\n x: Math.min(Math.max(nextX, 0), maxX),\n y: Math.min(Math.max(nextY, 0), maxY),\n };\n }, []);\n\n const handleMouseDown = useCallback((e: React.MouseEvent) => {\n e.preventDefault();\n const barElement = e.currentTarget.closest('.pending-edits-floating-bar') as HTMLElement;\n if (!barElement) return;\n const rect = barElement.getBoundingClientRect();\n dragStartRef.current = {\n x: e.clientX,\n y: e.clientY,\n barX: position?.x ?? rect.left,\n barY: position?.y ?? rect.top,\n barWidth: rect.width,\n barHeight: rect.height,\n };\n setIsDragging(true);\n }, [position]);\n\n useEffect(() => {\n if (!isDragging) return;\n const handleMouseMove = (e: MouseEvent) => {\n if (!dragStartRef.current) return;\n const nextX = dragStartRef.current.barX + e.clientX - dragStartRef.current.x;\n const nextY = dragStartRef.current.barY + e.clientY - dragStartRef.current.y;\n setPosition(clampPositionToViewport(nextX, nextY, dragStartRef.current.barWidth, dragStartRef.current.barHeight));\n };\n const handleMouseUp = () => { setIsDragging(false); dragStartRef.current = null; };\n document.addEventListener('mousemove', handleMouseMove);\n document.addEventListener('mouseup', handleMouseUp);\n return () => { document.removeEventListener('mousemove', handleMouseMove); document.removeEventListener('mouseup', handleMouseUp); };\n }, [isDragging, clampPositionToViewport]);\n\n useEffect(() => {\n if (!position || !floatingBarRef.current) return;\n\n const keepBarInViewport = () => {\n if (!floatingBarRef.current) return;\n const rect = floatingBarRef.current.getBoundingClientRect();\n const clampedPosition = clampPositionToViewport(position.x, position.y, rect.width, rect.height);\n if (clampedPosition.x !== position.x || clampedPosition.y !== position.y) {\n setPosition(clampedPosition);\n }\n };\n\n keepBarInViewport();\n window.addEventListener('resize', keepBarInViewport);\n return () => window.removeEventListener('resize', keepBarInViewport);\n }, [position, clampPositionToViewport]);\n\n const formatValue = (val: unknown, currencyCode?: string | null): string => {\n if (typeof val === 'boolean') return val ? 'Yes' : 'No';\n if (val === null || val === undefined || val === '') return '-';\n const strVal = String(val);\n const dateRegex = /^\\d{4}-\\d{2}-\\d{2}(T\\d{2}:\\d{2}(:\\d{2})?)?/;\n if (dateRegex.test(strVal)) {\n const hasTime = strVal.includes('T');\n return formatDate(strVal, { withTime: hasTime, skipTimezone: true }) || strVal;\n }\n if (currencyCode) return `${strVal} ${currencyCode}`;\n return strVal;\n };\n\n const handleCellClick = (edit: PendingEdit) => { setShowDropdown(false); onScrollToCell(edit.rowId, edit.columnKey, edit.rowIndex); };\n const handleRowFilterSelect = (rowId: string | null) => { setRowFilter(rowId); setShowRowFilterDropdown(false); setRowFilterSearch(''); };\n\n if (pendingEditsCount === 0) return null;\n\n const floatingBar = (\n <motion.div\n ref={floatingBarRef}\n className='pending-edits-floating-bar fixed z-[9999]'\n style={{\n zIndex: 2147483646,\n ...(position ? { left: position.x, top: position.y } : { bottom: 24, left: '50%', transform: 'translateX(-50%)' }),\n }}\n initial={{ opacity: 0, scale: 0.9 }}\n animate={{ opacity: 1, scale: 1 }}\n transition={{ type: 'spring', stiffness: 300, damping: 25 }}\n >\n <AnimatePresence>\n {showDropdown && !isMinimized && (\n <motion.div\n className='absolute w-80'\n style={{ bottom: '100%', left: '50%', marginLeft: FLOATING_BAR_TOOLTIP_MARGIN_LEFT, marginBottom: FLOATING_BAR_TOOLTIP_MARGIN_BOTTOM }}\n initial={{ opacity: 0, y: 10, scale: 0.95 }}\n animate={{ opacity: 1, y: 0, scale: 1 }}\n exit={{ opacity: 0, y: 10, scale: 0.95 }}\n transition={{ type: 'spring', stiffness: 300, damping: 24 }}\n onMouseEnter={handleMouseEnter}\n onMouseLeave={handleMouseLeave}\n >\n <div className='bg-white dark:bg-black-700 rounded-lg shadow-xl border border-neutral-200 dark:border-black-600 py-2 overflow-hidden'>\n <div className='px-3 py-1.5 text-xs font-semibold text-neutral-500 dark:text-neutral-400 uppercase tracking-wider border-b border-neutral-100 dark:border-black-600'>Pending Changes</div>\n {rowsWithPendingEdits.length > 1 && (\n <div className='px-3 py-2 border-b border-neutral-100 dark:border-black-600' ref={rowFilterRef}>\n <div className='relative'>\n <button\n ref={rowFilterButtonRef}\n onClick={() => { if (rowFilterButtonRef.current) setRowFilterButtonRect(rowFilterButtonRef.current.getBoundingClientRect()); setShowRowFilterDropdown(!showRowFilterDropdown); }}\n className='w-full text-xs px-2 py-1.5 rounded border border-neutral-200 dark:border-black-500 bg-neutral-50 dark:bg-black-600 text-neutral-700 dark:text-neutral-200 focus:outline-none focus:ring-1 focus:ring-primary-500 flex items-center justify-between gap-2'\n >\n <span className='truncate'>{selectedRowLabel}</span>\n <motion.div animate={{ rotate: showRowFilterDropdown ? 180 : 0 }} transition={{ duration: 0.2 }}>\n <KeyboardArrowDownRounded sx={{ fontSize: 16 }} className='text-neutral-400' />\n </motion.div>\n </button>\n {showRowFilterDropdown && rowFilterButtonRect && createPortal(\n <AnimatePresence>\n <motion.div\n ref={rowFilterDropdownRef}\n className='fixed bg-white dark:bg-black-700 rounded-lg shadow-xl border border-neutral-200 dark:border-black-600 overflow-hidden'\n style={{ zIndex: 2147483647, top: rowFilterButtonRect.bottom + 4, left: rowFilterButtonRect.left, width: rowFilterButtonRect.width }}\n variants={rowFilterDropdownVariants}\n initial='hidden' animate='visible' exit='exit'\n >\n <div className='p-2 border-b border-neutral-100 dark:border-black-600'>\n <div className='relative flex items-center'>\n <SearchRounded sx={{ fontSize: 14 }} className='absolute left-2 text-neutral-400 dark:text-neutral-500 z-10 pointer-events-none' />\n <input type='text' value={rowFilterSearch} onChange={(e) => setRowFilterSearch(e.target.value)} placeholder='Search rows...' className='w-full text-xs pl-7 pr-7 py-1.5 rounded border border-neutral-200 dark:border-black-500 bg-white dark:bg-black-600 text-neutral-700 dark:text-neutral-200 focus:outline-none focus:ring-1 focus:ring-primary-500 placeholder:text-neutral-400' autoFocus />\n {rowFilterSearch && <button onClick={() => setRowFilterSearch('')} className='absolute right-2 z-10 text-neutral-400 hover:text-neutral-600 dark:hover:text-neutral-300'><CloseRounded sx={{ fontSize: 14 }} /></button>}\n </div>\n </div>\n <motion.div className='max-h-40 overflow-y-auto' variants={listContainerVariants} initial='hidden' animate='visible'>\n {(!rowFilterSearch || 'all rows'.includes(rowFilterSearch.toLowerCase())) && (\n <motion.button variants={listItemVariants} onClick={() => handleRowFilterSelect(null)} className={`w-full text-left px-3 py-2 text-xs transition-colors ${!rowFilter ? 'bg-primary-50 dark:bg-primary-900/30 text-primary-700 dark:text-primary-300' : 'text-neutral-700 dark:text-neutral-200 hover:bg-neutral-50 dark:hover:bg-black-600'}`}>\n All Rows ({pendingEditsList.length} changes)\n </motion.button>\n )}\n {filteredRowOptions.map((row) => (\n <motion.button key={row.rowId} variants={listItemVariants} onClick={() => handleRowFilterSelect(row.rowId)} className={`w-full text-left px-3 py-2 text-xs transition-colors ${rowFilter === row.rowId ? 'bg-primary-50 dark:bg-primary-900/30 text-primary-700 dark:text-primary-300' : 'text-neutral-700 dark:text-neutral-200 hover:bg-neutral-50 dark:hover:bg-black-600'}`}>\n Row {row.rowIndex + 1} ({row.editCount} {row.editCount === 1 ? 'change' : 'changes'})\n </motion.button>\n ))}\n {filteredRowOptions.length === 0 && rowFilterSearch && !'all rows'.includes(rowFilterSearch.toLowerCase()) && (\n <motion.div variants={listItemVariants} className='px-3 py-2 text-xs text-neutral-500 dark:text-neutral-400'>No rows found</motion.div>\n )}\n </motion.div>\n </motion.div>\n </AnimatePresence>,\n document.body,\n )}\n </div>\n </div>\n )}\n <motion.div className='max-h-52 overflow-y-auto' variants={listContainerVariants} initial='hidden' animate='visible'>\n {filteredPendingEditsList?.map((edit, idx) => (\n <motion.button key={`${edit.rowId}-${edit.columnKey}-${idx}`} variants={listItemVariants} onClick={() => handleCellClick(edit)} className='w-full px-3 py-2 text-left hover:bg-neutral-50 dark:hover:bg-black-600 transition-colors' whileHover={{ backgroundColor: 'rgba(0,0,0,0.03)' }} whileTap={{ scale: 0.98 }}>\n <div className='text-xs font-bold text-neutral-700 dark:text-neutral-300 mb-1'>\n {edit.fieldName} {!rowFilter && <span className='font-normal text-neutral-500 dark:text-neutral-400'>(Row {edit.rowIndex + 1})</span>}\n </div>\n <div className='flex items-center gap-1.5 text-sm'>\n <span className='text-neutral-400 dark:text-neutral-500 line-through truncate max-w-[100px]'>{formatValue(edit.originalValue, edit.originalMeta?.currency_code)}</span>\n <span className='text-neutral-400 dark:text-neutral-500 flex-shrink-0'>→</span>\n <span className='text-primary-600 dark:text-primary-400 font-medium truncate max-w-[100px]'>{formatValue(edit.value, edit.meta?.currency_code)}</span>\n </div>\n </motion.button>\n ))}\n </motion.div>\n </div>\n </motion.div>\n )}\n </AnimatePresence>\n\n <motion.div\n className='flex items-center bg-white dark:bg-black-700 shadow-lg border border-neutral-200 dark:border-black-600 overflow-hidden'\n animate={{ padding: isMinimized ? '8px' : '12px 16px', gap: isMinimized ? '0px' : '12px', borderRadius: isMinimized ? '9999px' : '8px' }}\n transition={{ type: 'spring', stiffness: 300, damping: 25 }}\n >\n <AnimatePresence mode='wait'>\n {isMinimized ? (\n <motion.div key='minimized' initial={{ opacity: 0, scale: 0.8 }} animate={{ opacity: 1, scale: 1 }} exit={{ opacity: 0, scale: 0.8 }}\n onMouseDown={handleMouseDown} onClick={() => setIsMinimized(false)}\n className='flex items-center justify-center cursor-grab active:cursor-grabbing flex-shrink-0'\n style={{ width: '32px', height: '32px', borderRadius: '9999px', backgroundColor: 'var(--color-primary-600)', color: 'white' }}\n title='Drag to move / Click to expand' whileHover={{ backgroundColor: 'var(--color-primary-700)', scale: 1.05 }} whileTap={{ scale: 0.95 }}\n >\n <span className='text-xs font-bold'>{pendingEditsCount}</span>\n </motion.div>\n ) : (\n <motion.button key='minimize-btn' initial={{ opacity: 0, scale: 0.8 }} animate={{ opacity: 1, scale: 1 }} exit={{ opacity: 0, scale: 0.8 }}\n onClick={() => setIsMinimized(true)} className='flex items-center justify-center flex-shrink-0'\n style={{ width: '24px', height: '24px', borderRadius: '4px', backgroundColor: 'transparent', color: 'var(--color-neutral-400)' }}\n title='Minimize' whileHover={{ backgroundColor: 'var(--color-neutral-100)', color: 'var(--color-neutral-600)' }} whileTap={{ scale: 0.9 }}\n >\n <RemoveOutlined sx={{ fontSize: 16 }} />\n </motion.button>\n )}\n </AnimatePresence>\n\n <motion.div className='flex items-center gap-3' animate={{ width: isMinimized ? 0 : 'auto', opacity: isMinimized ? 0 : 1 }}\n transition={{ type: 'spring', stiffness: 300, damping: 25 }} style={{ overflow: 'hidden', pointerEvents: isMinimized ? 'none' : 'auto' }}\n >\n <div onMouseDown={handleMouseDown} className='cursor-grab active:cursor-grabbing text-neutral-400 dark:text-neutral-500 hover:text-neutral-600 dark:hover:text-neutral-300 flex items-center' title='Drag to move'>\n <DragIndicator sx={{ fontSize: 18 }} />\n </div>\n <div className='relative' onMouseEnter={handleMouseEnter} onMouseLeave={handleMouseLeave}>\n <span className='text-sm font-medium text-neutral-700 dark:text-neutral-200 cursor-pointer hover:text-primary-600 dark:hover:text-primary-400 whitespace-nowrap'>\n {pendingEditsCount} unsaved {pendingEditsCount === 1 ? 'change' : 'changes'}\n </span>\n </div>\n <div className='h-4 w-px bg-neutral-200 dark:bg-black-600 flex-shrink-0' />\n <motion.button onClick={onClearAll} disabled={!!fieldOperationLoading}\n className={`px-3 py-1.5 text-sm font-medium rounded-md whitespace-nowrap flex-shrink-0 ${fieldOperationLoading ? 'text-neutral-400 dark:text-neutral-500 cursor-not-allowed' : 'text-neutral-600 dark:text-neutral-300 hover:bg-neutral-100 dark:hover:bg-black-600'}`}\n whileHover={!fieldOperationLoading ? { scale: 1.02 } : undefined} whileTap={!fieldOperationLoading ? { scale: 0.98 } : undefined}\n >\n Cancel\n </motion.button>\n <motion.button onClick={onSaveAll} disabled={!!fieldOperationLoading}\n className={`px-3 py-1.5 text-sm font-medium rounded-md whitespace-nowrap flex-shrink-0 ${fieldOperationLoading ? 'text-white bg-primary-400 cursor-not-allowed' : 'text-white bg-primary-600 hover:bg-primary-700'}`}\n whileHover={!fieldOperationLoading ? { scale: 1.02 } : undefined} whileTap={!fieldOperationLoading ? { scale: 0.98 } : undefined}\n >\n Save All\n </motion.button>\n </motion.div>\n </motion.div>\n </motion.div>\n );\n\n return createPortal(floatingBar, document.body);\n};\n"],"names":["rowFilterDropdownVariants","listContainerVariants","listItemVariants","PendingEditsFloatingBar","pendingEditsCount","pendingEditsList","rowsWithPendingEdits","fieldOperationLoading","onClearAll","onSaveAll","onScrollToCell","showDropdown","setShowDropdown","useState","isMinimized","setIsMinimized","rowFilter","setRowFilter","position","setPosition","isDragging","setIsDragging","rowFilterSearch","setRowFilterSearch","showRowFilterDropdown","setShowRowFilterDropdown","rowFilterButtonRect","setRowFilterButtonRect","dropdownTimeoutRef","useRef","dragStartRef","floatingBarRef","rowFilterRef","rowFilterButtonRef","rowFilterDropdownRef","filteredPendingEditsList","useMemo","edit","filteredRowOptions","searchLower","row","selectedRowLabel","r","useEffect","handleClickOutside","e","target","handleMouseEnter","useCallback","handleMouseLeave","clampPositionToViewport","nextX","nextY","barWidth","barHeight","maxX","maxY","handleMouseDown","barElement","rect","handleMouseMove","handleMouseUp","keepBarInViewport","clampedPosition","formatValue","val","currencyCode","strVal","hasTime","formatDate","handleCellClick","handleRowFilterSelect","rowId","floatingBar","jsxs","motion","jsx","AnimatePresence","FLOATING_BAR_TOOLTIP_MARGIN_LEFT","FLOATING_BAR_TOOLTIP_MARGIN_BOTTOM","KeyboardArrowDownRounded","createPortal","SearchRounded","CloseRounded","idx","RemoveOutlined","DragIndicator"],"mappings":"0SAmCMA,GAA4B,CAChC,OAAQ,CAAE,QAAS,EAAG,EAAG,GAAI,MAAO,GAAA,EACpC,QAAS,CAAE,QAAS,EAAG,EAAG,EAAG,MAAO,EAAG,WAAY,CAAE,KAAM,SAAmB,UAAW,IAAK,QAAS,GAAG,EAC1G,KAAM,CAAE,QAAS,EAAG,EAAG,GAAI,MAAO,IAAM,WAAY,CAAE,SAAU,EAAA,CAAI,CACtE,EAEMC,EAAwB,CAC5B,OAAQ,CAAE,QAAS,CAAA,EACnB,QAAS,CAAE,QAAS,EAAG,WAAY,CAAE,gBAAiB,IAAM,cAAe,GAAA,CAAK,CAClF,EAEMC,EAAmB,CACvB,OAAQ,CAAE,QAAS,EAAG,EAAG,EAAA,EACzB,QAAS,CAAE,QAAS,EAAG,EAAG,EAAG,WAAY,CAAE,KAAM,SAAmB,UAAW,IAAK,QAAS,GAAG,CAClG,EAEaC,GAAkE,CAAC,CAC9E,kBAAAC,EAAmB,iBAAAC,EAAkB,qBAAAC,EAAsB,sBAAAC,EAAuB,WAAAC,EAAY,UAAAC,EAAW,eAAAC,CAC3G,IAAM,CACJ,KAAM,CAACC,EAAcC,CAAe,EAAIC,EAAAA,SAAS,EAAK,EAChD,CAACC,EAAaC,CAAc,EAAIF,EAAAA,SAAS,EAAK,EAC9C,CAACG,EAAWC,CAAY,EAAIJ,EAAAA,SAAwB,IAAI,EACxD,CAACK,EAAUC,CAAW,EAAIN,EAAAA,SAA0C,IAAI,EACxE,CAACO,EAAYC,CAAa,EAAIR,EAAAA,SAAS,EAAK,EAC5C,CAACS,EAAiBC,CAAkB,EAA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A,EAAc,OAAS,MAAA,EAEhI,SAAA,CAAA8D,EAAAA,IAAC,MAAA,CAAI,YAAanB,EAAiB,UAAU,iJAAiJ,MAAM,eAClM,SAAAmB,EAAAA,IAACU,EAAAA,cAAA,CAAc,GAAI,CAAE,SAAU,EAAA,EAAM,EACvC,EACAV,EAAAA,IAAC,MAAA,CAAI,UAAU,WAAW,aAAc7B,EAAkB,aAAcE,EACtE,SAAAyB,EAAAA,KAAC,OAAA,CAAK,UAAU,iJACb,SAAA,CAAAtE,EAAkB,YAAUA,IAAsB,EAAI,SAAW,SAAA,CAAA,CACpE,CAAA,CACF,EACAwE,EAAAA,IAAC,MAAA,CAAI,UAAU,yDAAA,CAA0D,EACzEA,EAAAA,IAACD,EAAAA,OAAO,OAAP,CAAc,QAASnE,EAAY,SAAU,CAAC,CAACD,EAC9C,UAAW,8EAA8EA,EAAwB,4DAA8D,qFAAqF,GACpQ,WAAaA,EAA0C,OAAlB,CAAE,MAAO,MAAoB,SAAWA,EAA0C,OAAlB,CAAE,MAAO,KAC/G,SAAA,QAAA,CAAA,EAGDqE,EAAAA,IAACD,EAAAA,OAAO,OAAP,CAAc,QAASlE,EAAW,SAAU,CAAC,CAACF,EAC7C,UAAW,8EAA8EA,EAAwB,+CAAiD,gDAAgD,GAClN,WAAaA,EAA0C,OAAlB,CAAE,MAAO,MAAoB,SAAWA,EAA0C,OAAlB,CAAE,MAAO,KAC/G,SAAA,UAAA,CAAA,CAED,CAAA,CAAA,CACF,CAAA,CAAA,CACF,CAAA,CAAA,EAIJ,OAAO0E,eAAaR,EAAa,SAAS,IAAI,CAChD"}
|
|
@@ -1,57 +1,58 @@
|
|
|
1
1
|
import { jsxs as n, jsx as t } from "react/jsx-runtime";
|
|
2
2
|
import { formatDate as ne } from "../../../utils/formatters.es.js";
|
|
3
3
|
import { KeyboardArrowDownRounded as oe, SearchRounded as le, CloseRounded as ie, RemoveOutlined as se, DragIndicator as ce } from "@mui/icons-material";
|
|
4
|
-
import { motion as o, AnimatePresence as
|
|
5
|
-
import { useState as x, useRef as p, useMemo as
|
|
6
|
-
import { createPortal as
|
|
7
|
-
|
|
4
|
+
import { motion as o, AnimatePresence as D } from "framer-motion";
|
|
5
|
+
import { useState as x, useRef as p, useMemo as S, useEffect as C, useCallback as I } from "react";
|
|
6
|
+
import { createPortal as P } from "react-dom";
|
|
7
|
+
import { FLOATING_BAR_TOOLTIP_MARGIN_BOTTOM as de, FLOATING_BAR_TOOLTIP_MARGIN_LEFT as ue } from "./constants.es.js";
|
|
8
|
+
const me = {
|
|
8
9
|
hidden: { opacity: 0, y: -8, scale: 0.95 },
|
|
9
10
|
visible: { opacity: 1, y: 0, scale: 1, transition: { type: "spring", stiffness: 400, damping: 25 } },
|
|
10
11
|
exit: { opacity: 0, y: -8, scale: 0.95, transition: { duration: 0.1 } }
|
|
11
12
|
}, E = {
|
|
12
13
|
hidden: { opacity: 0 },
|
|
13
14
|
visible: { opacity: 1, transition: { staggerChildren: 0.03, delayChildren: 0.05 } }
|
|
14
|
-
},
|
|
15
|
+
}, M = {
|
|
15
16
|
hidden: { opacity: 0, y: -8 },
|
|
16
17
|
visible: { opacity: 1, y: 0, transition: { type: "spring", stiffness: 400, damping: 25 } }
|
|
17
|
-
},
|
|
18
|
+
}, ve = ({
|
|
18
19
|
pendingEditsCount: w,
|
|
19
20
|
pendingEditsList: h,
|
|
20
21
|
rowsWithPendingEdits: d,
|
|
21
22
|
fieldOperationLoading: u,
|
|
22
|
-
onClearAll:
|
|
23
|
-
onSaveAll:
|
|
24
|
-
onScrollToCell:
|
|
23
|
+
onClearAll: U,
|
|
24
|
+
onSaveAll: q,
|
|
25
|
+
onScrollToCell: J
|
|
25
26
|
}) => {
|
|
26
|
-
const [
|
|
27
|
+
const [Q, T] = x(!1), [m, B] = x(!1), [l, $] = x(null), [i, A] = x(null), [L, _] = x(!1), [s, g] = x(""), [b, z] = x(!1), [v, Z] = x(null), y = p(null), c = p(null), k = p(null), H = p(null), F = p(null), V = p(null), W = S(() => l ? h.filter((e) => e.rowId === l) : h, [h, l]), X = S(() => {
|
|
27
28
|
if (!s) return d;
|
|
28
29
|
const e = s.toLowerCase();
|
|
29
30
|
return d.filter((a) => `row ${a.rowIndex + 1}`.toLowerCase().includes(e));
|
|
30
|
-
}, [d, s]), ee =
|
|
31
|
+
}, [d, s]), ee = S(() => {
|
|
31
32
|
if (!l) return `All Rows (${h.length})`;
|
|
32
33
|
const e = d.find((a) => a.rowId === l);
|
|
33
34
|
return e ? `Row ${e.rowIndex + 1} (${e.editCount})` : `All Rows (${h.length})`;
|
|
34
35
|
}, [l, d, h.length]);
|
|
35
36
|
C(() => {
|
|
36
|
-
l && !d.find((e) => e.rowId === l) &&
|
|
37
|
+
l && !d.find((e) => e.rowId === l) && $(null);
|
|
37
38
|
}, [d, l]), C(() => {
|
|
38
39
|
const e = (a) => {
|
|
39
40
|
const r = a.target;
|
|
40
|
-
!
|
|
41
|
+
!H.current?.contains(r) && !V.current?.contains(r) && (z(!1), g(""));
|
|
41
42
|
};
|
|
42
43
|
return b && document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
|
|
43
44
|
}, [b]);
|
|
44
|
-
const
|
|
45
|
-
y.current && (clearTimeout(y.current), y.current = null),
|
|
46
|
-
}, []),
|
|
47
|
-
y.current = setTimeout(() =>
|
|
48
|
-
}, []), N =
|
|
45
|
+
const Y = I(() => {
|
|
46
|
+
y.current && (clearTimeout(y.current), y.current = null), T(!0);
|
|
47
|
+
}, []), j = I(() => {
|
|
48
|
+
y.current = setTimeout(() => T(!1), 300);
|
|
49
|
+
}, []), N = I((e, a, r, R) => {
|
|
49
50
|
const f = Math.max(0, window.innerWidth - r), ae = Math.max(0, window.innerHeight - R);
|
|
50
51
|
return {
|
|
51
52
|
x: Math.min(Math.max(e, 0), f),
|
|
52
53
|
y: Math.min(Math.max(a, 0), ae)
|
|
53
54
|
};
|
|
54
|
-
}, []),
|
|
55
|
+
}, []), G = I((e) => {
|
|
55
56
|
e.preventDefault();
|
|
56
57
|
const a = e.currentTarget.closest(".pending-edits-floating-bar");
|
|
57
58
|
if (!a) return;
|
|
@@ -63,30 +64,30 @@ const de = {
|
|
|
63
64
|
barY: i?.y ?? r.top,
|
|
64
65
|
barWidth: r.width,
|
|
65
66
|
barHeight: r.height
|
|
66
|
-
},
|
|
67
|
+
}, _(!0);
|
|
67
68
|
}, [i]);
|
|
68
69
|
C(() => {
|
|
69
|
-
if (!
|
|
70
|
+
if (!L) return;
|
|
70
71
|
const e = (r) => {
|
|
71
72
|
if (!c.current) return;
|
|
72
73
|
const R = c.current.barX + r.clientX - c.current.x, f = c.current.barY + r.clientY - c.current.y;
|
|
73
|
-
|
|
74
|
+
A(N(R, f, c.current.barWidth, c.current.barHeight));
|
|
74
75
|
}, a = () => {
|
|
75
|
-
|
|
76
|
+
_(!1), c.current = null;
|
|
76
77
|
};
|
|
77
78
|
return document.addEventListener("mousemove", e), document.addEventListener("mouseup", a), () => {
|
|
78
79
|
document.removeEventListener("mousemove", e), document.removeEventListener("mouseup", a);
|
|
79
80
|
};
|
|
80
|
-
}, [
|
|
81
|
+
}, [L, N]), C(() => {
|
|
81
82
|
if (!i || !k.current) return;
|
|
82
83
|
const e = () => {
|
|
83
84
|
if (!k.current) return;
|
|
84
85
|
const a = k.current.getBoundingClientRect(), r = N(i.x, i.y, a.width, a.height);
|
|
85
|
-
(r.x !== i.x || r.y !== i.y) &&
|
|
86
|
+
(r.x !== i.x || r.y !== i.y) && A(r);
|
|
86
87
|
};
|
|
87
88
|
return e(), window.addEventListener("resize", e), () => window.removeEventListener("resize", e);
|
|
88
89
|
}, [i, N]);
|
|
89
|
-
const
|
|
90
|
+
const O = (e, a) => {
|
|
90
91
|
if (typeof e == "boolean") return e ? "Yes" : "No";
|
|
91
92
|
if (e == null || e === "") return "-";
|
|
92
93
|
const r = String(e);
|
|
@@ -96,9 +97,9 @@ const de = {
|
|
|
96
97
|
}
|
|
97
98
|
return a ? `${r} ${a}` : r;
|
|
98
99
|
}, te = (e) => {
|
|
99
|
-
|
|
100
|
-
},
|
|
101
|
-
|
|
100
|
+
T(!1), J(e.rowId, e.columnKey, e.rowIndex);
|
|
101
|
+
}, K = (e) => {
|
|
102
|
+
$(e), z(!1), g("");
|
|
102
103
|
};
|
|
103
104
|
if (w === 0) return null;
|
|
104
105
|
const re = /* @__PURE__ */ n(
|
|
@@ -114,26 +115,26 @@ const de = {
|
|
|
114
115
|
animate: { opacity: 1, scale: 1 },
|
|
115
116
|
transition: { type: "spring", stiffness: 300, damping: 25 },
|
|
116
117
|
children: [
|
|
117
|
-
/* @__PURE__ */ t(
|
|
118
|
+
/* @__PURE__ */ t(D, { children: Q && !m && /* @__PURE__ */ t(
|
|
118
119
|
o.div,
|
|
119
120
|
{
|
|
120
121
|
className: "absolute w-80",
|
|
121
|
-
style: { bottom: "100%", left: "50%", marginLeft:
|
|
122
|
+
style: { bottom: "100%", left: "50%", marginLeft: ue, marginBottom: de },
|
|
122
123
|
initial: { opacity: 0, y: 10, scale: 0.95 },
|
|
123
124
|
animate: { opacity: 1, y: 0, scale: 1 },
|
|
124
125
|
exit: { opacity: 0, y: 10, scale: 0.95 },
|
|
125
126
|
transition: { type: "spring", stiffness: 300, damping: 24 },
|
|
126
|
-
onMouseEnter:
|
|
127
|
-
onMouseLeave:
|
|
127
|
+
onMouseEnter: Y,
|
|
128
|
+
onMouseLeave: j,
|
|
128
129
|
children: /* @__PURE__ */ n("div", { className: "bg-white dark:bg-black-700 rounded-lg shadow-xl border border-neutral-200 dark:border-black-600 py-2 overflow-hidden", children: [
|
|
129
130
|
/* @__PURE__ */ t("div", { className: "px-3 py-1.5 text-xs font-semibold text-neutral-500 dark:text-neutral-400 uppercase tracking-wider border-b border-neutral-100 dark:border-black-600", children: "Pending Changes" }),
|
|
130
|
-
d.length > 1 && /* @__PURE__ */ t("div", { className: "px-3 py-2 border-b border-neutral-100 dark:border-black-600", ref:
|
|
131
|
+
d.length > 1 && /* @__PURE__ */ t("div", { className: "px-3 py-2 border-b border-neutral-100 dark:border-black-600", ref: H, children: /* @__PURE__ */ n("div", { className: "relative", children: [
|
|
131
132
|
/* @__PURE__ */ n(
|
|
132
133
|
"button",
|
|
133
134
|
{
|
|
134
|
-
ref:
|
|
135
|
+
ref: F,
|
|
135
136
|
onClick: () => {
|
|
136
|
-
|
|
137
|
+
F.current && Z(F.current.getBoundingClientRect()), z(!b);
|
|
137
138
|
},
|
|
138
139
|
className: "w-full text-xs px-2 py-1.5 rounded border border-neutral-200 dark:border-black-500 bg-neutral-50 dark:bg-black-600 text-neutral-700 dark:text-neutral-200 focus:outline-none focus:ring-1 focus:ring-primary-500 flex items-center justify-between gap-2",
|
|
139
140
|
children: [
|
|
@@ -142,14 +143,14 @@ const de = {
|
|
|
142
143
|
]
|
|
143
144
|
}
|
|
144
145
|
),
|
|
145
|
-
b && v &&
|
|
146
|
-
/* @__PURE__ */ t(
|
|
146
|
+
b && v && P(
|
|
147
|
+
/* @__PURE__ */ t(D, { children: /* @__PURE__ */ n(
|
|
147
148
|
o.div,
|
|
148
149
|
{
|
|
149
|
-
ref:
|
|
150
|
+
ref: V,
|
|
150
151
|
className: "fixed bg-white dark:bg-black-700 rounded-lg shadow-xl border border-neutral-200 dark:border-black-600 overflow-hidden",
|
|
151
152
|
style: { zIndex: 2147483647, top: v.bottom + 4, left: v.left, width: v.width },
|
|
152
|
-
variants:
|
|
153
|
+
variants: me,
|
|
153
154
|
initial: "hidden",
|
|
154
155
|
animate: "visible",
|
|
155
156
|
exit: "exit",
|
|
@@ -160,12 +161,12 @@ const de = {
|
|
|
160
161
|
s && /* @__PURE__ */ t("button", { onClick: () => g(""), className: "absolute right-2 z-10 text-neutral-400 hover:text-neutral-600 dark:hover:text-neutral-300", children: /* @__PURE__ */ t(ie, { sx: { fontSize: 14 } }) })
|
|
161
162
|
] }) }),
|
|
162
163
|
/* @__PURE__ */ n(o.div, { className: "max-h-40 overflow-y-auto", variants: E, initial: "hidden", animate: "visible", children: [
|
|
163
|
-
(!s || "all rows".includes(s.toLowerCase())) && /* @__PURE__ */ n(o.button, { variants:
|
|
164
|
+
(!s || "all rows".includes(s.toLowerCase())) && /* @__PURE__ */ n(o.button, { variants: M, onClick: () => K(null), className: `w-full text-left px-3 py-2 text-xs transition-colors ${l ? "text-neutral-700 dark:text-neutral-200 hover:bg-neutral-50 dark:hover:bg-black-600" : "bg-primary-50 dark:bg-primary-900/30 text-primary-700 dark:text-primary-300"}`, children: [
|
|
164
165
|
"All Rows (",
|
|
165
166
|
h.length,
|
|
166
167
|
" changes)"
|
|
167
168
|
] }),
|
|
168
|
-
|
|
169
|
+
X.map((e) => /* @__PURE__ */ n(o.button, { variants: M, onClick: () => K(e.rowId), className: `w-full text-left px-3 py-2 text-xs transition-colors ${l === e.rowId ? "bg-primary-50 dark:bg-primary-900/30 text-primary-700 dark:text-primary-300" : "text-neutral-700 dark:text-neutral-200 hover:bg-neutral-50 dark:hover:bg-black-600"}`, children: [
|
|
169
170
|
"Row ",
|
|
170
171
|
e.rowIndex + 1,
|
|
171
172
|
" (",
|
|
@@ -174,7 +175,7 @@ const de = {
|
|
|
174
175
|
e.editCount === 1 ? "change" : "changes",
|
|
175
176
|
")"
|
|
176
177
|
] }, e.rowId)),
|
|
177
|
-
|
|
178
|
+
X.length === 0 && s && !"all rows".includes(s.toLowerCase()) && /* @__PURE__ */ t(o.div, { variants: M, className: "px-3 py-2 text-xs text-neutral-500 dark:text-neutral-400", children: "No rows found" })
|
|
178
179
|
] })
|
|
179
180
|
]
|
|
180
181
|
}
|
|
@@ -182,7 +183,7 @@ const de = {
|
|
|
182
183
|
document.body
|
|
183
184
|
)
|
|
184
185
|
] }) }),
|
|
185
|
-
/* @__PURE__ */ t(o.div, { className: "max-h-52 overflow-y-auto", variants: E, initial: "hidden", animate: "visible", children: W?.map((e, a) => /* @__PURE__ */ n(o.button, { variants:
|
|
186
|
+
/* @__PURE__ */ t(o.div, { className: "max-h-52 overflow-y-auto", variants: E, initial: "hidden", animate: "visible", children: W?.map((e, a) => /* @__PURE__ */ n(o.button, { variants: M, onClick: () => te(e), className: "w-full px-3 py-2 text-left hover:bg-neutral-50 dark:hover:bg-black-600 transition-colors", whileHover: { backgroundColor: "rgba(0,0,0,0.03)" }, whileTap: { scale: 0.98 }, children: [
|
|
186
187
|
/* @__PURE__ */ n("div", { className: "text-xs font-bold text-neutral-700 dark:text-neutral-300 mb-1", children: [
|
|
187
188
|
e.fieldName,
|
|
188
189
|
" ",
|
|
@@ -193,9 +194,9 @@ const de = {
|
|
|
193
194
|
] })
|
|
194
195
|
] }),
|
|
195
196
|
/* @__PURE__ */ n("div", { className: "flex items-center gap-1.5 text-sm", children: [
|
|
196
|
-
/* @__PURE__ */ t("span", { className: "text-neutral-400 dark:text-neutral-500 line-through truncate max-w-[100px]", children:
|
|
197
|
+
/* @__PURE__ */ t("span", { className: "text-neutral-400 dark:text-neutral-500 line-through truncate max-w-[100px]", children: O(e.originalValue, e.originalMeta?.currency_code) }),
|
|
197
198
|
/* @__PURE__ */ t("span", { className: "text-neutral-400 dark:text-neutral-500 flex-shrink-0", children: "→" }),
|
|
198
|
-
/* @__PURE__ */ t("span", { className: "text-primary-600 dark:text-primary-400 font-medium truncate max-w-[100px]", children:
|
|
199
|
+
/* @__PURE__ */ t("span", { className: "text-primary-600 dark:text-primary-400 font-medium truncate max-w-[100px]", children: O(e.value, e.meta?.currency_code) })
|
|
199
200
|
] })
|
|
200
201
|
] }, `${e.rowId}-${e.columnKey}-${a}`)) })
|
|
201
202
|
] })
|
|
@@ -208,14 +209,14 @@ const de = {
|
|
|
208
209
|
animate: { padding: m ? "8px" : "12px 16px", gap: m ? "0px" : "12px", borderRadius: m ? "9999px" : "8px" },
|
|
209
210
|
transition: { type: "spring", stiffness: 300, damping: 25 },
|
|
210
211
|
children: [
|
|
211
|
-
/* @__PURE__ */ t(
|
|
212
|
+
/* @__PURE__ */ t(D, { mode: "wait", children: m ? /* @__PURE__ */ t(
|
|
212
213
|
o.div,
|
|
213
214
|
{
|
|
214
215
|
initial: { opacity: 0, scale: 0.8 },
|
|
215
216
|
animate: { opacity: 1, scale: 1 },
|
|
216
217
|
exit: { opacity: 0, scale: 0.8 },
|
|
217
|
-
onMouseDown:
|
|
218
|
-
onClick: () =>
|
|
218
|
+
onMouseDown: G,
|
|
219
|
+
onClick: () => B(!1),
|
|
219
220
|
className: "flex items-center justify-center cursor-grab active:cursor-grabbing flex-shrink-0",
|
|
220
221
|
style: { width: "32px", height: "32px", borderRadius: "9999px", backgroundColor: "var(--color-primary-600)", color: "white" },
|
|
221
222
|
title: "Drag to move / Click to expand",
|
|
@@ -230,7 +231,7 @@ const de = {
|
|
|
230
231
|
initial: { opacity: 0, scale: 0.8 },
|
|
231
232
|
animate: { opacity: 1, scale: 1 },
|
|
232
233
|
exit: { opacity: 0, scale: 0.8 },
|
|
233
|
-
onClick: () =>
|
|
234
|
+
onClick: () => B(!0),
|
|
234
235
|
className: "flex items-center justify-center flex-shrink-0",
|
|
235
236
|
style: { width: "24px", height: "24px", borderRadius: "4px", backgroundColor: "transparent", color: "var(--color-neutral-400)" },
|
|
236
237
|
title: "Minimize",
|
|
@@ -248,8 +249,8 @@ const de = {
|
|
|
248
249
|
transition: { type: "spring", stiffness: 300, damping: 25 },
|
|
249
250
|
style: { overflow: "hidden", pointerEvents: m ? "none" : "auto" },
|
|
250
251
|
children: [
|
|
251
|
-
/* @__PURE__ */ t("div", { onMouseDown:
|
|
252
|
-
/* @__PURE__ */ t("div", { className: "relative", onMouseEnter:
|
|
252
|
+
/* @__PURE__ */ t("div", { onMouseDown: G, className: "cursor-grab active:cursor-grabbing text-neutral-400 dark:text-neutral-500 hover:text-neutral-600 dark:hover:text-neutral-300 flex items-center", title: "Drag to move", children: /* @__PURE__ */ t(ce, { sx: { fontSize: 18 } }) }),
|
|
253
|
+
/* @__PURE__ */ t("div", { className: "relative", onMouseEnter: Y, onMouseLeave: j, children: /* @__PURE__ */ n("span", { className: "text-sm font-medium text-neutral-700 dark:text-neutral-200 cursor-pointer hover:text-primary-600 dark:hover:text-primary-400 whitespace-nowrap", children: [
|
|
253
254
|
w,
|
|
254
255
|
" unsaved ",
|
|
255
256
|
w === 1 ? "change" : "changes"
|
|
@@ -258,7 +259,7 @@ const de = {
|
|
|
258
259
|
/* @__PURE__ */ t(
|
|
259
260
|
o.button,
|
|
260
261
|
{
|
|
261
|
-
onClick:
|
|
262
|
+
onClick: U,
|
|
262
263
|
disabled: !!u,
|
|
263
264
|
className: `px-3 py-1.5 text-sm font-medium rounded-md whitespace-nowrap flex-shrink-0 ${u ? "text-neutral-400 dark:text-neutral-500 cursor-not-allowed" : "text-neutral-600 dark:text-neutral-300 hover:bg-neutral-100 dark:hover:bg-black-600"}`,
|
|
264
265
|
whileHover: u ? void 0 : { scale: 1.02 },
|
|
@@ -269,7 +270,7 @@ const de = {
|
|
|
269
270
|
/* @__PURE__ */ t(
|
|
270
271
|
o.button,
|
|
271
272
|
{
|
|
272
|
-
onClick:
|
|
273
|
+
onClick: q,
|
|
273
274
|
disabled: !!u,
|
|
274
275
|
className: `px-3 py-1.5 text-sm font-medium rounded-md whitespace-nowrap flex-shrink-0 ${u ? "text-white bg-primary-400 cursor-not-allowed" : "text-white bg-primary-600 hover:bg-primary-700"}`,
|
|
275
276
|
whileHover: u ? void 0 : { scale: 1.02 },
|
|
@@ -286,9 +287,9 @@ const de = {
|
|
|
286
287
|
]
|
|
287
288
|
}
|
|
288
289
|
);
|
|
289
|
-
return
|
|
290
|
+
return P(re, document.body);
|
|
290
291
|
};
|
|
291
292
|
export {
|
|
292
|
-
|
|
293
|
+
ve as PendingEditsFloatingBar
|
|
293
294
|
};
|
|
294
295
|
//# sourceMappingURL=PendingEditsFloatingBar.es.js.map
|