@jetlinks-web/components 3.1.6 → 3.1.8

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.
@@ -1,3 +1,9 @@
1
+ function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) {
2
+ return lhs;
3
+ }
4
+ else {
5
+ return rhsFn();
6
+ } }
1
7
  function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) {
2
8
  const op = ops[i];
3
9
  const fn = ops[i + 1];
@@ -20,17 +26,22 @@ function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]
20
26
  "autoCompleteProps": "setup-maybe-ref",
21
27
  "ref": "setup-const",
22
28
  "watch": "setup-const",
29
+ "computed": "setup-const",
30
+ "omit": "setup-maybe-ref",
23
31
  "props": "setup-reactive-const",
24
32
  "emit": "setup-const",
25
- "_options": "setup-ref",
33
+ "displayText": "setup-ref",
34
+ "keyword": "setup-ref",
35
+ "filteredOptions": "setup-ref",
26
36
  "onSearch": "setup-const",
27
- "dropdownVisibleChange": "setup-const"
37
+ "onSelect": "setup-const"
28
38
  } */
29
39
  import { defineComponent as _defineComponent } from 'vue';
30
- import { renderSlot as _renderSlot, toDisplayString as _toDisplayString, createTextVNode as _createTextVNode, unref as _unref, mergeProps as _mergeProps, withCtx as _withCtx, openBlock as _openBlock, createBlock as _createBlock } from "vue";
40
+ import { unref as _unref, renderSlot as _renderSlot, toDisplayString as _toDisplayString, createTextVNode as _createTextVNode, mergeProps as _mergeProps, withCtx as _withCtx, openBlock as _openBlock, createBlock as _createBlock } from "vue";
31
41
  import { AutoComplete } from 'ant-design-vue';
32
42
  import { autoCompleteProps } from 'ant-design-vue/lib/auto-complete';
