@refinitiv-ui/efx-grid 6.0.31 → 6.0.33

Sign up to get free protection for your applications and to get access to all the features.
Files changed (41) hide show
  1. package/lib/core/dist/core.js +376 -126
  2. package/lib/core/dist/core.min.js +1 -1
  3. package/lib/core/es6/grid/Core.d.ts +4 -0
  4. package/lib/core/es6/grid/Core.js +79 -33
  5. package/lib/core/es6/grid/ILayoutGrid.js +3 -3
  6. package/lib/core/es6/grid/LayoutGrid.js +67 -23
  7. package/lib/core/es6/grid/VirtualizedLayoutGrid.js +92 -55
  8. package/lib/core/es6/grid/plugins/SortableTitlePlugin.d.ts +1 -0
  9. package/lib/core/es6/grid/plugins/SortableTitlePlugin.js +29 -5
  10. package/lib/core/es6/grid/util/SelectionList.d.ts +6 -2
  11. package/lib/core/es6/grid/util/SelectionList.js +76 -7
  12. package/lib/grid/index.js +1 -1
  13. package/lib/rt-grid/dist/rt-grid.js +521 -179
  14. package/lib/rt-grid/dist/rt-grid.min.js +1 -1
  15. package/lib/rt-grid/es6/Grid.js +14 -13
  16. package/lib/rt-grid/es6/RowDefinition.js +1 -1
  17. package/lib/statistics-row/es6/StatisticsRow.d.ts +25 -25
  18. package/lib/statistics-row/es6/StatisticsRow.js +9 -4
  19. package/lib/tr-grid-column-grouping/es6/ColumnGrouping.d.ts +4 -0
  20. package/lib/tr-grid-column-grouping/es6/ColumnGrouping.js +58 -30
  21. package/lib/tr-grid-column-selection/es6/ColumnSelection.d.ts +2 -0
  22. package/lib/tr-grid-column-selection/es6/ColumnSelection.js +14 -0
  23. package/lib/tr-grid-column-stack/es6/ColumnStack.d.ts +2 -0
  24. package/lib/tr-grid-column-stack/es6/ColumnStack.js +35 -12
  25. package/lib/tr-grid-row-dragging/es6/RowDragging.d.ts +23 -1
  26. package/lib/tr-grid-row-dragging/es6/RowDragging.js +339 -40
  27. package/lib/tr-grid-util/es6/GroupDefinitions.d.ts +2 -0
  28. package/lib/tr-grid-util/es6/GroupDefinitions.js +15 -0
  29. package/lib/tr-grid-util/es6/Util.d.ts +3 -0
  30. package/lib/tr-grid-util/es6/Util.js +15 -0
  31. package/lib/tr-grid-util/es6/jet/CollectionDict.d.ts +1 -1
  32. package/lib/tr-grid-util/es6/jet/CollectionDict.js +12 -2
  33. package/lib/tr-grid-util/es6/jet/MockQuotes2.js +170 -47
  34. package/lib/types/es6/ColumnGrouping.d.ts +4 -0
  35. package/lib/types/es6/ColumnSelection.d.ts +2 -0
  36. package/lib/types/es6/ColumnStack.d.ts +2 -0
  37. package/lib/types/es6/Core/grid/util/SelectionList.d.ts +6 -2
  38. package/lib/types/es6/RowDragging.d.ts +23 -1
  39. package/lib/types/es6/StatisticsRow.d.ts +25 -25
  40. package/lib/versions.json +6 -6
  41. package/package.json +1 -1
