@kdcloudjs/table 1.2.0-canary.5 → 1.2.0-canary.6-hotfix.1

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.
@@ -26,10 +26,14 @@ declare class LocaleCache {
26
26
  */
27
27
  setLocalesData(locale: string, localeData?: LocaleDataType): {
28
28
  locale: string;
29
- 'global.selectholder': string;
30
- 'global.placeholder': string;
31
- 'global.cancel': string;
32
- 'global.confirm': string;
29
+ contain: string;
30
+ notContain: string;
31
+ equal: string;
32
+ notEqual: string;
33
+ isNull: string;
34
+ notIsNull: string;
35
+ resetFilter: string;
36
+ confirmFilter: string;
33
37
  };
34
38
  /**
35
39
  * 获取当前语言包数据
@@ -1,8 +1,12 @@
1
1
  declare const locale: {
2
2
  locale: string;
3
- 'global.selectholder': string;
4
- 'global.placeholder': string;
5
- 'global.cancel': string;
6
- 'global.confirm': string;
3
+ contain: string;
4
+ notContain: string;
5
+ equal: string;
6
+ notEqual: string;
7
+ isNull: string;
8
+ notIsNull: string;
9
+ resetFilter: string;
10
+ confirmFilter: string;
7
11
  };
8
12
  export default locale;
@@ -1,8 +1,14 @@
1
1
  var locale = {
2
2
  locale: 'zh-CN',
3
- 'global.selectholder': '请选择',
4
- 'global.placeholder': '请输入...',
5
- 'global.cancel': '取消',
6
- 'global.confirm': '确定'
3
+ // Text Filter
4
+ contain: '包含',
5
+ notContain: '不包含',
6
+ equal: '等于',
7
+ notEqual: '不等于',
8
+ isNull: '为空',
9
+ notIsNull: '不为空',
10
+ // filter button
11
+ resetFilter: '重置',
12
+ confirmFilter: '确定'
7
13
  };
8
14
  export default locale;
@@ -222,6 +222,9 @@ export var BaseTable = /*#__PURE__*/function (_React$Component) {
222
222
  var tableBodyHtmlTable = this.domHelper.getTableBodyHtmlTable();
223
223
  var innerTableWidth = tableBodyHtmlTable.offsetWidth;
224
224
  var artTableWidth = artTable.offsetWidth;
225
+ var artTableHeight = artTable.offsetHeight; // 表格隐藏后,不需要对表格的滚动条做额外的逻辑处理
226
+
227
+ if (artTableWidth === 0 && artTableHeight === 0) return;
225
228
  var stickyScrollHeightProp = this.props.stickyScrollHeight;
226
229
  var stickyScrollHeight = stickyScrollHeightProp === 'auto' ? this.getScrollBarWidth() : stickyScrollHeightProp; // stickyScroll.style.marginTop = `-${stickyScrollHeight + 1}px`
227
230
  // 设置滚动条高度
@@ -90,6 +90,9 @@ export interface FilterPanelProps {
90
90
  export interface DefaultFilterPanelProps extends FilterPanelProps {
91
91
  setFilterModel(filterItem?: Pick<FilterItem, 'filter' | 'filterCondition'>): void;
92
92
  filterModel: FilterItem;
93
+ localeText: {
94
+ [key: string]: string;
95
+ };
93
96
  }
94
97
  export interface CustomeFilterPanelProps extends FilterPanelProps {
95
98
  setFilter(filter?: any[]): void;
@@ -37,6 +37,7 @@ export function filter() {
37
37
  var inputFiltersMap = new _Map(_mapInstanceProperty(inputFilters).call(inputFilters, function (filterItem) {
38
38
  return [filterItem.code, _extends({}, filterItem)];
39
39
  }));
40
+ var localeText = pipeline.ctx.localeText;
40
41
 
41
42
  function processColumns(columns) {
42
43
  return _mapInstanceProperty(columns).call(columns, dfs);
@@ -97,7 +98,8 @@ export function filter() {
97
98
  stopClickEventPropagation: stopClickEventPropagation,
98
99
  stopESCKeyDownEventPropagation: stopESCKeyDownEventPropagation,
99
100
  hideFilterPopupHeader: hideFilterPopupHeader,
100
- getPopupParent: getPopupParent
101
+ getPopupParent: getPopupParent,
102
+ localeText: localeText
101
103
  })]); // result.headerCellProps = mergeCellProps(col.headerCellProps, {
102
104
  // style: {
103
105
  // paddingRight: '18px'
@@ -1,4 +1,4 @@
1
1
  /// <reference types="react" />
2
2
  import { DefaultFilterPanelProps } from '../../../interfaces';
3
- declare function DefaultFilterContent({ setFilterModel, filterModel, hidePanel }: DefaultFilterPanelProps): JSX.Element;
3
+ declare function DefaultFilterContent({ setFilterModel, filterModel, hidePanel, localeText }: DefaultFilterPanelProps): JSX.Element;
4
4
  export default DefaultFilterContent;
@@ -19,7 +19,11 @@ function DefaultFilterContent(_ref) {
19
19
 
20
20
  var setFilterModel = _ref.setFilterModel,
21
21
  filterModel = _ref.filterModel,
22
- hidePanel = _ref.hidePanel;
22
+ hidePanel = _ref.hidePanel,
23
+ _ref$localeText = _ref.localeText,
24
+ localeText = _ref$localeText === void 0 ? {} : _ref$localeText;
25
+
26
+ var _a, _b;
23
27
 
24
28
  var _React$useState = React.useState((filterModel === null || filterModel === void 0 ? void 0 : filterModel.filterCondition) || 'contain'),
25
29
  _React$useState2 = _slicedToArray(_React$useState, 2),
@@ -72,16 +76,18 @@ function DefaultFilterContent(_ref) {
72
76
  return /*#__PURE__*/React.createElement(DefaultFilterContentStyle, null, /*#__PURE__*/React.createElement("div", {
73
77
  className: 'filter-option-list'
74
78
  }, /*#__PURE__*/React.createElement("ul", null, _mapInstanceProperty(DEFAULT_FILTER_OPTIONS).call(DEFAULT_FILTER_OPTIONS, function (option, index) {
79
+ var _a;
80
+
75
81
  return (
76
82
  /*#__PURE__*/
77
83
  // eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions
78
84
  React.createElement("li", {
79
- key: index,
85
+ key: option.key,
80
86
  className: option.key === selectedValue ? 'active' : '',
81
87
  onClick: function onClick() {
82
88
  return handleClick(option);
83
89
  }
84
- }, option.title)
90
+ }, (_a = localeText[option.key]) !== null && _a !== void 0 ? _a : option.title)
85
91
  );
86
92
  }))), selectedValue !== 'notIsNull' && selectedValue !== 'isNull' && /*#__PURE__*/React.createElement("div", {
87
93
  className: 'filter-search'
@@ -100,12 +106,12 @@ function DefaultFilterContent(_ref) {
100
106
  'filter-btn': true
101
107
  }, Classes.button, true)),
102
108
  onClick: reset
103
- }, "\u91CD\u7F6E"), /*#__PURE__*/React.createElement("button", {
109
+ }, (_a = localeText.resetFilter) !== null && _a !== void 0 ? _a : '重置'), /*#__PURE__*/React.createElement("button", {
104
110
  className: cx((_cx2 = {
105
111
  'filter-btn': true
106
112
  }, _defineProperty(_cx2, Classes.button, true), _defineProperty(_cx2, Classes.buttonPrimary, true), _cx2)),
107
113
  onClick: confirm
108
- }, "\u786E\u5B9A")));
114
+ }, (_b = localeText.confirmFilter) !== null && _b !== void 0 ? _b : '确定')));
109
115
  }
