UNPKG

react-application-core

Version:

A react-based application core for the business applications.

78 lines 3.68 kB
"use strict"; var __extends = (this && this.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __assign = (this && this.__assign) || function () { __assign = Object.assign || function(t) { for (var s, i = 1, n = arguments.length; i < n; i++) { s = arguments[i]; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; } return t; }; return __assign.apply(this, arguments); }; Object.defineProperty(exports, "__esModule", { value: true }); exports.GridField = void 0; var React = require("react"); var grid_1 = require("../../grid"); var multifield_1 = require("../multifield"); var util_1 = require("../../../util"); var definition_1 = require("../../../definition"); var GridField = /** @class */ (function (_super) { __extends(GridField, _super); /** * @stable [02.06.2018] * @param {IGridFieldProps} props */ function GridField(props) { var _this = _super.call(this, props) || this; _this.onChangeRowField = _this.onChangeRowField.bind(_this); return _this; } Object.defineProperty(GridField.prototype, "attachmentElement", { /** * @stable [21.06.2018] * @returns {JSX.Element} */ get: function () { var _a = this.originalProps.gridConfiguration, gridConfiguration = _a === void 0 ? {} : _a; var itemConfiguration = gridConfiguration.itemConfiguration, onSelect = gridConfiguration.onSelect; var gridListEntity = __assign(__assign({}, definition_1.INITIAL_REDUX_LIST_ENTITY), { data: this.multiFieldPlugin.activeValue, changes: multifield_1.fromMultiItemEntitiesToFieldsChanges(this.multiFieldPlugin.editValue) }); return (React.createElement(grid_1.Grid, __assign({ emptyMessage: this.settings.messages.noItemsMessage, emptyDataMessage: this.settings.messages.noItemsMessage }, gridListEntity, gridConfiguration, { itemConfiguration: __assign(__assign({}, itemConfiguration), (util_1.TypeUtils.isFn(onSelect) ? definition_1.DefaultEntities.SELECTABLE_LIST_ITEM_ENTITY : {})), onChange: this.onChangeRowField, disabled: this.isInactive }))); }, enumerable: false, configurable: true }); /** * @stable [19.09.2018] * @returns {string} */ GridField.prototype.getFieldClassName = function () { return util_1.ClsUtils.joinClassName(_super.prototype.getFieldClassName.call(this), 'rac-gridfield'); }; /** * @stable [07.06.2018] * @param {IFieldChangeEntity} fieldChangeEntity */ GridField.prototype.onChangeRowField = function (fieldChangeEntity) { this.multiFieldPlugin.onEditItem(__assign({ id: fieldChangeEntity.rawData.id }, fieldChangeEntity)); }; GridField.defaultProps = util_1.PropsUtils.mergeWithParentDefaultProps({}, multifield_1.MultiField); return GridField; }(multifield_1.MultiField)); exports.GridField = GridField; //# sourceMappingURL=gridfield.component.js.map