@luminati-io/uikit 3.9.1 → 3.9.2-beta.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -40191,6 +40191,9 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
40191
40191
 
40192
40192
 
40193
40193
  var assign = Object.assign;
40194
+ var defaultContextValue = {};
40195
+ var TableContext = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createContext(defaultContextValue);
40196
+ TableContext.displayName = 'TableContext';
40194
40197
  var defaultPropGetter = function defaultPropGetter() {
40195
40198
  return {};
40196
40199
  };
@@ -40198,9 +40201,7 @@ var defaultIsCellEditable = function defaultIsCellEditable(_ref) {
40198
40201
  var column = _ref.column;
40199
40202
  return column.canEdit;
40200
40203
  };
40201
- var defaultContextValue = {};
40202
- var TableContext = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createContext(defaultContextValue);
40203
- TableContext.displayName = 'TableContext';
40204
+ var defaultPageSizes = [5, 10, 20, 30];
40204
40205
  var Cell = function Cell(_ref2) {
40205
40206
  var value = _ref2.value;
40206
40207
  return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_typography__WEBPACK_IMPORTED_MODULE_5__.Paragraph, {
@@ -40208,18 +40209,24 @@ var Cell = function Cell(_ref2) {
40208
40209
  color: "gray-11-50"
40209
40210
  }, String(value));
40210
40211
  };
40212
+ var defaultColumn = {
40213
+ minWidth: 100,
40214
+ Cell: Cell
40215
+ };
40216
+ var emptyArray = [];
40217
+ var emptyObject = {};
40211
40218
  var Provider = function Provider(_ref3) {
40212
40219
  var _columns$;
40213
40220
  var columns = _ref3.columns,
40214
40221
  _ref3$data = _ref3.data,
40215
- data = _ref3$data === void 0 ? [] : _ref3$data,
40222
+ data = _ref3$data === void 0 ? emptyArray : _ref3$data,
40216
40223
  pageSize = _ref3.pageSize,
40217
40224
  _ref3$pageSizes = _ref3.pageSizes,
40218
- pageSizes = _ref3$pageSizes === void 0 ? [5, 10, 20, 30] : _ref3$pageSizes,
40225
+ pageSizes = _ref3$pageSizes === void 0 ? defaultPageSizes : _ref3$pageSizes,
40219
40226
  children = _ref3.children,
40220
40227
  stateManager = _ref3.stateManager,
40221
40228
  _ref3$hooks = _ref3.hooks,
40222
- hooks = _ref3$hooks === void 0 ? [] : _ref3$hooks,
40229
+ hooks = _ref3$hooks === void 0 ? emptyArray : _ref3$hooks,
40223
40230
  NoDataComp = _ref3.NoDataComp,
40224
40231
  LoadingComp = _ref3.LoadingComp,
40225
40232
  _ref3$ExpandHandleCom = _ref3.ExpandHandleComp,
@@ -40251,7 +40258,7 @@ var Provider = function Provider(_ref3) {
40251
40258
  canOrderColumns = _ref3$canOrderColumns === void 0 ? false : _ref3$canOrderColumns,
40252
40259
  rowActions = _ref3.rowActions,
40253
40260
  _ref3$columnSort = _ref3.columnSort,
40254
- columnSort = _ref3$columnSort === void 0 ? {} : _ref3$columnSort,
40261
+ columnSort = _ref3$columnSort === void 0 ? emptyObject : _ref3$columnSort,
40255
40262
  onColumnSortChanged = _ref3.onColumnSortChanged,
40256
40263
  _ref3$isCellEditable = _ref3.isCellEditable,
40257
40264
  isCellEditable = _ref3$isCellEditable === void 0 ? defaultIsCellEditable : _ref3$isCellEditable,
@@ -40274,13 +40281,7 @@ var Provider = function Provider(_ref3) {
40274
40281
  _ref3$rowDensity = _ref3.rowDensity,
40275
40282
  rowDensity = _ref3$rowDensity === void 0 ? 'busy_bee' : _ref3$rowDensity,
40276
40283
  rest = _objectWithoutProperties(_ref3, _excluded);
40277
- var defaultColumn = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(function () {
40278
- return {
40279
- minWidth: 100,
40280
- Cell: Cell
40281
- };
40282
- }, []);
40283
- var _useState = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(undefined),
40284
+ var _useState = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(0),
40284
40285
  _useState2 = _slicedToArray(_useState, 2),
40285
40286
  pageCount = _useState2[0],
40286
40287
  setPageCount = _useState2[1];
@@ -40291,19 +40292,17 @@ var Provider = function Provider(_ref3) {
40291
40292
  var hiddenColumns = (0,_util__WEBPACK_IMPORTED_MODULE_6__.firstDefined)(stateManager === null || stateManager === void 0 ? void 0 : stateManager.get('hiddenColumns'), _hiddenColumns);
40292
40293
  var pinnedColumns = (0,_util__WEBPACK_IMPORTED_MODULE_6__.firstDefined)(stateManager === null || stateManager === void 0 ? void 0 : stateManager.get('pinnedColumns'), _pinnedColumns);
40293
40294
  var columnOrder = (0,_util__WEBPACK_IMPORTED_MODULE_6__.firstDefined)(stateManager === null || stateManager === void 0 ? void 0 : stateManager.get('columnOrder'), _columnOrder);
40294
- var initialState = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(function () {
40295
- return assign({}, _initialState, pageSize && {
40296
- pageSize: pageSize
40297
- }, hiddenColumns && {
40298
- hiddenColumns: hiddenColumns
40299
- }, pinnedColumns && {
40300
- pinnedColumns: pinnedColumns
40301
- }, columnOrder && {
40302
- columnOrder: columnOrder
40303
- }, selectedRowIds && {
40304
- selectedRowIds: selectedRowIds
40305
- });
40306
- }, [_initialState, pageSize, hiddenColumns, pinnedColumns, columnOrder, selectedRowIds]);
40295
+ var initialState = assign({}, _initialState, pageSize && {
40296
+ pageSize: pageSize
40297
+ }, hiddenColumns && {
40298
+ hiddenColumns: hiddenColumns
40299
+ }, pinnedColumns && {
40300
+ pinnedColumns: pinnedColumns
40301
+ }, columnOrder && {
40302
+ columnOrder: columnOrder
40303
+ }, selectedRowIds && {
40304
+ selectedRowIds: selectedRowIds
40305
+ });
40307
40306
  var table = react_table__WEBPACK_IMPORTED_MODULE_2__.useTable.apply(void 0, [Object.assign(_objectSpread({
40308
40307
  columns: columns,
40309
40308
  data: data,