@unbxd-ui/unbxd-react-components 0.2.134 → 0.2.136
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.
|
@@ -38,6 +38,7 @@ var InlineModal = function InlineModal(props, ref) {
|
|
|
38
38
|
isModalOpen = _useState2[0],
|
|
39
39
|
setIsModalOpen = _useState2[1];
|
|
40
40
|
var activatorProps = {};
|
|
41
|
+
var modalCloseProps = {};
|
|
41
42
|
var inlineModalClassName = "RCB-inline-modal ".concat(className);
|
|
42
43
|
var _useState3 = (0, _react.useState)(isModalOpen),
|
|
43
44
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
@@ -48,7 +49,7 @@ var InlineModal = function InlineModal(props, ref) {
|
|
|
48
49
|
var inlineModalBodyRef = (0, _react.useRef)();
|
|
49
50
|
var isFirstRun = (0, _react.useRef)(true);
|
|
50
51
|
(0, _react.useEffect)(function () {
|
|
51
|
-
setShowModalBody(isModalOpen);
|
|
52
|
+
if (isModalOpen !== undefined) setShowModalBody(isModalOpen);
|
|
52
53
|
}, [isModalOpen]);
|
|
53
54
|
var changeModalState = function changeModalState(newState) {
|
|
54
55
|
setIsModalOpen(newState);
|
|
@@ -57,6 +58,13 @@ var InlineModal = function InlineModal(props, ref) {
|
|
|
57
58
|
//e.stopPropagation();
|
|
58
59
|
changeModalState(!isModalOpen);
|
|
59
60
|
};
|
|
61
|
+
var onActivatorHover = function onActivatorHover(e) {
|
|
62
|
+
//e.stopPropagation();
|
|
63
|
+
setShowModalBody(true);
|
|
64
|
+
};
|
|
65
|
+
var onActivatorMouseOut = function onActivatorMouseOut(e) {
|
|
66
|
+
setShowModalBody(false);
|
|
67
|
+
};
|
|
60
68
|
var onBodyClick = function onBodyClick(e) {
|
|
61
69
|
var eventTarget = e.target;
|
|
62
70
|
var inlineModalNode = inlineModalRef.current;
|
|
@@ -107,8 +115,13 @@ var InlineModal = function InlineModal(props, ref) {
|
|
|
107
115
|
onClick: onActivatorClick
|
|
108
116
|
};
|
|
109
117
|
} else if (activatorAction === "hover") {
|
|
110
|
-
|
|
111
|
-
|
|
118
|
+
activatorProps = {
|
|
119
|
+
onMouseOver: onActivatorHover
|
|
120
|
+
};
|
|
121
|
+
modalCloseProps = {
|
|
122
|
+
onMouseLeave: onActivatorMouseOut
|
|
123
|
+
};
|
|
124
|
+
// setShowModalBody(true);
|
|
112
125
|
}
|
|
113
126
|
|
|
114
127
|
/* add methods that can be accessed via this component's ref */
|
|
@@ -119,10 +132,10 @@ var InlineModal = function InlineModal(props, ref) {
|
|
|
119
132
|
}
|
|
120
133
|
};
|
|
121
134
|
});
|
|
122
|
-
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
135
|
+
return /*#__PURE__*/_react["default"].createElement("div", _extends({
|
|
123
136
|
className: inlineModalClassName,
|
|
124
137
|
ref: inlineModalRef
|
|
125
|
-
}, /*#__PURE__*/_react["default"].createElement("div", _extends({}, activatorProps, {
|
|
138
|
+
}, modalCloseProps), /*#__PURE__*/_react["default"].createElement("div", _extends({}, activatorProps, {
|
|
126
139
|
className: "RCB-inline-modal-btn ".concat(activatorClassName)
|
|
127
140
|
}), children[0]), showModalBody && /*#__PURE__*/_react["default"].createElement("div", {
|
|
128
141
|
className: "RCB-inline-modal-body RCB-align-".concat(halign),
|
|
@@ -194,7 +194,8 @@ var BaseTable = function BaseTable(props, ref) {
|
|
|
194
194
|
onRefreshTableData = props.onRefreshTableData,
|
|
195
195
|
isTableRefreshing = props.isTableRefreshing,
|
|
196
196
|
refreshIconClass = props.refreshIconClass,
|
|
197
|
-
spinnerIconClass = props.spinnerIconClass
|
|
197
|
+
spinnerIconClass = props.spinnerIconClass,
|
|
198
|
+
onRefreshCB = props.onRefreshCB;
|
|
198
199
|
var _DEFAULT_CHECKBOX_CON = _objectSpread(_objectSpread({}, DEFAULT_CHECKBOX_CONFIG), checkboxConfig || {}),
|
|
199
200
|
showCheckbox = _DEFAULT_CHECKBOX_CON.enabled,
|
|
200
201
|
showInHeader = _DEFAULT_CHECKBOX_CON.showInHeader;
|
|
@@ -229,6 +230,7 @@ var BaseTable = function BaseTable(props, ref) {
|
|
|
229
230
|
return selected;
|
|
230
231
|
};
|
|
231
232
|
var refreshTableData = function refreshTableData() {
|
|
233
|
+
if (onRefreshCB) onRefreshCB();
|
|
232
234
|
onRefreshTableData();
|
|
233
235
|
};
|
|
234
236
|
var updateCheckboxValue = function updateCheckboxValue(newValue) {
|
|
@@ -11,7 +11,7 @@ var _DataLoader = _interopRequireDefault(require("../DataLoader"));
|
|
|
11
11
|
var _PaginationComponent = _interopRequireDefault(require("./PaginationComponent"));
|
|
12
12
|
var _utils = _interopRequireDefault(require("../../core/utils"));
|
|
13
13
|
var _dataLoader = _interopRequireDefault(require("../../core/dataLoader"));
|
|
14
|
-
var _excluded = ["className", "wrapperClassName", "records", "columnConfigs", "idAttribute", "searchBy", "getRequestKeys", "showPaginateBar", "paginationPosition", "paginationType", "paginationBar", "requestId", "pageNoKey", "perPageKey", "pageSizeList", "isExpandableTable", "ExpandedRowComponent", "responseFormatter", "noDataComponent", "omitProps", "getUrlParams", "getRequestParams", "checkboxConfig", "tbodyClassName", "refreshFeature", "refreshIconClass", "spinnerIconClass"];
|
|
14
|
+
var _excluded = ["className", "wrapperClassName", "records", "columnConfigs", "idAttribute", "searchBy", "getRequestKeys", "showPaginateBar", "paginationPosition", "paginationType", "paginationBar", "requestId", "pageNoKey", "perPageKey", "pageSizeList", "isExpandableTable", "ExpandedRowComponent", "responseFormatter", "noDataComponent", "omitProps", "getUrlParams", "getRequestParams", "checkboxConfig", "tbodyClassName", "refreshFeature", "refreshIconClass", "spinnerIconClass", "onRefreshCB"];
|
|
15
15
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
16
16
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
17
17
|
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; }
|
|
@@ -128,6 +128,7 @@ var Table = function Table(props, ref) {
|
|
|
128
128
|
refreshFeature = _props$refreshFeature === void 0 ? false : _props$refreshFeature,
|
|
129
129
|
refreshIconClass = props.refreshIconClass,
|
|
130
130
|
spinnerIconClass = props.spinnerIconClass,
|
|
131
|
+
onRefreshCB = props.onRefreshCB,
|
|
131
132
|
restProps = _objectWithoutProperties(props, _excluded);
|
|
132
133
|
/* variables for server data */
|
|
133
134
|
var _useState = (0, _react.useState)([]),
|
|
@@ -263,6 +264,7 @@ var Table = function Table(props, ref) {
|
|
|
263
264
|
isTableRefreshing: isTableRefreshing,
|
|
264
265
|
refreshFeature: refreshFeature,
|
|
265
266
|
refreshIconClass: refreshIconClass,
|
|
267
|
+
onRefreshCB: onRefreshCB,
|
|
266
268
|
spinnerIconClass: spinnerIconClass,
|
|
267
269
|
onRefreshTableData: onRefreshTableData,
|
|
268
270
|
sortByConfig: sortByConfig,
|
|
@@ -323,7 +325,15 @@ Table.propTypes = _objectSpread(_objectSpread({}, _BaseTable["default"].propType
|
|
|
323
325
|
/** If paginationType is "SERVER", function that is expected to return the URL Params object */
|
|
324
326
|
getUrlParams: _propTypes["default"].func,
|
|
325
327
|
/** If paginationType is "SERVER", function that is expected to return the Request Params object */
|
|
326
|
-
getRequestParams: _propTypes["default"].func
|
|
328
|
+
getRequestParams: _propTypes["default"].func,
|
|
329
|
+
/** If refreshFeature is true will have refresh option on table */
|
|
330
|
+
refreshFeature: _propTypes["default"].bool,
|
|
331
|
+
/** refresh icon class */
|
|
332
|
+
refreshIconClass: _propTypes["default"].string,
|
|
333
|
+
/** spinnerIcon is used when we have refreshFeature equal to true */
|
|
334
|
+
spinnerIconClass: _propTypes["default"].string,
|
|
335
|
+
/** If on table refresh we want to handle something we can add it in call back */
|
|
336
|
+
onRefreshCB: _propTypes["default"].func
|
|
327
337
|
});
|
|
328
338
|
Table.defaultProps = _objectSpread(_objectSpread({}, _BaseTable["default"].defaultProps), {}, {
|
|
329
339
|
pageSizeList: [{
|