UNPKG

@progress/kendo-react-grid

Version:
78 lines 3.36 kB
"use strict"; var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); Object.defineProperty(exports, "__esModule", { value: true }); var React = require("react"); var kendo_react_common_1 = require("@progress/kendo-react-common"); /** * @hidden */ var GroupingIndicator = /** @class */ (function (_super) { __extends(GroupingIndicator, _super); function GroupingIndicator() { var _this = _super !== null && _super.apply(this, arguments) || this; /** * @hidden */ _this.onPress = function (data) { var element = _this.draggable && _this.draggable.element; if (element && _this.props.onPress) { _this.props.onPress(data.event, element); } }; /** * @hidden */ _this.onDrag = function (data) { var element = _this.draggable && _this.draggable.element; if (element && _this.props.onDrag) { _this.props.onDrag(data.event, element); } }; /** * @hidden */ _this.onRelease = function (data) { var element = _this.draggable && _this.draggable.element; if (element && _this.props.onRelease) { _this.props.onRelease(data.event); } }; _this.sortChange = function (event) { event.preventDefault(); if (_this.props.onSortChange) { var sort = (_this.props.dir === 'asc') ? 'desc' : 'asc'; _this.props.onSortChange(event, sort); } }; _this.groupRemove = function (event) { event.preventDefault(); if (_this.props.onRemove) { _this.props.onRemove(event); } }; return _this; } GroupingIndicator.prototype.render = function () { var _this = this; return (React.createElement(kendo_react_common_1.Draggable, { onPress: this.onPress, onDrag: this.onDrag, onRelease: this.onRelease, ref: function (component) { _this.draggable = component; } }, React.createElement("div", { className: "k-indicator-container" }, React.createElement("div", { className: "k-group-indicator" }, React.createElement("a", { className: "k-link", href: "#", tabIndex: -1, onClick: this.sortChange }, React.createElement("span", { className: 'k-icon k-i-sort-' + this.props.dir + '-sm' }), this.props.title), React.createElement("a", { className: "k-button k-button-icon k-bare", tabIndex: -1, onClick: this.groupRemove }, React.createElement("span", { className: "k-icon k-i-group-delete" })))))); }; return GroupingIndicator; }(React.Component)); exports.GroupingIndicator = GroupingIndicator; //# sourceMappingURL=GroupingIndicator.js.map