util-helpers 4.14.0 → 4.15.0
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/README.md +8 -2
- package/dist/util-helpers.js +257 -126
- package/dist/util-helpers.js.map +1 -1
- package/dist/util-helpers.min.js +1 -1
- package/dist/util-helpers.min.js.map +1 -1
- package/esm/calculateCursorPosition.js +1 -3
- package/esm/filterTree.js +62 -0
- package/esm/findTreeNode.js +11 -6
- package/esm/findTreeNodes.js +70 -0
- package/esm/findTreeSelect.js +8 -6
- package/esm/index.js +4 -2
- package/esm/listToTree.js +5 -2
- package/esm/transformFieldNames.doc.js +4 -3
- package/esm/transformFieldNames.js +8 -6
- package/esm/utils/config.js +1 -1
- package/lib/calculateCursorPosition.js +1 -3
- package/lib/filterTree.js +71 -0
- package/lib/findTreeNode.js +10 -6
- package/lib/findTreeNodes.js +79 -0
- package/lib/findTreeSelect.js +8 -6
- package/lib/index.js +16 -2
- package/lib/listToTree.js +5 -2
- package/lib/transformFieldNames.doc.js +4 -3
- package/lib/transformFieldNames.js +8 -6
- package/lib/utils/config.js +1 -1
- package/package.json +1 -1
- package/types/calculateCursorPosition.d.ts +0 -2
- package/types/filterTree.d.ts +28 -0
- package/types/findTreeNode.d.ts +1 -1
- package/types/findTreeNodes.d.ts +29 -0
- package/types/index.d.ts +4 -2
- package/types/listToTree.d.ts +2 -0
- package/types/transformFieldNames.d.ts +4 -3
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import normalizeString from './normalizeString';
|
|
2
2
|
|
|
3
|
-
//
|
|
3
|
+
// ref: https://github.com/ant-design/ant-design-mobile/blob/v2/components/input-item/index.tsx#L240
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* 计算输入框的值格式化后光标位置
|
|
@@ -8,8 +8,6 @@ import normalizeString from './normalizeString';
|
|
|
8
8
|
* @static
|
|
9
9
|
* @alias module:Other.calculateCursorPosition
|
|
10
10
|
* @since 4.6.0
|
|
11
|
-
* @see 格式化手机号码 {@link https://doly-dev.github.io/util-helpers/module-Processor.html#.formatMobile|formatMobile}
|
|
12
|
-
* @see 格式化银行卡号 {@link https://doly-dev.github.io/util-helpers/module-Processor.html#.formatBankCard|formatBankCard}
|
|
13
11
|
* @see h5示例 {@link https://2950v9.csb.app/|点击查看}
|
|
14
12
|
* @see react示例 {@link https://33ccy9.csb.app/|点击查看}
|
|
15
13
|
* @param {number} prevPos 赋值前的光标位置,onChange/onInput的光标位置 e.target.selectionEnd
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
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; }
|
|
3
|
+
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) { _defineProperty(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; }
|
|
4
|
+
import { isObject } from "./utils/type";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* 过滤/筛选树节点。<br/><br/>如果某节点被过滤掉,它的子节点也一并抛弃
|
|
8
|
+
*
|
|
9
|
+
* @static
|
|
10
|
+
* @alias module:Processor.filterTree
|
|
11
|
+
* @since 4.15.0
|
|
12
|
+
* @template {any} T
|
|
13
|
+
* @template {(item: T) => boolean} F
|
|
14
|
+
* @param {T[]} tree 树结构数据
|
|
15
|
+
* @param {F} predicate 遍历每一项执行的函数,参数是当前遍历到的节点数据,如果返回 Truthy ,结果将包含该节点
|
|
16
|
+
* @param {string} [childrenField='children'] 子级字段名
|
|
17
|
+
* @param {'spread'|'self'} [nodeAssign='spread'] 节点赋值方式。spread表示使用展开运算符创建新值,self表示使用自身对象。
|
|
18
|
+
* @returns {T[]}
|
|
19
|
+
* @example
|
|
20
|
+
* const menus = [{ "id": "1", "name": "首页", "code": "trade", "pid": null }, { "id": "2", "name": "交易管理", "code": "trade", "pid": null, "children": [{ "id": "3", "name": "交易查询", "code": "trade-1", "pid": "2", "children": [{ "id": "4", "name": "交易查询-查询操作", "code": "trade-1-1", "pid": "3" }] }] }, { "id": "5", "name": "权限管理", "code": "authorization", "pid": null, "children": [{ "id": "6", "name": "角色管理", "code": "authorization-1", "pid": "5" }, { "id": "7", "name": "用户管理", "code": "authorization-2", "pid": "5" }] }];
|
|
21
|
+
*
|
|
22
|
+
* filterTree(menus, item=>item.name.indexOf('管理') > -1);
|
|
23
|
+
* // [{"id":"2","name":"交易管理","code":"trade","pid":null,"children":[]},{"id":"5","name":"权限管理","code":"authorization","pid":null,"children":[{"id":"6","name":"角色管理","code":"authorization-1","pid":"5"},{"id":"7","name":"用户管理","code":"authorization-2","pid":"5"}]}]
|
|
24
|
+
*
|
|
25
|
+
* // 如果某节点被过滤掉,它的子节点也一并抛弃
|
|
26
|
+
* filterTree(menus, item=>item.id === '7');
|
|
27
|
+
* // []
|
|
28
|
+
*
|
|
29
|
+
* filterTree(menus, item=>item.id === 'not found');
|
|
30
|
+
* // []
|
|
31
|
+
*/
|
|
32
|
+
function filterTree(tree, predicate) {
|
|
33
|
+
var childrenField = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'children';
|
|
34
|
+
var nodeAssign = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'spread';
|
|
35
|
+
if (!Array.isArray(tree)) {
|
|
36
|
+
return tree;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/** @type {T[]} */
|
|
40
|
+
var result = [];
|
|
41
|
+
tree.forEach(function (item) {
|
|
42
|
+
var newItem = item;
|
|
43
|
+
if (isObject(item)) {
|
|
44
|
+
// @ts-ignore
|
|
45
|
+
newItem = nodeAssign === 'spread' ? _objectSpread({}, item) : item;
|
|
46
|
+
}
|
|
47
|
+
if (predicate(newItem)) {
|
|
48
|
+
if (isObject(newItem)) {
|
|
49
|
+
/** @type {T[]|undefined} */
|
|
50
|
+
// @ts-ignore
|
|
51
|
+
var childs = newItem[childrenField];
|
|
52
|
+
if (Array.isArray(childs) && childs.length > 0) {
|
|
53
|
+
// @ts-ignore
|
|
54
|
+
newItem[childrenField] = filterTree(childs, predicate, childrenField, nodeAssign);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
result.push(newItem);
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
return result;
|
|
61
|
+
}
|
|
62
|
+
export default filterTree;
|
package/esm/findTreeNode.js
CHANGED
|
@@ -2,6 +2,8 @@ import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
|
2
2
|
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
|
|
3
3
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
4
4
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
5
|
+
import { isObject } from "./utils/type";
|
|
6
|
+
|
|
5
7
|
/**
|
|
6
8
|
* 查找树结构数据节点
|
|
7
9
|
*
|
|
@@ -11,7 +13,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
11
13
|
* @template {any} T
|
|
12
14
|
* @template {(item: T) => boolean} F
|
|
13
15
|
* @param {T[]} tree 树结构数据
|
|
14
|
-
* @param {F} predicate 遍历每一项执行的函数,参数是当前遍历到的节点数据,如果返回 Truthy
|
|
16
|
+
* @param {F} predicate 遍历每一项执行的函数,参数是当前遍历到的节点数据,如果返回 Truthy ,将返回该节点
|
|
15
17
|
* @param {string} [childrenField='children'] 子级字段名
|
|
16
18
|
* @returns {T|undefined}
|
|
17
19
|
* @example
|
|
@@ -46,11 +48,14 @@ function findTreeNode(tree, predicate) {
|
|
|
46
48
|
node = temp;
|
|
47
49
|
break;
|
|
48
50
|
}
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
51
|
+
if (isObject(temp)) {
|
|
52
|
+
/** @type {T[]} */
|
|
53
|
+
// @ts-ignore
|
|
54
|
+
var childs = temp[childrenField];
|
|
55
|
+
if (Array.isArray(childs) && childs.length > 0) {
|
|
56
|
+
stack.push.apply(stack, _toConsumableArray(childs));
|
|
57
|
+
}
|
|
58
|
+
}
|
|
54
59
|
}
|
|
55
60
|
if (node) {
|
|
56
61
|
break;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
2
|
+
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
|
|
3
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
4
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
5
|
+
import { isObject } from "./utils/type";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* 查找树结构数据多个节点
|
|
9
|
+
*
|
|
10
|
+
* @static
|
|
11
|
+
* @alias module:Other.findTreeNodes
|
|
12
|
+
* @since 4.15.0
|
|
13
|
+
* @template {any} T
|
|
14
|
+
* @template {(item: T) => boolean} F
|
|
15
|
+
* @param {T[]} tree 树结构数据
|
|
16
|
+
* @param {F} predicate 遍历每一项执行的函数,参数是当前遍历到的节点数据,如果返回 Truthy ,返回结果将包含该节点
|
|
17
|
+
* @param {string} [childrenField='children'] 子级字段名
|
|
18
|
+
* @returns {T[]}
|
|
19
|
+
* @example
|
|
20
|
+
* const menus = [{ "id": "1", "name": "首页", "code": "trade", "pid": null }, { "id": "2", "name": "交易管理", "code": "trade", "pid": null, "children": [{ "id": "3", "name": "交易查询", "code": "trade-1", "pid": "2", "children": [{ "id": "4", "name": "交易查询-查询操作", "code": "trade-1-1", "pid": "3" }] }] }, { "id": "5", "name": "权限管理", "code": "authorization", "pid": null, "children": [{ "id": "6", "name": "角色管理", "code": "authorization-1", "pid": "5" }, { "id": "7", "name": "用户管理", "code": "authorization-2", "pid": "5" }] }];
|
|
21
|
+
*
|
|
22
|
+
* findTreeNodes(menus, item=>item.id === '2');
|
|
23
|
+
* // [{"id":"2","name":"交易管理","code":"trade","pid":null,"children":[{"id":"3","name":"交易查询","code":"trade-1","pid":"2","children":[{"id":"4","name":"交易查询-查询操作","code":"trade-1-1","pid":"3"}]}]}]
|
|
24
|
+
*
|
|
25
|
+
* findTreeNodes(menus, item=>item.name.indexOf('管理') > -1);
|
|
26
|
+
* // [{"id":"2","name":"交易管理","code":"trade","pid":null,"children":[{"id":"3","name":"交易查询","code":"trade-1","pid":"2","children":[{"id":"4","name":"交易查询-查询操作","code":"trade-1-1","pid":"3"}]}]},{"id":"5","name":"权限管理","code":"authorization","pid":null,"children":[{"id":"6","name":"角色管理","code":"authorization-1","pid":"5"},{"id":"7","name":"用户管理","code":"authorization-2","pid":"5"}]},{"id":"7","name":"用户管理","code":"authorization-2","pid":"5"},{"id":"6","name":"角色管理","code":"authorization-1","pid":"5"}]
|
|
27
|
+
*
|
|
28
|
+
* findTreeNodes(menus, item=>item.id === '1' || item.id === '7');
|
|
29
|
+
* // [{"id":"1","name":"首页","code":"trade","pid":null},{"id":"7","name":"用户管理","code":"authorization-2","pid":"5"}]
|
|
30
|
+
*
|
|
31
|
+
* findTreeNodes(menus, item=>item.id === 'not found');
|
|
32
|
+
* // []
|
|
33
|
+
*/
|
|
34
|
+
function findTreeNodes(tree, predicate) {
|
|
35
|
+
var childrenField = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'children';
|
|
36
|
+
var stack = [];
|
|
37
|
+
|
|
38
|
+
/** @type {T[]} */
|
|
39
|
+
var nodes = [];
|
|
40
|
+
var _iterator = _createForOfIteratorHelper(tree),
|
|
41
|
+
_step;
|
|
42
|
+
try {
|
|
43
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
44
|
+
var item = _step.value;
|
|
45
|
+
stack.push(item);
|
|
46
|
+
while (stack.length) {
|
|
47
|
+
/** @type {T} */
|
|
48
|
+
// @ts-ignore
|
|
49
|
+
var temp = stack.pop();
|
|
50
|
+
if (predicate(temp)) {
|
|
51
|
+
nodes.push(temp);
|
|
52
|
+
}
|
|
53
|
+
if (isObject(temp)) {
|
|
54
|
+
/** @type {T[]} */
|
|
55
|
+
// @ts-ignore
|
|
56
|
+
var childs = temp[childrenField];
|
|
57
|
+
if (Array.isArray(childs) && childs.length > 0) {
|
|
58
|
+
stack.push.apply(stack, _toConsumableArray(childs));
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
} catch (err) {
|
|
64
|
+
_iterator.e(err);
|
|
65
|
+
} finally {
|
|
66
|
+
_iterator.f();
|
|
67
|
+
}
|
|
68
|
+
return nodes;
|
|
69
|
+
}
|
|
70
|
+
export default findTreeNodes;
|
package/esm/findTreeSelect.js
CHANGED
|
@@ -30,13 +30,15 @@ function internalFindTreeSelect(tree, predicate) {
|
|
|
30
30
|
if (predicate(item)) {
|
|
31
31
|
return path;
|
|
32
32
|
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
if (isObject(item) && Array.isArray(item[childrenField]) && item[childrenField].length > 0) {
|
|
33
|
+
if (isObject(item)) {
|
|
34
|
+
/** @type {T[]} */
|
|
36
35
|
// @ts-ignore
|
|
37
|
-
var
|
|
38
|
-
if (
|
|
39
|
-
|
|
36
|
+
var childs = item[childrenField];
|
|
37
|
+
if (Array.isArray(childs) && childs.length > 0) {
|
|
38
|
+
var findChildren = internalFindTreeSelect(childs, predicate, childrenField, path);
|
|
39
|
+
if (findChildren.length > 0) {
|
|
40
|
+
return findChildren;
|
|
41
|
+
}
|
|
40
42
|
}
|
|
41
43
|
}
|
|
42
44
|
path.pop();
|
package/esm/index.js
CHANGED
|
@@ -49,8 +49,7 @@ export { default as padZero } from './padZero';
|
|
|
49
49
|
export { default as transformFieldNames } from './transformFieldNames';
|
|
50
50
|
export { default as listToTree } from './listToTree';
|
|
51
51
|
export { default as treeToList } from './treeToList';
|
|
52
|
-
export { default as
|
|
53
|
-
export { default as findTreeSelect } from './findTreeSelect';
|
|
52
|
+
export { default as filterTree } from './filterTree';
|
|
54
53
|
|
|
55
54
|
/**
|
|
56
55
|
* 数学计算,修正浮点数计算问题
|
|
@@ -107,6 +106,9 @@ export { default as waitTime } from './waitTime';
|
|
|
107
106
|
export { default as calculateCursorPosition } from './calculateCursorPosition';
|
|
108
107
|
export { default as randomString } from './randomString';
|
|
109
108
|
export { default as strlen } from './strlen';
|
|
109
|
+
export { default as findTreeNode } from './findTreeNode';
|
|
110
|
+
export { default as findTreeNodes } from './findTreeNodes';
|
|
111
|
+
export { default as findTreeSelect } from './findTreeSelect';
|
|
110
112
|
|
|
111
113
|
/**
|
|
112
114
|
* 调试相关
|
package/esm/listToTree.js
CHANGED
|
@@ -49,6 +49,7 @@ function processEmptyChildren(arr) {
|
|
|
49
49
|
* @param {string} [options.parentField='pid'] 当前数据的父级字段名称
|
|
50
50
|
* @param {string} [options.childrenField='children'] 子级字段名称
|
|
51
51
|
* @param {'none'|'null'|'array'} [options.emptyChildrenValue='none'] 子级为空时的值,none表示删除该子级,null表示为null,array表示为[]。
|
|
52
|
+
* @param {'spread'|'self'} [options.nodeAssign='spread'] 节点赋值方式。spread表示使用展开运算符创建新值,self表示使用自身对象。
|
|
52
53
|
* @returns {R[]} 树结构
|
|
53
54
|
* @example
|
|
54
55
|
*
|
|
@@ -78,7 +79,9 @@ function listToTree(list) {
|
|
|
78
79
|
_options$childrenFiel2 = options.childrenField,
|
|
79
80
|
childrenField = _options$childrenFiel2 === void 0 ? 'children' : _options$childrenFiel2,
|
|
80
81
|
_options$emptyChildre2 = options.emptyChildrenValue,
|
|
81
|
-
emptyChildrenValue = _options$emptyChildre2 === void 0 ? 'none' : _options$emptyChildre2
|
|
82
|
+
emptyChildrenValue = _options$emptyChildre2 === void 0 ? 'none' : _options$emptyChildre2,
|
|
83
|
+
_options$nodeAssign = options.nodeAssign,
|
|
84
|
+
nodeAssign = _options$nodeAssign === void 0 ? 'spread' : _options$nodeAssign;
|
|
82
85
|
|
|
83
86
|
/** @type {R[]} */
|
|
84
87
|
var tree = [];
|
|
@@ -87,7 +90,7 @@ function listToTree(list) {
|
|
|
87
90
|
var record = {};
|
|
88
91
|
list.forEach(function (item) {
|
|
89
92
|
if (isObject(item)) {
|
|
90
|
-
var newItem = _objectSpread({}, item);
|
|
93
|
+
var newItem = nodeAssign === 'spread' ? _objectSpread({}, item) : item;
|
|
91
94
|
|
|
92
95
|
/** @type {string} */
|
|
93
96
|
var id = newItem[keyField];
|
|
@@ -7,9 +7,10 @@
|
|
|
7
7
|
* @static
|
|
8
8
|
* @alias module:Processor.transformFieldNames
|
|
9
9
|
* @since 4.14.0
|
|
10
|
-
* @param {object[]} data 对象数组。如果是树结构数据,需要指定第三个参数
|
|
10
|
+
* @param {object[]} data 对象数组。如果是树结构数据,需要指定第三个参数 childrenField
|
|
11
11
|
* @param {object} fieldNames 字段名映射
|
|
12
|
-
* @param {string} [
|
|
12
|
+
* @param {string} [childrenField] 子级数据字段名
|
|
13
|
+
* @param {'spread'|'self'} [nodeAssign='spread'] 节点赋值方式。spread表示使用展开运算符创建新值,self表示使用自身对象。
|
|
13
14
|
* @returns {object[]}
|
|
14
15
|
* @example
|
|
15
16
|
*
|
|
@@ -30,5 +31,5 @@
|
|
|
30
31
|
* const newOptions4 = transformFieldNames(options3, {label: 'name', value: 'code', children: 'childs'}, 'childs');
|
|
31
32
|
* // [{value: '1', label: 'one'},{value:'2', label:'two', children: [{value: '2-1', label:'two-one'}]}]
|
|
32
33
|
*/
|
|
33
|
-
function transformFieldNames(data, fieldNames,
|
|
34
|
+
function transformFieldNames(data, fieldNames, childrenField) {}
|
|
34
35
|
export default transformFieldNames;
|
|
@@ -15,9 +15,10 @@ import { isObject } from './utils/type';
|
|
|
15
15
|
* @template {*} D
|
|
16
16
|
* @template {Record<string, keyof D>} F
|
|
17
17
|
* @template {string} C
|
|
18
|
-
* @param {D[]} data 对象数组。如果是树结构数据,需要指定第三个参数
|
|
18
|
+
* @param {D[]} data 对象数组。如果是树结构数据,需要指定第三个参数 childrenField
|
|
19
19
|
* @param {F} fieldNames 字段名映射
|
|
20
|
-
* @param {C} [
|
|
20
|
+
* @param {C} [childrenField] 子级数据字段名
|
|
21
|
+
* @param {'spread'|'self'} [nodeAssign='spread'] 节点赋值方式。spread表示使用展开运算符创建新值,self表示使用自身对象。
|
|
21
22
|
* @returns {import('./transformFieldNames.type.js').TransformFieldNames<D, F, C>}
|
|
22
23
|
* @example
|
|
23
24
|
*
|
|
@@ -38,7 +39,8 @@ import { isObject } from './utils/type';
|
|
|
38
39
|
* const newOptions4 = transformFieldNames(options3, {label: 'name', value: 'code', children: 'childs'}, 'childs');
|
|
39
40
|
* // [{value: '1', label: 'one'},{value:'2', label:'two', children: [{value: '2-1', label:'two-one'}]}]
|
|
40
41
|
*/
|
|
41
|
-
function transformFieldNames(data, fieldNames,
|
|
42
|
+
function transformFieldNames(data, fieldNames, childrenField) {
|
|
43
|
+
var nodeAssign = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'spread';
|
|
42
44
|
if (!Array.isArray(data)) {
|
|
43
45
|
return data;
|
|
44
46
|
}
|
|
@@ -59,15 +61,15 @@ function transformFieldNames(data, fieldNames, childrenFieldName) {
|
|
|
59
61
|
if (!isObject(item)) {
|
|
60
62
|
return item;
|
|
61
63
|
}
|
|
62
|
-
var newItem = _objectSpread({}, item);
|
|
64
|
+
var newItem = nodeAssign === 'spread' ? _objectSpread({}, item) : item;
|
|
63
65
|
/** @type {Array.<string>} */
|
|
64
66
|
var delKeys = [];
|
|
65
67
|
|
|
66
68
|
// 树形数据子节点
|
|
67
69
|
// @ts-ignore
|
|
68
|
-
if (
|
|
70
|
+
if (childrenField && Array.isArray(newItem[childrenField]) && newItem[childrenField].length > 0) {
|
|
69
71
|
// @ts-ignore
|
|
70
|
-
newItem[
|
|
72
|
+
newItem[childrenField] = recusion(newItem[childrenField].slice());
|
|
71
73
|
}
|
|
72
74
|
|
|
73
75
|
// 替换字段名
|
package/esm/utils/config.js
CHANGED
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports["default"] = void 0;
|
|
7
7
|
var _normalizeString = _interopRequireDefault(require("./normalizeString"));
|
|
8
8
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
9
|
-
//
|
|
9
|
+
// ref: https://github.com/ant-design/ant-design-mobile/blob/v2/components/input-item/index.tsx#L240
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* 计算输入框的值格式化后光标位置
|
|
@@ -14,8 +14,6 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "d
|
|
|
14
14
|
* @static
|
|
15
15
|
* @alias module:Other.calculateCursorPosition
|
|
16
16
|
* @since 4.6.0
|
|
17
|
-
* @see 格式化手机号码 {@link https://doly-dev.github.io/util-helpers/module-Processor.html#.formatMobile|formatMobile}
|
|
18
|
-
* @see 格式化银行卡号 {@link https://doly-dev.github.io/util-helpers/module-Processor.html#.formatBankCard|formatBankCard}
|
|
19
17
|
* @see h5示例 {@link https://2950v9.csb.app/|点击查看}
|
|
20
18
|
* @see react示例 {@link https://33ccy9.csb.app/|点击查看}
|
|
21
19
|
* @param {number} prevPos 赋值前的光标位置,onChange/onInput的光标位置 e.target.selectionEnd
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
var _type = require("./utils/type");
|
|
8
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
9
|
+
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; }
|
|
10
|
+
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) { _defineProperty(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; }
|
|
11
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
12
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
13
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
14
|
+
/**
|
|
15
|
+
* 过滤/筛选树节点。<br/><br/>如果某节点被过滤掉,它的子节点也一并抛弃
|
|
16
|
+
*
|
|
17
|
+
* @static
|
|
18
|
+
* @alias module:Processor.filterTree
|
|
19
|
+
* @since 4.15.0
|
|
20
|
+
* @template {any} T
|
|
21
|
+
* @template {(item: T) => boolean} F
|
|
22
|
+
* @param {T[]} tree 树结构数据
|
|
23
|
+
* @param {F} predicate 遍历每一项执行的函数,参数是当前遍历到的节点数据,如果返回 Truthy ,结果将包含该节点
|
|
24
|
+
* @param {string} [childrenField='children'] 子级字段名
|
|
25
|
+
* @param {'spread'|'self'} [nodeAssign='spread'] 节点赋值方式。spread表示使用展开运算符创建新值,self表示使用自身对象。
|
|
26
|
+
* @returns {T[]}
|
|
27
|
+
* @example
|
|
28
|
+
* const menus = [{ "id": "1", "name": "首页", "code": "trade", "pid": null }, { "id": "2", "name": "交易管理", "code": "trade", "pid": null, "children": [{ "id": "3", "name": "交易查询", "code": "trade-1", "pid": "2", "children": [{ "id": "4", "name": "交易查询-查询操作", "code": "trade-1-1", "pid": "3" }] }] }, { "id": "5", "name": "权限管理", "code": "authorization", "pid": null, "children": [{ "id": "6", "name": "角色管理", "code": "authorization-1", "pid": "5" }, { "id": "7", "name": "用户管理", "code": "authorization-2", "pid": "5" }] }];
|
|
29
|
+
*
|
|
30
|
+
* filterTree(menus, item=>item.name.indexOf('管理') > -1);
|
|
31
|
+
* // [{"id":"2","name":"交易管理","code":"trade","pid":null,"children":[]},{"id":"5","name":"权限管理","code":"authorization","pid":null,"children":[{"id":"6","name":"角色管理","code":"authorization-1","pid":"5"},{"id":"7","name":"用户管理","code":"authorization-2","pid":"5"}]}]
|
|
32
|
+
*
|
|
33
|
+
* // 如果某节点被过滤掉,它的子节点也一并抛弃
|
|
34
|
+
* filterTree(menus, item=>item.id === '7');
|
|
35
|
+
* // []
|
|
36
|
+
*
|
|
37
|
+
* filterTree(menus, item=>item.id === 'not found');
|
|
38
|
+
* // []
|
|
39
|
+
*/
|
|
40
|
+
function filterTree(tree, predicate) {
|
|
41
|
+
var childrenField = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'children';
|
|
42
|
+
var nodeAssign = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'spread';
|
|
43
|
+
if (!Array.isArray(tree)) {
|
|
44
|
+
return tree;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/** @type {T[]} */
|
|
48
|
+
var result = [];
|
|
49
|
+
tree.forEach(function (item) {
|
|
50
|
+
var newItem = item;
|
|
51
|
+
if ((0, _type.isObject)(item)) {
|
|
52
|
+
// @ts-ignore
|
|
53
|
+
newItem = nodeAssign === 'spread' ? _objectSpread({}, item) : item;
|
|
54
|
+
}
|
|
55
|
+
if (predicate(newItem)) {
|
|
56
|
+
if ((0, _type.isObject)(newItem)) {
|
|
57
|
+
/** @type {T[]|undefined} */
|
|
58
|
+
// @ts-ignore
|
|
59
|
+
var childs = newItem[childrenField];
|
|
60
|
+
if (Array.isArray(childs) && childs.length > 0) {
|
|
61
|
+
// @ts-ignore
|
|
62
|
+
newItem[childrenField] = filterTree(childs, predicate, childrenField, nodeAssign);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
result.push(newItem);
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
return result;
|
|
69
|
+
}
|
|
70
|
+
var _default = filterTree;
|
|
71
|
+
exports["default"] = _default;
|
package/lib/findTreeNode.js
CHANGED
|
@@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports["default"] = void 0;
|
|
7
|
+
var _type = require("./utils/type");
|
|
7
8
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
8
9
|
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
9
10
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
@@ -20,7 +21,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
20
21
|
* @template {any} T
|
|
21
22
|
* @template {(item: T) => boolean} F
|
|
22
23
|
* @param {T[]} tree 树结构数据
|
|
23
|
-
* @param {F} predicate 遍历每一项执行的函数,参数是当前遍历到的节点数据,如果返回 Truthy
|
|
24
|
+
* @param {F} predicate 遍历每一项执行的函数,参数是当前遍历到的节点数据,如果返回 Truthy ,将返回该节点
|
|
24
25
|
* @param {string} [childrenField='children'] 子级字段名
|
|
25
26
|
* @returns {T|undefined}
|
|
26
27
|
* @example
|
|
@@ -55,11 +56,14 @@ function findTreeNode(tree, predicate) {
|
|
|
55
56
|
node = temp;
|
|
56
57
|
break;
|
|
57
58
|
}
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
59
|
+
if ((0, _type.isObject)(temp)) {
|
|
60
|
+
/** @type {T[]} */
|
|
61
|
+
// @ts-ignore
|
|
62
|
+
var childs = temp[childrenField];
|
|
63
|
+
if (Array.isArray(childs) && childs.length > 0) {
|
|
64
|
+
stack.push.apply(stack, _toConsumableArray(childs));
|
|
65
|
+
}
|
|
66
|
+
}
|
|
63
67
|
}
|
|
64
68
|
if (node) {
|
|
65
69
|
break;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
var _type = require("./utils/type");
|
|
8
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
9
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
10
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
11
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
12
|
+
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
|
|
13
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
14
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
15
|
+
/**
|
|
16
|
+
* 查找树结构数据多个节点
|
|
17
|
+
*
|
|
18
|
+
* @static
|
|
19
|
+
* @alias module:Other.findTreeNodes
|
|
20
|
+
* @since 4.15.0
|
|
21
|
+
* @template {any} T
|
|
22
|
+
* @template {(item: T) => boolean} F
|
|
23
|
+
* @param {T[]} tree 树结构数据
|
|
24
|
+
* @param {F} predicate 遍历每一项执行的函数,参数是当前遍历到的节点数据,如果返回 Truthy ,返回结果将包含该节点
|
|
25
|
+
* @param {string} [childrenField='children'] 子级字段名
|
|
26
|
+
* @returns {T[]}
|
|
27
|
+
* @example
|
|
28
|
+
* const menus = [{ "id": "1", "name": "首页", "code": "trade", "pid": null }, { "id": "2", "name": "交易管理", "code": "trade", "pid": null, "children": [{ "id": "3", "name": "交易查询", "code": "trade-1", "pid": "2", "children": [{ "id": "4", "name": "交易查询-查询操作", "code": "trade-1-1", "pid": "3" }] }] }, { "id": "5", "name": "权限管理", "code": "authorization", "pid": null, "children": [{ "id": "6", "name": "角色管理", "code": "authorization-1", "pid": "5" }, { "id": "7", "name": "用户管理", "code": "authorization-2", "pid": "5" }] }];
|
|
29
|
+
*
|
|
30
|
+
* findTreeNodes(menus, item=>item.id === '2');
|
|
31
|
+
* // [{"id":"2","name":"交易管理","code":"trade","pid":null,"children":[{"id":"3","name":"交易查询","code":"trade-1","pid":"2","children":[{"id":"4","name":"交易查询-查询操作","code":"trade-1-1","pid":"3"}]}]}]
|
|
32
|
+
*
|
|
33
|
+
* findTreeNodes(menus, item=>item.name.indexOf('管理') > -1);
|
|
34
|
+
* // [{"id":"2","name":"交易管理","code":"trade","pid":null,"children":[{"id":"3","name":"交易查询","code":"trade-1","pid":"2","children":[{"id":"4","name":"交易查询-查询操作","code":"trade-1-1","pid":"3"}]}]},{"id":"5","name":"权限管理","code":"authorization","pid":null,"children":[{"id":"6","name":"角色管理","code":"authorization-1","pid":"5"},{"id":"7","name":"用户管理","code":"authorization-2","pid":"5"}]},{"id":"7","name":"用户管理","code":"authorization-2","pid":"5"},{"id":"6","name":"角色管理","code":"authorization-1","pid":"5"}]
|
|
35
|
+
*
|
|
36
|
+
* findTreeNodes(menus, item=>item.id === '1' || item.id === '7');
|
|
37
|
+
* // [{"id":"1","name":"首页","code":"trade","pid":null},{"id":"7","name":"用户管理","code":"authorization-2","pid":"5"}]
|
|
38
|
+
*
|
|
39
|
+
* findTreeNodes(menus, item=>item.id === 'not found');
|
|
40
|
+
* // []
|
|
41
|
+
*/
|
|
42
|
+
function findTreeNodes(tree, predicate) {
|
|
43
|
+
var childrenField = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'children';
|
|
44
|
+
var stack = [];
|
|
45
|
+
|
|
46
|
+
/** @type {T[]} */
|
|
47
|
+
var nodes = [];
|
|
48
|
+
var _iterator = _createForOfIteratorHelper(tree),
|
|
49
|
+
_step;
|
|
50
|
+
try {
|
|
51
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
52
|
+
var item = _step.value;
|
|
53
|
+
stack.push(item);
|
|
54
|
+
while (stack.length) {
|
|
55
|
+
/** @type {T} */
|
|
56
|
+
// @ts-ignore
|
|
57
|
+
var temp = stack.pop();
|
|
58
|
+
if (predicate(temp)) {
|
|
59
|
+
nodes.push(temp);
|
|
60
|
+
}
|
|
61
|
+
if ((0, _type.isObject)(temp)) {
|
|
62
|
+
/** @type {T[]} */
|
|
63
|
+
// @ts-ignore
|
|
64
|
+
var childs = temp[childrenField];
|
|
65
|
+
if (Array.isArray(childs) && childs.length > 0) {
|
|
66
|
+
stack.push.apply(stack, _toConsumableArray(childs));
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
} catch (err) {
|
|
72
|
+
_iterator.e(err);
|
|
73
|
+
} finally {
|
|
74
|
+
_iterator.f();
|
|
75
|
+
}
|
|
76
|
+
return nodes;
|
|
77
|
+
}
|
|
78
|
+
var _default = findTreeNodes;
|
|
79
|
+
exports["default"] = _default;
|
package/lib/findTreeSelect.js
CHANGED
|
@@ -35,13 +35,15 @@ function internalFindTreeSelect(tree, predicate) {
|
|
|
35
35
|
if (predicate(item)) {
|
|
36
36
|
return path;
|
|
37
37
|
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
if ((0, _type.isObject)(item) && Array.isArray(item[childrenField]) && item[childrenField].length > 0) {
|
|
38
|
+
if ((0, _type.isObject)(item)) {
|
|
39
|
+
/** @type {T[]} */
|
|
41
40
|
// @ts-ignore
|
|
42
|
-
var
|
|
43
|
-
if (
|
|
44
|
-
|
|
41
|
+
var childs = item[childrenField];
|
|
42
|
+
if (Array.isArray(childs) && childs.length > 0) {
|
|
43
|
+
var findChildren = internalFindTreeSelect(childs, predicate, childrenField, path);
|
|
44
|
+
if (findChildren.length > 0) {
|
|
45
|
+
return findChildren;
|
|
46
|
+
}
|
|
45
47
|
}
|
|
46
48
|
}
|
|
47
49
|
path.pop();
|
package/lib/index.js
CHANGED
|
@@ -33,12 +33,24 @@ Object.defineProperty(exports, "divide", {
|
|
|
33
33
|
return _divide["default"];
|
|
34
34
|
}
|
|
35
35
|
});
|
|
36
|
+
Object.defineProperty(exports, "filterTree", {
|
|
37
|
+
enumerable: true,
|
|
38
|
+
get: function get() {
|
|
39
|
+
return _filterTree["default"];
|
|
40
|
+
}
|
|
41
|
+
});
|
|
36
42
|
Object.defineProperty(exports, "findTreeNode", {
|
|
37
43
|
enumerable: true,
|
|
38
44
|
get: function get() {
|
|
39
45
|
return _findTreeNode["default"];
|
|
40
46
|
}
|
|
41
47
|
});
|
|
48
|
+
Object.defineProperty(exports, "findTreeNodes", {
|
|
49
|
+
enumerable: true,
|
|
50
|
+
get: function get() {
|
|
51
|
+
return _findTreeNodes["default"];
|
|
52
|
+
}
|
|
53
|
+
});
|
|
42
54
|
Object.defineProperty(exports, "findTreeSelect", {
|
|
43
55
|
enumerable: true,
|
|
44
56
|
get: function get() {
|
|
@@ -347,8 +359,7 @@ var _padZero = _interopRequireDefault(require("./padZero"));
|
|
|
347
359
|
var _transformFieldNames = _interopRequireDefault(require("./transformFieldNames"));
|
|
348
360
|
var _listToTree = _interopRequireDefault(require("./listToTree"));
|
|
349
361
|
var _treeToList = _interopRequireDefault(require("./treeToList"));
|
|
350
|
-
var
|
|
351
|
-
var _findTreeSelect = _interopRequireDefault(require("./findTreeSelect"));
|
|
362
|
+
var _filterTree = _interopRequireDefault(require("./filterTree"));
|
|
352
363
|
var _plus = _interopRequireDefault(require("./plus"));
|
|
353
364
|
var _minus = _interopRequireDefault(require("./minus"));
|
|
354
365
|
var _times = _interopRequireDefault(require("./times"));
|
|
@@ -358,5 +369,8 @@ var _waitTime = _interopRequireDefault(require("./waitTime"));
|
|
|
358
369
|
var _calculateCursorPosition = _interopRequireDefault(require("./calculateCursorPosition"));
|
|
359
370
|
var _randomString = _interopRequireDefault(require("./randomString"));
|
|
360
371
|
var _strlen = _interopRequireDefault(require("./strlen"));
|
|
372
|
+
var _findTreeNode = _interopRequireDefault(require("./findTreeNode"));
|
|
373
|
+
var _findTreeNodes = _interopRequireDefault(require("./findTreeNodes"));
|
|
374
|
+
var _findTreeSelect = _interopRequireDefault(require("./findTreeSelect"));
|
|
361
375
|
var _config = require("./utils/config");
|
|
362
376
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|