"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([[896],{

/***/ "./src/control/hooks/index.ts":
/*!************************************!*\
  !*** ./src/control/hooks/index.ts ***!
  \************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   useFieldProps: function() { return /* reexport safe */ _useFieldProps__WEBPACK_IMPORTED_MODULE_2__.useFieldProps; },\n/* harmony export */   useGridFocus: function() { return /* reexport safe */ _useGridHooks__WEBPACK_IMPORTED_MODULE_3__.useGridFocus; },\n/* harmony export */   useGridProps: function() { return /* reexport safe */ _useGridHooks__WEBPACK_IMPORTED_MODULE_3__.useGridProps; },\n/* harmony export */   useGridValidate: function() { return /* reexport safe */ _useGridHooks__WEBPACK_IMPORTED_MODULE_3__.useGridValidate; },\n/* harmony export */   useListenControlAction: function() { return /* reexport safe */ _useListenControlAction__WEBPACK_IMPORTED_MODULE_0__.useListenControlAction; },\n/* harmony export */   usePageStatus: function() { return /* reexport safe */ _usePageStatus__WEBPACK_IMPORTED_MODULE_1__.usePageStatus; }\n/* harmony export */ });\n/* harmony import */ var _useListenControlAction__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./useListenControlAction */ \"./src/control/hooks/useListenControlAction.tsx\");\n/* harmony import */ var _usePageStatus__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./usePageStatus */ \"./src/control/hooks/usePageStatus.tsx\");\n/* harmony import */ var _useFieldProps__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./useFieldProps */ \"./src/control/hooks/useFieldProps.tsx\");\n/* harmony import */ var _useGridHooks__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./useGridHooks */ \"./src/control/hooks/useGridHooks.tsx\");\n/*\n * @Description:\n * @Author: jianhang_he\n * @Date: 2022-08-31 16:17:38\n * @LastEditTime: 2022-11-25 16:08:33\n * @Last Modified by: jianhang_he\n */\n\n\n\n\n\n// const files = require.context('./', false, /^use\\w+.(ts|js)$/)\n// const hooks = {}\n\n// files.keys().forEach((path) => {\n//   const name = path.replace(/^\\.\\//, '').replace(/\\/$/, '')\n//   // const filePath = require.resolve(`${path}index.js`)\n//   // Object.keys(require.cache).forEach(key => {\n//   //     if (key.endsWith(filePath)){\n//   //         delete require.cache[key]\n//   //     }\n//   // })\n//   // eslint-disable-next-line import/no-dynamic-require\n//   hooks[name] = require(`${path}index.js`).default\n// })\n\n// export default {\n//   ...hooks\n// }\n\n//# sourceURL=webpack://nocode-component/./src/control/hooks/index.ts?");

/***/ }),

