@verdocs/web-sdk 6.2.5 → 6.2.7

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.
Files changed (105) hide show
  1. package/dist/cjs/verdocs-checkbox.verdocs-component-error.verdocs-loader.verdocs-select-input.verdocs-template-field-properties.entry.cjs.js.map +1 -1
  2. package/dist/cjs/verdocs-checkbox_5.cjs.entry.js +1 -0
  3. package/dist/cjs/verdocs-field-attachment_13.cjs.entry.js +22 -12
  4. package/dist/cjs/verdocs-sign.cjs.entry.js +7 -0
  5. package/dist/cjs/verdocs-sign.entry.cjs.js.map +1 -1
  6. package/dist/collection/components/embeds/verdocs-sign/verdocs-sign.js +7 -0
  7. package/dist/collection/components/embeds/verdocs-sign/verdocs-sign.js.map +1 -1
  8. package/dist/collection/components/fields/verdocs-field-date/verdocs-field-date.js +16 -11
  9. package/dist/collection/components/fields/verdocs-field-date/verdocs-field-date.js.map +1 -1
  10. package/dist/collection/components/fields/verdocs-field-dropdown/verdocs-field-dropdown.js +6 -1
  11. package/dist/collection/components/fields/verdocs-field-dropdown/verdocs-field-dropdown.js.map +1 -1
  12. package/dist/collection/components/templates/verdocs-template-field-properties/verdocs-template-field-properties.js +1 -0
  13. package/dist/collection/components/templates/verdocs-template-field-properties/verdocs-template-field-properties.js.map +1 -1
  14. package/dist/components/{p-L3HpKTaM.js → p-BJqJsTbt.js} +3 -3
  15. package/dist/components/{p-L3HpKTaM.js.map → p-BJqJsTbt.js.map} +1 -1
  16. package/dist/components/{p-DSO1_d48.js → p-BPPiqx8Q.js} +3 -3
  17. package/dist/components/{p-DSO1_d48.js.map → p-BPPiqx8Q.js.map} +1 -1
  18. package/dist/components/{p-C4lOZS20.js → p-BiqAkA9R.js} +3 -3
  19. package/dist/components/{p-C4lOZS20.js.map → p-BiqAkA9R.js.map} +1 -1
  20. package/dist/components/{p-DfTz53m-.js → p-CJt2BxDt.js} +19 -14
  21. package/dist/components/p-CJt2BxDt.js.map +1 -0
  22. package/dist/components/{p-CcIaiNEM.js → p-Ck_1uk0F.js} +3 -3
  23. package/dist/components/{p-CcIaiNEM.js.map → p-Ck_1uk0F.js.map} +1 -1
  24. package/dist/components/{p-BXFf3Lpk.js → p-CnRyZDAM.js} +3 -3
  25. package/dist/components/{p-BXFf3Lpk.js.map → p-CnRyZDAM.js.map} +1 -1
  26. package/dist/components/{p-mjn4Ftey.js → p-D2DrESHF.js} +13 -13
  27. package/dist/components/{p-mjn4Ftey.js.map → p-D2DrESHF.js.map} +1 -1
  28. package/dist/components/{p-BVuTqQTL.js → p-D_sm-ZDj.js} +9 -4
  29. package/dist/components/p-D_sm-ZDj.js.map +1 -0
  30. package/dist/components/{p-TkHAxPB_.js → p-Da1nfhXq.js} +3 -2
  31. package/dist/components/p-Da1nfhXq.js.map +1 -0
  32. package/dist/components/{p-B4UtR_2c.js → p-IbPNQm1I.js} +3 -3
  33. package/dist/components/{p-B4UtR_2c.js.map → p-IbPNQm1I.js.map} +1 -1
  34. package/dist/components/{p-DK8_N2Na.js → p-gEwPUp5J.js} +14 -14
  35. package/dist/components/{p-DK8_N2Na.js.map → p-gEwPUp5J.js.map} +1 -1
  36. package/dist/components/{p-CtbvYEGE.js → p-gGtgKfmC.js} +3 -3
  37. package/dist/components/{p-CtbvYEGE.js.map → p-gGtgKfmC.js.map} +1 -1
  38. package/dist/components/{p-B0MvlQO2.js → p-jXH2SygA.js} +3 -3
  39. package/dist/components/{p-B0MvlQO2.js.map → p-jXH2SygA.js.map} +1 -1
  40. package/dist/components/{p-BjvBJ8-S.js → p-vDfciSeg.js} +14 -14
  41. package/dist/components/{p-BjvBJ8-S.js.map → p-vDfciSeg.js.map} +1 -1
  42. package/dist/components/verdocs-build.js +14 -14
  43. package/dist/components/verdocs-field-attachment.js +1 -1
  44. package/dist/components/verdocs-field-checkbox.js +1 -1
  45. package/dist/components/verdocs-field-date.js +1 -1
  46. package/dist/components/verdocs-field-dropdown.js +1 -1
  47. package/dist/components/verdocs-field-initial.js +1 -1
  48. package/dist/components/verdocs-field-payment.js +1 -1
  49. package/dist/components/verdocs-field-radio.js +1 -1
  50. package/dist/components/verdocs-field-signature.js +1 -1
  51. package/dist/components/verdocs-field-textarea.js +1 -1
  52. package/dist/components/verdocs-field-textbox.js +1 -1
  53. package/dist/components/verdocs-field-timestamp.js +1 -1
  54. package/dist/components/verdocs-preview.js +1 -1
  55. package/dist/components/verdocs-sign.js +7 -0
  56. package/dist/components/verdocs-sign.js.map +1 -1
  57. package/dist/components/verdocs-template-document-page.js +1 -1
  58. package/dist/components/verdocs-template-field-properties.js +1 -1
  59. package/dist/components/verdocs-template-fields.js +1 -1
  60. package/dist/esm/verdocs-checkbox.verdocs-component-error.verdocs-loader.verdocs-select-input.verdocs-template-field-properties.entry.js.map +1 -1
  61. package/dist/esm/verdocs-checkbox_5.entry.js +1 -0
  62. package/dist/esm/verdocs-field-attachment_13.entry.js +22 -12
  63. package/dist/esm/verdocs-sign.entry.js +7 -0
  64. package/dist/esm/verdocs-sign.entry.js.map +1 -1
  65. package/dist/esm-es5/verdocs-checkbox.verdocs-component-error.verdocs-loader.verdocs-select-input.verdocs-template-field-properties.entry.js.map +1 -1
  66. package/dist/esm-es5/verdocs-checkbox_5.entry.js +1 -1
  67. package/dist/esm-es5/verdocs-checkbox_5.entry.js.map +1 -1
  68. package/dist/esm-es5/verdocs-field-attachment_13.entry.js +1 -1
  69. package/dist/esm-es5/verdocs-field-attachment_13.entry.js.map +1 -1
  70. package/dist/esm-es5/verdocs-sign.entry.js +1 -1
  71. package/dist/esm-es5/verdocs-sign.entry.js.map +1 -1
  72. package/dist/verdocs-web-sdk/p-54a99b75.system.entry.js +2 -0
  73. package/dist/verdocs-web-sdk/p-54a99b75.system.entry.js.map +1 -0
  74. package/dist/verdocs-web-sdk/p-5b010bdb.entry.js +2 -0
  75. package/dist/verdocs-web-sdk/p-5b010bdb.entry.js.map +1 -0
  76. package/dist/verdocs-web-sdk/{p-74f5a0bd.entry.js → p-77a3e9ea.entry.js} +2 -2
  77. package/dist/verdocs-web-sdk/p-77a3e9ea.entry.js.map +1 -0
  78. package/dist/verdocs-web-sdk/{p-df9a63c8.system.entry.js → p-77a96b42.system.entry.js} +2 -2
  79. package/dist/verdocs-web-sdk/{p-df9a63c8.system.entry.js.map → p-77a96b42.system.entry.js.map} +1 -1
  80. package/dist/verdocs-web-sdk/p-BSxnvcXp.system.js +1 -1
  81. package/dist/verdocs-web-sdk/p-BsSES842.system.js.map +1 -0
  82. package/dist/verdocs-web-sdk/p-CDd3Y_Oc.system.js.map +1 -0
  83. package/dist/verdocs-web-sdk/p-e7b26cd8.system.entry.js +2 -0
  84. package/dist/verdocs-web-sdk/p-e7b26cd8.system.entry.js.map +1 -0
  85. package/dist/verdocs-web-sdk/p-fa410d5c.entry.js +2 -0
  86. package/dist/verdocs-web-sdk/p-fa410d5c.entry.js.map +1 -0
  87. package/dist/verdocs-web-sdk/{p-Cdv-0jBY.system.js.map → p-gJaz09Zo.system.js.map} +1 -1
  88. package/dist/verdocs-web-sdk/verdocs-checkbox.verdocs-component-error.verdocs-loader.verdocs-select-input.verdocs-template-field-properties.entry.esm.js.map +1 -1
  89. package/dist/verdocs-web-sdk/verdocs-sign.entry.esm.js.map +1 -1
  90. package/dist/verdocs-web-sdk/verdocs-web-sdk.esm.js +1 -1
  91. package/package.json +1 -1
  92. package/dist/components/p-BVuTqQTL.js.map +0 -1
  93. package/dist/components/p-DfTz53m-.js.map +0 -1
  94. package/dist/components/p-TkHAxPB_.js.map +0 -1
  95. package/dist/verdocs-web-sdk/p-0c2b17b8.system.entry.js +0 -2
  96. package/dist/verdocs-web-sdk/p-0c2b17b8.system.entry.js.map +0 -1
  97. package/dist/verdocs-web-sdk/p-0c895013.entry.js +0 -2
  98. package/dist/verdocs-web-sdk/p-0c895013.entry.js.map +0 -1
  99. package/dist/verdocs-web-sdk/p-16c12330.system.entry.js +0 -2
  100. package/dist/verdocs-web-sdk/p-16c12330.system.entry.js.map +0 -1
  101. package/dist/verdocs-web-sdk/p-74f5a0bd.entry.js.map +0 -1
  102. package/dist/verdocs-web-sdk/p-778aa621.entry.js +0 -2
  103. package/dist/verdocs-web-sdk/p-778aa621.entry.js.map +0 -1
  104. package/dist/verdocs-web-sdk/p-CqY4YwuC.system.js.map +0 -1
  105. package/dist/verdocs-web-sdk/p-WL8pZ5_5.system.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"verdocs-template-field-properties.js","sourceRoot":"","sources":["../../../../src/components/templates/verdocs-template-field-properties/verdocs-template-field-properties.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,CAAC,EAAE,OAAO,EAAE,KAAK,EAAgB,IAAI,EAAE,KAAK,EAAE,IAAI,EAAC,MAAM,eAAe,CAAC;AAC5F,OAAO,EAAC,WAAW,EAAE,WAAW,EAA8C,WAAW,EAAE,eAAe,EAAC,MAAM,iBAAiB,CAAC;AACnI,OAAO,EAAC,QAAQ,EAAC,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EAAC,KAAK,EAAC,MAAM,0BAA0B,CAAC;AAE/C,MAAM,UAAU,GAAG,CAAC,GAAW,EAAE,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AAE/E,MAAM,SAAS,GAAG,ukBAAukB,CAAC;AAE1lB,MAAM,QAAQ,GACZ,s6BAAs6B,CAAC;AAEz6B;;GAEG;AAMH,MAAM,OAAO,8BAA8B;IAL3C;QAMU,uBAAkB,GAAG,IAAI,CAAC;QAKlC;;WAEG;QACK,aAAQ,GAAoB,eAAe,CAAC,UAAU,EAAE,CAAC;QAEjE;;WAEG;QACK,eAAU,GAAW,EAAE,CAAC;QAEhC;;WAEG;QACoB,cAAS,GAAW,EAAE,CAAC;QAE9C;;WAEG;QACK,aAAQ,GAAY,EAAE,CAAC;QAwBtB,UAAK,GAAY,KAAK,CAAC;QACvB,U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AG,IAAI,CAAC;gCAClB,IAAI,CAAC,cAAc,EAAE,CAAC;4BACxB,CAAC,GACD,CACE,CACP,CAAC,CACE,CACP;gBAED,WAAK,KAAK,EAAC,SAAS;oBAClB,cAAQ,KAAK,EAAC,eAAe,EAAC,QAAQ,EAAE,IAAI,CAAC,KAAK,EAAE,OAAO,EAAE,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,SAAS,GAAI;oBAChH,WAAK,KAAK,EAAE,EAAC,IAAI,EAAE,GAAG,EAAC,GAAI;oBAC3B,sBAAgB,IAAI,EAAC,OAAO,EAAC,OAAO,EAAC,SAAS,EAAC,KAAK,EAAC,QAAQ,EAAC,QAAQ,EAAE,CAAC,IAAI,CAAC,KAAK,EAAE,OAAO,EAAE,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,GAAI;oBAC3H,sBAAgB,IAAI,EAAC,OAAO,EAAC,KAAK,EAAC,MAAM,EAAC,QAAQ,EAAE,YAAY,IAAI,CAAC,IAAI,CAAC,QAAQ,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,YAAY,IAAI,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,GAAI,CAC5J,CACD,CACF,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import {Component, h, Element, Event, EventEmitter, Prop, State, Host} from '@stencil/core';\nimport {deleteField, getTemplate, type ITemplate, ITemplateField, TFieldType, updateField, VerdocsEndpoint} from '@verdocs/js-sdk';\nimport {SDKError} from '../../../utils/errors';\nimport {Store} from '../../../utils/Datastore';\n\nconst capitalize = (str: string) => str.charAt(0).toUpperCase() + str.slice(1);\n\nconst TrashIcon = `<svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke-width=\"1.5\" stroke=\"#a50021\"><path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M14.74 9l-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 01-2.244 2.077H8.084a2.25 2.25 0 01-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 00-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 013.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 00-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 00-7.5 0\" /></svg>`;\n\nconst HelpIcon =\n '<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" width=\"24\"><path d=\"M11.925 18q.55 0 .938-.387.387-.388.387-.938 0-.55-.387-.925-.388-.375-.938-.375-.55 0-.925.375t-.375.925q0 .55.375.938.375.387.925.387Zm-.95-3.85h1.95q0-.8.2-1.287.2-.488 1.025-1.288.65-.625 1.025-1.213.375-.587.375-1.437 0-1.425-1.025-2.175Q13.5 6 12.1 6q-1.425 0-2.35.775t-1.275 1.85l1.775.7q.125-.45.55-.975.425-.525 1.275-.525.725 0 1.1.412.375.413.375.888 0 .475-.287.9-.288.425-.713.775-1.075.95-1.325 1.475-.25.525-.25 1.875ZM12 22.2q-2.125 0-3.988-.8-1.862-.8-3.237-2.175Q3.4 17.85 2.6 15.988 1.8 14.125 1.8 12t.8-3.988q.8-1.862 2.175-3.237Q6.15 3.4 8.012 2.6 9.875 1.8 12 1.8t3.988.8q1.862.8 3.237 2.175Q20.6 6.15 21.4 8.012q.8 1.863.8 3.988t-.8 3.988q-.8 1.862-2.175 3.237Q17.85 20.6 15.988 21.4q-1.863.8-3.988.8Zm0-2.275q3.325 0 5.625-2.3t2.3-5.625q0-3.325-2.3-5.625T12 4.075q-3.325 0-5.625 2.3T4.075 12q0 3.325 2.3 5.625t5.625 2.3ZM12 12Z\"/></svg>';\n\n/**\n * Displays an edit form that allows the user to adjust a field's settings.\n */\n@Component({\n tag: 'verdocs-template-field-properties',\n styleUrl: 'verdocs-template-field-properties.scss',\n shadow: false,\n})\nexport class VerdocsTemplateFieldProperties {\n private templateListenerId = null;\n\n @Element()\n el: any;\n\n /**\n * The endpoint to use to communicate with Verdocs. If not set, the default endpoint will be used.\n */\n @Prop() endpoint: VerdocsEndpoint = VerdocsEndpoint.getDefault();\n\n /**\n * The template ID to edit.\n */\n @Prop() templateId: string = '';\n\n /**\n * The field to configure.\n */\n @Prop({mutable: true}) fieldName: string = '';\n\n /**\n * If specified, the properties card will have a \"back\" side with the help text as its content.\n */\n @Prop() helpText?: string = '';\n\n /**\n * Event fired when the user cancels the dialog.\n */\n @Event({composed: true}) close: EventEmitter;\n\n /**\n * Event fired when the user deletes the role. The parent should update its UI to reflect the removal. When this event is emitted,\n * the role will have already been deleted server-side.\n */\n @Event({composed: true}) delete: EventEmitter<{templateId: string; roleName: string}>;\n\n /**\n * Event fired when the field's settings are changed.\n */\n @Event({composed: true}) settingsChanged: EventEmitter<{fieldName: string; field: ITemplateField}>;\n\n /**\n * Event fired if an error occurs. The event details will contain information about the error. Most errors will\n * terminate the process, and the calling application should correct the condition and re-render the component.\n */\n @Event({composed: true}) sdkError: EventEmitter<SDKError>;\n\n @State() dirty: boolean = false;\n @State() label = '';\n @State() type = 'textbox' as TFieldType;\n @State() name = '';\n @State() required = false;\n @State() readonly = false;\n @State() roleName = '';\n @State() group = '';\n @State() fieldType = '';\n @State() options = [];\n @State() placeholder = '';\n @State() defaultValue = '';\n @State() showingHelp = false;\n\n @State() loading = true;\n @State() template: ITemplate | null = null;\n\n disconnectedCallback() {\n this.unlistenToTemplate();\n }\n\n async listenToTemplate() {\n this.unlistenToTemplate();\n Store.subscribe(\n 'templates',\n this.templateId,\n () => getTemplate(this.endpoint, this.templateId),\n false,\n (template: ITemplate) => {\n this.template = template;\n this.loading = false;\n this.resetForm();\n },\n );\n }\n\n unlistenToTemplate() {\n if (this.templateListenerId) {\n Store.store.delListener(this.templateListenerId);\n this.templateListenerId = null;\n }\n }\n\n async componentWillLoad() {\n try {\n this.endpoint.loadSession();\n\n if (!this.templateId) {\n console.log(`[FIELD PROPERTIES] Missing required template ID ${this.templateId}`);\n return;\n }\n\n if (!this.fieldName) {\n console.error(`[FIELD PROPERTIES] Missing required field name`);\n return;\n }\n\n if (!this.endpoint.session) {\n console.log('[FIELD PROPERTIES] Unable to start builder session, must be authenticated');\n return;\n }\n\n this.listenToTemplate();\n } catch (e) {\n console.log('[FIELD PROPERTIES] Error loading template', e);\n this.loading = false;\n this.sdkError?.emit(new SDKError(e.message, e.response?.status, e.response?.data));\n }\n }\n\n resetForm() {\n const field = (this.template?.fields || []).find(field => field.name === this.fieldName);\n if (!field) {\n console.log(`[FIELD PROPERTIES] Unable to find field \"${this.fieldName}\" in fields`);\n return;\n }\n\n this.type = field.type;\n this.name = field.name;\n this.label = field.label;\n this.group = field.group;\n this.roleName = field.role_name;\n this.required = field.required;\n this.readonly = field.readonly;\n this.fieldType = field.type;\n this.options = field.options || [];\n this.placeholder = field.placeholder || '';\n this.defaultValue = field.default || '';\n this.dirty = false;\n this.loading = false;\n this.cleanupOptions();\n }\n\n handleCancel(e: any) {\n e.stopPropagation();\n\n this.resetForm();\n this.close?.emit();\n document.getElementById('verdocs-template-field-properties')?.remove();\n }\n\n handleSave(e: any) {\n e.stopPropagation();\n const newProperties = {\n name: this.name,\n role_name: this.roleName,\n required: this.required,\n label: this.label,\n group: this.group,\n placeholder: this.placeholder,\n default: this.defaultValue,\n options: this.options,\n } as Partial<ITemplateField>;\n\n this.cleanupOptions();\n updateField(this.endpoint, this.templateId, this.fieldName, newProperties)\n .then(updatedField => {\n console.log('[FIELD PROPERTIES] Updated', updatedField);\n const newTemplate = JSON.parse(JSON.stringify(this.template));\n const fieldIndex = newTemplate.fields.findIndex(field => field.name === this.fieldName);\n if (fieldIndex > -1) {\n newTemplate.fields[fieldIndex] = updatedField;\n }\n Store.updateTemplate(this.templateId, newTemplate);\n this.settingsChanged?.emit({fieldName: this.fieldName, field: updatedField});\n this.close?.emit();\n\n document.getElementById('verdocs-template-field-properties')?.remove();\n })\n .catch(() => {\n console.log('[FIELD PROPERTIES] Update failed', e);\n });\n }\n\n async handleDelete(e: any) {\n e.stopPropagation();\n deleteField(this.endpoint, this.templateId, this.fieldName)\n .then(() => {\n const newTemplate = JSON.parse(JSON.stringify(this.template));\n newTemplate.fields = newTemplate.fields.filter(field => field.name !== this.fieldName);\n Store.updateTemplate(this.templateId, newTemplate);\n this.delete?.emit({templateId: this.templateId, roleName: this.roleName});\n document.getElementById('verdocs-template-field-properties')?.remove();\n })\n .catch(e => {\n console.log('[FIELD PROPERTIES] Deletion error', e);\n });\n }\n\n cleanupOptions() {\n this.options = [...this.options.filter(opt => (opt.id || '').trim() !== '' || (opt.label || '').trim() !== '')];\n if (!this.options.find(opt => !opt.id && !opt.label)) {\n this.options = [...this.options, {id: '', label: ''}];\n }\n }\n\n render() {\n if (this.loading) {\n return (\n <Host>\n <verdocs-loader />\n </Host>\n );\n }\n\n if (!this.endpoint.session) {\n return (\n <Host>\n <verdocs-component-error message=\"You must be authenticated to use this module.\" />\n </Host>\n );\n }\n\n // This is meant to be a companion for larger visual experiences so we just go blank on errors for now.\n if (!this.endpoint.session || !(this.template?.fields || []).some(field => field.name === this.fieldName)) {\n return <Host class=\"empty\" />;\n }\n\n if (this.helpText && this.showingHelp) {\n return (\n <Host>\n <h6>\n {capitalize(this.fieldType)} Settings <div style={{flex: '1'}} />\n <div class=\"help-icon\" innerHTML={HelpIcon} onClick={() => (this.showingHelp = false)} />\n </h6>\n\n <p class=\"instructions\" innerHTML={this.helpText} />\n </Host>\n );\n }\n\n const hasOptions = this.options.filter(opt => (opt.id || '').trim() !== '' || (opt.label || '').trim() !== '').length > 0;\n const saveDisabled = !this.dirty || (this.type === 'dropdown' && !hasOptions);\n\n return (\n <Host id=\"verdocs-template-field-properties\">\n <h6>\n {capitalize(this.fieldType.replace(/_/g, ' '))} Settings <div style={{flex: '1'}} />\n {this.helpText && <div class=\"help-icon\" innerHTML={HelpIcon} onClick={() => (this.showingHelp = true)} />}\n </h6>\n\n <form onSubmit={e => e.preventDefault()} onClick={e => e.stopPropagation()} autocomplete=\"off\">\n <div class=\"row\">\n <verdocs-text-input\n id=\"verdocs-field-name\"\n label=\"Field Name\"\n value={this.name}\n autocomplete=\"off\"\n // helpText=\"The internal name of the field. Must be unique, and contain only letters, numbers, and dashes. After an envelope is completed, the value entered by the signer will be tagged with this key.\"\n placeholder=\"Field Name...\"\n onInput={(e: any) => {\n this.name = e.target.value;\n this.dirty = true;\n }}\n />\n </div>\n\n <div class=\"row\">\n <verdocs-text-input\n id=\"verdocs-field-label\"\n label=\"Optional Label\"\n value={this.label}\n autocomplete=\"off\"\n placeholder=\"Optional Label...\"\n onInput={(e: any) => {\n this.label = e.target.value;\n this.dirty = true;\n }}\n />\n </div>\n\n <div class=\"row\">\n <div class=\"input-label\">Role:</div>\n <verdocs-select-input\n value={this.roleName}\n options={(this.template?.roles || []).map(role => ({label: role.name, value: role.name}))}\n onInput={(e: any) => {\n this.roleName = e.target.value;\n this.dirty = true;\n }}\n />\n </div>\n\n {['textbox', 'textarea'].includes(this.type) && (\n <div class=\"row\" style={{marginTop: '10px', marginBottom: '10px'}}>\n <verdocs-text-input\n id=\"verdocs-field-value\"\n label=\"Default Value\"\n value={this.defaultValue}\n autocomplete=\"off\"\n placeholder={this.readonly && !this.defaultValue ? 'Default value required' : 'Pre-filled value...'}\n onInput={(e: any) => {\n this.defaultValue = e.target.value;\n this.dirty = true;\n }}\n />\n </div>\n )}\n\n {this.type === 'radio' && (\n <div class=\"row\">\n <verdocs-text-input\n id=\"verdocs-field-label\"\n label=\"Group\"\n value={this.group}\n autocomplete=\"off\"\n helpText=\"Enable exclusive selections. Only one option within the same group may be selected at a time.\"\n placeholder=\"Group...\"\n onInput={(e: any) => {\n this.group = (e.target.value || '')\n .trim()\n .toLowerCase()\n .replace(/[^a-z0-9]/g, '');\n this.dirty = true;\n }}\n />\n </div>\n )}\n\n {['textbox', 'textarea'].includes(this.type) && (\n <div class=\"row\" style={{marginTop: '10px', marginBottom: '10px'}}>\n <verdocs-text-input\n id=\"verdocs-field-placeholder\"\n label=\"Placeholder\"\n value={this.placeholder}\n autocomplete=\"off\"\n placeholder=\"Placeholder...\"\n onInput={(e: any) => {\n this.placeholder = e.target.value;\n this.dirty = true;\n }}\n />\n </div>\n )}\n\n <div class=\"row\" style={{marginTop: '15px', marginBottom: '15px'}}>\n <label htmlFor=\"verdocs-is-required\" class=\"input-label\">\n Required\n </label>\n <verdocs-checkbox\n id=\"verdocs-is-required\"\n name=\"is-required\"\n checked={this.required}\n value=\"on\"\n onInput={(e: any) => {\n this.required = e.target.checked;\n this.dirty = true;\n }}\n />\n </div>\n\n <div class=\"row\" style={{marginTop: '15px', marginBottom: '15px'}}>\n <label htmlFor=\"verdocs-is-readonly\" class=\"input-label\">\n Read-only\n </label>\n <verdocs-checkbox\n id=\"verdocs-is-readonly\"\n name=\"is-readonly\"\n checked={this.readonly}\n value=\"on\"\n onInput={(e: any) => {\n this.readonly = e.target.checked;\n this.dirty = true;\n }}\n />\n </div>\n\n {this.type === 'dropdown' && (\n <div class=\"row\" style={{marginTop: '15px', marginBottom: '15px'}}>\n <label htmlFor=\"verdocs-is-required\" class=\"input-label\">\n Options\n </label>\n </div>\n )}\n\n {this.type === 'dropdown' && (\n <div class=\"options\">\n <div class=\"options-header\">\n <div class=\"options-header-label\">ID</div>\n <dev class=\"options-header-label\">Label</dev>\n </div>\n\n {this.options.map((option, index) => (\n <div class=\"row option-row\" key={index}>\n <verdocs-text-input\n value={option.id}\n placeholder=\"Unique ID\"\n onInput={(e: any) => {\n this.options[index].id = e.target.value;\n this.dirty = true;\n this.cleanupOptions();\n }}\n />\n <verdocs-text-input\n value={option.label}\n placeholder=\"Display label\"\n onInput={(e: any) => {\n this.options[index].label = e.target.value;\n this.dirty = true;\n this.cleanupOptions();\n }}\n />\n <button\n innerHTML={TrashIcon}\n class=\"remove-button\"\n onClick={() => {\n this.options = this.options.filter(opt => opt.id !== option.id);\n this.dirty = true;\n this.cleanupOptions();\n }}\n />\n </div>\n ))}\n </div>\n )}\n\n <div class=\"buttons\">\n <button class=\"delete-button\" disabled={this.dirty} onClick={e => this.handleDelete(e)} innerHTML={TrashIcon} />\n <div style={{flex: '1'}} />\n <verdocs-button size=\"small\" variant=\"outline\" label=\"Cancel\" disabled={!this.dirty} onClick={e => this.handleCancel(e)} />\n <verdocs-button size=\"small\" label=\"Save\" disabled={saveDisabled || (this.readonly && !this.defaultValue)} onClick={e => !saveDisabled && this.handleSave(e)} />\n </div>\n </form>\n </Host>\n );\n }\n}\n"]}
