dynamic-mui 2.0.3 → 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-DGrHXwre.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-uFHTBiw4.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-MXZTLvLW.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-BXu2a5gD.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-BXu2a5gD.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")
@@ -101153,29 +101153,29 @@ async function ZGe(e, t, r, o, i, s = "") {
101153
101153
  }
101154
101154
  }
101155
101155
  function XGe({ attributes: e = {}, rules: t = {}, onChange: r }) {
101156
- 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;
101157
101157
  ba(() => {
101158
- e.value && d.current && d.current.fromDataURL(e.value);
101158
+ e.value && f.current && f.current.fromDataURL(e.value);
101159
101159
  }, [e.value]);
101160
- const y = () => {
101161
- d.current && d.current.clear(), b(null), r && r({ id: o, value: "" });
101162
- }, x = async () => {
101163
- if (!d.current || d.current.isEmpty()) return;
101164
- p(!0);
101165
- 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`;
101166
101166
  try {
101167
- const T = await ZGe(C, O, a, l, c, u);
101168
- b(T), r && r({ id: o, value: T });
101169
- } catch (T) {
101170
- 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);
101171
101171
  } finally {
101172
- p(!1);
101172
+ h(!1);
101173
101173
  }
101174
101174
  };
101175
101175
  return /* @__PURE__ */ w.jsxs(ti, { sx: { width: "100%", ...i.sx }, children: [
101176
101176
  /* @__PURE__ */ w.jsxs(uu, { variant: "subtitle2", gutterBottom: !0, sx: { display: "flex" }, children: [
101177
101177
  s,
101178
- 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: "*" })
101179
101179
  ] }),
101180
101180
  /* @__PURE__ */ w.jsx(
101181
101181
  ti,
@@ -101190,11 +101190,11 @@ function XGe({ attributes: e = {}, rules: t = {}, onChange: r }) {
101190
101190
  children: /* @__PURE__ */ w.jsx(
101191
101191
  PC,
101192
101192
  {
101193
- ref: d,
101193
+ ref: f,
101194
101194
  penColor: "black",
101195
101195
  canvasProps: {
101196
101196
  className: "sigCanvas",
101197
- style: { width: "100%", height: 200 }
101197
+ style: { width: "100%", height: 200, pointerEvents: d ? "none" : "auto" }
101198
101198
  },
101199
101199
  backgroundColor: "transparent"
101200
101200
  }
@@ -101202,20 +101202,20 @@ function XGe({ attributes: e = {}, rules: t = {}, onChange: r }) {
101202
101202
  }
101203
101203
  ),
101204
101204
  /* @__PURE__ */ w.jsxs(ti, { sx: { display: "flex", gap: 2, alignItems: "center", mt: 1 }, children: [
101205
- /* @__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" }),
101206
101206
  /* @__PURE__ */ w.jsx(
101207
101207
  Bh,
101208
101208
  {
101209
101209
  variant: "contained",
101210
101210
  color: "primary",
101211
- onClick: x,
101211
+ onClick: C,
101212
101212
  size: "small",
101213
- disabled: f || h !== null,
101214
- startIcon: f ? /* @__PURE__ */ w.jsx(Jte, { size: 16, color: "inherit" }) : null,
101215
- 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"
101216
101216
  }
101217
101217
  ),
101218
- 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!" })
101219
101219
  ] })
101220
101220
  ] });
101221
101221
  }