UNPKG

tplus-pos

Version:

pos module

190 lines (156 loc) 6.99 kB
'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); var _defineProperty = require('babel-runtime/core-js/object/define-property'); var _defineProperty2 = _interopRequireDefault(_defineProperty); var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck'); var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); var _desc, _value, _class, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _descriptor7, _descriptor8; /* * @Descripttion: * @version: * @Author: chenlongad * @Date: 2020-10-29 09:43:18 * @LastEditors: chenlongad * @LastEditTime: 2020-12-15 21:51:39 */ /** * props: * @params key://抽屉显示内容 number/stock/searchbill * @params count //不重新渲染的条件下,控制是否第一次渲染 * @params title //抽屉title * @params placement //抽屉位置 * @params visible //抽屉是否可见 * @params saveDom //抽屉 保存隐藏的dom or 重新渲染 */ var _mobx = require('mobx'); var _tplusComponentsTouch = require('tplus-components-touch'); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _initDefineProp(target, property, descriptor, context) { if (!descriptor) return; (0, _defineProperty2.default)(target, property, { enumerable: descriptor.enumerable, configurable: descriptor.configurable, writable: descriptor.writable, value: descriptor.initializer ? descriptor.initializer.call(context) : void 0 }); } function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { var desc = {}; Object['ke' + 'ys'](descriptor).forEach(function (key) { desc[key] = descriptor[key]; }); desc.enumerable = !!desc.enumerable; desc.configurable = !!desc.configurable; if ('value' in desc || desc.initializer) { desc.writable = true; } desc = decorators.slice().reverse().reduce(function (desc, decorator) { return decorator(target, property, desc) || desc; }, desc); if (context && desc.initializer !== void 0) { desc.value = desc.initializer ? desc.initializer.call(context) : void 0; desc.initializer = undefined; } if (desc.initializer === void 0) { Object['define' + 'Property'](target, property, desc); desc = null; } return desc; } function _initializerWarningHelper(descriptor, context) { throw new Error('Decorating class property failed. Please ensure that transform-class-properties is enabled.'); } var DrawerStore = (_class = function DrawerStore() { (0, _classCallCheck3.default)(this, DrawerStore); _initDefineProp(this, 'visible', _descriptor, this); _initDefineProp(this, 'title', _descriptor2, this); _initDefineProp(this, 'placement', _descriptor3, this); _initDefineProp(this, 'key', _descriptor4, this); _initDefineProp(this, 'type', _descriptor5, this); this.saveDom = false; _initDefineProp(this, 'init', _descriptor6, this); _initDefineProp(this, 'show', _descriptor7, this); _initDefineProp(this, 'hide', _descriptor8, this); } // @observable count={ // stock:false, // member:false, // searchbill:false // }; , (_descriptor = _applyDecoratedDescriptor(_class.prototype, 'visible', [_mobx.observable], { enumerable: true, initializer: function initializer() { return false; } }), _descriptor2 = _applyDecoratedDescriptor(_class.prototype, 'title', [_mobx.observable], { enumerable: true, initializer: function initializer() { return ''; } }), _descriptor3 = _applyDecoratedDescriptor(_class.prototype, 'placement', [_mobx.observable], { enumerable: true, initializer: function initializer() { return 'right'; } }), _descriptor4 = _applyDecoratedDescriptor(_class.prototype, 'key', [_mobx.observable], { enumerable: true, initializer: function initializer() { return ''; } }), _descriptor5 = _applyDecoratedDescriptor(_class.prototype, 'type', [_mobx.observable], { enumerable: true, initializer: function initializer() { return 1; } }), _descriptor6 = _applyDecoratedDescriptor(_class.prototype, 'init', [_mobx.action], { enumerable: true, initializer: function initializer() { var _this = this; return function (_ref) { var title = _ref.title, placement = _ref.placement, key = _ref.key, type = _ref.type, onHide = _ref.onHide, listArr = _ref.listArr; _this.title = title; _this.placement = placement || 'right'; // this.count[key]=true; _this.type = type; _this.key = key; _this.onHide = onHide; _this.listArr = listArr; _this.show(); }; } }), _descriptor7 = _applyDecoratedDescriptor(_class.prototype, 'show', [_mobx.action], { enumerable: true, initializer: function initializer() { var _this2 = this; return function () { _this2.visible = true; _tplusComponentsTouch.Keyboard.close(); var activeElement = document.activeElement; activeElement && activeElement.blur(); $ && setTimeout(function () { return $.observerTrigger(); }, 10); }; } }), _descriptor8 = _applyDecoratedDescriptor(_class.prototype, 'hide', [_mobx.action], { enumerable: true, initializer: function initializer() { var _this3 = this; return function () { _this3.visible = false; _tplusComponentsTouch.Keyboard.close(); _this3.onHide && _this3.onHide(); $ && setTimeout(function () { return $.observerTrigger(); }, 10); }; } })), _class); exports.default = new DrawerStore(); //# sourceMappingURL=DrawerStore.js.map