@superdoc-dev/esign 1.4.2 → 1.5.0
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.
- package/LICENSE +661 -0
- package/dist/defaults/DownloadButton.d.ts.map +1 -1
- package/dist/defaults/SubmitButton.d.ts.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.mjs +273 -216
- package/dist/types.d.ts +20 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/styles.css +26 -0
package/dist/index.mjs
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
const
|
|
4
|
-
value:
|
|
1
|
+
import { jsxs as y, jsx as c } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as ue, useState as v, useRef as D, useEffect as R, useCallback as M, useImperativeHandle as pe } from "react";
|
|
3
|
+
const ge = ({
|
|
4
|
+
value: p,
|
|
5
5
|
onChange: m,
|
|
6
|
-
isDisabled:
|
|
7
|
-
label:
|
|
8
|
-
}) => /* @__PURE__ */
|
|
6
|
+
isDisabled: l,
|
|
7
|
+
label: n
|
|
8
|
+
}) => /* @__PURE__ */ y(
|
|
9
9
|
"div",
|
|
10
10
|
{
|
|
11
11
|
className: "superdoc-esign-signature-input",
|
|
12
12
|
style: { display: "flex", flexDirection: "column", gap: "8px" },
|
|
13
13
|
children: [
|
|
14
|
-
|
|
15
|
-
/* @__PURE__ */
|
|
14
|
+
n && /* @__PURE__ */ c("label", { children: n }),
|
|
15
|
+
/* @__PURE__ */ c(
|
|
16
16
|
"input",
|
|
17
17
|
{
|
|
18
18
|
type: "text",
|
|
19
|
-
value: String(
|
|
20
|
-
onChange: (
|
|
21
|
-
disabled:
|
|
19
|
+
value: String(p || ""),
|
|
20
|
+
onChange: (i) => m(i.target.value),
|
|
21
|
+
disabled: l,
|
|
22
22
|
placeholder: "Type your full name",
|
|
23
23
|
style: {
|
|
24
24
|
fontFamily: "cursive",
|
|
@@ -28,323 +28,380 @@ const ue = ({
|
|
|
28
28
|
)
|
|
29
29
|
]
|
|
30
30
|
}
|
|
31
|
-
),
|
|
32
|
-
value:
|
|
31
|
+
), me = ({
|
|
32
|
+
value: p,
|
|
33
33
|
onChange: m,
|
|
34
|
-
isDisabled:
|
|
35
|
-
label:
|
|
36
|
-
}) => /* @__PURE__ */
|
|
37
|
-
/* @__PURE__ */
|
|
34
|
+
isDisabled: l,
|
|
35
|
+
label: n
|
|
36
|
+
}) => /* @__PURE__ */ y("label", { className: "superdoc-esign-checkbox-input", style: { display: "flex", gap: "8px" }, children: [
|
|
37
|
+
/* @__PURE__ */ c(
|
|
38
38
|
"input",
|
|
39
39
|
{
|
|
40
40
|
type: "checkbox",
|
|
41
|
-
checked: !!
|
|
42
|
-
onChange: (
|
|
43
|
-
disabled:
|
|
41
|
+
checked: !!p,
|
|
42
|
+
onChange: (i) => m(i.target.checked),
|
|
43
|
+
disabled: l
|
|
44
44
|
}
|
|
45
45
|
),
|
|
46
|
-
/* @__PURE__ */
|
|
47
|
-
] }),
|
|
48
|
-
|
|
49
|
-
|
|
46
|
+
/* @__PURE__ */ c("span", { children: n })
|
|
47
|
+
] }), fe = (p) => ({
|
|
48
|
+
onClick: l,
|
|
49
|
+
fileName: n,
|
|
50
|
+
isDisabled: i,
|
|
51
|
+
isDownloading: a
|
|
52
|
+
}) => {
|
|
53
|
+
const b = p?.label || "Download", u = i || a;
|
|
54
|
+
return /* @__PURE__ */ y(
|
|
50
55
|
"button",
|
|
51
56
|
{
|
|
52
|
-
onClick:
|
|
53
|
-
disabled:
|
|
54
|
-
className:
|
|
57
|
+
onClick: l,
|
|
58
|
+
disabled: u,
|
|
59
|
+
className: `superdoc-esign-btn superdoc-esign-btn--download${a ? " superdoc-esign-btn--loading" : ""}`,
|
|
55
60
|
style: {
|
|
56
61
|
padding: "8px 16px",
|
|
57
62
|
borderRadius: "6px",
|
|
58
63
|
border: "1px solid #d0d5dd",
|
|
59
64
|
background: "#ffffff",
|
|
60
65
|
color: "#333",
|
|
61
|
-
cursor:
|
|
62
|
-
opacity:
|
|
66
|
+
cursor: u ? "not-allowed" : "pointer",
|
|
67
|
+
opacity: u ? 0.7 : 1,
|
|
63
68
|
fontSize: "16px",
|
|
64
|
-
fontWeight: "bold"
|
|
69
|
+
fontWeight: "bold",
|
|
70
|
+
display: "inline-flex",
|
|
71
|
+
alignItems: "center",
|
|
72
|
+
gap: "8px",
|
|
73
|
+
transition: "opacity 0.2s ease"
|
|
65
74
|
},
|
|
66
75
|
children: [
|
|
67
|
-
|
|
68
|
-
"
|
|
69
|
-
|
|
76
|
+
a && /* @__PURE__ */ c("span", { className: "superdoc-esign-spinner" }),
|
|
77
|
+
a ? "Downloading..." : b,
|
|
78
|
+
!a && n && ` (${n})`
|
|
70
79
|
]
|
|
71
80
|
}
|
|
72
81
|
);
|
|
73
|
-
},
|
|
74
|
-
onClick:
|
|
75
|
-
isValid:
|
|
76
|
-
isDisabled:
|
|
77
|
-
isSubmitting:
|
|
78
|
-
}) =>
|
|
79
|
-
"
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
82
|
+
}, he = (p) => ({
|
|
83
|
+
onClick: l,
|
|
84
|
+
isValid: n,
|
|
85
|
+
isDisabled: i,
|
|
86
|
+
isSubmitting: a
|
|
87
|
+
}) => {
|
|
88
|
+
const b = p?.label || "Submit", u = !n || i || a;
|
|
89
|
+
return /* @__PURE__ */ y(
|
|
90
|
+
"button",
|
|
91
|
+
{
|
|
92
|
+
onClick: l,
|
|
93
|
+
disabled: u,
|
|
94
|
+
className: `superdoc-esign-btn superdoc-esign-btn--submit${a ? " superdoc-esign-btn--loading" : ""}`,
|
|
95
|
+
style: {
|
|
96
|
+
padding: "12px 24px",
|
|
97
|
+
borderRadius: "6px",
|
|
98
|
+
border: "none",
|
|
99
|
+
background: "#007bff",
|
|
100
|
+
color: "#fff",
|
|
101
|
+
cursor: u ? "not-allowed" : "pointer",
|
|
102
|
+
opacity: u && !a ? 0.5 : 1,
|
|
103
|
+
fontSize: "16px",
|
|
104
|
+
fontWeight: "bold",
|
|
105
|
+
display: "inline-flex",
|
|
106
|
+
alignItems: "center",
|
|
107
|
+
gap: "8px",
|
|
108
|
+
transition: "opacity 0.2s ease"
|
|
109
|
+
},
|
|
110
|
+
children: [
|
|
111
|
+
a && /* @__PURE__ */ c("span", { className: "superdoc-esign-spinner superdoc-esign-spinner--light" }),
|
|
112
|
+
a ? "Submitting..." : b
|
|
113
|
+
]
|
|
114
|
+
}
|
|
115
|
+
);
|
|
116
|
+
}, ve = ue(
|
|
117
|
+
(p, m) => {
|
|
99
118
|
const {
|
|
100
|
-
eventId:
|
|
101
|
-
document:
|
|
102
|
-
fields:
|
|
103
|
-
download:
|
|
104
|
-
submit:
|
|
105
|
-
onSubmit:
|
|
106
|
-
onDownload:
|
|
119
|
+
eventId: l,
|
|
120
|
+
document: n,
|
|
121
|
+
fields: i = {},
|
|
122
|
+
download: a,
|
|
123
|
+
submit: b,
|
|
124
|
+
onSubmit: u,
|
|
125
|
+
onDownload: I,
|
|
107
126
|
onStateChange: A,
|
|
108
|
-
onFieldChange:
|
|
109
|
-
onFieldsDiscovered:
|
|
110
|
-
isDisabled:
|
|
111
|
-
className:
|
|
112
|
-
style:
|
|
113
|
-
documentHeight:
|
|
114
|
-
} =
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
}, [
|
|
118
|
-
const
|
|
119
|
-
if (!
|
|
120
|
-
const t =
|
|
121
|
-
let
|
|
122
|
-
|
|
127
|
+
onFieldChange: q,
|
|
128
|
+
onFieldsDiscovered: V,
|
|
129
|
+
isDisabled: f = !1,
|
|
130
|
+
className: X,
|
|
131
|
+
style: Y,
|
|
132
|
+
documentHeight: G = "600px"
|
|
133
|
+
} = p, [x, B] = v(!n.validation?.scroll?.required), [d, _] = v(/* @__PURE__ */ new Map()), [S, U] = v(!1), [h, $] = v(!1), [k, H] = v(!1), [z, O] = v([]), [W, J] = v(!1), E = D(null), F = D(null), Q = D(Date.now()), w = D(i), N = D([]), j = D(V);
|
|
134
|
+
w.current = i, j.current = V, R(() => {
|
|
135
|
+
N.current = z;
|
|
136
|
+
}, [z]);
|
|
137
|
+
const C = M((e) => {
|
|
138
|
+
if (!F.current?.activeEditor) return;
|
|
139
|
+
const t = F.current.activeEditor, o = w.current.signer?.find((s) => s.id === e.id);
|
|
140
|
+
let r;
|
|
141
|
+
o?.type === "signature" && e.value ? r = {
|
|
123
142
|
json: {
|
|
124
143
|
type: "image",
|
|
125
|
-
attrs: { src: typeof e.value == "string" && e.value.startsWith("data:image/") ? e.value :
|
|
144
|
+
attrs: { src: typeof e.value == "string" && e.value.startsWith("data:image/") ? e.value : Z(String(e.value)), alt: "Signature" }
|
|
126
145
|
}
|
|
127
|
-
} :
|
|
146
|
+
} : r = { text: String(e.value ?? "") }, e.id && t.commands.updateStructuredContentById(e.id, r);
|
|
128
147
|
}, []);
|
|
129
|
-
function
|
|
130
|
-
const t = globalThis.document.createElement("canvas"),
|
|
131
|
-
|
|
132
|
-
const
|
|
133
|
-
return t.width = Math.ceil(
|
|
148
|
+
function Z(e) {
|
|
149
|
+
const t = globalThis.document.createElement("canvas"), o = t.getContext("2d"), r = 30;
|
|
150
|
+
o.font = `italic ${r}px cursive`;
|
|
151
|
+
const g = o.measureText(e).width, ce = r * 1.3, le = 4, de = 6;
|
|
152
|
+
return t.width = Math.ceil(g + le * 2) + 20, t.height = Math.ceil(ce + de * 2), o.font = `italic ${r}px cursive`, o.fillStyle = "black", o.textAlign = "center", o.textBaseline = "middle", o.fillText(e, t.width / 2, t.height / 2), t.toDataURL("image/png");
|
|
134
153
|
}
|
|
135
|
-
const
|
|
154
|
+
const L = M(
|
|
136
155
|
(e) => {
|
|
137
156
|
if (!e) return;
|
|
138
157
|
const t = e.helpers.structuredContentCommands.getStructuredContentTags(
|
|
139
158
|
e.state
|
|
140
|
-
),
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
}),
|
|
144
|
-
|
|
159
|
+
), o = /* @__PURE__ */ new Map();
|
|
160
|
+
w.current.document?.forEach((s) => {
|
|
161
|
+
s.id && o.set(s.id, s.value);
|
|
162
|
+
}), w.current.signer?.forEach((s) => {
|
|
163
|
+
s.value !== void 0 && o.set(s.id, s.value);
|
|
145
164
|
});
|
|
146
|
-
const
|
|
147
|
-
id:
|
|
148
|
-
label:
|
|
149
|
-
value:
|
|
150
|
-
})).filter((
|
|
151
|
-
|
|
152
|
-
...
|
|
153
|
-
...
|
|
154
|
-
].filter((
|
|
155
|
-
(
|
|
156
|
-
id:
|
|
157
|
-
value:
|
|
165
|
+
const r = t.map(({ node: s }) => ({
|
|
166
|
+
id: s.attrs.id,
|
|
167
|
+
label: s.attrs.label,
|
|
168
|
+
value: o.get(s.attrs.id) ?? s.textContent ?? ""
|
|
169
|
+
})).filter((s) => s.id);
|
|
170
|
+
r.length > 0 && (j.current?.(r), [
|
|
171
|
+
...w.current.document || [],
|
|
172
|
+
...w.current.signer || []
|
|
173
|
+
].filter((g) => g.value !== void 0).forEach(
|
|
174
|
+
(g) => C({
|
|
175
|
+
id: g.id,
|
|
176
|
+
value: g.value
|
|
158
177
|
})
|
|
159
178
|
));
|
|
160
179
|
},
|
|
161
|
-
[
|
|
162
|
-
),
|
|
180
|
+
[C]
|
|
181
|
+
), T = (e) => {
|
|
163
182
|
const t = {
|
|
164
183
|
...e,
|
|
165
184
|
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
166
|
-
},
|
|
167
|
-
|
|
168
|
-
const
|
|
169
|
-
return
|
|
185
|
+
}, o = globalThis?.__SUPERDOC_AUDIT_MOCK__;
|
|
186
|
+
o && o(t);
|
|
187
|
+
const r = [...N.current, t];
|
|
188
|
+
return N.current = r, O(r), r;
|
|
170
189
|
};
|
|
171
|
-
|
|
172
|
-
if (!
|
|
190
|
+
R(() => {
|
|
191
|
+
if (!E.current) return;
|
|
173
192
|
let e = !1, t = null;
|
|
174
193
|
return (async () => {
|
|
175
|
-
const { SuperDoc:
|
|
176
|
-
e || (t = new
|
|
177
|
-
selector:
|
|
178
|
-
document:
|
|
194
|
+
const { SuperDoc: r } = await import("superdoc");
|
|
195
|
+
e || (t = new r({
|
|
196
|
+
selector: E.current,
|
|
197
|
+
document: n.source,
|
|
179
198
|
documentMode: "viewing",
|
|
180
199
|
modules: {
|
|
181
200
|
comments: !1
|
|
182
201
|
},
|
|
202
|
+
layoutMode: n.layoutMode,
|
|
203
|
+
layoutMargins: n.layoutMargins,
|
|
183
204
|
onReady: () => {
|
|
184
|
-
e || (t?.activeEditor &&
|
|
205
|
+
e || (t?.activeEditor && L(t.activeEditor), T({ type: "ready" }), J(!0));
|
|
185
206
|
}
|
|
186
|
-
}),
|
|
207
|
+
}), F.current = t);
|
|
187
208
|
})(), () => {
|
|
188
|
-
e = !0, t && typeof t.destroy == "function" && t.destroy(),
|
|
209
|
+
e = !0, t && typeof t.destroy == "function" && t.destroy(), F.current = null;
|
|
189
210
|
};
|
|
190
|
-
}, [
|
|
191
|
-
|
|
192
|
-
|
|
211
|
+
}, [
|
|
212
|
+
n.source,
|
|
213
|
+
n.mode,
|
|
214
|
+
n.layoutMode,
|
|
215
|
+
n.layoutMargins?.top,
|
|
216
|
+
n.layoutMargins?.bottom,
|
|
217
|
+
n.layoutMargins?.left,
|
|
218
|
+
n.layoutMargins?.right,
|
|
219
|
+
L
|
|
220
|
+
]), R(() => {
|
|
221
|
+
if (!n.validation?.scroll?.required || !W) return;
|
|
222
|
+
const e = E.current;
|
|
193
223
|
if (!e) return;
|
|
194
224
|
const t = () => {
|
|
195
|
-
const { scrollTop:
|
|
196
|
-
(
|
|
225
|
+
const { scrollTop: o, scrollHeight: r, clientHeight: s } = e, g = o / (r - s);
|
|
226
|
+
(g >= 0.95 || r <= s) && (B(!0), T({
|
|
197
227
|
type: "scroll",
|
|
198
|
-
data: { percent: Math.round(
|
|
228
|
+
data: { percent: Math.round(g * 100) }
|
|
199
229
|
}));
|
|
200
230
|
};
|
|
201
231
|
return e.addEventListener("scroll", t), t(), () => e.removeEventListener("scroll", t);
|
|
202
|
-
}, [
|
|
203
|
-
const
|
|
232
|
+
}, [n.validation?.scroll?.required, W]);
|
|
233
|
+
const ee = M(
|
|
204
234
|
(e, t) => {
|
|
205
|
-
_((
|
|
206
|
-
const
|
|
207
|
-
return
|
|
235
|
+
_((o) => {
|
|
236
|
+
const r = o.get(e), s = new Map(o);
|
|
237
|
+
return s.set(e, t), C({
|
|
208
238
|
id: e,
|
|
209
239
|
value: t
|
|
210
|
-
}),
|
|
240
|
+
}), T({
|
|
211
241
|
type: "field_change",
|
|
212
|
-
data: { fieldId: e, value: t, previousValue:
|
|
213
|
-
}),
|
|
242
|
+
data: { fieldId: e, value: t, previousValue: r }
|
|
243
|
+
}), q?.({
|
|
214
244
|
id: e,
|
|
215
245
|
value: t,
|
|
216
|
-
previousValue:
|
|
217
|
-
}),
|
|
246
|
+
previousValue: r
|
|
247
|
+
}), s;
|
|
218
248
|
});
|
|
219
249
|
},
|
|
220
|
-
[
|
|
221
|
-
),
|
|
250
|
+
[q, C]
|
|
251
|
+
), P = M(() => n.validation?.scroll?.required && !x ? !1 : (i.signer || []).every((e) => {
|
|
222
252
|
if (!e.validation?.required) return !0;
|
|
223
|
-
const t =
|
|
253
|
+
const t = d.get(e.id);
|
|
224
254
|
return t && (typeof t != "string" || t.trim());
|
|
225
|
-
}), [
|
|
226
|
-
|
|
227
|
-
const e =
|
|
255
|
+
}), [x, i.signer, d, n.validation?.scroll?.required]);
|
|
256
|
+
R(() => {
|
|
257
|
+
const e = P();
|
|
228
258
|
U(e), A?.({
|
|
229
|
-
scrolled:
|
|
230
|
-
fields:
|
|
259
|
+
scrolled: x,
|
|
260
|
+
fields: d,
|
|
231
261
|
isValid: e,
|
|
232
|
-
isSubmitting:
|
|
262
|
+
isSubmitting: h
|
|
233
263
|
});
|
|
234
|
-
}, [
|
|
235
|
-
const
|
|
236
|
-
if (
|
|
264
|
+
}, [x, d, h, P, A]);
|
|
265
|
+
const te = M(async () => {
|
|
266
|
+
if (f || k) return;
|
|
267
|
+
H(!0);
|
|
237
268
|
const e = {
|
|
238
|
-
eventId:
|
|
239
|
-
documentSource:
|
|
269
|
+
eventId: l,
|
|
270
|
+
documentSource: n.source,
|
|
240
271
|
fields: {
|
|
241
|
-
document:
|
|
242
|
-
signer: (
|
|
272
|
+
document: i.document || [],
|
|
273
|
+
signer: (i.signer || []).map((t) => ({
|
|
243
274
|
id: t.id,
|
|
244
|
-
value:
|
|
275
|
+
value: d.get(t.id) ?? null
|
|
245
276
|
}))
|
|
246
277
|
},
|
|
247
|
-
fileName:
|
|
278
|
+
fileName: a?.fileName || "document.pdf"
|
|
248
279
|
};
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
280
|
+
try {
|
|
281
|
+
await I?.(e);
|
|
282
|
+
} finally {
|
|
283
|
+
H(!1);
|
|
284
|
+
}
|
|
285
|
+
}, [
|
|
286
|
+
f,
|
|
287
|
+
k,
|
|
288
|
+
l,
|
|
289
|
+
n.source,
|
|
290
|
+
i,
|
|
291
|
+
d,
|
|
292
|
+
a,
|
|
293
|
+
I
|
|
294
|
+
]), ne = M(async () => {
|
|
295
|
+
if (!S || f || h) return;
|
|
296
|
+
$(!0), T({ type: "submit" });
|
|
297
|
+
const e = T({ type: "submit" }), t = {
|
|
298
|
+
eventId: l,
|
|
255
299
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
256
|
-
duration: Math.floor((Date.now() -
|
|
300
|
+
duration: Math.floor((Date.now() - Q.current) / 1e3),
|
|
257
301
|
auditTrail: e,
|
|
258
|
-
documentFields:
|
|
259
|
-
signerFields: (
|
|
260
|
-
id:
|
|
261
|
-
value:
|
|
302
|
+
documentFields: i.document || [],
|
|
303
|
+
signerFields: (i.signer || []).map((o) => ({
|
|
304
|
+
id: o.id,
|
|
305
|
+
value: d.get(o.id) ?? null
|
|
262
306
|
})),
|
|
263
|
-
isFullyCompleted:
|
|
307
|
+
isFullyCompleted: S
|
|
264
308
|
};
|
|
265
309
|
try {
|
|
266
|
-
await
|
|
310
|
+
await u(t);
|
|
267
311
|
} finally {
|
|
268
|
-
|
|
312
|
+
$(!1);
|
|
269
313
|
}
|
|
270
|
-
}, [
|
|
271
|
-
const t = e.component ||
|
|
272
|
-
return /* @__PURE__ */
|
|
314
|
+
}, [S, f, h, l, i, d, u]), oe = (e) => {
|
|
315
|
+
const t = e.component || se(e.type);
|
|
316
|
+
return /* @__PURE__ */ c(
|
|
273
317
|
t,
|
|
274
318
|
{
|
|
275
|
-
value:
|
|
276
|
-
onChange: (
|
|
277
|
-
isDisabled:
|
|
319
|
+
value: d.get(e.id) ?? null,
|
|
320
|
+
onChange: (o) => ee(e.id, o),
|
|
321
|
+
isDisabled: f,
|
|
278
322
|
label: e.label
|
|
279
323
|
},
|
|
280
324
|
e.id
|
|
281
325
|
);
|
|
282
|
-
},
|
|
326
|
+
}, se = (e) => {
|
|
283
327
|
switch (e) {
|
|
284
328
|
case "signature":
|
|
285
329
|
case "text":
|
|
286
|
-
return
|
|
330
|
+
return ge;
|
|
287
331
|
case "checkbox":
|
|
288
|
-
return
|
|
332
|
+
return me;
|
|
289
333
|
}
|
|
290
334
|
}, re = () => {
|
|
291
|
-
const e =
|
|
292
|
-
return e ? /* @__PURE__ */
|
|
335
|
+
const e = a?.component || fe(a);
|
|
336
|
+
return e ? /* @__PURE__ */ c(
|
|
293
337
|
e,
|
|
294
338
|
{
|
|
295
|
-
onClick:
|
|
296
|
-
fileName:
|
|
297
|
-
isDisabled:
|
|
339
|
+
onClick: te,
|
|
340
|
+
fileName: a?.fileName,
|
|
341
|
+
isDisabled: f,
|
|
342
|
+
isDownloading: k
|
|
298
343
|
}
|
|
299
344
|
) : null;
|
|
300
|
-
},
|
|
301
|
-
if (
|
|
345
|
+
}, ie = () => {
|
|
346
|
+
if (n.mode === "download")
|
|
302
347
|
return null;
|
|
303
|
-
const e =
|
|
304
|
-
return /* @__PURE__ */
|
|
348
|
+
const e = b?.component || he(b);
|
|
349
|
+
return /* @__PURE__ */ c("div", { className: "superdoc-esign-actions superdoc-esign-form-actions", children: /* @__PURE__ */ c(
|
|
305
350
|
e,
|
|
306
351
|
{
|
|
307
|
-
onClick:
|
|
308
|
-
isValid:
|
|
309
|
-
isDisabled:
|
|
310
|
-
isSubmitting:
|
|
352
|
+
onClick: ne,
|
|
353
|
+
isValid: S,
|
|
354
|
+
isDisabled: f,
|
|
355
|
+
isSubmitting: h
|
|
311
356
|
}
|
|
312
357
|
) });
|
|
313
|
-
},
|
|
314
|
-
return
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
358
|
+
}, K = re(), ae = ie();
|
|
359
|
+
return pe(
|
|
360
|
+
m,
|
|
361
|
+
() => ({
|
|
362
|
+
getState: () => ({
|
|
363
|
+
scrolled: x,
|
|
364
|
+
fields: d,
|
|
365
|
+
isValid: S,
|
|
366
|
+
isSubmitting: h
|
|
367
|
+
}),
|
|
368
|
+
getAuditTrail: () => N.current,
|
|
369
|
+
reset: () => {
|
|
370
|
+
B(!n.validation?.scroll?.required), _(/* @__PURE__ */ new Map()), U(!1), N.current = [], O([]);
|
|
371
|
+
},
|
|
372
|
+
updateFieldInDocument: C
|
|
320
373
|
}),
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
374
|
+
[
|
|
375
|
+
x,
|
|
376
|
+
d,
|
|
377
|
+
S,
|
|
378
|
+
h,
|
|
379
|
+
n.validation?.scroll?.required,
|
|
380
|
+
C
|
|
381
|
+
]
|
|
382
|
+
), /* @__PURE__ */ y("div", { className: `superdoc-esign-container ${X || ""}`, style: Y, children: [
|
|
383
|
+
/* @__PURE__ */ y("div", { className: "superdoc-esign-document", "data-testid": "superdoc-esign-document", children: [
|
|
384
|
+
K && /* @__PURE__ */ c("div", { className: "superdoc-esign-document-toolbar", children: /* @__PURE__ */ c("div", { className: "superdoc-esign-document-controls", children: K }) }),
|
|
385
|
+
/* @__PURE__ */ c(
|
|
329
386
|
"div",
|
|
330
387
|
{
|
|
331
|
-
ref:
|
|
388
|
+
ref: E,
|
|
332
389
|
className: "superdoc-esign-document-viewer",
|
|
333
390
|
"data-testid": "superdoc-scroll-container",
|
|
334
|
-
style: { height:
|
|
391
|
+
style: { height: G, overflow: "auto" }
|
|
335
392
|
}
|
|
336
393
|
)
|
|
337
394
|
] }),
|
|
338
|
-
/* @__PURE__ */
|
|
339
|
-
|
|
340
|
-
|
|
395
|
+
/* @__PURE__ */ y("div", { className: "superdoc-esign-controls", "data-testid": "superdoc-esign-controls", children: [
|
|
396
|
+
i.signer && i.signer.length > 0 && /* @__PURE__ */ c("div", { className: "superdoc-esign-fields", "data-testid": "superdoc-esign-fields", children: i.signer.map(oe) }),
|
|
397
|
+
ae
|
|
341
398
|
] })
|
|
342
399
|
] });
|
|
343
400
|
}
|
|
344
401
|
);
|
|
345
|
-
|
|
402
|
+
ve.displayName = "SuperDocESign";
|
|
346
403
|
export {
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
404
|
+
me as CheckboxInput,
|
|
405
|
+
ge as SignatureInput,
|
|
406
|
+
ve as default
|
|
350
407
|
};
|