@mui/x-data-grid 6.7.0 → 6.8.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/CHANGELOG.md +77 -15
- package/components/GridColumnHeaders.d.ts +2 -2
- package/components/GridColumnHeaders.js +3 -1
- package/components/GridRow.d.ts +2 -2
- package/components/GridRow.js +23 -69
- package/components/cell/GridCell.d.ts +24 -15
- package/components/cell/GridCell.js +422 -45
- package/components/cell/index.d.ts +2 -1
- package/components/cell/index.js +1 -1
- package/components/containers/GridRootStyles.js +30 -16
- package/components/menu/columnMenu/GridColumnHeaderMenu.js +1 -1
- package/components/toolbar/GridToolbar.js +2 -2
- package/components/virtualization/GridVirtualScroller.js +4 -9
- package/components/virtualization/GridVirtualScrollerContent.js +11 -20
- package/constants/defaultGridSlotsComponents.js +6 -2
- package/hooks/core/useGridApiInitialization.js +4 -1
- package/hooks/core/useGridStateInitialization.js +2 -9
- package/hooks/features/clipboard/useGridClipboard.js +1 -4
- package/hooks/features/columnHeaders/useGridColumnHeaders.js +9 -3
- package/hooks/features/editing/useGridCellEditing.js +5 -3
- package/hooks/features/editing/useGridRowEditing.js +14 -6
- package/hooks/features/filter/gridFilterUtils.d.ts +4 -1
- package/hooks/features/filter/gridFilterUtils.js +19 -13
- package/hooks/features/filter/useGridFilter.js +2 -1
- package/hooks/features/focus/useGridFocus.js +9 -4
- package/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +2 -3
- package/hooks/features/rows/useGridParamsApi.d.ts +2 -0
- package/hooks/features/rows/useGridParamsApi.js +7 -15
- package/hooks/features/virtualization/useGridVirtualScroller.d.ts +8 -816
- package/hooks/features/virtualization/useGridVirtualScroller.js +40 -38
- package/hooks/utils/index.d.ts +1 -1
- package/hooks/utils/index.js +1 -1
- package/hooks/utils/useGridSelector.d.ts +3 -1
- package/hooks/utils/useGridSelector.js +37 -6
- package/hooks/utils/useLazyRef.d.ts +2 -0
- package/hooks/utils/useLazyRef.js +9 -0
- package/hooks/utils/useOnMount.d.ts +2 -0
- package/hooks/utils/useOnMount.js +7 -0
- package/index.js +1 -1
- package/legacy/components/GridColumnHeaders.js +3 -1
- package/legacy/components/GridRow.js +25 -69
- package/legacy/components/cell/GridCell.js +425 -46
- package/legacy/components/cell/index.js +1 -1
- package/legacy/components/containers/GridRootStyles.js +20 -17
- package/legacy/components/menu/columnMenu/GridColumnHeaderMenu.js +1 -1
- package/legacy/components/toolbar/GridToolbar.js +2 -2
- package/legacy/components/virtualization/GridVirtualScroller.js +4 -7
- package/legacy/components/virtualization/GridVirtualScrollerContent.js +10 -17
- package/legacy/constants/defaultGridSlotsComponents.js +6 -2
- package/legacy/hooks/core/useGridApiInitialization.js +4 -1
- package/legacy/hooks/core/useGridStateInitialization.js +2 -7
- package/legacy/hooks/features/clipboard/useGridClipboard.js +1 -4
- package/legacy/hooks/features/columnHeaders/useGridColumnHeaders.js +9 -3
- package/legacy/hooks/features/editing/useGridCellEditing.js +5 -3
- package/legacy/hooks/features/editing/useGridRowEditing.js +15 -7
- package/legacy/hooks/features/filter/gridFilterUtils.js +23 -19
- package/legacy/hooks/features/filter/useGridFilter.js +2 -1
- package/legacy/hooks/features/focus/useGridFocus.js +9 -4
- package/legacy/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +2 -3
- package/legacy/hooks/features/rows/useGridParamsApi.js +23 -15
- package/legacy/hooks/features/virtualization/useGridVirtualScroller.js +38 -34
- package/legacy/hooks/utils/index.js +1 -1
- package/legacy/hooks/utils/useGridSelector.js +43 -5
- package/legacy/hooks/utils/useLazyRef.js +9 -0
- package/legacy/hooks/utils/useOnMount.js +7 -0
- package/legacy/index.js +1 -1
- package/legacy/locales/elGR.js +70 -79
- package/legacy/utils/Store.js +34 -0
- package/legacy/utils/doesSupportPreventScroll.js +13 -0
- package/legacy/utils/fastMemo.js +5 -0
- package/legacy/utils/fastObjectShallowCompare.js +32 -0
- package/legacy/utils/keyboardUtils.js +4 -2
- package/locales/elGR.js +66 -79
- package/models/api/gridCoreApi.d.ts +6 -0
- package/models/colDef/gridColDef.d.ts +4 -3
- package/models/colDef/gridColType.d.ts +3 -1
- package/models/events/gridEventLookup.d.ts +3 -3
- package/modern/components/GridColumnHeaders.js +3 -1
- package/modern/components/GridRow.js +22 -69
- package/modern/components/cell/GridCell.js +421 -45
- package/modern/components/cell/index.js +1 -1
- package/modern/components/containers/GridRootStyles.js +30 -16
- package/modern/components/menu/columnMenu/GridColumnHeaderMenu.js +1 -1
- package/modern/components/toolbar/GridToolbar.js +2 -2
- package/modern/components/virtualization/GridVirtualScroller.js +4 -9
- package/modern/components/virtualization/GridVirtualScrollerContent.js +10 -20
- package/modern/constants/defaultGridSlotsComponents.js +6 -2
- package/modern/hooks/core/useGridApiInitialization.js +4 -1
- package/modern/hooks/core/useGridStateInitialization.js +2 -9
- package/modern/hooks/features/clipboard/useGridClipboard.js +1 -4
- package/modern/hooks/features/columnHeaders/useGridColumnHeaders.js +9 -3
- package/modern/hooks/features/editing/useGridCellEditing.js +5 -3
- package/modern/hooks/features/editing/useGridRowEditing.js +14 -6
- package/modern/hooks/features/filter/gridFilterUtils.js +17 -12
- package/modern/hooks/features/filter/useGridFilter.js +2 -1
- package/modern/hooks/features/focus/useGridFocus.js +8 -4
- package/modern/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +2 -3
- package/modern/hooks/features/rows/useGridParamsApi.js +7 -15
- package/modern/hooks/features/virtualization/useGridVirtualScroller.js +40 -38
- package/modern/hooks/utils/index.js +1 -1
- package/modern/hooks/utils/useGridSelector.js +37 -6
- package/modern/hooks/utils/useLazyRef.js +9 -0
- package/modern/hooks/utils/useOnMount.js +7 -0
- package/modern/index.js +1 -1
- package/modern/locales/elGR.js +66 -79
- package/modern/utils/Store.js +24 -0
- package/modern/utils/doesSupportPreventScroll.js +13 -0
- package/modern/utils/fastMemo.js +5 -0
- package/modern/utils/fastObjectShallowCompare.js +32 -0
- package/modern/utils/keyboardUtils.js +4 -2
- package/node/components/GridColumnHeaders.js +4 -2
- package/node/components/GridRow.js +22 -69
- package/node/components/cell/GridCell.js +424 -47
- package/node/components/cell/index.js +17 -10
- package/node/components/containers/GridRootStyles.js +30 -16
- package/node/components/menu/columnMenu/GridColumnHeaderMenu.js +1 -1
- package/node/components/toolbar/GridToolbar.js +2 -2
- package/node/components/virtualization/GridVirtualScroller.js +4 -9
- package/node/components/virtualization/GridVirtualScrollerContent.js +10 -20
- package/node/constants/defaultGridSlotsComponents.js +4 -1
- package/node/hooks/core/useGridApiInitialization.js +4 -1
- package/node/hooks/core/useGridStateInitialization.js +2 -9
- package/node/hooks/features/clipboard/useGridClipboard.js +1 -4
- package/node/hooks/features/columnHeaders/useGridColumnHeaders.js +8 -2
- package/node/hooks/features/editing/useGridCellEditing.js +5 -3
- package/node/hooks/features/editing/useGridRowEditing.js +14 -6
- package/node/hooks/features/filter/gridFilterUtils.js +17 -12
- package/node/hooks/features/filter/useGridFilter.js +2 -1
- package/node/hooks/features/focus/useGridFocus.js +8 -4
- package/node/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +2 -3
- package/node/hooks/features/rows/useGridParamsApi.js +9 -15
- package/node/hooks/features/virtualization/useGridVirtualScroller.js +40 -36
- package/node/hooks/utils/index.js +14 -10
- package/node/hooks/utils/useGridSelector.js +41 -7
- package/node/hooks/utils/useLazyRef.js +17 -0
- package/node/hooks/utils/useOnMount.js +15 -0
- package/node/index.js +1 -1
- package/node/locales/elGR.js +66 -79
- package/node/utils/Store.js +31 -0
- package/node/utils/doesSupportPreventScroll.js +19 -0
- package/node/utils/fastMemo.js +13 -0
- package/node/utils/fastObjectShallowCompare.js +38 -0
- package/node/utils/keyboardUtils.js +4 -2
- package/package.json +1 -1
- package/utils/Store.d.ts +11 -0
- package/utils/Store.js +24 -0
- package/utils/doesSupportPreventScroll.d.ts +1 -0
- package/utils/doesSupportPreventScroll.js +13 -0
- package/utils/fastMemo.d.ts +1 -0
- package/utils/fastMemo.js +5 -0
- package/utils/fastObjectShallowCompare.d.ts +1 -0
- package/utils/fastObjectShallowCompare.js +32 -0
- package/utils/keyboardUtils.js +4 -2
|
@@ -2,11 +2,10 @@ import _extends from "@babel/runtime/helpers/esm/extends";
|
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
3
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
4
4
|
var _excluded = ["style"],
|
|
5
|
-
_excluded2 = ["style"]
|
|
6
|
-
_excluded3 = ["style"];
|
|
5
|
+
_excluded2 = ["style"];
|
|
7
6
|
import * as React from 'react';
|
|
8
7
|
import * as ReactDOM from 'react-dom';
|
|
9
|
-
import { unstable_useForkRef as useForkRef, unstable_useEnhancedEffect as useEnhancedEffect } from '@mui/utils';
|
|
8
|
+
import { unstable_useForkRef as useForkRef, unstable_useEnhancedEffect as useEnhancedEffect, unstable_useEventCallback as useEventCallback } from '@mui/utils';
|
|
10
9
|
import { useTheme } from '@mui/material/styles';
|
|
11
10
|
import { defaultMemoize } from 'reselect';
|
|
12
11
|
import { useGridPrivateApiContext } from '../../utils/useGridPrivateApiContext';
|
|
@@ -52,12 +51,17 @@ export var getRenderableIndexes = function getRenderableIndexes(_ref) {
|
|
|
52
51
|
maxLastIndex = _ref.maxLastIndex;
|
|
53
52
|
return [clamp(firstIndex - buffer, minFirstIndex, maxLastIndex), clamp(lastIndex + buffer, minFirstIndex, maxLastIndex)];
|
|
54
53
|
};
|
|
55
|
-
var areRenderContextsEqual = function areRenderContextsEqual(context1, context2) {
|
|
54
|
+
export var areRenderContextsEqual = function areRenderContextsEqual(context1, context2) {
|
|
56
55
|
if (context1 === context2) {
|
|
57
56
|
return true;
|
|
58
57
|
}
|
|
59
58
|
return context1.firstRowIndex === context2.firstRowIndex && context1.lastRowIndex === context2.lastRowIndex && context1.firstColumnIndex === context2.firstColumnIndex && context1.lastColumnIndex === context2.lastColumnIndex;
|
|
60
59
|
};
|
|
60
|
+
// The `maxSize` is 3 so that reselect caches the `renderedColumns` values for the pinned left,
|
|
61
|
+
// unpinned, and pinned right sections.
|
|
62
|
+
var MEMOIZE_OPTIONS = {
|
|
63
|
+
maxSize: 3
|
|
64
|
+
};
|
|
61
65
|
export var useGridVirtualScroller = function useGridVirtualScroller(props) {
|
|
62
66
|
var _currentPage$range3, _currentPage$range4;
|
|
63
67
|
var apiRef = useGridPrivateApiContext();
|
|
@@ -104,7 +108,7 @@ export var useGridVirtualScroller = function useGridVirtualScroller(props) {
|
|
|
104
108
|
var prevRootRowStyle = React.useRef();
|
|
105
109
|
var getRenderedColumnsRef = React.useRef(defaultMemoize(function (columns, firstColumnToRender, lastColumnToRender) {
|
|
106
110
|
return columns.slice(firstColumnToRender, lastColumnToRender);
|
|
107
|
-
}));
|
|
111
|
+
}, MEMOIZE_OPTIONS));
|
|
108
112
|
var getNearestIndexToRender = React.useCallback(function (offset) {
|
|
109
113
|
var _currentPage$range, _currentPage$range2;
|
|
110
114
|
var lastMeasuredIndexRelativeToAllRows = apiRef.current.getLastMeasuredRowIndex();
|
|
@@ -272,7 +276,7 @@ export var useGridVirtualScroller = function useGridVirtualScroller(props) {
|
|
|
272
276
|
};
|
|
273
277
|
apiRef.current.publishEvent('scrollPositionChange', params);
|
|
274
278
|
}, [apiRef, computeRenderContext, containerDimensions.width, updateRenderContext]);
|
|
275
|
-
var handleScroll = function
|
|
279
|
+
var handleScroll = useEventCallback(function (event) {
|
|
276
280
|
var _event$currentTarget = event.currentTarget,
|
|
277
281
|
scrollTop = _event$currentTarget.scrollTop,
|
|
278
282
|
scrollLeft = _event$currentTarget.scrollLeft;
|
|
@@ -313,13 +317,13 @@ export var useGridVirtualScroller = function useGridVirtualScroller(props) {
|
|
|
313
317
|
});
|
|
314
318
|
prevTotalWidth.current = columnsTotalWidth;
|
|
315
319
|
}
|
|
316
|
-
};
|
|
317
|
-
var handleWheel = function
|
|
320
|
+
});
|
|
321
|
+
var handleWheel = useEventCallback(function (event) {
|
|
318
322
|
apiRef.current.publishEvent('virtualScrollerWheel', {}, event);
|
|
319
|
-
};
|
|
320
|
-
var handleTouchMove = function
|
|
323
|
+
});
|
|
324
|
+
var handleTouchMove = useEventCallback(function (event) {
|
|
321
325
|
apiRef.current.publishEvent('virtualScrollerTouchMove', {}, event);
|
|
322
|
-
};
|
|
326
|
+
});
|
|
323
327
|
var getRows = function getRows() {
|
|
324
328
|
var _rootProps$slotProps;
|
|
325
329
|
var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
|
|
@@ -471,22 +475,25 @@ export var useGridVirtualScroller = function useGridVirtualScroller(props) {
|
|
|
471
475
|
height: height,
|
|
472
476
|
minHeight: shouldExtendContent ? '100%' : 'auto'
|
|
473
477
|
};
|
|
478
|
+
if (rootProps.autoHeight && currentPage.rows.length === 0) {
|
|
479
|
+
size.height = getMinimalContentHeight(apiRef, rootProps.rowHeight); // Give room to show the overlay when there no rows.
|
|
480
|
+
}
|
|
481
|
+
|
|
474
482
|
return size;
|
|
475
|
-
}, [rootRef, columnsTotalWidth, rowsMeta.currentPageTotalHeight, needsHorizontalScrollbar]);
|
|
483
|
+
}, [apiRef, rootRef, columnsTotalWidth, rowsMeta.currentPageTotalHeight, needsHorizontalScrollbar, rootProps.autoHeight, rootProps.rowHeight, currentPage.rows.length]);
|
|
476
484
|
React.useEffect(function () {
|
|
477
485
|
apiRef.current.publishEvent('virtualScrollerContentSizeChange');
|
|
478
486
|
}, [apiRef, contentSize]);
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
}
|
|
487
|
+
var rootStyle = React.useMemo(function () {
|
|
488
|
+
var style = {};
|
|
489
|
+
if (!needsHorizontalScrollbar) {
|
|
490
|
+
style.overflowX = 'hidden';
|
|
491
|
+
}
|
|
492
|
+
if (rootProps.autoHeight) {
|
|
493
|
+
style.overflowY = 'hidden';
|
|
494
|
+
}
|
|
495
|
+
return style;
|
|
496
|
+
}, [needsHorizontalScrollbar, rootProps.autoHeight]);
|
|
490
497
|
var getRenderContext = React.useCallback(function () {
|
|
491
498
|
return prevRenderContext.current;
|
|
492
499
|
}, []);
|
|
@@ -498,24 +505,21 @@ export var useGridVirtualScroller = function useGridVirtualScroller(props) {
|
|
|
498
505
|
updateRenderZonePosition: updateRenderZonePosition,
|
|
499
506
|
getRows: getRows,
|
|
500
507
|
getRootProps: function getRootProps() {
|
|
501
|
-
var
|
|
502
|
-
var _ref6$style = _ref6.style,
|
|
503
|
-
style = _ref6$style === void 0 ? {} : _ref6$style,
|
|
504
|
-
other = _objectWithoutProperties(_ref6, _excluded3);
|
|
508
|
+
var inputProps = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
505
509
|
return _extends({
|
|
506
510
|
ref: handleRef,
|
|
507
511
|
onScroll: handleScroll,
|
|
508
512
|
onWheel: handleWheel,
|
|
509
|
-
onTouchMove: handleTouchMove
|
|
510
|
-
|
|
511
|
-
|
|
513
|
+
onTouchMove: handleTouchMove
|
|
514
|
+
}, inputProps, {
|
|
515
|
+
style: inputProps.style ? _extends({}, inputProps.style, rootStyle) : rootStyle
|
|
516
|
+
});
|
|
512
517
|
},
|
|
513
518
|
getContentProps: function getContentProps() {
|
|
514
|
-
var
|
|
515
|
-
|
|
516
|
-
style = _ref7$style === void 0 ? {} : _ref7$style;
|
|
519
|
+
var _ref6 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
520
|
+
style = _ref6.style;
|
|
517
521
|
return {
|
|
518
|
-
style: _extends({}, style, contentSize)
|
|
522
|
+
style: style ? _extends({}, style, contentSize) : contentSize
|
|
519
523
|
};
|
|
520
524
|
},
|
|
521
525
|
getRenderZoneProps: function getRenderZoneProps() {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export * from './useGridApiEventHandler';
|
|
2
2
|
export * from './useGridApiMethod';
|
|
3
3
|
export * from './useGridLogger';
|
|
4
|
-
export
|
|
4
|
+
export { useGridSelector } from './useGridSelector';
|
|
5
5
|
export * from './useGridNativeEventListener';
|
|
6
6
|
export * from './useFirstRender';
|
|
@@ -1,16 +1,54 @@
|
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { useLazyRef } from './useLazyRef';
|
|
4
|
+
import { useOnMount } from './useOnMount';
|
|
1
5
|
import { buildWarning } from '../../utils/warning';
|
|
6
|
+
import { fastObjectShallowCompare } from '../../utils/fastObjectShallowCompare';
|
|
7
|
+
var stateNotInitializedWarning = buildWarning(['MUI: `useGridSelector` has been called before the initialization of the state.', 'This hook can only be used inside the context of the grid.']);
|
|
2
8
|
function isOutputSelector(selector) {
|
|
3
9
|
return selector.acceptsApiRef;
|
|
4
10
|
}
|
|
5
|
-
|
|
11
|
+
function applySelector(apiRef, selector) {
|
|
12
|
+
if (isOutputSelector(selector)) {
|
|
13
|
+
return selector(apiRef);
|
|
14
|
+
}
|
|
15
|
+
return selector(apiRef.current.state);
|
|
16
|
+
}
|
|
17
|
+
var defaultCompare = Object.is;
|
|
18
|
+
export var objectShallowCompare = fastObjectShallowCompare;
|
|
19
|
+
var createRefs = function createRefs() {
|
|
20
|
+
return {
|
|
21
|
+
state: null,
|
|
22
|
+
equals: null,
|
|
23
|
+
selector: null
|
|
24
|
+
};
|
|
25
|
+
};
|
|
6
26
|
export var useGridSelector = function useGridSelector(apiRef, selector) {
|
|
27
|
+
var equals = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : defaultCompare;
|
|
7
28
|
if (process.env.NODE_ENV !== 'production') {
|
|
8
29
|
if (!apiRef.current.state) {
|
|
9
30
|
stateNotInitializedWarning();
|
|
10
31
|
}
|
|
11
32
|
}
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
33
|
+
var refs = useLazyRef(createRefs);
|
|
34
|
+
var didInit = refs.current.selector !== null;
|
|
35
|
+
var _React$useState = React.useState(
|
|
36
|
+
// We don't use an initialization function to avoid allocations
|
|
37
|
+
didInit ? null : applySelector(apiRef, selector)),
|
|
38
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
39
|
+
state = _React$useState2[0],
|
|
40
|
+
setState = _React$useState2[1];
|
|
41
|
+
refs.current.state = state;
|
|
42
|
+
refs.current.equals = equals;
|
|
43
|
+
refs.current.selector = selector;
|
|
44
|
+
useOnMount(function () {
|
|
45
|
+
return apiRef.current.store.subscribe(function () {
|
|
46
|
+
var newState = applySelector(apiRef, refs.current.selector);
|
|
47
|
+
if (!refs.current.equals(refs.current.state, newState)) {
|
|
48
|
+
refs.current.state = newState;
|
|
49
|
+
setState(newState);
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
});
|
|
53
|
+
return state;
|
|
16
54
|
};
|
package/legacy/index.js
CHANGED
package/legacy/locales/elGR.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { elGR as elGRCore } from '@mui/material/locale';
|
|
1
2
|
import { getGridLocalization } from '../utils/getGridLocalization';
|
|
2
3
|
var elGRGrid = {
|
|
3
4
|
// Root
|
|
@@ -21,17 +22,15 @@ var elGRGrid = {
|
|
|
21
22
|
return count !== 1 ? "".concat(count, " \u03B5\u03BD\u03B5\u03C1\u03B3\u03AC \u03C6\u03AF\u03BB\u03C4\u03C1\u03B1") : "".concat(count, " \u03B5\u03BD\u03B5\u03C1\u03B3\u03CC \u03C6\u03AF\u03BB\u03C4\u03C1\u03BF");
|
|
22
23
|
},
|
|
23
24
|
// Quick filter toolbar field
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
25
|
+
toolbarQuickFilterPlaceholder: 'Αναζήτηση…',
|
|
26
|
+
toolbarQuickFilterLabel: 'Αναζήτηση',
|
|
27
|
+
toolbarQuickFilterDeleteIconLabel: 'Καθαρισμός',
|
|
28
28
|
// Export selector toolbar button text
|
|
29
29
|
toolbarExport: 'Εξαγωγή',
|
|
30
30
|
toolbarExportLabel: 'Εξαγωγή',
|
|
31
31
|
toolbarExportCSV: 'Λήψη ως CSV',
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
32
|
+
toolbarExportPrint: 'Εκτύπωση',
|
|
33
|
+
toolbarExportExcel: 'Λήψη ως Excel',
|
|
35
34
|
// Columns panel text
|
|
36
35
|
columnsPanelTextFieldLabel: 'Εύρεση στήλης',
|
|
37
36
|
columnsPanelTextFieldPlaceholder: 'Επικεφαλίδα στήλης',
|
|
@@ -40,9 +39,9 @@ var elGRGrid = {
|
|
|
40
39
|
columnsPanelHideAllButton: 'Απόκρυψη όλων',
|
|
41
40
|
// Filter panel text
|
|
42
41
|
filterPanelAddFilter: 'Προσθήκη φίλτρου',
|
|
43
|
-
|
|
42
|
+
filterPanelRemoveAll: 'Αφαίρεση όλων',
|
|
44
43
|
filterPanelDeleteIconLabel: 'Διαγραφή',
|
|
45
|
-
|
|
44
|
+
filterPanelLogicOperator: 'Λογικός τελεστής',
|
|
46
45
|
filterPanelOperator: 'Τελεστές',
|
|
47
46
|
filterPanelOperatorAnd: 'Καί',
|
|
48
47
|
filterPanelOperatorOr: 'Ή',
|
|
@@ -62,44 +61,41 @@ var elGRGrid = {
|
|
|
62
61
|
filterOperatorOnOrBefore: 'είναι ίσο ή πριν',
|
|
63
62
|
filterOperatorIsEmpty: 'είναι κενό',
|
|
64
63
|
filterOperatorIsNotEmpty: 'δεν είναι κενό',
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
64
|
+
filterOperatorIsAnyOf: 'είναι οποιοδήποτε από',
|
|
65
|
+
'filterOperator=': '=',
|
|
66
|
+
'filterOperator!=': '!=',
|
|
67
|
+
'filterOperator>': '>',
|
|
68
|
+
'filterOperator>=': '>=',
|
|
69
|
+
'filterOperator<': '<',
|
|
70
|
+
'filterOperator<=': '<=',
|
|
73
71
|
// Header filter operators text
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
72
|
+
headerFilterOperatorContains: 'Περιέχει',
|
|
73
|
+
headerFilterOperatorEquals: 'Ισούται',
|
|
74
|
+
headerFilterOperatorStartsWith: 'Ξεκινάει με',
|
|
75
|
+
headerFilterOperatorEndsWith: 'Τελειώνει με',
|
|
76
|
+
headerFilterOperatorIs: 'Είναι',
|
|
77
|
+
headerFilterOperatorNot: 'Δεν είναι',
|
|
78
|
+
headerFilterOperatorAfter: 'Είναι μετά',
|
|
79
|
+
headerFilterOperatorOnOrAfter: 'Είναι ίσο ή μετά',
|
|
80
|
+
headerFilterOperatorBefore: 'Είναι πριν',
|
|
81
|
+
headerFilterOperatorOnOrBefore: 'Είναι ίσο ή πριν',
|
|
82
|
+
headerFilterOperatorIsEmpty: 'Είναι κενό',
|
|
83
|
+
headerFilterOperatorIsNotEmpty: 'Δεν είναι κενό',
|
|
84
|
+
headerFilterOperatorIsAnyOf: 'Είναι οποιοδήποτε από',
|
|
85
|
+
'headerFilterOperator=': 'Ισούται',
|
|
86
|
+
'headerFilterOperator!=': 'Δεν ισούται',
|
|
87
|
+
'headerFilterOperator>': 'Μεγαλύτερο από',
|
|
88
|
+
'headerFilterOperator>=': 'Μεγαλύτερο ή ίσο με',
|
|
89
|
+
'headerFilterOperator<': 'Μικρότερο από',
|
|
90
|
+
'headerFilterOperator<=': 'Μικρότερο ή ίσο με',
|
|
94
91
|
// Filter values text
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
92
|
+
filterValueAny: 'οποιοδήποτε',
|
|
93
|
+
filterValueTrue: 'αληθές',
|
|
94
|
+
filterValueFalse: 'ψευδές',
|
|
99
95
|
// Column menu text
|
|
100
96
|
columnMenuLabel: 'Μενού',
|
|
101
97
|
columnMenuShowColumns: 'Εμφάνιση στηλών',
|
|
102
|
-
|
|
98
|
+
columnMenuManageColumns: 'Διαχείριση στηλών',
|
|
103
99
|
columnMenuFilter: 'Φίλτρο',
|
|
104
100
|
columnMenuHideColumn: 'Απόκρυψη',
|
|
105
101
|
columnMenuUnsort: 'Απενεργοποίηση ταξινόμησης',
|
|
@@ -122,49 +118,44 @@ var elGRGrid = {
|
|
|
122
118
|
return "".concat(visibleCount.toLocaleString(), " \u03B1\u03C0\u03CC ").concat(totalCount.toLocaleString());
|
|
123
119
|
},
|
|
124
120
|
// Checkbox selection text
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
121
|
+
checkboxSelectionHeaderName: 'Επιλογή πλαισίου ελέγχου',
|
|
122
|
+
checkboxSelectionSelectAllRows: 'Επιλέξτε όλες τις σειρές',
|
|
123
|
+
checkboxSelectionUnselectAllRows: 'Καταργήση επιλογής όλων των σειρών',
|
|
124
|
+
checkboxSelectionSelectRow: 'Επιλογή γραμμής',
|
|
125
|
+
checkboxSelectionUnselectRow: 'Καταργήση επιλογής γραμμής',
|
|
131
126
|
// Boolean cell text
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
127
|
+
booleanCellTrueLabel: 'ναί',
|
|
128
|
+
booleanCellFalseLabel: 'όχι',
|
|
135
129
|
// Actions cell more text
|
|
136
|
-
actionsCellMore: 'περισσότερα'
|
|
137
|
-
|
|
130
|
+
actionsCellMore: 'περισσότερα',
|
|
138
131
|
// Column pinning text
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
132
|
+
pinToLeft: 'Καρφιτσώμα στα αριστερά',
|
|
133
|
+
pinToRight: 'Καρφιτσώμα στα δεξιά',
|
|
134
|
+
unpin: 'Ξεκαρφίτσωμα',
|
|
143
135
|
// Tree Data
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
136
|
+
treeDataGroupingHeaderName: 'Ομαδοποίηση',
|
|
137
|
+
treeDataExpand: 'εμφάνιση περιεχομένων',
|
|
138
|
+
treeDataCollapse: 'απόκρυψη περιεχομένων',
|
|
148
139
|
// Grouping columns
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
140
|
+
groupingColumnHeaderName: 'Ομαδοποίηση',
|
|
141
|
+
groupColumn: function groupColumn(name) {
|
|
142
|
+
return "\u039F\u03BC\u03B1\u03B4\u03BF\u03C0\u03BF\u03AF\u03B7\u03C3\u03B7 \u03BA\u03B1\u03C4\u03AC ".concat(name);
|
|
143
|
+
},
|
|
144
|
+
unGroupColumn: function unGroupColumn(name) {
|
|
145
|
+
return "\u0394\u03B9\u03B1\u03BA\u03BF\u03C0\u03AE \u03BF\u03BC\u03B1\u03B4\u03BF\u03C0\u03BF\u03AF\u03B7\u03C3\u03B7\u03C2 \u03BA\u03B1\u03C4\u03AC ".concat(name);
|
|
146
|
+
},
|
|
153
147
|
// Master/detail
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
148
|
+
detailPanelToggle: 'Εναλλαγή πίνακα λεπτομερειών',
|
|
149
|
+
expandDetailPanel: 'Ανάπτυξη',
|
|
150
|
+
collapseDetailPanel: 'Σύμπτυξη',
|
|
158
151
|
// Row reordering text
|
|
159
|
-
|
|
160
|
-
|
|
152
|
+
rowReorderingHeaderName: 'Αναδιάταξη γραμμών',
|
|
161
153
|
// Aggregation
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
154
|
+
aggregationMenuItemHeader: 'Συσσωμάτωση',
|
|
155
|
+
aggregationFunctionLabelSum: 'άθροισμα',
|
|
156
|
+
aggregationFunctionLabelAvg: 'μέση τιμή',
|
|
157
|
+
aggregationFunctionLabelMin: 'ελάχιστο',
|
|
158
|
+
aggregationFunctionLabelMax: 'μέγιστο',
|
|
159
|
+
aggregationFunctionLabelSize: 'μέγεθος'
|
|
168
160
|
};
|
|
169
|
-
|
|
170
|
-
export var elGR = getGridLocalization(elGRGrid);
|
|
161
|
+
export var elGR = getGridLocalization(elGRGrid, elGRCore);
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
2
|
+
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
3
|
+
export var Store = /*#__PURE__*/function () {
|
|
4
|
+
function Store(_value) {
|
|
5
|
+
var _this = this;
|
|
6
|
+
_classCallCheck(this, Store);
|
|
7
|
+
this.value = void 0;
|
|
8
|
+
this.listeners = void 0;
|
|
9
|
+
this.subscribe = function (fn) {
|
|
10
|
+
_this.listeners.add(fn);
|
|
11
|
+
return function () {
|
|
12
|
+
_this.listeners.delete(fn);
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
this.getSnapshot = function () {
|
|
16
|
+
return _this.value;
|
|
17
|
+
};
|
|
18
|
+
this.update = function (value) {
|
|
19
|
+
_this.value = value;
|
|
20
|
+
_this.listeners.forEach(function (l) {
|
|
21
|
+
return l(value);
|
|
22
|
+
});
|
|
23
|
+
};
|
|
24
|
+
this.value = _value;
|
|
25
|
+
this.listeners = new Set();
|
|
26
|
+
}
|
|
27
|
+
_createClass(Store, null, [{
|
|
28
|
+
key: "create",
|
|
29
|
+
value: function create(value) {
|
|
30
|
+
return new Store(value);
|
|
31
|
+
}
|
|
32
|
+
}]);
|
|
33
|
+
return Store;
|
|
34
|
+
}();
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// Based on https://stackoverflow.com/a/59518678
|
|
2
|
+
var cachedSupportsPreventScroll;
|
|
3
|
+
export function doesSupportPreventScroll() {
|
|
4
|
+
if (cachedSupportsPreventScroll === undefined) {
|
|
5
|
+
document.createElement('div').focus({
|
|
6
|
+
get preventScroll() {
|
|
7
|
+
cachedSupportsPreventScroll = true;
|
|
8
|
+
return false;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
return cachedSupportsPreventScroll;
|
|
13
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
var is = Object.is;
|
|
2
|
+
export function fastObjectShallowCompare(a, b) {
|
|
3
|
+
if (a === b) {
|
|
4
|
+
return true;
|
|
5
|
+
}
|
|
6
|
+
if (!(a instanceof Object) || !(b instanceof Object)) {
|
|
7
|
+
return false;
|
|
8
|
+
}
|
|
9
|
+
var aLength = 0;
|
|
10
|
+
var bLength = 0;
|
|
11
|
+
|
|
12
|
+
/* eslint-disable no-restricted-syntax */
|
|
13
|
+
/* eslint-disable guard-for-in */
|
|
14
|
+
for (var key in a) {
|
|
15
|
+
aLength += 1;
|
|
16
|
+
if (!is(a[key], b[key])) {
|
|
17
|
+
return false;
|
|
18
|
+
}
|
|
19
|
+
if (!(key in b)) {
|
|
20
|
+
return false;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/* eslint-disable-next-line @typescript-eslint/naming-convention, @typescript-eslint/no-unused-vars */
|
|
25
|
+
for (var _ in b) {
|
|
26
|
+
bLength += 1;
|
|
27
|
+
}
|
|
28
|
+
/* eslint-enable no-restricted-syntax */
|
|
29
|
+
/* eslint-enable guard-for-in */
|
|
30
|
+
|
|
31
|
+
return aLength === bLength;
|
|
32
|
+
}
|
|
@@ -26,11 +26,13 @@ export var isDeleteKeys = function isDeleteKeys(key) {
|
|
|
26
26
|
|
|
27
27
|
// Non printable keys have a name, e.g. "ArrowRight", see the whole list:
|
|
28
28
|
// https://developer.mozilla.org/en-US/docs/Web/API/UI_Events/Keyboard_event_key_values
|
|
29
|
-
//
|
|
29
|
+
// So event.key.length === 1 is often enough.
|
|
30
|
+
//
|
|
31
|
+
// However, we also need to ignore shortcuts, for example: select all:
|
|
30
32
|
// - Windows: Ctrl+A, event.ctrlKey is true
|
|
31
33
|
// - macOS: ⌘ Command+A, event.metaKey is true
|
|
32
34
|
export function isPrintableKey(event) {
|
|
33
|
-
return event.key.length === 1 && event.ctrlKey
|
|
35
|
+
return event.key.length === 1 && !event.ctrlKey && !event.metaKey;
|
|
34
36
|
}
|
|
35
37
|
export var GRID_MULTIPLE_SELECTION_KEYS = ['Meta', 'Control', 'Shift'];
|
|
36
38
|
export var GRID_CELL_EXIT_EDIT_MODE_KEYS = ['Enter', 'Escape', 'Tab'];
|