@unbxd-ui/unbxd-react-components 0.2.119 → 0.2.120

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.
@@ -117,6 +117,10 @@ var ServerPaginatedDDList = function ServerPaginatedDDList(props) {
117
117
  _useState10 = _slicedToArray(_useState9, 2),
118
118
  isNextPageLoading = _useState10[0],
119
119
  setIsNextPageLoading = _useState10[1];
120
+ var _useState11 = (0, _react.useState)(false),
121
+ _useState12 = _slicedToArray(_useState11, 2),
122
+ isApiLoading = _useState12[0],
123
+ setIsApiLoading = _useState12[1];
120
124
  var debouncedFn = (0, _react.useRef)();
121
125
  var getDefaultPageNo = function getDefaultPageNo() {
122
126
  return minPageNo !== null && minPageNo !== void 0 ? minPageNo : 1;
@@ -155,6 +159,7 @@ var ServerPaginatedDDList = function ServerPaginatedDDList(props) {
155
159
  };
156
160
  var makeAPICall = function makeAPICall() {
157
161
  var _objectSpread2;
162
+ setIsApiLoading(true);
158
163
  apiCallRef.current = true;
159
164
  abortController.current = new AbortController();
160
165
  setIsNextPageLoading(true);
@@ -166,6 +171,7 @@ var ServerPaginatedDDList = function ServerPaginatedDDList(props) {
166
171
  });
167
172
  def.done(function (response) {
168
173
  onDataLoaded(response);
174
+ setIsApiLoading(false);
169
175
  });
170
176
  return def;
171
177
  };
@@ -235,7 +241,7 @@ var ServerPaginatedDDList = function ServerPaginatedDDList(props) {
235
241
  showClippedContentTitle: showClippedContentTitle
236
242
  }, restProps);
237
243
  if (total === null) {
238
- if (LoaderComponent) {
244
+ if (LoaderComponent && isApiLoading) {
239
245
  return LoaderComponent;
240
246
  }
241
247
  return [];
@@ -188,7 +188,9 @@ var BaseTable = function BaseTable(props, ref) {
188
188
  ExpandedRowComponent = props.ExpandedRowComponent,
189
189
  noDataComponent = props.noDataComponent,
190
190
  sortByConfig = props.sortByConfig,
191
- resetPageNo = props.resetPageNo;
191
+ resetPageNo = props.resetPageNo,
192
+ pageNo = props.pageNo,
193
+ tbodyClassName = props.tbodyClassName;
192
194
  var _DEFAULT_CHECKBOX_CON = _objectSpread(_objectSpread({}, DEFAULT_CHECKBOX_CONFIG), checkboxConfig || {}),
193
195
  showCheckbox = _DEFAULT_CHECKBOX_CON.enabled,
194
196
  showInHeader = _DEFAULT_CHECKBOX_CON.showInHeader;
@@ -247,7 +249,12 @@ var BaseTable = function BaseTable(props, ref) {
247
249
  };
248
250
  });
249
251
  if (records.length === 0) {
250
- return noDataComponent;
252
+ if (pageNo === 1) {
253
+ return noDataComponent;
254
+ } else {
255
+ var LoaderComponent = _utils["default"].getDefaultConfig("DefaultLoader") || "";
256
+ return /*#__PURE__*/_react["default"].createElement(LoaderComponent, null);
257
+ }
251
258
  } else {
252
259
  return /*#__PURE__*/_react["default"].createElement("table", {
253
260
  className: "RCB-table ".concat(className)
@@ -289,7 +296,9 @@ var BaseTable = function BaseTable(props, ref) {
289
296
  className: className,
290
297
  key: key
291
298
  }, thAttrs), label);
292
- }))), /*#__PURE__*/_react["default"].createElement("tbody", null, records.map(function (rowData, index) {
299
+ }))), /*#__PURE__*/_react["default"].createElement("tbody", {
300
+ className: tbodyClassName
301
+ }, records.map(function (rowData, index) {
293
302
  return /*#__PURE__*/_react["default"].createElement(RowComponent, {
294
303
  key: rowData[idAttribute],
295
304
  isEven: _utils["default"].isEven(index),
@@ -10,7 +10,7 @@ var _BaseTable = _interopRequireDefault(require("./BaseTable"));
10
10
  var _DataLoader = _interopRequireDefault(require("../DataLoader"));
11
11
  var _PaginationComponent = _interopRequireDefault(require("./PaginationComponent"));
12
12
  var _utils = _interopRequireDefault(require("../../core/utils"));
13
- 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"];
13
+ 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"];
14
14
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
15
15
  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); }
16
16
  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 && Object.prototype.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; }
@@ -123,6 +123,7 @@ var Table = function Table(props, ref) {
123
123
  getUrlParams = props.getUrlParams,
124
124
  getRequestParams = props.getRequestParams,
125
125
  checkboxConfig = props.checkboxConfig,
126
+ tbodyClassName = props.tbodyClassName,
126
127
  restProps = _objectWithoutProperties(props, _excluded);
127
128
  /* variables for server data */
128
129
  var _useState = (0, _react.useState)([]),
@@ -238,6 +239,8 @@ var Table = function Table(props, ref) {
238
239
  checkboxConfig: checkboxConfig,
239
240
  idAttribute: idAttribute,
240
241
  noDataComponent: noDataComponent,
242
+ pageNo: pageNo,
243
+ tbodyClassName: tbodyClassName,
241
244
  sortByConfig: sortByConfig,
242
245
  onSort: onSort,
243
246
  resetPageNo: resetPageNo,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unbxd-ui/unbxd-react-components",
3
- "version": "0.2.119",
3
+ "version": "0.2.120",
4
4
  "description": "React components library",
5
5
  "keywords": [
6
6
  "react components",