"use strict";
/*
 * ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
 * This devtool is neither made for production nor for readable output files.
 * It uses "eval()" calls to create a separate source file in the browser devtools.
 * If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
 * or disable the default devtool with "devtool: false".
 * If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
 */
(self["webpackChunknocode_component"] = self["webpackChunknocode_component"] || []).push([[832],{

/***/ "./src/control/mobile/Button/index.tsx":
/*!*********************************************!*\
  !*** ./src/control/mobile/Button/index.tsx ***!
  \*********************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.object.to-string.js */ \"../../node_modules/core-js/modules/es.object.to-string.js\");\n/* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var core_js_modules_web_dom_collections_for_each_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/web.dom-collections.for-each.js */ \"../../node_modules/core-js/modules/web.dom-collections.for-each.js\");\n/* harmony import */ var core_js_modules_web_dom_collections_for_each_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_web_dom_collections_for_each_js__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _babel_runtime_corejs3_core_js_stable_object_keys__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime-corejs3/core-js-stable/object/keys */ \"../../node_modules/@babel/runtime-corejs3/core-js-stable/object/keys.js\");\n/* harmony import */ var _babel_runtime_corejs3_core_js_stable_object_keys__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_corejs3_core_js_stable_object_keys__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _babel_runtime_corejs3_core_js_stable_object_get_own_property_symbols__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols */ \"../../node_modules/@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols.js\");\n/* harmony import */ var _babel_runtime_corejs3_core_js_stable_object_get_own_property_symbols__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_corejs3_core_js_stable_object_get_own_property_symbols__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _babel_runtime_corejs3_core_js_stable_instance_filter__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime-corejs3/core-js-stable/instance/filter */ \"../../node_modules/@babel/runtime-corejs3/core-js-stable/instance/filter.js\");\n/* harmony import */ var _babel_runtime_corejs3_core_js_stable_instance_filter__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_corejs3_core_js_stable_instance_filter__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var _babel_runtime_corejs3_core_js_stable_object_get_own_property_descriptor__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor */ \"../../node_modules/@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor.js\");\n/* harmony import */ var _babel_runtime_corejs3_core_js_stable_object_get_own_property_descriptor__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_corejs3_core_js_stable_object_get_own_property_descriptor__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony import */ var _babel_runtime_corejs3_core_js_stable_object_get_own_property_descriptors__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors */ \"../../node_modules/@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors.js\");\n/* harmony import */ var _babel_runtime_corejs3_core_js_stable_object_get_own_property_descriptors__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_corejs3_core_js_stable_object_get_own_property_descriptors__WEBPACK_IMPORTED_MODULE_6__);\n/* harmony import */ var _babel_runtime_corejs3_core_js_stable_object_define_properties__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @babel/runtime-corejs3/core-js-stable/object/define-properties */ \"../../node_modules/@babel/runtime-corejs3/core-js-stable/object/define-properties.js\");\n/* harmony import */ var _babel_runtime_corejs3_core_js_stable_object_define_properties__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_corejs3_core_js_stable_object_define_properties__WEBPACK_IMPORTED_MODULE_7__);\n/* harmony import */ var _babel_runtime_corejs3_core_js_stable_object_define_property__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @babel/runtime-corejs3/core-js-stable/object/define-property */ \"../../node_modules/@babel/runtime-corejs3/core-js-stable/object/define-property.js\");\n/* harmony import */ var _babel_runtime_corejs3_core_js_stable_object_define_property__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_corejs3_core_js_stable_object_define_property__WEBPACK_IMPORTED_MODULE_8__);\n/* harmony import */ var _babel_runtime_corejs3_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @babel/runtime-corejs3/helpers/defineProperty */ \"../../node_modules/@babel/runtime-corejs3/helpers/esm/defineProperty.js\");\n/* harmony import */ var _babel_runtime_corejs3_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @babel/runtime-corejs3/helpers/slicedToArray */ \"../../node_modules/@babel/runtime-corejs3/helpers/esm/slicedToArray.js\");\n/* harmony import */ var _babel_runtime_corejs3_core_js_stable_instance_concat__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @babel/runtime-corejs3/core-js-stable/instance/concat */ \"../../node_modules/@babel/runtime-corejs3/core-js-stable/instance/concat.js\");\n/* harmony import */ var _babel_runtime_corejs3_core_js_stable_instance_concat__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_corejs3_core_js_stable_instance_concat__WEBPACK_IMPORTED_MODULE_11__);\n/* harmony import */ var kd_libs_react__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! kd_libs/react */ \"webpack/container/remote/kd_libs/react\");\n/* harmony import */ var kd_libs_react__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(kd_libs_react__WEBPACK_IMPORTED_MODULE_12__);\n/* harmony import */ var _base_mobile__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @/base/mobile */ \"./src/base/mobile/index.ts\");\n/* harmony import */ var _utils_context__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @/utils/context */ \"./src/utils/context.ts\");\n/* harmony import */ var _utils_componentUtil__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @/utils/componentUtil */ \"./src/utils/componentUtil.ts\");\n/* harmony import */ var _control_hooks_useControlState__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! @/control/hooks/useControlState */ \"./src/control/hooks/useControlState.ts\");\n/* harmony import */ var _base_hooks_useDebounce__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! @/base/hooks/useDebounce */ \"./src/base/hooks/useDebounce.ts\");\n\n\n\n\n\n\n\n\n\n\n\nfunction ownKeys(e, r) { var t = _babel_runtime_corejs3_core_js_stable_object_keys__WEBPACK_IMPORTED_MODULE_2___default()(e); if ((_babel_runtime_corejs3_core_js_stable_object_get_own_property_symbols__WEBPACK_IMPORTED_MODULE_3___default())) { var o = _babel_runtime_corejs3_core_js_stable_object_get_own_property_symbols__WEBPACK_IMPORTED_MODULE_3___default()(e); r && (o = _babel_runtime_corejs3_core_js_stable_instance_filter__WEBPACK_IMPORTED_MODULE_4___default()(o).call(o, function (r) { return _babel_runtime_corejs3_core_js_stable_object_get_own_property_descriptor__WEBPACK_IMPORTED_MODULE_5___default()(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0,_babel_runtime_corejs3_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_9__[\"default\"])(e, r, t[r]); }) : (_babel_runtime_corejs3_core_js_stable_object_get_own_property_descriptors__WEBPACK_IMPORTED_MODULE_6___default()) ? _babel_runtime_corejs3_core_js_stable_object_define_properties__WEBPACK_IMPORTED_MODULE_7___default()(e, _babel_runtime_corejs3_core_js_stable_object_get_own_property_descriptors__WEBPACK_IMPORTED_MODULE_6___default()(t)) : ownKeys(Object(t)).forEach(function (r) { _babel_runtime_corejs3_core_js_stable_object_define_property__WEBPACK_IMPORTED_MODULE_8___default()(e, r, _babel_runtime_corejs3_core_js_stable_object_get_own_property_descriptor__WEBPACK_IMPORTED_MODULE_5___default()(t, r)); }); } return e; }\n\n\n\n\n\n\n\nvar FORM_STATUS = {\n  addNew: 0,\n  edit: 1,\n  view: 2\n};\n/**\n * 按钮控件KD层 -- 移动\n * @param props\n * @returns\n */\nvar KDButton = (0,kd_libs_react__WEBPACK_IMPORTED_MODULE_12__.memo)(function (props) {\n  var _context, _context2, _context3;\n  console.log('KDButton', props);\n  var meta = props.controlMeta;\n  var _useContext = (0,kd_libs_react__WEBPACK_IMPORTED_MODULE_12__.useContext)(_utils_context__WEBPACK_IMPORTED_MODULE_14__.KDContext),\n    model = _useContext.model;\n  var batchInvoke = model.batchInvoke,\n    getControlText = model.getControlText,\n    getFormStatus = model.getFormStatus;\n  var pageId = meta.pageId,\n    s = meta.s,\n    id = meta.id,\n    vi = meta.vi;\n  var styleObj = {\n    // backgroundColor: meta.bc,\n    // borderColor: meta.bc,\n    // color: meta.fc,\n    // borderRadias: meta.rd,\n    margin: _babel_runtime_corejs3_core_js_stable_instance_concat__WEBPACK_IMPORTED_MODULE_11___default()(_context = _babel_runtime_corejs3_core_js_stable_instance_concat__WEBPACK_IMPORTED_MODULE_11___default()(_context2 = _babel_runtime_corejs3_core_js_stable_instance_concat__WEBPACK_IMPORTED_MODULE_11___default()(_context3 = \"\".concat((s === null || s === void 0 ? void 0 : s.m.t) || 0, \" \")).call(_context3, (s === null || s === void 0 ? void 0 : s.m.r) || 0, \" \")).call(_context2, (s === null || s === void 0 ? void 0 : s.m.b) || 0, \" \")).call(_context, (s === null || s === void 0 ? void 0 : s.m.l) || 0)\n  };\n  var _useState = (0,kd_libs_react__WEBPACK_IMPORTED_MODULE_12__.useState)(false),\n    _useState2 = (0,_babel_runtime_corejs3_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_10__[\"default\"])(_useState, 2),\n    btnLoading = _useState2[0],\n    setBtnLoading = _useState2[1];\n  var newMeta = (0,kd_libs_react__WEBPACK_IMPORTED_MODULE_12__.useMemo)(function () {\n    var config = model.getConfig(pageId);\n    var formStatus = typeof config.status === 'string' ? FORM_STATUS[config.status] : config.status;\n    var visible = (0,_utils_componentUtil__WEBPACK_IMPORTED_MODULE_15__.getMetaVisible)(vi, formStatus);\n    return visible ? _objectSpread({}, meta) : _objectSpread(_objectSpread({}, meta), {}, {\n      Status: '4'\n    });\n  }, [pageId, vi, meta]);\n  // const isDisabled = getFormStatus(pageId) === 'view'\n  var clickEvn = (0,kd_libs_react__WEBPACK_IMPORTED_MODULE_12__.useCallback)(function () {\n    setBtnLoading(true);\n    batchInvoke('click', pageId, id, undefined, undefined, function () {\n      setBtnLoading(false);\n    });\n  }, [batchInvoke, pageId, id, setBtnLoading]);\n  var debounceClickEvn = (0,_base_hooks_useDebounce__WEBPACK_IMPORTED_MODULE_17__[\"default\"])(clickEvn);\n  var _useControlState = (0,_control_hooks_useControlState__WEBPACK_IMPORTED_MODULE_16__[\"default\"])(newMeta),\n    disabled = _useControlState.disabled,\n    hidden = _useControlState.hidden;\n\n  // followTheme 苍穹平台是用于主题颜色配置按钮，这里主要用于区分主要按钮与普通按钮\n  var type = meta !== null && meta !== void 0 && meta.followTheme ? 'primary' : 'second';\n  return !hidden && /*#__PURE__*/kd_libs_react__WEBPACK_IMPORTED_MODULE_12___default().createElement(_base_mobile__WEBPACK_IMPORTED_MODULE_13__.BtnField, {\n    style: styleObj,\n    type: type,\n    loading: btnLoading,\n    onClick: debounceClickEvn,\n    disabled: disabled,\n    text: getControlText(meta.text)\n  });\n});\nKDButton.displayName = 'KDButton';\n/* harmony default export */ __webpack_exports__[\"default\"] = (KDButton);\n\n//# sourceURL=webpack://nocode-component/./src/control/mobile/Button/index.tsx?");

/***/ })

}]);