UNPKG

2.14 kBJavaScriptView Raw
1/**
2 * ag-grid - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
3 * @version v18.1.2
4 * @link http://www.ag-grid.com/
5 * @license MIT
6 */
7"use strict";
8var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
9 var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
10 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
11 else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
12 return c > 3 && r && Object.defineProperty(target, key, r), r;
13};
14var __metadata = (this && this.__metadata) || function (k, v) {
15 if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
16};
17Object.defineProperty(exports, "__esModule", { value: true });
18var context_1 = require("../../context/context");
19var gridOptionsWrapper_1 = require("../../gridOptionsWrapper");
20var sortService_1 = require("../../rowNodes/sortService");
21var SortStage = (function () {
22 function SortStage() {
23 }
24 SortStage.prototype.execute = function (params) {
25 // if the sorting is already done by the server, then we should not do it here
26 if (this.gridOptionsWrapper.isEnableServerSideSorting()) {
27 this.sortService.sort(params.rowNode, null);
28 }
29 else {
30 this.sortService.sortAccordingToColumnsState(params.rowNode);
31 }
32 };
33 __decorate([
34 context_1.Autowired('gridOptionsWrapper'),
35 __metadata("design:type", gridOptionsWrapper_1.GridOptionsWrapper)
36 ], SortStage.prototype, "gridOptionsWrapper", void 0);
37 __decorate([
38 context_1.Autowired('sortService'),
39 __metadata("design:type", sortService_1.SortService)
40 ], SortStage.prototype, "sortService", void 0);
41 SortStage = __decorate([
42 context_1.Bean('sortStage')
43 ], SortStage);
44 return SortStage;
45}());
46exports.SortStage = SortStage;