@kdcloudjs/kdesign 1.7.19 → 1.7.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +34 -0
- package/dist/kdesign-complete.less +331 -239
- package/dist/kdesign.css +266 -239
- package/dist/kdesign.css.map +1 -1
- package/dist/kdesign.js +512 -625
- package/dist/kdesign.js.map +1 -1
- package/dist/kdesign.min.css +2 -2
- package/dist/kdesign.min.js +9 -9
- package/dist/kdesign.min.js.map +1 -1
- package/es/button/style/token.less +1 -0
- package/es/checkbox/checkbox.js +5 -5
- package/es/checkbox/style/index.css +2 -0
- package/es/checkbox/style/index.less +2 -0
- package/es/checkbox/style/token.less +1 -1
- package/es/city-picker/city-picker.d.ts +3 -23
- package/es/city-picker/city-picker.js +351 -124
- package/es/city-picker/interface.d.ts +57 -0
- package/es/city-picker/interface.js +3 -0
- package/es/city-picker/option.d.ts +4 -0
- package/es/city-picker/option.js +42 -0
- package/es/city-picker/style/index.css +264 -239
- package/es/city-picker/style/index.less +262 -218
- package/es/city-picker/style/mixin.less +26 -3
- package/es/city-picker/style/token.less +42 -14
- package/es/config-provider/compDefaultProps.d.ts +13 -0
- package/es/config-provider/compDefaultProps.js +13 -0
- package/es/input/style/token.less +2 -8
- package/lib/button/style/token.less +1 -0
- package/lib/checkbox/checkbox.js +4 -4
- package/lib/checkbox/style/index.css +2 -0
- package/lib/checkbox/style/index.less +2 -0
- package/lib/checkbox/style/token.less +1 -1
- package/lib/city-picker/city-picker.d.ts +3 -23
- package/lib/city-picker/city-picker.js +350 -123
- package/lib/city-picker/interface.d.ts +57 -0
- package/lib/city-picker/interface.js +11 -0
- package/lib/city-picker/option.d.ts +4 -0
- package/lib/city-picker/option.js +55 -0
- package/lib/city-picker/style/index.css +264 -239
- package/lib/city-picker/style/index.less +262 -218
- package/lib/city-picker/style/mixin.less +26 -3
- package/lib/city-picker/style/token.less +42 -14
- package/lib/config-provider/compDefaultProps.d.ts +13 -0
- package/lib/config-provider/compDefaultProps.js +13 -0
- package/lib/input/style/token.less +2 -8
- package/package.json +1 -1
- package/es/city-picker/city-group.d.ts +0 -8
- package/es/city-picker/city-group.js +0 -38
- package/es/city-picker/city-list.d.ts +0 -12
- package/es/city-picker/city-list.js +0 -55
- package/es/city-picker/city-panel-item.d.ts +0 -13
- package/es/city-picker/city-panel-item.js +0 -22
- package/es/city-picker/city-panel.d.ts +0 -17
- package/es/city-picker/city-panel.js +0 -153
- package/es/city-picker/city-search-panel.d.ts +0 -9
- package/es/city-picker/city-search-panel.js +0 -44
- package/es/city-picker/no-data.d.ts +0 -3
- package/es/city-picker/no-data.js +0 -18
- package/es/city-picker/utils/grouping.d.ts +0 -7
- package/es/city-picker/utils/grouping.js +0 -24
- package/lib/city-picker/city-group.d.ts +0 -8
- package/lib/city-picker/city-group.js +0 -51
- package/lib/city-picker/city-list.d.ts +0 -12
- package/lib/city-picker/city-list.js +0 -68
- package/lib/city-picker/city-panel-item.d.ts +0 -13
- package/lib/city-picker/city-panel-item.js +0 -35
- package/lib/city-picker/city-panel.d.ts +0 -17
- package/lib/city-picker/city-panel.js +0 -166
- package/lib/city-picker/city-search-panel.d.ts +0 -9
- package/lib/city-picker/city-search-panel.js +0 -57
- package/lib/city-picker/no-data.d.ts +0 -3
- package/lib/city-picker/no-data.js +0 -31
- package/lib/city-picker/utils/grouping.d.ts +0 -7
- package/lib/city-picker/utils/grouping.js +0 -30
package/dist/kdesign.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
*
|
|
3
|
-
* @kdcloudjs/kdesign v1.7.
|
|
3
|
+
* @kdcloudjs/kdesign v1.7.19
|
|
4
4
|
*
|
|
5
5
|
* Copyright 2020-present, Kingdee, Inc.
|
|
6
6
|
* All rights reserved.
|
|
@@ -7103,20 +7103,20 @@ var InternalCheckbox = function InternalCheckbox(props, ref) {
|
|
|
7103
7103
|
var getIndeterminate = function getIndeterminate() {
|
|
7104
7104
|
return selected ? false : indeterminate;
|
|
7105
7105
|
};
|
|
7106
|
-
var getDefaultClassName = classnames__WEBPACK_IMPORTED_MODULE_7___default()(className, (_classNames = {}, _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1___default()(_classNames, "".concat(checkboxPrefixCls), true), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1___default()(_classNames, "".concat(checkboxPrefixCls, "-no-child"), !children), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1___default()(_classNames, "".concat(checkboxPrefixCls, "-").concat(mergedSize),
|
|
7107
|
-
var getSquareClassName = classnames__WEBPACK_IMPORTED_MODULE_7___default()(className, (_classNames2 = {}, _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1___default()(_classNames2, "".concat(checkboxPrefixCls), true), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1___default()(_classNames2, "".concat(checkboxPrefixCls, "-").concat(mergedCheckboxType), true), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1___default()(_classNames2, "".concat(checkboxPrefixCls, "-").concat(mergedSize),
|
|
7106
|
+
var getDefaultClassName = classnames__WEBPACK_IMPORTED_MODULE_7___default()(className, (_classNames = {}, _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1___default()(_classNames, "".concat(checkboxPrefixCls), true), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1___default()(_classNames, "".concat(checkboxPrefixCls, "-no-child"), !children), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1___default()(_classNames, "".concat(checkboxPrefixCls, "-").concat(mergedSize), !!children), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1___default()(_classNames, "".concat(checkboxPrefixCls, "-").concat(mergedCheckboxType), true), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1___default()(_classNames, "".concat(checkboxPrefixCls, "-").concat(mergedCheckboxType, "-disabled"), mergedDisabled), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1___default()(_classNames, "checked", selected), _classNames));
|
|
7107
|
+
var getSquareClassName = classnames__WEBPACK_IMPORTED_MODULE_7___default()(className, (_classNames2 = {}, _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1___default()(_classNames2, "".concat(checkboxPrefixCls), true), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1___default()(_classNames2, "".concat(checkboxPrefixCls, "-").concat(mergedCheckboxType), true), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1___default()(_classNames2, "".concat(checkboxPrefixCls, "-").concat(mergedSize), !!children), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1___default()(_classNames2, "".concat(checkboxPrefixCls, "-").concat(mergedCheckboxType, "-disabled"), mergedDisabled), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1___default()(_classNames2, "".concat(checkboxPrefixCls, "-").concat(mergedCheckboxType, "-checked"), selected && !mergedDisabled), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1___default()(_classNames2, "checked", selected), _classNames2));
|
|
7108
7108
|
var getRootClassName = isDefaultType() ? getDefaultClassName : getSquareClassName;
|
|
7109
7109
|
var inputClassName = classnames__WEBPACK_IMPORTED_MODULE_7___default()(_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1___default()({}, "".concat(checkboxPrefixCls, "-input"), true));
|
|
7110
7110
|
var checkedWrapperClassName = classnames__WEBPACK_IMPORTED_MODULE_7___default()((_classNames4 = {}, _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1___default()(_classNames4, "".concat(checkboxPrefixCls, "-").concat(mergedCheckboxType, "-no-child"), !children), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1___default()(_classNames4, "".concat(checkboxPrefixCls, "-").concat(mergedCheckboxType, "-wrapper"), true), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1___default()(_classNames4, "".concat(checkboxPrefixCls, "-").concat(mergedCheckboxType, "-wrapper-size"), !!children), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1___default()(_classNames4, "".concat(checkboxPrefixCls, "-").concat(mergedCheckboxType, "-margin"), !!children), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1___default()(_classNames4, "".concat(checkboxPrefixCls, "-").concat(mergedCheckboxType, "-checked"), selected), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1___default()(_classNames4, "".concat(checkboxPrefixCls, "-").concat(mergedCheckboxType, "-indeterminate"), getIndeterminate()), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1___default()(_classNames4, "".concat(checkboxPrefixCls, "-").concat(mergedCheckboxType, "-disabled"), mergedDisabled && !selected), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1___default()(_classNames4, "".concat(checkboxPrefixCls, "-").concat(mergedCheckboxType, "-checked-disabled"), mergedDisabled && selected), _classNames4));
|
|
7111
7111
|
var triangleClassName = classnames__WEBPACK_IMPORTED_MODULE_7___default()((_classNames5 = {}, _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1___default()(_classNames5, "".concat(checkboxPrefixCls, "-").concat(mergedCheckboxType, "-triangle"), !selected), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1___default()(_classNames5, "".concat(checkboxPrefixCls, "-").concat(mergedCheckboxType, "-triangle-checked"), selected), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1___default()(_classNames5, "".concat(checkboxPrefixCls, "-").concat(mergedCheckboxType, "-triangle-disabled"), mergedDisabled), _classNames5));
|
|
7112
7112
|
var innerIconClassName = classnames__WEBPACK_IMPORTED_MODULE_7___default()(_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1___default()({}, "".concat(checkboxPrefixCls, "-").concat(mergedCheckboxType, "-inner"), true));
|
|
7113
|
-
var handleChange =
|
|
7113
|
+
var handleChange = function handleChange(e) {
|
|
7114
7114
|
onChange && onChange(e);
|
|
7115
7115
|
(checkboxGroup === null || checkboxGroup === void 0 ? void 0 : checkboxGroup.onCheckboxGroupChange) && (checkboxGroup === null || checkboxGroup === void 0 ? void 0 : checkboxGroup.onCheckboxGroupChange(value, e.target.checked, e));
|
|
7116
7116
|
if (!(checkboxGroup !== null && checkboxGroup !== void 0 && checkboxGroup.isControlled)) {
|
|
7117
7117
|
setSelected(e.target.checked);
|
|
7118
7118
|
}
|
|
7119
|
-
}
|
|
7119
|
+
};
|
|
7120
7120
|
Object(react__WEBPACK_IMPORTED_MODULE_6__["useEffect"])(function () {
|
|
7121
7121
|
lodash_isBoolean__WEBPACK_IMPORTED_MODULE_11___default()(checked) && checked !== selected && setSelected(checked);
|
|
7122
7122
|
}, [checked, selected]);
|
|
@@ -7398,210 +7398,88 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
7398
7398
|
|
|
7399
7399
|
/***/ }),
|
|
7400
7400
|
|
|
7401
|
-
/***/ "./components/city-picker/city-
|
|
7402
|
-
|
|
7403
|
-
!*** ./components/city-picker/city-
|
|
7404
|
-
|
|
7401
|
+
/***/ "./components/city-picker/city-picker.tsx":
|
|
7402
|
+
/*!************************************************!*\
|
|
7403
|
+
!*** ./components/city-picker/city-picker.tsx ***!
|
|
7404
|
+
\************************************************/
|
|
7405
7405
|
/*! exports provided: default */
|
|
7406
7406
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
7407
7407
|
|
|
7408
7408
|
"use strict";
|
|
7409
7409
|
__webpack_require__.r(__webpack_exports__);
|
|
7410
|
-
/* harmony import */ var
|
|
7411
|
-
/* harmony import */ var
|
|
7412
|
-
/* harmony import */ var
|
|
7413
|
-
/* harmony import */ var
|
|
7414
|
-
/* harmony import */ var
|
|
7415
|
-
/* harmony import */ var
|
|
7416
|
-
/* harmony import */ var
|
|
7417
|
-
/* harmony import */ var
|
|
7418
|
-
/* harmony import */ var
|
|
7419
|
-
|
|
7420
|
-
|
|
7421
|
-
|
|
7422
|
-
|
|
7423
|
-
|
|
7424
|
-
var
|
|
7425
|
-
|
|
7426
|
-
|
|
7427
|
-
|
|
7428
|
-
|
|
7429
|
-
|
|
7430
|
-
|
|
7431
|
-
|
|
7432
|
-
|
|
7433
|
-
|
|
7434
|
-
|
|
7435
|
-
|
|
7436
|
-
|
|
7437
|
-
|
|
7438
|
-
|
|
7439
|
-
|
|
7440
|
-
|
|
7441
|
-
|
|
7442
|
-
|
|
7443
|
-
|
|
7444
|
-
|
|
7445
|
-
|
|
7446
|
-
|
|
7447
|
-
|
|
7448
|
-
|
|
7449
|
-
|
|
7450
|
-
|
|
7451
|
-
|
|
7452
|
-
|
|
7453
|
-
|
|
7454
|
-
|
|
7455
|
-
/* harmony
|
|
7456
|
-
|
|
7457
|
-
|
|
7410
|
+
/* harmony import */ var _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/toConsumableArray */ "./node_modules/@babel/runtime/helpers/toConsumableArray.js");
|
|
7411
|
+
/* harmony import */ var _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__);
|
|
7412
|
+
/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "./node_modules/@babel/runtime/helpers/defineProperty.js");
|
|
7413
|
+
/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1__);
|
|
7414
|
+
/* harmony import */ var _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "./node_modules/@babel/runtime/helpers/slicedToArray.js");
|
|
7415
|
+
/* harmony import */ var _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_2__);
|
|
7416
|
+
/* harmony import */ var core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.symbol.js */ "./node_modules/core-js/modules/es.symbol.js");
|
|
7417
|
+
/* harmony import */ var core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_3__);
|
|
7418
|
+
/* harmony import */ var core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/es.symbol.description.js */ "./node_modules/core-js/modules/es.symbol.description.js");
|
|
7419
|
+
/* harmony import */ var core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_4__);
|
|
7420
|
+
/* harmony import */ var core_js_modules_es_array_concat_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/es.array.concat.js */ "./node_modules/core-js/modules/es.array.concat.js");
|
|
7421
|
+
/* harmony import */ var core_js_modules_es_array_concat_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_concat_js__WEBPACK_IMPORTED_MODULE_5__);
|
|
7422
|
+
/* harmony import */ var core_js_modules_es_array_find_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! core-js/modules/es.array.find.js */ "./node_modules/core-js/modules/es.array.find.js");
|
|
7423
|
+
/* harmony import */ var core_js_modules_es_array_find_js__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_find_js__WEBPACK_IMPORTED_MODULE_6__);
|
|
7424
|
+
/* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! core-js/modules/es.object.to-string.js */ "./node_modules/core-js/modules/es.object.to-string.js");
|
|
7425
|
+
/* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_7__);
|
|
7426
|
+
/* harmony import */ var core_js_modules_es_regexp_constructor_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! core-js/modules/es.regexp.constructor.js */ "./node_modules/core-js/modules/es.regexp.constructor.js");
|
|
7427
|
+
/* harmony import */ var core_js_modules_es_regexp_constructor_js__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_regexp_constructor_js__WEBPACK_IMPORTED_MODULE_8__);
|
|
7428
|
+
/* harmony import */ var core_js_modules_es_regexp_exec_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! core-js/modules/es.regexp.exec.js */ "./node_modules/core-js/modules/es.regexp.exec.js");
|
|
7429
|
+
/* harmony import */ var core_js_modules_es_regexp_exec_js__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_regexp_exec_js__WEBPACK_IMPORTED_MODULE_9__);
|
|
7430
|
+
/* harmony import */ var core_js_modules_es_regexp_to_string_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! core-js/modules/es.regexp.to-string.js */ "./node_modules/core-js/modules/es.regexp.to-string.js");
|
|
7431
|
+
/* harmony import */ var core_js_modules_es_regexp_to_string_js__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_regexp_to_string_js__WEBPACK_IMPORTED_MODULE_10__);
|
|
7432
|
+
/* harmony import */ var core_js_modules_es_array_join_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! core-js/modules/es.array.join.js */ "./node_modules/core-js/modules/es.array.join.js");
|
|
7433
|
+
/* harmony import */ var core_js_modules_es_array_join_js__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_join_js__WEBPACK_IMPORTED_MODULE_11__);
|
|
7434
|
+
/* harmony import */ var core_js_modules_es_array_map_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! core-js/modules/es.array.map.js */ "./node_modules/core-js/modules/es.array.map.js");
|
|
7435
|
+
/* harmony import */ var core_js_modules_es_array_map_js__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_map_js__WEBPACK_IMPORTED_MODULE_12__);
|
|
7436
|
+
/* harmony import */ var core_js_modules_es_string_split_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! core-js/modules/es.string.split.js */ "./node_modules/core-js/modules/es.string.split.js");
|
|
7437
|
+
/* harmony import */ var core_js_modules_es_string_split_js__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_string_split_js__WEBPACK_IMPORTED_MODULE_13__);
|
|
7438
|
+
/* harmony import */ var core_js_modules_es_function_name_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! core-js/modules/es.function.name.js */ "./node_modules/core-js/modules/es.function.name.js");
|
|
7439
|
+
/* harmony import */ var core_js_modules_es_function_name_js__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_function_name_js__WEBPACK_IMPORTED_MODULE_14__);
|
|
7440
|
+
/* harmony import */ var core_js_modules_es_object_keys_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! core-js/modules/es.object.keys.js */ "./node_modules/core-js/modules/es.object.keys.js");
|
|
7441
|
+
/* harmony import */ var core_js_modules_es_object_keys_js__WEBPACK_IMPORTED_MODULE_15___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_object_keys_js__WEBPACK_IMPORTED_MODULE_15__);
|
|
7442
|
+
/* harmony import */ var core_js_modules_es_array_filter_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! core-js/modules/es.array.filter.js */ "./node_modules/core-js/modules/es.array.filter.js");
|
|
7443
|
+
/* harmony import */ var core_js_modules_es_array_filter_js__WEBPACK_IMPORTED_MODULE_16___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_filter_js__WEBPACK_IMPORTED_MODULE_16__);
|
|
7444
|
+
/* harmony import */ var core_js_modules_es_object_get_own_property_descriptor_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptor.js */ "./node_modules/core-js/modules/es.object.get-own-property-descriptor.js");
|
|
7445
|
+
/* harmony import */ var core_js_modules_es_object_get_own_property_descriptor_js__WEBPACK_IMPORTED_MODULE_17___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_object_get_own_property_descriptor_js__WEBPACK_IMPORTED_MODULE_17__);
|
|
7446
|
+
/* harmony import */ var core_js_modules_web_dom_collections_for_each_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! core-js/modules/web.dom-collections.for-each.js */ "./node_modules/core-js/modules/web.dom-collections.for-each.js");
|
|
7447
|
+
/* harmony import */ var core_js_modules_web_dom_collections_for_each_js__WEBPACK_IMPORTED_MODULE_18___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_web_dom_collections_for_each_js__WEBPACK_IMPORTED_MODULE_18__);
|
|
7448
|
+
/* harmony import */ var core_js_modules_es_object_get_own_property_descriptors_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptors.js */ "./node_modules/core-js/modules/es.object.get-own-property-descriptors.js");
|
|
7449
|
+
/* harmony import */ var core_js_modules_es_object_get_own_property_descriptors_js__WEBPACK_IMPORTED_MODULE_19___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_object_get_own_property_descriptors_js__WEBPACK_IMPORTED_MODULE_19__);
|
|
7450
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! react */ "react");
|
|
7451
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_20___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_20__);
|
|
7452
|
+
/* harmony import */ var _utils_hooks__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ../_utils/hooks */ "./components/_utils/hooks.tsx");
|
|
7453
|
+
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
|
|
7454
|
+
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_22___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_22__);
|
|
7455
|
+
/* harmony import */ var _config_provider_ConfigContext__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ../config-provider/ConfigContext */ "./components/config-provider/ConfigContext.tsx");
|
|
7456
|
+
/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ../_utils */ "./components/_utils/index.ts");
|
|
7457
|
+
/* harmony import */ var _index__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ../index */ "./components/index.tsx");
|
|
7458
|
+
/* harmony import */ var _utils_usePopper__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ../_utils/usePopper */ "./components/_utils/usePopper.tsx");
|
|
7459
|
+
/* harmony import */ var _option__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./option */ "./components/city-picker/option.tsx");
|
|
7460
|
+
/* harmony import */ var lodash_escapeRegExp__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! lodash/escapeRegExp */ "./node_modules/lodash/escapeRegExp.js");
|
|
7461
|
+
/* harmony import */ var lodash_escapeRegExp__WEBPACK_IMPORTED_MODULE_28___default = /*#__PURE__*/__webpack_require__.n(lodash_escapeRegExp__WEBPACK_IMPORTED_MODULE_28__);
|
|
7458
7462
|
|
|
7459
|
-
/***/ "./components/city-picker/city-list.tsx":
|
|
7460
|
-
/*!**********************************************!*\
|
|
7461
|
-
!*** ./components/city-picker/city-list.tsx ***!
|
|
7462
|
-
\**********************************************/
|
|
7463
|
-
/*! exports provided: default */
|
|
7464
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
7465
7463
|
|
|
7466
|
-
"use strict";
|
|
7467
|
-
__webpack_require__.r(__webpack_exports__);
|
|
7468
|
-
/* 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");
|
|
7469
|
-
/* 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__);
|
|
7470
|
-
/* harmony import */ var core_js_modules_es_array_map_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.array.map.js */ "./node_modules/core-js/modules/es.array.map.js");
|
|
7471
|
-
/* harmony import */ var core_js_modules_es_array_map_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_map_js__WEBPACK_IMPORTED_MODULE_1__);
|
|
7472
|
-
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "react");
|
|
7473
|
-
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__);
|
|
7474
|
-
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
|
|
7475
|
-
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_3__);
|
|
7476
|
-
/* harmony import */ var _config_provider_ConfigContext__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../config-provider/ConfigContext */ "./components/config-provider/ConfigContext.tsx");
|
|
7477
|
-
/* harmony import */ var _city_panel_item__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./city-panel-item */ "./components/city-picker/city-panel-item.tsx");
|
|
7478
|
-
/* harmony import */ var _no_data__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./no-data */ "./components/city-picker/no-data.tsx");
|
|
7479
7464
|
|
|
7465
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
7466
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1___default()(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
7480
7467
|
|
|
7481
7468
|
|
|
7482
7469
|
|
|
7483
7470
|
|
|
7484
7471
|
|
|
7485
7472
|
|
|
7486
|
-
var CityList = function CityList(props) {
|
|
7487
|
-
var _useContext = Object(react__WEBPACK_IMPORTED_MODULE_2__["useContext"])(_config_provider_ConfigContext__WEBPACK_IMPORTED_MODULE_4__["default"]),
|
|
7488
|
-
getPrefixCls = _useContext.getPrefixCls,
|
|
7489
|
-
prefixCls = _useContext.prefixCls;
|
|
7490
|
-
var groupKeys = props.groupKeys,
|
|
7491
|
-
cityList = props.cityList,
|
|
7492
|
-
handleSelect = props.onSelect;
|
|
7493
|
-
var cityPickerPrefixCls = getPrefixCls(prefixCls, 'city-picker');
|
|
7494
|
-
var tableCls = classnames__WEBPACK_IMPORTED_MODULE_3___default()("".concat(cityPickerPrefixCls, "-city-table"));
|
|
7495
|
-
var tableGroupCls = classnames__WEBPACK_IMPORTED_MODULE_3___default()("".concat(cityPickerPrefixCls, "-city-table-group"));
|
|
7496
|
-
var keyCls = classnames__WEBPACK_IMPORTED_MODULE_3___default()("".concat(cityPickerPrefixCls, "-city-table-key"));
|
|
7497
|
-
var itemContainerCls = classnames__WEBPACK_IMPORTED_MODULE_3___default()("".concat(cityPickerPrefixCls, "-city-table-item-container"));
|
|
7498
|
-
var hasData = cityList && cityList.some(function (citys) {
|
|
7499
|
-
return citys.length > 0;
|
|
7500
|
-
});
|
|
7501
|
-
if (!hasData) {
|
|
7502
|
-
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("div", {
|
|
7503
|
-
className: tableCls
|
|
7504
|
-
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(_no_data__WEBPACK_IMPORTED_MODULE_6__["default"], null));
|
|
7505
|
-
}
|
|
7506
|
-
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("div", {
|
|
7507
|
-
className: tableCls
|
|
7508
|
-
}, groupKeys && groupKeys.length > 0 && groupKeys.map(function (key, index) {
|
|
7509
|
-
var list = cityList[index] || [];
|
|
7510
|
-
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("div", {
|
|
7511
|
-
className: tableGroupCls,
|
|
7512
|
-
key: key
|
|
7513
|
-
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("div", {
|
|
7514
|
-
className: keyCls
|
|
7515
|
-
}, key), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("div", {
|
|
7516
|
-
className: itemContainerCls
|
|
7517
|
-
}, list.map(function (city) {
|
|
7518
|
-
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(_city_panel_item__WEBPACK_IMPORTED_MODULE_5__["default"], {
|
|
7519
|
-
key: city.id,
|
|
7520
|
-
city: city,
|
|
7521
|
-
onSelect: handleSelect
|
|
7522
|
-
});
|
|
7523
|
-
})));
|
|
7524
|
-
}), !groupKeys && cityList && cityList.map(function (citys) {
|
|
7525
|
-
return citys.map(function (city) {
|
|
7526
|
-
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(_city_panel_item__WEBPACK_IMPORTED_MODULE_5__["default"], {
|
|
7527
|
-
key: city.id,
|
|
7528
|
-
city: city,
|
|
7529
|
-
onSelect: handleSelect
|
|
7530
|
-
});
|
|
7531
|
-
});
|
|
7532
|
-
}));
|
|
7533
|
-
};
|
|
7534
|
-
/* harmony default export */ __webpack_exports__["default"] = (CityList);
|
|
7535
7473
|
|
|
7536
|
-
/***/ }),
|
|
7537
7474
|
|
|
7538
|
-
/***/ "./components/city-picker/city-panel-item.tsx":
|
|
7539
|
-
/*!****************************************************!*\
|
|
7540
|
-
!*** ./components/city-picker/city-panel-item.tsx ***!
|
|
7541
|
-
\****************************************************/
|
|
7542
|
-
/*! exports provided: default */
|
|
7543
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
7544
7475
|
|
|
7545
|
-
"use strict";
|
|
7546
|
-
__webpack_require__.r(__webpack_exports__);
|
|
7547
|
-
/* harmony import */ var core_js_modules_es_function_name_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.function.name.js */ "./node_modules/core-js/modules/es.function.name.js");
|
|
7548
|
-
/* harmony import */ var core_js_modules_es_function_name_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_function_name_js__WEBPACK_IMPORTED_MODULE_0__);
|
|
7549
|
-
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
|
|
7550
|
-
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
|
|
7551
|
-
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
|
|
7552
|
-
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__);
|
|
7553
|
-
/* harmony import */ var _config_provider_ConfigContext__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../config-provider/ConfigContext */ "./components/config-provider/ConfigContext.tsx");
|
|
7554
7476
|
|
|
7555
7477
|
|
|
7556
7478
|
|
|
7557
7479
|
|
|
7558
|
-
var CityPanelItem = function CityPanelItem(props) {
|
|
7559
|
-
var _useContext = Object(react__WEBPACK_IMPORTED_MODULE_1__["useContext"])(_config_provider_ConfigContext__WEBPACK_IMPORTED_MODULE_3__["default"]),
|
|
7560
|
-
getPrefixCls = _useContext.getPrefixCls,
|
|
7561
|
-
prefixCls = _useContext.prefixCls;
|
|
7562
|
-
var city = props.city,
|
|
7563
|
-
onSelect = props.onSelect;
|
|
7564
|
-
var cityPickerPrefixCls = getPrefixCls(prefixCls, 'city-picker');
|
|
7565
|
-
var cls = classnames__WEBPACK_IMPORTED_MODULE_2___default()("".concat(cityPickerPrefixCls, "-city-table-cell"));
|
|
7566
|
-
var handleCitySelect = function handleCitySelect() {
|
|
7567
|
-
onSelect === null || onSelect === void 0 ? void 0 : onSelect(city);
|
|
7568
|
-
};
|
|
7569
|
-
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("div", {
|
|
7570
|
-
className: cls,
|
|
7571
|
-
key: city.id,
|
|
7572
|
-
title: city.name,
|
|
7573
|
-
onClick: handleCitySelect
|
|
7574
|
-
}, city.name);
|
|
7575
|
-
};
|
|
7576
|
-
/* harmony default export */ __webpack_exports__["default"] = (CityPanelItem);
|
|
7577
7480
|
|
|
7578
|
-
/***/ }),
|
|
7579
7481
|
|
|
7580
|
-
/***/ "./components/city-picker/city-panel.tsx":
|
|
7581
|
-
/*!***********************************************!*\
|
|
7582
|
-
!*** ./components/city-picker/city-panel.tsx ***!
|
|
7583
|
-
\***********************************************/
|
|
7584
|
-
/*! exports provided: default */
|
|
7585
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
7586
7482
|
|
|
7587
|
-
"use strict";
|
|
7588
|
-
__webpack_require__.r(__webpack_exports__);
|
|
7589
|
-
/* harmony import */ var _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "./node_modules/@babel/runtime/helpers/slicedToArray.js");
|
|
7590
|
-
/* harmony import */ var _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_0__);
|
|
7591
|
-
/* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.object.to-string.js */ "./node_modules/core-js/modules/es.object.to-string.js");
|
|
7592
|
-
/* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_1__);
|
|
7593
|
-
/* harmony import */ var core_js_modules_web_dom_collections_for_each_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/web.dom-collections.for-each.js */ "./node_modules/core-js/modules/web.dom-collections.for-each.js");
|
|
7594
|
-
/* harmony import */ var core_js_modules_web_dom_collections_for_each_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_web_dom_collections_for_each_js__WEBPACK_IMPORTED_MODULE_2__);
|
|
7595
|
-
/* harmony import */ var core_js_modules_es_array_concat_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.array.concat.js */ "./node_modules/core-js/modules/es.array.concat.js");
|
|
7596
|
-
/* harmony import */ var core_js_modules_es_array_concat_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_concat_js__WEBPACK_IMPORTED_MODULE_3__);
|
|
7597
|
-
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react */ "react");
|
|
7598
|
-
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_4__);
|
|
7599
|
-
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
|
|
7600
|
-
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_5__);
|
|
7601
|
-
/* harmony import */ var _config_provider_ConfigContext__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../config-provider/ConfigContext */ "./components/config-provider/ConfigContext.tsx");
|
|
7602
|
-
/* harmony import */ var _city_group__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./city-group */ "./components/city-picker/city-group.tsx");
|
|
7603
|
-
/* harmony import */ var _city_list__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./city-list */ "./components/city-picker/city-list.tsx");
|
|
7604
|
-
/* harmony import */ var _utils_grouping__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./utils/grouping */ "./components/city-picker/utils/grouping.ts");
|
|
7605
7483
|
|
|
7606
7484
|
|
|
7607
7485
|
|
|
@@ -7612,413 +7490,373 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
7612
7490
|
|
|
7613
7491
|
|
|
7614
7492
|
|
|
7615
|
-
var
|
|
7616
|
-
|
|
7617
|
-
|
|
7618
|
-
|
|
7619
|
-
|
|
7620
|
-
|
|
7493
|
+
var tabsData = [{
|
|
7494
|
+
id: 'domestic',
|
|
7495
|
+
name: '国内'
|
|
7496
|
+
}, {
|
|
7497
|
+
id: 'foreign',
|
|
7498
|
+
name: '国际/中国港澳台'
|
|
7499
|
+
}];
|
|
7500
|
+
var InternalSelect = function InternalSelect(props, ref) {
|
|
7501
|
+
var _classNames3, _classNames5;
|
|
7502
|
+
var _useContext = Object(react__WEBPACK_IMPORTED_MODULE_20__["useContext"])(_config_provider_ConfigContext__WEBPACK_IMPORTED_MODULE_23__["default"]),
|
|
7621
7503
|
getPrefixCls = _useContext.getPrefixCls,
|
|
7622
7504
|
prefixCls = _useContext.prefixCls,
|
|
7623
|
-
|
|
7624
|
-
var
|
|
7625
|
-
|
|
7626
|
-
|
|
7627
|
-
|
|
7628
|
-
|
|
7629
|
-
|
|
7630
|
-
|
|
7631
|
-
|
|
7632
|
-
|
|
7633
|
-
|
|
7505
|
+
userDefaultProps = _useContext.compDefaultProps;
|
|
7506
|
+
var selectProps = Object(_utils__WEBPACK_IMPORTED_MODULE_24__["getCompProps"])('CityPicker', userDefaultProps, props);
|
|
7507
|
+
var type = selectProps.type,
|
|
7508
|
+
size = selectProps.size,
|
|
7509
|
+
value = selectProps.value,
|
|
7510
|
+
className = selectProps.className,
|
|
7511
|
+
defaultOpen = selectProps.defaultOpen,
|
|
7512
|
+
disabled = selectProps.disabled,
|
|
7513
|
+
borderType = selectProps.borderType,
|
|
7514
|
+
_selectProps$showArro = selectProps.showArrow,
|
|
7515
|
+
showArrow = _selectProps$showArro === void 0 ? true : _selectProps$showArro,
|
|
7516
|
+
allowClear = selectProps.allowClear,
|
|
7517
|
+
customPrefixcls = selectProps.prefixCls,
|
|
7518
|
+
onFocus = selectProps.onFocus,
|
|
7519
|
+
onBlur = selectProps.onBlur,
|
|
7520
|
+
onClear = selectProps.onClear,
|
|
7521
|
+
onVisibleChange = selectProps.onVisibleChange,
|
|
7522
|
+
onChange = selectProps.onChange,
|
|
7523
|
+
onSearch = selectProps.onSearch,
|
|
7524
|
+
defaultValue = selectProps.defaultValue,
|
|
7525
|
+
placeholder = selectProps.placeholder,
|
|
7526
|
+
_selectProps$dropdown = selectProps.dropdownStyle,
|
|
7527
|
+
dropdownStyle = _selectProps$dropdown === void 0 ? {} : _selectProps$dropdown,
|
|
7528
|
+
style = selectProps.style,
|
|
7529
|
+
clearIcon = selectProps.clearIcon,
|
|
7530
|
+
loading = selectProps.loading,
|
|
7531
|
+
showDescription = selectProps.showDescription,
|
|
7532
|
+
description = selectProps.description,
|
|
7533
|
+
optionHighlightProps = selectProps.optionHighlightProps,
|
|
7534
|
+
_selectProps$popperSt = selectProps.popperStyle,
|
|
7535
|
+
popperStyle = _selectProps$popperSt === void 0 ? {} : _selectProps$popperSt,
|
|
7536
|
+
_selectProps$commonLi = selectProps.commonList,
|
|
7537
|
+
commonList = _selectProps$commonLi === void 0 ? [] : _selectProps$commonLi,
|
|
7538
|
+
_selectProps$domestic = selectProps.domesticList,
|
|
7539
|
+
domesticList = _selectProps$domestic === void 0 ? [] : _selectProps$domestic,
|
|
7540
|
+
_selectProps$foreignL = selectProps.foreignList,
|
|
7541
|
+
foreignList = _selectProps$foreignL === void 0 ? [] : _selectProps$foreignL,
|
|
7542
|
+
itemRender = selectProps.itemRender;
|
|
7543
|
+
var _useMergedState = Object(_utils_hooks__WEBPACK_IMPORTED_MODULE_21__["useMergedState"])(undefined, {
|
|
7544
|
+
value: value,
|
|
7545
|
+
defaultValue: defaultValue
|
|
7634
7546
|
}),
|
|
7635
|
-
|
|
7636
|
-
|
|
7637
|
-
|
|
7638
|
-
var
|
|
7639
|
-
|
|
7640
|
-
|
|
7641
|
-
|
|
7642
|
-
var
|
|
7643
|
-
|
|
7644
|
-
|
|
7645
|
-
|
|
7646
|
-
|
|
7647
|
-
|
|
7648
|
-
|
|
7649
|
-
|
|
7650
|
-
|
|
7651
|
-
|
|
7652
|
-
|
|
7653
|
-
|
|
7654
|
-
|
|
7655
|
-
|
|
7656
|
-
|
|
7657
|
-
|
|
7658
|
-
|
|
7659
|
-
|
|
7660
|
-
|
|
7661
|
-
|
|
7662
|
-
|
|
7663
|
-
|
|
7664
|
-
|
|
7665
|
-
domestic: domestic,
|
|
7666
|
-
foreign: foreign
|
|
7667
|
-
});
|
|
7668
|
-
}, [groups, commons]);
|
|
7669
|
-
Object(react__WEBPACK_IMPORTED_MODULE_4__["useEffect"])(function () {
|
|
7670
|
-
if (commons) {
|
|
7671
|
-
setList([commons[activedIndex]]);
|
|
7672
|
-
} else {
|
|
7673
|
-
var _groups = cityGroups[activedIndex];
|
|
7674
|
-
var currentGroup = _groups[0];
|
|
7675
|
-
var currentGroups = (currentGroup || '').split('');
|
|
7676
|
-
var newList = [];
|
|
7677
|
-
var currentList = cityList[activedIndex];
|
|
7678
|
-
currentGroups.forEach(function (character) {
|
|
7679
|
-
var temp = currentList[character] ? currentList[character] : [];
|
|
7680
|
-
newList.push(temp);
|
|
7681
|
-
});
|
|
7682
|
-
setList(newList);
|
|
7683
|
-
setGroupKeys(currentGroups);
|
|
7684
|
-
}
|
|
7685
|
-
setActivedGroupIndex(0);
|
|
7686
|
-
}, [activedIndex, cityGroups, groups, cityList]);
|
|
7687
|
-
var cityPickerPrefixCls = getPrefixCls(prefixCls, 'city-picker');
|
|
7688
|
-
var containerCls = classnames__WEBPACK_IMPORTED_MODULE_5___default()("".concat(cityPickerPrefixCls, "-panel-container"));
|
|
7689
|
-
var headerCls = classnames__WEBPACK_IMPORTED_MODULE_5___default()("".concat(cityPickerPrefixCls, "-header"));
|
|
7690
|
-
var contentContainerCls = classnames__WEBPACK_IMPORTED_MODULE_5___default()("".concat(cityPickerPrefixCls, "-content-container"));
|
|
7691
|
-
var domesticCls = classnames__WEBPACK_IMPORTED_MODULE_5___default()("".concat(cityPickerPrefixCls, "-tab-item ").concat(cityPickerPrefixCls, "-header-domestic"), {
|
|
7692
|
-
active: activedIndex === 'domestic'
|
|
7693
|
-
});
|
|
7694
|
-
var internationalCls = classnames__WEBPACK_IMPORTED_MODULE_5___default()("".concat(cityPickerPrefixCls, "-tab-item ").concat(cityPickerPrefixCls, "-header-internation"), {
|
|
7695
|
-
active: activedIndex === 'foreign'
|
|
7696
|
-
});
|
|
7697
|
-
var handleDomesticClick = function handleDomesticClick() {
|
|
7698
|
-
if (activedIndex === 'domestic') return;
|
|
7699
|
-
setActivedIndex('domestic');
|
|
7700
|
-
};
|
|
7701
|
-
var handleInternationClick = function handleInternationClick() {
|
|
7702
|
-
if (activedIndex === 'foreign') return;
|
|
7703
|
-
setActivedIndex('foreign');
|
|
7547
|
+
_useMergedState2 = _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_2___default()(_useMergedState, 2),
|
|
7548
|
+
initValue = _useMergedState2[0],
|
|
7549
|
+
setInitValue = _useMergedState2[1];
|
|
7550
|
+
var innerRef = Object(react__WEBPACK_IMPORTED_MODULE_20__["useRef"])();
|
|
7551
|
+
var selectRef = ref || innerRef;
|
|
7552
|
+
var searchRef = Object(react__WEBPACK_IMPORTED_MODULE_20__["useRef"])(null); // 搜索框ref
|
|
7553
|
+
var selectionRef = Object(react__WEBPACK_IMPORTED_MODULE_20__["useRef"])(null);
|
|
7554
|
+
var clearRef = Object(react__WEBPACK_IMPORTED_MODULE_20__["useRef"])(null);
|
|
7555
|
+
var _useState = Object(react__WEBPACK_IMPORTED_MODULE_20__["useState"])(typeof props.visible === 'undefined' ? !!defaultOpen : !!props.visible),
|
|
7556
|
+
_useState2 = _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_2___default()(_useState, 2),
|
|
7557
|
+
optionShow = _useState2[0],
|
|
7558
|
+
setOptionShow = _useState2[1];
|
|
7559
|
+
var _useState3 = Object(react__WEBPACK_IMPORTED_MODULE_20__["useState"])(''),
|
|
7560
|
+
_useState4 = _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_2___default()(_useState3, 2),
|
|
7561
|
+
searchValue = _useState4[0],
|
|
7562
|
+
setSearchValue = _useState4[1];
|
|
7563
|
+
var _useState5 = Object(react__WEBPACK_IMPORTED_MODULE_20__["useState"])(false),
|
|
7564
|
+
_useState6 = _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_2___default()(_useState5, 2),
|
|
7565
|
+
focusd = _useState6[0],
|
|
7566
|
+
setFocusd = _useState6[1];
|
|
7567
|
+
var _useState7 = Object(react__WEBPACK_IMPORTED_MODULE_20__["useState"])(null),
|
|
7568
|
+
_useState8 = _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_2___default()(_useState7, 2),
|
|
7569
|
+
seletedCity = _useState8[0],
|
|
7570
|
+
setSeletedCity = _useState8[1];
|
|
7571
|
+
var _useState9 = Object(react__WEBPACK_IMPORTED_MODULE_20__["useState"])('domestic'),
|
|
7572
|
+
_useState10 = _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_2___default()(_useState9, 2),
|
|
7573
|
+
tabsValue = _useState10[0],
|
|
7574
|
+
setTabsValue = _useState10[1];
|
|
7575
|
+
var isDomestic = function isDomestic(type) {
|
|
7576
|
+
return type === 'domestic';
|
|
7704
7577
|
};
|
|
7578
|
+
var selectPrefixCls = getPrefixCls(prefixCls, 'city-picker', customPrefixcls);
|
|
7579
|
+
var cityPickerCls = classnames__WEBPACK_IMPORTED_MODULE_22___default()(selectPrefixCls, className, _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1___default()({}, "".concat(selectPrefixCls, "-visible"), optionShow));
|
|
7580
|
+
var selectionCls = classnames__WEBPACK_IMPORTED_MODULE_22___default()(_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1___default()({}, "".concat(selectPrefixCls, "-selector"), true));
|
|
7705
7581
|
|
|
7706
|
-
|
|
7707
|
-
|
|
7708
|
-
|
|
7709
|
-
|
|
7710
|
-
|
|
7711
|
-
|
|
7712
|
-
return;
|
|
7582
|
+
// 公共样式
|
|
7583
|
+
var commCls = classnames__WEBPACK_IMPORTED_MODULE_22___default()((_classNames3 = {}, _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1___default()(_classNames3, "".concat(selectPrefixCls, "-bordered"), borderType === 'bordered'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1___default()(_classNames3, "".concat(selectPrefixCls, "-underline"), borderType === 'underline'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1___default()(_classNames3, "".concat(selectPrefixCls, "-borderless"), borderType === 'none'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1___default()(_classNames3, "".concat(selectPrefixCls, "-size-").concat(size), size), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1___default()(_classNames3, "".concat(selectPrefixCls, "-wrapper"), true), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1___default()(_classNames3, "".concat(selectPrefixCls, "-show-search"), focusd), _classNames3));
|
|
7584
|
+
Object(react__WEBPACK_IMPORTED_MODULE_20__["useEffect"])(function () {
|
|
7585
|
+
if (typeof value === 'undefined') return;
|
|
7586
|
+
var cityList = [].concat(_babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0___default()(commonList), _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0___default()(domesticList), _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0___default()(foreignList));
|
|
7587
|
+
var city = cityList.find(function (city) {
|
|
7588
|
+
return city.id === value;
|
|
7589
|
+
});
|
|
7590
|
+
if (city) {
|
|
7591
|
+
setSeletedCity(city);
|
|
7713
7592
|
}
|
|
7714
|
-
|
|
7715
|
-
|
|
7716
|
-
if (
|
|
7717
|
-
|
|
7718
|
-
setGroupKeys(null);
|
|
7719
|
-
setActivedGroupIndex(index);
|
|
7720
|
-
return;
|
|
7593
|
+
}, [commonList, domesticList, foreignList, value]);
|
|
7594
|
+
Object(react__WEBPACK_IMPORTED_MODULE_20__["useEffect"])(function () {
|
|
7595
|
+
if (typeof props.visible !== 'undefined') {
|
|
7596
|
+
setOptionShow(props.visible);
|
|
7721
7597
|
}
|
|
7722
|
-
|
|
7723
|
-
|
|
7724
|
-
|
|
7725
|
-
|
|
7726
|
-
|
|
7727
|
-
|
|
7598
|
+
}, [props.visible]);
|
|
7599
|
+
Object(react__WEBPACK_IMPORTED_MODULE_20__["useEffect"])(function () {
|
|
7600
|
+
if (optionShow === false) {
|
|
7601
|
+
handleClear();
|
|
7602
|
+
}
|
|
7603
|
+
}, [optionShow]);
|
|
7604
|
+
var handleFocus = Object(react__WEBPACK_IMPORTED_MODULE_20__["useCallback"])(function (e) {
|
|
7605
|
+
e.stopPropagation();
|
|
7606
|
+
setFocusd(true);
|
|
7607
|
+
onFocus && onFocus(e);
|
|
7608
|
+
}, [onFocus]);
|
|
7609
|
+
var handleBlur = Object(react__WEBPACK_IMPORTED_MODULE_20__["useCallback"])(function (e) {
|
|
7610
|
+
e.stopPropagation();
|
|
7611
|
+
setFocusd(false);
|
|
7612
|
+
onBlur && onBlur(e);
|
|
7613
|
+
}, [onBlur]);
|
|
7614
|
+
Object(react__WEBPACK_IMPORTED_MODULE_20__["useEffect"])(function () {
|
|
7615
|
+
selectionRef.current.addEventListener('mouseup', function (e) {
|
|
7616
|
+
var _e$target;
|
|
7617
|
+
var isCloseBtn = (e === null || e === void 0 ? void 0 : (_e$target = e.target) === null || _e$target === void 0 ? void 0 : _e$target.className.indexOf('kd-tag-close-icon')) > -1;
|
|
7618
|
+
if (isCloseBtn) {
|
|
7619
|
+
e.stopPropagation();
|
|
7620
|
+
}
|
|
7728
7621
|
});
|
|
7729
|
-
|
|
7730
|
-
setGroupKeys(currentGroups);
|
|
7731
|
-
setActivedGroupIndex(index);
|
|
7732
|
-
};
|
|
7733
|
-
var handleSelectCity = function handleSelectCity(city) {
|
|
7734
|
-
onSelect === null || onSelect === void 0 ? void 0 : onSelect(city);
|
|
7735
|
-
};
|
|
7736
|
-
var isClassified = commons && commons.domestic && commons.foreign;
|
|
7737
|
-
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default.a.createElement("div", {
|
|
7738
|
-
className: containerCls
|
|
7739
|
-
}, isClassified && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default.a.createElement("div", {
|
|
7740
|
-
className: headerCls
|
|
7741
|
-
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default.a.createElement("div", {
|
|
7742
|
-
className: domesticCls,
|
|
7743
|
-
onClick: handleDomesticClick
|
|
7744
|
-
}, cityPickerLang.domestic), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default.a.createElement("div", {
|
|
7745
|
-
className: internationalCls,
|
|
7746
|
-
onClick: handleInternationClick
|
|
7747
|
-
}, cityPickerLang.internation)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default.a.createElement("div", {
|
|
7748
|
-
className: contentContainerCls
|
|
7749
|
-
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default.a.createElement(_city_group__WEBPACK_IMPORTED_MODULE_7__["default"], {
|
|
7750
|
-
groups: cityGroups[activedIndex],
|
|
7751
|
-
activedIndex: activedGroupIndex,
|
|
7752
|
-
changeIndex: handleGroupChange
|
|
7753
|
-
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default.a.createElement(_city_list__WEBPACK_IMPORTED_MODULE_8__["default"], {
|
|
7754
|
-
groupKeys: groupKeys,
|
|
7755
|
-
cityList: list,
|
|
7756
|
-
onSelect: handleSelectCity
|
|
7757
|
-
})));
|
|
7758
|
-
};
|
|
7759
|
-
/* harmony default export */ __webpack_exports__["default"] = (CityPanel);
|
|
7760
|
-
|
|
7761
|
-
/***/ }),
|
|
7762
|
-
|
|
7763
|
-
/***/ "./components/city-picker/city-picker.tsx":
|
|
7764
|
-
/*!************************************************!*\
|
|
7765
|
-
!*** ./components/city-picker/city-picker.tsx ***!
|
|
7766
|
-
\************************************************/
|
|
7767
|
-
/*! exports provided: default */
|
|
7768
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
7769
|
-
|
|
7770
|
-
"use strict";
|
|
7771
|
-
__webpack_require__.r(__webpack_exports__);
|
|
7772
|
-
/* harmony import */ var _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/toConsumableArray */ "./node_modules/@babel/runtime/helpers/toConsumableArray.js");
|
|
7773
|
-
/* harmony import */ var _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__);
|
|
7774
|
-
/* harmony import */ var _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "./node_modules/@babel/runtime/helpers/slicedToArray.js");
|
|
7775
|
-
/* harmony import */ var _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_1__);
|
|
7776
|
-
/* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.object.to-string.js */ "./node_modules/core-js/modules/es.object.to-string.js");
|
|
7777
|
-
/* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_2__);
|
|
7778
|
-
/* harmony import */ var core_js_modules_es_array_concat_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.array.concat.js */ "./node_modules/core-js/modules/es.array.concat.js");
|
|
7779
|
-
/* harmony import */ var core_js_modules_es_array_concat_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_concat_js__WEBPACK_IMPORTED_MODULE_3__);
|
|
7780
|
-
/* harmony import */ var core_js_modules_es_object_values_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/es.object.values.js */ "./node_modules/core-js/modules/es.object.values.js");
|
|
7781
|
-
/* harmony import */ var core_js_modules_es_object_values_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_object_values_js__WEBPACK_IMPORTED_MODULE_4__);
|
|
7782
|
-
/* harmony import */ var core_js_modules_es_function_name_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/es.function.name.js */ "./node_modules/core-js/modules/es.function.name.js");
|
|
7783
|
-
/* harmony import */ var core_js_modules_es_function_name_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_function_name_js__WEBPACK_IMPORTED_MODULE_5__);
|
|
7784
|
-
/* harmony import */ var core_js_modules_es_array_filter_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! core-js/modules/es.array.filter.js */ "./node_modules/core-js/modules/es.array.filter.js");
|
|
7785
|
-
/* harmony import */ var core_js_modules_es_array_filter_js__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_filter_js__WEBPACK_IMPORTED_MODULE_6__);
|
|
7786
|
-
/* harmony import */ var core_js_modules_es_string_starts_with_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! core-js/modules/es.string.starts-with.js */ "./node_modules/core-js/modules/es.string.starts-with.js");
|
|
7787
|
-
/* harmony import */ var core_js_modules_es_string_starts_with_js__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_string_starts_with_js__WEBPACK_IMPORTED_MODULE_7__);
|
|
7788
|
-
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! react */ "react");
|
|
7789
|
-
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_8__);
|
|
7790
|
-
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
|
|
7791
|
-
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_9__);
|
|
7792
|
-
/* harmony import */ var _config_provider_ConfigContext__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../config-provider/ConfigContext */ "./components/config-provider/ConfigContext.tsx");
|
|
7793
|
-
/* harmony import */ var _city_panel_item__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./city-panel-item */ "./components/city-picker/city-panel-item.tsx");
|
|
7794
|
-
/* harmony import */ var _city_panel__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./city-panel */ "./components/city-picker/city-panel.tsx");
|
|
7795
|
-
/* harmony import */ var _city_search_panel__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./city-search-panel */ "./components/city-picker/city-search-panel.tsx");
|
|
7796
|
-
/* harmony import */ var _utils_usePopper__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../_utils/usePopper */ "./components/_utils/usePopper.tsx");
|
|
7797
|
-
|
|
7798
|
-
|
|
7799
|
-
|
|
7800
|
-
|
|
7801
|
-
|
|
7802
|
-
|
|
7803
|
-
|
|
7804
|
-
|
|
7805
|
-
|
|
7806
|
-
|
|
7622
|
+
}, []);
|
|
7807
7623
|
|
|
7624
|
+
// 输入框变化搜索内容
|
|
7625
|
+
var handleSearchChange = Object(react__WEBPACK_IMPORTED_MODULE_20__["useCallback"])(function (event) {
|
|
7626
|
+
var val = event.currentTarget.value;
|
|
7627
|
+
setOptionShow(true);
|
|
7628
|
+
setSearchValue(val);
|
|
7629
|
+
onSearch === null || onSearch === void 0 ? void 0 : onSearch(val);
|
|
7630
|
+
}, [onSearch]);
|
|
7808
7631
|
|
|
7632
|
+
// 清除搜索内容
|
|
7633
|
+
var handleClear = Object(react__WEBPACK_IMPORTED_MODULE_20__["useCallback"])(function () {
|
|
7634
|
+
if (searchRef.current) {
|
|
7635
|
+
searchRef.current.value = '';
|
|
7636
|
+
setSearchValue('');
|
|
7637
|
+
}
|
|
7638
|
+
}, [searchRef]);
|
|
7809
7639
|
|
|
7640
|
+
// 清空选择器内容
|
|
7641
|
+
var handleReset = function handleReset(e) {
|
|
7642
|
+
e.stopPropagation();
|
|
7643
|
+
onClear && onClear('');
|
|
7644
|
+
setInitValue('');
|
|
7645
|
+
setSeletedCity(null);
|
|
7646
|
+
setSearchValue('');
|
|
7647
|
+
onChange && onChange(undefined, '');
|
|
7648
|
+
};
|
|
7810
7649
|
|
|
7650
|
+
// 渲染后缀图标
|
|
7651
|
+
var renderSuffix = function renderSuffix() {
|
|
7652
|
+
var _classNames4;
|
|
7653
|
+
if (disabled) return null;
|
|
7654
|
+
var suffixIcon = selectProps.suffixIcon;
|
|
7655
|
+
var arrowIconCls = classnames__WEBPACK_IMPORTED_MODULE_22___default()((_classNames4 = {}, _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1___default()(_classNames4, "".concat(selectPrefixCls, "-icon-arrow"), true), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1___default()(_classNames4, "".concat(selectPrefixCls, "-icon-arrow-up"), optionShow), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1___default()(_classNames4, "".concat(selectPrefixCls, "-icon-arrow-down"), !optionShow), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1___default()(_classNames4, "".concat(selectPrefixCls, "-icon-arrow-focus"), optionShow), _classNames4));
|
|
7656
|
+
var iconShow = allowClear && !disabled && ((initValue !== null && initValue !== void 0 ? initValue : '') !== '' || searchValue);
|
|
7657
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_20___default.a.createElement(react__WEBPACK_IMPORTED_MODULE_20___default.a.Fragment, null, iconShow && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_20___default.a.createElement("span", {
|
|
7658
|
+
onClick: handleReset,
|
|
7659
|
+
onMouseDown: function onMouseDown(e) {
|
|
7660
|
+
return e.preventDefault();
|
|
7661
|
+
},
|
|
7662
|
+
className: "".concat(selectPrefixCls, "-icon-clear"),
|
|
7663
|
+
ref: clearRef
|
|
7664
|
+
}, clearIcon || /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_20___default.a.createElement(_index__WEBPACK_IMPORTED_MODULE_25__["Icon"], {
|
|
7665
|
+
type: "close-solid"
|
|
7666
|
+
})), showArrow && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_20___default.a.createElement("span", {
|
|
7667
|
+
className: arrowIconCls
|
|
7668
|
+
}, suffixIcon || /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_20___default.a.createElement(_index__WEBPACK_IMPORTED_MODULE_25__["Icon"], {
|
|
7669
|
+
type: "arrow-down"
|
|
7670
|
+
})));
|
|
7671
|
+
};
|
|
7811
7672
|
|
|
7812
|
-
|
|
7813
|
-
var
|
|
7814
|
-
|
|
7815
|
-
|
|
7816
|
-
|
|
7817
|
-
|
|
7818
|
-
|
|
7819
|
-
|
|
7820
|
-
|
|
7821
|
-
|
|
7822
|
-
|
|
7823
|
-
|
|
7824
|
-
|
|
7825
|
-
|
|
7826
|
-
|
|
7827
|
-
|
|
7828
|
-
|
|
7829
|
-
|
|
7830
|
-
|
|
7831
|
-
|
|
7832
|
-
|
|
7833
|
-
|
|
7834
|
-
|
|
7835
|
-
var
|
|
7836
|
-
|
|
7837
|
-
|
|
7838
|
-
|
|
7839
|
-
|
|
7840
|
-
|
|
7841
|
-
Object(react__WEBPACK_IMPORTED_MODULE_8__["useEffect"])(function () {
|
|
7842
|
-
if (!cityList) {
|
|
7843
|
-
return;
|
|
7673
|
+
// 下拉列表为空时显示的内容
|
|
7674
|
+
var renderNotContent = function renderNotContent(msg) {
|
|
7675
|
+
var notFoundContent = selectProps.notFoundContent;
|
|
7676
|
+
var emptyContent = notFoundContent || msg;
|
|
7677
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_20___default.a.createElement("div", {
|
|
7678
|
+
className: "".concat(selectPrefixCls, "-dropdown-empty")
|
|
7679
|
+
}, emptyContent);
|
|
7680
|
+
};
|
|
7681
|
+
var getHighlightText = function getHighlightText(text, inputValue) {
|
|
7682
|
+
if (!inputValue || !text) return text;
|
|
7683
|
+
var regex = new RegExp(Array.isArray(inputValue) ? inputValue.map(function (item) {
|
|
7684
|
+
return "(".concat(lodash_escapeRegExp__WEBPACK_IMPORTED_MODULE_28___default()(item), ")");
|
|
7685
|
+
}).join('|') : "(".concat(lodash_escapeRegExp__WEBPACK_IMPORTED_MODULE_28___default()(inputValue), ")"), 'i');
|
|
7686
|
+
var strArr = text === null || text === void 0 ? void 0 : text.split(regex);
|
|
7687
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_20___default.a.createElement(react__WEBPACK_IMPORTED_MODULE_20___default.a.Fragment, null, strArr === null || strArr === void 0 ? void 0 : strArr.map(function (item, index) {
|
|
7688
|
+
return regex !== null && regex !== void 0 && regex.test(item) ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_20___default.a.createElement("span", {
|
|
7689
|
+
key: index,
|
|
7690
|
+
className: "".concat(selectPrefixCls, "-highlight")
|
|
7691
|
+
}, item) : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_20___default.a.createElement("span", {
|
|
7692
|
+
key: index
|
|
7693
|
+
}, item);
|
|
7694
|
+
}));
|
|
7695
|
+
};
|
|
7696
|
+
var handleOption = function handleOption(city) {
|
|
7697
|
+
handleVisibleChange(false);
|
|
7698
|
+
(city === null || city === void 0 ? void 0 : city.id) !== initValue && (onChange === null || onChange === void 0 ? void 0 : onChange(city === null || city === void 0 ? void 0 : city.id, city));
|
|
7699
|
+
if (typeof value === 'undefined') {
|
|
7700
|
+
setSeletedCity(city);
|
|
7701
|
+
setInitValue(city === null || city === void 0 ? void 0 : city.id);
|
|
7844
7702
|
}
|
|
7845
|
-
|
|
7846
|
-
|
|
7847
|
-
|
|
7848
|
-
return
|
|
7849
|
-
}, []);
|
|
7850
|
-
}, [cityList]);
|
|
7851
|
-
var cityPickerPrefixCls = getPrefixCls(prefixCls, 'city-picker');
|
|
7852
|
-
var containerCls = classnames__WEBPACK_IMPORTED_MODULE_9___default()("".concat(cityPickerPrefixCls, "-container"), className);
|
|
7853
|
-
var contentCls = classnames__WEBPACK_IMPORTED_MODULE_9___default()("".concat(cityPickerPrefixCls, "-content"));
|
|
7854
|
-
var titleCls = classnames__WEBPACK_IMPORTED_MODULE_9___default()("".concat(cityPickerPrefixCls, "-title"));
|
|
7855
|
-
var additionalInfoCls = classnames__WEBPACK_IMPORTED_MODULE_9___default()("".concat(cityPickerPrefixCls, "-info"));
|
|
7856
|
-
var inputCls = classnames__WEBPACK_IMPORTED_MODULE_9___default()("".concat(cityPickerPrefixCls, "-input"), inputClassName);
|
|
7857
|
-
var arrowCls = classnames__WEBPACK_IMPORTED_MODULE_9___default()('kdicon kdicon-arrow-down', "".concat(cityPickerPrefixCls, "-arrow"), {
|
|
7858
|
-
'arrow-up': popperVisible
|
|
7859
|
-
});
|
|
7860
|
-
var handleContainerClick = function handleContainerClick() {
|
|
7861
|
-
var _inputRef$current;
|
|
7862
|
-
if (document.activeElement === inputRef.current) {
|
|
7863
|
-
return;
|
|
7703
|
+
};
|
|
7704
|
+
var renderNodeList = function renderNodeList(data, notContent) {
|
|
7705
|
+
if (!data.length) {
|
|
7706
|
+
return renderNotContent(notContent);
|
|
7864
7707
|
}
|
|
7865
|
-
|
|
7708
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_20___default.a.createElement("div", {
|
|
7709
|
+
className: "".concat(selectPrefixCls, "-list")
|
|
7710
|
+
}, data.map(function (item) {
|
|
7711
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_20___default.a.createElement(_option__WEBPACK_IMPORTED_MODULE_27__["default"], {
|
|
7712
|
+
key: item.id,
|
|
7713
|
+
value: initValue,
|
|
7714
|
+
city: item,
|
|
7715
|
+
renderCityInfo: renderCityInfo,
|
|
7716
|
+
onChangeSelect: handleOption,
|
|
7717
|
+
itemRender: itemRender
|
|
7718
|
+
}, searchValue ? getHighlightText(item === null || item === void 0 ? void 0 : item.name, (item === null || item === void 0 ? void 0 : item[optionHighlightProps]) || searchValue) : item === null || item === void 0 ? void 0 : item.name);
|
|
7719
|
+
}));
|
|
7866
7720
|
};
|
|
7867
|
-
var
|
|
7868
|
-
|
|
7869
|
-
|
|
7870
|
-
|
|
7871
|
-
|
|
7721
|
+
var renderLoading = function renderLoading() {
|
|
7722
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_20___default.a.createElement("div", {
|
|
7723
|
+
className: "".concat(selectPrefixCls, "-dropdown-loading")
|
|
7724
|
+
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_20___default.a.createElement(_index__WEBPACK_IMPORTED_MODULE_25__["Spin"], {
|
|
7725
|
+
type: "container"
|
|
7726
|
+
}));
|
|
7872
7727
|
};
|
|
7873
|
-
var
|
|
7874
|
-
|
|
7875
|
-
|
|
7728
|
+
var toggleTabPane = function toggleTabPane(type) {
|
|
7729
|
+
setTabsValue(type);
|
|
7730
|
+
};
|
|
7731
|
+
|
|
7732
|
+
// 渲染下拉列表框
|
|
7733
|
+
var renderContent = function renderContent() {
|
|
7734
|
+
return loading ? renderLoading() : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_20___default.a.createElement(react__WEBPACK_IMPORTED_MODULE_20___default.a.Fragment, null, searchValue ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_20___default.a.createElement(react__WEBPACK_IMPORTED_MODULE_20___default.a.Fragment, null, isDomestic(type) && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_20___default.a.createElement(_index__WEBPACK_IMPORTED_MODULE_25__["Tabs"], {
|
|
7735
|
+
noContainer: true,
|
|
7736
|
+
onChange: toggleTabPane,
|
|
7737
|
+
activeKey: tabsValue
|
|
7738
|
+
}, tabsData.map(function (item) {
|
|
7739
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_20___default.a.createElement(_index__WEBPACK_IMPORTED_MODULE_25__["Tabs"].TabPane, {
|
|
7740
|
+
key: item.id,
|
|
7741
|
+
tab: item.name
|
|
7742
|
+
}, item);
|
|
7743
|
+
})), tabsValue === 'domestic' ? renderNodeList(domesticList, '暂无数据') : renderNodeList(foreignList, '暂无数据')) : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_20___default.a.createElement(react__WEBPACK_IMPORTED_MODULE_20___default.a.Fragment, null, !!commonList.length && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_20___default.a.createElement("div", {
|
|
7744
|
+
className: "".concat(selectPrefixCls, "-dropdown-common")
|
|
7745
|
+
}, "\u5E38\u7528"), renderNodeList(commonList, '无常用城市')));
|
|
7746
|
+
};
|
|
7747
|
+
var renderCityInfo = Object(react__WEBPACK_IMPORTED_MODULE_20__["useCallback"])(function (data) {
|
|
7748
|
+
var flag = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
7749
|
+
var symbol = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : ', ';
|
|
7750
|
+
if (!data) return null;
|
|
7751
|
+
if (isDomestic(type)) {
|
|
7752
|
+
return "".concat(flag && data !== null && data !== void 0 && data.province ? symbol : '').concat(data === null || data === void 0 ? void 0 : data.province);
|
|
7753
|
+
} else {
|
|
7754
|
+
return "".concat(flag && data !== null && data !== void 0 && data.province ? symbol : '').concat(data === null || data === void 0 ? void 0 : data.province).concat(data !== null && data !== void 0 && data.country ? symbol : '').concat(data === null || data === void 0 ? void 0 : data.country);
|
|
7876
7755
|
}
|
|
7877
|
-
|
|
7756
|
+
}, [type]);
|
|
7757
|
+
var renderSingle = function renderSingle() {
|
|
7758
|
+
var hiddenStyle = !!searchValue || (initValue !== null && initValue !== void 0 ? initValue : '') !== '' ? {
|
|
7759
|
+
visibility: 'hidden'
|
|
7760
|
+
} : undefined;
|
|
7761
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_20___default.a.createElement(react__WEBPACK_IMPORTED_MODULE_20___default.a.Fragment, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_20___default.a.createElement("div", {
|
|
7762
|
+
className: singleCls,
|
|
7763
|
+
ref: selectionRef
|
|
7764
|
+
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_20___default.a.createElement("div", {
|
|
7765
|
+
className: "".concat(selectPrefixCls, "-content")
|
|
7766
|
+
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_20___default.a.createElement("span", {
|
|
7767
|
+
className: "".concat(selectPrefixCls, "-content-search")
|
|
7768
|
+
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_20___default.a.createElement("input", {
|
|
7769
|
+
ref: searchRef,
|
|
7770
|
+
value: searchValue,
|
|
7771
|
+
className: "".concat(selectPrefixCls, "-content-search-input"),
|
|
7772
|
+
onChange: handleSearchChange,
|
|
7773
|
+
onFocus: handleFocus,
|
|
7774
|
+
onBlur: handleBlur,
|
|
7775
|
+
readOnly: !!disabled
|
|
7776
|
+
}), !searchValue && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_20___default.a.createElement("span", {
|
|
7777
|
+
className: "".concat(selectPrefixCls, "-content-item"),
|
|
7778
|
+
title: seletedCity === null || seletedCity === void 0 ? void 0 : seletedCity.name
|
|
7779
|
+
}, seletedCity === null || seletedCity === void 0 ? void 0 : seletedCity.name)), !searchValue && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_20___default.a.createElement("span", {
|
|
7780
|
+
className: "".concat(selectPrefixCls, "-content-info")
|
|
7781
|
+
}, renderCityInfo(seletedCity))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_20___default.a.createElement("span", {
|
|
7782
|
+
className: "".concat(selectPrefixCls, "-placeholder"),
|
|
7783
|
+
style: hiddenStyle
|
|
7784
|
+
}, placeholder), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_20___default.a.createElement("span", {
|
|
7785
|
+
className: "".concat(selectPrefixCls, "-suffix")
|
|
7786
|
+
}, renderSuffix())));
|
|
7878
7787
|
};
|
|
7879
|
-
var
|
|
7880
|
-
|
|
7881
|
-
|
|
7882
|
-
|
|
7788
|
+
var singleCls = classnames__WEBPACK_IMPORTED_MODULE_22___default()(commCls, (_classNames5 = {}, _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1___default()(_classNames5, "".concat(selectPrefixCls, "-disabled"), disabled), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1___default()(_classNames5, "".concat(selectPrefixCls, "-focused"), !disabled && focusd || optionShow), _classNames5));
|
|
7789
|
+
Object(react__WEBPACK_IMPORTED_MODULE_20__["useEffect"])(function () {
|
|
7790
|
+
if (optionShow && !disabled) {
|
|
7791
|
+
var onDropdownVisibleChange = selectProps.onDropdownVisibleChange;
|
|
7792
|
+
onDropdownVisibleChange && onDropdownVisibleChange(true);
|
|
7793
|
+
}
|
|
7794
|
+
}, [optionShow]);
|
|
7795
|
+
Object(react__WEBPACK_IMPORTED_MODULE_20__["useEffect"])(function () {
|
|
7796
|
+
var _clearRef$current;
|
|
7797
|
+
var fn = function fn(e) {
|
|
7798
|
+
e.stopPropagation();
|
|
7799
|
+
};
|
|
7800
|
+
(_clearRef$current = clearRef.current) === null || _clearRef$current === void 0 ? void 0 : _clearRef$current.addEventListener('mouseup', fn);
|
|
7801
|
+
return function () {
|
|
7802
|
+
var _clearRef$current2;
|
|
7803
|
+
(_clearRef$current2 = clearRef.current) === null || _clearRef$current2 === void 0 ? void 0 : _clearRef$current2.removeEventListener('mouseup', fn);
|
|
7804
|
+
};
|
|
7805
|
+
}, [initValue]);
|
|
7806
|
+
var renderCityPicker = function renderCityPicker() {
|
|
7807
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_20___default.a.createElement("div", {
|
|
7808
|
+
className: cityPickerCls,
|
|
7809
|
+
ref: selectRef,
|
|
7810
|
+
style: style
|
|
7811
|
+
}, showDescription && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_20___default.a.createElement("span", {
|
|
7812
|
+
className: "".concat(selectPrefixCls, "-description")
|
|
7813
|
+
}, description), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_20___default.a.createElement("span", {
|
|
7814
|
+
className: selectionCls,
|
|
7815
|
+
tabIndex: disabled ? -1 : 0,
|
|
7816
|
+
onFocus: function onFocus() {
|
|
7817
|
+
var _searchRef$current;
|
|
7818
|
+
return (_searchRef$current = searchRef.current) === null || _searchRef$current === void 0 ? void 0 : _searchRef$current.focus();
|
|
7819
|
+
},
|
|
7820
|
+
onBlur: function onBlur() {
|
|
7821
|
+
var _searchRef$current2;
|
|
7822
|
+
return (_searchRef$current2 = searchRef.current) === null || _searchRef$current2 === void 0 ? void 0 : _searchRef$current2.blur();
|
|
7823
|
+
}
|
|
7824
|
+
}, renderSingle()));
|
|
7883
7825
|
};
|
|
7884
|
-
var
|
|
7885
|
-
if (
|
|
7886
|
-
|
|
7826
|
+
var catchStyle = function catchStyle() {
|
|
7827
|
+
if (selectRef !== null && selectRef !== void 0 && selectRef.current) {
|
|
7828
|
+
var _selectRef$current;
|
|
7829
|
+
var _selectRef$current$ge = (_selectRef$current = selectRef.current) === null || _selectRef$current === void 0 ? void 0 : _selectRef$current.getBoundingClientRect(),
|
|
7830
|
+
width = _selectRef$current$ge.width;
|
|
7831
|
+
return _objectSpread(_objectSpread({
|
|
7832
|
+
minWidth: width,
|
|
7833
|
+
maxWidth: 600
|
|
7834
|
+
}, dropdownStyle), {}, {
|
|
7835
|
+
width: (dropdownStyle === null || dropdownStyle === void 0 ? void 0 : dropdownStyle.width) || 'auto',
|
|
7836
|
+
zIndex: 1050
|
|
7837
|
+
}, popperStyle);
|
|
7887
7838
|
}
|
|
7888
7839
|
};
|
|
7889
|
-
var
|
|
7890
|
-
|
|
7891
|
-
|
|
7892
|
-
|
|
7893
|
-
}, showTitle && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_8___default.a.createElement("div", {
|
|
7894
|
-
className: titleCls
|
|
7895
|
-
}, title), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_8___default.a.createElement("div", {
|
|
7896
|
-
className: contentCls
|
|
7897
|
-
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_8___default.a.createElement("input", {
|
|
7898
|
-
ref: inputRef,
|
|
7899
|
-
type: "text",
|
|
7900
|
-
readOnly: disabled,
|
|
7901
|
-
onChange: handleChange,
|
|
7902
|
-
placeholder: placeholder,
|
|
7903
|
-
style: inputStyle,
|
|
7904
|
-
className: inputCls,
|
|
7905
|
-
title: inputVal,
|
|
7906
|
-
value: inputVal,
|
|
7907
|
-
onFocus: handleFocus
|
|
7908
|
-
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_8___default.a.createElement("span", {
|
|
7909
|
-
className: additionalInfoCls
|
|
7910
|
-
}, additionalVal), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_8___default.a.createElement("i", {
|
|
7911
|
-
className: arrowCls
|
|
7912
|
-
})));
|
|
7913
|
-
var cityPanel = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_8___default.a.createElement(_city_panel__WEBPACK_IMPORTED_MODULE_12__["default"], {
|
|
7914
|
-
commons: commons,
|
|
7915
|
-
groups: groups,
|
|
7916
|
-
cityList: cityList,
|
|
7917
|
-
onSelect: handleCitySelect
|
|
7918
|
-
});
|
|
7919
|
-
var getSearchResults = function getSearchResults() {
|
|
7920
|
-
if (!allCity.current || allCity.current.length === 0 || !inputVal) {
|
|
7921
|
-
return [];
|
|
7840
|
+
var handleVisibleChange = function handleVisibleChange(visible) {
|
|
7841
|
+
if (visible !== optionShow) {
|
|
7842
|
+
props.visible === undefined && setOptionShow(visible);
|
|
7843
|
+
onVisibleChange && onVisibleChange(visible);
|
|
7922
7844
|
}
|
|
7923
|
-
return allCity.current.filter(function (city) {
|
|
7924
|
-
var _city$name;
|
|
7925
|
-
return (_city$name = city.name) === null || _city$name === void 0 ? void 0 : _city$name.startsWith(inputVal);
|
|
7926
|
-
});
|
|
7927
7845
|
};
|
|
7928
|
-
var
|
|
7929
|
-
|
|
7930
|
-
data: getSearchResults(),
|
|
7931
|
-
onSelect: handleCitySelect
|
|
7932
|
-
});
|
|
7933
|
-
var popperProps = {
|
|
7934
|
-
visible: popperVisible,
|
|
7846
|
+
var popperProps = _objectSpread(_objectSpread({}, selectProps), {}, {
|
|
7847
|
+
prefixCls: "".concat(selectPrefixCls, "-dropdown"),
|
|
7935
7848
|
placement: 'bottomLeft',
|
|
7936
|
-
|
|
7937
|
-
|
|
7938
|
-
|
|
7939
|
-
|
|
7940
|
-
|
|
7941
|
-
|
|
7942
|
-
|
|
7943
|
-
CityPicker.displayName = 'CityPicker';
|
|
7944
|
-
CityPicker.PanelItem = _city_panel_item__WEBPACK_IMPORTED_MODULE_11__["default"];
|
|
7945
|
-
CityPicker.Panel = _city_panel__WEBPACK_IMPORTED_MODULE_12__["default"];
|
|
7946
|
-
CityPicker.SearchPanel = _city_search_panel__WEBPACK_IMPORTED_MODULE_13__["default"];
|
|
7947
|
-
/* harmony default export */ __webpack_exports__["default"] = (CityPicker);
|
|
7948
|
-
|
|
7949
|
-
/***/ }),
|
|
7950
|
-
|
|
7951
|
-
/***/ "./components/city-picker/city-search-panel.tsx":
|
|
7952
|
-
/*!******************************************************!*\
|
|
7953
|
-
!*** ./components/city-picker/city-search-panel.tsx ***!
|
|
7954
|
-
\******************************************************/
|
|
7955
|
-
/*! exports provided: default */
|
|
7956
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
7957
|
-
|
|
7958
|
-
"use strict";
|
|
7959
|
-
__webpack_require__.r(__webpack_exports__);
|
|
7960
|
-
/* harmony import */ var core_js_modules_es_array_map_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.map.js */ "./node_modules/core-js/modules/es.array.map.js");
|
|
7961
|
-
/* harmony import */ var core_js_modules_es_array_map_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_map_js__WEBPACK_IMPORTED_MODULE_0__);
|
|
7962
|
-
/* harmony import */ var core_js_modules_es_regexp_exec_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.regexp.exec.js */ "./node_modules/core-js/modules/es.regexp.exec.js");
|
|
7963
|
-
/* harmony import */ var core_js_modules_es_regexp_exec_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_regexp_exec_js__WEBPACK_IMPORTED_MODULE_1__);
|
|
7964
|
-
/* harmony import */ var core_js_modules_es_string_replace_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.string.replace.js */ "./node_modules/core-js/modules/es.string.replace.js");
|
|
7965
|
-
/* harmony import */ var core_js_modules_es_string_replace_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_string_replace_js__WEBPACK_IMPORTED_MODULE_2__);
|
|
7966
|
-
/* harmony import */ var core_js_modules_es_function_name_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.function.name.js */ "./node_modules/core-js/modules/es.function.name.js");
|
|
7967
|
-
/* harmony import */ var core_js_modules_es_function_name_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_function_name_js__WEBPACK_IMPORTED_MODULE_3__);
|
|
7968
|
-
/* harmony import */ var core_js_modules_es_array_concat_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/es.array.concat.js */ "./node_modules/core-js/modules/es.array.concat.js");
|
|
7969
|
-
/* harmony import */ var core_js_modules_es_array_concat_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_concat_js__WEBPACK_IMPORTED_MODULE_4__);
|
|
7970
|
-
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react */ "react");
|
|
7971
|
-
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_5__);
|
|
7972
|
-
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
|
|
7973
|
-
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_6__);
|
|
7974
|
-
/* harmony import */ var _config_provider_ConfigContext__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../config-provider/ConfigContext */ "./components/config-provider/ConfigContext.tsx");
|
|
7975
|
-
/* harmony import */ var _no_data__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./no-data */ "./components/city-picker/no-data.tsx");
|
|
7976
|
-
|
|
7977
|
-
|
|
7978
|
-
|
|
7979
|
-
|
|
7980
|
-
|
|
7981
|
-
|
|
7982
|
-
|
|
7983
|
-
|
|
7984
|
-
|
|
7985
|
-
var SearchPanel = function SearchPanel(_ref) {
|
|
7986
|
-
var _ref$data = _ref.data,
|
|
7987
|
-
data = _ref$data === void 0 ? [] : _ref$data,
|
|
7988
|
-
_ref$keyword = _ref.keyword,
|
|
7989
|
-
keyword = _ref$keyword === void 0 ? '' : _ref$keyword,
|
|
7990
|
-
handleSelect = _ref.onSelect;
|
|
7991
|
-
var _useContext = Object(react__WEBPACK_IMPORTED_MODULE_5__["useContext"])(_config_provider_ConfigContext__WEBPACK_IMPORTED_MODULE_7__["default"]),
|
|
7992
|
-
getPrefixCls = _useContext.getPrefixCls,
|
|
7993
|
-
prefixCls = _useContext.prefixCls;
|
|
7994
|
-
var cityPickerPrefixCls = getPrefixCls(prefixCls, 'city-picker');
|
|
7995
|
-
var containerCls = classnames__WEBPACK_IMPORTED_MODULE_6___default()("".concat(cityPickerPrefixCls, "-search-panel"));
|
|
7996
|
-
var hasData = data && data.length > 0;
|
|
7997
|
-
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement("div", {
|
|
7998
|
-
className: containerCls
|
|
7999
|
-
}, hasData ? data.map(function (city) {
|
|
8000
|
-
var itemContainerCls = classnames__WEBPACK_IMPORTED_MODULE_6___default()("".concat(cityPickerPrefixCls, "-search-panel-item"));
|
|
8001
|
-
var itemLeftCls = classnames__WEBPACK_IMPORTED_MODULE_6___default()("".concat(cityPickerPrefixCls, "-search-panel-item-left"));
|
|
8002
|
-
var itemRightCls = classnames__WEBPACK_IMPORTED_MODULE_6___default()("".concat(cityPickerPrefixCls, "-search-panel-item-right"));
|
|
8003
|
-
var handleClick = function handleClick() {
|
|
8004
|
-
handleSelect === null || handleSelect === void 0 ? void 0 : handleSelect(city);
|
|
8005
|
-
};
|
|
8006
|
-
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement("div", {
|
|
8007
|
-
className: itemContainerCls,
|
|
8008
|
-
onClick: handleClick,
|
|
8009
|
-
key: city.id
|
|
8010
|
-
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement("div", {
|
|
8011
|
-
className: itemLeftCls
|
|
8012
|
-
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement("span", {
|
|
8013
|
-
dangerouslySetInnerHTML: {
|
|
8014
|
-
__html: city.name.replace(keyword, "<span class=\"".concat(cityPickerPrefixCls, "-search-keyword\">").concat(keyword, "</span>"))
|
|
8015
|
-
}
|
|
8016
|
-
})), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement("div", {
|
|
8017
|
-
className: itemRightCls
|
|
8018
|
-
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement("span", null, city.province), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement("span", null, city.country === '中国' ? '' : city.country)));
|
|
8019
|
-
}) : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement(_no_data__WEBPACK_IMPORTED_MODULE_8__["default"], null));
|
|
7849
|
+
popperStyle: catchStyle(),
|
|
7850
|
+
defaultVisible: optionShow,
|
|
7851
|
+
visible: optionShow,
|
|
7852
|
+
onVisibleChange: handleVisibleChange,
|
|
7853
|
+
clickToClose: !searchValue
|
|
7854
|
+
});
|
|
7855
|
+
return Object(_utils_usePopper__WEBPACK_IMPORTED_MODULE_26__["default"])(renderCityPicker(), renderContent(), popperProps);
|
|
8020
7856
|
};
|
|
8021
|
-
|
|
7857
|
+
var Select = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_20___default.a.forwardRef(InternalSelect);
|
|
7858
|
+
Select.displayName = 'CityPicker';
|
|
7859
|
+
/* harmony default export */ __webpack_exports__["default"] = (Select);
|
|
8022
7860
|
|
|
8023
7861
|
/***/ }),
|
|
8024
7862
|
|
|
@@ -8038,38 +7876,68 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
8038
7876
|
|
|
8039
7877
|
/***/ }),
|
|
8040
7878
|
|
|
8041
|
-
/***/ "./components/city-picker/
|
|
8042
|
-
|
|
8043
|
-
!*** ./components/city-picker/
|
|
8044
|
-
|
|
7879
|
+
/***/ "./components/city-picker/option.tsx":
|
|
7880
|
+
/*!*******************************************!*\
|
|
7881
|
+
!*** ./components/city-picker/option.tsx ***!
|
|
7882
|
+
\*******************************************/
|
|
8045
7883
|
/*! exports provided: default */
|
|
8046
7884
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
8047
7885
|
|
|
8048
7886
|
"use strict";
|
|
8049
7887
|
__webpack_require__.r(__webpack_exports__);
|
|
8050
|
-
/* harmony import */ var
|
|
8051
|
-
/* harmony import */ var
|
|
8052
|
-
/* harmony import */ var
|
|
8053
|
-
/* harmony import */ var
|
|
8054
|
-
/* harmony import */ var
|
|
7888
|
+
/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "./node_modules/@babel/runtime/helpers/defineProperty.js");
|
|
7889
|
+
/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__);
|
|
7890
|
+
/* harmony import */ var core_js_modules_es_function_name_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.function.name.js */ "./node_modules/core-js/modules/es.function.name.js");
|
|
7891
|
+
/* harmony import */ var core_js_modules_es_function_name_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_function_name_js__WEBPACK_IMPORTED_MODULE_1__);
|
|
7892
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "react");
|
|
7893
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__);
|
|
7894
|
+
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
|
|
7895
|
+
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_3__);
|
|
7896
|
+
/* harmony import */ var _config_provider_ConfigContext__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../config-provider/ConfigContext */ "./components/config-provider/ConfigContext.tsx");
|
|
8055
7897
|
|
|
8056
7898
|
|
|
8057
7899
|
|
|
8058
|
-
|
|
8059
|
-
|
|
7900
|
+
|
|
7901
|
+
|
|
7902
|
+
var InternalOption = function InternalOption(props, ref) {
|
|
7903
|
+
var _classNames;
|
|
7904
|
+
var optionRef = Object(react__WEBPACK_IMPORTED_MODULE_2__["useRef"])(null) || ref;
|
|
7905
|
+
var children = props.children,
|
|
7906
|
+
value = props.value,
|
|
7907
|
+
disabled = props.disabled,
|
|
7908
|
+
onChangeSelect = props.onChangeSelect,
|
|
7909
|
+
_props$city = props.city,
|
|
7910
|
+
city = _props$city === void 0 ? {} : _props$city,
|
|
7911
|
+
renderCityInfo = props.renderCityInfo,
|
|
7912
|
+
itemRender = props.itemRender;
|
|
7913
|
+
var _ref = city,
|
|
7914
|
+
id = _ref.id,
|
|
7915
|
+
name = _ref.name;
|
|
7916
|
+
var _useContext = Object(react__WEBPACK_IMPORTED_MODULE_2__["useContext"])(_config_provider_ConfigContext__WEBPACK_IMPORTED_MODULE_4__["default"]),
|
|
8060
7917
|
getPrefixCls = _useContext.getPrefixCls,
|
|
8061
|
-
prefixCls = _useContext.prefixCls
|
|
8062
|
-
|
|
8063
|
-
var
|
|
8064
|
-
|
|
8065
|
-
|
|
8066
|
-
|
|
8067
|
-
|
|
8068
|
-
|
|
8069
|
-
|
|
8070
|
-
|
|
7918
|
+
prefixCls = _useContext.prefixCls;
|
|
7919
|
+
var selectOptionPrefixCls = getPrefixCls(prefixCls, 'city-picker-list-item');
|
|
7920
|
+
var isSelected = id !== undefined ? id === value : false;
|
|
7921
|
+
var optionCls = classnames__WEBPACK_IMPORTED_MODULE_3___default()(selectOptionPrefixCls, (_classNames = {}, _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_classNames, "".concat(selectOptionPrefixCls, "-selected"), isSelected), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_classNames, "".concat(selectOptionPrefixCls, "-disabled"), disabled), _classNames));
|
|
7922
|
+
var handleClick = function handleClick(e) {
|
|
7923
|
+
e.preventDefault();
|
|
7924
|
+
if (disabled || id === undefined) return;
|
|
7925
|
+
onChangeSelect === null || onChangeSelect === void 0 ? void 0 : onChangeSelect(city);
|
|
7926
|
+
};
|
|
7927
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(react__WEBPACK_IMPORTED_MODULE_2___default.a.Fragment, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("div", {
|
|
7928
|
+
ref: optionRef,
|
|
7929
|
+
className: optionCls,
|
|
7930
|
+
title: name,
|
|
7931
|
+
onClick: handleClick
|
|
7932
|
+
}, typeof itemRender === 'function' ? itemRender(city) : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(react__WEBPACK_IMPORTED_MODULE_2___default.a.Fragment, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("div", {
|
|
7933
|
+
className: "".concat(selectOptionPrefixCls, "-content")
|
|
7934
|
+
}, children), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("div", {
|
|
7935
|
+
className: "".concat(selectOptionPrefixCls, "-info")
|
|
7936
|
+
}, renderCityInfo === null || renderCityInfo === void 0 ? void 0 : renderCityInfo(city, true)))));
|
|
8071
7937
|
};
|
|
8072
|
-
|
|
7938
|
+
var Option = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default.a.forwardRef(InternalOption);
|
|
7939
|
+
Option.displayName = 'CityPickerOption';
|
|
7940
|
+
/* harmony default export */ __webpack_exports__["default"] = (Option);
|
|
8073
7941
|
|
|
8074
7942
|
/***/ }),
|
|
8075
7943
|
|
|
@@ -8100,43 +7968,6 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
8100
7968
|
|
|
8101
7969
|
|
|
8102
7970
|
|
|
8103
|
-
/***/ }),
|
|
8104
|
-
|
|
8105
|
-
/***/ "./components/city-picker/utils/grouping.ts":
|
|
8106
|
-
/*!**************************************************!*\
|
|
8107
|
-
!*** ./components/city-picker/utils/grouping.ts ***!
|
|
8108
|
-
\**************************************************/
|
|
8109
|
-
/*! exports provided: default */
|
|
8110
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
8111
|
-
|
|
8112
|
-
"use strict";
|
|
8113
|
-
__webpack_require__.r(__webpack_exports__);
|
|
8114
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return grouping; });
|
|
8115
|
-
/**
|
|
8116
|
-
* 进行分组
|
|
8117
|
-
* @param groups 组别
|
|
8118
|
-
* @param nums 每组个数
|
|
8119
|
-
* @returns 分组结果
|
|
8120
|
-
*/
|
|
8121
|
-
function grouping() {
|
|
8122
|
-
var groups = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
8123
|
-
var nums = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 4;
|
|
8124
|
-
if (groups.length === 0 || nums <= 1) return groups;
|
|
8125
|
-
var result = [];
|
|
8126
|
-
var str = '';
|
|
8127
|
-
for (var i = 0; i < groups.length; i++) {
|
|
8128
|
-
if (str.length === nums) {
|
|
8129
|
-
result.push(str);
|
|
8130
|
-
str = '';
|
|
8131
|
-
}
|
|
8132
|
-
str += groups[i];
|
|
8133
|
-
if (i === groups.length - 1) {
|
|
8134
|
-
result.push(str);
|
|
8135
|
-
}
|
|
8136
|
-
}
|
|
8137
|
-
return result;
|
|
8138
|
-
}
|
|
8139
|
-
|
|
8140
7971
|
/***/ }),
|
|
8141
7972
|
|
|
8142
7973
|
/***/ "./components/collapse/collapse.tsx":
|
|
@@ -9970,6 +9801,19 @@ var compDefaultProps = {
|
|
|
9970
9801
|
});
|
|
9971
9802
|
},
|
|
9972
9803
|
expandOnClickNode: false
|
|
9804
|
+
},
|
|
9805
|
+
CityPicker: {
|
|
9806
|
+
type: 'domestic',
|
|
9807
|
+
loading: false,
|
|
9808
|
+
size: 'small',
|
|
9809
|
+
borderType: 'underline',
|
|
9810
|
+
defaultOpen: false,
|
|
9811
|
+
showArrow: true,
|
|
9812
|
+
placeholder: '',
|
|
9813
|
+
description: '城市',
|
|
9814
|
+
showDescription: true,
|
|
9815
|
+
optionHighlightProps: 'highlightText',
|
|
9816
|
+
allowClear: true
|
|
9973
9817
|
}
|
|
9974
9818
|
};
|
|
9975
9819
|
/* harmony default export */ __webpack_exports__["default"] = (compDefaultProps);
|
|
@@ -117745,6 +117589,49 @@ function eq(value, other) {
|
|
|
117745
117589
|
module.exports = eq;
|
|
117746
117590
|
|
|
117747
117591
|
|
|
117592
|
+
/***/ }),
|
|
117593
|
+
|
|
117594
|
+
/***/ "./node_modules/lodash/escapeRegExp.js":
|
|
117595
|
+
/*!*********************************************!*\
|
|
117596
|
+
!*** ./node_modules/lodash/escapeRegExp.js ***!
|
|
117597
|
+
\*********************************************/
|
|
117598
|
+
/*! no static exports found */
|
|
117599
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
117600
|
+
|
|
117601
|
+
var toString = __webpack_require__(/*! ./toString */ "./node_modules/lodash/toString.js");
|
|
117602
|
+
|
|
117603
|
+
/**
|
|
117604
|
+
* Used to match `RegExp`
|
|
117605
|
+
* [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
|
|
117606
|
+
*/
|
|
117607
|
+
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g,
|
|
117608
|
+
reHasRegExpChar = RegExp(reRegExpChar.source);
|
|
117609
|
+
|
|
117610
|
+
/**
|
|
117611
|
+
* Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+",
|
|
117612
|
+
* "?", "(", ")", "[", "]", "{", "}", and "|" in `string`.
|
|
117613
|
+
*
|
|
117614
|
+
* @static
|
|
117615
|
+
* @memberOf _
|
|
117616
|
+
* @since 3.0.0
|
|
117617
|
+
* @category String
|
|
117618
|
+
* @param {string} [string=''] The string to escape.
|
|
117619
|
+
* @returns {string} Returns the escaped string.
|
|
117620
|
+
* @example
|
|
117621
|
+
*
|
|
117622
|
+
* _.escapeRegExp('[lodash](https://lodash.com/)');
|
|
117623
|
+
* // => '\[lodash\]\(https://lodash\.com/\)'
|
|
117624
|
+
*/
|
|
117625
|
+
function escapeRegExp(string) {
|
|
117626
|
+
string = toString(string);
|
|
117627
|
+
return (string && reHasRegExpChar.test(string))
|
|
117628
|
+
? string.replace(reRegExpChar, '\\$&')
|
|
117629
|
+
: string;
|
|
117630
|
+
}
|
|
117631
|
+
|
|
117632
|
+
module.exports = escapeRegExp;
|
|
117633
|
+
|
|
117634
|
+
|
|
117748
117635
|
/***/ }),
|
|
117749
117636
|
|
|
117750
117637
|
/***/ "./node_modules/lodash/findLast.js":
|