UNPKG

fastlion-amis

Version:

一种MIS页面生成工具

62 lines (61 loc) 2.77 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.CalendarRenderer = exports.Calendar = void 0; var tslib_1 = require("tslib"); var react_1 = (0, tslib_1.__importDefault)(require("react")); var factory_1 = require("../factory"); var calendar_1 = (0, tslib_1.__importDefault)(require("../components/Schedule/calendar")); var helper_1 = require("../utils/helper"); var Scoped_1 = require("../Scoped"); var Calendar = /** @class */ (function (_super) { (0, tslib_1.__extends)(Calendar, _super); function Calendar() { return _super !== null && _super.apply(this, arguments) || this; } // wrapperRef: React.RefObject<HTMLDivElement> = React.createRef(); Calendar.prototype.receive = function (values) { this.setState({ receiveData: values }); }; Calendar.prototype.render = function () { return (react_1.default.createElement("div", null, react_1.default.createElement(calendar_1.default, (0, tslib_1.__assign)({ isMobile: (0, helper_1.isMobile)(), calendarType: this.state.calendarType }, this.props, { context: this.context, receiveData: this.state.receiveData })))); }; return Calendar; }(react_1.default.Component)); exports.Calendar = Calendar; var CalendarRenderer = /** @class */ (function (_super) { (0, tslib_1.__extends)(CalendarRenderer, _super); function CalendarRenderer(props, context) { var _this = _super.call(this, props) || this; var mode = props.mode; var scoped = context; scoped.registerComponent(_this); _this.state = { calendarType: mode !== null && mode !== void 0 ? mode : 'attendance', receiveData: {} }; return _this; } CalendarRenderer.prototype.componentWillUnmount = function () { // super.componentWillUnmount(); var scoped = this.context; scoped.unRegisterComponent(this); }; CalendarRenderer.prototype.receive = function (values, subPath) { var scoped = this.context; if (subPath) { return scoped.send(subPath, values); } return _super.prototype.receive.call(this, values); }; var _a; CalendarRenderer.contextType = Scoped_1.ScopedContext; CalendarRenderer = (0, tslib_1.__decorate)([ (0, factory_1.Renderer)({ type: 'calendar' }), (0, tslib_1.__metadata)("design:paramtypes", [Object, typeof (_a = typeof Scoped_1.IScopedContext !== "undefined" && Scoped_1.IScopedContext) === "function" ? _a : Object]) ], CalendarRenderer); return CalendarRenderer; }(Calendar)); exports.CalendarRenderer = CalendarRenderer; //# sourceMappingURL=./renderers/Calendar.js.map