110
116
 
111
117
  export default DefaultFilterContent;
@@ -15,6 +15,9 @@ interface FilterProps {
15
15
  stopESCKeyDownEventPropagation?: boolean;
16
16
  hideFilterPopupHeader?: boolean;
17
17
  getPopupParent?: (triggerElement: HTMLElement) => HTMLElement;
18
+ localeText?: {
19
+ [key: string]: string;
20
+ };
18
21
  }
19
- declare function Filter({ size, style, className, FilterPanelContent, filterIcon, setFilter, setFilterModel, filterModel, isFilterActive, stopClickEventPropagation, stopESCKeyDownEventPropagation, hideFilterPopupHeader, getPopupParent }: FilterProps): JSX.Element;
22
+ declare function Filter({ size, style, className, FilterPanelContent, filterIcon, setFilter, setFilterModel, filterModel, isFilterActive, stopClickEventPropagation, stopESCKeyDownEventPropagation, hideFilterPopupHeader, getPopupParent, localeText }: FilterProps): JSX.Element;
20
23
  export default Filter;
@@ -77,7 +77,8 @@ function Filter(_ref2) {
77
77
  stopClickEventPropagation = _ref2.stopClickEventPropagation,
78
78
  stopESCKeyDownEventPropagation = _ref2.stopESCKeyDownEventPropagation,
79
79
  hideFilterPopupHeader = _ref2.hideFilterPopupHeader,
80
- getPopupParent = _ref2.getPopupParent;
80
+ getPopupParent = _ref2.getPopupParent,
81
+ localeText = _ref2.localeText;
81
82
 
82
83
  var _React$useState3 = React.useState(false),
83
84
  _React$useState4 = _slicedToArray(_React$useState3, 2),
@@ -104,7 +105,8 @@ function Filter(_ref2) {
104
105
  setFilterModel: setFilterModel,
105
106
  filterModel: filterModel,
106
107
  isFilterActive: isFilterActive,
107
- hidePanel: hidePanel
108
+ hidePanel: hidePanel,
109
+ localeText: localeText
108
110
  });