1
+ {"version":3,"file":"verdocs-template-field-properties.js","sourceRoot":"","sources":["../../../../src/components/templates/verdocs-template-field-properties/verdocs-template-field-properties.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,CAAC,EAAE,OAAO,EAAE,KAAK,EAAgB,IAAI,EAAE,KAAK,EAAE,IAAI,EAAC,MAAM,eAAe,CAAC;AAC5F,OAAO,EAAC,WAAW,EAAE,WAAW,EAA8C,WAAW,EAAE,eAAe,EAAC,MAAM,iBAAiB,CAAC;AACnI,OAAO,EAAC,QAAQ,EAAC,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EAAC,KAAK,EAAC,MAAM,0BAA0B,CAAC;AAE/C,MAAM,UAAU,GAAG,CAAC,GAAW,EAAE,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC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IAAI,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,GAAI,CAC5J,CACD,CACF,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import {Component, h, Element, Event, EventEmitter, Prop, State, Host} from '@stencil/core';\nimport {deleteField, getTemplate, type ITemplate, ITemplateField, TFieldType, updateField, VerdocsEndpoint} from '@verdocs/js-sdk';\nimport {SDKError} from '../../../utils/errors';\nimport {Store} from '../../../utils/Datastore';\n\nconst capitalize = (str: string) => str.charAt(0).toUpperCase() + str.slice(1);\n\nconst TrashIcon = `<svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke-width=\"1.5\" stroke=\"#a50021\"><path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M14.74 9l-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 01-2.244 2.077H8.084a2.25 2.25 0 01-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 00-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 013.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 00-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 00-7.5 0\" /></svg>`;\n\nconst HelpIcon =\n '<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" width=\"24\"><path d=\"M11.925 18q.55 0 .938-.387.387-.388.387-.938 0-.55-.387-.925-.388-.375-.938-.375-.55 0-.925.375t-.375.925q0 .55.375.938.375.387.925.387Zm-.95-3.85h1.95q0-.8.2-1.287.2-.488 1.025-1.288.65-.625 1.025-1.213.375-.587.375-1.437 0-1.425-1.025-2.175Q13.5 6 12.1 6q-1.425 0-2.35.775t-1.275 1.85l1.775.7q.125-.45.55-.975.425-.525 1.275-.525.725 0 1.1.412.375.413.375.888 0 .475-.287.9-.288.425-.713.775-1.075.95-1.325 1.475-.25.525-.25 1.875ZM12 22.2q-2.125 0-3.988-.8-1.862-.8-3.237-2.175Q3.4 17.85 2.6 15.988 1.8 14.125 1.8 12t.8-3.988q.8-1.862 2.175-3.237Q6.15 3.4 8.012 2.6 9.875 1.8 12 1.8t3.988.8q1.862.8 3.237 2.175Q20.6 6.15 21.4 8.012q.8 1.863.8 3.988t-.8 3.988q-.8 1.862-2.175 3.237Q17.85 20.6 15.988 21.4q-1.863.8-3.988.8Zm0-2.275q3.325 0 5.625-2.3t2.3-5.625q0-3.325-2.3-5.625T12 4.075q-3.325 0-5.625 2.3T4.075 12q0 3.325 2.3 5.625t5.625 2.3ZM12 12Z\"/></svg>';\n\n/**\n * Displays an edit form that allows the user to adjust a field's settings.\n */\n@Component({\n tag: 'verdocs-template-field-properties',\n styleUrl: 'verdocs-template-field-properties.scss',\n shadow: false,\n})\nexport class VerdocsTemplateFieldProperties {\n private templateListenerId = null;\n\n @Element()\n el: any;\n\n /**\n * The endpoint to use to communicate with Verdocs. If not set, the default endpoint will be used.\n */\n @Prop() endpoint: VerdocsEndpoint = VerdocsEndpoint.getDefault();\n\n /**\n * The template ID to edit.\n */\n @Prop() templateId: string = '';\n\n /**\n * The field to configure.\n */\n @Prop({mutable: true}) fieldName: string = '';\n\n /**\n * If specified, the properties card will have a \"back\" side with the help text as its content.\n */\n @Prop() helpText?: string = '';\n\n /**\n * Event fired when the user cancels the dialog.\n */\n @Event({composed: true}) close: EventEmitter;\n\n /**\n * Event fired when the user deletes the role. The parent should update its UI to reflect the removal. When this event is emitted,\n * the role will have already been deleted server-side.\n */\n @Event({composed: true}) delete: EventEmitter<{templateId: string; roleName: string}>;\n\n /**\n * Event fired when the field's settings are changed.\n */\n @Event({composed: true}) settingsChanged: EventEmitter<{fieldName: string; field: ITemplateField}>;\n\n /**\n * Event fired if an error occurs. The event details will contain information about the error. Most errors will\n * terminate the process, and the calling application should correct the condition and re-render the component.\n */\n @Event({composed: true}) sdkError: EventEmitter<SDKError>;\n\n @State() dirty: boolean = false;\n @State() label = '';\n @State() type = 'textbox' as TFieldType;\n @State() name = '';\n @State() required = false;\n @State() readonly = false;\n @State() roleName = '';\n @State() group = '';\n @State() fieldType = '';\n @State() options = [];\n @State() placeholder = '';\n @State() defaultValue = '';\n @State() showingHelp = false;\n\n @State() loading = true;\n @State() template: ITemplate | null = null;\n\n disconnectedCallback() {\n this.unlistenToTemplate();\n }\n\n async listenToTemplate() {\n this.unlistenToTemplate();\n Store.subscribe(\n 'templates',\n this.templateId,\n () => getTemplate(this.endpoint, this.templateId),\n false,\n (template: ITemplate) => {\n this.template = template;\n this.loading = false;\n this.resetForm();\n },\n );\n }\n\n unlistenToTemplate() {\n if (this.templateListenerId) {\n Store.store.delListener(this.templateListenerId);\n this.templateListenerId = null;\n }\n }\n\n async componentWillLoad() {\n try {\n this.endpoint.loadSession();\n\n if (!this.templateId) {\n console.log(`[FIELD PROPERTIES] Missing required template ID ${this.templateId}`);\n return;\n }\n\n if (!this.fieldName) {\n console.error(`[FIELD PROPERTIES] Missing required field name`);\n return;\n }\n\n if (!this.endpoint.session) {\n console.log('[FIELD PROPERTIES] Unable to start builder session, must be authenticated');\n return;\n }\n\n this.listenToTemplate();\n } catch (e) {\n console.log('[FIELD PROPERTIES] Error loading template', e);\n this.loading = false;\n this.sdkError?.emit(new SDKError(e.message, e.response?.status, e.response?.data));\n }\n }\n\n resetForm() {\n const field = (this.template?.fields || []).find(field => field.name === this.fieldName);\n if (!field) {\n console.log(`[FIELD PROPERTIES] Unable to find field \"${this.fieldName}\" in fields`);\n return;\n }\n\n this.type = field.type;\n this.name = field.name;\n this.label = field.label;\n this.group = field.group;\n this.roleName = field.role_name;\n this.required = field.required;\n this.readonly = field.readonly;\n this.fieldType = field.type;\n this.options = field.options || [];\n this.placeholder = field.placeholder || '';\n this.defaultValue = field.default || '';\n this.dirty = false;\n this.loading = false;\n this.cleanupOptions();\n }\n\n handleCancel(e: any) {\n e.stopPropagation();\n\n this.resetForm();\n this.close?.emit();\n document.getElementById('verdocs-template-field-properties')?.remove();\n }\n\n handleSave(e: any) {\n e.stopPropagation();\n const newProperties = {\n name: this.name,\n role_name: this.roleName,\n required: this.required,\n readonly: this.readonly,\n label: this.label,\n group: this.group,\n placeholder: this.placeholder,\n default: this.defaultValue,\n options: this.options,\n } as Partial<ITemplateField>;\n\n this.cleanupOptions();\n updateField(this.endpoint, this.templateId, this.fieldName, newProperties)\n .then(updatedField => {\n console.log('[FIELD PROPERTIES] Updated', updatedField);\n const newTemplate = JSON.parse(JSON.stringify(this.template));\n const fieldIndex = newTemplate.fields.findIndex(field => field.name === this.fieldName);\n if (fieldIndex > -1) {\n newTemplate.fields[fieldIndex] = updatedField;\n }\n Store.updateTemplate(this.templateId, newTemplate);\n this.settingsChanged?.emit({fieldName: this.fieldName, field: updatedField});\n this.close?.emit();\n\n document.getElementById('verdocs-template-field-properties')?.remove();\n })\n .catch(() => {\n console.log('[FIELD PROPERTIES] Update failed', e);\n });\n }\n\n async handleDelete(e: any) {\n e.stopPropagation();\n deleteField(this.endpoint, this.templateId, this.fieldName)\n .then(() => {\n const newTemplate = JSON.parse(JSON.stringify(this.template));\n newTemplate.fields = newTemplate.fields.filter(field => field.name !== this.fieldName);\n Store.updateTemplate(this.templateId, newTemplate);\n this.delete?.emit({templateId: this.templateId, roleName: this.roleName});\n document.getElementById('verdocs-template-field-properties')?.remove();\n })\n .catch(e => {\n console.log('[FIELD PROPERTIES] Deletion error', e);\n });\n }\n\n cleanupOptions() {\n this.options = [...this.options.filter(opt => (opt.id || '').trim() !== '' || (opt.label || '').trim() !== '')];\n if (!this.options.find(opt => !opt.id && !opt.label)) {\n this.options = [...this.options, {id: '', label: ''}];\n }\n }\n\n render() {\n if (this.loading) {\n return (\n <Host>\n <verdocs-loader />\n </Host>\n );\n }\n\n if (!this.endpoint.session) {\n return (\n <Host>\n <verdocs-component-error message=\"You must be authenticated to use this module.\" />\n </Host>\n );\n }\n\n // This is meant to be a companion for larger visual experiences so we just go blank on errors for now.\n if (!this.endpoint.session || !(this.template?.fields || []).some(field => field.name === this.fieldName)) {\n return <Host class=\"empty\" />;\n }\n\n if (this.helpText && this.showingHelp) {\n return (\n <Host>\n <h6>\n {capitalize(this.fieldType)} Settings <div style={{flex: '1'}} />\n <div class=\"help-icon\" innerHTML={HelpIcon} onClick={() => (this.showingHelp = false)} />\n </h6>\n\n <p class=\"instructions\" innerHTML={this.helpText} />\n </Host>\n );\n }\n\n const hasOptions = this.options.filter(opt => (opt.id || '').trim() !== '' || (opt.label || '').trim() !== '').length > 0;\n const saveDisabled = !this.dirty || (this.type === 'dropdown' && !hasOptions);\n\n return (\n <Host id=\"verdocs-template-field-properties\">\n <h6>\n {capitalize(this.fieldType.replace(/_/g, ' '))} Settings <div style={{flex: '1'}} />\n {this.helpText && <div class=\"help-icon\" innerHTML={HelpIcon} onClick={() => (this.showingHelp = true)} />}\n </h6>\n\n <form onSubmit={e => e.preventDefault()} onClick={e => e.stopPropagation()} autocomplete=\"off\">\n <div class=\"row\">\n <verdocs-text-input\n id=\"verdocs-field-name\"\n label=\"Field Name\"\n value={this.name}\n autocomplete=\"off\"\n // helpText=\"The internal name of the field. Must be unique, and contain only letters, numbers, and dashes. After an envelope is completed, the value entered by the signer will be tagged with this key.\"\n placeholder=\"Field Name...\"\n onInput={(e: any) => {\n this.name = e.target.value;\n this.dirty = true;\n }}\n />\n </div>\n\n <div class=\"row\">\n <verdocs-text-input\n id=\"verdocs-field-label\"\n label=\"Optional Label\"\n value={this.label}\n autocomplete=\"off\"\n placeholder=\"Optional Label...\"\n onInput={(e: any) => {\n this.label = e.target.value;\n this.dirty = true;\n }}\n />\n </div>\n\n <div class=\"row\">\n <div class=\"input-label\">Role:</div>\n <verdocs-select-input\n value={this.roleName}\n options={(this.template?.roles || []).map(role => ({label: role.name, value: role.name}))}\n onInput={(e: any) => {\n this.roleName = e.target.value;\n this.dirty = true;\n }}\n />\n </div>\n\n {['textbox', 'textarea'].includes(this.type) && (\n <div class=\"row\" style={{marginTop: '10px', marginBottom: '10px'}}>\n <verdocs-text-input\n id=\"verdocs-field-value\"\n label=\"Default Value\"\n value={this.defaultValue}\n autocomplete=\"off\"\n placeholder={this.readonly && !this.defaultValue ? 'Default value required' : 'Pre-filled value...'}\n onInput={(e: any) => {\n this.defaultValue = e.target.value;\n this.dirty = true;\n }}\n />\n </div>\n )}\n\n {this.type === 'radio' && (\n <div class=\"row\">\n <verdocs-text-input\n id=\"verdocs-field-label\"\n label=\"Group\"\n value={this.group}\n autocomplete=\"off\"\n helpText=\"Enable exclusive selections. Only one option within the same group may be selected at a time.\"\n placeholder=\"Group...\"\n onInput={(e: any) => {\n this.group = (e.target.value || '')\n .trim()\n .toLowerCase()\n .replace(/[^a-z0-9]/g, '');\n this.dirty = true;\n }}\n />\n </div>\n )}\n\n {['textbox', 'textarea'].includes(this.type) && (\n <div class=\"row\" style={{marginTop: '10px', marginBottom: '10px'}}>\n <verdocs-text-input\n id=\"verdocs-field-placeholder\"\n label=\"Placeholder\"\n value={this.placeholder}\n autocomplete=\"off\"\n placeholder=\"Placeholder...\"\n onInput={(e: any) => {\n this.placeholder = e.target.value;\n this.dirty = true;\n }}\n />\n </div>\n )}\n\n <div class=\"row\" style={{marginTop: '15px', marginBottom: '15px'}}>\n <label htmlFor=\"verdocs-is-required\" class=\"input-label\">\n Required\n </label>\n <verdocs-checkbox\n id=\"verdocs-is-required\"\n name=\"is-required\"\n checked={this.required}\n value=\"on\"\n onInput={(e: any) => {\n this.required = e.target.checked;\n this.dirty = true;\n }}\n />\n </div>\n\n <div class=\"row\" style={{marginTop: '15px', marginBottom: '15px'}}>\n <label htmlFor=\"verdocs-is-readonly\" class=\"input-label\">\n Read-only\n </label>\n <verdocs-checkbox\n id=\"verdocs-is-readonly\"\n name=\"is-readonly\"\n checked={this.readonly}\n value=\"on\"\n onInput={(e: any) => {\n this.readonly = e.target.checked;\n this.dirty = true;\n }}\n />\n </div>\n\n {this.type === 'dropdown' && (\n <div class=\"row\" style={{marginTop: '15px', marginBottom: '15px'}}>\n <label htmlFor=\"verdocs-is-required\" class=\"input-label\">\n Options\n </label>\n </div>\n )}\n\n {this.type === 'dropdown' && (\n <div class=\"options\">\n <div class=\"options-header\">\n <div class=\"options-header-label\">ID</div>\n <dev class=\"options-header-label\">Label</dev>\n </div>\n\n {this.options.map((option, index) => (\n <div class=\"row option-row\" key={index}>\n <verdocs-text-input\n value={option.id}\n placeholder=\"Unique ID\"\n onInput={(e: any) => {\n this.options[index].id = e.target.value;\n this.dirty = true;\n this.cleanupOptions();\n }}\n />\n <verdocs-text-input\n value={option.label}\n placeholder=\"Display label\"\n onInput={(e: any) => {\n this.options[index].label = e.target.value;\n this.dirty = true;\n this.cleanupOptions();\n }}\n />\n <button\n innerHTML={TrashIcon}\n class=\"remove-button\"\n onClick={() => {\n this.options = this.options.filter(opt => opt.id !== option.id);\n this.dirty = true;\n this.cleanupOptions();\n }}\n />\n </div>\n ))}\n </div>\n )}\n\n <div class=\"buttons\">\n <button class=\"delete-button\" disabled={this.dirty} onClick={e => this.handleDelete(e)} innerHTML={TrashIcon} />\n <div style={{flex: '1'}} />\n <verdocs-button size=\"small\" variant=\"outline\" label=\"Cancel\" disabled={!this.dirty} onClick={e => this.handleCancel(e)} />\n <verdocs-button size=\"small\" label=\"Save\" disabled={saveDisabled || (this.readonly && !this.defaultValue)} onClick={e => !saveDisabled && this.handleSave(e)} />\n </div>\n </form>\n </Host>\n );\n }\n}\n"]}
@@ -12,7 +12,7 @@ import { d as defineCustomElement$6 } from './p-D_QT5uZk.js';
12
12
  import { d as defineCustomElement$5 } from './p-C3iwT41e.js';
