@cubejs-client/react 0.34.46 → 0.35.0

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.
@@ -10200,8 +10200,10 @@
10200
10200
 
10201
10201
  if (id === 'measures') {
10202
10202
  destinationIndex = lastIndex + 1;
10203
- } else if (destinationIndex >= lastIndex && nextPivotConfig[destinationAxis][lastIndex] === 'measures') {
10203
+ } else if (sourceAxis === destinationAxis && destinationIndex >= lastIndex && nextPivotConfig[destinationAxis][lastIndex] === 'measures') {
10204
10204
  destinationIndex = lastIndex - 1;
10205
+ } else if (sourceAxis !== destinationAxis && destinationIndex > lastIndex && nextPivotConfig[destinationAxis][lastIndex] === 'measures') {
10206
+ destinationIndex = lastIndex;
10205
10207
  }
10206
10208
 
10207
10209
  nextPivotConfig[sourceAxis].splice(sourceIndex, 1);
@@ -11238,7 +11240,7 @@
11238
11240
  query = _this$props2.query,
11239
11241
  queries = _this$props2.queries,
11240
11242
  render = _this$props2.render,
11241
- cubejsApi = _this$props2.cubejsApi,
11243
+ cubeApi = _this$props2.cubeApi,
11242
11244
  loadSql = _this$props2.loadSql,
11243
11245
  updateOnlyOnStateChange = _this$props2.updateOnlyOnStateChange;
11244
11246
 
@@ -11246,7 +11248,7 @@
11246
11248
  return true;
11247
11249
  }
11248
11250
 
11249
- return !equals(nextProps.query, query) || !equals(nextProps.queries, queries) || (nextProps.render == null || render == null) && nextProps.render !== render || nextProps.cubejsApi !== cubejsApi || nextProps.loadSql !== loadSql || !equals(nextState, this.state) || nextProps.updateOnlyOnStateChange !== updateOnlyOnStateChange;
11251
+ return !equals(nextProps.query, query) || !equals(nextProps.queries, queries) || (nextProps.render == null || render == null) && nextProps.render !== render || nextProps.cubeApi !== cubeApi || nextProps.loadSql !== loadSql || !equals(nextState, this.state) || nextProps.updateOnlyOnStateChange !== updateOnlyOnStateChange;
11250
11252
  }
11251
11253
  }, {
11252
11254
  key: "componentDidUpdate",
@@ -11264,10 +11266,10 @@
11264
11266
  }
11265
11267
  }
11266
11268
  }, {
11267
- key: "cubejsApi",
11268
- value: function cubejsApi() {
11269
+ key: "cubeApi",
11270
+ value: function cubeApi() {
11269
11271
  // eslint-disable-next-line react/destructuring-assignment
11270
- return this.props.cubejsApi || this.context && this.context.cubejsApi;
11272
+ return this.props.cubeApi || this.context && this.context.cubeApi;
11271
11273
  }
11272
11274
  }, {
11273
11275
  key: "load",
@@ -11283,11 +11285,11 @@
11283
11285
  resultSet: null
11284
11286
  } : {}));
11285
11287
  var loadSql = this.props.loadSql;
11286
- var cubejsApi = this.cubejsApi();
11288
+ var cubeApi = this.cubeApi();
11287
11289
 
