UNPKG

mp-colorui

Version:

MP ColorUI 是一款基于 Taro 框架并且联合 Color-UI CSS 库开发的多端 UI 组件库(支持小程序端和H5端)

253 lines (207 loc) 17.3 kB
(wx["webpackJsonp"] = wx["webpackJsonp"] || []).push([["components/button/index"],{ /***/ "./node_modules/@tarojs/mini-runner/dist/loaders/wxTransformerLoader.js?!./src/components/button/index.tsx?taro&type=script&parse=COMPONENT&": /*!************************************************************************************************************************************************************!*\ !*** ./node_modules/@tarojs/mini-runner/dist/loaders/wxTransformerLoader.js??ref--4-0!./src/components/button/index.tsx?taro&type=script&parse=COMPONENT& ***! \************************************************************************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; var _taroWeapp = __webpack_require__(/*! @tarojs/taro-weapp */ "./node_modules/@tarojs/taro-weapp/index.js"); var _taroWeapp2 = _interopRequireDefault(_taroWeapp); var _index = __webpack_require__(/*! ../../lib/index */ "./src/lib/index.ts"); var _model = __webpack_require__(/*! ../../lib/model */ "./src/lib/model.ts"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var ClButton = function (_Taro$Component) { _inherits(ClButton, _Taro$Component); function ClButton() { var _ref; var _temp, _this, _ret; _classCallCheck(this, ClButton); for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = ClButton.__proto__ || Object.getPrototypeOf(ClButton)).call.apply(_ref, [this].concat(args))), _this), _this.$usedState = ["anonymousState__temp", "anonymousState__temp2", "anonymousState__temp3", "anonymousState__temp4", "anonymousState__temp5", "props", "undefined", "loadingClassName", "children"], _this.customComponents = [], _temp), _possibleConstructorReturn(_this, _ret); } _createClass(ClButton, [{ key: "_constructor", value: function _constructor(props) { _get(ClButton.prototype.__proto__ || Object.getPrototypeOf(ClButton.prototype), "_constructor", this).call(this, props); this.$$refs = new _taroWeapp2.default.RefsArray(); } }, { key: "_createData", value: function _createData() { this.__state = arguments[0] || this.state || {}; this.__props = arguments[1] || this.props || {}; var __isRunloopRef = arguments[2]; var __prefix = this.$prefix; ; var props = this.__props; var onClick = function onClick(e) { !props.disabled && props.onClick && props.onClick(e); }; var onOpenSetting = function onOpenSetting(e) { !props.disabled && props.onOpenSetting && props.onOpenSetting(e); }; var onGetUserInfo = function onGetUserInfo(e) { !props.disabled && props.onGetUserInfo && props.onGetUserInfo(e); }; var onContact = function onContact(e) { !props.disabled && props.onContact && props.onContact(e); }; var onGetPhoneNumber = function onGetPhoneNumber(e) { !props.disabled && props.onGetPhoneNumber && props.onGetPhoneNumber(e); }; var onGetRealnameAuthInfo = function onGetRealnameAuthInfo(e) { !props.disabled && props.onGetRealnameAuthInfo && props.onGetRealnameAuthInfo(e); }; var onError = function onError(e) { !props.disabled && props.onError && props.onError(e); }; var shapeClassName = props.shape || "radius"; var sizeClassName = props.size || "normal"; var colorClassName = props.bgColor || "blue"; var disabledClassName = props.disabled; var loadingClassName = props.loading ? "cuIcon-loading iconfont-spin" : ""; var plainClassName = props.plain; var plainSizeName = props.plainSize === "default" ? "line" : "lines"; var shadowSizeName = props.shadow ? "shadow" : ""; var buttonClassName = "cu-btn " + shapeClassName + " " + _model.SIZE[sizeClassName] + " " + (plainClassName ? "" : _model.BG_COLOR_LIST[colorClassName]) + " " + (plainClassName ? plainSizeName + "-" + colorClassName : "") + " " + shadowSizeName; var anonymousState__temp = (0, _index.classNames)(buttonClassName + " " + (disabledClassName ? "disabled" : "")); this.anonymousFunc0 = onClick.bind(this); this.anonymousFunc1 = onOpenSetting; this.anonymousFunc2 = onGetUserInfo; this.anonymousFunc3 = onContact; this.anonymousFunc4 = onGetPhoneNumber; this.anonymousFunc5 = onGetRealnameAuthInfo; this.anonymousFunc6 = onError; var anonymousState__temp2 = (0, _index.classNames)("flex flex-direction", props.className); var anonymousState__temp3 = (0, _taroWeapp.internal_inline_style)(Object.assign({}, props.style)); var anonymousState__temp4 = (0, _index.classNames)(props.className); var anonymousState__temp5 = (0, _taroWeapp.internal_inline_style)(Object.assign({ display: "inline-block" }, props.style)); Object.assign(this.__state, { anonymousState__temp: anonymousState__temp, anonymousState__temp2: anonymousState__temp2, anonymousState__temp3: anonymousState__temp3, anonymousState__temp4: anonymousState__temp4, anonymousState__temp5: anonymousState__temp5, props: props, undefined: undefined, loadingClassName: loadingClassName }); return this.__state; } }, { key: "anonymousFunc0", value: function anonymousFunc0(e) { ; } }, { key: "anonymousFunc1", value: function anonymousFunc1(e) { ; } }, { key: "anonymousFunc2", value: function anonymousFunc2(e) { ; } }, { key: "anonymousFunc3", value: function anonymousFunc3(e) { ; } }, { key: "anonymousFunc4", value: function anonymousFunc4(e) { ; } }, { key: "anonymousFunc5", value: function anonymousFunc5(e) { ; } }, { key: "anonymousFunc6", value: function anonymousFunc6(e) { ; } }]); return ClButton; }(_taroWeapp2.default.Component); ClButton.$$events = ["anonymousFunc0", "anonymousFunc1", "anonymousFunc2", "anonymousFunc3", "anonymousFunc4", "anonymousFunc5", "anonymousFunc6"]; ClButton.$$componentPath = "components/button/index"; ClButton.options = { addGlobalClass: true }; ClButton.defaultProps = { shape: "radius", size: "normal", bgColor: "blue", disabled: false, icon: undefined, loading: false, long: false, plain: false, plainSize: "default", shadow: true, openType: undefined, customData: {} }; exports.default = ClButton; Component(__webpack_require__(/*! @tarojs/taro-weapp */ "./node_modules/@tarojs/taro-weapp/index.js").default.createComponent(ClButton)); /***/ }), /***/ "./node_modules/file-loader/dist/cjs.js?name=[path][name].wxml&context=/Users/jinbai/Documents/develop/github/mp-colorui-old/mp-colorui/src!./node_modules/@tarojs/mini-runner/dist/loaders/miniTemplateLoader.js!./node_modules/@tarojs/mini-runner/dist/loaders/wxTransformerLoader.js?!./src/components/button/index.tsx?taro&type=template&parse=COMPONENT&": /*!*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\ !*** ./node_modules/file-loader/dist/cjs.js?name=[path][name].wxml&context=/Users/jinbai/Documents/develop/github/mp-colorui-old/mp-colorui/src!./node_modules/@tarojs/mini-runner/dist/loaders/miniTemplateLoader.js!./node_modules/@tarojs/mini-runner/dist/loaders/wxTransformerLoader.js??ref--4-0!./src/components/button/index.tsx?taro&type=template&parse=COMPONENT& ***! \*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "components/button/index.wxml"; /***/ }), /***/ "./src/components/button/index.tsx": /*!*****************************************!*\ !*** ./src/components/button/index.tsx ***! \*****************************************/ /*! no static exports found */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _index_tsx_taro_type_template_parse_COMPONENT___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./index.tsx?taro&type=template&parse=COMPONENT& */ "./src/components/button/index.tsx?taro&type=template&parse=COMPONENT&"); /* harmony import */ var _index_tsx_taro_type_script_parse_COMPONENT___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./index.tsx?taro&type=script&parse=COMPONENT& */ "./src/components/button/index.tsx?taro&type=script&parse=COMPONENT&"); /* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _index_tsx_taro_type_script_parse_COMPONENT___WEBPACK_IMPORTED_MODULE_1__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _index_tsx_taro_type_script_parse_COMPONENT___WEBPACK_IMPORTED_MODULE_1__[key]; }) }(__WEBPACK_IMPORT_KEY__)); /***/ }), /***/ "./src/components/button/index.tsx?taro&type=script&parse=COMPONENT&": /*!***************************************************************************!*\ !*** ./src/components/button/index.tsx?taro&type=script&parse=COMPONENT& ***! \***************************************************************************/ /*! no static exports found */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _node_modules_tarojs_mini_runner_dist_loaders_wxTransformerLoader_js_ref_4_0_index_tsx_taro_type_script_parse_COMPONENT___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/@tarojs/mini-runner/dist/loaders/wxTransformerLoader.js??ref--4-0!./index.tsx?taro&type=script&parse=COMPONENT& */ "./node_modules/@tarojs/mini-runner/dist/loaders/wxTransformerLoader.js?!./src/components/button/index.tsx?taro&type=script&parse=COMPONENT&"); /* harmony import */ var _node_modules_tarojs_mini_runner_dist_loaders_wxTransformerLoader_js_ref_4_0_index_tsx_taro_type_script_parse_COMPONENT___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_tarojs_mini_runner_dist_loaders_wxTransformerLoader_js_ref_4_0_index_tsx_taro_type_script_parse_COMPONENT___WEBPACK_IMPORTED_MODULE_0__); /* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _node_modules_tarojs_mini_runner_dist_loaders_wxTransformerLoader_js_ref_4_0_index_tsx_taro_type_script_parse_COMPONENT___WEBPACK_IMPORTED_MODULE_0__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _node_modules_tarojs_mini_runner_dist_loaders_wxTransformerLoader_js_ref_4_0_index_tsx_taro_type_script_parse_COMPONENT___WEBPACK_IMPORTED_MODULE_0__[key]; }) }(__WEBPACK_IMPORT_KEY__)); /* harmony default export */ __webpack_exports__["default"] = (_node_modules_tarojs_mini_runner_dist_loaders_wxTransformerLoader_js_ref_4_0_index_tsx_taro_type_script_parse_COMPONENT___WEBPACK_IMPORTED_MODULE_0___default.a); /***/ }), /***/ "./src/components/button/index.tsx?taro&type=template&parse=COMPONENT&": /*!*****************************************************************************!*\ !*** ./src/components/button/index.tsx?taro&type=template&parse=COMPONENT& ***! \*****************************************************************************/ /*! no static exports found */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _node_modules_file_loader_dist_cjs_js_name_path_name_wxml_context_Users_jinbai_Documents_develop_github_mp_colorui_old_mp_colorui_src_node_modules_tarojs_mini_runner_dist_loaders_miniTemplateLoader_js_node_modules_tarojs_mini_runner_dist_loaders_wxTransformerLoader_js_ref_4_0_index_tsx_taro_type_template_parse_COMPONENT___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/file-loader/dist/cjs.js?name=[path][name].wxml&context=/Users/jinbai/Documents/develop/github/mp-colorui-old/mp-colorui/src!../../../node_modules/@tarojs/mini-runner/dist/loaders/miniTemplateLoader.js!../../../node_modules/@tarojs/mini-runner/dist/loaders/wxTransformerLoader.js??ref--4-0!./index.tsx?taro&type=template&parse=COMPONENT& */ "./node_modules/file-loader/dist/cjs.js?name=[path][name].wxml&context=/Users/jinbai/Documents/develop/github/mp-colorui-old/mp-colorui/src!./node_modules/@tarojs/mini-runner/dist/loaders/miniTemplateLoader.js!./node_modules/@tarojs/mini-runner/dist/loaders/wxTransformerLoader.js?!./src/components/button/index.tsx?taro&type=template&parse=COMPONENT&"); /* harmony import */ var _node_modules_file_loader_dist_cjs_js_name_path_name_wxml_context_Users_jinbai_Documents_develop_github_mp_colorui_old_mp_colorui_src_node_modules_tarojs_mini_runner_dist_loaders_miniTemplateLoader_js_node_modules_tarojs_mini_runner_dist_loaders_wxTransformerLoader_js_ref_4_0_index_tsx_taro_type_template_parse_COMPONENT___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_file_loader_dist_cjs_js_name_path_name_wxml_context_Users_jinbai_Documents_develop_github_mp_colorui_old_mp_colorui_src_node_modules_tarojs_mini_runner_dist_loaders_miniTemplateLoader_js_node_modules_tarojs_mini_runner_dist_loaders_wxTransformerLoader_js_ref_4_0_index_tsx_taro_type_template_parse_COMPONENT___WEBPACK_IMPORTED_MODULE_0__); /* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _node_modules_file_loader_dist_cjs_js_name_path_name_wxml_context_Users_jinbai_Documents_develop_github_mp_colorui_old_mp_colorui_src_node_modules_tarojs_mini_runner_dist_loaders_miniTemplateLoader_js_node_modules_tarojs_mini_runner_dist_loaders_wxTransformerLoader_js_ref_4_0_index_tsx_taro_type_template_parse_COMPONENT___WEBPACK_IMPORTED_MODULE_0__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _node_modules_file_loader_dist_cjs_js_name_path_name_wxml_context_Users_jinbai_Documents_develop_github_mp_colorui_old_mp_colorui_src_node_modules_tarojs_mini_runner_dist_loaders_miniTemplateLoader_js_node_modules_tarojs_mini_runner_dist_loaders_wxTransformerLoader_js_ref_4_0_index_tsx_taro_type_template_parse_COMPONENT___WEBPACK_IMPORTED_MODULE_0__[key]; }) }(__WEBPACK_IMPORT_KEY__)); /***/ }) },[["./src/components/button/index.tsx","runtime","taro","vendors","common"]]]);