ui.pivot_grid.data_area.js 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. /**
  2. * DevExtreme (ui/pivot_grid/ui.pivot_grid.data_area.js)
  3. * Version: 19.1.16
  4. * Build date: Tue Oct 18 2022
  5. *
  6. * Copyright (c) 2012 - 2022 Developer Express Inc. ALL RIGHTS RESERVED
  7. * Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/
  8. */
  9. "use strict";
  10. var _renderer = require("../../core/renderer");
  11. var _renderer2 = _interopRequireDefault(_renderer);
  12. var _uiPivot_grid = require("./ui.pivot_grid.area_item");
  13. function _interopRequireDefault(obj) {
  14. return obj && obj.__esModule ? obj : {
  15. "default": obj
  16. }
  17. }
  18. var PIVOTGRID_AREA_CLASS = "dx-pivotgrid-area";
  19. var PIVOTGRID_AREA_DATA_CLASS = "dx-pivotgrid-area-data";
  20. var PIVOTGRID_TOTAL_CLASS = "dx-total";
  21. var PIVOTGRID_GRAND_TOTAL_CLASS = "dx-grandtotal";
  22. var PIVOTGRID_ROW_TOTAL_CLASS = "dx-row-total";
  23. exports.DataArea = _uiPivot_grid.AreaItem.inherit({
  24. _getAreaName: function() {
  25. return "data"
  26. },
  27. _createGroupElement: function() {
  28. return (0, _renderer2.default)("<div>").addClass(PIVOTGRID_AREA_CLASS).addClass(PIVOTGRID_AREA_DATA_CLASS)
  29. },
  30. _applyCustomStyles: function(options) {
  31. var cell = options.cell;
  32. var classArray = options.classArray;
  33. if ("T" === cell.rowType || "T" === cell.columnType) {
  34. classArray.push(PIVOTGRID_TOTAL_CLASS)
  35. }
  36. if ("GT" === cell.rowType || "GT" === cell.columnType) {
  37. classArray.push(PIVOTGRID_GRAND_TOTAL_CLASS)
  38. }
  39. if ("T" === cell.rowType || "GT" === cell.rowType) {
  40. classArray.push(PIVOTGRID_ROW_TOTAL_CLASS)
  41. }
  42. if (options.rowIndex === options.rowsCount - 1) {
  43. options.cssArray.push("border-bottom: 0px")
  44. }
  45. this.callBase(options)
  46. },
  47. _moveFakeTable: function(scrollPos) {
  48. this._moveFakeTableHorizontally(scrollPos.x);
  49. this._moveFakeTableTop(scrollPos.y);
  50. this.callBase()
  51. },
  52. processScroll: function(useNativeScrolling, horizontalScroll, verticalScroll) {
  53. var direction = "both";
  54. if (horizontalScroll && !verticalScroll) {
  55. direction = "horizontal"
  56. } else {
  57. if (!horizontalScroll && verticalScroll) {
  58. direction = "vertical"
  59. }
  60. }
  61. this._groupElement.css("borderTopWidth", 0).dxScrollable({
  62. useNative: !!useNativeScrolling,
  63. useSimulatedScrollbar: !useNativeScrolling,
  64. direction: direction,
  65. bounceEnabled: false,
  66. updateManually: true
  67. })
  68. },
  69. reset: function() {
  70. this.callBase();
  71. if (this._virtualContent) {
  72. this._virtualContent.parent().css("height", "auto")
  73. }
  74. },
  75. setVirtualContentParams: function(params) {
  76. this.callBase(params);
  77. this._virtualContent.parent().css("height", params.height);
  78. this._setTableCss({
  79. top: params.top,
  80. left: params.left
  81. })
  82. }
  83. });