@trackunit/react-components 0.1.36 → 0.1.40
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/index.css +2 -2
- package/index.js +18 -4
- package/package.json +2 -2
package/index.css
CHANGED
package/index.js
CHANGED
|
@@ -7,7 +7,7 @@ import EChart from 'echarts-for-react';
|
|
|
7
7
|
import { v4 } from 'uuid';
|
|
8
8
|
import { useMeasure, useCopyToClipboard } from 'react-use';
|
|
9
9
|
import { format, formatDistance } from 'date-fns';
|
|
10
|
-
import { useFloating, offset, shift,
|
|
10
|
+
import { useFloating, offset, flip, shift, size, autoUpdate, useInteractions, useClick, useHover, useRole, useDismiss, FloatingPortal, FloatingFocusManager } from '@floating-ui/react';
|
|
11
11
|
import { Link, UNSAFE_NavigationContext } from 'react-router-dom';
|
|
12
12
|
import { DayPicker as DayPicker$1 } from 'react-day-picker';
|
|
13
13
|
import { enGB, enUS, da, de, cs, nl, fr, fi, hu, it, nb, pl, pt, ru, ro, es, sv, ja, th } from 'date-fns/locale';
|
|
@@ -955,7 +955,20 @@ const Popover = ({ children, render, placement, activation = { click: true, hove
|
|
|
955
955
|
const { x, y, reference, floating, strategy, context } = useFloating({
|
|
956
956
|
open,
|
|
957
957
|
onOpenChange: setOpen,
|
|
958
|
-
middleware: [
|
|
958
|
+
middleware: [
|
|
959
|
+
offset(8),
|
|
960
|
+
flip({ fallbackPlacements: ["top", "bottom", "right", "left"] }),
|
|
961
|
+
shift(),
|
|
962
|
+
size({
|
|
963
|
+
padding: 8,
|
|
964
|
+
apply({ availableWidth, availableHeight, elements }) {
|
|
965
|
+
Object.assign(elements.floating.style, {
|
|
966
|
+
maxWidth: `${availableWidth}px`,
|
|
967
|
+
maxHeight: `${availableHeight}px`,
|
|
968
|
+
});
|
|
969
|
+
},
|
|
970
|
+
}),
|
|
971
|
+
],
|
|
959
972
|
placement,
|
|
960
973
|
whileElementsMounted: autoUpdate,
|
|
961
974
|
});
|
|
@@ -972,6 +985,7 @@ const Popover = ({ children, render, placement, activation = { click: true, hove
|
|
|
972
985
|
position: strategy,
|
|
973
986
|
top: y !== null && y !== void 0 ? y : 0,
|
|
974
987
|
left: x !== null && x !== void 0 ? x : 0,
|
|
988
|
+
display: "flex",
|
|
975
989
|
} }, getFloatingProps(), { children: render({
|
|
976
990
|
close: () => {
|
|
977
991
|
setOpen(false);
|
|
@@ -1779,10 +1793,10 @@ const Pagination = ({ gotoPage, previousPage, nextPage, pageCount, pageIndex, ca
|
|
|
1779
1793
|
if (loading) {
|
|
1780
1794
|
return (jsx(Root$3, Object.assign({ className: className }, { children: jsx(SkeletonLines, { height: 16, width: 150 }) })));
|
|
1781
1795
|
}
|
|
1782
|
-
return (jsxs(Root$3, Object.assign({ "data-testid": dataTestId, className: className }, { children: [jsx(IconButton, { onClick: () => handlePageChange("prev"), disabled: cursorBase ? false : page !== undefined && page <= 0, "data-testid": "prev-page", icon: jsx(Icon, { name: "ChevronLeftIcon", size: "small" }), size: "small", color: "secondary", variant: "transparent" }), !cursorBase && (jsxs(Fragment, { children: [jsx(Text$1, { children: getTranslatedPage() }), jsx(PageInput, { type: "number", min: 1,
|
|
1796
|
+
return (jsxs(Root$3, Object.assign({ "data-testid": dataTestId, className: className }, { children: [jsx(IconButton, { onClick: () => handlePageChange("prev"), disabled: cursorBase ? !canPreviousPage || false : page !== undefined && page <= 0, "data-testid": "prev-page", icon: jsx(Icon, { name: "ChevronLeftIcon", size: "small" }), size: "small", color: "secondary", variant: "transparent" }), !cursorBase && (jsxs(Fragment, { children: [jsx(Text$1, { children: getTranslatedPage() }), jsx(PageInput, { type: "number", min: 1,
|
|
1783
1797
|
// max={amountOfPages}
|
|
1784
1798
|
value: pageInputValue, onFocus: handleOnFocus, onBlur: handleOnBlur, onChange: handleOnChange, onKeyPress: handleOnKeyPress, "data-testid": "page-input" }), jsx(TextStyled, Object.assign({ dataTestId: "page-count" }, { children: pageCount !== null && pageCount !== undefined && getTranslatedCount(pageCount) }))] })), jsx(IconButton, { onClick: () => handlePageChange("next"), disabled: cursorBase
|
|
1785
|
-
? false
|
|
1799
|
+
? !canNextPage || false
|
|
1786
1800
|
: page !== undefined && pageCount !== undefined && pageCount !== null && page >= pageCount - 1, "data-testid": "next-page", icon: jsx(Icon, { name: "ChevronRightIcon", size: "small" }), size: "small", color: "secondary", variant: "transparent" })] })));
|
|
1787
1801
|
};
|
|
1788
1802
|
const Root$3 = tw.div `
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trackunit/react-components",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.40",
|
|
4
4
|
"repository": "https://github.com/Trackunit/manager",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"dependencies": {
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"@trackunit/tailwind-styled-components": "0.0.51",
|
|
9
9
|
"react": "18.2.0",
|
|
10
10
|
"@trackunit/ui-design-tokens": "0.0.53",
|
|
11
|
-
"@trackunit/react-core-contexts-test": "0.1.
|
|
11
|
+
"@trackunit/react-core-contexts-test": "0.1.23",
|
|
12
12
|
"echarts": "5.4.0",
|
|
13
13
|
"echarts-for-react": "3.0.2",
|
|
14
14
|
"uuid": "8.3.2",
|