@refinitiv-ui/efx-grid 6.0.4 → 6.0.5

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.
Files changed (32) hide show
  1. package/lib/column-selection-dialog/lib/column-selection-dialog.d.ts +1 -1
  2. package/lib/column-selection-dialog/lib/column-selection-dialog.js +1 -1
  3. package/lib/core/dist/core.js +21 -2
  4. package/lib/core/dist/core.min.js +1 -1
  5. package/lib/core/es6/grid/Core.d.ts +2 -0
  6. package/lib/core/es6/grid/Core.js +8 -2
  7. package/lib/core/es6/grid/components/Scrollbar.d.ts +2 -0
  8. package/lib/core/es6/grid/components/Scrollbar.js +13 -0
  9. package/lib/grid/lib/efx-grid.js +4 -44
  10. package/lib/grid/themes/halo/light/efx-grid.js +1 -1
  11. package/lib/grid/themes/halo/light/es5/all-elements.js +1 -1
  12. package/lib/rt-grid/dist/rt-grid.js +675 -78
  13. package/lib/rt-grid/dist/rt-grid.min.js +1 -1
  14. package/lib/rt-grid/es6/Grid.d.ts +7 -0
  15. package/lib/rt-grid/es6/Grid.js +81 -1
  16. package/lib/rt-grid/es6/SnapshotFiller.d.ts +3 -0
  17. package/lib/rt-grid/es6/SnapshotFiller.js +121 -15
  18. package/lib/tr-grid-conditional-coloring/es6/ConditionalColoring.d.ts +3 -2
  19. package/lib/tr-grid-conditional-coloring/es6/ConditionalColoring.js +5 -0
  20. package/lib/tr-grid-percent-bar/es6/PercentBar.js +1 -1
  21. package/lib/tr-grid-row-selection/es6/RowSelection.js +14 -10
  22. package/lib/tr-grid-util/es6/CellPainter.js +1 -1
  23. package/lib/tr-grid-util/es6/ElementObserver.js +6 -3
  24. package/lib/tr-grid-util/es6/ElfUtil.d.ts +4 -1
  25. package/lib/tr-grid-util/es6/ElfUtil.js +130 -27
  26. package/lib/types/es6/ConditionalColoring.d.ts +3 -2
  27. package/lib/types/es6/Core/grid/Core.d.ts +2 -0
  28. package/lib/types/es6/Core/grid/components/Scrollbar.d.ts +2 -0
  29. package/lib/types/es6/RealtimeGrid/Grid.d.ts +7 -0
  30. package/lib/types/es6/RealtimeGrid/SnapshotFiller.d.ts +3 -0
  31. package/lib/versions.json +4 -4
  32. package/package.json +1 -1
