@teamix/pro 1.4.25 → 1.4.27

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.
Files changed (52) hide show
  1. package/dist/pro.css +1 -1
  2. package/dist/pro.js +45535 -35222
  3. package/dist/pro.min.css +1 -1
  4. package/dist/pro.min.js +1 -1
  5. package/dist/pro.min.js.LICENSE.txt +11 -0
  6. package/es/card/index.js +2 -2
  7. package/es/form/Filter/layout.scss +1 -1
  8. package/es/form/ProForm/addCascadeEffect.d.ts +2 -0
  9. package/es/form/ProForm/addCascadeEffect.js +225 -0
  10. package/es/form/ProForm/index.js +8 -5
  11. package/es/form/typing.d.ts +20 -0
  12. package/es/index.d.ts +1 -1
  13. package/es/index.js +2 -1
  14. package/es/sidebar/components/sidebar-container/index.js +18 -2
  15. package/es/sidebar/components/sidebar-container/index.scss +21 -14
  16. package/es/sidebar/components/tree/index.js +24 -6
  17. package/es/sidebar/components/tree-node/index.js +1 -1
  18. package/es/sidebar/components/tree-node/index.scss +6 -0
  19. package/es/sidebar/typing.d.ts +4 -0
  20. package/es/table/components/Layout/index.scss +1 -1
  21. package/es/table/components/ToolBar/DensityIcon.js +1 -0
  22. package/es/table/components/ToolBar/FilterColumnIcon.js +2 -0
  23. package/es/table/components/ToolBar/FullScreenIcon.js +6 -57
  24. package/es/table/components/ToolBar/index.d.ts +1 -1
  25. package/es/table/components/ToolBar/index.js +99 -16
  26. package/es/table/components/ToolBar/index.scss +22 -2
  27. package/es/table/index.js +6 -3
  28. package/es/table/typing.d.ts +4 -1
  29. package/lib/card/index.js +2 -2
  30. package/lib/form/Filter/layout.scss +1 -1
  31. package/lib/form/ProForm/addCascadeEffect.d.ts +2 -0
  32. package/lib/form/ProForm/addCascadeEffect.js +235 -0
  33. package/lib/form/ProForm/index.js +9 -5
  34. package/lib/form/typing.d.ts +20 -0
  35. package/lib/index.d.ts +1 -1
  36. package/lib/index.js +2 -1
  37. package/lib/sidebar/components/sidebar-container/index.js +18 -2
  38. package/lib/sidebar/components/sidebar-container/index.scss +21 -14
  39. package/lib/sidebar/components/tree/index.js +24 -6
  40. package/lib/sidebar/components/tree-node/index.js +1 -1
  41. package/lib/sidebar/components/tree-node/index.scss +6 -0
  42. package/lib/sidebar/typing.d.ts +4 -0
  43. package/lib/table/components/Layout/index.scss +1 -1
  44. package/lib/table/components/ToolBar/DensityIcon.js +1 -0
  45. package/lib/table/components/ToolBar/FilterColumnIcon.js +2 -0
  46. package/lib/table/components/ToolBar/FullScreenIcon.js +9 -63
  47. package/lib/table/components/ToolBar/index.d.ts +1 -1
  48. package/lib/table/components/ToolBar/index.js +109 -16
  49. package/lib/table/components/ToolBar/index.scss +22 -2
  50. package/lib/table/index.js +6 -3
  51. package/lib/table/typing.d.ts +4 -1
  52. package/package.json +1 -1
@@ -30,6 +30,17 @@ object-assign
30
30
  * (c) Sindre Sorhus; MIT License
31
31
  */
32
32
 
