@datarobot/design-system 29.2.1 → 29.3.0
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/cjs/table-react/components/table.js +3 -1
- package/cjs/table-react/hooks/useInnerStateFallback.js +1 -1
- package/esm/table-react/components/table.js +3 -1
- package/esm/table-react/hooks/useInnerStateFallback.js +1 -1
- package/js/bundle/bundle.js +4 -2
- package/js/bundle/bundle.min.js +1 -1
- package/package.json +1 -1
|
@@ -147,7 +147,9 @@ function Table({
|
|
|
147
147
|
}
|
|
148
148
|
// Component width depends on Vertical scroll
|
|
149
149
|
}, [columnSizing, width, isVerticalScrollPresent]);
|
|
150
|
-
const decoratedColumns = (0, _useColumns.useColumns)(columns, enableCheckBoxes, width - (isVerticalScrollPresent ? _types.COLUMN_SIZE.SCROLL_OFFSET : 0),
|
|
150
|
+
const decoratedColumns = (0, _useColumns.useColumns)(columns, enableCheckBoxes, width - (isVerticalScrollPresent ? _types.COLUMN_SIZE.SCROLL_OFFSET : 0), visible || visibility,
|
|
151
|
+
// we do not update internal state when external one is updated so visibility might fall behind
|
|
152
|
+
columnSizing, isRowExpandEnabled, !!getRowActions, localizationProps?.tableBody);
|
|
151
153
|
const onChangeSize = fn => {
|
|
152
154
|
const nextData = typeof fn === 'function' ? fn(columnSizing) : fn;
|
|
153
155
|
const targetData = typeof fn === 'function' ? fn({}) : fn;
|
|
@@ -20,7 +20,7 @@ function useInnerStateFallback(onExternalStateUpdate, externalState, decoratorFn
|
|
|
20
20
|
const onChangeState = fn => {
|
|
21
21
|
// we are setting innerState and outer externalState as the same object "nextData"
|
|
22
22
|
// it means that their links should be equal. If their links are not equal, it means externalState was altered by the user
|
|
23
|
-
// thus
|
|
23
|
+
// thus external state should take precedence over inner state that has fallen behind
|
|
24
24
|
const currentState = externalState && externalState !== innerState ? externalState : innerState;
|
|
25
25
|
const nextData = typeof fn === 'function' ? fn(currentState) : fn;
|
|
26
26
|
const nextDecoratedData = decoratorFn(nextData);
|
|
@@ -139,7 +139,9 @@ export function Table({
|
|
|
139
139
|
}
|
|
140
140
|
// Component width depends on Vertical scroll
|
|
141
141
|
}, [columnSizing, width, isVerticalScrollPresent]);
|
|
142
|
-
const decoratedColumns = useColumns(columns, enableCheckBoxes, width - (isVerticalScrollPresent ? COLUMN_SIZE.SCROLL_OFFSET : 0),
|
|
142
|
+
const decoratedColumns = useColumns(columns, enableCheckBoxes, width - (isVerticalScrollPresent ? COLUMN_SIZE.SCROLL_OFFSET : 0), visible || visibility,
|
|
143
|
+
// we do not update internal state when external one is updated so visibility might fall behind
|
|
144
|
+
columnSizing, isRowExpandEnabled, !!getRowActions, localizationProps?.tableBody);
|
|
143
145
|
const onChangeSize = fn => {
|
|
144
146
|
const nextData = typeof fn === 'function' ? fn(columnSizing) : fn;
|
|
145
147
|
const targetData = typeof fn === 'function' ? fn({}) : fn;
|
|
@@ -14,7 +14,7 @@ export function useInnerStateFallback(onExternalStateUpdate, externalState, deco
|
|
|
14
14
|
const onChangeState = fn => {
|
|
15
15
|
// we are setting innerState and outer externalState as the same object "nextData"
|
|
16
16
|
// it means that their links should be equal. If their links are not equal, it means externalState was altered by the user
|
|
17
|
-
// thus
|
|
17
|
+
// thus external state should take precedence over inner state that has fallen behind
|
|
18
18
|
const currentState = externalState && externalState !== innerState ? externalState : innerState;
|
|
19
19
|
const nextData = typeof fn === 'function' ? fn(currentState) : fn;
|
|
20
20
|
const nextDecoratedData = decoratorFn(nextData);
|
package/js/bundle/bundle.js
CHANGED
|
@@ -78004,7 +78004,9 @@ function Table(_ref) {
|
|
|
78004
78004
|
}
|
|
78005
78005
|
// Component width depends on Vertical scroll
|
|
78006
78006
|
}, [columnSizing, width, isVerticalScrollPresent]);
|
|
78007
|
-
var decoratedColumns = (0,_hooks_useColumns__WEBPACK_IMPORTED_MODULE_9__.useColumns)(columns, enableCheckBoxes, width - (isVerticalScrollPresent ? _types__WEBPACK_IMPORTED_MODULE_18__.COLUMN_SIZE.SCROLL_OFFSET : 0),
|
|
78007
|
+
var decoratedColumns = (0,_hooks_useColumns__WEBPACK_IMPORTED_MODULE_9__.useColumns)(columns, enableCheckBoxes, width - (isVerticalScrollPresent ? _types__WEBPACK_IMPORTED_MODULE_18__.COLUMN_SIZE.SCROLL_OFFSET : 0), visible || visibility,
|
|
78008
|
+
// we do not update internal state when external one is updated so visibility might fall behind
|
|
78009
|
+
columnSizing, isRowExpandEnabled, !!getRowActions, localizationProps === null || localizationProps === void 0 ? void 0 : localizationProps.tableBody);
|
|
78008
78010
|
var onChangeSize = function onChangeSize(fn) {
|
|
78009
78011
|
var nextData = typeof fn === 'function' ? fn(columnSizing) : fn;
|
|
78010
78012
|
var targetData = typeof fn === 'function' ? fn({}) : fn;
|
|
@@ -78498,7 +78500,7 @@ function useInnerStateFallback(onExternalStateUpdate, externalState) {
|
|
|
78498
78500
|
var onChangeState = function onChangeState(fn) {
|
|
78499
78501
|
// we are setting innerState and outer externalState as the same object "nextData"
|
|
78500
78502
|
// it means that their links should be equal. If their links are not equal, it means externalState was altered by the user
|
|
78501
|
-
// thus
|
|
78503
|
+
// thus external state should take precedence over inner state that has fallen behind
|
|
78502
78504
|
var currentState = externalState && externalState !== innerState ? externalState : innerState;
|
|
78503
78505
|
var nextData = typeof fn === 'function' ? fn(currentState) : fn;
|
|
78504
78506
|
var nextDecoratedData = decoratorFn(nextData);
|