najwer23morsels 1.10.16 → 1.10.17

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.
@@ -1 +1 @@
1
- import{jsxs as e,jsx as l}from"react/jsx-runtime";import{useState as a}from"react";import{B as t}from"../Button-QC014EKI.js";import{C as o}from"../Calendar-BkDrBfRy.js";import{D as i}from"../Dialog-8B0xk8Wx.js";import{F as r}from"../Form-CgTuTB2Q.js";import{G as n}from"../Grid-DmI4tqqG.js";import{I as s}from"../Input-Bl7_BOs4.js";import{S as c}from"../Select-QBTZllFj.js";import{T as d}from"../TextBox-__k4jPYK.js";import{T as m}from"../Typography-CZqNLAT7.js";import{s as p,g as b}from"../style-inject.es-CrVRO2OA.js";import"../Loader-ZYEBOkbx.js";import"../LoaderDots-BoEg_zlZ.js";import"../IconLocate-CQda7FAB.js";import"../validator/index.js";var u={n23mTable:"Table-module_n23mTable__kKVd9",table:"Table-module_table__hJFsY"};p("@layer n23mTable{.Table-module_n23mTable__kKVd9{background-attachment:local,local,scroll,scroll;background-color:#fff;background-image:linear-gradient(90deg,#fff 20px,hsla(0,0%,100%,0)),linear-gradient(270deg,#fff 20px,hsla(0,0%,100%,0)),radial-gradient(farthest-side at 0 50%,rgba(0,0,0,.25),transparent),radial-gradient(farthest-side at 100% 50%,rgba(0,0,0,.25),transparent);background-position:0,100%,0,100%;background-repeat:no-repeat;background-size:40px 100%,40px 100%,14px 100%,14px 100%;overflow-x:auto}.Table-module_n23mTable__kKVd9:focus-visible{outline:2px solid currentcolor;outline-offset:2px}.Table-module_table__hJFsY{border-collapse:collapse;min-width:max-content;width:100%}.Table-module_table__hJFsY td,.Table-module_table__hJFsY th{border:1px solid grey;padding:10px 12px}.Table-module_table__hJFsY td[data-clickable=true]{cursor:pointer}}");const g=({className:p,jsonSchema:g,jsonData:h,cellEdit:f,style:x,...T})=>{const[k,_]=a(!1),[j,y]=a(0),[S,C]=a(null),{onCellEdit:N,onCellDelete:v,onCellReset:w,isCellError:z=!1,isCellPending:D=!1,isCellSuccess:V=!1,cellErrorMsg:B,cellSuccessMsg:E}=f??{},F=Boolean(N),M=g.cols.filter(e=>"id"!==e.cellName);return e("div",{className:[u.n23mTable,"n23mTable",p].filter(Boolean).join(" "),...T,style:{...b({}),...x},children:[F&&l(i,{open:k,onCancel:()=>{_(!1),w?.()},widthMax:"900px",children:e(n,{layout:"container",widthMin:"min(800px, calc(100vw - 25px))",padding:"0px 30px 30px 30px",margin:"auto",children:[l(m,{appearance:"light",variant:"subheading",style:{margin:"0 0 20px 0"},children:"Edit Cell"}),e(r,{onSubmit:e=>{if(!N)return;if(Object.values(e).some(({error:e})=>e))return;const l=Object.fromEntries(Object.entries(e).map(([e,{value:l}])=>[e,l]));N(l)},isError:z,isPending:D,isSuccess:V,errorMsg:B,successMsg:E,children:[l(n,{layout:"columns",col:{smallDesktop:2},gap:{col:"20px"},children:S&&g.cols.map(e=>{const a="id"===e.cellName,t=S[e.cellName];if("date"===e.cellType){const a=t||e.initialValue;return l(o,{label:e.cellText,name:e.cellName,initialValue:a,placeholder:e.cellText},e.cellName)}if("select"===e.cellType){const a=e.options.find(e=>e.value===String(t??""))??e.initialValue;return l(c,{name:e.cellName,options:e.options,initialValue:a},e.cellName)}return l(s,{label:e.cellText,name:e.cellName,type:e.cellType,step:"number"===e.cellType?.01:void 0,defaultValue:String(t??""),disabled:a,placeholder:e.cellText},e.cellName)})}),e(n,{layout:"flex",widthMax:"100%",padding:"0",justifyContent:v?"space-between":"flex-end",alignItems:"right",margin:"20px 0 0 0",children:[v&&l(t,{type:"button",height:"40px",width:"auto",padding:"0 10px",disabled:D,backgroundColor:"red",backgroundColorDisabled:"grey",onClick:()=>{v&&S&&(v(S.id),_(!1),w?.())},children:l(d,{tag:"span",desktopSize:16,mobileSize:16,fontWeight:400,color:"white",children:"Delete"})}),l(t,{type:"submit",height:"40px",width:"auto",padding:"0 10px",disabled:D,backgroundColor:"#4BB543",backgroundColorDisabled:"grey",children:l(d,{tag:"span",desktopSize:16,mobileSize:16,fontWeight:400,color:"white",children:"Save"})})]})]},j)]})}),e("table",{className:u.table,children:[l("thead",{children:l("tr",{children:M.map(e=>l("th",{scope:"col",children:l(d,{mobileSize:16,desktopSize:20,color:"black",textAlign:e.thAlign??"left",children:e.cellText})},e.cellName))})}),l("tbody",{children:h.rows.map(e=>l("tr",{children:M.map(a=>{const t=e[a.cellName];return l("td",{"data-clickable":F,onClick:F?()=>(e=>{C(e),_(!0),y(e=>e+1)})(e):void 0,children:l(d,{fontWeight:400,mobileSize:16,desktopSize:16,color:"black",textAlign:a.tdAlign??"left",children:void 0===t?"":String(t)})},a.cellName)})},e.id))})]})]})};g.displayName="Table";export{g as Table};
1
+ import{jsxs as e,jsx as l}from"react/jsx-runtime";import{useState as a}from"react";import{B as o}from"../Button-QC014EKI.js";import{C as t}from"../Calendar-BkDrBfRy.js";import{D as r}from"../Dialog-8B0xk8Wx.js";import{F as i}from"../Form-CgTuTB2Q.js";import{G as n}from"../Grid-DmI4tqqG.js";import{I as s}from"../Input-Bl7_BOs4.js";import{S as d}from"../Select-QBTZllFj.js";import{T as c}from"../TextBox-__k4jPYK.js";import{T as m}from"../Typography-CZqNLAT7.js";import{s as p,g as b}from"../style-inject.es-CrVRO2OA.js";import"../Loader-ZYEBOkbx.js";import"../LoaderDots-BoEg_zlZ.js";import"../IconLocate-CQda7FAB.js";import"../validator/index.js";var h={n23mTable:"Table-module_n23mTable__kKVd9",table:"Table-module_table__hJFsY"};p('@layer n23mTable{.Table-module_n23mTable__kKVd9{--hover-bg:rgba(0,0,0,.11);background-attachment:local,local,scroll,scroll;background-color:#fff;background-image:linear-gradient(90deg,#fff 20px,hsla(0,0%,100%,0)),linear-gradient(270deg,#fff 20px,hsla(0,0%,100%,0)),radial-gradient(farthest-side at 0 50%,rgba(0,0,0,.25),transparent),radial-gradient(farthest-side at 100% 50%,rgba(0,0,0,.25),transparent);background-position:0,100%,0,100%;background-repeat:no-repeat;background-size:40px 100%,40px 100%,14px 100%,14px 100%;isolation:isolate;overflow-x:auto;overflow-y:hidden}.Table-module_n23mTable__kKVd9:focus-visible{outline:2px solid currentcolor;outline-offset:2px}.Table-module_table__hJFsY{border-collapse:collapse;min-width:max-content;width:100%}.Table-module_table__hJFsY td,.Table-module_table__hJFsY th{border:1px solid grey;padding:10px 12px;position:relative}.Table-module_table__hJFsY td[data-clickable=true]{cursor:pointer}@media (hover:hover){.Table-module_table__hJFsY tbody tr:hover>td{background-color:var(--hover-bg)}.Table-module_table__hJFsY tbody td:hover:after{background-color:var(--hover-bg);content:"";inset:-100vh 0;pointer-events:none;position:absolute;z-index:-1}}}');const u=({className:p,jsonSchema:u,jsonData:g,cellEdit:f,style:x,...T})=>{const[_,v]=a(!1),[k,y]=a(0),[j,S]=a(null),{onCellEdit:C,onCellDelete:N,onCellReset:w,isCellError:z=!1,isCellPending:D=!1,isCellSuccess:F=!1,cellErrorMsg:V,cellSuccessMsg:B}=f??{},E=Boolean(C),J=u.cols.filter(e=>"id"!==e.cellName);return e("div",{className:[h.n23mTable,"n23mTable",p].filter(Boolean).join(" "),...T,style:{...b({}),...x},children:[E&&l(r,{open:_,onCancel:()=>{v(!1),w?.()},widthMax:"900px",children:e(n,{layout:"container",widthMin:"min(800px, calc(100vw - 25px))",padding:"0px 30px 30px 30px",margin:"auto",children:[l(m,{appearance:"light",variant:"subheading",style:{margin:"0 0 20px 0"},children:"Edit Cell"}),e(i,{onSubmit:e=>{if(!C)return;if(Object.values(e).some(({error:e})=>e))return;const l=Object.fromEntries(Object.entries(e).map(([e,{value:l}])=>[e,l]));C(l)},isError:z,isPending:D,isSuccess:F,errorMsg:V,successMsg:B,children:[l(n,{layout:"columns",col:{smallDesktop:2},gap:{col:"20px"},children:j&&u.cols.map(e=>{const a="id"===e.cellName,o=j[e.cellName];if("date"===e.cellType){const a=o||e.initialValue;return l(t,{label:e.cellText,name:e.cellName,initialValue:a,placeholder:e.cellText},e.cellName)}if("select"===e.cellType){const a=e.options.find(e=>e.value===String(o??""))??e.initialValue;return l(d,{name:e.cellName,options:e.options,initialValue:a},e.cellName)}return l(s,{label:e.cellText,name:e.cellName,type:e.cellType,step:"number"===e.cellType?.01:void 0,defaultValue:String(o??""),disabled:a,placeholder:e.cellText},e.cellName)})}),e(n,{layout:"flex",widthMax:"100%",padding:"0",justifyContent:N?"space-between":"flex-end",alignItems:"right",margin:"20px 0 0 0",children:[N&&l(o,{type:"button",height:"40px",width:"auto",padding:"0 10px",disabled:D,backgroundColor:"red",backgroundColorDisabled:"grey",onClick:()=>{N&&j&&(N(j.id),v(!1),w?.())},children:l(c,{tag:"span",desktopSize:16,mobileSize:16,fontWeight:400,color:"white",children:"Delete"})}),l(o,{type:"submit",height:"40px",width:"auto",padding:"0 10px",disabled:D,backgroundColor:"#4BB543",backgroundColorDisabled:"grey",children:l(c,{tag:"span",desktopSize:16,mobileSize:16,fontWeight:400,color:"white",children:"Save"})})]})]},k)]})}),e("table",{className:h.table,children:[l("thead",{children:l("tr",{children:J.map(e=>l("th",{scope:"col",children:l(c,{mobileSize:16,desktopSize:20,color:"black",textAlign:e.thAlign??"left",children:e.cellText})},e.cellName))})}),l("tbody",{children:g.rows.map(e=>l("tr",{children:J.map(a=>{const o=e[a.cellName];return l("td",{"data-clickable":E,onClick:E?()=>(e=>{S(e),v(!0),y(e=>e+1)})(e):void 0,children:l(c,{fontWeight:400,mobileSize:16,desktopSize:16,color:"black",textAlign:a.tdAlign??"left",children:void 0===o?"":String(o)})},a.cellName)})},e.id))})]})]})};u.displayName="Table";export{u as Table};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "najwer23morsels",
3
- "version": "1.10.16",
3
+ "version": "1.10.17",
4
4
  "exports": {
5
5
  "./lib/*": {
6
6
  "types": "./lib/*/index.d.ts",