@agilemotion/oui-react-js 1.8.16 → 1.8.18

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.
@@ -202,8 +202,8 @@ const DataGrid = exports.DataGrid = /*#__PURE__*/_react.default.memo(/*#__PURE__
202
202
  }
203
203
  return children;
204
204
  },
205
- loadData: actionConfig => {
206
- search(actionConfig);
205
+ loadData: (actionConfig, event) => {
206
+ search(actionConfig, event);
207
207
  },
208
208
  deleteSelectedRows: () => {
209
209
  // TODO : dispose from observer
@@ -398,6 +398,7 @@ const DataGrid = exports.DataGrid = /*#__PURE__*/_react.default.memo(/*#__PURE__
398
398
  }
399
399
  const search = function () {
400
400
  let actionConfig = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
401
+ let event = arguments.length > 1 ? arguments[1] : undefined;
401
402
  let conf = config;
402
403
  if (_Utils.default.isNull(conf)) {
403
404
  conf = _Utils.default.parseConfig(props.config, props.viewId);
@@ -413,11 +414,13 @@ const DataGrid = exports.DataGrid = /*#__PURE__*/_react.default.memo(/*#__PURE__
413
414
  method({
414
415
  service: service,
415
416
  component: props.handle,
416
- viewId: props.viewId
417
+ viewId: props.viewId,
418
+ event
417
419
  }).then(result => {
418
420
  processData(result, conf);
419
421
  }).catch(e => {
420
422
  console.error(e);
423
+ _Utils.default.publishErrorMessage(e, props.viewId);
421
424
  });
422
425
  } else {
423
426
  throw new Error('Unknown service type : ' + serviceType);
@@ -3,13 +3,27 @@
3
3
  .stepVisited {
4
4
  }
5
5
 
6
- .box, .dot {
6
+ .box, .box-pending, .dot {
7
7
  border-radius: 100px;
8
- display: inline-block;
9
8
  text-align: center;
10
- font-size: 18px;
9
+ font-size: 14px;
11
10
  color: #888888;
12
11
  border: 1px solid #888888;
12
+ display: flex;
13
+ justify-content: center;
14
+ }
15
+
16
+ .box-pending {
17
+ border: unset;
18
+ border-right: 1px solid #888888;
19
+ border-top: 1px solid #888888;
20
+ border-bottom: 1px solid #888888;
21
+ }
22
+
23
+ .line {
24
+ border-top: 1px solid #888888;
25
+ width: 100%;
26
+ height: 1px;
13
27
  }
14
28
 
15
29
  .step .box,
@@ -32,15 +46,15 @@
32
46
  .dot {
33
47
  width: 30px;
34
48
  height: 30px;
49
+ font-size: 18px;
35
50
  }
36
51
 
37
52
  .stepActive .dot {
38
- color: #ffffff;
53
+ color: #000000;
39
54
  border-color: #ffffff;
40
55
  }
41
56
 
42
57
  .stepVisited .dot {
43
- color: #ffffff;
44
58
  }
45
59
 
46
60
  .leftLine,
@@ -14,8 +14,13 @@ require("./StepperTitleBar.css");
14
14
  var _jquery = _interopRequireDefault(require("jquery"));
15
15
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
16
16
  const useStyles = (0, _styles.makeStyles)(theme => ({
17
- theme: {
18
- backgroundColor: theme.palette.secondary.main
17
+ primary: {
18
+ backgroundColor: theme.palette.primary.main,
19
+ border: '1px solid ' + theme.palette.primary.main
20
+ },
21
+ secondary: {
22
+ backgroundColor: theme.palette.secondary.main,
23
+ border: '1px solid ' + theme.palette.secondary.main
19
24
  },
20
25
  themeBorder: {
21
26
  borderColor: theme.palette.secondary.main
@@ -31,7 +36,11 @@ const StepperTitleBar = /*#__PURE__*/_react.default.memo(/*#__PURE__*/_react.def
31
36
  const classes = useStyles();
32
37
  _react.default.useEffect(() => {
33
38
  props.handle.api = api();
39
+ recalcLinePosition();
34
40
  });
41
+ _react.default.useLayoutEffect(() => {
42
+ recalcLinePosition();
43
+ }, []);
35
44
  _react.default.useEffect(() => {
36
45
  let parsedConfig = _Utils.default.parseConfig(props.config, props.viewId);
37
46
  let eventHandlingConfig = _Utils.default.isNull(parsedConfig.eventHandlingConfig) ? {} : parsedConfig.eventHandlingConfig;
@@ -90,46 +99,73 @@ const StepperTitleBar = /*#__PURE__*/_react.default.memo(/*#__PURE__*/_react.def
90
99
  return /*#__PURE__*/_react.default.createElement("div", {
91
100
  className: graphicsCounter === currentIndex.current ? `stepActive` : graphicsCounter < currentIndex.current ? 'stepVisited' : 'step'
92
101
  }, graphicsCounter > 0 ? /*#__PURE__*/_react.default.createElement("div", {
93
- className: (graphicsCounter <= currentIndex.current ? `${classes.themeBorder} ` : '') + 'leftLine' + (graphicsCounter === steps.length - 1 ? ' lastLine' : '')
102
+ className: (graphicsCounter <= currentIndex.current ? `${classes.themeBorder} ` : '') + '' + (graphicsCounter === steps.length - 1 ? ' lastLine' : '')
94
103
  }) : null, /*#__PURE__*/_react.default.createElement("div", {
95
- className: (graphicsCounter <= currentIndex.current ? `${classes.theme} box row` : 'box') + (graphicsCounter === 0 ? ' firstBox' : ''),
104
+ className: 'row flex' + (graphicsCounter === 0 ? ' firstBox' : ''),
96
105
  style: {
97
106
  marginLeft: 'unset',
98
- marginRight: 'unset'
107
+ marginRight: 'unset',
108
+ width: '100%'
99
109
  },
100
110
  id: 'step-' + graphicsCounter
101
111
  }, /*#__PURE__*/_react.default.createElement("div", {
102
- className: 'dot col-*-*'
103
- }, step.index + 1), graphicsCounter === currentIndex.current ? /*#__PURE__*/_react.default.createElement("div", {
104
- className: `title col-*-*`,
105
- id: "titleDiv"
106
- }, step.title) : null), graphicsCounter < steps.length - 1 ? /*#__PURE__*/_react.default.createElement("div", {
107
- className: (graphicsCounter < currentIndex.current ? `${classes.themeBorder} ` : '') + 'rightLine' + (graphicsCounter === 0 ? ' firstLine' : '')
112
+ style: {
113
+ whiteSpace: "nowrap"
114
+ },
115
+ className: (graphicsCounter < currentIndex.current ? `${classes.secondary} box` : graphicsCounter === currentIndex.current ? `${classes.primary} box` : 'box-pending') + ' row no-margin no-padding'
116
+ }, /*#__PURE__*/_react.default.createElement("div", {
117
+ className: 'dot col-*-*',
118
+ style: {
119
+ color: graphicsCounter < currentIndex.current ? '#ffffff' : null
120
+ }
121
+ }, step.index + 1), graphicsCounter <= currentIndex.current ? /*#__PURE__*/_react.default.createElement("div", {
122
+ className: `col-*-*`,
123
+ id: "titleDiv",
124
+ style: {
125
+ alignContent: 'center',
126
+ color: graphicsCounter === currentIndex.current ? '#000000' : '#ffffff',
127
+ margin: '0 4px'
128
+ }
129
+ }, step.title) : /*#__PURE__*/_react.default.createElement("div", {
130
+ className: `col-*-*`,
131
+ id: "titleDiv",
132
+ style: {
133
+ alignContent: 'center',
134
+ color: '#888888',
135
+ margin: '0 4px'
136
+ }
137
+ }, step.title)), graphicsCounter < steps.length - 1 && /*#__PURE__*/_react.default.createElement("div", {
138
+ style: {
139
+ flex: 1,
140
+ overflow: "hidden",
141
+ alignContent: 'center'
142
+ },
143
+ className: 'col-*-*'
144
+ }, /*#__PURE__*/_react.default.createElement("div", {
145
+ className: 'line'
146
+ }, "\xA0"))), graphicsCounter < steps.length - 1 ? /*#__PURE__*/_react.default.createElement("div", {
147
+ className: (graphicsCounter < currentIndex.current ? `${classes.themeBorder} ` : '') + '' + (graphicsCounter === 0 ? ' firstLine' : '')
108
148
  }) : null, graphicsCounter++ ? null : null);
109
149
  }
110
150
  function render() {
111
151
  return /*#__PURE__*/_react.default.createElement("div", {
112
152
  className: "w-100",
113
153
  style: {
114
- width: "100%"
115
- }
116
- }, /*#__PURE__*/_react.default.createElement("table", {
117
- cellPadding: "0",
118
- style: {
119
- borderCollapse: "collapse",
120
- width: "100%"
154
+ display: "flex",
155
+ width: "100%",
156
+ margin: "0 0 16px 0"
121
157
  }
122
- }, /*#__PURE__*/_react.default.createElement("tbody", null, /*#__PURE__*/_react.default.createElement("tr", null, steps.map(step => /*#__PURE__*/_react.default.createElement("td", {
123
- align: graphicsCounter === 0 ? 'left' : graphicsCounter === steps.length - 1 ? 'right' : 'center',
158
+ }, steps.map(step => /*#__PURE__*/_react.default.createElement("div", {
159
+ align: graphicsCounter === 0 ? "left" : graphicsCounter === steps.length - 1 ? "right" : "center",
124
160
  key: keyCounter++,
125
161
  style: {
126
162
  whiteSpace: "nowrap",
127
- paddingTop: '8px',
128
- maxHeight: '8px',
129
- width: (graphicsCounter === currentIndex.current ? activeSegmentPercentage : 10) + '%'
163
+ paddingTop: "8px",
164
+ maxHeight: "8px",
165
+ width: 100 / steps.length + "%"
130
166
  },
131
- id: 'step-container-' + counter++
132
- }, renderStep(step)))))));
167
+ id: "step-container-" + counter++
168
+ }, renderStep(step))));
133
169
  }
134
170
  return /*#__PURE__*/_react.default.createElement("div", null, !_Utils.default.isNull(props.config) ? /*#__PURE__*/_react.default.createElement("div", {
135
171
  style: _Utils.default.mergeStyles({
@@ -22,6 +22,7 @@ const View = props => {
22
22
  const [layoutHandle] = _react.default.useState({});
23
23
  const [model] = _react.default.useState({});
24
24
  const loadingRef = _react.default.useRef(true);
25
+ const paramsLoaded = _react.default.useRef(false);
25
26
  function registerInlineScriptLibraries() {
26
27
  if (!_Utils.default.isNull(props.config.lib)) {
27
28
  let libName = props.config.id + '_lib';
@@ -116,11 +117,18 @@ const View = props => {
116
117
  });
117
118
  }
118
119
  const api = () => {
120
+ if (!paramsLoaded.current && !_Utils.default.isNull(props.parameters)) {
121
+ doUpdateModel(props.parameters);
122
+ paramsLoaded.current = true;
123
+ }
119
124
  return {
120
125
  get id() {
121
126
  // View
122
127
  return props.config.id;
123
128
  },
129
+ get parameters() {
130
+ return props.parameters;
131
+ },
124
132
  get model() {
125
133
  let children = layoutHandle.api.getChildren();
126
134
  for (const child of children) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agilemotion/oui-react-js",
3
- "version": "1.8.16",
3
+ "version": "1.8.18",
4
4
  "files": [
5
5
  "dist"
6
6
  ],