@infinite-table/infinite-react 5.0.0-canary.0 → 5.0.0-canary.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.
- package/index.css +10 -10
- package/index.d.ts +7 -1
- package/index.dev.js +192 -129
- package/index.dev.mjs +192 -129
- package/index.js +192 -129
- package/index.mjs +192 -129
- package/package.json +2 -2
package/index.js
CHANGED
|
@@ -1410,7 +1410,7 @@ function stripVar(cssVariableWithVarString) {
|
|
|
1410
1410
|
}
|
|
1411
1411
|
|
|
1412
1412
|
// src/components/InfiniteTable/internalVars.css.ts
|
|
1413
|
-
var InternalVars = { currentColumnTransformX: "var(--currentColumnTransformX__16hkbkc0)", y: "var(--y__16hkbkc1)", activeCellRowOffset: "var(--activeCellRowOffset__16hkbkc2)", activeCellRowHeight: "var(--
|
|
1413
|
+
var InternalVars = { currentColumnTransformX: "var(--currentColumnTransformX__16hkbkc0)", y: "var(--y__16hkbkc1)", activeCellRowOffset: "var(--activeCellRowOffset__16hkbkc2)", activeCellRowOffsetX: "var(--activeCellRowOffsetX__16hkbkc3)", activeCellRowHeight: "var(--activeCellRowHeight__16hkbkc4)", activeCellOffsetX: "var(--activeCellOffsetX__16hkbkc5)", activeCellOffsetY: "var(--activeCellOffsetY__16hkbkc6)", scrollTopForActiveRow: "var(--scrollTopForActiveRow__16hkbkc7)", scrollLeftForActiveRowWhenHorizontalLayout: "var(--scrollLeftForActiveRowWhenHorizontalLayout__16hkbkc8)", activeCellColWidth: "var(--activeCellColWidth__16hkbkc9)", activeCellColOffset: "var(--activeCellColOffset__16hkbkca)", columnReorderEffectDurationAtIndex: "var(--columnReorderEffectDurationAtIndex__16hkbkcb)", columnWidthAtIndex: "var(--columnWidthAtIndex__16hkbkcc)", columnOffsetAtIndex: "var(--columnOffsetAtIndex__16hkbkcd)", columnOffsetAtIndexWhileReordering: "var(--columnOffsetAtIndexWhileReordering__16hkbkce)", columnZIndexAtIndex: "var(--columnZIndexAtIndex__16hkbkcf)", pinnedStartWidth: "var(--pinnedStartWidth__16hkbkcg)", pinnedEndWidth: "var(--pinnedEndWidth__16hkbkch)", pinnedEndOffset: "var(--pinnedEndOffset__16hkbkci)", computedVisibleColumnsCount: "var(--computedVisibleColumnsCount__16hkbkcj)", baseZIndexForCells: "var(--baseZIndexForCells__16hkbkck)", bodyWidth: "var(--bodyWidth__16hkbkcl)", bodyHeight: "var(--bodyHeight__16hkbkcm)", scrollbarWidthHorizontal: "var(--scrollbarWidthHorizontal__16hkbkcn)", scrollbarWidthVertical: "var(--scrollbarWidthVertical__16hkbkco)", scrollLeft: "var(--scrollLeft__16hkbkcp)", scrollTop: "var(--scrollTop__16hkbkcq)" };
|
|
1414
1414
|
|
|
1415
1415
|
// src/utils/selectParent.ts
|
|
1416
1416
|
function selectParent(el, selector2) {
|
|
@@ -3122,11 +3122,13 @@ var ReactHeadlessTableRenderer = class extends Logger {
|
|
|
3122
3122
|
return { start: startRow, end: endRow };
|
|
3123
3123
|
};
|
|
3124
3124
|
this.getScrollPositionForScrollRowIntoView = (rowIndex, config = { offset: 0 }) => {
|
|
3125
|
+
var _a;
|
|
3125
3126
|
if (this.destroyed) {
|
|
3126
3127
|
return null;
|
|
3127
3128
|
}
|
|
3128
3129
|
const { brain } = this;
|
|
3129
3130
|
const scrollPosition = brain.getScrollPosition();
|
|
3131
|
+
let scrollLeft2 = scrollPosition.scrollLeft;
|
|
3130
3132
|
let { scrollAdjustPosition, offset = 0 } = config;
|
|
3131
3133
|
if (this.isRowFullyVisible(rowIndex) && !scrollAdjustPosition) {
|
|
3132
3134
|
return scrollPosition;
|
|
@@ -3156,9 +3158,22 @@ var ReactHeadlessTableRenderer = class extends Logger {
|
|
|
3156
3158
|
offset += rowHeight;
|
|
3157
3159
|
scrollTop2 += rowOffset - bottom + offset + fixedEndRowsHeight;
|
|
3158
3160
|
}
|
|
3159
|
-
|
|
3161
|
+
if (this.brain.isHorizontalLayoutBrain) {
|
|
3162
|
+
const colIndex = (_a = config.colIndex) != null ? _a : Math.ceil(this.brain.getInitialCols() / 2);
|
|
3163
|
+
const colScrollPosition = this.getScrollPositionForScrollColumnIntoView(
|
|
3164
|
+
colIndex,
|
|
3165
|
+
__spreadProps(__spreadValues({}, config), {
|
|
3166
|
+
horizontalLayoutPageIndex: this.brain.getPageIndexForRow(rowIndex)
|
|
3167
|
+
})
|
|
3168
|
+
);
|
|
3169
|
+
if (colScrollPosition) {
|
|
3170
|
+
scrollLeft2 = colScrollPosition.scrollLeft;
|
|
3171
|
+
}
|
|
3172
|
+
}
|
|
3173
|
+
return {
|
|
3174
|
+
scrollLeft: scrollLeft2,
|
|
3160
3175
|
scrollTop: scrollTop2
|
|
3161
|
-
}
|
|
3176
|
+
};
|
|
3162
3177
|
};
|
|
3163
3178
|
this.getScrollPositionForScrollColumnIntoView = (colIndex, config = { offset: 0 }) => {
|
|
3164
3179
|
if (this.destroyed) {
|
|
@@ -4269,9 +4284,9 @@ var HorizontalLayoutTableRenderer = class extends ReactHeadlessTableRenderer {
|
|
|
4269
4284
|
element.style.setProperty(currentTransformY, currentTransformYValue);
|
|
4270
4285
|
}
|
|
4271
4286
|
const xOffset = `calc(var(${columnOffsetX}) + ${pageOffset})`;
|
|
4272
|
-
const
|
|
4287
|
+
const transformX2 = `var(${columnOffsetXWhileReordering}, ${xOffset})`;
|
|
4273
4288
|
const transformY = `var(${currentTransformY})`;
|
|
4274
|
-
const transformValue = `translate3d(${
|
|
4289
|
+
const transformValue = `translate3d(${transformX2}, ${transformY}, 0px)`;
|
|
4275
4290
|
if (element.__transformValue !== transformValue) {
|
|
4276
4291
|
element.__transformValue = transformValue;
|
|
4277
4292
|
element.style.transform = transformValue;
|
|
@@ -4395,46 +4410,169 @@ var useRerender = () => {
|
|
|
4395
4410
|
var ActiveCellIndicatorCls = { visible: "ActiveCellIndicator_ActiveCellIndicatorCls_visible__nxbq1c2 ActiveCellIndicator_ActiveCellIndicator__nxbq1c1 utilities_pointerEvents_none__16lm1iwl utilities_position_absolute__16lm1iw2", hidden: "ActiveCellIndicator_ActiveCellIndicatorCls_hidden__nxbq1c3 ActiveCellIndicator_ActiveCellIndicator__nxbq1c1 utilities_pointerEvents_none__16lm1iwl utilities_position_absolute__16lm1iw2" };
|
|
4396
4411
|
var ActiveIndicatorWrapperCls = "ActiveCellIndicator_ActiveIndicatorWrapperCls__nxbq1c0 utilities_pointerEvents_none__16lm1iwl utilities_position_sticky__16lm1iw4 utilities_left_0__16lm1iw1e utilities_top_0__16lm1iw1c utilities_height_0__16lm1iw18 utilities_zIndex_1000000__16lm1iwu";
|
|
4397
4412
|
|
|
4413
|
+
// ../node_modules/@vanilla-extract/recipes/dist/createRuntimeFn-62c9670f.esm.js
|
|
4414
|
+
function toPrimitive(t, r) {
|
|
4415
|
+
if ("object" != typeof t || !t)
|
|
4416
|
+
return t;
|
|
4417
|
+
var e = t[Symbol.toPrimitive];
|
|
4418
|
+
if (void 0 !== e) {
|
|
4419
|
+
var i = e.call(t, r || "default");
|
|
4420
|
+
if ("object" != typeof i)
|
|
4421
|
+
return i;
|
|
4422
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
4423
|
+
}
|
|
4424
|
+
return ("string" === r ? String : Number)(t);
|
|
4425
|
+
}
|
|
4426
|
+
function toPropertyKey(t) {
|
|
4427
|
+
var i = toPrimitive(t, "string");
|
|
4428
|
+
return "symbol" == typeof i ? i : String(i);
|
|
4429
|
+
}
|
|
4430
|
+
function _defineProperty(obj, key, value) {
|
|
4431
|
+
key = toPropertyKey(key);
|
|
4432
|
+
if (key in obj) {
|
|
4433
|
+
Object.defineProperty(obj, key, {
|
|
4434
|
+
value,
|
|
4435
|
+
enumerable: true,
|
|
4436
|
+
configurable: true,
|
|
4437
|
+
writable: true
|
|
4438
|
+
});
|
|
4439
|
+
} else {
|
|
4440
|
+
obj[key] = value;
|
|
4441
|
+
}
|
|
4442
|
+
return obj;
|
|
4443
|
+
}
|
|
4444
|
+
function ownKeys(e, r) {
|
|
4445
|
+
var t = Object.keys(e);
|
|
4446
|
+
if (Object.getOwnPropertySymbols) {
|
|
4447
|
+
var o = Object.getOwnPropertySymbols(e);
|
|
4448
|
+
r && (o = o.filter(function(r2) {
|
|
4449
|
+
return Object.getOwnPropertyDescriptor(e, r2).enumerable;
|
|
4450
|
+
})), t.push.apply(t, o);
|
|
4451
|
+
}
|
|
4452
|
+
return t;
|
|
4453
|
+
}
|
|
4454
|
+
function _objectSpread2(e) {
|
|
4455
|
+
for (var r = 1; r < arguments.length; r++) {
|
|
4456
|
+
var t = null != arguments[r] ? arguments[r] : {};
|
|
4457
|
+
r % 2 ? ownKeys(Object(t), true).forEach(function(r2) {
|
|
4458
|
+
_defineProperty(e, r2, t[r2]);
|
|
4459
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r2) {
|
|
4460
|
+
Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t, r2));
|
|
4461
|
+
});
|
|
4462
|
+
}
|
|
4463
|
+
return e;
|
|
4464
|
+
}
|
|
4465
|
+
function mapValues(input, fn) {
|
|
4466
|
+
var result = {};
|
|
4467
|
+
for (var _key in input) {
|
|
4468
|
+
result[_key] = fn(input[_key], _key);
|
|
4469
|
+
}
|
|
4470
|
+
return result;
|
|
4471
|
+
}
|
|
4472
|
+
var shouldApplyCompound = (compoundCheck, selections, defaultVariants) => {
|
|
4473
|
+
for (var key of Object.keys(compoundCheck)) {
|
|
4474
|
+
var _selections$key;
|
|
4475
|
+
if (compoundCheck[key] !== ((_selections$key = selections[key]) !== null && _selections$key !== void 0 ? _selections$key : defaultVariants[key])) {
|
|
4476
|
+
return false;
|
|
4477
|
+
}
|
|
4478
|
+
}
|
|
4479
|
+
return true;
|
|
4480
|
+
};
|
|
4481
|
+
var createRuntimeFn = (config) => {
|
|
4482
|
+
var runtimeFn = (options) => {
|
|
4483
|
+
var className = config.defaultClassName;
|
|
4484
|
+
var selections = _objectSpread2(_objectSpread2({}, config.defaultVariants), options);
|
|
4485
|
+
for (var variantName in selections) {
|
|
4486
|
+
var _selections$variantNa;
|
|
4487
|
+
var variantSelection = (_selections$variantNa = selections[variantName]) !== null && _selections$variantNa !== void 0 ? _selections$variantNa : config.defaultVariants[variantName];
|
|
4488
|
+
if (variantSelection != null) {
|
|
4489
|
+
var selection = variantSelection;
|
|
4490
|
+
if (typeof selection === "boolean") {
|
|
4491
|
+
selection = selection === true ? "true" : "false";
|
|
4492
|
+
}
|
|
4493
|
+
var selectionClassName = (
|
|
4494
|
+
// @ts-expect-error
|
|
4495
|
+
config.variantClassNames[variantName][selection]
|
|
4496
|
+
);
|
|
4497
|
+
if (selectionClassName) {
|
|
4498
|
+
className += " " + selectionClassName;
|
|
4499
|
+
}
|
|
4500
|
+
}
|
|
4501
|
+
}
|
|
4502
|
+
for (var [compoundCheck, compoundClassName] of config.compoundVariants) {
|
|
4503
|
+
if (shouldApplyCompound(compoundCheck, selections, config.defaultVariants)) {
|
|
4504
|
+
className += " " + compoundClassName;
|
|
4505
|
+
}
|
|
4506
|
+
}
|
|
4507
|
+
return className;
|
|
4508
|
+
};
|
|
4509
|
+
runtimeFn.variants = () => Object.keys(config.variantClassNames);
|
|
4510
|
+
runtimeFn.classNames = {
|
|
4511
|
+
get base() {
|
|
4512
|
+
return config.defaultClassName.split(" ")[0];
|
|
4513
|
+
},
|
|
4514
|
+
get variants() {
|
|
4515
|
+
return mapValues(config.variantClassNames, (classNames) => mapValues(classNames, (className) => className.split(" ")[0]));
|
|
4516
|
+
}
|
|
4517
|
+
};
|
|
4518
|
+
return runtimeFn;
|
|
4519
|
+
};
|
|
4520
|
+
|
|
4398
4521
|
// src/components/InfiniteTable/components/ActiveRowIndicator.css.ts
|
|
4399
|
-
var
|
|
4522
|
+
var ActiveRowIndicatorRecipe = createRuntimeFn({ defaultClassName: "ActiveRowIndicator_ActiveRowIndicator__j26lrx0 utilities_pointerEvents_none__16lm1iwl utilities_position_absolute__16lm1iw2 utilities_top_0__16lm1iw1c utilities_left_0__16lm1iw1e", variantClassNames: { active: { true: "ActiveRowIndicator_ActiveRowIndicatorRecipe_active_true__j26lrx2", false: "ActiveRowIndicator_ActiveRowIndicatorRecipe_active_false__j26lrx3" } }, defaultVariants: {}, compoundVariants: [] });
|
|
4400
4523
|
|
|
4401
4524
|
// src/components/InfiniteTable/components/ActiveRowIndicator.tsx
|
|
4402
4525
|
var { rootClassName: rootClassName3 } = internalProps;
|
|
4403
4526
|
var baseCls = `${rootClassName3}-ActiveRowIndicator`;
|
|
4527
|
+
var transformX = `calc(${InternalVars.activeCellRowOffsetX} + var(${stripVar(
|
|
4528
|
+
InternalVars.scrollLeftForActiveRowWhenHorizontalLayout
|
|
4529
|
+
)}, 0px))`;
|
|
4404
4530
|
var ActiveStyle = {
|
|
4405
4531
|
[stripVar(InternalVars.activeCellOffsetY)]: InternalVars.activeCellRowOffset,
|
|
4406
|
-
transform: `translate3d(
|
|
4532
|
+
transform: `translate3d(${transformX}, calc( ${InternalVars.activeCellOffsetY} + var(${stripVar(InternalVars.scrollTopForActiveRow)}, 0px)), 0px)`,
|
|
4407
4533
|
height: InternalVars.activeCellRowHeight,
|
|
4408
4534
|
maxWidth: ThemeVars.runtime.totalVisibleColumnsWidthVar
|
|
4409
4535
|
};
|
|
4410
4536
|
var ActiveRowIndicatorFn = (props) => {
|
|
4411
4537
|
const { brain } = props;
|
|
4412
4538
|
const domRef = (0, import_react8.useRef)(null);
|
|
4413
|
-
const active = props.activeRowIndex != null && brain.
|
|
4539
|
+
const active = props.activeRowIndex != null && brain.getInitialRows() > props.activeRowIndex;
|
|
4414
4540
|
const [_rerenderId, rerender] = useRerender();
|
|
4415
4541
|
(0, import_react8.useLayoutEffect)(() => {
|
|
4416
4542
|
if (props.activeRowIndex == null) {
|
|
4417
4543
|
return;
|
|
4418
4544
|
}
|
|
4419
|
-
|
|
4545
|
+
let activeCellRowOffsetX = "0px";
|
|
4546
|
+
let rowIndex = props.activeRowIndex;
|
|
4547
|
+
if (brain.isHorizontalLayoutBrain && brain.rowsPerPage) {
|
|
4548
|
+
const pageIndex = brain.getPageIndexForRow(rowIndex);
|
|
4549
|
+
if (pageIndex > 0) {
|
|
4550
|
+
activeCellRowOffsetX = `calc(${ThemeVars.runtime.totalVisibleColumnsWidthVar} * ${pageIndex})`;
|
|
4551
|
+
}
|
|
4552
|
+
rowIndex = rowIndex % brain.rowsPerPage;
|
|
4553
|
+
}
|
|
4420
4554
|
const activeCellRowHeight = brain.getRowHeight(rowIndex);
|
|
4421
4555
|
const activeCellRowOffset = brain.getItemOffsetFor(rowIndex, "vertical");
|
|
4422
4556
|
const node = domRef.current;
|
|
4423
4557
|
const vars = {
|
|
4424
4558
|
activeCellRowHeight: `${activeCellRowHeight}px`,
|
|
4425
|
-
activeCellRowOffset: `${activeCellRowOffset}px
|
|
4559
|
+
activeCellRowOffset: `${activeCellRowOffset}px`,
|
|
4560
|
+
activeCellRowOffsetX
|
|
4426
4561
|
};
|
|
4427
4562
|
setInfiniteVarsOnNode(vars, node);
|
|
4428
|
-
}, [props.activeRowIndex]);
|
|
4563
|
+
}, [props.activeRowIndex, brain]);
|
|
4429
4564
|
(0, import_react8.useEffect)(() => {
|
|
4430
|
-
const
|
|
4565
|
+
const updateVars = (scrollPosition) => {
|
|
4431
4566
|
setInfiniteVarsOnNode(
|
|
4432
4567
|
{
|
|
4433
|
-
scrollTopForActiveRow: `${-scrollPosition.scrollTop}px
|
|
4568
|
+
scrollTopForActiveRow: `${-scrollPosition.scrollTop}px`,
|
|
4569
|
+
scrollLeftForActiveRowWhenHorizontalLayout: `${-scrollPosition.scrollLeft}px`
|
|
4434
4570
|
},
|
|
4435
4571
|
domRef.current
|
|
4436
4572
|
);
|
|
4437
|
-
}
|
|
4573
|
+
};
|
|
4574
|
+
updateVars(brain.getScrollPosition());
|
|
4575
|
+
const removeOnScroll = brain.onScroll(updateVars);
|
|
4438
4576
|
const removeOnRenderCountChange = brain.onRenderCountChange(rerender);
|
|
4439
4577
|
return () => {
|
|
4440
4578
|
removeOnRenderCountChange();
|
|
@@ -4448,7 +4586,9 @@ var ActiveRowIndicatorFn = (props) => {
|
|
|
4448
4586
|
{
|
|
4449
4587
|
ref: domRef,
|
|
4450
4588
|
"data-name": "active-row-indicator",
|
|
4451
|
-
className: `${baseCls} ${
|
|
4589
|
+
className: `${baseCls} ${ActiveRowIndicatorRecipe({
|
|
4590
|
+
active
|
|
4591
|
+
})}`,
|
|
4452
4592
|
style: active ? ActiveStyle : void 0
|
|
4453
4593
|
}
|
|
4454
4594
|
))
|
|
@@ -4490,7 +4630,7 @@ var ActiveCellIndicatorFn = (props) => {
|
|
|
4490
4630
|
const active = props.activeCellIndex != null && brain.getInitialRows() > props.activeCellIndex[0];
|
|
4491
4631
|
(0, import_react9.useLayoutEffect)(() => {
|
|
4492
4632
|
reposition(brain, props.activeCellIndex, props.rowHeight, domRef);
|
|
4493
|
-
}, [props.activeCellIndex, props.rowHeight]);
|
|
4633
|
+
}, [props.activeCellIndex, props.rowHeight, brain]);
|
|
4494
4634
|
(0, import_react9.useEffect)(() => {
|
|
4495
4635
|
const removeOnRenderCountChange = brain.onRenderCountChange(() => {
|
|
4496
4636
|
rerender();
|
|
@@ -5254,114 +5394,6 @@ var useInfiniteTableState = () => {
|
|
|
5254
5394
|
var React26 = __toESM(require("react"));
|
|
5255
5395
|
var import_react18 = require("react");
|
|
5256
5396
|
|
|
5257
|
-
// ../node_modules/@vanilla-extract/recipes/dist/createRuntimeFn-62c9670f.esm.js
|
|
5258
|
-
function toPrimitive(t, r) {
|
|
5259
|
-
if ("object" != typeof t || !t)
|
|
5260
|
-
return t;
|
|
5261
|
-
var e = t[Symbol.toPrimitive];
|
|
5262
|
-
if (void 0 !== e) {
|
|
5263
|
-
var i = e.call(t, r || "default");
|
|
5264
|
-
if ("object" != typeof i)
|
|
5265
|
-
return i;
|
|
5266
|
-
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
5267
|
-
}
|
|
5268
|
-
return ("string" === r ? String : Number)(t);
|
|
5269
|
-
}
|
|
5270
|
-
function toPropertyKey(t) {
|
|
5271
|
-
var i = toPrimitive(t, "string");
|
|
5272
|
-
return "symbol" == typeof i ? i : String(i);
|
|
5273
|
-
}
|
|
5274
|
-
function _defineProperty(obj, key, value) {
|
|
5275
|
-
key = toPropertyKey(key);
|
|
5276
|
-
if (key in obj) {
|
|
5277
|
-
Object.defineProperty(obj, key, {
|
|
5278
|
-
value,
|
|
5279
|
-
enumerable: true,
|
|
5280
|
-
configurable: true,
|
|
5281
|
-
writable: true
|
|
5282
|
-
});
|
|
5283
|
-
} else {
|
|
5284
|
-
obj[key] = value;
|
|
5285
|
-
}
|
|
5286
|
-
return obj;
|
|
5287
|
-
}
|
|
5288
|
-
function ownKeys(e, r) {
|
|
5289
|
-
var t = Object.keys(e);
|
|
5290
|
-
if (Object.getOwnPropertySymbols) {
|
|
5291
|
-
var o = Object.getOwnPropertySymbols(e);
|
|
5292
|
-
r && (o = o.filter(function(r2) {
|
|
5293
|
-
return Object.getOwnPropertyDescriptor(e, r2).enumerable;
|
|
5294
|
-
})), t.push.apply(t, o);
|
|
5295
|
-
}
|
|
5296
|
-
return t;
|
|
5297
|
-
}
|
|
5298
|
-
function _objectSpread2(e) {
|
|
5299
|
-
for (var r = 1; r < arguments.length; r++) {
|
|
5300
|
-
var t = null != arguments[r] ? arguments[r] : {};
|
|
5301
|
-
r % 2 ? ownKeys(Object(t), true).forEach(function(r2) {
|
|
5302
|
-
_defineProperty(e, r2, t[r2]);
|
|
5303
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r2) {
|
|
5304
|
-
Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t, r2));
|
|
5305
|
-
});
|
|
5306
|
-
}
|
|
5307
|
-
return e;
|
|
5308
|
-
}
|
|
5309
|
-
function mapValues(input, fn) {
|
|
5310
|
-
var result = {};
|
|
5311
|
-
for (var _key in input) {
|
|
5312
|
-
result[_key] = fn(input[_key], _key);
|
|
5313
|
-
}
|
|
5314
|
-
return result;
|
|
5315
|
-
}
|
|
5316
|
-
var shouldApplyCompound = (compoundCheck, selections, defaultVariants) => {
|
|
5317
|
-
for (var key of Object.keys(compoundCheck)) {
|
|
5318
|
-
var _selections$key;
|
|
5319
|
-
if (compoundCheck[key] !== ((_selections$key = selections[key]) !== null && _selections$key !== void 0 ? _selections$key : defaultVariants[key])) {
|
|
5320
|
-
return false;
|
|
5321
|
-
}
|
|
5322
|
-
}
|
|
5323
|
-
return true;
|
|
5324
|
-
};
|
|
5325
|
-
var createRuntimeFn = (config) => {
|
|
5326
|
-
var runtimeFn = (options) => {
|
|
5327
|
-
var className = config.defaultClassName;
|
|
5328
|
-
var selections = _objectSpread2(_objectSpread2({}, config.defaultVariants), options);
|
|
5329
|
-
for (var variantName in selections) {
|
|
5330
|
-
var _selections$variantNa;
|
|
5331
|
-
var variantSelection = (_selections$variantNa = selections[variantName]) !== null && _selections$variantNa !== void 0 ? _selections$variantNa : config.defaultVariants[variantName];
|
|
5332
|
-
if (variantSelection != null) {
|
|
5333
|
-
var selection = variantSelection;
|
|
5334
|
-
if (typeof selection === "boolean") {
|
|
5335
|
-
selection = selection === true ? "true" : "false";
|
|
5336
|
-
}
|
|
5337
|
-
var selectionClassName = (
|
|
5338
|
-
// @ts-expect-error
|
|
5339
|
-
config.variantClassNames[variantName][selection]
|
|
5340
|
-
);
|
|
5341
|
-
if (selectionClassName) {
|
|
5342
|
-
className += " " + selectionClassName;
|
|
5343
|
-
}
|
|
5344
|
-
}
|
|
5345
|
-
}
|
|
5346
|
-
for (var [compoundCheck, compoundClassName] of config.compoundVariants) {
|
|
5347
|
-
if (shouldApplyCompound(compoundCheck, selections, config.defaultVariants)) {
|
|
5348
|
-
className += " " + compoundClassName;
|
|
5349
|
-
}
|
|
5350
|
-
}
|
|
5351
|
-
return className;
|
|
5352
|
-
};
|
|
5353
|
-
runtimeFn.variants = () => Object.keys(config.variantClassNames);
|
|
5354
|
-
runtimeFn.classNames = {
|
|
5355
|
-
get base() {
|
|
5356
|
-
return config.defaultClassName.split(" ")[0];
|
|
5357
|
-
},
|
|
5358
|
-
get variants() {
|
|
5359
|
-
return mapValues(config.variantClassNames, (classNames) => mapValues(classNames, (className) => className.split(" ")[0]));
|
|
5360
|
-
}
|
|
5361
|
-
};
|
|
5362
|
-
return runtimeFn;
|
|
5363
|
-
};
|
|
5364
|
-
|
|
5365
5397
|
// src/components/InfiniteTable/components/InfiniteTableHeader/header.css.ts
|
|
5366
5398
|
var CellCls = "cell_CellCls__1eexc2a5 utilities_display_flex__16lm1iwz utilities_flexFlow_row__16lm1iw1o utilities_alignItems_center__16lm1iw1q utilities_position_absolute__16lm1iw2 utilities_willChange_transform__16lm1iw22 utilities_whiteSpace_nowrap__16lm1iw23 utilities_userSelect_none__16lm1iw17";
|
|
5367
5399
|
var HeaderCellContentRecipe = createRuntimeFn({ defaultClassName: "header_HeaderCellContentRecipe__12zfob122 utilities_height_100%__16lm1iw19 utilities_width_100%__16lm1iw1b utilities_display_flex__16lm1iwz utilities_flexFlow_row__16lm1iw1o utilities_alignItems_center__16lm1iw1q utilities_justifyContent_start__16lm1iw1v", variantClassNames: { filtered: { false: "header_HeaderCellContentRecipe_filtered_false__12zfob123", true: "header_HeaderCellContentRecipe_filtered_true__12zfob124" }, verticalAlign: { start: "header_HeaderCellContentRecipe_verticalAlign_start__12zfob125", end: "header_HeaderCellContentRecipe_verticalAlign_end__12zfob126", center: "header_HeaderCellContentRecipe_verticalAlign_center__12zfob127" }, align: { start: "header_HeaderCellContentRecipe_align_start__12zfob128", end: "header_HeaderCellContentRecipe_align_end__12zfob129", center: "header_HeaderCellContentRecipe_align_center__12zfob12a" } }, defaultVariants: {}, compoundVariants: [] });
|
|
@@ -17021,22 +17053,35 @@ var InfiniteTableApiImpl = class {
|
|
|
17021
17053
|
state.scrollerDOMRef.current.scrollTop = Math.max(scrollTop2, 0);
|
|
17022
17054
|
}
|
|
17023
17055
|
scrollRowIntoView(rowIndex, config = { offset: 0 }) {
|
|
17056
|
+
var _a;
|
|
17024
17057
|
const state = this.getState();
|
|
17058
|
+
const computed = this.getComputed();
|
|
17059
|
+
const currentScrollPosition = state.brain.getScrollPosition();
|
|
17060
|
+
let columnId = config.columnId;
|
|
17061
|
+
let colIndex = void 0;
|
|
17062
|
+
if (!columnId && state.brain.isHorizontalLayoutBrain && computed.computedVisibleColumns.length > 0) {
|
|
17063
|
+
columnId = computed.computedVisibleColumns[Math.ceil(computed.computedVisibleColumns.length / 2)].id;
|
|
17064
|
+
colIndex = (_a = computed.computedVisibleColumnsMap.get(columnId)) == null ? void 0 : _a.computedVisibleIndex;
|
|
17065
|
+
}
|
|
17025
17066
|
const scrollPosition = state.renderer.getScrollPositionForScrollRowIntoView(
|
|
17026
17067
|
rowIndex,
|
|
17027
|
-
config
|
|
17068
|
+
__spreadProps(__spreadValues({}, config), { colIndex })
|
|
17028
17069
|
);
|
|
17029
17070
|
if (!scrollPosition) {
|
|
17030
17071
|
return false;
|
|
17031
17072
|
}
|
|
17032
|
-
const currentScrollPosition = state.brain.getScrollPosition();
|
|
17033
17073
|
const scrollTopMax = state.brain.scrollTopMax;
|
|
17034
|
-
|
|
17074
|
+
const scrollLeftChanged = scrollPosition.scrollLeft !== currentScrollPosition.scrollLeft;
|
|
17075
|
+
const scrollTopValid = scrollPosition.scrollTop <= scrollTopMax + (config.offset || 0);
|
|
17076
|
+
if (!scrollTopValid && !scrollLeftChanged) {
|
|
17035
17077
|
return false;
|
|
17036
17078
|
}
|
|
17037
|
-
if (scrollPosition.scrollTop !== currentScrollPosition.scrollTop) {
|
|
17079
|
+
if (scrollTopValid && scrollPosition.scrollTop !== currentScrollPosition.scrollTop) {
|
|
17038
17080
|
state.scrollerDOMRef.current.scrollTop = scrollPosition.scrollTop;
|
|
17039
17081
|
}
|
|
17082
|
+
if (scrollLeftChanged) {
|
|
17083
|
+
state.scrollerDOMRef.current.scrollLeft = scrollPosition.scrollLeft;
|
|
17084
|
+
}
|
|
17040
17085
|
return true;
|
|
17041
17086
|
}
|
|
17042
17087
|
scrollColumnIntoView(columnId, config = { offset: 0 }) {
|
|
@@ -19720,7 +19765,7 @@ var useLicense = (licenseKey = "") => {
|
|
|
19720
19765
|
}
|
|
19721
19766
|
let valid2 = isValidLicense(licenseKey, {
|
|
19722
19767
|
publishedAt: 1624970570587,
|
|
19723
|
-
version: "5.0.0-canary.
|
|
19768
|
+
version: "5.0.0-canary.1"
|
|
19724
19769
|
});
|
|
19725
19770
|
if (!licenseKey && !valid2 && isInsidePlayground) {
|
|
19726
19771
|
return true;
|
|
@@ -19981,6 +20026,15 @@ function handleRowNavigation(options, event) {
|
|
|
19981
20026
|
},
|
|
19982
20027
|
ArrowLeft: () => {
|
|
19983
20028
|
const rowInfo = dataArray[activeRowIndex];
|
|
20029
|
+
if (brain.isHorizontalLayoutBrain) {
|
|
20030
|
+
const rowsPerPage = brain.rowsPerPage;
|
|
20031
|
+
if (activeRowIndex - rowsPerPage >= min) {
|
|
20032
|
+
activeRowIndex = activeRowIndex - rowsPerPage;
|
|
20033
|
+
} else {
|
|
20034
|
+
KeyToFunction.ArrowUp();
|
|
20035
|
+
}
|
|
20036
|
+
return;
|
|
20037
|
+
}
|
|
19984
20038
|
if (rowInfo && rowInfo.isGroupRow) {
|
|
19985
20039
|
return api.collapseGroupRow(rowInfo.groupKeys);
|
|
19986
20040
|
}
|
|
@@ -19991,6 +20045,15 @@ function handleRowNavigation(options, event) {
|
|
|
19991
20045
|
},
|
|
19992
20046
|
ArrowRight: () => {
|
|
19993
20047
|
const rowInfo = dataArray[activeRowIndex];
|
|
20048
|
+
if (brain.isHorizontalLayoutBrain) {
|
|
20049
|
+
const rowsPerPage = brain.rowsPerPage;
|
|
20050
|
+
if (activeRowIndex + rowsPerPage <= max) {
|
|
20051
|
+
activeRowIndex = activeRowIndex + rowsPerPage;
|
|
20052
|
+
} else {
|
|
20053
|
+
KeyToFunction.ArrowDown();
|
|
20054
|
+
}
|
|
20055
|
+
return;
|
|
20056
|
+
}
|
|
19994
20057
|
if (rowInfo && rowInfo.isGroupRow) {
|
|
19995
20058
|
return api.expandGroupRow(rowInfo.groupKeys);
|
|
19996
20059
|
}
|