33
- import { ref, watch } from 'vue';
43
+ import { ref, watch, computed } from 'vue';
44
+ import { omit } from "lodash-es";
34
45
  const __sfc_main__ = _defineComponent({
35
46
  ...{
36
47
  name: 'JAutoComplete'
@@ -42,38 +53,55 @@ const __sfc_main__ = _defineComponent({
42
53
  default: 'label',
43
54
  },
44
55
  },
45
- emits: ["select"],
56
+ emits: ["select", "change", "update:value"],
46
57
  setup(__props, { emit: __emit }) {
47
58
  const props = __props;
48
59
  const emit = __emit;
49
- const _options = ref([]);
60
+ const displayText = ref();
61
+ const keyword = ref('');
62
+ const filteredOptions = computed(() => {
63
+ if (!keyword.value)
64
+ return props.options;
65
+ const filterArr = props.options.filter(opt => String(_nullishCoalesce(opt[props.searchKey], () => ('')))
66
+ .includes(keyword.value));
67
+ if (filterArr.length === 0) {
68
+ return [{
69
+ label: keyword.value,
70
+ value: keyword.value
71
+ }];
72
+ }
73
+ return filterArr;
74
+ });
50
75
  /**
51
76
  * 根据关键词提示
52
77
  * @param searchText 关键词
53
78
  */
54
79
  const onSearch = (searchText) => {
55
- _options.value = _optionalChain([props, 'access', _2 => _2.options, 'optionalAccess', _3 => _3.filter, 'call', _4 => _4((item) => !!_optionalChain([item, 'access', _5 => _5[props.searchKey], 'optionalAccess', _6 => _6.includes, 'call', _7 => _7(searchText)]))]) || [];
56
- if (!_options.value.length) {
57
- _options.value.unshift({ label: searchText, value: searchText });
58
- }
80
+ keyword.value = searchText;
59
81
  };
60
- const dropdownVisibleChange = (open) => {
61
- if (!open) {
62
- // 关闭还原下拉options
63
- setTimeout(() => {
64
- _options.value = props.options || [];
65
- });
66
- }
82
+ const onSelect = (val, option) => {
83
+ displayText.value = option.label;
84
+ keyword.value = undefined;
85
+ emit('update:value', val);
86
+ emit('select', val, option);
67
87
  };
68
- watch(() => JSON.stringify(props.options), // 处理options变化
69
- () => {
70
- _options.value = props.options || [];
88
+ watch(() => props.value, (val) => {
89
+ if (!val) {
90
+ displayText.value = '';
91
+ }
92
+ else {
93
+ const found = _optionalChain([props, 'access', _2 => _2.options, 'optionalAccess', _3 => _3.find, 'call', _4 => _4((opt) => opt.value === val)]);
94
+ displayText.value = _nullishCoalesce(_optionalChain([found, 'optionalAccess', _5 => _5.label]), () => (''));
95
+ }
71
96
  }, { immediate: true });
72
97
  return (_ctx, _cache) => {
73
- return (_openBlock(), _createBlock(_unref(AutoComplete), _mergeProps({ style: { "width": "100%" } }, props, {
74
- options: _options.value,
98
+ return (_openBlock(), _createBlock(_unref(AutoComplete), _mergeProps({ ..._unref(omit)(props, ['onSelect']) }, {
99
+ style: { "width": "100%" },
100
+ value: displayText.value,
101
+ "onUpdate:value": _cache[0] || (_cache[0] = ($event) => ((displayText).value = $event)),
102
+ options: filteredOptions.value,
75
103
  onSearch: onSearch,
76
- onDropdownVisibleChange: dropdownVisibleChange
104
+ onSelect: onSelect
77
105
  }), {
78
106
  option: _withCtx(({ value, label }) => [
79
107
  _renderSlot(_ctx.$slots, "option", { value: value }, () => [
@@ -84,7 +112,7 @@ const __sfc_main__ = _defineComponent({
84
112
  _renderSlot(_ctx.$slots, "default")
85
113
  ]),
86
114
  _: 3 /* FORWARDED */
87
- }, 16 /* FULL_PROPS */, ["options"]));
115
+ }, 16 /* FULL_PROPS */, ["value", "options"]));
88
116
  };
89
117
  }
90
118
  });
@@ -11,12 +11,14 @@
11
11
  "ref": "setup-const",
12
12
  "watch": "setup-const",
13
13
  "genCompoentStyle": "setup-maybe-ref",
14
+ "Form": "setup-maybe-ref",
14
15
  "props": "setup-reactive-const",
15
16
  "emit": "setup-const",
16
17
  "selectKeys": "setup-ref",
17
18
  "prefixCls": "setup-ref",
18
19
  "wrapSSR": "setup-maybe-ref",
19
20
  "hashId": "setup-maybe-ref",
21
+ "formItemContext": "setup-maybe-ref",
20
22
  "CardSelectStyle": "setup-ref",
21
23
  "isMultiple": "setup-ref",
22
24
  "handleSelect": "setup-const"
@@ -26,6 +28,7 @@ const _hoisted_1 = ["onClick"];
26
28
  import { has } from 'lodash-es';
27
29
  import { computed, ref, watch } from 'vue';
28
30
  import genCompoentStyle from './style';
31
+ import { Form } from 'ant-design-vue';
29
32
  const __sfc_main__ = Object.assign({
30
33
  name: 'JCardSelect'
31
34
  }, {
@@ -66,6 +69,7 @@ const __sfc_main__ = Object.assign({
66
69
  const selectKeys = ref([]);
67
70
  const prefixCls = computed(() => 'j-card-select');
68
71
  const [wrapSSR, hashId] = genCompoentStyle(prefixCls);
72
+ const formItemContext = Form.useInjectFormItemContext();
69
73
  const CardSelectStyle = computed(() => {
70
74
  const _column = props.column > 0 && props.layout === 'horizontal' ? props.column : 1;
71
75
  return {
@@ -100,6 +104,7 @@ const __sfc_main__ = Object.assign({
100
104
  emit('change', key, node);
101
105
  emit('update:value', key);
102
106
  }
107
+ formItemContext.onFieldChange();
103
108
  };
104
109
  watch(() => props.value, () => {
105
110
  selectKeys.value = isMultiple.value ? (props.value || []) : [props.value];
@@ -10,11 +10,13 @@
10
10
  "watch": "setup-const",
11
11
  "isArray": "setup-maybe-ref",
12
12
  "useCheckButtonStyle": "setup-maybe-ref",
13
+ "Form": "setup-maybe-ref",
13
14
  "props": "setup-reactive-const",
14
15
  "emit": "setup-const",
15
16
  "prefixCls": "setup-ref",
16
17
  "wrapSSR": "setup-maybe-ref",
17
18
  "hashId": "setup-maybe-ref",
19
+ "formItemContext": "setup-maybe-ref",
18
20
  "myValue": "setup-ref",
19
21
  "optionsMap": "setup-ref",
20
22
  "_options": "setup-ref",
@@ -26,6 +28,7 @@ const _hoisted_1 = ["onClick"];
26
28
  import { computed, ref, watch } from 'vue';
27
29
  import { isArray } from '@jetlinks-web/utils';
28
30
  import useCheckButtonStyle from './style';
31
+ import { Form } from "ant-design-vue";
29
32
  const __sfc_main__ = _defineComponent({
30
33
  ...{
31
34
  name: 'JCheckButton'
@@ -63,6 +66,7 @@ const __sfc_main__ = _defineComponent({
63
66
  // 使用样式
64
67
  const prefixCls = computed(() => 'j-check-button');
65
68
  const [wrapSSR, hashId] = useCheckButtonStyle(prefixCls);
69
+ const formItemContext = Form.useInjectFormItemContext();
66
70
  const myValue = ref();
67
71
  const optionsMap = ref(new Map());
68
72
  const _options = computed(() => {
@@ -103,6 +107,7 @@ const __sfc_main__ = _defineComponent({
103
107
  emit('update:value', _value);
104
108
  emit('change', _value, props.multiple ? optionsItems : optionsItems[0]);
105
109
  emit('select', _value, props.multiple ? optionsItems : optionsItems[0]);
110
+ formItemContext.onFieldChange();
106
111
  };
107
112
  return (_ctx, _cache) => {
108
113
  return (_openBlock(), _createElementBlock("div", {
@@ -369,10 +369,7 @@ const __sfc_main__ = _defineComponent({
369
369
  expandChange: expandChange
370
370
  }, () => [
371
371
  _createElementVNode("div", _hoisted_6, [
372
- _createVNode(_unref(Button), {
373
- type: "stroke",
374
- onClick: reset
375
- }, {
372
+ _createVNode(_unref(Button), { onClick: reset }, {
376
373
  default: _withCtx(() => [
377
374
  _createTextVNode(_toDisplayString(_unref(contextLocale).advanced.reset), 1 /* TEXT */)
378
375
  ]),
package/es/Search/Item.js CHANGED
@@ -188,11 +188,11 @@ const __sfc_main__ = _defineComponent({
188
188
  };
189
189
  const onTermTypeChange = () => {
190
190
  const isBtw = btwKeys.includes(termsModel.termType);
191
- if (!isBtw && Array.isArray(termsModel.value)) {
191
+ if (!isBtw && termsModel.value && Array.isArray(termsModel.value)) {
192
192
  termsModel.value = termsModel.value[0];
193
193
  onValueChange();
194
194
  }
195
- else if (isBtw && !Array.isArray(termsModel.value)) {
195
+ else if (isBtw && termsModel.value && !Array.isArray(termsModel.value)) {
196
196
  termsModel.value = [termsModel.value];
197
197
  onValueChange();
198
198
  }
@@ -73,7 +73,7 @@ export var useHandleColumns = function useHandleColumns(props, terms, options) {
73
73
  var initValues = function initValues() {
74
74
  var arr = Object.values(columnsMap.value);
75
75
  if (!arr.length) return;
76
- if (options.mode === 'advanced') {
76
+ if ((options === null || options === void 0 ? void 0 : options.mode) === 'advanced') {
77
77
  // 设置第一位
78
78
  terms.terms = [getItemDefaultValue(arr[0], defaultCacheValues.value)];
79
79
  } else {
@@ -7,7 +7,11 @@ var _flattenTree = function flattenTree(tree) {
7
7
  var parentId = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
8
8
  return tree.flatMap(function (item) {
9
9
  var _item$children;
10
+ var _children = (item.children || []).map(function (i) {
11
+ return _objectSpread({}, omit(i, 'children'));
12
+ });
10
13
  var flatNode = _objectSpread(_objectSpread({}, omit(item, 'children')), {}, {
14
+ _children: _children,
11
15
  level: level,
12
16
  parentId: parentId,
13
17
  expanded: false,
@@ -1,3 +1,9 @@
1
+ function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) {
2
+ return lhs;
3
+ }
4
+ else {
5
+ return rhsFn();
6
+ } }
1
7
  function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) {
2
8
  const op = ops[i];
3
9
  const fn = ops[i + 1];
@@ -20,17 +26,22 @@ function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]
20
26
  "autoCompleteProps": "setup-maybe-ref",
21
27
  "ref": "setup-const",
22
28
  "watch": "setup-const",
29
+ "computed": "setup-const",
30
+ "omit": "setup-maybe-ref",
23
31
  "props": "setup-reactive-const",
24
32
  "emit": "setup-const",
25
- "_options": "setup-ref",
33
+ "displayText": "setup-ref",
34
+ "keyword": "setup-ref",
35
+ "filteredOptions": "setup-ref",
26
36
  "onSearch": "setup-const",
27
- "dropdownVisibleChange": "setup-const"
37
+ "onSelect": "setup-const"
28
38
  } */
29
39
  import { defineComponent as _defineComponent } from 'vue';
30
- import { renderSlot as _renderSlot, toDisplayString as _toDisplayString, createTextVNode as _createTextVNode, unref as _unref, mergeProps as _mergeProps, withCtx as _withCtx, openBlock as _openBlock, createBlock as _createBlock } from "vue";
40
+ import { unref as _unref, renderSlot as _renderSlot, toDisplayString as _toDisplayString, createTextVNode as _createTextVNode, mergeProps as _mergeProps, withCtx as _withCtx, openBlock as _openBlock, createBlock as _createBlock } from "vue";
31
41
  import { AutoComplete } from 'ant-design-vue';
32
42
  import { autoCompleteProps } from 'ant-design-vue/lib/auto-complete';
33
- import { ref, watch } from 'vue';
43
+ import { ref, watch, computed } from 'vue';
44
+ import { omit } from "lodash-es";
34
45
  const __sfc_main__ = _defineComponent({
35
46
  ...{
36
47
  name: 'JAutoComplete'
@@ -42,38 +53,55 @@ const __sfc_main__ = _defineComponent({
42
53
  default: 'label',
43
54
  },
44
55
  },
45
- emits: ["select"],
56
+ emits: ["select", "change", "update:value"],
46
57
  setup(__props, { emit: __emit }) {
47
58
  const props = __props;
48
59
  const emit = __emit;
49
- const _options = ref([]);
60
+ const displayText = ref();
61
+ const keyword = ref('');
62
+ const filteredOptions = computed(() => {
63
+ if (!keyword.value)
64
+ return props.options;
65
+ const filterArr = props.options.filter(opt => String(_nullishCoalesce(opt[props.searchKey], () => ('')))
66
+ .includes(keyword.value));
67
+ if (filterArr.length === 0) {
68
+ return [{
69
+ label: keyword.value,
70
+ value: keyword.value
71
+ }];
72
+ }
73
+ return filterArr;
74
+ });
50
75
  /**
51
76
  * 根据关键词提示
52
77
  * @param searchText 关键词
53
78
  */
54
79
  const onSearch = (searchText) => {
55
- _options.value = _optionalChain([props, 'access', _2 => _2.options, 'optionalAccess', _3 => _3.filter, 'call', _4 => _4((item) => !!_optionalChain([item, 'access', _5 => _5[props.searchKey], 'optionalAccess', _6 => _6.includes, 'call', _7 => _7(searchText)]))]) || [];
56
- if (!_options.value.length) {
57
- _options.value.unshift({ label: searchText, value: searchText });
58
- }
80
+ keyword.value = searchText;
59
81
  };
60
- const dropdownVisibleChange = (open) => {
61
- if (!open) {
62
- // 关闭还原下拉options
63
- setTimeout(() => {
64
- _options.value = props.options || [];
65
- });
66
- }
82
+ const onSelect = (val, option) => {
83
+ displayText.value = option.label;
84
+ keyword.value = undefined;
85
+ emit('update:value', val);
86
+ emit('select', val, option);
67
87
  };
68
- watch(() => JSON.stringify(props.options), // 处理options变化
69
- () => {
70
- _options.value = props.options || [];
88
+ watch(() => props.value, (val) => {
89
+ if (!val) {
90
+ displayText.value = '';
91
+ }
92
+ else {
93
+ const found = _optionalChain([props, 'access', _2 => _2.options, 'optionalAccess', _3 => _3.find, 'call', _4 => _4((opt) => opt.value === val)]);
94
+ displayText.value = _nullishCoalesce(_optionalChain([found, 'optionalAccess', _5 => _5.label]), () => (''));
95
+ }
71
96
  }, { immediate: true });
72
97
  return (_ctx, _cache) => {
73
- return (_openBlock(), _createBlock(_unref(AutoComplete), _mergeProps({ style: { "width": "100%" } }, props, {
74
- options: _options.value,
98
+ return (_openBlock(), _createBlock(_unref(AutoComplete), _mergeProps({ ..._unref(omit)(props, ['onSelect']) }, {
99
+ style: { "width": "100%" },
100
+ value: displayText.value,
101
+ "onUpdate:value": _cache[0] || (_cache[0] = ($event) => ((displayText).value = $event)),
102
+ options: filteredOptions.value,
75
103
  onSearch: onSearch,
76
- onDropdownVisibleChange: dropdownVisibleChange
104
+ onSelect: onSelect
77
105
  }), {
78
106
  option: _withCtx(({ value, label }) => [
79
107
  _renderSlot(_ctx.$slots, "option", { value: value }, () => [
@@ -84,7 +112,7 @@ const __sfc_main__ = _defineComponent({
84
112
  _renderSlot(_ctx.$slots, "default")
85
113
  ]),
86
114
  _: 3 /* FORWARDED */
87
- }, 16 /* FULL_PROPS */, ["options"]));
115
+ }, 16 /* FULL_PROPS */, ["value", "options"]));
88
116
  };
89
117
  }
90
118
  });
@@ -11,12 +11,14 @@
11
11
  "ref": "setup-const",
12
12
  "watch": "setup-const",
13
13
  "genCompoentStyle": "setup-maybe-ref",
14
+ "Form": "setup-maybe-ref",
14
15
  "props": "setup-reactive-const",
15
16
  "emit": "setup-const",
16
17
  "selectKeys": "setup-ref",
17
18
  "prefixCls": "setup-ref",
18
19
  "wrapSSR": "setup-maybe-ref",
19
20
  "hashId": "setup-maybe-ref",
21
+ "formItemContext": "setup-maybe-ref",
20
22
  "CardSelectStyle": "setup-ref",
21
23
  "isMultiple": "setup-ref",
22
24
  "handleSelect": "setup-const"
@@ -26,6 +28,7 @@ const _hoisted_1 = ["onClick"];
26
28
  import { has } from 'lodash-es';
27
29
  import { computed, ref, watch } from 'vue';
28
30
  import genCompoentStyle from './style';
31
+ import { Form } from 'ant-design-vue';
29
32
  const __sfc_main__ = Object.assign({
30
33
  name: 'JCardSelect'
31
34
  }, {
@@ -66,6 +69,7 @@ const __sfc_main__ = Object.assign({
66
69
  const selectKeys = ref([]);
67
70
  const prefixCls = computed(() => 'j-card-select');
68
71
  const [wrapSSR, hashId] = genCompoentStyle(prefixCls);
72
+ const formItemContext = Form.useInjectFormItemContext();
69
73
  const CardSelectStyle = computed(() => {
70
74
  const _column = props.column > 0 && props.layout === 'horizontal' ? props.column : 1;
71
75
  return {
@@ -100,6 +104,7 @@ const __sfc_main__ = Object.assign({
100
104
  emit('change', key, node);
101
105
  emit('update:value', key);
102
106
  }
107
+ formItemContext.onFieldChange();
103
108
  };
104
109
  watch(() => props.value, () => {
105
110
  selectKeys.value = isMultiple.value ? (props.value || []) : [props.value];
@@ -10,11 +10,13 @@
10
10
  "watch": "setup-const",
11
11
  "isArray": "setup-maybe-ref",
12
12
  "useCheckButtonStyle": "setup-maybe-ref",
13
+ "Form": "setup-maybe-ref",
13
14
  "props": "setup-reactive-const",
14
15
  "emit": "setup-const",
15
16
  "prefixCls": "setup-ref",
16
17
  "wrapSSR": "setup-maybe-ref",
17
18
  "hashId": "setup-maybe-ref",
19
+ "formItemContext": "setup-maybe-ref",
18
20
  "myValue": "setup-ref",
19
21
  "optionsMap": "setup-ref",
20
22
  "_options": "setup-ref",
@@ -26,6 +28,7 @@ const _hoisted_1 = ["onClick"];
26
28
  import { computed, ref, watch } from 'vue';
27
29
  import { isArray } from '@jetlinks-web/utils';
28
30
  import useCheckButtonStyle from './style';
31
+ import { Form } from "ant-design-vue";
29
32
  const __sfc_main__ = _defineComponent({
30
33
  ...{
31
34
  name: 'JCheckButton'
@@ -63,6 +66,7 @@ const __sfc_main__ = _defineComponent({
63
66
  // 使用样式
64
67
  const prefixCls = computed(() => 'j-check-button');
65
68
  const [wrapSSR, hashId] = useCheckButtonStyle(prefixCls);
69
+ const formItemContext = Form.useInjectFormItemContext();
66
70
  const myValue = ref();
67
71
  const optionsMap = ref(new Map());
68
72
  const _options = computed(() => {
@@ -103,6 +107,7 @@ const __sfc_main__ = _defineComponent({
103
107
  emit('update:value', _value);
104
108
  emit('change', _value, props.multiple ? optionsItems : optionsItems[0]);
105
109
  emit('select', _value, props.multiple ? optionsItems : optionsItems[0]);
110
+ formItemContext.onFieldChange();
106
111
  };
107
112
  return (_ctx, _cache) => {
108
113
  return (_openBlock(), _createElementBlock("div", {
@@ -369,10 +369,7 @@ const __sfc_main__ = _defineComponent({
369
369
  expandChange: expandChange
370
370
  }, () => [
371
371
  _createElementVNode("div", _hoisted_6, [
372
- _createVNode(_unref(Button), {
373
- type: "stroke",
374
- onClick: reset
375
- }, {
372
+ _createVNode(_unref(Button), { onClick: reset }, {
376
373
  default: _withCtx(() => [
377
374
  _createTextVNode(_toDisplayString(_unref(contextLocale).advanced.reset), 1 /* TEXT */)
378
375
  ]),
@@ -188,11 +188,11 @@ const __sfc_main__ = _defineComponent({
188
188
  };
189
189
  const onTermTypeChange = () => {
190
190
  const isBtw = btwKeys.includes(termsModel.termType);
191
- if (!isBtw && Array.isArray(termsModel.value)) {
191
+ if (!isBtw && termsModel.value && Array.isArray(termsModel.value)) {
192
192
  termsModel.value = termsModel.value[0];
193
193
  onValueChange();
194
194
  }
195
- else if (isBtw && !Array.isArray(termsModel.value)) {
195
+ else if (isBtw && termsModel.value && !Array.isArray(termsModel.value)) {
196
196
  termsModel.value = [termsModel.value];
197
197
  onValueChange();
198
198
  }
@@ -121,7 +121,7 @@ var useHandleColumns = exports.useHandleColumns = function useHandleColumns(prop
121
121
  var initValues = function initValues() {
122
122
  var arr = Object.values(columnsMap.value);
123
123
  if (!arr.length) return;
124
- if (options.mode === 'advanced') {
124
+ if ((options === null || options === void 0 ? void 0 : options.mode) === 'advanced') {
125
125
  // 设置第一位
126
126
  terms.terms = [(0, _util.getItemDefaultValue)(arr[0], defaultCacheValues.value)];
127
127
  } else {
@@ -15,7 +15,11 @@ var _flattenTree = exports.flattenTree = function flattenTree(tree) {
15
15
  var parentId = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
16
16
  return tree.flatMap(function (item) {
17
17
  var _item$children;
18
+ var _children = (item.children || []).map(function (i) {
19
+ return (0, _objectSpread2.default)({}, (0, _lodashEs.omit)(i, 'children'));
20
+ });
18
21
  var flatNode = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, (0, _lodashEs.omit)(item, 'children')), {}, {
22
+ _children: _children,
19
23
  level: level,
20
24
  parentId: parentId,
21
25
  expanded: false,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jetlinks-web/components",
3
- "version": "3.1.6",
3
+ "version": "3.1.8",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",