/***/ "./src/control/hooks/useControlState.ts":
/*!**********************************************!*\
  !*** ./src/control/hooks/useControlState.ts ***!
  \**********************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _babel_runtime_corejs3_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_0__ = __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_1__ = __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_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_corejs3_core_js_stable_instance_concat__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _babel_runtime_corejs3_core_js_stable_instance_filter__WEBPACK_IMPORTED_MODULE_2__ = __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_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_corejs3_core_js_stable_instance_filter__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var kd_libs_react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! kd_libs/react */ \"webpack/container/remote/kd_libs/react\");\n/* harmony import */ var kd_libs_react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(kd_libs_react__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _control_hooks__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/control/hooks */ \"./src/control/hooks/index.ts\");\n/* harmony import */ var _utils_componentUtil__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/utils/componentUtil */ \"./src/utils/componentUtil.ts\");\n/* harmony import */ var _constants_sysActionName__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/constants/sysActionName */ \"./src/constants/sysActionName.js\");\n/* harmony import */ var kd_libs_react_dom__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! kd_libs/react-dom */ \"webpack/container/remote/kd_libs/react-dom\");\n/* harmony import */ var kd_libs_react_dom__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(kd_libs_react_dom__WEBPACK_IMPORTED_MODULE_7__);\n\n\n\n/*\n * @Description:\n * @Author: jianhang_he\n * @Date: 2024-01-30 09:23:45\n * @LastEditTime: 2024-04-11 13:49:13\n * @Last Modified by: jianhang_he\n */\n\n\n\n\n\n// 根据Status获取控件的状态：只读、隐藏、禁用等\nvar useControlState = function useControlState(controlmeta) {\n  var Status = controlmeta.Status,\n    required = controlmeta.mi,\n    _controlmeta$rules = controlmeta.rules,\n    rules = _controlmeta$rules === void 0 ? [] : _controlmeta$rules;\n  // const [controlStatus, setControlStatus] = useState(Status)\n  var controlStatusRef = (0,kd_libs_react__WEBPACK_IMPORTED_MODULE_3__.useRef)(Status);\n  // 获取当前控件状态：禁用、只读、隐藏等\n  var _getControlStatus = (0,_utils_componentUtil__WEBPACK_IMPORTED_MODULE_5__.getControlStatus)(controlStatusRef.current),\n    disabled = _getControlStatus.disabled,\n    readonly = _getControlStatus.readonly,\n    hidden = _getControlStatus.hidden;\n  var _useState = (0,kd_libs_react__WEBPACK_IMPORTED_MODULE_3__.useState)(!!required),\n    _useState2 = (0,_babel_runtime_corejs3_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(_useState, 2),\n    controlRequired = _useState2[0],\n    setControlRequired = _useState2[1];\n  var _useReducer = (0,kd_libs_react__WEBPACK_IMPORTED_MODULE_3__.useReducer)(function (n) {\n      return n + 1;\n    }, 0),\n    _useReducer2 = (0,_babel_runtime_corejs3_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(_useReducer, 2),\n    forceUpdate = _useReducer2[1];\n  var updateControlStatus = (0,kd_libs_react__WEBPACK_IMPORTED_MODULE_3__.useCallback)(function (args) {\n    var v = args.v;\n    // if (controlStatusRef.current === args.v) return\n    if (v < 5) {\n      // 1-4对应：普通、禁用、只读、隐藏\n      // 状态更新时,同时刷新必录状态,\n      controlStatusRef.current = v;\n      (0,kd_libs_react_dom__WEBPACK_IMPORTED_MODULE_7__.unstable_batchedUpdates)(function () {\n        // setControlRequired(v === '1' && !!controlRequired)\n        forceUpdate();\n      });\n    } else if (v === '5') {\n      // 必录\n      setControlRequired(true);\n    } else if (v === '6') {\n      // 非必录\n      setControlRequired(false);\n    }\n  }, []);\n\n  // 表格\n  (0,kd_libs_react__WEBPACK_IMPORTED_MODULE_3__.useEffect)(function () {\n    // 如果是处理表格的状态的话是无需处理5、6的情况，5、6使用mi表示\n    updateControlStatus({\n      v: Status\n    });\n  }, [Status, updateControlStatus]);\n\n  // 必填状态变更更改内部状态\n  (0,kd_libs_react__WEBPACK_IMPORTED_MODULE_3__.useEffect)(function () {\n    setControlRequired(required);\n  }, [required]);\n  (0,_control_hooks__WEBPACK_IMPORTED_MODULE_4__.useListenControlAction)(_constants_sysActionName__WEBPACK_IMPORTED_MODULE_6__.SET_CONTROL_STATUS, controlmeta, updateControlStatus);\n  var mergedRules = (0,kd_libs_react__WEBPACK_IMPORTED_MODULE_3__.useMemo)(function () {\n    if (controlRequired) {\n      var _context, _context2;\n      return _babel_runtime_corejs3_core_js_stable_instance_concat__WEBPACK_IMPORTED_MODULE_1___default()(_context = _babel_runtime_corejs3_core_js_stable_instance_filter__WEBPACK_IMPORTED_MODULE_2___default()(_context2 = rules).call(_context2, function (r) {\n        return r.required !== true;\n      })).call(_context, (0,_utils_componentUtil__WEBPACK_IMPORTED_MODULE_5__.getRequiredRule)(controlmeta));\n    }\n    return rules;\n  }, [controlRequired]);\n  return {\n    disabled: disabled,\n    readonly: readonly,\n    hidden: hidden,\n    rules: mergedRules,\n    required: !disabled && !readonly && controlRequired // 只读、禁用态不显示必录\n  };\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (useControlState);\n\n//# sourceURL=webpack://nocode-component/./src/control/hooks/useControlState.ts?");

