@agilemotion/oui-react-js 1.7.1 → 1.7.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/dist/ApplicationManager.js +8 -3
  2. package/dist/BasicAppHome.js +1 -1
  3. package/dist/DynamicJS.js +5 -2
  4. package/dist/InteractionPortalAppHome.js +5 -0
  5. package/dist/RestService.js +344 -0
  6. package/dist/RestUtils.js +22 -8
  7. package/dist/Utils.js +9 -0
  8. package/dist/components/AlertBar.js +3 -0
  9. package/dist/components/DataGrid.js +72 -43
  10. package/dist/components/DocumentTemplateDesigner.css +2 -2
  11. package/dist/components/DocumentTemplateDesigner.js +43 -31
  12. package/dist/components/DocumentTemplateDesignerComponent.css +15 -0
  13. package/dist/components/DocumentTemplateDesignerComponent.js +368 -72
  14. package/dist/components/DocumentTemplatePlaceholderDialog.js +6 -6
  15. package/dist/components/DocumentViewer.css +10 -0
  16. package/dist/components/DocumentViewer.js +95 -45
  17. package/dist/components/Graph.js +12 -2
  18. package/dist/components/GraphNode.js +0 -2
  19. package/dist/components/{DocumentViewerComponent.js → PDFViewer.js} +2 -2
  20. package/dist/components/TabPage.js +7 -3
  21. package/dist/components/TabPanel.js +13 -3
  22. package/dist/components/TableCellContent.js +21 -4
  23. package/dist/components/TemplateDesigner.css +3 -2
  24. package/dist/components/TemplateDesigner.js +3 -1
  25. package/dist/components/TemplateItemEventHandler.js +30 -15
  26. package/dist/components/Toolbar.js +3 -1
  27. package/dist/components/Tree.js +5 -5
  28. package/dist/components/WordDocumentViewer.js +167 -0
  29. package/dist/components/dashboard/SideMenuModuleDashboard.js +1 -3
  30. package/dist/components/dashboard/components/blackDashboard/sidebar/ModuleMenuSidebar.css +4 -0
  31. package/dist/components/dashboard/components/blackDashboard/sidebar/ModuleMenuSidebar.js +131 -159
  32. package/dist/components/form/AutoComplete.js +28 -6
  33. package/dist/components/form/BaseField.js +3 -3
  34. package/dist/components/form/DatePicker.js +7 -2
  35. package/dist/components/form/FieldSet.js +24 -8
  36. package/dist/components/form/Form.js +4 -3
  37. package/dist/components/form/GridField.js +13 -37
  38. package/dist/components/form/LookupField.js +23 -23
  39. package/dist/components/form/RadioGroup.js +2 -1
  40. package/dist/components/form/Section.js +4 -0
  41. package/dist/components/form/SelectItem.js +2 -3
  42. package/dist/components/form/TextField.js +6 -6
  43. package/dist/components/layout/Layout.js +24 -15
  44. package/dist/components/menu/MenuButton.js +12 -7
  45. package/dist/components/menu/MenuLink.js +6 -0
  46. package/dist/components/signatures/AgilitySignaturePanel.js +33 -14
  47. package/dist/components/signatures/DocumentContainer.css +26 -1
  48. package/dist/components/signatures/DocumentContainer.js +55 -10
  49. package/dist/components/signatures/SignatureInputProps.js +59 -9
  50. package/dist/components/signatures/SignatureTemplateDesigner.js +71 -38
  51. package/dist/event/ActionHandlers.js +7 -4
  52. package/dist/event/RouteActionHandler.js +3 -3
  53. package/dist/event/ScriptActionHandler.js +2 -2
  54. package/dist/event/ServiceCallActionHandler.js +73 -28
  55. package/dist/js/Docs.js +57 -10
  56. package/dist/view/Dashboard.js +3 -3
  57. package/package.json +10 -5
  58. package/dist/components/DocumentView.css +0 -4
@@ -4,104 +4,400 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
- var _ej2ReactRichtexteditor = require("@syncfusion/ej2-react-richtexteditor");
7
+ var _ej2ReactDocumenteditor = require("@syncfusion/ej2-react-documenteditor");
8
+ var _ej2Base = require("@syncfusion/ej2-base");
8
9
  var _react = _interopRequireWildcard(require("react"));
9
10
  var React = _react;