109
111
  }
110
112
  };
@@ -26,10 +26,14 @@ declare class LocaleCache {
26
26
  */
27
27
  setLocalesData(locale: string, localeData?: LocaleDataType): {
28
28
  locale: string;
29
- 'global.selectholder': string;
30
- 'global.placeholder': string;
31
- 'global.cancel': string;
32
- 'global.confirm': string;
29
+ contain: string;
30
+ notContain: string;
31
+ equal: string;
32
+ notEqual: string;
33
+ isNull: string;
34
+ notIsNull: string;
35
+ resetFilter: string;
36
+ confirmFilter: string;
33
37
  };
34
38
  /**
35
39
  * 获取当前语言包数据
@@ -1,8 +1,12 @@
1
1
  declare const locale: {
2
2
  locale: string;
3
- 'global.selectholder': string;
4
- 'global.placeholder': string;
5
- 'global.cancel': string;
6
- 'global.confirm': string;
3
+ contain: string;
4
+ notContain: string;
5
+ equal: string;
6
+ notEqual: string;
7
+ isNull: string;
8
+ notIsNull: string;
9
+ resetFilter: string;
10
+ confirmFilter: string;
7
11
  };
8
12
  export default locale;
@@ -6,10 +6,16 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.default = void 0;
7
7
  var locale = {
8
8
  locale: 'zh-CN',
9
- 'global.selectholder': '请选择',
10
- 'global.placeholder': '请输入...',
11
- 'global.cancel': '取消',
12
- 'global.confirm': '确定'
9
+ // Text Filter
10
+ contain: '包含',
11
+ notContain: '不包含',
12
+ equal: '等于',
13
+ notEqual: '不等于',
14
+ isNull: '为空',
15
+ notIsNull: '不为空',
16
+ // filter button
17
+ resetFilter: '重置',
18
+ confirmFilter: '确定'
13
19
  };
14
20
  var _default = locale;
15
21
  exports.default = _default;
@@ -273,6 +273,9 @@ var BaseTable = /*#__PURE__*/function (_React$Component) {
273
273
  var tableBodyHtmlTable = this.domHelper.getTableBodyHtmlTable();
274
274
  var innerTableWidth = tableBodyHtmlTable.offsetWidth;
275
275
  var artTableWidth = artTable.offsetWidth;
276
+ var artTableHeight = artTable.offsetHeight; // 表格隐藏后,不需要对表格的滚动条做额外的逻辑处理
277
+
278
+ if (artTableWidth === 0 && artTableHeight === 0) return;
276
279
  var stickyScrollHeightProp = this.props.stickyScrollHeight;
277
280
  var stickyScrollHeight = stickyScrollHeightProp === 'auto' ? this.getScrollBarWidth() : stickyScrollHeightProp; // stickyScroll.style.marginTop = `-${stickyScrollHeight + 1}px`
278
281
  // 设置滚动条高度
@@ -90,6 +90,9 @@ export interface FilterPanelProps {
90
90
  export interface DefaultFilterPanelProps extends FilterPanelProps {
91
91
  setFilterModel(filterItem?: Pick<FilterItem, 'filter' | 'filterCondition'>): void;
92
92
  filterModel: FilterItem;
93
+ localeText: {
94
+ [key: string]: string;
95
+ };
93
96
  }
94
97
  export interface CustomeFilterPanelProps extends FilterPanelProps {
95
98
  setFilter(filter?: any[]): void;
@@ -63,6 +63,7 @@ function filter() {
63
63
  var inputFiltersMap = new _map.default((0, _map2.default)(inputFilters).call(inputFilters, function (filterItem) {
64
64
  return [filterItem.code, (0, _extends2.default)({}, filterItem)];
65
65
  }));
66
+ var localeText = pipeline.ctx.localeText;
66
67
 
67
68
  function processColumns(columns) {
68
69
  return (0, _map2.default)(columns).call(columns, dfs);
@@ -120,7 +121,8 @@ function filter() {
120
121
  stopClickEventPropagation: stopClickEventPropagation,
121
122
  stopESCKeyDownEventPropagation: stopESCKeyDownEventPropagation,
122
123
  hideFilterPopupHeader: hideFilterPopupHeader,
123
- getPopupParent: getPopupParent
124
+ getPopupParent: getPopupParent,
125
+ localeText: localeText
124
126
  })]); // result.headerCellProps = mergeCellProps(col.headerCellProps, {
125
127
  // style: {
126
128
  // paddingRight: '18px'
@@ -1,4 +1,4 @@
1
1
  /// <reference types="react" />
2
2
  import { DefaultFilterPanelProps } from '../../../interfaces';
3
- declare function DefaultFilterContent({ setFilterModel, filterModel, hidePanel }: DefaultFilterPanelProps): JSX.Element;
3
+ declare function DefaultFilterContent({ setFilterModel, filterModel, hidePanel, localeText }: DefaultFilterPanelProps): JSX.Element;
4
4
  export default DefaultFilterContent;
@@ -48,7 +48,11 @@ function DefaultFilterContent(_ref) {
48
48
 
49
49
  var setFilterModel = _ref.setFilterModel,
50
50
  filterModel = _ref.filterModel,
51
- hidePanel = _ref.hidePanel;
51
+ hidePanel = _ref.hidePanel,
52
+ _ref$localeText = _ref.localeText,
53
+ localeText = _ref$localeText === void 0 ? {} : _ref$localeText;
54
+
55
+ var _a, _b;
52
56
 
53
57
  var _React$useState = _react.default.useState((filterModel === null || filterModel === void 0 ? void 0 : filterModel.filterCondition) || 'contain'),
54
58
  _React$useState2 = (0, _slicedToArray2.default)(_React$useState, 2),
@@ -102,16 +106,18 @@ function DefaultFilterContent(_ref) {
102
106
  return /*#__PURE__*/_react.default.createElement(DefaultFilterContentStyle, null, /*#__PURE__*/_react.default.createElement("div", {
103
107
  className: 'filter-option-list'
104
108
  }, /*#__PURE__*/_react.default.createElement("ul", null, (0, _map.default)(_util.DEFAULT_FILTER_OPTIONS).call(_util.DEFAULT_FILTER_OPTIONS, function (option, index) {
109
+ var _a;
110
+
105
111
  return (
106
112
  /*#__PURE__*/
107
113
  // eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions
108
114
  _react.default.createElement("li", {
109
- key: index,
115
+ key: option.key,
110
116
  className: option.key === selectedValue ? 'active' : '',
111
117
  onClick: function onClick() {
112
118
  return handleClick(option);
113
119
  }
114
- }, option.title)
120
+ }, (_a = localeText[option.key]) !== null && _a !== void 0 ? _a : option.title)
115
121
  );
116
122
  }))), selectedValue !== 'notIsNull' && selectedValue !== 'isNull' && /*#__PURE__*/_react.default.createElement("div", {
117
123
  className: 'filter-search'
@@ -130,12 +136,12 @@ function DefaultFilterContent(_ref) {
130
136
  'filter-btn': true
131
137
  }, _styles.Classes.button, true)),
132
138
  onClick: reset
133
- }, "\u91CD\u7F6E"), /*#__PURE__*/_react.default.createElement("button", {
139
+ }, (_a = localeText.resetFilter) !== null && _a !== void 0 ? _a : '重置'), /*#__PURE__*/_react.default.createElement("button", {
134
140
  className: (0, _classnames.default)((_cx2 = {
135
141
  'filter-btn': true
136
142
  }, (0, _defineProperty2.default)(_cx2, _styles.Classes.button, true), (0, _defineProperty2.default)(_cx2, _styles.Classes.buttonPrimary, true), _cx2)),
137
143
  onClick: confirm
138
- }, "\u786E\u5B9A")));
144
+ }, (_b = localeText.confirmFilter) !== null && _b !== void 0 ? _b : '确定')));
139
145
  }