13
13
  import { d as defineCustomElement$4 } from './p-kvTSiSQ0.js';
14
14
  import { d as defineCustomElement$3 } from './p-LeCnrgBv.js';
15
- import { d as defineCustomElement$2 } from './p-TkHAxPB_.js';
15
+ import { d as defineCustomElement$2 } from './p-Da1nfhXq.js';
16
16
  import { d as defineCustomElement$1 } from './p-BvDqCFDj.js';
17
17
 
18
18
  const verdocsFieldSignatureCss = "@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-field-signature{font-family:\"Inter\", -apple-system, \"Segoe UI\", \"Roboto\", \"Helvetica Neue\", sans-serif;width:83px;height:36px;display:block;font-size:11px;position:relative;scroll-margin:20px 0;letter-spacing:0.3px;background-color:transparent;-webkit-transform-origin:bottom left;transform-origin:bottom left;border:1px solid rgba(0, 0, 0, 0.2)}verdocs-field-signature label{top:-14px;left:-1px;height:14px;color:white;padding:0 4px;font-size:9px;line-height:13px;position:absolute;background:#4a4a99;border-top-left-radius:2px;border-top-right-radius:2px}verdocs-field-signature.done{border:none;opacity:1}verdocs-field-signature img{display:block;max-width:100%;max-height:100%}verdocs-field-signature.disabled img{opacity:0.5}verdocs-field-signature button{cursor:inherit;-webkit-box-sizing:border-box;box-sizing:border-box;border:none;color:rgba(0, 0, 0, 0.87);font-weight:500;-webkit-transform-origin:0 0;transform-origin:0 0;height:100%;width:100%;background:none;font-size:11px}verdocs-field-signature button.hide{display:none}verdocs-field-signature.required{border:1px solid rgb(204, 0, 0)}verdocs-field-signature.focused{-webkit-animation:verdocs-field-pulse 0.4s 1;animation:verdocs-field-pulse 0.4s 1}verdocs-field-signature verdocs-button-panel{top:-3px;left:-2px;opacity:0.5;z-index:1000;cursor:pointer;position:absolute;-webkit-transform:scale(0.6);transform:scale(0.6)}verdocs-field-signature verdocs-button-panel[data-active],verdocs-field-signature verdocs-button-panel:hover{opacity:1}verdocs-field-signature verdocs-button-panel .icon svg{fill:#333333}verdocs-field-signature verdocs-button-panel .icon:hover svg{fill:#000000}verdocs-field-signature .settings-icon{position:absolute;top:-3px;left:-20px;display:inline-block;cursor:pointer;opacity:0.3}verdocs-field-signature .settings-icon svg{fill:#707ae5}verdocs-field-signature .settings-icon:hover{opacity:1}verdocs-field-signature .edge-top,verdocs-field-signature .edge-right,verdocs-field-signature .edge-left,verdocs-field-signature .edge-bottom{position:absolute;z-index:10}verdocs-field-signature .edge-top{top:-2px;left:0;right:0;height:5px}verdocs-field-signature .edge-right{top:0;bottom:0;right:-2px;width:5px}verdocs-field-signature .edge-left{top:0;left:-2px;bottom:0;width:5px}verdocs-field-signature .edge-bottom{bottom:-2px;left:0;right:0;height:5px}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}";
@@ -303,6 +303,6 @@ function defineCustomElement() {
303
303
  }
304
304
 
305
305
  export { VerdocsFieldSignature as V, defineCustomElement as d };
306
- //# sourceMappingURL=p-L3HpKTaM.js.map
306
+ //# sourceMappingURL=p-BJqJsTbt.js.map
307
307
 
