@agilemotion/oui-react-js 1.8.18 → 1.8.20

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.
@@ -213,9 +213,7 @@ const TableCellContent = /*#__PURE__*/_react.default.memo(/*#__PURE__*/_react.de
213
213
  }, doRender()))));
214
214
  };
215
215
  const api = {
216
- set value(val) {
217
- alert('Mbulu ya nga');
218
- },
216
+ set value(val) {},
219
217
  refresh: () => {
220
218
  setRefresher(!refresher);
221
219
  if (_Utils.default.isNull(props.editor)) {
@@ -7,7 +7,7 @@ exports.default = void 0;
7
7
  var _react = _interopRequireWildcard(require("react"));
8
8
  var _Observable = _interopRequireDefault(require("../event/Observable"));
9
9
  var _styles = require("@mui/styles");
10
- var _ToggleButtonGroup = _interopRequireDefault(require("@mui/lab/ToggleButtonGroup"));
10
+ var _ToggleButtonGroup = _interopRequireDefault(require("@mui/material/ToggleButtonGroup"));
11
11
  var _MenuButton = _interopRequireDefault(require("./menu/MenuButton"));
12
12
  var _Button = _interopRequireDefault(require("./Button"));
13
13
  var _Utils = _interopRequireDefault(require("../Utils"));
@@ -30,21 +30,26 @@ const BaseField = props => {
30
30
  const [minDate, setMinDate] = _react.default.useState(null);
31
31
  const [maxDate, setMaxDate] = _react.default.useState(null);
32
32
  const validateOnChange = _react.default.useRef();
33
+ const initialValueBound = _react.default.useRef(false);
33
34
  const ref = _react.default.useRef(null);
34
35
  const valid = _react.default.useRef(false);
35
36
  _react.default.useEffect(() => {
36
- let value = valueObject[valueProperty];
37
- if (props.config.fieldType === 'SELECT' || props.config.fieldType === 'LOOKUP') {
38
- if (!value || _Utils.default.isNull(value.id)) {
39
- setValue(null);
40
- valueRef.current = null;
37
+ let boundValue = valueObject[valueProperty];
38
+ if (boundValue && !initialValueBound.current) {
39
+ initialValueBound.current = true;
40
+ if (props.config.fieldType === 'SELECT' || props.config.fieldType === 'LOOKUP') {
41
+ console.log("BINDING : " + props.config.id, valueObject[valueProperty]);
42
+ if (!boundValue || _Utils.default.isNull(boundValue.id)) {
43
+ setValue(null);
44
+ valueRef.current = null;
45
+ } else {
46
+ setValue(boundValue);
47
+ valueRef.current = boundValue;
48
+ }
41
49
  } else {
42
- setValue(value);
43
- valueRef.current = value;
50
+ setValue(boundValue);
51
+ valueRef.current = boundValue;
44
52
  }
45
- } else {
46
- setValue(value);
47
- valueRef.current = value;
48
53
  }
49
54
  }, [valueObject[valueProperty]]);
50
55
 
@@ -134,6 +139,7 @@ const BaseField = props => {
134
139
  };
135
140
  }, []);
136
141
  const handleValueChange = newValue => {
142
+ initialValueBound.current = true;
137
143
  let valueChanged = newValue !== valueRef.current;
138
144
  if (!_Utils.default.isNull(newValue) && !_Utils.default.isNull(valueRef.current)) {
139
145
  if (props.config.fieldType === 'SELECT' || props.config.fieldType === 'LOOKUP') {
@@ -52,7 +52,6 @@ const CurrencyFieldWrapper = /*#__PURE__*/_react.default.memo(/*#__PURE__*/_reac
52
52
  } else {
53
53
  base.handleValueChange(0);
54
54
  }
55
- console.log("TARGET VAL : " + event.target.value);
56
55
  setDisplayValue(event.target.value);
57
56
  }
58
57
  };
@@ -206,7 +206,6 @@ const GridField = /*#__PURE__*/_react.default.memo(/*#__PURE__*/_react.default.f
206
206
  },
207
207
  clearHandler: () => gridHandle.api.clear(),
208
208
  rowsHandler: () => {
209
- alert(JSON.stringify(gridHandle.api.rows));
210
209
  return gridHandle.api.rows;
211
210
  }
212
211
  }), base => /*#__PURE__*/_react.default.createElement(GridFieldWrapper, _extends({
@@ -27,12 +27,17 @@ const LookupFieldComponent = exports.LookupFieldComponent = /*#__PURE__*/_react.
27
27
  const height = !_Utils.default.isNull(props.config.attributes?.style?.height) ? props.config.attributes.style.height : '41px';
28
28
  const margin = !_Utils.default.isNull(props.config.attributes?.style?.margin) ? props.config.attributes.style.margin : '4px 0';
29
29
  const defaultValue = _Utils.default.isNull(props.value) ? '' : props.value;
30
+ const [value, setValue] = _react.default.useState(_Utils.default.isNull(props.value) ? null : props.value.id);
30
31
  const base = props.base;
31
32
  const handleClose = () => {
32
33
  setOpen(false);
33
34
  setCurrentSelection(null);
34
35
  _Observable.default.clearComponentEventListeners(props.gridHandle.api.id);
35
36
  };
37
+ _react.default.useEffect(() => {
38
+ console.log("LOOKUP FIELD VALUE CHANGED", base.value);
39
+ setValue(base.value);
40
+ }, [base.value]);
36
41
  _react.default.useEffect(() => {
37
42
  if (props.config && props.config.grid) {
38
43
  if (!props.config.grid.attributes) {
@@ -62,6 +67,7 @@ const LookupFieldComponent = exports.LookupFieldComponent = /*#__PURE__*/_react.
62
67
  const setSelectionAsValue = () => {
63
68
  if (currentSelection.length > 0) {
64
69
  let val = setupVal();
70
+ setValue(val);
65
71
  base.handleValueChange(val);
66
72
  handleClose();
67
73
  }
@@ -100,7 +106,7 @@ const LookupFieldComponent = exports.LookupFieldComponent = /*#__PURE__*/_react.
100
106
  className: 'col-*-* no-margin no-padding',
101
107
  style: {
102
108
  width: 'calc(100% - 72px)',
103
- marginBottom: base.value ? '0' : '8px',
109
+ marginBottom: value ? '0' : '8px',
104
110
  position: 'relative'
105
111
  }
106
112
  }, !base.required && /*#__PURE__*/_react.default.createElement("div", {
@@ -124,10 +130,10 @@ const LookupFieldComponent = exports.LookupFieldComponent = /*#__PURE__*/_react.
124
130
  },
125
131
  id: props.id,
126
132
  required: base.required,
127
- readonly: true,
133
+ readOnly: true,
128
134
  disabled: base.disabled,
129
135
  label: !_Utils.default.isNull(props.config.attributes) && !_Utils.default.isNull(props.config.attributes['label']) ? props.config.attributes['label'] : null,
130
- value: base.value?.__oui_label || base.value?.dataRecordDescription || defaultValue,
136
+ value: value?.__oui_label || value?.dataRecordDescription || defaultValue,
131
137
  className: props.className || 'lookup-field-input',
132
138
  error: base.hasError,
133
139
  helperText: base.errorMessage,
@@ -5,24 +5,21 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = void 0;
7
7
  var _react = _interopRequireDefault(require("react"));
8
- var _TextField = _interopRequireDefault(require("@mui/material/TextField"));
9
- var _MenuItem = _interopRequireDefault(require("@mui/material/MenuItem"));
10
8
  var _Utils = _interopRequireDefault(require("../../Utils"));
11
9
  var _BaseField = require("./BaseField");
12
10
  var _RestService = require("../../RestService");
13
- var _Event = _interopRequireDefault(require("../../event/Event"));
14
- var _Observable = _interopRequireDefault(require("../../event/Observable"));
15
- var _EventType = _interopRequireDefault(require("../../event/EventType"));
11
+ var _material = require("@mui/material");
16
12
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
17
13
  function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
18
14
  const SelectItemComponent = props => {
19
15
  const base = props.base;
20
16
  const [optionsLoaded, setOptionsLoaded] = _react.default.useState(false);
21
17
  const [loadFullOptionList, setLoadFullOptionList] = _react.default.useState(false);
18
+ const [value, setValue] = _react.default.useState(_Utils.default.isNull(props.value) ? '' : props.value.id);
19
+ const initialValue = _react.default.useRef(null);
22
20
  const width = !_Utils.default.isNull(props.config.attributes?.style?.width) ? props.config.attributes.style.width : "100%";
23
21
  const maxWidth = !_Utils.default.isNull(props.config.attributes?.style?.maxWidth) ? props.config.attributes.style.maxWidth : null;
24
22
  const minWidth = !_Utils.default.isNull(props.config.attributes?.style?.minWidth) ? props.config.attributes.style.minWidth : "240px";
25
- const defaultValue = _Utils.default.isNull(props.value) ? '' : props.value.id;
26
23
  _react.default.useEffect(() => {
27
24
  if (!_Utils.default.isNull(base.value) && !optionsLoaded) {
28
25
  let defaultOptions = [];
@@ -30,7 +27,18 @@ const SelectItemComponent = props => {
30
27
  base.setSelectOptions(defaultOptions);
31
28
  setOptionsLoaded(true);
32
29
  }
30
+ if (_Utils.default.isNull(initialValue.current) && !_Utils.default.isNull(base.value)) {
31
+ initialValue.current = base.value;
32
+ }
33
+ setValue(base.value?.id);
33
34
  }, [base.value]);
35
+ _react.default.useEffect(() => {
36
+ if (!_Utils.default.isNull(base.selectOptions) && base.selectOptions.length > 0) {
37
+ if (initialValue.current) {
38
+ setValue(initialValue.current.id);
39
+ }
40
+ }
41
+ }, [base.selectOptions]);
34
42
  _react.default.useEffect(() => {
35
43
  if (loadFullOptionList && !_Utils.default.isNull(props.config.dataService)) {
36
44
  let method = props.config.dataService.type === 'rpc' ? _RestService.invokeRpc : _RestService.invokeRest;
@@ -57,42 +65,45 @@ const SelectItemComponent = props => {
57
65
  setOptionsLoaded(true);
58
66
  }
59
67
  }, [loadFullOptionList, props.refreshData]);
60
- return /*#__PURE__*/_react.default.createElement(_TextField.default, {
61
- select: true,
62
- InputProps: props.InputProps,
63
- id: props.id,
64
- disabled: base.disabled,
68
+ return /*#__PURE__*/_react.default.createElement(_material.FormControl, {
69
+ fullWidth: true,
70
+ margin: "dense",
71
+ size: "small",
65
72
  required: base.required,
66
- label: !_Utils.default.isNull(props.config.attributes) ? props.config.attributes['label'] : null,
73
+ disabled: base.disabled,
74
+ error: base.hasError,
67
75
  style: _Utils.default.mergeStyles({
68
76
  minWidth: minWidth,
69
77
  width: width,
70
78
  maxWidth: maxWidth
71
- }, props.config),
72
- SelectProps: {
73
- onOpen: () => {
74
- if (!loadFullOptionList) {
75
- setLoadFullOptionList(true);
76
- }
79
+ }, props.config)
80
+ }, /*#__PURE__*/_react.default.createElement(_material.InputLabel, {
81
+ id: `${props.id}-label`
82
+ }, !_Utils.default.isNull(props.config.attributes) ? props.config.attributes['label'] : ''), /*#__PURE__*/_react.default.createElement(_material.Select, {
83
+ labelId: `${props.id}-label`,
84
+ id: props.id,
85
+ variant: "outlined",
86
+ value: value,
87
+ input: /*#__PURE__*/_react.default.createElement(_material.OutlinedInput, {
88
+ label: props.config.attributes?.label || ''
89
+ }),
90
+ onOpen: () => {
91
+ if (!loadFullOptionList) {
92
+ setLoadFullOptionList(true);
77
93
  }
78
94
  },
79
- value: !_Utils.default.isNull(base.value) && base.selectOptions && base.selectOptions.length > 0 ? base.value.id : defaultValue,
80
- className: props.className,
81
95
  onChange: e => {
82
96
  base.handleValueChange(e.target.value);
97
+ setValue(e.target.value);
83
98
  },
84
- error: base.hasError,
85
- helperText: base.errorMessage,
86
- margin: "dense",
87
- size: "small",
88
- variant: "outlined"
89
- }, base.selectOptions.map(option => option.id === '_EMPTY_VALUE' ? /*#__PURE__*/_react.default.createElement(_MenuItem.default, {
99
+ className: props.className
100
+ }, base.selectOptions.map(option => option.id === '_EMPTY_VALUE' ? /*#__PURE__*/_react.default.createElement(_material.MenuItem, {
90
101
  value: "",
91
102
  key: option.id
92
- }, /*#__PURE__*/_react.default.createElement("em", null, "\xA0")) : /*#__PURE__*/_react.default.createElement(_MenuItem.default, {
103
+ }, /*#__PURE__*/_react.default.createElement("em", null, "\xA0")) : /*#__PURE__*/_react.default.createElement(_material.MenuItem, {
93
104
  key: option.id,
94
105
  value: option.id
95
- }, _Utils.default.isNull(option.dataRecordDescription) ? '' : option.dataRecordDescription.trim())));
106
+ }, _Utils.default.isNull(option.dataRecordDescription) ? '' : option.dataRecordDescription.trim()))), base.hasError && /*#__PURE__*/_react.default.createElement(_material.FormHelperText, null, base.errorMessage));
96
107
  };
97
108
  const SelectItem = /*#__PURE__*/_react.default.memo(/*#__PURE__*/_react.default.forwardRef((props, ref) => {
98
109
  const [refreshData, setRefreshData] = _react.default.useState(false);
@@ -1,9 +1,9 @@
1
- .coll-panel-container {
2
- font-family: sans-serif;
3
- text-align: center;
4
- }
5
-
6
- .coll-panel-btn:focus {
7
- outline: 0;
8
- box-shadow: none;
9
- }
1
+ .coll-panel-container {
2
+ font-family: sans-serif;
3
+ text-align: center;
4
+ }
5
+
6
+ .coll-panel-btn:focus {
7
+ outline: 0;
8
+ box-shadow: none;
9
+ }
@@ -1,68 +1,68 @@
1
- .view {
2
- padding: 0 32px;
3
- background-color: #ffffff;
4
- border-radius: 4px;
5
- }
6
-
7
- .window-unpinned .view {
8
- width: 0 !important;;
9
- }
10
-
11
- .window-pinned .view {
12
- padding: 0 8px;
13
- }
14
-
15
- .no-margin {
16
- margin-left: 0 !important;
17
- margin-right: 0 !important;
18
- }
19
-
20
- .no-padding {
21
- padding-left: 0 !important;
22
- padding-right: 0 !important;
23
- }
24
-
25
- .centered-flex-box {
26
- display: flex;
27
- align-Items: center;
28
- justify-content: center
29
- }
30
-
31
- /* Smartphones (landscape); */
32
- @media only screen and (min-device-width : 361px) and (max-device-width : 480px) {
33
- .view {
34
- padding: 0 16px;
35
- }
36
- }
37
-
38
- /* Smartphones (portrait); */
39
- @media only screen and (min-device-width : 280px) and (max-device-width : 360px) {
40
- .view {
41
- padding: 0 16px;
42
- }
43
- }
44
-
45
- /* iPads (portrait and landscape); */
46
- @media only screen and (min-device-width : 768px) and (max-device-width : 1024px) {
47
- .view {
48
- padding: 0 24px;
49
- }
50
- }
51
-
52
- /* iPad 3 */
53
- @media only screen and (min-device-width : 768px) and (max-device-width : 1024px) and (orientation : landscape) and (-webkit-min-device-pixel-ratio : 2) {
54
- .view {
55
- padding: 0 24px;
56
- }
57
- }
58
-
59
- /* small desktop screens */
60
- @media only screen and (max-width : 600px) {
61
- }
62
-
63
- /* low resolution desktop */
64
- @media only screen and (max-width : 1200px) {
65
- .view {
66
-
67
- }
68
- }
1
+ .view {
2
+ padding: 0 32px;
3
+ background-color: #ffffff;
4
+ border-radius: 4px;
5
+ }
6
+
7
+ .window-unpinned .view {
8
+ width: 0 !important;;
9
+ }
10
+
11
+ .window-pinned .view {
12
+ padding: 0 8px;
13
+ }
14
+
15
+ .no-margin {
16
+ margin-left: 0 !important;
17
+ margin-right: 0 !important;
18
+ }
19
+
20
+ .no-padding {
21
+ padding-left: 0 !important;
22
+ padding-right: 0 !important;
23
+ }
24
+
25
+ .centered-flex-box {
26
+ display: flex;
27
+ align-Items: center;
28
+ justify-content: center
29
+ }
30
+
31
+ /* Smartphones (landscape); */
32
+ @media only screen and (min-device-width : 361px) and (max-device-width : 480px) {
33
+ .view {
34
+ padding: 0 16px;
35
+ }
36
+ }
37
+
38
+ /* Smartphones (portrait); */
39
+ @media only screen and (min-device-width : 280px) and (max-device-width : 360px) {
40
+ .view {
41
+ padding: 0 16px;
42
+ }
43
+ }
44
+
45
+ /* iPads (portrait and landscape); */
46
+ @media only screen and (min-device-width : 768px) and (max-device-width : 1024px) {
47
+ .view {
48
+ padding: 0 24px;
49
+ }
50
+ }
51
+
52
+ /* iPad 3 */
53
+ @media only screen and (min-device-width : 768px) and (max-device-width : 1024px) and (orientation : landscape) and (-webkit-min-device-pixel-ratio : 2) {
54
+ .view {
55
+ padding: 0 24px;
56
+ }
57
+ }
58
+
59
+ /* small desktop screens */
60
+ @media only screen and (max-width : 600px) {
61
+ }
62
+
63
+ /* low resolution desktop */
64
+ @media only screen and (max-width : 1200px) {
65
+ .view {
66
+
67
+ }
68
+ }
@@ -1,36 +1,36 @@
1
- .loaderModal {
2
- display: block; /* Hidden by default */
3
- position: fixed; /* Stay in place */
4
- z-index: 3000; /* Sit on top */
5
- left: 0;
6
- top: 0;
7
- width: 100vw; /* Full width */
8
- height: 100vh; /* Full height */
9
- overflow: hidden; /* Enable scroll if needed */
10
- background-color: rgb(0,0,0); /* Fallback color */
11
- background-color: rgba(0,0,0,0.1); /* Black w/ opacity */
12
- }
13
-
14
- /* Modal Content/Box */
15
- .modal-content {
16
- background-color: transparent;
17
- margin: 30% auto; /* 15% from the top and centered */
18
- padding: 20px;
19
- border: 1px solid #888;
20
- width: 10%; /* Could be more or less, depending on screen size */
21
- }
22
-
23
- /* The Close Button */
24
- .close {
25
- color: #aaa;
26
- float: right;
27
- font-size: 28px;
28
- font-weight: bold;
29
- }
30
-
31
- .close:hover,
32
- .close:focus {
33
- color: black;
34
- text-decoration: none;
35
- cursor: pointer;
36
- }
1
+ .loaderModal {
2
+ display: block; /* Hidden by default */
3
+ position: fixed; /* Stay in place */
4
+ z-index: 3000; /* Sit on top */
5
+ left: 0;
6
+ top: 0;
7
+ width: 100vw; /* Full width */
8
+ height: 100vh; /* Full height */
9
+ overflow: hidden; /* Enable scroll if needed */
10
+ background-color: rgb(0,0,0); /* Fallback color */
11
+ background-color: rgba(0,0,0,0.1); /* Black w/ opacity */
12
+ }
13
+
14
+ /* Modal Content/Box */
15
+ .modal-content {
16
+ background-color: transparent;
17
+ margin: 30% auto; /* 15% from the top and centered */
18
+ padding: 20px;
19
+ border: 1px solid #888;
20
+ width: 10%; /* Could be more or less, depending on screen size */
21
+ }
22
+
23
+ /* The Close Button */
24
+ .close {
25
+ color: #aaa;
26
+ float: right;
27
+ font-size: 28px;
28
+ font-weight: bold;
29
+ }
30
+
31
+ .close:hover,
32
+ .close:focus {
33
+ color: black;
34
+ text-decoration: none;
35
+ cursor: pointer;
36
+ }
@@ -78,7 +78,6 @@ const TrainingRoom = /*#__PURE__*/_react.default.memo(/*#__PURE__*/_react.defaul
78
78
  case _VCEventType.VCEventType.REQUEST_TO_JOIN_MEETING:
79
79
  break;
80
80
  case _VCEventType.VCEventType.USER_JOINED:
81
- alert('USER JOIN FIREEEEE...');
82
81
  addUser(be.payload);
83
82
  break;
84
83
  case _VCEventType.VCEventType.USER_LEFT_MEETING:
@@ -1,4 +1,4 @@
1
- .user-video {
2
- min-width: 280px;
3
- height: 280px;
4
- }
1
+ .user-video {
2
+ min-width: 280px;
3
+ height: 280px;
4
+ }