@kdcloudjs/table 1.2.0-canary.5 → 1.2.0-canary.6
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/dist/@kdcloudjs/table.css +1 -1
- package/dist/@kdcloudjs/table.js +28 -14
- package/dist/@kdcloudjs/table.js.map +1 -1
- package/dist/@kdcloudjs/table.min.css +1 -1
- package/dist/@kdcloudjs/table.min.js +3 -3
- package/dist/@kdcloudjs/table.min.js.map +1 -1
- package/es/locale/locale.d.ts +8 -4
- package/es/locale/zh-CN.d.ts +8 -4
- package/es/locale/zh-CN.js +10 -4
- package/es/table/interfaces.d.ts +3 -0
- package/es/table/pipeline/features/columnFilter.js +3 -1
- package/es/table/pipeline/features/filter/DefaultFilterContent.d.ts +1 -1
- package/es/table/pipeline/features/filter/DefaultFilterContent.js +11 -5
- package/es/table/pipeline/features/filter/Filter.d.ts +4 -1
- package/es/table/pipeline/features/filter/Filter.js +4 -2
- package/lib/locale/locale.d.ts +8 -4
- package/lib/locale/zh-CN.d.ts +8 -4
- package/lib/locale/zh-CN.js +10 -4
- package/lib/table/interfaces.d.ts +3 -0
- package/lib/table/pipeline/features/columnFilter.js +3 -1
- package/lib/table/pipeline/features/filter/DefaultFilterContent.d.ts +1 -1
- package/lib/table/pipeline/features/filter/DefaultFilterContent.js +11 -5
- package/lib/table/pipeline/features/filter/Filter.d.ts +4 -1
- package/lib/table/pipeline/features/filter/Filter.js +4 -2
- package/package.json +1 -1
package/es/locale/locale.d.ts
CHANGED
|
@@ -26,10 +26,14 @@ declare class LocaleCache {
|
|
|
26
26
|
*/
|
|
27
27
|
setLocalesData(locale: string, localeData?: LocaleDataType): {
|
|
28
28
|
locale: string;
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
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
|
* 获取当前语言包数据
|
package/es/locale/zh-CN.d.ts
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
declare const locale: {
|
|
2
2
|
locale: string;
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
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;
|
package/es/locale/zh-CN.js
CHANGED
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
var locale = {
|
|
2
2
|
locale: 'zh-CN',
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
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;
|
package/es/table/interfaces.d.ts
CHANGED
|
@@ -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:
|
|
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
|
-
},
|
|
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
|
-
},
|
|
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
|
};
|
package/lib/locale/locale.d.ts
CHANGED
|
@@ -26,10 +26,14 @@ declare class LocaleCache {
|
|
|
26
26
|
*/
|
|
27
27
|
setLocalesData(locale: string, localeData?: LocaleDataType): {
|
|
28
28
|
locale: string;
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
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
|
* 获取当前语言包数据
|
package/lib/locale/zh-CN.d.ts
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
declare const locale: {
|
|
2
2
|
locale: string;
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
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;
|
package/lib/locale/zh-CN.js
CHANGED
|
@@ -6,10 +6,16 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var locale = {
|
|
8
8
|
locale: 'zh-CN',
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
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;
|
|
@@ -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:
|
|
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
|
-
},
|
|
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
|
-
},
|
|
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
|
};
|