33
+ /*! js-cookie v3.0.1 | MIT */
34
+
35
+ /**
36
+ * @license
37
+ * Lodash <https://lodash.com/>
38
+ * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
39
+ * Released under MIT license <https://lodash.com/license>
40
+ * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
41
+ * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
42
+ */
43
+
33
44
  /** @license React v16.13.1
34
45
  * react-is.production.min.js
35
46
  *
package/es/card/index.js CHANGED
@@ -221,9 +221,9 @@ export var ProCard = function ProCard(props) {
221
221
  });
222
222
  var width = widthList.reduce(function (acc, cur) {
223
223
  return acc + cur;
224
- }, 0) + widthList.length * 8; // 无法取出精准宽度,减去1作为阈值
224
+ }, 0) + widthList.length * 8; // 无法取出精准宽度,减去1作为阈值 10为右padding
225
225
 
226
- setHeaderWithoutTitleWidth(width - 1);
226
+ setHeaderWithoutTitleWidth(width - 1 + 10);
227
227
  }
228
228
  };
229
229
 
@@ -26,7 +26,7 @@ $query-filter-layout: #{$teamix-pro-form}-query-filter-layout;
26
26
  margin-bottom: 8px;
27
27
  }
28
28
  .#{$query-filter-layout}-addonAfter {
29
- flex: 0 1 auto;
29
+ flex: 0 0 auto;
30
30
  margin-left: 8px;
31
31
  }
32
32
  .#{$query-filter-layout}-panel {
@@ -0,0 +1,2 @@
1
+ declare const _default: (form: any, schema: any, scope: any) => void;
2
+ export default _default;
@@ -0,0 +1,225 @@
1
+ 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; }
2
+
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
+
5
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
6
+
7
+ import { onFieldReact, onFieldValueChange } from '@formily/core';
8
+ var OP_MAPS = {
9
+ '*': function _() {
10
+ return true;
11
+ },
12
+ '=': function _(l, r) {
13
+ return l === r;
14
+ },
15
+ '==': function _(l, r) {
16
+ return l === r;
17
+ },
18
+ '!': function _(l, r) {
19
+ return l !== r;
20
+ },
21
+ '!=': function _(l, r) {
22
+ return l != r;
23
+ },
24
+ '>': function _(l, r) {
25
+ return l > r;
26
+ },
27
+ '<': function _(l, r) {
28
+ return l < r;
29
+ },
30
+ '>=': function _(l, r) {
31
+ return l >= r;
32
+ },
33
+ '<=': function _(l, r) {
34
+ return l <= r;
35
+ },
36
+ ied: function ied(l, r) {
37
+ if (Array.isArray(l) || typeof l === 'string' && r) {
38
+ return l.includes(r);
39
+ } else {
40
+ return false;
41
+ }
42
+ },
43
+ eed: function eed(l, r) {
44
+ if (Array.isArray(l) || typeof l === 'string' && r) {
45
+ return !l.includes(r);
46
+ } else {
47
+ return true;
48
+ }
49
+ },
50
+ i: function i(l, r) {
51
+ if (Array.isArray(r) || typeof r === 'string' && l) {
52
+ return r.includes(l);
53
+ } else {
54
+ return false;
55
+ }
56
+ },
57
+ e: function e(l, r) {
58
+ if (Array.isArray(r) || typeof r === 'string' && l) {
59
+ return !r.includes(l);
60
+ } else {
61
+ return true;
62
+ }
63
+ },
64
+ isEmpty: function isEmpty(l, r) {
65
+ return l === null || l === undefined || l === '' || Array.isArray(l) && l.length === 0;
66
+ },
67
+ notEmpty: function notEmpty(l, r) {
68
+ return l !== null && l !== undefined && l !== '' && (!Array.isArray(l) || l.length !== 0);
69
+ }
70
+ };
71
+
72
+ var getParsedValue = function getParsedValue(value, scope) {
73
+ if (typeof value === 'string' && value.startsWith('${') && value.endsWith('}')) {
74
+ return scope.$form.getValuesIn(value.slice(2, value.length - 1));
75
+ } else if (typeof value === 'string' && value.startsWith('{{') && value.endsWith('}}')) {
76
+ var code = value.slice(2, value.length - 2);
77
+
78
+ try {
79
+ return new Function("with(this){ return ".concat(code, " }")).call(scope);
80
+ } catch (e) {
81
+ return undefined;
82
+ }
83
+ } else {
84
+ return value;
85
+ }
86
+ };
87
+
88
+ var bingo = function bingo(bingoItem, scope) {
89
+ var _bingoItem$when = bingoItem.when,
90
+ when = _bingoItem$when === void 0 ? [] : _bingoItem$when,
91
+ _bingoItem$logic = bingoItem.logic,
92
+ logic = _bingoItem$logic === void 0 ? '&&' : _bingoItem$logic;
93
+ var result = logic === '&&';
94
+ when.forEach(function (_ref) {
95
+ var left = _ref.left,
96
+ op = _ref.op,
97
+ right = _ref.right;
98
+ var leftValue = scope.$form.getValuesIn(left);
99
+ var rightValue = getParsedValue(right, scope);
100
+ var itemResult = OP_MAPS[op](leftValue, rightValue);
101
+
102
+ if (logic === '&&') {
103
+ result = result && itemResult;
104
+ } else {
105
+ result = result || itemResult;
106
+ }
107
+ });
108
+ return result;
109
+ };
110
+
111
+ var loopAddFieldEffect = function loopAddFieldEffect(schema, form, scope) {
112
+ if (Array.isArray(schema)) {
113
+ schema === null || schema === void 0 ? void 0 : schema.forEach(function (item) {
114
+ if (item.name) {
115
+ var _item$cascade, _item$onChange;
116
+
117
+ (_item$cascade = item.cascade) === null || _item$cascade === void 0 ? void 0 : _item$cascade.forEach(function (cascade) {
118
+ onFieldReact(item.name, function (field) {
119
+ var contextScope = _objectSpread(_objectSpread({}, scope), {}, {
120
+ $form: form,
121
+ $self: field,
122
+ $values: form.values
123
+ });
124
+
125
+ var _cascade$state = cascade.state,
126
+ state = _cascade$state === void 0 ? {} : _cascade$state,
127
+ _cascade$props = cascade.props,
128
+ props = _cascade$props === void 0 ? {} : _cascade$props,
129
+ dataSourceFilter = cascade.dataSourceFilter,
130
+ dataSourceHide = cascade.dataSourceHide;
131
+
132
+ if (bingo(cascade, contextScope)) {
133
+ if (dataSourceFilter || dataSourceHide) {
134
+ var sourceDataSource = field.getState()._sourceDataSource;
135
+
136
+ if (!sourceDataSource) {
137
+ var dataSource = field.getState().dataSource;
138
+ field.setState({
139
+ _sourceDataSource: dataSource
140
+ });
141
+ sourceDataSource = dataSource;
142
+ }
143
+
144
+ if (sourceDataSource) {
145
+ var nextDataSource = sourceDataSource.filter(function (item) {
146
+ if (Array.isArray(dataSourceFilter)) {
147
+ return dataSourceFilter.includes(item.value);
148
+ }
149
+
150
+ if (Array.isArray(dataSourceHide)) {
151
+ return !dataSourceFilter.includes(item.value);
152
+ }
153
+ });
154
+ field.setDataSource(nextDataSource);
155
+ var value = field.getState().value;
156
+
157
+ if (!nextDataSource.some(function (item) {
158
+ return item.value === value;
159
+ })) {
160
+ field.setValue(undefined);
161
+ }
162
+ }
163
+ }
164
+
165
+ var nextState = {};
166
+ Object.keys(state).forEach(function (stateKey) {
167
+ nextState[stateKey] = getParsedValue(state[stateKey], contextScope);
168
+ });
169
+ field.setState(nextState);
170
+ var nextProps = {};
171
+ Object.keys(props).forEach(function (propsKey) {
172
+ nextProps[propsKey] = getParsedValue(props[propsKey], contextScope);
173
+ });
174
+ field.setComponentProps(nextProps);
175
+ } else {
176
+ var formState = form.getState();
177
+
178
+ if (dataSourceFilter || dataSourceHide) {
179
+ var _sourceDataSource = field.getState()._sourceDataSource;
180
+
181
+ _sourceDataSource && field.setDataSource(_sourceDataSource);
182
+ }
183
+
184
+ var _nextState = {};
185
+ Object.keys(state).forEach(function (stateKey) {
186
+ _nextState[stateKey] = stateKey in item ? item[stateKey] : formState[stateKey];
187
+ });
188
+ field.setState(_nextState);
189
+ var _nextProps = {};
190
+ Object.keys(props).forEach(function (propsKey) {
191
+ _nextProps[propsKey] = item.props ? item.props[propsKey] : undefined;
192
+ });
193
+ field.setComponentProps(_nextProps);
194
+ }
195
+ });
196
+ });
197
+ (_item$onChange = item.onChange) === null || _item$onChange === void 0 ? void 0 : _item$onChange.forEach(function (onChange) {
198
+ onFieldValueChange(item.name, function (field) {
199
+ var contextScope = _objectSpread(_objectSpread({}, scope), {}, {
200
+ $form: form,
201
+ $self: field,
202
+ $values: form.values
203
+ });
204
+
205
+ var values = onChange.values;
206
+
207
+ if (bingo(onChange, contextScope)) {
208
+ Object.keys(values).forEach(function (valuesKey) {
209
+ form.setValuesIn(valuesKey, getParsedValue(values[valuesKey], contextScope));
210
+ });
211
+ }
212
+ });
213
+ });
214
+ } else if (item.children) {
215
+ loopAddFieldEffect(item.children, form, scope);
216
+ }
217
+ });
218
+ }
219
+ };
220
+
221
+ export default (function (form, schema, scope) {
222
+ form.addEffects('cascade', function () {
223
+ loopAddFieldEffect(schema, form, scope);
224
+ });
225
+ });
@@ -17,6 +17,7 @@ import { toJS } from '@formily/reactive';
17
17
  import { Form, Upload, SelectTable, FormLayout, FormItem, ArrayCollapse, ArrayCards, ArrayItems, ArrayTable, Space, FormGrid, FormTab, FormCollapse, FormStep, Editable, FormDialog, FormDrawer, FormButtonGroup, Submit, Reset } from '@teamix/formily';
18
18
  import { Affix } from '@alicloudfe/components';
19
19
  import ProFieldComponents from '../Components/ProField';
20
+ import addCascadeEffect from './addCascadeEffect';
20
21
  import { EditableDialog, EditableDrawer, EditablePopover } from '../Components/Editable';
21
22
  import FormGroup from '../Components/FormGroup';
22
23
  import LightFilter from '../Components/LightFilter';
@@ -80,17 +81,19 @@ var ProForm = /*#__PURE__*/memo(function (_ref) {
80
81
  globalComponents = _ref2.components,
81
82
  globalScope = _ref2.scope;
82
83
 
84
+ var mergedScope = _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, context), globalScope), scope), {}, {
85
+ context: context
86
+ });
87
+
83
88
  var form = useMemo(function () {
84
- return outerForm || createForm({
89
+ var nextForm = outerForm || createForm({
85
90
  validateFirst: validateFirst
86
91
  });
92
+ addCascadeEffect(nextForm, schema, mergedScope);
93
+ return nextForm;
87
94
  }, [outerForm]);
88
95
  var prefixCls = usePrefixCls('teamix-pro-form'); // 由于Actions需要,解构context供使用。原context键名的上下文继续保留。
89
96
 
90
- var mergedScope = _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, context), globalScope), scope), {}, {
91
- context: context
92
- });
93
-
94
97
  var mergedComponents = _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, globalComponents), components), formilyComponents), ProFieldComponents);