/***/ }),

/***/ "./src/control/hooks/useFieldProps.tsx":
/*!*********************************************!*\
  !*** ./src/control/hooks/useFieldProps.tsx ***!
  \*********************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   useFieldProps: function() { return /* binding */ useFieldProps; }\n/* harmony export */ });\n/* harmony import */ var kd_libs_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! kd_libs/react */ \"webpack/container/remote/kd_libs/react\");\n/* harmony import */ var kd_libs_react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(kd_libs_react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _utils_context__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/utils/context */ \"./src/utils/context.ts\");\n/* harmony import */ var _utils_componentUtil__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/utils/componentUtil */ \"./src/utils/componentUtil.ts\");\n/* harmony import */ var _useControlState__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./useControlState */ \"./src/control/hooks/useControlState.ts\");\n/*\n * @Description: 获取字段类的属性\n * @Author: jianhang_he\n * @Date: 2022-08-31 09:37:07\n * @LastEditTime: 2022-09-19 18:08:25\n * @Last Modified by: jianhang_he\n */\n\n\n\n\nvar useFieldProps = function useFieldProps(controlmeta) {\n  var extra = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n  var emptytip = controlmeta.emptytip,\n    ShowClearButton = controlmeta.ShowClearButton,\n    maxlength = controlmeta.maxlength,\n    pageId = controlmeta.pageId;\n  var _useContext = (0,kd_libs_react__WEBPACK_IMPORTED_MODULE_0__.useContext)(_utils_context__WEBPACK_IMPORTED_MODULE_1__.KDContext),\n    model = _useContext.model; // 上下文\n  // 页面查看态\n  var pageStatus = model.getFormStatus(pageId);\n  var isViewStatus = (0,_utils_componentUtil__WEBPACK_IMPORTED_MODULE_2__.isPageViewStatus)(pageStatus);\n\n  // 获取当前控件状态：禁用、只读、隐藏等\n  var _useControlState = (0,_useControlState__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(controlmeta),\n    disabled = _useControlState.disabled,\n    readonly = _useControlState.readonly,\n    hidden = _useControlState.hidden,\n    required = _useControlState.required,\n    rules = _useControlState.rules;\n  var readonlyState = extra.readonly || readonly || isViewStatus;\n  if (!controlmeta) {\n    return {\n      readonly: readonlyState\n    };\n  }\n  return {\n    hidden: hidden,\n    disabled: disabled,\n    readonly: readonlyState,\n    placeholder: model.getControlText(emptytip) || '',\n    allowClear: ShowClearButton,\n    maxLength: maxlength,\n    required: required,\n    rules: rules\n  };\n};\n\n//# sourceURL=webpack://nocode-component/./src/control/hooks/useFieldProps.tsx?");

/***/ }),

