@easyquery/enterprise 7.2.1-rc03 → 7.2.2-rc01

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.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * EasyQuery.JS Enterprise 7.2.1-rc03 (https://korzh.com/easyquery/javascript)
2
+ * EasyQuery.JS Enterprise 7.2.2-rc01 (https://korzh.com/easyquery/javascript)
3
3
  * Copyright 2022 Korzh.com. All rights reserved.
4
4
  *
5
5
  * EasyQuery.JS commercial licenses may be obtained at
@@ -3222,7 +3222,6 @@ var context_EqContext = /** @class */ (function () {
3222
3222
  /**
3223
3223
  * If `defaultModelId` property is define - this method calls `loadModel` function in the broker
3224
3224
  * to load the model with such ID.
3225
- *
3226
3225
  */
3227
3226
  EqContext.prototype.loadDefaultModel = function () {
3228
3227
  var _this = this;
@@ -26007,6 +26006,7 @@ var PivotTableFacet = /** @class */ (function (_super) {
26007
26006
  var dataTable = this.getContextDataTable();
26008
26007
  var csb = Object(_easydata_ui__WEBPACK_IMPORTED_MODULE_0__["domel"])('select');
26009
26008
  var firstNumericColIndex = null;
26009
+ var optionIndex = 0;
26010
26010
  var _loop_2 = function (i) {
26011
26011
  var column = dataTable.columns.get(i);
26012
26012
  var colLabel = column.label;
@@ -26015,13 +26015,14 @@ var PivotTableFacet = /** @class */ (function (_super) {
26015
26015
  if (allowedTypes && allowedTypes.indexOf(colType) < 0)
26016
26016
  return "continue";
26017
26017
  if (firstNumericColIndex === null && _easydata_core__WEBPACK_IMPORTED_MODULE_1__["utils"].isNumericType(colType)) {
26018
- firstNumericColIndex = i;
26018
+ firstNumericColIndex = optionIndex;
26019
26019
  }
26020
26020
  csb.addChild('option', function (b) {
26021
26021
  b
26022
26022
  .attr('value', colId)
26023
26023
  .text(colLabel);
26024
26024
  });
26025
+ optionIndex++;
26025
26026
  };
26026
26027
  for (var i = 0; i < dataTable.columns.count; i++) {
26027
26028
  _loop_2(i);
@@ -36280,13 +36281,12 @@ var data_filter_view_extends = (undefined && undefined.__extends) || (function (
36280
36281
  var data_filter_view_DataFilterView = /** @class */ (function (_super) {
36281
36282
  data_filter_view_extends(DataFilterView, _super);
36282
36283
  function DataFilterView() {
36283
- var _this = _super.call(this) || this;
36284
- _this.resultOptions.fetchEmptyQueries = true;
36285
- return _this;
36284
+ return _super.call(this) || this;
36286
36285
  }
36287
36286
  DataFilterView.prototype.initOptions = function (options) {
36288
36287
  var _this = this;
36289
36288
  options = _super.prototype.initOptions.call(this, options);
36289
+ options.result.fetchEmptyQueries = true;
36290
36290
  var query = this.context.getQuery();
36291
36291
  query.addChangedCallback(function () {
36292
36292
  if (_this.resultOptions.clearResultOnQueryChange) {
@@ -36360,9 +36360,7 @@ var html_data_filter_view_extends = (undefined && undefined.__extends) || (funct
36360
36360
  var html_data_filter_view_HtmlDataFilterView = /** @class */ (function (_super) {
36361
36361
  html_data_filter_view_extends(HtmlDataFilterView, _super);
36362
36362
  function HtmlDataFilterView() {
36363
- var _this = _super.call(this) || this;
36364
- _this.resultOptions.fetchEmptyQueries = true;
36365
- return _this;
36363
+ return _super.call(this) || this;
36366
36364
  }
36367
36365
  /**
36368
36366
  * Creates the widget that represents Grid Widget.
@@ -37519,7 +37517,7 @@ Math.trunc = Math.trunc || function (x) {
37519
37517
  }
37520
37518
  return Math.ceil(x);
37521
37519
  };
37522
- var lcv = {
37520
+ var lcv_lcv = {
37523
37521
  __kt: 0,
37524
37522
  ck: function (key) {
37525
37523
  if (!key || !key.length) {
@@ -37540,23 +37538,23 @@ var lcv = {
37540
37538
  }
37541
37539
  }
37542
37540
  if (!ism) {
37543
- lcv.__kt = -1;
37541
+ lcv_lcv.__kt = -1;
37544
37542
  }
37545
37543
  var idx = minVer % 4;
37546
37544
  var shift = majVer + minVer;
37547
37545
  if (part2[6 + idx] != encChar(shift, 19)) {
37548
- lcv.__kt = -2;
37546
+ lcv_lcv.__kt = -2;
37549
37547
  return;
37550
37548
  }
37551
37549
  if (part2[1] != encChar(infoBytes[3])) {
37552
37550
  return;
37553
37551
  }
37554
- lcv.__kt = part2[3] != encChar(infoBytes[5]) ? 2 : 3;
37555
- if (lcv.__kt === 2) {
37552
+ lcv_lcv.__kt = part2[3] != encChar(infoBytes[5]) ? 2 : 3;
37553
+ if (lcv_lcv.__kt === 2) {
37556
37554
  var eds = "" + f36(part2.substring(4, 6) + part2.substring(10));
37557
37555
  var ed = new Date(2000 + Number.parseInt(eds.substring(0, 2)), Number.parseInt(eds.substring(2, 4)) - 1, Number.parseInt(eds.substring(4)), 0, 0, 0, 0);
37558
37556
  if (Date.now() > ed.getTime()) {
37559
- lcv.__kt = 1;
37557
+ lcv_lcv.__kt = 1;
37560
37558
  }
37561
37559
  }
37562
37560
  }
@@ -37657,7 +37655,7 @@ var condition_ex_ConditionEx = /** @class */ (function (_super) {
37657
37655
  };
37658
37656
  ConditionEx.prototype.loadFromData = function (model, data) {
37659
37657
  _super.prototype.loadFromData.call(this, model, data);
37660
- if (lcv.__kt <= 1)
37658
+ if (lcv_lcv.__kt <= 1)
37661
37659
  return;
37662
37660
  if (typeof data.readOnly !== 'undefined') {
37663
37661
  this.setReadOnly(data.readOnly);
@@ -37681,7 +37679,7 @@ var condition_ex_ConditionEx = /** @class */ (function (_super) {
37681
37679
  };
37682
37680
  ConditionEx.prototype.saveToData = function () {
37683
37681
  var obj = _super.prototype.saveToData.call(this);
37684
- if (lcv.__kt <= 1)
37682
+ if (lcv_lcv.__kt <= 1)
37685
37683
  return obj;
37686
37684
  if (this.isReadOnly()) {
37687
37685
  obj.readOnly = this.isReadOnly();
@@ -37742,7 +37740,7 @@ var query_column_ex_QueryColumnEx = /** @class */ (function (_super) {
37742
37740
  */
37743
37741
  QueryColumnEx.prototype.loadFromData = function (model, colData) {
37744
37742
  _super.prototype.loadFromData.call(this, model, colData);
37745
- if (lcv.__kt <= 2)
37743
+ if (lcv_lcv.__kt <= 2)
37746
37744
  return;
37747
37745
  if (colData) {
37748
37746
  if (typeof colData.readOnly != 'undefined') {
@@ -37752,7 +37750,7 @@ var query_column_ex_QueryColumnEx = /** @class */ (function (_super) {
37752
37750
  };
37753
37751
  QueryColumnEx.prototype.saveToData = function () {
37754
37752
  var colData = _super.prototype.saveToData.call(this);
37755
- if (lcv.__kt <= 2)
37753
+ if (lcv_lcv.__kt <= 2)
37756
37754
  return colData;
37757
37755
  if (this.isReadOnly()) {
37758
37756
  colData.readOnly = this.isReadOnly();
@@ -37787,20 +37785,20 @@ var query_ex_QueryEx = /** @class */ (function (_super) {
37787
37785
  return _super.call(this, model) || this;
37788
37786
  }
37789
37787
  QueryEx.prototype.isEx = function () {
37790
- return lcv.__kt > 1;
37788
+ return lcv_lcv.__kt > 1;
37791
37789
  };
37792
37790
  QueryEx.prototype.createSubQuery = function () {
37793
37791
  return new QueryEx(this.model);
37794
37792
  };
37795
37793
  QueryEx.prototype.createCondition = function (tag) {
37796
37794
  if (tag === void 0) { tag = public_api["CondTag"].Simple; }
37797
- if (lcv.__kt <= 1)
37795
+ if (lcv_lcv.__kt <= 1)
37798
37796
  return _super.prototype.createCondition.call(this, tag);
37799
37797
  return new condition_ex_ConditionEx(this, tag);
37800
37798
  };
37801
37799
  QueryEx.prototype.createColumn = function (justsorted) {
37802
37800
  if (justsorted === void 0) { justsorted = false; }
37803
- if (lcv.__kt <= 1)
37801
+ if (lcv_lcv.__kt <= 1)
37804
37802
  return _super.prototype.createColumn.call(this, justsorted);
37805
37803
  return new query_column_ex_QueryColumnEx(this, justsorted);
37806
37804
  };
@@ -37811,7 +37809,7 @@ var query_ex_QueryEx = /** @class */ (function (_super) {
37811
37809
  */
37812
37810
  QueryEx.prototype.addConditionGroup = function (descriptor, addChildCondition) {
37813
37811
  if (addChildCondition === void 0) { addChildCondition = true; }
37814
- if (lcv.__kt <= 1)
37812
+ if (lcv_lcv.__kt <= 1)
37815
37813
  return _super.prototype.addConditionGroup.call(this, descriptor, addChildCondition);
37816
37814
  var parent = descriptor.parent || this.getRootCondition();
37817
37815
  var lType = descriptor.linking || (parent.linkType === public_api["LinkType"].All ? public_api["LinkType"].Any : public_api["LinkType"].All);
@@ -37830,7 +37828,7 @@ var query_ex_QueryEx = /** @class */ (function (_super) {
37830
37828
  QueryEx.prototype.addExtraConditionGroup = function (descriptor, addChildCondition) {
37831
37829
  if (addChildCondition === void 0) { addChildCondition = true; }
37832
37830
  descriptor.parent = descriptor.parent || this.extraConditions;
37833
- if (lcv.__kt <= 1)
37831
+ if (lcv_lcv.__kt <= 1)
37834
37832
  return _super.prototype.addExtraConditionGroup.call(this, descriptor, addChildCondition);
37835
37833
  return this.addConditionGroup(descriptor);
37836
37834
  };
@@ -37864,7 +37862,7 @@ var model_ex_DataModelEx = /** @class */ (function (_super) {
37864
37862
  return _super !== null && _super.apply(this, arguments) || this;
37865
37863
  }
37866
37864
  DataModelEx.prototype.buildQueryPath = function (query) {
37867
- if (lcv.__kt <= 1)
37865
+ if (lcv_lcv.__kt <= 1)
37868
37866
  return _super.prototype.buildQueryPath.call(this, query);
37869
37867
  if (this.mainEntity)
37870
37868
  return _super.prototype.buildQueryPath.call(this, query);
@@ -38022,7 +38020,7 @@ var lc_dialog_LCDialog = /** @class */ (function () {
38022
38020
  closable: false,
38023
38021
  cancelable: false,
38024
38022
  submitOnEnter: true,
38025
- title: 'Incorrect license key for EasyQuery',
38023
+ title: 'No license key for EasyQuery',
38026
38024
  body: this.buildStartPage(),
38027
38025
  submitButtonText: 'Submit',
38028
38026
  onInput: this.validateForm.bind(this),
@@ -38107,7 +38105,7 @@ var lc_dialog_LCDialog = /** @class */ (function () {
38107
38105
  var formBuilder = Object(dist_lib_public_api["domel"])('div');
38108
38106
  formBuilder.addChild('div', function (b) { return b
38109
38107
  .html('<div style="font-size:1.2em">The EasyQuery license key is either absent, invalid or was issued for a different version of the library.</div>' +
38110
- '<div style="font-size:1.2em">Please fill out the form to obtain a valid license key.</div>'); });
38108
+ '<div style="font-size:1.2em">Please fill out the form to obtain a valid trial license key.</div>'); });
38111
38109
  formBuilder
38112
38110
  .addClass('kfrm-form')
38113
38111
  .addChild('div', function (b) {
@@ -38140,7 +38138,7 @@ var lc_dialog_LCDialog = /** @class */ (function () {
38140
38138
  var formBuilder = Object(dist_lib_public_api["domel"])('div');
38141
38139
  formBuilder.addChild('div', function (b) { return b
38142
38140
  .html('<div style="font-size:1.2em">We sent a confirmation code to <strong>{{email}}</strong>.</div>' +
38143
- '<div style="font-size:1.2em">Please find it and enter the code in the input below</div>'); });
38141
+ '<div style="font-size:1.2em">Please find it in the email and enter to the text box below</div>'); });
38144
38142
  formBuilder
38145
38143
  .addClass('kfrm-form')
38146
38144
  .addChild('div', function (b) {
@@ -38165,7 +38163,7 @@ var lc_dialog_LCDialog = /** @class */ (function () {
38165
38163
  var formBuilder = Object(dist_lib_public_api["domel"])('div');
38166
38164
  formBuilder.addChild('div', function (b) { return b
38167
38165
  .html('<div style="font-size:1.2em">You have successfully completed the registration process.</div>' +
38168
- '<div style="font-size:1.2em">Please restart web application to get the key applied.</div>'); });
38166
+ '<div style="font-size:1.2em">Please restart your web application to get the key applied.</div>'); });
38169
38167
  form = formBuilder.toDOM();
38170
38168
  return form;
38171
38169
  };
@@ -38256,6 +38254,56 @@ var lc_dialog_LCDialog = /** @class */ (function () {
38256
38254
  return LCDialog;
38257
38255
  }());
38258
38256
 
38257
+ function showNoLicenseAlert(lcv) {
38258
+ var title, body, buttonTitle, buttonUrl;
38259
+ switch (lcv.__kt) {
38260
+ case 1:
38261
+ title = 'EasyQuery trial has expired';
38262
+ body = "Your trial period for EasyQuery has expired. \n\tYou can send a request to <a href=\"https://korzh.com/account\">extend your trial</a> or <a href=\"https://korzh.com/easyquery/licensing\">buy a license</a> to get rid of all limitations.";
38263
+ buttonTitle = 'Buy a license';
38264
+ buttonUrl = 'https://korzh.com/easyquery/licensing';
38265
+ break;
38266
+ case -3:
38267
+ title = 'No license key for EasyQuery';
38268
+ body = "Please <a href=\"https://korzh.com/easyquery#get-started\">register for a trial</a> \n\tor <a href=\"https://korzh.com/easyquery/licensing\">purchase a license</a> to get a proper product key. <br />\n\tIf you already have a key, please follow <a href=\"https://korzh.com/easyquery/docs/getting-started/product-key\">this guide</a> to apply it.";
38269
+ buttonTitle = 'Register trial';
38270
+ buttonUrl = 'https://korzh.com/easyquery#get-started';
38271
+ break;
38272
+ default:
38273
+ title = "Invalid key for EasyQuery!";
38274
+ body = "The EasyQuery product key is either invalid or was issued for a different version of the library.\n The version you are using now is 7.2,\n\tso please <a href=\"https://korzh.com/account\">login to your account</a> to get a proper key for version 7.2.";
38275
+ buttonTitle = 'Get key';
38276
+ buttonUrl = 'https://korzh.com/account';
38277
+ break;
38278
+ }
38279
+ var ds = new dist_lib_public_api["DefaultDialogService"]();
38280
+ var dlg = ds.open({
38281
+ closable: false,
38282
+ cancelable: false,
38283
+ submitable: false,
38284
+ title: title,
38285
+ body: body
38286
+ });
38287
+ var footer = dlg.getRootElement().querySelector('footer');
38288
+ Object(dist_lib_public_api["domel"])(footer)
38289
+ .removeClass('align-right')
38290
+ .setStyle('justify-content', 'center')
38291
+ .addChild('button', function (b) { return b
38292
+ .addClass('kfrm-button', 'is-info')
38293
+ .addText(buttonTitle)
38294
+ .on('click', function (e) {
38295
+ window.location.href = buttonUrl;
38296
+ }); });
38297
+ if (lcv.__kt == 1) {
38298
+ Object(dist_lib_public_api["domel"])(footer)
38299
+ .addChild('button', function (b) { return b
38300
+ .addClass('kfrm-button')
38301
+ .addText('Extend trial')
38302
+ .on('click', function (e) {
38303
+ window.location.href = 'https://korzh.com/account';
38304
+ }); });
38305
+ }
38306
+ }
38259
38307
  //# sourceMappingURL=lc-dialog.js.map
38260
38308
  // CONCATENATED MODULE: ./dist/lib/extensions.js
38261
38309
 
@@ -38272,15 +38320,15 @@ public_api["EqContext"].prototype.setLicenseKeyEndpoint = function (endpoint) {
38272
38320
  };
38273
38321
  public_api["EqContext"].prototype.useEnterprise = function (keyOrInitCallback) {
38274
38322
  var _this = this;
38275
- var func = function (key) {
38276
- lcv.ck(key);
38277
- if (lcv.__kt > 1) {
38323
+ var func = function (key, showAlert) {
38324
+ lcv_lcv.ck(key);
38325
+ if (lcv_lcv.__kt > 1) {
38278
38326
  var services = _this.getServices();
38279
38327
  services.registerDataModelResolver(function (context) { return new model_ex_DataModelEx(); });
38280
38328
  services.registerQueryResolver(function (context) { return new query_ex_QueryEx(context.getModel()); });
38281
38329
  services.registerQueryStorageResolver(function (context) { return new eqs_query_storage["a" /* EqServerQueryStorage */](context); });
38282
38330
  services.registerAggregatesCalculator(function (context) { return new data_table_aggr_calculator["a" /* DataTableAggregatesCalculator */](context); });
38283
- if (lcv.__kt === 2) {
38331
+ if (lcv_lcv.__kt === 2) {
38284
38332
  console.warn('EasyQuery.JS is working in the TRIAL MODE!\n'
38285
38333
  + 'Please order a license (https://korzh.com/eq) to get a proper product key.');
38286
38334
  createTrialWM();
@@ -38291,19 +38339,24 @@ public_api["EqContext"].prototype.useEnterprise = function (keyOrInitCallback) {
38291
38339
  }
38292
38340
  }
38293
38341
  else {
38294
- var lcd = new lc_dialog_LCDialog(_this);
38295
- lcd.show();
38342
+ if (showAlert) {
38343
+ showNoLicenseAlert(lcv_lcv);
38344
+ }
38345
+ else {
38346
+ var lcd = new lc_dialog_LCDialog(_this);
38347
+ lcd.show();
38348
+ }
38296
38349
  }
38297
38350
  };
38298
38351
  if (typeof (keyOrInitCallback) === "string") {
38299
- func(keyOrInitCallback);
38352
+ func(keyOrInitCallback, true);
38300
38353
  }
38301
38354
  else if (typeof (keyOrInitCallback) === "function") {
38302
38355
  var http_1 = this.getServices().getHttpClient();
38303
38356
  var url_1 = public_api["equtils"].combinePath(this.getBaseEndpoint(), 'lck2');
38304
38357
  http_1.get(url_1)
38305
38358
  .then(function (result) {
38306
- func(result.key.split("").reverse().join(""));
38359
+ func(result.key.split("").reverse().join(""), false);
38307
38360
  _this.useBackend({
38308
38361
  type: result.backendType,
38309
38362
  subType: result.appType
@@ -38314,7 +38367,7 @@ public_api["EqContext"].prototype.useEnterprise = function (keyOrInitCallback) {
38314
38367
  url_1 = public_api["equtils"].combinePath(_this.getBaseEndpoint(), 'lck');
38315
38368
  http_1.get(url_1)
38316
38369
  .then(function (result) {
38317
- func(result.split("").reverse().join(""));
38370
+ func(result.split("").reverse().join(""), false);
38318
38371
  keyOrInitCallback();
38319
38372
  })
38320
38373
  .catch(function (error) { return _this.throwError({