@verbb/formie-web-components 1.0.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/CHANGELOG.md +5 -0
- package/LICENSE.md +40 -0
- package/README.md +49 -0
- package/dist/field-utils.d.ts +4 -0
- package/dist/field-utils.d.ts.map +1 -0
- package/dist/form-element.d.ts +53 -0
- package/dist/form-element.d.ts.map +1 -0
- package/dist/formie-core-form.d.ts +33 -0
- package/dist/formie-core-form.d.ts.map +1 -0
- package/dist/index.d.ts +19 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1596 -0
- package/dist/index.js.map +1 -0
- package/dist/registry.d.ts +30 -0
- package/dist/registry.d.ts.map +1 -0
- package/dist/render-view.d.ts +18 -0
- package/dist/render-view.d.ts.map +1 -0
- package/dist/signature-element.d.ts +23 -0
- package/dist/signature-element.d.ts.map +1 -0
- package/dist/signature_pad-69C-Dgt3.js +391 -0
- package/dist/signature_pad-69C-Dgt3.js.map +1 -0
- package/dist/types.d.ts +26 -0
- package/dist/types.d.ts.map +1 -0
- package/package.json +51 -0
|
@@ -0,0 +1,391 @@
|
|
|
1
|
+
//#region ../../node_modules/signature_pad/dist/signature_pad.js
|
|
2
|
+
var e = class {
|
|
3
|
+
x;
|
|
4
|
+
y;
|
|
5
|
+
pressure;
|
|
6
|
+
time;
|
|
7
|
+
constructor(e, t, n, r) {
|
|
8
|
+
if (isNaN(e) || isNaN(t)) throw Error(`Point is invalid: (${e}, ${t})`);
|
|
9
|
+
this.x = +e, this.y = +t, this.pressure = n || 0, this.time = r || Date.now();
|
|
10
|
+
}
|
|
11
|
+
distanceTo(e) {
|
|
12
|
+
return Math.sqrt((this.x - e.x) ** 2 + (this.y - e.y) ** 2);
|
|
13
|
+
}
|
|
14
|
+
equals(e) {
|
|
15
|
+
return this.x === e.x && this.y === e.y && this.pressure === e.pressure && this.time === e.time;
|
|
16
|
+
}
|
|
17
|
+
velocityFrom(e) {
|
|
18
|
+
return this.time === e.time ? 0 : this.distanceTo(e) / (this.time - e.time);
|
|
19
|
+
}
|
|
20
|
+
}, t = class t {
|
|
21
|
+
constructor(e, t, n, r, i, a) {
|
|
22
|
+
this.startPoint = e, this.control2 = t, this.control1 = n, this.endPoint = r, this.startWidth = i, this.endWidth = a;
|
|
23
|
+
}
|
|
24
|
+
static fromPoints(e, n) {
|
|
25
|
+
let r = this.calculateControlPoints(e[0], e[1], e[2]).c2, i = this.calculateControlPoints(e[1], e[2], e[3]).c1;
|
|
26
|
+
return new t(e[1], r, i, e[2], n.start, n.end);
|
|
27
|
+
}
|
|
28
|
+
static calculateControlPoints(t, n, r) {
|
|
29
|
+
let i = t.x - n.x, a = t.y - n.y, o = n.x - r.x, s = n.y - r.y, c = {
|
|
30
|
+
x: (t.x + n.x) / 2,
|
|
31
|
+
y: (t.y + n.y) / 2
|
|
32
|
+
}, l = {
|
|
33
|
+
x: (n.x + r.x) / 2,
|
|
34
|
+
y: (n.y + r.y) / 2
|
|
35
|
+
}, u = Math.sqrt(i * i + a * a), d = Math.sqrt(o * o + s * s), f = c.x - l.x, p = c.y - l.y, m = u + d == 0 ? 0 : d / (u + d), h = {
|
|
36
|
+
x: l.x + f * m,
|
|
37
|
+
y: l.y + p * m
|
|
38
|
+
}, g = n.x - h.x, _ = n.y - h.y;
|
|
39
|
+
return {
|
|
40
|
+
c1: new e(c.x + g, c.y + _),
|
|
41
|
+
c2: new e(l.x + g, l.y + _)
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
length() {
|
|
45
|
+
let e = 0, t, n;
|
|
46
|
+
for (let r = 0; r <= 10; r += 1) {
|
|
47
|
+
let i = r / 10, a = this.point(i, this.startPoint.x, this.control1.x, this.control2.x, this.endPoint.x), o = this.point(i, this.startPoint.y, this.control1.y, this.control2.y, this.endPoint.y);
|
|
48
|
+
if (r > 0) {
|
|
49
|
+
let r = a - t, i = o - n;
|
|
50
|
+
e += Math.sqrt(r * r + i * i);
|
|
51
|
+
}
|
|
52
|
+
t = a, n = o;
|
|
53
|
+
}
|
|
54
|
+
return e;
|
|
55
|
+
}
|
|
56
|
+
point(e, t, n, r, i) {
|
|
57
|
+
return t * (1 - e) * (1 - e) * (1 - e) + 3 * n * (1 - e) * (1 - e) * e + 3 * r * (1 - e) * e * e + i * e * e * e;
|
|
58
|
+
}
|
|
59
|
+
}, n = class {
|
|
60
|
+
_et;
|
|
61
|
+
constructor() {
|
|
62
|
+
try {
|
|
63
|
+
this._et = new EventTarget();
|
|
64
|
+
} catch {
|
|
65
|
+
this._et = document;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
addEventListener(e, t, n) {
|
|
69
|
+
this._et.addEventListener(e, t, n);
|
|
70
|
+
}
|
|
71
|
+
dispatchEvent(e) {
|
|
72
|
+
return this._et.dispatchEvent(e);
|
|
73
|
+
}
|
|
74
|
+
removeEventListener(e, t, n) {
|
|
75
|
+
this._et.removeEventListener(e, t, n);
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
function r(e, t = 250) {
|
|
79
|
+
let n = 0, r = null, i, a, o, s = () => {
|
|
80
|
+
n = Date.now(), r = null, i = e.apply(a, o), r || (a = null, o = []);
|
|
81
|
+
};
|
|
82
|
+
return function(...c) {
|
|
83
|
+
let l = Date.now(), u = t - (l - n);
|
|
84
|
+
return a = this, o = c, u <= 0 || u > t ? (r &&= (clearTimeout(r), null), n = l, i = e.apply(a, o), r || (a = null, o = [])) : r ||= window.setTimeout(s, u), i;
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
var i = class i extends n {
|
|
88
|
+
constructor(e, t = {}) {
|
|
89
|
+
super(), this.canvas = e, this.velocityFilterWeight = t.velocityFilterWeight || .7, this.minWidth = t.minWidth || .5, this.maxWidth = t.maxWidth || 2.5, this.throttle = t.throttle ?? 16, this.minDistance = t.minDistance ?? 5, this.dotSize = t.dotSize || 0, this.penColor = t.penColor || "black", this.backgroundColor = t.backgroundColor || "rgba(0,0,0,0)", this.compositeOperation = t.compositeOperation || "source-over", this.canvasContextOptions = t.canvasContextOptions ?? {}, this._strokeMoveUpdate = this.throttle ? r(i.prototype._strokeUpdate, this.throttle) : i.prototype._strokeUpdate, this._handleMouseDown = this._handleMouseDown.bind(this), this._handleMouseMove = this._handleMouseMove.bind(this), this._handleMouseUp = this._handleMouseUp.bind(this), this._handleTouchStart = this._handleTouchStart.bind(this), this._handleTouchMove = this._handleTouchMove.bind(this), this._handleTouchEnd = this._handleTouchEnd.bind(this), this._handlePointerDown = this._handlePointerDown.bind(this), this._handlePointerMove = this._handlePointerMove.bind(this), this._handlePointerUp = this._handlePointerUp.bind(this), this._handlePointerCancel = this._handlePointerCancel.bind(this), this._handleTouchCancel = this._handleTouchCancel.bind(this), this._ctx = e.getContext("2d", this.canvasContextOptions), this.clear(), this.on();
|
|
90
|
+
}
|
|
91
|
+
dotSize;
|
|
92
|
+
minWidth;
|
|
93
|
+
maxWidth;
|
|
94
|
+
penColor;
|
|
95
|
+
minDistance;
|
|
96
|
+
velocityFilterWeight;
|
|
97
|
+
compositeOperation;
|
|
98
|
+
backgroundColor;
|
|
99
|
+
throttle;
|
|
100
|
+
canvasContextOptions;
|
|
101
|
+
_ctx;
|
|
102
|
+
_drawingStroke = !1;
|
|
103
|
+
_isEmpty = !0;
|
|
104
|
+
_dataUrl;
|
|
105
|
+
_dataUrlOptions;
|
|
106
|
+
_lastPoints = [];
|
|
107
|
+
_data = [];
|
|
108
|
+
_lastVelocity = 0;
|
|
109
|
+
_lastWidth = 0;
|
|
110
|
+
_strokeMoveUpdate;
|
|
111
|
+
_strokePointerId;
|
|
112
|
+
clear() {
|
|
113
|
+
let { _ctx: e, canvas: t } = this;
|
|
114
|
+
e.fillStyle = this.backgroundColor, e.clearRect(0, 0, t.width, t.height), e.fillRect(0, 0, t.width, t.height), this._data = [], this._reset(this._getPointGroupOptions()), this._isEmpty = !0, this._dataUrl = void 0, this._dataUrlOptions = void 0, this._strokePointerId = void 0;
|
|
115
|
+
}
|
|
116
|
+
redraw() {
|
|
117
|
+
let e = this._data, t = this._dataUrl, n = this._dataUrlOptions;
|
|
118
|
+
this.clear(), t && this.fromDataURL(t, n), this.fromData(e, { clear: !1 });
|
|
119
|
+
}
|
|
120
|
+
fromDataURL(e, t = {}) {
|
|
121
|
+
return new Promise((n, r) => {
|
|
122
|
+
let i = new Image(), a = t.ratio || window.devicePixelRatio || 1, o = t.width || this.canvas.width / a, s = t.height || this.canvas.height / a, c = t.xOffset || 0, l = t.yOffset || 0;
|
|
123
|
+
this._reset(this._getPointGroupOptions()), i.onload = () => {
|
|
124
|
+
this._ctx.drawImage(i, c, l, o, s), n();
|
|
125
|
+
}, i.onerror = (e) => {
|
|
126
|
+
r(e);
|
|
127
|
+
}, i.crossOrigin = "anonymous", i.src = e, this._isEmpty = !1, this._dataUrl = e, this._dataUrlOptions = { ...t };
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
toDataURL(e = "image/png", t) {
|
|
131
|
+
switch (e) {
|
|
132
|
+
case "image/svg+xml": return typeof t != "object" && (t = void 0), `data:image/svg+xml;base64,${btoa(this.toSVG(t))}`;
|
|
133
|
+
default: return typeof t != "number" && (t = void 0), this.canvas.toDataURL(e, t);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
on() {
|
|
137
|
+
this.canvas.style.touchAction = "none", this.canvas.style.msTouchAction = "none", this.canvas.style.userSelect = "none", this.canvas.style.webkitUserSelect = "none";
|
|
138
|
+
let e = /Macintosh/.test(navigator.userAgent) && "ontouchstart" in document;
|
|
139
|
+
window.PointerEvent && !e ? this._handlePointerEvents() : (this._handleMouseEvents(), "ontouchstart" in window && this._handleTouchEvents());
|
|
140
|
+
}
|
|
141
|
+
off() {
|
|
142
|
+
this.canvas.style.touchAction = "auto", this.canvas.style.msTouchAction = "auto", this.canvas.style.userSelect = "auto", this.canvas.style.webkitUserSelect = "auto", this.canvas.removeEventListener("pointerdown", this._handlePointerDown), this.canvas.removeEventListener("mousedown", this._handleMouseDown), this.canvas.removeEventListener("touchstart", this._handleTouchStart), this._removeMoveUpEventListeners();
|
|
143
|
+
}
|
|
144
|
+
_getListenerFunctions() {
|
|
145
|
+
let e = window.document === this.canvas.ownerDocument ? window : this.canvas.ownerDocument.defaultView ?? this.canvas.ownerDocument;
|
|
146
|
+
return {
|
|
147
|
+
addEventListener: e.addEventListener.bind(e),
|
|
148
|
+
removeEventListener: e.removeEventListener.bind(e)
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
_removeMoveUpEventListeners() {
|
|
152
|
+
let { removeEventListener: e } = this._getListenerFunctions();
|
|
153
|
+
e("pointermove", this._handlePointerMove), e("pointerup", this._handlePointerUp), e("pointercancel", this._handlePointerCancel), e("mousemove", this._handleMouseMove), e("mouseup", this._handleMouseUp), e("touchmove", this._handleTouchMove), e("touchend", this._handleTouchEnd), e("touchcancel", this._handleTouchCancel);
|
|
154
|
+
}
|
|
155
|
+
isEmpty() {
|
|
156
|
+
return this._isEmpty;
|
|
157
|
+
}
|
|
158
|
+
fromData(e, { clear: t = !0 } = {}) {
|
|
159
|
+
t && this.clear(), this._fromData(e, this._drawCurve.bind(this), this._drawDot.bind(this)), this._data = this._data.concat(e);
|
|
160
|
+
}
|
|
161
|
+
toData() {
|
|
162
|
+
return this._data;
|
|
163
|
+
}
|
|
164
|
+
_isLeftButtonPressed(e, t) {
|
|
165
|
+
return t ? e.buttons === 1 : (e.buttons & 1) == 1;
|
|
166
|
+
}
|
|
167
|
+
_pointerEventToSignatureEvent(e) {
|
|
168
|
+
return {
|
|
169
|
+
event: e,
|
|
170
|
+
type: e.type,
|
|
171
|
+
x: e.clientX,
|
|
172
|
+
y: e.clientY,
|
|
173
|
+
pressure: "pressure" in e ? e.pressure : 0
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
_touchEventToSignatureEvent(e) {
|
|
177
|
+
let t = e.changedTouches[0];
|
|
178
|
+
return {
|
|
179
|
+
event: e,
|
|
180
|
+
type: e.type,
|
|
181
|
+
x: t.clientX,
|
|
182
|
+
y: t.clientY,
|
|
183
|
+
pressure: t.force
|
|
184
|
+
};
|
|
185
|
+
}
|
|
186
|
+
_handleMouseDown(e) {
|
|
187
|
+
!this._isLeftButtonPressed(e, !0) || this._drawingStroke || this._strokeBegin(this._pointerEventToSignatureEvent(e));
|
|
188
|
+
}
|
|
189
|
+
_handleMouseMove(e) {
|
|
190
|
+
if (!this._isLeftButtonPressed(e, !0) || !this._drawingStroke) {
|
|
191
|
+
this._strokeEnd(this._pointerEventToSignatureEvent(e), !1);
|
|
192
|
+
return;
|
|
193
|
+
}
|
|
194
|
+
this._strokeMoveUpdate(this._pointerEventToSignatureEvent(e));
|
|
195
|
+
}
|
|
196
|
+
_handleMouseUp(e) {
|
|
197
|
+
this._isLeftButtonPressed(e) || this._strokeEnd(this._pointerEventToSignatureEvent(e));
|
|
198
|
+
}
|
|
199
|
+
_handleTouchStart(e) {
|
|
200
|
+
e.targetTouches.length !== 1 || this._drawingStroke || (e.cancelable && e.preventDefault(), this._strokeBegin(this._touchEventToSignatureEvent(e)));
|
|
201
|
+
}
|
|
202
|
+
_handleTouchMove(e) {
|
|
203
|
+
if (e.targetTouches.length === 1) {
|
|
204
|
+
if (e.cancelable && e.preventDefault(), !this._drawingStroke) {
|
|
205
|
+
this._strokeEnd(this._touchEventToSignatureEvent(e), !1);
|
|
206
|
+
return;
|
|
207
|
+
}
|
|
208
|
+
this._strokeMoveUpdate(this._touchEventToSignatureEvent(e));
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
_handleTouchEnd(e) {
|
|
212
|
+
e.targetTouches.length === 0 && (e.cancelable && e.preventDefault(), this._strokeEnd(this._touchEventToSignatureEvent(e)));
|
|
213
|
+
}
|
|
214
|
+
_handlePointerCancel(e) {
|
|
215
|
+
this._allowPointerId(e) && (e.preventDefault(), this._strokeEnd(this._pointerEventToSignatureEvent(e), !1));
|
|
216
|
+
}
|
|
217
|
+
_handleTouchCancel(e) {
|
|
218
|
+
e.cancelable && e.preventDefault(), this._strokeEnd(this._touchEventToSignatureEvent(e), !1);
|
|
219
|
+
}
|
|
220
|
+
_getPointerId(e) {
|
|
221
|
+
return e.persistentDeviceId || e.pointerId;
|
|
222
|
+
}
|
|
223
|
+
_allowPointerId(e, t = !1) {
|
|
224
|
+
return this._strokePointerId === void 0 ? t : this._getPointerId(e) === this._strokePointerId;
|
|
225
|
+
}
|
|
226
|
+
_handlePointerDown(e) {
|
|
227
|
+
this._drawingStroke || !this._isLeftButtonPressed(e) || !this._allowPointerId(e, !0) || (this._strokePointerId = this._getPointerId(e), e.preventDefault(), this._strokeBegin(this._pointerEventToSignatureEvent(e)));
|
|
228
|
+
}
|
|
229
|
+
_handlePointerMove(e) {
|
|
230
|
+
if (this._allowPointerId(e)) {
|
|
231
|
+
if (!this._isLeftButtonPressed(e, !0) || !this._drawingStroke) {
|
|
232
|
+
this._strokeEnd(this._pointerEventToSignatureEvent(e), !1);
|
|
233
|
+
return;
|
|
234
|
+
}
|
|
235
|
+
e.preventDefault(), this._strokeMoveUpdate(this._pointerEventToSignatureEvent(e));
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
_handlePointerUp(e) {
|
|
239
|
+
this._isLeftButtonPressed(e) || !this._allowPointerId(e) || (e.preventDefault(), this._strokeEnd(this._pointerEventToSignatureEvent(e)));
|
|
240
|
+
}
|
|
241
|
+
_getPointGroupOptions(e) {
|
|
242
|
+
return {
|
|
243
|
+
penColor: e && "penColor" in e ? e.penColor : this.penColor,
|
|
244
|
+
dotSize: e && "dotSize" in e ? e.dotSize : this.dotSize,
|
|
245
|
+
minWidth: e && "minWidth" in e ? e.minWidth : this.minWidth,
|
|
246
|
+
maxWidth: e && "maxWidth" in e ? e.maxWidth : this.maxWidth,
|
|
247
|
+
velocityFilterWeight: e && "velocityFilterWeight" in e ? e.velocityFilterWeight : this.velocityFilterWeight,
|
|
248
|
+
compositeOperation: e && "compositeOperation" in e ? e.compositeOperation : this.compositeOperation
|
|
249
|
+
};
|
|
250
|
+
}
|
|
251
|
+
_strokeBegin(e) {
|
|
252
|
+
if (!this.dispatchEvent(new CustomEvent("beginStroke", {
|
|
253
|
+
detail: e,
|
|
254
|
+
cancelable: !0
|
|
255
|
+
}))) return;
|
|
256
|
+
let { addEventListener: t } = this._getListenerFunctions();
|
|
257
|
+
switch (e.event.type) {
|
|
258
|
+
case "mousedown":
|
|
259
|
+
t("mousemove", this._handleMouseMove, { passive: !1 }), t("mouseup", this._handleMouseUp, { passive: !1 });
|
|
260
|
+
break;
|
|
261
|
+
case "touchstart":
|
|
262
|
+
t("touchmove", this._handleTouchMove, { passive: !1 }), t("touchend", this._handleTouchEnd, { passive: !1 }), t("touchcancel", this._handleTouchCancel, { passive: !1 });
|
|
263
|
+
break;
|
|
264
|
+
case "pointerdown":
|
|
265
|
+
t("pointermove", this._handlePointerMove, { passive: !1 }), t("pointerup", this._handlePointerUp, { passive: !1 }), t("pointercancel", this._handlePointerCancel, { passive: !1 });
|
|
266
|
+
break;
|
|
267
|
+
default:
|
|
268
|
+
}
|
|
269
|
+
this._drawingStroke = !0;
|
|
270
|
+
let n = this._getPointGroupOptions(), r = {
|
|
271
|
+
...n,
|
|
272
|
+
points: []
|
|
273
|
+
};
|
|
274
|
+
this._data.push(r), this._reset(n), this._strokeUpdate(e);
|
|
275
|
+
}
|
|
276
|
+
_strokeUpdate(e) {
|
|
277
|
+
if (!this._drawingStroke) return;
|
|
278
|
+
if (this._data.length === 0) {
|
|
279
|
+
this._strokeBegin(e);
|
|
280
|
+
return;
|
|
281
|
+
}
|
|
282
|
+
this.dispatchEvent(new CustomEvent("beforeUpdateStroke", { detail: e }));
|
|
283
|
+
let t = this._createPoint(e.x, e.y, e.pressure), n = this._data[this._data.length - 1], r = n.points, i = r.length > 0 && r[r.length - 1], a = i ? t.distanceTo(i) <= this.minDistance : !1, o = this._getPointGroupOptions(n);
|
|
284
|
+
if (!i || !(i && a)) {
|
|
285
|
+
let e = this._addPoint(t, o);
|
|
286
|
+
i ? e && this._drawCurve(e, o) : this._drawDot(t, o), r.push({
|
|
287
|
+
time: t.time,
|
|
288
|
+
x: t.x,
|
|
289
|
+
y: t.y,
|
|
290
|
+
pressure: t.pressure
|
|
291
|
+
});
|
|
292
|
+
}
|
|
293
|
+
this.dispatchEvent(new CustomEvent("afterUpdateStroke", { detail: e }));
|
|
294
|
+
}
|
|
295
|
+
_strokeEnd(e, t = !0) {
|
|
296
|
+
this._removeMoveUpEventListeners(), this._drawingStroke && (t && this._strokeUpdate(e), this._drawingStroke = !1, this._strokePointerId = void 0, this.dispatchEvent(new CustomEvent("endStroke", { detail: e })));
|
|
297
|
+
}
|
|
298
|
+
_handlePointerEvents() {
|
|
299
|
+
this._drawingStroke = !1, this.canvas.addEventListener("pointerdown", this._handlePointerDown, { passive: !1 });
|
|
300
|
+
}
|
|
301
|
+
_handleMouseEvents() {
|
|
302
|
+
this._drawingStroke = !1, this.canvas.addEventListener("mousedown", this._handleMouseDown, { passive: !1 });
|
|
303
|
+
}
|
|
304
|
+
_handleTouchEvents() {
|
|
305
|
+
this.canvas.addEventListener("touchstart", this._handleTouchStart, { passive: !1 });
|
|
306
|
+
}
|
|
307
|
+
_reset(e) {
|
|
308
|
+
this._lastPoints = [], this._lastVelocity = 0, this._lastWidth = (e.minWidth + e.maxWidth) / 2, this._ctx.fillStyle = e.penColor, this._ctx.globalCompositeOperation = e.compositeOperation;
|
|
309
|
+
}
|
|
310
|
+
_createPoint(t, n, r) {
|
|
311
|
+
let i = this.canvas.getBoundingClientRect();
|
|
312
|
+
return new e(t - i.left, n - i.top, r, (/* @__PURE__ */ new Date()).getTime());
|
|
313
|
+
}
|
|
314
|
+
_addPoint(e, n) {
|
|
315
|
+
let { _lastPoints: r } = this;
|
|
316
|
+
if (r.push(e), r.length > 2) {
|
|
317
|
+
r.length === 3 && r.unshift(r[0]);
|
|
318
|
+
let e = this._calculateCurveWidths(r[1], r[2], n), i = t.fromPoints(r, e);
|
|
319
|
+
return r.shift(), i;
|
|
320
|
+
}
|
|
321
|
+
return null;
|
|
322
|
+
}
|
|
323
|
+
_calculateCurveWidths(e, t, n) {
|
|
324
|
+
let r = n.velocityFilterWeight * t.velocityFrom(e) + (1 - n.velocityFilterWeight) * this._lastVelocity, i = this._strokeWidth(r, n), a = {
|
|
325
|
+
end: i,
|
|
326
|
+
start: this._lastWidth
|
|
327
|
+
};
|
|
328
|
+
return this._lastVelocity = r, this._lastWidth = i, a;
|
|
329
|
+
}
|
|
330
|
+
_strokeWidth(e, t) {
|
|
331
|
+
return Math.max(t.maxWidth / (e + 1), t.minWidth);
|
|
332
|
+
}
|
|
333
|
+
_drawCurveSegment(e, t, n) {
|
|
334
|
+
let r = this._ctx;
|
|
335
|
+
r.moveTo(e, t), r.arc(e, t, n, 0, 2 * Math.PI, !1), this._isEmpty = !1;
|
|
336
|
+
}
|
|
337
|
+
_drawCurve(e, t) {
|
|
338
|
+
let n = this._ctx, r = e.endWidth - e.startWidth, i = Math.ceil(e.length()) * 2;
|
|
339
|
+
n.beginPath(), n.fillStyle = t.penColor;
|
|
340
|
+
for (let n = 0; n < i; n += 1) {
|
|
341
|
+
let a = n / i, o = a * a, s = o * a, c = 1 - a, l = c * c, u = l * c, d = u * e.startPoint.x;
|
|
342
|
+
d += 3 * l * a * e.control1.x, d += 3 * c * o * e.control2.x, d += s * e.endPoint.x;
|
|
343
|
+
let f = u * e.startPoint.y;
|
|
344
|
+
f += 3 * l * a * e.control1.y, f += 3 * c * o * e.control2.y, f += s * e.endPoint.y;
|
|
345
|
+
let p = Math.min(e.startWidth + s * r, t.maxWidth);
|
|
346
|
+
this._drawCurveSegment(d, f, p);
|
|
347
|
+
}
|
|
348
|
+
n.closePath(), n.fill();
|
|
349
|
+
}
|
|
350
|
+
_drawDot(e, t) {
|
|
351
|
+
let n = this._ctx, r = t.dotSize > 0 ? t.dotSize : (t.minWidth + t.maxWidth) / 2;
|
|
352
|
+
n.beginPath(), this._drawCurveSegment(e.x, e.y, r), n.closePath(), n.fillStyle = t.penColor, n.fill();
|
|
353
|
+
}
|
|
354
|
+
_fromData(t, n, r) {
|
|
355
|
+
for (let i of t) {
|
|
356
|
+
let { points: t } = i, a = this._getPointGroupOptions(i);
|
|
357
|
+
if (t.length > 1) for (let r = 0; r < t.length; r += 1) {
|
|
358
|
+
let i = t[r], o = new e(i.x, i.y, i.pressure, i.time);
|
|
359
|
+
r === 0 && this._reset(a);
|
|
360
|
+
let s = this._addPoint(o, a);
|
|
361
|
+
s && n(s, a);
|
|
362
|
+
}
|
|
363
|
+
else this._reset(a), r(t[0], a);
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
toSVG({ includeBackgroundColor: e = !1, includeDataUrl: t = !1 } = {}) {
|
|
367
|
+
let n = this._data, r = Math.max(window.devicePixelRatio || 1, 1), i = this.canvas.width / r, a = this.canvas.height / r, o = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
368
|
+
if (o.setAttribute("xmlns", "http://www.w3.org/2000/svg"), o.setAttribute("xmlns:xlink", "http://www.w3.org/1999/xlink"), o.setAttribute("viewBox", `0 0 ${i} ${a}`), o.setAttribute("width", i.toString()), o.setAttribute("height", a.toString()), e && this.backgroundColor) {
|
|
369
|
+
let e = document.createElement("rect");
|
|
370
|
+
e.setAttribute("width", "100%"), e.setAttribute("height", "100%"), e.setAttribute("fill", this.backgroundColor), o.appendChild(e);
|
|
371
|
+
}
|
|
372
|
+
if (t && this._dataUrl) {
|
|
373
|
+
let e = this._dataUrlOptions?.ratio || window.devicePixelRatio || 1, t = this._dataUrlOptions?.width || this.canvas.width / e, n = this._dataUrlOptions?.height || this.canvas.height / e, r = this._dataUrlOptions?.xOffset || 0, i = this._dataUrlOptions?.yOffset || 0, a = document.createElement("image");
|
|
374
|
+
a.setAttribute("x", r.toString()), a.setAttribute("y", i.toString()), a.setAttribute("width", t.toString()), a.setAttribute("height", n.toString()), a.setAttribute("preserveAspectRatio", "none"), a.setAttribute("href", this._dataUrl), o.appendChild(a);
|
|
375
|
+
}
|
|
376
|
+
return this._fromData(n, (e, { penColor: t }) => {
|
|
377
|
+
let n = document.createElement("path");
|
|
378
|
+
if (!isNaN(e.control1.x) && !isNaN(e.control1.y) && !isNaN(e.control2.x) && !isNaN(e.control2.y)) {
|
|
379
|
+
let r = `M ${e.startPoint.x.toFixed(3)},${e.startPoint.y.toFixed(3)} C ${e.control1.x.toFixed(3)},${e.control1.y.toFixed(3)} ${e.control2.x.toFixed(3)},${e.control2.y.toFixed(3)} ${e.endPoint.x.toFixed(3)},${e.endPoint.y.toFixed(3)}`;
|
|
380
|
+
n.setAttribute("d", r), n.setAttribute("stroke-width", (e.endWidth * 2.25).toFixed(3)), n.setAttribute("stroke", t), n.setAttribute("fill", "none"), n.setAttribute("stroke-linecap", "round"), o.appendChild(n);
|
|
381
|
+
}
|
|
382
|
+
}, (e, { penColor: t, dotSize: n, minWidth: r, maxWidth: i }) => {
|
|
383
|
+
let a = document.createElement("circle"), s = n > 0 ? n : (r + i) / 2;
|
|
384
|
+
a.setAttribute("r", s.toString()), a.setAttribute("cx", e.x.toString()), a.setAttribute("cy", e.y.toString()), a.setAttribute("fill", t), o.appendChild(a);
|
|
385
|
+
}), o.outerHTML;
|
|
386
|
+
}
|
|
387
|
+
};
|
|
388
|
+
//#endregion
|
|
389
|
+
export { i as default };
|
|
390
|
+
|
|
391
|
+
//# sourceMappingURL=signature_pad-69C-Dgt3.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"signature_pad-69C-Dgt3.js","names":[],"sources":["../../../node_modules/signature_pad/dist/signature_pad.js"],"sourcesContent":["/*!\n * Signature Pad v5.1.3 | https://github.com/szimek/signature_pad\n * (c) 2025 Szymon Nowak | Released under the MIT license\n */\n\n\n// src/point.ts\nvar Point = class {\n x;\n y;\n pressure;\n time;\n constructor(x, y, pressure, time) {\n if (isNaN(x) || isNaN(y)) {\n throw new Error(`Point is invalid: (${x}, ${y})`);\n }\n this.x = +x;\n this.y = +y;\n this.pressure = pressure || 0;\n this.time = time || Date.now();\n }\n distanceTo(start) {\n return Math.sqrt(\n Math.pow(this.x - start.x, 2) + Math.pow(this.y - start.y, 2)\n );\n }\n equals(other) {\n return this.x === other.x && this.y === other.y && this.pressure === other.pressure && this.time === other.time;\n }\n velocityFrom(start) {\n return this.time !== start.time ? this.distanceTo(start) / (this.time - start.time) : 0;\n }\n};\n\n// src/bezier.ts\nvar Bezier = class _Bezier {\n constructor(startPoint, control2, control1, endPoint, startWidth, endWidth) {\n this.startPoint = startPoint;\n this.control2 = control2;\n this.control1 = control1;\n this.endPoint = endPoint;\n this.startWidth = startWidth;\n this.endWidth = endWidth;\n }\n static fromPoints(points, widths) {\n const c2 = this.calculateControlPoints(points[0], points[1], points[2]).c2;\n const c3 = this.calculateControlPoints(points[1], points[2], points[3]).c1;\n return new _Bezier(points[1], c2, c3, points[2], widths.start, widths.end);\n }\n static calculateControlPoints(s1, s2, s3) {\n const dx1 = s1.x - s2.x;\n const dy1 = s1.y - s2.y;\n const dx2 = s2.x - s3.x;\n const dy2 = s2.y - s3.y;\n const m1 = { x: (s1.x + s2.x) / 2, y: (s1.y + s2.y) / 2 };\n const m2 = { x: (s2.x + s3.x) / 2, y: (s2.y + s3.y) / 2 };\n const l1 = Math.sqrt(dx1 * dx1 + dy1 * dy1);\n const l2 = Math.sqrt(dx2 * dx2 + dy2 * dy2);\n const dxm = m1.x - m2.x;\n const dym = m1.y - m2.y;\n const k = l1 + l2 == 0 ? 0 : l2 / (l1 + l2);\n const cm = { x: m2.x + dxm * k, y: m2.y + dym * k };\n const tx = s2.x - cm.x;\n const ty = s2.y - cm.y;\n return {\n c1: new Point(m1.x + tx, m1.y + ty),\n c2: new Point(m2.x + tx, m2.y + ty)\n };\n }\n // Returns approximated length. Code taken from https://www.lemoda.net/maths/bezier-length/index.html.\n length() {\n const steps = 10;\n let length = 0;\n let px;\n let py;\n for (let i = 0; i <= steps; i += 1) {\n const t = i / steps;\n const cx = this.point(\n t,\n this.startPoint.x,\n this.control1.x,\n this.control2.x,\n this.endPoint.x\n );\n const cy = this.point(\n t,\n this.startPoint.y,\n this.control1.y,\n this.control2.y,\n this.endPoint.y\n );\n if (i > 0) {\n const xdiff = cx - px;\n const ydiff = cy - py;\n length += Math.sqrt(xdiff * xdiff + ydiff * ydiff);\n }\n px = cx;\n py = cy;\n }\n return length;\n }\n // Calculate parametric value of x or y given t and the four point coordinates of a cubic bezier curve.\n point(t, start, c1, c2, end) {\n return start * (1 - t) * (1 - t) * (1 - t) + 3 * c1 * (1 - t) * (1 - t) * t + 3 * c2 * (1 - t) * t * t + end * t * t * t;\n }\n};\n\n// src/signature_event_target.ts\nvar SignatureEventTarget = class {\n /* tslint:disable: variable-name */\n _et;\n /* tslint:enable: variable-name */\n constructor() {\n try {\n this._et = new EventTarget();\n } catch {\n this._et = document;\n }\n }\n addEventListener(type, listener, options) {\n this._et.addEventListener(type, listener, options);\n }\n dispatchEvent(event) {\n return this._et.dispatchEvent(event);\n }\n removeEventListener(type, callback, options) {\n this._et.removeEventListener(type, callback, options);\n }\n};\n\n// src/throttle.ts\nfunction throttle(fn, wait = 250) {\n let previous = 0;\n let timeout = null;\n let result;\n let storedContext;\n let storedArgs;\n const later = () => {\n previous = Date.now();\n timeout = null;\n result = fn.apply(storedContext, storedArgs);\n if (!timeout) {\n storedContext = null;\n storedArgs = [];\n }\n };\n return function wrapper(...args) {\n const now = Date.now();\n const remaining = wait - (now - previous);\n storedContext = this;\n storedArgs = args;\n if (remaining <= 0 || remaining > wait) {\n if (timeout) {\n clearTimeout(timeout);\n timeout = null;\n }\n previous = now;\n result = fn.apply(storedContext, storedArgs);\n if (!timeout) {\n storedContext = null;\n storedArgs = [];\n }\n } else if (!timeout) {\n timeout = window.setTimeout(later, remaining);\n }\n return result;\n };\n}\n\n// src/signature_pad.ts\nvar SignaturePad = class _SignaturePad extends SignatureEventTarget {\n /* tslint:enable: variable-name */\n constructor(canvas, options = {}) {\n super();\n this.canvas = canvas;\n this.velocityFilterWeight = options.velocityFilterWeight || 0.7;\n this.minWidth = options.minWidth || 0.5;\n this.maxWidth = options.maxWidth || 2.5;\n this.throttle = options.throttle ?? 16;\n this.minDistance = options.minDistance ?? 5;\n this.dotSize = options.dotSize || 0;\n this.penColor = options.penColor || \"black\";\n this.backgroundColor = options.backgroundColor || \"rgba(0,0,0,0)\";\n this.compositeOperation = options.compositeOperation || \"source-over\";\n this.canvasContextOptions = options.canvasContextOptions ?? {};\n this._strokeMoveUpdate = this.throttle ? throttle(_SignaturePad.prototype._strokeUpdate, this.throttle) : _SignaturePad.prototype._strokeUpdate;\n this._handleMouseDown = this._handleMouseDown.bind(this);\n this._handleMouseMove = this._handleMouseMove.bind(this);\n this._handleMouseUp = this._handleMouseUp.bind(this);\n this._handleTouchStart = this._handleTouchStart.bind(this);\n this._handleTouchMove = this._handleTouchMove.bind(this);\n this._handleTouchEnd = this._handleTouchEnd.bind(this);\n this._handlePointerDown = this._handlePointerDown.bind(this);\n this._handlePointerMove = this._handlePointerMove.bind(this);\n this._handlePointerUp = this._handlePointerUp.bind(this);\n this._handlePointerCancel = this._handlePointerCancel.bind(this);\n this._handleTouchCancel = this._handleTouchCancel.bind(this);\n this._ctx = canvas.getContext(\n \"2d\",\n this.canvasContextOptions\n );\n this.clear();\n this.on();\n }\n // Public stuff\n dotSize;\n minWidth;\n maxWidth;\n penColor;\n minDistance;\n velocityFilterWeight;\n compositeOperation;\n backgroundColor;\n throttle;\n canvasContextOptions;\n // Private stuff\n /* tslint:disable: variable-name */\n _ctx;\n _drawingStroke = false;\n _isEmpty = true;\n _dataUrl;\n _dataUrlOptions;\n _lastPoints = [];\n // Stores up to 4 most recent points; used to generate a new curve\n _data = [];\n // Stores all points in groups (one group per line or dot)\n _lastVelocity = 0;\n _lastWidth = 0;\n _strokeMoveUpdate;\n _strokePointerId;\n clear() {\n const { _ctx: ctx, canvas } = this;\n ctx.fillStyle = this.backgroundColor;\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n ctx.fillRect(0, 0, canvas.width, canvas.height);\n this._data = [];\n this._reset(this._getPointGroupOptions());\n this._isEmpty = true;\n this._dataUrl = void 0;\n this._dataUrlOptions = void 0;\n this._strokePointerId = void 0;\n }\n redraw() {\n const data = this._data;\n const dataUrl = this._dataUrl;\n const dataUrlOptions = this._dataUrlOptions;\n this.clear();\n if (dataUrl) {\n this.fromDataURL(dataUrl, dataUrlOptions);\n }\n this.fromData(data, { clear: false });\n }\n fromDataURL(dataUrl, options = {}) {\n return new Promise((resolve, reject) => {\n const image = new Image();\n const ratio = options.ratio || window.devicePixelRatio || 1;\n const width = options.width || this.canvas.width / ratio;\n const height = options.height || this.canvas.height / ratio;\n const xOffset = options.xOffset || 0;\n const yOffset = options.yOffset || 0;\n this._reset(this._getPointGroupOptions());\n image.onload = () => {\n this._ctx.drawImage(image, xOffset, yOffset, width, height);\n resolve();\n };\n image.onerror = (error) => {\n reject(error);\n };\n image.crossOrigin = \"anonymous\";\n image.src = dataUrl;\n this._isEmpty = false;\n this._dataUrl = dataUrl;\n this._dataUrlOptions = { ...options };\n });\n }\n toDataURL(type = \"image/png\", encoderOptions) {\n switch (type) {\n case \"image/svg+xml\":\n if (typeof encoderOptions !== \"object\") {\n encoderOptions = void 0;\n }\n return `data:image/svg+xml;base64,${btoa(\n this.toSVG(encoderOptions)\n )}`;\n default:\n if (typeof encoderOptions !== \"number\") {\n encoderOptions = void 0;\n }\n return this.canvas.toDataURL(type, encoderOptions);\n }\n }\n on() {\n this.canvas.style.touchAction = \"none\";\n this.canvas.style.msTouchAction = \"none\";\n this.canvas.style.userSelect = \"none\";\n this.canvas.style.webkitUserSelect = \"none\";\n const isIOS = /Macintosh/.test(navigator.userAgent) && \"ontouchstart\" in document;\n if (window.PointerEvent && !isIOS) {\n this._handlePointerEvents();\n } else {\n this._handleMouseEvents();\n if (\"ontouchstart\" in window) {\n this._handleTouchEvents();\n }\n }\n }\n off() {\n this.canvas.style.touchAction = \"auto\";\n this.canvas.style.msTouchAction = \"auto\";\n this.canvas.style.userSelect = \"auto\";\n this.canvas.style.webkitUserSelect = \"auto\";\n this.canvas.removeEventListener(\"pointerdown\", this._handlePointerDown);\n this.canvas.removeEventListener(\"mousedown\", this._handleMouseDown);\n this.canvas.removeEventListener(\"touchstart\", this._handleTouchStart);\n this._removeMoveUpEventListeners();\n }\n _getListenerFunctions() {\n const canvasWindow = window.document === this.canvas.ownerDocument ? window : this.canvas.ownerDocument.defaultView ?? this.canvas.ownerDocument;\n return {\n addEventListener: canvasWindow.addEventListener.bind(\n canvasWindow\n ),\n removeEventListener: canvasWindow.removeEventListener.bind(\n canvasWindow\n )\n };\n }\n _removeMoveUpEventListeners() {\n const { removeEventListener } = this._getListenerFunctions();\n removeEventListener(\"pointermove\", this._handlePointerMove);\n removeEventListener(\"pointerup\", this._handlePointerUp);\n removeEventListener(\"pointercancel\", this._handlePointerCancel);\n removeEventListener(\"mousemove\", this._handleMouseMove);\n removeEventListener(\"mouseup\", this._handleMouseUp);\n removeEventListener(\"touchmove\", this._handleTouchMove);\n removeEventListener(\"touchend\", this._handleTouchEnd);\n removeEventListener(\"touchcancel\", this._handleTouchCancel);\n }\n isEmpty() {\n return this._isEmpty;\n }\n fromData(pointGroups, { clear = true } = {}) {\n if (clear) {\n this.clear();\n }\n this._fromData(\n pointGroups,\n this._drawCurve.bind(this),\n this._drawDot.bind(this)\n );\n this._data = this._data.concat(pointGroups);\n }\n toData() {\n return this._data;\n }\n _isLeftButtonPressed(event, only) {\n if (only) {\n return event.buttons === 1;\n }\n return (event.buttons & 1) === 1;\n }\n _pointerEventToSignatureEvent(event) {\n return {\n event,\n type: event.type,\n x: event.clientX,\n y: event.clientY,\n pressure: \"pressure\" in event ? event.pressure : 0\n };\n }\n _touchEventToSignatureEvent(event) {\n const touch = event.changedTouches[0];\n return {\n event,\n type: event.type,\n x: touch.clientX,\n y: touch.clientY,\n pressure: touch.force\n };\n }\n // Event handlers\n _handleMouseDown(event) {\n if (!this._isLeftButtonPressed(event, true) || this._drawingStroke) {\n return;\n }\n this._strokeBegin(this._pointerEventToSignatureEvent(event));\n }\n _handleMouseMove(event) {\n if (!this._isLeftButtonPressed(event, true) || !this._drawingStroke) {\n this._strokeEnd(this._pointerEventToSignatureEvent(event), false);\n return;\n }\n this._strokeMoveUpdate(this._pointerEventToSignatureEvent(event));\n }\n _handleMouseUp(event) {\n if (this._isLeftButtonPressed(event)) {\n return;\n }\n this._strokeEnd(this._pointerEventToSignatureEvent(event));\n }\n _handleTouchStart(event) {\n if (event.targetTouches.length !== 1 || this._drawingStroke) {\n return;\n }\n if (event.cancelable) {\n event.preventDefault();\n }\n this._strokeBegin(this._touchEventToSignatureEvent(event));\n }\n _handleTouchMove(event) {\n if (event.targetTouches.length !== 1) {\n return;\n }\n if (event.cancelable) {\n event.preventDefault();\n }\n if (!this._drawingStroke) {\n this._strokeEnd(this._touchEventToSignatureEvent(event), false);\n return;\n }\n this._strokeMoveUpdate(this._touchEventToSignatureEvent(event));\n }\n _handleTouchEnd(event) {\n if (event.targetTouches.length !== 0) {\n return;\n }\n if (event.cancelable) {\n event.preventDefault();\n }\n this._strokeEnd(this._touchEventToSignatureEvent(event));\n }\n _handlePointerCancel(event) {\n if (!this._allowPointerId(event)) {\n return;\n }\n event.preventDefault();\n this._strokeEnd(this._pointerEventToSignatureEvent(event), false);\n }\n _handleTouchCancel(event) {\n if (event.cancelable) {\n event.preventDefault();\n }\n this._strokeEnd(this._touchEventToSignatureEvent(event), false);\n }\n _getPointerId(event) {\n return event.persistentDeviceId || event.pointerId;\n }\n _allowPointerId(event, allowUndefined = false) {\n if (typeof this._strokePointerId === \"undefined\") {\n return allowUndefined;\n }\n return this._getPointerId(event) === this._strokePointerId;\n }\n _handlePointerDown(event) {\n if (this._drawingStroke || !this._isLeftButtonPressed(event) || !this._allowPointerId(event, true)) {\n return;\n }\n this._strokePointerId = this._getPointerId(event);\n event.preventDefault();\n this._strokeBegin(this._pointerEventToSignatureEvent(event));\n }\n _handlePointerMove(event) {\n if (!this._allowPointerId(event)) {\n return;\n }\n if (!this._isLeftButtonPressed(event, true) || !this._drawingStroke) {\n this._strokeEnd(this._pointerEventToSignatureEvent(event), false);\n return;\n }\n event.preventDefault();\n this._strokeMoveUpdate(this._pointerEventToSignatureEvent(event));\n }\n _handlePointerUp(event) {\n if (this._isLeftButtonPressed(event) || !this._allowPointerId(event)) {\n return;\n }\n event.preventDefault();\n this._strokeEnd(this._pointerEventToSignatureEvent(event));\n }\n _getPointGroupOptions(group) {\n return {\n penColor: group && \"penColor\" in group ? group.penColor : this.penColor,\n dotSize: group && \"dotSize\" in group ? group.dotSize : this.dotSize,\n minWidth: group && \"minWidth\" in group ? group.minWidth : this.minWidth,\n maxWidth: group && \"maxWidth\" in group ? group.maxWidth : this.maxWidth,\n velocityFilterWeight: group && \"velocityFilterWeight\" in group ? group.velocityFilterWeight : this.velocityFilterWeight,\n compositeOperation: group && \"compositeOperation\" in group ? group.compositeOperation : this.compositeOperation\n };\n }\n // Private methods\n _strokeBegin(event) {\n const cancelled = !this.dispatchEvent(\n new CustomEvent(\"beginStroke\", { detail: event, cancelable: true })\n );\n if (cancelled) {\n return;\n }\n const { addEventListener } = this._getListenerFunctions();\n switch (event.event.type) {\n case \"mousedown\":\n addEventListener(\"mousemove\", this._handleMouseMove, {\n passive: false\n });\n addEventListener(\"mouseup\", this._handleMouseUp, { passive: false });\n break;\n case \"touchstart\":\n addEventListener(\"touchmove\", this._handleTouchMove, {\n passive: false\n });\n addEventListener(\"touchend\", this._handleTouchEnd, { passive: false });\n addEventListener(\"touchcancel\", this._handleTouchCancel, { passive: false });\n break;\n case \"pointerdown\":\n addEventListener(\"pointermove\", this._handlePointerMove, {\n passive: false\n });\n addEventListener(\"pointerup\", this._handlePointerUp, {\n passive: false\n });\n addEventListener(\"pointercancel\", this._handlePointerCancel, {\n passive: false\n });\n break;\n default:\n }\n this._drawingStroke = true;\n const pointGroupOptions = this._getPointGroupOptions();\n const newPointGroup = {\n ...pointGroupOptions,\n points: []\n };\n this._data.push(newPointGroup);\n this._reset(pointGroupOptions);\n this._strokeUpdate(event);\n }\n _strokeUpdate(event) {\n if (!this._drawingStroke) {\n return;\n }\n if (this._data.length === 0) {\n this._strokeBegin(event);\n return;\n }\n this.dispatchEvent(\n new CustomEvent(\"beforeUpdateStroke\", { detail: event })\n );\n const point = this._createPoint(event.x, event.y, event.pressure);\n const lastPointGroup = this._data[this._data.length - 1];\n const lastPoints = lastPointGroup.points;\n const lastPoint = lastPoints.length > 0 && lastPoints[lastPoints.length - 1];\n const isLastPointTooClose = lastPoint ? point.distanceTo(lastPoint) <= this.minDistance : false;\n const pointGroupOptions = this._getPointGroupOptions(lastPointGroup);\n if (!lastPoint || !(lastPoint && isLastPointTooClose)) {\n const curve = this._addPoint(point, pointGroupOptions);\n if (!lastPoint) {\n this._drawDot(point, pointGroupOptions);\n } else if (curve) {\n this._drawCurve(curve, pointGroupOptions);\n }\n lastPoints.push({\n time: point.time,\n x: point.x,\n y: point.y,\n pressure: point.pressure\n });\n }\n this.dispatchEvent(new CustomEvent(\"afterUpdateStroke\", { detail: event }));\n }\n _strokeEnd(event, shouldUpdate = true) {\n this._removeMoveUpEventListeners();\n if (!this._drawingStroke) {\n return;\n }\n if (shouldUpdate) {\n this._strokeUpdate(event);\n }\n this._drawingStroke = false;\n this._strokePointerId = void 0;\n this.dispatchEvent(new CustomEvent(\"endStroke\", { detail: event }));\n }\n _handlePointerEvents() {\n this._drawingStroke = false;\n this.canvas.addEventListener(\"pointerdown\", this._handlePointerDown, {\n passive: false\n });\n }\n _handleMouseEvents() {\n this._drawingStroke = false;\n this.canvas.addEventListener(\"mousedown\", this._handleMouseDown, {\n passive: false\n });\n }\n _handleTouchEvents() {\n this.canvas.addEventListener(\"touchstart\", this._handleTouchStart, {\n passive: false\n });\n }\n // Called when a new line is started\n _reset(options) {\n this._lastPoints = [];\n this._lastVelocity = 0;\n this._lastWidth = (options.minWidth + options.maxWidth) / 2;\n this._ctx.fillStyle = options.penColor;\n this._ctx.globalCompositeOperation = options.compositeOperation;\n }\n _createPoint(x, y, pressure) {\n const rect = this.canvas.getBoundingClientRect();\n return new Point(\n x - rect.left,\n y - rect.top,\n pressure,\n (/* @__PURE__ */ new Date()).getTime()\n );\n }\n // Add point to _lastPoints array and generate a new curve if there are enough points (i.e. 3)\n _addPoint(point, options) {\n const { _lastPoints } = this;\n _lastPoints.push(point);\n if (_lastPoints.length > 2) {\n if (_lastPoints.length === 3) {\n _lastPoints.unshift(_lastPoints[0]);\n }\n const widths = this._calculateCurveWidths(\n _lastPoints[1],\n _lastPoints[2],\n options\n );\n const curve = Bezier.fromPoints(_lastPoints, widths);\n _lastPoints.shift();\n return curve;\n }\n return null;\n }\n _calculateCurveWidths(startPoint, endPoint, options) {\n const velocity = options.velocityFilterWeight * endPoint.velocityFrom(startPoint) + (1 - options.velocityFilterWeight) * this._lastVelocity;\n const newWidth = this._strokeWidth(velocity, options);\n const widths = {\n end: newWidth,\n start: this._lastWidth\n };\n this._lastVelocity = velocity;\n this._lastWidth = newWidth;\n return widths;\n }\n _strokeWidth(velocity, options) {\n return Math.max(options.maxWidth / (velocity + 1), options.minWidth);\n }\n _drawCurveSegment(x, y, width) {\n const ctx = this._ctx;\n ctx.moveTo(x, y);\n ctx.arc(x, y, width, 0, 2 * Math.PI, false);\n this._isEmpty = false;\n }\n _drawCurve(curve, options) {\n const ctx = this._ctx;\n const widthDelta = curve.endWidth - curve.startWidth;\n const drawSteps = Math.ceil(curve.length()) * 2;\n ctx.beginPath();\n ctx.fillStyle = options.penColor;\n for (let i = 0; i < drawSteps; i += 1) {\n const t = i / drawSteps;\n const tt = t * t;\n const ttt = tt * t;\n const u = 1 - t;\n const uu = u * u;\n const uuu = uu * u;\n let x = uuu * curve.startPoint.x;\n x += 3 * uu * t * curve.control1.x;\n x += 3 * u * tt * curve.control2.x;\n x += ttt * curve.endPoint.x;\n let y = uuu * curve.startPoint.y;\n y += 3 * uu * t * curve.control1.y;\n y += 3 * u * tt * curve.control2.y;\n y += ttt * curve.endPoint.y;\n const width = Math.min(\n curve.startWidth + ttt * widthDelta,\n options.maxWidth\n );\n this._drawCurveSegment(x, y, width);\n }\n ctx.closePath();\n ctx.fill();\n }\n _drawDot(point, options) {\n const ctx = this._ctx;\n const width = options.dotSize > 0 ? options.dotSize : (options.minWidth + options.maxWidth) / 2;\n ctx.beginPath();\n this._drawCurveSegment(point.x, point.y, width);\n ctx.closePath();\n ctx.fillStyle = options.penColor;\n ctx.fill();\n }\n _fromData(pointGroups, drawCurve, drawDot) {\n for (const group of pointGroups) {\n const { points } = group;\n const pointGroupOptions = this._getPointGroupOptions(group);\n if (points.length > 1) {\n for (let j = 0; j < points.length; j += 1) {\n const basicPoint = points[j];\n const point = new Point(\n basicPoint.x,\n basicPoint.y,\n basicPoint.pressure,\n basicPoint.time\n );\n if (j === 0) {\n this._reset(pointGroupOptions);\n }\n const curve = this._addPoint(point, pointGroupOptions);\n if (curve) {\n drawCurve(curve, pointGroupOptions);\n }\n }\n } else {\n this._reset(pointGroupOptions);\n drawDot(points[0], pointGroupOptions);\n }\n }\n }\n toSVG({ includeBackgroundColor = false, includeDataUrl = false } = {}) {\n const pointGroups = this._data;\n const ratio = Math.max(window.devicePixelRatio || 1, 1);\n const minX = 0;\n const minY = 0;\n const maxX = this.canvas.width / ratio;\n const maxY = this.canvas.height / ratio;\n const svg = document.createElementNS(\"http://www.w3.org/2000/svg\", \"svg\");\n svg.setAttribute(\"xmlns\", \"http://www.w3.org/2000/svg\");\n svg.setAttribute(\"xmlns:xlink\", \"http://www.w3.org/1999/xlink\");\n svg.setAttribute(\"viewBox\", `${minX} ${minY} ${maxX} ${maxY}`);\n svg.setAttribute(\"width\", maxX.toString());\n svg.setAttribute(\"height\", maxY.toString());\n if (includeBackgroundColor && this.backgroundColor) {\n const rect = document.createElement(\"rect\");\n rect.setAttribute(\"width\", \"100%\");\n rect.setAttribute(\"height\", \"100%\");\n rect.setAttribute(\"fill\", this.backgroundColor);\n svg.appendChild(rect);\n }\n if (includeDataUrl && this._dataUrl) {\n const ratio2 = this._dataUrlOptions?.ratio || window.devicePixelRatio || 1;\n const width = this._dataUrlOptions?.width || this.canvas.width / ratio2;\n const height = this._dataUrlOptions?.height || this.canvas.height / ratio2;\n const xOffset = this._dataUrlOptions?.xOffset || 0;\n const yOffset = this._dataUrlOptions?.yOffset || 0;\n const image = document.createElement(\"image\");\n image.setAttribute(\"x\", xOffset.toString());\n image.setAttribute(\"y\", yOffset.toString());\n image.setAttribute(\"width\", width.toString());\n image.setAttribute(\"height\", height.toString());\n image.setAttribute(\"preserveAspectRatio\", \"none\");\n image.setAttribute(\"href\", this._dataUrl);\n svg.appendChild(image);\n }\n this._fromData(\n pointGroups,\n (curve, { penColor }) => {\n const path = document.createElement(\"path\");\n if (!isNaN(curve.control1.x) && !isNaN(curve.control1.y) && !isNaN(curve.control2.x) && !isNaN(curve.control2.y)) {\n const attr = `M ${curve.startPoint.x.toFixed(3)},${curve.startPoint.y.toFixed(\n 3\n )} C ${curve.control1.x.toFixed(3)},${curve.control1.y.toFixed(3)} ${curve.control2.x.toFixed(3)},${curve.control2.y.toFixed(3)} ${curve.endPoint.x.toFixed(3)},${curve.endPoint.y.toFixed(3)}`;\n path.setAttribute(\"d\", attr);\n path.setAttribute(\"stroke-width\", (curve.endWidth * 2.25).toFixed(3));\n path.setAttribute(\"stroke\", penColor);\n path.setAttribute(\"fill\", \"none\");\n path.setAttribute(\"stroke-linecap\", \"round\");\n svg.appendChild(path);\n }\n },\n (point, { penColor, dotSize, minWidth, maxWidth }) => {\n const circle = document.createElement(\"circle\");\n const size = dotSize > 0 ? dotSize : (minWidth + maxWidth) / 2;\n circle.setAttribute(\"r\", size.toString());\n circle.setAttribute(\"cx\", point.x.toString());\n circle.setAttribute(\"cy\", point.y.toString());\n circle.setAttribute(\"fill\", penColor);\n svg.appendChild(circle);\n }\n );\n return svg.outerHTML;\n }\n};\nexport {\n SignaturePad as default\n};\n//# sourceMappingURL=signature_pad.js.map\n"],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AY;AAK7D,GAJA,EAAO,aAAa,KAAK,EAAK,UAAU,CAAC,EACzC,EAAO,aAAa,MAAM,EAAM,EAAE,UAAU,CAAC,EAC7C,EAAO,aAAa,MAAM,EAAM,EAAE,UAAU,CAAC,EAC7C,EAAO,aAAa,QAAQ,EAAS,EACrC,EAAI,YAAY,EAAO;IAE1B,EACM,EAAI"}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { FrontendFieldDefinition } from '@verbb/formie-core';
|
|
2
|
+
/** Dispatched as `formie-control-value-change` from custom field controls (`bubbles` + `composed`). */
|
|
3
|
+
export declare const FORMIE_CONTROL_VALUE_EVENT = "formie-control-value-change";
|
|
4
|
+
/**
|
|
5
|
+
* Contract for custom elements registered via {@link FormieRegistry.registerFieldControl}.
|
|
6
|
+
* Set as properties on the host; listen for {@link FORMIE_CONTROL_VALUE_EVENT}.
|
|
7
|
+
*/
|
|
8
|
+
export type FormieFieldControlElement = HTMLElement & {
|
|
9
|
+
field: FrontendFieldDefinition;
|
|
10
|
+
value: unknown;
|
|
11
|
+
errorKey: string;
|
|
12
|
+
disabled: boolean;
|
|
13
|
+
hidden: boolean;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Optional **field** host element: wraps label, instructions, the control, and errors.
|
|
17
|
+
* Distinct from {@link FormieFieldControlElement}, which is only the input widget.
|
|
18
|
+
* Use a **default slot** (or light DOM projection) where the control is rendered.
|
|
19
|
+
*/
|
|
20
|
+
export type FormieFieldElement = HTMLElement & {
|
|
21
|
+
field: FrontendFieldDefinition;
|
|
22
|
+
errors: string[];
|
|
23
|
+
};
|
|
24
|
+
/** Keys for optional custom elements that replace default layout regions on `<formie-core-form>`. */
|
|
25
|
+
export type FormieRegionKey = 'form' | 'page' | 'errorSummary' | 'loading' | 'pageActions';
|
|
26
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAElE,uGAAuG;AACvG,eAAO,MAAM,0BAA0B,gCAAgC,CAAC;AAExE;;;GAGG;AACH,MAAM,MAAM,yBAAyB,GAAG,WAAW,GAAG;IAClD,KAAK,EAAE,uBAAuB,CAAC;IAC/B,KAAK,EAAE,OAAO,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,OAAO,CAAC;IAClB,MAAM,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,kBAAkB,GAAG,WAAW,GAAG;IAC3C,KAAK,EAAE,uBAAuB,CAAC;IAC/B,MAAM,EAAE,MAAM,EAAE,CAAC;CACpB,CAAC;AAEF,qGAAqG;AACrG,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG,MAAM,GAAG,cAAc,GAAG,SAAS,GAAG,aAAa,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@verbb/formie-web-components",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"main": "./dist/index.js",
|
|
6
|
+
"module": "./dist/index.js",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"files": [
|
|
9
|
+
"dist",
|
|
10
|
+
"CHANGELOG.md",
|
|
11
|
+
"LICENSE.md"
|
|
12
|
+
],
|
|
13
|
+
"license": "SEE LICENSE IN LICENSE.md",
|
|
14
|
+
"repository": {
|
|
15
|
+
"type": "git",
|
|
16
|
+
"url": "git+https://github.com/verbb/formie.git"
|
|
17
|
+
},
|
|
18
|
+
"bugs": {
|
|
19
|
+
"url": "https://github.com/verbb/formie/issues"
|
|
20
|
+
},
|
|
21
|
+
"homepage": "https://docs.verbb.io/formie/packages/web-components",
|
|
22
|
+
"engines": {
|
|
23
|
+
"node": ">=20.0.0"
|
|
24
|
+
},
|
|
25
|
+
"sideEffects": [
|
|
26
|
+
"./dist/index.js"
|
|
27
|
+
],
|
|
28
|
+
"exports": {
|
|
29
|
+
".": {
|
|
30
|
+
"types": "./dist/index.d.ts",
|
|
31
|
+
"import": "./dist/index.js"
|
|
32
|
+
},
|
|
33
|
+
"./package.json": "./package.json"
|
|
34
|
+
},
|
|
35
|
+
"publishConfig": {
|
|
36
|
+
"access": "public"
|
|
37
|
+
},
|
|
38
|
+
"scripts": {
|
|
39
|
+
"build": "vite build && tsc -p tsconfig.json"
|
|
40
|
+
},
|
|
41
|
+
"dependencies": {
|
|
42
|
+
"@verbb/formie-browser": "1.0.0",
|
|
43
|
+
"@verbb/formie-core": "1.0.0",
|
|
44
|
+
"lit": "^3.3.2",
|
|
45
|
+
"signature_pad": "^5.1.3"
|
|
46
|
+
},
|
|
47
|
+
"devDependencies": {
|
|
48
|
+
"typescript": "^6.0.3",
|
|
49
|
+
"vite": "^8.0.10"
|
|
50
|
+
}
|
|
51
|
+
}
|