/***/ "./src/control/hooks/useGridHooks.tsx":
/*!********************************************!*\
  !*** ./src/control/hooks/useGridHooks.tsx ***!
  \********************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   useGridFocus: function() { return /* binding */ useGridFocus; },\n/* harmony export */   useGridProps: function() { return /* binding */ useGridProps; },\n/* harmony export */   useGridValidate: function() { return /* binding */ useGridValidate; }\n/* harmony export */ });\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_set_timeout__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @babel/runtime-corejs3/core-js-stable/set-timeout */ \"../../node_modules/@babel/runtime-corejs3/core-js-stable/set-timeout.js\");\n/* harmony import */ var _babel_runtime_corejs3_core_js_stable_set_timeout__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_corejs3_core_js_stable_set_timeout__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 _control_hooks_useFieldProps__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @/control/hooks/useFieldProps */ \"./src/control/hooks/useFieldProps.tsx\");\n/* harmony import */ var _utils_context__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @/utils/context */ \"./src/utils/context.ts\");\n/* harmony import */ var _control_web_DataGrid_context_dataGridContext__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @/control/web/DataGrid/context/dataGridContext */ \"./src/control/web/DataGrid/context/dataGridContext.ts\");\n/* harmony import */ var _constants_dataGridConstants__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! @/constants/dataGridConstants */ \"./src/constants/dataGridConstants.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 * @Description: 表格点击聚焦\n * @Author: jianhang_he\n * @Date: 2022-11-25 15:07:02\n * @LastEditTime: 2023-01-29 10:43:11\n * @Last Modified by: jianhang_he\n */\n\n\n\n\n\n/**\n * 表格点击聚焦\n * @param ref 聚焦节点\n * @param disabled 是否禁用\n */\nvar useGridFocus = function useGridFocus(ref, disabled) {\n  (0,kd_libs_react__WEBPACK_IMPORTED_MODULE_12__.useEffect)(function () {\n    if (ref.current) ref.current.focus(); // 自动获取焦点\n  }, [disabled]);\n};\n\n/**\n * 表格校验\n * @param trigger 触发方式\n * @param disabled 是否禁用\n */\nvar useGridValidate = function useGridValidate(trigger, _ref) {\n  var value = _ref.value,\n    disabled = _ref.disabled,\n    isValidate = _ref.isValidate;\n  var ref = (0,kd_libs_react__WEBPACK_IMPORTED_MODULE_12__.useRef)();\n  (0,kd_libs_react__WEBPACK_IMPORTED_MODULE_12__.useEffect)(function () {\n    _babel_runtime_corejs3_core_js_stable_set_timeout__WEBPACK_IMPORTED_MODULE_11___default()(function () {\n      var _ref$current;\n      isValidate && !disabled && (Array.isArray(value) ? (value === null || value === void 0 ? void 0 : value.length) > 0 : value) && ((_ref$current = ref.current) === null || _ref$current === void 0 ? void 0 : _ref$current.validateFields(trigger, value));\n    });\n  }, [ref.current, value, disabled]);\n  return ref;\n};\n// 生成表格控件属性\nvar useGridProps = function useGridProps(props) {\n  var _record$cprop3;\n  var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'blur';\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 _useContext2 = (0,kd_libs_react__WEBPACK_IMPORTED_MODULE_12__.useContext)(_control_web_DataGrid_context_dataGridContext__WEBPACK_IMPORTED_MODULE_15__.TableContext),\n    state = _useContext2.state,\n    dispatch = _useContext2.dispatch;\n  var rowIndex = props.rowIndex,\n    meta = props.meta,\n    value = props.value,\n    record = props.record;\n  var _useFieldProps = (0,_control_hooks_useFieldProps__WEBPACK_IMPORTED_MODULE_13__.useFieldProps)(meta, props),\n    readonly = _useFieldProps.readonly;\n  var _useState = (0,kd_libs_react__WEBPACK_IMPORTED_MODULE_12__.useState)(true),\n    _useState2 = (0,_babel_runtime_corejs3_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_10__[\"default\"])(_useState, 2),\n    disabled = _useState2[0],\n    setDisabled = _useState2[1]; // 控制只读\n  var _useState3 = (0,kd_libs_react__WEBPACK_IMPORTED_MODULE_12__.useState)(new Date()),\n    _useState4 = (0,_babel_runtime_corejs3_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_10__[\"default\"])(_useState3, 2),\n    forceRefresh = _useState4[1]; // 强制刷新\n  var pageId = meta.pageId,\n    dataIndex = meta.dataIndex,\n    editor = meta.editor,\n    id = meta.id,\n    gridId = meta.gridId;\n  var ref = (0,kd_libs_react__WEBPACK_IMPORTED_MODULE_12__.useRef)(null); // 保存当前控件\n  var newValue = (0,kd_libs_react__WEBPACK_IMPORTED_MODULE_12__.useRef)(value); // 是否有变化，减少失焦后请求\n\n  var updateValue = (0,kd_libs_react__WEBPACK_IMPORTED_MODULE_12__.useCallback)(function (val) {\n    if (newValue.current === value) return;\n    var data = {\n      k: dataIndex,\n      r: rowIndex,\n      v: val || newValue.current\n    };\n    model.batchInvoke('updateValue', pageId, '', [], [{}, [data]]);\n  }, [value, dataIndex, rowIndex, pageId]);\n\n  // 内容变化时\n  var onChange = (0,kd_libs_react__WEBPACK_IMPORTED_MODULE_12__.useCallback)(function (val) {\n    newValue.current = val;\n    type === 'change' && updateValue(val);\n  }, [type, updateValue]);\n\n  /**\n   * 失焦，通过指令更新服务器控件值\n   */\n  var onBlur = (0,kd_libs_react__WEBPACK_IMPORTED_MODULE_12__.useCallback)(function () {\n    type === 'blur' && updateValue();\n  }, [value, type, updateValue]);\n\n  // 是否支持行编辑\n  var canEditRow = (0,kd_libs_react__WEBPACK_IMPORTED_MODULE_12__.useMemo)(function () {\n    var _record$cprop, _record$cprop2;\n    return (record === null || record === void 0 || (_record$cprop = record.cprop) === null || _record$cprop === void 0 ? void 0 : _record$cprop.canEditRow) || (record === null || record === void 0 || (_record$cprop2 = record.cprop) === null || _record$cprop2 === void 0 ? void 0 : _record$cprop2.canEditRow) === undefined;\n  }, [record === null || record === void 0 || (_record$cprop3 = record.cprop) === null || _record$cprop3 === void 0 ? void 0 : _record$cprop3.canEditRow]);\n\n  // 单元格点击,上报当前点击的单元格\n  var onTdClick = (0,kd_libs_react__WEBPACK_IMPORTED_MODULE_12__.useCallback)(function () {\n    if (readonly || !canEditRow) return;\n    var info = {\n      fieldKey: dataIndex,\n      row: rowIndex,\n      selRows: [rowIndex],\n      isClientNewRow: false,\n      clientNewRows: '',\n      selDatas: []\n    };\n    var postData = [(0,_babel_runtime_corejs3_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_9__[\"default\"])({}, gridId, info), []];\n    model.batchInvoke('entryRowClick', pageId, gridId, [rowIndex], postData);\n    dispatch({\n      type: _constants_dataGridConstants__WEBPACK_IMPORTED_MODULE_16__.SET_DATA_GRID_FOCUSTD,\n      payload: [rowIndex, dataIndex]\n    });\n  }, [value, readonly, canEditRow, rowIndex, dataIndex, gridId]);\n  (0,kd_libs_react__WEBPACK_IMPORTED_MODULE_12__.useEffect)(function () {\n    if (ref.current) ref.current.focus(); // 自动获取焦点\n  }, [disabled]);\n\n  // 监听值变化\n  (0,kd_libs_react__WEBPACK_IMPORTED_MODULE_12__.useEffect)(function () {\n    newValue.current = value;\n    forceRefresh(new Date());\n  }, [value]);\n\n  // 监听焦点变化\n  (0,kd_libs_react__WEBPACK_IMPORTED_MODULE_12__.useEffect)(function () {\n    console.log('useGridProps', state.focusTd, rowIndex, dataIndex);\n    var isFocus = state.focusTd[0] === rowIndex && state.focusTd[1] === dataIndex;\n    disabled !== !isFocus && setDisabled(!isFocus);\n  }, [state.focusTd, rowIndex, dataIndex, disabled, setDisabled]);\n  console.log('useGridProps', readonly, meta, state.focusTd);\n  return {\n    ref: ref,\n    controlMeta: _objectSpread(_objectSpread({}, editor), {}, {\n      pageId: pageId,\n      id: dataIndex,\n      gridId: gridId,\n      dataIndex: dataIndex,\n      TitleArea: 'hide'\n    }),\n    value: {\n      v: newValue.current\n    },\n    disabled: disabled,\n    setDisabled: setDisabled,\n    onChange: onChange,\n    onBlur: onBlur,\n    onTdClick: onTdClick\n  };\n};\n\n//# sourceURL=webpack://nocode-component/./src/control/hooks/useGridHooks.tsx?");