@@ -1204,7 +1204,15 @@ Formula.toUpperCase = function(exp) {
1204
1204
  exp = exp.toUpperCase(); // Upper case the remaining
1205
1205
 
1206
1206
  // May have the new string token from ADC field with parameter
1207
- exp = exp.replace(/TR\.[\w_ ]+\([^\(\)]*\)(\.[a-zA-Z]+)*/g, Formula._encloseWithTR);
1207
+ // Regex for adc fileds
1208
+ // TR : start with tr
1209
+ // (\.[\w]+)+ : dot follow by any character at least 1
1210
+ // \( : start parentheses
1211
+ // [^\(\)]* : any except parentheses
1212
+ // \) : end parentheses
1213
+ // (\.[a-zA-Z]+)* : dot follow by any character (optional)
1214
+
1215
+ exp = exp.replace(/TR(\.[\w ]+)+\([^\(\)]*\)(\.[a-zA-Z]+)*/g, Formula._encloseWithTR);
1208
1216
 
1209
1217
  exp = Formula.resolveTokens(exp, tokens, calcHierarchy); // Restore the string
1210
1218
 
@@ -3014,10 +3022,144 @@ Deferred.prototype._finally = function() {
3014
3022
  /* harmony default export */ var es6_Deferred = (Deferred);
3015
3023
 
3016
3024
 
3025
+ // CONCATENATED MODULE: ./node_modules/tr-grid-util/es6/ElementObserver.js
3026
+
3027
+ /** @namespace
3028
+ */
3029
+ var ElementObserver = {};
3030
+
3031
+ /** @private
3032
+ * @param {Element} elem
3033
+ * @param {MutationRecord} mutation
3034
+ */
3035
+ var _onLanguageMutated = function (elem, mutation) {
3036
+ if (mutation.type == "attributes" && mutation.attributeName == "lang") {
3037
+ elem.lang = mutation.target.lang || "en";
3038
+ }
3039
+ };
3040
+
3041
+ /** @private
3042
+ * @param {Function} listener
3043
+ * @param {string=} attributeName
3044
+ * @param {MutationRecord} mutation
3045
+ */
3046
+ var _onAttributeMutated = function (listener, attributeName, mutation) {
3047
+ if (mutation.type === "attributes") {
3048
+ if (attributeName != null) {
3049
+ if (mutation.attributeName === attributeName) {
3050
+ listener(mutation.target.getAttribute(attributeName));
3051
+ }
3052
+ } else {
3053
+ listener(mutation.target);
3054
+ }
3055
+ }
3056
+ };
3057
+
3058
+ /** @private
3059
+ * @return {string}
3060
+ */
3061
+ ElementObserver._getNewId = function () {
3062
+ var id = "observer_" + (++ElementObserver._id);
3063
+ return id;
3064
+ };
3065
+
3066
+ /** @private Observe any element
3067
+ * @param {Element} elem
3068
+ * @param {Function} listener
3069
+ * @param {Object=} opt_option
3070
+ */
3071
+ ElementObserver._addObserver = function(elem, listener, opt_option) {
3072
+ var option = opt_option;
3073
+ if (!option) {
3074
+ option = {};
3075
+ }
3076
+ option.attributes = true; //configure it to listen to attribute changes
3077
+
3078
+ ElementObserver._observer.observe(elem, option);
3079
+ ElementObserver._addListener(elem, listener);
3080
+ };
3081
+
3082
+ /** @private
3083
+ * @param {Array.<MutationRecord>} mutations
3084
+ */
3085
+ ElementObserver._onMutationCallback = function(mutations) {
3086
+ for (var i = 0; i < mutations.length; i++) {
3087
+ var mutation = mutations[i];
3088
+ var listeners = ElementObserver._listeners[mutation.target._observeId];
3089
+ for (var j = 0; j < listeners.length; j++) {
3090
+ listeners[j](mutation);
3091
+ }
3092
+ }
3093
+ };
3094
+
3095
+ /** @private
3096
+ * @param {Element} elem
3097
+ * @param {Function} fn
3098
+ */
3099
+ ElementObserver._addListener = function(elem, fn) {
3100
+ var listeners = ElementObserver._listeners;
3101
+ if (!listeners) {
3102
+ listeners = ElementObserver._listeners = {};
3103
+ }
3104
+ if (!elem._observeId) {
3105
+ var id = ElementObserver._getNewId();
3106
+ elem._observeId = id;
3107
+ }
3108
+ if (!listeners[elem._observeId]) { // Always check to support the using of separated ElfUtil module in testing page
3109
+ listeners[elem._observeId] = [];
3110
+ }
3111
+
3112
+ var listener = listeners[elem._observeId];
3113
+ if (listener.indexOf(fn) < 0) {
3114
+ listener.push(fn);
3115
+ }
3116
+ };
3117
+
3118
+ /** @public Add a listener to a html lang attribute
3119
+ * @param {Element} element An element within the DOM tree to watch for changes
3120
+ */
3121
+ ElementObserver.addLanguageListener = function(element) {
3122
+ if (!element) { return; }
3123
+
3124
+ element.lang = document.documentElement.lang || "en";
3125
+
3126
+ ElementObserver._addObserver(document.documentElement, _onLanguageMutated.bind(null, element));
3127
+ };
3128
+
3129
+ /** @public Add a listener to a html attribute
3130
+ * @param {Element} element An element within the DOM tree to watch for changes
3131
+ * @param {Function} listener A function which will be called on each attribute change
3132
+ * @param {string=} attributeName If not specified, listener will be called on every attribute change
3133
+ */
3134
+ ElementObserver.addAttributeListener = function(element, listener, attributeName) {
3135
+ if (!element || !listener) { return; }
3136
+ ElementObserver._addObserver(element, _onAttributeMutated.bind(null, listener, attributeName));
3137
+ };
3138
+
3139
+ /**
3140
+ * @type {MutationObserver}
3141
+ * @private
3142
+ */
3143
+ ElementObserver._observer = new MutationObserver(ElementObserver._onMutationCallback);
3144
+ /**
3145
+ * @type {Obect}
3146
+ * @private
3147
+ */
3148
+ ElementObserver._listeners = {};
3149
+ /**
3150
+ * @type {number}
3151
+ * @private
3152
+ */
3153
+ ElementObserver._id = 0;
3154
+
3155
+ /* harmony default export */ var es6_ElementObserver = (ElementObserver);
3156
+
3157
+
3017
3158
  // CONCATENATED MODULE: ./node_modules/tr-grid-util/es6/ElfUtil.js
3018
3159
 
3019
3160
 
3020
3161
 
3162
+
3021
3163
  /** Dialog supporting language (selection dialog, formater dialog and filter dialog)
3022
3164
  * @type {!Object.<string, boolean>}
3023
3165
  * @private
@@ -3080,6 +3222,22 @@ ElfUtil._dummyIcon = null;
3080
3222
  * @private
3081
3223
  */
3082
3224
  ElfUtil._iconLoaded = false;
3225
+ /** @type {string|null}
3226
+ * @private
3227
+ */
3228
+ ElfUtil._profileName = null;
3229
+ /** @type {Array}
3230
+ * @private
3231
+ */
3232
+ ElfUtil._callbacks = [];
3233
+ /** @type {boolean}
3234
+ * @private
3235
+ */
3236
+ ElfUtil._observed = false;
3237
+ /** @type {boolean}
3238
+ * @private
3239
+ */
3240
+ ElfUtil._pendingResolve = false;
3083
3241
 
3084
3242
  /** @type {Object.<string, Object>}
3085
3243
  * @private
@@ -3351,57 +3509,146 @@ ElfUtil.getCssVariables = function (obj, optElem) {
3351
3509
  return obj || null;
3352
3510
  };
3353
3511
 
3512
+ /** @public
3513
+ * @param {Object} rtk
3514
+ */
3515
+ ElfUtil.setRTK = function(rtk) {
3516
+ if(rtk != null) {
3517
+ ElfUtil._rtk = rtk;
3518
+ }
3519
+ };
3520
+
3521
+ /** Get current profile name set on the root html element (document.documentElement)
3522
+ * @public
3523
+ * @return {string} Current profile name
3524
+ */
3525
+ ElfUtil.getMovementColorProfile = function() {
3526
+ return document.documentElement.getAttribute("movement-color-profile");
3527
+ };
3528
+
3529
+ /** @private
3530
+ * @param {Function} cb
3531
+ */
3532
+ ElfUtil._addThemeChangedCallback = function(cb) {
3533
+ var callbacks = ElfUtil._callbacks;
3534
+ if(callbacks.indexOf(cb) < 0) {
3535
+ callbacks.push(cb);
3536
+ }
3537
+ };
3538
+
3354
3539
  /** Gets current theme colors from the document and returns a promise. <br>
3355
- * WANRING: This method sets movement color profile to html tag automatically, if JET.Settings exists. <br>
3540
+ * WANRING: This method sets movement color profile to html tag automatically, if JET.Settings exists or RTK is available. <br>
3356
3541
  * To re-request/reset theme colors, set ElfUtil.themeReady variable to null
3357
3542
  * @public
3543
+ * @param {Function=} themeChangedCb
3358
3544
  * @return {Promise<Object>} A promise of object of theme colors
3359
3545
  */
3360
- ElfUtil.getThemeColors = function() {
3546
+ ElfUtil.getThemeColors = function(themeChangedCb) {
3547
+ if(typeof themeChangedCb === "function") {
3548
+ ElfUtil._addThemeChangedCallback(themeChangedCb);
3549
+ }
3550
+
3361
3551
  if(ElfUtil.themeReady) {
3362
3552
  return ElfUtil.themeReady;
3363
3553
  }
3554
+
3364
3555
  var d = ElfUtil._deferred = new Deferred();
3365
3556
  ElfUtil.themeReady = d.promise;
3366
3557
 
3367
- var jet = window ? window.JET : null;
3368
- if(jet && jet.Settings) {
3369
- try {
3370
- jet.Settings.read(ElfUtil._onColorProfile, {
3371
- providerName: "Configuration",
3372
- settingName: "RDE_USER_CURRENT_TICK_COLOR"
3373
- });
3374
- } catch (err) {
3375
- d.reject("Cannot read JET's settings");
3558
+ var profileName = ElfUtil.getMovementColorProfile();
3559
+ if(profileName) {
3560
+ if(profileName !== ElfUtil._profileName) {
3561
+ setTimeout(ElfUtil._profileNameRetrieved, 100); // TODO: Find a proper way to ensure that theme is ready
3562
+ } else {
3563
+ ElfUtil._deferred.resolve(ElfUtil.themeColors);
3376
3564
  }
3377
3565
  } else {
3378
- setTimeout(ElfUtil._retrieveThemeColors, 100); // TODO: Find a proper way to ensure that theme is ready
3566
+ var options = {
3567
+ providerName: "Configuration",
3568
+ settingName: "RDE_USER_CURRENT_TICK_COLOR"
3569
+ };
3570
+
3571
+ var jet = window ? window.JET : null;
3572
+ if(ElfUtil._rtk && ElfUtil._rtk.Settings) {
3573
+ ElfUtil._rtk.Settings.getAsync(options).then(ElfUtil._loadingProfileSuccess, ElfUtil._loadingProfileFailure);
3574
+ } else if(jet && jet.Settings) {
3575
+ try {
3576
+ jet.Settings.read(ElfUtil._loadingProfileSuccess, options);
3577
+ } catch (err) {
3578
+ ElfUtil._loadingProfileFailure();
3579
+ }
3580
+ } else {
3581
+ setTimeout(ElfUtil._profileNameRetrieved, 100); // TODO: Find a proper way to ensure that theme is ready
3582
+ }
3379
3583
  }
3584
+
3380
3585
  return d.promise;
3381
3586
  };
3382
3587
 
3383
- /** Get user's color profile from JET and set it to html tag (document.documentElement)
3588
+ /** @private
3589
+ * @param {string} profileName
3590
+ */
3591
+ var movementColorProfileChanged = function(profileName) {
3592
+ if(profileName && profileName !== ElfUtil._profileName) {
3593
+ ElfUtil._retrieveThemeColors(profileName);
3594
+
3595
+ if(ElfUtil._pendingResolve) {
3596
+ ElfUtil._pendingResolve = false;
3597
+ ElfUtil._deferred.resolve(ElfUtil.themeColors);
3598
+ }
3599
+
3600
+ var callbacks = ElfUtil._callbacks;
3601
+ for (var i = 0; i < callbacks.length; i++) {
3602
+ callbacks[i]();
3603
+ }
3604
+ }
3605
+ };
3606
+
3607
+ /** Get user's color profile from JET or TRK and set it to html tag (document.documentElement)
3384
3608
  * @private
3385
- * @param {string} colorProfile Returned from JET.Settings
3609
+ * @param {string} profileName Returned from JET.Settings or RTK.Settings
3386
3610
  */
3387
- ElfUtil._onColorProfile = function (colorProfile) {
3388
- if(colorProfile) {
3389
- document.documentElement.setAttribute("movement-color-profile", colorProfile.toLowerCase());
3611
+ ElfUtil._loadingProfileSuccess = function(profileName) {
3612
+ if(profileName) {
3613
+ document.documentElement.setAttribute("movement-color-profile", profileName.toLowerCase());
3614
+ }
3615
+
3616
+ if(ElfUtil._observed) { // Let attribute listener does the job
3617
+ ElfUtil._pendingResolve = true;
3618
+ } else {
3619
+ ElfUtil._profileNameRetrieved(profileName);
3390
3620
  }
3391
- ElfUtil._retrieveThemeColors();
3392
3621
  };
3393
- /** Get current profile name set on the root html element (document.documentElement)
3394
- * @public
3395
- * @return {string} Current profile name
3622
+
3623
+ /** @private
3396
3624
  */
3397
- ElfUtil.getMovementColorProfile = function() {
3398
- return document.documentElement.getAttribute("movement-color-profile");
3625
+ ElfUtil._loadingProfileFailure = function() {
3626
+ if(!ElfUtil._observed) {
3627
+ ElfUtil._observed = true;
3628
+ ElementObserver.addAttributeListener(document.documentElement, movementColorProfileChanged, "movement-color-profile");
3629
+ }
3630
+ ElfUtil._deferred.reject("Failed to get movement color profile from settings.");
3631
+ };
3632
+
3633
+ /** @private
3634
+ */
3635
+ ElfUtil._profileNameRetrieved = function() {
3636
+ var profileName = ElfUtil.getMovementColorProfile();
3637
+ ElfUtil._retrieveThemeColors(profileName);
3638
+ if(!ElfUtil._observed) {
3639
+ ElfUtil._observed = true;
3640
+ ElementObserver.addAttributeListener(document.documentElement, movementColorProfileChanged, "movement-color-profile");
3641
+ }
3642
+ ElfUtil._deferred.resolve(ElfUtil.themeColors);
3399
3643
  };
3400
3644
 
3401
3645
  /** Get theme colors from document
3402
3646
  * @private
3647
+ * @param {string} profileName Movement color profile name
3403
3648
  */
3404
- ElfUtil._retrieveThemeColors = function() {
3649
+ ElfUtil._retrieveThemeColors = function(profileName) {
3650
+ ElfUtil._profileName = profileName;
3651
+
3405
3652
  var colors = ElfUtil.themeColors = ElfUtil.getCssVariables({
3406
3653
  "primary": "--color-scheme-primary", // Usually used in headers, and selection
3407
3654
  "secondary": "--color-scheme-secondary",
@@ -3466,11 +3713,8 @@ ElfUtil._retrieveThemeColors = function() {
3466
3713
  colors["baseGrid"] = colors["tableBg"];
3467
3714
  colors["baseText"] = colors["tableText"];
3468
3715
  colors["trackColor"] = colors["primary"] || ElfUtil._defaultColors["trackColor"];
3469
-
3470
- ElfUtil._deferred.resolve(colors);
3471
3716
  };
3472
3717
 
3473
-
3474
3718
  /* harmony default export */ var es6_ElfUtil = (ElfUtil);
3475
3719
 
3476
3720
 
@@ -14253,6 +14497,8 @@ ColumnDefinition.prototype.clearUserModel = function() {
14253
14497
  /* harmony default export */ var js_ColumnDefinition = (ColumnDefinition);
14254
14498
 
14255
14499
  // CONCATENATED MODULE: ./src/js/SnapshotFiller.js
14500
+ /* eslint-disable */
14501
+
14256
14502
 
14257
14503
 
14258
14504
 
@@ -14276,6 +14522,9 @@ var SnapshotFiller = function () {
14276
14522
 
14277
14523
  this._rics = {};
14278
14524
  this._fields = {};
14525
+ this._adcOptions = { // TODO: support requesting level parameter
14526
+ productId: "001"
14527
+ };
14279
14528
  };
14280
14529
  Ext["a" /* Ext */].inherits(SnapshotFiller, EventDispatcher["a" /* EventDispatcher */]);
14281
14530
 
@@ -14296,6 +14545,10 @@ SnapshotFiller.prototype._fields;
14296
14545
  * @private
14297
14546
  */
14298
14547
  SnapshotFiller.prototype._rtk;
14548
+ /** @type {!Grid~ADCOptions}
14549
+ * @private
14550
+ */
14551
+ SnapshotFiller.prototype._adcOptions = null;
14299
14552
  //#endregion Private Members
14300
14553
 
14301
14554
  /** @public
@@ -14305,6 +14558,26 @@ SnapshotFiller.prototype.setRTK = function (rtk) {
14305
14558
  this._rtk = rtk;
14306
14559
  };
14307
14560
 
14561
+ /** @public
14562
+ * @param {Grid~ADCOptions} adcOptions ADC requesting level parameter options
14563
+ */
14564
+ SnapshotFiller.prototype.setADCOptions = function (adcOptions) {
14565
+
14566
+ var val = adcOptions["productId"];
14567
+ if(val) {
14568
+ this._adcOptions.productId = val;
14569
+ }
14570
+ // TODO: support requesting level parameter https://confluence.refinitiv.com/display/ADC/Request+level+parameters
14571
+ // var val = adcOptions["lang"];
14572
+ // if(val) {
14573
+ // this._adcOptions.lang = val;
14574
+ // }
14575
+ // var val = adcOptions["cache"];
14576
+ // if(val) {
14577
+ // this._adcOptions.cache = val;
14578
+ // }
14579
+ };
14580
+
14308
14581
  /** @public
14309
14582
  * @param {string} ric
14310
14583
  */
@@ -14422,29 +14695,37 @@ SnapshotFiller.prototype._onRequest = function () {
14422
14695
  return;
14423
14696
  }
14424
14697
 
14425
- var reqFields = [];
14426
- for(i = 0; i < fieldLen; i++) {
14427
- reqFields.push({ "name": fields[i] });
14428
- }
14429
-
14430
14698
  // Clean up members, preparing for the next request
14431
14699
  this._rics = {};
14432
14700
  this._fields = {};
14433
14701
 
14434
- var payload = {
14435
- "instruments": instruments,
14436
- "fields": reqFields
14437
- };
14438
-
14439
- var onSuccess = this._onSuccess.bind(this, fields);
14702
+ var onSuccess, payload;
14440
14703
  if (this._rtk) {
14441
- this._rtk.Data.DataGrid
14704
+ var strFields = fields.join(',');
14705
+ payload = {
14706
+ "method": "select",
14707
+ "formula": strFields,
14708
+ "identifiers": instruments,
14709
+ "productId": this._adcOptions.productId,
14710
+ "output": "Col,In,va,T,NoEmptyTickers" // For customize output server, for more information please visit "https://confluence.refinitiv.com/display/ADC/Data+Cloud+Output+Format"
14711
+ };
14712
+ onSuccess = this._onRTKSuccess.bind(this, fields);
14713
+ this._rtk.Data.Adc
14442
14714
  .request(payload)
14443
14715
  .then(onSuccess)
14444
14716
  .catch(function (err) {
14445
14717
  console.log(err);
14446
14718
  });
14447
14719
  } else {
14720
+ var reqFields = [];
14721
+ for(i = 0; i < fieldLen; i++) {
14722
+ reqFields.push({ "name": fields[i] });
14723
+ }
14724
+ payload = {
14725
+ "instruments": instruments,
14726
+ "fields": reqFields
14727
+ };
14728
+ onSuccess = this._onJETSuccess.bind(this, fields);
14448
14729
  jet["Data"]("datagrid")
14449
14730
  .then(function (service) { return service["request"](payload); })
14450
14731
  .then(JSON.parse)
@@ -14460,16 +14741,15 @@ SnapshotFiller.prototype._onRequest = function () {
14460
14741
  * @param {Array.<string>} fields
14461
14742
  * @param {string} serverResult
14462
14743
  */
14463
- SnapshotFiller.prototype._onSuccess = function (fields, serverResult) {
14744
+ SnapshotFiller.prototype._onJETSuccess = function (fields, serverResult) {
14745
+ this._dispatch("adcDataReceived", serverResult);
14464
14746
  var data2D = serverResult["data"];
14465
14747
  var svHeaders = serverResult["headers"] && serverResult["headers"][0];
14466
14748
 
14467
14749
  if (!Array.isArray(data2D) || !Array.isArray(svHeaders)) {
14468
- console.log("Invalid server response detected");
14469
14750
  return; //TODO: Return Promise.reject(errMsg);
14470
14751
  }
14471
14752
 
14472
- this._dispatch("adcDataReceived", serverResult);
14473
14753
 
14474
14754
  // Server will return field only in UPPERCASE
14475
14755
  // ex. requestField = TR.Volume ===> serverField = TR.VOLUME
@@ -14526,6 +14806,76 @@ SnapshotFiller.prototype._onSuccess = function (fields, serverResult) {
14526
14806
  });
14527
14807
  };
14528
14808
 
14809
+ /** @private
14810
+ * @function
14811
+ * @param {Array.<string>} fields
14812
+ * @param {string} serverResult
14813
+ */
14814
+ SnapshotFiller.prototype._onRTKSuccess = function (fields, serverResult) {
14815
+ this._dispatch("adcDataReceived", serverResult);
14816
+ var data2D = serverResult["rows"];
14817
+ var svHeaders = serverResult["rows"] && serverResult["rows"][0];
14818
+ if (!Array.isArray(data2D) || !Array.isArray(svHeaders)) {
14819
+ return; //TODO: Return Promise.reject(errMsg);
14820
+ }
14821
+
14822
+ // Server will return field only in UPPERCASE
14823
+ // ex. requestField = TR.Volume ===> serverField = TR.VOLUME
14824
+ // so we need convert UPPERCASE to be original
14825
+ var i, field, ric;
14826
+ var j = 1; // to skip instrument index, use j = 1
14827
+ var fLength = fields.length;
14828
+ var hLength = svHeaders.length;
14829
+ var headers = new Array(hLength);
14830
+ for (i = 0; i < fLength && j < hLength; i++) {
14831
+ field = fields[i];
14832
+ if (svHeaders[j].r.toUpperCase() === field.toUpperCase()) {
14833
+ headers[j] = field;
14834
+ j++;
14835
+ }
14836
+ }
14837
+
14838
+ var len = data2D.length;
14839
+ var fieldLen = headers.length;
14840
+ var ricMap = {};
14841
+
14842
+ // TODO: Freeze the data view before setting multiple data
14843
+ for (i = 1; i < len; i++) { // to skip column header index, use i = 1
14844
+ var dataRow = data2D[i];
14845
+ ric = dataRow[0];
14846
+
14847
+ var snapData = ricMap[ric] = {};
14848
+
14849
+ // loop for create rowData for update
14850
+ for (j = 1; j < fieldLen; j++) { // to skip instrument index, use j = 1
14851
+ var value = dataRow[j];
14852
+ if (value != null && value !== "") {
14853
+ if(typeof value !== 'object') {
14854
+ field = headers[j];
14855
+ snapData[field] = value;
14856
+ }
14857
+ // TODO : handled when a cell has a mistake and the value appears as {f: "1"} ( description error in fault attribute at index 1 ),
14858
+ // Therefore, we need to store information to the error field for this cell.
14859
+ // else {}
14860
+
14861
+ }
14862
+ }
14863
+ }
14864
+
14865
+ // return result only ric that has update data
14866
+ var updatedData = {};
14867
+ for (ric in ricMap) {
14868
+ var obj = ricMap[ric];
14869
+ if (!isEmptyObject(obj)) {
14870
+ updatedData[ric] = obj;
14871
+ }
14872
+ }
14873
+
14874
+ this._dispatch("dataChanged", {
14875
+ data: updatedData
14876
+ });
14877
+ };
14878
+
14529
14879
 
14530
14880
  /* harmony default export */ var js_SnapshotFiller = (SnapshotFiller);
14531
14881
 
@@ -16516,6 +16866,33 @@ TrackLayout.prototype.setLaneSize = function (index, val) {
16516
16866
  return false;
16517
16867
  };
16518
16868
 
16869
+ /** @public
16870
+ * @param {number} index
16871
+ * @param {string} propName
16872
+ * @param {*} val
16873
+ * @return {boolean}
16874
+ */
16875
+ TrackLayout.prototype.setLaneProperty = function (index, propName, val) {
16876
+ if (index < 0 || index >= this._laneCount) { return false; }
16877
+
16878
+ var col = this._cols[index];
16879
+ if (col == null || col[propName] !== val) {
16880
+ col = this._newColumn(index);
16881
+ col[propName] = val;
16882
+ return true;
16883
+ }
16884
+
16885
+ return false;
16886
+ };
16887
+ /** @public
16888
+ * @param {number} index
16889
+ * @param {string} propName
16890
+ * @return {*}
16891
+ */
16892
+ TrackLayout.prototype.getLaneProperty = function (index, propName) {
16893
+ var col = this._cols[index];
16894
+ return (col && col[propName] != null) ? col[propName] : null;
16895
+ };
16519
16896
  /** @public
16520
16897
  * @param {number} index
16521
16898
  * @return {number}
@@ -18502,10 +18879,10 @@ StretchedCells.prototype.getColumnIndex = function (cellRef) {
18502
18879
  if(cellRef["getElement"]) {
18503
18880
  var cellElement = cellRef["getElement"]();
18504
18881
  if(cellElement) {
18505
- return cellElement._colIndex || 0;
18882
+ return cellElement._colIndex != null ? cellElement._colIndex : -1;
18506
18883
  }
18507
18884
  } else {
18508
- return cellRef._colIndex || 0;
18885
+ return cellRef._colIndex != null ? cellRef._colIndex : -1;
18509
18886
  }
18510
18887
  }
18511
18888
  return -1;
@@ -20988,6 +21365,19 @@ Scrollbar.prototype.freezeScrolling = function (frozen) {
20988
21365
  this._isFrozen = frozen !== false;
20989
21366
  return prev;
20990
21367
  };
21368
+ /** @public
21369
+ */
21370
+ Scrollbar.prototype.restoreTrackPosition = function () {
21371
+ // Scroll event will be fired asynchronously, if there is any change
21372
+ var track = this._element;
21373
+ if(this._vertical) {
21374
+ track.scrollTop = this._tScrollVal;
21375
+ if(track.scrollTop){
21376
+ this._tScrollVal = track.scrollTop; //Check to ensure that cache equal to element's scroll
21377
+ }
21378
+ }
21379
+ //TODO: handle restore scrollLeft for hscroll
21380
+ };
20991
21381
 
20992
21382
  Scrollbar._proto = Scrollbar.prototype;
20993
21383
 
@@ -21765,6 +22155,22 @@ LayoutGrid.prototype._setColumnWidth = function (indexX, val) {
21765
22155
  LayoutGrid.prototype._updateColumnLayout = function () {
21766
22156
  this._syncLayoutToColumns(0);
21767
22157
  };
22158
+ /** @public
22159
+ * @ignore
22160
+ * @param {boolean} enabled
22161
+ * @param {number=} fromR
22162
+ * @param {number=} toR
22163
+ */
22164
+ LayoutGrid.prototype._startBindingSession = function (enabled, fromR, toR) {
22165
+ // Prevent error when calling _startBindingSession in LayoutGrid
22166
+ };
22167
+ /** @public
22168
+ * @ignore
22169
+ * @return {Array<boolean>}
22170
+ */
22171
+ LayoutGrid.prototype._getTempRowHeights = function () {
22172
+ return null;
22173
+ };
21768
22174
 
21769
22175
  /**
21770
22176
  * {@link ILayoutGrid#getRowHeight}
@@ -22606,6 +23012,11 @@ LayoutGrid.prototype.setRowHighlight = function (rowIndex) {
22606
23012
  this._highlightedCells[c] = cell;
22607
23013
  cell.addClass("highlighted-row");
22608
23014
  }
23015
+ var stretchEl = this.getStretchedCell(rowIndex); // check stretched cell
23016
+ if(stretchEl) {
23017
+ this._highlightedCells.push(stretchEl);
23018
+ stretchEl.addClass("highlighted-row");
23019
+ }
22609
23020
  } else {
22610
23021
  this._highlightedCells.length = 0;
22611
23022
  }
@@ -22891,6 +23302,7 @@ LayoutGrid.prototype.insertColumn = function (index, opt_json) {
22891
23302
  cell.addClass("selected-row");
22892
23303
  }
22893
23304
  }
23305
+ // TODO: Check if it can insert column with stretch cell
22894
23306
  }
22895
23307
 
22896
23308
  column.activate(atTheMiddle || !this._colVir);
@@ -23122,6 +23534,10 @@ LayoutGrid.prototype.stretchCell = function (cellRef, rowIndex, opt_stretching,
23122
23534
  } else {
23123
23535
  cell = this._stretchedCells.unstretchCell(rowIndex);
23124
23536
  }
23537
+ if(cell) {
23538
+ var selected = this._selectionList.getSelection(rowIndex);
23539
+ cell.enableClass("selected-row", selected); // It's can enable class without get stretch cell again.
23540
+ }
23125
23541
  return cell;
23126
23542
  };
23127
23543
 
@@ -23204,6 +23620,19 @@ LayoutGrid.prototype._calculateViewSize = function (forceRecal) {
23204
23620
  }
23205
23621
  return stretchSize;
23206
23622
  };
23623
+
23624
+ /**
23625
+ * @private
23626
+ * @param {number} rowIndex
23627
+ * @param {string} className
23628
+ * @param {boolean} enabled
23629
+ */
23630
+ LayoutGrid.prototype._enableStretchCellClass = function (rowIndex, className, enabled ) {
23631
+ var stretchEl = this.getStretchedCell(rowIndex); // check stretched cell
23632
+ if(stretchEl) {
23633
+ stretchEl.enableClass(className, enabled);
23634
+ }
23635
+ };
23207
23636
  /** View size is width of container (Grid's pane) or content (LayoutGrid's columns), whichever is smaller.
23208
23637
  * @public
23209
23638
  * @ignore
@@ -23887,11 +24316,16 @@ LayoutGrid.prototype._updateCellSpans = function (cellSpans, adding) {
23887
24316
  */
23888
24317
  LayoutGrid.prototype._onMouseMove = function (e) {
23889
24318
  var target = e["target"];
23890
- var colElement = util.closestElement(target, "column");
23891
- var colIndex = this.getColumnIndex(colElement);
23892
- var cellElement = (colIndex >= 0) ? util.closestElement(target, "cell") : null;
23893
24319
 
23894
- this.setRowHighlight(this.getCellIndex(colIndex, cellElement));
24320
+ var cellElement = util.closestElement(target, "cell");
24321
+ var colIndex = this._stretchedCells.getColumnIndex(cellElement);
24322
+ if(colIndex < 0) { // Not found colIndex in stretching cell, then get from normal row
24323
+ var colElement = util.closestElement(target, "column");
24324
+ colIndex = this.getColumnIndex(colElement);
24325
+ }
24326
+ var rowIndex = this.getCellIndex(colIndex, cellElement);
24327
+
24328
+ this.setRowHighlight(rowIndex);
23895
24329
  };
23896
24330
 
23897
24331
  /**
@@ -23922,27 +24356,16 @@ LayoutGrid.prototype._onMouseOut = function (e) {
23922
24356
  */
23923
24357
  LayoutGrid.prototype._updateSelectionUI = function (rowIndex) { // Update UI of the specified row index
23924
24358
  var selected = this._selectionList.getSelection(rowIndex);
23925
-
23926
- for (var c = 0; c < this._colCount; ++c) {
23927
- var cell = this._columns[c].getCell(rowIndex);
23928
-
23929
- if (cell) {
23930
- cell.enableClass("selected-row", selected);
23931
- }
23932
- }
24359
+ this._enableStretchCellClass(rowIndex, "selected-row", selected);
24360
+ this.enableRowClass(rowIndex, "selected-row", selected);
23933
24361
  };
23934
24362
 
23935
24363
  /** @private
23936
24364
  * @param {number} rowIndex
23937
24365
  */
23938
24366
  LayoutGrid.prototype._addSelectionUI = function (rowIndex) {
23939
- for (var c = 0; c < this._colCount; ++c) {
23940
- var cell = this._columns[c].getCell(rowIndex);
23941
-
23942
- if (cell) {
23943
- cell.addClass("selected-row");
23944
- }
23945
- }
24367
+ this._enableStretchCellClass(rowIndex, "selected-row", true);
24368
+ this.enableRowClass(rowIndex, "selected-row", true);
23946
24369
  };
23947
24370
 
23948
24371
  /**
@@ -23950,13 +24373,8 @@ LayoutGrid.prototype._addSelectionUI = function (rowIndex) {
23950
24373
  * @param {number} rowIndex
23951
24374
  */
23952
24375
  LayoutGrid.prototype._removeSelectionUI = function (rowIndex) {
23953
- for (var c = 0; c < this._colCount; ++c) {
23954
- var cell = this._columns[c].getCell(rowIndex);
23955
-
23956
- if (cell) {
23957
- cell.removeClass("selected-row");
23958
- }
23959
- }
24376
+ this._enableStretchCellClass(rowIndex, "selected-row", false);
24377
+ this.enableRowClass(rowIndex, "selected-row", false);
23960
24378
  };
23961
24379
 
23962
24380
  /**
@@ -30271,6 +30689,11 @@ SectionSettings.prototype._dispatchDataChanged = function (firstUpdate, lastUpda
30271
30689
  */
30272
30690
  SectionSettings.prototype.updateRowData = function (fromRowIndex, lastRowIndex, e) {
30273
30691
  if(this.isDataBindable()) { // Prevent dispatching dataChanged event without the data view
30692
+ if(this._grid._getTempRowHeights()){
30693
+ fromRowIndex = this._grid.getFirstIndexInView();
30694
+ lastRowIndex = this._grid.getLastIndexInView() + 1;
30695
+ }
30696
+
30274
30697
  e = this.extendDataEventArg(e, fromRowIndex, lastRowIndex);
30275
30698
  if(e["fromRowIndex"] < e["toRowIndex"]) {
30276
30699
  this._dispatch("dataChanged", e);
@@ -31031,6 +31454,14 @@ VirtualizedLayoutGrid.prototype._boundLayer = null;
31031
31454
  * @private
31032
31455
  */
31033
31456
  VirtualizedLayoutGrid.prototype._hscrollbar = null;
31457
+ /** @type {string}
31458
+ * @private
31459
+ */
31460
+ VirtualizedLayoutGrid.prototype._session = "A";
31461
+ /** @type {Array<boolean>}
31462
+ * @private
31463
+ */
31464
+ VirtualizedLayoutGrid.prototype._tempRowHeights = null;
31034
31465
 
31035
31466
  //#region ====== Override ElementWrapper ======//
31036
31467
  /** @override */
@@ -31142,13 +31573,68 @@ VirtualizedLayoutGrid.prototype._setColumnWidth = function (indexX, val) {
31142
31573
  VirtualizedLayoutGrid.prototype._updateColumnLayout = function () {
31143
31574
  this._grid._updateColumnLayout();
31144
31575
  };
31576
+ /** @public
31577
+ * @ignore
31578
+ * @param {boolean} enabled
31579
+ */
31580
+ VirtualizedLayoutGrid.prototype._startBindingSession = function (enabled) {
31581
+ this._isBinding = enabled;
31582
+ if(!enabled){
31583
+ // Clear old session
31584
+ if(this._tempRowHeights){
31585
+ var defaultRowHeight = this.getDefaultRowHeight();
31586
+ var hasSession = true;
31587
+ var removedIndices = [];
31588
+
31589
+ for(var key in this._tempRowHeights){
31590
+ var index = +key;
31591
+ var rowSession = this._layoutY.getLaneProperty(index, "sizeSession");
31592
+ if(rowSession) {
31593
+ if(rowSession != this._session){
31594
+ this.setRowHeight(index, defaultRowHeight);
31595
+ this._layoutY.setLaneProperty(index, "sizeSession", null);
31596
+ removedIndices.push(index);
31597
+ }
31598
+ }
31599
+ }
31600
+ var removedCount = removedIndices.length;
31601
+ for(var i = 0; i < removedCount; i++){
31602
+ delete this._tempRowHeights[removedIndices[i]];
31603
+ }
31604
+ if(removedCount){
31605
+ for(var remainingKey in this._tempRowHeights){
31606
+ hasSession = remainingKey != null;
31607
+ break;
31608
+ }
31609
+ }
31610
+ if(!hasSession){
31611
+ this._tempRowHeights = null;
31612
+ }
31145
31613
 
31614
+ }
31615
+ this._session = this._session === "A" ? "B" : "A";
31616
+ }
31617
+ };
31618
+ /** @public
31619
+ * @ignore
31620
+ * @return {Array<boolean>}
31621
+ */
31622
+ VirtualizedLayoutGrid.prototype._getTempRowHeights = function () {
31623
+ return this._tempRowHeights;
31624
+ };
31146
31625
  /** @inheritDoc */
31147
31626
  VirtualizedLayoutGrid.prototype.getRowHeight = function (index) {
31148
31627
  return this._layoutY.getLaneSize(index);
31149
31628
  };
31150
31629
  /** @inheritDoc */
31151
31630
  VirtualizedLayoutGrid.prototype.setRowHeight = function (index, val) {
31631
+ if(this._isBinding && val != this.getDefaultRowHeight()){
31632
+ this._layoutY.setLaneProperty(index, "sizeSession", this._session);
31633
+ if(!this._tempRowHeights){
31634
+ this._tempRowHeights = [];
31635
+ }
31636
+ this._tempRowHeights[index] = true; // Store row index that set temporary row height
31637
+ }
31152
31638
  if(this._layoutY.setLaneSize(index, val)) {
31153
31639
  this._grid.setRowHeight(index - this._firstIndex, val);
31154
31640
  this._element.style.height = this._layoutY.getTrackSize() + "px";
@@ -31302,6 +31788,9 @@ VirtualizedLayoutGrid.prototype.setRowCount = function (val, noBinding) {
31302
31788
  var prevCount = this._layoutY.getLaneCount();
31303
31789
  if(prevCount !== val){
31304
31790
  this._layoutY.setLaneCount(val);
31791
+ if(this._tempRowHeights){
31792
+ this._tempRowHeights.length = val;
31793
+ }
31305
31794
  this._element.style.height = this._layoutY.getTrackSize() + "px";
31306
31795
  this._requestUpdatingRowBounds();
31307
31796
  //After rowCountChanged fires, virtualizer will update virtual row count if
@@ -32190,6 +32679,7 @@ var Core = function (opt_initializer) {
32190
32679
  _t._updateColumnBounds = _t._updateColumnBounds.bind(_t);
32191
32680
  _t._dispatchColumnPositionChanged = _t._dispatchColumnPositionChanged.bind(_t);
32192
32681
  _t._dispatchRowPositionChanged = _t._dispatchRowPositionChanged.bind(_t);
32682
+ _t._requestScrollbarUpdate = _t._requestScrollbarUpdate.bind(_t);
32193
32683
 
32194
32684
  // Text nodes are unintentionally getting in the tag.
32195
32685
  if(opt_initializer) { // Any node other than element node is not allowed within the tag.
@@ -32607,6 +33097,10 @@ Core.prototype._preserveProportion = false;
32607
33097
  * @private
32608
33098
  */
32609
33099
  Core.prototype._preserveGridSize = false;
33100
+ /** @type {number}
33101
+ * @private
33102
+ */
33103
+ Core.prototype._rowHeightTimerId = 0;
32610
33104
  //#region Public Methods
32611
33105
 
32612
33106
  /**
@@ -32614,7 +33108,7 @@ Core.prototype._preserveGridSize = false;
32614
33108
  * @return {string}
32615
33109
  */
32616
33110
  Core.getVersion = function () {
32617
- return "5.0.55";
33111
+ return "5.0.59";
32618
33112
  };
32619
33113
  /** {@link ElementWrapper#dispose}
32620
33114
  * @override
@@ -35442,6 +35936,11 @@ Core.prototype.getScrollHeight = function () {
35442
35936
  }
35443
35937
  return this._vscrollbar.getContentHeight();
35444
35938
  };
35939
+ /** @public
35940
+ */
35941
+ Core.prototype.restoreScrollbars = function () {
35942
+ this._vscrollbar.restoreTrackPosition();
35943
+ };
35445
35944
 
35446
35945
  /** @public
35447
35946
  * @ignore
@@ -35567,6 +36066,13 @@ Core.prototype.requestRowRefresh = function() {
35567
36066
  this._rowRefreshTimer = setTimeout(this._onRowRefresh, 100);
35568
36067
  }
35569
36068
  };
36069
+ /** Set a timer to call updateScrollbarHeight only once to avoid performance issue due to multiple call of _updateScrollbarHeight()
36070
+ * @public
36071
+ */
36072
+ Core.prototype._requestScrollbarUpdate = function() {
36073
+ this._updateScrollbarHeight(true, true);
36074
+ this._rowHeightTimerId = 0;
36075
+ };
35570
36076
 
35571
36077
  /** prevent bind data process
35572
36078
  * @public
@@ -36462,6 +36968,9 @@ Core.prototype._onSectionDataChanged = function (e) {
36462
36968
  var dataView = /** @type{DataView} */(e["dataSource"]);
36463
36969
  var hasDataView = (dataView && dataView.getDataSource()) ? 1 : 0;
36464
36970
  var rids, rowDataCollection;
36971
+
36972
+ section._startBindingSession(true);
36973
+
36465
36974
  if(hasDataView) {
36466
36975
  rids = dataView.getVisibleRowIds(true);
36467
36976
  rowDataCollection = dataView.getMultipleRowData(rids, fromR, toR);
@@ -36499,8 +37008,9 @@ Core.prototype._onSectionDataChanged = function (e) {
36499
37008
  }
36500
37009
 
36501
37010
  this._dispatch("postSectionDataBinding", e);
36502
-
36503
37011
  this._dispatchRowExpansionBinding(e);
37012
+
37013
+ section._startBindingSession(false);
36504
37014
  this._dispatchingDataChanged = false;
36505
37015
  };
36506
37016
 
@@ -36826,8 +37336,14 @@ Core.prototype._onRowHeightChanged = function (e) {
36826
37336
  this._rowHeightConflator._needScrollbarUpdate = false;
36827
37337
  this._updateScrollbarHeight(true, true);
36828
37338
  } else if(minSectionIndex >= 0) {
36829
- this._updateScrollbarHeight(minSectionIndex < this._startVScrollbarIndex,
36830
- minSectionIndex >= this._startVScrollbarIndex);
37339
+ if(this._dispatchingDataChanged){
37340
+ if(!this._rowHeightTimerId){
37341
+ this._rowHeightTimerId = setTimeout(this._requestScrollbarUpdate, 0);
37342
+ }
37343
+ } else {
37344
+ this._updateScrollbarHeight(minSectionIndex < this._startVScrollbarIndex,
37345
+ minSectionIndex >= this._startVScrollbarIndex);
37346
+ }
36831
37347
  }
36832
37348
 
36833
37349
  this._dispatchRowPositionChanged();
@@ -37253,7 +37769,8 @@ Core.prototype._updateSectionIndices = function (from) {
37253
37769
 
37254
37770
  /** @private */
37255
37771
  Core.prototype._updateLayout = function () {
37256
- if(this._disposed) { return; }
37772
+ var element = this.getElement();
37773
+ if(this._disposed || !element.offsetParent) { return; }
37257
37774
 
37258
37775
  this._syncLayoutToColumns(); // Update only if need
37259
37776
 
@@ -39780,6 +40297,11 @@ SortableTitlePlugin._proto = SortableTitlePlugin.prototype;
39780
40297
  * @property {boolean=} debug=false If true, Synapse response will be mock
39781
40298
  */
39782
40299
 
40300
+ /** @typedef {Object} Grid~ADCOptions
40301
+ * @description ADC requesting level config from adc team
40302
+ * @property {string=} productId=001 required parameter, it specifies the product for which you request data. Contact the adc staff to create one.
40303
+ */
40304
+
39783
40305
  /** @typedef {Object} Grid~GridOptions
39784
40306
  * @description Configuration object that can be provided directly at the initialization phase
39785
40307
  * @property {Array.<ColumnDefinition~Options|string>=} columns Collection of the column definitions
@@ -39814,6 +40336,7 @@ SortableTitlePlugin._proto = SortableTitlePlugin.prototype;
39814
40336
  * @property {boolean=} verticalLines=true Vertical lines for all sections
39815
40337
  * @property {boolean=} horizontalLines=true Horizontal lines for all sections
39816
40338
  * @property {*=} RTK=null rtk toolkit instance
40339
+ * @property {Grid~ADCOptions=} ADC=null ADC requesting level config object from adc team
39817
40340
  * @property {Grid~SynapseConfig=} synapse=null synapse config object
39818
40341
  * @property {number=} contentRightPadding=0 Padding that is added next to the right most column. The padding is still a part of scrollable content.
39819
40342
  * @property {number=} contentBottomPadding=0 Padding that is added below the last section. The padding is still a part of scrollable content.
@@ -40204,6 +40727,10 @@ Grid.prototype._defaultColumnOptions = null;
40204
40727
  * @type {*}
40205
40728
  */
40206
40729
  Grid.prototype._RTK = null;
40730
+ /** @private
40731
+ * @type {Grid~ADCOptions}
40732
+ */
40733
+ Grid.prototype._ADCOptions = null;
40207
40734
  /** use for synapse service
40208
40735
  * @private
40209
40736
  * @type {string}
@@ -40478,6 +41005,12 @@ Grid.prototype.initialize = function(gridOption) {
40478
41005
  t._RTK = gridOption["RTK"];
40479
41006
  t._snapshot.setRTK(t._RTK);
40480
41007
  }
41008
+
41009
+ if (gridOption["ADC"]) {
41010
+ t._ADCOptions = gridOption["ADC"];
41011
+ t._snapshot.setADCOptions(t._ADCOptions);
41012
+ }
41013
+
40481
41014
  if (gridOption["synapse"]) {
40482
41015
  t._synapse = gridOption["synapse"];
40483
41016
  js_FieldDefinition.setSynapseConfig(t._synapse);
@@ -40833,7 +41366,7 @@ Grid.prototype.getConfigObject = function (gridOptions) {
40833
41366
  // topFreezingCount, bottomFreezingCount
40834
41367
  // scrollbarParent
40835
41368
 
40836
- // NOTE: no need to export synapseApiKey and RTK
41369
+ // NOTE: no need to export synapseApiKey, ADC and RTK
40837
41370
 
40838
41371
  return obj;
40839
41372
  };
@@ -40994,6 +41527,70 @@ Grid.prototype.insertColumn = function (columnOption, idx) {
40994
41527
  };
40995
41528
 
40996
41529
 
41530
+ /** @public
41531
+ * @param {ColumnDefinition~Options|string} columnOption String will be treated as field, while object is treated as the column options
41532
+ * @param {Grid~ColumnReference} colRef
41533
+ */
41534
+ Grid.prototype.replaceColumn = function (columnOption, colRef) {
41535
+ var colIndex = this.getColumnIndex(colRef);
41536
+ if(colIndex < 0) {
41537
+ return;
41538
+ }
41539
+ var colConfig = {};
41540
+ var core = this._grid;
41541
+ var columnDef = core._getColumnDef(colIndex);
41542
+
41543
+ var value = core.getColumnScalability(colIndex);
41544
+ colConfig["scalable"] = value;
41545
+
41546
+ value = core.getColumnCustomLaneSize(colIndex);
41547
+ colConfig["width"] = value;
41548
+
41549
+ value = core.getMinimumColumnWidth(colIndex);
41550
+ if(value !== 32) {
41551
+ colConfig["minWidth"] = value;
41552
+ }
41553
+
41554
+ value = core.isColumnVisible(colIndex);
41555
+ if(!value) {
41556
+ colConfig["hidden"] = true;
41557
+ }
41558
+
41559
+ value = columnDef["stationary"];
41560
+ if (value) {
41561
+ colConfig["stationary"] = value;
41562
+ }
41563
+
41564
+ value = columnDef["leftPinned"];
41565
+ if (value) {
41566
+ colConfig["leftPinned"] = value;
41567
+ }
41568
+
41569
+ value = columnDef["rightPinned"];
41570
+ if (value) {
41571
+ colConfig["rightPinned"] = value;
41572
+ }
41573
+
41574
+ if(typeof columnOption === "string") {
41575
+ colConfig["field"] = columnOption;
41576
+ } else { // type object from user
41577
+ for (var key in columnOption) {
41578
+ colConfig[key] = columnOption[key];
41579
+ }
41580
+ }
41581
+
41582
+ if(columnOption["width"] && !columnOption["scalable"]) {
41583
+ colConfig["scalable"] = false;
41584
+ }
41585
+
41586
+ if(columnOption["scalable"] && !columnOption["width"]) {
41587
+ colConfig["width"] = 1;
41588
+ }
41589
+
41590
+ this.insertColumn(colConfig, colIndex);
41591
+ this.removeColumn(colIndex + 1); // remove existing column after insert
41592
+ };
41593
+
40997
41594
  /** to update column name when field info is loaded
40998
41595
  * @private
40999
41596
  * @param {string} field
@@ -46159,7 +46756,7 @@ CellPainter._onThemeChanged = function(colors) {
46159
46756
  */
46160
46757
  CellPainter.loadThemeColors = function() {
46161
46758
  if(!CellPainter.themeReady) {
46162
- CellPainter.themeReady = ElfUtil.getThemeColors().then(CellPainter._onThemeChanged);
46759
+ CellPainter.themeReady = ElfUtil.getThemeColors(CellPainter._onThemeChanged).then(CellPainter._onThemeChanged);
46163
46760
  }
46164
46761
  return CellPainter.themeReady;
46165
46762
  };