@verdocs/web-sdk 1.9.3 → 1.9.4
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/verdocs-button-panel_3.cjs.entry.js +5 -5
- package/dist/cjs/verdocs-button-panel_3.cjs.entry.js.map +1 -1
- package/dist/cjs/verdocs-dropdown_3.cjs.entry.js +5 -3
- package/dist/cjs/verdocs-dropdown_3.cjs.entry.js.map +1 -1
- package/dist/cjs/verdocs-template-create_4.cjs.entry.js +34 -11
- package/dist/cjs/verdocs-template-create_4.cjs.entry.js.map +1 -1
- package/dist/cjs/verdocs-web-sdk.cjs.js +1 -1
- package/dist/collection/components/controls/verdocs-dropdown/verdocs-dropdown.js +5 -3
- package/dist/collection/components/controls/verdocs-dropdown/verdocs-dropdown.js.map +1 -1
- package/dist/collection/components/controls/verdocs-text-input/verdocs-text-input.js +5 -5
- package/dist/collection/components/controls/verdocs-text-input/verdocs-text-input.js.map +1 -1
- package/dist/collection/components/elements/verdocs-template-create/verdocs-template-create.js +1 -1
- package/dist/collection/components/elements/verdocs-template-create/verdocs-template-create.js.map +1 -1
- package/dist/collection/components/elements/verdocs-template-fields/verdocs-template-fields.js +4 -2
- package/dist/collection/components/elements/verdocs-template-fields/verdocs-template-fields.js.map +1 -1
- package/dist/collection/components/elements/verdocs-template-properties/verdocs-template-properties.js +65 -23
- package/dist/collection/components/elements/verdocs-template-properties/verdocs-template-properties.js.map +1 -1
- package/dist/collection/components/elements/verdocs-template-properties/verdocs-template-properties.stories.js +3 -12
- package/dist/collection/components/elements/verdocs-template-properties/verdocs-template-properties.stories.js.map +1 -1
- package/dist/components/verdocs-dropdown2.js +5 -3
- package/dist/components/verdocs-dropdown2.js.map +1 -1
- package/dist/components/verdocs-template-create2.js +1 -1
- package/dist/components/verdocs-template-create2.js.map +1 -1
- package/dist/components/verdocs-template-fields2.js +4 -2
- package/dist/components/verdocs-template-fields2.js.map +1 -1
- package/dist/components/verdocs-template-properties2.js +39 -10
- package/dist/components/verdocs-template-properties2.js.map +1 -1
- package/dist/components/verdocs-text-input2.js +5 -5
- package/dist/components/verdocs-text-input2.js.map +1 -1
- package/dist/docs.json +16 -6
- package/dist/esm/loader.js +1 -1
- package/dist/esm/verdocs-button-panel_3.entry.js +5 -5
- package/dist/esm/verdocs-button-panel_3.entry.js.map +1 -1
- package/dist/esm/verdocs-dropdown_3.entry.js +5 -3
- package/dist/esm/verdocs-dropdown_3.entry.js.map +1 -1
- package/dist/esm/verdocs-template-create_4.entry.js +34 -11
- package/dist/esm/verdocs-template-create_4.entry.js.map +1 -1
- package/dist/esm/verdocs-web-sdk.js +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/loader.js.map +1 -1
- package/dist/esm-es5/verdocs-button-panel_3.entry.js +1 -1
- package/dist/esm-es5/verdocs-button-panel_3.entry.js.map +1 -1
- package/dist/esm-es5/verdocs-dropdown_3.entry.js +1 -1
- package/dist/esm-es5/verdocs-dropdown_3.entry.js.map +1 -1
- package/dist/esm-es5/verdocs-template-create_4.entry.js +1 -1
- package/dist/esm-es5/verdocs-template-create_4.entry.js.map +1 -1
- package/dist/esm-es5/verdocs-web-sdk.js +1 -1
- package/dist/esm-es5/verdocs-web-sdk.js.map +1 -1
- package/dist/types/components/controls/verdocs-dropdown/verdocs-dropdown.d.ts +2 -2
- package/dist/types/components/controls/verdocs-text-input/verdocs-text-input.d.ts +0 -1
- package/dist/types/components/elements/verdocs-template-properties/verdocs-template-properties.d.ts +14 -5
- package/dist/types/components/elements/verdocs-template-properties/verdocs-template-properties.stories.d.ts +3 -3
- package/dist/types/components.d.ts +8 -4
- package/dist/verdocs-web-sdk/p-0a68a117.entry.js +2 -0
- package/dist/verdocs-web-sdk/p-0a68a117.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/p-1c6ecae5.entry.js +2 -0
- package/dist/verdocs-web-sdk/p-1c6ecae5.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/p-1e46b31a.system.entry.js +2 -0
- package/dist/verdocs-web-sdk/p-1e46b31a.system.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/p-38ee6c83.system.entry.js +2 -0
- package/dist/verdocs-web-sdk/p-38ee6c83.system.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/{p-ca92aa8d.entry.js → p-ba2957bf.entry.js} +2 -2
- package/dist/verdocs-web-sdk/p-ba2957bf.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/{p-32caf55b.system.entry.js → p-c68c09d4.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/p-c68c09d4.system.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/p-d05bf10f.system.js +1 -1
- package/dist/verdocs-web-sdk/p-d05bf10f.system.js.map +1 -1
- package/dist/verdocs-web-sdk/verdocs-web-sdk.esm.js +1 -1
- package/dist/verdocs-web-sdk/verdocs-web-sdk.esm.js.map +1 -1
- package/package.json +1 -1
- package/dist/verdocs-web-sdk/p-32caf55b.system.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-6b7392f8.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-6b7392f8.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-ca92aa8d.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-d35c1011.system.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-d35c1011.system.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-dceb1619.system.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-dceb1619.system.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-eb0a6461.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-eb0a6461.entry.js.map +0 -1
|
@@ -21,7 +21,8 @@ const VerdocsDropdown = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
|
21
21
|
componentDidLoad() {
|
|
22
22
|
this.popper = createPopper(this.dropdownButton, this.dropdownMenu, { placement: 'bottom-start', modifiers: [{ name: 'offset', options: { offset: [0, 6] } }] });
|
|
23
23
|
}
|
|
24
|
-
handleSelectOption(option) {
|
|
24
|
+
handleSelectOption(e, option) {
|
|
25
|
+
e.stopPropagation();
|
|
25
26
|
this.isOpen = false;
|
|
26
27
|
this.optionSelected.emit(option);
|
|
27
28
|
this.hide();
|
|
@@ -47,7 +48,8 @@ const VerdocsDropdown = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
|
47
48
|
}
|
|
48
49
|
this.hide();
|
|
49
50
|
}
|
|
50
|
-
toggleDropdown() {
|
|
51
|
+
toggleDropdown(e) {
|
|
52
|
+
e.stopPropagation();
|
|
51
53
|
if (this.isOpen) {
|
|
52
54
|
this.hide();
|
|
53
55
|
}
|
|
@@ -67,7 +69,7 @@ const VerdocsDropdown = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
|
67
69
|
}
|
|
68
70
|
render() {
|
|
69
71
|
var _a;
|
|
70
|
-
return (h(Host, { class: { storybook: !!(window === null || window === void 0 ? void 0 : window['STORYBOOK_ENV']), open: !!this.isOpen } }, h("button", { class: "arrow", innerHTML: SortDown, "aria-label": "Open Menu", onClick:
|
|
72
|
+
return (h(Host, { class: { storybook: !!(window === null || window === void 0 ? void 0 : window['STORYBOOK_ENV']), open: !!this.isOpen } }, h("button", { class: "arrow", innerHTML: SortDown, "aria-label": "Open Menu", onClick: e => this.toggleDropdown(e), onBlur: e => this.handleHideDropdown(e), ref: el => (this.dropdownButton = el) }), h("div", { class: "items", "aria-hidden": !this.open, ref: el => (this.dropdownMenu = el) }, (_a = this.options) === null || _a === void 0 ? void 0 : _a.map(option => (h("button", { onClick: e => this.handleSelectOption(e, option), class: "option", disabled: option.disabled }, option.label))))));
|
|
71
73
|
}
|
|
72
74
|
static get style() { return verdocsDropdownCss; }
|
|
73
75
|
}, [0, "verdocs-dropdown", {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"verdocs-dropdown2.js","mappings":";;;;;;AAAA,MAAM,kBAA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EAAE,KAAK,EAAC,CAAC;KAC5E,CAAC,CAAC,CAAC;GACL;EAED,MAAM;;IACJ,QACE,EAAC,IAAI,IAAC,KAAK,EAAE,EAAC,SAAS,EAAE,CAAC,EAAC,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAG,eAAe,CAAC,CAAA,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,MAAM,EAAC,IACxE,cACE,KAAK,EAAC,OAAO,EACb,SAAS,EAAE,QAAQ,gBACR,WAAW,EACtB,OAAO,EAAE,CAAC,IAAI,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,EACpC,MAAM,EAAE,CAAC,IAAI,IAAI,CAAC,kBAAkB,CAAC,CAAC,CAAC,EACvC,GAAG,EAAE,EAAE,KAAK,IAAI,CAAC,cAAc,GAAG,EAAuB,CAAC,GAC1D,EAEF,WAAK,KAAK,EAAC,OAAO,iBAAc,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,EAAE,EAAE,KAAK,IAAI,CAAC,YAAY,GAAG,EAAoB,CAAC,IAC9F,MAAA,IAAI,CAAC,OAAO,0CAAE,GAAG,CAAC,MAAM,KACvB,cAAQ,OAAO,EAAE,CAAC,IAAI,IAAI,CAAC,kBAAkB,CAAC,CAAC,EAAE,MAAM,CAAC,EAAE,KAAK,EAAC,QAAQ,EAAC,QAAQ,EAAE,MAAM,CAAC,QAAQ,IAC/F,MAAM,CAAC,KAAK,CACN,CACV,CAAC,CACE,CACD,EACP;GACH;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["./src/components/controls/verdocs-dropdown/verdocs-dropdown.scss?tag=verdocs-dropdown","./src/components/controls/verdocs-dropdown/verdocs-dropdown.tsx"],"sourcesContent":["@import '../../../theme.scss';\n\nverdocs-dropdown {\n font-family: $primary-font;\n display: block;\n\n .arrow {\n width: 32px;\n height: 26px;\n background: #fff;\n cursor: pointer;\n border-radius: 4px;\n align-items: center;\n display: inline-flex;\n border: 1px solid $light-border-color;\n justify-content: center;\n }\n\n .arrow svg {\n fill: $primary-color;\n transition: 0.3s;\n }\n\n .items {\n width: 200px;\n display: none;\n z-index: 10000;\n border-radius: 5px;\n background: $medium-bg;\n border: 1px solid $item-border-color;\n }\n\n .items[data-show] {\n display: block;\n }\n\n .option {\n width: 100%;\n color: #fff;\n border: none;\n display: block;\n text-align: left;\n background: none;\n padding: 10px 20px;\n }\n\n .option:hover {\n cursor: pointer;\n background: $primary-color;\n }\n\n .option[disabled] {\n color: $light-disabled-color;\n }\n\n .option[disabled]:hover {\n color: $light-disabled-color;\n cursor: inherit;\n background: transparent;\n }\n\n &.open {\n .items {\n display: block;\n }\n\n .arrow {\n background: $secondary-color;\n border: 1px solid $border-color;\n }\n\n .arrow svg {\n transform: scaleY(-1);\n fill: #fff;\n }\n }\n}\n","import {Host} from '@stencil/core';\nimport {createPopper, Instance} from '@popperjs/core';\nimport {Component, Prop, State, h, Event, EventEmitter} from '@stencil/core';\nimport SortDown from './down-arrow.svg';\n\nexport interface IMenuOption {\n label: string;\n id?: any;\n faIcon?: any;\n disabled?: boolean;\n}\n\n/**\n * 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\n * when the button is pressed again, or an option is selected.\n */\n@Component({\n tag: 'verdocs-dropdown',\n styleUrl: 'verdocs-dropdown.scss',\n})\nexport class VerdocsDropdown {\n private dropdownButton?: HTMLButtonElement;\n private dropdownMenu?: HTMLDivElement;\n private popper?: Instance;\n\n /**\n * The menu options to display.\n */\n @Prop() options: IMenuOption[] = [];\n\n /**\n * If set, the component will be open by default. This is primarily intended to be used for testing.\n */\n @Prop() open: boolean;\n\n /**\n * If set, the component will be open by default.\n */\n @State() isOpen: boolean;\n\n /**\n * Event fired when a menu option is clicked.\n * Web Component events need to be \"composed\" to cross the Shadow DOM and be received by parent frameworks.\n */\n @Event({composed: true}) optionSelected: EventEmitter<IMenuOption>;\n\n componentWillLoad() {\n this.isOpen = !!this.open;\n }\n\n componentDidLoad() {\n this.popper = createPopper(this.dropdownButton, this.dropdownMenu, {placement: 'bottom-start', modifiers: [{name: 'offset', options: {offset: [0, 6]}}]});\n }\n\n handleSelectOption(e: any, option: IMenuOption) {\n e.stopPropagation();\n this.isOpen = false;\n this.optionSelected.emit(option);\n this.hide();\n }\n\n // See https://popper.js.org/docs/v2/tutorial/\n // What we're doing here is clearing event listeners when they aren't needed, to increase performance in lists\n showDropdown() {\n this.isOpen = true;\n this.dropdownMenu.setAttribute('data-show', '');\n this.dropdownMenu.removeAttribute('aria-hidden');\n\n this.popper?.setOptions(options => ({\n ...options,\n modifiers: [...options.modifiers, {name: 'eventListeners', enabled: true}],\n }));\n\n this.popper?.update();\n }\n\n handleHideDropdown(e: any) {\n if (e?.target?.localName === 'button' && e?.target?.className === 'arrow') {\n // This event is fired when a menu element is clicked because the button \"loses focus\" then too\n return;\n }\n\n this.hide();\n }\n\n toggleDropdown(e: any) {\n e.stopPropagation();\n\n if (this.isOpen) {\n this.hide();\n } else {\n this.showDropdown();\n }\n }\n\n hide() {\n this.isOpen = false;\n this.dropdownMenu.removeAttribute('data-show');\n this.dropdownMenu.setAttribute('aria-hidden', 'true');\n this.popper?.setOptions(options => ({\n ...options,\n modifiers: [...options.modifiers, {name: 'eventListeners', enabled: false}],\n }));\n }\n\n render() {\n return (\n <Host class={{storybook: !!window?.['STORYBOOK_ENV'], open: !!this.isOpen}}>\n <button\n class=\"arrow\"\n innerHTML={SortDown}\n aria-label=\"Open Menu\"\n onClick={e => this.toggleDropdown(e)}\n onBlur={e => this.handleHideDropdown(e)}\n ref={el => (this.dropdownButton = el as HTMLButtonElement)}\n />\n\n <div class=\"items\" aria-hidden={!this.open} ref={el => (this.dropdownMenu = el as HTMLDivElement)}>\n {this.options?.map(option => (\n <button onClick={e => this.handleSelectOption(e, option)} class=\"option\" disabled={option.disabled}>\n {option.label}\n </button>\n ))}\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
|
|
@@ -82,7 +82,7 @@ const VerdocsTemplateCreate = /*@__PURE__*/ proxyCustomElement(class extends HTM
|
|
|
82
82
|
console.log('created template', template);
|
|
83
83
|
const template_document = await createTemplateDocument(this.endpoint, template.id, this.file);
|
|
84
84
|
console.log('created document', template_document);
|
|
85
|
-
for await (let pageNumber of Array.from(Array(
|
|
85
|
+
for await (let pageNumber of Array.from(Array(template_document.page_numbers).keys(), n => n + 1)) {
|
|
86
86
|
console.log('Updating page', pageNumber);
|
|
87
87
|
const page = await createPage(this.endpoint, template.id, { sequence: pageNumber, page_number: pageNumber, document_id: template_document.id });
|
|
88
88
|
console.log('Created page', page);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"verdocs-template-create2.js","mappings":";;;;;;;AAAA;AACA;AACA;AACO,IAAI,UAAU,GAAG,UAAU,QAAQ,EAAE,UAAU,EAAE,MAAM,EAAE;AAChE,IAAI,OAAO,QAAQ,CAAC,GAAG;AACvB,SAAS,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,UAAU,EAAE,QAAQ,CAAC,EAAE,MAAM,CAAC;AACjE,SAAS,IAAI,CAAC,UAAU,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAC/C,CAAC;;ACPD;AACA;AACA;AACA;AACA;AAmDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,IAAI,sBAAsB,GAAG,UAAU,QAAQ,EAAE,UAAU,EAAE,IAAI,EAAE,gBAAgB,EAAE;AAC5F,IAAI,IAAI,QAAQ,GAAG,IAAI,QAAQ,EAAE,CAAC;AAClC,IAAI,QAAQ,CAAC,MAAM,CAAC,UAAU,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;AACjD,IAAI,OAAO,QAAQ,CAAC,GAAG;AACvB,SAAS,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,UAAU,EAAE,YAAY,CAAC,EAAE,QAAQ,EAAE;AACxE,QAAQ,OAAO,EAAE,KAAK;AACtB,QAAQ,gBAAgB,EAAE,UAA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AE,CAAC,IAAI,CAAC,IAAI,GAAI,CAClG,CACD,EACP;GACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["./node_modules/@verdocs/js-sdk/Templates/Pages.js","./node_modules/@verdocs/js-sdk/Templates/TemplateDocuments.js","./src/components/elements/verdocs-template-create/verdocs-template-create.scss?tag=verdocs-template-create","./src/components/elements/verdocs-template-create/verdocs-template-create.tsx"],"sourcesContent":["/**\n * Add a page to a template.\n */\nexport var createPage = function (endpoint, templateId, params) {\n return endpoint.api //\n .post(\"/templates/\".concat(templateId, \"/pages\"), params)\n .then(function (r) { return r.data; });\n};\n/**\n * Update a template page.\n */\nexport var editPage = function (endpoint, templateId, sequence) {\n return endpoint.api //\n .put(\"/templates/\".concat(templateId, \"/pages/\").concat(sequence))\n .then(function (r) { return r.data; });\n};\n/**\n * Get a page from a template.\n */\nexport var getPage = function (endpoint, templateId, sequence) {\n return endpoint.api //\n .get(\"/templates/\".concat(templateId, \"/pages/\").concat(sequence))\n .then(function (r) { return r.data; });\n};\n/**\n * Delete a page from a template\n */\nexport var deletePage = function (endpoint, templateId, sequence) {\n return endpoint.api //\n .delete(\"/templates/\".concat(templateId, \"/pages/\").concat(sequence))\n .then(function (r) { return r.data; });\n};\n","/**\n * A TemplateDocument represents a PDF or other attachment in a Template.\n *\n * @module\n */\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\n/**\n * Get all the Template Documents associated to a particular Template.\n *\n * ```typescript\n * import {TemplateDocument} from '@verdocs/js-sdk/Templates';\n *\n * await TemplateDocument.getDocuments((VerdocsEndpoint.getDefault(), templateID);\n * ```\n */\nexport var getTemplateDocuments = function (endpoint, templateId) {\n return endpoint.api //\n .get(\"/templates/\".concat(templateId, \"/documents/\"))\n .then(function (r) { return r.data; });\n};\n/**\n * Create a Document for a particular Template.\n *\n * ```typescript\n * import {TemplateDocument} from '@verdocs/js-sdk/Templates';\n *\n * await TemplateDocument.createDocument((VerdocsEndpoint.getDefault(), templateID, params);\n * ```\n */\nexport var createTemplateDocument = function (endpoint, templateId, file, onUploadProgress) {\n var formData = new FormData();\n formData.append('document', file, file.name);\n return endpoint.api //\n .post(\"/templates/\".concat(templateId, \"/documents\"), formData, {\n timeout: 10000,\n onUploadProgress: function (event) { return onUploadProgress === null || onUploadProgress === void 0 ? void 0 : onUploadProgress(Math.floor((event.loaded * 100) / event.total), event.loaded, event.total); },\n })\n .then(function (r) { return r.data; });\n};\n/**\n * Get a specific Document.\n *\n * ```typescript\n * import {TemplateDocument} from '@verdocs/js-sdk/Templates';\n *\n * await TemplateDocument.getDocument((VerdocsEndpoint.getDefault(), templateID, documentID);\n * ```\n */\nexport var getTemplateDocument = function (endpoint, templateId, documentId) {\n return endpoint.api //\n .get(\"/templates/\".concat(templateId, \"/documents/\").concat(documentId))\n .then(function (r) { return r.data; });\n};\n/**\n * Delete a specific Document.\n *\n * ```typescript\n * import {TemplateDocument} from '@verdocs/js-sdk/Templates';\n *\n * await TemplateDocument.deleteDocument((VerdocsEndpoint.getDefault(), templateID, documentID);\n * ```\n */\nexport var deleteTemplateDocument = function (endpoint, templateId, documentId) {\n return endpoint.api //\n .delete(\"/templates/\".concat(templateId, \"/documents/\").concat(documentId))\n .then(function (r) { return r.data; });\n};\n/**\n * Get (binary download) a file attached to a Template. It is important to use this method\n * rather than a direct A HREF or similar link to set the authorization headers for the\n * request.\n */\nexport var getTemplateDocumentFile = function (endpoint, templateId, documentId) { return __awaiter(void 0, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, endpoint.api //\n .get(\"/templates/\".concat(templateId, \"/documents/\").concat(documentId, \"?file=true\"), {\n responseType: 'arraybuffer',\n })\n .then(function (r) { return Buffer.from(r.data, 'binary').toString('base64'); })];\n });\n}); };\n/**\n * Get (binary download) a file attached to a Template. It is important to use this method\n * rather than a direct A HREF or similar link to set the authorization headers for the\n * request.\n */\nexport var getTemplateDocumentThumbnail = function (endpoint, templateId, documentId) { return __awaiter(void 0, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, endpoint.api //\n .get(\"/templates/\".concat(templateId, \"/documents/\").concat(documentId, \"?thumbnail=true\"), {\n responseType: 'arraybuffer',\n })\n .then(function (r) { return Buffer.from(r.data, 'binary').toString('base64'); })];\n });\n}); };\n","@import '../../../theme.scss';\n\nverdocs-template-create {\n font-family: $verdocs-primary-font;\n\n form {\n background-color: $verdocs-grey-4;\n padding: 12px;\n display: flex;\n flex-direction: column;\n\n .upload-box {\n max-width: 320px;\n text-align: center;\n padding: 44px 18px 66px;\n border: 2px dashed #979797;\n color: rgba(0, 0, 0, 0.54);\n\n svg {\n width: 64px;\n fill: #5c6575;\n }\n }\n }\n\n .buttons {\n display: flex;\n column-gap: 8px;\n margin-top: 16px;\n align-items: center;\n flex-direction: row;\n justify-content: flex-end;\n\n .flex-fill {\n flex: 1;\n }\n }\n\n ::placeholder {\n color: $verdocs-bg-2;\n }\n}\n","import {VerdocsEndpoint} from '@verdocs/js-sdk';\nimport {Component, h, Event, EventEmitter, Prop, State} from '@stencil/core';\nimport {createTemplate} from '@verdocs/js-sdk/Templates/Templates';\nimport {SDKError} from '../../../utils/errors';\nimport {ITemplate, ITemplateDocument} from '@verdocs/js-sdk/Templates/Types';\nimport {createTemplateDocument} from '@verdocs/js-sdk/Templates/TemplateDocuments';\nimport {createPage} from '@verdocs/js-sdk/Templates/Pages';\n\nconst FileIcon =\n '<svg focusable=\"false\" aria-hidden=\"true\" viewBox=\"0 0 24 24\"><path d=\"M6 2c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6H6zm7 7V3.5L18.5 9H13z\"></path></svg>';\n\n/**\n * Displays a file upload mechanism suitable for the first step of creating a template.\n */\n@Component({\n tag: 'verdocs-template-create',\n styleUrl: 'verdocs-template-create.scss',\n shadow: false,\n})\nexport class VerdocsTemplateCreate {\n /**\n * The endpoint to use to communicate with Verdocs. If not set, the default endpoint will be used.\n */\n @Prop() endpoint: VerdocsEndpoint = VerdocsEndpoint.getDefault();\n\n /**\n * Event fired when the user cancels the dialog.\n */\n @Event({composed: true}) cancel: EventEmitter;\n\n /**\n * Event fired when the user changes the type.\n */\n @Event({composed: true}) templateCreated: EventEmitter<{template: ITemplate; template_document: ITemplateDocument}>;\n\n /**\n * Event fired if an error occurs. The event details will contain information about the error. Most errors will\n * terminate the process, and the calling application should correct the condition and re-render the component.\n */\n @Event({composed: true}) sdkError: EventEmitter<SDKError>;\n\n @State() file: File | null;\n\n componentWillLoad() {}\n\n handleFileChanged(e: any) {\n console.log('files', e.target.files);\n this.file = e.target.files?.[0] || null;\n console.log('Selected file', this.file);\n // this.filePath = e.target.files?.[0]?.name;\n }\n\n handleUpload(e) {\n e.stopPropagation();\n const fileElem = document.getElementById('verdocs-template-create-file');\n fileElem.click();\n }\n\n handleCancel(e) {\n e.stopPropagation();\n this.cancel?.emit();\n }\n\n async handleSubmit(e) {\n e.stopPropagation();\n\n // Should be true if we're here because onClick is only enabled then. We're just guarding this for Typescript.\n if (!this.file) {\n return;\n }\n\n try {\n const template = await createTemplate(this.endpoint, {name: this.file.name});\n console.log('created template', template);\n\n const template_document = await createTemplateDocument(this.endpoint, template.id, this.file);\n console.log('created document', template_document);\n\n for await (let pageNumber of Array.from(Array(3).keys(), n => n + 1)) {\n console.log('Updating page', pageNumber);\n const page = await createPage(this.endpoint, template.id, {sequence: pageNumber, page_number: pageNumber, document_id: template_document.id});\n console.log('Created page', page);\n }\n\n this.templateCreated?.emit({template, template_document});\n // this.fileUploaded?.emit({filePath: this.filePath});\n } catch (e) {\n console.log('[TEMPLATE-CREATE] Error creating template', e);\n this.sdkError?.emit(new SDKError(e.message, e.response?.status, e.response?.data));\n }\n }\n\n render() {\n return (\n <form onSubmit={e => e.preventDefault()} onClick={e => e.stopPropagation()} autocomplete=\"off\">\n <input type=\"file\" id=\"verdocs-template-create-file\" multiple accept=\"application/pdf\" style={{display: 'none'}} onChange={e => this.handleFileChanged(e)} />\n\n <div class=\"upload-box\">\n <div>\n <span innerHTML={FileIcon} />\n </div>\n <div style={{marginTop: '20px', fontSize: '20px', fontWeight: 'bold'}}>Drag a file here</div>\n <div style={{marginTop: '20px', marginBottom: '20px', fontSize: '16px'}}>Or, if you prefer...</div>\n <verdocs-button label=\"Select a file from your computer\" size=\"small\" onPress={e => this.handleUpload(e)} />\n </div>\n\n <div class=\"buttons\">\n <verdocs-button variant=\"outline\" label=\"Cancel\" size=\"small\" onPress={e => this.handleCancel(e)} />\n <verdocs-button label=\"Next\" size=\"small\" onPress={e => this.handleSubmit(e)} disabled={!this.file} />\n </div>\n </form>\n );\n }\n}\n"],"version":3}
|
|
1
|
+
{"file":"verdocs-template-create2.js","mappings":";;;;;;;AAAA;AACA;AACA;AACO,IAAI,UAAU,GAAG,UAAU,QAAQ,EAAE,UAAU,EAAE,MAAM,EAAE;AAChE,IAAI,OAAO,QAAQ,CAAC,GAAG;AACvB,SAAS,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,UAAU,EAAE,QAAQ,CAAC,EAAE,MAAM,CAAC;AACjE,SAAS,IAAI,CAAC,UAAU,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAC/C,CAAC;;ACPD;AACA;AACA;AACA;AACA;AAmDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,IAAI,sBAAsB,GAAG,UAAU,QAAQ,EAAE,UAAU,EAAE,IAAI,EAAE,gBAAgB,EAAE;AAC5F,IAAI,IAAI,QAAQ,GAAG,IAAI,QAAQ,EAAE,CAAC;AAClC,IAAI,QAAQ,CAAC,MAAM,CAAC,UAAU,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;AACjD,IAAI,OAAO,QAAQ,CAAC,GAAG;AACvB,SAAS,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,UAAU,EAAE,YAAY,CAAC,EAAE,QAAQ,EAAE;AACxE,QAAQ,OAAO,EAAE,K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AAI,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,IAAI,CAAC,IAAI,GAAI,CAClG,CACD,EACP;GACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["./node_modules/@verdocs/js-sdk/Templates/Pages.js","./node_modules/@verdocs/js-sdk/Templates/TemplateDocuments.js","./src/components/elements/verdocs-template-create/verdocs-template-create.scss?tag=verdocs-template-create","./src/components/elements/verdocs-template-create/verdocs-template-create.tsx"],"sourcesContent":["/**\n * Add a page to a template.\n */\nexport var createPage = function (endpoint, templateId, params) {\n return endpoint.api //\n .post(\"/templates/\".concat(templateId, \"/pages\"), params)\n .then(function (r) { return r.data; });\n};\n/**\n * Update a template page.\n */\nexport var editPage = function (endpoint, templateId, sequence) {\n return endpoint.api //\n .put(\"/templates/\".concat(templateId, \"/pages/\").concat(sequence))\n .then(function (r) { return r.data; });\n};\n/**\n * Get a page from a template.\n */\nexport var getPage = function (endpoint, templateId, sequence) {\n return endpoint.api //\n .get(\"/templates/\".concat(templateId, \"/pages/\").concat(sequence))\n .then(function (r) { return r.data; });\n};\n/**\n * Delete a page from a template\n */\nexport var deletePage = function (endpoint, templateId, sequence) {\n return endpoint.api //\n .delete(\"/templates/\".concat(templateId, \"/pages/\").concat(sequence))\n .then(function (r) { return r.data; });\n};\n","/**\n * A TemplateDocument represents a PDF or other attachment in a Template.\n *\n * @module\n */\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\n/**\n * Get all the Template Documents associated to a particular Template.\n *\n * ```typescript\n * import {TemplateDocument} from '@verdocs/js-sdk/Templates';\n *\n * await TemplateDocument.getDocuments((VerdocsEndpoint.getDefault(), templateID);\n * ```\n */\nexport var getTemplateDocuments = function (endpoint, templateId) {\n return endpoint.api //\n .get(\"/templates/\".concat(templateId, \"/documents/\"))\n .then(function (r) { return r.data; });\n};\n/**\n * Create a Document for a particular Template.\n *\n * ```typescript\n * import {TemplateDocument} from '@verdocs/js-sdk/Templates';\n *\n * await TemplateDocument.createDocument((VerdocsEndpoint.getDefault(), templateID, params);\n * ```\n */\nexport var createTemplateDocument = function (endpoint, templateId, file, onUploadProgress) {\n var formData = new FormData();\n formData.append('document', file, file.name);\n return endpoint.api //\n .post(\"/templates/\".concat(templateId, \"/documents\"), formData, {\n timeout: 10000,\n onUploadProgress: function (event) { return onUploadProgress === null || onUploadProgress === void 0 ? void 0 : onUploadProgress(Math.floor((event.loaded * 100) / event.total), event.loaded, event.total); },\n })\n .then(function (r) { return r.data; });\n};\n/**\n * Get a specific Document.\n *\n * ```typescript\n * import {TemplateDocument} from '@verdocs/js-sdk/Templates';\n *\n * await TemplateDocument.getDocument((VerdocsEndpoint.getDefault(), templateID, documentID);\n * ```\n */\nexport var getTemplateDocument = function (endpoint, templateId, documentId) {\n return endpoint.api //\n .get(\"/templates/\".concat(templateId, \"/documents/\").concat(documentId))\n .then(function (r) { return r.data; });\n};\n/**\n * Delete a specific Document.\n *\n * ```typescript\n * import {TemplateDocument} from '@verdocs/js-sdk/Templates';\n *\n * await TemplateDocument.deleteDocument((VerdocsEndpoint.getDefault(), templateID, documentID);\n * ```\n */\nexport var deleteTemplateDocument = function (endpoint, templateId, documentId) {\n return endpoint.api //\n .delete(\"/templates/\".concat(templateId, \"/documents/\").concat(documentId))\n .then(function (r) { return r.data; });\n};\n/**\n * Get (binary download) a file attached to a Template. It is important to use this method\n * rather than a direct A HREF or similar link to set the authorization headers for the\n * request.\n */\nexport var getTemplateDocumentFile = function (endpoint, templateId, documentId) { return __awaiter(void 0, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, endpoint.api //\n .get(\"/templates/\".concat(templateId, \"/documents/\").concat(documentId, \"?file=true\"), {\n responseType: 'arraybuffer',\n })\n .then(function (r) { return Buffer.from(r.data, 'binary').toString('base64'); })];\n });\n}); };\n/**\n * Get (binary download) a file attached to a Template. It is important to use this method\n * rather than a direct A HREF or similar link to set the authorization headers for the\n * request.\n */\nexport var getTemplateDocumentThumbnail = function (endpoint, templateId, documentId) { return __awaiter(void 0, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, endpoint.api //\n .get(\"/templates/\".concat(templateId, \"/documents/\").concat(documentId, \"?thumbnail=true\"), {\n responseType: 'arraybuffer',\n })\n .then(function (r) { return Buffer.from(r.data, 'binary').toString('base64'); })];\n });\n}); };\n","@import '../../../theme.scss';\n\nverdocs-template-create {\n font-family: $verdocs-primary-font;\n\n form {\n background-color: $verdocs-grey-4;\n padding: 12px;\n display: flex;\n flex-direction: column;\n\n .upload-box {\n max-width: 320px;\n text-align: center;\n padding: 44px 18px 66px;\n border: 2px dashed #979797;\n color: rgba(0, 0, 0, 0.54);\n\n svg {\n width: 64px;\n fill: #5c6575;\n }\n }\n }\n\n .buttons {\n display: flex;\n column-gap: 8px;\n margin-top: 16px;\n align-items: center;\n flex-direction: row;\n justify-content: flex-end;\n\n .flex-fill {\n flex: 1;\n }\n }\n\n ::placeholder {\n color: $verdocs-bg-2;\n }\n}\n","import {VerdocsEndpoint} from '@verdocs/js-sdk';\nimport {Component, h, Event, EventEmitter, Prop, State} from '@stencil/core';\nimport {createTemplate} from '@verdocs/js-sdk/Templates/Templates';\nimport {SDKError} from '../../../utils/errors';\nimport {ITemplate, ITemplateDocument} from '@verdocs/js-sdk/Templates/Types';\nimport {createTemplateDocument} from '@verdocs/js-sdk/Templates/TemplateDocuments';\nimport {createPage} from '@verdocs/js-sdk/Templates/Pages';\n\nconst FileIcon =\n '<svg focusable=\"false\" aria-hidden=\"true\" viewBox=\"0 0 24 24\"><path d=\"M6 2c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6H6zm7 7V3.5L18.5 9H13z\"></path></svg>';\n\n/**\n * Displays a file upload mechanism suitable for the first step of creating a template.\n */\n@Component({\n tag: 'verdocs-template-create',\n styleUrl: 'verdocs-template-create.scss',\n shadow: false,\n})\nexport class VerdocsTemplateCreate {\n /**\n * The endpoint to use to communicate with Verdocs. If not set, the default endpoint will be used.\n */\n @Prop() endpoint: VerdocsEndpoint = VerdocsEndpoint.getDefault();\n\n /**\n * Event fired when the user cancels the dialog.\n */\n @Event({composed: true}) cancel: EventEmitter;\n\n /**\n * Event fired when the user changes the type.\n */\n @Event({composed: true}) templateCreated: EventEmitter<{template: ITemplate; template_document: ITemplateDocument}>;\n\n /**\n * Event fired if an error occurs. The event details will contain information about the error. Most errors will\n * terminate the process, and the calling application should correct the condition and re-render the component.\n */\n @Event({composed: true}) sdkError: EventEmitter<SDKError>;\n\n @State() file: File | null;\n\n componentWillLoad() {}\n\n handleFileChanged(e: any) {\n console.log('files', e.target.files);\n this.file = e.target.files?.[0] || null;\n console.log('Selected file', this.file);\n // this.filePath = e.target.files?.[0]?.name;\n }\n\n handleUpload(e) {\n e.stopPropagation();\n const fileElem = document.getElementById('verdocs-template-create-file');\n fileElem.click();\n }\n\n handleCancel(e) {\n e.stopPropagation();\n this.cancel?.emit();\n }\n\n async handleSubmit(e) {\n e.stopPropagation();\n\n // Should be true if we're here because onClick is only enabled then. We're just guarding this for Typescript.\n if (!this.file) {\n return;\n }\n\n try {\n const template = await createTemplate(this.endpoint, {name: this.file.name});\n console.log('created template', template);\n\n const template_document = await createTemplateDocument(this.endpoint, template.id, this.file);\n console.log('created document', template_document);\n\n for await (let pageNumber of Array.from(Array(template_document.page_numbers).keys(), n => n + 1)) {\n console.log('Updating page', pageNumber);\n const page = await createPage(this.endpoint, template.id, {sequence: pageNumber, page_number: pageNumber, document_id: template_document.id});\n console.log('Created page', page);\n }\n\n this.templateCreated?.emit({template, template_document});\n // this.fileUploaded?.emit({filePath: this.filePath});\n } catch (e) {\n console.log('[TEMPLATE-CREATE] Error creating template', e);\n this.sdkError?.emit(new SDKError(e.message, e.response?.status, e.response?.data));\n }\n }\n\n render() {\n return (\n <form onSubmit={e => e.preventDefault()} onClick={e => e.stopPropagation()} autocomplete=\"off\">\n <input type=\"file\" id=\"verdocs-template-create-file\" multiple accept=\"application/pdf\" style={{display: 'none'}} onChange={e => this.handleFileChanged(e)} />\n\n <div class=\"upload-box\">\n <div>\n <span innerHTML={FileIcon} />\n </div>\n <div style={{marginTop: '20px', fontSize: '20px', fontWeight: 'bold'}}>Drag a file here</div>\n <div style={{marginTop: '20px', marginBottom: '20px', fontSize: '16px'}}>Or, if you prefer...</div>\n <verdocs-button label=\"Select a file from your computer\" size=\"small\" onPress={e => this.handleUpload(e)} />\n </div>\n\n <div class=\"buttons\">\n <verdocs-button variant=\"outline\" label=\"Cancel\" size=\"small\" onPress={e => this.handleCancel(e)} />\n <verdocs-button label=\"Next\" size=\"small\" onPress={e => this.handleSubmit(e)} disabled={!this.file} />\n </div>\n </form>\n );\n }\n}\n"],"version":3}
|
|
@@ -6,6 +6,7 @@ import { g as getRGBA } from './Colors.js';
|
|
|
6
6
|
import { V as VerdocsEndpoint } from './VerdocsEndpoint.js';
|
|
7
7
|
import { r as renderDocumentField, a as getRoleIndex } from './utils.js';
|
|
8
8
|
import { s as state } from './builderStore.js';
|
|
9
|
+
import { S as SDKError } from './errors.js';
|
|
9
10
|
import { d as defineCustomElement$a } from './verdocs-button2.js';
|
|
10
11
|
import { d as defineCustomElement$9 } from './verdocs-button-panel2.js';
|
|
11
12
|
import { d as defineCustomElement$8 } from './verdocs-document-page2.js';
|
|
@@ -58,8 +59,9 @@ const VerdocsTemplateFields = /*@__PURE__*/ proxyCustomElement(class extends HTM
|
|
|
58
59
|
this.template = null;
|
|
59
60
|
}
|
|
60
61
|
async componentWillLoad() {
|
|
61
|
-
var _a;
|
|
62
|
+
var _a, _b, _c, _d;
|
|
62
63
|
try {
|
|
64
|
+
this.endpoint.loadSession();
|
|
63
65
|
console.log(`[PREVIEW] Loading template ${this.templateId}`);
|
|
64
66
|
state.templateId = this.templateId;
|
|
65
67
|
const template = await getTemplate(this.endpoint, this.templateId);
|
|
@@ -83,7 +85,7 @@ const VerdocsTemplateFields = /*@__PURE__*/ proxyCustomElement(class extends HTM
|
|
|
83
85
|
}
|
|
84
86
|
catch (e) {
|
|
85
87
|
console.log('[PREVIEW] Error with preview session', e);
|
|
86
|
-
|
|
88
|
+
(_b = this.sdkError) === null || _b === void 0 ? void 0 : _b.emit(new SDKError(e.message, (_c = e.response) === null || _c === void 0 ? void 0 : _c.status, (_d = e.response) === null || _d === void 0 ? void 0 : _d.data));
|
|
87
89
|
}
|
|
88
90
|
}
|
|
89
91
|
componentDidRender() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"verdocs-template-fields2.js","mappings":";;;;;;;;;;;;;;;;;;;AAAA,MAAM,wBAAwB,GAAG,s9CAAs9C;;ACWv/C;;;;;;;AAOA,MAAM,kBAAkB,GAAG,CAAC,EAAe,EAAE,GAAW,EAAE,KAAa;;EAErE,MAAM,gBAAgB,GAAG,EAAE,CAAC,KAAK,CAAC,SAAS,CAAC;;EAE5C,MAAM,UAAU,GAAG,CAAC,GAAG,gBAAgB,CAAC,QAAQ,CAAC,oBAAoB,CAAC,CAAC,CAAC;EACxE,EAAE,CAAC,KAAK,CAAC,SAAS,GAAG;IACnB,UAAU;OACP,MAAM,CAAC,SAAS,IAAI,SAAS,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC;OACzC,GAAG,CAAC,SAAS,IAAI,SAAS,CAAC,CAAC,CAAC,CAAC;IACjC,GAAG,GAAG,IAAI,KAAK,GAAG;GACnB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACd,CAAC,CAAC;AAEF,MAAM,cAAc,GAAG,oIAAoI,CAAC;AAE5J,MAAM,aAAa,GACjB,6LAA6L,CAAC;AAEhM,MAAM,SAAS,GACb,oYAAoY,CAAC;AAEvY,MAAM,SAAS,GACb,2pBAA2pB,CAAC;AAE9pB,MAAM,cAAc,GAClB,0sBAA0sB,CAAC;AAE7sB,MAAM,aAAa,GACjB,qWAAqW,CAAC;AAExW,MAAM,WAAW,GAAG,6JAA6J,CAAC;MAWrK,qBAAqB;;;;;;;oBAOI,eAAe,CA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,IAAI,EAAE,KAAK,EAAC;OAChC,GACD,CACO,KAEX,yBAAkB,CACnB,CACI,EACP;GACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["builderStore"],"sources":["./src/components/elements/verdocs-template-fields/verdocs-template-fields.scss?tag=verdocs-template-fields","./src/components/elements/verdocs-template-fields/verdocs-template-fields.tsx"],"sourcesContent":["@import '../../../theme.scss';\n\nverdocs-template-fields {\n position: relative;\n font-family: $verdocs-primary-font;\n\n .page-0 {\n padding: 65px 15px 0 15px;\n box-sizing: border-box;\n\n .user-placed-fields {\n height: 100px;\n position: relative;\n background: #ffffff;\n box-shadow: 0 0 10px 5px #0000000f;\n\n .title {\n top: 0;\n left: 0;\n color: #ffffff;\n font-size: 12px;\n padding: 3px 6px;\n font-weight: bold;\n position: absolute;\n background: $verdocs-grey-blue;\n }\n }\n }\n\n .fields-bar {\n height: 50px;\n display: flex;\n z-index: 10000;\n position: fixed;\n padding: 5px 20px;\n line-height: 28px;\n align-items: center;\n flex-direction: row;\n box-sizing: border-box;\n background: $verdocs-grey-blue;\n\n .label {\n color: #ffffff;\n font-size: 14px;\n font-weight: bold;\n margin-right: 8px;\n }\n\n .icon {\n margin: 0 4px;\n display: flex;\n transform: scale(0.8, 0.8);\n\n svg {\n fill: #ffffff;\n }\n }\n\n .operation {\n border: none;\n outline: none;\n color: #ffffff;\n cursor: pointer;\n font-size: 16px;\n margin-left: 10px;\n background: transparent;\n text-transform: uppercase;\n\n &:disabled {\n color: #cccccc;\n cursor: inherit;\n pointer-events: none;\n }\n }\n }\n}\n","import interact from 'interactjs';\nimport {VerdocsEndpoint} from '@verdocs/js-sdk';\nimport {getRGBA} from '@verdocs/js-sdk/Utils/Colors';\nimport {ITemplate, ITemplateField} from '@verdocs/js-sdk/Templates/Types';\nimport {Component, h, Event, EventEmitter, Fragment, Prop, State, Host} from '@stencil/core';\nimport {IPageRenderEvent} from '../../embeds/verdocs-view/verdocs-view';\nimport {getRoleIndex, renderDocumentField} from '../../../utils/utils';\nimport {getTemplate} from '@verdocs/js-sdk/Templates/Templates';\nimport builderStore from '../../../utils/builderStore';\nimport {SDKError} from '../../../utils/errors';\n\n/**\n * Helper function to safely set/update components in a CSS transform attribute. Transform is normally set as a string of\n * `operation1(param) operation2(param) ...` components, which makes updating them a bit of a pain. This will remove the\n * specified component if it's already set and replace it with the new value, without touching the other components that\n * may already be set. Note that this operation moves the component to the end of the transform chain so it's not meant\n * to be used for order-sensitive components e.g. translate-then-rotate.\n */\nconst updateCssTransform = (el: HTMLElement, key: string, value: string) => {\n // e.g. 'scale(1.87908, 1.87908) translate(0px, 0px);'\n const currentTransform = el.style.transform;\n // e.g. ['scale(1.87908, 1.87908)', 'scale', '1.87908, 1.87908', ...], [ 'translate(0px, 0px)', 'translate', '0px, 0px']]\n const components = [...currentTransform.matchAll(/(\\w+)\\(([^)]*)\\)/gi)];\n el.style.transform = [\n components //\n .filter(component => component[1] !== key) // Remove the entry if it's already set\n .map(component => component[0]), // Convert back the remaining entries\n `${key}(${value})`,\n ].join(' ');\n};\n\nconst iconSingleline = '<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" width=\"24\"><path d=\"M3.425 16.15V13h11.15v3.15Zm0-5.15V7.85h17.15V11Z\"/></svg>';\n\nconst iconMultiline =\n '<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" width=\"24\"><path d=\"M3.225 20.725v-3.15h11.55v3.15Zm0-4.775V12.8h17.55v3.15Zm0-4.75V8.05h17.55v3.15Zm0-4.775v-3.15h17.55v3.15Z\"/></svg>';\n\nconst iconCheck =\n '<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" width=\"24\"><path d=\"m10.55 16.55 7.275-7.275L16.05 7.5l-5.5 5.45-2.675-2.65L6.1 12.075Zm-5.375 4.925q-1.125 0-1.887-.763-.763-.762-.763-1.887V5.175q0-1.125.763-1.888.762-.762 1.887-.762h13.65q1.125 0 1.888.762.762.763.762 1.888v13.65q0 1.125-.762 1.887-.763.763-1.888.763Zm0-2.65h13.65V5.175H5.175v13.65Zm0-13.65v13.65-13.65Z\"/></svg>';\n\nconst iconRadio =\n '<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" width=\"24\"><path d=\"M12 17q2.075 0 3.538-1.463Q17 14.075 17 12t-1.462-3.538Q14.075 7 12 7 9.925 7 8.463 8.462 7 9.925 7 12q0 2.075 1.463 3.537Q9.925 17 12 17Zm0 5.85q-2.275 0-4.25-.85t-3.438-2.312Q2.85 18.225 2 16.25q-.85-1.975-.85-4.25T2 7.75q.85-1.975 2.312-3.438Q5.775 2.85 7.75 2q1.975-.85 4.25-.85t4.25.85q1.975.85 3.438 2.312Q21.15 5.775 22 7.75q.85 1.975.85 4.25T22 16.25q-.85 1.975-2.312 3.438Q18.225 21.15 16.25 22q-1.975.85-4.25.85Zm0-3.15q3.25 0 5.475-2.225Q19.7 15.25 19.7 12q0-3.25-2.225-5.475Q15.25 4.3 12 4.3q-3.25 0-5.475 2.225Q4.3 8.75 4.3 12q0 3.25 2.225 5.475Q8.75 19.7 12 19.7Zm0-7.7Z\"/></svg>';\n\nconst iconDatepicker =\n '<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" width=\"24\"><path d=\"M7.6 13.925q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375Zm4.4 0q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375Zm4.4 0q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375ZM5.3 22.85q-1.325 0-2.238-.912-.912-.913-.912-2.238V6.3q0-1.325.912-2.238.913-.912 2.238-.912H6v-2h2.575v2h6.85v-2H18v2h.7q1.325 0 2.238.912.912.913.912 2.238v13.4q0 1.325-.912 2.238-.913.912-2.238.912Zm0-3.15h13.4V10H5.3v9.7ZM5.3 8h13.4V6.3H5.3Zm0 0V6.3 8Z\"/></svg>';\n\nconst iconSignature =\n '<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" width=\"24\"><path d=\"m9.225 21.225 4.65-4.65h8.45v4.65Zm-5.35-2.2H5.05l8.5-8.5-1.175-1.175-8.5 8.5Zm14.25-9.95L13.8 4.8l1.325-1.325q.625-.65 1.525-.663.9-.012 1.6.663l1.225 1.175q.675.675.663 1.562-.013.888-.663 1.513ZM16.7 10.55 6 21.225H1.675V16.9L12.35 6.225Zm-3.725-.625-.6-.575 1.175 1.175Z\"/></svg>';\n\nconst iconInitial = '<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" width=\"24\"><path d=\"M6.225 20.775V7h-5V3.225H15V7h-5v13.775Zm9.775 0v-8h-3V9h9.775v3.775h-3v8Z\"/></svg>';\n\n/**\n * Displays a builder experience for laying out fields in a template. Note that this experience requires a large display area to\n * present all of the required controls, so it is primarily intended to be used in desktop environments.\n */\n@Component({\n tag: 'verdocs-template-fields',\n styleUrl: 'verdocs-template-fields.scss',\n shadow: false,\n})\nexport class VerdocsTemplateFields {\n page0El: HTMLDivElement;\n toolbarEl: HTMLDivElement;\n\n /**\n * The endpoint to use to communicate with Verdocs. If not set, the default endpoint will be used.\n */\n @Prop() endpoint: VerdocsEndpoint = VerdocsEndpoint.getDefault();\n\n /**\n * The ID of the template to create the document from.\n */\n @Prop() templateId: string | null = null;\n\n /**\n * Event fired when the user completes the step.\n */\n @Event({composed: true}) settingsUpdated: EventEmitter;\n\n /**\n * Event fired when the user cancels the dialog.\n */\n @Event({composed: true}) cancel: EventEmitter;\n\n /**\n * Event fired if an error occurs. The event details will contain information about the error. Most errors will\n * terminate the process, and the calling application should correct the condition and re-render the component.\n */\n @Event({composed: true}) sdkError: EventEmitter<SDKError>;\n\n @State() pdfUrl = null;\n @State() template: ITemplate | null = null;\n\n async componentWillLoad() {\n try {\n console.log(`[PREVIEW] Loading template ${this.templateId}`);\n builderStore.templateId = this.templateId;\n const template = await getTemplate(this.endpoint, this.templateId);\n\n console.log('[PREVIEW] Got template', this.template);\n this.template = template;\n builderStore.template = this.template;\n\n this.pdfUrl = `${this.endpoint.getBaseURL()}/templates/${this.templateId}/documents/${template.template_document?.id}?file=true`;\n\n builderStore.roleNames = template.roles.map(role => role.name);\n // this.roles = template.roles.map(role => role.name);\n console.log('[PREVIEW] Loaded roles', builderStore.roleNames);\n\n builderStore.fields = [];\n template.roles.forEach(role => {\n builderStore.fields.push(...role.fields);\n });\n console.log('[PREVIEW] Loaded fields', builderStore.fields);\n // this.fields = [];\n // template.roles.forEach(role => {\n // this.fields.push(...role.fields);\n // });\n // console.log('[PREVIEW] Loaded fields', this.fields);\n } catch (e) {\n console.log('[PREVIEW] Error with preview session', e);\n // this.sdkError?.emit(new SDKError(e.message, e.response?.status, e.response?.data));\n }\n }\n\n componentDidRender() {\n // console.log('rendered', this.page0El, this.toolbarEl);\n // console.log('w', this.page0El.clientWidth);\n // console.log('t', this.toolbarEl.clientWidth);\n interact.dynamicDrop(true);\n this.toolbarEl.style.width = `${this.page0El.clientWidth}px`;\n }\n\n async handleFieldChange(field: ITemplateField, e: any, optionId?: string) {\n console.log('[PREVIEW] handleFieldChange', field, e, optionId);\n }\n\n handlePageRendered(e) {\n const pageInfo = e.detail as IPageRenderEvent;\n console.log('[PREVIEW] Page rendered', pageInfo);\n\n const fields = builderStore.fields.filter(field => field.page_sequence === pageInfo.renderedPage.pageNumber);\n // const fields = this.fields.filter(field => field.page_sequence === pageInfo.renderedPage.pageNumber);\n console.log('[PREVIEW] Fields on page', fields);\n fields.forEach(field => {\n const el = renderDocumentField(field, pageInfo.renderedPage, getRoleIndex(builderStore.roleNames, field.role_name), this.handleFieldChange, true, true, true);\n // const el = renderDocumentField(field, pageInfo.renderedPage, getRoleIndex(this.roles, field.role_name), this.handleFieldChange, true, true, true);\n if (!el) {\n console.log('Skipping partially rendered field', field);\n return;\n }\n\n el.addEventListener('recipientChanged', e => {\n el.setAttribute('roleindex', getRoleIndex(builderStore.roleNames, e.detail));\n // el.setAttribute('roleindex', getRoleIndex(this.roles, e.detail));\n });\n\n el.setAttribute('xScale', pageInfo.renderedPage.xScale);\n el.setAttribute('yScale', pageInfo.renderedPage.yScale);\n\n interact(el).draggable({\n listeners: {\n start(event) {\n console.log('drag started', event.type, event.target);\n },\n move(event) {\n console.log('moved');\n const oldX = +(event.target.getAttribute('posX') || 0);\n const oldY = +(event.target.getAttribute('posY') || 0);\n const xScale = +(event.target.getAttribute('xScale') || 1);\n const yScale = +(event.target.getAttribute('yScale') || 1);\n const newX = event.dx / xScale + oldX;\n const newY = event.dy / yScale + oldY;\n event.target.setAttribute('posX', newX);\n event.target.setAttribute('posy', newY);\n updateCssTransform(event.target, 'translate', `${newX}px, ${newY}px`);\n },\n end(event) {\n console.log('ended', event);\n // event.target.setAttribute('posX', 0);\n // event.target.setAttribute('posy', 0);\n // updateCssTransform(event.target, 'translate', `${0}px, ${0}px`);\n },\n },\n });\n });\n }\n\n render() {\n const testField: ITemplateField = {\n template_id: '',\n name: 'test',\n role_name: 'Recipient 1',\n type: 'textbox',\n required: true,\n setting: {\n x: 0,\n y: 0,\n },\n page_sequence: 0,\n };\n\n return (\n <Host>\n {this.pdfUrl ? (\n <Fragment>\n <div class=\"fields-bar\" ref={el => (this.toolbarEl = el as HTMLDivElement)}>\n <div class=\"label\">Add Field:</div>\n <verdocs-toolbar-icon icon={iconSingleline} text=\"Single-line Text Box\" onPress={() => console.log('single press')} />\n <verdocs-toolbar-icon icon={iconMultiline} text=\"Multi-line Text Box\" onPress={() => console.log('multi press')} />\n <verdocs-toolbar-icon icon={iconCheck} text=\"Checkbox\" onPress={() => console.log('check press')} />\n <verdocs-toolbar-icon icon={iconRadio} text=\"Radio Button\" onPress={() => console.log('radio press')} />\n <verdocs-toolbar-icon icon={iconDatepicker} text=\"Date Picker\" onPress={() => console.log('date press')} />\n <verdocs-toolbar-icon icon={iconSignature} text=\"Signature\" onPress={() => console.log('signature press')} />\n <verdocs-toolbar-icon icon={iconInitial} text=\"Initials\" onPress={() => console.log('initial press')} />\n <div style={{flex: '1'}} />\n <button onClick={() => console.log('save')} disabled={true} class=\"operation\">\n Save\n </button>\n <button onClick={() => console.log('close')} class=\"operation\">\n Close\n </button>\n </div>\n\n <div class=\"page-0\" ref={el => (this.page0El = el as HTMLDivElement)}>\n <div class=\"user-placed-fields\">\n <div class=\"title\">User-Placed Fields</div>\n <verdocs-field-signature\n field={testField}\n style={{width: '82px', height: '41px', left: '20px', top: '40px', transform: 'scale(1,1)', backgroundColor: getRGBA(0)}}\n moveable={true}\n editable={true}\n />\n </div>\n </div>\n\n <verdocs-view\n source={this.pdfUrl}\n endpoint={this.endpoint}\n onPageRendered={e => this.handlePageRendered(e)}\n pageLayers={[\n {name: 'page', type: 'canvas'},\n {name: 'controls', type: 'div'},\n ]}\n />\n </Fragment>\n ) : (\n <verdocs-loader />\n )}\n </Host>\n );\n }\n}\n"],"version":3}
|
|
1
|
+
{"file":"verdocs-template-fields2.js","mappings":";;;;;;;;;;;;;;;;;;;;AAAA,MAAM,wBAAwB,GAAG,s9CAAs9C;;ACWv/C;;;;;;;AAOA,MAAM,kBAAkB,GAAG,CAAC,EAAe,EAAE,GAAW,EAAE,KAAa;;EAErE,MAAM,gBAAgB,GAAG,EAAE,CAAC,KAAK,CAAC,SAAS,CAAC;;EAE5C,MAAM,UAAU,GAAG,CAAC,GAAG,gBAAgB,CAAC,QAAQ,CAAC,oBAAoB,CAAC,CAAC,CAAC;EACxE,EAAE,CAAC,KAAK,CAAC,SAAS,GAAG;IACnB,UAAU;OACP,MAAM,CAAC,SAAS,IAAI,SAAS,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC;OACzC,GAAG,CAAC,SAAS,IAAI,SAAS,CAAC,CAAC,CAAC,CAAC;IACjC,GAAG,GAAG,IAAI,KAAK,GAAG;GACnB,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ClE,WAAK,KAAK,EAAC,oBAAoB,IAC7B,WAAK,KAAK,EAAC,OAAO,yBAAyB,EAC3C,+BACE,KAAK,EAAE,SAAS,EAChB,KAAK,EAAE,EAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,eAAe,EAAE,OAAO,CAAC,CAAC,CAAC,EAAC,EACvH,QAAQ,EAAE,IAAI,EACd,QAAQ,EAAE,IAAI,GACd,CACE,CACF,EAEN,oBACE,MAAM,EAAE,IAAI,CAAC,MAAM,EACnB,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,cAAc,EAAE,CAAC,IAAI,IAAI,CAAC,kBAAkB,CAAC,CAAC,CAAC,EAC/C,UAAU,EAAE;QACV,EAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAC;QAC9B,EAAC,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,KAAK,EAAC;OAChC,GACD,CACO,KAEX,yBAAkB,CACnB,CACI,EACP;GACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["builderStore"],"sources":["./src/components/elements/verdocs-template-fields/verdocs-template-fields.scss?tag=verdocs-template-fields","./src/components/elements/verdocs-template-fields/verdocs-template-fields.tsx"],"sourcesContent":["@import '../../../theme.scss';\n\nverdocs-template-fields {\n position: relative;\n font-family: $verdocs-primary-font;\n\n .page-0 {\n padding: 65px 15px 0 15px;\n box-sizing: border-box;\n\n .user-placed-fields {\n height: 100px;\n position: relative;\n background: #ffffff;\n box-shadow: 0 0 10px 5px #0000000f;\n\n .title {\n top: 0;\n left: 0;\n color: #ffffff;\n font-size: 12px;\n padding: 3px 6px;\n font-weight: bold;\n position: absolute;\n background: $verdocs-grey-blue;\n }\n }\n }\n\n .fields-bar {\n height: 50px;\n display: flex;\n z-index: 10000;\n position: fixed;\n padding: 5px 20px;\n line-height: 28px;\n align-items: center;\n flex-direction: row;\n box-sizing: border-box;\n background: $verdocs-grey-blue;\n\n .label {\n color: #ffffff;\n font-size: 14px;\n font-weight: bold;\n margin-right: 8px;\n }\n\n .icon {\n margin: 0 4px;\n display: flex;\n transform: scale(0.8, 0.8);\n\n svg {\n fill: #ffffff;\n }\n }\n\n .operation {\n border: none;\n outline: none;\n color: #ffffff;\n cursor: pointer;\n font-size: 16px;\n margin-left: 10px;\n background: transparent;\n text-transform: uppercase;\n\n &:disabled {\n color: #cccccc;\n cursor: inherit;\n pointer-events: none;\n }\n }\n }\n}\n","import interact from 'interactjs';\nimport {VerdocsEndpoint} from '@verdocs/js-sdk';\nimport {getRGBA} from '@verdocs/js-sdk/Utils/Colors';\nimport {ITemplate, ITemplateField} from '@verdocs/js-sdk/Templates/Types';\nimport {Component, h, Event, EventEmitter, Fragment, Prop, State, Host} from '@stencil/core';\nimport {IPageRenderEvent} from '../../embeds/verdocs-view/verdocs-view';\nimport {getRoleIndex, renderDocumentField} from '../../../utils/utils';\nimport {getTemplate} from '@verdocs/js-sdk/Templates/Templates';\nimport builderStore from '../../../utils/builderStore';\nimport {SDKError} from '../../../utils/errors';\n\n/**\n * Helper function to safely set/update components in a CSS transform attribute. Transform is normally set as a string of\n * `operation1(param) operation2(param) ...` components, which makes updating them a bit of a pain. This will remove the\n * specified component if it's already set and replace it with the new value, without touching the other components that\n * may already be set. Note that this operation moves the component to the end of the transform chain so it's not meant\n * to be used for order-sensitive components e.g. translate-then-rotate.\n */\nconst updateCssTransform = (el: HTMLElement, key: string, value: string) => {\n // e.g. 'scale(1.87908, 1.87908) translate(0px, 0px);'\n const currentTransform = el.style.transform;\n // e.g. ['scale(1.87908, 1.87908)', 'scale', '1.87908, 1.87908', ...], [ 'translate(0px, 0px)', 'translate', '0px, 0px']]\n const components = [...currentTransform.matchAll(/(\\w+)\\(([^)]*)\\)/gi)];\n el.style.transform = [\n components //\n .filter(component => component[1] !== key) // Remove the entry if it's already set\n .map(component => component[0]), // Convert back the remaining entries\n `${key}(${value})`,\n ].join(' ');\n};\n\nconst iconSingleline = '<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" width=\"24\"><path d=\"M3.425 16.15V13h11.15v3.15Zm0-5.15V7.85h17.15V11Z\"/></svg>';\n\nconst iconMultiline =\n '<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" width=\"24\"><path d=\"M3.225 20.725v-3.15h11.55v3.15Zm0-4.775V12.8h17.55v3.15Zm0-4.75V8.05h17.55v3.15Zm0-4.775v-3.15h17.55v3.15Z\"/></svg>';\n\nconst iconCheck =\n '<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" width=\"24\"><path d=\"m10.55 16.55 7.275-7.275L16.05 7.5l-5.5 5.45-2.675-2.65L6.1 12.075Zm-5.375 4.925q-1.125 0-1.887-.763-.763-.762-.763-1.887V5.175q0-1.125.763-1.888.762-.762 1.887-.762h13.65q1.125 0 1.888.762.762.763.762 1.888v13.65q0 1.125-.762 1.887-.763.763-1.888.763Zm0-2.65h13.65V5.175H5.175v13.65Zm0-13.65v13.65-13.65Z\"/></svg>';\n\nconst iconRadio =\n '<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" width=\"24\"><path d=\"M12 17q2.075 0 3.538-1.463Q17 14.075 17 12t-1.462-3.538Q14.075 7 12 7 9.925 7 8.463 8.462 7 9.925 7 12q0 2.075 1.463 3.537Q9.925 17 12 17Zm0 5.85q-2.275 0-4.25-.85t-3.438-2.312Q2.85 18.225 2 16.25q-.85-1.975-.85-4.25T2 7.75q.85-1.975 2.312-3.438Q5.775 2.85 7.75 2q1.975-.85 4.25-.85t4.25.85q1.975.85 3.438 2.312Q21.15 5.775 22 7.75q.85 1.975.85 4.25T22 16.25q-.85 1.975-2.312 3.438Q18.225 21.15 16.25 22q-1.975.85-4.25.85Zm0-3.15q3.25 0 5.475-2.225Q19.7 15.25 19.7 12q0-3.25-2.225-5.475Q15.25 4.3 12 4.3q-3.25 0-5.475 2.225Q4.3 8.75 4.3 12q0 3.25 2.225 5.475Q8.75 19.7 12 19.7Zm0-7.7Z\"/></svg>';\n\nconst iconDatepicker =\n '<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" width=\"24\"><path d=\"M7.6 13.925q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375Zm4.4 0q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375Zm4.4 0q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375ZM5.3 22.85q-1.325 0-2.238-.912-.912-.913-.912-2.238V6.3q0-1.325.912-2.238.913-.912 2.238-.912H6v-2h2.575v2h6.85v-2H18v2h.7q1.325 0 2.238.912.912.913.912 2.238v13.4q0 1.325-.912 2.238-.913.912-2.238.912Zm0-3.15h13.4V10H5.3v9.7ZM5.3 8h13.4V6.3H5.3Zm0 0V6.3 8Z\"/></svg>';\n\nconst iconSignature =\n '<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" width=\"24\"><path d=\"m9.225 21.225 4.65-4.65h8.45v4.65Zm-5.35-2.2H5.05l8.5-8.5-1.175-1.175-8.5 8.5Zm14.25-9.95L13.8 4.8l1.325-1.325q.625-.65 1.525-.663.9-.012 1.6.663l1.225 1.175q.675.675.663 1.562-.013.888-.663 1.513ZM16.7 10.55 6 21.225H1.675V16.9L12.35 6.225Zm-3.725-.625-.6-.575 1.175 1.175Z\"/></svg>';\n\nconst iconInitial = '<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" width=\"24\"><path d=\"M6.225 20.775V7h-5V3.225H15V7h-5v13.775Zm9.775 0v-8h-3V9h9.775v3.775h-3v8Z\"/></svg>';\n\n/**\n * Displays a builder experience for laying out fields in a template. Note that this experience requires a large display area to\n * present all of the required controls, so it is primarily intended to be used in desktop environments.\n */\n@Component({\n tag: 'verdocs-template-fields',\n styleUrl: 'verdocs-template-fields.scss',\n shadow: false,\n})\nexport class VerdocsTemplateFields {\n page0El: HTMLDivElement;\n toolbarEl: HTMLDivElement;\n\n /**\n * The endpoint to use to communicate with Verdocs. If not set, the default endpoint will be used.\n */\n @Prop() endpoint: VerdocsEndpoint = VerdocsEndpoint.getDefault();\n\n /**\n * The ID of the template to create the document from.\n */\n @Prop() templateId: string | null = null;\n\n /**\n * Event fired when the user completes the step.\n */\n @Event({composed: true}) settingsUpdated: EventEmitter;\n\n /**\n * Event fired when the user cancels the dialog.\n */\n @Event({composed: true}) cancel: EventEmitter;\n\n /**\n * Event fired if an error occurs. The event details will contain information about the error. Most errors will\n * terminate the process, and the calling application should correct the condition and re-render the component.\n */\n @Event({composed: true}) sdkError: EventEmitter<SDKError>;\n\n @State() pdfUrl = null;\n @State() template: ITemplate | null = null;\n\n async componentWillLoad() {\n try {\n this.endpoint.loadSession();\n\n console.log(`[PREVIEW] Loading template ${this.templateId}`);\n builderStore.templateId = this.templateId;\n const template = await getTemplate(this.endpoint, this.templateId);\n\n console.log('[PREVIEW] Got template', this.template);\n this.template = template;\n builderStore.template = this.template;\n\n this.pdfUrl = `${this.endpoint.getBaseURL()}/templates/${this.templateId}/documents/${template.template_document?.id}?file=true`;\n\n builderStore.roleNames = template.roles.map(role => role.name);\n // this.roles = template.roles.map(role => role.name);\n console.log('[PREVIEW] Loaded roles', builderStore.roleNames);\n\n builderStore.fields = [];\n template.roles.forEach(role => {\n builderStore.fields.push(...role.fields);\n });\n console.log('[PREVIEW] Loaded fields', builderStore.fields);\n // this.fields = [];\n // template.roles.forEach(role => {\n // this.fields.push(...role.fields);\n // });\n // console.log('[PREVIEW] Loaded fields', this.fields);\n } catch (e) {\n console.log('[PREVIEW] Error with preview session', e);\n this.sdkError?.emit(new SDKError(e.message, e.response?.status, e.response?.data));\n }\n }\n\n componentDidRender() {\n // console.log('rendered', this.page0El, this.toolbarEl);\n // console.log('w', this.page0El.clientWidth);\n // console.log('t', this.toolbarEl.clientWidth);\n interact.dynamicDrop(true);\n this.toolbarEl.style.width = `${this.page0El.clientWidth}px`;\n }\n\n async handleFieldChange(field: ITemplateField, e: any, optionId?: string) {\n console.log('[PREVIEW] handleFieldChange', field, e, optionId);\n }\n\n handlePageRendered(e) {\n const pageInfo = e.detail as IPageRenderEvent;\n console.log('[PREVIEW] Page rendered', pageInfo);\n\n const fields = builderStore.fields.filter(field => field.page_sequence === pageInfo.renderedPage.pageNumber);\n // const fields = this.fields.filter(field => field.page_sequence === pageInfo.renderedPage.pageNumber);\n console.log('[PREVIEW] Fields on page', fields);\n fields.forEach(field => {\n const el = renderDocumentField(field, pageInfo.renderedPage, getRoleIndex(builderStore.roleNames, field.role_name), this.handleFieldChange, true, true, true);\n // const el = renderDocumentField(field, pageInfo.renderedPage, getRoleIndex(this.roles, field.role_name), this.handleFieldChange, true, true, true);\n if (!el) {\n console.log('Skipping partially rendered field', field);\n return;\n }\n\n el.addEventListener('recipientChanged', e => {\n el.setAttribute('roleindex', getRoleIndex(builderStore.roleNames, e.detail));\n // el.setAttribute('roleindex', getRoleIndex(this.roles, e.detail));\n });\n\n el.setAttribute('xScale', pageInfo.renderedPage.xScale);\n el.setAttribute('yScale', pageInfo.renderedPage.yScale);\n\n interact(el).draggable({\n listeners: {\n start(event) {\n console.log('drag started', event.type, event.target);\n },\n move(event) {\n console.log('moved');\n const oldX = +(event.target.getAttribute('posX') || 0);\n const oldY = +(event.target.getAttribute('posY') || 0);\n const xScale = +(event.target.getAttribute('xScale') || 1);\n const yScale = +(event.target.getAttribute('yScale') || 1);\n const newX = event.dx / xScale + oldX;\n const newY = event.dy / yScale + oldY;\n event.target.setAttribute('posX', newX);\n event.target.setAttribute('posy', newY);\n updateCssTransform(event.target, 'translate', `${newX}px, ${newY}px`);\n },\n end(event) {\n console.log('ended', event);\n // event.target.setAttribute('posX', 0);\n // event.target.setAttribute('posy', 0);\n // updateCssTransform(event.target, 'translate', `${0}px, ${0}px`);\n },\n },\n });\n });\n }\n\n render() {\n const testField: ITemplateField = {\n template_id: '',\n name: 'test',\n role_name: 'Recipient 1',\n type: 'textbox',\n required: true,\n setting: {\n x: 0,\n y: 0,\n },\n page_sequence: 0,\n };\n\n return (\n <Host>\n {this.pdfUrl ? (\n <Fragment>\n <div class=\"fields-bar\" ref={el => (this.toolbarEl = el as HTMLDivElement)}>\n <div class=\"label\">Add Field:</div>\n <verdocs-toolbar-icon icon={iconSingleline} text=\"Single-line Text Box\" onPress={() => console.log('single press')} />\n <verdocs-toolbar-icon icon={iconMultiline} text=\"Multi-line Text Box\" onPress={() => console.log('multi press')} />\n <verdocs-toolbar-icon icon={iconCheck} text=\"Checkbox\" onPress={() => console.log('check press')} />\n <verdocs-toolbar-icon icon={iconRadio} text=\"Radio Button\" onPress={() => console.log('radio press')} />\n <verdocs-toolbar-icon icon={iconDatepicker} text=\"Date Picker\" onPress={() => console.log('date press')} />\n <verdocs-toolbar-icon icon={iconSignature} text=\"Signature\" onPress={() => console.log('signature press')} />\n <verdocs-toolbar-icon icon={iconInitial} text=\"Initials\" onPress={() => console.log('initial press')} />\n <div style={{flex: '1'}} />\n <button onClick={() => console.log('save')} disabled={true} class=\"operation\">\n Save\n </button>\n <button onClick={() => console.log('close')} class=\"operation\">\n Close\n </button>\n </div>\n\n <div class=\"page-0\" ref={el => (this.page0El = el as HTMLDivElement)}>\n <div class=\"user-placed-fields\">\n <div class=\"title\">User-Placed Fields</div>\n <verdocs-field-signature\n field={testField}\n style={{width: '82px', height: '41px', left: '20px', top: '40px', transform: 'scale(1,1)', backgroundColor: getRGBA(0)}}\n moveable={true}\n editable={true}\n />\n </div>\n </div>\n\n <verdocs-view\n source={this.pdfUrl}\n endpoint={this.endpoint}\n onPageRendered={e => this.handlePageRendered(e)}\n pageLayers={[\n {name: 'page', type: 'canvas'},\n {name: 'controls', type: 'div'},\n ]}\n />\n </Fragment>\n ) : (\n <verdocs-loader />\n )}\n </Host>\n );\n }\n}\n"],"version":3}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
|
|
2
|
+
import { g as getTemplate } from './Templates.js';
|
|
2
3
|
import './Types.js';
|
|
3
4
|
import { V as VerdocsEndpoint } from './VerdocsEndpoint.js';
|
|
5
|
+
import { s as state } from './builderStore.js';
|
|
6
|
+
import { S as SDKError } from './errors.js';
|
|
4
7
|
import { d as defineCustomElement$4 } from './verdocs-button2.js';
|
|
5
8
|
import { d as defineCustomElement$3 } from './verdocs-checkbox2.js';
|
|
6
9
|
import { d as defineCustomElement$2 } from './verdocs-radio-button2.js';
|
|
@@ -14,16 +17,31 @@ const VerdocsTemplateProperties = /*@__PURE__*/ proxyCustomElement(class extends
|
|
|
14
17
|
this.__registerHost();
|
|
15
18
|
this.cancel = createEvent(this, "cancel", 7);
|
|
16
19
|
this.settingsUpdated = createEvent(this, "settingsUpdated", 7);
|
|
20
|
+
this.sdkError = createEvent(this, "sdkError", 7);
|
|
17
21
|
this.endpoint = VerdocsEndpoint.getDefault();
|
|
18
|
-
this.
|
|
22
|
+
this.templateId = '';
|
|
23
|
+
this.template = null;
|
|
24
|
+
this.name = '';
|
|
19
25
|
this.sendReminders = false;
|
|
26
|
+
this.firstReminderDays = '1';
|
|
27
|
+
this.reminderDays = '1';
|
|
20
28
|
}
|
|
21
|
-
componentWillLoad() {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
29
|
+
async componentWillLoad() {
|
|
30
|
+
var _a, _b, _c;
|
|
31
|
+
try {
|
|
32
|
+
this.endpoint.loadSession();
|
|
33
|
+
console.log(`[PROPERTIES] Loading template ${this.templateId}`);
|
|
34
|
+
state.templateId = this.templateId;
|
|
35
|
+
const template = await getTemplate(this.endpoint, this.templateId);
|
|
36
|
+
console.log('[PROPERTIES] Got template', template);
|
|
37
|
+
this.template = template;
|
|
38
|
+
this.name = template.name;
|
|
39
|
+
this.sendReminders = template.reminder_id !== null;
|
|
40
|
+
}
|
|
41
|
+
catch (e) {
|
|
42
|
+
console.log('[PROPERTIES] Error loading template', e);
|
|
43
|
+
(_a = this.sdkError) === null || _a === void 0 ? void 0 : _a.emit(new SDKError(e.message, (_b = e.response) === null || _b === void 0 ? void 0 : _b.status, (_c = e.response) === null || _c === void 0 ? void 0 : _c.data));
|
|
44
|
+
}
|
|
27
45
|
}
|
|
28
46
|
handleMessageChange(e) {
|
|
29
47
|
console.log(e);
|
|
@@ -43,13 +61,24 @@ const VerdocsTemplateProperties = /*@__PURE__*/ proxyCustomElement(class extends
|
|
|
43
61
|
// });
|
|
44
62
|
}
|
|
45
63
|
render() {
|
|
46
|
-
|
|
64
|
+
console.log('vals', { firstReminderDays: this.firstReminderDays, reminderDays: this.reminderDays, name: this.name });
|
|
65
|
+
return (h("form", { onSubmit: e => e.preventDefault(), onClick: e => e.stopPropagation(), autocomplete: "off" }, h("h5", null, "Template Name"), h("fieldset", null, h("verdocs-text-input", { value: this.name, autocomplete: "off", onInput: (e) => {
|
|
66
|
+
this.name = e.target.value;
|
|
67
|
+
} })), h("h5", null, "Reminders"), h("fieldset", null, h("div", { class: "input-row" }, h("label", null, "Send Automatic Reminders"), h("verdocs-checkbox", { name: "automatic-reminders", checked: this.sendReminders, value: "on", onSelected: e => (this.sendReminders = e.detail.value === 'on') })), h("div", { class: "input-row" }, h("label", null, "Days Before First Reminder"), h("verdocs-text-input", { value: this.firstReminderDays, onInput: (e) => {
|
|
68
|
+
this.firstReminderDays = e.target.value;
|
|
69
|
+
} })), h("div", { class: "input-row" }, h("label", null, "Days Between Reminders"), h("verdocs-text-input", { value: this.reminderDays, onInput: (e) => {
|
|
70
|
+
this.firstReminderDays = e.target.value;
|
|
71
|
+
} }))), h("h5", null, "Template Visibility"), h("fieldset", null, h("div", { class: "radio-row" }, h("verdocs-radio-button", { name: "visibility", checked: true, value: "private" }), h("label", { htmlFor: "verdocs-radio-button-visibility-private" }, h("div", { class: "title" }, "Private"), h("div", { class: "description" }, "Only you can share and use this template"))), h("div", { class: "radio-row" }, h("verdocs-radio-button", { name: "visibility", checked: true, value: "shared" }), h("label", { htmlFor: "verdocs-radio-button-visibility-shared" }, h("div", { class: "title" }, "Shared to your organization"), h("div", { class: "description" }, "Give access to your organization to share and use this template"))), h("div", { class: "radio-row" }, h("verdocs-radio-button", { name: "visibility", checked: true, value: "shared_public" }), h("label", { htmlFor: "verdocs-radio-button-visibility-shared_public" }, h("div", { class: "title" }, "Shared to your organization and Public"), h("div", { class: "description" }, "Give access to your organization to share this template, and anyone on the Web can find and use this template"))), h("div", { class: "radio-row" }, h("verdocs-radio-button", { name: "visibility", checked: true, value: "public" }), h("label", { htmlFor: "verdocs-radio-button-visibility-public" }, h("div", { class: "title" }, "Public"), h("div", { class: "description" }, "Anyone on the Web can find and use this template")))), h("div", { class: "buttons" }, h("div", { class: "flex-fill" }), h("verdocs-button", { variant: "outline", label: "Cancel", size: "small", onPress: e => this.handleCancel(e) }), h("verdocs-button", { label: "OK", size: "small", onPress: e => this.handleSubmit(e) }))));
|
|
47
72
|
}
|
|
48
73
|
static get style() { return verdocsTemplatePropertiesCss; }
|
|
49
74
|
}, [0, "verdocs-template-properties", {
|
|
50
75
|
"endpoint": [16],
|
|
51
|
-
"
|
|
52
|
-
"
|
|
76
|
+
"templateId": [1, "template-id"],
|
|
77
|
+
"template": [32],
|
|
78
|
+
"name": [32],
|
|
79
|
+
"sendReminders": [32],
|
|
80
|
+
"firstReminderDays": [32],
|
|
81
|
+
"reminderDays": [32]
|
|
53
82
|
}]);
|
|
54
83
|
function defineCustomElement() {
|
|
55
84
|
if (typeof customElements === "undefined") {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"verdocs-template-properties2.js","mappings":";;;;;;;;AAAA,MAAM,4BAA4B,GAAG,m/FAAm/F;;MCY3gG,yBAAyB;;;;;;o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;;","names":[],"sources":["./src/components/elements/verdocs-template-properties/verdocs-template-properties.scss?tag=verdocs-template-properties","./src/components/elements/verdocs-template-properties/verdocs-template-properties.tsx"],"sourcesContent":["@import '../../../theme.scss';\n\nverdocs-template-properties {\n font-family: $verdocs-primary-font;\n\n form {\n display: flex;\n flex-direction: column;\n\n h5 {\n font-size: 14px;\n font-weight: 400;\n margin: 0 0 6px 0;\n }\n\n .row {\n display: flex;\n position: relative;\n margin: 0 0 20px 0;\n flex-direction: column;\n }\n\n fieldset {\n width: 440px;\n border: none;\n max-width: 100%;\n margin: 0 0 20px 0;\n box-sizing: border-box;\n padding: 20px 20px 10px 20px;\n background-color: $verdocs-grey-4;\n box-shadow: 0 1px 3px 0 rgb(0 0 0 / 20%), 0 2px 2px 0 rgb(0 0 0 / 12%), 0 0 2px 0 rgb(0 0 0 / 14%);\n }\n\n label {\n display: block;\n font-size: 14px;\n font-weight: 500;\n margin: 0 0 4px 0;\n color: $verdocs-bg-4;\n }\n\n input {\n border: none;\n font-size: 18px;\n padding: 3px 6px 3px 0;\n background: transparent;\n border-bottom: 1px solid $verdocs-dark-blue;\n\n &:focus {\n outline: none;\n }\n }\n\n .input-row {\n display: flex;\n margin: 0 0 10px 0;\n align-items: center;\n flex-direction: row;\n\n label {\n flex: 1;\n display: flex;\n }\n\n verdocs-text-input {\n margin: 0;\n display: flex;\n flex: 0 0 40px;\n\n input {\n text-align: center;\n }\n }\n\n verdocs-checkbox {\n display: flex;\n flex: 0 0 40px;\n justify-content: center;\n }\n }\n\n .radio-row {\n display: flex;\n position: relative;\n margin: 0 0 10px 0;\n flex-direction: row;\n\n verdocs-radio-button {\n display: flex;\n flex: 0 0 30px;\n }\n\n label {\n display: flex;\n flex-direction: column;\n\n .title {\n font-size: 16px;\n font-weight: 500;\n }\n\n .description {\n font-size: 14px;\n font-weight: 400;\n }\n }\n }\n }\n\n .buttons {\n display: flex;\n column-gap: 8px;\n margin-top: 16px;\n flex-direction: row;\n\n .flex-fill {\n flex: 1;\n }\n }\n\n ::placeholder {\n color: $verdocs-bg-2;\n }\n}\n","import {VerdocsEndpoint} from '@verdocs/js-sdk';\nimport {IRole} from '@verdocs/js-sdk/Templates/Types';\nimport {Component, h, Event, EventEmitter, Prop, State} from '@stencil/core';\n\n/**\n * Displays a collection of settings boxes that allow a user to configure a template's behavior.\n */\n@Component({\n tag: 'verdocs-template-properties',\n styleUrl: 'verdocs-template-properties.scss',\n shadow: false,\n})\nexport class VerdocsTemplateProperties {\n /**\n * The endpoint to use to communicate with Verdocs. If not set, the default endpoint will be used.\n */\n @Prop() endpoint: VerdocsEndpoint = VerdocsEndpoint.getDefault();\n\n /**\n * The role that this contact will be assigned to.\n */\n @Prop() templateRole: IRole | null = null;\n\n /**\n * Event fired when the user cancels the dialog.\n */\n @Event({composed: true}) cancel: EventEmitter;\n\n /**\n * Event fired when the user completes the step.\n */\n @Event({composed: true}) settingsUpdated: EventEmitter;\n\n @State() sendReminders: boolean = false;\n\n componentWillLoad() {\n if (this.templateRole) {\n // this.showMessage = this.message !== '';\n }\n }\n\n handleNameChange(e: any) {\n console.log(e);\n // this.name = e.target.value;\n // this.searchContacts?.emit({query: this.name});\n }\n\n handleMessageChange(e: any) {\n console.log(e);\n // this.message = e.target.value;\n }\n\n handleCancel(e) {\n e.stopPropagation();\n this.cancel?.emit();\n }\n\n handleSubmit(e) {\n e.stopPropagation();\n\n this.settingsUpdated?.emit();\n\n // this.contactSelected?.emit({\n // delegator: this.delegator,\n // });\n }\n\n render() {\n return (\n <form onSubmit={e => e.preventDefault()} onClick={e => e.stopPropagation()} autocomplete=\"off\">\n <h5>Template Name</h5>\n <fieldset>\n <verdocs-text-input value=\"Motor Vehicle Bill of Sale\" autocomplete=\"off\" />\n </fieldset>\n\n <h5>Reminders</h5>\n <fieldset>\n <div class=\"input-row\">\n <label>Send Automatic Reminders</label>\n <verdocs-checkbox name=\"automatic-reminders\" checked={true} />\n </div>\n\n <div class=\"input-row\">\n <label>Days Before First Reminder</label>\n <verdocs-text-input value=\"1\" />\n </div>\n <div class=\"input-row\">\n <label>Days Between Reminders</label>\n <verdocs-text-input value=\"1\" />\n </div>\n </fieldset>\n\n <h5>Template Visibility</h5>\n <fieldset>\n <div class=\"radio-row\">\n <verdocs-radio-button name=\"visibility\" checked={true} value=\"private\" />\n <label htmlFor=\"verdocs-radio-button-visibility-private\">\n <div class=\"title\">Private</div>\n <div class=\"description\">Only you can share and use this template</div>\n </label>\n </div>\n <div class=\"radio-row\">\n <verdocs-radio-button name=\"visibility\" checked={true} value=\"shared\" />\n <label htmlFor=\"verdocs-radio-button-visibility-shared\">\n <div class=\"title\">Shared to your organization</div>\n <div class=\"description\">Give access to your organization to share and use this template</div>\n </label>\n </div>\n <div class=\"radio-row\">\n <verdocs-radio-button name=\"visibility\" checked={true} value=\"shared_public\" />\n <label htmlFor=\"verdocs-radio-button-visibility-shared_public\">\n <div class=\"title\">Shared to your organization and Public</div>\n <div class=\"description\">Give access to your organization to share this template, and anyone on the Web can find and use this template</div>\n </label>\n </div>\n <div class=\"radio-row\">\n <verdocs-radio-button name=\"visibility\" checked={true} value=\"public\" />\n <label htmlFor=\"verdocs-radio-button-visibility-public\">\n <div class=\"title\">Public</div>\n <div class=\"description\">Anyone on the Web can find and use this template</div>\n </label>\n </div>\n </fieldset>\n\n <div class=\"buttons\">\n <div class=\"flex-fill\" />\n\n <verdocs-button variant=\"outline\" label=\"Cancel\" size=\"small\" onPress={e => this.handleCancel(e)} />\n <verdocs-button label=\"OK\" size=\"small\" onPress={e => this.handleSubmit(e)} />\n </div>\n </form>\n );\n }\n}\n"],"version":3}
|
|
1
|
+
{"file":"verdocs-template-properties2.js","mappings":";;;;;;;;;;;AAAA,MAAM,4BAA4B,GAAG,m/FAAm/F;;MCe3gG,yBAAyB;;;;;;;oBAIA,eAAe,CAAC,UAAU,EAAE;sBAKnC,EAAE;oBAkBO,IAAI;gBAClB,EAAE;yBACD,KAAK;6BACD,GAAG;wBACR,GAAG;;EAE3B,MAAM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GAAI,CAC1E,CACD,EACP;GACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["builderStore"],"sources":["./src/components/elements/verdocs-template-properties/verdocs-template-properties.scss?tag=verdocs-template-properties","./src/components/elements/verdocs-template-properties/verdocs-template-properties.tsx"],"sourcesContent":["@import '../../../theme.scss';\n\nverdocs-template-properties {\n font-family: $verdocs-primary-font;\n\n form {\n display: flex;\n flex-direction: column;\n\n h5 {\n font-size: 14px;\n font-weight: 400;\n margin: 0 0 6px 0;\n }\n\n .row {\n display: flex;\n position: relative;\n margin: 0 0 20px 0;\n flex-direction: column;\n }\n\n fieldset {\n width: 440px;\n border: none;\n max-width: 100%;\n margin: 0 0 20px 0;\n box-sizing: border-box;\n padding: 20px 20px 10px 20px;\n background-color: $verdocs-grey-4;\n box-shadow: 0 1px 3px 0 rgb(0 0 0 / 20%), 0 2px 2px 0 rgb(0 0 0 / 12%), 0 0 2px 0 rgb(0 0 0 / 14%);\n }\n\n label {\n display: block;\n font-size: 14px;\n font-weight: 500;\n margin: 0 0 4px 0;\n color: $verdocs-bg-4;\n }\n\n input {\n border: none;\n font-size: 18px;\n padding: 3px 6px 3px 0;\n background: transparent;\n border-bottom: 1px solid $verdocs-dark-blue;\n\n &:focus {\n outline: none;\n }\n }\n\n .input-row {\n display: flex;\n margin: 0 0 10px 0;\n align-items: center;\n flex-direction: row;\n\n label {\n flex: 1;\n display: flex;\n }\n\n verdocs-text-input {\n margin: 0;\n display: flex;\n flex: 0 0 40px;\n\n input {\n text-align: center;\n }\n }\n\n verdocs-checkbox {\n display: flex;\n flex: 0 0 40px;\n justify-content: center;\n }\n }\n\n .radio-row {\n display: flex;\n position: relative;\n margin: 0 0 10px 0;\n flex-direction: row;\n\n verdocs-radio-button {\n display: flex;\n flex: 0 0 30px;\n }\n\n label {\n display: flex;\n flex-direction: column;\n\n .title {\n font-size: 16px;\n font-weight: 500;\n }\n\n .description {\n font-size: 14px;\n font-weight: 400;\n }\n }\n }\n }\n\n .buttons {\n display: flex;\n column-gap: 8px;\n margin-top: 16px;\n flex-direction: row;\n\n .flex-fill {\n flex: 1;\n }\n }\n\n ::placeholder {\n color: $verdocs-bg-2;\n }\n}\n","import {VerdocsEndpoint} from '@verdocs/js-sdk';\nimport {Component, h, Event, EventEmitter, Prop, State} from '@stencil/core';\nimport builderStore from '../../../utils/builderStore';\nimport {getTemplate} from '@verdocs/js-sdk/Templates/Templates';\nimport {ITemplate} from '@verdocs/js-sdk/Templates/Types';\nimport {SDKError} from '../../../utils/errors';\n\n/**\n * Displays a collection of settings boxes that allow a user to configure a template's behavior.\n */\n@Component({\n tag: 'verdocs-template-properties',\n styleUrl: 'verdocs-template-properties.scss',\n shadow: false,\n})\nexport class VerdocsTemplateProperties {\n /**\n * The endpoint to use to communicate with Verdocs. If not set, the default endpoint will be used.\n */\n @Prop() endpoint: VerdocsEndpoint = VerdocsEndpoint.getDefault();\n\n /**\n * The template ID to edit.\n */\n @Prop() templateId: string = '';\n\n /**\n * Event fired when the user cancels the dialog.\n */\n @Event({composed: true}) cancel: EventEmitter;\n\n /**\n * Event fired when the user completes the step.\n */\n @Event({composed: true}) settingsUpdated: EventEmitter;\n\n /**\n * Event fired if an error occurs. The event details will contain information about the error. Most errors will\n * terminate the process, and the calling application should correct the condition and re-render the component.\n */\n @Event({composed: true}) sdkError: EventEmitter<SDKError>;\n\n @State() template: ITemplate | null = null;\n @State() name: string = '';\n @State() sendReminders = false;\n @State() firstReminderDays = '1';\n @State() reminderDays = '1';\n\n async componentWillLoad() {\n try {\n this.endpoint.loadSession();\n\n console.log(`[PROPERTIES] Loading template ${this.templateId}`);\n builderStore.templateId = this.templateId;\n const template = await getTemplate(this.endpoint, this.templateId);\n\n console.log('[PROPERTIES] Got template', template);\n this.template = template;\n this.name = template.name;\n this.sendReminders = template.reminder_id !== null;\n } catch (e) {\n console.log('[PROPERTIES] Error loading template', e);\n this.sdkError?.emit(new SDKError(e.message, e.response?.status, e.response?.data));\n }\n }\n\n handleMessageChange(e: any) {\n console.log(e);\n // this.message = e.target.value;\n }\n\n handleCancel(e) {\n e.stopPropagation();\n this.cancel?.emit();\n }\n\n handleSubmit(e) {\n e.stopPropagation();\n\n this.settingsUpdated?.emit();\n\n // this.contactSelected?.emit({\n // delegator: this.delegator,\n // });\n }\n\n render() {\n console.log('vals', {firstReminderDays: this.firstReminderDays, reminderDays: this.reminderDays, name: this.name});\n return (\n <form onSubmit={e => e.preventDefault()} onClick={e => e.stopPropagation()} autocomplete=\"off\">\n <h5>Template Name</h5>\n <fieldset>\n <verdocs-text-input\n value={this.name}\n autocomplete=\"off\"\n onInput={(e: any) => {\n this.name = e.target.value;\n }}\n />\n </fieldset>\n\n <h5>Reminders</h5>\n <fieldset>\n <div class=\"input-row\">\n <label>Send Automatic Reminders</label>\n <verdocs-checkbox name=\"automatic-reminders\" checked={this.sendReminders} value=\"on\" onSelected={e => (this.sendReminders = e.detail.value === 'on')} />\n </div>\n\n <div class=\"input-row\">\n <label>Days Before First Reminder</label>\n <verdocs-text-input\n value={this.firstReminderDays}\n onInput={(e: any) => {\n this.firstReminderDays = e.target.value;\n }}\n />\n </div>\n <div class=\"input-row\">\n <label>Days Between Reminders</label>\n <verdocs-text-input\n value={this.reminderDays}\n onInput={(e: any) => {\n this.firstReminderDays = e.target.value;\n }}\n />\n </div>\n </fieldset>\n\n <h5>Template Visibility</h5>\n <fieldset>\n <div class=\"radio-row\">\n <verdocs-radio-button name=\"visibility\" checked={true} value=\"private\" />\n <label htmlFor=\"verdocs-radio-button-visibility-private\">\n <div class=\"title\">Private</div>\n <div class=\"description\">Only you can share and use this template</div>\n </label>\n </div>\n <div class=\"radio-row\">\n <verdocs-radio-button name=\"visibility\" checked={true} value=\"shared\" />\n <label htmlFor=\"verdocs-radio-button-visibility-shared\">\n <div class=\"title\">Shared to your organization</div>\n <div class=\"description\">Give access to your organization to share and use this template</div>\n </label>\n </div>\n <div class=\"radio-row\">\n <verdocs-radio-button name=\"visibility\" checked={true} value=\"shared_public\" />\n <label htmlFor=\"verdocs-radio-button-visibility-shared_public\">\n <div class=\"title\">Shared to your organization and Public</div>\n <div class=\"description\">Give access to your organization to share this template, and anyone on the Web can find and use this template</div>\n </label>\n </div>\n <div class=\"radio-row\">\n <verdocs-radio-button name=\"visibility\" checked={true} value=\"public\" />\n <label htmlFor=\"verdocs-radio-button-visibility-public\">\n <div class=\"title\">Public</div>\n <div class=\"description\">Anyone on the Web can find and use this template</div>\n </label>\n </div>\n </fieldset>\n\n <div class=\"buttons\">\n <div class=\"flex-fill\" />\n\n <verdocs-button variant=\"outline\" label=\"Cancel\" size=\"small\" onPress={e => this.handleCancel(e)} />\n <verdocs-button label=\"OK\" size=\"small\" onPress={e => this.handleSubmit(e)} />\n </div>\n </form>\n );\n }\n}\n"],"version":3}
|
|
@@ -15,14 +15,14 @@ const VerdocsTextInput = /*@__PURE__*/ proxyCustomElement(class extends HTMLElem
|
|
|
15
15
|
this._value = '';
|
|
16
16
|
}
|
|
17
17
|
componentWillLoad() {
|
|
18
|
-
this._value = this.value;
|
|
18
|
+
// this._value = this.value;
|
|
19
19
|
}
|
|
20
20
|
componentDidLoad() { }
|
|
21
|
-
handleInput(e) {
|
|
22
|
-
|
|
23
|
-
}
|
|
21
|
+
// handleInput(e: any) {
|
|
22
|
+
// this._value = e.target.value;
|
|
23
|
+
// }
|
|
24
24
|
render() {
|
|
25
|
-
return (h(Host, { class: "input-field" }, h("label", null, this.label ? h("div", { class: "input-label" }, this.label + ':') : h("div", null), h("input", { type: this.type, value: this.
|
|
25
|
+
return (h(Host, { class: "input-field" }, h("label", null, this.label ? h("div", { class: "input-label" }, this.label + ':') : h("div", null), h("input", { type: this.type, value: this.value, class: "input-element", "data-lpignore": "true", disabled: this.disabled, placeholder: this.placeholder, autoComplete: this.autocomplete }))));
|
|
26
26
|
}
|
|
27
27
|
static get style() { return verdocsTextInputCss; }
|
|
28
28
|
}, [0, "verdocs-text-input", {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"verdocs-text-input2.js","mappings":";;AAAA,MAAM,mBAAmB,GAAG,s6BAAs6B;;MCWr7B,gBAAgB;;;;iBAIH,EAAE;iBAKF,EAAE;uBAKI,EAAE;wBAKD,EAAE;gBAMmD,MAAM;oBAK9D,KAAK;kBAEP,EAAE;;EAE5B,iBAAiB;
|
|
1
|
+
{"file":"verdocs-text-input2.js","mappings":";;AAAA,MAAM,mBAAmB,GAAG,s6BAAs6B;;MCWr7B,gBAAgB;;;;iBAIH,EAAE;iBAKF,EAAE;uBAKI,EAAE;wBAKD,EAAE;gBAMmD,MAAM;oBAK9D,KAAK;kBAEP,EAAE;;EAE5B,iBAAiB;;GAEhB;EAED,gBAAgB,MAAK;;;;EAMrB,MAAM;IACJ,QACE,EAAC,IAAI,IAAC,KAAK,EAAC,aAAa,IACvB,iBACG,IAAI,CAAC,KAAK,GAAG,WAAK,KAAK,EAAC,aAAa,IAAE,IAAI,CAAC,KAAK,GAAG,GAAG,CAAO,GAAG,cAAO,EACzE,aACE,IAAI,EAAE,IAAI,CAAC,IAAI,EACf,KAAK,EAAE,IAAI,CAAC,KAAK,EACjB,KAAK,EAAC,eAAe,mBACP,MAAM,EACpB,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,WAAW,EAAE,IAAI,CAAC,WAAW,EAC7B,YAAY,EAAE,IAAI,CAAC,YAAY,GAE/B,CACI,CACH,EACP;GACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["./src/components/controls/verdocs-text-input/verdocs-text-input.scss?tag=verdocs-text-input","./src/components/controls/verdocs-text-input/verdocs-text-input.tsx"],"sourcesContent":["@import '../../../theme.scss';\n\nverdocs-text-input {\n font-family: $primary-font;\n box-sizing: border-box;\n margin: 0 0 10px 0;\n display: block;\n\n .input-element {\n box-sizing: border-box;\n border: 1px solid $border-color;\n border-radius: 4px;\n background: $verdocs-grey-4;\n color: #000;\n width: 100%;\n font-size: 16px;\n height: 28px;\n padding: 4px 12px;\n outline: none;\n\n &::placeholder {\n color: $light-disabled-color;\n opacity: 1;\n }\n\n &:focus {\n outline: 1px solid $border-color-highlight;\n }\n }\n\n .input-label {\n display: block;\n color: $label-color-light;\n font-weight: 700;\n font-size: 14px;\n margin: 0 0 4px 0;\n }\n}\n","import {Component, Prop, State, Host, h} from '@stencil/core';\n\n/**\n * Display a text input field. This is just a standard HTML input field with minimal markup to fit the\n * visual styles of the other components. Note that events \"bubble\" from the input field to the container,\n * so you can subscribe to the same DOM events (input, blur, etc) that a normal input would emmit.\n */\n@Component({\n tag: 'verdocs-text-input',\n styleUrl: 'verdocs-text-input.scss',\n})\nexport class VerdocsTextInput {\n /**\n * The initial value for the input field.\n */\n @Prop() value: string = '';\n\n /**\n * The label for the field.\n */\n @Prop() label: string = '';\n\n /**\n * The placeholder for the field.\n */\n @Prop() placeholder: string = '';\n\n /**\n * If desired, the autocomplete attribute to set.\n */\n @Prop() autocomplete: string = '';\n\n /**\n * The type of field to render. Only text-type fields are allowed here for the current styling. Additional types\n * (e.g. a date picker) will be supported by other controls in the future.\n */\n @Prop() type: 'text' | 'password' | 'email' | 'number' | 'search' | 'tel' | 'url' = 'text';\n\n /**\n * Should the field be disabled?\n */\n @Prop() disabled: boolean = false;\n\n @State() _value: string = '';\n\n componentWillLoad() {\n // this._value = this.value;\n }\n\n componentDidLoad() {}\n\n // handleInput(e: any) {\n // this._value = e.target.value;\n // }\n\n render() {\n return (\n <Host class=\"input-field\">\n <label>\n {this.label ? <div class=\"input-label\">{this.label + ':'}</div> : <div />}\n <input\n type={this.type}\n value={this.value}\n class=\"input-element\"\n data-lpignore=\"true\"\n disabled={this.disabled}\n placeholder={this.placeholder}\n autoComplete={this.autocomplete}\n // onInput={e => this.handleInput(e)}\n />\n </label>\n </Host>\n );\n }\n}\n"],"version":3}
|
package/dist/docs.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"timestamp": "2022-12-
|
|
2
|
+
"timestamp": "2022-12-15T17:45:31",
|
|
3
3
|
"compiler": {
|
|
4
4
|
"name": "@stencil/core",
|
|
5
5
|
"version": "2.20.0",
|
|
@@ -4621,16 +4621,17 @@
|
|
|
4621
4621
|
"required": false
|
|
4622
4622
|
},
|
|
4623
4623
|
{
|
|
4624
|
-
"name": "
|
|
4625
|
-
"type": "
|
|
4624
|
+
"name": "templateId",
|
|
4625
|
+
"type": "string",
|
|
4626
4626
|
"mutable": false,
|
|
4627
|
+
"attr": "template-id",
|
|
4627
4628
|
"reflectToAttr": false,
|
|
4628
|
-
"docs": "The
|
|
4629
|
+
"docs": "The template ID to edit.",
|
|
4629
4630
|
"docsTags": [],
|
|
4630
|
-
"default": "
|
|
4631
|
+
"default": "''",
|
|
4631
4632
|
"values": [
|
|
4632
4633
|
{
|
|
4633
|
-
"type": "
|
|
4634
|
+
"type": "string"
|
|
4634
4635
|
}
|
|
4635
4636
|
],
|
|
4636
4637
|
"optional": false,
|
|
@@ -4648,6 +4649,15 @@
|
|
|
4648
4649
|
"docs": "Event fired when the user cancels the dialog.",
|
|
4649
4650
|
"docsTags": []
|
|
4650
4651
|
},
|
|
4652
|
+
{
|
|
4653
|
+
"event": "sdkError",
|
|
4654
|
+
"detail": "SDKError",
|
|
4655
|
+
"bubbles": true,
|
|
4656
|
+
"cancelable": true,
|
|
4657
|
+
"composed": true,
|
|
4658
|
+
"docs": "Event fired if an error occurs. The event details will contain information about the error. Most errors will\nterminate the process, and the calling application should correct the condition and re-render the component.",
|
|
4659
|
+
"docsTags": []
|
|
4660
|
+
},
|
|
4651
4661
|
{
|
|
4652
4662
|
"event": "settingsUpdated",
|
|
4653
4663
|
"detail": "any",
|