11288
11290
  if (query && isQueryPresent(query)) {
11289
11291
  if (loadSql === 'only') {
11290
- cubejsApi.sql(query, {
11292
+ cubeApi.sql(query, {
11291
11293
  mutexObj: this.mutexObj,
11292
11294
  mutexKey: 'sql'
11293
11295
  }).then(function (sqlQuery) {
@@ -11305,10 +11307,10 @@
11305
11307
  }));
11306
11308
  });
11307
11309
  } else if (loadSql) {
11308
- Promise.all([cubejsApi.sql(query, {
11310
+ Promise.all([cubeApi.sql(query, {
11309
11311
  mutexObj: this.mutexObj,
11310
11312
  mutexKey: 'sql'
11311
- }), cubejsApi.load(query, {
11313
+ }), cubeApi.load(query, {
11312
11314
  mutexObj: this.mutexObj,
11313
11315
  mutexKey: 'query'
11314
11316
  })]).then(function (_ref) {
@@ -11331,7 +11333,7 @@
11331
11333
  }));
11332
11334
  });
11333
11335
  } else {
11334
- cubejsApi.load(query, {
11336
+ cubeApi.load(query, {
11335
11337
  mutexObj: this.mutexObj,
11336
11338
  mutexKey: 'query'
11337
11339
  }).then(function (resultSet) {
@@ -11356,7 +11358,7 @@
11356
11358
  value: function loadQueries(queries) {
11357
11359
  var _this3 = this;
11358
11360
 
11359
- var cubejsApi = this.cubejsApi();
11361
+ var cubeApi = this.cubeApi();
11360
11362
  var resetResultSetOnChange = this.props.resetResultSetOnChange;
11361
11363
  this.setState(_objectSpread$6(_objectSpread$6({
11362
11364
  isLoading: true
@@ -11370,7 +11372,7 @@
11370
11372
  name = _ref4[0],
11371
11373
  query = _ref4[1];
11372
11374
 
11373
- return cubejsApi.load(query, {
11375
+ return cubeApi.load(query, {
11374
11376
  mutexObj: _this3.mutexObj,
11375
11377
  mutexKey: name
11376
11378
  }).then(function (r) {
@@ -11433,7 +11435,7 @@
11433
11435
  _defineProperty(QueryRenderer, "contextType", CubeContext);
11434
11436
 
11435
11437
  _defineProperty(QueryRenderer, "defaultProps", {
11436
- cubejsApi: null,
11438
+ cubeApi: null,
11437
11439
  query: null,
11438
11440
  render: null,
11439
11441
  queries: null,
@@ -11742,7 +11744,7 @@
11742
11744
  while (1) {
11743
11745
  switch (_context.prev = _context.next) {
11744
11746
  case 0:
11745
- if (_this.cubejsApi()) {
11747
+ if (_this.cubeApi()) {
11746
11748
  _context.next = 2;
11747
11749
  break;
11748
11750
  }
@@ -11760,7 +11762,7 @@
11760
11762
  });
11761
11763
 
11762
11764
  _context.next = 9;
11763
- return _this.cubejsApi().meta();
11765
+ return _this.cubeApi().meta();
11764
11766
 
11765
11767
  case 9:
11766
11768
  meta = _context.sent;
@@ -11853,7 +11855,7 @@
11853
11855
  _this$props = this.props, schemaVersion = _this$props.schemaVersion, onSchemaChange = _this$props.onSchemaChange;
11854
11856
  meta = this.state.meta;
11855
11857
 
11856
- if (!(((_this$prevContext = this.prevContext) === null || _this$prevContext === void 0 ? void 0 : _this$prevContext.cubejsApi) !== ((_this$context = this.context) === null || _this$context === void 0 ? void 0 : _this$context.cubejsApi))) {
11858
+ if (!(((_this$prevContext = this.prevContext) === null || _this$prevContext === void 0 ? void 0 : _this$prevContext.cubeApi) !== ((_this$context = this.context) === null || _this$context === void 0 ? void 0 : _this$context.cubeApi))) {
11857
11859
  _context4.next = 6;
11858
11860
  break;
11859
11861
  }
@@ -11870,7 +11872,7 @@
11870
11872
 
11871
11873
  _context4.prev = 7;
11872
11874
  _context4.next = 10;
11873
- return this.cubejsApi().meta();
11875
+ return this.cubeApi().meta();
11874
11876
 
11875
11877
  case 10:
11876
11878
  newMeta = _context4.sent;
@@ -11930,11 +11932,11 @@
11930
11932
  return componentDidUpdate;
11931
11933
  }()
11932
11934
  }, {
11933
- key: "cubejsApi",
11934
- value: function cubejsApi() {
11935
- var cubejsApi = this.props.cubejsApi; // eslint-disable-next-line react/destructuring-assignment
11935
+ key: "cubeApi",
11936
+ value: function cubeApi() {
11937
+ var cubeApi = this.props.cubeApi; // eslint-disable-next-line react/destructuring-assignment
11936
11938
 
11937
- return cubejsApi || this.context && this.context.cubejsApi;
11939
+ return cubeApi || this.context && this.context.cubeApi;
11938
11940
  }
11939
11941
  }, {
11940
11942
  key: "getMissingMembers",
@@ -12300,7 +12302,7 @@
12300
12302
 
12301
12303
  _context5.prev = 16;
12302
12304
  _context5.next = 19;
12303
- return this.cubejsApi().dryRun(finalState.query, {
12305
+ return this.cubeApi().dryRun(finalState.query, {
12304
12306
  mutexObj: this.mutexObj
12305
12307
  });
12306
12308
 
@@ -12391,14 +12393,14 @@
12391
12393
 
12392
12394
  var query = this.state.query;
12393
12395
  var _this$props4 = this.props,
12394
- cubejsApi = _this$props4.cubejsApi,
12396
+ cubeApi = _this$props4.cubeApi,
12395
12397
  _render = _this$props4.render,
12396
12398
  wrapWithQueryRenderer = _this$props4.wrapWithQueryRenderer;
12397
12399
 
12398
12400
  if (wrapWithQueryRenderer) {
12399
12401
  return /*#__PURE__*/React__default['default'].createElement(QueryRenderer, {
12400
12402
  query: query,
12401
- cubejsApi: cubejsApi,
12403
+ cubeApi: cubeApi,
12402
12404
  resetResultSetOnChange: false,
12403
12405
  render: function render(queryRendererProps) {
12404
12406
  if (_render) {
@@ -12479,7 +12481,7 @@
12479
12481
  _defineProperty(QueryBuilder, "contextType", CubeContext);
12480
12482
 
12481
12483
  _defineProperty(QueryBuilder, "defaultProps", {
12482
- cubejsApi: null,
12484
+ cubeApi: null,
12483
12485
  stateChangeHeuristics: null,
12484
12486
  disableHeuristics: false,
12485
12487
  render: null,
@@ -12497,18 +12499,11 @@
12497
12499
 
12498
12500
  function CubeProvider(_ref) {
12499
12501
  var cubeApi = _ref.cubeApi,
12500
- cubejsApi = _ref.cubejsApi,
12501
12502
  children = _ref.children,
12502
12503
  _ref$options = _ref.options,
12503
12504
  options = _ref$options === void 0 ? {} : _ref$options;
12504
- React.useEffect(function () {
12505
- if (cubejsApi && !cubeApi) {
12506
- console.warn('"cubejsApi" is deprecated and will be removed in the following version. Use "cubeApi" instead.');
12507
- }
12508
- }, [cubeApi, cubejsApi]);
12509
12505
  return /*#__PURE__*/React__default['default'].createElement(CubeContext.Provider, {
12510
12506
  value: {
12511
- cubejsApi: cubejsApi,
12512
12507
  cubeApi: cubeApi,
12513
12508
  options: options
12514
12509
  }
@@ -12587,7 +12582,7 @@
12587
12582
  case 0:
12588
12583
  loadOptions = _args.length > 0 && _args[0] !== undefined ? _args[0] : {};
12589
12584
  ignoreSkip = _args.length > 1 && _args[1] !== undefined ? _args[1] : false;
12590
- cubeApi = options.cubeApi || options.cubejsApi || (context === null || context === void 0 ? void 0 : context.cubeApi) || (context === null || context === void 0 ? void 0 : context.cubejsApi);
12585
+ cubeApi = options.cubeApi || (context === null || context === void 0 ? void 0 : context.cubeApi);
12591
12586
  query = loadOptions.query || options.query;
12592
12587
  queryCondition = method === 'meta' ? true : query && isQueryPresent(query);
12593
12588
 
@@ -12732,12 +12727,6 @@
12732
12727
  return setProgress(progressResponse);
12733
12728
  };
12734
12729
 
12735
- React.useEffect(function () {
12736
- if (options.cubejsApi && !options.cubeApi) {
12737
- console.warn('"cubejsApi" is deprecated and will be removed in the following version. Use "cubeApi" instead.');
12738
- }
12739
- }, [options.cubeApi, options.cubejsApi]);
12740
-
12741
12730
  function fetch() {
12742
12731
  return _fetch.apply(this, arguments);
12743
12732
  }
@@ -12751,7 +12740,7 @@
12751
12740
  switch (_context2.prev = _context2.next) {
12752
12741
  case 0:
12753
12742
  resetResultSetOnChange = options.resetResultSetOnChange;
12754
- cubeApi = options.cubeApi || options.cubejsApi || (context === null || context === void 0 ? void 0 : context.cubeApi) || (context === null || context === void 0 ? void 0 : context.cubejsApi);
12743
+ cubeApi = options.cubeApi || (context === null || context === void 0 ? void 0 : context.cubeApi);
12755
12744
 
12756
12745
  if (cubeApi) {
12757
12746
  _context2.next = 4;
@@ -12816,7 +12805,7 @@
12816
12805
  var _options$skip = options.skip,
12817
12806
  skip = _options$skip === void 0 ? false : _options$skip,
12818
12807
  resetResultSetOnChange = options.resetResultSetOnChange;
12819
- var cubeApi = options.cubeApi || options.cubejsApi || (context === null || context === void 0 ? void 0 : context.cubeApi) || (context === null || context === void 0 ? void 0 : context.cubejsApi);
12808
+ var cubeApi = options.cubeApi || (context === null || context === void 0 ? void 0 : context.cubeApi);
12820
12809
 
12821
12810
  if (!cubeApi) {
12822
12811
  throw new Error('Cube API client is not provided');