140
146
 
141
147
  var _default = DefaultFilterContent;
@@ -15,6 +15,9 @@ interface FilterProps {
15
15
  stopESCKeyDownEventPropagation?: boolean;
16
16
  hideFilterPopupHeader?: boolean;
17
17
  getPopupParent?: (triggerElement: HTMLElement) => HTMLElement;
18
+ localeText?: {
19
+ [key: string]: string;
20
+ };
18
21
  }
19
- declare function Filter({ size, style, className, FilterPanelContent, filterIcon, setFilter, setFilterModel, filterModel, isFilterActive, stopClickEventPropagation, stopESCKeyDownEventPropagation, hideFilterPopupHeader, getPopupParent }: FilterProps): JSX.Element;
22
+ declare function Filter({ size, style, className, FilterPanelContent, filterIcon, setFilter, setFilterModel, filterModel, isFilterActive, stopClickEventPropagation, stopESCKeyDownEventPropagation, hideFilterPopupHeader, getPopupParent, localeText }: FilterProps): JSX.Element;
20
23
  export default Filter;
@@ -110,7 +110,8 @@ function Filter(_ref2) {
110
110
  stopClickEventPropagation = _ref2.stopClickEventPropagation,
111
111
  stopESCKeyDownEventPropagation = _ref2.stopESCKeyDownEventPropagation,
112
112
  hideFilterPopupHeader = _ref2.hideFilterPopupHeader,
113
- getPopupParent = _ref2.getPopupParent;
113
+ getPopupParent = _ref2.getPopupParent,
114
+ localeText = _ref2.localeText;
114
115
 
115
116
  var _React$useState3 = _react.default.useState(false),
116
117
  _React$useState4 = (0, _slicedToArray2.default)(_React$useState3, 2),
@@ -138,7 +139,8 @@ function Filter(_ref2) {
138
139
  setFilterModel: setFilterModel,
139
140
  filterModel: filterModel,
140
141
  isFilterActive: isFilterActive,
141
- hidePanel: hidePanel
142
+ hidePanel: hidePanel,
143
+ localeText: localeText
142
144
  });
143
145
  }
144
146
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kdcloudjs/table",
3
- "version": "1.2.0-canary.5",
3
+ "version": "1.2.0-canary.6-hotfix.1",
4
4
  "description": "金蝶 react table 组件",
5
5
  "title": "table",
6
6
  "keywords": [
@@ -56,6 +56,7 @@
56
56
  "changelog": "conventional-changelog -p angular -i CHANGELOG.md -s --skip-unstable",
57
57
  "pub": "npm run test:all && npm run build && cross-env PUB_ENV=pub np --no-cleanup --no-tests",
58
58
  "pub:canary": "npm run build && cross-env PUB_ENV=pub np --no-cleanup --anyBranch --no-tests --tag=canary",
59
+ "pub:canary-hotfix": "npm run build && cross-env PUB_ENV=pub np --no-cleanup --anyBranch --no-tests --tag=canaryHotFix",
59
60
  "new": "node scripts/create-component.js",
60
61
  "kd-ui": "npm install @kingdee-ui/kui --registry http://npm.kingdee.com/"
61
62
  },