@agilemotion/oui-react-js 1.7.8 → 1.8.0

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.
@@ -336,7 +336,7 @@ class ApplicationManager {
336
336
  if (!view.popUp && !view.window) {
337
337
  let topView = this.getTopAnchorView();
338
338
  if (topView) {
339
- this.closeView(topView?.config.id);
339
+ this.closeView(topView?.config.id, forward);
340
340
  }
341
341
  } else {
342
342
  if (view.popUp) {
@@ -345,7 +345,7 @@ class ApplicationManager {
345
345
  if (view.window) {
346
346
  let topView = this.getTopWindowView();
347
347
  if (topView) {
348
- this.closeView(topView?.config.id);
348
+ this.closeView(topView?.config.id, forward);
349
349
  }
350
350
  }
351
351
  }
@@ -358,11 +358,13 @@ class ApplicationManager {
358
358
  }
359
359
  }
360
360
  }
361
- let historyElement = {};
362
- historyElement.viewId = view.config.id;
363
- historyElement.parent = view.parent;
364
- historyElement.path = path;
365
- this.navHistory.push(historyElement);
361
+ if (forward || view.parent) {
362
+ let historyElement = {};
363
+ historyElement.viewId = view.config.id;
364
+ historyElement.parent = view.parent;
365
+ historyElement.path = path;
366
+ this.navHistory.push(historyElement);
367
+ }
366
368
  this.views.push(view);
367
369
  if (view.window) {
368
370
  _Observable.default.emitContextChangeEvent(applicationContext, {
@@ -68,7 +68,11 @@ class RestService {
68
68
  }
69
69
  if (httpParameterType === 'PATH_VARIABLE') {
70
70
  if (!_Utils.default.isNull(parameterValue)) {
71
- pathParameters += '/' + (typeof parameterValue.value === 'object' ? encodeURIComponent(JSON.stringify(parameterValue.value)) : parameterValue.instanceType === 'TypedValue' ? encodeURIComponent(parameterValue.value) : encodeURIComponent(parameterValue));
71
+ if (parameter.encode) {
72
+ pathParameters += '/' + (typeof parameterValue.value === 'object' ? encodeURIComponent(JSON.stringify(parameterValue.value)) : parameterValue.instanceType === 'TypedValue' ? encodeURIComponent(parameterValue.value) : encodeURIComponent(parameterValue));
73
+ } else {
74
+ pathParameters += '/' + (typeof parameterValue.value === 'object' ? JSON.stringify(parameterValue.value) : parameterValue.instanceType === 'TypedValue' ? parameterValue.value : parameterValue);
75
+ }
72
76
  }
73
77
  }
74
78
  if (httpParameterType === 'HEADER') {
package/dist/RestUtils.js CHANGED
@@ -69,7 +69,11 @@ class RestUtils {
69
69
  }
70
70
  if (httpParameterType === 'PATH_VARIABLE') {
71
71
  if (!_Utils.default.isNull(parameterValue)) {
72
- pathParameters += '/' + (typeof parameterValue.value === 'object' ? encodeURIComponent(JSON.stringify(parameterValue.value)) : parameterValue.instanceType === 'TypedValue' ? encodeURIComponent(parameterValue.value) : encodeURIComponent(parameterValue));
72
+ if (parameter.encode) {
73
+ pathParameters += '/' + (typeof parameterValue.value === 'object' ? encodeURIComponent(JSON.stringify(parameterValue.value)) : parameterValue.instanceType === 'TypedValue' ? encodeURIComponent(parameterValue.value) : encodeURIComponent(parameterValue));
74
+ } else {
75
+ pathParameters += '/' + (typeof parameterValue.value === 'object' ? JSON.stringify(parameterValue.value) : parameterValue.instanceType === 'TypedValue' ? parameterValue.value : parameterValue);
76
+ }
73
77
  }
74
78
  }
75
79
  if (httpParameterType === 'HEADER') {
@@ -36,11 +36,6 @@ const Button = /*#__PURE__*/_react.default.forwardRef((props, ref) => {
36
36
  _react.default.useEffect(() => {
37
37
  props.handle.api = api();
38
38
  });
39
- _react.default.useEffect(() => {
40
- return () => {
41
- props.handle.api = null;
42
- };
43
- }, []);
44
39
  _react.default.useEffect(() => {
45
40
  if (config) {
46
41
  props.handle.api = api();
@@ -58,6 +53,7 @@ const Button = /*#__PURE__*/_react.default.forwardRef((props, ref) => {
58
53
  } : props.config);
59
54
  return () => {
60
55
  _Observable.default.clearComponentEventListeners(props.handle);
56
+ props.handle.api = null;
61
57
  };
62
58
  }, []);
63
59
  const handleClick = e => {
@@ -68,7 +64,7 @@ const Button = /*#__PURE__*/_react.default.forwardRef((props, ref) => {
68
64
  const api = () => {
69
65
  return {
70
66
  get id() {
71
- return config ? config.id : props.config.id;
67
+ return props.tableRow ? props.config.id + '_' + props.tableRow.id?.replaceAll('-', '') : props.config.id;
72
68
  },
73
69
  get tableRow() {
74
70
  return props.tableRow;
@@ -127,7 +127,8 @@ const DataGrid = exports.DataGrid = /*#__PURE__*/_react.default.memo( /*#__PURE_
127
127
  const [cells] = _react.default.useState([]);
128
128
  const [headingHandle] = _react.default.useState({});
129
129
  const [filterHandle] = _react.default.useState({});
130
- const [columnLayoutHandles] = _react.default.useState([]);
130
+ const [columnLayoutHandles] = _react.default.useState({});
131
+ const [editorHandles] = _react.default.useState({});
131
132
  const rowCount = _react.default.useRef(-1);
132
133
  const rowsRef = _react.default.useRef([]);
133
134
  let noteKey = 0;
@@ -185,6 +186,19 @@ const DataGrid = exports.DataGrid = /*#__PURE__*/_react.default.memo( /*#__PURE_
185
186
  }
186
187
  }
187
188
  }
189
+ properties = Object.getOwnPropertyNames(editorHandles);
190
+ for (const property of properties) {
191
+ let editorHandle = editorHandles[property];
192
+ children.push(editorHandle);
193
+ if (!_Utils.default.isNull(editorHandle.api) && !_Utils.default.isNull(editorHandle.api.getChildren)) {
194
+ let moreChildren = editorHandle.api.getChildren();
195
+ if (!_Utils.default.isNull(moreChildren)) {
196
+ for (const child of moreChildren) {
197
+ children.push(child);
198
+ }
199
+ }
200
+ }
201
+ }
188
202
  return children;
189
203
  },
190
204
  loadData: actionConfig => {
@@ -249,6 +263,13 @@ const DataGrid = exports.DataGrid = /*#__PURE__*/_react.default.memo( /*#__PURE_
249
263
  }
250
264
  };
251
265
  };
266
+ const formApi = () => {
267
+ return {
268
+ get id() {
269
+ return props.config.id + "_edit_form";
270
+ }
271
+ };
272
+ };
252
273
  function updateScrollBarPadding() {
253
274
  var tbody = document.getElementById('mainTableBody');
254
275
  if (tbody !== null && typeof tbody !== 'undefined') {
@@ -345,15 +366,20 @@ const DataGrid = exports.DataGrid = /*#__PURE__*/_react.default.memo( /*#__PURE_
345
366
  setPage(0);
346
367
  }
347
368
  const observeRow = row => {
348
- let observableRow = (0, _mobx.observable)(row);
349
- (0, _mobx.observe)(observableRow, change => {
350
- let newValue = change.newValue;
351
- let oldValue = change.oldValue;
352
- if (newValue !== oldValue) {
353
- refreshCell(row.id, change.name);
354
- }
355
- });
356
- return observableRow;
369
+ /*let observableRow = observable(row);
370
+ observe(
371
+ observableRow,
372
+ change => {
373
+ let newValue = change.newValue;
374
+ let oldValue = change.oldValue;
375
+ if (newValue !== oldValue) {
376
+ refreshCell(row.id, change.name);
377
+ }
378
+ }
379
+ );
380
+ return observableRow;*/
381
+
382
+ return row;
357
383
  };
358
384
  function processData(data, conf) {
359
385
  setTotalNumberOfRows(data.totalNumberOfRecords ? data.totalNumberOfRecords : data.records.length);
@@ -620,6 +646,14 @@ const DataGrid = exports.DataGrid = /*#__PURE__*/_react.default.memo( /*#__PURE_
620
646
  }
621
647
  return columnLayoutHandles[column.id + index];
622
648
  }
649
+ function createCellEditorHandle(column) {
650
+ if (_Utils.default.isNull(editorHandles[column.id + "_editor"])) {
651
+ let handle = {};
652
+ editorHandles[column.id + "_editor"] = handle;
653
+ return handle;
654
+ }
655
+ return editorHandles[column.id + "_editor"];
656
+ }
623
657
  return /*#__PURE__*/_react.default.createElement("div", {
624
658
  ref: ref,
625
659
  style: _Utils.default.isNull(props.hasBorder) || props.hasBorder === true ? _Utils.default.mergeStyles({
@@ -734,11 +768,12 @@ const DataGrid = exports.DataGrid = /*#__PURE__*/_react.default.memo( /*#__PURE_
734
768
  },
735
769
  align: "left",
736
770
  className: isItemSelected && !_Utils.default.isNull(props.form) && !_Utils.default.isNull(column.editor) ? 'editCell' : null,
737
- key: column.id
771
+ key: index + "_" + column.id
738
772
  }, /*#__PURE__*/_react.default.createElement(_Layout.Layout, {
739
- ref: /*#__PURE__*/_react.default.createRef(),
740
773
  handle: createColumnLayoutHandle(column, index),
741
- tableRow: row,
774
+ key: index + "_" + column.id + "_layout",
775
+ tableRow: rows.find(r => r.id === row.id),
776
+ rowIndex: index,
742
777
  config: JSON.parse(JSON.stringify(props.config.columns.find(col => col.id === column.id).layout)),
743
778
  viewId: props.viewId,
744
779
  parent: false
@@ -747,13 +782,12 @@ const DataGrid = exports.DataGrid = /*#__PURE__*/_react.default.memo( /*#__PURE_
747
782
  width: column.attributes.width ? column.attributes.width : 100 / config.columns.length + '%'
748
783
  },
749
784
  align: "left",
750
- className: isItemSelected && !_Utils.default.isNull(props.form) && !_Utils.default.isNull(column.editor) ? 'editCell' : null,
751
- key: column.id,
785
+ className: isItemSelected && !_Utils.default.isNull(column.editor) ? 'editCell' : null,
786
+ key: index + "_" + column.id,
752
787
  onClick: event => handleCellClick(event, row.id, column)
753
788
  }, /*#__PURE__*/_react.default.createElement(_TableCellContent.default, {
789
+ handle: createCellEditorHandle(column),
754
790
  viewId: props.viewId,
755
- form: props.form,
756
- formValues: props.formValues,
757
791
  editor: column.editor,
758
792
  ref: /*#__PURE__*/_react.default.createRef(),
759
793
  refCallback: createCell,
@@ -49,7 +49,7 @@ const DocumentViewer = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_react.def
49
49
  actionConfig = {};
50
50
  }
51
51
  actionConfig.service = service;
52
- // TODO : Implement the invalid paramenter callback
52
+ // TODO : Implement the invalid parameter callback
53
53
  _ServiceCallActionHandler.default.execute(actionConfig, null, null, props.viewId, data => {
54
54
  let file = {};
55
55
  if (data.payloadBase64) {
@@ -68,6 +68,8 @@ const DocumentViewer = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_react.def
68
68
  console.error(e);
69
69
  setHasLoadingError(true);
70
70
  setLoading(false);
71
+ }, () => {
72
+ setLoading(false);
71
73
  });
72
74
  }
73
75
  } else {
@@ -127,7 +129,7 @@ const DocumentViewer = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_react.def
127
129
  }, "Error loading document"), !loading && !hasLoadingError && props.config.fileType === 'application/pdf' && !_Utils.default.isNull(value) && /*#__PURE__*/_react.default.createElement(_PDFViewer.default, {
128
130
  file: value,
129
131
  onDocumentLoadSuccess: () => {}
130
- }), !loading && !hasLoadingError && props.config.fileType === 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' && !_Utils.default.isNull(value) && /*#__PURE__*/_react.default.createElement(_WordDocumentViewer.default, {
132
+ }), !loading && !hasLoadingError && props.config.fileType === 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' && (!_Utils.default.isNull(value) || props.config.enableUpload) && /*#__PURE__*/_react.default.createElement(_WordDocumentViewer.default, {
131
133
  file: value,
132
134
  onDocumentLoadSuccess: () => {},
133
135
  valueHandler: wordEditorValueHandler,
@@ -135,7 +137,9 @@ const DocumentViewer = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_react.def
135
137
  disableRejectChanges: props.config.disableRejectChanges,
136
138
  disableAcceptChanges: props.config.disableAcceptChanges,
137
139
  readOnly: props.config.readOnly,
138
- commentsOnly: props.config.commentsOnly
140
+ commentsOnly: props.config.commentsOnly,
141
+ enableUpload: props.config.enableUpload,
142
+ trackChanges: props.config.trackChanges
139
143
  }));
140
144
  }));
141
145
  var _default = exports.default = DocumentViewer;
@@ -5,19 +5,16 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = void 0;
7
7
  var _react = _interopRequireDefault(require("react"));
8
- var _TextField = _interopRequireDefault(require("./form/TextField"));
9
- var _DatePicker = _interopRequireDefault(require("./form/DatePicker"));
10
- var _SelectItem = _interopRequireDefault(require("./form/SelectItem"));
11
8
  var _Utils = _interopRequireDefault(require("../Utils"));
12
- var _LookupField = _interopRequireDefault(require("./form/LookupField"));
13
9
  var _Error = _interopRequireDefault(require("@material-ui/icons/Error"));
14
10
  var _Tooltip = _interopRequireDefault(require("./Tooltip"));
15
- var _ApplicationManager = _interopRequireDefault(require("../ApplicationManager"));
16
- var _AutoComplete = _interopRequireDefault(require("./form/AutoComplete"));
11
+ var _Form = _interopRequireDefault(require("./form/Form"));
17
12
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
18
13
  const TableCellContent = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_react.default.forwardRef((props, ref) => {
19
14
  const [contentType] = _react.default.useState(props.contentType);
20
15
  const [refresher, setRefresher] = _react.default.useState(true);
16
+ const [editor, setEditor] = _react.default.useState(null);
17
+ const editorValue = _react.default.useRef(null);
21
18
  const validate = value => {
22
19
  let validator = props.validator;
23
20
  let errors = props.row.errors;
@@ -33,7 +30,9 @@ const TableCellContent = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_react.d
33
30
  let nullableExpression = validator.nullable.replace(/\[#i]/g, `[${props.row.index}]`);
34
31
  required = !_Utils.default.evaluateBooleanExpression(nullableExpression, props.dataBinding);
35
32
  }
36
- let validation = _Utils.default.validateField(props.dataBinding, required, props.formValues, value, validator);
33
+ let formValue = {};
34
+ formValue[props.editor.id] = value;
35
+ let validation = _Utils.default.validateField(props.dataBinding, required, formValue, value, validator);
37
36
  if (!validation.valid) {
38
37
  let error = {};
39
38
  error.column = props.dataBinding;
@@ -59,14 +58,30 @@ const TableCellContent = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_react.d
59
58
  });
60
59
  }
61
60
  }, [ref.current]);
61
+ _react.default.useEffect(() => {
62
+ if (props.editor && props.row) {
63
+ editorValue.current = props.row[props.dataBinding];
64
+ }
65
+ }, [props.row, props.editor]);
62
66
  _react.default.useEffect(() => {
63
67
  if (!_Utils.default.isNull(props.editor)) {
64
- props.editor.id = props.editor.id.replace('.', '_');
65
- if (_Utils.default.isNull(props.editor.attributes)) {
66
- props.editor.attributes = {};
68
+ let e = {
69
+ ...props.editor,
70
+ id: props.editor.id.replace('.', '_')
71
+ };
72
+ if (_Utils.default.isNull(e.attributes)) {
73
+ e.attributes = {};
67
74
  }
68
- props.editor.attributes['minWidth'] = 0;
69
-
75
+ if (_Utils.default.isNull(e.attributes.style)) {
76
+ e.attributes.style = {};
77
+ }
78
+ if (_Utils.default.isNull(e.attributes.containerStyle)) {
79
+ e.attributes.containerStyle = {};
80
+ }
81
+ e.attributes.style.minWidth = e.attributes.style.minWidth ? e.attributes.style.minWidth : 0;
82
+ e.attributes.style.width = e.attributes.style.width ? e.attributes.style.width : 'calc(100% - 8px)';
83
+ e.attributes.containerStyle.minWidth = e.attributes.containerStyle.minWidth ? e.attributes.containerStyle.minWidth : 0;
84
+ setEditor(e);
70
85
  // This forces the editable grid to validate its initial value
71
86
  let value = props.row[props.dataBinding];
72
87
  valueChangeHandler(_Utils.default.isNull(value) ? null : value);
@@ -115,84 +130,37 @@ const TableCellContent = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_react.d
115
130
  return getStaticDisplayValue();
116
131
  } else {
117
132
  if (!_Utils.default.isNull(props.editor)) {
118
- props.formValues[props.editor.id] = props.row[props.dataBinding];
119
- if (props.editor.fieldType === 'TEXT_FIELD') {
120
- return /*#__PURE__*/_react.default.createElement(_TextField.default, {
121
- valueChangeHandler: valueChangeHandler,
122
- config: props.editor,
123
- form: props.form,
124
- handle: {},
125
- ref: /*#__PURE__*/_react.default.createRef(),
126
- bindValueToForm: false,
127
- values: props.formValues,
128
- viewId: props.viewId
129
- });
130
- } else if (props.editor.fieldType === 'DATE') {
131
- return /*#__PURE__*/_react.default.createElement(_DatePicker.default, {
132
- valueChangeHandler: valueChangeHandler,
133
- config: props.editor,
134
- form: props.form,
135
- handle: {},
136
- ref: /*#__PURE__*/_react.default.createRef(),
137
- bindValueToForm: false,
138
- values: props.formValues,
139
- viewId: props.viewId
140
- });
141
- } else if (props.editor.fieldType === 'SELECT') {
142
- let objectReference = props.row[props.dataBinding];
143
- if (!_Utils.default.isNull(objectReference)) {
144
- objectReference.toString = () => {
145
- return objectReference.label;
146
- };
147
- }
148
- return /*#__PURE__*/_react.default.createElement(_SelectItem.default, {
149
- valueChangeHandler: valueChangeHandler,
150
- config: props.editor,
151
- form: props.form,
152
- handle: {},
153
- ref: /*#__PURE__*/_react.default.createRef(),
154
- bindValueToForm: false,
155
- values: props.formValues,
156
- value: objectReference,
157
- viewId: props.viewId
158
- });
159
- } else if (props.editor.fieldType === 'LOOKUP') {
160
- let data = props.row[props.dataBinding];
161
- if (!_Utils.default.isNull(data)) {
162
- data.toString = () => {
163
- return data.label;
164
- };
165
- }
166
- return /*#__PURE__*/_react.default.createElement(_LookupField.default, {
167
- valueChangeHandler: valueChangeHandler,
168
- config: props.editor,
169
- form: props.form,
170
- handle: {},
171
- ref: /*#__PURE__*/_react.default.createRef(),
172
- bindValueToForm: false,
173
- values: props.formValues,
174
- value: data,
175
- viewId: props.viewId
176
- });
177
- } else if (props.editor.fieldType === 'AUTO_COMPLETE') {
178
- let data = props.row[props.dataBinding];
179
- if (!_Utils.default.isNull(data)) {
180
- data.toString = () => {
181
- return "12345";
182
- };
183
- }
184
- return /*#__PURE__*/_react.default.createElement(_AutoComplete.default, {
185
- valueChangeHandler: valueChangeHandler,
186
- config: props.editor,
187
- form: props.form,
188
- handle: {},
189
- ref: /*#__PURE__*/_react.default.createRef(),
190
- bindValueToForm: false,
191
- values: props.formValues,
192
- value: data,
193
- viewId: props.viewId
194
- });
195
- }
133
+ //props.formValues[props.editor.id] = props.row[props.dataBinding];
134
+
135
+ let formValue = {};
136
+ formValue[props.editor.id] = editorValue.current;
137
+ let formConfig = {
138
+ type: "form",
139
+ id: props.editor.id + "_form",
140
+ sections: [{
141
+ type: "formSection",
142
+ components: [{
143
+ type: "fieldSet",
144
+ attributes: {
145
+ style: {
146
+ "width": "100%",
147
+ "minWidth": "0"
148
+ }
149
+ },
150
+ fields: [editor]
151
+ }]
152
+ }]
153
+ };
154
+ return /*#__PURE__*/_react.default.createElement(_Form.default, {
155
+ config: formConfig,
156
+ handle: props.handle,
157
+ values: formValue,
158
+ valueChangeHandler: value => {
159
+ editorValue.current = value[props.editor.id];
160
+ valueChangeHandler(value[props.editor.id]);
161
+ },
162
+ viewId: props.viewId
163
+ });
196
164
  } else {
197
165
  return getStaticDisplayValue();
198
166
  }
@@ -234,6 +202,6 @@ const TableCellContent = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_react.d
234
202
  }
235
203
  }
236
204
  };
237
- return render();
205
+ return (!props.editor || props.editor && editor) && render();
238
206
  }));
239
207
  var _default = exports.default = TableCellContent;
@@ -17,17 +17,9 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e
17
17
  _ej2ReactDocumenteditor.DocumentEditorContainerComponent.Inject(_ej2ReactDocumenteditor.Toolbar);
18
18
  const WordDocumentViewer = props => {
19
19
  const [container, setContainer] = _react.default.useState(null);
20
+ const [items, setItems] = _react.default.useState(null);
20
21
  const [json, setJson] = _react.default.useState(null);
21
22
  const [errorMessage, setErrorMessage] = _react.default.useState(null);
22
- let items = ["Undo", "Redo", "Separator", {
23
- tooltipText: 'Bold',
24
- prefixIcon: 'e-icons e-bold',
25
- command: 'Bold'
26
- }, {
27
- tooltipText: 'Italic',
28
- prefixIcon: 'e-icons e-italic',
29
- command: 'Italic'
30
- }, "Separator", "Image", "Table", "Separator", "Header", "Footer", "PageSetup", "PageNumber", "Break", "InsertFootnote", "Separator", "Find", "Separator", "Comments"];
31
23
 
32
24
  /*let items = ['Bold', 'Italic', 'Underline', '|', 'Formats', '|', 'CreateLink', '|',
33
25
  {
@@ -50,7 +42,22 @@ const WordDocumentViewer = props => {
50
42
  props.valueHandler.api = api();
51
43
  });
52
44
  _react.default.useEffect(() => {
53
- if (props.file.base64) {
45
+ let toolbarItems = ["Undo", "Redo", "Separator", {
46
+ tooltipText: 'Bold',
47
+ prefixIcon: 'e-icons e-bold',
48
+ command: 'Bold'
49
+ }, {
50
+ tooltipText: 'Italic',
51
+ prefixIcon: 'e-icons e-italic',
52
+ command: 'Italic'
53
+ }, "Separator", "Image", "Table", "Separator", "Header", "Footer", "PageSetup", "PageNumber", "Break", "InsertFootnote", "Separator", "Find", "Separator", "Comments"];
54
+ if (props.enableUpload) {
55
+ toolbarItems.unshift("Open");
56
+ }
57
+ setItems(toolbarItems);
58
+ }, []);
59
+ _react.default.useEffect(() => {
60
+ if (props.file?.base64) {
54
61
  let base64 = props.file.base64;
55
62
  const arrayBuffer = _Utils.default.base64ToArrayBuffer(base64);
56
63
  const file = new Blob([arrayBuffer], {
@@ -96,7 +103,7 @@ const WordDocumentViewer = props => {
96
103
  _react.default.useEffect(() => {
97
104
  if (container && json) {
98
105
  container.documentEditor.documentChange = () => {
99
- container.documentEditor.enableTrackChanges = true;
106
+ container.documentEditor.enableTrackChanges = !_Utils.default.isNull(props.trackChanges) ? props.trackChanges : true;
100
107
  if (props.commentsOnly) {
101
108
  container.documentEditor.editor.enforceProtection('password', 'CommentsOnly');
102
109
  } else if (props.readOnly) {
@@ -118,7 +125,7 @@ const WordDocumentViewer = props => {
118
125
  }
119
126
  });
120
127
  container.documentEditor.open(json);
121
- container.documentEditor.enableTrackChanges = true;
128
+ container.documentEditor.enableTrackChanges = !_Utils.default.isNull(props.trackChanges) ? props.trackChanges : true;
122
129
  //container.documentEditor.isReadOnly = (props.readOnly || props.commentsOnly);
123
130
  }
124
131
  }, [json, container]);
@@ -145,7 +152,7 @@ const WordDocumentViewer = props => {
145
152
  style: {
146
153
  color: 'rgba(255, 255, 255, 0.8)'
147
154
  }
148
- }, errorMessage))), /*#__PURE__*/_react.default.createElement(_ej2ReactDocumenteditor.DocumentEditorContainerComponent, {
155
+ }, errorMessage))), items && (_Utils.default.isNull(props.trackChanges) || props.trackChanges === true) && /*#__PURE__*/_react.default.createElement(_ej2ReactDocumenteditor.DocumentEditorContainerComponent, {
149
156
  id: "container",
150
157
  height: '690px',
151
158
  ref: scope => {
@@ -162,6 +169,22 @@ const WordDocumentViewer = props => {
162
169
  enableTrackChanges: true,
163
170
  serviceUrl: "https://services.syncfusion.com/react/production/api/documenteditor/",
164
171
  enableToolbar: !(props.readOnly || props.commentsOnly)
172
+ }), items && props.trackChanges === false && /*#__PURE__*/_react.default.createElement(_ej2ReactDocumenteditor.DocumentEditorContainerComponent, {
173
+ id: "container",
174
+ height: '690px',
175
+ ref: scope => {
176
+ setContainer(scope);
177
+ },
178
+ created: () => {
179
+ if (container) {
180
+ container.resize();
181
+ container.documentEditor.resize();
182
+ }
183
+ },
184
+ toolbarItems: items,
185
+ showPropertiesPane: false,
186
+ serviceUrl: "https://services.syncfusion.com/react/production/api/documenteditor/",
187
+ enableToolbar: !(props.readOnly || props.commentsOnly)
165
188
  }));
166
189
  };
167
190
  var _default = exports.default = WordDocumentViewer;
@@ -343,7 +343,8 @@ const ModuleMenuSidebar = props => {
343
343
  className: "logo-img",
344
344
  style: {
345
345
  paddingTop: '16px',
346
- paddingBottom: '8px'
346
+ paddingBottom: '8px',
347
+ maxWidth: '140px'
347
348
  }
348
349
  }, /*#__PURE__*/_react.default.createElement("img", {
349
350
  src: logo.imgSrc,
@@ -136,6 +136,14 @@ const BaseField = props => {
136
136
  valueChanged = JSON.stringify(valueRef.current) !== JSON.stringify(newValue);
137
137
  }
138
138
  }
139
+ if (props.config.fieldType === 'GRID' && valueObject[valueProperty]) {
140
+ valueObject[valueProperty].splice(0, valueObject[valueProperty].length);
141
+ for (const newValueElement of newValue) {
142
+ valueObject[valueProperty].push(newValueElement);
143
+ }
144
+ let id = props.config.dataBinding ? props.config.dataBinding : props.config.id;
145
+ props.form().handleChange(!_Utils.default.isNull(props.config.dataBinding) ? props.config.dataBinding : id, newValue);
146
+ }
139
147
  if (valueChanged) {
140
148
  let id = props.config.dataBinding ? props.config.dataBinding : props.config.id;
141
149
  _ApplicationManager.default.enableFormMarkers(true);
@@ -498,7 +498,7 @@ const FieldSet = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_react.default.f
498
498
  }
499
499
  }
500
500
  width = colspan / fieldGrid.maxColPerRow * 100;
501
- let columnStyle = {
501
+ let containerStyle = {
502
502
  paddingLeft: '0',
503
503
  paddingRight: '0',
504
504
  marginLeft: '0',
@@ -506,7 +506,7 @@ const FieldSet = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_react.default.f
506
506
  minWidth: '320px',
507
507
  width: width + '%'
508
508
  };
509
- let style = field.attributes?.columnStyle ? _Utils.default.mergeObjects(field.attributes?.columnStyle, columnStyle) : columnStyle;
509
+ let style = field.attributes?.containerStyle ? _Utils.default.mergeObjects(field.attributes?.containerStyle, containerStyle) : containerStyle;
510
510
  return /*#__PURE__*/_react.default.createElement("div", {
511
511
  key: index,
512
512
  className: "col-*-*",
@@ -113,11 +113,16 @@ const Form = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_react.default.forwa
113
113
  return values.current;
114
114
  },
115
115
  set model(model) {
116
- parseValues(transformDataObject(model));
117
- setMasterValues(model);
116
+ if (_Utils.default.isNull(model)) {
117
+ parseValues({});
118
+ setMasterValues({});
119
+ } else {
120
+ parseValues(transformDataObject(model));
121
+ setMasterValues(model);
122
+ }
118
123
  },
119
124
  get value() {
120
- if (loadingRef.current === false) {
125
+ if (loadingRef.current === false && values.current) {
121
126
  let data = null;
122
127
  let valid = true;
123
128
  data = {};
@@ -222,8 +227,8 @@ const Form = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_react.default.forwa
222
227
  if (!_Utils.default.isNull(result)) {
223
228
  parseValues(transformDataObject(result));
224
229
  setMasterValues(result);
225
- loadingRef.current = false;
226
230
  }
231
+ loadingRef.current = false;
227
232
  } catch (e) {
228
233
  console.error(e);
229
234
  }
@@ -241,8 +246,10 @@ const Form = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_react.default.forwa
241
246
  eventConfig.service = service;
242
247
  // TODO : Implement the invalid paramenter callback
243
248
  _ServiceCallActionHandler.default.execute(eventConfig, null, null, props.viewId, data => {
244
- parseValues(transformDataObject(data));
245
- setMasterValues(data);
249
+ if (data) {
250
+ parseValues(transformDataObject(data));
251
+ setMasterValues(data);
252
+ }
246
253
  loadingRef.current = false;
247
254
  }, () => {}, parameter => {
248
255
  loadingRef.current = false;
@@ -130,7 +130,6 @@ const GridFieldWrapper = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_react.d
130
130
  ref: /*#__PURE__*/_react.default.createRef(),
131
131
  viewId: props.viewId,
132
132
  rows: rows,
133
- form: props.form,
134
133
  formValues: props.values,
135
134
  valueChangeHandler: rows => {
136
135
  let value = null;
@@ -157,7 +156,7 @@ const GridFieldWrapper = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_react.d
157
156
  const GridField = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_react.default.forwardRef((props, ref) => {
158
157
  const [gridHandle] = _react.default.useState({});
159
158
  const [toolHandle] = _react.default.useState(!_Utils.default.isNull(props.config.toolstrip) ? {} : null);
160
- const [initialValueSet, setInitialValueSet] = _react.default.useState(false);
159
+ const initialValueSet = _react.default.useRef(false);
161
160
  return /*#__PURE__*/_react.default.createElement(_BaseField.BaseField, _extends({}, props, {
162
161
  handle: props.handle,
163
162
  getChildren: () => {
@@ -181,7 +180,6 @@ const GridField = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_react.default.
181
180
  let objectArray = value;
182
181
  let val = [];
183
182
  if (objectArray.length > 0) {
184
- let type = objectArray[0].type;
185
183
  let nullIdRecords = 1;
186
184
  for (const objectArrayElement of objectArray) {
187
185
  if (inbound && _Utils.default.isNull(objectArrayElement.id)) {
@@ -193,7 +191,7 @@ const GridField = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_react.default.
193
191
  val.push(objectArrayElement);
194
192
  }
195
193
  }
196
- setInitialValueSet(false);
194
+ initialValueSet.current = false;
197
195
  return val;
198
196
  }
199
197
  return value;
@@ -203,9 +201,9 @@ const GridField = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_react.default.
203
201
  ref: ref,
204
202
  gridHandle: gridHandle,
205
203
  toolstripHandle: toolHandle,
206
- initialValueSet: initialValueSet,
204
+ initialValueSet: initialValueSet.current,
207
205
  loadCallback: () => {
208
- setInitialValueSet(true);
206
+ initialValueSet.current = true;
209
207
  },
210
208
  base: base
211
209
  }, props)));
@@ -23,6 +23,8 @@ const LookupFieldComponent = exports.LookupFieldComponent = /*#__PURE__*/_react.
23
23
  const [open, setOpen] = _react.default.useState(false);
24
24
  const width = props.config.attributes?.style?.width ? props.config.attributes.style.width : "100%";
25
25
  const minWidth = props.config.attributes?.style?.minWidth ? props.config.attributes.style.minWidth : "240px";
26
+ const height = !_Utils.default.isNull(props.config.attributes?.style?.height) ? props.config.attributes.style.height : '52px';
27
+ const margin = !_Utils.default.isNull(props.config.attributes?.style?.margin) ? props.config.attributes.style.margin : '4px 0';
26
28
  const defaultValue = _Utils.default.isNull(props.value) ? '' : props.value;
27
29
  const base = props.base;
28
30
  const handleClose = () => {
@@ -67,19 +69,43 @@ const LookupFieldComponent = exports.LookupFieldComponent = /*#__PURE__*/_react.
67
69
  setOpen(true);
68
70
  };
69
71
  return /*#__PURE__*/_react.default.createElement("div", {
70
- className: "w-100 lookup"
71
- }, /*#__PURE__*/_react.default.createElement("table", {
72
- className: "w-100"
73
- }, /*#__PURE__*/_react.default.createElement("tbody", null, /*#__PURE__*/_react.default.createElement("tr", null, /*#__PURE__*/_react.default.createElement("td", {
74
- width: "90%"
72
+ className: "w-100 lookup row no-margin no-padding",
73
+ style: {
74
+ width: width,
75
+ minWidth: minWidth,
76
+ margin: margin,
77
+ height: height
78
+ }
79
+ }, /*#__PURE__*/_react.default.createElement("div", {
80
+ className: 'col-*-*',
81
+ style: {
82
+ width: '72px',
83
+ marginRight: '8px',
84
+ height: '100%'
85
+ }
86
+ }, /*#__PURE__*/_react.default.createElement(_Button.default, {
87
+ style: {
88
+ height: '100%'
89
+ },
90
+ variant: 'outlined',
91
+ onClick: openSearch,
92
+ disabled: base.disabled,
93
+ "aria-label": "search"
94
+ }, "...")), /*#__PURE__*/_react.default.createElement("div", {
95
+ className: 'col-*-* no-margin no-padding',
96
+ style: {
97
+ width: 'calc(100% - 80px)',
98
+ marginBottom: base.value ? '0' : '8px'
99
+ }
75
100
  }, /*#__PURE__*/_react.default.createElement(_TextField.default, {
76
101
  InputProps: {
77
- readOnly: true
102
+ readOnly: true,
103
+ disableUnderline: true
78
104
  },
79
105
  id: props.id,
80
106
  ref: ref,
81
107
  required: base.required,
82
- disabled: base.disabled,
108
+ disabled: true,
83
109
  label: !_Utils.default.isNull(props.config.attributes) && !_Utils.default.isNull(props.config.attributes['label']) ? props.config.attributes['label'] : null,
84
110
  value: base.value?.__oui_label || base.value?.dataRecordDescription || defaultValue,
85
111
  className: props.className,
@@ -88,19 +114,12 @@ const LookupFieldComponent = exports.LookupFieldComponent = /*#__PURE__*/_react.
88
114
  size: "small",
89
115
  margin: "dense",
90
116
  style: {
91
- minWidth: minWidth,
92
- width: width,
93
- color: 'secondary'
94
- },
95
- variant: "outlined"
96
- })), /*#__PURE__*/_react.default.createElement("td", {
97
- valign: "middle",
98
- align: "left"
99
- }, /*#__PURE__*/_react.default.createElement(_IconButton.default, {
100
- onClick: openSearch,
101
- disabled: base.disabled,
102
- "aria-label": "search"
103
- }, /*#__PURE__*/_react.default.createElement(_Search.default, null)))))), /*#__PURE__*/_react.default.createElement(_Dialog.default, {
117
+ height: '48px',
118
+ width: '100%',
119
+ color: 'secondary',
120
+ border: 'none'
121
+ }
122
+ })), /*#__PURE__*/_react.default.createElement(_Dialog.default, {
104
123
  open: open,
105
124
  onClose: handleClose,
106
125
  "aria-labelledby": "form-dialog-title",
@@ -155,6 +174,9 @@ const LookupField = exports.LookupField = /*#__PURE__*/_react.default.memo( /*#_
155
174
  },
156
175
  valueParser: (value, inbound) => {
157
176
  if (!value || !value.id) {
177
+ if (value) {
178
+ console.warn("LOOKUP VALUE WITH NO ID FOR : " + props.config.id, value);
179
+ }
158
180
  return null;
159
181
  }
160
182
  if (!_Utils.default.isNull(value)) {
@@ -113,17 +113,18 @@ const Section = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_react.default.fo
113
113
  function render(section) {
114
114
  let counter = 0;
115
115
  return _Utils.default.isNull(section.components) || section.components.length === 0 ? /*#__PURE__*/_react.default.createElement("div", null, " Error: A form section must have components") : /*#__PURE__*/_react.default.createElement("div", {
116
- style: {
116
+ style: _Utils.default.mergeStyles({
117
117
  overflow: 'hidden'
118
- }
118
+ }, props.config),
119
+ className: "oui-form-section"
119
120
  }, fieldGrid.rows.map((row, index) => {
120
121
  return /*#__PURE__*/_react.default.createElement(_Grid.default, {
121
122
  container: true,
122
- style: _Utils.default.mergeStyles({
123
+ style: {
123
124
  margin: '0',
124
125
  textAlign: 'left',
125
126
  width: '100%'
126
- }, section),
127
+ },
127
128
  key: index
128
129
  }, row.fields.map(field => {
129
130
  if (_Utils.default.isNull(field.id)) {
@@ -16,9 +16,9 @@ const SelectItemComponent = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_reac
16
16
  const base = props.base;
17
17
  const [optionsLoaded, setOptionsLoaded] = _react.default.useState(false);
18
18
  const [loadFullOptionList, setLoadFullOptionList] = _react.default.useState(false);
19
- const minWidth = _Utils.default.getComponentAttribute(props.config, 'minWidth', '240px');
20
- const maxWidth = _Utils.default.getComponentAttribute(props.config, 'maxWidth', null);
21
- const width = _Utils.default.getComponentAttribute(props.config, 'width', '100%');
19
+ const width = !_Utils.default.isNull(props.config.attributes?.style?.width) ? props.config.attributes.style.width : "100%";
20
+ const maxWidth = !_Utils.default.isNull(props.config.attributes?.style?.maxWidth) ? props.config.attributes.style.maxWidth : null;
21
+ const minWidth = !_Utils.default.isNull(props.config.attributes?.style?.minWidth) ? props.config.attributes.style.minWidth : "240px";
22
22
  const defaultValue = _Utils.default.isNull(props.value) ? '' : props.value.id;
23
23
  _react.default.useEffect(() => {
24
24
  if (!_Utils.default.isNull(base.value) && !optionsLoaded) {
@@ -15,10 +15,10 @@ function _extends() { return _extends = Object.assign ? Object.assign.bind() : f
15
15
  const TextFieldWrapper = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_react.default.forwardRef((props, ref) => {
16
16
  const base = props.base;
17
17
  const [multiline] = _react.default.useState(props.multiline);
18
- const width = props.config.attributes?.style?.width ? props.config.attributes.style.width : "100%";
19
- const maxWidth = props.config.attributes?.style?.maxWidth ? props.config.attributes.style.maxWidth : null;
20
- const minWidth = props.config.attributes?.style?.minWidth ? props.config.attributes.style.minWidth : "240px";
21
- const height = props.config.attributes?.style?.height ? props.config.attributes.style.height : multiline ? '200px' : null;
18
+ const width = !_Utils.default.isNull(props.config.attributes?.style?.width) ? props.config.attributes.style.width : "100%";
19
+ const maxWidth = !_Utils.default.isNull(props.config.attributes?.style?.maxWidth) ? props.config.attributes.style.maxWidth : null;
20
+ const minWidth = !_Utils.default.isNull(props.config.attributes?.style?.minWidth) ? props.config.attributes.style.minWidth : "240px";
21
+ const height = !_Utils.default.isNull(props.config.attributes?.style?.height) ? props.config.attributes.style.height : multiline ? '200px' : null;
22
22
  const rows = height === null ? 4 : height.replace('px', '') / 20 - 1;
23
23
  const secondaryColor = (0, _reactRedux.useSelector)(state => state.dashboard.secondaryThemeColor);
24
24
  const ThemedTextField = (0, _styles.withStyles)({
@@ -31,7 +31,7 @@ var _ChatRoomWrapper = _interopRequireDefault(require("../media/chat/ChatRoomWra
31
31
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
32
32
  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); }
33
33
  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; }
34
- const Layout = exports.Layout = /*#__PURE__*/_react.default.forwardRef((props, ref) => {
34
+ const Layout = props => {
35
35
  const [componentHandles] = _react.default.useState({});
36
36
  const [loadedComponents] = _react.default.useState([]);
37
37
  const [visible, setVisible] = _react.default.useState(true);
@@ -278,12 +278,10 @@ const Layout = exports.Layout = /*#__PURE__*/_react.default.forwardRef((props, r
278
278
  setVisible(val);
279
279
  },
280
280
  getChildren: () => {
281
- //console.log("\n\n\n\nGETTING LAYOUT KIDS : ", componentHandles);
282
281
  let children = [];
283
282
  let properties = Object.getOwnPropertyNames(componentHandles);
284
283
  for (const property of properties) {
285
284
  let componentHandle = componentHandles[property];
286
- //console.log(property, componentHandle);
287
285
  children.push(componentHandle);
288
286
  if (!_Utils.default.isNull(componentHandle.api) && !_Utils.default.isNull(componentHandle.api.getChildren)) {
289
287
  let moreChildren = componentHandle.api.getChildren();
@@ -364,9 +362,10 @@ const Layout = exports.Layout = /*#__PURE__*/_react.default.forwardRef((props, r
364
362
  }, renderComponent(component, null));
365
363
  }));
366
364
  }
367
- return visible && /*#__PURE__*/_react.default.createElement("div", {
365
+ return /*#__PURE__*/_react.default.createElement("div", {
368
366
  id: props.config.id,
369
367
  style: getLayoutStyle(props.config, 'transparent'),
370
368
  className: `${_Utils.default.getComponentAttribute(props.config, 'className', '') + (props.config.orientation === 'HORIZONTAL' ? ' row' : '')}`
371
369
  }, render(props.config));
372
- });
370
+ };
371
+ exports.Layout = Layout;
@@ -78,7 +78,7 @@ const MenuButton = /*#__PURE__*/_react.default.forwardRef((props, ref) => {
78
78
  const api = () => {
79
79
  return {
80
80
  get id() {
81
- return config ? config.id : props.config.id;
81
+ return props.tableRow ? props.config.id + '_' + props.tableRow.id?.replaceAll('-', '') : props.config.id;
82
82
  },
83
83
  get tableRow() {
84
84
  return props.tableRow;
@@ -46,7 +46,7 @@ const MenuItem = /*#__PURE__*/_react.default.forwardRef((props, ref) => {
46
46
  const api = () => {
47
47
  return {
48
48
  get id() {
49
- return config ? config.id : props.config.id;
49
+ return props.tableRow ? props.config.id + '_' + props.tableRow.id?.replaceAll('-', '') : props.config.id;
50
50
  },
51
51
  get tableRow() {
52
52
  return props.tableRow;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agilemotion/oui-react-js",
3
- "version": "1.7.8",
3
+ "version": "1.8.0",
4
4
  "files": [
5
5
  "dist"
6
6
  ],