10
- var _DocumentTemplatePlaceholderDialog = _interopRequireDefault(require("./DocumentTemplatePlaceholderDialog"));
11
- var _mammoth = _interopRequireDefault(require("mammoth"));
12
- var _Button = _interopRequireDefault(require("@material-ui/core/Button"));
13
11
  require("./DocumentTemplateDesignerComponent.css");
12
+ var _ApplicationManager = _interopRequireDefault(require("../ApplicationManager"));
13
+ var _Form = _interopRequireDefault(require("./form/Form"));
14
+ var _EventType = _interopRequireDefault(require("../event/EventType"));
15
+ var _Observable = _interopRequireDefault(require("../event/Observable"));
16
+ var _Utils = _interopRequireDefault(require("../Utils"));
17
+ var _reactPromiseTracker = require("react-promise-tracker");
14
18
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
15
19
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
16
20
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
21
+ (0, _ej2Base.registerLicense)('ORg4AjUWIQA/Gnt2U1hhQlJBfV5AQmBIYVp/TGpJfl96cVxMZVVBJAtUQF1hTX5adkJiWHtWdXBXT2Je');
22
+ _ej2ReactDocumenteditor.DocumentEditorContainerComponent.Inject(_ej2ReactDocumenteditor.Toolbar);
17
23
  const DocumentTemplateDesignerComponent = props => {
18
24
  const {
19
25
  contractTemplate,
20
26
  uploadTrigger,
21
27
  valueChangeHandler,
22
- addDocumentMetaDataHandler
28
+ addDocumentMetaDataHandler,
29
+ value
23
30
  } = props;
24
- const [open, setOpen] = React.useState(false);
25
- const [error, setError] = React.useState(null);
26
- const [documentLoaded, setDocumentLoaded] = React.useState(false);
27
- const fileInputRef = (0, _react.useRef)(null);
31
+ const [container, setContainer] = React.useState(null);
32
+ const model = React.useRef({});
33
+ const [doc, setDoc] = React.useState(null);
34
+ const [file, setFile] = React.useState(null);
35
+ const [contentState] = React.useState({
36
+ changed: false
37
+ });
28
38
  const btnRef = (0, _react.useRef)(null);
29
- let rteObj;
30
- let items = ['Bold', 'Italic', 'Underline', '|', 'Formats', '|', 'CreateLink', '|', {
31
- template: '' + '<button class="e-tbar-btn e-btn" tabindex="-1" id="custom_tbar" style="width:100%"><div class="e-tbar-btn-text" style="font-weight: normal; font-size: inherit;"> Placeholders</div></button>',
32
- undo: true,
33
- click: onClick.bind(void 0),
34
- tooltipText: 'Insert Placeholders'
35
- }, '|', 'Undo', 'Redo'];
36
- let toolbarSettings = {
37
- items: items
39
+ const currentVal = (0, _react.useRef)(null);
40
+ const propertiesFormHandle = React.useRef({});
41
+ const onToolbarClick = args => {
42
+ switch (args.item.id) {
43
+ case "Custom":
44
+ break;
45
+ default:
46
+ break;
47
+ }
38
48
  };
39
- function onInsert(holder) {
40
- rteObj.executeCommand('insertText', holder);
41
- }
42
- function onClick() {
43
- setOpen(true);
49
+ const onWrapText = text => {
50
+ let content = '';
51
+ const index = text.lastIndexOf(' ');
52
+ if (index !== -1) {
53
+ content = text.slice(0, index) + "<div class='e-de-text-wrap'>" + text.slice(index + 1) + "</div>";
54
+ } else {
55
+ content = text;
56
+ }
57
+ return content;
58
+ };
59
+ const findNext = () => {
60
+ container.documentEditor.search.searchResults.index = container.documentEditor.search.searchResults.index + 1;
61
+ };
62
+ const findPrev = () => {
63
+ container.documentEditor.search.searchResults.index = container.documentEditor.search.searchResults.index - 1;
64
+ };
65
+ let next = {
66
+ prefixIcon: "e-chevron-down",
67
+ click: findNext.bind(void 0),
68
+ tooltipText: 'Next placeholder',
69
+ text: '',
70
+ id: "NextPlaceHolder"
71
+ };
72
+ let previous = {
73
+ prefixIcon: "e-chevron-up",
74
+ click: findPrev.bind(void 0),
75
+ tooltipText: 'Previous placeholder',
76
+ text: '',
77
+ id: "PrevPlaceHolder"
78
+ };
79
+ let apply = {
80
+ prefixIcon: "e-icons e-save",
81
+ click: applyChanges.bind(void 0),
82
+ tooltipText: 'Previous placeholder',
83
+ text: 'Apply',
84
+ id: "PrevPlaceHolder"
85
+ };
86
+ let items = ["Open", apply, "Undo", "Redo", "Separator", {
87
+ tooltipText: 'Bold',
88
+ prefixIcon: 'e-icons e-bold',
89
+ command: 'Bold'
90
+ }, {
91
+ tooltipText: 'Italic',
92
+ prefixIcon: 'e-icons e-italic',
93
+ command: 'Italic'
94
+ }, "Separator", "Image", "Table", "Separator", "Header", "Footer", "PageSetup", "PageNumber", "InsertFootnote", "Separator", "Find"];
95
+ let searchHighlightColor = {
96
+ searchHighlightColor: 'Red'
97
+ };
98
+ const saveDoc = () => {
99
+ return new Promise((accept, reject) => {
100
+ if (container && container.documentEditor) {
101
+ container.documentEditor.saveAsBlob('Docx').then(blob => {
102
+ accept(blob);
103
+ }).catch(e => {
104
+ console.error("Error saving document");
105
+ reject(e);
106
+ });
107
+ }
108
+ });
109
+ };
110
+ const onContentChange = () => {
111
+ contentState.changed = true;
112
+ };
113
+ (0, _react.useEffect)(() => {
114
+ if (uploadTrigger != null && btnRef.current) {
115
+ btnRef.current.click();
116
+ }
117
+ }, [uploadTrigger]);
118
+ (0, _react.useEffect)(() => {
119
+ if (value) {
120
+ let i = 0;
121
+ for (const property of value.properties) {
122
+ property.id = i++;
123
+ }
124
+ propertiesFormHandle.current.api.model = {
125
+ properties: value.properties
126
+ };
127
+ if (value.file && value.file.url) {
128
+ let tokens = value.file.url.split(';base64,');
129
+ let type = tokens[0].replace("data:", "");
130
+ let base64 = tokens[1];
131
+ const arrayBuffer = _Utils.default.base64ToArrayBuffer(base64);
132
+ const file = new Blob([arrayBuffer], {
133
+ type
134
+ });
135
+ const formData = new FormData();
136
+ formData.append('files', file, 'document.docx');
137
+ (0, _reactPromiseTracker.trackPromise)(fetch('https://ej2services.syncfusion.com/production/web-services/api/documenteditor/Import', {
138
+ method: 'POST',
139
+ body: formData
140
+ }).then(response => {
141
+ (0, _reactPromiseTracker.trackPromise)(response.json().then(json => {
142
+ container.documentEditor.open(json);
143
+ }));
144
+ }));
145
+ }
146
+ }
147
+ }, [value]);
148
+ const getFooterText = () => {
149
+ container.documentEditor.selection.goToFooter();
150
+ container.documentEditor.selection.selectAll();
151
+ let footerText = container.documentEditor.selection.getText();
152
+ container.documentEditor.selection.closeHeaderFooter();
153
+ container.documentEditor.selection.clear();
154
+ return footerText;
155
+ };
156
+ function applyChanges() {
157
+ setup();
44
158
  }
45
- const handleFileChange = async event => {
46
- const file = event.target.files[0];
47
- setError(null);
48
- if (file) {
49
- if (file.type === 'application/vnd.openxmlformats-officedocument.wordprocessingml.document') {
50
- const reader = new FileReader();
51
- reader.onload = async e => {
52
- const arrayBuffer = e.target.result;
53
- try {
54
- const {
55
- value
56
- } = await _mammoth.default.convertToHtml({
57
- arrayBuffer
159
+ function setup() {
160
+ let initialFormValue = {
161
+ properties: []
162
+ };
163
+ if (container) {
164
+ container.documentEditor.selection.selectAll();
165
+ const text = container.documentEditor.selection.getText();
166
+ container.documentEditor.selection.clear();
167
+ const bodyMatches = removeNextLineCharsFromPlaceholders(text, '<<', '>>');
168
+ const footerText = getFooterText();
169
+ let footerMatches = removeNextLineCharsFromPlaceholders(footerText, '<<', '>>');
170
+ const matches = bodyMatches.concat(footerMatches);
171
+
172
+ //container.documentEditor.editor.enforceProtection('password', 'CommentsOnly');
173
+ //container.documentEditor.search.findAll(/<<[\s\S]*?>>/g);
174
+
175
+ matches.forEach(match => {
176
+ let prop = model.current.properties.find(p => p.placeHolder === match.text);
177
+ if (!prop) {
178
+ prop = {
179
+ placeHolder: match.text
180
+ };
181
+ }
182
+ if (!initialFormValue.properties.find(p => p.placeHolder === match.text)) {
183
+ initialFormValue.properties.push(prop);
184
+ }
185
+ });
186
+ let i = 0;
187
+ for (const property of initialFormValue.properties) {
188
+ property.id = i++;
189
+ }
190
+
191
+ //console.log("\n\n\n\n\n\nINITITIAL VALUES : ", initialFormValue);
192
+ propertiesFormHandle.current.api.model = initialFormValue;
193
+ saveDoc().then(blob => {
194
+ const newFile = new File([blob], props.documentName, {
195
+ type: blob.type
196
+ });
197
+ setFile(newFile);
198
+ if (contentState.changed) {
199
+ if (!initialFormValue) {
200
+ valueChangeHandler(null);
201
+ } else {
202
+ valueChangeHandler({
203
+ properties: initialFormValue.properties,
204
+ file: newFile
58
205
  });
59
- rteObj.executeCommand('insertHTML', value);
60
- addDocumentMetaDataHandler(file, value);
61
- } catch (error) {
62
- setError('Error processing the file. Please ensure it is a valid .docx file.');
63
206
  }
64
- };
65
- reader.readAsArrayBuffer(file);
66
- } else {
67
- setError('Unsupported file type. Please upload a .docx file.');
207
+ }
208
+ contentState.changed = false;
209
+ });
210
+ }
211
+ }
212
+ (0, _react.useEffect)(() => {
213
+ setup();
214
+ }, [doc]);
215
+ const validateProps = properties => {
216
+ let valid = properties && properties.length > 0;
217
+ if (valid) {
218
+ for (const property of properties) {
219
+ if (!property.valueField) {
220
+ valid = false;
221
+ break;
222
+ }
68
223
  }
69
224
  }
225
+ return valid;
70
226
  };
227
+ const removeNextLineCharsFromPlaceholders = (text, startTag, endTag) => {
228
+ const matches = [];
229
+ let index = 0;
230
+ while (index < text.length) {
231
+ const startIndex = text.indexOf(startTag, index);
232
+ if (startIndex === -1) break;
233
+ const endIndex = text.indexOf(endTag, startIndex + startTag.length);
234
+ if (endIndex === -1) break;
235
+ let find = text.substring(startIndex, endIndex + endTag.length);
236
+ let split = find.split("\r");
237
+ if (split.length > 1) {
238
+ container.documentEditor.search.find(split[0]);
239
+ let startPosition = container.documentEditor.search.searchResults.searchModule.textSearchResults.innerList[0].startIn;
240
+ container.documentEditor.search.find(split[split.length - 1]);
241
+ let endPosition = container.documentEditor.search.searchResults.searchModule.textSearchResults.innerList[0].endIn;
242
+ let selection = container.documentEditor.selection;
243
+ selection.selectRange(startPosition, endPosition);
244
+ if (selection && selection.start && selection.end) {
245
+ let selectedText = selection.getText();
246
+ container.documentEditor.editor.delete();
247
+ container.documentEditor.editor.insertText(selectedText.replace(/(\r\n|\n|\r)/gm, ""));
248
+ } else {
249
+ console.error("No valid selection found");
250
+ }
251
+ }
252
+ matches.push({
253
+ start: startIndex,
254
+ end: endIndex + endTag.length,
255
+ text: find.replace(/(\r\n|\n|\r)/gm, "")
256
+ });
257
+ index = endIndex + endTag.length;
258
+ }
259
+ return matches;
260
+ };
261
+ function setupContainer() {
262
+ container.documentEditor.currentUser = _ApplicationManager.default.getUserDetails().name + " " + _ApplicationManager.default.getUserDetails().surname;
263
+ }
71
264
  (0, _react.useEffect)(() => {
72
- if (uploadTrigger != null && btnRef.current) {
73
- btnRef.current.click();
265
+ if (container) {
266
+ setupContainer();
267
+ //autoSave();
74
268
  }
75
- }, [uploadTrigger]);
76
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(_Button.default, {
269
+ }, [container]);
270
+ (0, _react.useEffect)(() => {
271
+ props.handle.api = api();
272
+ });
273
+ (0, _react.useEffect)(() => {
274
+ props.handle.api = api();
275
+ let eventHandlingConfig = {};
276
+ let defaultAction = {
277
+ actionType: 'script',
278
+ script: {
279
+ lines: [`@#{this}.highlightSelection($event.data)`]
280
+ }
281
+ };
282
+ eventHandlingConfig.subscriptions = [];
283
+ let subscription = {
284
+ publisher: 'propertiesGrid',
285
+ eventType: _EventType.default.SELECTION_CHANGE,
286
+ actions: [defaultAction]
287
+ };
288
+ eventHandlingConfig.subscriptions.push(subscription);
289
+ _Observable.default.addSubscriptions(_Utils.default.parseConfig({
290
+ id: props.id + "DocTemplateDesigner",
291
+ eventHandlingConfig
292
+ }, props.viewId).eventHandlingConfig, props.handle, props.viewId);
293
+ return () => {
294
+ _Observable.default.clearComponentEventListeners(props.handle);
295
+ };
296
+ }, []);
297
+ const doHighlightSelection = selectedPropertyRows => {
298
+ if (container && selectedPropertyRows && selectedPropertyRows.length > 0) {
299
+ container.documentEditor.selection.clear();
300
+ container.documentEditor.search.find(selectedPropertyRows[0].placeHolder);
301
+ }
302
+ };
303
+ const api = () => {
304
+ return {
305
+ get id() {
306
+ return props.id + "DocTemplateDesigner";
307
+ },
308
+ highlightSelection: selectedPropertyRow => {
309
+ doHighlightSelection(selectedPropertyRow);
310
+ }
311
+ };
312
+ };
313
+ return /*#__PURE__*/React.createElement("div", {
314
+ className: 'row no-margin no-padding',
77
315
  style: {
78
- display: 'none'
79
- },
80
- ref: btnRef,
81
- variant: "contained",
82
- component: "label"
83
- }, "Load Contract", /*#__PURE__*/React.createElement("input", {
84
- type: "file",
316
+ height: "100%"
317
+ }
318
+ }, /*#__PURE__*/React.createElement("div", {
85
319
  style: {
86
- display: 'none'
87
- },
88
- onChange: handleFileChange,
89
- accept: ".docx"
90
- })), /*#__PURE__*/React.createElement(_ej2ReactRichtexteditor.RichTextEditorComponent, {
91
- id: "defaultRTE",
320
+ width: "40%",
321
+ overflow: "auto",
322
+ minHeight: "250px",
323
+ height: "100%",
324
+ border: "1px solid #e1e1e1",
325
+ borderRadius: '4px',
326
+ marginRight: "4px"
327
+ }
328
+ }, /*#__PURE__*/React.createElement("div", {
329
+ style: {
330
+ width: "100%",
331
+ fontSize: "12px",
332
+ backgroundColor: "#fafafa",
333
+ padding: "8px",
334
+ height: "77px",
335
+ color: "rgba(0, 0, 0, 0.87)",
336
+ borderBottom: "#f1f1f1",
337
+ display: "flex",
338
+ alignItems: "center"
339
+ }
340
+ }, "Properties"), /*#__PURE__*/React.createElement("div", {
341
+ style: {
342
+ width: "100%",
343
+ marginTop: "4px",
344
+ padding: "0 8px"
345
+ }
346
+ }, /*#__PURE__*/React.createElement(_Form.default, {
347
+ config: props.propertiesFormConfig,
348
+ handle: propertiesFormHandle.current,
349
+ valueChangeHandler: React.useCallback(val => {
350
+ model.current = val;
351
+ let newVal = validateProps(val.properties) ? val : null;
352
+ if (JSON.stringify(currentVal.current) !== JSON.stringify(newVal?.properties)) {
353
+ if (newVal) {
354
+ valueChangeHandler({
355
+ properties: val.properties,
356
+ file
357
+ });
358
+ currentVal.current = val.properties;
359
+ } else {
360
+ if (currentVal.current) {
361
+ currentVal.current = null;
362
+ valueChangeHandler(null);
363
+ }
364
+ }
365
+ }
366
+ }, [file]),
367
+ viewId: props.viewId,
368
+ className: 'defaultForm'
369
+ }))), props.visible && /*#__PURE__*/React.createElement("div", {
370
+ className: 'col no-margin no-padding',
371
+ style: {
372
+ maxWidth: 'calc(60% - 16px)',
373
+ height: '100%'
374
+ }
375
+ }, /*#__PURE__*/React.createElement(_ej2ReactDocumenteditor.DocumentEditorContainerComponent, {
376
+ id: "container",
377
+ height: '590px',
92
378
  ref: scope => {
93
- rteObj = scope;
379
+ setContainer(scope);
94
380
  },
95
- toolbarSettings: toolbarSettings,
96
- change: args => {
97
- valueChangeHandler(args.value);
381
+ created: () => {
382
+ if (container) {
383
+ container.resize();
384
+ container.documentEditor.resize();
385
+ }
386
+ },
387
+ documentChange: doc => {
388
+ if (container) {
389
+ setupContainer();
390
+ }
391
+ setDoc(doc);
98
392
  }
99
- }, /*#__PURE__*/React.createElement(_ej2ReactRichtexteditor.Inject, {
100
- services: [_ej2ReactRichtexteditor.HtmlEditor, _ej2ReactRichtexteditor.Toolbar, _ej2ReactRichtexteditor.Link, _ej2ReactRichtexteditor.Image, _ej2ReactRichtexteditor.QuickToolbar]
101
- })), /*#__PURE__*/React.createElement(_DocumentTemplatePlaceholderDialog.default, {
102
- open: open,
103
- onClose: () => setOpen(false),
104
- onInsertHandler: onInsert
105
- }));
393
+ //documentEditorSettings={searchHighlightColor}
394
+ ,
395
+ showPropertiesPane: false,
396
+ toolbarItems: items,
397
+ toolbarClick: onToolbarClick,
398
+ contentChange: onContentChange,
399
+ serviceUrl: "https://services.syncfusion.com/react/production/api/documenteditor/",
400
+ enableToolbar: true
401
+ })));
106
402
  };
107
403
  var _default = exports.default = DocumentTemplateDesignerComponent;
@@ -19,16 +19,16 @@ const DocumentTemplatePlaceholderDialog = _ref => {
19
19
  const [selectedIndex, setSelectedIndex] = (0, _react.useState)(null);
20
20
  const placeholders = [{
21
21
  title: 'Placeholder 1',
22
- description: '{{placeholder_1}}'
22
+ value: '{{placeholder_1}}'
23
23
  }, {
24
24
  title: 'Placeholder 2',
25
- description: '{{placeholder_2}}'
25
+ value: '{{placeholder_2}}'
26
26
  }, {
27
27
  title: 'Placeholder 3',
28
- description: '{{placeholder_3}}'
28
+ value: '{{placeholder_3}}'
29
29
  }, {
30
30
  title: 'Placeholder 4',
31
- description: '{{placeholder_4}}'
31
+ value: '{{placeholder_4}}'
32
32
  }];
33
33
  const {
34
34
  palette
@@ -39,7 +39,7 @@ const DocumentTemplatePlaceholderDialog = _ref => {
39
39
  const handleInsert = () => {
40
40
  if (selectedIndex !== null) {
41
41
  console.log(`Selected placeholder: ${placeholders[selectedIndex].title}`);
42
- onInsertHandler(placeholders[selectedIndex].description);
42
+ onInsertHandler(placeholders[selectedIndex]);
43
43
  }
44
44
  onClose();
45
45
  };
@@ -65,7 +65,7 @@ const DocumentTemplatePlaceholderDialog = _ref => {
65
65
  }
66
66
  }, /*#__PURE__*/_react.default.createElement(_core.ListItemAvatar, null, /*#__PURE__*/_react.default.createElement(_core.Avatar, null, /*#__PURE__*/_react.default.createElement(_icons.AddCircle, null))), /*#__PURE__*/_react.default.createElement(_core.ListItemText, {
67
67
  primary: placeholder.title,
68
- secondary: placeholder.description
68
+ secondary: ''
69
69
  })), index < placeholders.length - 1 && /*#__PURE__*/_react.default.createElement(_core.Divider, null)))))), /*#__PURE__*/_react.default.createElement(_core.DialogActions, null, /*#__PURE__*/_react.default.createElement(_core.Button, {
70
70
  onClick: onClose,
71
71
  color: "primary"
@@ -0,0 +1,10 @@
1
+ .react-pdf__Page__canvas {
2
+ margin: 0 auto;
3
+ height: auto !important;
4
+ }
5
+
6
+ .custom-toolbar-button {
7
+ width: 200px; /* Set your desired width */
8
+ height: 30px; /* Set your desired height */
9
+ font-size: 14px; /* Adjust the font size if needed */
10
+ }