@orfium/ictinus 4.67.0 → 4.67.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.
|
@@ -87,24 +87,17 @@ function Table(_ref) {
|
|
|
87
87
|
return Boolean(row.expanded);
|
|
88
88
|
});
|
|
89
89
|
var columnCount = getColumnCount(columns, onCheck, hasExpandableRows);
|
|
90
|
-
(0, _react.useEffect)(function () {
|
|
91
|
-
if (onSort) {
|
|
92
|
-
onSort(sorting.column, sorting.order);
|
|
93
|
-
}
|
|
94
|
-
}, [onSort, sorting]);
|
|
95
90
|
/** when the selection of ids change then inform the user if onCheck callback provided **/
|
|
96
91
|
|
|
97
|
-
_react
|
|
92
|
+
(0, _react.useEffect)(function () {
|
|
98
93
|
if (onCheck && selectedIds) {
|
|
99
94
|
onCheck(selectedIds);
|
|
100
95
|
}
|
|
101
96
|
}, [onCheck, selectedIds]);
|
|
102
|
-
|
|
103
|
-
_react["default"].useEffect(function () {
|
|
97
|
+
(0, _react.useEffect)(function () {
|
|
104
98
|
// when data are fresh initialize the selectedIds state
|
|
105
99
|
setSelectedIds(undefined);
|
|
106
|
-
}, [data]);
|
|
107
|
-
|
|
100
|
+
}, [data]);
|
|
108
101
|
|
|
109
102
|
var onSelectionAdd = _react["default"].useCallback(function (rowId) {
|
|
110
103
|
setSelectedIds(function (selectedIds) {
|
|
@@ -148,6 +141,7 @@ function Table(_ref) {
|
|
|
148
141
|
var handleSorting = function handleSorting(column) {
|
|
149
142
|
setSorting(function (prevState) {
|
|
150
143
|
if (sortDir) {
|
|
144
|
+
onSort == null ? void 0 : onSort(column, sortDir);
|
|
151
145
|
return {
|
|
152
146
|
column: column,
|
|
153
147
|
order: sortDir
|
|
@@ -155,12 +149,14 @@ function Table(_ref) {
|
|
|
155
149
|
}
|
|
156
150
|
|
|
157
151
|
if (prevState.column !== column) {
|
|
152
|
+
onSort == null ? void 0 : onSort(column, 'asc');
|
|
158
153
|
return {
|
|
159
154
|
column: column,
|
|
160
155
|
order: 'asc'
|
|
161
156
|
};
|
|
162
157
|
}
|
|
163
158
|
|
|
159
|
+
onSort == null ? void 0 : onSort(column, prevState.order === 'asc' ? 'desc' : 'asc');
|
|
164
160
|
return {
|
|
165
161
|
column: column,
|
|
166
162
|
order: prevState.order === 'asc' ? 'desc' : 'asc'
|
|
@@ -268,6 +264,6 @@ function Table(_ref) {
|
|
|
268
264
|
}))));
|
|
269
265
|
}
|
|
270
266
|
|
|
271
|
-
var _default = /*#__PURE__*/_react
|
|
267
|
+
var _default = /*#__PURE__*/(0, _react.memo)(Table, _reactFastCompare["default"]);
|
|
272
268
|
|
|
273
269
|
exports["default"] = _default;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@orfium/ictinus",
|
|
3
|
-
"version": "4.67.
|
|
3
|
+
"version": "4.67.1",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"types": "./dist/index.d.ts",
|
|
6
6
|
"license": "MIT",
|
|
@@ -84,6 +84,7 @@
|
|
|
84
84
|
"styled-components": "^5.2.0",
|
|
85
85
|
"ts-jest": "^26.5.6",
|
|
86
86
|
"ts-loader": "^9.1.2",
|
|
87
|
+
"tsc-watch": "^5.0.3",
|
|
87
88
|
"typedoc": "^0.22.12",
|
|
88
89
|
"typescript": "4.2.4",
|
|
89
90
|
"url-loader": "^4.1.0"
|
|
@@ -129,6 +130,8 @@
|
|
|
129
130
|
"build:lib": "yarn build:partial:style && yarn build:partial:nostyle && yarn build:partial:types",
|
|
130
131
|
"build": "build-storybook -o build/",
|
|
131
132
|
"lint": "eslint './src/**/*.{ts,tsx}'",
|
|
133
|
+
"yalc:watch": "tsc-watch --noClear -p ./tsconfig.json --onSuccess \"yarn yalc:push\"",
|
|
134
|
+
"yalc:push": "yalc publish --push",
|
|
132
135
|
"test": "jest",
|
|
133
136
|
"test:watch": "jest --watch",
|
|
134
137
|
"test:update": "jest -u",
|