@moving-walls/design-system 1.0.22 → 1.0.24
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/components/ui/AgGridTable/types.d.ts +2 -0
- package/dist/index.esm.js +31 -18
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +31 -18
- package/dist/index.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -36382,9 +36382,10 @@ function CalendarMonth(_ref) {
|
|
|
36382
36382
|
}
|
|
36383
36383
|
// Next month's leading days
|
|
36384
36384
|
var totalCells = Math.ceil(days.length / 7) * 7;
|
|
36385
|
-
|
|
36386
|
-
|
|
36387
|
-
|
|
36385
|
+
var nextMonthStart = days.length;
|
|
36386
|
+
for (var _i = nextMonthStart; _i < totalCells; _i++) {
|
|
36387
|
+
var nextDay = _i - nextMonthStart + 1;
|
|
36388
|
+
var _date2 = new Date(currentMonth.getFullYear(), currentMonth.getMonth() + 1, nextDay);
|
|
36388
36389
|
days.push({
|
|
36389
36390
|
date: _date2,
|
|
36390
36391
|
isCurrentMonth: false
|
|
@@ -41337,8 +41338,8 @@ function Tooltip(_ref2) {
|
|
|
41337
41338
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
41338
41339
|
resolvedPosition = _useState6[0],
|
|
41339
41340
|
setResolvedPosition = _useState6[1];
|
|
41340
|
-
React.
|
|
41341
|
-
if (!
|
|
41341
|
+
var recalculate = React.useCallback(function () {
|
|
41342
|
+
if (!triggerRef.current || !tooltipRef.current) return;
|
|
41342
41343
|
var triggerRect = triggerRef.current.getBoundingClientRect();
|
|
41343
41344
|
var tooltipRect = tooltipRef.current.getBoundingClientRect();
|
|
41344
41345
|
var vw = window.innerWidth;
|
|
@@ -41346,7 +41347,6 @@ function Tooltip(_ref2) {
|
|
|
41346
41347
|
var top = 0;
|
|
41347
41348
|
var left = 0;
|
|
41348
41349
|
var resolved = position;
|
|
41349
|
-
// Calculate preferred position
|
|
41350
41350
|
var calc = function calc(pos) {
|
|
41351
41351
|
switch (pos) {
|
|
41352
41352
|
case 'top':
|
|
@@ -41368,7 +41368,6 @@ function Tooltip(_ref2) {
|
|
|
41368
41368
|
}
|
|
41369
41369
|
};
|
|
41370
41370
|
calc(position);
|
|
41371
|
-
// Flip if overflowing viewport
|
|
41372
41371
|
if (position === 'top' && top < PADDING) {
|
|
41373
41372
|
resolved = 'bottom';
|
|
41374
41373
|
calc('bottom');
|
|
@@ -41382,10 +41381,8 @@ function Tooltip(_ref2) {
|
|
|
41382
41381
|
resolved = 'left';
|
|
41383
41382
|
calc('left');
|
|
41384
41383
|
}
|
|
41385
|
-
// Clamp horizontal to stay within viewport
|
|
41386
41384
|
if (left < PADDING) left = PADDING;
|
|
41387
41385
|
if (left + tooltipRect.width > vw - PADDING) left = vw - PADDING - tooltipRect.width;
|
|
41388
|
-
// Clamp vertical
|
|
41389
41386
|
if (top < PADDING) top = PADDING;
|
|
41390
41387
|
if (top + tooltipRect.height > vh - PADDING) top = vh - PADDING - tooltipRect.height;
|
|
41391
41388
|
setCoords({
|
|
@@ -41393,10 +41390,20 @@ function Tooltip(_ref2) {
|
|
|
41393
41390
|
left: left
|
|
41394
41391
|
});
|
|
41395
41392
|
setResolvedPosition(resolved);
|
|
41396
|
-
}, [
|
|
41393
|
+
}, [position]);
|
|
41394
|
+
// Recalculate on visibility change
|
|
41395
|
+
React.useLayoutEffect(function () {
|
|
41396
|
+
if (!isVisible) return;
|
|
41397
|
+
recalculate();
|
|
41398
|
+
}, [isVisible, recalculate]);
|
|
41399
|
+
// Use callback ref to recalculate once the portal element is mounted in the DOM
|
|
41400
|
+
var tooltipCallbackRef = React.useCallback(function (node) {
|
|
41401
|
+
tooltipRef.current = node;
|
|
41402
|
+
if (node && isVisible) recalculate();
|
|
41403
|
+
}, [isVisible, recalculate]);
|
|
41397
41404
|
var show = React.useCallback(function () {
|
|
41398
|
-
|
|
41399
|
-
}, []);
|
|
41405
|
+
if (content != null && content !== '') setIsVisible(true);
|
|
41406
|
+
}, [content]);
|
|
41400
41407
|
var hide = React.useCallback(function () {
|
|
41401
41408
|
setIsVisible(false);
|
|
41402
41409
|
setCoords(null);
|
|
@@ -41432,16 +41439,18 @@ function Tooltip(_ref2) {
|
|
|
41432
41439
|
onFocus: show,
|
|
41433
41440
|
onBlur: hide,
|
|
41434
41441
|
children: children
|
|
41435
|
-
}), isVisible && /*#__PURE__*/ReactDOM.createPortal(require$$1.jsxs("div", {
|
|
41436
|
-
ref:
|
|
41442
|
+
}), isVisible && content != null && content !== '' && /*#__PURE__*/ReactDOM.createPortal(require$$1.jsxs("div", {
|
|
41443
|
+
ref: tooltipCallbackRef,
|
|
41437
41444
|
style: coords ? {
|
|
41438
41445
|
top: coords.top,
|
|
41439
|
-
left: coords.left
|
|
41446
|
+
left: coords.left,
|
|
41447
|
+
zIndex: 999999
|
|
41440
41448
|
} : {
|
|
41441
41449
|
top: -9999,
|
|
41442
|
-
left: -9999
|
|
41450
|
+
left: -9999,
|
|
41451
|
+
zIndex: 999999
|
|
41443
41452
|
},
|
|
41444
|
-
className: clsx('fixed
|
|
41453
|
+
className: clsx('fixed px-2 py-1 text-sm text-mw-neutral-500 bg-white border border-mw-neutral-100 rounded-md shadow-sm max-w-sm whitespace-normal', className),
|
|
41445
41454
|
children: [content, require$$1.jsx("div", {
|
|
41446
41455
|
className: clsx('w-0 h-0 border-4', arrowClasses[resolvedPosition]),
|
|
41447
41456
|
style: arrowStyle()
|
|
@@ -49563,7 +49572,8 @@ function AgGridTableInner(props) {
|
|
|
49563
49572
|
cacheBlockSize = props.cacheBlockSize,
|
|
49564
49573
|
footerData = props.footerData,
|
|
49565
49574
|
_props$pagination = props.pagination,
|
|
49566
|
-
pagination = _props$pagination === void 0 ? true : _props$pagination
|
|
49575
|
+
pagination = _props$pagination === void 0 ? true : _props$pagination,
|
|
49576
|
+
onBodyScrollEnd = props.onBodyScrollEnd;
|
|
49567
49577
|
var gridRef = React.useRef(null);
|
|
49568
49578
|
var apiRef = React.useRef(null);
|
|
49569
49579
|
var isSortFromExternalRef = React.useRef(false);
|
|
@@ -49731,6 +49741,9 @@ function AgGridTableInner(props) {
|
|
|
49731
49741
|
paginationPageSize: useGridPagination ? (_a = serverSideConfig === null || serverSideConfig === void 0 ? void 0 : serverSideConfig.pageSize) !== null && _a !== void 0 ? _a : 10 : undefined,
|
|
49732
49742
|
paginationPageSizeSelector: useGridPagination ? (_b = serverSideConfig === null || serverSideConfig === void 0 ? void 0 : serverSideConfig.pageSizeSelector) !== null && _b !== void 0 ? _b : DEFAULT_PAGE_SIZE_SELECTOR : undefined,
|
|
49733
49743
|
cacheBlockSize: cacheBlockSize,
|
|
49744
|
+
onBodyScrollEnd: onBodyScrollEnd ? function () {
|
|
49745
|
+
return onBodyScrollEnd();
|
|
49746
|
+
} : undefined,
|
|
49734
49747
|
pinnedBottomRowData: footerData === null || footerData === void 0 ? void 0 : footerData.map(function (row, i) {
|
|
49735
49748
|
return _typeof(row) === "object" && row !== null && !("id" in row) ? Object.assign(Object.assign({}, row), {
|
|
49736
49749
|
id: "pinned-bottom-".concat(i)
|