@verdocs/web-sdk 4.0.6 → 4.0.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/verdocs-button-panel.cjs.entry.js +2 -2
- package/dist/cjs/verdocs-button_3.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-checkbox_5.cjs.entry.js +16 -7
- package/dist/cjs/verdocs-dropdown.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-file-chooser_2.cjs.entry.js +1 -1
- package/dist/collection/components/controls/verdocs-button/verdocs-button.js +1 -20
- package/dist/collection/components/controls/verdocs-button-panel/verdocs-button-panel.js +2 -12
- package/dist/collection/components/controls/verdocs-dropdown/verdocs-dropdown.js +1 -17
- package/dist/collection/components/controls/verdocs-file-chooser/verdocs-file-chooser.js +1 -5
- package/dist/collection/components/templates/verdocs-template-field-properties/verdocs-template-field-properties.js +16 -3
- package/dist/components/verdocs-button-panel.js +2 -2
- package/dist/components/verdocs-button2.js +1 -1
- package/dist/components/verdocs-dropdown2.js +1 -1
- package/dist/components/verdocs-file-chooser2.js +1 -1
- package/dist/components/verdocs-template-field-properties2.js +16 -3
- package/dist/docs.json +5 -5
- package/dist/esm/verdocs-button-panel.entry.js +2 -2
- package/dist/esm/verdocs-button_3.entry.js +1 -1
- package/dist/esm/verdocs-checkbox_5.entry.js +16 -3
- package/dist/esm/verdocs-dropdown.entry.js +1 -1
- package/dist/esm/verdocs-file-chooser_2.entry.js +1 -1
- package/dist/esm-es5/verdocs-button-panel.entry.js +1 -1
- package/dist/esm-es5/verdocs-button_3.entry.js +1 -1
- package/dist/esm-es5/verdocs-checkbox_5.entry.js +1 -1
- package/dist/esm-es5/verdocs-dropdown.entry.js +1 -1
- package/dist/esm-es5/verdocs-file-chooser_2.entry.js +1 -1
- package/dist/types/components/controls/verdocs-button/verdocs-button.d.ts +0 -19
- package/dist/types/components/controls/verdocs-button-panel/verdocs-button-panel.d.ts +0 -10
- package/dist/types/components/controls/verdocs-dropdown/verdocs-dropdown.d.ts +0 -16
- package/dist/types/components/controls/verdocs-file-chooser/verdocs-file-chooser.d.ts +0 -4
- package/dist/types/components.d.ts +0 -172
- package/dist/verdocs-web-sdk/p-322fa613.system.js +1 -1
- package/dist/verdocs-web-sdk/{p-0bd91b17.entry.js → p-3ae988e6.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-943c7b8f.system.entry.js → p-3d9d0c2e.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-5bc622c5.entry.js +1 -0
- package/dist/verdocs-web-sdk/{p-208ba4e2.system.entry.js → p-7db995b0.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-7c1030dc.system.entry.js → p-8a0fd8b4.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-9746816b.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/{p-6890fe65.system.entry.js → p-9a780e51.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-1a5cdf1a.entry.js → p-9f7a6ff6.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-7adbe456.entry.js → p-b952113a.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-48d9efa4.entry.js → p-e504ebcd.entry.js} +1 -1
- package/dist/verdocs-web-sdk/verdocs-web-sdk.esm.js +1 -1
- package/package.json +1 -3
- package/dist/collection/components/controls/verdocs-button/test/verdocs-button.e2e.js +0 -8
- package/dist/collection/components/controls/verdocs-button/test/verdocs-button.spec.js +0 -36
- package/dist/collection/components/controls/verdocs-organization-card/test/org-popup.e2e.js +0 -34
- package/dist/collection/components/controls/verdocs-organization-card/test/org-popup.spec.js +0 -64
- package/dist/collection/components/controls/verdocs-text-input/test/verdocs-text-input.js +0 -8
- package/dist/collection/components/controls/verdocs-text-input/test/verdocs-text-input.spec.js +0 -36
- package/dist/types/components/controls/verdocs-text-input/test/verdocs-text-input.d.ts +0 -1
- package/dist/verdocs-web-sdk/p-383de7ca.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-c0d1020a.system.entry.js +0 -1
@@ -70,10 +70,10 @@ const VerdocsButtonPanel = class {
|
|
70
70
|
}
|
71
71
|
}
|
72
72
|
render() {
|
73
|
-
return (index.h(index.Host, { key: '
|
73
|
+
return (index.h(index.Host, { key: '875a734696925dd22625880b694e32c4845e1254' }, index.h("div", { key: 'cc83aef76b34b3e9031160451f9643168d41cf3b', class: "icon", innerHTML: this.icon, onClick: (e) => {
|
74
74
|
e.stopPropagation();
|
75
75
|
return this.toggle();
|
76
|
-
}, ref: el => (this.iconEl = el) }), index.h("div", { key: '
|
76
|
+
}, ref: el => (this.iconEl = el) }), index.h("div", { key: '136375bb517b9d86327c6fa63b115f3f496df7a4', role: "tooltip", class: "verdocs-button-panel-content", "data-popper-placement": "bottom", ref: el => (this.panelEl = el) }, index.h("div", { key: '065c60cf39be8a608fbc5e2199b09cb55d8a551b', "data-popper-arrow": "true", class: "arrow" }), index.h("slot", { key: '85af4ff2a549a5d062fff08bf17d1c6c24c439e5' }))));
|
77
77
|
}
|
78
78
|
};
|
79
79
|
VerdocsButtonPanel.style = VerdocsButtonPanelStyle0;
|
@@ -21,7 +21,7 @@ const VerdocsButton = class {
|
|
21
21
|
this.disabled = false;
|
22
22
|
}
|
23
23
|
render() {
|
24
|
-
return (index.h("button", { key: '
|
24
|
+
return (index.h("button", { key: '813ea229dd512708d1b1c0fe87cf7462cb2276b7', disabled: this.disabled, type: this.type, class: `${this.variant} ${this.size} ${this.type}` }, this.startIcon ? index.h("span", { class: "icon start", innerHTML: this.startIcon }) : null, index.h("span", { key: 'd1ca3189f5513bbe13eeda50aa0dc27a03f67480', class: "button-label" }, this.label), this.endIcon ? index.h("span", { class: "icon end", innerHTML: this.endIcon }) : null));
|
25
25
|
}
|
26
26
|
};
|
27
27
|
VerdocsButton.style = VerdocsButtonStyle0;
|
@@ -3,7 +3,6 @@
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
4
4
|
|
5
5
|
const index = require('./index-cfdfab36.js');
|
6
|
-
const uuidv4 = require('uuid-browser');
|
7
6
|
const jsSdk = require('@verdocs/js-sdk');
|
8
7
|
const TemplateFieldStore = require('./TemplateFieldStore-6a79aae7.js');
|
9
8
|
const TemplateRoleStore = require('./TemplateRoleStore-06db6e56.js');
|
@@ -12,10 +11,6 @@ const errors = require('./errors-017fb835.js');
|
|
12
11
|
require('./index-3e4c5891.js');
|
13
12
|
require('./index-a5472099.js');
|
14
13
|
|
15
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
16
|
-
|
17
|
-
const uuidv4__default = /*#__PURE__*/_interopDefaultLegacy(uuidv4);
|
18
|
-
|
19
14
|
const 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}";
|
20
15
|
const VerdocsCheckboxStyle0 = verdocsCheckboxCss;
|
21
16
|
|
@@ -144,6 +139,20 @@ const VerdocsTemplateFieldPropertiesStyle0 = verdocsTemplateFieldPropertiesCss;
|
|
144
139
|
const capitalize = (str) => str.charAt(0).toUpperCase() + str.slice(1);
|
145
140
|
const 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>`;
|
146
141
|
const 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>';
|
142
|
+
// Credit: https://stackoverflow.com/a/78196510/1812436
|
143
|
+
// NOTE: This is NOT safe or cryptographically strong, so it's not part of our core SDK's or Utils modules.
|
144
|
+
// It should never be used anywhere a real GUID is required. But we don't need one here, we just need a
|
145
|
+
// "GUID-like" value for one step of a field update operation (adding items to lists). There are no security
|
146
|
+
// implications in how we use IDs for list items. They only need to be GUID-like for historical reasons that
|
147
|
+
// we may change shortly anyway.
|
148
|
+
function generateWeakGuid() {
|
149
|
+
const s4 = () => {
|
150
|
+
return Math.floor((1 + Math.random()) * 0x10000)
|
151
|
+
.toString(16)
|
152
|
+
.substring(1);
|
153
|
+
};
|
154
|
+
return s4() + s4() + '-' + s4() + '-' + s4() + '-' + s4() + '-' + s4() + s4() + s4();
|
155
|
+
}
|
147
156
|
const VerdocsTemplateFieldProperties = class {
|
148
157
|
constructor(hostRef) {
|
149
158
|
index.registerInstance(this, hostRef);
|
@@ -295,14 +304,14 @@ const VerdocsTemplateFieldProperties = class {
|
|
295
304
|
};
|
296
305
|
this.options.push(this.type === 'radio_button_group'
|
297
306
|
? {
|
298
|
-
id:
|
307
|
+
id: generateWeakGuid(),
|
299
308
|
value: `Option ${this.options.length + 1}`,
|
300
309
|
selected: false,
|
301
310
|
x: this.options.length > 0 ? this.options[this.options.length - 1].x : 20,
|
302
311
|
y: this.options.length > 0 ? this.options[this.options.length - 1].y - 25 : 20,
|
303
312
|
}
|
304
313
|
: {
|
305
|
-
id:
|
314
|
+
id: generateWeakGuid(),
|
306
315
|
value: `Option ${this.options.length + 1}`,
|
307
316
|
checked: false,
|
308
317
|
x: this.options.length > 0 ? this.options[this.options.length - 1].x : 20,
|
@@ -91,7 +91,7 @@ const VerdocsDropdown = class {
|
|
91
91
|
(_a = document.getElementById(MENU_ID)) === null || _a === void 0 ? void 0 : _a.remove();
|
92
92
|
}
|
93
93
|
render() {
|
94
|
-
return (index.h(index.Host, { key: '
|
94
|
+
return (index.h(index.Host, { key: '068386cdca529f310e7914d475739ca9a574d02d' }, index.h("button", { key: '557fe893e3123fdff6251992c14a3a803451fd30', class: "arrow", innerHTML: DropdownArrow, "aria-label": "Open Menu", onClick: e => this.toggle(e),
|
95
95
|
// onBlur={() => this.hide()}
|
96
96
|
ref: el => (this.dropdownButton = el) })));
|
97
97
|
}
|
@@ -31,7 +31,7 @@ const VerdocsFileChooser = class {
|
|
31
31
|
}
|
32
32
|
render() {
|
33
33
|
const buttonlabel = this.file ? 'Select a different file' : 'Select a file from your computer';
|
34
|
-
return (index.h(index.Host, { key: '
|
34
|
+
return (index.h(index.Host, { key: '870f83d51356099942aeb7f50680bff38b946e74' }, index.h("input", { key: 'a4177207b2d87dd1d7e26093b93e36858a296f65', type: "file", multiple: true, id: "verdocs-file-chooser", accept: "application/pdf,.pdf,.doc,.docx,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document", style: { display: 'none' }, onChange: e => this.handleFileChanged(e) }), index.h("div", { key: '57e6c23406d1a12bc7b426fe76469c83925692ed', class: "upload-box" }, index.h("div", { key: '6b05c0bc019af781b632b91761e96b48a7e99623', class: "selected-filename" }, this.file ? this.file.name : 'Drag a file here'), index.h("div", { key: 'b1ab95cb7d5a19c2d5c3e3a48c073a954bbed454', class: "or-prefer" }, this.file ? Icons.unicodeNBSP : 'Or, if you prefer...'), index.h("verdocs-button", { key: 'bec299eef4e98464c0cd76180c8b2af875ee6243', label: buttonlabel, size: "small", onClick: e => this.handleSelectFile(e) }))));
|
35
35
|
}
|
36
36
|
};
|
37
37
|
VerdocsFileChooser.style = VerdocsFileChooserStyle0;
|
@@ -1,23 +1,4 @@
|
|
1
1
|
import { h } from "@stencil/core";
|
2
|
-
/**
|
3
|
-
* Display a simple button.
|
4
|
-
*
|
5
|
-
* Three variants are supported. `standard` and `outline` buttons look like traditional form buttons and are ideal candidates for 'Ok' and
|
6
|
-
* 'Cancel' options in most cases. `text` buttons are intended to be used inline in content blocks or for more subtle button options.
|
7
|
-
* (Auth uses text buttons for the Forgot Password and Sign Up options.)
|
8
|
-
*
|
9
|
-
* Four sizes are also supported. Most use cases will call for the `normal` size, but a `small` size is ideal for more subtle controls, such
|
10
|
-
* as pagination or other secondary functions. `medium` buttons are slightly larger to provide balance in forms where other items are also
|
11
|
-
* bigger, and `large` buttons are for cases where the page has mostly white-space and the buttons need to fill more space.
|
12
|
-
*
|
13
|
-
* Icons may be placed either before ("start") or after ("end") the button label. Icons should be SVG objects passed as strings and will
|
14
|
-
* be rendered as HTML inside the button label area. It is important that the root <SVG> tag contains a default `fill="#ffffff"` setting
|
15
|
-
* for the base color, and that child elements below it do not. This allows the button color to carry into the icon properly.
|
16
|
-
*
|
17
|
-
* ```html
|
18
|
-
* <verdocs-button label="OK" onClick={() => (console.log('OK clicked'))} />
|
19
|
-
* ```
|
20
|
-
*/
|
21
2
|
export class VerdocsButton {
|
22
3
|
constructor() {
|
23
4
|
this.label = undefined;
|
@@ -29,7 +10,7 @@ export class VerdocsButton {
|
|
29
10
|
this.disabled = false;
|
30
11
|
}
|
31
12
|
render() {
|
32
|
-
return (h("button", { key: '
|
13
|
+
return (h("button", { key: '813ea229dd512708d1b1c0fe87cf7462cb2276b7', disabled: this.disabled, type: this.type, class: `${this.variant} ${this.size} ${this.type}` }, this.startIcon ? h("span", { class: "icon start", innerHTML: this.startIcon }) : null, h("span", { key: 'd1ca3189f5513bbe13eeda50aa0dc27a03f67480', class: "button-label" }, this.label), this.endIcon ? h("span", { class: "icon end", innerHTML: this.endIcon }) : null));
|
33
14
|
}
|
34
15
|
static get is() { return "verdocs-button"; }
|
35
16
|
static get originalStyleUrls() {
|
@@ -1,15 +1,5 @@
|
|
1
1
|
import { createPopper } from "@popperjs/core";
|
2
2
|
import { h, Host } from "@stencil/core";
|
3
|
-
/**
|
4
|
-
* Displays a clickable icon suitable for display in a toolbar. When clicked, a customizable drop-down panel will be
|
5
|
-
* displayed.
|
6
|
-
*
|
7
|
-
* ```html
|
8
|
-
* <verdocs-button-panel icon="<svg.../>">
|
9
|
-
* <div class="content">...</div>
|
10
|
-
* </verdocs-button-panel>
|
11
|
-
* ```
|
12
|
-
*/
|
13
3
|
export class VerdocsButtonPanel {
|
14
4
|
constructor() {
|
15
5
|
// Not marked as @State because it's not the thing that controls our rendering
|
@@ -71,10 +61,10 @@ export class VerdocsButtonPanel {
|
|
71
61
|
}
|
72
62
|
}
|
73
63
|
render() {
|
74
|
-
return (h(Host, { key: '
|
64
|
+
return (h(Host, { key: '875a734696925dd22625880b694e32c4845e1254' }, h("div", { key: 'cc83aef76b34b3e9031160451f9643168d41cf3b', class: "icon", innerHTML: this.icon, onClick: (e) => {
|
75
65
|
e.stopPropagation();
|
76
66
|
return this.toggle();
|
77
|
-
}, ref: el => (this.iconEl = el) }), h("div", { key: '
|
67
|
+
}, ref: el => (this.iconEl = el) }), h("div", { key: '136375bb517b9d86327c6fa63b115f3f496df7a4', role: "tooltip", class: "verdocs-button-panel-content", "data-popper-placement": "bottom", ref: el => (this.panelEl = el) }, h("div", { key: '065c60cf39be8a608fbc5e2199b09cb55d8a551b', "data-popper-arrow": "true", class: "arrow" }), h("slot", { key: '85af4ff2a549a5d062fff08bf17d1c6c24c439e5' }))));
|
78
68
|
}
|
79
69
|
static get is() { return "verdocs-button-panel"; }
|
80
70
|
static get originalStyleUrls() {
|
@@ -18,22 +18,6 @@ function debounce(func, wait, immediate) {
|
|
18
18
|
func.apply(context, args);
|
19
19
|
};
|
20
20
|
}
|
21
|
-
/**
|
22
|
-
* Display a drop-down menu button. A menu of the specified options will be displayed when the button is pressed. The menu will be hidden
|
23
|
-
* when the button is pressed again, or an option is selected. Separators may be created by supplying an entry with an empty label.
|
24
|
-
*
|
25
|
-
* ```html
|
26
|
-
* <verdocs-dropdown
|
27
|
-
* options={[
|
28
|
-
* {label: 'Option 1', disabled: true},
|
29
|
-
* {label: 'Option 2', id: '2'}
|
30
|
-
* {label: ''}
|
31
|
-
* {label: 'Option 3', id: '2'}
|
32
|
-
* ]}
|
33
|
-
* label="OK" onClick={() => (console.log('OK clicked'))}
|
34
|
-
* />
|
35
|
-
* ```
|
36
|
-
*/
|
37
21
|
export class VerdocsDropdown {
|
38
22
|
constructor() {
|
39
23
|
this.options = [];
|
@@ -98,7 +82,7 @@ export class VerdocsDropdown {
|
|
98
82
|
(_a = document.getElementById(MENU_ID)) === null || _a === void 0 ? void 0 : _a.remove();
|
99
83
|
}
|
100
84
|
render() {
|
101
|
-
return (h(Host, { key: '
|
85
|
+
return (h(Host, { key: '068386cdca529f310e7914d475739ca9a574d02d' }, h("button", { key: '557fe893e3123fdff6251992c14a3a803451fd30', class: "arrow", innerHTML: DropdownArrow, "aria-label": "Open Menu", onClick: e => this.toggle(e),
|
102
86
|
// onBlur={() => this.hide()}
|
103
87
|
ref: el => (this.dropdownButton = el) })));
|
104
88
|
}
|
@@ -1,10 +1,6 @@
|
|
1
1
|
import { VerdocsEndpoint } from "@verdocs/js-sdk";
|
2
2
|
import { h, Host } from "@stencil/core";
|
3
3
|
import { unicodeNBSP } from "../../../utils/Icons";
|
4
|
-
/**
|
5
|
-
* Displays a file picker to upload an attachment. This component is just the picker - the host application or component should
|
6
|
-
* provide the actual upload functionality.
|
7
|
-
*/
|
8
4
|
export class VerdocsFileChooser {
|
9
5
|
constructor() {
|
10
6
|
this.endpoint = VerdocsEndpoint.getDefault();
|
@@ -25,7 +21,7 @@ export class VerdocsFileChooser {
|
|
25
21
|
}
|
26
22
|
render() {
|
27
23
|
const buttonlabel = this.file ? 'Select a different file' : 'Select a file from your computer';
|
28
|
-
return (h(Host, { key: '
|
24
|
+
return (h(Host, { key: '870f83d51356099942aeb7f50680bff38b946e74' }, h("input", { key: 'a4177207b2d87dd1d7e26093b93e36858a296f65', type: "file", multiple: true, id: "verdocs-file-chooser", accept: "application/pdf,.pdf,.doc,.docx,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document", style: { display: 'none' }, onChange: e => this.handleFileChanged(e) }), h("div", { key: '57e6c23406d1a12bc7b426fe76469c83925692ed', class: "upload-box" }, h("div", { key: '6b05c0bc019af781b632b91761e96b48a7e99623', class: "selected-filename" }, this.file ? this.file.name : 'Drag a file here'), h("div", { key: 'b1ab95cb7d5a19c2d5c3e3a48c073a954bbed454', class: "or-prefer" }, this.file ? unicodeNBSP : 'Or, if you prefer...'), h("verdocs-button", { key: 'bec299eef4e98464c0cd76180c8b2af875ee6243', label: buttonlabel, size: "small", onClick: e => this.handleSelectFile(e) }))));
|
29
25
|
}
|
30
26
|
static get is() { return "verdocs-file-chooser"; }
|
31
27
|
static get originalStyleUrls() {
|
@@ -1,4 +1,3 @@
|
|
1
|
-
import uuidv4 from "uuid-browser";
|
2
1
|
import { deleteField, updateField, VerdocsEndpoint } from "@verdocs/js-sdk";
|
3
2
|
import { h, Host } from "@stencil/core";
|
4
3
|
import { getTemplateFieldStore, updateStoreField } from "../../../utils/TemplateFieldStore";
|
@@ -8,6 +7,20 @@ import { SDKError } from "../../../utils/errors";
|
|
8
7
|
const capitalize = (str) => str.charAt(0).toUpperCase() + str.slice(1);
|
9
8
|
const 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>`;
|
10
9
|
const 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>';
|
10
|
+
// Credit: https://stackoverflow.com/a/78196510/1812436
|
11
|
+
// NOTE: This is NOT safe or cryptographically strong, so it's not part of our core SDK's or Utils modules.
|
12
|
+
// It should never be used anywhere a real GUID is required. But we don't need one here, we just need a
|
13
|
+
// "GUID-like" value for one step of a field update operation (adding items to lists). There are no security
|
14
|
+
// implications in how we use IDs for list items. They only need to be GUID-like for historical reasons that
|
15
|
+
// we may change shortly anyway.
|
16
|
+
function generateWeakGuid() {
|
17
|
+
const s4 = () => {
|
18
|
+
return Math.floor((1 + Math.random()) * 0x10000)
|
19
|
+
.toString(16)
|
20
|
+
.substring(1);
|
21
|
+
};
|
22
|
+
return s4() + s4() + '-' + s4() + '-' + s4() + '-' + s4() + '-' + s4() + s4() + s4();
|
23
|
+
}
|
11
24
|
/**
|
12
25
|
* Displays an edit form that allows the user to adjust a field's settings.
|
13
26
|
*/
|
@@ -157,14 +170,14 @@ export class VerdocsTemplateFieldProperties {
|
|
157
170
|
};
|
158
171
|
this.options.push(this.type === 'radio_button_group'
|
159
172
|
? {
|
160
|
-
id:
|
173
|
+
id: generateWeakGuid(),
|
161
174
|
value: `Option ${this.options.length + 1}`,
|
162
175
|
selected: false,
|
163
176
|
x: this.options.length > 0 ? this.options[this.options.length - 1].x : 20,
|
164
177
|
y: this.options.length > 0 ? this.options[this.options.length - 1].y - 25 : 20,
|
165
178
|
}
|
166
179
|
: {
|
167
|
-
id:
|
180
|
+
id: generateWeakGuid(),
|
168
181
|
value: `Option ${this.options.length + 1}`,
|
169
182
|
checked: false,
|
170
183
|
x: this.options.length > 0 ? this.options[this.options.length - 1].x : 20,
|
@@ -67,10 +67,10 @@ const VerdocsButtonPanel$1 = /*@__PURE__*/ proxyCustomElement(class VerdocsButto
|
|
67
67
|
}
|
68
68
|
}
|
69
69
|
render() {
|
70
|
-
return (h(Host, { key: '
|
70
|
+
return (h(Host, { key: '875a734696925dd22625880b694e32c4845e1254' }, h("div", { key: 'cc83aef76b34b3e9031160451f9643168d41cf3b', class: "icon", innerHTML: this.icon, onClick: (e) => {
|
71
71
|
e.stopPropagation();
|
72
72
|
return this.toggle();
|
73
|
-
}, ref: el => (this.iconEl = el) }), h("div", { key: '
|
73
|
+
}, ref: el => (this.iconEl = el) }), h("div", { key: '136375bb517b9d86327c6fa63b115f3f496df7a4', role: "tooltip", class: "verdocs-button-panel-content", "data-popper-placement": "bottom", ref: el => (this.panelEl = el) }, h("div", { key: '065c60cf39be8a608fbc5e2199b09cb55d8a551b', "data-popper-arrow": "true", class: "arrow" }), h("slot", { key: '85af4ff2a549a5d062fff08bf17d1c6c24c439e5' }))));
|
74
74
|
}
|
75
75
|
static get style() { return VerdocsButtonPanelStyle0; }
|
76
76
|
}, [4, "verdocs-button-panel", {
|
@@ -16,7 +16,7 @@ const VerdocsButton = /*@__PURE__*/ proxyCustomElement(class VerdocsButton exten
|
|
16
16
|
this.disabled = false;
|
17
17
|
}
|
18
18
|
render() {
|
19
|
-
return (h("button", { key: '
|
19
|
+
return (h("button", { key: '813ea229dd512708d1b1c0fe87cf7462cb2276b7', disabled: this.disabled, type: this.type, class: `${this.variant} ${this.size} ${this.type}` }, this.startIcon ? h("span", { class: "icon start", innerHTML: this.startIcon }) : null, h("span", { key: 'd1ca3189f5513bbe13eeda50aa0dc27a03f67480', class: "button-label" }, this.label), this.endIcon ? h("span", { class: "icon end", innerHTML: this.endIcon }) : null));
|
20
20
|
}
|
21
21
|
static get style() { return VerdocsButtonStyle0; }
|
22
22
|
}, [0, "verdocs-button", {
|
@@ -88,7 +88,7 @@ const VerdocsDropdown = /*@__PURE__*/ proxyCustomElement(class VerdocsDropdown e
|
|
88
88
|
(_a = document.getElementById(MENU_ID)) === null || _a === void 0 ? void 0 : _a.remove();
|
89
89
|
}
|
90
90
|
render() {
|
91
|
-
return (h(Host, { key: '
|
91
|
+
return (h(Host, { key: '068386cdca529f310e7914d475739ca9a574d02d' }, h("button", { key: '557fe893e3123fdff6251992c14a3a803451fd30', class: "arrow", innerHTML: DropdownArrow, "aria-label": "Open Menu", onClick: e => this.toggle(e),
|
92
92
|
// onBlur={() => this.hide()}
|
93
93
|
ref: el => (this.dropdownButton = el) })));
|
94
94
|
}
|
@@ -29,7 +29,7 @@ const VerdocsFileChooser = /*@__PURE__*/ proxyCustomElement(class VerdocsFileCho
|
|
29
29
|
}
|
30
30
|
render() {
|
31
31
|
const buttonlabel = this.file ? 'Select a different file' : 'Select a file from your computer';
|
32
|
-
return (h(Host, { key: '
|
32
|
+
return (h(Host, { key: '870f83d51356099942aeb7f50680bff38b946e74' }, h("input", { key: 'a4177207b2d87dd1d7e26093b93e36858a296f65', type: "file", multiple: true, id: "verdocs-file-chooser", accept: "application/pdf,.pdf,.doc,.docx,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document", style: { display: 'none' }, onChange: e => this.handleFileChanged(e) }), h("div", { key: '57e6c23406d1a12bc7b426fe76469c83925692ed', class: "upload-box" }, h("div", { key: '6b05c0bc019af781b632b91761e96b48a7e99623', class: "selected-filename" }, this.file ? this.file.name : 'Drag a file here'), h("div", { key: 'b1ab95cb7d5a19c2d5c3e3a48c073a954bbed454', class: "or-prefer" }, this.file ? unicodeNBSP : 'Or, if you prefer...'), h("verdocs-button", { key: 'bec299eef4e98464c0cd76180c8b2af875ee6243', label: buttonlabel, size: "small", onClick: e => this.handleSelectFile(e) }))));
|
33
33
|
}
|
34
34
|
static get style() { return VerdocsFileChooserStyle0; }
|
35
35
|
}, [0, "verdocs-file-chooser", {
|
@@ -1,5 +1,4 @@
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
2
|
-
import uuidv4 from 'uuid-browser';
|
3
2
|
import { VerdocsEndpoint, updateField, deleteField } from '@verdocs/js-sdk';
|
4
3
|
import { g as getTemplateFieldStore, u as updateStoreField } from './TemplateFieldStore.js';
|
5
4
|
import { g as getTemplateRoleStore } from './TemplateRoleStore.js';
|
@@ -18,6 +17,20 @@ const VerdocsTemplateFieldPropertiesStyle0 = verdocsTemplateFieldPropertiesCss;
|
|
18
17
|
const capitalize = (str) => str.charAt(0).toUpperCase() + str.slice(1);
|
19
18
|
const 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>`;
|
20
19
|
const 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>';
|
20
|
+
// Credit: https://stackoverflow.com/a/78196510/1812436
|
21
|
+
// NOTE: This is NOT safe or cryptographically strong, so it's not part of our core SDK's or Utils modules.
|
22
|
+
// It should never be used anywhere a real GUID is required. But we don't need one here, we just need a
|
23
|
+
// "GUID-like" value for one step of a field update operation (adding items to lists). There are no security
|
24
|
+
// implications in how we use IDs for list items. They only need to be GUID-like for historical reasons that
|
25
|
+
// we may change shortly anyway.
|
26
|
+
function generateWeakGuid() {
|
27
|
+
const s4 = () => {
|
28
|
+
return Math.floor((1 + Math.random()) * 0x10000)
|
29
|
+
.toString(16)
|
30
|
+
.substring(1);
|
31
|
+
};
|
32
|
+
return s4() + s4() + '-' + s4() + '-' + s4() + '-' + s4() + '-' + s4() + s4() + s4();
|
33
|
+
}
|
21
34
|
const VerdocsTemplateFieldProperties = /*@__PURE__*/ proxyCustomElement(class VerdocsTemplateFieldProperties extends HTMLElement {
|
22
35
|
constructor() {
|
23
36
|
super();
|
@@ -170,14 +183,14 @@ const VerdocsTemplateFieldProperties = /*@__PURE__*/ proxyCustomElement(class Ve
|
|
170
183
|
};
|
171
184
|
this.options.push(this.type === 'radio_button_group'
|
172
185
|
? {
|
173
|
-
id:
|
186
|
+
id: generateWeakGuid(),
|
174
187
|
value: `Option ${this.options.length + 1}`,
|
175
188
|
selected: false,
|
176
189
|
x: this.options.length > 0 ? this.options[this.options.length - 1].x : 20,
|
177
190
|
y: this.options.length > 0 ? this.options[this.options.length - 1].y - 25 : 20,
|
178
191
|
}
|
179
192
|
: {
|
180
|
-
id:
|
193
|
+
id: generateWeakGuid(),
|
181
194
|
value: `Option ${this.options.length + 1}`,
|
182
195
|
checked: false,
|
183
196
|
x: this.options.length > 0 ? this.options[this.options.length - 1].x : 20,
|
package/dist/docs.json
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
{
|
2
|
-
"timestamp": "2024-06-
|
2
|
+
"timestamp": "2024-06-19T00:05:44",
|
3
3
|
"compiler": {
|
4
4
|
"name": "@stencil/core",
|
5
5
|
"version": "4.18.3",
|
@@ -781,7 +781,7 @@
|
|
781
781
|
"filePath": "src/components/controls/verdocs-button/verdocs-button.tsx",
|
782
782
|
"encapsulation": "none",
|
783
783
|
"tag": "verdocs-button",
|
784
|
-
"docs": "
|
784
|
+
"docs": "",
|
785
785
|
"docsTags": [],
|
786
786
|
"usage": {},
|
787
787
|
"props": [
|
@@ -1098,7 +1098,7 @@
|
|
1098
1098
|
"filePath": "src/components/controls/verdocs-button-panel/verdocs-button-panel.tsx",
|
1099
1099
|
"encapsulation": "none",
|
1100
1100
|
"tag": "verdocs-button-panel",
|
1101
|
-
"docs": "
|
1101
|
+
"docs": "",
|
1102
1102
|
"docsTags": [],
|
1103
1103
|
"usage": {},
|
1104
1104
|
"props": [
|
@@ -1690,7 +1690,7 @@
|
|
1690
1690
|
"filePath": "src/components/controls/verdocs-dropdown/verdocs-dropdown.tsx",
|
1691
1691
|
"encapsulation": "none",
|
1692
1692
|
"tag": "verdocs-dropdown",
|
1693
|
-
"docs": "
|
1693
|
+
"docs": "",
|
1694
1694
|
"docsTags": [],
|
1695
1695
|
"usage": {},
|
1696
1696
|
"props": [
|
@@ -7287,7 +7287,7 @@
|
|
7287
7287
|
"filePath": "src/components/controls/verdocs-file-chooser/verdocs-file-chooser.tsx",
|
7288
7288
|
"encapsulation": "none",
|
7289
7289
|
"tag": "verdocs-file-chooser",
|
7290
|
-
"docs": "
|
7290
|
+
"docs": "",
|
7291
7291
|
"docsTags": [],
|
7292
7292
|
"usage": {},
|
7293
7293
|
"props": [
|
@@ -66,10 +66,10 @@ const VerdocsButtonPanel = class {
|
|
66
66
|
}
|
67
67
|
}
|
68
68
|
render() {
|
69
|
-
return (h(Host, { key: '
|
69
|
+
return (h(Host, { key: '875a734696925dd22625880b694e32c4845e1254' }, h("div", { key: 'cc83aef76b34b3e9031160451f9643168d41cf3b', class: "icon", innerHTML: this.icon, onClick: (e) => {
|
70
70
|
e.stopPropagation();
|
71
71
|
return this.toggle();
|
72
|
-
}, ref: el => (this.iconEl = el) }), h("div", { key: '
|
72
|
+
}, ref: el => (this.iconEl = el) }), h("div", { key: '136375bb517b9d86327c6fa63b115f3f496df7a4', role: "tooltip", class: "verdocs-button-panel-content", "data-popper-placement": "bottom", ref: el => (this.panelEl = el) }, h("div", { key: '065c60cf39be8a608fbc5e2199b09cb55d8a551b', "data-popper-arrow": "true", class: "arrow" }), h("slot", { key: '85af4ff2a549a5d062fff08bf17d1c6c24c439e5' }))));
|
73
73
|
}
|
74
74
|
};
|
75
75
|
VerdocsButtonPanel.style = VerdocsButtonPanelStyle0;
|
@@ -17,7 +17,7 @@ const VerdocsButton = class {
|
|
17
17
|
this.disabled = false;
|
18
18
|
}
|
19
19
|
render() {
|
20
|
-
return (h("button", { key: '
|
20
|
+
return (h("button", { key: '813ea229dd512708d1b1c0fe87cf7462cb2276b7', disabled: this.disabled, type: this.type, class: `${this.variant} ${this.size} ${this.type}` }, this.startIcon ? h("span", { class: "icon start", innerHTML: this.startIcon }) : null, h("span", { key: 'd1ca3189f5513bbe13eeda50aa0dc27a03f67480', class: "button-label" }, this.label), this.endIcon ? h("span", { class: "icon end", innerHTML: this.endIcon }) : null));
|
21
21
|
}
|
22
22
|
};
|
23
23
|
VerdocsButton.style = VerdocsButtonStyle0;
|
@@ -1,5 +1,4 @@
|
|
1
1
|
import { r as registerInstance, h, H as Host, c as createEvent, g as getElement } from './index-b89cf6a4.js';
|
2
|
-
import uuidv4 from 'uuid-browser';
|
3
2
|
import { VerdocsEndpoint, updateField, deleteField } from '@verdocs/js-sdk';
|
4
3
|
import { g as getTemplateFieldStore, u as updateStoreField } from './TemplateFieldStore-d7516adf.js';
|
5
4
|
import { g as getTemplateRoleStore } from './TemplateRoleStore-ddc3b96f.js';
|
@@ -136,6 +135,20 @@ const VerdocsTemplateFieldPropertiesStyle0 = verdocsTemplateFieldPropertiesCss;
|
|
136
135
|
const capitalize = (str) => str.charAt(0).toUpperCase() + str.slice(1);
|
137
136
|
const 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>`;
|
138
137
|
const 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>';
|
138
|
+
// Credit: https://stackoverflow.com/a/78196510/1812436
|
139
|
+
// NOTE: This is NOT safe or cryptographically strong, so it's not part of our core SDK's or Utils modules.
|
140
|
+
// It should never be used anywhere a real GUID is required. But we don't need one here, we just need a
|
141
|
+
// "GUID-like" value for one step of a field update operation (adding items to lists). There are no security
|
142
|
+
// implications in how we use IDs for list items. They only need to be GUID-like for historical reasons that
|
143
|
+
// we may change shortly anyway.
|
144
|
+
function generateWeakGuid() {
|
145
|
+
const s4 = () => {
|
146
|
+
return Math.floor((1 + Math.random()) * 0x10000)
|
147
|
+
.toString(16)
|
148
|
+
.substring(1);
|
149
|
+
};
|
150
|
+
return s4() + s4() + '-' + s4() + '-' + s4() + '-' + s4() + '-' + s4() + s4() + s4();
|
151
|
+
}
|
139
152
|
const VerdocsTemplateFieldProperties = class {
|
140
153
|
constructor(hostRef) {
|
141
154
|
registerInstance(this, hostRef);
|
@@ -287,14 +300,14 @@ const VerdocsTemplateFieldProperties = class {
|
|
287
300
|
};
|
288
301
|
this.options.push(this.type === 'radio_button_group'
|
289
302
|
? {
|
290
|
-
id:
|
303
|
+
id: generateWeakGuid(),
|
291
304
|
value: `Option ${this.options.length + 1}`,
|
292
305
|
selected: false,
|
293
306
|
x: this.options.length > 0 ? this.options[this.options.length - 1].x : 20,
|
294
307
|
y: this.options.length > 0 ? this.options[this.options.length - 1].y - 25 : 20,
|
295
308
|
}
|
296
309
|
: {
|
297
|
-
id:
|
310
|
+
id: generateWeakGuid(),
|
298
311
|
value: `Option ${this.options.length + 1}`,
|
299
312
|
checked: false,
|
300
313
|
x: this.options.length > 0 ? this.options[this.options.length - 1].x : 20,
|
@@ -87,7 +87,7 @@ const VerdocsDropdown = class {
|
|
87
87
|
(_a = document.getElementById(MENU_ID)) === null || _a === void 0 ? void 0 : _a.remove();
|
88
88
|
}
|
89
89
|
render() {
|
90
|
-
return (h(Host, { key: '
|
90
|
+
return (h(Host, { key: '068386cdca529f310e7914d475739ca9a574d02d' }, h("button", { key: '557fe893e3123fdff6251992c14a3a803451fd30', class: "arrow", innerHTML: DropdownArrow, "aria-label": "Open Menu", onClick: e => this.toggle(e),
|
91
91
|
// onBlur={() => this.hide()}
|
92
92
|
ref: el => (this.dropdownButton = el) })));
|
93
93
|
}
|
@@ -27,7 +27,7 @@ const VerdocsFileChooser = class {
|
|
27
27
|
}
|
28
28
|
render() {
|
29
29
|
const buttonlabel = this.file ? 'Select a different file' : 'Select a file from your computer';
|
30
|
-
return (h(Host, { key: '
|
30
|
+
return (h(Host, { key: '870f83d51356099942aeb7f50680bff38b946e74' }, h("input", { key: 'a4177207b2d87dd1d7e26093b93e36858a296f65', type: "file", multiple: true, id: "verdocs-file-chooser", accept: "application/pdf,.pdf,.doc,.docx,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document", style: { display: 'none' }, onChange: e => this.handleFileChanged(e) }), h("div", { key: '57e6c23406d1a12bc7b426fe76469c83925692ed', class: "upload-box" }, h("div", { key: '6b05c0bc019af781b632b91761e96b48a7e99623', class: "selected-filename" }, this.file ? this.file.name : 'Drag a file here'), h("div", { key: 'b1ab95cb7d5a19c2d5c3e3a48c073a954bbed454', class: "or-prefer" }, this.file ? unicodeNBSP : 'Or, if you prefer...'), h("verdocs-button", { key: 'bec299eef4e98464c0cd76180c8b2af875ee6243', label: buttonlabel, size: "small", onClick: e => this.handleSelectFile(e) }))));
|
31
31
|
}
|
32
32
|
};
|
33
33
|
VerdocsFileChooser.style = VerdocsFileChooserStyle0;
|
@@ -1 +1 @@
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(t,e,n,o){function r(t){return t instanceof n?t:new n((function(e){e(t)}))}return new(n||(n=Promise))((function(n,i){function a(t){try{s(o.next(t))}catch(t){i(t)}}function c(t){try{s(o["throw"](t))}catch(t){i(t)}}function s(t){t.done?n(t.value):r(t.value).then(a,c)}s((o=o.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var n={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},o,r,i,a;return a={next:c(0),throw:c(1),return:c(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function c(t){return function(e){return s([t,e])}}function s(c){if(o)throw new TypeError("Generator is already executing.");while(a&&(a=0,c[0]&&(n=0)),n)try{if(o=1,r&&(i=c[0]&2?r["return"]:c[0]?r["throw"]||((i=r["return"])&&i.call(r),0):r.next)&&!(i=i.call(r,c[1])).done)return i;if(r=0,i)c=[c[0]&2,i.value];switch(c[0]){case 0:case 1:i=c;break;case 4:n.label++;return{value:c[1],done:false};case 5:n.label++;r=c[1];c=[0];continue;case 7:c=n.ops.pop();n.trys.pop();continue;default:if(!(i=n.trys,i=i.length>0&&i[i.length-1])&&(c[0]===6||c[0]===2)){n=0;continue}if(c[0]===3&&(!i||c[1]>i[0]&&c[1]<i[3])){n.label=c[1];break}if(c[0]===6&&n.label<i[1]){n.label=i[1];i=c;break}if(i&&n.label<i[2]){n.label=i[2];n.ops.push(c);break}if(i[2])n.ops.pop();n.trys.pop();continue}c=e.call(t,n)}catch(t){c=[6,t];r=0}finally{o=i=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:true}}};import{r as registerInstance,h,H as Host}from"./index-b89cf6a4.js";import{c as createPopper}from"./popper-0fbeff6d.js";var verdocsButtonPanelCss='@-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-button-panel{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;display:inline-block}verdocs-button-panel .icon{display:inline-block;cursor:pointer;opacity:0.6}verdocs-button-panel .icon svg{fill:#707ae5}verdocs-button-panel .icon:hover{opacity:1}.verdocs-button-panel-content{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;-webkit-box-shadow:0 0 10px 1px #999999;box-shadow:0 0 10px 1px #999999;display:none;background:#ffffff;color:#33364b;width:320px;font-weight:bold;padding:15px;font-size:14px;position:relative;border-radius:4px;z-index:10000}.verdocs-button-panel-content .arrow,.verdocs-button-panel-content .arrow::before{position:absolute;width:8px;height:8px;background:inherit}.verdocs-button-panel-content .arrow{visibility:hidden;top:-4px}.verdocs-button-panel-content .arrow::before{visibility:visible;content:"";-webkit-transform:rotate(45deg);transform:rotate(45deg)}.verdocs-button-panel-content[data-show]{display:block}.verdocs-button-panel-content[data-popper-placement^=top]>.arrow{bottom:-4px}.verdocs-button-panel-content[data-popper-placement^=bottom]>.arrow{top:-4px}.verdocs-button-panel-content[data-popper-placement^=left]>.arrow{right:-4px}.verdocs-button-panel-content[data-popper-placement^=right]>.arrow{left:-4px}.verdocs-button-panel-content h6{font-size:16px;font-weight:bold;margin:0 0 16px 0;color:#092c4c;border-bottom:1px solid #cccccc}';var VerdocsButtonPanelStyle0=verdocsButtonPanelCss;var VerdocsButtonPanel=function(){function t(t){registerInstance(this,t);this.showing=false;this.icon=""}t.prototype.componentDidRender=function(){document.body.appendChild(this.panelEl);if(this.popperInstance){this.popperInstance.destroy()}this.popperInstance=createPopper(this.iconEl,this.panelEl,{})};t.prototype.disconnectedCallback=function(){if(this.popperInstance){this.popperInstance.destroy();this.popperInstance=null}if(this.panelEl){this.panelEl.remove()}};t.prototype.showPanel=function(){return __awaiter(this,void 0,void 0,(function(){var t,e;var n=this;return __generator(this,(function(o){(t=this.panelEl)===null||t===void 0?void 0:t.setAttribute("data-show","");(e=this.popperInstance)===null||e===void 0?void 0:e.update().catch((function(){}));this.showing=true;this.hiderEl=document.createElement("div");this.hiderEl.id="verdocs-button-panel-hider";this.hiderEl.style.zIndex="100";this.hiderEl.style.position="absolute";this.hiderEl.style.top="0px";this.hiderEl.style.left="0px";this.hiderEl.style.right="0px";this.hiderEl.style.bottom="0px";this.hiderEl.onclick=function(t){t.stopPropagation();n.toggle()};document.body.appendChild(this.hiderEl);return[2]}))}))};t.prototype.hidePanel=function(){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(e){Array.from(document.getElementsByClassName("verdocs-button-panel-content")).forEach((function(t){t.removeAttribute("data-show")}));(t=document.getElementById("verdocs-button-panel-hider"))===null||t===void 0?void 0:t.remove();this.showing=false;return[2]}))}))};t.prototype.toggle=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:if(!this.showing)return[3,2];return[4,this.hidePanel()];case 1:t.sent();return[3,4];case 2:return[4,this.showPanel()];case 3:t.sent();t.label=4;case 4:return[2]}}))}))};t.prototype.render=function(){var t=this;return h(Host,{key:"
|
1
|
+
var __awaiter=this&&this.__awaiter||function(t,e,n,o){function r(t){return t instanceof n?t:new n((function(e){e(t)}))}return new(n||(n=Promise))((function(n,i){function a(t){try{s(o.next(t))}catch(t){i(t)}}function c(t){try{s(o["throw"](t))}catch(t){i(t)}}function s(t){t.done?n(t.value):r(t.value).then(a,c)}s((o=o.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var n={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},o,r,i,a;return a={next:c(0),throw:c(1),return:c(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function c(t){return function(e){return s([t,e])}}function s(c){if(o)throw new TypeError("Generator is already executing.");while(a&&(a=0,c[0]&&(n=0)),n)try{if(o=1,r&&(i=c[0]&2?r["return"]:c[0]?r["throw"]||((i=r["return"])&&i.call(r),0):r.next)&&!(i=i.call(r,c[1])).done)return i;if(r=0,i)c=[c[0]&2,i.value];switch(c[0]){case 0:case 1:i=c;break;case 4:n.label++;return{value:c[1],done:false};case 5:n.label++;r=c[1];c=[0];continue;case 7:c=n.ops.pop();n.trys.pop();continue;default:if(!(i=n.trys,i=i.length>0&&i[i.length-1])&&(c[0]===6||c[0]===2)){n=0;continue}if(c[0]===3&&(!i||c[1]>i[0]&&c[1]<i[3])){n.label=c[1];break}if(c[0]===6&&n.label<i[1]){n.label=i[1];i=c;break}if(i&&n.label<i[2]){n.label=i[2];n.ops.push(c);break}if(i[2])n.ops.pop();n.trys.pop();continue}c=e.call(t,n)}catch(t){c=[6,t];r=0}finally{o=i=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:true}}};import{r as registerInstance,h,H as Host}from"./index-b89cf6a4.js";import{c as createPopper}from"./popper-0fbeff6d.js";var verdocsButtonPanelCss='@-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-button-panel{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;display:inline-block}verdocs-button-panel .icon{display:inline-block;cursor:pointer;opacity:0.6}verdocs-button-panel .icon svg{fill:#707ae5}verdocs-button-panel .icon:hover{opacity:1}.verdocs-button-panel-content{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;-webkit-box-shadow:0 0 10px 1px #999999;box-shadow:0 0 10px 1px #999999;display:none;background:#ffffff;color:#33364b;width:320px;font-weight:bold;padding:15px;font-size:14px;position:relative;border-radius:4px;z-index:10000}.verdocs-button-panel-content .arrow,.verdocs-button-panel-content .arrow::before{position:absolute;width:8px;height:8px;background:inherit}.verdocs-button-panel-content .arrow{visibility:hidden;top:-4px}.verdocs-button-panel-content .arrow::before{visibility:visible;content:"";-webkit-transform:rotate(45deg);transform:rotate(45deg)}.verdocs-button-panel-content[data-show]{display:block}.verdocs-button-panel-content[data-popper-placement^=top]>.arrow{bottom:-4px}.verdocs-button-panel-content[data-popper-placement^=bottom]>.arrow{top:-4px}.verdocs-button-panel-content[data-popper-placement^=left]>.arrow{right:-4px}.verdocs-button-panel-content[data-popper-placement^=right]>.arrow{left:-4px}.verdocs-button-panel-content h6{font-size:16px;font-weight:bold;margin:0 0 16px 0;color:#092c4c;border-bottom:1px solid #cccccc}';var VerdocsButtonPanelStyle0=verdocsButtonPanelCss;var VerdocsButtonPanel=function(){function t(t){registerInstance(this,t);this.showing=false;this.icon=""}t.prototype.componentDidRender=function(){document.body.appendChild(this.panelEl);if(this.popperInstance){this.popperInstance.destroy()}this.popperInstance=createPopper(this.iconEl,this.panelEl,{})};t.prototype.disconnectedCallback=function(){if(this.popperInstance){this.popperInstance.destroy();this.popperInstance=null}if(this.panelEl){this.panelEl.remove()}};t.prototype.showPanel=function(){return __awaiter(this,void 0,void 0,(function(){var t,e;var n=this;return __generator(this,(function(o){(t=this.panelEl)===null||t===void 0?void 0:t.setAttribute("data-show","");(e=this.popperInstance)===null||e===void 0?void 0:e.update().catch((function(){}));this.showing=true;this.hiderEl=document.createElement("div");this.hiderEl.id="verdocs-button-panel-hider";this.hiderEl.style.zIndex="100";this.hiderEl.style.position="absolute";this.hiderEl.style.top="0px";this.hiderEl.style.left="0px";this.hiderEl.style.right="0px";this.hiderEl.style.bottom="0px";this.hiderEl.onclick=function(t){t.stopPropagation();n.toggle()};document.body.appendChild(this.hiderEl);return[2]}))}))};t.prototype.hidePanel=function(){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(e){Array.from(document.getElementsByClassName("verdocs-button-panel-content")).forEach((function(t){t.removeAttribute("data-show")}));(t=document.getElementById("verdocs-button-panel-hider"))===null||t===void 0?void 0:t.remove();this.showing=false;return[2]}))}))};t.prototype.toggle=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:if(!this.showing)return[3,2];return[4,this.hidePanel()];case 1:t.sent();return[3,4];case 2:return[4,this.showPanel()];case 3:t.sent();t.label=4;case 4:return[2]}}))}))};t.prototype.render=function(){var t=this;return h(Host,{key:"875a734696925dd22625880b694e32c4845e1254"},h("div",{key:"cc83aef76b34b3e9031160451f9643168d41cf3b",class:"icon",innerHTML:this.icon,onClick:function(e){e.stopPropagation();return t.toggle()},ref:function(e){return t.iconEl=e}}),h("div",{key:"136375bb517b9d86327c6fa63b115f3f496df7a4",role:"tooltip",class:"verdocs-button-panel-content","data-popper-placement":"bottom",ref:function(e){return t.panelEl=e}},h("div",{key:"065c60cf39be8a608fbc5e2199b09cb55d8a551b","data-popper-arrow":"true",class:"arrow"}),h("slot",{key:"85af4ff2a549a5d062fff08bf17d1c6c24c439e5"})))};return t}();VerdocsButtonPanel.style=VerdocsButtonPanelStyle0;export{VerdocsButtonPanel as verdocs_button_panel};
|