/***/ }),

/***/ "./src/control/hooks/useListenControlAction.tsx":
/*!******************************************************!*\
  !*** ./src/control/hooks/useListenControlAction.tsx ***!
  \******************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   useListenControlAction: function() { return /* binding */ useListenControlAction; }\n/* harmony export */ });\n/* harmony import */ var kd_libs_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! kd_libs/react */ \"webpack/container/remote/kd_libs/react\");\n/* harmony import */ var kd_libs_react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(kd_libs_react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _utils_context__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/utils/context */ \"./src/utils/context.ts\");\n/*\n * @Description: 监听指令\n * @Author: jianhang_he\n * @Date: 2022-08-31 09:37:07\n * @LastEditTime: 2022-08-31 10:19:42\n * @Last Modified by: jianhang_he\n */\n\n\nvar useListenControlAction = function useListenControlAction(action, controlmeta, callback) {\n  var _useContext = (0,kd_libs_react__WEBPACK_IMPORTED_MODULE_0__.useContext)(_utils_context__WEBPACK_IMPORTED_MODULE_1__.KDContext),\n    model = _useContext.model; // 上下文\n\n  var actionHandle = (0,kd_libs_react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(callback, [callback]);\n  (0,kd_libs_react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {\n    var pageId = controlmeta.pageId,\n      id = controlmeta.id;\n    var removeAction = model.addControlAction(action, pageId, id, actionHandle);\n    return function () {\n      removeAction && removeAction();\n    };\n  }, []);\n};\n\n//# sourceURL=webpack://nocode-component/./src/control/hooks/useListenControlAction.tsx?");