@@ -75,6 +75,10 @@ var RowDraggingPlugin = function (options) {
75
75
  t._onDragEnd = t._onDragEnd.bind(t);
76
76
  t._onThemeLoaded = t._onThemeLoaded.bind(t);
77
77
 
78
+ t._onJETDrop = t._onJETDrop.bind(t);
79
+ t._onJETDragOver = t._onJETDragOver.bind(t);
80
+ t._delayStart = t._delayStart.bind(t);
81
+
78
82
  t._hosts = [];
79
83
 
80
84
  t._guideline = document.createElement("div"); // Test IE mouse event, guildline close mouse event
@@ -198,6 +202,30 @@ RowDraggingPlugin.prototype._autoScroll = true;
198
202
  * @private
199
203
  */
200
204
  RowDraggingPlugin.prototype._dragUI = null;
205
+ /** @type {number}
206
+ * @private
207
+ */
208
+ RowDraggingPlugin.prototype._timerId = -1;
209
+ /** @type {boolean}
210
+ * @private
211
+ */
212
+ RowDraggingPlugin.prototype._jetDnD = false;
213
+ /** @type {Object}
214
+ * @private
215
+ */
216
+ RowDraggingPlugin.prototype._jetDragContent = null;
217
+ /** @type {boolean}
218
+ * @private
219
+ */
220
+ RowDraggingPlugin.prototype._jetContentHasRic = false;
221
+ /** @type {boolean}
222
+ * @private
223
+ */
224
+ RowDraggingPlugin.prototype._jetContentHasField = false;
225
+ /** @type {string}
226
+ * @private
227
+ */
228
+ RowDraggingPlugin.prototype._entryPoint = "";
201
229
 
202
230
  /** @private Applied theme color in row dragging and dragUI
203
231
  * @param {Object} host core grid instance
@@ -337,7 +365,11 @@ RowDraggingPlugin.prototype.config = function (options) {
337
365
 
338
366
  if (typeof extOptions["dragBoxRenderer"] === "function") {
339
367
  this._dragBoxRenderer = extOptions["dragBoxRenderer"];
340
- this._dragBox.className = "drag-box"; // set disable drag-box
368
+ var className = "drag-box";
369
+ if (ElfUtil.getElfVersion() < 3) {
370
+ className = "tr-dragbox content-dragging"; // Keep backward compatibility
371
+ }
372
+ this._dragBox.className = className;
341
373
  } else {
342
374
  this._dragBox.className = "drag-box-disabled"; // set disable drag-box
343
375
  }
@@ -389,38 +421,10 @@ RowDraggingPlugin.prototype.getConfigObject = function (out_obj) {
389
421
  };
390
422
 
391
423
  /** @public
392
- * @param {*} startRef
393
- * @param {boolean=} opt_suppressEvent
424
+ * @param {*=} startRef
394
425
  */
395
426
  RowDraggingPlugin.prototype.startDrag = function (startRef) {
396
- if (this._dragging || this._hosts.length <= 0) { return; }
397
- if (this._disabled) {
398
- return;
399
- }
400
-
401
- var pos;
402
- if (startRef) {
403
- if (startRef.type === "dragstart") {
404
- if(startRef["preventDefault"]) {
405
- Dom.preventDefault(startRef);
406
- }
407
- var host = this.getRelativeGrid(startRef);
408
- if (host) {
409
- pos = host.getRelativePosition(this._dragTarget);
410
- }
411
- } else {
412
- pos = this._hitTest(startRef);
413
- }
414
- } else {
415
- var target = this._dragTarget || this._hosts[0].getSection("content").getCell(0, 0);
416
- pos = this._hitTest(target);
417
- }
418
-
419
- if (_isInContentSection(pos)) {
420
- this._clearCache();
421
- this._pos = pos;
422
- this._onDragStart(startRef);
423
- }
427
+ this._startDrag(false, startRef); // Start without delay start
424
428
  };
425
429
  /** @public */
426
430
  RowDraggingPlugin.prototype.stopDrag = function () {
@@ -469,6 +473,114 @@ RowDraggingPlugin.prototype.disableUIs = function (disabled) {
469
473
  this._uiDisabled = disabled !== false;
470
474
  };
471
475
 
476
+ /** @public
477
+ * @param {boolean=} allowed
478
+ */
479
+ RowDraggingPlugin.prototype.allowDrag = function (allowed) {
480
+ if(this._pos) {// WARNING: Please note that this method is intent to be used by client, and not for internal use
481
+ this._pos["invalidTarget"] = (allowed === false);
482
+ }
483
+ };
484
+
485
+ /** @public
486
+ * @function
487
+ * @param {boolean=} allowed
488
+ */
489
+ RowDraggingPlugin.prototype.allowDrop = RowDraggingPlugin.prototype.allowDrag;
490
+
491
+ /** @public
492
+ * @param {*} content Element, Node, string, number, or everything else.
493
+ */
494
+ RowDraggingPlugin.prototype.setDragContent = function (content) {
495
+ this._dragUI.setContent(content);
496
+ };
497
+
498
+ /** @public
499
+ * @return {Element}
500
+ */
501
+ RowDraggingPlugin.prototype.getDragBox = function () {
502
+ return this._dragBox;
503
+ };
504
+
505
+ /** @public
506
+ * @return {string}
507
+ */
508
+ RowDraggingPlugin.prototype.getDragSource = function () {
509
+ return this._entryPoint;
510
+ };
511
+
512
+ /** @public
513
+ * @return {boolean}
514
+ */
515
+ RowDraggingPlugin.prototype.isDragging = function () {
516
+ return this._dragging;
517
+ };
518
+
519
+ /** @public
520
+ * @param {boolean=} disabled
521
+ */
522
+ RowDraggingPlugin.prototype.disableDragging = function (disabled) {
523
+ this._disabled = disabled !== false;
524
+ };
525
+
526
+ /** @public
527
+ * @param {boolean=} enabled
528
+ */
529
+ RowDraggingPlugin.prototype.enableJETDragAndDrop = function (enabled) {
530
+ var val = enabled !== false;
531
+ if(this._jetDnD === val) { return; }
532
+
533
+ this._jetDnD = val;
534
+
535
+ var jet = window["JET"];
536
+ if (jet) {
537
+ //If ContainerDescription is undefined, that means JET is not initalized. Mostlikely the app
538
+ //is running the local development mode without container. Disable dnd in this case
539
+ if (jet["ContainerDescription"] && (jet["ContainerDescription"]["name"] !== "EikonNowContainer")) {
540
+ if (this._jetDnD) {
541
+ jet["onDrop"](this._onJETDrop);
542
+ jet["onDragOver"](this._onJETDragOver);
543
+ jet["onDragLeave"](this.stopDrag);
544
+ } else {
545
+ jet["onDrop"](null);
546
+ jet["onDragOver"](null);
547
+ jet["onDragLeave"](null);
548
+ }
549
+ } else {
550
+ this._jetDnD = false;
551
+ }
552
+ }
553
+ };
554
+
555
+ /** @public
556
+ * @return {Object}
557
+ */
558
+ RowDraggingPlugin.prototype.getJETDragContent = function () {
559
+ return this._jetDragContent;
560
+ };
561
+
562
+ /** @public
563
+ * @param {Object} content
564
+ */
565
+ RowDraggingPlugin.prototype.setJETDragContent = function (content) {
566
+ this._jetDragContent = content;
567
+
568
+ var tr = window["tr"];
569
+ var grid = (tr) ? tr["grid"] : null;
570
+ var JetDragContent = (grid) ? grid["JetDragContent"] : null;
571
+ if (content && JetDragContent) {
572
+ var jetDragContentMgr = new JetDragContent(content);
573
+ var rics = jetDragContentMgr["getRicsToDrop"]();
574
+ var fields = jetDragContentMgr["getFieldsToDrop"]();
575
+
576
+ this._jetContentHasRic = (rics && rics.length > 0) ? true : false;
577
+ this._jetContentHasField = (fields && fields.length > 0) ? true : false;
578
+ } else {
579
+ this._jetContentHasRic = false;
580
+ this._jetContentHasField = false;
581
+ }
582
+ };
583
+
472
584
  /** @private
473
585
  * @param {*} e
474
586
  * @return {!Object}
@@ -503,25 +615,41 @@ RowDraggingPlugin.prototype._onMouseDown = function (e) {
503
615
  this._touchMode = true;
504
616
  }
505
617
  this._dragTarget = /** @type{Element} */(e.target);
618
+ this._setEntryPoint("grid");
506
619
  };
507
620
  /** @private
508
621
  * @param {*=} e
622
+ * @param {boolean=} fromJET
509
623
  */
510
- RowDraggingPlugin.prototype._onDragStart = function (e) {
624
+ RowDraggingPlugin.prototype._onDragStart = function (e, fromJET) {
511
625
  if (this._dragging) { return; }
512
626
  if (!this._pos) { return; }
513
627
 
514
- this._dispatch("dragStart", this._pos);
515
- if (this._isDragCancelled()) {
516
- return;
628
+ this._listenAbortActions(false); // Unlisen abort action
629
+
630
+ var useJetDragStart = false;
631
+ var jet = window["JET"];
632
+ if (fromJET) {
633
+ useJetDragStart = true;
634
+ } else {
635
+ this._dispatch("dragStart", /** @type{!Object} */(this._pos));
636
+ if(this._isDragCancelled()) {
637
+ return; // User does not allow this drag to happen
638
+ }
639
+ if (jet && this._jetDnD && this._jetDragContent) {
640
+ useJetDragStart = true;
641
+ jet["dragStart"](this._jetDragContent);
642
+ }
517
643
  }
518
644
 
519
645
  this._dragging = true;
520
646
  // Event listeners
521
647
  document.body.classList.add("tr-dragging"); // Prevent text selection
522
648
 
523
- window.addEventListener("mousemove", this._onMouseMove, false);
524
- window.addEventListener("touchmove", this._onMouseMove, false);
649
+ if (!useJetDragStart) { // WARNING: JET wrongly intercepts all mouse events without app's consent
650
+ window.addEventListener("mousemove", this._onMouseMove, false);
651
+ window.addEventListener("touchmove", this._onMouseMove, false);
652
+ }
525
653
  window.addEventListener("mouseup", this._onDragEnd, false);
526
654
  window.addEventListener("touchend", this._onDragEnd, false);
527
655
  window.addEventListener("touchcancel", this._onDragEnd, false);
@@ -601,12 +729,20 @@ RowDraggingPlugin.prototype._onMouseMove = function (e) {
601
729
 
602
730
  this._pos = this._hitTest(e); // A new object is created
603
731
 
604
- this._updateGuidePosition(e);
732
+ var dropable = true;
733
+ if(this._entryPoint === 'JET' && !this._jetContentHasRic) {
734
+ dropable = false;
735
+ }
736
+
737
+ if(dropable) {
738
+ this._updateGuidePosition(e);
739
+ }
740
+
605
741
  this._pos.dragBox = this._dragBox; // assign dragBox for user determine valid target
606
742
 
607
743
  // Dispatch drag event to let user determine valid drop target using allowDrag (allowDrop) method
608
744
  this._dispatch("drag", this._pos);
609
- if(!this._uiDisabled) {
745
+ if(!this._uiDisabled && dropable) {
610
746
  e.dragBoxIcon = this._pos.dragBoxIcon; // access event object instread of element for prevent element persistence
611
747
  var drop = this._dragUI.renderDragBox(e, this._startingGrid);
612
748
  if(!drop) { // can not be drop or not allow to drop or insertion
@@ -655,7 +791,7 @@ RowDraggingPlugin.prototype._onDragEnd = function (e) {
655
791
  // WARNING: dropTarget is not correct for element in a shadow root
656
792
  destPos["dropTarget"] = e ? e.target : null;
657
793
 
658
- if (this._dataTransfer && _isInContentSection(this._pos)) {
794
+ if (!this._jetDnD && this._dataTransfer && _isInContentSection(this._pos)) {
659
795
  var destGrid = destPos["grid"] || srcGrid;
660
796
  var destRowIndex = destPos["rowIndex"];
661
797
 
@@ -668,10 +804,26 @@ RowDraggingPlugin.prototype._onDragEnd = function (e) {
668
804
 
669
805
  this._moveRows(srcRowIndices, destRowIndex, srcGrid, destGrid, destPos);
670
806
  }
807
+
808
+ // Extend event property
809
+ var cellElement = destPos["cellElement"];
810
+ var isRight = 0;
811
+
812
+ if (e && cellElement) {
813
+ var rect = cellElement.getBoundingClientRect();
814
+ var offsetX = (e["clientX"] - rect["left"]) / destPos["zoomFactor"];
815
+ isRight = Math.round(offsetX / cellElement.offsetWidth);
816
+ }
817
+
818
+ destPos["colIndex"] += isRight;
819
+ destPos["currentPosition"] = destPos; // To support JET requirement
820
+ destPos["data"] = this._jetDragContent;
821
+ destPos["dropTarget"] = e.target;
671
822
  }
672
823
 
673
824
  this._dispatch("dragEnd", destPos || {}); // Always fire drag end for client to clean up its resource
674
825
  this._clearCache();
826
+ this._jetDragContent = null;
675
827
  };
676
828
  /** @private
677
829
  * @param {Array.<number>|string} srcRowRef
@@ -840,6 +992,153 @@ RowDraggingPlugin.prototype._onDragPulse = function () {
840
992
  }
841
993
  };
842
994
 
995
+ /** @public
996
+ * @param {Object} content
997
+ */
998
+ RowDraggingPlugin.prototype.setJETDragContent = function (content) {
999
+ this._jetDragContent = content;
1000
+
1001
+ var t = window["tr"];
1002
+ var g = (t) ? t["grid"] : null;
1003
+ var jdc = (g) ? g["JetDragContent"] : null;
1004
+ if (content && jdc) {
1005
+ var jetDragContentMgr = new jdc(content);
1006
+ var rics = jetDragContentMgr["getRicsToDrop"]();
1007
+ var fields = jetDragContentMgr["getFieldsToDrop"]();
1008
+
1009
+ this._jetContentHasRic = (rics && rics.length > 0) ? true : false;
1010
+ this._jetContentHasField = (fields && fields.length > 0) ? true : false;
1011
+ } else {
1012
+ this._jetContentHasRic = false;
1013
+ this._jetContentHasField = false;
1014
+ }
1015
+ };
1016
+ /** @private
1017
+ * @param {string} str
1018
+ */
1019
+ RowDraggingPlugin.prototype._setEntryPoint = function (str) {
1020
+ this._entryPoint = str;
1021
+ this.setDragContent(null); // Clear original content
1022
+ };
1023
+
1024
+ /** @private
1025
+ * @param {Object} e
1026
+ */
1027
+ RowDraggingPlugin.prototype._onMouseOut = function (e) {
1028
+ e = e ? e : window.event;
1029
+ var from = e.relatedTarget || e.toElement;
1030
+ if (!from || from.nodeName == "HTML") {
1031
+ // window.console.warn("Left window");
1032
+
1033
+ /*
1034
+ * TRGRID-1493
1035
+ * The DragStart is delayed using a timer (_timerId created by _delayStart )
1036
+ * The mouse may left the window before the drag start
1037
+ * In this case we should force the stopDrag to stop the drag on the source
1038
+ * Because the mouse up will not be handled by the source
1039
+ */
1040
+
1041
+ // cancel the timer - _onDragStart will not be called by the timer
1042
+ if(this._timerId >= 0) {
1043
+ clearTimeout(this._timerId);
1044
+ this._timerId = -1;
1045
+ }
1046
+
1047
+ this._onDragStart();
1048
+ this.stopDrag();
1049
+ }
1050
+ };
1051
+
1052
+ /** @private
1053
+ * @param {Object} e
1054
+ */
1055
+ RowDraggingPlugin.prototype._delayStart = function (e) {
1056
+ this._startingGrid.unlisten("mousemove", this._delayStart);
1057
+
1058
+ if (this._timerId < 0) {
1059
+ this._timerId = window.setTimeout(this._onDragStart, 200);
1060
+ }
1061
+ if (this._jetDnD) {
1062
+ document.addEventListener("mouseout", this._onMouseOut, false);
1063
+ }
1064
+ };
1065
+ /** @private
1066
+ * @param {boolean=} bool
1067
+ */
1068
+ RowDraggingPlugin.prototype._listenAbortActions = function (bool) {
1069
+ if (bool !== false) {
1070
+ window.addEventListener("mouseup", this._clearCache, false);
1071
+ } else {
1072
+ window.removeEventListener("mouseup", this._clearCache, false);
1073
+ }
1074
+ };
1075
+ /** @private
1076
+ * @param {boolean=} delayStart
1077
+ * @param {*=} startRef
1078
+ * @param {boolean=} fromJET
1079
+ */
1080
+ RowDraggingPlugin.prototype._startDrag = function (delayStart, startRef, fromJET) {
1081
+ if (this._dragging || this._hosts.length <= 0) { return; }
1082
+ if (this._disabled) { return; }
1083
+
1084
+ var pos;
1085
+ if (startRef) {
1086
+ if (startRef.type === "dragstart") {
1087
+ if (startRef["preventDefault"]) {
1088
+ Dom.preventDefault(startRef);
1089
+ }
1090
+ var host = this.getRelativeGrid(startRef);
1091
+ if (host) {
1092
+ pos = host.getRelativePosition(this._dragTarget);
1093
+ }
1094
+ } else {
1095
+ pos = this._hitTest(startRef);
1096
+ }
1097
+ } else {
1098
+ var target = this._dragTarget || this._hosts[0].getSection("content").getCell(0, 0);
1099
+ pos = this._hitTest(target);
1100
+ }
1101
+
1102
+ if (_isInContentSection(pos)) {
1103
+ this._clearCache();
1104
+ this._pos = pos;
1105
+ this._startingGrid = pos["grid"];
1106
+
1107
+ if (delayStart) {
1108
+ this._startingGrid.listen("mousemove", this._delayStart);
1109
+ this._listenAbortActions();
1110
+ } else { // Start immediately
1111
+ this._onDragStart(startRef, fromJET);
1112
+ }
1113
+ }
1114
+ };
1115
+ /** @private
1116
+ * @param {Object} clientPos
1117
+ */
1118
+ RowDraggingPlugin.prototype._onJETDragOver = function (clientPos) {
1119
+ if (!clientPos) { return; }
1120
+
1121
+ if (!this._dragging) {
1122
+ if (!clientPos["dropData"]) { return; }
1123
+ this._setEntryPoint("JET");
1124
+ this.setJETDragContent(clientPos["dropData"]); // WARNING: We have no way to distinguish between dropData from grid and other apps
1125
+ this._startDrag(false, clientPos["e"], true); // Event is suppressed
1126
+ } else {
1127
+ this._onDrag(clientPos["e"]);
1128
+ }
1129
+ };
1130
+ /** @private
1131
+ * @param {Object} jetObj
1132
+ */
1133
+ RowDraggingPlugin.prototype._onJETDrop = function (jetObj) {
1134
+ if (!this._dragging) { return; }
1135
+
1136
+ if (!this._jetDragContent) {
1137
+ this._jetDragContent = jetObj; // To maintain original client signature
1138
+ }
1139
+ this._onDragEnd(jetObj["mouse"]["srcEvent"]);
1140
+ };
1141
+
843
1142
 
844
1143
 
845
1144
  export default RowDraggingPlugin;
@@ -56,6 +56,8 @@ declare class GroupDefinitions {
56
56
 
57
57
  public setGroupChildren(groupId: string, newChildList: (string)[]|null): boolean;
58
58
 
59
+ public setGroupName(groupId: string, groupName: string): boolean;
60
+
59
61
  }
60
62
 
61
63
  export default GroupDefinitions;
@@ -562,6 +562,21 @@ GroupDefinitions.prototype.setGroupChildren = function (groupId, newChildList) {
562
562
  }
563
563
  return false;
564
564
  };
565
+ /** @public
566
+ * @param {string} groupId
567
+ * @param {string} groupName
568
+ * @return {boolean}
569
+ */
570
+ GroupDefinitions.prototype.setGroupName = function (groupId, groupName) {
571
+ var groupDef = this._groupMap[groupId];
572
+ if(groupDef) {
573
+ if(groupDef.name !== groupName) {
574
+ groupDef.name = groupName;
575
+ return true;
576
+ }
577
+ }
565
578
 
579
+ return false;
580
+ };
566
581
  export default GroupDefinitions;
567
582
  export { GroupDefinitions };
@@ -18,6 +18,8 @@ declare function extendObject(obj: any, extender?: any, limiters?: (string)[]|nu
18
18
 
19
19
  declare function cloneObject(obj: any, limiters?: (string)[]|null): any;
20
20
 
21
+ declare function isEmptyObject(obj: any): boolean;
22
+
21
23
  declare function arrayToObject(data?: any[]|null, fields?: (string)[]|null): any|null|null;
22
24
 
23
25
  declare function extendProperty(obj: any, extender: any, propName: string): void;
@@ -49,6 +51,7 @@ export {
49
51
  Util,
50
52
  extendObject,
51
53
  cloneObject,
54
+ isEmptyObject,
52
55
  arrayToObject,
53
56
  extendProperty,
54
57
  extendArrayProperty,
@@ -138,6 +138,20 @@ var extendObject = function (obj, extender, limiters) {
138
138
  var cloneObject = function (obj, limiters) {
139
139
  return extendObject({}, obj, limiters);
140
140
  };
141
+
142
+ /** Check empty object
143
+ * @public
144
+ * @function
145
+ * @param {Object} obj
146
+ * @return {boolean}=true, if the obj is empty
147
+ */
148
+ var isEmptyObject = function (obj) {
149
+ for (var key in obj) {
150
+ return false;
151
+ }
152
+ return true;
153
+ };
154
+
141
155
  /** @public
142
156
  * @param {Array=} data
143
157
  * @param {Array.<string>=} fields In case of the given data is an array, this param will be used for mapping index to field
@@ -512,6 +526,7 @@ export {
512
526
  Util,
513
527
  extendObject,
514
528
  cloneObject,
529
+ isEmptyObject,
515
530
  arrayToObject,
516
531
  extendProperty,
517
532
  extendArrayProperty,
@@ -18,7 +18,7 @@ declare class CollectionDict {
18
18
 
19
19
  public getAllItems(): any[]|null;
20
20
 
21
- public getItemCount(): number;
21
+ public getItemCount(key?: string|null): number;
22
22
 
23
23
  public getAllKeys(): (string)[];
24
24
 
@@ -1,4 +1,6 @@
1
- /** @constructor */
1
+ /** @description CollectionDict stores a collection (Array) of any value using a text (string) as a key for accessing the collection.
2
+ * @constructor
3
+ */
2
4
  var CollectionDict = function() {
3
5
  this._dict = {};
4
6
  };
@@ -125,9 +127,17 @@ CollectionDict.prototype.getAllItems = function() {
125
127
  return null;
126
128
  };
127
129
  /** @public
130
+ * @param {string=} key
128
131
  * @return {number}
129
132
  */
130
- CollectionDict.prototype.getItemCount = function() {
133
+ CollectionDict.prototype.getItemCount = function(key) {
134
+ if(key) {
135
+ var items = this._dict[key] || null;
136
+ if(items) {
137
+ return items.length;
138
+ }
139
+ return 0;
140
+ }
131
141
  return this._count;
132
142
  };
133
143
  /** @public