@infinite-table/infinite-react 1.3.17 → 1.3.19
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 +1 -1
- package/index.d.ts +24 -13
- package/index.dev.js +185 -44
- package/index.dev.mjs +185 -43
- package/index.js +5 -5
- package/index.mjs +5 -5
- package/package.json +2 -2
package/index.dev.js
CHANGED
|
@@ -873,7 +873,6 @@ __export(src_exports, {
|
|
|
873
873
|
InfiniteTableClassName: () => InfiniteTableClassName,
|
|
874
874
|
InfiniteTableComponent: () => InfiniteTableComponent,
|
|
875
875
|
Menu: () => Menu,
|
|
876
|
-
MenuIcon: () => MenuIcon,
|
|
877
876
|
RowSelectionState: () => RowSelectionState,
|
|
878
877
|
components: () => components,
|
|
879
878
|
debounce: () => debounce,
|
|
@@ -4955,6 +4954,15 @@ var React42 = __toESM(require("react"));
|
|
|
4955
4954
|
var import_react28 = require("react");
|
|
4956
4955
|
var import_react_dom = require("react-dom");
|
|
4957
4956
|
|
|
4957
|
+
// src/utils/keyMirror.ts
|
|
4958
|
+
function keyMirror(obj) {
|
|
4959
|
+
const result = {};
|
|
4960
|
+
Object.keys(obj).forEach((key) => {
|
|
4961
|
+
result[key] = key;
|
|
4962
|
+
});
|
|
4963
|
+
return result;
|
|
4964
|
+
}
|
|
4965
|
+
|
|
4958
4966
|
// src/components/InfiniteTable/components/icons/Icon.tsx
|
|
4959
4967
|
var React16 = __toESM(require("react"));
|
|
4960
4968
|
var Icon = (props) => {
|
|
@@ -5132,22 +5140,22 @@ var createRuntimeFn = (config) => (options) => {
|
|
|
5132
5140
|
|
|
5133
5141
|
// src/components/InfiniteTable/components/InfiniteTableHeader/header.css.ts
|
|
5134
5142
|
var CellCls = "cell_CellCls__1eexc2a5 utilities_display_flex__16lm1iwy utilities_flexFlow_row__16lm1iw1n utilities_alignItems_center__16lm1iw1p utilities_position_absolute__16lm1iw2 utilities_willChange_transform__16lm1iw21 utilities_whiteSpace_nowrap__16lm1iw22 utilities_userSelect_none__16lm1iw16";
|
|
5135
|
-
var HeaderCellContentRecipe = createRuntimeFn({ defaultClassName: "
|
|
5143
|
+
var HeaderCellContentRecipe = createRuntimeFn({ defaultClassName: "header_HeaderCellContentRecipe__12zfob11v utilities_height_100%__16lm1iw18 utilities_width_100%__16lm1iw1a utilities_display_flex__16lm1iwy utilities_flexFlow_row__16lm1iw1n utilities_alignItems_center__16lm1iw1p utilities_justifyContent_start__16lm1iw1u", variantClassNames: { filtered: { false: "header_HeaderCellContentRecipe_filtered_false__12zfob11w", true: "header_HeaderCellContentRecipe_filtered_true__12zfob11x" }, verticalAlign: { start: "header_HeaderCellContentRecipe_verticalAlign_start__12zfob11y", end: "header_HeaderCellContentRecipe_verticalAlign_end__12zfob11z", center: "header_HeaderCellContentRecipe_verticalAlign_center__12zfob120" }, align: { start: "header_HeaderCellContentRecipe_align_start__12zfob121", end: "header_HeaderCellContentRecipe_align_end__12zfob122", center: "header_HeaderCellContentRecipe_align_center__12zfob123" } }, defaultVariants: {}, compoundVariants: [] });
|
|
5136
5144
|
var HeaderCellProxy = "header_HeaderCellProxy__12zfob1m utilities_whiteSpace_nowrap__16lm1iw22 utilities_textOverflow_ellipsis__16lm1iw23 utilities_overflow_hidden__16lm1iw1w";
|
|
5137
5145
|
var HeaderCellRecipe = createRuntimeFn({ defaultClassName: "header_HeaderCellRecipe__12zfob1n utilities_display_block__16lm1iw11", variantClassNames: { rowActive: { false: "header_HeaderCellRecipe_rowActive_false__12zfob1o", true: "header_HeaderCellRecipe_rowActive_true__12zfob1p" }, rowSelected: { false: "header_HeaderCellRecipe_rowSelected_false__12zfob1q", true: "header_HeaderCellRecipe_rowSelected_true__12zfob1r", null: "header_HeaderCellRecipe_rowSelected_null__12zfob1s" }, groupRow: { false: "header_HeaderCellRecipe_groupRow_false__12zfob1t", true: "header_HeaderCellRecipe_groupRow_true__12zfob1u" }, groupCell: { false: "header_HeaderCellRecipe_groupCell_false__12zfob1v", true: "header_HeaderCellRecipe_groupCell_true__12zfob1w" }, align: { start: "header_HeaderCellRecipe_align_start__12zfob1x", end: "header_HeaderCellRecipe_align_end__12zfob1y", center: "header_HeaderCellRecipe_align_center__12zfob1z" }, verticalAlign: { start: "header_HeaderCellRecipe_verticalAlign_start__12zfob110", end: "header_HeaderCellRecipe_verticalAlign_end__12zfob111", center: "header_HeaderCellRecipe_verticalAlign_center__12zfob112" }, zebra: { false: "header_HeaderCellRecipe_zebra_false__12zfob113", even: "header_HeaderCellRecipe_zebra_even__12zfob114", odd: "header_HeaderCellRecipe_zebra_odd__12zfob115" }, dragging: { true: "header_HeaderCellRecipe_dragging_true__12zfob116", false: "header_HeaderCellRecipe_dragging_false__12zfob117" }, first: { true: "header_HeaderCellRecipe_first_true__12zfob118", false: "header_HeaderCellRecipe_first_false__12zfob119" }, last: { true: "header_HeaderCellRecipe_last_true__12zfob11a", false: "header_HeaderCellRecipe_last_false__12zfob11b" }, groupByField: { true: "header_HeaderCellRecipe_groupByField_true__12zfob11c", false: "header_HeaderCellRecipe_groupByField_false__12zfob11d" }, firstInCategory: { true: "header_HeaderCellRecipe_firstInCategory_true__12zfob11e", false: "header_HeaderCellRecipe_firstInCategory_false__12zfob11f" }, lastInCategory: { true: "header_HeaderCellRecipe_lastInCategory_true__12zfob11g", false: "header_HeaderCellRecipe_lastInCategory_false__12zfob11h" }, pinned: { start: "header_HeaderCellRecipe_pinned_start__12zfob11i", end: "header_HeaderCellRecipe_pinned_end__12zfob11j", false: "header_HeaderCellRecipe_pinned_false__12zfob11k" }, filtered: { true: "header_HeaderCellRecipe_filtered_true__12zfob11l", false: "header_HeaderCellRecipe_filtered_false__12zfob11m" } }, defaultVariants: {}, compoundVariants: [[{ pinned: "start", lastInCategory: true }, "header_HeaderCellRecipe_compound_0__12zfob11n"], [{ pinned: "end", firstInCategory: true }, "header_HeaderCellRecipe_compound_1__12zfob11o"], [{ pinned: false, lastInCategory: true }, "header_HeaderCellRecipe_compound_2__12zfob11p"]] });
|
|
5138
5146
|
var HeaderClsRecipe = createRuntimeFn({ defaultClassName: "header_HeaderClsRecipe__12zfob18 utilities_display_block__16lm1iw11 utilities_position_absolute__16lm1iw2", variantClassNames: { pinned: { start: "header_HeaderClsRecipe_pinned_start__12zfob19", end: "header_HeaderClsRecipe_pinned_end__12zfob1a", false: "header_HeaderClsRecipe_pinned_false__12zfob1b" }, firstInCategory: { true: "header_HeaderClsRecipe_firstInCategory_true__12zfob1c", false: "header_HeaderClsRecipe_firstInCategory_false__12zfob1d" }, lastInCategory: { true: "header_HeaderClsRecipe_lastInCategory_true__12zfob1e", false: "header_HeaderClsRecipe_lastInCategory_false__12zfob1f" }, overflow: { true: "header_HeaderClsRecipe_overflow_true__12zfob1g", false: "header_HeaderClsRecipe_overflow_false__12zfob1h" } }, defaultVariants: {}, compoundVariants: [[{ overflow: true, pinned: "start" }, "header_HeaderClsRecipe_compound_0__12zfob1i"], [{ pinned: "start", firstInCategory: true }, "header_HeaderClsRecipe_compound_1__12zfob1j"], [{ overflow: true, pinned: "end" }, "header_HeaderClsRecipe_compound_2__12zfob1k"], [{ pinned: "end", lastInCategory: true }, "header_HeaderClsRecipe_compound_3__12zfob1l"]] });
|
|
5139
|
-
var HeaderFilterCls = "
|
|
5140
|
-
var HeaderFilterEditorCls = "
|
|
5147
|
+
var HeaderFilterCls = "header_HeaderFilterCls__12zfob126 utilities_display_flex__16lm1iwy utilities_flexFlow_row__16lm1iw1n utilities_alignItems_stretch__16lm1iw1q utilities_position_relative__16lm1iw1";
|
|
5148
|
+
var HeaderFilterEditorCls = "header_HeaderFilterEditorCls__12zfob12b utilities_width_100%__16lm1iw1a utilities_height_100%__16lm1iw18";
|
|
5141
5149
|
var HeaderFilterIconIndexCls = "header_HeaderFilterIconIndexCls__12zfob16";
|
|
5142
|
-
var HeaderFilterOperatorCls = "
|
|
5143
|
-
var HeaderFilterOperatorIconRecipe = createRuntimeFn({ defaultClassName: "
|
|
5144
|
-
var HeaderGroupCls = "
|
|
5145
|
-
var HeaderMenuIconCls = createRuntimeFn({ defaultClassName: "header_HeaderMenuIconCls__12zfob11q utilities_position_relative__16lm1iw1 utilities_display_flex__16lm1iwy utilities_flexFlow_column__16lm1iw1l utilities_justifyContent_spaceAround__16lm1iw1t utilities_visibility_hidden__16lm1iw20", variantClassNames: { reserveSpaceWhenHidden: { true: "
|
|
5150
|
+
var HeaderFilterOperatorCls = "header_HeaderFilterOperatorCls__12zfob127 utilities_display_flex__16lm1iwy utilities_flexFlow_row__16lm1iw1n utilities_alignItems_center__16lm1iw1p utilities_position_relative__16lm1iw1";
|
|
5151
|
+
var HeaderFilterOperatorIconRecipe = createRuntimeFn({ defaultClassName: "header_HeaderFilterOperatorIconRecipe__12zfob128 utilities_position_relative__16lm1iw1 utilities_top_0__16lm1iw1b", variantClassNames: { disabled: { true: "header_HeaderFilterOperatorIconRecipe_disabled_true__12zfob129", false: "header_HeaderFilterOperatorIconRecipe_disabled_false__12zfob12a" } }, defaultVariants: {}, compoundVariants: [] });
|
|
5152
|
+
var HeaderGroupCls = "header_HeaderGroupCls__12zfob125 utilities_display_flex__16lm1iwy utilities_flexFlow_row__16lm1iw1n utilities_alignItems_center__16lm1iw1p";
|
|
5153
|
+
var HeaderMenuIconCls = createRuntimeFn({ defaultClassName: "header_HeaderMenuIconCls__12zfob11q utilities_position_relative__16lm1iw1 utilities_display_flex__16lm1iwy utilities_flexFlow_column__16lm1iw1l utilities_justifyContent_spaceAround__16lm1iw1t utilities_visibility_hidden__16lm1iw20", variantClassNames: { menuVisible: { true: "header_HeaderMenuIconCls_menuVisible_true__12zfob11r" }, reserveSpaceWhenHidden: { true: "header_HeaderMenuIconCls_reserveSpaceWhenHidden_true__12zfob11s", false: "header_HeaderMenuIconCls_reserveSpaceWhenHidden_false__12zfob11t" } }, defaultVariants: {}, compoundVariants: [[{ menuVisible: true, reserveSpaceWhenHidden: false }, "header_HeaderMenuIconCls_compound_0__12zfob11u"]] });
|
|
5146
5154
|
var HeaderScrollbarPlaceholderCls = "header_HeaderScrollbarPlaceholderCls__12zfob17 utilities_position_absolute__16lm1iw2";
|
|
5147
5155
|
var HeaderSortIconCls = "utilities_position_relative__16lm1iw1";
|
|
5148
5156
|
var HeaderSortIconIndexCls = "header_HeaderSortIconIndexCls__12zfob15";
|
|
5149
5157
|
var HeaderSortIconRecipe = createRuntimeFn({ defaultClassName: "", variantClassNames: { align: { start: "header_HeaderSortIconRecipe_align_start__12zfob12", center: "header_HeaderSortIconRecipe_align_center__12zfob13", end: "header_HeaderSortIconRecipe_align_end__12zfob14" } }, defaultVariants: {}, compoundVariants: [] });
|
|
5150
|
-
var HeaderWrapperCls = "
|
|
5158
|
+
var HeaderWrapperCls = "header_HeaderWrapperCls__12zfob124 utilities_overflow_hidden__16lm1iw1w utilities_position_relative__16lm1iw1 utilities_display_flex__16lm1iwy utilities_flexFlow_row__16lm1iw1n";
|
|
5151
5159
|
|
|
5152
5160
|
// src/components/InfiniteTable/components/icons/InfiniteTableIconClassName.ts
|
|
5153
5161
|
var InfiniteTableIconClassName = "InfiniteTableIcon";
|
|
@@ -5267,6 +5275,9 @@ function getColumnApiForColumn(colOrColId, param) {
|
|
|
5267
5275
|
hideContextMenu() {
|
|
5268
5276
|
actions.columnMenuVisibleForColumnId = null;
|
|
5269
5277
|
},
|
|
5278
|
+
isVisible() {
|
|
5279
|
+
return getComputed().computedVisibleColumnsMap.has(column.id);
|
|
5280
|
+
},
|
|
5270
5281
|
toggleSort(params = {
|
|
5271
5282
|
multiSortBehavior: "replace"
|
|
5272
5283
|
}) {
|
|
@@ -7714,20 +7725,34 @@ var defaultLineStyle2 = {
|
|
|
7714
7725
|
pointerEvents: "none"
|
|
7715
7726
|
};
|
|
7716
7727
|
var lineClassName = `${InfiniteTableIconClassName}-menu`;
|
|
7728
|
+
var MenuIconDataAttributes = keyMirror({
|
|
7729
|
+
"data-name": ""
|
|
7730
|
+
});
|
|
7731
|
+
var MenuIconDataAttributesValues = {
|
|
7732
|
+
[MenuIconDataAttributes["data-name"]]: "menu-icon"
|
|
7733
|
+
};
|
|
7717
7734
|
function MenuIcon(props) {
|
|
7718
|
-
const {
|
|
7735
|
+
const {
|
|
7736
|
+
style: style2,
|
|
7737
|
+
className,
|
|
7738
|
+
domProps,
|
|
7739
|
+
reserveSpaceWhenHidden,
|
|
7740
|
+
menuVisible,
|
|
7741
|
+
children
|
|
7742
|
+
} = props;
|
|
7719
7743
|
const lineStyle = __spreadValues(__spreadProps(__spreadValues({}, defaultLineStyle2), {
|
|
7720
7744
|
borderTop: `${ThemeVars.components.HeaderCell.menuIconLineWidth} solid currentColor`
|
|
7721
7745
|
}), props.lineStyle);
|
|
7722
7746
|
return /* @__PURE__ */ React38.createElement(
|
|
7723
7747
|
"div",
|
|
7724
|
-
__spreadProps(__spreadValues({}, domProps), {
|
|
7725
|
-
style: style2
|
|
7726
|
-
|
|
7748
|
+
__spreadProps(__spreadValues(__spreadProps(__spreadValues({}, domProps), {
|
|
7749
|
+
style: style2
|
|
7750
|
+
}), MenuIconDataAttributesValues), {
|
|
7727
7751
|
onPointerDown: (e) => e.stopPropagation(),
|
|
7728
7752
|
className: join(
|
|
7729
7753
|
className,
|
|
7730
7754
|
HeaderMenuIconCls({
|
|
7755
|
+
menuVisible,
|
|
7731
7756
|
reserveSpaceWhenHidden
|
|
7732
7757
|
}),
|
|
7733
7758
|
InfiniteTableIconClassName,
|
|
@@ -8508,6 +8533,11 @@ var { rootClassName: rootClassName8 } = internalProps;
|
|
|
8508
8533
|
var InfiniteTableHeaderCellClassName = `${rootClassName8}HeaderCell`;
|
|
8509
8534
|
var columnZIndexAtIndex5 = stripVar(InternalVars.columnZIndexAtIndex);
|
|
8510
8535
|
var spacer = /* @__PURE__ */ React42.createElement("div", { className: flex["1"] });
|
|
8536
|
+
var InfiniteHeaderCellDataAttributes = keyMirror({
|
|
8537
|
+
"data-name": ``,
|
|
8538
|
+
"data-header-align": "",
|
|
8539
|
+
"data-column-id": ""
|
|
8540
|
+
});
|
|
8511
8541
|
function InfiniteTableHeaderCell(props) {
|
|
8512
8542
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o;
|
|
8513
8543
|
const column = props.column;
|
|
@@ -8521,7 +8551,8 @@ function InfiniteTableHeaderCell(props) {
|
|
|
8521
8551
|
components: components2,
|
|
8522
8552
|
portalDOMRef,
|
|
8523
8553
|
columnHeaderHeight,
|
|
8524
|
-
columnReorderDragColumnId
|
|
8554
|
+
columnReorderDragColumnId,
|
|
8555
|
+
columnMenuVisibleForColumnId
|
|
8525
8556
|
}
|
|
8526
8557
|
} = useInfiniteTable();
|
|
8527
8558
|
const {
|
|
@@ -8568,6 +8599,7 @@ function InfiniteTableHeaderCell(props) {
|
|
|
8568
8599
|
const headerCSSEllipsis = (_e = (_d = column.headerCssEllipsis) != null ? _d : column.cssEllipsis) != null ? _e : true;
|
|
8569
8600
|
const menuIconProps = {
|
|
8570
8601
|
reserveSpaceWhenHidden: align2 === "center",
|
|
8602
|
+
menuVisible: columnMenuVisibleForColumnId === column.id,
|
|
8571
8603
|
style: align2 === "end" ? {
|
|
8572
8604
|
marginInlineStart: `calc(${ThemeVars.components.HeaderCell.resizeHandleActiveAreaWidth} / 2)`,
|
|
8573
8605
|
marginInlineEnd: ThemeVars.spacing[2]
|
|
@@ -8611,6 +8643,7 @@ function InfiniteTableHeaderCell(props) {
|
|
|
8611
8643
|
sortIcon,
|
|
8612
8644
|
filterIcon,
|
|
8613
8645
|
menuIcon,
|
|
8646
|
+
menuIconProps,
|
|
8614
8647
|
selectionCheckBox: null,
|
|
8615
8648
|
header: column.header && typeof column.header !== "function" ? column.header : column.name
|
|
8616
8649
|
}
|
|
@@ -8647,7 +8680,19 @@ function InfiniteTableHeaderCell(props) {
|
|
|
8647
8680
|
renderParam2.renderBag.menuIcon = /* @__PURE__ */ React42.createElement(
|
|
8648
8681
|
RenderHeaderCellHookComponent,
|
|
8649
8682
|
{
|
|
8650
|
-
render:
|
|
8683
|
+
render: (param) => {
|
|
8684
|
+
if (typeof column.renderMenuIcon !== "function") {
|
|
8685
|
+
return null;
|
|
8686
|
+
}
|
|
8687
|
+
const result = column.renderMenuIcon(param);
|
|
8688
|
+
if (result) {
|
|
8689
|
+
if (result.type === MenuIconCmp || result.type === MenuIcon) {
|
|
8690
|
+
return result;
|
|
8691
|
+
}
|
|
8692
|
+
return /* @__PURE__ */ React42.createElement(MenuIconCmp, __spreadValues({}, menuIconProps), result);
|
|
8693
|
+
}
|
|
8694
|
+
return null;
|
|
8695
|
+
},
|
|
8651
8696
|
renderParam: __spreadProps(__spreadValues({}, renderParam2), {
|
|
8652
8697
|
renderBag: __spreadValues({}, renderParam2.renderBag)
|
|
8653
8698
|
})
|
|
@@ -8771,15 +8816,18 @@ function InfiniteTableHeaderCell(props) {
|
|
|
8771
8816
|
const resizeHandle = useColumnResizeHandle(column);
|
|
8772
8817
|
const zIndex2 = `var(${columnZIndexAtIndex5}-${column.computedVisibleIndex})`;
|
|
8773
8818
|
style2.zIndex = zIndex2;
|
|
8819
|
+
const dataAttrs = {
|
|
8820
|
+
"data-column-id": column.id,
|
|
8821
|
+
"data-header-align": align2,
|
|
8822
|
+
"data-name": "HeaderCell"
|
|
8823
|
+
};
|
|
8774
8824
|
return /* @__PURE__ */ React42.createElement(ContextProvider, { value: renderParam }, /* @__PURE__ */ React42.createElement(
|
|
8775
8825
|
InfiniteTableCell,
|
|
8776
|
-
{
|
|
8826
|
+
__spreadProps(__spreadValues({
|
|
8777
8827
|
domRef: ref,
|
|
8778
8828
|
cellType: "header",
|
|
8779
|
-
column
|
|
8780
|
-
|
|
8781
|
-
"data-header-align": align2,
|
|
8782
|
-
"data-column-id": column.id,
|
|
8829
|
+
column
|
|
8830
|
+
}, dataAttrs), {
|
|
8783
8831
|
"data-z-index": zIndex2,
|
|
8784
8832
|
style: style2,
|
|
8785
8833
|
width,
|
|
@@ -8828,7 +8876,7 @@ function InfiniteTableHeaderCell(props) {
|
|
|
8828
8876
|
}
|
|
8829
8877
|
) : /* @__PURE__ */ React42.createElement(InfiniteTableColumnHeaderFilterEmpty, null) : null, resizeHandle),
|
|
8830
8878
|
renderChildren
|
|
8831
|
-
}
|
|
8879
|
+
})
|
|
8832
8880
|
), draggingProxy);
|
|
8833
8881
|
}
|
|
8834
8882
|
function useInfiniteHeaderCell() {
|
|
@@ -13395,6 +13443,48 @@ function useRowInfoReducers() {
|
|
|
13395
13443
|
return rowInfoReducerResults;
|
|
13396
13444
|
}
|
|
13397
13445
|
|
|
13446
|
+
// src/components/InfiniteTable/api/realignColumnContextMenu.ts
|
|
13447
|
+
function realignColumnContextMenu(param) {
|
|
13448
|
+
const { getComputed, getState, actions } = param;
|
|
13449
|
+
const columnMenuVisibleForColumnId = getState().columnMenuVisibleForColumnId;
|
|
13450
|
+
if (!columnMenuVisibleForColumnId) {
|
|
13451
|
+
return;
|
|
13452
|
+
}
|
|
13453
|
+
const computed = getComputed();
|
|
13454
|
+
const visibleCols = computed.computedVisibleColumnsMap;
|
|
13455
|
+
const order2 = computed.computedColumnOrder;
|
|
13456
|
+
if (visibleCols.has(columnMenuVisibleForColumnId)) {
|
|
13457
|
+
actions.columnMenuVisibleKey = Date.now();
|
|
13458
|
+
return;
|
|
13459
|
+
}
|
|
13460
|
+
function tryCol(diff2, sign2) {
|
|
13461
|
+
const colId2 = order2[index + diff2 * sign2];
|
|
13462
|
+
if (visibleCols.has(colId2)) {
|
|
13463
|
+
return colId2;
|
|
13464
|
+
}
|
|
13465
|
+
return;
|
|
13466
|
+
}
|
|
13467
|
+
const index = order2.indexOf(columnMenuVisibleForColumnId);
|
|
13468
|
+
let diff = 0;
|
|
13469
|
+
let sign = -1;
|
|
13470
|
+
let colId;
|
|
13471
|
+
while (!colId && diff < order2.length) {
|
|
13472
|
+
diff++;
|
|
13473
|
+
colId = tryCol(diff, sign);
|
|
13474
|
+
if (!colId) {
|
|
13475
|
+
sign *= -1;
|
|
13476
|
+
colId = tryCol(diff, sign);
|
|
13477
|
+
}
|
|
13478
|
+
if (colId) {
|
|
13479
|
+
break;
|
|
13480
|
+
}
|
|
13481
|
+
}
|
|
13482
|
+
if (colId) {
|
|
13483
|
+
actions.columnMenuVisibleForColumnId = colId;
|
|
13484
|
+
}
|
|
13485
|
+
return colId;
|
|
13486
|
+
}
|
|
13487
|
+
|
|
13398
13488
|
// src/components/InfiniteTable/api/getImperativeApi.ts
|
|
13399
13489
|
var InfiniteTableApiImpl = class {
|
|
13400
13490
|
constructor(context) {
|
|
@@ -13702,6 +13792,21 @@ var InfiniteTableApiImpl = class {
|
|
|
13702
13792
|
this.actions.contextMenuVisibleFor = null;
|
|
13703
13793
|
this.actions.cellContextMenuVisibleFor = null;
|
|
13704
13794
|
}
|
|
13795
|
+
realignColumnContextMenu() {
|
|
13796
|
+
realignColumnContextMenu({
|
|
13797
|
+
actions: this.actions,
|
|
13798
|
+
getState: this.getState,
|
|
13799
|
+
getComputed: this.getComputed
|
|
13800
|
+
});
|
|
13801
|
+
}
|
|
13802
|
+
getColumnOrder() {
|
|
13803
|
+
return this.getComputed().computedColumnOrder;
|
|
13804
|
+
}
|
|
13805
|
+
getVisibleColumnOrder() {
|
|
13806
|
+
const order2 = this.getColumnOrder();
|
|
13807
|
+
const visibleColumns = this.getComputed().computedVisibleColumnsMap;
|
|
13808
|
+
return order2.filter((id) => visibleColumns.has(id));
|
|
13809
|
+
}
|
|
13705
13810
|
startEdit(params) {
|
|
13706
13811
|
return __async(this, null, function* () {
|
|
13707
13812
|
const { columnId, rowIndex: index, primaryKey } = params;
|
|
@@ -14771,6 +14876,7 @@ function initSetupState2() {
|
|
|
14771
14876
|
cellContextMenuVisibleFor: null,
|
|
14772
14877
|
contextMenuVisibleFor: null,
|
|
14773
14878
|
columnMenuVisibleForColumnId: null,
|
|
14879
|
+
columnMenuVisibleKey: 0,
|
|
14774
14880
|
filterOperatorMenuVisibleForColumnId: null,
|
|
14775
14881
|
getDOMNodeForCell: (cellPosition) => {
|
|
14776
14882
|
if (!domRef.current) {
|
|
@@ -14782,6 +14888,7 @@ function initSetupState2() {
|
|
|
14782
14888
|
brain,
|
|
14783
14889
|
headerBrain,
|
|
14784
14890
|
domRef,
|
|
14891
|
+
columnMenuTargetRef: (0, import_react42.createRef)(),
|
|
14785
14892
|
editingValueRef: (0, import_react42.createRef)(),
|
|
14786
14893
|
scrollerDOMRef: (0, import_react42.createRef)(),
|
|
14787
14894
|
portalDOMRef: (0, import_react42.createRef)(),
|
|
@@ -14931,6 +15038,7 @@ var cleanupState = (state) => {
|
|
|
14931
15038
|
state.onColumnMenuClick.destroy();
|
|
14932
15039
|
state.onFilterOperatorMenuClick.destroy();
|
|
14933
15040
|
state.domRef.current = null;
|
|
15041
|
+
state.columnMenuTargetRef.current = null;
|
|
14934
15042
|
state.scrollerDOMRef.current = null;
|
|
14935
15043
|
state.portalDOMRef.current = null;
|
|
14936
15044
|
state.onRowHeightCSSVarChange.destroy();
|
|
@@ -16561,7 +16669,7 @@ var useLicense = (licenseKey = "") => {
|
|
|
16561
16669
|
const valid = (0, import_react49.useMemo)(() => {
|
|
16562
16670
|
let valid2 = isValidLicense(licenseKey, {
|
|
16563
16671
|
publishedAt: 1624970570587,
|
|
16564
|
-
version: "1.3.
|
|
16672
|
+
version: "1.3.19"
|
|
16565
16673
|
});
|
|
16566
16674
|
if (!licenseKey && !valid2 && isInsidePlayground) {
|
|
16567
16675
|
return true;
|
|
@@ -19044,7 +19152,11 @@ function defaultGetColumnMenuItems(_items, params) {
|
|
|
19044
19152
|
disabled: col.computedVisible && api.getVisibleColumnsCount() === 1,
|
|
19045
19153
|
checked: col.computedVisible,
|
|
19046
19154
|
onChange: (checked) => {
|
|
19047
|
-
|
|
19155
|
+
const visible = !!checked;
|
|
19156
|
+
api.setVisibilityForColumn(col.id, visible);
|
|
19157
|
+
requestAnimationFrame(() => {
|
|
19158
|
+
api.realignColumnContextMenu();
|
|
19159
|
+
});
|
|
19048
19160
|
}
|
|
19049
19161
|
}
|
|
19050
19162
|
)
|
|
@@ -19118,6 +19230,42 @@ function getMenuForColumn(columnId, context, onHideIntent) {
|
|
|
19118
19230
|
}
|
|
19119
19231
|
|
|
19120
19232
|
// src/components/InfiniteTable/hooks/useColumnMenu.ts
|
|
19233
|
+
var menuIconSelector = `[${MenuIconDataAttributes["data-name"]}="${MenuIconDataAttributesValues["data-name"]}"]`;
|
|
19234
|
+
function showMenuForColumn(options) {
|
|
19235
|
+
var _a;
|
|
19236
|
+
const { columnId, context, clearAll, showOverlay } = options;
|
|
19237
|
+
const { getState, actions } = context;
|
|
19238
|
+
function onHideIntent() {
|
|
19239
|
+
clearAll();
|
|
19240
|
+
actions.columnMenuVisibleForColumnId = null;
|
|
19241
|
+
}
|
|
19242
|
+
let target = options.target;
|
|
19243
|
+
if (!target) {
|
|
19244
|
+
const iconSelector = `[${InfiniteHeaderCellDataAttributes["data-column-id"]}="${columnId}"] ${menuIconSelector}`;
|
|
19245
|
+
target = getState().domRef.current.querySelector(
|
|
19246
|
+
iconSelector
|
|
19247
|
+
);
|
|
19248
|
+
if (!target) {
|
|
19249
|
+
target = (_a = getState().columnMenuTargetRef.current) != null ? _a : void 0;
|
|
19250
|
+
if (!(target == null ? void 0 : target.parentElement)) {
|
|
19251
|
+
target = void 0;
|
|
19252
|
+
}
|
|
19253
|
+
}
|
|
19254
|
+
}
|
|
19255
|
+
if (!target) {
|
|
19256
|
+
console.warn(`Cannot show column menu for column "${columnId}"`);
|
|
19257
|
+
return;
|
|
19258
|
+
}
|
|
19259
|
+
showOverlay(() => getMenuForColumn(columnId, context, onHideIntent), {
|
|
19260
|
+
constrainTo: getState().domRef.current,
|
|
19261
|
+
id: "column-menu",
|
|
19262
|
+
alignTo: target,
|
|
19263
|
+
alignPosition: [
|
|
19264
|
+
["TopLeft", "BottomLeft"],
|
|
19265
|
+
["TopRight", "BottomRight"]
|
|
19266
|
+
]
|
|
19267
|
+
});
|
|
19268
|
+
}
|
|
19121
19269
|
function useColumnMenu() {
|
|
19122
19270
|
const context = useInfiniteTable();
|
|
19123
19271
|
const { getState, actions } = context;
|
|
@@ -19135,31 +19283,17 @@ function useColumnMenu() {
|
|
|
19135
19283
|
if (!info) {
|
|
19136
19284
|
return;
|
|
19137
19285
|
}
|
|
19138
|
-
|
|
19139
|
-
function onHideIntent() {
|
|
19140
|
-
clearAll();
|
|
19141
|
-
actions2.columnMenuVisibleForColumnId = null;
|
|
19142
|
-
}
|
|
19143
|
-
showOverlay(() => getMenuForColumn(column.id, context, onHideIntent), {
|
|
19144
|
-
constrainTo: getState2().domRef.current,
|
|
19145
|
-
id: "column-menu",
|
|
19146
|
-
alignTo: target,
|
|
19147
|
-
alignPosition: [
|
|
19148
|
-
["TopLeft", "BottomLeft"],
|
|
19149
|
-
["TopRight", "BottomRight"]
|
|
19150
|
-
]
|
|
19151
|
-
});
|
|
19286
|
+
state.columnMenuTargetRef.current = info.target;
|
|
19152
19287
|
actions2.contextMenuVisibleFor = null;
|
|
19153
19288
|
actions2.cellContextMenuVisibleFor = null;
|
|
19154
19289
|
actions2.filterOperatorMenuVisibleForColumnId = null;
|
|
19155
|
-
actions2.columnMenuVisibleForColumnId = column.id;
|
|
19290
|
+
actions2.columnMenuVisibleForColumnId = info.column.id;
|
|
19156
19291
|
});
|
|
19157
19292
|
}, []);
|
|
19293
|
+
const { columnMenuVisibleForColumnId, columnMenuVisibleKey } = getState();
|
|
19158
19294
|
(0, import_react57.useEffect)(() => {
|
|
19159
|
-
const {
|
|
19160
|
-
|
|
19161
|
-
} = getState();
|
|
19162
|
-
if (columnContextMenuVisibleForColumnId) {
|
|
19295
|
+
const { columnMenuVisibleForColumnId: columnMenuVisibleForColumnId2, columnMenuTargetRef } = getState();
|
|
19296
|
+
if (columnMenuVisibleForColumnId2) {
|
|
19163
19297
|
let handleMouseDown2 = function(event) {
|
|
19164
19298
|
if (event.__insideMenu !== true) {
|
|
19165
19299
|
clearAll();
|
|
@@ -19168,6 +19302,12 @@ function useColumnMenu() {
|
|
|
19168
19302
|
};
|
|
19169
19303
|
var handleMouseDown = handleMouseDown2;
|
|
19170
19304
|
document.documentElement.addEventListener("mousedown", handleMouseDown2);
|
|
19305
|
+
showMenuForColumn({
|
|
19306
|
+
columnId: columnMenuVisibleForColumnId2,
|
|
19307
|
+
context,
|
|
19308
|
+
clearAll,
|
|
19309
|
+
showOverlay
|
|
19310
|
+
});
|
|
19171
19311
|
return () => {
|
|
19172
19312
|
document.documentElement.removeEventListener(
|
|
19173
19313
|
"mousedown",
|
|
@@ -19175,11 +19315,12 @@ function useColumnMenu() {
|
|
|
19175
19315
|
);
|
|
19176
19316
|
};
|
|
19177
19317
|
} else {
|
|
19318
|
+
columnMenuTargetRef.current = null;
|
|
19178
19319
|
clearAll();
|
|
19179
19320
|
}
|
|
19180
19321
|
return () => {
|
|
19181
19322
|
};
|
|
19182
|
-
}, [
|
|
19323
|
+
}, [columnMenuVisibleForColumnId, columnMenuVisibleKey]);
|
|
19183
19324
|
return { menuPortal };
|
|
19184
19325
|
}
|
|
19185
19326
|
|
|
@@ -20117,6 +20258,7 @@ InfiniteTable.defaultProps = {
|
|
|
20117
20258
|
var components = {
|
|
20118
20259
|
CheckBox: InfiniteCheckBox,
|
|
20119
20260
|
LoadMask,
|
|
20261
|
+
MenuIcon,
|
|
20120
20262
|
StringFilterEditor,
|
|
20121
20263
|
NumberFilterEditor
|
|
20122
20264
|
};
|
|
@@ -20130,7 +20272,6 @@ var components = {
|
|
|
20130
20272
|
InfiniteTableClassName,
|
|
20131
20273
|
InfiniteTableComponent,
|
|
20132
20274
|
Menu,
|
|
20133
|
-
MenuIcon,
|
|
20134
20275
|
RowSelectionState,
|
|
20135
20276
|
components,
|
|
20136
20277
|
debounce,
|