/***/ }),

/***/ "./src/control/hooks/usePageStatus.tsx":
/*!*********************************************!*\
  !*** ./src/control/hooks/usePageStatus.tsx ***!
  \*********************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   usePageStatus: function() { return /* binding */ usePageStatus; }\n/* harmony export */ });\n/* harmony import */ var kd_libs_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! kd_libs/react */ \"webpack/container/remote/kd_libs/react\");\n/* harmony import */ var kd_libs_react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(kd_libs_react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _utils_context__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/utils/context */ \"./src/utils/context.ts\");\n/*\n * @Description: 获取页面状态\n * @Author: jianhang_he\n * @Date: 2022-08-26 15:04:33\n * @LastEditTime: 2022-08-31 10:56:59\n * @Last Modified by: jianhang_he\n */\n\n\nvar usePageStatus = function usePageStatus() {\n  var _useContext = (0,kd_libs_react__WEBPACK_IMPORTED_MODULE_0__.useContext)(_utils_context__WEBPACK_IMPORTED_MODULE_1__.KDContext),\n    model = _useContext.model; // 上下文\n  var pageStatus = model.getFormStatus();\n\n  // 查看态\n  return pageStatus;\n};\n\n//# sourceURL=webpack://nocode-component/./src/control/hooks/usePageStatus.tsx?");

/***/ }),

/***/ "./src/control/web/DataGrid/context/dataGridContext.ts":
/*!*************************************************************!*\
  !*** ./src/control/web/DataGrid/context/dataGridContext.ts ***!
  \*************************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   TableContext: function() { return /* binding */ TableContext; }\n/* harmony export */ });\n/* harmony import */ var kd_libs_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! kd_libs/react */ \"webpack/container/remote/kd_libs/react\");\n/* harmony import */ var kd_libs_react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(kd_libs_react__WEBPACK_IMPORTED_MODULE_0__);\n\nvar TableContext = kd_libs_react__WEBPACK_IMPORTED_MODULE_0___default().createContext(null);\n\n//# sourceURL=webpack://nocode-component/./src/control/web/DataGrid/context/dataGridContext.ts?");

/***/ })

}]);