95
98
 
96
99
  var onAutoSubmit = useAutoSubmit(onSubmit, context);
@@ -34,6 +34,24 @@ export interface ProFormRequestConfig extends Omit<ProFormCommonRequestConfig, '
34
34
  extraConfig?: AnyObject;
35
35
  onComplete?: (res?: any, field?: any, context?: any) => any;
36
36
  }
37
+ export interface CascadeWhen {
38
+ left: string;
39
+ op: string;
40
+ right: any;
41
+ }
42
+ export interface Cascade {
43
+ when: CascadeWhen[];
44
+ logic?: '||' | '&&';
45
+ props?: any;
46
+ state?: any;
47
+ dataSourceFilter?: any[];
48
+ dataSourceHide?: any[];
49
+ }
50
+ export interface OnChange {
51
+ when: CascadeWhen[];
52
+ logic?: '||' | '&&';
53
+ values: any;
54
+ }
37
55
  export interface ProFormSchemaItem {
38
56
  type?: string;
39
57
  name?: string;
@@ -61,6 +79,8 @@ export interface ProFormSchemaItem {
61
79
  default?: any;
62
80
  request?: ProFormRequestConfig | ProFormRequestConfig[];
63
81
  data?: AnyObject;
82
+ cascade?: Cascade[];
83
+ onChange?: OnChange[];
64
84
  }
65
85
  export declare type ProFormSchema = ProFormSchemaItem[];
66
86
  interface AutoLayout {
package/es/index.d.ts CHANGED
@@ -28,5 +28,5 @@ export * from './table';
28
28
  export * from './sidebar';
29
29
  export * from './utils';
30
30
  export * from './timeline';
31
- declare const version = "1.4.25";
31
+ declare const version = "1.4.27";
32
32
  export { version, ProAction, ProCard, ProField, ProForm, ProInfo, ProPageContainer, ProPageHeader, ProSkeleton, ProTable, ProSidebar, ProTimeline, TeamixIcon, hooks, nocode, templates, utils, };
package/es/index.js CHANGED
@@ -18,6 +18,7 @@ import * as nocode from './nocode';
18
18
  import * as templates from './templates';
19
19
  import TeamixIcon from '@teamix/icon';
20
20
  import './global.scss'; // 设置图标源
21
+ // @ts-ignore
21
22
 
22
23
  if (!((_window = window) === null || _window === void 0 ? void 0 : _window.TEAMIXPRO_WITHOUT_ICON)) {
23
24
  TeamixIcon.setConfig(utils.getTeamixIconConfig());
@@ -36,6 +37,6 @@ export * from './table';
36
37
  export * from './sidebar';
37
38
  export * from './utils';
38
39
  export * from './timeline';
39
- var version = '1.4.25';
40
+ var version = '1.4.27';
40
41
  export { version, ProAction, ProCard, ProField, ProForm, ProInfo, // ProLayout,
41
42
  ProPageContainer, ProPageHeader, ProSkeleton, ProTable, ProSidebar, ProTimeline, TeamixIcon, hooks, nocode, templates, utils };
@@ -1,4 +1,4 @@
1
- var _excluded = ["children", "searchPlaceholder", "showSearch", "searchProps", "customSearch", "searchOnChange", "message", "messageProps", "customMessage", "scrollArea", "showExpandAll", "showExpandLevel", "onExpandAllChange", "onExpandLevelChange", "expandLevel", "isTree"];
1
+ var _excluded = ["children", "searchPlaceholder", "showSearch", "searchProps", "customSearch", "searchOnChange", "message", "messageProps", "customMessage", "scrollArea", "showExpandAll", "showExpandLevel", "onExpandAllChange", "onExpandLevelChange", "expandLevel", "expandLevelState", "expandAllState", "isTree"];
2
2
 
3
3
  function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
4
4
 
@@ -59,6 +59,10 @@ var ProSidebarContainer = function ProSidebarContainer(props) {
59
59
  onExpandLevelChange = props.onExpandLevelChange,
60
60
  _props$expandLevel = props.expandLevel,
61
61
  expandLevel = _props$expandLevel === void 0 ? 1 : _props$expandLevel,
62
+ _props$expandLevelSta = props.expandLevelState,
63
+ expandLevelStateProp = _props$expandLevelSta === void 0 ? 1 : _props$expandLevelSta,
64
+ _props$expandAllState = props.expandAllState,
65
+ expandAllStateProp = _props$expandAllState === void 0 ? false : _props$expandAllState,
62
66
  isTree = props.isTree,
63
67
  others = _objectWithoutProperties(props, _excluded);
64
68
 
@@ -92,7 +96,19 @@ var ProSidebarContainer = function ProSidebarContainer(props) {
92
96
  setTreeHeight("calc(100% - ".concat(remainHeight, "px + 16px)"));
93
97
  }
94
98
  }
95
- }, []); // 渲染搜索区域
99
+ }, []);
100
+ useEffect(function () {
101
+ setExpandLevelState(expandLevelStateProp);
102
+ setTimeout(function () {
103
+ onExpandLevelChange === null || onExpandLevelChange === void 0 ? void 0 : onExpandLevelChange(expandLevelStateProp);
104
+ });
105
+ }, [expandLevelStateProp]);
106
+ useEffect(function () {
107
+ setExpandAllState(expandAllStateProp);
108
+ setTimeout(function () {
109
+ onExpandAllChange === null || onExpandAllChange === void 0 ? void 0 : onExpandAllChange(expandAllStateProp);
110
+ });
111
+ }, [expandAllStateProp]); // 渲染搜索区域
96
112
 
