@verdocs/web-sdk 4.2.79 → 4.2.84
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/verdocs-checkbox_4.cjs.entry.js +2 -1
- package/dist/cjs/verdocs-field-attachment_13.cjs.entry.js +6 -3
- package/dist/collection/components/fields/verdocs-field-signature/verdocs-field-signature.js +2 -1
- package/dist/collection/components/fields/verdocs-field-textbox/verdocs-field-textbox.js +2 -1
- package/dist/collection/components/fields/verdocs-field-timestamp/verdocs-field-timestamp.js +2 -1
- package/dist/collection/components/templates/verdocs-template-field-properties/verdocs-template-field-properties.js +2 -1
- package/dist/components/verdocs-field-signature2.js +2 -1
- package/dist/components/verdocs-field-textbox2.js +2 -1
- package/dist/components/verdocs-field-timestamp2.js +2 -1
- package/dist/components/verdocs-template-field-properties2.js +2 -1
- package/dist/esm/verdocs-checkbox_4.entry.js +2 -1
- package/dist/esm/verdocs-field-attachment_13.entry.js +6 -3
- package/dist/esm-es5/verdocs-checkbox_4.entry.js +1 -1
- package/dist/esm-es5/verdocs-field-attachment_13.entry.js +1 -1
- package/dist/verdocs-web-sdk/p-30c0a251.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-34325ad6.system.js +1 -1
- package/dist/verdocs-web-sdk/{p-73b7249a.system.entry.js → p-6ac15c93.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-912f8ad2.entry.js → p-b241b339.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-ea31368b.system.entry.js → p-c2d00ebf.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/verdocs-web-sdk.esm.js +1 -1
- package/package.json +2 -2
- package/dist/verdocs-web-sdk/p-acc43b94.entry.js +0 -1
@@ -126,6 +126,7 @@ const VerdocsTemplateFieldProperties = class {
|
|
126
126
|
const field = this.fieldStore.get('fields').find(field => field.name === this.fieldName);
|
127
127
|
if (!field) {
|
128
128
|
console.log(`[FIELD PROPERTIES] Unable to find field "${this.fieldName}" in fields`);
|
129
|
+
return;
|
129
130
|
}
|
130
131
|
else {
|
131
132
|
console.log('[FIELD PROPERTIES]', field);
|
@@ -167,8 +168,8 @@ const VerdocsTemplateFieldProperties = class {
|
|
167
168
|
jsSdk.updateField(this.endpoint, this.templateId, this.fieldName, newProperties)
|
168
169
|
.then(updated => {
|
169
170
|
var _a, _b, _c;
|
171
|
+
console.log('[FIELD PROPERTIES] Updated', updated);
|
170
172
|
TemplateFieldStore.updateStoreField(this.fieldStore, this.fieldName, updated);
|
171
|
-
this.resetForm();
|
172
173
|
(_a = this.settingsChanged) === null || _a === void 0 ? void 0 : _a.emit({ fieldName: this.fieldName, field: updated });
|
173
174
|
(_b = this.close) === null || _b === void 0 ? void 0 : _b.emit();
|
174
175
|
(_c = document.getElementById('verdocs-template-field-properties')) === null || _c === void 0 ? void 0 : _c.remove();
|
@@ -612,6 +612,7 @@ const VerdocsFieldSignature = class {
|
|
612
612
|
if (settingsPanel && settingsPanel.hidePanel) {
|
613
613
|
settingsPanel.hidePanel();
|
614
614
|
}
|
615
|
+
this.showingProperties = false;
|
615
616
|
}
|
616
617
|
async componentWillLoad() {
|
617
618
|
this.fieldStore = TemplateFieldStore.getTemplateFieldStore(this.templateid);
|
@@ -628,7 +629,7 @@ const VerdocsFieldSignature = class {
|
|
628
629
|
return (index.h(index.Host, { class: { required, disabled, done, focused }, style: { backgroundColor } }, label && index.h("label", null, label), value ? index.h("img", { src: value, alt: "Signature" }) : index.h("button", { onClick: () => !disabled && this.handleShow() }, "Signature"), editable && (index.h(index.Fragment, null, index.h("div", { id: `verdocs-settings-panel-trigger-${fieldname}`, style: { transform: `scale(${Math.floor((1 / xscale) * 1000) / 1000}, ${Math.floor((1 / yscale) * 1000) / 1000})` }, class: "settings-icon", innerHTML: Icons.SettingsIcon, onClick: (e) => {
|
629
630
|
e.stopPropagation();
|
630
631
|
this.showingProperties = !this.showingProperties;
|
631
|
-
} }), this.showingProperties && (index.h("verdocs-portal", { anchor: `verdocs-settings-panel-trigger-${fieldname}`, onClickAway: () => (this.showingProperties = false) }, index.h("verdocs-template-field-properties", { templateId: templateid, fieldName: fieldname, onClose: () =>
|
632
|
+
} }), this.showingProperties && (index.h("verdocs-portal", { anchor: `verdocs-settings-panel-trigger-${fieldname}`, onClickAway: () => (this.showingProperties = false) }, index.h("verdocs-template-field-properties", { templateId: templateid, fieldName: fieldname, onClose: () => this.hideSettingsPanel(), onDelete: () => {
|
632
633
|
var _a;
|
633
634
|
(_a = this.deleted) === null || _a === void 0 ? void 0 : _a.emit({ fieldName: fieldname });
|
634
635
|
return this.hideSettingsPanel();
|
@@ -794,6 +795,7 @@ const VerdocsFieldTextbox = class {
|
|
794
795
|
if (settingsPanel && settingsPanel.hidePanel) {
|
795
796
|
settingsPanel.hidePanel();
|
796
797
|
}
|
798
|
+
this.showingProperties = false;
|
797
799
|
}
|
798
800
|
async componentWillLoad() {
|
799
801
|
this.fieldStore = TemplateFieldStore.getTemplateFieldStore(this.templateid);
|
@@ -870,7 +872,7 @@ const VerdocsFieldTextbox = class {
|
|
870
872
|
return (index.h(index.Host, { class: { required, disabled, done, focused }, style: { backgroundColor } }, label && index.h("label", null, label), multiline ? (index.h("textarea", { name: fieldname, disabled: disabled, required: required, placeholder: placeholder, ref: el => (this.inputEl = el), onFocus: () => (this.focused = true), onBlur: () => (this.focused = false) }, value)) : (index.h("input", { type: "text", name: fieldname, value: value, disabled: disabled, required: required, placeholder: placeholder, maxlength: maxlength, ref: el => (this.inputEl = el), onFocus: () => (this.focused = true), onBlur: () => (this.focused = false) })), editable && (index.h(index.Fragment, null, index.h("div", { id: `verdocs-settings-panel-trigger-${fieldname}`, style: { transform: `scale(${Math.floor((1 / xscale) * 1000) / 1000}, ${Math.floor((1 / yscale) * 1000) / 1000})` }, class: "settings-icon", innerHTML: Icons.SettingsIcon, onClick: (e) => {
|
871
873
|
e.stopPropagation();
|
872
874
|
this.showingProperties = !this.showingProperties;
|
873
|
-
} }), this.showingProperties && (index.h("verdocs-portal", { anchor: `verdocs-settings-panel-trigger-${fieldname}`, onClickAway: () => (this.showingProperties = false) }, index.h("verdocs-template-field-properties", { templateId: templateid, fieldName: fieldname, onClose: () =>
|
875
|
+
} }), this.showingProperties && (index.h("verdocs-portal", { anchor: `verdocs-settings-panel-trigger-${fieldname}`, onClickAway: () => (this.showingProperties = false) }, index.h("verdocs-template-field-properties", { templateId: templateid, fieldName: fieldname, onClose: () => this.hideSettingsPanel(), onDelete: () => {
|
874
876
|
var _a;
|
875
877
|
(_a = this.deleted) === null || _a === void 0 ? void 0 : _a.emit({ fieldName: fieldname });
|
876
878
|
return this.hideSettingsPanel();
|
@@ -919,6 +921,7 @@ const VerdocsFieldTimestamp = class {
|
|
919
921
|
if (settingsPanel && settingsPanel.hidePanel) {
|
920
922
|
settingsPanel.hidePanel();
|
921
923
|
}
|
924
|
+
this.showingProperties = false;
|
922
925
|
}
|
923
926
|
async componentWillLoad() {
|
924
927
|
this.fieldStore = TemplateFieldStore.getTemplateFieldStore(this.templateid);
|
@@ -936,7 +939,7 @@ const VerdocsFieldTimestamp = class {
|
|
936
939
|
return (index.h(index.Host, { class: { required, disabled, done }, style: { backgroundColor } }, label && index.h("label", null, label), index.h("input", { type: "text", placeholder: placeholder, value: formatted, disabled: true, ref: el => (this.el = el) }), editable && (index.h(index.Fragment, null, index.h("div", { id: `verdocs-settings-panel-trigger-${fieldname}`, style: { transform: `scale(${Math.floor((1 / xscale) * 1000) / 1000}, ${Math.floor((1 / yscale) * 1000) / 1000})` }, class: "settings-icon", innerHTML: Icons.SettingsIcon, onClick: (e) => {
|
937
940
|
e.stopPropagation();
|
938
941
|
this.showingProperties = !this.showingProperties;
|
939
|
-
} }), this.showingProperties && (index.h("verdocs-portal", { anchor: `verdocs-settings-panel-trigger-${fieldname}`, onClickAway: () => (this.showingProperties = false) }, index.h("verdocs-template-field-properties", { templateId: templateid, fieldName: fieldname, onClose: () =>
|
942
|
+
} }), this.showingProperties && (index.h("verdocs-portal", { anchor: `verdocs-settings-panel-trigger-${fieldname}`, onClickAway: () => (this.showingProperties = false) }, index.h("verdocs-template-field-properties", { templateId: templateid, fieldName: fieldname, onClose: () => this.hideSettingsPanel(), onDelete: () => {
|
940
943
|
var _a;
|
941
944
|
(_a = this.deleted) === null || _a === void 0 ? void 0 : _a.emit({ fieldName: fieldname });
|
942
945
|
return this.hideSettingsPanel();
|
package/dist/collection/components/fields/verdocs-field-signature/verdocs-field-signature.js
CHANGED
@@ -66,6 +66,7 @@ export class VerdocsFieldSignature {
|
|
66
66
|
if (settingsPanel && settingsPanel.hidePanel) {
|
67
67
|
settingsPanel.hidePanel();
|
68
68
|
}
|
69
|
+
this.showingProperties = false;
|
69
70
|
}
|
70
71
|
async componentWillLoad() {
|
71
72
|
this.fieldStore = getTemplateFieldStore(this.templateid);
|
@@ -82,7 +83,7 @@ export class VerdocsFieldSignature {
|
|
82
83
|
return (h(Host, { class: { required, disabled, done, focused }, style: { backgroundColor } }, label && h("label", null, label), value ? h("img", { src: value, alt: "Signature" }) : h("button", { onClick: () => !disabled && this.handleShow() }, "Signature"), editable && (h(Fragment, null, h("div", { id: `verdocs-settings-panel-trigger-${fieldname}`, style: { transform: `scale(${Math.floor((1 / xscale) * 1000) / 1000}, ${Math.floor((1 / yscale) * 1000) / 1000})` }, class: "settings-icon", innerHTML: SettingsIcon, onClick: (e) => {
|
83
84
|
e.stopPropagation();
|
84
85
|
this.showingProperties = !this.showingProperties;
|
85
|
-
} }), this.showingProperties && (h("verdocs-portal", { anchor: `verdocs-settings-panel-trigger-${fieldname}`, onClickAway: () => (this.showingProperties = false) }, h("verdocs-template-field-properties", { templateId: templateid, fieldName: fieldname, onClose: () =>
|
86
|
+
} }), this.showingProperties && (h("verdocs-portal", { anchor: `verdocs-settings-panel-trigger-${fieldname}`, onClickAway: () => (this.showingProperties = false) }, h("verdocs-template-field-properties", { templateId: templateid, fieldName: fieldname, onClose: () => this.hideSettingsPanel(), onDelete: () => {
|
86
87
|
var _a;
|
87
88
|
(_a = this.deleted) === null || _a === void 0 ? void 0 : _a.emit({ fieldName: fieldname });
|
88
89
|
return this.hideSettingsPanel();
|
@@ -39,6 +39,7 @@ export class VerdocsFieldTextbox {
|
|
39
39
|
if (settingsPanel && settingsPanel.hidePanel) {
|
40
40
|
settingsPanel.hidePanel();
|
41
41
|
}
|
42
|
+
this.showingProperties = false;
|
42
43
|
}
|
43
44
|
async componentWillLoad() {
|
44
45
|
this.fieldStore = getTemplateFieldStore(this.templateid);
|
@@ -115,7 +116,7 @@ export class VerdocsFieldTextbox {
|
|
115
116
|
return (h(Host, { class: { required, disabled, done, focused }, style: { backgroundColor } }, label && h("label", null, label), multiline ? (h("textarea", { name: fieldname, disabled: disabled, required: required, placeholder: placeholder, ref: el => (this.inputEl = el), onFocus: () => (this.focused = true), onBlur: () => (this.focused = false) }, value)) : (h("input", { type: "text", name: fieldname, value: value, disabled: disabled, required: required, placeholder: placeholder, maxlength: maxlength, ref: el => (this.inputEl = el), onFocus: () => (this.focused = true), onBlur: () => (this.focused = false) })), editable && (h(Fragment, null, h("div", { id: `verdocs-settings-panel-trigger-${fieldname}`, style: { transform: `scale(${Math.floor((1 / xscale) * 1000) / 1000}, ${Math.floor((1 / yscale) * 1000) / 1000})` }, class: "settings-icon", innerHTML: SettingsIcon, onClick: (e) => {
|
116
117
|
e.stopPropagation();
|
117
118
|
this.showingProperties = !this.showingProperties;
|
118
|
-
} }), this.showingProperties && (h("verdocs-portal", { anchor: `verdocs-settings-panel-trigger-${fieldname}`, onClickAway: () => (this.showingProperties = false) }, h("verdocs-template-field-properties", { templateId: templateid, fieldName: fieldname, onClose: () =>
|
119
|
+
} }), this.showingProperties && (h("verdocs-portal", { anchor: `verdocs-settings-panel-trigger-${fieldname}`, onClickAway: () => (this.showingProperties = false) }, h("verdocs-template-field-properties", { templateId: templateid, fieldName: fieldname, onClose: () => this.hideSettingsPanel(), onDelete: () => {
|
119
120
|
var _a;
|
120
121
|
(_a = this.deleted) === null || _a === void 0 ? void 0 : _a.emit({ fieldName: fieldname });
|
121
122
|
return this.hideSettingsPanel();
|
package/dist/collection/components/fields/verdocs-field-timestamp/verdocs-field-timestamp.js
CHANGED
@@ -38,6 +38,7 @@ export class VerdocsFieldTimestamp {
|
|
38
38
|
if (settingsPanel && settingsPanel.hidePanel) {
|
39
39
|
settingsPanel.hidePanel();
|
40
40
|
}
|
41
|
+
this.showingProperties = false;
|
41
42
|
}
|
42
43
|
async componentWillLoad() {
|
43
44
|
this.fieldStore = getTemplateFieldStore(this.templateid);
|
@@ -55,7 +56,7 @@ export class VerdocsFieldTimestamp {
|
|
55
56
|
return (h(Host, { class: { required, disabled, done }, style: { backgroundColor } }, label && h("label", null, label), h("input", { type: "text", placeholder: placeholder, value: formatted, disabled: true, ref: el => (this.el = el) }), editable && (h(Fragment, null, h("div", { id: `verdocs-settings-panel-trigger-${fieldname}`, style: { transform: `scale(${Math.floor((1 / xscale) * 1000) / 1000}, ${Math.floor((1 / yscale) * 1000) / 1000})` }, class: "settings-icon", innerHTML: SettingsIcon, onClick: (e) => {
|
56
57
|
e.stopPropagation();
|
57
58
|
this.showingProperties = !this.showingProperties;
|
58
|
-
} }), this.showingProperties && (h("verdocs-portal", { anchor: `verdocs-settings-panel-trigger-${fieldname}`, onClickAway: () => (this.showingProperties = false) }, h("verdocs-template-field-properties", { templateId: templateid, fieldName: fieldname, onClose: () =>
|
59
|
+
} }), this.showingProperties && (h("verdocs-portal", { anchor: `verdocs-settings-panel-trigger-${fieldname}`, onClickAway: () => (this.showingProperties = false) }, h("verdocs-template-field-properties", { templateId: templateid, fieldName: fieldname, onClose: () => this.hideSettingsPanel(), onDelete: () => {
|
59
60
|
var _a;
|
60
61
|
(_a = this.deleted) === null || _a === void 0 ? void 0 : _a.emit({ fieldName: fieldname });
|
61
62
|
return this.hideSettingsPanel();
|
@@ -64,6 +64,7 @@ export class VerdocsTemplateFieldProperties {
|
|
64
64
|
const field = this.fieldStore.get('fields').find(field => field.name === this.fieldName);
|
65
65
|
if (!field) {
|
66
66
|
console.log(`[FIELD PROPERTIES] Unable to find field "${this.fieldName}" in fields`);
|
67
|
+
return;
|
67
68
|
}
|
68
69
|
else {
|
69
70
|
console.log('[FIELD PROPERTIES]', field);
|
@@ -105,8 +106,8 @@ export class VerdocsTemplateFieldProperties {
|
|
105
106
|
updateField(this.endpoint, this.templateId, this.fieldName, newProperties)
|
106
107
|
.then(updated => {
|
107
108
|
var _a, _b, _c;
|
109
|
+
console.log('[FIELD PROPERTIES] Updated', updated);
|
108
110
|
updateStoreField(this.fieldStore, this.fieldName, updated);
|
109
|
-
this.resetForm();
|
110
111
|
(_a = this.settingsChanged) === null || _a === void 0 ? void 0 : _a.emit({ fieldName: this.fieldName, field: updated });
|
111
112
|
(_b = this.close) === null || _b === void 0 ? void 0 : _b.emit();
|
112
113
|
(_c = document.getElementById('verdocs-template-field-properties')) === null || _c === void 0 ? void 0 : _c.remove();
|
@@ -76,6 +76,7 @@ const VerdocsFieldSignature = /*@__PURE__*/ proxyCustomElement(class VerdocsFiel
|
|
76
76
|
if (settingsPanel && settingsPanel.hidePanel) {
|
77
77
|
settingsPanel.hidePanel();
|
78
78
|
}
|
79
|
+
this.showingProperties = false;
|
79
80
|
}
|
80
81
|
async componentWillLoad() {
|
81
82
|
this.fieldStore = getTemplateFieldStore(this.templateid);
|
@@ -92,7 +93,7 @@ const VerdocsFieldSignature = /*@__PURE__*/ proxyCustomElement(class VerdocsFiel
|
|
92
93
|
return (h(Host, { class: { required, disabled, done, focused }, style: { backgroundColor } }, label && h("label", null, label), value ? h("img", { src: value, alt: "Signature" }) : h("button", { onClick: () => !disabled && this.handleShow() }, "Signature"), editable && (h(Fragment, null, h("div", { id: `verdocs-settings-panel-trigger-${fieldname}`, style: { transform: `scale(${Math.floor((1 / xscale) * 1000) / 1000}, ${Math.floor((1 / yscale) * 1000) / 1000})` }, class: "settings-icon", innerHTML: SettingsIcon, onClick: (e) => {
|
93
94
|
e.stopPropagation();
|
94
95
|
this.showingProperties = !this.showingProperties;
|
95
|
-
} }), this.showingProperties && (h("verdocs-portal", { anchor: `verdocs-settings-panel-trigger-${fieldname}`, onClickAway: () => (this.showingProperties = false) }, h("verdocs-template-field-properties", { templateId: templateid, fieldName: fieldname, onClose: () =>
|
96
|
+
} }), this.showingProperties && (h("verdocs-portal", { anchor: `verdocs-settings-panel-trigger-${fieldname}`, onClickAway: () => (this.showingProperties = false) }, h("verdocs-template-field-properties", { templateId: templateid, fieldName: fieldname, onClose: () => this.hideSettingsPanel(), onDelete: () => {
|
96
97
|
var _a;
|
97
98
|
(_a = this.deleted) === null || _a === void 0 ? void 0 : _a.emit({ fieldName: fieldname });
|
98
99
|
return this.hideSettingsPanel();
|
@@ -52,6 +52,7 @@ const VerdocsFieldTextbox = /*@__PURE__*/ proxyCustomElement(class VerdocsFieldT
|
|
52
52
|
if (settingsPanel && settingsPanel.hidePanel) {
|
53
53
|
settingsPanel.hidePanel();
|
54
54
|
}
|
55
|
+
this.showingProperties = false;
|
55
56
|
}
|
56
57
|
async componentWillLoad() {
|
57
58
|
this.fieldStore = getTemplateFieldStore(this.templateid);
|
@@ -128,7 +129,7 @@ const VerdocsFieldTextbox = /*@__PURE__*/ proxyCustomElement(class VerdocsFieldT
|
|
128
129
|
return (h(Host, { class: { required, disabled, done, focused }, style: { backgroundColor } }, label && h("label", null, label), multiline ? (h("textarea", { name: fieldname, disabled: disabled, required: required, placeholder: placeholder, ref: el => (this.inputEl = el), onFocus: () => (this.focused = true), onBlur: () => (this.focused = false) }, value)) : (h("input", { type: "text", name: fieldname, value: value, disabled: disabled, required: required, placeholder: placeholder, maxlength: maxlength, ref: el => (this.inputEl = el), onFocus: () => (this.focused = true), onBlur: () => (this.focused = false) })), editable && (h(Fragment, null, h("div", { id: `verdocs-settings-panel-trigger-${fieldname}`, style: { transform: `scale(${Math.floor((1 / xscale) * 1000) / 1000}, ${Math.floor((1 / yscale) * 1000) / 1000})` }, class: "settings-icon", innerHTML: SettingsIcon, onClick: (e) => {
|
129
130
|
e.stopPropagation();
|
130
131
|
this.showingProperties = !this.showingProperties;
|
131
|
-
} }), this.showingProperties && (h("verdocs-portal", { anchor: `verdocs-settings-panel-trigger-${fieldname}`, onClickAway: () => (this.showingProperties = false) }, h("verdocs-template-field-properties", { templateId: templateid, fieldName: fieldname, onClose: () =>
|
132
|
+
} }), this.showingProperties && (h("verdocs-portal", { anchor: `verdocs-settings-panel-trigger-${fieldname}`, onClickAway: () => (this.showingProperties = false) }, h("verdocs-template-field-properties", { templateId: templateid, fieldName: fieldname, onClose: () => this.hideSettingsPanel(), onDelete: () => {
|
132
133
|
var _a;
|
133
134
|
(_a = this.deleted) === null || _a === void 0 ? void 0 : _a.emit({ fieldName: fieldname });
|
134
135
|
return this.hideSettingsPanel();
|
@@ -50,6 +50,7 @@ const VerdocsFieldTimestamp = /*@__PURE__*/ proxyCustomElement(class VerdocsFiel
|
|
50
50
|
if (settingsPanel && settingsPanel.hidePanel) {
|
51
51
|
settingsPanel.hidePanel();
|
52
52
|
}
|
53
|
+
this.showingProperties = false;
|
53
54
|
}
|
54
55
|
async componentWillLoad() {
|
55
56
|
this.fieldStore = getTemplateFieldStore(this.templateid);
|
@@ -67,7 +68,7 @@ const VerdocsFieldTimestamp = /*@__PURE__*/ proxyCustomElement(class VerdocsFiel
|
|
67
68
|
return (h(Host, { class: { required, disabled, done }, style: { backgroundColor } }, label && h("label", null, label), h("input", { type: "text", placeholder: placeholder, value: formatted, disabled: true, ref: el => (this.el = el) }), editable && (h(Fragment, null, h("div", { id: `verdocs-settings-panel-trigger-${fieldname}`, style: { transform: `scale(${Math.floor((1 / xscale) * 1000) / 1000}, ${Math.floor((1 / yscale) * 1000) / 1000})` }, class: "settings-icon", innerHTML: SettingsIcon, onClick: (e) => {
|
68
69
|
e.stopPropagation();
|
69
70
|
this.showingProperties = !this.showingProperties;
|
70
|
-
} }), this.showingProperties && (h("verdocs-portal", { anchor: `verdocs-settings-panel-trigger-${fieldname}`, onClickAway: () => (this.showingProperties = false) }, h("verdocs-template-field-properties", { templateId: templateid, fieldName: fieldname, onClose: () =>
|
71
|
+
} }), this.showingProperties && (h("verdocs-portal", { anchor: `verdocs-settings-panel-trigger-${fieldname}`, onClickAway: () => (this.showingProperties = false) }, h("verdocs-template-field-properties", { templateId: templateid, fieldName: fieldname, onClose: () => this.hideSettingsPanel(), onDelete: () => {
|
71
72
|
var _a;
|
72
73
|
(_a = this.deleted) === null || _a === void 0 ? void 0 : _a.emit({ fieldName: fieldname });
|
73
74
|
return this.hideSettingsPanel();
|
@@ -77,6 +77,7 @@ const VerdocsTemplateFieldProperties = /*@__PURE__*/ proxyCustomElement(class Ve
|
|
77
77
|
const field = this.fieldStore.get('fields').find(field => field.name === this.fieldName);
|
78
78
|
if (!field) {
|
79
79
|
console.log(`[FIELD PROPERTIES] Unable to find field "${this.fieldName}" in fields`);
|
80
|
+
return;
|
80
81
|
}
|
81
82
|
else {
|
82
83
|
console.log('[FIELD PROPERTIES]', field);
|
@@ -118,8 +119,8 @@ const VerdocsTemplateFieldProperties = /*@__PURE__*/ proxyCustomElement(class Ve
|
|
118
119
|
updateField(this.endpoint, this.templateId, this.fieldName, newProperties)
|
119
120
|
.then(updated => {
|
120
121
|
var _a, _b, _c;
|
122
|
+
console.log('[FIELD PROPERTIES] Updated', updated);
|
121
123
|
updateStoreField(this.fieldStore, this.fieldName, updated);
|
122
|
-
this.resetForm();
|
123
124
|
(_a = this.settingsChanged) === null || _a === void 0 ? void 0 : _a.emit({ fieldName: this.fieldName, field: updated });
|
124
125
|
(_b = this.close) === null || _b === void 0 ? void 0 : _b.emit();
|
125
126
|
(_c = document.getElementById('verdocs-template-field-properties')) === null || _c === void 0 ? void 0 : _c.remove();
|
@@ -122,6 +122,7 @@ const VerdocsTemplateFieldProperties = class {
|
|
122
122
|
const field = this.fieldStore.get('fields').find(field => field.name === this.fieldName);
|
123
123
|
if (!field) {
|
124
124
|
console.log(`[FIELD PROPERTIES] Unable to find field "${this.fieldName}" in fields`);
|
125
|
+
return;
|
125
126
|
}
|
126
127
|
else {
|
127
128
|
console.log('[FIELD PROPERTIES]', field);
|
@@ -163,8 +164,8 @@ const VerdocsTemplateFieldProperties = class {
|
|
163
164
|
updateField(this.endpoint, this.templateId, this.fieldName, newProperties)
|
164
165
|
.then(updated => {
|
165
166
|
var _a, _b, _c;
|
167
|
+
console.log('[FIELD PROPERTIES] Updated', updated);
|
166
168
|
updateStoreField(this.fieldStore, this.fieldName, updated);
|
167
|
-
this.resetForm();
|
168
169
|
(_a = this.settingsChanged) === null || _a === void 0 ? void 0 : _a.emit({ fieldName: this.fieldName, field: updated });
|
169
170
|
(_b = this.close) === null || _b === void 0 ? void 0 : _b.emit();
|
170
171
|
(_c = document.getElementById('verdocs-template-field-properties')) === null || _c === void 0 ? void 0 : _c.remove();
|
@@ -608,6 +608,7 @@ const VerdocsFieldSignature = class {
|
|
608
608
|
if (settingsPanel && settingsPanel.hidePanel) {
|
609
609
|
settingsPanel.hidePanel();
|
610
610
|
}
|
611
|
+
this.showingProperties = false;
|
611
612
|
}
|
612
613
|
async componentWillLoad() {
|
613
614
|
this.fieldStore = getTemplateFieldStore(this.templateid);
|
@@ -624,7 +625,7 @@ const VerdocsFieldSignature = class {
|
|
624
625
|
return (h(Host, { class: { required, disabled, done, focused }, style: { backgroundColor } }, label && h("label", null, label), value ? h("img", { src: value, alt: "Signature" }) : h("button", { onClick: () => !disabled && this.handleShow() }, "Signature"), editable && (h(Fragment, null, h("div", { id: `verdocs-settings-panel-trigger-${fieldname}`, style: { transform: `scale(${Math.floor((1 / xscale) * 1000) / 1000}, ${Math.floor((1 / yscale) * 1000) / 1000})` }, class: "settings-icon", innerHTML: SettingsIcon, onClick: (e) => {
|
625
626
|
e.stopPropagation();
|
626
627
|
this.showingProperties = !this.showingProperties;
|
627
|
-
} }), this.showingProperties && (h("verdocs-portal", { anchor: `verdocs-settings-panel-trigger-${fieldname}`, onClickAway: () => (this.showingProperties = false) }, h("verdocs-template-field-properties", { templateId: templateid, fieldName: fieldname, onClose: () =>
|
628
|
+
} }), this.showingProperties && (h("verdocs-portal", { anchor: `verdocs-settings-panel-trigger-${fieldname}`, onClickAway: () => (this.showingProperties = false) }, h("verdocs-template-field-properties", { templateId: templateid, fieldName: fieldname, onClose: () => this.hideSettingsPanel(), onDelete: () => {
|
628
629
|
var _a;
|
629
630
|
(_a = this.deleted) === null || _a === void 0 ? void 0 : _a.emit({ fieldName: fieldname });
|
630
631
|
return this.hideSettingsPanel();
|
@@ -790,6 +791,7 @@ const VerdocsFieldTextbox = class {
|
|
790
791
|
if (settingsPanel && settingsPanel.hidePanel) {
|
791
792
|
settingsPanel.hidePanel();
|
792
793
|
}
|
794
|
+
this.showingProperties = false;
|
793
795
|
}
|
794
796
|
async componentWillLoad() {
|
795
797
|
this.fieldStore = getTemplateFieldStore(this.templateid);
|
@@ -866,7 +868,7 @@ const VerdocsFieldTextbox = class {
|
|
866
868
|
return (h(Host, { class: { required, disabled, done, focused }, style: { backgroundColor } }, label && h("label", null, label), multiline ? (h("textarea", { name: fieldname, disabled: disabled, required: required, placeholder: placeholder, ref: el => (this.inputEl = el), onFocus: () => (this.focused = true), onBlur: () => (this.focused = false) }, value)) : (h("input", { type: "text", name: fieldname, value: value, disabled: disabled, required: required, placeholder: placeholder, maxlength: maxlength, ref: el => (this.inputEl = el), onFocus: () => (this.focused = true), onBlur: () => (this.focused = false) })), editable && (h(Fragment, null, h("div", { id: `verdocs-settings-panel-trigger-${fieldname}`, style: { transform: `scale(${Math.floor((1 / xscale) * 1000) / 1000}, ${Math.floor((1 / yscale) * 1000) / 1000})` }, class: "settings-icon", innerHTML: SettingsIcon, onClick: (e) => {
|
867
869
|
e.stopPropagation();
|
868
870
|
this.showingProperties = !this.showingProperties;
|
869
|
-
} }), this.showingProperties && (h("verdocs-portal", { anchor: `verdocs-settings-panel-trigger-${fieldname}`, onClickAway: () => (this.showingProperties = false) }, h("verdocs-template-field-properties", { templateId: templateid, fieldName: fieldname, onClose: () =>
|
871
|
+
} }), this.showingProperties && (h("verdocs-portal", { anchor: `verdocs-settings-panel-trigger-${fieldname}`, onClickAway: () => (this.showingProperties = false) }, h("verdocs-template-field-properties", { templateId: templateid, fieldName: fieldname, onClose: () => this.hideSettingsPanel(), onDelete: () => {
|
870
872
|
var _a;
|
871
873
|
(_a = this.deleted) === null || _a === void 0 ? void 0 : _a.emit({ fieldName: fieldname });
|
872
874
|
return this.hideSettingsPanel();
|
@@ -915,6 +917,7 @@ const VerdocsFieldTimestamp = class {
|
|
915
917
|
if (settingsPanel && settingsPanel.hidePanel) {
|
916
918
|
settingsPanel.hidePanel();
|
917
919
|
}
|
920
|
+
this.showingProperties = false;
|
918
921
|
}
|
919
922
|
async componentWillLoad() {
|
920
923
|
this.fieldStore = getTemplateFieldStore(this.templateid);
|
@@ -932,7 +935,7 @@ const VerdocsFieldTimestamp = class {
|
|
932
935
|
return (h(Host, { class: { required, disabled, done }, style: { backgroundColor } }, label && h("label", null, label), h("input", { type: "text", placeholder: placeholder, value: formatted, disabled: true, ref: el => (this.el = el) }), editable && (h(Fragment, null, h("div", { id: `verdocs-settings-panel-trigger-${fieldname}`, style: { transform: `scale(${Math.floor((1 / xscale) * 1000) / 1000}, ${Math.floor((1 / yscale) * 1000) / 1000})` }, class: "settings-icon", innerHTML: SettingsIcon, onClick: (e) => {
|
933
936
|
e.stopPropagation();
|
934
937
|
this.showingProperties = !this.showingProperties;
|
935
|
-
} }), this.showingProperties && (h("verdocs-portal", { anchor: `verdocs-settings-panel-trigger-${fieldname}`, onClickAway: () => (this.showingProperties = false) }, h("verdocs-template-field-properties", { templateId: templateid, fieldName: fieldname, onClose: () =>
|
938
|
+
} }), this.showingProperties && (h("verdocs-portal", { anchor: `verdocs-settings-panel-trigger-${fieldname}`, onClickAway: () => (this.showingProperties = false) }, h("verdocs-template-field-properties", { templateId: templateid, fieldName: fieldname, onClose: () => this.hideSettingsPanel(), onDelete: () => {
|
936
939
|
var _a;
|
937
940
|
(_a = this.deleted) === null || _a === void 0 ? void 0 : _a.emit({ fieldName: fieldname });
|
938
941
|
return this.hideSettingsPanel();
|
@@ -1 +1 @@
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(e,t,o,r){function i(e){return e instanceof o?e:new o((function(t){t(e)}))}return new(o||(o=Promise))((function(o,s){function n(e){try{a(r.next(e))}catch(e){s(e)}}function l(e){try{a(r["throw"](e))}catch(e){s(e)}}function a(e){e.done?o(e.value):i(e.value).then(n,l)}a((r=r.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var o={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},r,i,s,n;return n={next:l(0),throw:l(1),return:l(2)},typeof Symbol==="function"&&(n[Symbol.iterator]=function(){return this}),n;function l(e){return function(t){return a([e,t])}}function a(l){if(r)throw new TypeError("Generator is already executing.");while(n&&(n=0,l[0]&&(o=0)),o)try{if(r=1,i&&(s=l[0]&2?i["return"]:l[0]?i["throw"]||((s=i["return"])&&s.call(i),0):i.next)&&!(s=s.call(i,l[1])).done)return s;if(i=0,s)l=[l[0]&2,s.value];switch(l[0]){case 0:case 1:s=l;break;case 4:o.label++;return{value:l[1],done:false};case 5:o.label++;i=l[1];l=[0];continue;case 7:l=o.ops.pop();o.trys.pop();continue;default:if(!(s=o.trys,s=s.length>0&&s[s.length-1])&&(l[0]===6||l[0]===2)){o=0;continue}if(l[0]===3&&(!s||l[1]>s[0]&&l[1]<s[3])){o.label=l[1];break}if(l[0]===6&&o.label<s[1]){o.label=s[1];s=l;break}if(s&&o.label<s[2]){o.label=s[2];o.ops.push(l);break}if(s[2])o.ops.pop();o.trys.pop();continue}l=t.call(e,o)}catch(e){l=[6,e];i=0}finally{r=s=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(e,t,o){if(o||arguments.length===2)for(var r=0,i=t.length,s;r<i;r++){if(s||!(r in t)){if(!s)s=Array.prototype.slice.call(t,0,r);s[r]=t[r]}}return e.concat(s||Array.prototype.slice.call(t))};import{r as registerInstance,h,H as Host,c as createEvent,g as getElement}from"./index-d3ac9650.js";import{VerdocsEndpoint,updateField,deleteField}from"@verdocs/js-sdk";import{g as getTemplateFieldStore,u as updateStoreField}from"./TemplateFieldStore-6113ab4b.js";import{g as getTemplateRoleStore}from"./TemplateRoleStore-054bd7ed.js";import{g as getTemplateStore}from"./TemplateStore-d432547d.js";import{S as SDKError}from"./errors-887f1e88.js";import"./index-04235019.js";import"./index-7588a071.js";var verdocsCheckboxCss='@charset "UTF-8";@-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-checkbox{line-height:18px;font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-checkbox label>input[type=checkbox]{display:none}verdocs-checkbox label>input[type=checkbox]+*::before{content:"";width:20px;height:20px;-ms-flex-negative:0;flex-shrink:0;margin-right:8px;line-height:20px;border-radius:2px;border-style:solid;border-width:0.1rem;display:inline-block;vertical-align:bottom;border-color:#aeb4bf}verdocs-checkbox label>input[type=checkbox]:checked+*{color:#55bc81}verdocs-checkbox label>input[type=checkbox]:checked+*::before{content:"✓";color:white;text-align:center;background:#55bc81;border-color:#55bc81}verdocs-checkbox.dark label>input[type=checkbox]+*::before{border-color:#ffffff}verdocs-checkbox.dark label>input[type=checkbox]:checked+*::before{background:#55bc81;border-color:#55bc81}';var VerdocsCheckboxStyle0=verdocsCheckboxCss;var VerdocsCheckbox=function(){function e(e){registerInstance(this,e);this.checked=false;this.name="";this.label="";this.value="";this.theme="light";this.disabled=false}e.prototype.render=function(){var e;return h(Host,{key:"134ddfacbf313ed3d8aaaae104e7ceefaf8f260f",class:(e={disabled:this.disabled},e[this.theme]=true,e)},h("label",{key:"f4c5ad61ffc32acf46e42a22c9cfdb27b44d21c9"},h("input",{key:"edc72dbc12bb2f93daa6bf90fe8baddeee003a0f",type:"checkbox",value:this.value,name:this.name,checked:this.checked,disabled:this.disabled}),h("span",{key:"0d3a00d372dc0a0b2de109c1ee8c484153b789a7"},this.label)))};return e}();VerdocsCheckbox.style=VerdocsCheckboxStyle0;var verdocsComponentErrorCss='@-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-component-error{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;display:-ms-flexbox;display:flex;padding:15px;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center}verdocs-component-error .inner{-ms-flex:1;flex:1;height:300px;display:-ms-flexbox;display:flex;font-size:18px;-webkit-box-sizing:border-box;box-sizing:border-box;padding:0 20px;background:#ffffff;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center}';var VerdocsComponentErrorStyle0=verdocsComponentErrorCss;var VerdocsComponentError=function(){function e(e){registerInstance(this,e);this.message=""}e.prototype.render=function(){return h(Host,{key:"5fd53e1053d599dc955c727344dfbc48ddf13622"},h("div",{key:"bd877d18be032147ed72b999896f0cec3b021c95",class:"inner"},this.message))};return e}();VerdocsComponentError.style=VerdocsComponentErrorStyle0;var verdocsSelectInputCss='@-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-select-input{font-family:"Inter", "Barlow", sans-serif;-webkit-box-sizing:border-box;box-sizing:border-box;margin:0 0 10px 0;display:block}verdocs-select-input .input-element{-webkit-box-sizing:border-box;box-sizing:border-box;background:#ffffff;border:1px solid #cccccc;border-radius:4px;background:#ffffff;color:#092c4c;width:100%;font-size:16px;height:28px;padding:2px 8px}verdocs-select-input .input-element::-webkit-input-placeholder{color:#aaaaaa;opacity:1}verdocs-select-input .input-element::-moz-placeholder{color:#aaaaaa;opacity:1}verdocs-select-input .input-element:-ms-input-placeholder{color:#aaaaaa;opacity:1}verdocs-select-input .input-element::-ms-input-placeholder{color:#aaaaaa;opacity:1}verdocs-select-input .input-element::placeholder{color:#aaaaaa;opacity:1}verdocs-select-input .input-label{display:block;color:#555570;font-weight:700;font-size:14px;margin:0 0 4px 0}';var VerdocsSelectInputStyle0=verdocsSelectInputCss;var VerdocsSelectInput=function(){function e(e){registerInstance(this,e);this.value="";this.label="";this.options=undefined;this.disabled=false}e.prototype.render=function(){var e=this;return h(Host,{key:"4f49d2d10cf951c150b168563bcdb1d69e2385f2",class:"input-field"},h("label",{key:"a7329800f45797aac347e20231cc790e7ed4a91f"},this.label?h("div",{class:"input-label"},this.label+":"):h("div",null),h("select",{key:"1f66b8907f5ba4c9ecece9444ee4afc1be6a4459",class:"input-element",disabled:this.disabled},this.options.map((function(t){return h("option",{value:t.value,selected:t.value===e.value},t.label)})))))};return e}();VerdocsSelectInput.style=VerdocsSelectInputStyle0;var verdocsTemplateFieldPropertiesCss='@-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-template-field-properties{padding:20px;display:block;border-radius:4px;background:#ffffff;border:1px solid #ccc;font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;-webkit-box-shadow:2px 2px 10px 0 rgba(0, 0, 0, 0.1215686275);box-shadow:2px 2px 10px 0 rgba(0, 0, 0, 0.1215686275)}@media all and (max-width: 600px){verdocs-template-field-properties{padding:10px;-webkit-transform:scale(0.8);transform:scale(0.8)}}verdocs-template-field-properties .buttons{display:-ms-flexbox;display:flex;margin-top:30px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:end;justify-content:flex-end}verdocs-template-field-properties .buttons verdocs-button{margin-left:16px}verdocs-template-field-properties form .row{display:-ms-flexbox;display:flex;-webkit-column-gap:15px;-moz-column-gap:15px;column-gap:15px;margin:0 0 10px 0;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-template-field-properties form .row .input-label{display:block;color:#555570;font-weight:700;font-size:14px;margin:0 0 4px 0;-ms-flex:0 0 100px;flex:0 0 100px}verdocs-template-field-properties verdocs-select-input{-ms-flex:1;flex:1;margin:0}verdocs-template-field-properties verdocs-text-input{margin:0;-ms-flex:1;flex:1}verdocs-template-field-properties verdocs-text-input label{margin:0;display:-ms-flexbox;display:flex;-webkit-column-gap:15px;-moz-column-gap:15px;column-gap:15px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-template-field-properties verdocs-text-input .input-label{-ms-flex:0 0 100px;flex:0 0 100px}verdocs-template-field-properties verdocs-text-input input{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex}verdocs-template-field-properties .checkbox-wrapper{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex}verdocs-template-field-properties .delete-button{height:34px;display:-ms-flexbox;display:flex;cursor:pointer;background:none;border-radius:4px;-ms-flex-align:center;align-items:center;border:1px solid #999;-ms-flex-pack:center;justify-content:center}verdocs-template-field-properties .delete-button:active{background:#f3f3f3}verdocs-template-field-properties .delete-button svg{width:24px;height:24px}verdocs-template-field-properties h6{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex;font-size:16px;font-weight:bold;margin:0 0 8px 0;-ms-flex-direction:row;flex-direction:row;color:#092c4c}verdocs-template-field-properties h6 .help-icon{opacity:0.5}verdocs-template-field-properties h6 .help-icon:hover{opacity:1;cursor:pointer}verdocs-template-field-properties .row-header{gap:15px;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row}verdocs-template-field-properties .row-header h6{margin-bottom:0}verdocs-template-field-properties .row-header verdocs-help-icon{-webkit-transform:scale(0.85);transform:scale(0.85)}verdocs-template-field-properties .row-header verdocs-help-icon svg{margin-bottom:-5px}verdocs-template-field-properties .row-header .add-button{margin:0;padding:0;border:none;opacity:0.5;cursor:pointer;background:none}verdocs-template-field-properties .row-header .add-button:hover{opacity:1}verdocs-template-field-properties .row-header .add-button svg{width:32px;height:32px}verdocs-template-field-properties .options-header{gap:10px;margin:0 0 5px 0;display:-ms-flexbox;display:flex;color:#ffffff;font-size:14px;padding:5px 8px;font-weight:700;text-align:center;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:center;justify-content:center;background-color:#333333}verdocs-template-field-properties .options-header-label{display:-ms-flexbox;display:flex;-ms-flex:1;flex:1;font-weight:700;font-size:14px}verdocs-template-field-properties .option-row{margin:15px 0}verdocs-template-field-properties .option-row .remove-button{height:28px;display:-ms-flexbox;display:flex;cursor:pointer;background:none;border-radius:4px;-ms-flex-align:center;align-items:center;border:1px solid #999;-ms-flex-pack:center;justify-content:center}verdocs-template-field-properties .option-row .remove-button:active{background:#f3f3f3}verdocs-template-field-properties .option-row .remove-button:hover svg{stroke:rgb(165, 0, 33)}verdocs-template-field-properties .option-row .remove-button svg{width:20px;height:20px;stroke:#333333}verdocs-template-field-properties .options{background:#f3f3f3;padding:0 0 1px 0}verdocs-template-field-properties .options .row-header,verdocs-template-field-properties .options .option-row{padding:0 10px}verdocs-template-field-properties .options .add-option-button{border-radius:5px;border:1px solid #cccccc;background:#46497d;color:#ffffff;padding:3px 8px}verdocs-template-field-properties .options .option-row .input-element{font-size:14px}verdocs-template-field-properties .options verdocs-help-icon{opacity:1;-webkit-transform:scale(0.8);transform:scale(0.8)}verdocs-template-field-properties .options verdocs-help-icon svg{fill:#ffffff}';var VerdocsTemplateFieldPropertiesStyle0=verdocsTemplateFieldPropertiesCss;var capitalize=function(e){return e.charAt(0).toUpperCase()+e.slice(1)};var 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>';var HelpIcon='<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>';var VerdocsTemplateFieldProperties=function(){function e(e){registerInstance(this,e);this.close=createEvent(this,"close",7);this.delete=createEvent(this,"delete",7);this.settingsChanged=createEvent(this,"settingsChanged",7);this.sdkError=createEvent(this,"sdkError",7);this.templateStore=null;this.fieldStore=null;this.roleStore=null;this.endpoint=VerdocsEndpoint.getDefault();this.templateId="";this.fieldName="";this.helpText="";this.dirty=false;this.loading=true;this.label="";this.type="textbox";this.name="";this.required=false;this.roleName="";this.group="";this.fieldType="";this.options=[];this.placeholder="";this.defaultValue="";this.showingHelp=false}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,o,r,i;return __generator(this,(function(s){switch(s.label){case 0:s.trys.push([0,2,,3]);this.endpoint.loadSession();if(!this.templateId){console.log("[FIELD PROPERTIES] Missing required template ID ".concat(this.templateId));return[2]}if(!this.fieldName){console.error("[FIELD PROPERTIES] Missing required field name");return[2]}if(!this.endpoint.session){console.log("[FIELD PROPERTIES] Unable to start builder session, must be authenticated");return[2]}r=this;return[4,getTemplateStore(this.endpoint,this.templateId)];case 1:r.templateStore=s.sent();this.fieldStore=getTemplateFieldStore(this.templateId);this.roleStore=getTemplateRoleStore(this.templateId);this.resetForm();return[3,3];case 2:i=s.sent();console.log("[FIELD PROPERTIES] Error loading template",i);this.loading=false;(e=this.sdkError)===null||e===void 0?void 0:e.emit(new SDKError(i.message,(t=i.response)===null||t===void 0?void 0:t.status,(o=i.response)===null||o===void 0?void 0:o.data));return[3,3];case 3:return[2]}}))}))};e.prototype.resetForm=function(){var e=this;var t=this.fieldStore.get("fields").find((function(t){return t.name===e.fieldName}));if(!t){console.log('[FIELD PROPERTIES] Unable to find field "'.concat(this.fieldName,'" in fields'))}else{console.log("[FIELD PROPERTIES]",t)}this.type=t.type;this.name=t.name;this.label=t.label;this.group=t.group;this.roleName=t.role_name;this.required=t.required;this.fieldType=t.type;this.options=t.options||[];this.placeholder=t.placeholder||"";this.defaultValue=t.default||"";this.dirty=false;this.loading=false;this.cleanupOptions()};e.prototype.handleCancel=function(e){var t,o;e.stopPropagation();this.resetForm();(t=this.close)===null||t===void 0?void 0:t.emit();(o=document.getElementById("verdocs-template-field-properties"))===null||o===void 0?void 0:o.remove()};e.prototype.handleSave=function(e){var t=this;e.stopPropagation();var o={name:this.name,role_name:this.roleName,required:this.required,label:this.label,group:this.group,placeholder:this.placeholder,default:this.defaultValue,options:this.options};console.log("[FIELD PROPERTIES] Will update",this.fieldName,o);updateField(this.endpoint,this.templateId,this.fieldName,o).then((function(e){var o,r,i;updateStoreField(t.fieldStore,t.fieldName,e);t.resetForm();(o=t.settingsChanged)===null||o===void 0?void 0:o.emit({fieldName:t.fieldName,field:e});(r=t.close)===null||r===void 0?void 0:r.emit();(i=document.getElementById("verdocs-template-field-properties"))===null||i===void 0?void 0:i.remove()})).catch((function(){console.log("[FIELD PROPERTIES] Update failed",e)}))};e.prototype.handleDelete=function(e){return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(o){e.stopPropagation();deleteField(this.endpoint,this.templateId,this.fieldName).then((function(){var e,o;t.fieldStore.set("fields",t.fieldStore.get("fields").filter((function(e){return e.name!==t.fieldName})));(e=t.delete)===null||e===void 0?void 0:e.emit({templateId:t.templateId,roleName:t.roleName});(o=document.getElementById("verdocs-template-field-properties"))===null||o===void 0?void 0:o.remove()})).catch((function(e){console.log("[FIELD PROPERTIES] Deletion error",e)}));return[2]}))}))};e.prototype.cleanupOptions=function(){this.options=__spreadArray([],this.options.filter((function(e){return(e.id||"").trim()!==""||(e.value||"").trim()!==""})),true);if(!this.options.find((function(e){return!e.id&&!e.value}))){this.options=__spreadArray(__spreadArray([],this.options,true),[{id:"",value:""}],false)}};e.prototype.render=function(){var e=this;var t;if(!this.endpoint.session){return h(Host,null,h("verdocs-component-error",{message:"You must be authenticated to use this module."}))}if(!this.endpoint.session||!this.fieldStore.get("fields").some((function(t){return t.name===e.fieldName}))){return h(Host,{class:"empty"})}if(this.helpText&&this.showingHelp){return h(Host,null,h("h6",null,capitalize(this.fieldType)," Settings ",h("div",{style:{flex:"1"}}),h("div",{class:"help-icon",innerHTML:HelpIcon,onClick:function(){return e.showingHelp=false}})),h("p",{class:"instructions",innerHTML:this.helpText}))}return h(Host,{id:"verdocs-template-field-properties"},h("h6",null,capitalize(this.fieldType.replace(/_/g," "))," Settings ",h("div",{style:{flex:"1"}}),this.helpText&&h("div",{class:"help-icon",innerHTML:HelpIcon,onClick:function(){return e.showingHelp=true}})),h("form",{onSubmit:function(e){return e.preventDefault()},onClick:function(e){return e.stopPropagation()},autocomplete:"off"},h("div",{class:"row"},h("verdocs-text-input",{id:"verdocs-field-name",label:"Field Name",value:this.name,autocomplete:"off",placeholder:"Field Name...",onInput:function(t){e.name=t.target.value;e.dirty=true}})),h("div",{class:"row"},h("verdocs-text-input",{id:"verdocs-field-label",label:"Optional Label",value:this.label,autocomplete:"off",placeholder:"Optional Label...",onInput:function(t){e.label=t.target.value;e.dirty=true}})),h("div",{class:"row"},h("div",{class:"input-label"},"Role:"),h("verdocs-select-input",{value:this.roleName,options:(t=this.roleStore.state)===null||t===void 0?void 0:t.roles.map((function(e){return{label:e.name,value:e.name}})),onInput:function(t){e.roleName=t.target.value;e.dirty=true}})),["textbox","textarea"].includes(this.type)&&h("div",{class:"row",style:{marginTop:"10px",marginBottom:"10px"}},h("verdocs-text-input",{id:"verdocs-field-value",label:"Default Value",value:this.defaultValue,autocomplete:"off",placeholder:"Pre-filled value...",onInput:function(t){e.defaultValue=t.target.value;e.dirty=true}})),this.type==="radio"&&h("div",{class:"row"},h("verdocs-text-input",{id:"verdocs-field-label",label:"Group",value:this.group,autocomplete:"off",helpText:"Enable exclusive selections. Only one option within the same group may be selected at a time.",placeholder:"Group...",onInput:function(t){e.group=(t.target.value||"").trim().toLowerCase().replace(/[^a-z0-9]/g,"");e.dirty=true}})),["textbox","textarea"].includes(this.type)&&h("div",{class:"row",style:{marginTop:"10px",marginBottom:"10px"}},h("verdocs-text-input",{id:"verdocs-field-placeholder",label:"Placeholder",value:this.placeholder,autocomplete:"off",placeholder:"Placeholder...",onInput:function(t){e.placeholder=t.target.value;e.dirty=true}})),h("div",{class:"row",style:{marginTop:"15px",marginBottom:"15px"}},h("label",{htmlFor:"verdocs-is-required",class:"input-label"},"Required"),h("verdocs-checkbox",{id:"verdocs-is-required",name:"is-required",checked:this.required,value:"on",onInput:function(t){e.required=t.target.checked;e.dirty=true}})),this.type==="dropdown"&&h("div",{class:"row",style:{marginTop:"15px",marginBottom:"15px"}},h("label",{htmlFor:"verdocs-is-required",class:"input-label"},"Options")),this.type==="dropdown"&&h("div",{class:"options"},h("div",{class:"options-header"},h("div",{class:"options-header-label"},"ID"),h("dev",{class:"options-header-label"},"Label")),this.options.map((function(t,o){return h("div",{class:"row option-row",key:o},h("verdocs-text-input",{id:"verdocs-option-id-".concat(t.id),value:t.id,placeholder:"Unique ID",onInput:function(t){e.options[o].id=t.target.value;e.dirty=true;e.cleanupOptions()}}),h("verdocs-text-input",{id:"verdocs-option-value-".concat(t.id),value:t.value,placeholder:"Display value",onInput:function(t){e.options[o].value=t.target.value;e.dirty=true;e.cleanupOptions()}}),h("button",{innerHTML:TrashIcon,class:"remove-button",onClick:function(){e.options=e.options.filter((function(e){return e.id!==t.id}));e.dirty=true;e.cleanupOptions()}}))}))),h("div",{class:"buttons"},h("button",{class:"delete-button",disabled:this.dirty,onClick:function(t){return e.handleDelete(t)},innerHTML:TrashIcon}),h("div",{style:{flex:"1"}}),h("verdocs-button",{size:"small",variant:"outline",label:"Cancel",disabled:!this.dirty,onClick:function(t){return e.handleCancel(t)}}),h("verdocs-button",{size:"small",label:"Save",disabled:!this.dirty,onClick:function(t){return e.handleSave(t)}}))))};Object.defineProperty(e.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();VerdocsTemplateFieldProperties.style=VerdocsTemplateFieldPropertiesStyle0;export{VerdocsCheckbox as verdocs_checkbox,VerdocsComponentError as verdocs_component_error,VerdocsSelectInput as verdocs_select_input,VerdocsTemplateFieldProperties as verdocs_template_field_properties};
|
1
|
+
var __awaiter=this&&this.__awaiter||function(e,t,o,r){function i(e){return e instanceof o?e:new o((function(t){t(e)}))}return new(o||(o=Promise))((function(o,s){function n(e){try{a(r.next(e))}catch(e){s(e)}}function l(e){try{a(r["throw"](e))}catch(e){s(e)}}function a(e){e.done?o(e.value):i(e.value).then(n,l)}a((r=r.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var o={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},r,i,s,n;return n={next:l(0),throw:l(1),return:l(2)},typeof Symbol==="function"&&(n[Symbol.iterator]=function(){return this}),n;function l(e){return function(t){return a([e,t])}}function a(l){if(r)throw new TypeError("Generator is already executing.");while(n&&(n=0,l[0]&&(o=0)),o)try{if(r=1,i&&(s=l[0]&2?i["return"]:l[0]?i["throw"]||((s=i["return"])&&s.call(i),0):i.next)&&!(s=s.call(i,l[1])).done)return s;if(i=0,s)l=[l[0]&2,s.value];switch(l[0]){case 0:case 1:s=l;break;case 4:o.label++;return{value:l[1],done:false};case 5:o.label++;i=l[1];l=[0];continue;case 7:l=o.ops.pop();o.trys.pop();continue;default:if(!(s=o.trys,s=s.length>0&&s[s.length-1])&&(l[0]===6||l[0]===2)){o=0;continue}if(l[0]===3&&(!s||l[1]>s[0]&&l[1]<s[3])){o.label=l[1];break}if(l[0]===6&&o.label<s[1]){o.label=s[1];s=l;break}if(s&&o.label<s[2]){o.label=s[2];o.ops.push(l);break}if(s[2])o.ops.pop();o.trys.pop();continue}l=t.call(e,o)}catch(e){l=[6,e];i=0}finally{r=s=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(e,t,o){if(o||arguments.length===2)for(var r=0,i=t.length,s;r<i;r++){if(s||!(r in t)){if(!s)s=Array.prototype.slice.call(t,0,r);s[r]=t[r]}}return e.concat(s||Array.prototype.slice.call(t))};import{r as registerInstance,h,H as Host,c as createEvent,g as getElement}from"./index-d3ac9650.js";import{VerdocsEndpoint,updateField,deleteField}from"@verdocs/js-sdk";import{g as getTemplateFieldStore,u as updateStoreField}from"./TemplateFieldStore-6113ab4b.js";import{g as getTemplateRoleStore}from"./TemplateRoleStore-054bd7ed.js";import{g as getTemplateStore}from"./TemplateStore-d432547d.js";import{S as SDKError}from"./errors-887f1e88.js";import"./index-04235019.js";import"./index-7588a071.js";var verdocsCheckboxCss='@charset "UTF-8";@-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-checkbox{line-height:18px;font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-checkbox label>input[type=checkbox]{display:none}verdocs-checkbox label>input[type=checkbox]+*::before{content:"";width:20px;height:20px;-ms-flex-negative:0;flex-shrink:0;margin-right:8px;line-height:20px;border-radius:2px;border-style:solid;border-width:0.1rem;display:inline-block;vertical-align:bottom;border-color:#aeb4bf}verdocs-checkbox label>input[type=checkbox]:checked+*{color:#55bc81}verdocs-checkbox label>input[type=checkbox]:checked+*::before{content:"✓";color:white;text-align:center;background:#55bc81;border-color:#55bc81}verdocs-checkbox.dark label>input[type=checkbox]+*::before{border-color:#ffffff}verdocs-checkbox.dark label>input[type=checkbox]:checked+*::before{background:#55bc81;border-color:#55bc81}';var VerdocsCheckboxStyle0=verdocsCheckboxCss;var VerdocsCheckbox=function(){function e(e){registerInstance(this,e);this.checked=false;this.name="";this.label="";this.value="";this.theme="light";this.disabled=false}e.prototype.render=function(){var e;return h(Host,{key:"134ddfacbf313ed3d8aaaae104e7ceefaf8f260f",class:(e={disabled:this.disabled},e[this.theme]=true,e)},h("label",{key:"f4c5ad61ffc32acf46e42a22c9cfdb27b44d21c9"},h("input",{key:"edc72dbc12bb2f93daa6bf90fe8baddeee003a0f",type:"checkbox",value:this.value,name:this.name,checked:this.checked,disabled:this.disabled}),h("span",{key:"0d3a00d372dc0a0b2de109c1ee8c484153b789a7"},this.label)))};return e}();VerdocsCheckbox.style=VerdocsCheckboxStyle0;var verdocsComponentErrorCss='@-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-component-error{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;display:-ms-flexbox;display:flex;padding:15px;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center}verdocs-component-error .inner{-ms-flex:1;flex:1;height:300px;display:-ms-flexbox;display:flex;font-size:18px;-webkit-box-sizing:border-box;box-sizing:border-box;padding:0 20px;background:#ffffff;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center}';var VerdocsComponentErrorStyle0=verdocsComponentErrorCss;var VerdocsComponentError=function(){function e(e){registerInstance(this,e);this.message=""}e.prototype.render=function(){return h(Host,{key:"5fd53e1053d599dc955c727344dfbc48ddf13622"},h("div",{key:"bd877d18be032147ed72b999896f0cec3b021c95",class:"inner"},this.message))};return e}();VerdocsComponentError.style=VerdocsComponentErrorStyle0;var verdocsSelectInputCss='@-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-select-input{font-family:"Inter", "Barlow", sans-serif;-webkit-box-sizing:border-box;box-sizing:border-box;margin:0 0 10px 0;display:block}verdocs-select-input .input-element{-webkit-box-sizing:border-box;box-sizing:border-box;background:#ffffff;border:1px solid #cccccc;border-radius:4px;background:#ffffff;color:#092c4c;width:100%;font-size:16px;height:28px;padding:2px 8px}verdocs-select-input .input-element::-webkit-input-placeholder{color:#aaaaaa;opacity:1}verdocs-select-input .input-element::-moz-placeholder{color:#aaaaaa;opacity:1}verdocs-select-input .input-element:-ms-input-placeholder{color:#aaaaaa;opacity:1}verdocs-select-input .input-element::-ms-input-placeholder{color:#aaaaaa;opacity:1}verdocs-select-input .input-element::placeholder{color:#aaaaaa;opacity:1}verdocs-select-input .input-label{display:block;color:#555570;font-weight:700;font-size:14px;margin:0 0 4px 0}';var VerdocsSelectInputStyle0=verdocsSelectInputCss;var VerdocsSelectInput=function(){function e(e){registerInstance(this,e);this.value="";this.label="";this.options=undefined;this.disabled=false}e.prototype.render=function(){var e=this;return h(Host,{key:"4f49d2d10cf951c150b168563bcdb1d69e2385f2",class:"input-field"},h("label",{key:"a7329800f45797aac347e20231cc790e7ed4a91f"},this.label?h("div",{class:"input-label"},this.label+":"):h("div",null),h("select",{key:"1f66b8907f5ba4c9ecece9444ee4afc1be6a4459",class:"input-element",disabled:this.disabled},this.options.map((function(t){return h("option",{value:t.value,selected:t.value===e.value},t.label)})))))};return e}();VerdocsSelectInput.style=VerdocsSelectInputStyle0;var verdocsTemplateFieldPropertiesCss='@-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-template-field-properties{padding:20px;display:block;border-radius:4px;background:#ffffff;border:1px solid #ccc;font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;-webkit-box-shadow:2px 2px 10px 0 rgba(0, 0, 0, 0.1215686275);box-shadow:2px 2px 10px 0 rgba(0, 0, 0, 0.1215686275)}@media all and (max-width: 600px){verdocs-template-field-properties{padding:10px;-webkit-transform:scale(0.8);transform:scale(0.8)}}verdocs-template-field-properties .buttons{display:-ms-flexbox;display:flex;margin-top:30px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:end;justify-content:flex-end}verdocs-template-field-properties .buttons verdocs-button{margin-left:16px}verdocs-template-field-properties form .row{display:-ms-flexbox;display:flex;-webkit-column-gap:15px;-moz-column-gap:15px;column-gap:15px;margin:0 0 10px 0;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-template-field-properties form .row .input-label{display:block;color:#555570;font-weight:700;font-size:14px;margin:0 0 4px 0;-ms-flex:0 0 100px;flex:0 0 100px}verdocs-template-field-properties verdocs-select-input{-ms-flex:1;flex:1;margin:0}verdocs-template-field-properties verdocs-text-input{margin:0;-ms-flex:1;flex:1}verdocs-template-field-properties verdocs-text-input label{margin:0;display:-ms-flexbox;display:flex;-webkit-column-gap:15px;-moz-column-gap:15px;column-gap:15px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-template-field-properties verdocs-text-input .input-label{-ms-flex:0 0 100px;flex:0 0 100px}verdocs-template-field-properties verdocs-text-input input{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex}verdocs-template-field-properties .checkbox-wrapper{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex}verdocs-template-field-properties .delete-button{height:34px;display:-ms-flexbox;display:flex;cursor:pointer;background:none;border-radius:4px;-ms-flex-align:center;align-items:center;border:1px solid #999;-ms-flex-pack:center;justify-content:center}verdocs-template-field-properties .delete-button:active{background:#f3f3f3}verdocs-template-field-properties .delete-button svg{width:24px;height:24px}verdocs-template-field-properties h6{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex;font-size:16px;font-weight:bold;margin:0 0 8px 0;-ms-flex-direction:row;flex-direction:row;color:#092c4c}verdocs-template-field-properties h6 .help-icon{opacity:0.5}verdocs-template-field-properties h6 .help-icon:hover{opacity:1;cursor:pointer}verdocs-template-field-properties .row-header{gap:15px;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row}verdocs-template-field-properties .row-header h6{margin-bottom:0}verdocs-template-field-properties .row-header verdocs-help-icon{-webkit-transform:scale(0.85);transform:scale(0.85)}verdocs-template-field-properties .row-header verdocs-help-icon svg{margin-bottom:-5px}verdocs-template-field-properties .row-header .add-button{margin:0;padding:0;border:none;opacity:0.5;cursor:pointer;background:none}verdocs-template-field-properties .row-header .add-button:hover{opacity:1}verdocs-template-field-properties .row-header .add-button svg{width:32px;height:32px}verdocs-template-field-properties .options-header{gap:10px;margin:0 0 5px 0;display:-ms-flexbox;display:flex;color:#ffffff;font-size:14px;padding:5px 8px;font-weight:700;text-align:center;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:center;justify-content:center;background-color:#333333}verdocs-template-field-properties .options-header-label{display:-ms-flexbox;display:flex;-ms-flex:1;flex:1;font-weight:700;font-size:14px}verdocs-template-field-properties .option-row{margin:15px 0}verdocs-template-field-properties .option-row .remove-button{height:28px;display:-ms-flexbox;display:flex;cursor:pointer;background:none;border-radius:4px;-ms-flex-align:center;align-items:center;border:1px solid #999;-ms-flex-pack:center;justify-content:center}verdocs-template-field-properties .option-row .remove-button:active{background:#f3f3f3}verdocs-template-field-properties .option-row .remove-button:hover svg{stroke:rgb(165, 0, 33)}verdocs-template-field-properties .option-row .remove-button svg{width:20px;height:20px;stroke:#333333}verdocs-template-field-properties .options{background:#f3f3f3;padding:0 0 1px 0}verdocs-template-field-properties .options .row-header,verdocs-template-field-properties .options .option-row{padding:0 10px}verdocs-template-field-properties .options .add-option-button{border-radius:5px;border:1px solid #cccccc;background:#46497d;color:#ffffff;padding:3px 8px}verdocs-template-field-properties .options .option-row .input-element{font-size:14px}verdocs-template-field-properties .options verdocs-help-icon{opacity:1;-webkit-transform:scale(0.8);transform:scale(0.8)}verdocs-template-field-properties .options verdocs-help-icon svg{fill:#ffffff}';var VerdocsTemplateFieldPropertiesStyle0=verdocsTemplateFieldPropertiesCss;var capitalize=function(e){return e.charAt(0).toUpperCase()+e.slice(1)};var 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>';var HelpIcon='<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>';var VerdocsTemplateFieldProperties=function(){function e(e){registerInstance(this,e);this.close=createEvent(this,"close",7);this.delete=createEvent(this,"delete",7);this.settingsChanged=createEvent(this,"settingsChanged",7);this.sdkError=createEvent(this,"sdkError",7);this.templateStore=null;this.fieldStore=null;this.roleStore=null;this.endpoint=VerdocsEndpoint.getDefault();this.templateId="";this.fieldName="";this.helpText="";this.dirty=false;this.loading=true;this.label="";this.type="textbox";this.name="";this.required=false;this.roleName="";this.group="";this.fieldType="";this.options=[];this.placeholder="";this.defaultValue="";this.showingHelp=false}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,o,r,i;return __generator(this,(function(s){switch(s.label){case 0:s.trys.push([0,2,,3]);this.endpoint.loadSession();if(!this.templateId){console.log("[FIELD PROPERTIES] Missing required template ID ".concat(this.templateId));return[2]}if(!this.fieldName){console.error("[FIELD PROPERTIES] Missing required field name");return[2]}if(!this.endpoint.session){console.log("[FIELD PROPERTIES] Unable to start builder session, must be authenticated");return[2]}r=this;return[4,getTemplateStore(this.endpoint,this.templateId)];case 1:r.templateStore=s.sent();this.fieldStore=getTemplateFieldStore(this.templateId);this.roleStore=getTemplateRoleStore(this.templateId);this.resetForm();return[3,3];case 2:i=s.sent();console.log("[FIELD PROPERTIES] Error loading template",i);this.loading=false;(e=this.sdkError)===null||e===void 0?void 0:e.emit(new SDKError(i.message,(t=i.response)===null||t===void 0?void 0:t.status,(o=i.response)===null||o===void 0?void 0:o.data));return[3,3];case 3:return[2]}}))}))};e.prototype.resetForm=function(){var e=this;var t=this.fieldStore.get("fields").find((function(t){return t.name===e.fieldName}));if(!t){console.log('[FIELD PROPERTIES] Unable to find field "'.concat(this.fieldName,'" in fields'));return}else{console.log("[FIELD PROPERTIES]",t)}this.type=t.type;this.name=t.name;this.label=t.label;this.group=t.group;this.roleName=t.role_name;this.required=t.required;this.fieldType=t.type;this.options=t.options||[];this.placeholder=t.placeholder||"";this.defaultValue=t.default||"";this.dirty=false;this.loading=false;this.cleanupOptions()};e.prototype.handleCancel=function(e){var t,o;e.stopPropagation();this.resetForm();(t=this.close)===null||t===void 0?void 0:t.emit();(o=document.getElementById("verdocs-template-field-properties"))===null||o===void 0?void 0:o.remove()};e.prototype.handleSave=function(e){var t=this;e.stopPropagation();var o={name:this.name,role_name:this.roleName,required:this.required,label:this.label,group:this.group,placeholder:this.placeholder,default:this.defaultValue,options:this.options};console.log("[FIELD PROPERTIES] Will update",this.fieldName,o);updateField(this.endpoint,this.templateId,this.fieldName,o).then((function(e){var o,r,i;console.log("[FIELD PROPERTIES] Updated",e);updateStoreField(t.fieldStore,t.fieldName,e);(o=t.settingsChanged)===null||o===void 0?void 0:o.emit({fieldName:t.fieldName,field:e});(r=t.close)===null||r===void 0?void 0:r.emit();(i=document.getElementById("verdocs-template-field-properties"))===null||i===void 0?void 0:i.remove()})).catch((function(){console.log("[FIELD PROPERTIES] Update failed",e)}))};e.prototype.handleDelete=function(e){return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(o){e.stopPropagation();deleteField(this.endpoint,this.templateId,this.fieldName).then((function(){var e,o;t.fieldStore.set("fields",t.fieldStore.get("fields").filter((function(e){return e.name!==t.fieldName})));(e=t.delete)===null||e===void 0?void 0:e.emit({templateId:t.templateId,roleName:t.roleName});(o=document.getElementById("verdocs-template-field-properties"))===null||o===void 0?void 0:o.remove()})).catch((function(e){console.log("[FIELD PROPERTIES] Deletion error",e)}));return[2]}))}))};e.prototype.cleanupOptions=function(){this.options=__spreadArray([],this.options.filter((function(e){return(e.id||"").trim()!==""||(e.value||"").trim()!==""})),true);if(!this.options.find((function(e){return!e.id&&!e.value}))){this.options=__spreadArray(__spreadArray([],this.options,true),[{id:"",value:""}],false)}};e.prototype.render=function(){var e=this;var t;if(!this.endpoint.session){return h(Host,null,h("verdocs-component-error",{message:"You must be authenticated to use this module."}))}if(!this.endpoint.session||!this.fieldStore.get("fields").some((function(t){return t.name===e.fieldName}))){return h(Host,{class:"empty"})}if(this.helpText&&this.showingHelp){return h(Host,null,h("h6",null,capitalize(this.fieldType)," Settings ",h("div",{style:{flex:"1"}}),h("div",{class:"help-icon",innerHTML:HelpIcon,onClick:function(){return e.showingHelp=false}})),h("p",{class:"instructions",innerHTML:this.helpText}))}return h(Host,{id:"verdocs-template-field-properties"},h("h6",null,capitalize(this.fieldType.replace(/_/g," "))," Settings ",h("div",{style:{flex:"1"}}),this.helpText&&h("div",{class:"help-icon",innerHTML:HelpIcon,onClick:function(){return e.showingHelp=true}})),h("form",{onSubmit:function(e){return e.preventDefault()},onClick:function(e){return e.stopPropagation()},autocomplete:"off"},h("div",{class:"row"},h("verdocs-text-input",{id:"verdocs-field-name",label:"Field Name",value:this.name,autocomplete:"off",placeholder:"Field Name...",onInput:function(t){e.name=t.target.value;e.dirty=true}})),h("div",{class:"row"},h("verdocs-text-input",{id:"verdocs-field-label",label:"Optional Label",value:this.label,autocomplete:"off",placeholder:"Optional Label...",onInput:function(t){e.label=t.target.value;e.dirty=true}})),h("div",{class:"row"},h("div",{class:"input-label"},"Role:"),h("verdocs-select-input",{value:this.roleName,options:(t=this.roleStore.state)===null||t===void 0?void 0:t.roles.map((function(e){return{label:e.name,value:e.name}})),onInput:function(t){e.roleName=t.target.value;e.dirty=true}})),["textbox","textarea"].includes(this.type)&&h("div",{class:"row",style:{marginTop:"10px",marginBottom:"10px"}},h("verdocs-text-input",{id:"verdocs-field-value",label:"Default Value",value:this.defaultValue,autocomplete:"off",placeholder:"Pre-filled value...",onInput:function(t){e.defaultValue=t.target.value;e.dirty=true}})),this.type==="radio"&&h("div",{class:"row"},h("verdocs-text-input",{id:"verdocs-field-label",label:"Group",value:this.group,autocomplete:"off",helpText:"Enable exclusive selections. Only one option within the same group may be selected at a time.",placeholder:"Group...",onInput:function(t){e.group=(t.target.value||"").trim().toLowerCase().replace(/[^a-z0-9]/g,"");e.dirty=true}})),["textbox","textarea"].includes(this.type)&&h("div",{class:"row",style:{marginTop:"10px",marginBottom:"10px"}},h("verdocs-text-input",{id:"verdocs-field-placeholder",label:"Placeholder",value:this.placeholder,autocomplete:"off",placeholder:"Placeholder...",onInput:function(t){e.placeholder=t.target.value;e.dirty=true}})),h("div",{class:"row",style:{marginTop:"15px",marginBottom:"15px"}},h("label",{htmlFor:"verdocs-is-required",class:"input-label"},"Required"),h("verdocs-checkbox",{id:"verdocs-is-required",name:"is-required",checked:this.required,value:"on",onInput:function(t){e.required=t.target.checked;e.dirty=true}})),this.type==="dropdown"&&h("div",{class:"row",style:{marginTop:"15px",marginBottom:"15px"}},h("label",{htmlFor:"verdocs-is-required",class:"input-label"},"Options")),this.type==="dropdown"&&h("div",{class:"options"},h("div",{class:"options-header"},h("div",{class:"options-header-label"},"ID"),h("dev",{class:"options-header-label"},"Label")),this.options.map((function(t,o){return h("div",{class:"row option-row",key:o},h("verdocs-text-input",{id:"verdocs-option-id-".concat(t.id),value:t.id,placeholder:"Unique ID",onInput:function(t){e.options[o].id=t.target.value;e.dirty=true;e.cleanupOptions()}}),h("verdocs-text-input",{id:"verdocs-option-value-".concat(t.id),value:t.value,placeholder:"Display value",onInput:function(t){e.options[o].value=t.target.value;e.dirty=true;e.cleanupOptions()}}),h("button",{innerHTML:TrashIcon,class:"remove-button",onClick:function(){e.options=e.options.filter((function(e){return e.id!==t.id}));e.dirty=true;e.cleanupOptions()}}))}))),h("div",{class:"buttons"},h("button",{class:"delete-button",disabled:this.dirty,onClick:function(t){return e.handleDelete(t)},innerHTML:TrashIcon}),h("div",{style:{flex:"1"}}),h("verdocs-button",{size:"small",variant:"outline",label:"Cancel",disabled:!this.dirty,onClick:function(t){return e.handleCancel(t)}}),h("verdocs-button",{size:"small",label:"Save",disabled:!this.dirty,onClick:function(t){return e.handleSave(t)}}))))};Object.defineProperty(e.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();VerdocsTemplateFieldProperties.style=VerdocsTemplateFieldPropertiesStyle0;export{VerdocsCheckbox as verdocs_checkbox,VerdocsComponentError as verdocs_component_error,VerdocsSelectInput as verdocs_select_input,VerdocsTemplateFieldProperties as verdocs_template_field_properties};
|