dynamic-mui 2.0.2 → 2.0.4

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
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./index-B0FG-JGp.js");exports.ClearFormData=o.ClearFormData;exports.Controls=o.Controls;exports.DynamicComponent=o.DynamicComponent;exports.FormData=o.FormData;exports.FormGenerator=o.FormGenerator;exports.MuiConfig=o.mui;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./index-D3Jm-ikP.js");exports.ClearFormData=o.ClearFormData;exports.Controls=o.Controls;exports.DynamicComponent=o.DynamicComponent;exports.FormData=o.FormData;exports.FormGenerator=o.FormGenerator;exports.MuiConfig=o.mui;
@@ -1,4 +1,4 @@
1
- import { af as r, ag as s, ah as m, ai as n, aj as t, ak as e } from "./index-BVwk54iw.mjs";
1
+ import { af as r, ag as s, ah as m, ai as n, aj as t, ak as e } from "./index-Cm0CQSwi.mjs";
2
2
  export {
3
3
  r as ClearFormData,
4
4
  s as Controls,
@@ -95286,7 +95286,7 @@ class zze extends kC {
95286
95286
  });
95287
95287
  }
95288
95288
  async loadEventStreamCapability() {
95289
- const { EventStreamSerde: t } = await import("./index-Cz6j-hVM.mjs");
95289
+ const { EventStreamSerde: t } = await import("./index-I4bvPSIq.mjs");
95290
95290
  return new t({
95291
95291
  marshaller: this.getEventStreamMarshaller(),
95292
95292
  serializer: this.serializer,
@@ -100975,7 +100975,7 @@ function DK(e) {
100975
100975
  function $Ge(e) {
100976
100976
  return async (t) => {
100977
100977
  e.logger?.debug("@aws-sdk/credential-provider-cognito-identity - fromCognitoIdentity");
100978
- const { GetCredentialsForIdentityCommand: r, CognitoIdentityClient: o } = await import("./loadCognitoIdentity-CjHrMl-Z.mjs"), i = (u) => e.clientConfig?.[u] ?? e.parentClientConfig?.[u] ?? t?.callerClientConfig?.[u], { Credentials: { AccessKeyId: s = jGe(e.logger), Expiration: a, SecretKey: l = VGe(e.logger), SessionToken: c } = BGe(e.logger) } = await (e.client ?? new o(Object.assign({}, e.clientConfig ?? {}, {
100978
+ const { GetCredentialsForIdentityCommand: r, CognitoIdentityClient: o } = await import("./loadCognitoIdentity-DczJMR0u.mjs"), i = (u) => e.clientConfig?.[u] ?? e.parentClientConfig?.[u] ?? t?.callerClientConfig?.[u], { Credentials: { AccessKeyId: s = jGe(e.logger), Expiration: a, SecretKey: l = VGe(e.logger), SessionToken: c } = BGe(e.logger) } = await (e.client ?? new o(Object.assign({}, e.clientConfig ?? {}, {
100979
100979
  region: i("region"),
100980
100980
  profile: i("profile"),
100981
100981
  userAgentAppId: i("userAgentAppId")
@@ -101083,7 +101083,7 @@ function GGe({ accountId: e, cache: t = UGe(), client: r, clientConfig: o, custo
101083
101083
  c?.debug("@aws-sdk/credential-provider-cognito-identity - fromCognitoIdentity");
101084
101084
  const d = l ? `aws:cognito-identity-credentials:${s}:${l}` : void 0;
101085
101085
  let f = async (p) => {
101086
- const { GetIdCommand: h, CognitoIdentityClient: b } = await import("./loadCognitoIdentity-CjHrMl-Z.mjs"), g = (C) => o?.[C] ?? u?.[C] ?? p?.callerClientConfig?.[C], y = r ?? new b(Object.assign({}, o ?? {}, {
101086
+ const { GetIdCommand: h, CognitoIdentityClient: b } = await import("./loadCognitoIdentity-DczJMR0u.mjs"), g = (C) => o?.[C] ?? u?.[C] ?? p?.callerClientConfig?.[C], y = r ?? new b(Object.assign({}, o ?? {}, {
101087
101087
  region: g("region"),
101088
101088
  profile: g("profile"),
101089
101089
  userAgentAppId: g("userAgentAppId")
@@ -101134,7 +101134,8 @@ async function ZGe(e, t, r, o, i, s = "") {
101134
101134
  clientConfig: { region: o },
101135
101135
  identityPoolId: i
101136
101136
  }),
101137
- requestChecksumCalculation: "WHEN_REQUIRED"
101137
+ requestChecksumCalculation: "WHEN_REQUIRED",
101138
+ forcePathStyle: !0
101138
101139
  }), l = YGe(e);
101139
101140
  let c = s.trim();
101140
101141
  c && !c.endsWith("/") && (c += "/");
@@ -101144,37 +101145,37 @@ async function ZGe(e, t, r, o, i, s = "") {
101144
101145
  Body: l,
101145
101146
  ContentType: l.type
101146
101147
  // Depending on your bucket policy, you might need ACL: 'public-read'
101147
- // ACL: 'public-read',
101148
+ // ACL: 'public-read',
101148
101149
  });
101149
- return await a.send(d), `https://${r}.s3.${o}.amazonaws.com/${u}`;
101150
+ return await a.send(d), `https://${r}/${u}`;
101150
101151
  } catch (a) {
101151
101152
  throw console.error("Error uploading to S3:", a), a;
101152
101153
  }
101153
101154
  }
101154
101155
  function XGe({ attributes: e = {}, rules: t = {}, onChange: r }) {
101155
- const { id: o = "", MuiAttributes: i = {}, label: s = "Signature", bucket: a = "", region: l = "", identityPoolId: c = "", path: u = "" } = e, d = Hl(null), [f, p] = ya(!1), [h, b] = ya(e.value || null), g = t?.validation?.some((C) => C.rule === "mandatory") || !1;
101156
+ const { id: o = "", MuiAttributes: i = {}, label: s = "Signature", bucket: a = "", region: l = "", identityPoolId: c = "", path: u = "", disabled: d = !1 } = e, f = Hl(null), [p, h] = ya(!1), [b, g] = ya(e.value || null), y = t?.validation?.some((O) => O.rule === "mandatory") || !1;
101156
101157
  ba(() => {
101157
- e.value && d.current && d.current.fromDataURL(e.value);
101158
+ e.value && f.current && f.current.fromDataURL(e.value);
101158
101159
  }, [e.value]);
101159
- const y = () => {
101160
- d.current && d.current.clear(), b(null), r && r({ id: o, value: "" });
101161
- }, x = async () => {
101162
- if (!d.current || d.current.isEmpty()) return;
101163
- p(!0);
101164
- const C = d.current.getTrimmedCanvas().toDataURL("image/png"), O = `${o}-${Date.now()}.png`;
101160
+ const x = () => {
101161
+ f.current && f.current.clear(), g(null), r && r({ id: o, value: "" });
101162
+ }, C = async () => {
101163
+ if (!f.current || f.current.isEmpty()) return;
101164
+ h(!0);
101165
+ const O = f.current.getTrimmedCanvas().toDataURL("image/png"), T = `${o}-${Date.now()}.png`;
101165
101166
  try {
101166
- const T = await ZGe(C, O, a, l, c, u);
101167
- b(T), r && r({ id: o, value: T });
101168
- } catch (T) {
101169
- console.error("Signature upload failed", T);
101167
+ const P = await ZGe(O, T, a, l, c, u);
101168
+ g(P), r && r({ id: o, value: P });
101169
+ } catch (P) {
101170
+ console.error("Signature upload failed", P);
101170
101171
  } finally {
101171
- p(!1);
101172
+ h(!1);
101172
101173
  }
101173
101174
  };
101174
101175
  return /* @__PURE__ */ w.jsxs(ti, { sx: { width: "100%", ...i.sx }, children: [
101175
101176
  /* @__PURE__ */ w.jsxs(uu, { variant: "subtitle2", gutterBottom: !0, sx: { display: "flex" }, children: [
101176
101177
  s,
101177
- g && /* @__PURE__ */ w.jsx(ti, { component: "span", sx: { color: "error.main", ml: 0.5 }, children: "*" })
101178
+ y && /* @__PURE__ */ w.jsx(ti, { component: "span", sx: { color: "error.main", ml: 0.5 }, children: "*" })
101178
101179
  ] }),
101179
101180
  /* @__PURE__ */ w.jsx(
101180
101181
  ti,
@@ -101189,11 +101190,11 @@ function XGe({ attributes: e = {}, rules: t = {}, onChange: r }) {
101189
101190
  children: /* @__PURE__ */ w.jsx(
101190
101191
  PC,
101191
101192
  {
101192
- ref: d,
101193
+ ref: f,
101193
101194
  penColor: "black",
101194
101195
  canvasProps: {
101195
101196
  className: "sigCanvas",
101196
- style: { width: "100%", height: 200 }
101197
+ style: { width: "100%", height: 200, pointerEvents: d ? "none" : "auto" }
101197
101198
  },
101198
101199
  backgroundColor: "transparent"
101199
101200
  }
@@ -101201,20 +101202,20 @@ function XGe({ attributes: e = {}, rules: t = {}, onChange: r }) {
101201
101202
  }
101202
101203
  ),
101203
101204
  /* @__PURE__ */ w.jsxs(ti, { sx: { display: "flex", gap: 2, alignItems: "center", mt: 1 }, children: [
101204
- /* @__PURE__ */ w.jsx(Bh, { variant: "outlined", color: "secondary", onClick: y, size: "small", children: "Clear" }),
101205
+ /* @__PURE__ */ w.jsx(Bh, { variant: "outlined", color: "secondary", onClick: x, size: "small", disabled: d || p, children: "Clear" }),
101205
101206
  /* @__PURE__ */ w.jsx(
101206
101207
  Bh,
101207
101208
  {
101208
101209
  variant: "contained",
101209
101210
  color: "primary",
101210
- onClick: x,
101211
+ onClick: C,
101211
101212
  size: "small",
101212
- disabled: f || h !== null,
101213
- startIcon: f ? /* @__PURE__ */ w.jsx(Jte, { size: 16, color: "inherit" }) : null,
101214
- children: h ? "Saved" : "Save & Upload"
101213
+ disabled: d || p || b !== null,
101214
+ startIcon: p ? /* @__PURE__ */ w.jsx(Jte, { size: 16, color: "inherit" }) : null,
101215
+ children: b ? "Saved" : "Save"
101215
101216
  }
101216
101217
  ),
101217
- h && /* @__PURE__ */ w.jsx(uu, { variant: "caption", color: "success.main", children: "Signature Uploaded!" })
101218
+ b && /* @__PURE__ */ w.jsx(uu, { variant: "caption", color: "success.main", children: "Signature Saved!" })
101218
101219
  ] })
101219
101220
  ] });
101220
101221
  }