97
113
  var renderSearch = function renderSearch() {
98
114
  if (customSearch || showSearch) {
@@ -1,12 +1,13 @@
1
1
  .teamix-pro-sidebar-container {
2
2
  min-width: 180px;
3
- .teamix-pro-card.compacted >.next-card-header{
3
+
4
+ .teamix-pro-card.compacted > .next-card-header {
4
5
  padding: 16px 0px;
5
6
  margin: 0;
6
-
7
+
7
8
  }
8
9
 
9
- .next-card .next-card-header-extra{
10
+ .next-card .next-card-header-extra {
10
11
  margin-top: 2px;
11
12
  }
12
13
 
@@ -27,38 +28,44 @@
27
28
  }
28
29
 
29
30
 
30
- &.teamix-pro-sidebar-container &-context{
31
- overflow-y: hidden;
32
-
33
- &:hover{
31
+ &.teamix-pro-sidebar-container &-context {
32
+ //overflow-y: hidden;
33
+
34
+ &:hover {
34
35
  overflow-y: auto;
35
36
  }
37
+
38
+ .next-tree-switcher.next-noop-line.next-noop-line-noroot {
39
+ flex-shrink: 0;
40
+ }
41
+
36
42
  }
37
43
 
38
44
 
39
- &-not-is-tree{
45
+ &-not-is-tree {
40
46
 
41
- .teamix-pro-card.compacted >.next-card-header{
47
+ .teamix-pro-card.compacted > .next-card-header {
42
48
  padding: 16px 8px;
43
49
  margin: 0;
44
50
  }
45
- .teamix-pro-sidebar-container-context{
51
+
52
+ .teamix-pro-sidebar-container-context {
46
53
  padding: 0;
47
54
  }
48
55
 
49
- .teamix-pro-sidebar-container-search{
56
+ .teamix-pro-sidebar-container-search {
50
57
  padding: 0 8px;
51
58
  }
52
59
 
53
- .teamix-pro-sidebar-container-search-has-message{
60
+ .teamix-pro-sidebar-container-search-has-message {
54
61
  padding: 0 8px;
55
62
  }
56
63
 
57
- .teamix-pro-sidebar-container-notice{
64
+ .teamix-pro-sidebar-container-notice {
58
65
  padding: 0 8px;
59
66
  }
60
67
 
61
- .teamix-pro-sidebar-container-fold{
68
+ .teamix-pro-sidebar-container-fold {
62
69
  padding: 0 8px;
63
70
  }
64
71
 
@@ -131,21 +131,39 @@ var ProSidebarTree = function ProSidebarTree(props) {
131
131
  }, [dataSourceProp]); // 监听展开全部事件
132
132
 
133
133
  useUpdateEffect(function () {
134
+ onChangeExpandAll();
135
+ }, [expandAll]); // 监听展开层级事件
136
+
137
+ useUpdateEffect(function () {
138
+ onChangeExpandLevel();
139
+ }, [expandLevel]); // 监听 DataSource 变化事件
140
+
141
+ useEffect(function () {
142
+ onDataSourceChange === null || onDataSourceChange === void 0 ? void 0 : onDataSourceChange(dataSource); // 更新层级状态
143
+
144
+ if (expandAll) {
145
+ onChangeExpandAll();
146
+ }
147
+
148
+ if (expandLevel > 1) {
149
+ onChangeExpandLevel();
150
+ }
151
+ }, [dataSource]); // 展开全部事件
152
+
153
+ var onChangeExpandAll = function onChangeExpandAll() {
134
154
  if (expandAll) {
135
155
  setExpandedKeys(getAllNodeKey(dataSource));
136
156
  } else {
137
157
  setExpandedKeys([]);
138
158
  }
139
- }, [expandAll]); // 监听展开层级事件
159
+ }; // 展开层级事件
140
160
 
141
- useUpdateEffect(function () {
161
+
162
+ var onChangeExpandLevel = function onChangeExpandLevel() {
142
163
  var keys = getTreeLevelKey(dataSource, expandLevel - 1);
143
164
  setExpandedKeys(keys);
144
- }, [expandLevel]); // 监听 DataSource 变化事件
165
+ }; // 绑定actionRef
145
166
 
146
- useEffect(function () {
147
- onDataSourceChange === null || onDataSourceChange === void 0 ? void 0 : onDataSourceChange(dataSource);
148
- }, [dataSource]); // 绑定actionRef
149
167
 
150
168
  useActionType(actionRef, {
151
169
  setTreeNode: function setTreeNode(treeNode) {
@@ -221,7 +221,7 @@ export function renderTreeNodeDependenceValue(data, onBeforeRenderNodeEvent, che
221
221
  newProps = onBeforeRenderNodeEvent(item, checkedKeys, selectedKeys, allData !== null && allData !== void 0 ? allData : data);
222
222
  }
223
223
 
224
- var _getTreeNodeProps2 = getTreeNodeProps(item),
224
+ var _getTreeNodeProps2 = getTreeNodeProps(newProps),
225
225
  nodeProps = _getTreeNodeProps2.nodeProps,
226
226
  labelProps = _getTreeNodeProps2.labelProps;
227
227
 
@@ -50,6 +50,12 @@
50
50
  font-weight: unset;
51
51
  }
52
52
  }
53
+ // 选中图标变色
54
+ .next-tree-node-inner.next-selected {
55
+ .teamix-icon.teamix-pro-filed-output-prefix-icon {
56
+ color: var(--color-brand1-6) !important;
57
+ }
58
+ }
53
59
  }
54
60
  .teamix-pro-sidebar-deep-1 {
55
61
  .teamix-pro-sidebar-tree {
@@ -88,6 +88,8 @@ export declare type ProSidebarContainerProps = {
88
88
  scrollArea?: 'all' | 'tree';
89
89
  /** 是否显示展开全部 */
90
90
  showExpandAll?: boolean;
91
+ /** 展开全部 状态 */
92
+ expandAllState?: boolean;
91
93
  /** 是否显示展开层级 */
92
94
  showExpandLevel?: boolean;
93
95
  /** 展开全部变化回调 */
@@ -96,6 +98,8 @@ export declare type ProSidebarContainerProps = {
96
98
  onExpandLevelChange?: (state: number) => void;
97
99
  /** 展开层级 层级 */
98
100
  expandLevel?: number;
101
+ /** 展开层级 当前所展示层级 */
102
+ expandLevelState?: number;
99
103
  /** 列表 or tree */
100
104
  isTree?: boolean;
101
105
  } & ProCardProps;
@@ -1,7 +1,7 @@
1
1
  $prefix: 'teamix-pro-table-layout';
2
2
 
3
3
  .theme-hybridcloud-dark {
4
- --panel-filter-bg: #1f1f1f;
4
+ --panel-filter-bg: #141414;
5
5
  }
6
6
 
7
7
  .#{$prefix} {
@@ -77,6 +77,7 @@ var DensityIcon = function DensityIcon(props) {
77
77
  size: "small",
78
78
  type: "space-line"
79
79
  })),
80
+ followTrigger: true,
80
81
  visible: dropdownVisible,
81
82
  onVisibleChange: function onVisibleChange(state) {
82
83
  setTooltipVisible(false);
@@ -265,6 +265,8 @@ var FilterColumnIcon = function FilterColumnIcon(props) {
265
265
  setTooltipVisible(false);
266
266
  setDropdownVisible(state);
267
267
  },
268
+ followTrigger: true,
269
+ cache: true,
268
270
  triggerType: ['click'],
269
271
  align: "tr br"
270
272
  }, /*#__PURE__*/React.createElement("div", {