codicent-app-sdk 0.4.2 → 0.4.3
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
|
-
{"version":3,"file":"RecordModal.d.ts","sourceRoot":"","sources":["../../../src/components/RecordModal.tsx"],"names":[],"mappings":"AAWA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAenD,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAiB9C,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACzD,OAAO,EAAE,gBAAgB,EAAE,CAAC;IAC5B,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACtC,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,
|
|
1
|
+
{"version":3,"file":"RecordModal.d.ts","sourceRoot":"","sources":["../../../src/components/RecordModal.tsx"],"names":[],"mappings":"AAWA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAenD,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAiB9C,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACzD,OAAO,EAAE,gBAAgB,EAAE,CAAC;IAC5B,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACtC,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CA0GlD,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("react"),t=require("@fluentui/react-components"),a=require("../hooks/useLocalization.js");const o=t.makeStyles({content:{display:"flex",flexDirection:"column",gap:"16px",minWidth:"400px",maxHeight:"60vh",overflowY:"auto"},field:{display:"flex",flexDirection:"column"}}),n=({open:n,onClose:l,onSave:i,columns:c,initialData:s,title:d})=>{const u=o(),{t:p}=a.default(),[x,h]=r.useState({}),[y,f]=r.useState(!1);r.useEffect((()=>{n&&h(s||{})}),[n,s]);const g=e=>Array.isArray(e.key)?e.key[0]:e.key,j=e=>{if(Array.isArray(e.key))for(const r of e.key)if(void 0!==x[r])return r;return g(e)},k=(e,r)=>{const t=j(e);h((e=>({...e,[t]:r})))},m=c.filter((e=>!e.hidden&&"file"!==e.type&&"createdAt"!==g(e)));return e.jsx(t.Dialog,{open:n,onOpenChange:(e,r)=>!y&&!1===r.open&&l(),children:e.jsx(t.DialogSurface,{backdrop:{style:{backgroundColor:"rgba(0, 0, 0, 0.4)"}},children:e.jsxs(t.DialogBody,{children:[e.jsx(t.DialogTitle,{children:d||p(s?"Edit Record":"Add Record")}),e.jsx(t.DialogContent,{className:u.content,children:m.map(((r,a)=>{const o=g(r),n=(e=>{const r=j(e);return x[r]})(r),l=r.title||o;return"checkbox"===r.type?e.jsx(t.Field,{label:l,className:u.field,children:e.jsx(t.Checkbox,{checked:!0===n||"true"===n||"yes"===n||"1"===n,onChange:(e,t)=>k(r,t.checked)})},a):e.jsx(t.Field,{label:l,className:u.field,children:e.jsx(t.Input,{value:String(n??""),onChange:(e,t)=>k(r,t.value),placeholder:p("Enter")+" "+l.toLowerCase()})},a)}))}),e.jsxs(t.DialogActions,{children:[e.jsx(t.Button,{appearance:"secondary",onClick:l,disabled:y,children:p("Cancel")}),e.jsx(t.Button,{appearance:"primary",onClick:async()=>{f(!0);try{await i(x),l()}catch(e){console.error("Failed to save record:",e)}finally{f(!1)}},disabled:y,children:p(y?"Saving...":"Save")})]})]})})})};exports.RecordModal=n,exports.default=n;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RecordModal.d.ts","sourceRoot":"","sources":["../../../src/components/RecordModal.tsx"],"names":[],"mappings":"AAWA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAenD,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAiB9C,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACzD,OAAO,EAAE,gBAAgB,EAAE,CAAC;IAC5B,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACtC,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,
|
|
1
|
+
{"version":3,"file":"RecordModal.d.ts","sourceRoot":"","sources":["../../../src/components/RecordModal.tsx"],"names":[],"mappings":"AAWA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAenD,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAiB9C,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACzD,OAAO,EAAE,gBAAgB,EAAE,CAAC;IAC5B,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACtC,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CA0GlD,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,jsxs as
|
|
1
|
+
import{jsx as e,jsxs as r}from"react/jsx-runtime";import{useState as n,useEffect as o}from"react";import{makeStyles as a,Dialog as t,DialogSurface as c,DialogBody as i,DialogTitle as l,DialogContent as d,Field as s,Checkbox as p,Input as h,DialogActions as f,Button as m}from"@fluentui/react-components";import y from"../hooks/useLocalization.js";const u=a({content:{display:"flex",flexDirection:"column",gap:"16px",minWidth:"400px",maxHeight:"60vh",overflowY:"auto"},field:{display:"flex",flexDirection:"column"}}),k=({open:a,onClose:k,onSave:x,columns:g,initialData:v,title:C})=>{const b=u(),{t:A}=y(),[S,w]=n({}),[D,N]=n(!1);o((()=>{a&&w(v||{})}),[a,v]);const j=e=>Array.isArray(e.key)?e.key[0]:e.key,E=e=>{if(Array.isArray(e.key))for(const r of e.key)if(void 0!==S[r])return r;return j(e)},L=(e,r)=>{const n=E(e);w((e=>({...e,[n]:r})))},R=g.filter((e=>!e.hidden&&"file"!==e.type&&"createdAt"!==j(e)));return e(t,{open:a,onOpenChange:(e,r)=>!D&&!1===r.open&&k(),children:e(c,{backdrop:{style:{backgroundColor:"rgba(0, 0, 0, 0.4)"}},children:r(i,{children:[e(l,{children:C||A(v?"Edit Record":"Add Record")}),e(d,{className:b.content,children:R.map(((r,n)=>{const o=j(r),a=(e=>{const r=E(e);return S[r]})(r),t=r.title||o;return"checkbox"===r.type?e(s,{label:t,className:b.field,children:e(p,{checked:!0===a||"true"===a||"yes"===a||"1"===a,onChange:(e,n)=>L(r,n.checked)})},n):e(s,{label:t,className:b.field,children:e(h,{value:String(a??""),onChange:(e,n)=>L(r,n.value),placeholder:A("Enter")+" "+t.toLowerCase()})},n)}))}),r(f,{children:[e(m,{appearance:"secondary",onClick:k,disabled:D,children:A("Cancel")}),e(m,{appearance:"primary",onClick:async()=>{N(!0);try{await x(S),k()}catch(e){console.error("Failed to save record:",e)}finally{N(!1)}},disabled:D,children:A(D?"Saving...":"Save")})]})]})})})};export{k as RecordModal,k as default};
|