legalesign-document-viewer 0.2.6 → 0.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.
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/ls-document-options_37.cjs.entry.js +62 -54
- package/dist/cjs/ls-document-options_37.cjs.entry.js.map +1 -1
- package/dist/cjs/ls-document-viewer.cjs.js +1 -1
- package/dist/collection/components/ls-document-viewer/defaultPalette.js +34 -20
- package/dist/collection/components/ls-document-viewer/defaultPalette.js.map +1 -1
- package/dist/collection/components/ls-document-viewer/ls-document-viewer.js +3 -27
- package/dist/collection/components/ls-document-viewer/ls-document-viewer.js.map +1 -1
- package/dist/collection/components/ls-editor-field/ls-editor-field.css +0 -244
- package/dist/collection/components/ls-editor-field/ls-editor-field.js +4 -23
- package/dist/collection/components/ls-editor-field/ls-editor-field.js.map +1 -1
- package/dist/collection/components/ls-participant-select/ls-participant-select.js +20 -20
- package/dist/collection/components/ls-participant-select/ls-participant-select.js.map +1 -1
- package/dist/collection/types/RoleColor.js.map +1 -1
- package/dist/components/ls-document-viewer.js +18 -24
- package/dist/components/ls-document-viewer.js.map +1 -1
- package/dist/components/ls-editor-field.js +1 -1
- package/dist/components/ls-field-properties-date.js +1 -1
- package/dist/components/ls-field-properties-email.js +1 -1
- package/dist/components/ls-field-properties-file.js +1 -1
- package/dist/components/ls-field-properties-general.js +1 -1
- package/dist/components/ls-field-properties-image.js +1 -1
- package/dist/components/ls-field-properties-multiple.js +1 -1
- package/dist/components/ls-field-properties-number.js +1 -1
- package/dist/components/ls-field-properties-signature.js +1 -1
- package/dist/components/ls-field-properties-text.js +1 -1
- package/dist/components/ls-field-properties.js +1 -1
- package/dist/components/ls-participant-manager.js +1 -1
- package/dist/components/ls-participant-select.js +1 -1
- package/dist/components/ls-toolbar.js +1 -1
- package/dist/components/{p-B7VyU7YH.js → p-7mvMkVRb.js} +3 -3
- package/dist/components/{p-B7VyU7YH.js.map → p-7mvMkVRb.js.map} +1 -1
- package/dist/components/{p-DzHh5tyo.js → p-B6Dqll_2.js} +3 -3
- package/dist/components/{p-DzHh5tyo.js.map → p-B6Dqll_2.js.map} +1 -1
- package/dist/components/{p-DEE854iZ.js → p-BYkgi-J_.js} +3 -3
- package/dist/components/{p-DEE854iZ.js.map → p-BYkgi-J_.js.map} +1 -1
- package/dist/components/{p-Bh-iiZW1.js → p-BedUS-Pi.js} +3 -3
- package/dist/components/{p-Bh-iiZW1.js.map → p-BedUS-Pi.js.map} +1 -1
- package/dist/components/{p-EsA1p6L3.js → p-Bj9FzNSh.js} +3 -3
- package/dist/components/{p-EsA1p6L3.js.map → p-Bj9FzNSh.js.map} +1 -1
- package/dist/components/{p-C6YMMVJ1.js → p-BjBJRt5-.js} +3 -3
- package/dist/components/{p-C6YMMVJ1.js.map → p-BjBJRt5-.js.map} +1 -1
- package/dist/components/{p-DCLBmOtj.js → p-CE67ypMe.js} +3 -3
- package/dist/components/{p-DCLBmOtj.js.map → p-CE67ypMe.js.map} +1 -1
- package/dist/components/{p-D4JCAjlc.js → p-CbUCAzmE.js} +23 -23
- package/dist/components/p-CbUCAzmE.js.map +1 -0
- package/dist/components/{p-ucaurEVy.js → p-CuxAfM9m.js} +3 -3
- package/dist/components/{p-ucaurEVy.js.map → p-CuxAfM9m.js.map} +1 -1
- package/dist/components/p-D1OQM-9f.js +40 -0
- package/dist/components/p-D1OQM-9f.js.map +1 -0
- package/dist/components/{p-rEZh-cMt.js → p-D4doNXE5.js} +3 -3
- package/dist/components/{p-rEZh-cMt.js.map → p-D4doNXE5.js.map} +1 -1
- package/dist/components/{p-D_ZsRxGa.js → p-DYZGkZmu.js} +3 -3
- package/dist/components/{p-D_ZsRxGa.js.map → p-DYZGkZmu.js.map} +1 -1
- package/dist/components/{p-1Ir9-yQU.js → p-DqToFDz3.js} +11 -11
- package/dist/components/{p-1Ir9-yQU.js.map → p-DqToFDz3.js.map} +1 -1
- package/dist/components/{p-BSN2cMdj.js → p-LFkQIFv6.js} +3 -3
- package/dist/components/{p-BSN2cMdj.js.map → p-LFkQIFv6.js.map} +1 -1
- package/dist/components/p-ynMP52Os.js +160 -0
- package/dist/components/p-ynMP52Os.js.map +1 -0
- package/dist/esm/loader.js +1 -1
- package/dist/esm/ls-document-options_37.entry.js +62 -54
- package/dist/esm/ls-document-options_37.entry.js.map +1 -1
- package/dist/esm/ls-document-viewer.js +1 -1
- package/dist/ls-document-viewer/ls-document-viewer.esm.js +1 -1
- package/dist/ls-document-viewer/{p-3e954354.entry.js → p-0ca48927.entry.js} +5 -5
- package/dist/ls-document-viewer/p-0ca48927.entry.js.map +1 -0
- package/dist/types/components/ls-document-viewer/defaultPalette.d.ts +2 -1
- package/dist/types/components/ls-document-viewer/ls-document-viewer.d.ts +0 -5
- package/dist/types/components/ls-editor-field/ls-editor-field.d.ts +1 -2
- package/dist/types/components/ls-field-properties-date/ls-field-properties-date.d.ts +1 -1
- package/dist/types/components/ls-field-properties-email/ls-field-properties-email.d.ts +1 -1
- package/dist/types/components/ls-field-properties-file/ls-field-properties-file.d.ts +1 -1
- package/dist/types/components/ls-field-properties-general/ls-field-properties-general.d.ts +1 -1
- package/dist/types/components/ls-field-properties-image/ls-field-properties-image.d.ts +1 -1
- package/dist/types/components/ls-field-properties-multiple/ls-field-properties-multiple.d.ts +1 -1
- package/dist/types/components/ls-field-properties-number/ls-field-properties-number.d.ts +1 -1
- package/dist/types/components/ls-field-properties-signature/ls-field-properties-signature.d.ts +1 -1
- package/dist/types/components/ls-field-properties-text/ls-field-properties-text.d.ts +1 -1
- package/dist/types/components/ls-participant-manager/ls-participant-manager.d.ts +1 -1
- package/dist/types/components/ls-participant-select/ls-participant-select.d.ts +1 -1
- package/dist/types/components.d.ts +0 -12
- package/dist/types/types/RoleColor.d.ts +6 -2
- package/package.json +1 -1
- package/dist/components/p-C00GqV9f.js +0 -26
- package/dist/components/p-C00GqV9f.js.map +0 -1
- package/dist/components/p-D4JCAjlc.js.map +0 -1
- package/dist/components/p-xCgJuAC2.js +0 -162
- package/dist/components/p-xCgJuAC2.js.map +0 -1
- package/dist/ls-document-viewer/p-3e954354.entry.js.map +0 -1
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
import { p as proxyCustomElement, H, h, d as Host } from './p-DjfDnBZ1.js';
|
|
2
|
+
import { b as getInputType } from './p-DqJ_uIFZ.js';
|
|
3
|
+
import { d as defaultRolePalette } from './p-D1OQM-9f.js';
|
|
4
|
+
|
|
5
|
+
const lsEditorFieldCss = ":host{display:block;position:absolute;margin:0px;padding:0px 0px 0px 0px;isolation:isolate}.ls-editor-field-editable{display:block;font-family:inherit;font-size:inherit;overflow:hidden;white-space:nowrap;margin:0;padding:0px 0px 0px 0px;min-width:2em;height:100%;width:100%}.ls-editor-field{opacity:0.7}.ls-editor-field-editable:focus{outline:none}.ls-editor-field-draggable{display:block;font-family:inherit;font-size:inherit;overflow:hidden;white-space:nowrap;min-width:2px;height:98%;width:98%}.hidden-field{display:none}input{all:unset}.draggable-input{font-family:inherit;font-size:inherit;position:relative;height:95%;width:95%}.editing-input{caret-color:rgb(15 23 42);caret-shape:auto;height:100%;width:100%}";
|
|
6
|
+
|
|
7
|
+
const LsEditorField = /*@__PURE__*/ proxyCustomElement(class LsEditorField extends H {
|
|
8
|
+
constructor() {
|
|
9
|
+
super();
|
|
10
|
+
this.__registerHost();
|
|
11
|
+
this.__attachShadow();
|
|
12
|
+
}
|
|
13
|
+
get component() { return this; }
|
|
14
|
+
dataItem;
|
|
15
|
+
selected;
|
|
16
|
+
readonly;
|
|
17
|
+
type;
|
|
18
|
+
page;
|
|
19
|
+
isEditing = false;
|
|
20
|
+
heldEdge = null;
|
|
21
|
+
isEdgeDragging = false;
|
|
22
|
+
innerValue;
|
|
23
|
+
sizeObserver;
|
|
24
|
+
handleInput(e) {
|
|
25
|
+
if (e.code === 'Enter') {
|
|
26
|
+
this.isEditing = false;
|
|
27
|
+
this.sizeObserver.observe(this.component.shadowRoot.getElementById('field-info'));
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
handleMouseMove(e) {
|
|
31
|
+
if (this.readonly)
|
|
32
|
+
return;
|
|
33
|
+
if (!e.clientX)
|
|
34
|
+
return;
|
|
35
|
+
// Determine which edge is being moved over and what cursor to show.
|
|
36
|
+
if (Math.abs(e.offsetX) < 5) {
|
|
37
|
+
this.component.style.cursor = 'ew-resize';
|
|
38
|
+
}
|
|
39
|
+
else if (Math.abs(e.offsetX - this.component.clientWidth) < 5) {
|
|
40
|
+
this.component.style.cursor = 'ew-resize';
|
|
41
|
+
}
|
|
42
|
+
else if (Math.abs(e.offsetY) < 5) {
|
|
43
|
+
this.component.style.cursor = 'ns-resize';
|
|
44
|
+
}
|
|
45
|
+
else if (Math.abs(e.offsetY - this.component.clientHeight) < 5) {
|
|
46
|
+
this.component.style.cursor = 'ns-resize';
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
this.component.style.cursor = 'move';
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
handleDoubleClick() {
|
|
53
|
+
if (this.readonly)
|
|
54
|
+
return;
|
|
55
|
+
this.isEditing = true;
|
|
56
|
+
this.heldEdge = null;
|
|
57
|
+
this.isEdgeDragging = false;
|
|
58
|
+
this.sizeObserver.disconnect();
|
|
59
|
+
this.innerValue = this.innerValue ? this.innerValue : this.dataItem?.value;
|
|
60
|
+
const editbox = this.component.shadowRoot.getElementById('editing-input');
|
|
61
|
+
console.log(editbox);
|
|
62
|
+
if (editbox) {
|
|
63
|
+
editbox.className = 'ls-editor-field-editable';
|
|
64
|
+
editbox.focus();
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
handleDragStart(event) {
|
|
68
|
+
console.log('dragstart ls-editor-field', event, this.type);
|
|
69
|
+
// Add the target element's id to the data transfer object
|
|
70
|
+
event.dataTransfer.setData('application/json', JSON.stringify({
|
|
71
|
+
type: this.type,
|
|
72
|
+
}));
|
|
73
|
+
event.dataTransfer.dropEffect = 'move';
|
|
74
|
+
}
|
|
75
|
+
watchSelectedHandler(_newValue, _oldValue) {
|
|
76
|
+
if (_newValue) {
|
|
77
|
+
this.component.style.background = `var(--${this.participantColor(this.dataItem?.signer)}-20)`;
|
|
78
|
+
this.component.style.opacity = '0.7';
|
|
79
|
+
this.component.style.boxShadow = '0 4px 6px -1px rgba(0, 0, 0, 0.10), 0 2px 4px -1px rgba(0, 0, 0, 0.06)';
|
|
80
|
+
}
|
|
81
|
+
else {
|
|
82
|
+
this.component.style.background = 'transparent';
|
|
83
|
+
this.component.style.boxShadow = 'none';
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
onInputChange(e) {
|
|
87
|
+
// console.log("INPUT CHANGE", e);
|
|
88
|
+
this.innerValue = e.target.value;
|
|
89
|
+
}
|
|
90
|
+
componentDidLoad() {
|
|
91
|
+
this.sizeObserver = new ResizeObserver(entries => {
|
|
92
|
+
for (const entry of entries) {
|
|
93
|
+
if (entry.contentRect) {
|
|
94
|
+
// const editbox = this.component.shadowRoot.getElementById('editing-input') as HTMLElement;
|
|
95
|
+
const movebox = this.component.shadowRoot.getElementById('field-info');
|
|
96
|
+
// console.log(editbox)
|
|
97
|
+
// editbox.style.height = entry.contentRect.height + "px"
|
|
98
|
+
// editbox.style.width = entry.contentRect.width + "px"
|
|
99
|
+
movebox.style.height = entry.contentRect.height + 'px';
|
|
100
|
+
movebox.style.width = entry.contentRect.width + 'px';
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
this.sizeObserver.observe(this.component);
|
|
105
|
+
// New dropped components automatically need selecting.
|
|
106
|
+
if (this.selected) {
|
|
107
|
+
this.component.style.background = this.participantColor(this.dataItem?.signer).s20;
|
|
108
|
+
this.component.style.opacity = '0.7';
|
|
109
|
+
this.component.style.boxShadow = '0 4px 6px -1px rgba(0, 0, 0, 0.10), 0 2px 4px -1px rgba(0, 0, 0, 0.06)';
|
|
110
|
+
}
|
|
111
|
+
else {
|
|
112
|
+
this.component.style.background = `transparent`;
|
|
113
|
+
this.component.style.boxShadow = 'none';
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
participantColor = (index) => {
|
|
117
|
+
return defaultRolePalette[index % 100] || defaultRolePalette[0];
|
|
118
|
+
};
|
|
119
|
+
render() {
|
|
120
|
+
return (h(Host, { key: '3c8441e53f90eed0e0b778924f9191342f504a65', style: { border: `1px ${this.participantColor(this.dataItem?.signer).s60} solid` } }, h("div", { key: 'b81189da32a8a824d19a90b452117a3e820798e5', class: {
|
|
121
|
+
'ls-editor-field': true,
|
|
122
|
+
'is-selected': this.selected,
|
|
123
|
+
} }, h("input", { key: 'e339642324a7180e435f4d04eaff8823288ab4bb', id: "editing-input", class: this.isEditing ? 'ls-editor-field-editable' : 'hidden-field', type: getInputType(this.dataItem.validation).inputType, value: this.dataItem?.value || this.innerValue, onChange: e => this.onInputChange(e) }), h("div", { key: 'af5b7435dab53aaf8b4ad0000b0e01116c97ef52', id: "field-info", class: this.isEditing ? 'hidden-field' : 'ls-editor-field-draggable' }, this.innerValue || this.dataItem?.label || this.dataItem?.formElementType))));
|
|
124
|
+
}
|
|
125
|
+
static get watchers() { return {
|
|
126
|
+
"selected": ["watchSelectedHandler"]
|
|
127
|
+
}; }
|
|
128
|
+
static get style() { return lsEditorFieldCss; }
|
|
129
|
+
}, [257, "ls-editor-field", {
|
|
130
|
+
"dataItem": [1040, "data-item"],
|
|
131
|
+
"selected": [4],
|
|
132
|
+
"readonly": [4],
|
|
133
|
+
"type": [1],
|
|
134
|
+
"page": [16],
|
|
135
|
+
"isEditing": [32],
|
|
136
|
+
"heldEdge": [32],
|
|
137
|
+
"isEdgeDragging": [32],
|
|
138
|
+
"innerValue": [32]
|
|
139
|
+
}, [[0, "keydown", "handleInput"], [3, "mousemove", "handleMouseMove"], [2, "dblclick", "handleDoubleClick"], [0, "dragstart", "handleDragStart"]], {
|
|
140
|
+
"selected": ["watchSelectedHandler"]
|
|
141
|
+
}]);
|
|
142
|
+
function defineCustomElement() {
|
|
143
|
+
if (typeof customElements === "undefined") {
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
146
|
+
const components = ["ls-editor-field"];
|
|
147
|
+
components.forEach(tagName => { switch (tagName) {
|
|
148
|
+
case "ls-editor-field":
|
|
149
|
+
if (!customElements.get(tagName)) {
|
|
150
|
+
customElements.define(tagName, LsEditorField);
|
|
151
|
+
}
|
|
152
|
+
break;
|
|
153
|
+
} });
|
|
154
|
+
}
|
|
155
|
+
defineCustomElement();
|
|
156
|
+
|
|
157
|
+
export { LsEditorField as L, defineCustomElement as d };
|
|
158
|
+
//# sourceMappingURL=p-ynMP52Os.js.map
|
|
159
|
+
|
|
160
|
+
//# sourceMappingURL=p-ynMP52Os.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"p-ynMP52Os.js","mappings":";;;;AAAA,MAAM,gBAAgB,GAAG,6sBAA6sB;;MCUztB,aAAa,iBAAAA,kBAAA,CAAA,MAAA,aAAA,SAAAC,CAAA,CAAA;;;;;;;AAEC,IAAA,QAAQ;AACzB,IAAA,QAAQ;AACR,IAAA,QAAQ;AACR,IAAA,IAAI;AACJ,IAAA,IAAI;IACH,SAAS,GAAY,KAAK;IAC1B,QAAQ,GAAW,IAAI;IACvB,cAAc,GAAY,KAAK;AAC/B,IAAA,UAAU;AACX,IAAA,YAAY;AAGpB,IAAA,WAAW,CAAC,CAAgB,EAAA;AAC1B,QAAA,IAAI,CAAC,CAAC,IAAI,KAAK,OAAO,EAAE;AACtB,YAAA,IAAI,CAAC,SAAS,GAAG,KAAK;AACtB,YAAA,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,cAAc,CAAC,YAAY,CAAC,CAAC;;;AAKrF,IAAA,eAAe,CAAC,CAAC,EAAA;QACf,IAAI,IAAI,CAAC,QAAQ;YAAE;QACnB,IAAI,CAAC,CAAC,CAAC,OAAO;YAAE;;QAGhB,IAAI,IAAI,CAAC,GAAG,C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,EAAA,0CAAA,EAAA,EAAE,EAAC,eAAe,EAClB,KAAK,EAAE,IAAI,CAAC,SAAS,GAAG,0BAA0B,GAAG,cAAc,EACnE,IAAI,EAAE,YAAY,CAAC,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC,SAAS,EACtD,KAAK,EAAE,IAAI,CAAC,QAAQ,EAAE,KAAK,IAAI,IAAI,CAAC,UAAU,EAC9C,QAAQ,EAAE,CAAC,IAAI,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,EACpC,CAAA,EACF,CAAA,CAAA,KAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAK,EAAE,EAAC,YAAY,EAAC,KAAK,EAAE,IAAI,CAAC,SAAS,GAAG,cAAc,GAAG,2BAA2B,EAAA,EACtF,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,QAAQ,EAAE,KAAK,IAAI,IAAI,CAAC,QAAQ,EAAE,eAAe,CACtE,CACF,CACD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["__stencil_proxyCustomElement","HTMLElement"],"sources":["src/components/ls-editor-field/ls-editor-field.css?tag=ls-editor-field&encapsulation=shadow","src/components/ls-editor-field/ls-editor-field.tsx"],"sourcesContent":[":host {\n display: block;\n position: absolute;\n margin: 0px;\n padding: 0px 0px 0px 0px;\n isolation: isolate;\n}\n\n.ls-editor-field-editable {\n display: block;\n font-family: inherit;\n font-size: inherit;\n overflow: hidden;\n\n /* no extra spaces */\n white-space: nowrap;\n margin: 0;\n padding: 0px 0px 0px 0px;\n /* default widths */\n min-width: 2em;\n height: 100%;\n width: 100%;\n}\n\n.ls-editor-field {\n opacity: 0.7;\n}\n\n.ls-editor-field-editable:focus {\n outline: none;\n}\n\n.ls-editor-field-draggable {\n display: block;\n font-family: inherit;\n font-size: inherit;\n overflow: hidden;\n\n /* no extra spaces */\n white-space: nowrap;\n\n /* default widths */\n min-width: 2px;\n height: 98%;\n width: 98%;\n}\n\n/* .is-selected {\n border: 1px dotted rgb(193, 26, 26);\n} */\n\n.hidden-field {\n display: none;\n}\n\ninput {\n all: unset;\n}\n\n.draggable-input {\n font-family: inherit;\n font-size: inherit;\n position: relative;\n height: 95%;\n width: 95%;\n}\n\n.editing-input {\n caret-color: rgb(15 23 42);\n caret-shape: auto;\n height: 100%;\n width: 100%;\n}","import { Component, Host, h, Element, State, Prop, Watch, Listen } from '@stencil/core';\nimport { LSApiElement } from '../../components';\nimport { getInputType } from '../ls-document-viewer/editorUtils';\nimport { defaultRolePalette } from '../ls-document-viewer/defaultPalette';\n\n@Component({\n tag: 'ls-editor-field',\n styleUrl: 'ls-editor-field.css',\n shadow: true,\n})\nexport class LsEditorField {\n @Element() component: HTMLElement;\n @Prop({ mutable: true }) dataItem: LSApiElement;\n @Prop() selected: boolean;\n @Prop() readonly: boolean;\n @Prop() type: 'text' | 'signature' | 'date' | 'regex' | 'file' | 'number' | 'autodate';\n @Prop() page: { height: number; width: number };\n @State() isEditing: boolean = false;\n @State() heldEdge: string = null;\n @State() isEdgeDragging: boolean = false;\n @State() innerValue: string;\n private sizeObserver: ResizeObserver;\n\n @Listen('keydown')\n handleInput(e: KeyboardEvent) {\n if (e.code === 'Enter') {\n this.isEditing = false;\n this.sizeObserver.observe(this.component.shadowRoot.getElementById('field-info'));\n }\n }\n\n @Listen('mousemove', { capture: true })\n handleMouseMove(e) {\n if (this.readonly) return;\n if (!e.clientX) return;\n\n // Determine which edge is being moved over and what cursor to show.\n if (Math.abs(e.offsetX) < 5) {\n this.component.style.cursor = 'ew-resize';\n } else if (Math.abs(e.offsetX - this.component.clientWidth) < 5) {\n this.component.style.cursor = 'ew-resize';\n } else if (Math.abs(e.offsetY) < 5) {\n this.component.style.cursor = 'ns-resize';\n } else if (Math.abs(e.offsetY - this.component.clientHeight) < 5) {\n this.component.style.cursor = 'ns-resize';\n } else {\n this.component.style.cursor = 'move';\n }\n }\n\n @Listen('dblclick', { capture: true })\n handleDoubleClick() {\n if (this.readonly) return;\n this.isEditing = true;\n this.heldEdge = null;\n this.isEdgeDragging = false;\n this.sizeObserver.disconnect();\n this.innerValue = this.innerValue ? this.innerValue : this.dataItem?.value;\n\n const editbox = this.component.shadowRoot.getElementById('editing-input') as HTMLInputElement;\n console.log(editbox);\n\n if (editbox) {\n editbox.className = 'ls-editor-field-editable';\n editbox.focus();\n }\n }\n\n @Listen('dragstart', { capture: false, passive: false })\n handleDragStart(event) {\n console.log('dragstart ls-editor-field', event, this.type);\n // Add the target element's id to the data transfer object\n event.dataTransfer.setData(\n 'application/json',\n JSON.stringify({\n type: this.type,\n }),\n );\n event.dataTransfer.dropEffect = 'move';\n }\n\n @Watch('selected')\n watchSelectedHandler(_newValue: boolean, _oldValue: boolean) {\n if (_newValue) {\n this.component.style.background = `var(--${this.participantColor(this.dataItem?.signer)}-20)`;\n this.component.style.opacity = '0.7';\n this.component.style.boxShadow = '0 4px 6px -1px rgba(0, 0, 0, 0.10), 0 2px 4px -1px rgba(0, 0, 0, 0.06)';\n } else {\n this.component.style.background = 'transparent';\n this.component.style.boxShadow = 'none';\n }\n }\n\n onInputChange(e) {\n // console.log(\"INPUT CHANGE\", e);\n this.innerValue = e.target.value;\n }\n\n componentDidLoad() {\n this.sizeObserver = new ResizeObserver(entries => {\n for (const entry of entries) {\n if (entry.contentRect) {\n // const editbox = this.component.shadowRoot.getElementById('editing-input') as HTMLElement;\n const movebox = this.component.shadowRoot.getElementById('field-info') as HTMLElement;\n // console.log(editbox)\n // editbox.style.height = entry.contentRect.height + \"px\"\n // editbox.style.width = entry.contentRect.width + \"px\"\n\n movebox.style.height = entry.contentRect.height + 'px';\n movebox.style.width = entry.contentRect.width + 'px';\n }\n }\n });\n\n this.sizeObserver.observe(this.component);\n\n // New dropped components automatically need selecting.\n if (this.selected) {\n this.component.style.background = this.participantColor(this.dataItem?.signer).s20;\n this.component.style.opacity = '0.7';\n this.component.style.boxShadow = '0 4px 6px -1px rgba(0, 0, 0, 0.10), 0 2px 4px -1px rgba(0, 0, 0, 0.06)';\n } else {\n this.component.style.background = `transparent`;\n this.component.style.boxShadow = 'none';\n }\n }\n\n participantColor = (index: number) => {\n return defaultRolePalette[index % 100] || defaultRolePalette[0];\n };\n\n render() {\n return (\n <Host style={{ border: `1px ${this.participantColor(this.dataItem?.signer).s60} solid` }}>\n <div\n class={{\n 'ls-editor-field': true,\n 'is-selected': this.selected,\n }}\n >\n <input\n id=\"editing-input\"\n class={this.isEditing ? 'ls-editor-field-editable' : 'hidden-field'}\n type={getInputType(this.dataItem.validation).inputType}\n value={this.dataItem?.value || this.innerValue}\n onChange={e => this.onInputChange(e)}\n />\n <div id=\"field-info\" class={this.isEditing ? 'hidden-field' : 'ls-editor-field-draggable'}>\n {this.innerValue || this.dataItem?.label || this.dataItem?.formElementType}\n </div>\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
|
package/dist/esm/loader.js
CHANGED
|
@@ -4,7 +4,7 @@ export { s as setNonce } from './index-BwkWPcyG.js';
|
|
|
4
4
|
const defineCustomElements = async (win, options) => {
|
|
5
5
|
if (typeof window === 'undefined') return undefined;
|
|
6
6
|
await globalScripts();
|
|
7
|
-
return bootstrapLazy([["ls-document-options_37",[[257,"ls-document-viewer",{"template":[1],"token":[1],"templateid":[1],"zoom":[1026],"pageNum":[1026,"page-num"],"signer":[1026],"mode":[1],"manager":[1025],"displayTable":[1028,"display-table"],"showtoolbox":[4],"showtoolbar":[4],"showstatusbar":[4],"showpagepreview":[4],"showrightpanel":[4],"expandfields":[4],"readonly":[4],"showtableview":[4],"toolboxFilter":[1,"toolbox-filter"],"
|
|
7
|
+
return bootstrapLazy([["ls-document-options_37",[[257,"ls-document-viewer",{"template":[1],"token":[1],"templateid":[1],"zoom":[1026],"pageNum":[1026,"page-num"],"signer":[1026],"mode":[1],"manager":[1025],"displayTable":[1028,"display-table"],"showtoolbox":[4],"showtoolbar":[4],"showstatusbar":[4],"showpagepreview":[4],"showrightpanel":[4],"expandfields":[4],"readonly":[4],"showtableview":[4],"toolboxFilter":[1,"toolbox-filter"],"_template":[32],"_group":[32],"selected":[32],"pageNext":[64],"pagePrev":[64],"setZoom":[64]},[[0,"mutate","mutateHandler"],[0,"update","updateHandler"],[0,"selectFields","selectFieldsHandler"],[0,"roleChange","roleHandler"]],{"mode":["modeHandler"],"displayTable":["tableViewHandler"]}],[257,"ls-field-properties",{"dataItem":[16,"data-item"]}],[257,"ls-document-options",{"template":[16]},null,{"template":["selectedHandler"]}],[257,"ls-toolbar",{"dataItem":[1040,"data-item"],"template":[16],"editor":[16]}],[257,"ls-feature-column",{"manager":[1025]}],[257,"ls-participant-manager",{"editor":[16],"template":[16]}],[257,"ls-statusbar",{"zoom":[1026],"editor":[16]}],[257,"ls-toolbox-field",{"formElementType":[1,"form-element-type"],"elementType":[1,"element-type"],"validation":[2],"label":[1],"icon":[1],"defaultHeight":[2,"default-height"],"defaultWidth":[2,"default-width"],"color":[1]},[[1,"dragstart","handleDragStart"],[0,"keydown","handleKeyDown"]]],[257,"ls-editor-field",{"dataItem":[1040,"data-item"],"selected":[4],"readonly":[4],"type":[1],"page":[16],"isEditing":[32],"heldEdge":[32],"isEdgeDragging":[32],"innerValue":[32]},[[0,"keydown","handleInput"],[3,"mousemove","handleMouseMove"],[2,"dblclick","handleDoubleClick"],[0,"dragstart","handleDragStart"]],{"selected":["watchSelectedHandler"]}],[257,"ls-editor-table",{"editor":[16]}],[257,"ls-field-properties-multiple",{"dataItem":[16,"data-item"],"fieldSet":[1,"field-set"]}],[257,"ls-field-properties-date",{"dataItem":[16,"data-item"],"fieldSet":[1,"field-set"]}],[257,"ls-field-properties-email",{"dataItem":[16,"data-item"],"fieldSet":[1,"field-set"]}],[257,"ls-field-properties-general",{"dataItem":[16,"data-item"],"fieldSet":[1,"field-set"]}],[257,"ls-field-properties-image",{"dataItem":[16,"data-item"],"fieldSet":[1,"field-set"]}],[257,"ls-field-properties-number",{"dataItem":[16,"data-item"],"fieldSet":[1,"field-set"]}],[257,"ls-field-properties-signature",{"dataItem":[1040,"data-item"],"fieldSet":[1,"field-set"]}],[260,"ls-formfield",{"name":[1],"fieldId":[1,"field-id"],"label":[1],"as":[1],"value":[1032],"placeholder":[1],"descriptionText":[1,"description-text"],"errorText":[1,"error-text"],"aria":[1],"inputRef":[1,"input-ref"],"infoTooltipText":[1,"info-tooltip-text"],"hoverTooltipText":[1,"hover-tooltip-text"],"disabled":[4],"extraLabel":[1,"extra-label"],"required":[4],"valid":[4],"dirty":[4],"count":[4],"countMax":[2,"count-max"],"buttonClick":[16,"button-click"],"buttonIcon":[1,"button-icon"],"labelIcon":[1,"label-icon"],"fieldIcon":[1,"field-icon"],"_value":[32]},null,{"value":["valueWatcher"]}],[257,"ls-field-properties-file",{"dataItem":[16,"data-item"],"fieldSet":[1,"field-set"]}],[257,"ls-field-properties-autosign",{"dataItem":[16,"data-item"]}],[257,"ls-field-properties-text",{"dataItem":[16,"data-item"],"fieldSet":[1,"field-set"]}],[257,"ls-field-format",{"dataItem":[1040,"data-item"]}],[257,"ls-participant-select",{"dataItem":[1040,"data-item"],"roles":[16],"selectedRole":[32],"isOpen":[32]}],[257,"ls-field-alignment",{"dataItem":[1040,"data-item"]}],[257,"ls-field-distribute",{"dataItem":[1040,"data-item"]}],[257,"ls-field-size",{"dataItem":[1040,"data-item"]}],[257,"ls-number-input",{"type":[1],"name":[1],"value":[1026],"placeholder":[1],"aria":[1],"inputRef":[1,"input-ref"],"disabled":[4],"required":[4],"valid":[4],"dirty":[4],"countMax":[2,"count-max"],"buttonClick":[8,"button-click"],"buttonIcon":[1,"button-icon"],"fieldIcon":[1,"field-icon"]}],[256,"ls-radio-input",{"radioId":[1,"radio-id"],"label":[1],"icon":[1],"name":[1],"checked":[4],"disabled":[4],"customStyle":[16,"custom-style"]}],[260,"ls-select-input",{"name":[1],"value":[1],"aria":[1],"inputRef":[1,"input-ref"],"disabled":[4],"displayOnly":[4,"display-only"],"required":[4],"valid":[4],"dirty":[4],"buttonClick":[8,"button-click"],"buttonIcon":[1,"button-icon"],"fieldIcon":[1,"field-icon"]}],[257,"ls-text-input",{"type":[1],"name":[1],"value":[1025],"placeholder":[1],"aria":[1],"inputRef":[1,"input-ref"],"disabled":[4],"required":[4],"valid":[4],"dirty":[4],"countMax":[2,"count-max"],"buttonClick":[8,"button-click"],"buttonIcon":[1,"button-icon"],"fieldIcon":[1,"field-icon"],"showPassword":[32]}],[257,"ls-textarea-input",{"name":[1],"value":[1],"placeholder":[1],"aria":[1],"inputRef":[1,"input-ref"],"disabled":[4],"displayOnly":[4,"display-only"],"required":[4],"valid":[4],"dirty":[4],"countMax":[2,"count-max"],"buttonClick":[8,"button-click"],"buttonIcon":[1,"button-icon"],"fieldIcon":[1,"field-icon"]}],[257,"ls-field-footer",{"dataItem":[1040,"data-item"]}],[257,"ls-field-properties-advanced",{"dataItem":[1040,"data-item"]}],[257,"ls-field-placement",{"dataItem":[1040,"data-item"]}],[257,"ls-field-dimensions",{"dataItem":[1040,"data-item"]}],[257,"ls-toggle"],[257,"ls-icon",{"name":[1],"solid":[4],"size":[1],"customStyle":[16,"custom-style"]}]]]], options);
|
|
8
8
|
};
|
|
9
9
|
|
|
10
10
|
export { defineCustomElements };
|
|
@@ -19901,26 +19901,40 @@ const findDimensions = (frameContainer, sourceField, pageHeight, pageWidth, zoom
|
|
|
19901
19901
|
};
|
|
19902
19902
|
|
|
19903
19903
|
// import { RoleColor } from "../../types/RoleColor";
|
|
19904
|
-
|
|
19905
|
-
|
|
19906
|
-
|
|
19907
|
-
|
|
19908
|
-
|
|
19909
|
-
|
|
19910
|
-
|
|
19911
|
-
|
|
19912
|
-
|
|
19913
|
-
|
|
19914
|
-
|
|
19915
|
-
|
|
19916
|
-
|
|
19917
|
-
|
|
19918
|
-
|
|
19919
|
-
|
|
19920
|
-
|
|
19921
|
-
|
|
19922
|
-
|
|
19923
|
-
|
|
19904
|
+
const defaultRolePalette = [
|
|
19905
|
+
{ s60: '#afb0b2', s80: '#6f7176', s50: '#c8c9cc', s10: '#f7f8fa', s20: '#edeff2', description: 'gray' },
|
|
19906
|
+
{ s60: '#5684f0', s80: '#2d4dcc', s50: '#78a3fa', s10: '#f0f6ff', s20: '#e0ecff', description: 'blue' },
|
|
19907
|
+
{ s60: '#46dbaa', s80: '#15946a', s50: '#57e5b1', s10: '#effff9', s20: '#c5fde8', description: 'green' },
|
|
19908
|
+
{ s60: '#f0b618', s80: '#9e5913', s50: '#fad232', s10: '#fffcef', s20: '#fff3c2', description: 'yellow' },
|
|
19909
|
+
{ s60: '#9956f0', s80: '#', s50: '#', s10: '#', s20: '#eee5ff', description: 'purple' },
|
|
19910
|
+
{ s60: '#46dbbd', s80: '#', s50: '#', s10: '#', s20: '#c5fcf1', description: 'teal' },
|
|
19911
|
+
{ s60: '#f056b2', s80: '#', s50: '#', s10: '#', s20: '#ffe5f5', description: 'pink' },
|
|
19912
|
+
{ s60: '#bdf056', s80: '#', s50: '#', s10: '#', s20: '#f6ffe5', description: 'lime' },
|
|
19913
|
+
{ s60: '#f64a44', s80: '#', s50: '#', s10: '#', s20: '#ffe1e0', description: 'red' },
|
|
19914
|
+
{ s60: '#48c5f0', s80: '#', s50: '#', s10: '#', s20: '#c7f1ff', description: 'lightblue' },
|
|
19915
|
+
{ s60: '#d156f0', s80: '#', s50: '#', s10: '#', s20: '#fae5ff', description: 'aubergine' },
|
|
19916
|
+
{ s60: '#f09456', s80: '#', s50: '#', s10: '#', s20: '#fff0e5', description: 'burnt' },
|
|
19917
|
+
{ s60: '#56f056', s80: '#', s50: '#', s10: '#', s20: '#e5ffe5', description: 'truegreen' },
|
|
19918
|
+
{ s60: '#6b56f0', s80: '#', s50: '#', s10: '#', s20: '#e9e5ff', description: 'indigo' },
|
|
19919
|
+
{ s60: '#46dbdb', s80: '#', s50: '#', s10: '#', s20: '#c5fcfc', description: 'cyan' },
|
|
19920
|
+
{ s60: 'rgb(70, 219, 170)', s80: '#', s50: '#', s10: '#', s20: 'rgb(239, 255, 249)', description: 'overflowcolor' },
|
|
19921
|
+
{ s60: 'rgb(240, 182, 24)', s80: '#', s50: '#', s10: '#', s20: 'rgb(255, 252, 239)', description: 'overflowcolor' },
|
|
19922
|
+
{ s60: 'rgb(238, 229, 255)', s80: '#', s50: '#', s10: '#', s20: 'rgb(244, 240, 255)', description: 'overflowcolor' },
|
|
19923
|
+
{ s60: 'rgb(240, 86, 178)', s80: '#', s50: '#', s10: '#', s20: 'rgb(255, 240, 249)', description: 'overflowcolor' },
|
|
19924
|
+
{ s60: 'rgb(189, 240, 86)', s80: '#', s50: '#', s10: '#', s20: 'rgb(250, 255, 240)', description: 'overflowcolor' },
|
|
19925
|
+
{ s60: 'rgb(246, 74, 68)', s80: '#', s50: '#', s10: '#', s20: 'rgb(246, 190, 188)', description: 'overflowcolor' },
|
|
19926
|
+
{ s60: 'rgb(58, 0, 166)', s80: '#', s50: '#', s10: '#', s20: 'rgb(188, 169, 240)', description: 'overflowcolor' },
|
|
19927
|
+
{ s60: 'rgba(1, 179, 34, 0.69)', s80: '#', s50: '#', s10: '#', s20: 'rgb(135, 173, 158)', description: 'overflowcolor' },
|
|
19928
|
+
{ s60: 'rgb(201, 204, 0)', s80: '#', s50: '#', s10: '#', s20: 'rgba(246, 247, 203, 0.77)', description: 'overflowcolor' },
|
|
19929
|
+
{ s60: 'rgb(249, 55, 129)', s80: '#', s50: '#', s10: '#', s20: 'rgb(255, 237, 244)', description: 'overflowcolor' },
|
|
19930
|
+
{ s60: 'rgb(0, 14, 166)', s80: '#', s50: '#', s10: '#', s20: 'rgb(209, 212, 243)', description: 'overflowcolor' },
|
|
19931
|
+
{ s60: 'rgb(135, 173, 158)', s80: '#', s50: '#', s10: '#', s20: 'rgb(205, 244, 228)', description: 'overflowcolor' },
|
|
19932
|
+
{ s60: 'rgb(86, 199, 240)', s80: '#', s50: '#', s10: '#', s20: 'rgb(202, 236, 248)', description: 'overflowcolor' },
|
|
19933
|
+
{ s60: 'rgb(246, 205, 68)', s80: '#', s50: '#', s10: '#', s20: 'rgb(244, 240, 255)', description: 'overflowcolor' },
|
|
19934
|
+
{ s60: 'rgb(0, 94, 166)', s80: '#', s50: '#', s10: '#', s20: 'rgb(188, 169, 240)', description: 'overflowcolor' },
|
|
19935
|
+
{ s60: 'rgba(179, 1, 63, 0.69)', s80: '#', s50: '#', s10: '#', s20: 'rgb(135, 173, 158)', description: 'overflowcolor' },
|
|
19936
|
+
];
|
|
19937
|
+
// export const defaultRolePalette: string[] = ['gray', 'blue', 'green', 'yellow', 'purple', 'teal', 'pink', 'lime', 'red', 'lightblue', 'aubergine', 'burnt', 'trueGreen', 'indigo', 'cyan'];
|
|
19924
19938
|
|
|
19925
19939
|
/**
|
|
19926
19940
|
* These utils are used to make document-viewer more readable
|
|
@@ -24776,11 +24790,6 @@ const LsDocumentViewer = class {
|
|
|
24776
24790
|
* {boolean}
|
|
24777
24791
|
*/
|
|
24778
24792
|
toolboxFilter = null;
|
|
24779
|
-
/**
|
|
24780
|
-
* Allows you to change the colours used for each role in the template.
|
|
24781
|
-
* {SignerColor[]}
|
|
24782
|
-
*/
|
|
24783
|
-
roleColors = defaultRolePalette;
|
|
24784
24793
|
//
|
|
24785
24794
|
// --- Event Emitters --- //
|
|
24786
24795
|
//
|
|
@@ -25032,10 +25041,10 @@ const LsDocumentViewer = class {
|
|
|
25032
25041
|
this.load();
|
|
25033
25042
|
}
|
|
25034
25043
|
signerColor = (index) => {
|
|
25035
|
-
return
|
|
25044
|
+
return defaultRolePalette[index % 100].s60 || defaultRolePalette[0].s60;
|
|
25036
25045
|
};
|
|
25037
25046
|
render() {
|
|
25038
|
-
return (h(Host, { key: '
|
|
25047
|
+
return (h(Host, { key: '859d2cc0c98f729ebacb16f36cee16dd28af7c2d' }, h(h.Fragment, null, h("div", { key: '4be8fb9ad4c7d583b474e3b23b1f1006ba1c2d08', class: "page-header" }, h("p", { key: '2cc24d403cc217a4e2f5b2ef109412a6396f2c4a', class: "header-text-1" }, "Template Creation"), h("p", { key: '3cc17aa5ef734022e85ef1e8501c9f1b22a8d5e9' }, "/"), h("p", { key: '5524c9eb62a096563eaad2f09af00c41df806ac7', class: "header-text-2" }, "Template Name")), h("form", { key: '3bc3f5317106ea2c4cabe42a70451906e0f13ac3', id: "ls-editor-form" }, this.showtoolbox === true ? (h("div", { class: "leftBox" }, h("div", { class: !this.selected || this.selected.length === 0 ? 'left-box-inner' : 'hidden' }, h("ls-feature-column", { onManage: manager => {
|
|
25039
25048
|
if (manager.detail === 'document') {
|
|
25040
25049
|
var documentManager = this.component.shadowRoot.getElementById('ls-document-options');
|
|
25041
25050
|
documentManager.template = this._template;
|
|
@@ -25048,7 +25057,7 @@ const LsDocumentViewer = class {
|
|
|
25048
25057
|
} }), h("div", { id: "ls-toolbox", class: this.manager === 'toolbox' ? 'toolbox' : 'hidden' }, h("div", { class: "ls-editor-infobox" }, h("h2", { class: "toolbox-section-title" }, "Participant Fields"), h("p", { class: "toolbox-section-description" }, "Select and Click to place Signature fields where you\u2019d like on the Document.")), h("div", { class: "fields-box" }, this.signer > 0 ? (h("ls-toolbox-field", { elementType: "signature", formElementType: "signature", label: "Signature", defaultHeight: 27, defaultWidth: 120, validation: 0, icon: "signature", color: this.signerColor(this.signer) })) : (h("ls-toolbox-field", { elementType: "auto sign", formElementType: "auto sign", label: "Auto Sign", defaultHeight: 27, defaultWidth: 120, validation: 3000, icon: "auto-sign", color: this.signerColor(this.signer) })), h("ls-toolbox-field", { elementType: "initials", formElementType: "initials", label: "Initials", defaultHeight: 27, defaultWidth: 120, validation: 2000, icon: "initials", color: this.signerColor(this.signer) }), h("ls-toolbox-field", { elementType: "date", formElementType: "date", label: "Date", defaultHeight: 27, defaultWidth: 80, validation: 2, icon: "calender", color: this.signerColor(this.signer) }), h("ls-toolbox-field", { elementType: "signing date", formElementType: "signing date", label: "Signing Date", defaultHeight: 27, defaultWidth: 120, validation: 30, icon: "auto-date", color: this.signerColor(this.signer) }), h("ls-toolbox-field", { elementType: "email", formElementType: "email", label: "Email", defaultHeight: 27, defaultWidth: 120, validation: 1, icon: "at-symbol", color: this.signerColor(this.signer) }), h("ls-toolbox-field", { elementType: "text", formElementType: "text", label: "Text", defaultHeight: 27, defaultWidth: 100, validation: 0, icon: "text", color: this.signerColor(this.signer) }), h("div", { class: 'expand-fields-row', onClick: () => (this.expandfields = !this.expandfields) }, h("ls-icon", { name: this.expandfields ? 'expand' : 'collapse', size: "20", solid: true }), h("p", null, "More Field Types")), this.expandfields && (h("div", { class: "fields-box" }, h("ls-toolbox-field", { elementType: "number", formElementType: "number", label: "Number", defaultHeight: 27, defaultWidth: 80, validation: 50, icon: "hashtag", color: this.signerColor(this.signer) }), h("ls-toolbox-field", { elementType: "checkbox", formElementType: "checkbox", label: "Checkbox", defaultHeight: 27, defaultWidth: 27, validation: 25, icon: "check", color: this.signerColor(this.signer) }), h("ls-toolbox-field", { elementType: "regex", formElementType: "regex", label: "Regex", defaultHeight: 27, defaultWidth: 120, validation: 93, icon: "code", color: this.signerColor(this.signer) }), h("ls-toolbox-field", { elementType: "image", formElementType: "image", label: "Image", defaultHeight: 27, defaultWidth: 120, validation: 90, icon: "photograph", color: this.signerColor(this.signer) }), h("ls-toolbox-field", { elementType: "file", formElementType: "file", label: "File", defaultHeight: 27, defaultWidth: 120, validation: 74, icon: "upload", color: this.signerColor(this.signer) }))))), h("ls-participant-manager", { id: "ls-participant-manager", class: this.manager === 'participant' ? 'toolbox' : 'hidden', editor: this }), h("ls-document-options", { id: "ls-document-options", class: this.manager === 'document' ? 'toolbox' : 'hidden' })), this.showrightpanel && !this.displayTable && (h("div", { class: this.selected && this.selected.length > 0 ? 'field-properties-outer' : 'hidden' }, h("div", { class: 'properties-header' }, h("div", { class: 'properties-header-icon' }, h("ls-icon", { name: "pre-filled-content" })), h("h1", { class: 'properties-header-title' }, "Field Properties"), h("button", { class: 'tertiaryGrey', onClick: e => {
|
|
25049
25058
|
this.selected = [];
|
|
25050
25059
|
e.preventDefault();
|
|
25051
|
-
} }, h("ls-icon", { name: "x", size: "20" }))), h("ls-field-properties", { id: "my-field-panel" }), h("slot", null))))) : (h(h.Fragment, null)), h("div", { key: '
|
|
25060
|
+
} }, h("ls-icon", { name: "x", size: "20" }))), h("ls-field-properties", { id: "my-field-panel" }), h("slot", null))))) : (h(h.Fragment, null)), h("div", { key: '396f65ae8dfd571d289bfc42816c040828e8fb88', id: "ls-mid-area" }, h("ls-toolbar", { key: '1a621e6b7c8dad1f0a4178f94ba9d069fb129a1d', id: "ls-toolbar", dataItem: this.selected ? this.selected.map(s => s.dataItem) : null, template: this._template }), h("div", { key: 'eae5daf190f5e3bdd39823a97cec71cfb2a0fea9', class: 'document-frame-wrapper' }, h("div", { key: 'c97bb669bffc774f5b3eb9a3a30d73929c08e3a5', class: 'spacer' }), h("div", { key: 'd0c6f96d9a08ae6c0c792e2dc0ef36ef3a631b77', id: "ls-document-frame" }, h("canvas", { key: 'efcdc3c09c8336e3be0e51afa560b3755519e308', id: "pdf-canvas", class: this.displayTable ? 'hidden' : '' }), h("ls-editor-table", { key: '298a8c1c28d7965e3a622006d2dd8de7005ba7b7', editor: this, class: this.displayTable ? '' : 'hidden' }), h("div", { key: '844cda3669af25400cc2b41094c3344c5cd60264', id: "ls-box-selector" }))), h("ls-statusbar", { key: 'a170950405cde15290542c96fcdfc0609f81a552', editor: this }))))));
|
|
25052
25061
|
}
|
|
25053
25062
|
static get watchers() { return {
|
|
25054
25063
|
"mode": ["modeHandler"],
|
|
@@ -25057,7 +25066,7 @@ const LsDocumentViewer = class {
|
|
|
25057
25066
|
};
|
|
25058
25067
|
LsDocumentViewer.style = lsDocumentViewerCss;
|
|
25059
25068
|
|
|
25060
|
-
const lsEditorFieldCss = ":host{
|
|
25069
|
+
const lsEditorFieldCss = ":host{display:block;position:absolute;margin:0px;padding:0px 0px 0px 0px;isolation:isolate}.ls-editor-field-editable{display:block;font-family:inherit;font-size:inherit;overflow:hidden;white-space:nowrap;margin:0;padding:0px 0px 0px 0px;min-width:2em;height:100%;width:100%}.ls-editor-field{opacity:0.7}.ls-editor-field-editable:focus{outline:none}.ls-editor-field-draggable{display:block;font-family:inherit;font-size:inherit;overflow:hidden;white-space:nowrap;min-width:2px;height:98%;width:98%}.hidden-field{display:none}input{all:unset}.draggable-input{font-family:inherit;font-size:inherit;position:relative;height:95%;width:95%}.editing-input{caret-color:rgb(15 23 42);caret-shape:auto;height:100%;width:100%}";
|
|
25061
25070
|
|
|
25062
25071
|
const LsEditorField = class {
|
|
25063
25072
|
constructor(hostRef) {
|
|
@@ -25067,7 +25076,6 @@ const LsEditorField = class {
|
|
|
25067
25076
|
dataItem;
|
|
25068
25077
|
selected;
|
|
25069
25078
|
readonly;
|
|
25070
|
-
palette;
|
|
25071
25079
|
type;
|
|
25072
25080
|
page;
|
|
25073
25081
|
isEditing = false;
|
|
@@ -25158,7 +25166,7 @@ const LsEditorField = class {
|
|
|
25158
25166
|
this.sizeObserver.observe(this.component);
|
|
25159
25167
|
// New dropped components automatically need selecting.
|
|
25160
25168
|
if (this.selected) {
|
|
25161
|
-
this.component.style.background =
|
|
25169
|
+
this.component.style.background = this.participantColor(this.dataItem?.signer).s20;
|
|
25162
25170
|
this.component.style.opacity = '0.7';
|
|
25163
25171
|
this.component.style.boxShadow = '0 4px 6px -1px rgba(0, 0, 0, 0.10), 0 2px 4px -1px rgba(0, 0, 0, 0.06)';
|
|
25164
25172
|
}
|
|
@@ -25168,13 +25176,13 @@ const LsEditorField = class {
|
|
|
25168
25176
|
}
|
|
25169
25177
|
}
|
|
25170
25178
|
participantColor = (index) => {
|
|
25171
|
-
return
|
|
25179
|
+
return defaultRolePalette[index % 100] || defaultRolePalette[0];
|
|
25172
25180
|
};
|
|
25173
25181
|
render() {
|
|
25174
|
-
return (h(Host, { key: '
|
|
25182
|
+
return (h(Host, { key: '3c8441e53f90eed0e0b778924f9191342f504a65', style: { border: `1px ${this.participantColor(this.dataItem?.signer).s60} solid` } }, h("div", { key: 'b81189da32a8a824d19a90b452117a3e820798e5', class: {
|
|
25175
25183
|
'ls-editor-field': true,
|
|
25176
25184
|
'is-selected': this.selected,
|
|
25177
|
-
} }, h("input", { key: '
|
|
25185
|
+
} }, h("input", { key: 'e339642324a7180e435f4d04eaff8823288ab4bb', id: "editing-input", class: this.isEditing ? 'ls-editor-field-editable' : 'hidden-field', type: getInputType(this.dataItem.validation).inputType, value: this.dataItem?.value || this.innerValue, onChange: e => this.onInputChange(e) }), h("div", { key: 'af5b7435dab53aaf8b4ad0000b0e01116c97ef52', id: "field-info", class: this.isEditing ? 'hidden-field' : 'ls-editor-field-draggable' }, this.innerValue || this.dataItem?.label || this.dataItem?.formElementType))));
|
|
25178
25186
|
}
|
|
25179
25187
|
static get watchers() { return {
|
|
25180
25188
|
"selected": ["watchSelectedHandler"]
|
|
@@ -33277,37 +33285,37 @@ const LsParticipantSelect = class {
|
|
|
33277
33285
|
console.log('Selected role:', this.selectedRole);
|
|
33278
33286
|
}
|
|
33279
33287
|
participantColor = (index) => {
|
|
33280
|
-
return
|
|
33288
|
+
return defaultRolePalette[index % 100] || defaultRolePalette[0];
|
|
33281
33289
|
};
|
|
33282
33290
|
render() {
|
|
33283
33291
|
console.log(this.selectedRole);
|
|
33284
|
-
return (h(Host, { key: '
|
|
33285
|
-
background:
|
|
33286
|
-
color:
|
|
33287
|
-
} }, h("ls-icon", { key: '
|
|
33288
|
-
(this.selectedRole.signerIndex > 100 ? `Participant ${this.selectedRole.signerIndex - 100} Witness` : `Participant ${this.selectedRole.signerIndex}`)), h("button", { key: '
|
|
33289
|
-
'--background-selected':
|
|
33290
|
-
'--check-icon-selected':
|
|
33291
|
-
}, onClick: () => this.selectRole({ signerIndex: 0, name: 'Sender', roleType: 'SENDER' }), onMouseEnter: e => e.currentTarget.querySelector('.check-icon')?.setAttribute('name', 'check-circle'), onMouseLeave: e => e.currentTarget.querySelector('.check-icon')?.setAttribute('name', this.selectedRole?.signerIndex !== 0 ? 'base-circle' : 'check-circle') }, h("div", { key: '
|
|
33292
|
-
background:
|
|
33293
|
-
color:
|
|
33294
|
-
} }, h("ls-icon", { key: '
|
|
33295
|
-
'--role-name-selected':
|
|
33296
|
-
} }, 'Sender'), h("p", { key: '
|
|
33297
|
-
'--role-type-selected':
|
|
33298
|
-
} }, "You")), h("ls-icon", { key: '
|
|
33299
|
-
'--background-selected':
|
|
33300
|
-
'--check-icon-selected':
|
|
33292
|
+
return (h(Host, { key: '376dc00f9ed35a608669050a14c3a6ec77222ae1' }, h("div", { key: 'bffe48d89c04e6d38de5a34d721fc62875233b8c', class: "dropdown" }, h("div", { key: '291784e958e45a72305fbdbbd220a3237e829e3b', class: "dropdown-header", onClick: this.toggleDropdown }, h("svg", { key: 'c4ae298b8fc164af5b3823952165885ece44a628', width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, h("path", { key: 'f18b791336b7901257dae3215ed0ef4128928e1d', d: "M4 0.5H6.5C8.433 0.5 10 2.067 10 4V6.5C10 8.433 8.433 10 6.5 10H4C2.067 10 0.5 8.433 0.5 6.5V4C0.5 2.067 2.067 0.5 4 0.5Z", fill: "#78A3FA", stroke: "#F7F8FA" }), h("path", { key: '6334dacce4604c2b2a8208232e5e3e2dfbeda08d', d: "M13.5 0.5H16C17.933 0.5 19.5 2.067 19.5 4V6.5C19.5 8.433 17.933 10 16 10H13.5C11.567 10 10 8.433 10 6.5V4C10 2.067 11.567 0.5 13.5 0.5Z", fill: "#46DBAA", stroke: "#F7F8FA" }), h("path", { key: 'a00c1daded99250cea5638c25fde7449cea1fb3f', d: "M4 10H6.5C8.433 10 10 11.567 10 13.5V16C10 17.933 8.433 19.5 6.5 19.5H4C2.067 19.5 0.5 17.933 0.5 16V13.5C0.5 11.567 2.067 10 4 10Z", fill: "#FAD232", stroke: "#F7F8FA" }), h("path", { key: '72c04a47d2856141e4d3083864f00c1ce2bc62ce', d: "M14.75 12.125V14.75M14.75 14.75V17.375M14.75 14.75H17.375M14.75 14.75L12.125 14.75", stroke: "#939599", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" })), h("p", { key: 'f44c6d982de08655cdd15a03145b3a711d045df6', class: 'placing-fields-text' }, "Placing Fields for"), h("div", { key: 'd83960f9c8999046c6e3e1137865e1036c651e85', class: 'selected-role-label', style: {
|
|
33293
|
+
background: this.participantColor(this.selectedRole?.signerIndex).s20,
|
|
33294
|
+
color: this.participantColor(this.selectedRole?.signerIndex).s80,
|
|
33295
|
+
} }, h("ls-icon", { key: '733e9f601506e58fecd83f1a5062561ef68efb01', size: "18", name: this.selectedRole?.roleType === 'SENDER' ? 'user' : this.selectedRole?.roleType === 'APPROVER' ? 'check-circle' : this.selectedRole?.roleType === 'WITNESS' ? 'eye' : 'signature' }), this.selectedRole.name ||
|
|
33296
|
+
(this.selectedRole.signerIndex > 100 ? `Participant ${this.selectedRole.signerIndex - 100} Witness` : `Participant ${this.selectedRole.signerIndex}`)), h("button", { key: 'c5f307779432fdde633d661b19d213a8e0fbfdc3', class: 'tertiaryGrey expand-button', "aria-haspopup": "listbox", "aria-expanded": this.isOpen }, h("ls-icon", { key: '5da68fd1dade4668364d2e328a6a404a772092eb', name: "chevron-down" }))), this.isOpen && (h("div", { key: '6545db8c8c0094cd863037f2e7c94c87e8a34f5b', class: "dropdown-list" }, h("div", { key: '4b4b466b9d9f553afb2dcbe4d1e1c623be4c3aa3', class: this.selectedRole?.signerIndex === 0 ? 'dropdown-item selected' : 'dropdown-item', style: {
|
|
33297
|
+
'--background-selected': defaultRolePalette[0].s10,
|
|
33298
|
+
'--check-icon-selected': defaultRolePalette[0].s50,
|
|
33299
|
+
}, onClick: () => this.selectRole({ signerIndex: 0, name: 'Sender', roleType: 'SENDER' }), onMouseEnter: e => e.currentTarget.querySelector('.check-icon')?.setAttribute('name', 'check-circle'), onMouseLeave: e => e.currentTarget.querySelector('.check-icon')?.setAttribute('name', this.selectedRole?.signerIndex !== 0 ? 'base-circle' : 'check-circle') }, h("div", { key: '9f4035308fc39587e417cf0a1e088a4175c118f9', class: 'role-icon', style: {
|
|
33300
|
+
background: defaultRolePalette[0].s50,
|
|
33301
|
+
color: defaultRolePalette[0].s80,
|
|
33302
|
+
} }, h("ls-icon", { key: '282c618109165a412bf12d6d9eb17216f1136b0d', name: "user" })), h("div", { key: '1e45e9c7405abc4e230a28eb793d984a9a71434b', class: 'role-text' }, h("p", { key: '0971c5ec3fac86c604a27a9b258d1edc75116308', class: 'role-name', style: {
|
|
33303
|
+
'--role-name-selected': defaultRolePalette[0].s80,
|
|
33304
|
+
} }, 'Sender'), h("p", { key: '94047f15d4dd4046343924e7c553eb947c07e363', class: 'role-type', style: {
|
|
33305
|
+
'--role-type-selected': defaultRolePalette[0].s80,
|
|
33306
|
+
} }, "You")), h("ls-icon", { key: 'ec8d3927cd65ac9a2ed789c67f43c2556645cc7f', class: 'check-icon', name: this.selectedRole?.signerIndex === 0 ? 'check-circle' : 'base-circle', solid: this.selectedRole?.signerIndex === 0 })), this.roles.map(r => (h("div", { class: r.signerIndex === this.selectedRole?.signerIndex ? 'dropdown-item selected' : 'dropdown-item', style: {
|
|
33307
|
+
'--background-selected': this.participantColor(r?.signerIndex).s10,
|
|
33308
|
+
'--check-icon-selected': this.participantColor(r?.signerIndex).s50,
|
|
33301
33309
|
}, onClick: () => this.selectRole(r), onMouseEnter: e => e.currentTarget.querySelector('.check-icon')?.setAttribute('name', 'check-circle'), onMouseLeave: e => e.currentTarget
|
|
33302
33310
|
.querySelector('.check-icon')
|
|
33303
33311
|
?.setAttribute('name', r.signerIndex !== this.selectedRole?.signerIndex ? 'base-circle' : 'check-circle') }, h("div", { class: 'role-icon', style: {
|
|
33304
|
-
background: r.signerIndex > 100 ?
|
|
33312
|
+
background: r.signerIndex > 100 ? this.participantColor(r?.signerIndex).s20 : this.participantColor(r?.signerIndex).s50,
|
|
33305
33313
|
color: `var(--${this.participantColor(r?.signerIndex)}-90)`,
|
|
33306
33314
|
} }, h("ls-icon", { name: r.roleType === 'WITNESS' ? 'eye' : r.roleType === 'APPROVER' ? 'check-circle' : 'signature' })), h("div", { class: 'role-text' }, h("p", { class: 'role-name', style: {
|
|
33307
33315
|
'--role-name-selected': `var(--${this.participantColor(r?.signerIndex)}-100)`,
|
|
33308
33316
|
} }, r.name || r.signerIndex > 100 ? `Participant ${r.signerIndex - 100} Witness` : `Participant ${r.signerIndex}`), h("p", { class: 'role-type', style: {
|
|
33309
33317
|
'--role-type-selected': `var(--${this.participantColor(r?.signerIndex)}-80)`,
|
|
33310
|
-
} }, r.roleType === 'WITNESS' ? 'Witness' : r.roleType === 'APPROVER' ? 'Approver' : 'Signer')), h("ls-icon", { class: 'check-icon', name: r.signerIndex === this.selectedRole?.signerIndex ? 'check-circle' : 'base-circle', solid: r.signerIndex === this.selectedRole?.signerIndex }))))))), h("slot", { key: '
|
|
33318
|
+
} }, r.roleType === 'WITNESS' ? 'Witness' : r.roleType === 'APPROVER' ? 'Approver' : 'Signer')), h("ls-icon", { class: 'check-icon', name: r.signerIndex === this.selectedRole?.signerIndex ? 'check-circle' : 'base-circle', solid: r.signerIndex === this.selectedRole?.signerIndex }))))))), h("slot", { key: 'b2f3b76d52dab109697f7edb8d81085c7237128f' })));
|
|
33311
33319
|
}
|
|
33312
33320
|
};
|
|
33313
33321
|
LsParticipantSelect.style = lsParticipantSelectCss;
|