@verdocs/web-sdk 2.3.86 → 2.3.87
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/dist/cjs/verdocs-sign.cjs.entry.js +22 -19
- package/dist/collection/components/embeds/verdocs-sign/verdocs-sign.js +22 -19
- package/dist/components/verdocs-sign.js +22 -19
- package/dist/custom-elements.json +2147 -0
- package/dist/docs.json +1 -1
- package/dist/esm/verdocs-sign.entry.js +22 -19
- package/dist/esm-es5/verdocs-sign.entry.js +1 -1
- package/dist/types/components/embeds/verdocs-sign/verdocs-sign.d.ts +1 -0
- package/dist/verdocs-web-sdk/{p-be7390d8.system.entry.js → p-aa49605f.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-c622d7b3.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-f04bf956.system.js +1 -1
- package/dist/verdocs-web-sdk/verdocs-web-sdk.esm.js +1 -1
- package/package.json +1 -1
- package/dist/verdocs-web-sdk/p-a5f94a3f.entry.js +0 -1
@@ -300,9 +300,8 @@ const VerdocsSign = class {
|
|
300
300
|
break;
|
301
301
|
}
|
302
302
|
}
|
303
|
-
|
303
|
+
isFieldFilled(field) {
|
304
304
|
var _a, _b, _c, _d, _e, _f, _g;
|
305
|
-
const { required = false } = field;
|
306
305
|
const { result = '', value = '', base64 = '' } = field.settings || {};
|
307
306
|
switch (field.type) {
|
308
307
|
case 'textbox':
|
@@ -312,25 +311,25 @@ const VerdocsSign = class {
|
|
312
311
|
case 'phone':
|
313
312
|
return Validators.isValidPhone(result);
|
314
313
|
default:
|
315
|
-
return
|
314
|
+
return result !== '';
|
316
315
|
}
|
317
316
|
case 'signature':
|
318
317
|
case 'initial':
|
319
|
-
return
|
318
|
+
return base64 !== '';
|
320
319
|
// Timestamp fields get automatically filled when the envelope is submitted.
|
321
320
|
case 'timestamp':
|
322
321
|
return true;
|
323
322
|
case 'textarea':
|
324
323
|
case 'date':
|
325
324
|
case 'attachment':
|
326
|
-
return
|
325
|
+
return result !== '';
|
327
326
|
case 'dropdown':
|
328
|
-
return
|
327
|
+
return value !== '';
|
329
328
|
case 'checkbox_group':
|
330
329
|
const checkedCount = (((_c = (_b = field.settings) === null || _b === void 0 ? void 0 : _b.options) === null || _c === void 0 ? void 0 : _c.filter(option => option.checked)) || []).length;
|
331
|
-
return
|
330
|
+
return checkedCount >= (((_d = field.settings) === null || _d === void 0 ? void 0 : _d.minimum_checked) || 0) && checkedCount <= (((_e = field.settings) === null || _e === void 0 ? void 0 : _e.maximum_checked) || 999);
|
332
331
|
case 'radio_button_group':
|
333
|
-
return
|
332
|
+
return (((_g = (_f = field.settings) === null || _f === void 0 ? void 0 : _f.options) === null || _g === void 0 ? void 0 : _g.filter(option => option.selected)) || []).length > 0;
|
334
333
|
// TODO
|
335
334
|
// case 'checkbox':
|
336
335
|
// return <verdocs-field-checkbox style={style} value={result || ''} id={id} />;
|
@@ -340,6 +339,10 @@ const VerdocsSign = class {
|
|
340
339
|
return false;
|
341
340
|
}
|
342
341
|
}
|
342
|
+
isFieldValid(field) {
|
343
|
+
const { required = false } = field;
|
344
|
+
return !required || this.isFieldFilled(field);
|
345
|
+
}
|
343
346
|
async handleNext() {
|
344
347
|
var _a, _b;
|
345
348
|
if (this.nextSubmits) {
|
@@ -365,11 +368,11 @@ const VerdocsSign = class {
|
|
365
368
|
this.submitting = false;
|
366
369
|
return;
|
367
370
|
}
|
368
|
-
// Find and focus the next incomplete
|
369
|
-
const
|
370
|
-
.filter(field => field.required)
|
371
|
+
// Find and focus the next incomplete field (that is fillable)
|
372
|
+
const emptyFields = this.getRecipientFields()
|
373
|
+
.filter(field => !this.isFieldFilled(field)) // field.required)
|
371
374
|
.filter(field => field.type !== 'timestamp');
|
372
|
-
|
375
|
+
emptyFields.sort((a, b) => {
|
373
376
|
var _a, _b, _c, _d;
|
374
377
|
const aX = ((_a = a.settings) === null || _a === void 0 ? void 0 : _a.x) || 0;
|
375
378
|
const aY = ((_b = a.settings) === null || _b === void 0 ? void 0 : _b.y) || 0;
|
@@ -377,23 +380,23 @@ const VerdocsSign = class {
|
|
377
380
|
const bY = ((_d = b.settings) === null || _d === void 0 ? void 0 : _d.y) || 0;
|
378
381
|
return bY !== aY ? bY - aY : bX - aX;
|
379
382
|
});
|
380
|
-
const focusedIndex =
|
383
|
+
const focusedIndex = emptyFields.findIndex(field => field.name === this.focusedField);
|
381
384
|
let nextFocusedIndex = focusedIndex + 1;
|
382
|
-
if (nextFocusedIndex >=
|
385
|
+
if (nextFocusedIndex >= emptyFields.length) {
|
383
386
|
nextFocusedIndex = 0;
|
384
387
|
}
|
385
|
-
let nextRequiredField =
|
388
|
+
let nextRequiredField = emptyFields[nextFocusedIndex];
|
386
389
|
// Skip signature and initial fields that are already filled in. We have to count our "skips" just in case, to avoid infinite loops.
|
387
390
|
let skips = 0;
|
388
|
-
if (skips <
|
391
|
+
if (skips < emptyFields.length && ['signature', 'initial'].includes(nextRequiredField.type) && ((_b = nextRequiredField.settings) === null || _b === void 0 ? void 0 : _b.result) === 'signed') {
|
389
392
|
skips++;
|
390
393
|
nextFocusedIndex++;
|
391
|
-
if (nextFocusedIndex >=
|
394
|
+
if (nextFocusedIndex >= emptyFields.length) {
|
392
395
|
nextFocusedIndex = 0;
|
393
396
|
}
|
394
|
-
nextRequiredField =
|
397
|
+
nextRequiredField = emptyFields[nextFocusedIndex];
|
395
398
|
}
|
396
|
-
if (skips >=
|
399
|
+
if (skips >= emptyFields.length) {
|
397
400
|
nextRequiredField = null;
|
398
401
|
}
|
399
402
|
if (nextRequiredField) {
|
@@ -277,9 +277,8 @@ export class VerdocsSign {
|
|
277
277
|
break;
|
278
278
|
}
|
279
279
|
}
|
280
|
-
|
280
|
+
isFieldFilled(field) {
|
281
281
|
var _a, _b, _c, _d, _e, _f, _g;
|
282
|
-
const { required = false } = field;
|
283
282
|
const { result = '', value = '', base64 = '' } = field.settings || {};
|
284
283
|
switch (field.type) {
|
285
284
|
case 'textbox':
|
@@ -289,25 +288,25 @@ export class VerdocsSign {
|
|
289
288
|
case 'phone':
|
290
289
|
return isValidPhone(result);
|
291
290
|
default:
|
292
|
-
return
|
291
|
+
return result !== '';
|
293
292
|
}
|
294
293
|
case 'signature':
|
295
294
|
case 'initial':
|
296
|
-
return
|
295
|
+
return base64 !== '';
|
297
296
|
// Timestamp fields get automatically filled when the envelope is submitted.
|
298
297
|
case 'timestamp':
|
299
298
|
return true;
|
300
299
|
case 'textarea':
|
301
300
|
case 'date':
|
302
301
|
case 'attachment':
|
303
|
-
return
|
302
|
+
return result !== '';
|
304
303
|
case 'dropdown':
|
305
|
-
return
|
304
|
+
return value !== '';
|
306
305
|
case 'checkbox_group':
|
307
306
|
const checkedCount = (((_c = (_b = field.settings) === null || _b === void 0 ? void 0 : _b.options) === null || _c === void 0 ? void 0 : _c.filter(option => option.checked)) || []).length;
|
308
|
-
return
|
307
|
+
return checkedCount >= (((_d = field.settings) === null || _d === void 0 ? void 0 : _d.minimum_checked) || 0) && checkedCount <= (((_e = field.settings) === null || _e === void 0 ? void 0 : _e.maximum_checked) || 999);
|
309
308
|
case 'radio_button_group':
|
310
|
-
return
|
309
|
+
return (((_g = (_f = field.settings) === null || _f === void 0 ? void 0 : _f.options) === null || _g === void 0 ? void 0 : _g.filter(option => option.selected)) || []).length > 0;
|
311
310
|
// TODO
|
312
311
|
// case 'checkbox':
|
313
312
|
// return <verdocs-field-checkbox style={style} value={result || ''} id={id} />;
|
@@ -317,6 +316,10 @@ export class VerdocsSign {
|
|
317
316
|
return false;
|
318
317
|
}
|
319
318
|
}
|
319
|
+
isFieldValid(field) {
|
320
|
+
const { required = false } = field;
|
321
|
+
return !required || this.isFieldFilled(field);
|
322
|
+
}
|
320
323
|
async handleNext() {
|
321
324
|
var _a, _b;
|
322
325
|
if (this.nextSubmits) {
|
@@ -342,11 +345,11 @@ export class VerdocsSign {
|
|
342
345
|
this.submitting = false;
|
343
346
|
return;
|
344
347
|
}
|
345
|
-
// Find and focus the next incomplete
|
346
|
-
const
|
347
|
-
.filter(field => field.required)
|
348
|
+
// Find and focus the next incomplete field (that is fillable)
|
349
|
+
const emptyFields = this.getRecipientFields()
|
350
|
+
.filter(field => !this.isFieldFilled(field)) // field.required)
|
348
351
|
.filter(field => field.type !== 'timestamp');
|
349
|
-
|
352
|
+
emptyFields.sort((a, b) => {
|
350
353
|
var _a, _b, _c, _d;
|
351
354
|
const aX = ((_a = a.settings) === null || _a === void 0 ? void 0 : _a.x) || 0;
|
352
355
|
const aY = ((_b = a.settings) === null || _b === void 0 ? void 0 : _b.y) || 0;
|
@@ -354,23 +357,23 @@ export class VerdocsSign {
|
|
354
357
|
const bY = ((_d = b.settings) === null || _d === void 0 ? void 0 : _d.y) || 0;
|
355
358
|
return bY !== aY ? bY - aY : bX - aX;
|
356
359
|
});
|
357
|
-
const focusedIndex =
|
360
|
+
const focusedIndex = emptyFields.findIndex(field => field.name === this.focusedField);
|
358
361
|
let nextFocusedIndex = focusedIndex + 1;
|
359
|
-
if (nextFocusedIndex >=
|
362
|
+
if (nextFocusedIndex >= emptyFields.length) {
|
360
363
|
nextFocusedIndex = 0;
|
361
364
|
}
|
362
|
-
let nextRequiredField =
|
365
|
+
let nextRequiredField = emptyFields[nextFocusedIndex];
|
363
366
|
// Skip signature and initial fields that are already filled in. We have to count our "skips" just in case, to avoid infinite loops.
|
364
367
|
let skips = 0;
|
365
|
-
if (skips <
|
368
|
+
if (skips < emptyFields.length && ['signature', 'initial'].includes(nextRequiredField.type) && ((_b = nextRequiredField.settings) === null || _b === void 0 ? void 0 : _b.result) === 'signed') {
|
366
369
|
skips++;
|
367
370
|
nextFocusedIndex++;
|
368
|
-
if (nextFocusedIndex >=
|
371
|
+
if (nextFocusedIndex >= emptyFields.length) {
|
369
372
|
nextFocusedIndex = 0;
|
370
373
|
}
|
371
|
-
nextRequiredField =
|
374
|
+
nextRequiredField = emptyFields[nextFocusedIndex];
|
372
375
|
}
|
373
|
-
if (skips >=
|
376
|
+
if (skips >= emptyFields.length) {
|
374
377
|
nextRequiredField = null;
|
375
378
|
}
|
376
379
|
if (nextRequiredField) {
|
@@ -300,9 +300,8 @@ const VerdocsSign$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
300
300
|
break;
|
301
301
|
}
|
302
302
|
}
|
303
|
-
|
303
|
+
isFieldFilled(field) {
|
304
304
|
var _a, _b, _c, _d, _e, _f, _g;
|
305
|
-
const { required = false } = field;
|
306
305
|
const { result = '', value = '', base64 = '' } = field.settings || {};
|
307
306
|
switch (field.type) {
|
308
307
|
case 'textbox':
|
@@ -312,25 +311,25 @@ const VerdocsSign$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
312
311
|
case 'phone':
|
313
312
|
return isValidPhone(result);
|
314
313
|
default:
|
315
|
-
return
|
314
|
+
return result !== '';
|
316
315
|
}
|
317
316
|
case 'signature':
|
318
317
|
case 'initial':
|
319
|
-
return
|
318
|
+
return base64 !== '';
|
320
319
|
// Timestamp fields get automatically filled when the envelope is submitted.
|
321
320
|
case 'timestamp':
|
322
321
|
return true;
|
323
322
|
case 'textarea':
|
324
323
|
case 'date':
|
325
324
|
case 'attachment':
|
326
|
-
return
|
325
|
+
return result !== '';
|
327
326
|
case 'dropdown':
|
328
|
-
return
|
327
|
+
return value !== '';
|
329
328
|
case 'checkbox_group':
|
330
329
|
const checkedCount = (((_c = (_b = field.settings) === null || _b === void 0 ? void 0 : _b.options) === null || _c === void 0 ? void 0 : _c.filter(option => option.checked)) || []).length;
|
331
|
-
return
|
330
|
+
return checkedCount >= (((_d = field.settings) === null || _d === void 0 ? void 0 : _d.minimum_checked) || 0) && checkedCount <= (((_e = field.settings) === null || _e === void 0 ? void 0 : _e.maximum_checked) || 999);
|
332
331
|
case 'radio_button_group':
|
333
|
-
return
|
332
|
+
return (((_g = (_f = field.settings) === null || _f === void 0 ? void 0 : _f.options) === null || _g === void 0 ? void 0 : _g.filter(option => option.selected)) || []).length > 0;
|
334
333
|
// TODO
|
335
334
|
// case 'checkbox':
|
336
335
|
// return <verdocs-field-checkbox style={style} value={result || ''} id={id} />;
|
@@ -340,6 +339,10 @@ const VerdocsSign$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
340
339
|
return false;
|
341
340
|
}
|
342
341
|
}
|
342
|
+
isFieldValid(field) {
|
343
|
+
const { required = false } = field;
|
344
|
+
return !required || this.isFieldFilled(field);
|
345
|
+
}
|
343
346
|
async handleNext() {
|
344
347
|
var _a, _b;
|
345
348
|
if (this.nextSubmits) {
|
@@ -365,11 +368,11 @@ const VerdocsSign$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
365
368
|
this.submitting = false;
|
366
369
|
return;
|
367
370
|
}
|
368
|
-
// Find and focus the next incomplete
|
369
|
-
const
|
370
|
-
.filter(field => field.required)
|
371
|
+
// Find and focus the next incomplete field (that is fillable)
|
372
|
+
const emptyFields = this.getRecipientFields()
|
373
|
+
.filter(field => !this.isFieldFilled(field)) // field.required)
|
371
374
|
.filter(field => field.type !== 'timestamp');
|
372
|
-
|
375
|
+
emptyFields.sort((a, b) => {
|
373
376
|
var _a, _b, _c, _d;
|
374
377
|
const aX = ((_a = a.settings) === null || _a === void 0 ? void 0 : _a.x) || 0;
|
375
378
|
const aY = ((_b = a.settings) === null || _b === void 0 ? void 0 : _b.y) || 0;
|
@@ -377,23 +380,23 @@ const VerdocsSign$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
377
380
|
const bY = ((_d = b.settings) === null || _d === void 0 ? void 0 : _d.y) || 0;
|
378
381
|
return bY !== aY ? bY - aY : bX - aX;
|
379
382
|
});
|
380
|
-
const focusedIndex =
|
383
|
+
const focusedIndex = emptyFields.findIndex(field => field.name === this.focusedField);
|
381
384
|
let nextFocusedIndex = focusedIndex + 1;
|
382
|
-
if (nextFocusedIndex >=
|
385
|
+
if (nextFocusedIndex >= emptyFields.length) {
|
383
386
|
nextFocusedIndex = 0;
|
384
387
|
}
|
385
|
-
let nextRequiredField =
|
388
|
+
let nextRequiredField = emptyFields[nextFocusedIndex];
|
386
389
|
// Skip signature and initial fields that are already filled in. We have to count our "skips" just in case, to avoid infinite loops.
|
387
390
|
let skips = 0;
|
388
|
-
if (skips <
|
391
|
+
if (skips < emptyFields.length && ['signature', 'initial'].includes(nextRequiredField.type) && ((_b = nextRequiredField.settings) === null || _b === void 0 ? void 0 : _b.result) === 'signed') {
|
389
392
|
skips++;
|
390
393
|
nextFocusedIndex++;
|
391
|
-
if (nextFocusedIndex >=
|
394
|
+
if (nextFocusedIndex >= emptyFields.length) {
|
392
395
|
nextFocusedIndex = 0;
|
393
396
|
}
|
394
|
-
nextRequiredField =
|
397
|
+
nextRequiredField = emptyFields[nextFocusedIndex];
|
395
398
|
}
|
396
|
-
if (skips >=
|
399
|
+
if (skips >= emptyFields.length) {
|
397
400
|
nextRequiredField = null;
|
398
401
|
}
|
399
402
|
if (nextRequiredField) {
|