whoami7 - Manager
:
/
home
/
qbizpnmr
/
arif.umairtax.com
/
public
/
Upload File:
files >> //home/qbizpnmr/arif.umairtax.com/public/DataTableColumnsPicker-BAbL5ze4.js
import{j as e,b3 as I,b4 as R,u as B,b5 as L,a as M,w as T,p as i,b6 as z,ad as F,E as U,a8 as V,b7 as H,b8 as W,b9 as X,ba as y,bb as v,bc as q,ae as p,bd as G,be as j,bf as k,r as A,e as J,$ as K,bg as O,bh as Q}from"./bundle.OlIVtvc7.js";/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function Y({size:a="1.2rem",color:d="#000"}){return e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",width:a,height:a,viewBox:"0 0 12 12",children:[e.jsx("line",{x1:"6",y1:"1.25",x2:"6",y2:"10.75",fill:"none",stroke:d,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5","data-color":"color-2"}),e.jsx("rect",{x:"1.25",y:"1.25",width:"9.5",height:"9.5",rx:"2",ry:"2",fill:"none",stroke:d,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"})]})}function ee(a){var g;const d=I(s=>s.user.user),b=R(),[n]=B(),{table:f,defaultColumns:C}=a;L();const l=M(),m=T(),[w,x]=i.useState(a.columns),[c,u]=i.useState(((g=m==null?void 0:m.react_table_columns)==null?void 0:g[f])||C),[$,h]=i.useState(!1);i.useEffect(()=>{x(s=>s.filter(r=>!c.includes(r)))},[c]);const _=i.useCallback(s=>{s.length>1&&u(r=>[...r,s])},[]),N=()=>{const s=j.cloneDeep(d);j.set(s,`company_user.react_settings.react_table_columns.${f}`,c),k.processing(),A("PUT",J("/api/v1/company_users/:id",{id:s.id}),s).then(r=>{j.set(s,"company_user",r.data.data),h(!1),K(["company_users"]),b(O(s)),b(Q()),k.success("saved_settings")})},D=s=>{const r=c.filter(t=>t!==s);u(r);const o=a.columns.filter(t=>!r.find(E=>E===t));x(o)},S=s=>{var o;const r=G(c,s.source.index,(o=s.destination)==null?void 0:o.index);u(r)},P=i.useCallback(()=>{u(C),x(a.columns)},[]);return e.jsxs(e.Fragment,{children:[z.createPortal(e.jsx(F,{title:n("edit_columns"),visible:$,onClose:h,children:e.jsxs("div",{className:"flex flex-col",children:[e.jsx(U,{className:"shadow-sm",label:n("add_column"),onValueChange:_,value:"",withBlank:!0,customSelector:!0,cypressRef:"columSelector",children:w.sort((s,r)=>n(s).localeCompare(n(r))).map((s,r)=>e.jsx("option",{value:s,children:n(s)},r))}),e.jsx(V,{className:"mt-4",children:n("order_columns")}),e.jsx("div",{className:"mt-3",children:e.jsx(H,{onDragEnd:S,children:e.jsx(W,{droppableId:"columns",renderClone:(s,r,o)=>{const t=c[o.source.index];return e.jsxs("div",{ref:s.innerRef,...s.draggableProps,className:"flex items-center justify-between py-[0.4rem] text-sm",children:[e.jsxs("div",{className:"flex flex-1 space-x-2 items-center cursor-pointer",...s.dragHandleProps,children:[e.jsx("div",{children:e.jsx(y,{size:"1.2rem",color:l.$17})}),e.jsx("p",{style:{color:l.$3},children:n(t)})]}),e.jsx(v,{color:l.$16,hoverColor:l.$3,borderColor:l.$5,hoverBorderColor:l.$17,size:"1.6rem"})]})},children:s=>e.jsxs("div",{...s.droppableProps,ref:s.innerRef,children:[c.map((r,o)=>e.jsx(X,{draggableId:`item-${o}`,index:o,children:t=>e.jsxs("div",{ref:t.innerRef,...t.draggableProps,className:"flex items-center justify-between py-[0.4rem]",children:[e.jsxs("div",{className:"flex flex-1 space-x-2 items-center cursor-pointer",...t.dragHandleProps,children:[e.jsx("div",{children:e.jsx(y,{size:"1.2rem",color:l.$17})}),e.jsx("p",{style:{color:l.$3},children:n(r)})]}),e.jsx("div",{className:"cursor-pointer",onClick:()=>D(r),children:e.jsx(v,{color:l.$16,hoverColor:l.$3,borderColor:l.$5,hoverBorderColor:l.$17,size:"1.6rem"})})]})},o)),s.placeholder]})})})}),e.jsx("div",{className:"flex mt-4 lg:flex-row lg:justify-end",children:e.jsxs(q,{children:[e.jsx(p,{type:"secondary",onClick:P,children:n("reset")}),e.jsx(p,{onClick:N,children:n("save")})]})})]})}),document.body),e.jsx(p,{className:"shadow-sm",type:"secondary",onClick:()=>h(!0),children:e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Y,{size:"1.3rem",color:l.$3}),e.jsx("span",{className:"hidden 2xl:flex",children:n("columns")})]})})]})}export{ee as D,Y as T};
Copyright ©2021 || Defacer Indonesia