308
- //# sourceMappingURL=p-L3HpKTaM.js.map
308
+ //# sourceMappingURL=p-BJqJsTbt.js.map
@@ -1 +1 @@
1
- {"file":"p-L3HpKTaM.js","mappings":";;;;;;;;;;;;;;;;;AAAA,MAAM,wBAAwB,GAAG,swFAAswF;;MCqB1xF,qBAAqB,iBAAAA,kBAAA,CAAA,MAAA,qBAAA,SAAAC,CAAA,CAAA;AALlC,IAAA,WAAA,CAAA,YAAA,EAAA;;;;;;;;;AAQE;;AAEG;AACoB,QAAA,IAAM,CAAA,MAAA,GAA4B,UAAU;AAEnE;;AAEG;AACoB,QAAA,IAAQ,CAAA,QAAA,GAAW,EAAE;AAE5C;;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,EAAE,QAAQ,EACpB,SAAS,EAAE,SAAS,EACpB,OAAO,EAAE,MAAM,IAAI,CAAC,iBAAiB,EAAE,EACvC,QAAQ,EAAE,MAAK;;AACb,gBAAA,CAAA,EAAA,GAAA,IAAI,CAAC,OAAO,MAAA,IAAA,IAAA,EAAA,KAAA,MAAA,GAAA,MAAA,GAAA,EAAA,CAAE,IAAI,CAAC,EAAC,SAAS,EAAE,SAAS,EAAC,CAAC;AAC1C,gBAAA,OAAO,IAAI,CAAC,iBAAiB,EAAE;AACjC,aAAC,EACD,iBAAiB,EAAE,CAAC,IAAG;;AACrB,gBAAA,CAAA,EAAA,GAAA,IAAI,CAAC,eAAe,MAAE,IAAA,IAAA,EAAA,KAAA,MAAA,GAAA,MAAA,GAAA,EAAA,CAAA,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC;AACpC,gBAAA,OAAO,IAAI,CAAC,iBAAiB,EAAE;AACjC,aAAC,EACD,QAAQ,EAAE,iEAAiE,EAAA,CAC3E,CACa,CAClB,CACQ,CACZ,CACI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["__stencil_proxyCustomElement","HTMLElement"],"sources":["src/components/fields/verdocs-field-signature/verdocs-field-signature.scss?tag=verdocs-field-signature","src/components/fields/verdocs-field-signature/verdocs-field-signature.tsx"],"sourcesContent":["@import '../../../theme.scss';\n\nverdocs-field-signature {\n font-family: $verdocs-primary-font;\n width: 83px;\n height: 36px;\n display: block;\n font-size: 11px;\n position: relative;\n scroll-margin: 20px 0;\n letter-spacing: 0.3px;\n background-color: transparent;\n transform-origin: bottom left;\n border: 1px solid rgba(0, 0, 0, 0.2);\n\n label {\n top: -14px;\n left: -1px;\n height: 14px;\n color: white;\n padding: 0 4px;\n font-size: 9px;\n line-height: 13px;\n position: absolute;\n background: #4a4a99;\n border-top-left-radius: 2px;\n border-top-right-radius: 2px;\n }\n\n &.done {\n border: none;\n opacity: 1;\n }\n\n img {\n display: block;\n max-width: 100%;\n max-height: 100%;\n }\n\n &.disabled img {\n opacity: 0.5;\n }\n\n button {\n // This is needed to bring down the cursor from the parent element, which is where interactjs applies it\n cursor: inherit;\n\n box-sizing: border-box;\n border: none;\n color: rgba(0, 0, 0, 0.87);\n font-weight: 500;\n transform-origin: 0 0;\n height: 100%;\n width: 100%;\n background: none;\n font-size: 11px;\n\n &.hide {\n display: none;\n }\n }\n\n &.required {\n border: 1px solid rgb(204, 0, 0);\n }\n\n &.focused {\n animation: verdocs-field-pulse 0.4s 1;\n }\n\n verdocs-button-panel {\n top: -3px;\n left: -2px;\n opacity: 0.5;\n z-index: 1000;\n cursor: pointer;\n position: absolute;\n transform: scale(0.6);\n\n &[data-active],\n &:hover {\n opacity: 1;\n }\n\n .icon {\n svg {\n fill: #333333;\n }\n\n &:hover {\n svg {\n fill: #000000;\n }\n }\n }\n }\n\n .settings-icon {\n position: absolute;\n top: -3px;\n left: -20px;\n display: inline-block;\n cursor: pointer;\n opacity: 0.3;\n\n svg {\n fill: $border-color;\n }\n\n &:hover {\n opacity: 1;\n }\n }\n\n .edge-top,\n .edge-right,\n .edge-left,\n .edge-bottom {\n position: absolute;\n z-index: 10;\n }\n\n .edge-top {\n top: -2px;\n left: 0;\n right: 0;\n height: 5px;\n }\n\n .edge-right {\n top: 0;\n bottom: 0;\n right: -2px;\n width: 5px;\n }\n\n .edge-left {\n top: 0;\n left: -2px;\n bottom: 0;\n width: 5px;\n }\n\n .edge-bottom {\n bottom: -2px;\n left: 0;\n right: 0;\n height: 5px;\n }\n}\n\n@keyframes verdocs-field-pulse {\n 0% {\n background-color: rgba(0, 0, 0, 0.35);\n }\n 50% {\n background-color: rgba(0, 0, 0, 0);\n }\n 100% {\n background-color: rgba(0, 0, 0, 0.35);\n }\n}\n","import interact from 'interactjs';\nimport {ITemplateField, getRGBA, IEnvelopeField, VerdocsEndpoint, updateField, ITemplate} from '@verdocs/js-sdk';\nimport {Component, h, Host, Prop, Event, EventEmitter, Method, Fragment, State, Element} from '@stencil/core';\nimport {SettingsIcon} from '../../../utils/Icons';\nimport {Store} from '../../../utils/Datastore';\nimport {ResizeEvent} from '@interactjs/actions/resize/plugin';\n\n/**\n * Displays a signature field. If a signature already exists, it will be displayed and the field\n * will be disabled. Otherwise, a placeholder button will be shown. Clicking the button will\n * show a dialog to adopt a signature.\n *\n * NOTE: When signature fields are completed they will be filled with a signature \"stamp\".\n * This requires operation against a live, valid envelope. If you are testing this component\n * in Storybook, it will not be visible here.\n */\n@Component({\n tag: 'verdocs-field-signature',\n styleUrl: 'verdocs-field-signature.scss',\n shadow: false,\n})\nexport class VerdocsFieldSignature {\n @Element() el: HTMLElement;\n\n /**\n * Fields may be attached to templates or envelopes, but only template fields may be edited.\n */\n @Prop({reflect: true}) source: 'template' | 'envelope' = 'template';\n\n /**\n * The source template or envelope ID the field is found in.\n */\n @Prop({reflect: true}) sourceid: string = '';\n\n /**\n * The name of the field to display.\n */\n @Prop({reflect: true}) fieldname: string = '';\n\n /**\n * Override the field's settings. This is intended to be used during signing when fields are being\n * mutated.\n */\n @Prop() field: IEnvelopeField | null | undefined = null;\n\n /**\n * If set, the signature creation dialog will be initialized with this text.\n */\n @Prop({reflect: true}) name?: string = '';\n\n /**\n * If set, overrides the field's settings object. Primarily used to support \"preview\" modes where all fields are disabled.\n */\n @Prop({reflect: true}) disabled?: boolean = false;\n\n /**\n * If set, a settings icon will be displayed on hover. The settings shown allow the field's recipient and other settings to be\n * changed, so it should typically only be enabled in the Builder.\n */\n @Prop({reflect: true}) editable?: boolean = false;\n\n /**\n * If set, the field may be dragged to a new location. This should only be enabled in the Builder, or for self-placed fields.\n */\n @Prop({reflect: true}) moveable?: boolean = false;\n\n /**\n * If set, the field is considered \"done\" and is drawn in a display-final-value state.\n */\n @Prop({reflect: true}) done?: boolean = false;\n\n /**\n * If set, the field will be be scaled horizontally by this factor.\n */\n @Prop({reflect: true}) xscale?: number = 1;\n\n /**\n * If set, the field will be be scaled vertically by this factor.\n */\n @Prop({reflect: true}) yscale?: number = 1;\n\n /**\n * The page the field is on\n */\n @Prop({reflect: true}) pagenumber?: number = 1;\n\n /**\n * Event emitted when the field has changed.\n */\n @Event({composed: true}) fieldChange: EventEmitter<string>;\n\n /**\n * Event fired on every character entered into / deleted from the field.\n */\n @Event({composed: true}) settingsPress: EventEmitter;\n\n /**\n * Event fired when the field's settings are changed.\n */\n @Event({composed: true}) settingsChanged: EventEmitter<{fieldName: string; field: ITemplateField}>;\n\n /**\n * Event fired when the field is deleted.\n */\n @Event({composed: true}) deleted: EventEmitter<{fieldName: string}>;\n\n @State() showingProperties?: boolean = false;\n @State() focused?: boolean = false;\n\n @Method() async focusField() {\n this.handleShow();\n }\n\n @State()\n tempSignature: string = '';\n\n private dialog?: any;\n\n componentDidRender() {\n interact.dynamicDrop(true);\n\n if (this.editable) {\n interact(this.el).resizable({\n edges: {\n top: '.edge-top',\n left: '.edge-left',\n bottom: '.edge-bottom',\n right: '.edge-right',\n },\n modifiers: [\n interact.modifiers.restrictSize({\n min: {width: 71, height: 36},\n }),\n ],\n listeners: {\n start: this.handleResizeStart.bind(this),\n move: this.handleResize.bind(this),\n end: this.handleResizeEnd.bind(this),\n },\n });\n }\n }\n\n handleResizeStart(e: ResizeEvent) {\n e.preventDefault();\n e.stopPropagation();\n e.target.dataset.originalBottom = e.target.style.bottom;\n }\n\n handleResize(e: any) {\n let {width, height} = e.rect;\n\n const dX = e.deltaRect.left;\n const dY = e.deltaRect.bottom;\n const currentLeft = parseFloat(e.target.style.left);\n const currentBottom = parseFloat(e.target.style.bottom);\n\n width /= this.xscale;\n height /= this.yscale;\n\n Object.assign(e.target.style, {\n width: `${width}px`,\n height: `${height}px`,\n left: `${currentLeft + dX}px`,\n bottom: `${currentBottom - dY}px`,\n });\n }\n\n async handleResizeEnd(e: any) {\n const {sourceid, fieldname} = this;\n\n const width = Math.round(parseFloat(e.target.style.width));\n let height = Math.round(parseFloat(e.target.style.height));\n if (height < 20) {\n height = 15;\n }\n\n const newBottom = parseFloat(e.target.style.bottom);\n const originalBottom = parseFloat(e.target.dataset.originalBottom);\n const template = await Store.getTemplate(VerdocsEndpoint.getDefault(), this.sourceid);\n const oldField = template.fields.find(f => f.name === fieldname);\n const y = newBottom !== originalBottom ? newBottom / this.yscale : oldField?.y;\n\n updateField(VerdocsEndpoint.getDefault(), sourceid, fieldname, {width, height, y})\n .then(async updatedField => {\n const template = await Store.getTemplate(VerdocsEndpoint.getDefault(), this.sourceid);\n const newTemplate = JSON.parse(JSON.stringify(template)) as ITemplate;\n const fieldIndex = newTemplate.fields.findIndex(field => field.name === fieldname);\n if (fieldIndex > -1) {\n newTemplate.fields[fieldIndex] = updatedField;\n }\n Store.updateTemplate(this.sourceid, newTemplate);\n\n this.settingsChanged?.emit({fieldName: fieldname, field: updatedField});\n Object.assign(e.target.dataset, {x: 0, y: 0, h: 0});\n })\n .catch(e => console.log('Field update failed', e));\n }\n\n hideDialog() {\n this.dialog?.remove();\n this.dialog = null;\n this.focused = false;\n }\n\n handleAdopt(e: any) {\n console.log('[SIGNATURE] Adopted signature');\n this.tempSignature = e.detail;\n this.fieldChange?.emit(this.tempSignature);\n this.hideDialog();\n }\n\n handleShow() {\n this.dialog = document.createElement('verdocs-signature-dialog');\n this.dialog.setAttribute('name', this.name);\n // this.dialog.setAttribute('roleindex', this.roleindex);\n this.dialog.addEventListener('exit', () => this.hideDialog());\n this.dialog.addEventListener('next', (e: any) => this.handleAdopt(e));\n document.body.append(this.dialog);\n this.focused = true;\n }\n\n @Method()\n async showSettingsPanel() {\n const settingsPanel = document.getElementById(`verdocs-settings-panel-${this.fieldname}`) as any;\n if (settingsPanel && settingsPanel.showPanel) {\n settingsPanel.showPanel();\n }\n }\n\n @Method()\n async hideSettingsPanel() {\n const settingsPanel = document.getElementById(`verdocs-settings-panel-${this.fieldname}`) as any;\n if (settingsPanel && settingsPanel.hidePanel) {\n settingsPanel.hidePanel();\n }\n this.showingProperties = false;\n }\n\n render() {\n const {source, sourceid, fieldname, editable = false, done = false, disabled = false, focused, xscale = 1, yscale = 1} = this;\n\n const {index, field} = Store.getField(source, sourceid, fieldname, this.field);\n const {required = false, value = '', label = '', settings = {}} = field || {};\n const {base64} = settings;\n const backgroundColor = getRGBA(index);\n\n if (done) {\n return <Host class={{done}}>{value && <img src={base64} alt=\"\" />}</Host>;\n }\n\n return (\n <Host class={{required, disabled, done, focused}} style={{backgroundColor}}>\n {editable && <div class=\"edge-right\" />}\n {editable && <div class=\"edge-left\" />}\n {editable && <div class=\"edge-top\" />}\n {editable && <div class=\"edge-bottom\" />}\n\n {label && <label>{label}</label>}\n\n {base64 ? <img src={base64} alt=\"\" /> : <button onClick={() => !disabled && this.handleShow()}>Signature</button>}\n\n {editable && (\n <Fragment>\n <div\n id={`verdocs-settings-panel-trigger-${fieldname}`}\n style={{transform: `scale(${Math.floor((1 / xscale) * 1000) / 1000}, ${Math.floor((1 / yscale) * 1000) / 1000})`}}\n class=\"settings-icon\"\n innerHTML={SettingsIcon}\n onClick={(e: any) => {\n e.stopPropagation();\n this.showingProperties = !this.showingProperties;\n }}\n />\n\n {this.showingProperties && (\n <verdocs-portal anchor={`verdocs-settings-panel-trigger-${fieldname}`} onClickAway={() => (this.showingProperties = false)}>\n <verdocs-template-field-properties\n templateId={sourceid}\n fieldName={fieldname}\n onClose={() => this.hideSettingsPanel()}\n onDelete={() => {\n this.deleted?.emit({fieldName: fieldname});\n return this.hideSettingsPanel();\n }}\n onSettingsChanged={e => {\n this.settingsChanged?.emit(e.detail);\n return this.hideSettingsPanel();\n }}\n helpText={\"Signature fields capture a recipient's signature on a document.\"}\n />\n </verdocs-portal>\n )}\n </Fragment>\n )}\n </Host>\n );\n }\n}\n"],"version":3}
1
+ {"file":"p-BJqJsTbt.js","mappings":";;;;;;;;;;;;;;;;;AAAA,MAAM,wBAAwB,GAAG,swFAAswF;;MCqB1xF,qBAAqB,iBAAAA,kBAAA,CAAA,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,EAED,IAAI,CAAC,iBAAiB,KACrB,sBAAgB,MAAM,EAAE,CAAkC,+BAAA,EAAA,SAAS,CAAE,CAAA,EAAE,WAAW,EAAE,OAAO,IAAI,CAAC,iBAAiB,GAAG,KAAK,CAAC,EAAA,EACxH,CACE,CAAA,mCAAA,EAAA,EAAA,UAAU,EAAE,QAAQ,EACpB,SAAS,EAAE,SAAS,EACpB,OAAO,EAAE,MAAM,IAAI,CAAC,iBAAiB,EAAE,EACvC,QAAQ,EAAE,MAAK;;AACb,gBAAA,CAAA,EAAA,GAAA,IAAI,CAAC,OAAO,MAAA,IAAA,IAAA,EAAA,KAAA,MAAA,GAAA,MAAA,GAAA,EAAA,CAAE,IAAI,CAAC,EAAC,SAAS,EAAE,SAAS,EAAC,CAAC;AAC1C,gBAAA,OAAO,IAAI,CAAC,iBAAiB,EAAE;AACjC,aAAC,EACD,iBAAiB,EAAE,CAAC,IAAG;;AACrB,gBAAA,CAAA,EAAA,GAAA,IAAI,CAAC,eAAe,MAAE,IAAA,IAAA,EAAA,KAAA,MAAA,GAAA,MAAA,GAAA,EAAA,CAAA,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC;AACpC,gBAAA,OAAO,IAAI,CAAC,iBAAiB,EAAE;AACjC,aAAC,EACD,QAAQ,EAAE,iEAAiE,EAAA,CAC3E,CACa,CAClB,CACQ,CACZ,CACI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["__stencil_proxyCustomElement","HTMLElement"],"sources":["src/components/fields/verdocs-field-signature/verdocs-field-signature.scss?tag=verdocs-field-signature","src/components/fields/verdocs-field-signature/verdocs-field-signature.tsx"],"sourcesContent":["@import '../../../theme.scss';\n\nverdocs-field-signature {\n font-family: $verdocs-primary-font;\n width: 83px;\n height: 36px;\n display: block;\n font-size: 11px;\n position: relative;\n scroll-margin: 20px 0;\n letter-spacing: 0.3px;\n background-color: transparent;\n transform-origin: bottom left;\n border: 1px solid rgba(0, 0, 0, 0.2);\n\n label {\n top: -14px;\n left: -1px;\n height: 14px;\n color: white;\n padding: 0 4px;\n font-size: 9px;\n line-height: 13px;\n position: absolute;\n background: #4a4a99;\n border-top-left-radius: 2px;\n border-top-right-radius: 2px;\n }\n\n &.done {\n border: none;\n opacity: 1;\n }\n\n img {\n display: block;\n max-width: 100%;\n max-height: 100%;\n }\n\n &.disabled img {\n opacity: 0.5;\n }\n\n button {\n // This is needed to bring down the cursor from the parent element, which is where interactjs applies it\n cursor: inherit;\n\n box-sizing: border-box;\n border: none;\n color: rgba(0, 0, 0, 0.87);\n font-weight: 500;\n transform-origin: 0 0;\n height: 100%;\n width: 100%;\n background: none;\n font-size: 11px;\n\n &.hide {\n display: none;\n }\n }\n\n &.required {\n border: 1px solid rgb(204, 0, 0);\n }\n\n &.focused {\n animation: verdocs-field-pulse 0.4s 1;\n }\n\n verdocs-button-panel {\n top: -3px;\n left: -2px;\n opacity: 0.5;\n z-index: 1000;\n cursor: pointer;\n position: absolute;\n transform: scale(0.6);\n\n &[data-active],\n &:hover {\n opacity: 1;\n }\n\n .icon {\n svg {\n fill: #333333;\n }\n\n &:hover {\n svg {\n fill: #000000;\n }\n }\n }\n }\n\n .settings-icon {\n position: absolute;\n top: -3px;\n left: -20px;\n display: inline-block;\n cursor: pointer;\n opacity: 0.3;\n\n svg {\n fill: $border-color;\n }\n\n &:hover {\n opacity: 1;\n }\n }\n\n .edge-top,\n .edge-right,\n .edge-left,\n .edge-bottom {\n position: absolute;\n z-index: 10;\n }\n\n .edge-top {\n top: -2px;\n left: 0;\n right: 0;\n height: 5px;\n }\n\n .edge-right {\n top: 0;\n bottom: 0;\n right: -2px;\n width: 5px;\n }\n\n .edge-left {\n top: 0;\n left: -2px;\n bottom: 0;\n width: 5px;\n }\n\n .edge-bottom {\n bottom: -2px;\n left: 0;\n right: 0;\n height: 5px;\n }\n}\n\n@keyframes verdocs-field-pulse {\n 0% {\n background-color: rgba(0, 0, 0, 0.35);\n }\n 50% {\n background-color: rgba(0, 0, 0, 0);\n }\n 100% {\n background-color: rgba(0, 0, 0, 0.35);\n }\n}\n","import interact from 'interactjs';\nimport {ITemplateField, getRGBA, IEnvelopeField, VerdocsEndpoint, updateField, ITemplate} from '@verdocs/js-sdk';\nimport {Component, h, Host, Prop, Event, EventEmitter, Method, Fragment, State, Element} from '@stencil/core';\nimport {SettingsIcon} from '../../../utils/Icons';\nimport {Store} from '../../../utils/Datastore';\nimport {ResizeEvent} from '@interactjs/actions/resize/plugin';\n\n/**\n * Displays a signature field. If a signature already exists, it will be displayed and the field\n * will be disabled. Otherwise, a placeholder button will be shown. Clicking the button will\n * show a dialog to adopt a signature.\n *\n * NOTE: When signature fields are completed they will be filled with a signature \"stamp\".\n * This requires operation against a live, valid envelope. If you are testing this component\n * in Storybook, it will not be visible here.\n */\n@Component({\n tag: 'verdocs-field-signature',\n styleUrl: 'verdocs-field-signature.scss',\n shadow: false,\n})\nexport class VerdocsFieldSignature {\n @Element() el: HTMLElement;\n\n /**\n * Fields may be attached to templates or envelopes, but only template fields may be edited.\n */\n @Prop({reflect: true}) source: 'template' | 'envelope' = 'template';\n\n /**\n * The source template or envelope ID the field is found in.\n */\n @Prop({reflect: true}) sourceid: string = '';\n\n /**\n * The name of the field to display.\n */\n @Prop({reflect: true}) fieldname: string = '';\n\n /**\n * Override the field's settings. This is intended to be used during signing when fields are being\n * mutated.\n */\n @Prop() field: IEnvelopeField | null | undefined = null;\n\n /**\n * If set, the signature creation dialog will be initialized with this text.\n */\n @Prop({reflect: true}) name?: string = '';\n\n /**\n * If set, overrides the field's settings object. Primarily used to support \"preview\" modes where all fields are disabled.\n */\n @Prop({reflect: true}) disabled?: boolean = false;\n\n /**\n * If set, a settings icon will be displayed on hover. The settings shown allow the field's recipient and other settings to be\n * changed, so it should typically only be enabled in the Builder.\n */\n @Prop({reflect: true}) editable?: boolean = false;\n\n /**\n * If set, the field may be dragged to a new location. This should only be enabled in the Builder, or for self-placed fields.\n */\n @Prop({reflect: true}) moveable?: boolean = false;\n\n /**\n * If set, the field is considered \"done\" and is drawn in a display-final-value state.\n */\n @Prop({reflect: true}) done?: boolean = false;\n\n /**\n * If set, the field will be be scaled horizontally by this factor.\n */\n @Prop({reflect: true}) xscale?: number = 1;\n\n /**\n * If set, the field will be be scaled vertically by this factor.\n */\n @Prop({reflect: true}) yscale?: number = 1;\n\n /**\n * The page the field is on\n */\n @Prop({reflect: true}) pagenumber?: number = 1;\n\n /**\n * Event emitted when the field has changed.\n */\n @Event({composed: true}) fieldChange: EventEmitter<string>;\n\n /**\n * Event fired on every character entered into / deleted from the field.\n */\n @Event({composed: true}) settingsPress: EventEmitter;\n\n /**\n * Event fired when the field's settings are changed.\n */\n @Event({composed: true}) settingsChanged: EventEmitter<{fieldName: string; field: ITemplateField}>;\n\n /**\n * Event fired when the field is deleted.\n */\n @Event({composed: true}) deleted: EventEmitter<{fieldName: string}>;\n\n @State() showingProperties?: boolean = false;\n @State() focused?: boolean = false;\n\n @Method() async focusField() {\n this.handleShow();\n }\n\n @State()\n tempSignature: string = '';\n\n private dialog?: any;\n\n componentDidRender() {\n interact.dynamicDrop(true);\n\n if (this.editable) {\n interact(this.el).resizable({\n edges: {\n top: '.edge-top',\n left: '.edge-left',\n bottom: '.edge-bottom',\n right: '.edge-right',\n },\n modifiers: [\n interact.modifiers.restrictSize({\n min: {width: 71, height: 36},\n }),\n ],\n listeners: {\n start: this.handleResizeStart.bind(this),\n move: this.handleResize.bind(this),\n end: this.handleResizeEnd.bind(this),\n },\n });\n }\n }\n\n handleResizeStart(e: ResizeEvent) {\n e.preventDefault();\n e.stopPropagation();\n e.target.dataset.originalBottom = e.target.style.bottom;\n }\n\n handleResize(e: any) {\n let {width, height} = e.rect;\n\n const dX = e.deltaRect.left;\n const dY = e.deltaRect.bottom;\n const currentLeft = parseFloat(e.target.style.left);\n const currentBottom = parseFloat(e.target.style.bottom);\n\n width /= this.xscale;\n height /= this.yscale;\n\n Object.assign(e.target.style, {\n width: `${width}px`,\n height: `${height}px`,\n left: `${currentLeft + dX}px`,\n bottom: `${currentBottom - dY}px`,\n });\n }\n\n async handleResizeEnd(e: any) {\n const {sourceid, fieldname} = this;\n\n const width = Math.round(parseFloat(e.target.style.width));\n let height = Math.round(parseFloat(e.target.style.height));\n if (height < 20) {\n height = 15;\n }\n\n const newBottom = parseFloat(e.target.style.bottom);\n const originalBottom = parseFloat(e.target.dataset.originalBottom);\n const template = await Store.getTemplate(VerdocsEndpoint.getDefault(), this.sourceid);\n const oldField = template.fields.find(f => f.name === fieldname);\n const y = newBottom !== originalBottom ? newBottom / this.yscale : oldField?.y;\n\n updateField(VerdocsEndpoint.getDefault(), sourceid, fieldname, {width, height, y})\n .then(async updatedField => {\n const template = await Store.getTemplate(VerdocsEndpoint.getDefault(), this.sourceid);\n const newTemplate = JSON.parse(JSON.stringify(template)) as ITemplate;\n const fieldIndex = newTemplate.fields.findIndex(field => field.name === fieldname);\n if (fieldIndex > -1) {\n newTemplate.fields[fieldIndex] = updatedField;\n }\n Store.updateTemplate(this.sourceid, newTemplate);\n\n this.settingsChanged?.emit({fieldName: fieldname, field: updatedField});\n Object.assign(e.target.dataset, {x: 0, y: 0, h: 0});\n })\n .catch(e => console.log('Field update failed', e));\n }\n\n hideDialog() {\n this.dialog?.remove();\n this.dialog = null;\n this.focused = false;\n }\n\n handleAdopt(e: any) {\n console.log('[SIGNATURE] Adopted signature');\n this.tempSignature = e.detail;\n this.fieldChange?.emit(this.tempSignature);\n this.hideDialog();\n }\n\n handleShow() {\n this.dialog = document.createElement('verdocs-signature-dialog');\n this.dialog.setAttribute('name', this.name);\n // this.dialog.setAttribute('roleindex', this.roleindex);\n this.dialog.addEventListener('exit', () => this.hideDialog());\n this.dialog.addEventListener('next', (e: any) => this.handleAdopt(e));\n document.body.append(this.dialog);\n this.focused = true;\n }\n\n @Method()\n async showSettingsPanel() {\n const settingsPanel = document.getElementById(`verdocs-settings-panel-${this.fieldname}`) as any;\n if (settingsPanel && settingsPanel.showPanel) {\n settingsPanel.showPanel();\n }\n }\n\n @Method()\n async hideSettingsPanel() {\n const settingsPanel = document.getElementById(`verdocs-settings-panel-${this.fieldname}`) as any;\n if (settingsPanel && settingsPanel.hidePanel) {\n settingsPanel.hidePanel();\n }\n this.showingProperties = false;\n }\n\n render() {\n const {source, sourceid, fieldname, editable = false, done = false, disabled = false, focused, xscale = 1, yscale = 1} = this;\n\n const {index, field} = Store.getField(source, sourceid, fieldname, this.field);\n const {required = false, value = '', label = '', settings = {}} = field || {};\n const {base64} = settings;\n const backgroundColor = getRGBA(index);\n\n if (done) {\n return <Host class={{done}}>{value && <img src={base64} alt=\"\" />}</Host>;\n }\n\n return (\n <Host class={{required, disabled, done, focused}} style={{backgroundColor}}>\n {editable && <div class=\"edge-right\" />}\n {editable && <div class=\"edge-left\" />}\n {editable && <div class=\"edge-top\" />}\n {editable && <div class=\"edge-bottom\" />}\n\n {label && <label>{label}</label>}\n\n {base64 ? <img src={base64} alt=\"\" /> : <button onClick={() => !disabled && this.handleShow()}>Signature</button>}\n\n {editable && (\n <Fragment>\n <div\n id={`verdocs-settings-panel-trigger-${fieldname}`}\n style={{transform: `scale(${Math.floor((1 / xscale) * 1000) / 1000}, ${Math.floor((1 / yscale) * 1000) / 1000})`}}\n class=\"settings-icon\"\n innerHTML={SettingsIcon}\n onClick={(e: any) => {\n e.stopPropagation();\n this.showingProperties = !this.showingProperties;\n }}\n />\n\n {this.showingProperties && (\n <verdocs-portal anchor={`verdocs-settings-panel-trigger-${fieldname}`} onClickAway={() => (this.showingProperties = false)}>\n <verdocs-template-field-properties\n templateId={sourceid}\n fieldName={fieldname}\n onClose={() => this.hideSettingsPanel()}\n onDelete={() => {\n this.deleted?.emit({fieldName: fieldname});\n return this.hideSettingsPanel();\n }}\n onSettingsChanged={e => {\n this.settingsChanged?.emit(e.detail);\n return this.hideSettingsPanel();\n }}\n helpText={\"Signature fields capture a recipient's signature on a document.\"}\n />\n </verdocs-portal>\n )}\n </Fragment>\n )}\n </Host>\n );\n }\n}\n"],"version":3}
@@ -9,7 +9,7 @@ import { d as defineCustomElement$6 } from './p-DGJlf5J_.js';
9
9
  import { d as defineCustomElement$5 } from './p-D_QT5uZk.js';
10
10
  import { d as defineCustomElement$4 } from './p-C3iwT41e.js';
11
11
  import { d as defineCustomElement$3 } from './p-kvTSiSQ0.js';
12
- import { d as defineCustomElement$2 } from './p-TkHAxPB_.js';
12
+ import { d as defineCustomElement$2 } from './p-Da1nfhXq.js';
13
13
  import { d as defineCustomElement$1 } from './p-BvDqCFDj.js';
14
14
 
15
15
  const verdocsFieldRadioCss = "@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-field-radio{font-family:\"Inter\", -apple-system, \"Segoe UI\", \"Roboto\", \"Helvetica Neue\", sans-serif;width:14px;height:14px;display:block;font-size:11px;position:relative;scroll-margin:20px 0;background-color:transparent;-webkit-transform-origin:bottom left;transform-origin:bottom left;border-radius:100%}verdocs-field-radio.focused{-webkit-animation:verdocs-field-pulse 0.4s 1;animation:verdocs-field-pulse 0.4s 1}verdocs-field-radio svg{margin-top:4px}verdocs-field-radio.disabled.done{opacity:1}verdocs-field-radio div.label{top:-14px;left:-1px;height:14px;color:white;padding:0 4px;font-size:9px;line-height:13px;position:absolute;background:#4a4a99;border-top-left-radius:2px;border-top-right-radius:2px}verdocs-field-radio div.group{top:14px;left:-1px;height:14px;color:white;padding:0 4px;font-size:9px;line-height:13px;position:absolute;background:#bb0589;border-bottom-left-radius:2px;border-bottom-right-radius:2px}verdocs-field-radio input{cursor:inherit}verdocs-field-radio.disabled input{opacity:0.5}verdocs-field-radio.done input[type=radio]{margin:0;padding:0;width:10px;height:10px}verdocs-field-radio:not(.done) input[type=radio]{position:absolute;opacity:0}verdocs-field-radio:not(.done) input[type=radio]+label:before{content:\"\";border-radius:100%;border:1px solid rgba(0, 0, 0, 0.6);display:inline-block;width:12px;height:12px;position:absolute;left:1px;top:1px;cursor:pointer;text-align:center;-webkit-transition:all 250ms ease;transition:all 250ms ease}verdocs-field-radio:not(.done) input[type=radio]:checked+label:before{background-color:#55bc81;-webkit-box-shadow:inset 0 0 0 2px #f5f5fa;box-shadow:inset 0 0 0 2px #f5f5fa}verdocs-field-radio:not(.done) input[type=radio]:focus+label:before{outline:none;border-color:#55bc81}verdocs-field-radio:not(.done) input[type=radio]:disabled+label:before{-webkit-box-shadow:inset 0 0 0 4px #f5f5fa;box-shadow:inset 0 0 0 4px #f5f5fa;border-color:#f3f3fc;background:#f3f3fc}verdocs-field-radio:not(.done) input[type=radio]+label:empty:before{margin-right:0}verdocs-field-radio.required{border:1px solid #cc0000}verdocs-field-radio.hide{display:none}verdocs-field-radio.focused{-webkit-animation:verdocs-field-pulse 0.4s 1;animation:verdocs-field-pulse 0.4s 1}verdocs-field-radio verdocs-button-panel{margin-left:-20px;margin-top:-7px;-webkit-transform:scale(0.7);transform:scale(0.7)}verdocs-field-radio .settings-icon{position:absolute;top:-6px;left:-20px;display:inline-block;cursor:pointer;opacity:0.3}verdocs-field-radio .settings-icon svg{fill:#707ae5}verdocs-field-radio .settings-icon:hover{opacity:1}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}";
@@ -198,6 +198,6 @@ function defineCustomElement() {
198
198
  }
199
199
 
200
200
  export { VerdocsFieldRadio as V, defineCustomElement as d };
201
- //# sourceMappingURL=p-DSO1_d48.js.map
201
+ //# sourceMappingURL=p-BPPiqx8Q.js.map
202
202
 
203
- //# sourceMappingURL=p-DSO1_d48.js.map
203
+ //# source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/verdocs-field-radio.scss?tag=verdocs-field-radio","src/components/fields/verdocs-field-radio/verdocs-field-radio.tsx"],"sourcesContent":["@import '../../../theme.scss';\n\n// See https://www.sliderrevolution.com/resources/styling-radio-buttons/\nverdocs-field-radio {\n font-family: $verdocs-primary-font;\n width: 14px;\n height: 14px;\n display: block;\n font-size: 11px;\n position: relative;\n scroll-margin: 20px 0;\n background-color: transparent;\n transform-origin: bottom left;\n border-radius: 100%;\n\n &.focused {\n animation: verdocs-field-pulse 0.4s 1;\n }\n\n svg {\n margin-top: 4px;\n }\n\n &.disabled.done {\n opacity: 1;\n }\n\n // To avoid conflicting with the use of a label for the checkbox itself\n div.label {\n top: -14px;\n left: -1px;\n height: 14px;\n color: white;\n padding: 0 4px;\n font-size: 9px;\n line-height: 13px;\n position: absolute;\n background: #4a4a99;\n border-top-left-radius: 2px;\n border-top-right-radius: 2px;\n }\n\n div.group {\n top: 14px;\n left: -1px;\n height: 14px;\n color: white;\n padding: 0 4px;\n font-size: 9px;\n line-height: 13px;\n position: absolute;\n background: #bb0589;\n border-bottom-left-radius: 2px;\n border-bottom-right-radius: 2px;\n }\n\n input {\n // This is needed to bring down the cursor from the parent element, which is where interactjs applies it\n cursor: inherit;\n }\n\n &.disabled input {\n opacity: 0.5;\n }\n\n &.done input[type='radio'] {\n margin: 0;\n padding: 0;\n width: 10px;\n height: 10px;\n }\n\n &:not(.done) input[type='radio'] {\n position: absolute;\n opacity: 0;\n\n + label {\n &:before {\n content: '';\n //background: $verdocs-grey-3;\n border-radius: 100%;\n border: 1px solid rgba(0, 0, 0, 0.6);\n display: inline-block;\n width: 12px;\n height: 12px;\n position: absolute;\n // This looks off in Storybook but correct in apps.\n left: 1px;\n top: 1px;\n cursor: pointer;\n text-align: center;\n transition: all 250ms ease;\n }\n }\n\n &:checked {\n + label {\n &:before {\n background-color: $verdocs-green;\n box-shadow: inset 0 0 0 2px $verdocs-grey-3;\n }\n }\n }\n\n &:focus {\n + label {\n &:before {\n outline: none;\n border-color: $verdocs-green;\n }\n }\n }\n\n &:disabled {\n + label {\n &:before {\n box-shadow: inset 0 0 0 4px $verdocs-grey-3;\n border-color: #f3f3fc;\n background: #f3f3fc;\n }\n }\n }\n\n + label {\n &:empty {\n &:before {\n margin-right: 0;\n }\n }\n }\n }\n\n &.required {\n border: 1px solid $verdocs-red-1;\n }\n\n &.hide {\n display: none;\n }\n\n &.focused {\n animation: verdocs-field-pulse 0.4s 1;\n }\n\n verdocs-button-panel {\n margin-left: -20px;\n margin-top: -7px;\n transform: scale(0.7);\n }\n\n .settings-icon {\n position: absolute;\n top: -6px;\n left: -20px;\n display: inline-block;\n cursor: pointer;\n opacity: 0.3;\n\n svg {\n fill: $border-color;\n }\n\n &:hover {\n opacity: 1;\n }\n }\n}\n\n@keyframes verdocs-field-pulse {\n 0% {\n background-color: rgba(0, 0, 0, 0.35);\n }\n 50% {\n background-color: rgba(0, 0, 0, 0);\n }\n 100% {\n background-color: rgba(0, 0, 0, 0.35);\n }\n}\n","import {ITemplateField, getRGBA, IEnvelopeField} from '@verdocs/js-sdk';\nimport {Component, Event, EventEmitter, h, Host, Method, Prop, Fragment, State} from '@stencil/core';\nimport {SettingsIcon} from '../../../utils/Icons';\nimport {Store} from '../../../utils/Datastore';\n\nconst RadioIconUnselected = `<svg focusable=\"false\" aria-hidden=\"true\" viewBox=\"0 0 24 24\"><path d=\"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z\"></path></svg>`;\n\nconst RadioIconSelected = `<svg focusable=\"false\" aria-hidden=\"true\" viewBox=\"0 0 24 24\"><path d=\"M12 7c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5zm0-5C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z\"></path></svg>`;\n\n/**\n * Displays a radio button.\n */\n@Component({\n tag: 'verdocs-field-radio',\n styleUrl: 'verdocs-field-radio.scss',\n shadow: false,\n})\nexport class VerdocsFieldRadio {\n /**\n * Fields may be attached to templates or envelopes, but only template fields may be edited.\n */\n @Prop({reflect: true}) source: 'template' | 'envelope' = 'template';\n\n /**\n * The source template or envelope ID the field is found in.\n */\n @Prop({reflect: true}) sourceid: string = '';\n\n /**\n * The name of the field to display.\n */\n @Prop({reflect: true}) fieldname: string = '';\n\n /**\n * Override the field's settings. This is intended to be used during signing when fields are being\n * mutated.\n */\n @Prop() field: IEnvelopeField | null | undefined = null;\n\n /**\n * If set, overrides the field's settings object. Primarily used in Storybook mode.\n */\n @Prop({reflect: true}) disabled?: boolean = false;\n\n /**\n * If set, overrides the field's required object. Primarily used in Storybook mode.\n */\n @Prop({reflect: true}) required?: boolean = false;\n\n /**\n * If set, the field is considered \"done\" and is drawn in a display-final-value state.\n */\n @Prop({reflect: true}) done?: boolean = false;\n\n /**\n * If set, a settings icon will be displayed on hover. The settings shown allow the field's recipient and other settings to be\n * changed, so it should typically only be enabled in the Builder.\n */\n @Prop({reflect: true}) editable?: boolean = false;\n\n /**\n * If set, the field may be dragged to a new location. This should only be enabled in the Builder, or for self-placed fields.\n */\n @Prop({reflect: true}) moveable?: boolean = false;\n\n /**\n * If set, the field will be be scaled horizontally by this factor.\n */\n @Prop({reflect: true}) xscale?: number = 1;\n\n /**\n * If set, the field will be be scaled vertically by this factor.\n */\n @Prop({reflect: true}) yscale?: number = 1;\n\n /**\n * The page the field is on\n */\n @Prop({reflect: true}) pagenumber?: number = 1;\n\n @State() showingProperties?: boolean = false;\n @State() focused = false;\n\n /**\n * Event fired when the field's settings are changed.\n */\n @Event({composed: true}) settingsChanged: EventEmitter<{fieldName: string; field: ITemplateField}>;\n\n /**\n * Event fired when the field is deleted.\n */\n @Event({composed: true}) deleted: EventEmitter<{fieldName: string}>;\n\n @Method()\n async focusField() {\n // Our input field is fake, so we fake the flash too\n this.focused = true;\n setTimeout(() => {\n this.focused = false;\n }, 500);\n }\n\n @Method()\n async showSettingsPanel() {\n const settingsPanel = document.getElementById(`verdocs-settings-panel-${this.fieldname}`) as any;\n if (settingsPanel && settingsPanel.showPanel) {\n settingsPanel.showPanel();\n }\n }\n\n @Method()\n async hideSettingsPanel() {\n const settingsPanel = document.getElementById(`verdocs-settings-panel-${this.fieldname}`) as any;\n if (settingsPanel && settingsPanel.hidePanel) {\n settingsPanel.hidePanel();\n }\n }\n\n render() {\n const {source, sourceid, fieldname, editable = false, done = false, disabled = false, focused, xscale = 1, yscale = 1} = this;\n const {index, field} = Store.getField(source, sourceid, fieldname, this.field);\n const {name, required = false, label = '', group = '', value = false, readonly = false} = field || {};\n const backgroundColor = getRGBA(index);\n\n const selected = value === 'true';\n\n if (done) {\n return (\n <Host class={{done}} style={{maxWidth: '10px'}}>\n <span innerHTML={selected ? RadioIconSelected : RadioIconUnselected} />\n </Host>\n );\n }\n\n return (\n <Host class={{required: this.required || required, disabled, done, focused}} style={{backgroundColor}}>\n {label && <div class=\"label\">{label}</div>}\n {editable && group && <div class=\"group\">{group}</div>}\n\n <input id={fieldname} type=\"radio\" name={group || fieldname} value={name} checked={!!selected} disabled={readonly || disabled} required={required} />\n <label htmlFor={fieldname} />\n\n {editable && (\n <Fragment>\n <div\n id={`verdocs-settings-panel-trigger-${fieldname}`}\n style={{transform: `scale(${Math.floor((1 / xscale) * 1000) / 1000}, ${Math.floor((1 / yscale) * 1000) / 1000})`}}\n class=\"settings-icon\"\n innerHTML={SettingsIcon}\n onClick={(e: any) => {\n e.stopPropagation();\n this.showingProperties = !this.showingProperties;\n }}\n />\n\n {this.showingProperties && (\n <verdocs-portal anchor={`verdocs-settings-panel-trigger-${fieldname}`} onClickAway={() => (this.showingProperties = false)}>\n <verdocs-template-field-properties\n templateId={sourceid}\n fieldName={fieldname}\n onClose={() => (this.showingProperties = false)}\n onDelete={() => {\n this.deleted?.emit({fieldName: fieldname});\n return this.hideSettingsPanel();\n }}\n onSettingsChanged={e => {\n this.settingsChanged?.emit(e.detail);\n return this.hideSettingsPanel();\n }}\n helpText={\"Radio buttons capture the recipient's selection of just one of several related (exclusive) options.\"}\n />\n </verdocs-portal>\n )}\n </Fragment>\n )}\n </Host>\n );\n }\n}\n"],"version":3}
1
+ {"file":"p-BPPiqx8Q.js","mappings":";;;;;;;;;;;;;;AAAA,MAAM,oBAAoB,GAAG,g/FAAg/F;;ACK7gG,MAAM,mBAAmB,GAAG,CAAA,kNAAA,CAAoN;AAEhP,MAAM,iBAAiB,GAAG,CAAA,2QAAA,CAA6Q;MAU1R,iBAAiB,iBAAAA,kBAAA,CAAA,MAAA,iBAAA,SAAAC,CAAA,CAAA;AAL9B,IAAA,WAAA,CAAA,YAAA,EAAA;;;;;;;AAME;;AAEG;AACoB,QAAA,IAAM,CAAA,MAAA,GAA4B,UAAU;AAEnE;;AAEG;AACoB,QAAA,IAAQ,CAAA,QAAA,GAAW,EAAE;AAE5C;;AAEG;AACoB,QAAA,IAAS,CAAA,SAAA,GAAW,EAAE;AAE7C;;;AAGG;AACK,QAAA,IAAK,CAAA,KAAA,GAAsC,IAAI;AAEvD;;AAEG;AACoB,QAAA,IAAQ,CAAA,QAAA,GAAa,KAAK;AAEjD;;AAEG;AACoB,QAAA,IAAQ,CAAA,QAAA,GAAa,KAAK;AAEjD;;AAEG;AACoB,QAAA,IAAI,CAAA,IAAA,GAAa,KAAK;AAE7C;;;AAGG;AACoB,QAAA,IAAQ,CAAA,QAAA,GAAa,KAAK;AAEjD;;AAEG;AACoB,QAAA,IAAQ,CAAA,QAAA,GAAa,KAAK;AAEjD;;AAEG;AACoB,QAAA,IAAM,CAAA,MAAA,GAAY,CAAC;AAE1C;;AAEG;AACoB,QAAA,IAAM,CAAA,MAAA,GAAY,CAAC;AAE1C;;AAEG;AACoB,QAAA,IAAU,CAAA,UAAA,GAAY,CAAC;AAErC,QAAA,IAAiB,CAAA,iBA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,CAClB,CACQ,CACZ,CACI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["__stencil_proxyCustomElement","HTMLElement"],"sources":["src/components/fields/verdocs-field-radio/verdocs-field-radio.scss?tag=verdocs-field-radio","src/components/fields/verdocs-field-radio/verdocs-field-radio.tsx"],"sourcesContent":["@import '../../../theme.scss';\n\n// See https://www.sliderrevolution.com/resources/styling-radio-buttons/\nverdocs-field-radio {\n font-family: $verdocs-primary-font;\n width: 14px;\n height: 14px;\n display: block;\n font-size: 11px;\n position: relative;\n scroll-margin: 20px 0;\n background-color: transparent;\n transform-origin: bottom left;\n border-radius: 100%;\n\n &.focused {\n animation: verdocs-field-pulse 0.4s 1;\n }\n\n svg {\n margin-top: 4px;\n }\n\n &.disabled.done {\n opacity: 1;\n }\n\n // To avoid conflicting with the use of a label for the checkbox itself\n div.label {\n top: -14px;\n left: -1px;\n height: 14px;\n color: white;\n padding: 0 4px;\n font-size: 9px;\n line-height: 13px;\n position: absolute;\n background: #4a4a99;\n border-top-left-radius: 2px;\n border-top-right-radius: 2px;\n }\n\n div.group {\n top: 14px;\n left: -1px;\n height: 14px;\n color: white;\n padding: 0 4px;\n font-size: 9px;\n line-height: 13px;\n position: absolute;\n background: #bb0589;\n border-bottom-left-radius: 2px;\n border-bottom-right-radius: 2px;\n }\n\n input {\n // This is needed to bring down the cursor from the parent element, which is where interactjs applies it\n cursor: inherit;\n }\n\n &.disabled input {\n opacity: 0.5;\n }\n\n &.done input[type='radio'] {\n margin: 0;\n padding: 0;\n width: 10px;\n height: 10px;\n }\n\n &:not(.done) input[type='radio'] {\n position: absolute;\n opacity: 0;\n\n + label {\n &:before {\n content: '';\n //background: $verdocs-grey-3;\n border-radius: 100%;\n border: 1px solid rgba(0, 0, 0, 0.6);\n display: inline-block;\n width: 12px;\n height: 12px;\n position: absolute;\n // This looks off in Storybook but correct in apps.\n left: 1px;\n top: 1px;\n cursor: pointer;\n text-align: center;\n transition: all 250ms ease;\n }\n }\n\n &:checked {\n + label {\n &:before {\n background-color: $verdocs-green;\n box-shadow: inset 0 0 0 2px $verdocs-grey-3;\n }\n }\n }\n\n &:focus {\n + label {\n &:before {\n outline: none;\n border-color: $verdocs-green;\n }\n }\n }\n\n &:disabled {\n + label {\n &:before {\n box-shadow: inset 0 0 0 4px $verdocs-grey-3;\n border-color: #f3f3fc;\n background: #f3f3fc;\n }\n }\n }\n\n + label {\n &:empty {\n &:before {\n margin-right: 0;\n }\n }\n }\n }\n\n &.required {\n border: 1px solid $verdocs-red-1;\n }\n\n &.hide {\n display: none;\n }\n\n &.focused {\n animation: verdocs-field-pulse 0.4s 1;\n }\n\n verdocs-button-panel {\n margin-left: -20px;\n margin-top: -7px;\n transform: scale(0.7);\n }\n\n .settings-icon {\n position: absolute;\n top: -6px;\n left: -20px;\n display: inline-block;\n cursor: pointer;\n opacity: 0.3;\n\n svg {\n fill: $border-color;\n }\n\n &:hover {\n opacity: 1;\n }\n }\n}\n\n@keyframes verdocs-field-pulse {\n 0% {\n background-color: rgba(0, 0, 0, 0.35);\n }\n 50% {\n background-color: rgba(0, 0, 0, 0);\n }\n 100% {\n background-color: rgba(0, 0, 0, 0.35);\n }\n}\n","import {ITemplateField, getRGBA, IEnvelopeField} from '@verdocs/js-sdk';\nimport {Component, Event, EventEmitter, h, Host, Method, Prop, Fragment, State} from '@stencil/core';\nimport {SettingsIcon} from '../../../utils/Icons';\nimport {Store} from '../../../utils/Datastore';\n\nconst RadioIconUnselected = `<svg focusable=\"false\" aria-hidden=\"true\" viewBox=\"0 0 24 24\"><path d=\"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z\"></path></svg>`;\n\nconst RadioIconSelected = `<svg focusable=\"false\" aria-hidden=\"true\" viewBox=\"0 0 24 24\"><path d=\"M12 7c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5zm0-5C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z\"></path></svg>`;\n\n/**\n * Displays a radio button.\n */\n@Component({\n tag: 'verdocs-field-radio',\n styleUrl: 'verdocs-field-radio.scss',\n shadow: false,\n})\nexport class VerdocsFieldRadio {\n /**\n * Fields may be attached to templates or envelopes, but only template fields may be edited.\n */\n @Prop({reflect: true}) source: 'template' | 'envelope' = 'template';\n\n /**\n * The source template or envelope ID the field is found in.\n */\n @Prop({reflect: true}) sourceid: string = '';\n\n /**\n * The name of the field to display.\n */\n @Prop({reflect: true}) fieldname: string = '';\n\n /**\n * Override the field's settings. This is intended to be used during signing when fields are being\n * mutated.\n */\n @Prop() field: IEnvelopeField | null | undefined = null;\n\n /**\n * If set, overrides the field's settings object. Primarily used in Storybook mode.\n */\n @Prop({reflect: true}) disabled?: boolean = false;\n\n /**\n * If set, overrides the field's required object. Primarily used in Storybook mode.\n */\n @Prop({reflect: true}) required?: boolean = false;\n\n /**\n * If set, the field is considered \"done\" and is drawn in a display-final-value state.\n */\n @Prop({reflect: true}) done?: boolean = false;\n\n /**\n * If set, a settings icon will be displayed on hover. The settings shown allow the field's recipient and other settings to be\n * changed, so it should typically only be enabled in the Builder.\n */\n @Prop({reflect: true}) editable?: boolean = false;\n\n /**\n * If set, the field may be dragged to a new location. This should only be enabled in the Builder, or for self-placed fields.\n */\n @Prop({reflect: true}) moveable?: boolean = false;\n\n /**\n * If set, the field will be be scaled horizontally by this factor.\n */\n @Prop({reflect: true}) xscale?: number = 1;\n\n /**\n * If set, the field will be be scaled vertically by this factor.\n */\n @Prop({reflect: true}) yscale?: number = 1;\n\n /**\n * The page the field is on\n */\n @Prop({reflect: true}) pagenumber?: number = 1;\n\n @State() showingProperties?: boolean = false;\n @State() focused = false;\n\n /**\n * Event fired when the field's settings are changed.\n */\n @Event({composed: true}) settingsChanged: EventEmitter<{fieldName: string; field: ITemplateField}>;\n\n /**\n * Event fired when the field is deleted.\n */\n @Event({composed: true}) deleted: EventEmitter<{fieldName: string}>;\n\n @Method()\n async focusField() {\n // Our input field is fake, so we fake the flash too\n this.focused = true;\n setTimeout(() => {\n this.focused = false;\n }, 500);\n }\n\n @Method()\n async showSettingsPanel() {\n const settingsPanel = document.getElementById(`verdocs-settings-panel-${this.fieldname}`) as any;\n if (settingsPanel && settingsPanel.showPanel) {\n settingsPanel.showPanel();\n }\n }\n\n @Method()\n async hideSettingsPanel() {\n const settingsPanel = document.getElementById(`verdocs-settings-panel-${this.fieldname}`) as any;\n if (settingsPanel && settingsPanel.hidePanel) {\n settingsPanel.hidePanel();\n }\n }\n\n render() {\n const {source, sourceid, fieldname, editable = false, done = false, disabled = false, focused, xscale = 1, yscale = 1} = this;\n const {index, field} = Store.getField(source, sourceid, fieldname, this.field);\n const {name, required = false, label = '', group = '', value = false, readonly = false} = field || {};\n const backgroundColor = getRGBA(index);\n\n const selected = value === 'true';\n\n if (done) {\n return (\n <Host class={{done}} style={{maxWidth: '10px'}}>\n <span innerHTML={selected ? RadioIconSelected : RadioIconUnselected} />\n </Host>\n );\n }\n\n return (\n <Host class={{required: this.required || required, disabled, done, focused}} style={{backgroundColor}}>\n {label && <div class=\"label\">{label}</div>}\n {editable && group && <div class=\"group\">{group}</div>}\n\n <input id={fieldname} type=\"radio\" name={group || fieldname} value={name} checked={!!selected} disabled={readonly || disabled} required={required} />\n <label htmlFor={fieldname} />\n\n {editable && (\n <Fragment>\n <div\n id={`verdocs-settings-panel-trigger-${fieldname}`}\n style={{transform: `scale(${Math.floor((1 / xscale) * 1000) / 1000}, ${Math.floor((1 / yscale) * 1000) / 1000})`}}\n class=\"settings-icon\"\n innerHTML={SettingsIcon}\n onClick={(e: any) => {\n e.stopPropagation();\n this.showingProperties = !this.showingProperties;\n }}\n />\n\n {this.showingProperties && (\n <verdocs-portal anchor={`verdocs-settings-panel-trigger-${fieldname}`} onClickAway={() => (this.showingProperties = false)}>\n <verdocs-template-field-properties\n templateId={sourceid}\n fieldName={fieldname}\n onClose={() => (this.showingProperties = false)}\n onDelete={() => {\n this.deleted?.emit({fieldName: fieldname});\n return this.hideSettingsPanel();\n }}\n onSettingsChanged={e => {\n this.settingsChanged?.emit(e.detail);\n return this.hideSettingsPanel();\n }}\n helpText={\"Radio buttons capture the recipient's selection of just one of several related (exclusive) options.\"}\n />\n </verdocs-portal>\n )}\n </Fragment>\n )}\n </Host>\n );\n }\n}\n"],"version":3}
@@ -11,7 +11,7 @@ import { d as defineCustomElement$6 } from './p-DGJlf5J_.js';
11
11
  import { d as defineCustomElement$5 } from './p-D_QT5uZk.js';
12
12
  import { d as defineCustomElement$4 } from './p-C3iwT41e.js';
13
13
  import { d as defineCustomElement$3 } from './p-kvTSiSQ0.js';
14
- import { d as defineCustomElement$2 } from './p-TkHAxPB_.js';
14
+ import { d as defineCustomElement$2 } from './p-Da1nfhXq.js';
15
15
  import { d as defineCustomElement$1 } from './p-BvDqCFDj.js';
16
16
 
17
17
  var formatExports = /*@__PURE__*/ requireFormat();
@@ -190,6 +190,6 @@ function defineCustomElement() {
190
190
  }
191
191
 
192
192
  export { VerdocsFieldTimestamp as V, defineCustomElement as d };
193
- //# sourceMappingURL=p-C4lOZS20.js.map
193
+ //# sourceMappingURL=p-BiqAkA9R.js.map
194
194
 
195
- //# sourceMappingURL=p-C4lOZS20.js.map
195
+ //# sourceMappingURL=p-BiqAkA9R.js.map
@@ -1 +1 @@
1
- {"file":"p-C4lOZS20.js","mappings":";;;;;;;;;;;;;;;;;;AAAA,MAAM,wBAAwB,GAAG,yhEAAyhE;;MCgB7iE,qBAAqB,iBAAAA,kBAAA,CAAA,MAAA,qBAAA,SAAAC,CAAA,CAAA;AALlC,IAAA,WAAA,CAAA,YAAA,EAAA;;;;;;;AAQE;;AAEG;AACoB,QAAA,I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IAAA,EAAA,KAAA,MAAA,GAAA,MAAA,GAAA,EAAA,CAAA,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC;AACpC,gBAAA,OAAO,IAAI,CAAC,iBAAiB,EAAE;AACjC,aAAC,EACD,QAAQ,EAAE,0EAA0E,EAAA,CACpF,CACa,CAClB,CACQ,CACZ,CACI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["__stencil_proxyCustomElement","HTMLElement","format"],"sources":["src/components/fields/verdocs-field-timestamp/verdocs-field-timestamp.scss?tag=verdocs-field-timestamp","src/components/fields/verdocs-field-timestamp/verdocs-field-timestamp.tsx"],"sourcesContent":["@import '../../../theme.scss';\n\nverdocs-field-timestamp {\n width: 160px;\n height: 15px;\n display: block;\n font-size: 9px;\n position: relative;\n scroll-margin: 20px 0;\n background-color: transparent;\n transform-origin: bottom left;\n font-family: $verdocs-primary-font;\n\n &.done {\n opacity: 1;\n }\n\n input {\n position: absolute;\n\n // This is needed to bring down the cursor from the parent element, which is where interactjs applies it\n cursor: inherit;\n\n opacity: 0.5;\n width: 100%;\n height: 100%;\n font-size: 9px;\n background: none;\n font-weight: 500;\n transform-origin: 0 0;\n box-sizing: border-box;\n color: rgba(0, 0, 0, 0.87);\n border: 1px solid rgba(0, 0, 0, 0.2);\n\n &.hide {\n display: none;\n }\n }\n\n label {\n top: -14px;\n left: -1px;\n height: 14px;\n color: white;\n padding: 0 4px;\n font-size: 9px;\n line-height: 13px;\n position: absolute;\n background: #4a4a99;\n border-top-left-radius: 2px;\n border-top-right-radius: 2px;\n }\n\n &.required {\n border: 1px solid rgb(204, 0, 0);\n }\n\n &.focused {\n animation: verdocs-field-pulse 0.4s 1;\n }\n\n verdocs-button-panel {\n top: -3px;\n left: -2px;\n opacity: 0.5;\n z-index: 1000;\n cursor: pointer;\n position: absolute;\n transform: scale(0.6);\n\n &[data-active],\n &:hover {\n opacity: 1;\n }\n\n .icon {\n svg {\n fill: #333333;\n }\n\n &:hover {\n svg {\n fill: #000000;\n }\n }\n }\n }\n\n .settings-icon {\n position: absolute;\n top: -3px;\n left: -20px;\n display: inline-block;\n cursor: pointer;\n opacity: 0.3;\n\n svg {\n fill: $border-color;\n }\n\n &:hover {\n opacity: 1;\n }\n }\n}\n","import {format} from 'date-fns/format';\nimport {ITemplateField, getRGBA, IEnvelopeField} from '@verdocs/js-sdk';\nimport {Component, h, Host, Prop, Method, Event, EventEmitter, Fragment, State} from '@stencil/core';\nimport {FORMAT_TIMESTAMP} from '../../../utils/Types';\nimport {SettingsIcon} from '../../../utils/Icons';\nimport {Store} from '../../../utils/Datastore';\n\n/**\n * Display a timestamp. Timestamps are not editable by signers. Instead, they are automatically\n * filled when the signer submits the document.\n */\n@Component({\n tag: 'verdocs-field-timestamp',\n styleUrl: 'verdocs-field-timestamp.scss',\n shadow: false,\n})\nexport class VerdocsFieldTimestamp {\n private el: HTMLInputElement;\n\n /**\n * Fields may be attached to templates or envelopes, but only template fields may be edited.\n */\n @Prop({reflect: true}) source: 'template' | 'envelope' = 'template';\n\n /**\n * The source template or envelope ID the field is found in.\n */\n @Prop({reflect: true}) sourceid: string = '';\n\n /**\n * The name of the field to display.\n */\n @Prop({reflect: true}) fieldname: string = '';\n\n /**\n * Override the field's settings. This is intended to be used during signing when fields are being\n * mutated.\n */\n @Prop() field: IEnvelopeField | null | undefined = null;\n\n /**\n * If set, overrides the field's settings object. Primarily used to support \"preview\" modes where all fields are disabled.\n */\n @Prop({reflect: true}) disabled?: boolean = false;\n\n /**\n * If set, a settings icon will be displayed on hover. The settings shown allow the field's recipient and other settings to be\n * changed, so it should typically only be enabled in the Builder.\n */\n @Prop({reflect: true}) editable?: boolean = false;\n\n /**\n * If set, the field may be dragged to a new location. This should only be enabled in the Builder, or for self-placed fields.\n */\n @Prop({reflect: true}) moveable?: boolean = false;\n\n /**\n * If set, the field is considered \"done\" and is drawn in a display-final-value state.\n */\n @Prop({reflect: true}) done?: boolean = false;\n\n /**\n * If set, the field will be be scaled horizontally by this factor.\n */\n @Prop({reflect: true}) xscale?: number = 1;\n\n /**\n * If set, the field will be be scaled vertically by this factor.\n */\n @Prop({reflect: true}) yscale?: number = 1;\n\n /**\n * The page the field is on\n */\n @Prop() pagenumber?: number = 1;\n\n /**\n * Event fired when the field's settings are changed.\n */\n @Event({composed: true}) settingsChanged: EventEmitter<{fieldName: string; field: ITemplateField}>;\n\n /**\n * Event fired when the field is deleted.\n */\n @Event({composed: true}) deleted: EventEmitter<{fieldName: string}>;\n\n @State() showingProperties?: boolean = false;\n\n @Method() async focusField() {\n this.el.focus();\n }\n\n @Method()\n async showSettingsPanel() {\n const settingsPanel = document.getElementById(`verdocs-settings-panel-${this.fieldname}`) as any;\n if (settingsPanel && settingsPanel.showPanel) {\n settingsPanel.showPanel();\n }\n }\n\n @Method()\n async hideSettingsPanel() {\n const settingsPanel = document.getElementById(`verdocs-settings-panel-${this.fieldname}`) as any;\n if (settingsPanel && settingsPanel.hidePanel) {\n settingsPanel.hidePanel();\n }\n this.showingProperties = false;\n }\n\n render() {\n const {source, sourceid, fieldname, editable = false, done = false, disabled = false, xscale = 1, yscale = 1} = this;\n\n const {index, field} = Store.getField(source, sourceid, fieldname, this.field);\n const {required = false, placeholder = '', value = '', label = ''} = field || {};\n const backgroundColor = getRGBA(index);\n\n const formatted = format(new Date(value || new Date().toISOString()), FORMAT_TIMESTAMP);\n\n if (done) {\n return <Host class={{done}}>{formatted}</Host>;\n }\n\n return (\n <Host class={{required, disabled, done}} style={{backgroundColor}}>\n {label && <label>{label}</label>}\n <input type=\"text\" placeholder={placeholder} value={formatted} disabled={true} ref={el => (this.el = el)} />\n\n {editable && (\n <Fragment>\n <div\n id={`verdocs-settings-panel-trigger-${fieldname}`}\n style={{transform: `scale(${Math.floor((1 / xscale) * 1000) / 1000}, ${Math.floor((1 / yscale) * 1000) / 1000})`}}\n class=\"settings-icon\"\n innerHTML={SettingsIcon}\n onClick={(e: any) => {\n e.stopPropagation();\n this.showingProperties = !this.showingProperties;\n }}\n />\n\n {this.showingProperties && (\n <verdocs-portal anchor={`verdocs-settings-panel-trigger-${fieldname}`} onClickAway={() => (this.showingProperties = false)}>\n <verdocs-template-field-properties\n templateId={sourceid}\n fieldName={fieldname}\n onClose={() => this.hideSettingsPanel()}\n onDelete={() => {\n this.deleted?.emit({fieldName: fieldname});\n return this.hideSettingsPanel();\n }}\n onSettingsChanged={e => {\n this.settingsChanged?.emit(e.detail);\n return this.hideSettingsPanel();\n }}\n helpText={'Time stamps are automatically set when the recipient signs the document.'}\n />\n </verdocs-portal>\n )}\n </Fragment>\n )}\n </Host>\n );\n }\n}\n"],"version":3}
1
+ {"file":"p-BiqAkA9R.js","mappings":";;;;;;;;;;;;;;;;;;AAAA,MAAM,wBAAwB,GAAG,yhEAAyhE;;MCgB7iE,qBAAqB,iBAAAA,kBAAA,CAAA,MAAA,qBAAA,SAAAC,CAAA,CAAA;AALlC,IAAA,WAAA,CAAA,YAAA,EAAA;;;;;;;AAQE;;AAEG;AACoB,QAAA,IAAM,CAAA,MAAA,GAA4B,UAAU;AAEnE;;AAEG;AACoB,QAAA,IAAQ,CAAA,QAAA,GAAW,EAAE;AAE5C;;AAEG;AACoB,QAAA,IAAS,CAAA,SAAA,GAAW,EAAE;AAE7C;;;AAGG;AACK,QAAA,IAAK,CAAA,KAAA,GAAsC,IAAI;AAEvD;;AAEG;AACoB,QAAA,IAAQ,CAAA,QAAA,GAAa,KAAK;AAEjD;;;AAGG;AACoB,QAAA,IAAQ,CAAA,QAAA,GAAa,KAAK;AAEjD;;AAEG;AACoB,QAAA,IAAQ,CAAA,QAAA,GAAa,KAAK;AAEjD;;AAEG;AACoB,QAAA,IAAI,CAAA,IAAA,GAAa,KAAK;AAE7C;;AAEG;AACoB,QAAA,IAAM,CAAA,MAAA,GAAY,CAAC;AAE1C;;AAEG;AACoB,QAAA,IAAM,CAAA,MAAA,GAAY,CAAC;AAE1C;;AAE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CAAC,IAAI,CAAC,iBAAiB;aACjD,EACD,CAAA,EAED,IAAI,CAAC,iBAAiB,KACrB,sBAAgB,MAAM,EAAE,CAAkC,+BAAA,EAAA,SAAS,CAAE,CAAA,EAAE,WAAW,EAAE,OAAO,IAAI,CAAC,iBAAiB,GAAG,KAAK,CAAC,EAAA,EACxH,CACE,CAAA,mCAAA,EAAA,EAAA,UAAU,EAAE,QAAQ,EACpB,SAAS,EAAE,SAAS,EACpB,OAAO,EAAE,MAAM,IAAI,CAAC,iBAAiB,EAAE,EACvC,QAAQ,EAAE,MAAK;;AACb,gBAAA,CAAA,EAAA,GAAA,IAAI,CAAC,OAAO,MAAA,IAAA,IAAA,EAAA,KAAA,MAAA,GAAA,MAAA,GAAA,EAAA,CAAE,IAAI,CAAC,EAAC,SAAS,EAAE,SAAS,EAAC,CAAC;AAC1C,gBAAA,OAAO,IAAI,CAAC,iBAAiB,EAAE;AACjC,aAAC,EACD,iBAAiB,EAAE,CAAC,IAAG;;AACrB,gBAAA,CAAA,EAAA,GAAA,IAAI,CAAC,eAAe,MAAE,IAAA,IAAA,EAAA,KAAA,MAAA,GAAA,MAAA,GAAA,EAAA,CAAA,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC;AACpC,gBAAA,OAAO,IAAI,CAAC,iBAAiB,EAAE;AACjC,aAAC,EACD,QAAQ,EAAE,0EAA0E,EAAA,CACpF,CACa,CAClB,CACQ,CACZ,CACI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["__stencil_proxyCustomElement","HTMLElement","format"],"sources":["src/components/fields/verdocs-field-timestamp/verdocs-field-timestamp.scss?tag=verdocs-field-timestamp","src/components/fields/verdocs-field-timestamp/verdocs-field-timestamp.tsx"],"sourcesContent":["@import '../../../theme.scss';\n\nverdocs-field-timestamp {\n width: 160px;\n height: 15px;\n display: block;\n font-size: 9px;\n position: relative;\n scroll-margin: 20px 0;\n background-color: transparent;\n transform-origin: bottom left;\n font-family: $verdocs-primary-font;\n\n &.done {\n opacity: 1;\n }\n\n input {\n position: absolute;\n\n // This is needed to bring down the cursor from the parent element, which is where interactjs applies it\n cursor: inherit;\n\n opacity: 0.5;\n width: 100%;\n height: 100%;\n font-size: 9px;\n background: none;\n font-weight: 500;\n transform-origin: 0 0;\n box-sizing: border-box;\n color: rgba(0, 0, 0, 0.87);\n border: 1px solid rgba(0, 0, 0, 0.2);\n\n &.hide {\n display: none;\n }\n }\n\n label {\n top: -14px;\n left: -1px;\n height: 14px;\n color: white;\n padding: 0 4px;\n font-size: 9px;\n line-height: 13px;\n position: absolute;\n background: #4a4a99;\n border-top-left-radius: 2px;\n border-top-right-radius: 2px;\n }\n\n &.required {\n border: 1px solid rgb(204, 0, 0);\n }\n\n &.focused {\n animation: verdocs-field-pulse 0.4s 1;\n }\n\n verdocs-button-panel {\n top: -3px;\n left: -2px;\n opacity: 0.5;\n z-index: 1000;\n cursor: pointer;\n position: absolute;\n transform: scale(0.6);\n\n &[data-active],\n &:hover {\n opacity: 1;\n }\n\n .icon {\n svg {\n fill: #333333;\n }\n\n &:hover {\n svg {\n fill: #000000;\n }\n }\n }\n }\n\n .settings-icon {\n position: absolute;\n top: -3px;\n left: -20px;\n display: inline-block;\n cursor: pointer;\n opacity: 0.3;\n\n svg {\n fill: $border-color;\n }\n\n &:hover {\n opacity: 1;\n }\n }\n}\n","import {format} from 'date-fns/format';\nimport {ITemplateField, getRGBA, IEnvelopeField} from '@verdocs/js-sdk';\nimport {Component, h, Host, Prop, Method, Event, EventEmitter, Fragment, State} from '@stencil/core';\nimport {FORMAT_TIMESTAMP} from '../../../utils/Types';\nimport {SettingsIcon} from '../../../utils/Icons';\nimport {Store} from '../../../utils/Datastore';\n\n/**\n * Display a timestamp. Timestamps are not editable by signers. Instead, they are automatically\n * filled when the signer submits the document.\n */\n@Component({\n tag: 'verdocs-field-timestamp',\n styleUrl: 'verdocs-field-timestamp.scss',\n shadow: false,\n})\nexport class VerdocsFieldTimestamp {\n private el: HTMLInputElement;\n\n /**\n * Fields may be attached to templates or envelopes, but only template fields may be edited.\n */\n @Prop({reflect: true}) source: 'template' | 'envelope' = 'template';\n\n /**\n * The source template or envelope ID the field is found in.\n */\n @Prop({reflect: true}) sourceid: string = '';\n\n /**\n * The name of the field to display.\n */\n @Prop({reflect: true}) fieldname: string = '';\n\n /**\n * Override the field's settings. This is intended to be used during signing when fields are being\n * mutated.\n */\n @Prop() field: IEnvelopeField | null | undefined = null;\n\n /**\n * If set, overrides the field's settings object. Primarily used to support \"preview\" modes where all fields are disabled.\n */\n @Prop({reflect: true}) disabled?: boolean = false;\n\n /**\n * If set, a settings icon will be displayed on hover. The settings shown allow the field's recipient and other settings to be\n * changed, so it should typically only be enabled in the Builder.\n */\n @Prop({reflect: true}) editable?: boolean = false;\n\n /**\n * If set, the field may be dragged to a new location. This should only be enabled in the Builder, or for self-placed fields.\n */\n @Prop({reflect: true}) moveable?: boolean = false;\n\n /**\n * If set, the field is considered \"done\" and is drawn in a display-final-value state.\n */\n @Prop({reflect: true}) done?: boolean = false;\n\n /**\n * If set, the field will be be scaled horizontally by this factor.\n */\n @Prop({reflect: true}) xscale?: number = 1;\n\n /**\n * If set, the field will be be scaled vertically by this factor.\n */\n @Prop({reflect: true}) yscale?: number = 1;\n\n /**\n * The page the field is on\n */\n @Prop() pagenumber?: number = 1;\n\n /**\n * Event fired when the field's settings are changed.\n */\n @Event({composed: true}) settingsChanged: EventEmitter<{fieldName: string; field: ITemplateField}>;\n\n /**\n * Event fired when the field is deleted.\n */\n @Event({composed: true}) deleted: EventEmitter<{fieldName: string}>;\n\n @State() showingProperties?: boolean = false;\n\n @Method() async focusField() {\n this.el.focus();\n }\n\n @Method()\n async showSettingsPanel() {\n const settingsPanel = document.getElementById(`verdocs-settings-panel-${this.fieldname}`) as any;\n if (settingsPanel && settingsPanel.showPanel) {\n settingsPanel.showPanel();\n }\n }\n\n @Method()\n async hideSettingsPanel() {\n const settingsPanel = document.getElementById(`verdocs-settings-panel-${this.fieldname}`) as any;\n if (settingsPanel && settingsPanel.hidePanel) {\n settingsPanel.hidePanel();\n }\n this.showingProperties = false;\n }\n\n render() {\n const {source, sourceid, fieldname, editable = false, done = false, disabled = false, xscale = 1, yscale = 1} = this;\n\n const {index, field} = Store.getField(source, sourceid, fieldname, this.field);\n const {required = false, placeholder = '', value = '', label = ''} = field || {};\n const backgroundColor = getRGBA(index);\n\n const formatted = format(new Date(value || new Date().toISOString()), FORMAT_TIMESTAMP);\n\n if (done) {\n return <Host class={{done}}>{formatted}</Host>;\n }\n\n return (\n <Host class={{required, disabled, done}} style={{backgroundColor}}>\n {label && <label>{label}</label>}\n <input type=\"text\" placeholder={placeholder} value={formatted} disabled={true} ref={el => (this.el = el)} />\n\n {editable && (\n <Fragment>\n <div\n id={`verdocs-settings-panel-trigger-${fieldname}`}\n style={{transform: `scale(${Math.floor((1 / xscale) * 1000) / 1000}, ${Math.floor((1 / yscale) * 1000) / 1000})`}}\n class=\"settings-icon\"\n innerHTML={SettingsIcon}\n onClick={(e: any) => {\n e.stopPropagation();\n this.showingProperties = !this.showingProperties;\n }}\n />\n\n {this.showingProperties && (\n <verdocs-portal anchor={`verdocs-settings-panel-trigger-${fieldname}`} onClickAway={() => (this.showingProperties = false)}>\n <verdocs-template-field-properties\n templateId={sourceid}\n fieldName={fieldname}\n onClose={() => this.hideSettingsPanel()}\n onDelete={() => {\n this.deleted?.emit({fieldName: fieldname});\n return this.hideSettingsPanel();\n }}\n onSettingsChanged={e => {\n this.settingsChanged?.emit(e.detail);\n return this.hideSettingsPanel();\n }}\n helpText={'Time stamps are automatically set when the recipient signs the document.'}\n />\n </verdocs-portal>\n )}\n </Fragment>\n )}\n </Host>\n );\n }\n}\n"],"version":3}
@@ -12,7 +12,7 @@ import { d as defineCustomElement$6 } from './p-DGJlf5J_.js';
12
12
  import { d as defineCustomElement$5 } from './p-D_QT5uZk.js';
13
13
  import { d as defineCustomElement$4 } from './p-C3iwT41e.js';
14
14
  import { d as defineCustomElement$3 } from './p-kvTSiSQ0.js';
15
- import { d as defineCustomElement$2 } from './p-TkHAxPB_.js';
15
+ import { d as defineCustomElement$2 } from './p-Da1nfhXq.js';
16
16
  import { d as defineCustomElement$1 } from './p-BvDqCFDj.js';
17
17
 
18
18
  const verdocsFieldDateCss = "@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-field-date{font-family:\"Inter\", -apple-system, \"Segoe UI\", \"Roboto\", \"Helvetica Neue\", sans-serif;width:74px;height:20px;display:block;font-size:11px;position:relative;scroll-margin:20px 0;letter-spacing:0.3px;background-color:transparent;-webkit-transform-origin:bottom left;transform-origin:bottom left}verdocs-field-date.focused{-webkit-animation:verdocs-field-pulse 0.4s 1;animation:verdocs-field-pulse 0.4s 1}verdocs-field-date label{top:-14px;left:0;height:14px;color:white;padding:0 4px;font-size:9px;line-height:13px;position:absolute;background:#4a4a99;border-top-left-radius:2px;border-top-right-radius:2px}verdocs-field-date input{position:absolute;font-size:12px;cursor:inherit;-webkit-box-sizing:border-box;box-sizing:border-box;color:rgba(0, 0, 0, 0.87);font-weight:500;-webkit-transform-origin:0 0;transform-origin:0 0;height:100%;width:100%;background:none;border:1px solid #cccccc;-webkit-appearance:none;-moz-appearance:none;appearance:none}verdocs-field-date input.hide{display:none}verdocs-field-date.disabled input{opacity:0.5}verdocs-field-date.required input{border:1px solid #cc0000}verdocs-field-date verdocs-button-panel{top:-3px;left:-2px;opacity:0.5;z-index:1000;cursor:pointer;position:absolute;-webkit-transform:scale(0.6);transform:scale(0.6)}verdocs-field-date verdocs-button-panel[data-active],verdocs-field-date verdocs-button-panel:hover{opacity:1}verdocs-field-date verdocs-button-panel .icon svg{fill:#333333}verdocs-field-date verdocs-button-panel .icon:hover svg{fill:#000000}verdocs-field-date .settings-icon{position:absolute;top:-3px;left:-18px;display:inline-block;cursor:pointer;opacity:0.3}verdocs-field-date .settings-icon svg{fill:#707ae5}verdocs-field-date .settings-icon:hover{opacity:1}.air-datepicker-cell.-year-.-other-decade-,.air-datepicker-cell.-day-.-other-month-{color:var(--adp-color-other-month)}.air-datepicker-cell.-year-.-other-decade-:hover,.air-datepicker-cell.-day-.-other-month-:hover{color:var(--adp-color-other-month-hover)}.-disabled-.-focus-.air-datepicker-cell.-year-.-other-decade-,.-disabled-.-focus-.air-datepicker-cell.-day-.-other-month-{color:var(--adp-color-other-month)}.-selected-.air-datepicker-cell.-year-.-other-decade-,.-selected-.air-datepicker-cell.-day-.-other-month-{color:#fff;background:var(--adp-background-color-selected-other-month)}.-selected-.-focus-.air-datepicker-cell.-year-.-other-decade-,.-selected-.-focus-.air-datepicker-cell.-day-.-other-month-{background:var(--adp-background-color-selected-other-month-focused)}.-in-range-.air-datepicker-cell.-year-.-other-decade-,.-in-range-.air-datepicker-cell.-day-.-other-month-{background-color:var(--adp-background-color-in-range);color:var(--adp-color)}.-in-range-.-focus-.air-datepicker-cell.-year-.-other-decade-,.-in-range-.-focus-.air-datepicker-cell.-day-.-other-month-{background-color:var(--adp-background-color-in-range-focused)}.air-datepicker-cell.-year-.-other-decade-:empty,.air-datepicker-cell.-day-.-other-month-:empty{background:none;border:none}.air-datepicker-cell{border-radius:var(--adp-cell-border-radius);-webkit-box-sizing:border-box;box-sizing:border-box;cursor:pointer;display:-ms-flexbox;display:flex;position:relative;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;z-index:1}.air-datepicker-cell.-focus-{background:var(--adp-cell-background-color-hover)}.air-datepicker-cell.-current-{color:var(--adp-color-current-date)}.air-datepicker-cell.-current-.-focus-{color:var(--adp-color)}.air-datepicker-cell.-current-.-in-range-{color:var(--adp-color-current-date)}.air-datepicker-cell.-disabled-{cursor:default;color:var(--adp-color-disabled)}.air-datepicker-cell.-disabled-.-focus-{color:var(--adp-color-disabled)}.air-datepicker-cell.-disabled-.-in-range-{color:var(--adp-color-disabled-in-range)}.air-datepicker-cell.-disabled-.-current-.-focus-{color:var(--adp-color-disabled)}.air-datepicker-cell.-in-range-{background:var(--adp-cell-background-color-in-range);border-radius:0}.air-datepicker-cell.-in-range-:hover{background:var(--adp-cell-background-color-in-range-hover)}.air-datepicker-cell.-range-from-{border:1px solid var(--adp-cell-border-color-in-range);background-color:var(--adp-cell-background-color-in-range);border-radius:var(--adp-cell-border-radius) 0 0 var(--adp-cell-border-radius)}.air-datepicker-cell.-range-to-{border:1px solid var(--adp-cell-border-color-in-range);background-color:var(--adp-cell-background-color-in-range);border-radius:0 var(--adp-cell-border-radius) var(--adp-cell-border-radius) 0}.air-datepicker-cell.-range-to-.-range-from-{border-radius:var(--adp-cell-border-radius)}.air-datepicker-cell.-selected-{color:#fff;border:none;background:var(--adp-cell-background-color-selected)}.air-datepicker-cell.-selected-.-current-{color:#fff;background:var(--adp-cell-background-color-selected)}.air-datepicker-cell.-selected-.-focus-{background:var(--adp-cell-background-color-selected-hover)}.air-datepicker-body{-webkit-transition:all var(--adp-transition-duration) var(--adp-transition-ease);transition:all var(--adp-transition-duration) var(--adp-transition-ease)}.air-datepicker-body.-hidden-{display:none}.air-datepicker-body--day-names{display:grid;grid-template-columns:repeat(7, var(--adp-day-cell-width));margin:8px 0 3px}.air-datepicker-body--day-name{color:var(--adp-day-name-color);display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;-ms-flex:1;flex:1;text-align:center;text-transform:uppercase;font-size:0.8em}.air-datepicker-body--day-name.-clickable-{cursor:pointer}.air-datepicker-body--day-name.-clickable-:hover{color:var(--adp-day-name-color-hover)}.air-datepicker-body--cells{display:grid}.air-datepicker-body--cells.-days-{grid-template-columns:repeat(7, var(--adp-day-cell-width));grid-auto-rows:var(--adp-day-cell-height)}.air-datepicker-body--cells.-months-{grid-template-columns:repeat(3, 1fr);grid-auto-rows:var(--adp-month-cell-height)}.air-datepicker-body--cells.-years-{grid-template-columns:repeat(4, 1fr);grid-auto-rows:var(--adp-year-cell-height)}.air-datepicker-nav{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;border-bottom:1px solid var(--adp-border-color-inner);min-height:var(--adp-nav-height);padding:var(--adp-padding);-webkit-box-sizing:content-box;box-sizing:content-box}.-only-timepicker- .air-datepicker-nav{display:none}.air-datepicker-nav--title,.air-datepicker-nav--action{display:-ms-flexbox;display:flex;cursor:pointer;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center}.air-datepicker-nav--action{width:var(--adp-nav-action-size);border-radius:var(--adp-border-radius);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.air-datepicker-nav--action:hover{background:var(--adp-background-color-hover)}.air-datepicker-nav--action:active{background:var(--adp-background-color-active)}.air-datepicker-nav--action.-disabled-{visibility:hidden}.air-datepicker-nav--action svg{width:32px;height:32px}.air-datepicker-nav--action path{fill:none;stroke:var(--adp-nav-arrow-color);stroke-width:2px}.air-datepicker-nav--title{border-radius:var(--adp-border-radius);padding:0 8px}.air-datepicker-nav--title i{font-style:normal;color:var(--adp-nav-color-secondary);margin-left:0.3em}.air-datepicker-nav--title:hover{background:var(--adp-background-color-hover)}.air-datepicker-nav--title:active{background:var(--adp-background-color-active)}.air-datepicker-nav--title.-disabled-{cursor:default;background:none}.air-datepicker-buttons{display:grid;grid-auto-columns:1fr;grid-auto-flow:column}.air-datepicker-button{display:-ms-inline-flexbox;display:inline-flex;color:var(--adp-btn-color);border-radius:var(--adp-btn-border-radius);cursor:pointer;height:var(--adp-btn-height);border:none;background:rgba(255, 255, 255, 0)}.air-datepicker-button:hover{color:var(--adp-btn-color-hover);background:var(--adp-btn-background-color-hover)}.air-datepicker-button:focus{color:var(--adp-btn-color-hover);background:var(--adp-btn-background-color-hover);outline:none}.air-datepicker-button:active{background:var(--adp-btn-background-color-active)}.air-datepicker-button span{outline:none;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;width:100%;height:100%}.air-datepicker-time{display:grid;grid-template-columns:-webkit-max-content 1fr;grid-template-columns:max-content 1fr;grid-column-gap:12px;-ms-flex-align:center;align-items:center;position:relative;padding:0 var(--adp-time-padding-inner)}.-only-timepicker- .air-datepicker-time{border-top:none}.air-datepicker-time--current{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex:1;flex:1;font-size:14px;text-align:center}.air-datepicker-time--current-colon{margin:0 2px 3px;line-height:1}.air-datepicker-time--current-hours,.air-datepicker-time--current-minutes{line-height:1;font-size:19px;font-family:\"Century Gothic\", CenturyGothic, AppleGothic, sans-serif;position:relative;z-index:1}.air-datepicker-time--current-hours:after,.air-datepicker-time--current-minutes:after{content:\"\";background:var(--adp-background-color-hover);border-radius:var(--adp-border-radius);position:absolute;left:-2px;top:-3px;right:-2px;bottom:-2px;z-index:-1;opacity:0}.air-datepicker-time--current-hours.-focus-:after,.air-datepicker-time--current-minutes.-focus-:after{opacity:1}.air-datepicker-time--current-ampm{text-transform:uppercase;-ms-flex-item-align:end;align-self:flex-end;color:var(--adp-time-day-period-color);margin-left:6px;font-size:11px;margin-bottom:1px}.air-datepicker-time--row{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;font-size:11px;height:17px;background:-webkit-gradient(linear, left top, right top, from(var(--adp-time-track-color)), to(var(--adp-time-track-color))) left 50%/100% var(--adp-time-track-height) no-repeat;background:linear-gradient(to right, var(--adp-time-track-color), var(--adp-time-track-color)) left 50%/100% var(--adp-time-track-height) no-repeat}.air-datepicker-time--row:first-child{margin-bottom:4px}.air-datepicker-time--row input[type=range]{background:none;cursor:pointer;-ms-flex:1;flex:1;height:100%;width:100%;padding:0;margin:0;-webkit-appearance:none}.air-datepicker-time--row input[type=range]::-webkit-slider-thumb{-webkit-appearance:none}.air-datepicker-time--row input[type=range]::-ms-tooltip{display:none}.air-datepicker-time--row input[type=range]:hover::-webkit-slider-thumb{border-color:var(--adp-time-track-color-hover)}.air-datepicker-time--row input[type=range]:hover::-moz-range-thumb{border-color:var(--adp-time-track-color-hover)}.air-datepicker-time--row input[type=range]:hover::-ms-thumb{border-color:var(--adp-time-track-color-hover)}.air-datepicker-time--row input[type=range]:focus{outline:none}.air-datepicker-time--row input[type=range]:focus::-webkit-slider-thumb{background:var(--adp-cell-background-color-selected);border-color:var(--adp-cell-background-color-selected)}.air-datepicker-time--row input[type=range]:focus::-moz-range-thumb{background:var(--adp-cell-background-color-selected);border-color:var(--adp-cell-background-color-selected)}.air-datepicker-time--row input[type=range]:focus::-ms-thumb{background:var(--adp-cell-background-color-selected);border-color:var(--adp-cell-background-color-selected)}.air-datepicker-time--row input[type=range]::-webkit-slider-thumb{-webkit-box-sizing:border-box;box-sizing:border-box;height:12px;width:12px;border-radius:3px;border:1px solid var(--adp-time-track-color);background:#fff;cursor:pointer;-webkit-transition:background var(--adp-transition-duration);transition:background var(--adp-transition-duration)}.air-datepicker-time--row input[type=range]::-moz-range-thumb{box-sizing:border-box;height:12px;width:12px;border-radius:3px;border:1px solid var(--adp-time-track-color);background:#fff;cursor:pointer;-moz-transition:background var(--adp-transition-duration);transition:background var(--adp-transition-duration)}.air-datepicker-time--row input[type=range]::-ms-thumb{box-sizing:border-box;height:12px;width:12px;border-radius:3px;border:1px solid var(--adp-time-track-color);background:#fff;cursor:pointer;-ms-transition:background var(--adp-transition-duration);transition:background var(--adp-transition-duration)}.air-datepicker-time--row input[type=range]::-webkit-slider-thumb{margin-top:calc(var(--adp-time-thumb-size) / 2 * -1)}.air-datepicker-time--row input[type=range]::-webkit-slider-runnable-track{border:none;height:var(--adp-time-track-height);cursor:pointer;color:rgba(0, 0, 0, 0);background:rgba(0, 0, 0, 0)}.air-datepicker-time--row input[type=range]::-moz-range-track{border:none;height:var(--adp-time-track-height);cursor:pointer;color:rgba(0, 0, 0, 0);background:rgba(0, 0, 0, 0)}.air-datepicker-time--row input[type=range]::-ms-track{border:none;height:var(--adp-time-track-height);cursor:pointer;color:rgba(0, 0, 0, 0);background:rgba(0, 0, 0, 0)}.air-datepicker-time--row input[type=range]::-ms-fill-lower{background:rgba(0, 0, 0, 0)}.air-datepicker-time--row input[type=range]::-ms-fill-upper{background:rgba(0, 0, 0, 0)}.air-datepicker{--adp-font-family:-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\";--adp-font-size:14px;--adp-width:246px;--adp-z-index:100;--adp-padding:4px;--adp-grid-areas:\"nav\" \"body\" \"timepicker\" \"buttons\";--adp-transition-duration:0.3s;--adp-transition-ease:ease-out;--adp-transition-offset:8px;--adp-background-color:#fff;--adp-background-color-hover:#f0f0f0;--adp-background-color-active:#eaeaea;--adp-background-color-in-range:rgba(92, 196, 239, 0.1);--adp-background-color-in-range-focused:rgba(92, 196, 239, 0.2);--adp-background-color-selected-other-month-focused:#8ad5f4;--adp-background-color-selected-other-month:#a2ddf6;--adp-color:#4a4a4a;--adp-color-secondary:#9c9c9c;--adp-accent-color:#4eb5e6;--adp-color-current-date:var(--adp-accent-color);--adp-color-other-month:#dedede;--adp-color-disabled:#aeaeae;--adp-color-disabled-in-range:#939393;--adp-color-other-month-hover:#c5c5c5;--adp-border-color:#dbdbdb;--adp-border-color-inner:#efefef;--adp-border-radius:4px;--adp-border-color-inline:#d7d7d7;--adp-nav-height:32px;--adp-nav-arrow-color:var(--adp-color-secondary);--adp-nav-action-size:32px;--adp-nav-color-secondary:var(--adp-color-secondary);--adp-day-name-color:#ff9a19;--adp-day-name-color-hover:#8ad5f4;--adp-day-cell-width:1fr;--adp-day-cell-height:32px;--adp-month-cell-height:42px;--adp-year-cell-height:56px;--adp-pointer-size:10px;--adp-poiner-border-radius:2px;--adp-pointer-offset:14px;--adp-cell-border-radius:4px;--adp-cell-background-color-hover:var(--adp-background-color-hover);--adp-cell-background-color-selected:#5cc4ef;--adp-cell-background-color-selected-hover:#45bced;--adp-cell-background-color-in-range:rgba(92, 196, 239, 0.1);--adp-cell-background-color-in-range-hover:rgba(92, 196, 239, 0.2);--adp-cell-border-color-in-range:var(--adp-cell-background-color-selected);--adp-btn-height:32px;--adp-btn-color:var(--adp-accent-color);--adp-btn-color-hover:var(--adp-color);--adp-btn-border-radius:var(--adp-border-radius);--adp-btn-background-color-hover:var(--adp-background-color-hover);--adp-btn-background-color-active:var(--adp-background-color-active);--adp-time-track-height:1px;--adp-time-track-color:#dedede;--adp-time-track-color-hover:#b1b1b1;--adp-time-thumb-size:12px;--adp-time-padding-inner:10px;--adp-time-day-period-color:var(--adp-color-secondary);--adp-mobile-font-size:16px;--adp-mobile-nav-height:40px;--adp-mobile-width:320px;--adp-mobile-day-cell-height:38px;--adp-mobile-month-cell-height:48px;--adp-mobile-year-cell-height:64px}.air-datepicker-overlay{--adp-overlay-background-color:rgba(0, 0, 0, 0.3);--adp-overlay-transition-duration:0.3s;--adp-overlay-transition-ease:ease-out;--adp-overlay-z-index:99}.air-datepicker{background:var(--adp-background-color);border:1px solid var(--adp-border-color);-webkit-box-shadow:0 4px 12px rgba(0, 0, 0, 0.15);box-shadow:0 4px 12px rgba(0, 0, 0, 0.15);border-radius:var(--adp-border-radius);-webkit-box-sizing:content-box;box-sizing:content-box;display:grid;grid-template-columns:1fr;grid-template-rows:repeat(4, -webkit-max-content);grid-template-rows:repeat(4, max-content);grid-template-areas:var(--adp-grid-areas);font-family:var(--adp-font-family), sans-serif;font-size:var(--adp-font-size);color:var(--adp-color);width:var(--adp-width);position:absolute;-webkit-transition:opacity var(--adp-transition-duration) var(--adp-transition-ease), -webkit-transform var(--adp-transition-duration) var(--adp-transition-ease);transition:opacity var(--adp-transition-duration) var(--adp-transition-ease), -webkit-transform var(--adp-transition-duration) var(--adp-transition-ease);transition:opacity var(--adp-transition-duration) var(--adp-transition-ease), transform var(--adp-transition-duration) var(--adp-transition-ease);transition:opacity var(--adp-transition-duration) var(--adp-transition-ease), transform var(--adp-transition-duration) var(--adp-transition-ease), -webkit-transform var(--adp-transition-duration) var(--adp-transition-ease);z-index:var(--adp-z-index)}.air-datepicker:not(.-custom-position-){opacity:0}.air-datepicker.-from-top-{-webkit-transform:translateY(calc(var(--adp-transition-offset) * -1));transform:translateY(calc(var(--adp-transition-offset) * -1))}.air-datepicker.-from-right-{-webkit-transform:translateX(var(--adp-transition-offset));transform:translateX(var(--adp-transition-offset))}.air-datepicker.-from-bottom-{-webkit-transform:translateY(var(--adp-transition-offset));transform:translateY(var(--adp-transition-offset))}.air-datepicker.-from-left-{-webkit-transform:translateX(calc(var(--adp-transition-offset) * -1));transform:translateX(calc(var(--adp-transition-offset) * -1))}.air-datepicker.-active-:not(.-custom-position-){-webkit-transform:translate(0, 0);transform:translate(0, 0);opacity:1}.air-datepicker.-active-.-custom-position-{-webkit-transition:none;transition:none}.air-datepicker.-inline-{border-color:var(--adp-border-color-inline);-webkit-box-shadow:none;box-shadow:none;position:static;left:auto;right:auto;opacity:1;-webkit-transform:none;transform:none}.air-datepicker.-inline- .air-datepicker--pointer{display:none}.air-datepicker.-is-mobile-{--adp-font-size:var(--adp-mobile-font-size);--adp-day-cell-height:var(--adp-mobile-day-cell-height);--adp-month-cell-height:var(--adp-mobile-month-cell-height);--adp-year-cell-height:var(--adp-mobile-year-cell-height);--adp-nav-height:var(--adp-mobile-nav-height);--adp-nav-action-size:var(--adp-mobile-nav-height);position:fixed;width:var(--adp-mobile-width);border:none}.air-datepicker.-is-mobile- *{-webkit-tap-highlight-color:rgba(0, 0, 0, 0)}.air-datepicker.-is-mobile- .air-datepicker--pointer{display:none}.air-datepicker.-is-mobile-:not(.-custom-position-){-webkit-transform:translate(-50%, calc(-50% + var(--adp-transition-offset)));transform:translate(-50%, calc(-50% + var(--adp-transition-offset)))}.air-datepicker.-is-mobile-.-active-:not(.-custom-position-){-webkit-transform:translate(-50%, -50%);transform:translate(-50%, -50%)}.air-datepicker.-custom-position-{-webkit-transition:none;transition:none}.air-datepicker-global-container{position:absolute;left:0;top:0}.air-datepicker--pointer{--pointer-half-size:calc(var(--adp-pointer-size) / 2);position:absolute;width:var(--adp-pointer-size);height:var(--adp-pointer-size);z-index:-1}.air-datepicker--pointer:after{content:\"\";position:absolute;background:#fff;border-top:1px solid var(--adp-border-color-inline);border-right:1px solid var(--adp-border-color-inline);border-top-right-radius:var(--adp-poiner-border-radius);width:var(--adp-pointer-size);height:var(--adp-pointer-size);-webkit-box-sizing:border-box;box-sizing:border-box}.-top-left- .air-datepicker--pointer,.-top-center- .air-datepicker--pointer,.-top-right- .air-datepicker--pointer,[data-popper-placement^=top] .air-datepicker--pointer{top:calc(100% - var(--pointer-half-size) + 1px)}.-top-left- .air-datepicker--pointer:after,.-top-center- .air-datepicker--pointer:after,.-top-right- .air-datepicker--pointer:after,[data-popper-placement^=top] .air-datepicker--pointer:after{-webkit-transform:rotate(135deg);transform:rotate(135deg)}.-right-top- .air-datepicker--pointer,.-right-center- .air-datepicker--pointer,.-right-bottom- .air-datepicker--pointer,[data-popper-placement^=right] .air-datepicker--pointer{right:calc(100% - var(--pointer-half-size) + 1px)}.-right-top- .air-datepicker--pointer:after,.-right-center- .air-datepicker--pointer:after,.-right-bottom- .air-datepicker--pointer:after,[data-popper-placement^=right] .air-datepicker--pointer:after{-webkit-transform:rotate(225deg);transform:rotate(225deg)}.-bottom-left- .air-datepicker--pointer,.-bottom-center- .air-datepicker--pointer,.-bottom-right- .air-datepicker--pointer,[data-popper-placement^=bottom] .air-datepicker--pointer{bottom:calc(100% - var(--pointer-half-size) + 1px)}.-bottom-left- .air-datepicker--pointer:after,.-bottom-center- .air-datepicker--pointer:after,.-bottom-right- .air-datepicker--pointer:after,[data-popper-placement^=bottom] .air-datepicker--pointer:after{-webkit-transform:rotate(315deg);transform:rotate(315deg)}.-left-top- .air-datepicker--pointer,.-left-center- .air-datepicker--pointer,.-left-bottom- .air-datepicker--pointer,[data-popper-placement^=left] .air-datepicker--pointer{left:calc(100% - var(--pointer-half-size) + 1px)}.-left-top- .air-datepicker--pointer:after,.-left-center- .air-datepicker--pointer:after,.-left-bottom- .air-datepicker--pointer:after,[data-popper-placement^=left] .air-datepicker--pointer:after{-webkit-transform:rotate(45deg);transform:rotate(45deg)}.-top-left- .air-datepicker--pointer,.-bottom-left- .air-datepicker--pointer{left:var(--adp-pointer-offset)}.-top-right- .air-datepicker--pointer,.-bottom-right- .air-datepicker--pointer{right:var(--adp-pointer-offset)}.-top-center- .air-datepicker--pointer,.-bottom-center- .air-datepicker--pointer{left:calc(50% - var(--adp-pointer-size) / 2)}.-left-top- .air-datepicker--pointer,.-right-top- .air-datepicker--pointer{top:var(--adp-pointer-offset)}.-left-bottom- .air-datepicker--pointer,.-right-bottom- .air-datepicker--pointer{bottom:var(--adp-pointer-offset)}.-left-center- .air-datepicker--pointer,.-right-center- .air-datepicker--pointer{top:calc(50% - var(--adp-pointer-size) / 2)}.air-datepicker--navigation{grid-area:nav}.air-datepicker--content{-webkit-box-sizing:content-box;box-sizing:content-box;padding:var(--adp-padding);grid-area:body}.-only-timepicker- .air-datepicker--content{display:none}.air-datepicker--time{grid-area:timepicker}.air-datepicker--buttons{grid-area:buttons}.air-datepicker--buttons,.air-datepicker--time{padding:var(--adp-padding);border-top:1px solid var(--adp-border-color-inner)}.air-datepicker-overlay{position:fixed;background:var(--adp-overlay-background-color);left:0;top:0;width:0;height:0;opacity:0;-webkit-transition:opacity var(--adp-overlay-transition-duration) var(--adp-overlay-transition-ease), left 0s, height 0s, width 0s;transition:opacity var(--adp-overlay-transition-duration) var(--adp-overlay-transition-ease), left 0s, height 0s, width 0s;-webkit-transition-delay:0s, var(--adp-overlay-transition-duration), var(--adp-overlay-transition-duration), var(--adp-overlay-transition-duration);transition-delay:0s, var(--adp-overlay-transition-duration), var(--adp-overlay-transition-duration), var(--adp-overlay-transition-duration);z-index:var(--adp-overlay-z-index)}.air-datepicker-overlay.-active-{opacity:1;width:100%;height:100%;-webkit-transition:opacity var(--adp-overlay-transition-duration) var(--adp-overlay-transition-ease), height 0s, width 0s;transition:opacity var(--adp-overlay-transition-duration) var(--adp-overlay-transition-ease), height 0s, width 0s}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}";
@@ -82,17 +82,22 @@ const VerdocsFieldDate = /*@__PURE__*/ proxyCustomElement(class VerdocsFieldDate
82
82
  }, 500);
83
83
  }
84
84
  componentDidLoad() {
85
- this.picker = new AirDatepicker(`#${this.containerId}`, {
86
- locale: localeEn,
87
- isMobile: true,
88
- autoClose: true,
89
- onShow: () => (this.focused = true),
90
- onHide: () => (this.focused = false),
91
- onSelect: ({ date, formattedDate }) => {
92
- const event = new CustomEvent('fieldChange', { detail: { date, formattedDate } });
93
- this.hostEl.dispatchEvent(event);
94
- },
95
- });
85
+ const { source, sourceid, fieldname } = this;
86
+ const { field } = Store.getField(source, sourceid, fieldname, this.field);
87
+ const { readonly = false } = field || {};
88
+ if (!readonly) {
89
+ this.picker = new AirDatepicker(`#${this.containerId}`, {
90
+ locale: localeEn,
91
+ isMobile: true,
92
+ autoClose: true,
93
+ onShow: () => (this.focused = true),
94
+ onHide: () => (this.focused = false),
95
+ onSelect: ({ date, formattedDate }) => {
96
+ const event = new CustomEvent('fieldChange', { detail: { date, formattedDate } });
97
+ this.hostEl.dispatchEvent(event);
98
+ },
99
+ });
100
+ }
96
101
  }
97
102
  async showSettingsPanel() {
98
103
  const settingsPanel = document.getElementById(`verdocs-settings-panel-${this.fieldname}`);
@@ -210,6 +215,6 @@ function defineCustomElement() {
210
215
  }
211
216
 
212
217
  export { VerdocsFieldDate as V, defineCustomElement as d };
213
- //# sourceMappingURL=p-DfTz53m-.js.map
218
+ //# sourceMappingURL=p-CJt2BxDt.js.map
214
219
 
215
- //# sourceMappingURL=p-DfTz53m-.js.map
220
+ //# sourceMappingURL=p-CJt2BxDt.js.map