@agilemotion/oui-react-js 1.8.60 → 1.8.62
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/components/DataGrid.css +1 -0
- package/dist/components/DataGridFilter.js +48 -42
- package/dist/components/DocumentTemplateDesignerComponent.js +3 -2
- package/dist/components/DocumentViewer.js +12 -2
- package/dist/components/PDFDesignerComponent.js +230 -0
- package/dist/components/TemplateDesigner.js +1 -1
- package/dist/components/form/SelectItem.js +5 -3
- package/package.json +3 -1
|
@@ -28,7 +28,6 @@ const DataGridFilter = /*#__PURE__*/_react.default.memo(/*#__PURE__*/_react.defa
|
|
|
28
28
|
props.handle.api = api();
|
|
29
29
|
});
|
|
30
30
|
_react.default.useEffect(() => {
|
|
31
|
-
console.log('DATA GRID FILTER RENDERED');
|
|
32
31
|
if (!_Utils.default.isNull(props.config)) {
|
|
33
32
|
let visibleCols = 0;
|
|
34
33
|
for (const column of config.columns) {
|
|
@@ -230,54 +229,61 @@ const DataGridFilter = /*#__PURE__*/_react.default.memo(/*#__PURE__*/_react.defa
|
|
|
230
229
|
}, /*#__PURE__*/_react.default.createElement(_Search.default, null)))) : !_Utils.default.isNull(numVisibleCols) ? /*#__PURE__*/_react.default.createElement(_reactSuperResponsiveTable.Tr, {
|
|
231
230
|
style: {
|
|
232
231
|
display: 'flex',
|
|
233
|
-
flexWrap: 'wrap'
|
|
232
|
+
flexWrap: 'wrap',
|
|
233
|
+
borderBottom: '1px solid #e1e1e1'
|
|
234
234
|
}
|
|
235
235
|
}, props.config.selectionMode === 'MULTIPLE' ? /*#__PURE__*/_react.default.createElement(_reactSuperResponsiveTable.Th, {
|
|
236
236
|
padding: "checkbox",
|
|
237
237
|
width: _DataGrid.MULTI_SELECT_CHECKBOX_COL_WIDTH + 'px',
|
|
238
238
|
className: "selectCell"
|
|
239
|
-
}) : null, props.config.columns.map(column =>
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
className: (!_Utils.default.isNull(props.filterWrapperClass) ? props.filterWrapperClass : 'filterWraper') + ' row no-margin no-padding'
|
|
247
|
-
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
248
|
-
className: 'col no-margin no-padding'
|
|
249
|
-
}, /*#__PURE__*/_react.default.createElement(_Form.default, {
|
|
250
|
-
config: createFormConfig(column, column.id),
|
|
251
|
-
handle: createFormHandle(),
|
|
252
|
-
ref: /*#__PURE__*/_react.default.createRef(),
|
|
253
|
-
viewId: props.viewId,
|
|
254
|
-
keyHandler: e => {
|
|
255
|
-
if (e.key === 'Enter') {
|
|
256
|
-
submitFilter();
|
|
239
|
+
}) : null, props.config.columns.map(column => {
|
|
240
|
+
var _column$attributes;
|
|
241
|
+
return /*#__PURE__*/_react.default.createElement(_reactSuperResponsiveTable.Th, {
|
|
242
|
+
key: column.id,
|
|
243
|
+
padding: 'default',
|
|
244
|
+
style: {
|
|
245
|
+
width: column === null || column === void 0 || (_column$attributes = column.attributes) === null || _column$attributes === void 0 ? void 0 : _column$attributes.width
|
|
257
246
|
}
|
|
258
|
-
},
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
model[id] = null;
|
|
265
|
-
fieldValidity[id] = false;
|
|
247
|
+
}, !_Utils.default.evaluateBooleanExpression(column.attributes['hidden'], props.config.id) ? column.attributes['filterable'] === true ? /*#__PURE__*/_react.default.createElement("div", {
|
|
248
|
+
className: (!_Utils.default.isNull(props.filterWrapperClass) ? props.filterWrapperClass : 'filterWraper') + ' row no-margin no-padding'
|
|
249
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
250
|
+
className: 'col no-margin no-padding',
|
|
251
|
+
style: {
|
|
252
|
+
width: 'calc(100% - 52px)'
|
|
266
253
|
}
|
|
267
|
-
}
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
254
|
+
}, /*#__PURE__*/_react.default.createElement(_Form.default, {
|
|
255
|
+
config: createFormConfig(column, column.id),
|
|
256
|
+
handle: createFormHandle(),
|
|
257
|
+
ref: /*#__PURE__*/_react.default.createRef(),
|
|
258
|
+
viewId: props.viewId,
|
|
259
|
+
keyHandler: e => {
|
|
260
|
+
if (e.key === 'Enter') {
|
|
261
|
+
submitFilter();
|
|
262
|
+
}
|
|
263
|
+
},
|
|
264
|
+
valueChangeHandler: (values, id, newValue) => {
|
|
265
|
+
if (!_Utils.default.isNull(values)) {
|
|
266
|
+
model[id] = newValue;
|
|
267
|
+
fieldValidity[id] = true;
|
|
268
|
+
} else {
|
|
269
|
+
model[id] = null;
|
|
270
|
+
fieldValidity[id] = false;
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
})), ++columnCounter === numVisibleCols && /*#__PURE__*/_react.default.createElement("div", {
|
|
274
|
+
className: 'col-*-*',
|
|
275
|
+
style: {
|
|
276
|
+
width: '52px',
|
|
277
|
+
marginTop: "4px"
|
|
278
|
+
}
|
|
279
|
+
}, /*#__PURE__*/_react.default.createElement(_IconButton.default, {
|
|
280
|
+
onClick: submitFilter
|
|
281
|
+
}, /*#__PURE__*/_react.default.createElement(_Search.default, null)))) : /*#__PURE__*/_react.default.createElement("div", {
|
|
282
|
+
className: "filterWraperBlank"
|
|
283
|
+
}, ++columnCounter === numVisibleCols && /*#__PURE__*/_react.default.createElement(_IconButton.default, {
|
|
284
|
+
onClick: submitFilter
|
|
285
|
+
}, /*#__PURE__*/_react.default.createElement(_Search.default, null))) : null);
|
|
286
|
+
})) : null;
|
|
281
287
|
}));
|
|
282
288
|
function arePropsEqual(prev, next) {
|
|
283
289
|
return prev.config === next.config && prev.scrollWidth === next.scrollWidth;
|
|
@@ -64,8 +64,7 @@ const DocumentTemplateDesignerComponent = props => {
|
|
|
64
64
|
overflow: "hidden",
|
|
65
65
|
minHeight: "250px",
|
|
66
66
|
height: "100%",
|
|
67
|
-
borderRadius: '4px'
|
|
68
|
-
padding: "0 16px"
|
|
67
|
+
borderRadius: '4px'
|
|
69
68
|
}
|
|
70
69
|
}, /*#__PURE__*/React.createElement("div", {
|
|
71
70
|
style: {
|
|
@@ -90,6 +89,8 @@ const DocumentTemplateDesignerComponent = props => {
|
|
|
90
89
|
config: props.templateViewer,
|
|
91
90
|
handle: templateDesignerComponentHandle,
|
|
92
91
|
viewId: props.viewId,
|
|
92
|
+
enableUpload: true,
|
|
93
|
+
designMode: true,
|
|
93
94
|
onValueChange: file => props.valueChangeHandler(_objectSpread(_objectSpread({}, propertiesComponentHandle.api.value), {}, {
|
|
94
95
|
file: file
|
|
95
96
|
}))
|
|
@@ -16,6 +16,7 @@ var _PDFViewer = _interopRequireDefault(require("./PDFViewer"));
|
|
|
16
16
|
var _WordDocumentViewer = _interopRequireDefault(require("./WordDocumentViewer"));
|
|
17
17
|
var _Event = _interopRequireDefault(require("../event/Event"));
|
|
18
18
|
var _EventType = _interopRequireDefault(require("../event/EventType"));
|
|
19
|
+
var _PDFDesignerComponent = _interopRequireDefault(require("./PDFDesignerComponent"));
|
|
19
20
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
20
21
|
const DocumentViewer = /*#__PURE__*/_react.default.memo(/*#__PURE__*/_react.default.forwardRef((props, ref) => {
|
|
21
22
|
var _props$config$attribu2, _props$config$attribu3, _parsedConfig$attribu;
|
|
@@ -141,7 +142,11 @@ const DocumentViewer = /*#__PURE__*/_react.default.memo(/*#__PURE__*/_react.defa
|
|
|
141
142
|
* @#{this}.insertReadonlyAnchor(...)
|
|
142
143
|
*/
|
|
143
144
|
insertReadonlyAnchor: (value, dropPosition) => {
|
|
144
|
-
|
|
145
|
+
if (_Utils.default.prop(parsedConfig.fileType) === 'application/pdf') {
|
|
146
|
+
alert('Anchor insertion is not yet supported for PDF files');
|
|
147
|
+
} else {
|
|
148
|
+
wordEditorValueHandler.api.insertReadonlyAnchor(value, dropPosition);
|
|
149
|
+
}
|
|
145
150
|
}
|
|
146
151
|
};
|
|
147
152
|
};
|
|
@@ -162,9 +167,14 @@ const DocumentViewer = /*#__PURE__*/_react.default.memo(/*#__PURE__*/_react.defa
|
|
|
162
167
|
marginTop: '16px',
|
|
163
168
|
color: 'red'
|
|
164
169
|
}
|
|
165
|
-
}, "Error loading document"), !loading && !hasLoadingError && _Utils.default.prop(parsedConfig.fileType) === 'application/pdf' && !_Utils.default.isNull(value) && /*#__PURE__*/_react.default.createElement(_PDFViewer.default, {
|
|
170
|
+
}, "Error loading document"), !loading && !hasLoadingError && _Utils.default.prop(parsedConfig.fileType) === 'application/pdf' && !props.designMode && !_Utils.default.isNull(value) && /*#__PURE__*/_react.default.createElement(_PDFViewer.default, {
|
|
166
171
|
file: value,
|
|
167
172
|
onDocumentLoadSuccess: () => {}
|
|
173
|
+
}), !loading && !hasLoadingError && _Utils.default.prop(parsedConfig.fileType) === 'application/pdf' && props.designMode && /*#__PURE__*/_react.default.createElement(_PDFDesignerComponent.default, {
|
|
174
|
+
file: value,
|
|
175
|
+
onDocumentLoadSuccess: () => {},
|
|
176
|
+
valueHandler: () => {},
|
|
177
|
+
valueChangeHandler: file => {}
|
|
168
178
|
}), !loading && !hasLoadingError && _Utils.default.prop(parsedConfig.fileType) === 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' && (!_Utils.default.isNull(value) || props.config.enableUpload) && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_WordDocumentViewer.default, {
|
|
169
179
|
file: value,
|
|
170
180
|
onDocumentLoadSuccess: () => {},
|
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _reactPdf = require("react-pdf");
|
|
9
|
+
var _reactRnd = require("react-rnd");
|
|
10
|
+
var _uuid = require("uuid");
|
|
11
|
+
var _Button = _interopRequireDefault(require("@mui/material/Button"));
|
|
12
|
+
var _Icon = _interopRequireDefault(require("./Icon"));
|
|
13
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
14
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
15
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
16
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
17
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
18
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
19
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
20
|
+
_reactPdf.pdfjs.GlobalWorkerOptions.workerSrc = "//cdnjs.cloudflare.com/ajax/libs/pdf.js/".concat(_reactPdf.pdfjs.version, "/pdf.worker.js");
|
|
21
|
+
const PDFDesignerComponent = props => {
|
|
22
|
+
const [file, setFile] = (0, _react.useState)(props.file);
|
|
23
|
+
const [pageNumber, setPageNumber] = (0, _react.useState)(1);
|
|
24
|
+
const [numPages, setNumPages] = (0, _react.useState)(null);
|
|
25
|
+
const [placeholders, setPlaceholders] = (0, _react.useState)([]);
|
|
26
|
+
const pageRef = (0, _react.useRef)(null);
|
|
27
|
+
const fileInputRef = (0, _react.useRef)(null);
|
|
28
|
+
|
|
29
|
+
// ===================================
|
|
30
|
+
// Upload Handling (PDF Only)
|
|
31
|
+
// ===================================
|
|
32
|
+
const handleUploadClick = () => {
|
|
33
|
+
var _fileInputRef$current;
|
|
34
|
+
(_fileInputRef$current = fileInputRef.current) === null || _fileInputRef$current === void 0 || _fileInputRef$current.click();
|
|
35
|
+
};
|
|
36
|
+
const handleFileChange = event => {
|
|
37
|
+
const selectedFile = event.target.files[0];
|
|
38
|
+
if (!selectedFile) return;
|
|
39
|
+
if (selectedFile.type !== "application/pdf") {
|
|
40
|
+
alert("Please upload PDF only.");
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
const reader = new FileReader();
|
|
44
|
+
reader.onload = e => {
|
|
45
|
+
const base64 = e.target.result.split(",")[1];
|
|
46
|
+
const fileObject = {
|
|
47
|
+
type: selectedFile.type,
|
|
48
|
+
base64,
|
|
49
|
+
name: selectedFile.name
|
|
50
|
+
};
|
|
51
|
+
setFile(fileObject);
|
|
52
|
+
setPageNumber(1);
|
|
53
|
+
if (props.onFileUpload) {
|
|
54
|
+
props.onFileUpload(fileObject);
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
reader.readAsDataURL(selectedFile);
|
|
58
|
+
};
|
|
59
|
+
(0, _react.useEffect)(() => {
|
|
60
|
+
setFile(props.file);
|
|
61
|
+
}, [props.file]);
|
|
62
|
+
|
|
63
|
+
// ===================================
|
|
64
|
+
// Syncfusion-style API Exposure
|
|
65
|
+
// ===================================
|
|
66
|
+
const api = () => ({
|
|
67
|
+
getValue: () => generateJSON(),
|
|
68
|
+
insertReadonlyAnchor: (value, dropPosition) => {
|
|
69
|
+
insertPlaceholder(value, dropPosition);
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
(0, _react.useEffect)(() => {
|
|
73
|
+
props.valueHandler.api = api();
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
// ===================================
|
|
77
|
+
// PDF Load
|
|
78
|
+
// ===================================
|
|
79
|
+
const onDocumentLoadSuccess = _ref => {
|
|
80
|
+
let {
|
|
81
|
+
numPages
|
|
82
|
+
} = _ref;
|
|
83
|
+
setNumPages(numPages);
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
// ===================================
|
|
87
|
+
// Insert Placeholder
|
|
88
|
+
// ===================================
|
|
89
|
+
const insertPlaceholder = (variable, dropPosition) => {
|
|
90
|
+
if (!pageRef.current) return;
|
|
91
|
+
const rect = pageRef.current.getBoundingClientRect();
|
|
92
|
+
if (dropPosition.x < rect.left || dropPosition.x > rect.right || dropPosition.y < rect.top || dropPosition.y > rect.bottom) {
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
const relativeX = dropPosition.x - rect.left;
|
|
96
|
+
const relativeY = dropPosition.y - rect.top;
|
|
97
|
+
const newPlaceholder = {
|
|
98
|
+
id: (0, _uuid.v4)(),
|
|
99
|
+
variable,
|
|
100
|
+
page: pageNumber,
|
|
101
|
+
left: relativeX / rect.width,
|
|
102
|
+
top: relativeY / rect.height,
|
|
103
|
+
fontSize: 12,
|
|
104
|
+
fontWeight: "bold",
|
|
105
|
+
textAlign: "center"
|
|
106
|
+
};
|
|
107
|
+
setPlaceholders(prev => [...prev, newPlaceholder]);
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
// ===================================
|
|
111
|
+
// Update Position After Drag
|
|
112
|
+
// ===================================
|
|
113
|
+
const updatePosition = (id, x, y) => {
|
|
114
|
+
const rect = pageRef.current.getBoundingClientRect();
|
|
115
|
+
setPlaceholders(prev => prev.map(p => p.id === id ? _objectSpread(_objectSpread({}, p), {}, {
|
|
116
|
+
left: x / rect.width,
|
|
117
|
+
top: y / rect.height
|
|
118
|
+
}) : p));
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
// ===================================
|
|
122
|
+
// JSON Output
|
|
123
|
+
// ===================================
|
|
124
|
+
const generateJSON = () => {
|
|
125
|
+
var _pageRef$current, _pageRef$current2;
|
|
126
|
+
return {
|
|
127
|
+
templateType: props.templateType,
|
|
128
|
+
pageSize: {
|
|
129
|
+
width: (_pageRef$current = pageRef.current) === null || _pageRef$current === void 0 ? void 0 : _pageRef$current.offsetWidth,
|
|
130
|
+
height: (_pageRef$current2 = pageRef.current) === null || _pageRef$current2 === void 0 ? void 0 : _pageRef$current2.offsetHeight
|
|
131
|
+
},
|
|
132
|
+
placeholders
|
|
133
|
+
};
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
// ===================================
|
|
137
|
+
// Render
|
|
138
|
+
// ===================================
|
|
139
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
140
|
+
style: {
|
|
141
|
+
width: "100%",
|
|
142
|
+
display: "flex",
|
|
143
|
+
flexDirection: "column",
|
|
144
|
+
border: '1px solid #e1e1e1',
|
|
145
|
+
height: "100%",
|
|
146
|
+
marginTop: "8px",
|
|
147
|
+
borderRadius: 4
|
|
148
|
+
}
|
|
149
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
150
|
+
style: {
|
|
151
|
+
marginBottom: 12,
|
|
152
|
+
width: "100%",
|
|
153
|
+
display: "flex",
|
|
154
|
+
justifyContent: "flex-start",
|
|
155
|
+
borderBottom: "1px solid #e1e1e1"
|
|
156
|
+
}
|
|
157
|
+
}, /*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
158
|
+
variant: "text",
|
|
159
|
+
size: "large",
|
|
160
|
+
onClick: handleUploadClick,
|
|
161
|
+
startIcon: /*#__PURE__*/_react.default.createElement(_Icon.default, {
|
|
162
|
+
id: 'UPLOAD'
|
|
163
|
+
})
|
|
164
|
+
}, "Upload PDF"), /*#__PURE__*/_react.default.createElement("input", {
|
|
165
|
+
type: "file",
|
|
166
|
+
accept: "application/pdf",
|
|
167
|
+
ref: fileInputRef,
|
|
168
|
+
style: {
|
|
169
|
+
display: "none"
|
|
170
|
+
},
|
|
171
|
+
onChange: handleFileChange
|
|
172
|
+
})), file && file.type === "application/pdf" && /*#__PURE__*/_react.default.createElement("div", {
|
|
173
|
+
style: {
|
|
174
|
+
position: "relative",
|
|
175
|
+
maxHeight: "calc(100vh - 32px)",
|
|
176
|
+
overflowY: "auto",
|
|
177
|
+
padding: "8px"
|
|
178
|
+
}
|
|
179
|
+
}, /*#__PURE__*/_react.default.createElement(_reactPdf.Document, {
|
|
180
|
+
file: {
|
|
181
|
+
data: atob(file.base64)
|
|
182
|
+
},
|
|
183
|
+
onLoadSuccess: onDocumentLoadSuccess
|
|
184
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
185
|
+
ref: pageRef,
|
|
186
|
+
style: {
|
|
187
|
+
position: "relative"
|
|
188
|
+
}
|
|
189
|
+
}, /*#__PURE__*/_react.default.createElement(_reactPdf.Page, {
|
|
190
|
+
pageNumber: pageNumber
|
|
191
|
+
}), placeholders.filter(p => p.page === pageNumber).map(p => {
|
|
192
|
+
var _pageRef$current3;
|
|
193
|
+
const rect = (_pageRef$current3 = pageRef.current) === null || _pageRef$current3 === void 0 ? void 0 : _pageRef$current3.getBoundingClientRect();
|
|
194
|
+
const pageWidth = (rect === null || rect === void 0 ? void 0 : rect.width) || 1;
|
|
195
|
+
const pageHeight = (rect === null || rect === void 0 ? void 0 : rect.height) || 1;
|
|
196
|
+
return /*#__PURE__*/_react.default.createElement(_reactRnd.Rnd, {
|
|
197
|
+
key: p.id,
|
|
198
|
+
size: {
|
|
199
|
+
width: 140,
|
|
200
|
+
height: 24
|
|
201
|
+
},
|
|
202
|
+
position: {
|
|
203
|
+
x: p.left * pageWidth,
|
|
204
|
+
y: p.top * pageHeight
|
|
205
|
+
},
|
|
206
|
+
bounds: "parent",
|
|
207
|
+
enableResizing: false,
|
|
208
|
+
onDragStop: (e, d) => updatePosition(p.id, d.x, d.y)
|
|
209
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
210
|
+
style: {
|
|
211
|
+
fontSize: p.fontSize,
|
|
212
|
+
fontWeight: p.fontWeight,
|
|
213
|
+
textAlign: p.textAlign,
|
|
214
|
+
border: "1px dashed #1976d2",
|
|
215
|
+
background: "rgba(25,118,210,0.08)",
|
|
216
|
+
padding: "2px 4px",
|
|
217
|
+
cursor: "move"
|
|
218
|
+
}
|
|
219
|
+
}, "${".concat(p.variable, "}")));
|
|
220
|
+
}))), /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("p", null, "Page ", pageNumber || (numPages ? 1 : "--"), " of", " ", numPages || "--"), /*#__PURE__*/_react.default.createElement("button", {
|
|
221
|
+
type: "button",
|
|
222
|
+
disabled: pageNumber <= 1,
|
|
223
|
+
onClick: () => setPageNumber(prev => prev - 1)
|
|
224
|
+
}, "Previous"), /*#__PURE__*/_react.default.createElement("button", {
|
|
225
|
+
type: "button",
|
|
226
|
+
disabled: pageNumber >= numPages,
|
|
227
|
+
onClick: () => setPageNumber(prev => prev + 1)
|
|
228
|
+
}, "Next"))));
|
|
229
|
+
};
|
|
230
|
+
var _default = exports.default = PDFDesignerComponent;
|
|
@@ -62,9 +62,11 @@ const SelectItemComponent = props => {
|
|
|
62
62
|
id: '_EMPTY_VALUE'
|
|
63
63
|
});
|
|
64
64
|
}
|
|
65
|
-
|
|
66
|
-
let
|
|
67
|
-
|
|
65
|
+
if (result && result.records) {
|
|
66
|
+
for (let i = 0; i < result.records.length; i++) {
|
|
67
|
+
let record = result.records[i];
|
|
68
|
+
options.push(record);
|
|
69
|
+
}
|
|
68
70
|
}
|
|
69
71
|
base.setSelectOptions(options);
|
|
70
72
|
}).catch(e => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agilemotion/oui-react-js",
|
|
3
|
-
"version": "1.8.
|
|
3
|
+
"version": "1.8.62",
|
|
4
4
|
"description": "AgileMotion React UI Component Library - A comprehensive collection of dashboard components, forms, media controls, and more",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"author": "",
|
|
@@ -110,6 +110,7 @@
|
|
|
110
110
|
"react-player": "^2.16.0",
|
|
111
111
|
"react-promise-tracker": "^2.1.0",
|
|
112
112
|
"react-redux": "^7.2.3",
|
|
113
|
+
"react-rnd": "^10.5.2",
|
|
113
114
|
"react-router": "^6.3.0",
|
|
114
115
|
"react-router-dom": "^6.3.0",
|
|
115
116
|
"react-router-redux": "^5.0.0-alpha.9",
|
|
@@ -122,6 +123,7 @@
|
|
|
122
123
|
"rrule": "^2.8.1",
|
|
123
124
|
"socket.io-client": "^4.7.5",
|
|
124
125
|
"styled-components": "^5.2.3",
|
|
126
|
+
"uuid": "^13.0.0",
|
|
125
127
|
"web-vitals": "^2.1.4"
|
|
126
128
|
},
|
|
127
129
|
"devDependencies": {
|