@infinite-table/infinite-react 2.0.7 → 3.0.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/index.css +1 -1
- package/index.d.ts +139 -15
- package/index.dev.js +897 -203
- package/index.dev.mjs +896 -203
- package/index.js +5 -5
- package/index.mjs +5 -5
- package/package.json +2 -2
package/index.dev.js
CHANGED
|
@@ -865,6 +865,7 @@ var require_binary_search = __commonJS({
|
|
|
865
865
|
// src/index.tsx
|
|
866
866
|
var src_exports = {};
|
|
867
867
|
__export(src_exports, {
|
|
868
|
+
CellSelectionState: () => CellSelectionState,
|
|
868
869
|
DataSource: () => DataSource,
|
|
869
870
|
DataSourceActionType: () => DataSourceActionType,
|
|
870
871
|
DeepMap: () => DeepMap,
|
|
@@ -1379,8 +1380,8 @@ function stripVar(cssVariableWithVarString) {
|
|
|
1379
1380
|
}
|
|
1380
1381
|
|
|
1381
1382
|
// src/components/InfiniteTable/theme.css.ts
|
|
1382
|
-
var InternalVars = {
|
|
1383
|
-
var ThemeVars = { color: { accent: "var(--infinite-accent-color)", error: "var(--infinite-error-color)", color: "var(--infinite-color)" }, spacing: { "0": "var(--infinite-space-0)", "1": "var(--infinite-space-1)", "2": "var(--infinite-space-2)", "3": "var(--infinite-space-3)", "4": "var(--infinite-space-4)", "5": "var(--infinite-space-5)", "6": "var(--infinite-space-6)", "7": "var(--infinite-space-7)", "8": "var(--infinite-space-8)", "9": "var(--infinite-space-9)", "10": "var(--infinite-space-10)" }, fontSize: { "0": "var(--infinite-font-size-0)", "1": "var(--infinite-font-size-1)", "2": "var(--infinite-font-size-2)", "3": "var(--infinite-font-size-3)", "4": "var(--infinite-font-size-4)", "5": "var(--infinite-font-size-5)", "6": "var(--infinite-font-size-6)", "7": "var(--infinite-font-size-7)" }, fontFamily: "var(--infinite-font-family)", minHeight: "var(--infinite-min-height)", borderRadius: "var(--infinite-border-radius)", background: "var(--infinite-background)", iconSize: "var(--infinite-icon-size)", components: { LoadMask: { padding: "var(--infinite-load-mask-padding)", color: "var(--infinite-load-mask-color)", textBackground: "var(--infinite-load-mask-text-background)", overlayBackground: "var(--infinite-load-mask-overlay-background)", overlayOpacity: "var(--infinite-load-mask-overlay-opacity)", borderRadius: "var(--infinite-load-mask-border-radius)" }, Header: { background: "var(--infinite-header-background)", color: "var(--infinite-header-color)", columnHeaderHeight: "var(--infinite-column-header-height)" }, HeaderCell: { background: "var(--infinite-header-cell-background)", hoverBackground: "var(--infinite-header-cell-hover-background)", padding: "var(--infinite-header-cell-padding)", paddingX: "var(--infinite-header-cell-padding-x)", paddingY: "var(--infinite-header-cell-padding-y)", iconSize: "var(--infinite-header-cell-icon-size)", menuIconLineWidth: "var(--infinite-header-cell-menu-icon-line-width)", sortIconMargin: "var(--infinite-header-cell-sort-icon-margin)", resizeHandleActiveAreaWidth: "var(--infinite-resize-handle-active-area-width)", resizeHandleWidth: "var(--infinite-resize-handle-width)", resizeHandleHoverBackground: "var(--infinite-resize-handle-hover-background)", resizeHandleConstrainedHoverBackground: "var(--infinite-resize-handle-constrained-hover-background)", filterOperatorPaddingX: "var(--infinite-filter-operator-padding-x)", filterEditorPaddingX: "var(--infinite-filter-editor-padding-x)", filterEditorMarginX: "var(--infinite-filter-editor-margin-x)", filterOperatorPaddingY: "var(--infinite-filter-operator-padding-y)", filterEditorPaddingY: "var(--infinite-filter-editor-padding-y)", filterEditorMarginY: "var(--infinite-filter-editor-margin-y)" }, Cell: { padding: "var(--infinite-cell-padding)", borderWidth: "var(--infinite-cell-border-width)", border: "var(--infinite-cell-border)", borderInvisible: "var(--infinite-cell-border-invisible)", borderRadius: "var(--infinite-cell-border-radius)", reorderEffectDuration: "var(--infinite-column-reorder-effect-duration)", pinnedBorder: "var(--infinite-pinned-cell-border)", color: "var(--infinite-cell-color)", activeBackgroundAlpha: "var(--infinite-active-cell-background-alpha)", activeBackgroundAlphaWhenTableUnfocused: "var(--infinite-active-cell-background-alpha--table-unfocused)", activeBackground: "var(--infinite-active-cell-background)", activeBorderColor: "var(--infinite-active-cell-border-color)", activeBorderWidth: "var(--infinite-active-cell-border-width)", activeBorderStyle: "var(--infinite-active-cell-border-style)", activeBorder: "var(--infinite-active-cell-border)" }, SelectionCheckBox: { marginInline: "var(--infinite-selection-checkbox-margin-inline)" }, Menu: { background: "var(--infinite-menu-background)", color: "var(--infinite-menu-color)", padding: "var(--infinite-menu-padding)", cellPaddingVertical: "var(--infinite-menu-cell-padding-vertical)", cellPaddingHorizontal: "var(--infinite-menu-cell-padding-horizontal)", cellMarginVertical: "var(--infinite-menu-cell-margin-vertical)", itemDisabledBackground: "var(--infinite-menu-item-disabled-background)", itemActiveBackground: "var(--infinite-menu-item-active-background)", itemActiveOpacity: "var(--infinite-menu-item-active-opacity)", itemPressedOpacity: "var(--infinite-menu-item-pressed-opacity)", itemPressedBackground: "var(--infinite-menu-item-pressed-background)", itemDisabledOpacity: "var(--infinite-menu-item-disabled-opacity)", borderRadius: "var(--infinite-menu-border-radius)", shadowColor: "var(--infinite-menu-shadow-color)" }, Row: { background: "var(--infinite-row-background)", oddBackground: "var(--infinite-row-odd-background)", selectedBackground: "var(--infinite-row-selected-background)", activeBackground: "var(--infinite-active-row-background)", activeBorderColor: "var(--infinite-active-row-border-color)", activeBorderWidth: "var(--infinite-active-row-border-width)", activeBorderStyle: "var(--infinite-active-row-border-style)", activeBorder: "var(--infinite-active-row-border)", activeBackgroundAlpha: "var(--infinite-active-row-background-alpha)", activeBackgroundAlphaWhenTableUnfocused: "var(--infinite-active-row-background-alpha--table-unfocused)", hoverBackground: "var(--infinite-row-hover-background)", selectedHoverBackground: "var(--infinite-row-selected-hover-background)", groupRowBackground: "var(--infinite-group-row-background)", groupRowColumnNesting: "var(--infinite-group-row-column-nesting)", groupNesting: "var(--infinite-dont-override-group-row-nesting-length)", pointerEventsWhileScrolling: "var(--infinite-row-pointer-events-while-scrolling)" }, ColumnCell: { background: "var(--infinite-column-cell-bg-dont-override)" } } };
|
|
1383
|
+
var InternalVars = { currentColumnTransformX: "var(--currentColumnTransformX__1slvgu90)", currentColumnTransformY: "var(--currentColumnTransformY__1slvgu91)", activeCellRowOffset: "var(--activeCellRowOffset__1slvgu92)", activeCellRowHeight: "var(--activeCellRowHeight__1slvgu93)", activeCellOffsetX: "var(--activeCellOffsetX__1slvgu94)", activeCellOffsetY: "var(--activeCellOffsetY__1slvgu95)", scrollTopForActiveRow: "var(--scrollTopForActiveRow__1slvgu96)", activeCellColWidth: "var(--activeCellColWidth__1slvgu97)", activeCellColOffset: "var(--activeCellColOffset__1slvgu98)", columnReorderEffectDurationAtIndex: "var(--columnReorderEffectDurationAtIndex__1slvgu99)", columnWidthAtIndex: "var(--columnWidthAtIndex__1slvgu9a)", columnOffsetAtIndex: "var(--columnOffsetAtIndex__1slvgu9b)", columnOffsetAtIndexWhileReordering: "var(--columnOffsetAtIndexWhileReordering__1slvgu9c)", columnZIndexAtIndex: "var(--columnZIndexAtIndex__1slvgu9d)", pinnedStartWidth: "var(--pinnedStartWidth__1slvgu9e)", pinnedEndWidth: "var(--pinnedEndWidth__1slvgu9f)", pinnedEndOffset: "var(--pinnedEndOffset__1slvgu9g)", computedVisibleColumnsCount: "var(--computedVisibleColumnsCount__1slvgu9h)", baseZIndexForCells: "var(--baseZIndexForCells__1slvgu9i)", bodyWidth: "var(--bodyWidth__1slvgu9j)", bodyHeight: "var(--bodyHeight__1slvgu9k)", scrollbarWidthHorizontal: "var(--scrollbarWidthHorizontal__1slvgu9l)", scrollbarWidthVertical: "var(--scrollbarWidthVertical__1slvgu9m)", scrollLeft: "var(--scrollLeft__1slvgu9n)", scrollTop: "var(--scrollTop__1slvgu9o)" };
|
|
1384
|
+
var ThemeVars = { color: { accent: "var(--infinite-accent-color)", error: "var(--infinite-error-color)", color: "var(--infinite-color)" }, spacing: { "0": "var(--infinite-space-0)", "1": "var(--infinite-space-1)", "2": "var(--infinite-space-2)", "3": "var(--infinite-space-3)", "4": "var(--infinite-space-4)", "5": "var(--infinite-space-5)", "6": "var(--infinite-space-6)", "7": "var(--infinite-space-7)", "8": "var(--infinite-space-8)", "9": "var(--infinite-space-9)", "10": "var(--infinite-space-10)" }, fontSize: { "0": "var(--infinite-font-size-0)", "1": "var(--infinite-font-size-1)", "2": "var(--infinite-font-size-2)", "3": "var(--infinite-font-size-3)", "4": "var(--infinite-font-size-4)", "5": "var(--infinite-font-size-5)", "6": "var(--infinite-font-size-6)", "7": "var(--infinite-font-size-7)" }, fontFamily: "var(--infinite-font-family)", minHeight: "var(--infinite-min-height)", borderRadius: "var(--infinite-border-radius)", background: "var(--infinite-background)", iconSize: "var(--infinite-icon-size)", components: { LoadMask: { padding: "var(--infinite-load-mask-padding)", color: "var(--infinite-load-mask-color)", textBackground: "var(--infinite-load-mask-text-background)", overlayBackground: "var(--infinite-load-mask-overlay-background)", overlayOpacity: "var(--infinite-load-mask-overlay-opacity)", borderRadius: "var(--infinite-load-mask-border-radius)" }, Header: { background: "var(--infinite-header-background)", color: "var(--infinite-header-color)", columnHeaderHeight: "var(--infinite-column-header-height)" }, HeaderCell: { background: "var(--infinite-header-cell-background)", hoverBackground: "var(--infinite-header-cell-hover-background)", padding: "var(--infinite-header-cell-padding)", paddingX: "var(--infinite-header-cell-padding-x)", paddingY: "var(--infinite-header-cell-padding-y)", iconSize: "var(--infinite-header-cell-icon-size)", menuIconLineWidth: "var(--infinite-header-cell-menu-icon-line-width)", sortIconMargin: "var(--infinite-header-cell-sort-icon-margin)", resizeHandleActiveAreaWidth: "var(--infinite-resize-handle-active-area-width)", resizeHandleWidth: "var(--infinite-resize-handle-width)", resizeHandleHoverBackground: "var(--infinite-resize-handle-hover-background)", resizeHandleConstrainedHoverBackground: "var(--infinite-resize-handle-constrained-hover-background)", filterOperatorPaddingX: "var(--infinite-filter-operator-padding-x)", filterEditorPaddingX: "var(--infinite-filter-editor-padding-x)", filterEditorMarginX: "var(--infinite-filter-editor-margin-x)", filterOperatorPaddingY: "var(--infinite-filter-operator-padding-y)", filterEditorPaddingY: "var(--infinite-filter-editor-padding-y)", filterEditorMarginY: "var(--infinite-filter-editor-margin-y)" }, Cell: { padding: "var(--infinite-cell-padding)", borderWidth: "var(--infinite-cell-border-width)", border: "var(--infinite-cell-border)", borderInvisible: "var(--infinite-cell-border-invisible)", borderRadius: "var(--infinite-cell-border-radius)", reorderEffectDuration: "var(--infinite-column-reorder-effect-duration)", pinnedBorder: "var(--infinite-pinned-cell-border)", color: "var(--infinite-cell-color)", selectedBackground: "var(--infinite-selected-cell-background)", selectedBackgroundAlpha: "var(--infinite-selected-cell-background-alpha)", selectedBackgroundAlphaWhenTableUnfocused: "var(--infinite-selected-cell-background-alpha--table-unfocused)", selectedBorderColor: "var(--infinite-selected-cell-border-color)", selectedBorderWidth: "var(--infinite-selected-cell-border-width)", selectedBorderStyle: "var(--infinite-selected-cell-border-style)", selectedBorder: "var(--infinite-selected-cell-border)", activeBackgroundAlpha: "var(--infinite-active-cell-background-alpha)", activeBackgroundAlphaWhenTableUnfocused: "var(--infinite-active-cell-background-alpha--table-unfocused)", activeBackground: "var(--infinite-active-cell-background)", activeBorderColor: "var(--infinite-active-cell-border-color)", activeBorderWidth: "var(--infinite-active-cell-border-width)", activeBorderStyle: "var(--infinite-active-cell-border-style)", activeBorder: "var(--infinite-active-cell-border)" }, SelectionCheckBox: { marginInline: "var(--infinite-selection-checkbox-margin-inline)" }, Menu: { background: "var(--infinite-menu-background)", color: "var(--infinite-menu-color)", padding: "var(--infinite-menu-padding)", cellPaddingVertical: "var(--infinite-menu-cell-padding-vertical)", cellPaddingHorizontal: "var(--infinite-menu-cell-padding-horizontal)", cellMarginVertical: "var(--infinite-menu-cell-margin-vertical)", itemDisabledBackground: "var(--infinite-menu-item-disabled-background)", itemActiveBackground: "var(--infinite-menu-item-active-background)", itemActiveOpacity: "var(--infinite-menu-item-active-opacity)", itemPressedOpacity: "var(--infinite-menu-item-pressed-opacity)", itemPressedBackground: "var(--infinite-menu-item-pressed-background)", itemDisabledOpacity: "var(--infinite-menu-item-disabled-opacity)", borderRadius: "var(--infinite-menu-border-radius)", shadowColor: "var(--infinite-menu-shadow-color)" }, Row: { background: "var(--infinite-row-background)", oddBackground: "var(--infinite-row-odd-background)", selectedBackground: "var(--infinite-row-selected-background)", activeBackground: "var(--infinite-active-row-background)", activeBorderColor: "var(--infinite-active-row-border-color)", activeBorderWidth: "var(--infinite-active-row-border-width)", activeBorderStyle: "var(--infinite-active-row-border-style)", activeBorder: "var(--infinite-active-row-border)", activeBackgroundAlpha: "var(--infinite-active-row-background-alpha)", activeBackgroundAlphaWhenTableUnfocused: "var(--infinite-active-row-background-alpha--table-unfocused)", hoverBackground: "var(--infinite-row-hover-background)", selectedHoverBackground: "var(--infinite-row-selected-hover-background)", groupRowBackground: "var(--infinite-group-row-background)", groupRowColumnNesting: "var(--infinite-group-row-column-nesting)", groupNesting: "var(--infinite-dont-override-group-row-nesting-length)", pointerEventsWhileScrolling: "var(--infinite-row-pointer-events-while-scrolling)" }, ColumnCell: { background: "var(--infinite-column-cell-bg-dont-override)" } } };
|
|
1384
1385
|
var columnHeaderHeightName = "column-header-height";
|
|
1385
1386
|
|
|
1386
1387
|
// src/utils/selectParent.ts
|
|
@@ -5140,22 +5141,22 @@ var createRuntimeFn = (config) => (options) => {
|
|
|
5140
5141
|
|
|
5141
5142
|
// src/components/InfiniteTable/components/InfiniteTableHeader/header.css.ts
|
|
5142
5143
|
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";
|
|
5143
|
-
var HeaderCellContentRecipe = createRuntimeFn({ defaultClassName: "
|
|
5144
|
+
var HeaderCellContentRecipe = createRuntimeFn({ defaultClassName: "header_HeaderCellContentRecipe__12zfob11x 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__12zfob11y", true: "header_HeaderCellContentRecipe_filtered_true__12zfob11z" }, verticalAlign: { start: "header_HeaderCellContentRecipe_verticalAlign_start__12zfob120", end: "header_HeaderCellContentRecipe_verticalAlign_end__12zfob121", center: "header_HeaderCellContentRecipe_verticalAlign_center__12zfob122" }, align: { start: "header_HeaderCellContentRecipe_align_start__12zfob123", end: "header_HeaderCellContentRecipe_align_end__12zfob124", center: "header_HeaderCellContentRecipe_align_center__12zfob125" } }, defaultVariants: {}, compoundVariants: [] });
|
|
5144
5145
|
var HeaderCellProxy = "header_HeaderCellProxy__12zfob1m utilities_whiteSpace_nowrap__16lm1iw22 utilities_textOverflow_ellipsis__16lm1iw23 utilities_overflow_hidden__16lm1iw1w";
|
|
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: "
|
|
5146
|
+
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" }, cellSelected: { false: "header_HeaderCellRecipe_cellSelected_false__12zfob1q", true: "header_HeaderCellRecipe_cellSelected_true__12zfob1r" }, rowSelected: { false: "header_HeaderCellRecipe_rowSelected_false__12zfob1s", true: "header_HeaderCellRecipe_rowSelected_true__12zfob1t", null: "header_HeaderCellRecipe_rowSelected_null__12zfob1u" }, groupRow: { false: "header_HeaderCellRecipe_groupRow_false__12zfob1v", true: "header_HeaderCellRecipe_groupRow_true__12zfob1w" }, groupCell: { false: "header_HeaderCellRecipe_groupCell_false__12zfob1x", true: "header_HeaderCellRecipe_groupCell_true__12zfob1y" }, align: { start: "header_HeaderCellRecipe_align_start__12zfob1z", end: "header_HeaderCellRecipe_align_end__12zfob110", center: "header_HeaderCellRecipe_align_center__12zfob111" }, verticalAlign: { start: "header_HeaderCellRecipe_verticalAlign_start__12zfob112", end: "header_HeaderCellRecipe_verticalAlign_end__12zfob113", center: "header_HeaderCellRecipe_verticalAlign_center__12zfob114" }, zebra: { false: "header_HeaderCellRecipe_zebra_false__12zfob115", even: "header_HeaderCellRecipe_zebra_even__12zfob116", odd: "header_HeaderCellRecipe_zebra_odd__12zfob117" }, dragging: { true: "header_HeaderCellRecipe_dragging_true__12zfob118", false: "header_HeaderCellRecipe_dragging_false__12zfob119" }, first: { true: "header_HeaderCellRecipe_first_true__12zfob11a", false: "header_HeaderCellRecipe_first_false__12zfob11b" }, last: { true: "header_HeaderCellRecipe_last_true__12zfob11c", false: "header_HeaderCellRecipe_last_false__12zfob11d" }, groupByField: { true: "header_HeaderCellRecipe_groupByField_true__12zfob11e", false: "header_HeaderCellRecipe_groupByField_false__12zfob11f" }, firstInCategory: { true: "header_HeaderCellRecipe_firstInCategory_true__12zfob11g", false: "header_HeaderCellRecipe_firstInCategory_false__12zfob11h" }, lastInCategory: { true: "header_HeaderCellRecipe_lastInCategory_true__12zfob11i", false: "header_HeaderCellRecipe_lastInCategory_false__12zfob11j" }, pinned: { start: "header_HeaderCellRecipe_pinned_start__12zfob11k", end: "header_HeaderCellRecipe_pinned_end__12zfob11l", false: "header_HeaderCellRecipe_pinned_false__12zfob11m" }, filtered: { true: "header_HeaderCellRecipe_filtered_true__12zfob11n", false: "header_HeaderCellRecipe_filtered_false__12zfob11o" } }, defaultVariants: {}, compoundVariants: [[{ pinned: "start", lastInCategory: true }, "header_HeaderCellRecipe_compound_0__12zfob11p"], [{ pinned: "end", firstInCategory: true }, "header_HeaderCellRecipe_compound_1__12zfob11q"], [{ pinned: false, lastInCategory: true }, "header_HeaderCellRecipe_compound_2__12zfob11r"]] });
|
|
5146
5147
|
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"]] });
|
|
5147
|
-
var HeaderFilterCls = "
|
|
5148
|
-
var HeaderFilterEditorCls = "
|
|
5148
|
+
var HeaderFilterCls = "header_HeaderFilterCls__12zfob128 utilities_display_flex__16lm1iwy utilities_flexFlow_row__16lm1iw1n utilities_alignItems_stretch__16lm1iw1q utilities_position_relative__16lm1iw1";
|
|
5149
|
+
var HeaderFilterEditorCls = "header_HeaderFilterEditorCls__12zfob12d utilities_width_100%__16lm1iw1a utilities_height_100%__16lm1iw18";
|
|
5149
5150
|
var HeaderFilterIconIndexCls = "header_HeaderFilterIconIndexCls__12zfob16";
|
|
5150
|
-
var HeaderFilterOperatorCls = "
|
|
5151
|
-
var HeaderFilterOperatorIconRecipe = createRuntimeFn({ defaultClassName: "
|
|
5152
|
-
var HeaderGroupCls = "
|
|
5153
|
-
var HeaderMenuIconCls = createRuntimeFn({ defaultClassName: "
|
|
5151
|
+
var HeaderFilterOperatorCls = "header_HeaderFilterOperatorCls__12zfob129 utilities_display_flex__16lm1iwy utilities_flexFlow_row__16lm1iw1n utilities_alignItems_center__16lm1iw1p utilities_position_relative__16lm1iw1";
|
|
5152
|
+
var HeaderFilterOperatorIconRecipe = createRuntimeFn({ defaultClassName: "header_HeaderFilterOperatorIconRecipe__12zfob12a utilities_position_relative__16lm1iw1 utilities_top_0__16lm1iw1b", variantClassNames: { disabled: { true: "header_HeaderFilterOperatorIconRecipe_disabled_true__12zfob12b", false: "header_HeaderFilterOperatorIconRecipe_disabled_false__12zfob12c" } }, defaultVariants: {}, compoundVariants: [] });
|
|
5153
|
+
var HeaderGroupCls = "header_HeaderGroupCls__12zfob127 utilities_display_flex__16lm1iwy utilities_flexFlow_row__16lm1iw1n utilities_alignItems_center__16lm1iw1p";
|
|
5154
|
+
var HeaderMenuIconCls = createRuntimeFn({ defaultClassName: "header_HeaderMenuIconCls__12zfob11s 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__12zfob11t" }, reserveSpaceWhenHidden: { true: "header_HeaderMenuIconCls_reserveSpaceWhenHidden_true__12zfob11u", false: "header_HeaderMenuIconCls_reserveSpaceWhenHidden_false__12zfob11v" } }, defaultVariants: {}, compoundVariants: [[{ menuVisible: true, reserveSpaceWhenHidden: false }, "header_HeaderMenuIconCls_compound_0__12zfob11w"]] });
|
|
5154
5155
|
var HeaderScrollbarPlaceholderCls = "header_HeaderScrollbarPlaceholderCls__12zfob17 utilities_position_absolute__16lm1iw2";
|
|
5155
5156
|
var HeaderSortIconCls = "utilities_position_relative__16lm1iw1";
|
|
5156
5157
|
var HeaderSortIconIndexCls = "header_HeaderSortIconIndexCls__12zfob15";
|
|
5157
5158
|
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: [] });
|
|
5158
|
-
var HeaderWrapperCls = "
|
|
5159
|
+
var HeaderWrapperCls = "header_HeaderWrapperCls__12zfob126 utilities_overflow_hidden__16lm1iw1w utilities_position_relative__16lm1iw1 utilities_display_flex__16lm1iwy utilities_flexFlow_row__16lm1iw1n";
|
|
5159
5160
|
|
|
5160
5161
|
// src/components/InfiniteTable/components/icons/InfiniteTableIconClassName.ts
|
|
5161
5162
|
var InfiniteTableIconClassName = "InfiniteTableIcon";
|
|
@@ -6562,6 +6563,7 @@ function useCellClassName(column, baseClasses, variants, extraFlags) {
|
|
|
6562
6563
|
firstInCategory: column.computedFirstInCategory,
|
|
6563
6564
|
lastInCategory: column.computedLastInCategory,
|
|
6564
6565
|
pinned: column.computedPinned || false,
|
|
6566
|
+
cellSelected: extraFlags.cellSelected || false,
|
|
6565
6567
|
rowSelected: (_a = extraFlags.rowSelected) != null ? _a : "null",
|
|
6566
6568
|
rowActive: extraFlags.rowActive,
|
|
6567
6569
|
dragging: extraFlags.dragging,
|
|
@@ -6591,6 +6593,9 @@ function useCellClassName(column, baseClasses, variants, extraFlags) {
|
|
|
6591
6593
|
if (extraFlags.rowSelected) {
|
|
6592
6594
|
result.push(...baseClasses.map((c) => `${c}--row-selected`));
|
|
6593
6595
|
}
|
|
6596
|
+
if (extraFlags.cellSelected) {
|
|
6597
|
+
result.push(...baseClasses.map((c) => `${c}--cell-selected`));
|
|
6598
|
+
}
|
|
6594
6599
|
if (extraFlags.groupRow) {
|
|
6595
6600
|
result.push(...baseClasses.map((c) => `${c}--group-row`));
|
|
6596
6601
|
result.push(
|
|
@@ -6619,9 +6624,7 @@ var InfiniteClsHasPinnedEnd = "InfiniteCls_InfiniteClsHasPinnedEnd__1yeub2vo";
|
|
|
6619
6624
|
var InfiniteClsHasPinnedStart = "InfiniteCls_InfiniteClsHasPinnedStart__1yeub2vn";
|
|
6620
6625
|
var InfiniteClsRecipe = createRuntimeFn({ defaultClassName: "", variantClassNames: { focused: { true: "InfiniteCls_InfiniteClsRecipe_focused_true__1yeub2v2", false: "InfiniteCls_InfiniteClsRecipe_focused_false__1yeub2v3" }, focusedWithin: { true: "InfiniteCls_InfiniteClsRecipe_focusedWithin_true__1yeub2v4", false: "InfiniteCls_InfiniteClsRecipe_focusedWithin_false__1yeub2v5" }, hasPinnedStart: { true: "InfiniteCls_InfiniteClsRecipe_hasPinnedStart_true__1yeub2v6", false: "InfiniteCls_InfiniteClsRecipe_hasPinnedStart_false__1yeub2v7" }, hasPinnedEnd: { true: "InfiniteCls_InfiniteClsRecipe_hasPinnedEnd_true__1yeub2v8", false: "InfiniteCls_InfiniteClsRecipe_hasPinnedEnd_false__1yeub2v9" }, hasPinnedStartOverflow: { true: "InfiniteCls_InfiniteClsRecipe_hasPinnedStartOverflow_true__1yeub2va", false: "InfiniteCls_InfiniteClsRecipe_hasPinnedStartOverflow_false__1yeub2vb" }, hasPinnedEndOverflow: { true: "InfiniteCls_InfiniteClsRecipe_hasPinnedEndOverflow_true__1yeub2vc", false: "InfiniteCls_InfiniteClsRecipe_hasPinnedEndOverflow_false__1yeub2vd" } }, defaultVariants: {}, compoundVariants: [[{ focused: false, focusedWithin: false }, "InfiniteCls_InfiniteClsRecipe_compound_0__1yeub2ve"]] });
|
|
6621
6626
|
var InfiniteClsShiftingColumns = "InfiniteCls_shiftingcols__1yeub2vl";
|
|
6622
|
-
var PinnedEndIndicatorBorder = "InfiniteCls_PinnedEndIndicatorBorder__1yeub2vr InfiniteCls_PinnedIndicatorCls__1yeub2vp utilities_position_absolute__16lm1iw2 utilities_top_0__16lm1iw1b utilities_cursor_colResize__16lm1iwj utilities_userSelect_none__16lm1iw16 utilities_width_0__16lm1iw19 utilities_visibility_hidden__16lm1iw20 utilities_pointerEvents_none__16lm1iwk utilities_zIndex_10000000__16lm1iwu";
|
|
6623
6627
|
var PinnedRowsContainerClsVariants = createRuntimeFn({ defaultClassName: "", variantClassNames: { pinned: { start: "InfiniteCls_PinnedRowsContainerClsVariants_pinned_start__1yeub2vi", end: "InfiniteCls_PinnedRowsContainerClsVariants_pinned_end__1yeub2vj", false: "InfiniteCls_PinnedRowsContainerClsVariants_pinned_false__1yeub2vk" } }, defaultVariants: {}, compoundVariants: [] });
|
|
6624
|
-
var PinnedStartIndicatorBorder = "InfiniteCls_PinnedStartIndicatorBorder__1yeub2vq InfiniteCls_PinnedIndicatorCls__1yeub2vp utilities_position_absolute__16lm1iw2 utilities_top_0__16lm1iw1b utilities_cursor_colResize__16lm1iwj utilities_userSelect_none__16lm1iw16 utilities_width_0__16lm1iw19 utilities_visibility_hidden__16lm1iw20 utilities_pointerEvents_none__16lm1iwk utilities_zIndex_10000000__16lm1iwu";
|
|
6625
6628
|
|
|
6626
6629
|
// src/components/InfiniteTable/utils/rafFn.ts
|
|
6627
6630
|
var rafFn = (fn) => {
|
|
@@ -7758,7 +7761,8 @@ function objectValuesExcept(obj, exceptList) {
|
|
|
7758
7761
|
|
|
7759
7762
|
// src/components/InfiniteTable/components/cell.css.ts
|
|
7760
7763
|
var ColumnCellCls = "cell_ColumnCellCls__1eexc2a6 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";
|
|
7761
|
-
var ColumnCellRecipe = createRuntimeFn({ defaultClassName: "
|
|
7764
|
+
var ColumnCellRecipe = createRuntimeFn({ defaultClassName: "cell_ColumnCellRecipe__1eexc2ah", variantClassNames: { dragging: { false: "cell_ColumnCellRecipe_dragging_false__1eexc2ai", true: "cell_ColumnCellRecipe_dragging_true__1eexc2aj" }, cellSelected: { false: "cell_ColumnCellRecipe_cellSelected_false__1eexc2ak", true: "cell_ColumnCellRecipe_cellSelected_true__1eexc2al" }, align: { start: "cell_ColumnCellRecipe_align_start__1eexc2am", end: "cell_ColumnCellRecipe_align_end__1eexc2an", center: "cell_ColumnCellRecipe_align_center__1eexc2ao" }, verticalAlign: { start: "cell_ColumnCellRecipe_verticalAlign_start__1eexc2ap", end: "cell_ColumnCellRecipe_verticalAlign_end__1eexc2aq", center: "cell_ColumnCellRecipe_verticalAlign_center__1eexc2ar" }, rowActive: { false: "cell_ColumnCellRecipe_rowActive_false__1eexc2as", true: "cell_ColumnCellRecipe_rowActive_true__1eexc2at" }, groupRow: { false: "cell_ColumnCellRecipe_groupRow_false__1eexc2au", true: "cell_ColumnCellRecipe_groupRow_true__1eexc2av" }, groupCell: { false: "cell_ColumnCellRecipe_groupCell_false__1eexc2aw", true: "cell_ColumnCellRecipe_groupCell_true__1eexc2ax" }, zebra: { false: "cell_ColumnCellRecipe_zebra_false__1eexc2ay", even: "cell_ColumnCellRecipe_zebra_even__1eexc2az", odd: "cell_ColumnCellRecipe_zebra_odd__1eexc2a10" }, rowSelected: { true: "cell_ColumnCellRecipe_rowSelected_true__1eexc2a11", false: "cell_ColumnCellRecipe_rowSelected_false__1eexc2a12", null: "cell_ColumnCellRecipe_rowSelected_null__1eexc2a13" }, first: { true: "cell_ColumnCellRecipe_first_true__1eexc2a14", false: "cell_ColumnCellRecipe_first_false__1eexc2a15" }, last: { true: "cell_ColumnCellRecipe_last_true__1eexc2a16", false: "cell_ColumnCellRecipe_last_false__1eexc2a17" }, groupByField: { true: "cell_ColumnCellRecipe_groupByField_true__1eexc2a18", false: "cell_ColumnCellRecipe_groupByField_false__1eexc2a19" }, firstInCategory: { true: "cell_ColumnCellRecipe_firstInCategory_true__1eexc2a1a", false: "cell_ColumnCellRecipe_firstInCategory_false__1eexc2a1b" }, lastInCategory: { true: "cell_ColumnCellRecipe_lastInCategory_true__1eexc2a1c", false: "cell_ColumnCellRecipe_lastInCategory_false__1eexc2a1d" }, pinned: { start: "cell_ColumnCellRecipe_pinned_start__1eexc2a1e", end: "cell_ColumnCellRecipe_pinned_end__1eexc2a1f", false: "cell_ColumnCellRecipe_pinned_false__1eexc2a1g" }, filtered: { true: "cell_ColumnCellRecipe_filtered_true__1eexc2a1h", false: "cell_ColumnCellRecipe_filtered_false__1eexc2a1i" } }, defaultVariants: {}, compoundVariants: [[{ pinned: "start", lastInCategory: true }, "cell_ColumnCellRecipe_compound_0__1eexc2a1j"], [{ pinned: "start", firstInCategory: true }, "cell_ColumnCellRecipe_compound_1__1eexc2a1k"], [{ pinned: "end", firstInCategory: true }, "cell_ColumnCellRecipe_compound_2__1eexc2a1l"], [{ pinned: "end", lastInCategory: true }, "cell_ColumnCellRecipe_compound_3__1eexc2a1m"], [{ align: "center", groupCell: false }, "cell_ColumnCellRecipe_compound_4__1eexc2a1n"]] });
|
|
7765
|
+
var ColumnCellSelectionIndicatorRecipe = createRuntimeFn({ defaultClassName: "cell_ColumnCellSelectionIndicatorRecipe__1eexc2a8", variantClassNames: { right: { true: "cell_ColumnCellSelectionIndicatorRecipe_right_true__1eexc2a9", false: "cell_ColumnCellSelectionIndicatorRecipe_right_false__1eexc2aa" }, left: { true: "cell_ColumnCellSelectionIndicatorRecipe_left_true__1eexc2ab", false: "cell_ColumnCellSelectionIndicatorRecipe_left_false__1eexc2ac" }, top: { true: "cell_ColumnCellSelectionIndicatorRecipe_top_true__1eexc2ad", false: "cell_ColumnCellSelectionIndicatorRecipe_top_false__1eexc2ae" }, bottom: { true: "cell_ColumnCellSelectionIndicatorRecipe_bottom_true__1eexc2af", false: "cell_ColumnCellSelectionIndicatorRecipe_bottom_false__1eexc2ag" } }, defaultVariants: {}, compoundVariants: [] });
|
|
7762
7766
|
var SelectionCheckboxCls = "cell_SelectionCheckboxCls__1eexc2a7";
|
|
7763
7767
|
|
|
7764
7768
|
// src/components/InfiniteTable/components/CheckBox.tsx
|
|
@@ -7945,6 +7949,7 @@ function getColumnRenderingParams(options) {
|
|
|
7945
7949
|
};
|
|
7946
7950
|
}
|
|
7947
7951
|
function getColumnRenderParam(options) {
|
|
7952
|
+
var _a;
|
|
7948
7953
|
const {
|
|
7949
7954
|
column,
|
|
7950
7955
|
context,
|
|
@@ -7960,7 +7965,7 @@ function getColumnRenderParam(options) {
|
|
|
7960
7965
|
const { editingCell } = getState();
|
|
7961
7966
|
const { indexInAll: rowIndex } = rowInfo;
|
|
7962
7967
|
const dataSourceState = getDataSourceState();
|
|
7963
|
-
const { selectionMode } = dataSourceState;
|
|
7968
|
+
const { selectionMode, cellSelection } = dataSourceState;
|
|
7964
7969
|
const groupByColumn = getGroupByColumnReference({
|
|
7965
7970
|
rowInfo,
|
|
7966
7971
|
column,
|
|
@@ -7968,21 +7973,35 @@ function getColumnRenderParam(options) {
|
|
|
7968
7973
|
groupRenderStrategy: context.getState().groupRenderStrategy
|
|
7969
7974
|
});
|
|
7970
7975
|
const toggleGroupRow = imperativeApi.toggleGroupRow;
|
|
7976
|
+
const cellSelected = (_a = cellSelection == null ? void 0 : cellSelection.isCellSelected(rowInfo.id, column.id)) != null ? _a : false;
|
|
7971
7977
|
const renderParam = __spreadProps(__spreadValues({
|
|
7972
7978
|
column,
|
|
7973
7979
|
columnsMap,
|
|
7974
7980
|
fieldsToColumn,
|
|
7975
7981
|
align: align2,
|
|
7976
|
-
verticalAlign
|
|
7982
|
+
verticalAlign,
|
|
7983
|
+
cellSelected
|
|
7977
7984
|
}, formattedValueContext), {
|
|
7978
7985
|
editError: editingCell && editingCell.primaryKey === rowInfo.id && editingCell.columnId === column.id && !editingCell.active && editingCell.accepted instanceof Error ? editingCell.accepted : void 0,
|
|
7979
7986
|
groupByColumn,
|
|
7980
7987
|
selectionMode,
|
|
7981
7988
|
api: imperativeApi,
|
|
7982
|
-
selectRow: imperativeApi.
|
|
7983
|
-
deselectRow: imperativeApi.
|
|
7984
|
-
toggleRowSelection: imperativeApi.
|
|
7985
|
-
toggleGroupRowSelection: imperativeApi.
|
|
7989
|
+
selectRow: imperativeApi.rowSelectionApi.selectRow,
|
|
7990
|
+
deselectRow: imperativeApi.rowSelectionApi.deselectRow,
|
|
7991
|
+
toggleRowSelection: imperativeApi.rowSelectionApi.toggleRowSelection,
|
|
7992
|
+
toggleGroupRowSelection: imperativeApi.rowSelectionApi.toggleGroupRowSelection,
|
|
7993
|
+
selectCell: () => {
|
|
7994
|
+
imperativeApi.cellSelectionApi.selectCell({
|
|
7995
|
+
rowId: rowInfo.id,
|
|
7996
|
+
colId: column.id
|
|
7997
|
+
});
|
|
7998
|
+
},
|
|
7999
|
+
deselectCell: () => {
|
|
8000
|
+
imperativeApi.cellSelectionApi.deselectCell({
|
|
8001
|
+
rowId: rowInfo.id,
|
|
8002
|
+
colId: column.id
|
|
8003
|
+
});
|
|
8004
|
+
},
|
|
7986
8005
|
renderBag: {
|
|
7987
8006
|
all: null,
|
|
7988
8007
|
value: typeof value === "boolean" ? `${value}` : value,
|
|
@@ -7990,13 +8009,13 @@ function getColumnRenderParam(options) {
|
|
|
7990
8009
|
groupIcon: null
|
|
7991
8010
|
},
|
|
7992
8011
|
selectCurrentRow: () => {
|
|
7993
|
-
return imperativeApi.
|
|
8012
|
+
return imperativeApi.rowSelectionApi.selectRow(
|
|
7994
8013
|
rowInfo.id,
|
|
7995
8014
|
rowInfo.dataSourceHasGrouping ? rowInfo.groupKeys : void 0
|
|
7996
8015
|
);
|
|
7997
8016
|
},
|
|
7998
8017
|
deselectCurrentRow: () => {
|
|
7999
|
-
return imperativeApi.
|
|
8018
|
+
return imperativeApi.rowSelectionApi.deselectRow(
|
|
8000
8019
|
rowInfo.id,
|
|
8001
8020
|
rowInfo.dataSourceHasGrouping ? rowInfo.groupKeys : void 0
|
|
8002
8021
|
);
|
|
@@ -8013,13 +8032,13 @@ function getColumnRenderParam(options) {
|
|
|
8013
8032
|
if (rowInfo.isGroupRow) {
|
|
8014
8033
|
return;
|
|
8015
8034
|
}
|
|
8016
|
-
return imperativeApi.
|
|
8035
|
+
return imperativeApi.rowSelectionApi.toggleRowSelection(rowInfo.id);
|
|
8017
8036
|
},
|
|
8018
8037
|
toggleCurrentGroupRowSelection: () => {
|
|
8019
8038
|
if (!rowInfo.isGroupRow) {
|
|
8020
8039
|
return;
|
|
8021
8040
|
}
|
|
8022
|
-
return imperativeApi.
|
|
8041
|
+
return imperativeApi.rowSelectionApi.toggleGroupRowSelection(
|
|
8023
8042
|
rowInfo.isGroupRow ? rowInfo.groupKeys : []
|
|
8024
8043
|
);
|
|
8025
8044
|
},
|
|
@@ -8260,7 +8279,9 @@ function InfiniteTableColumnCellFn(props) {
|
|
|
8260
8279
|
rowInfo,
|
|
8261
8280
|
rowStyle,
|
|
8262
8281
|
rowClassName,
|
|
8263
|
-
|
|
8282
|
+
getData,
|
|
8283
|
+
cellStyle,
|
|
8284
|
+
cellClassName,
|
|
8264
8285
|
width,
|
|
8265
8286
|
column,
|
|
8266
8287
|
onMouseLeave,
|
|
@@ -8281,6 +8302,7 @@ function InfiniteTableColumnCellFn(props) {
|
|
|
8281
8302
|
const {
|
|
8282
8303
|
getState,
|
|
8283
8304
|
actions: componentActions,
|
|
8305
|
+
computed,
|
|
8284
8306
|
api: imperativeApi
|
|
8285
8307
|
} = useInfiniteTable();
|
|
8286
8308
|
const {
|
|
@@ -8346,7 +8368,8 @@ function InfiniteTableColumnCellFn(props) {
|
|
|
8346
8368
|
},
|
|
8347
8369
|
[rowIndex, column.computedVisibleIndex, keyboardNavigation]
|
|
8348
8370
|
);
|
|
8349
|
-
const { selectionMode } = dataSourceState;
|
|
8371
|
+
const { selectionMode, cellSelection } = dataSourceState;
|
|
8372
|
+
const cellSelected = renderParam.cellSelected;
|
|
8350
8373
|
renderParam.domRef = domRef;
|
|
8351
8374
|
renderParam.selectCurrentRow = (0, import_react24.useCallback)(renderParam.selectCurrentRow, [
|
|
8352
8375
|
rowInfo
|
|
@@ -8476,6 +8499,12 @@ function InfiniteTableColumnCellFn(props) {
|
|
|
8476
8499
|
stylingParam
|
|
8477
8500
|
);
|
|
8478
8501
|
}
|
|
8502
|
+
if (cellClassName) {
|
|
8503
|
+
colClassName = join(
|
|
8504
|
+
colClassName,
|
|
8505
|
+
applyColumnClassName(cellClassName, stylingParam)
|
|
8506
|
+
);
|
|
8507
|
+
}
|
|
8479
8508
|
if (column.className) {
|
|
8480
8509
|
colClassName = join(
|
|
8481
8510
|
colClassName,
|
|
@@ -8489,6 +8518,9 @@ function InfiniteTableColumnCellFn(props) {
|
|
|
8489
8518
|
if (rowStyle) {
|
|
8490
8519
|
style2 = typeof rowStyle === "function" ? __spreadValues(__spreadValues({}, style2), rowStyle(rowPropsAndStyleArgs)) : __spreadValues(__spreadValues({}, style2), rowStyle);
|
|
8491
8520
|
}
|
|
8521
|
+
if (cellStyle) {
|
|
8522
|
+
style2 = applyColumnStyle(style2, cellStyle, stylingParam);
|
|
8523
|
+
}
|
|
8492
8524
|
if (groupByColumnReference == null ? void 0 : groupByColumnReference.style) {
|
|
8493
8525
|
style2 = applyColumnStyle(style2, groupByColumnReference.style, stylingParam);
|
|
8494
8526
|
}
|
|
@@ -8504,6 +8536,36 @@ function InfiniteTableColumnCellFn(props) {
|
|
|
8504
8536
|
);
|
|
8505
8537
|
const odd = (rowInfo.indexInAll != null ? rowInfo.indexInAll : rowIndex) % 2 === 1;
|
|
8506
8538
|
const zebra = showZebraRows ? odd ? "odd" : "even" : false;
|
|
8539
|
+
let topSelectionBorder = false;
|
|
8540
|
+
let leftSelectionBorder = false;
|
|
8541
|
+
let rightSelectionBorder = false;
|
|
8542
|
+
let bottomSelectionBorder = false;
|
|
8543
|
+
if (cellSelection && cellSelected) {
|
|
8544
|
+
const arr = getData();
|
|
8545
|
+
const topRowInfo = arr[rowInfo.indexInAll - 1];
|
|
8546
|
+
const bottomRowInfo = arr[rowInfo.indexInAll + 1];
|
|
8547
|
+
const nextColumn = computed.computedVisibleColumns[column.computedVisibleIndex + 1];
|
|
8548
|
+
const prevColumn = computed.computedVisibleColumns[column.computedVisibleIndex - 1];
|
|
8549
|
+
topSelectionBorder = topRowInfo ? !cellSelection.isCellSelected(topRowInfo.id, column.id) : true;
|
|
8550
|
+
if (column.computedPinned === "end" && column.computedFirstInCategory) {
|
|
8551
|
+
leftSelectionBorder = true;
|
|
8552
|
+
} else {
|
|
8553
|
+
leftSelectionBorder = prevColumn ? !cellSelection.isCellSelected(rowInfo.id, prevColumn.id) : true;
|
|
8554
|
+
}
|
|
8555
|
+
if (column.computedPinned === "start" && column.computedLastInCategory) {
|
|
8556
|
+
rightSelectionBorder = true;
|
|
8557
|
+
} else {
|
|
8558
|
+
rightSelectionBorder = nextColumn ? !cellSelection.isCellSelected(rowInfo.id, nextColumn.id) : true;
|
|
8559
|
+
}
|
|
8560
|
+
bottomSelectionBorder = bottomRowInfo ? !cellSelection.isCellSelected(bottomRowInfo.id, column.id) : true;
|
|
8561
|
+
}
|
|
8562
|
+
const cellSelectionBorders = cellSelection && cellSelected ? {
|
|
8563
|
+
top: topSelectionBorder,
|
|
8564
|
+
left: leftSelectionBorder,
|
|
8565
|
+
right: rightSelectionBorder,
|
|
8566
|
+
bottom: bottomSelectionBorder
|
|
8567
|
+
} : null;
|
|
8568
|
+
const afterChildren = editor;
|
|
8507
8569
|
const cellProps = {
|
|
8508
8570
|
domRef,
|
|
8509
8571
|
cellType: "body",
|
|
@@ -8514,10 +8576,11 @@ function InfiniteTableColumnCellFn(props) {
|
|
|
8514
8576
|
onMouseLeave,
|
|
8515
8577
|
onMouseEnter,
|
|
8516
8578
|
onClick,
|
|
8517
|
-
afterChildren
|
|
8579
|
+
afterChildren,
|
|
8518
8580
|
onMouseDown,
|
|
8519
8581
|
cssEllipsis: (_c = column.cssEllipsis) != null ? _c : true,
|
|
8520
8582
|
className: join(
|
|
8583
|
+
cellSelectionBorders ? ColumnCellSelectionIndicatorRecipe(cellSelectionBorders) : "",
|
|
8521
8584
|
useCellClassName(
|
|
8522
8585
|
column,
|
|
8523
8586
|
[InfiniteTableColumnCellClassName, InfiniteTableCellClassName],
|
|
@@ -8528,6 +8591,7 @@ function InfiniteTableColumnCellFn(props) {
|
|
|
8528
8591
|
align: align2,
|
|
8529
8592
|
verticalAlign,
|
|
8530
8593
|
rowActive,
|
|
8594
|
+
cellSelected,
|
|
8531
8595
|
rowSelected,
|
|
8532
8596
|
groupRow: rowInfo.isGroupRow,
|
|
8533
8597
|
groupCell: rowInfo.isGroupRow ? !!column.groupByForColumn : false,
|
|
@@ -8883,7 +8947,7 @@ function getColumnGroupResizer(colIndexes, config) {
|
|
|
8883
8947
|
|
|
8884
8948
|
// src/components/InfiniteTable/components/InfiniteTableHeader/ResizeHandle/ResizeHandle.css.ts
|
|
8885
8949
|
var ResizeHandleCls = "ResizeHandle_ResizeHandleCls__zneyzh0 utilities_position_absolute__16lm1iw2 utilities_top_0__16lm1iw1b utilities_right_0__16lm1iw1i utilities_bottom_0__16lm1iw1g utilities_cursor_colResize__16lm1iwj utilities_overflow_hidden__16lm1iw1w";
|
|
8886
|
-
var ResizeHandleDraggerClsRecipe = createRuntimeFn({ defaultClassName: "ResizeHandle_ResizeHandleDraggerClsRecipe__zneyzhb utilities_position_absolute__16lm1iw2 utilities_top_0__16lm1iw1b utilities_bottom_0__16lm1iw1g", variantClassNames: { constrained: { false: "ResizeHandle_ResizeHandleDraggerClsRecipe_constrained_false__zneyzhc", true: "ResizeHandle_ResizeHandleDraggerClsRecipe_constrained_true__zneyzhd" } }, defaultVariants: {}, compoundVariants: [] });
|
|
8950
|
+
var ResizeHandleDraggerClsRecipe = createRuntimeFn({ defaultClassName: "ResizeHandle_ResizeHandleDraggerClsRecipe__zneyzhb utilities_position_absolute__16lm1iw2 utilities_top_0__16lm1iw1b utilities_bottom_0__16lm1iw1g", variantClassNames: { constrained: { false: "ResizeHandle_ResizeHandleDraggerClsRecipe_constrained_false__zneyzhc", true: "ResizeHandle_ResizeHandleDraggerClsRecipe_constrained_true__zneyzhd" }, computedPinned: { start: "ResizeHandle_ResizeHandleDraggerClsRecipe_computedPinned_start__zneyzhe", end: "ResizeHandle_ResizeHandleDraggerClsRecipe_computedPinned_end__zneyzhf", false: "ResizeHandle_ResizeHandleDraggerClsRecipe_computedPinned_false__zneyzhg" }, computedFirstInCategory: { true: "ResizeHandle_ResizeHandleDraggerClsRecipe_computedFirstInCategory_true__zneyzhh", false: "ResizeHandle_ResizeHandleDraggerClsRecipe_computedFirstInCategory_false__zneyzhi" }, computedLastInCategory: { true: "ResizeHandle_ResizeHandleDraggerClsRecipe_computedLastInCategory_true__zneyzhj", false: "ResizeHandle_ResizeHandleDraggerClsRecipe_computedLastInCategory_false__zneyzhk" } }, defaultVariants: {}, compoundVariants: [[{ computedPinned: "start", computedLastInCategory: true }, "ResizeHandle_ResizeHandleDraggerClsRecipe_compound_0__zneyzhl"], [{ computedPinned: "end", computedFirstInCategory: true }, "ResizeHandle_ResizeHandleDraggerClsRecipe_compound_1__zneyzhm"]] });
|
|
8887
8951
|
var ResizeHandleRecipeCls = createRuntimeFn({ defaultClassName: "", variantClassNames: { computedPinned: { start: "ResizeHandle_ResizeHandleRecipeCls_computedPinned_start__zneyzh1", end: "ResizeHandle_ResizeHandleRecipeCls_computedPinned_end__zneyzh2 utilities_left_0__16lm1iw1d utilities_right_auto__16lm1iw1k", false: "ResizeHandle_ResizeHandleRecipeCls_computedPinned_false__zneyzh3" }, computedFirstInCategory: { true: "ResizeHandle_ResizeHandleRecipeCls_computedFirstInCategory_true__zneyzh4", false: "ResizeHandle_ResizeHandleRecipeCls_computedFirstInCategory_false__zneyzh5" }, computedLastInCategory: { true: "ResizeHandle_ResizeHandleRecipeCls_computedLastInCategory_true__zneyzh6", false: "ResizeHandle_ResizeHandleRecipeCls_computedLastInCategory_false__zneyzh7" } }, defaultVariants: {}, compoundVariants: [[{ computedPinned: "end", computedLastInCategory: false, computedFirstInCategory: true }, "ResizeHandle_ResizeHandleRecipeCls_compound_0__zneyzh8"], [{ computedPinned: false, computedFirstInCategory: false, computedLastInCategory: true }, "ResizeHandle_ResizeHandleRecipeCls_compound_1__zneyzh9"], [{ computedPinned: "start", computedFirstInCategory: false, computedLastInCategory: true }, "ResizeHandle_ResizeHandleRecipeCls_compound_2__zneyzha"]] });
|
|
8888
8952
|
|
|
8889
8953
|
// src/components/InfiniteTable/components/InfiniteTableHeader/ResizeHandle/index.tsx
|
|
@@ -8963,7 +9027,10 @@ function ResizeHandleFn(props) {
|
|
|
8963
9027
|
{
|
|
8964
9028
|
style: style2,
|
|
8965
9029
|
className: ResizeHandleDraggerClsRecipe({
|
|
8966
|
-
constrained
|
|
9030
|
+
constrained,
|
|
9031
|
+
computedPinned,
|
|
9032
|
+
computedFirstInCategory,
|
|
9033
|
+
computedLastInCategory
|
|
8967
9034
|
})
|
|
8968
9035
|
}
|
|
8969
9036
|
)
|
|
@@ -9057,9 +9124,9 @@ var defaultRenderSelectionCheckBox2 = (params) => {
|
|
|
9057
9124
|
},
|
|
9058
9125
|
onChange: (selected2) => {
|
|
9059
9126
|
if (selected2) {
|
|
9060
|
-
api.
|
|
9127
|
+
api.rowSelectionApi.selectAll();
|
|
9061
9128
|
} else {
|
|
9062
|
-
api.
|
|
9129
|
+
api.rowSelectionApi.deselectAll();
|
|
9063
9130
|
}
|
|
9064
9131
|
},
|
|
9065
9132
|
checked: selected
|
|
@@ -9396,6 +9463,7 @@ function InfiniteTableHeaderCell(props) {
|
|
|
9396
9463
|
align: align2,
|
|
9397
9464
|
verticalAlign,
|
|
9398
9465
|
rowSelected: false,
|
|
9466
|
+
cellSelected: false,
|
|
9399
9467
|
zebra: false,
|
|
9400
9468
|
rowActive: false,
|
|
9401
9469
|
groupCell: false,
|
|
@@ -10191,6 +10259,9 @@ var sharedValueGetterParamsFlyweightObject = Object.seal({
|
|
|
10191
10259
|
// src/utils/groupAndPivot/index.ts
|
|
10192
10260
|
var LAZY_ROOT_KEY_FOR_GROUPS = "____root____";
|
|
10193
10261
|
var NOT_LOADED_YET_KEY_PREFIX = "____not_loaded_yet____";
|
|
10262
|
+
function returnFalse() {
|
|
10263
|
+
return false;
|
|
10264
|
+
}
|
|
10194
10265
|
function initReducers(reducers) {
|
|
10195
10266
|
if (!reducers || !Object.keys(reducers).length) {
|
|
10196
10267
|
return {};
|
|
@@ -10623,6 +10694,7 @@ function getEnhancedGroupData(options, deepMapValue) {
|
|
|
10623
10694
|
//TODO improve this
|
|
10624
10695
|
collapsed: false,
|
|
10625
10696
|
dataSourceHasGrouping: true,
|
|
10697
|
+
isCellSelected: returnFalse,
|
|
10626
10698
|
selfLoaded,
|
|
10627
10699
|
error: options.error,
|
|
10628
10700
|
parents,
|
|
@@ -10758,6 +10830,7 @@ function enhancedFlatten(param) {
|
|
|
10758
10830
|
const rowInfo = {
|
|
10759
10831
|
id: itemId,
|
|
10760
10832
|
data: item,
|
|
10833
|
+
isCellSelected: returnFalse,
|
|
10761
10834
|
dataSourceHasGrouping: true,
|
|
10762
10835
|
isGroupRow: false,
|
|
10763
10836
|
selfLoaded: !!item,
|
|
@@ -10998,6 +11071,14 @@ var DataSourceCache = class {
|
|
|
10998
11071
|
}
|
|
10999
11072
|
};
|
|
11000
11073
|
|
|
11074
|
+
// src/components/DataSource/dataSourceGetters.ts
|
|
11075
|
+
function getRowInfoAt(rowIndex, getState) {
|
|
11076
|
+
return getState().dataArray[rowIndex];
|
|
11077
|
+
}
|
|
11078
|
+
function getRowInfoArray(getState) {
|
|
11079
|
+
return getState().dataArray;
|
|
11080
|
+
}
|
|
11081
|
+
|
|
11001
11082
|
// src/components/DataSource/getDataSourceApi.ts
|
|
11002
11083
|
function getDataSourceApi(param) {
|
|
11003
11084
|
return new DataSourceApiImpl(param);
|
|
@@ -11007,15 +11088,149 @@ var DataSourceApiImpl = class {
|
|
|
11007
11088
|
this.pendingOperations = [];
|
|
11008
11089
|
this.pendingPromise = null;
|
|
11009
11090
|
this.resolvePendingPromise = null;
|
|
11091
|
+
this.toPrimaryKey = (data) => {
|
|
11092
|
+
return this.getState().toPrimaryKey(data);
|
|
11093
|
+
};
|
|
11094
|
+
this.getRowInfoArray = () => {
|
|
11095
|
+
return getRowInfoArray(this.getState);
|
|
11096
|
+
};
|
|
11097
|
+
this.getRowInfoByIndex = (index) => {
|
|
11098
|
+
var _a;
|
|
11099
|
+
return (_a = getRowInfoAt(index, this.getState)) != null ? _a : null;
|
|
11100
|
+
};
|
|
11101
|
+
this.getRowInfoByPrimaryKey = (id) => {
|
|
11102
|
+
const index = this.getIndexByPrimaryKey(id);
|
|
11103
|
+
return this.getRowInfoByIndex(index);
|
|
11104
|
+
};
|
|
11105
|
+
this.getIndexByPrimaryKey = (id) => {
|
|
11106
|
+
var _a;
|
|
11107
|
+
const map2 = this.getState().idToIndexMap;
|
|
11108
|
+
return (_a = map2.get(id)) != null ? _a : -1;
|
|
11109
|
+
};
|
|
11110
|
+
this.getPrimaryKeyByIndex = (index) => {
|
|
11111
|
+
const rowInfo = this.getRowInfoByIndex(index);
|
|
11112
|
+
return rowInfo ? rowInfo.id : void 0;
|
|
11113
|
+
};
|
|
11010
11114
|
this.getOriginalDataArray = () => {
|
|
11011
11115
|
return this.getState().originalDataArray;
|
|
11012
11116
|
};
|
|
11117
|
+
this.getDataByPrimaryKey = (id) => {
|
|
11118
|
+
var _a;
|
|
11119
|
+
const { indexer } = this.getState();
|
|
11120
|
+
return (_a = indexer.getDataForPrimaryKey(id)) != null ? _a : null;
|
|
11121
|
+
};
|
|
11122
|
+
this.updateData = (data, options) => {
|
|
11123
|
+
return this.updateDataArray([data], options);
|
|
11124
|
+
};
|
|
11125
|
+
this.updateDataArray = (data, options) => {
|
|
11126
|
+
const result = this.batchOperation({
|
|
11127
|
+
type: "update",
|
|
11128
|
+
array: data,
|
|
11129
|
+
primaryKeys: data.map((d) => {
|
|
11130
|
+
return this.toPrimaryKey(d);
|
|
11131
|
+
}),
|
|
11132
|
+
metadata: options == null ? void 0 : options.metadata
|
|
11133
|
+
});
|
|
11134
|
+
if (options == null ? void 0 : options.flush) {
|
|
11135
|
+
this.commit();
|
|
11136
|
+
}
|
|
11137
|
+
return result;
|
|
11138
|
+
};
|
|
11139
|
+
this.removeDataByPrimaryKey = (id, options) => {
|
|
11140
|
+
const result = this.batchOperation({
|
|
11141
|
+
type: "delete",
|
|
11142
|
+
primaryKeys: [id],
|
|
11143
|
+
metadata: options == null ? void 0 : options.metadata
|
|
11144
|
+
});
|
|
11145
|
+
if (options == null ? void 0 : options.flush) {
|
|
11146
|
+
this.commit();
|
|
11147
|
+
}
|
|
11148
|
+
return result;
|
|
11149
|
+
};
|
|
11150
|
+
this.removeData = (data, options) => {
|
|
11151
|
+
const result = this.batchOperation({
|
|
11152
|
+
type: "delete",
|
|
11153
|
+
primaryKeys: [this.toPrimaryKey(data)],
|
|
11154
|
+
metadata: options == null ? void 0 : options.metadata
|
|
11155
|
+
});
|
|
11156
|
+
if (options == null ? void 0 : options.flush) {
|
|
11157
|
+
this.commit();
|
|
11158
|
+
}
|
|
11159
|
+
return result;
|
|
11160
|
+
};
|
|
11161
|
+
this.removeDataArrayByPrimaryKeys = (ids, options) => {
|
|
11162
|
+
const result = this.batchOperation({
|
|
11163
|
+
type: "delete",
|
|
11164
|
+
primaryKeys: ids,
|
|
11165
|
+
metadata: options == null ? void 0 : options.metadata
|
|
11166
|
+
});
|
|
11167
|
+
if (options == null ? void 0 : options.flush) {
|
|
11168
|
+
this.commit();
|
|
11169
|
+
}
|
|
11170
|
+
return result;
|
|
11171
|
+
};
|
|
11172
|
+
this.removeDataArray = (data, options) => {
|
|
11173
|
+
const result = this.batchOperation({
|
|
11174
|
+
type: "delete",
|
|
11175
|
+
primaryKeys: data.map(this.toPrimaryKey),
|
|
11176
|
+
metadata: options == null ? void 0 : options.metadata
|
|
11177
|
+
});
|
|
11178
|
+
if (options == null ? void 0 : options.flush) {
|
|
11179
|
+
this.commit();
|
|
11180
|
+
}
|
|
11181
|
+
return result;
|
|
11182
|
+
};
|
|
11183
|
+
this.addData = (data, options) => {
|
|
11184
|
+
return this.addDataArray([data], options);
|
|
11185
|
+
};
|
|
11186
|
+
this.addDataArray = (data, options) => {
|
|
11187
|
+
return this.insertDataArray(data, __spreadProps(__spreadValues({}, options), {
|
|
11188
|
+
position: "end"
|
|
11189
|
+
}));
|
|
11190
|
+
};
|
|
11191
|
+
this.insertData = (data, options) => {
|
|
11192
|
+
return this.insertDataArray([data], options);
|
|
11193
|
+
};
|
|
11194
|
+
this.insertDataArray = (data, options) => {
|
|
11195
|
+
let position2 = "before";
|
|
11196
|
+
let primaryKey = void 0;
|
|
11197
|
+
if (options.position === "before" || options.position === "after") {
|
|
11198
|
+
position2 = options.position;
|
|
11199
|
+
primaryKey = options.primaryKey;
|
|
11200
|
+
} else {
|
|
11201
|
+
const arr = this.getOriginalDataArray();
|
|
11202
|
+
if (options.position === "start") {
|
|
11203
|
+
position2 = "before";
|
|
11204
|
+
primaryKey = this.toPrimaryKey(arr[0]);
|
|
11205
|
+
} else {
|
|
11206
|
+
position2 = "after";
|
|
11207
|
+
primaryKey = this.toPrimaryKey(arr[arr.length - 1]);
|
|
11208
|
+
}
|
|
11209
|
+
}
|
|
11210
|
+
const result = this.batchOperation({
|
|
11211
|
+
type: "insert",
|
|
11212
|
+
array: data,
|
|
11213
|
+
position: position2,
|
|
11214
|
+
metadata: options == null ? void 0 : options.metadata,
|
|
11215
|
+
primaryKey
|
|
11216
|
+
});
|
|
11217
|
+
if (options == null ? void 0 : options.flush) {
|
|
11218
|
+
this.commit();
|
|
11219
|
+
}
|
|
11220
|
+
return result;
|
|
11221
|
+
};
|
|
11222
|
+
this.setSortInfo = (sortInfo) => {
|
|
11223
|
+
const multiSort = this.getState().multiSort;
|
|
11224
|
+
if (Array.isArray(sortInfo)) {
|
|
11225
|
+
this.actions.sortInfo = sortInfo.length ? multiSort ? sortInfo : sortInfo[0] : null;
|
|
11226
|
+
return;
|
|
11227
|
+
}
|
|
11228
|
+
this.actions.sortInfo = sortInfo;
|
|
11229
|
+
return;
|
|
11230
|
+
};
|
|
11013
11231
|
this.getState = param.getState;
|
|
11014
11232
|
this.actions = param.actions;
|
|
11015
11233
|
}
|
|
11016
|
-
toPrimaryKey(data) {
|
|
11017
|
-
return this.getState().toPrimaryKey(data);
|
|
11018
|
-
}
|
|
11019
11234
|
batchOperation(operation) {
|
|
11020
11235
|
if (!this.pendingPromise) {
|
|
11021
11236
|
this.pendingPromise = new Promise((resolve) => {
|
|
@@ -11086,140 +11301,6 @@ var DataSourceApiImpl = class {
|
|
|
11086
11301
|
this.resolvePendingPromise = null;
|
|
11087
11302
|
}
|
|
11088
11303
|
}
|
|
11089
|
-
getRowInfoArray() {
|
|
11090
|
-
return this.getState().dataArray;
|
|
11091
|
-
}
|
|
11092
|
-
getRowInfoByIndex(index) {
|
|
11093
|
-
var _a;
|
|
11094
|
-
return (_a = this.getRowInfoArray()[index]) != null ? _a : null;
|
|
11095
|
-
}
|
|
11096
|
-
getRowInfoByPrimaryKey(id) {
|
|
11097
|
-
const index = this.getIndexByPrimaryKey(id);
|
|
11098
|
-
return this.getRowInfoByIndex(index);
|
|
11099
|
-
}
|
|
11100
|
-
getIndexByPrimaryKey(id) {
|
|
11101
|
-
var _a;
|
|
11102
|
-
const map2 = this.getState().idToIndexMap;
|
|
11103
|
-
return (_a = map2.get(id)) != null ? _a : -1;
|
|
11104
|
-
}
|
|
11105
|
-
getPrimaryKeyByIndex(index) {
|
|
11106
|
-
const rowInfo = this.getRowInfoByIndex(index);
|
|
11107
|
-
return rowInfo ? rowInfo.id : void 0;
|
|
11108
|
-
}
|
|
11109
|
-
getDataByPrimaryKey(id) {
|
|
11110
|
-
var _a;
|
|
11111
|
-
const { indexer } = this.getState();
|
|
11112
|
-
return (_a = indexer.getDataForPrimaryKey(id)) != null ? _a : null;
|
|
11113
|
-
}
|
|
11114
|
-
updateData(data, options) {
|
|
11115
|
-
return this.updateDataArray([data], options);
|
|
11116
|
-
}
|
|
11117
|
-
updateDataArray(data, options) {
|
|
11118
|
-
const result = this.batchOperation({
|
|
11119
|
-
type: "update",
|
|
11120
|
-
array: data,
|
|
11121
|
-
primaryKeys: data.map((d) => {
|
|
11122
|
-
return this.toPrimaryKey(d);
|
|
11123
|
-
}),
|
|
11124
|
-
metadata: options == null ? void 0 : options.metadata
|
|
11125
|
-
});
|
|
11126
|
-
if (options == null ? void 0 : options.flush) {
|
|
11127
|
-
this.commit();
|
|
11128
|
-
}
|
|
11129
|
-
return result;
|
|
11130
|
-
}
|
|
11131
|
-
removeDataByPrimaryKey(id, options) {
|
|
11132
|
-
const result = this.batchOperation({
|
|
11133
|
-
type: "delete",
|
|
11134
|
-
primaryKeys: [id],
|
|
11135
|
-
metadata: options == null ? void 0 : options.metadata
|
|
11136
|
-
});
|
|
11137
|
-
if (options == null ? void 0 : options.flush) {
|
|
11138
|
-
this.commit();
|
|
11139
|
-
}
|
|
11140
|
-
return result;
|
|
11141
|
-
}
|
|
11142
|
-
removeData(data, options) {
|
|
11143
|
-
const result = this.batchOperation({
|
|
11144
|
-
type: "delete",
|
|
11145
|
-
primaryKeys: [this.toPrimaryKey(data)],
|
|
11146
|
-
metadata: options == null ? void 0 : options.metadata
|
|
11147
|
-
});
|
|
11148
|
-
if (options == null ? void 0 : options.flush) {
|
|
11149
|
-
this.commit();
|
|
11150
|
-
}
|
|
11151
|
-
return result;
|
|
11152
|
-
}
|
|
11153
|
-
removeDataArrayByPrimaryKeys(ids, options) {
|
|
11154
|
-
const result = this.batchOperation({
|
|
11155
|
-
type: "delete",
|
|
11156
|
-
primaryKeys: ids,
|
|
11157
|
-
metadata: options == null ? void 0 : options.metadata
|
|
11158
|
-
});
|
|
11159
|
-
if (options == null ? void 0 : options.flush) {
|
|
11160
|
-
this.commit();
|
|
11161
|
-
}
|
|
11162
|
-
return result;
|
|
11163
|
-
}
|
|
11164
|
-
removeDataArray(data, options) {
|
|
11165
|
-
const result = this.batchOperation({
|
|
11166
|
-
type: "delete",
|
|
11167
|
-
primaryKeys: data.map(this.toPrimaryKey),
|
|
11168
|
-
metadata: options == null ? void 0 : options.metadata
|
|
11169
|
-
});
|
|
11170
|
-
if (options == null ? void 0 : options.flush) {
|
|
11171
|
-
this.commit();
|
|
11172
|
-
}
|
|
11173
|
-
return result;
|
|
11174
|
-
}
|
|
11175
|
-
addData(data, options) {
|
|
11176
|
-
return this.addDataArray([data], options);
|
|
11177
|
-
}
|
|
11178
|
-
addDataArray(data, options) {
|
|
11179
|
-
return this.insertDataArray(data, __spreadProps(__spreadValues({}, options), {
|
|
11180
|
-
position: "end"
|
|
11181
|
-
}));
|
|
11182
|
-
}
|
|
11183
|
-
insertData(data, options) {
|
|
11184
|
-
return this.insertDataArray([data], options);
|
|
11185
|
-
}
|
|
11186
|
-
insertDataArray(data, options) {
|
|
11187
|
-
let position2 = "before";
|
|
11188
|
-
let primaryKey = void 0;
|
|
11189
|
-
if (options.position === "before" || options.position === "after") {
|
|
11190
|
-
position2 = options.position;
|
|
11191
|
-
primaryKey = options.primaryKey;
|
|
11192
|
-
} else {
|
|
11193
|
-
const arr = this.getOriginalDataArray();
|
|
11194
|
-
if (options.position === "start") {
|
|
11195
|
-
position2 = "before";
|
|
11196
|
-
primaryKey = this.toPrimaryKey(arr[0]);
|
|
11197
|
-
} else {
|
|
11198
|
-
position2 = "after";
|
|
11199
|
-
primaryKey = this.toPrimaryKey(arr[arr.length - 1]);
|
|
11200
|
-
}
|
|
11201
|
-
}
|
|
11202
|
-
const result = this.batchOperation({
|
|
11203
|
-
type: "insert",
|
|
11204
|
-
array: data,
|
|
11205
|
-
position: position2,
|
|
11206
|
-
metadata: options == null ? void 0 : options.metadata,
|
|
11207
|
-
primaryKey
|
|
11208
|
-
});
|
|
11209
|
-
if (options == null ? void 0 : options.flush) {
|
|
11210
|
-
this.commit();
|
|
11211
|
-
}
|
|
11212
|
-
return result;
|
|
11213
|
-
}
|
|
11214
|
-
setSortInfo(sortInfo) {
|
|
11215
|
-
const multiSort = this.getState().multiSort;
|
|
11216
|
-
if (Array.isArray(sortInfo)) {
|
|
11217
|
-
this.actions.sortInfo = sortInfo.length ? multiSort ? sortInfo : sortInfo[0] : null;
|
|
11218
|
-
return;
|
|
11219
|
-
}
|
|
11220
|
-
this.actions.sortInfo = sortInfo;
|
|
11221
|
-
return;
|
|
11222
|
-
}
|
|
11223
11304
|
};
|
|
11224
11305
|
function getCacheAffectedParts(state) {
|
|
11225
11306
|
const cache = state.cache;
|
|
@@ -11543,6 +11624,18 @@ function useEffectWithChanges(fn, deps) {
|
|
|
11543
11624
|
}, useEffectDeps);
|
|
11544
11625
|
}
|
|
11545
11626
|
|
|
11627
|
+
// src/utils/composeFunctions.ts
|
|
11628
|
+
function composeFunctions(...fns) {
|
|
11629
|
+
const f = (...args) => {
|
|
11630
|
+
fns.forEach((fn) => {
|
|
11631
|
+
if (typeof fn === "function") {
|
|
11632
|
+
fn(...args);
|
|
11633
|
+
}
|
|
11634
|
+
});
|
|
11635
|
+
};
|
|
11636
|
+
return f;
|
|
11637
|
+
}
|
|
11638
|
+
|
|
11546
11639
|
// src/utils/groupAndPivot/getPivotColumnsAndColumnGroups.ts
|
|
11547
11640
|
function prepareColumn(column) {
|
|
11548
11641
|
const { pivotByAtIndex: pivotByForColumn, pivotAggregator } = column;
|
|
@@ -11792,7 +11885,7 @@ function getGroupKeysForDataItem(data, groupBy) {
|
|
|
11792
11885
|
}, []);
|
|
11793
11886
|
}
|
|
11794
11887
|
|
|
11795
|
-
// src/components/InfiniteTable/api/
|
|
11888
|
+
// src/components/InfiniteTable/api/getRowSelectionApi.ts
|
|
11796
11889
|
function cloneRowSelection(rowSelection, stateOrGetDataSourceState) {
|
|
11797
11890
|
return new RowSelectionState(
|
|
11798
11891
|
rowSelection,
|
|
@@ -11813,7 +11906,7 @@ function rowSelectionStateConfigGetter(stateOrStateGetter) {
|
|
|
11813
11906
|
};
|
|
11814
11907
|
};
|
|
11815
11908
|
}
|
|
11816
|
-
function
|
|
11909
|
+
function getRowSelectionApi(param) {
|
|
11817
11910
|
const {
|
|
11818
11911
|
// getComputed,
|
|
11819
11912
|
// getState,
|
|
@@ -11821,7 +11914,7 @@ function getSelectionApi(param) {
|
|
|
11821
11914
|
// componentActions,
|
|
11822
11915
|
dataSourceActions
|
|
11823
11916
|
} = param;
|
|
11824
|
-
const
|
|
11917
|
+
const rowSelectionApi = {
|
|
11825
11918
|
get allRowsSelected() {
|
|
11826
11919
|
return getDataSourceState().allRowsSelected;
|
|
11827
11920
|
},
|
|
@@ -12024,11 +12117,249 @@ function getSelectionApi(param) {
|
|
|
12024
12117
|
}
|
|
12025
12118
|
};
|
|
12026
12119
|
if (false) {
|
|
12027
|
-
globalThis.
|
|
12120
|
+
globalThis.rowSelectionApi = rowSelectionApi;
|
|
12028
12121
|
}
|
|
12029
|
-
return
|
|
12122
|
+
return rowSelectionApi;
|
|
12030
12123
|
}
|
|
12031
12124
|
|
|
12125
|
+
// src/components/DataSource/CellSelectionState.ts
|
|
12126
|
+
var WILDCARD = "*";
|
|
12127
|
+
var CellSelectionState = class {
|
|
12128
|
+
constructor(clone) {
|
|
12129
|
+
this.wildcard = WILDCARD;
|
|
12130
|
+
this.cache = new DeepMap();
|
|
12131
|
+
this.selectedRowsToColumns = /* @__PURE__ */ new Map();
|
|
12132
|
+
this.selectedColumnsToRows = /* @__PURE__ */ new Map();
|
|
12133
|
+
this.deselectedRowsToColumns = /* @__PURE__ */ new Map();
|
|
12134
|
+
this.deselectedColumnsToRows = /* @__PURE__ */ new Map();
|
|
12135
|
+
this.defaultSelection = false;
|
|
12136
|
+
this.deselectAll = () => {
|
|
12137
|
+
this.update({
|
|
12138
|
+
defaultSelection: false,
|
|
12139
|
+
selectedCells: []
|
|
12140
|
+
});
|
|
12141
|
+
};
|
|
12142
|
+
this.selectAll = () => {
|
|
12143
|
+
this.update({
|
|
12144
|
+
defaultSelection: true,
|
|
12145
|
+
deselectedCells: []
|
|
12146
|
+
});
|
|
12147
|
+
};
|
|
12148
|
+
const stateObject = clone && clone instanceof Object.getPrototypeOf(this).constructor ? clone.getState() : clone;
|
|
12149
|
+
if (stateObject) {
|
|
12150
|
+
this.update(stateObject);
|
|
12151
|
+
}
|
|
12152
|
+
}
|
|
12153
|
+
selectCell(rowId, colId) {
|
|
12154
|
+
this.setCellSelected(rowId, colId, true);
|
|
12155
|
+
}
|
|
12156
|
+
deselectCell(rowId, colId) {
|
|
12157
|
+
this.setCellSelected(rowId, colId, false);
|
|
12158
|
+
}
|
|
12159
|
+
setCellSelected(rowId, colId, selected) {
|
|
12160
|
+
if (rowId === this.wildcard || colId === this.wildcard) {
|
|
12161
|
+
throw "Please dont use this private method to select cells with wildcard";
|
|
12162
|
+
}
|
|
12163
|
+
const isSelected = this.isCellSelected(rowId, colId);
|
|
12164
|
+
if (isSelected === selected) {
|
|
12165
|
+
return;
|
|
12166
|
+
}
|
|
12167
|
+
const cacheKey = [rowId, colId];
|
|
12168
|
+
this.cache.delete(cacheKey);
|
|
12169
|
+
if (selected) {
|
|
12170
|
+
if (this.defaultSelection) {
|
|
12171
|
+
const cellsForThisRow = this.deselectedRowsToColumns.get(rowId);
|
|
12172
|
+
if (cellsForThisRow && cellsForThisRow.has(colId)) {
|
|
12173
|
+
this.setCellInDeselection(rowId, colId, false);
|
|
12174
|
+
}
|
|
12175
|
+
const deselectedColumnsForWildcardRow = this.deselectedRowsToColumns.get(this.wildcard);
|
|
12176
|
+
const deselectedRowsForWildcardColumn = this.deselectedColumnsToRows.get(this.wildcard);
|
|
12177
|
+
if ((deselectedColumnsForWildcardRow == null ? void 0 : deselectedColumnsForWildcardRow.has(colId)) || (deselectedRowsForWildcardColumn == null ? void 0 : deselectedRowsForWildcardColumn.has(rowId))) {
|
|
12178
|
+
this.setCellInSelection(rowId, colId, true);
|
|
12179
|
+
}
|
|
12180
|
+
} else {
|
|
12181
|
+
const cellsForThisRow = this.deselectedRowsToColumns.get(rowId);
|
|
12182
|
+
if (cellsForThisRow && cellsForThisRow.has(colId)) {
|
|
12183
|
+
this.setCellInDeselection(rowId, colId, false);
|
|
12184
|
+
}
|
|
12185
|
+
this.setCellInSelection(rowId, colId, true);
|
|
12186
|
+
}
|
|
12187
|
+
} else {
|
|
12188
|
+
if (this.defaultSelection) {
|
|
12189
|
+
const cellsForThisRow = this.selectedRowsToColumns.get(rowId);
|
|
12190
|
+
if (cellsForThisRow == null ? void 0 : cellsForThisRow.has(colId)) {
|
|
12191
|
+
this.setCellInSelection(rowId, colId, false);
|
|
12192
|
+
}
|
|
12193
|
+
this.setCellInDeselection(rowId, colId, true);
|
|
12194
|
+
} else {
|
|
12195
|
+
const cellsForThisRow = this.selectedRowsToColumns.get(rowId);
|
|
12196
|
+
if (cellsForThisRow == null ? void 0 : cellsForThisRow.has(colId)) {
|
|
12197
|
+
this.setCellInSelection(rowId, colId, false);
|
|
12198
|
+
}
|
|
12199
|
+
const selectedColumnsForWildcardRow = this.selectedRowsToColumns.get(
|
|
12200
|
+
this.wildcard
|
|
12201
|
+
);
|
|
12202
|
+
const selectedRowsForWildcardColumn = this.selectedColumnsToRows.get(
|
|
12203
|
+
this.wildcard
|
|
12204
|
+
);
|
|
12205
|
+
if ((selectedColumnsForWildcardRow == null ? void 0 : selectedColumnsForWildcardRow.has(colId)) || (selectedRowsForWildcardColumn == null ? void 0 : selectedRowsForWildcardColumn.has(rowId))) {
|
|
12206
|
+
this.setCellInDeselection(rowId, colId, true);
|
|
12207
|
+
return;
|
|
12208
|
+
}
|
|
12209
|
+
}
|
|
12210
|
+
}
|
|
12211
|
+
}
|
|
12212
|
+
setCellInDeselection(rowId, colId, selected) {
|
|
12213
|
+
if (selected) {
|
|
12214
|
+
const deselectedColsForRow = this.deselectedRowsToColumns.get(rowId) || /* @__PURE__ */ new Set();
|
|
12215
|
+
deselectedColsForRow.add(colId);
|
|
12216
|
+
this.deselectedRowsToColumns.set(rowId, deselectedColsForRow);
|
|
12217
|
+
} else {
|
|
12218
|
+
const deselectedColsForRow = this.deselectedRowsToColumns.get(rowId);
|
|
12219
|
+
if (deselectedColsForRow) {
|
|
12220
|
+
deselectedColsForRow.delete(colId);
|
|
12221
|
+
if (deselectedColsForRow.size === 0) {
|
|
12222
|
+
this.deselectedRowsToColumns.delete(rowId);
|
|
12223
|
+
}
|
|
12224
|
+
}
|
|
12225
|
+
}
|
|
12226
|
+
if (selected) {
|
|
12227
|
+
const deselectedRowsForColumn = this.deselectedColumnsToRows.get(colId) || /* @__PURE__ */ new Set();
|
|
12228
|
+
deselectedRowsForColumn.add(rowId);
|
|
12229
|
+
this.deselectedColumnsToRows.set(colId, deselectedRowsForColumn);
|
|
12230
|
+
} else {
|
|
12231
|
+
const deselectedRowsForColumn = this.deselectedColumnsToRows.get(colId);
|
|
12232
|
+
if (deselectedRowsForColumn) {
|
|
12233
|
+
deselectedRowsForColumn.delete(rowId);
|
|
12234
|
+
if (deselectedRowsForColumn.size === 0) {
|
|
12235
|
+
this.deselectedColumnsToRows.delete(colId);
|
|
12236
|
+
}
|
|
12237
|
+
}
|
|
12238
|
+
}
|
|
12239
|
+
}
|
|
12240
|
+
setCellInSelection(rowId, colId, selected) {
|
|
12241
|
+
if (selected) {
|
|
12242
|
+
const selectedColsForRow = this.selectedRowsToColumns.get(rowId) || /* @__PURE__ */ new Set();
|
|
12243
|
+
selectedColsForRow.add(colId);
|
|
12244
|
+
this.selectedRowsToColumns.set(rowId, selectedColsForRow);
|
|
12245
|
+
} else {
|
|
12246
|
+
const selectedColsForRow = this.selectedRowsToColumns.get(rowId);
|
|
12247
|
+
if (selectedColsForRow) {
|
|
12248
|
+
selectedColsForRow.delete(colId);
|
|
12249
|
+
if (selectedColsForRow.size === 0) {
|
|
12250
|
+
this.selectedRowsToColumns.delete(rowId);
|
|
12251
|
+
}
|
|
12252
|
+
}
|
|
12253
|
+
}
|
|
12254
|
+
if (selected) {
|
|
12255
|
+
const selectedRowsForColumn = this.selectedColumnsToRows.get(colId) || /* @__PURE__ */ new Set();
|
|
12256
|
+
selectedRowsForColumn.add(rowId);
|
|
12257
|
+
this.selectedColumnsToRows.set(colId, selectedRowsForColumn);
|
|
12258
|
+
} else {
|
|
12259
|
+
const selectedRowsForColumn = this.selectedColumnsToRows.get(colId);
|
|
12260
|
+
if (selectedRowsForColumn) {
|
|
12261
|
+
selectedRowsForColumn.delete(rowId);
|
|
12262
|
+
if (selectedRowsForColumn.size === 0) {
|
|
12263
|
+
this.selectedColumnsToRows.delete(colId);
|
|
12264
|
+
}
|
|
12265
|
+
}
|
|
12266
|
+
}
|
|
12267
|
+
}
|
|
12268
|
+
update(stateObject) {
|
|
12269
|
+
const selectedCells = stateObject.selectedCells || null;
|
|
12270
|
+
const deselectedCells = stateObject.deselectedCells || null;
|
|
12271
|
+
this.selectedRowsToColumns.clear();
|
|
12272
|
+
this.selectedColumnsToRows.clear();
|
|
12273
|
+
this.deselectedRowsToColumns.clear();
|
|
12274
|
+
this.deselectedColumnsToRows.clear();
|
|
12275
|
+
this.cache.clear();
|
|
12276
|
+
if (selectedCells) {
|
|
12277
|
+
selectedCells.forEach(([rowId, colId]) => {
|
|
12278
|
+
this.setCellInSelection(rowId, colId, true);
|
|
12279
|
+
});
|
|
12280
|
+
}
|
|
12281
|
+
if (deselectedCells) {
|
|
12282
|
+
deselectedCells.forEach(([rowId, colId]) => {
|
|
12283
|
+
this.setCellInDeselection(rowId, colId, true);
|
|
12284
|
+
});
|
|
12285
|
+
}
|
|
12286
|
+
this.defaultSelection = stateObject.defaultSelection;
|
|
12287
|
+
}
|
|
12288
|
+
isCellSelected(rowId, colId) {
|
|
12289
|
+
var _a, _b;
|
|
12290
|
+
const cacheKey = [rowId, colId];
|
|
12291
|
+
const { cache } = this;
|
|
12292
|
+
const selected = cache.get(cacheKey);
|
|
12293
|
+
if (selected != null) {
|
|
12294
|
+
return selected;
|
|
12295
|
+
}
|
|
12296
|
+
const returnFalse3 = () => {
|
|
12297
|
+
cache.set(cacheKey, false);
|
|
12298
|
+
return false;
|
|
12299
|
+
};
|
|
12300
|
+
const returnTrue = () => {
|
|
12301
|
+
cache.set(cacheKey, true);
|
|
12302
|
+
return true;
|
|
12303
|
+
};
|
|
12304
|
+
const deselectedRowsForWildcardColumn = this.deselectedColumnsToRows.get(
|
|
12305
|
+
this.wildcard
|
|
12306
|
+
);
|
|
12307
|
+
const deselectedColumnsForWildcardRow = this.deselectedRowsToColumns.get(
|
|
12308
|
+
this.wildcard
|
|
12309
|
+
);
|
|
12310
|
+
const selectedRowsForWildcardColumn = this.selectedColumnsToRows.get(
|
|
12311
|
+
this.wildcard
|
|
12312
|
+
);
|
|
12313
|
+
const selectedColumnsForWildcardRow = this.selectedRowsToColumns.get(
|
|
12314
|
+
this.wildcard
|
|
12315
|
+
);
|
|
12316
|
+
let defaultSelection = this.defaultSelection;
|
|
12317
|
+
if (defaultSelection) {
|
|
12318
|
+
const cols2 = this.deselectedRowsToColumns.get(rowId);
|
|
12319
|
+
if (cols2 && cols2.has(colId)) {
|
|
12320
|
+
return returnFalse3();
|
|
12321
|
+
}
|
|
12322
|
+
if ((deselectedRowsForWildcardColumn == null ? void 0 : deselectedRowsForWildcardColumn.has(rowId)) || (deselectedColumnsForWildcardRow == null ? void 0 : deselectedColumnsForWildcardRow.has(colId))) {
|
|
12323
|
+
if ((_a = this.selectedRowsToColumns.get(rowId)) == null ? void 0 : _a.has(colId)) {
|
|
12324
|
+
return returnTrue();
|
|
12325
|
+
}
|
|
12326
|
+
return returnFalse3();
|
|
12327
|
+
}
|
|
12328
|
+
return returnTrue();
|
|
12329
|
+
}
|
|
12330
|
+
const cols = this.selectedRowsToColumns.get(rowId);
|
|
12331
|
+
if (cols && cols.has(colId)) {
|
|
12332
|
+
return returnTrue();
|
|
12333
|
+
}
|
|
12334
|
+
if ((selectedRowsForWildcardColumn == null ? void 0 : selectedRowsForWildcardColumn.has(rowId)) || (selectedColumnsForWildcardRow == null ? void 0 : selectedColumnsForWildcardRow.has(colId))) {
|
|
12335
|
+
if ((_b = this.deselectedRowsToColumns.get(rowId)) == null ? void 0 : _b.has(colId)) {
|
|
12336
|
+
return returnFalse3();
|
|
12337
|
+
}
|
|
12338
|
+
return returnTrue();
|
|
12339
|
+
}
|
|
12340
|
+
return returnFalse3();
|
|
12341
|
+
}
|
|
12342
|
+
getState() {
|
|
12343
|
+
const deselectedCells = [];
|
|
12344
|
+
const selectedCells = [];
|
|
12345
|
+
this.deselectedRowsToColumns.forEach((cols, rowId) => {
|
|
12346
|
+
cols.forEach((colId) => {
|
|
12347
|
+
deselectedCells.push([rowId, colId]);
|
|
12348
|
+
});
|
|
12349
|
+
});
|
|
12350
|
+
this.selectedRowsToColumns.forEach((cols, rowId) => {
|
|
12351
|
+
cols.forEach((colId) => {
|
|
12352
|
+
selectedCells.push([rowId, colId]);
|
|
12353
|
+
});
|
|
12354
|
+
});
|
|
12355
|
+
return {
|
|
12356
|
+
defaultSelection: this.defaultSelection,
|
|
12357
|
+
deselectedCells,
|
|
12358
|
+
selectedCells
|
|
12359
|
+
};
|
|
12360
|
+
}
|
|
12361
|
+
};
|
|
12362
|
+
|
|
12032
12363
|
// src/components/DataSource/RowSelectionState.ts
|
|
12033
12364
|
var RowSelectionState = class {
|
|
12034
12365
|
constructor(state, getConfig, _forTestingOnly) {
|
|
@@ -12590,7 +12921,10 @@ var haveDepsChanged = (state1, state2, deps) => {
|
|
|
12590
12921
|
}
|
|
12591
12922
|
return false;
|
|
12592
12923
|
};
|
|
12593
|
-
function
|
|
12924
|
+
function returnFalse2() {
|
|
12925
|
+
return false;
|
|
12926
|
+
}
|
|
12927
|
+
function toRowInfo(data, id, index, isRowSelected, cellSelectionState) {
|
|
12594
12928
|
const rowInfo = {
|
|
12595
12929
|
dataSourceHasGrouping: false,
|
|
12596
12930
|
data,
|
|
@@ -12598,11 +12932,17 @@ function toRowInfo(data, id, index, isRowSelected) {
|
|
|
12598
12932
|
indexInAll: index,
|
|
12599
12933
|
isGroupRow: false,
|
|
12600
12934
|
selfLoaded: true,
|
|
12601
|
-
rowSelected: false
|
|
12935
|
+
rowSelected: false,
|
|
12936
|
+
isCellSelected: returnFalse2
|
|
12602
12937
|
};
|
|
12603
12938
|
if (isRowSelected) {
|
|
12604
12939
|
rowInfo.rowSelected = isRowSelected(rowInfo);
|
|
12605
12940
|
}
|
|
12941
|
+
if (cellSelectionState) {
|
|
12942
|
+
rowInfo.isCellSelected = (colId) => {
|
|
12943
|
+
return cellSelectionState.isCellSelected(rowInfo.id, colId);
|
|
12944
|
+
};
|
|
12945
|
+
}
|
|
12606
12946
|
return rowInfo;
|
|
12607
12947
|
}
|
|
12608
12948
|
function filterDataSource(params) {
|
|
@@ -12783,6 +13123,7 @@ function concludeReducer(params) {
|
|
|
12783
13123
|
state.postSortDataArray = dataArray;
|
|
12784
13124
|
let rowInfoDataArray = state.dataArray;
|
|
12785
13125
|
const rowSelectionState = state.rowSelection instanceof RowSelectionState ? state.rowSelection : void 0;
|
|
13126
|
+
const cellSelectionState = state.cellSelection instanceof CellSelectionState ? state.cellSelection : void 0;
|
|
12786
13127
|
rowSelectionState == null ? void 0 : rowSelectionState.xcache();
|
|
12787
13128
|
let isRowSelected = state.selectionMode === "single-row" ? (rowInfo) => {
|
|
12788
13129
|
return rowInfo.id === state.rowSelection;
|
|
@@ -12841,6 +13182,19 @@ function concludeReducer(params) {
|
|
|
12841
13182
|
reducerKeys: rowInfoReducerKeys,
|
|
12842
13183
|
rowInfo: {}
|
|
12843
13184
|
};
|
|
13185
|
+
const withRowInfoForReducers = rowInfoReducerResults ? (rowInfo) => {
|
|
13186
|
+
rowInfoReducersShape.rowInfo = rowInfo;
|
|
13187
|
+
computeRowInfoReducersFor(rowInfoReducersShape);
|
|
13188
|
+
} : void 0;
|
|
13189
|
+
const withRowInfoForCellSelection = cellSelectionState ? (rowInfo) => {
|
|
13190
|
+
rowInfo.isCellSelected = (colId) => {
|
|
13191
|
+
return cellSelectionState.isCellSelected(rowInfo.id, colId);
|
|
13192
|
+
};
|
|
13193
|
+
} : void 0;
|
|
13194
|
+
const withRowInfo = withRowInfoForReducers || withRowInfoForCellSelection ? composeFunctions(
|
|
13195
|
+
withRowInfoForReducers,
|
|
13196
|
+
withRowInfoForCellSelection
|
|
13197
|
+
) : void 0;
|
|
12844
13198
|
const flattenResult = enhancedFlatten({
|
|
12845
13199
|
groupResult,
|
|
12846
13200
|
lazyLoad: !!state.lazyLoad,
|
|
@@ -12848,10 +13202,7 @@ function concludeReducer(params) {
|
|
|
12848
13202
|
toPrimaryKey,
|
|
12849
13203
|
isRowSelected,
|
|
12850
13204
|
rowSelectionState,
|
|
12851
|
-
withRowInfo
|
|
12852
|
-
rowInfoReducersShape.rowInfo = rowInfo;
|
|
12853
|
-
computeRowInfoReducersFor(rowInfoReducersShape);
|
|
12854
|
-
} : void 0,
|
|
13205
|
+
withRowInfo,
|
|
12855
13206
|
groupRowsState: state.groupRowsState,
|
|
12856
13207
|
generateGroupRows: state.generateGroupRows
|
|
12857
13208
|
});
|
|
@@ -12901,7 +13252,8 @@ function concludeReducer(params) {
|
|
|
12901
13252
|
data,
|
|
12902
13253
|
data ? toPrimaryKey(data) : index,
|
|
12903
13254
|
index,
|
|
12904
|
-
isRowSelected
|
|
13255
|
+
isRowSelected,
|
|
13256
|
+
cellSelectionState
|
|
12905
13257
|
);
|
|
12906
13258
|
if (rowInfoReducerResults) {
|
|
12907
13259
|
rowInfoReducersShape.rowInfo = rowInfo;
|
|
@@ -13775,7 +14127,9 @@ function deriveStateFromProps(params) {
|
|
|
13775
14127
|
}
|
|
13776
14128
|
}
|
|
13777
14129
|
let rowSelectionState = null;
|
|
14130
|
+
let cellSelectionState = null;
|
|
13778
14131
|
let currentRowSelection = props.rowSelection !== void 0 ? props.rowSelection : state.rowSelection === void 0 ? props.defaultRowSelection !== void 0 ? props.defaultRowSelection : null : state.rowSelection;
|
|
14132
|
+
let currentCellSelection = props.cellSelection !== void 0 ? props.cellSelection : state.cellSelection === void 0 ? props.defaultCellSelection !== void 0 ? props.defaultCellSelection : null : state.cellSelection || null;
|
|
13779
14133
|
if (selectionMode !== false) {
|
|
13780
14134
|
if (selectionMode === "single-row" || selectionMode === "multi-row") {
|
|
13781
14135
|
if (currentRowSelection === null) {
|
|
@@ -13794,6 +14148,15 @@ function deriveStateFromProps(params) {
|
|
|
13794
14148
|
);
|
|
13795
14149
|
}
|
|
13796
14150
|
}
|
|
14151
|
+
if (selectionMode === "single-cell" || selectionMode === "multi-cell") {
|
|
14152
|
+
if (currentCellSelection === null) {
|
|
14153
|
+
cellSelectionState = selectionMode === "single-cell" ? null : new CellSelectionState();
|
|
14154
|
+
} else {
|
|
14155
|
+
cellSelectionState = currentCellSelection instanceof CellSelectionState ? currentCellSelection : new CellSelectionState(
|
|
14156
|
+
currentCellSelection
|
|
14157
|
+
);
|
|
14158
|
+
}
|
|
14159
|
+
}
|
|
13797
14160
|
}
|
|
13798
14161
|
const primaryKeyDescriptor = state.primaryKey;
|
|
13799
14162
|
const toPrimaryKey = typeof primaryKeyDescriptor === "function" ? (data) => primaryKeyDescriptor(data) : (data) => data[primaryKeyDescriptor];
|
|
@@ -13810,8 +14173,8 @@ function deriveStateFromProps(params) {
|
|
|
13810
14173
|
const result = {
|
|
13811
14174
|
selectionMode,
|
|
13812
14175
|
groupRowsState,
|
|
13813
|
-
// for whatever reason I had to do this cast to appease TS
|
|
13814
14176
|
rowSelection: rowSelectionState,
|
|
14177
|
+
cellSelection: cellSelectionState,
|
|
13815
14178
|
toPrimaryKey,
|
|
13816
14179
|
operatorsByFilterType,
|
|
13817
14180
|
controlledSort,
|
|
@@ -13863,6 +14226,22 @@ function getMappedCallbacks() {
|
|
|
13863
14226
|
"multi-row"
|
|
13864
14227
|
]
|
|
13865
14228
|
};
|
|
14229
|
+
},
|
|
14230
|
+
cellSelection: (cellSelection, state) => {
|
|
14231
|
+
if (state.selectionMode === "single-cell") {
|
|
14232
|
+
return {
|
|
14233
|
+
callbackParams: [
|
|
14234
|
+
cellSelection instanceof CellSelectionState ? cellSelection.getState().selectedCells : null,
|
|
14235
|
+
"single-cell"
|
|
14236
|
+
]
|
|
14237
|
+
};
|
|
14238
|
+
}
|
|
14239
|
+
return {
|
|
14240
|
+
callbackParams: [
|
|
14241
|
+
cellSelection.getState(),
|
|
14242
|
+
"multi-cell"
|
|
14243
|
+
]
|
|
14244
|
+
};
|
|
13866
14245
|
}
|
|
13867
14246
|
};
|
|
13868
14247
|
}
|
|
@@ -14079,6 +14458,136 @@ function notNullable(value) {
|
|
|
14079
14458
|
return true;
|
|
14080
14459
|
}
|
|
14081
14460
|
|
|
14461
|
+
// src/components/InfiniteTable/api/getCellSelectionApi.ts
|
|
14462
|
+
function ensureMinMaxCellPositionByIndex(start, end) {
|
|
14463
|
+
let { rowIndex: startRowIndex, colIndex: startColIndex } = start;
|
|
14464
|
+
let { rowIndex: endRowIndex, colIndex: endColIndex } = end;
|
|
14465
|
+
const [colStart, colEnd] = startColIndex > endColIndex ? [endColIndex, startColIndex] : [startColIndex, endColIndex];
|
|
14466
|
+
const [rowStart, rowEnd] = startRowIndex > endRowIndex ? [endRowIndex, startRowIndex] : [startRowIndex, endRowIndex];
|
|
14467
|
+
return [
|
|
14468
|
+
{ rowIndex: rowStart, colIndex: colStart },
|
|
14469
|
+
{ rowIndex: rowEnd, colIndex: colEnd }
|
|
14470
|
+
];
|
|
14471
|
+
}
|
|
14472
|
+
function getCellSelectionApi(param) {
|
|
14473
|
+
const {
|
|
14474
|
+
getComputed,
|
|
14475
|
+
// getState,
|
|
14476
|
+
getDataSourceState,
|
|
14477
|
+
// componentActions,
|
|
14478
|
+
dataSourceActions
|
|
14479
|
+
} = param;
|
|
14480
|
+
const getCellSelectionPosition = (options) => {
|
|
14481
|
+
var _a, _b, _c;
|
|
14482
|
+
const rowId = (_b = options.rowId) != null ? _b : (_a = getRowInfoAt(options.rowIndex, getDataSourceState)) == null ? void 0 : _a.id;
|
|
14483
|
+
const colId = (_c = options.colId) != null ? _c : getComputed().computedVisibleColumns[options.colIndex].id;
|
|
14484
|
+
return [rowId, colId];
|
|
14485
|
+
};
|
|
14486
|
+
const cellSelectionApi = {
|
|
14487
|
+
deselectAll: () => {
|
|
14488
|
+
const dataSourceState = getDataSourceState();
|
|
14489
|
+
const cellSelection = dataSourceState.cellSelection;
|
|
14490
|
+
if (!cellSelection) {
|
|
14491
|
+
return;
|
|
14492
|
+
}
|
|
14493
|
+
const newCellSelection = new CellSelectionState(cellSelection);
|
|
14494
|
+
newCellSelection.deselectAll();
|
|
14495
|
+
dataSourceActions.cellSelection = newCellSelection;
|
|
14496
|
+
},
|
|
14497
|
+
clear: () => {
|
|
14498
|
+
cellSelectionApi.deselectAll();
|
|
14499
|
+
},
|
|
14500
|
+
selectAll: () => {
|
|
14501
|
+
const dataSourceState = getDataSourceState();
|
|
14502
|
+
const cellSelection = dataSourceState.cellSelection;
|
|
14503
|
+
if (!cellSelection) {
|
|
14504
|
+
return;
|
|
14505
|
+
}
|
|
14506
|
+
const newCellSelection = new CellSelectionState(cellSelection);
|
|
14507
|
+
newCellSelection.selectAll();
|
|
14508
|
+
dataSourceActions.cellSelection = newCellSelection;
|
|
14509
|
+
},
|
|
14510
|
+
selectRange: (startOptions, endOptions) => {
|
|
14511
|
+
cellSelectionApi.setRangeSelected(startOptions, endOptions, true);
|
|
14512
|
+
},
|
|
14513
|
+
deselectRange: (startOptions, endOptions) => {
|
|
14514
|
+
cellSelectionApi.setRangeSelected(startOptions, endOptions, false);
|
|
14515
|
+
},
|
|
14516
|
+
setRangeSelected: (startOptions, endOptions, selected) => {
|
|
14517
|
+
const dataSourceState = getDataSourceState();
|
|
14518
|
+
const cellSelection = dataSourceState.cellSelection;
|
|
14519
|
+
if (!cellSelection) {
|
|
14520
|
+
return;
|
|
14521
|
+
}
|
|
14522
|
+
const newCellSelection = new CellSelectionState(cellSelection);
|
|
14523
|
+
const [startRowId, startColId] = getCellSelectionPosition(startOptions);
|
|
14524
|
+
const [endRowId, endColId] = getCellSelectionPosition(endOptions);
|
|
14525
|
+
const startCol = getComputed().computedVisibleColumnsMap.get(startColId);
|
|
14526
|
+
const endCol = getComputed().computedVisibleColumnsMap.get(endColId);
|
|
14527
|
+
if (!startCol || !endCol) {
|
|
14528
|
+
return;
|
|
14529
|
+
}
|
|
14530
|
+
const startColIndex = startCol.computedVisibleIndex;
|
|
14531
|
+
const endColIndex = endCol.computedVisibleIndex;
|
|
14532
|
+
const startRowInfo = getRowInfoAt(startRowId, getDataSourceState);
|
|
14533
|
+
const endRowInfo = getRowInfoAt(endRowId, getDataSourceState);
|
|
14534
|
+
if (!startRowInfo || !endRowInfo) {
|
|
14535
|
+
return;
|
|
14536
|
+
}
|
|
14537
|
+
const startRowIndex = startRowInfo.indexInAll;
|
|
14538
|
+
const endRowIndex = endRowInfo.indexInAll;
|
|
14539
|
+
const [start, end] = ensureMinMaxCellPositionByIndex(
|
|
14540
|
+
{ rowIndex: startRowIndex, colIndex: startColIndex },
|
|
14541
|
+
{ rowIndex: endRowIndex, colIndex: endColIndex }
|
|
14542
|
+
);
|
|
14543
|
+
for (let i = start.rowIndex; i <= end.rowIndex; i++) {
|
|
14544
|
+
for (let j = start.colIndex; j <= end.colIndex; j++) {
|
|
14545
|
+
const pos = {
|
|
14546
|
+
rowIndex: i,
|
|
14547
|
+
colIndex: j
|
|
14548
|
+
};
|
|
14549
|
+
const [pk, colId] = getCellSelectionPosition(pos);
|
|
14550
|
+
if (selected) {
|
|
14551
|
+
newCellSelection.selectCell(pk, colId);
|
|
14552
|
+
} else {
|
|
14553
|
+
newCellSelection.deselectCell(pk, colId);
|
|
14554
|
+
}
|
|
14555
|
+
}
|
|
14556
|
+
}
|
|
14557
|
+
dataSourceActions.cellSelection = newCellSelection;
|
|
14558
|
+
},
|
|
14559
|
+
isCellSelected: (options) => {
|
|
14560
|
+
var _a, _b;
|
|
14561
|
+
const [pk, colId] = getCellSelectionPosition(options);
|
|
14562
|
+
return (_b = (_a = getDataSourceState().cellSelection) == null ? void 0 : _a.isCellSelected(pk, colId)) != null ? _b : false;
|
|
14563
|
+
},
|
|
14564
|
+
selectCell: (options) => {
|
|
14565
|
+
const cellSelection = getDataSourceState().cellSelection;
|
|
14566
|
+
if (!cellSelection) {
|
|
14567
|
+
return;
|
|
14568
|
+
}
|
|
14569
|
+
const [pk, colId] = getCellSelectionPosition(options);
|
|
14570
|
+
const newCellSelection = options.clear ? new CellSelectionState() : new CellSelectionState(cellSelection);
|
|
14571
|
+
newCellSelection.selectCell(pk, colId);
|
|
14572
|
+
dataSourceActions.cellSelection = newCellSelection;
|
|
14573
|
+
},
|
|
14574
|
+
deselectCell: (options) => {
|
|
14575
|
+
const cellSelection = getDataSourceState().cellSelection;
|
|
14576
|
+
if (!cellSelection) {
|
|
14577
|
+
return;
|
|
14578
|
+
}
|
|
14579
|
+
const [pk, colId] = getCellSelectionPosition(options);
|
|
14580
|
+
const newCellSelection = new CellSelectionState(cellSelection);
|
|
14581
|
+
newCellSelection.deselectCell(pk, colId);
|
|
14582
|
+
dataSourceActions.cellSelection = newCellSelection;
|
|
14583
|
+
}
|
|
14584
|
+
};
|
|
14585
|
+
if (false) {
|
|
14586
|
+
globalThis.cellSelectionApi = cellSelectionApi;
|
|
14587
|
+
}
|
|
14588
|
+
return cellSelectionApi;
|
|
14589
|
+
}
|
|
14590
|
+
|
|
14082
14591
|
// src/components/InfiniteTable/api/getImperativeApi.ts
|
|
14083
14592
|
function isSortInfoForColumn(sortInfo, col) {
|
|
14084
14593
|
if (sortInfo.id) {
|
|
@@ -14463,10 +14972,15 @@ var InfiniteTableApiImpl = class {
|
|
|
14463
14972
|
return true;
|
|
14464
14973
|
};
|
|
14465
14974
|
this.context = context;
|
|
14466
|
-
this.
|
|
14975
|
+
this.rowSelectionApi = getRowSelectionApi({
|
|
14467
14976
|
dataSourceActions: context.dataSourceActions,
|
|
14468
14977
|
getDataSourceState: context.getDataSourceState
|
|
14469
14978
|
});
|
|
14979
|
+
this.cellSelectionApi = getCellSelectionApi({
|
|
14980
|
+
dataSourceActions: context.dataSourceActions,
|
|
14981
|
+
getDataSourceState: context.getDataSourceState,
|
|
14982
|
+
getComputed: context.getComputed
|
|
14983
|
+
});
|
|
14470
14984
|
}
|
|
14471
14985
|
get actions() {
|
|
14472
14986
|
return this.context.actions;
|
|
@@ -15074,6 +15588,8 @@ function useCellRendering(param) {
|
|
|
15074
15588
|
groupRenderStrategy,
|
|
15075
15589
|
brain,
|
|
15076
15590
|
showZebraRows,
|
|
15591
|
+
cellClassName,
|
|
15592
|
+
cellStyle,
|
|
15077
15593
|
rowStyle,
|
|
15078
15594
|
rowClassName,
|
|
15079
15595
|
onScrollToTop,
|
|
@@ -15180,7 +15696,9 @@ function useCellRendering(param) {
|
|
|
15180
15696
|
columnsMap: computedColumnsMap,
|
|
15181
15697
|
fieldsToColumn,
|
|
15182
15698
|
rowStyle,
|
|
15183
|
-
rowClassName
|
|
15699
|
+
rowClassName,
|
|
15700
|
+
cellStyle,
|
|
15701
|
+
cellClassName
|
|
15184
15702
|
};
|
|
15185
15703
|
return /* @__PURE__ */ React51.createElement(InfiniteTableColumnCell, __spreadValues({}, cellProps));
|
|
15186
15704
|
},
|
|
@@ -15195,7 +15713,9 @@ function useCellRendering(param) {
|
|
|
15195
15713
|
showZebraRows,
|
|
15196
15714
|
repaintId,
|
|
15197
15715
|
rowStyle,
|
|
15198
|
-
rowClassName
|
|
15716
|
+
rowClassName,
|
|
15717
|
+
cellClassName,
|
|
15718
|
+
cellStyle
|
|
15199
15719
|
]
|
|
15200
15720
|
);
|
|
15201
15721
|
return {
|
|
@@ -15207,6 +15727,118 @@ function useCellRendering(param) {
|
|
|
15207
15727
|
// src/components/InfiniteTable/hooks/useComputed.ts
|
|
15208
15728
|
var import_react48 = require("react");
|
|
15209
15729
|
|
|
15730
|
+
// src/components/InfiniteTable/utils/MultiCellSelector.ts
|
|
15731
|
+
var MultiCellSelector = class {
|
|
15732
|
+
constructor(options) {
|
|
15733
|
+
this.multiSelectStartPosition = { rowIndex: 0, colIndex: 0 };
|
|
15734
|
+
this.getPrimaryKeyByIndex = options.getPrimaryKeyByIndex;
|
|
15735
|
+
this.getColumnIdByIndex = options.getColumnIdByIndex;
|
|
15736
|
+
}
|
|
15737
|
+
getCellSelectionPosition(position2) {
|
|
15738
|
+
const { rowIndex, colIndex } = position2;
|
|
15739
|
+
const rowId = this.getPrimaryKeyByIndex(rowIndex);
|
|
15740
|
+
const columnId = this.getColumnIdByIndex(colIndex);
|
|
15741
|
+
if (rowId === void 0 || !columnId) {
|
|
15742
|
+
return void 0;
|
|
15743
|
+
}
|
|
15744
|
+
return [rowId, columnId];
|
|
15745
|
+
}
|
|
15746
|
+
set cellSelectionState(cellSelectionState) {
|
|
15747
|
+
this._cellSelectionState = cellSelectionState;
|
|
15748
|
+
}
|
|
15749
|
+
get cellSelectionState() {
|
|
15750
|
+
return this._cellSelectionState;
|
|
15751
|
+
}
|
|
15752
|
+
/**
|
|
15753
|
+
* This is the single click, without any modifier
|
|
15754
|
+
*/
|
|
15755
|
+
resetClick(position2) {
|
|
15756
|
+
this.cellSelectionState.deselectAll();
|
|
15757
|
+
const cellSelectionPosition = this.getCellSelectionPosition(position2);
|
|
15758
|
+
if (!cellSelectionPosition) {
|
|
15759
|
+
return;
|
|
15760
|
+
}
|
|
15761
|
+
this.cellSelectionState.deselectAll();
|
|
15762
|
+
this.cellSelectionState.selectCell(...cellSelectionPosition);
|
|
15763
|
+
this.multiSelectStartPosition = position2;
|
|
15764
|
+
this.multiSelectEndPosition = void 0;
|
|
15765
|
+
}
|
|
15766
|
+
/**
|
|
15767
|
+
* This is the click with ctrl/cmd key pressed
|
|
15768
|
+
* @param position CellPosition
|
|
15769
|
+
*/
|
|
15770
|
+
singleAddClick(position2) {
|
|
15771
|
+
const cellSelectionPosition = this.getCellSelectionPosition(position2);
|
|
15772
|
+
if (!cellSelectionPosition) {
|
|
15773
|
+
return;
|
|
15774
|
+
}
|
|
15775
|
+
if (this.cellSelectionState.isCellSelected(...cellSelectionPosition)) {
|
|
15776
|
+
this.cellSelectionState.deselectCell(...cellSelectionPosition);
|
|
15777
|
+
const nextPos = {
|
|
15778
|
+
rowIndex: position2.rowIndex + 1,
|
|
15779
|
+
colIndex: position2.colIndex
|
|
15780
|
+
};
|
|
15781
|
+
if (this.getCellSelectionPosition(nextPos)) {
|
|
15782
|
+
this.multiSelectStartPosition = nextPos;
|
|
15783
|
+
}
|
|
15784
|
+
} else {
|
|
15785
|
+
this.cellSelectionState.selectCell(...cellSelectionPosition);
|
|
15786
|
+
this.multiSelectStartPosition = position2;
|
|
15787
|
+
this.multiSelectEndPosition = void 0;
|
|
15788
|
+
}
|
|
15789
|
+
}
|
|
15790
|
+
multiSelectClick(position2) {
|
|
15791
|
+
if (!this.multiSelectStartPosition) {
|
|
15792
|
+
return;
|
|
15793
|
+
}
|
|
15794
|
+
const cellSelectionPosition = this.getCellSelectionPosition(position2);
|
|
15795
|
+
if (!cellSelectionPosition) {
|
|
15796
|
+
return;
|
|
15797
|
+
}
|
|
15798
|
+
if (this.multiSelectEndPosition) {
|
|
15799
|
+
this.deselectRange(
|
|
15800
|
+
this.multiSelectStartPosition,
|
|
15801
|
+
this.multiSelectEndPosition
|
|
15802
|
+
);
|
|
15803
|
+
}
|
|
15804
|
+
this.selectRange(this.multiSelectStartPosition, position2);
|
|
15805
|
+
this.multiSelectEndPosition = position2;
|
|
15806
|
+
}
|
|
15807
|
+
setRangeSelected(startPosition, endPosition, selected) {
|
|
15808
|
+
const [start, end] = ensureMinMaxCellPositionByIndex(
|
|
15809
|
+
startPosition,
|
|
15810
|
+
endPosition
|
|
15811
|
+
);
|
|
15812
|
+
const startSelectionPosition = this.getCellSelectionPosition(start);
|
|
15813
|
+
const endSelectionPosition = this.getCellSelectionPosition(end);
|
|
15814
|
+
if (!startSelectionPosition || !endSelectionPosition) {
|
|
15815
|
+
return;
|
|
15816
|
+
}
|
|
15817
|
+
for (let i = start.rowIndex; i <= end.rowIndex; i++) {
|
|
15818
|
+
for (let j = start.colIndex; j <= end.colIndex; j++) {
|
|
15819
|
+
const selectionPosition = this.getCellSelectionPosition({
|
|
15820
|
+
rowIndex: i,
|
|
15821
|
+
colIndex: j
|
|
15822
|
+
});
|
|
15823
|
+
if (!selectionPosition) {
|
|
15824
|
+
continue;
|
|
15825
|
+
}
|
|
15826
|
+
if (selected) {
|
|
15827
|
+
this.cellSelectionState.selectCell(...selectionPosition);
|
|
15828
|
+
} else {
|
|
15829
|
+
this.cellSelectionState.deselectCell(...selectionPosition);
|
|
15830
|
+
}
|
|
15831
|
+
}
|
|
15832
|
+
}
|
|
15833
|
+
}
|
|
15834
|
+
deselectRange(startPosition, endPosition) {
|
|
15835
|
+
this.setRangeSelected(startPosition, endPosition, false);
|
|
15836
|
+
}
|
|
15837
|
+
selectRange(startPosition, endPosition) {
|
|
15838
|
+
this.setRangeSelected(startPosition, endPosition, true);
|
|
15839
|
+
}
|
|
15840
|
+
};
|
|
15841
|
+
|
|
15210
15842
|
// src/components/InfiniteTable/utils/MultiRowSelector.ts
|
|
15211
15843
|
function ensureMinMax(start, end) {
|
|
15212
15844
|
return start < end ? [start, end] : [end, start];
|
|
@@ -15642,8 +16274,10 @@ var forwardProps4 = (setupState) => {
|
|
|
15642
16274
|
columnDefaultFilterable: 1,
|
|
15643
16275
|
columnDefaultSortable: 1,
|
|
15644
16276
|
rowStyle: 1,
|
|
16277
|
+
cellStyle: 1,
|
|
15645
16278
|
rowProps: 1,
|
|
15646
16279
|
rowClassName: 1,
|
|
16280
|
+
cellClassName: 1,
|
|
15647
16281
|
pinnedStartMaxWidth: 1,
|
|
15648
16282
|
pinnedEndMaxWidth: 1,
|
|
15649
16283
|
pivotColumn: 1,
|
|
@@ -16501,7 +17135,8 @@ function useComputed() {
|
|
|
16501
17135
|
const {
|
|
16502
17136
|
componentActions: dataSourceActions,
|
|
16503
17137
|
componentState: dataSourceState,
|
|
16504
|
-
getState: getDataSourceState
|
|
17138
|
+
getState: getDataSourceState,
|
|
17139
|
+
api: dataSourceApi
|
|
16505
17140
|
} = useDataSourceContextValue();
|
|
16506
17141
|
const {
|
|
16507
17142
|
columnOrder,
|
|
@@ -16604,8 +17239,19 @@ function useComputed() {
|
|
|
16604
17239
|
});
|
|
16605
17240
|
return multiRowSelector2;
|
|
16606
17241
|
});
|
|
17242
|
+
const getComputedVisibleColumns = useLatest(computedVisibleColumns);
|
|
17243
|
+
const [multiCellSelector] = (0, import_react48.useState)(() => {
|
|
17244
|
+
return new MultiCellSelector({
|
|
17245
|
+
getPrimaryKeyByIndex: dataSourceApi.getPrimaryKeyByIndex,
|
|
17246
|
+
getColumnIdByIndex: (colIndex) => {
|
|
17247
|
+
var _a2;
|
|
17248
|
+
return ((_a2 = getComputedVisibleColumns()[colIndex]) == null ? void 0 : _a2.id) || "";
|
|
17249
|
+
}
|
|
17250
|
+
});
|
|
17251
|
+
});
|
|
16607
17252
|
return {
|
|
16608
17253
|
multiRowSelector,
|
|
17254
|
+
multiCellSelector,
|
|
16609
17255
|
scrollbars,
|
|
16610
17256
|
columnSize,
|
|
16611
17257
|
rowspan,
|
|
@@ -16807,7 +17453,7 @@ var useLicense = (licenseKey = "") => {
|
|
|
16807
17453
|
const valid = (0, import_react49.useMemo)(() => {
|
|
16808
17454
|
let valid2 = isValidLicense(licenseKey, {
|
|
16809
17455
|
publishedAt: 1624970570587,
|
|
16810
|
-
version: "
|
|
17456
|
+
version: "3.0.0"
|
|
16811
17457
|
});
|
|
16812
17458
|
if (!licenseKey && !valid2 && isInsidePlayground) {
|
|
16813
17459
|
return true;
|
|
@@ -16903,6 +17549,7 @@ var import_react52 = require("react");
|
|
|
16903
17549
|
function onCellClick(context, event) {
|
|
16904
17550
|
var _a, _b;
|
|
16905
17551
|
updateRowSelectionOnCellClick(context, event);
|
|
17552
|
+
updateCellSelectionOnCellClick(context, event);
|
|
16906
17553
|
if (event.detail === 2) {
|
|
16907
17554
|
onCellDoubleClick(context, event);
|
|
16908
17555
|
}
|
|
@@ -16916,6 +17563,38 @@ function onCellDoubleClick(context, _event) {
|
|
|
16916
17563
|
columnId: column.id
|
|
16917
17564
|
});
|
|
16918
17565
|
}
|
|
17566
|
+
function updateCellSelectionOnCellClick(context, event) {
|
|
17567
|
+
const {
|
|
17568
|
+
getDataSourceState,
|
|
17569
|
+
getComputed,
|
|
17570
|
+
rowIndex,
|
|
17571
|
+
colIndex,
|
|
17572
|
+
dataSourceActions
|
|
17573
|
+
} = context;
|
|
17574
|
+
const dataSourceState = getDataSourceState();
|
|
17575
|
+
const { selectionMode, cellSelection: existingCellSelection } = dataSourceState;
|
|
17576
|
+
if (!existingCellSelection) {
|
|
17577
|
+
return;
|
|
17578
|
+
}
|
|
17579
|
+
if (selectionMode !== "multi-cell") {
|
|
17580
|
+
return;
|
|
17581
|
+
}
|
|
17582
|
+
const { multiCellSelector } = getComputed();
|
|
17583
|
+
const cellSelection = new CellSelectionState(existingCellSelection);
|
|
17584
|
+
multiCellSelector.cellSelectionState = cellSelection;
|
|
17585
|
+
const position2 = {
|
|
17586
|
+
rowIndex,
|
|
17587
|
+
colIndex
|
|
17588
|
+
};
|
|
17589
|
+
if (event.metaKey || event.ctrlKey) {
|
|
17590
|
+
multiCellSelector.singleAddClick(position2);
|
|
17591
|
+
} else if (event.shiftKey) {
|
|
17592
|
+
multiCellSelector.multiSelectClick(position2);
|
|
17593
|
+
} else {
|
|
17594
|
+
multiCellSelector.resetClick(position2);
|
|
17595
|
+
}
|
|
17596
|
+
dataSourceActions.cellSelection = cellSelection;
|
|
17597
|
+
}
|
|
16919
17598
|
function updateRowSelectionOnCellClick(context, event) {
|
|
16920
17599
|
const {
|
|
16921
17600
|
rowIndex,
|
|
@@ -16954,14 +17633,24 @@ function updateRowSelectionOnCellClick(context, event) {
|
|
|
16954
17633
|
} else if (selectionMode === "single-row") {
|
|
16955
17634
|
const id = dataArray[rowIndex].id;
|
|
16956
17635
|
if (event.metaKey || event.ctrlKey) {
|
|
16957
|
-
api.
|
|
17636
|
+
api.rowSelectionApi.toggleRowSelection(id);
|
|
16958
17637
|
} else {
|
|
16959
|
-
api.
|
|
17638
|
+
api.rowSelectionApi.selectRow(id);
|
|
16960
17639
|
}
|
|
16961
17640
|
}
|
|
16962
17641
|
return false;
|
|
16963
17642
|
}
|
|
16964
17643
|
|
|
17644
|
+
// src/components/InfiniteTable/eventHandlers/onCellMouseDown.ts
|
|
17645
|
+
function onCellMouseDown(context, event) {
|
|
17646
|
+
if (event.detail === 2) {
|
|
17647
|
+
return;
|
|
17648
|
+
}
|
|
17649
|
+
updateCellSelectionOnCellMouseDown(context);
|
|
17650
|
+
}
|
|
17651
|
+
function updateCellSelectionOnCellMouseDown(_context) {
|
|
17652
|
+
}
|
|
17653
|
+
|
|
16965
17654
|
// src/components/utils/clamp.ts
|
|
16966
17655
|
function clamp(value, min, max) {
|
|
16967
17656
|
return Math.min(Math.max(value, min), max);
|
|
@@ -17216,7 +17905,7 @@ function handleKeyboardSelection(context, keyboardEvent) {
|
|
|
17216
17905
|
return false;
|
|
17217
17906
|
}
|
|
17218
17907
|
if (selectionMode === "single-row" && key === " ") {
|
|
17219
|
-
imperativeApi.
|
|
17908
|
+
imperativeApi.rowSelectionApi.toggleRowSelection(rowInfo.id);
|
|
17220
17909
|
return true;
|
|
17221
17910
|
}
|
|
17222
17911
|
if (selectionMode !== "multi-row") {
|
|
@@ -17233,9 +17922,11 @@ function handleKeyboardSelection(context, keyboardEvent) {
|
|
|
17233
17922
|
if (key === " ") {
|
|
17234
17923
|
if (groupBy.length) {
|
|
17235
17924
|
if (rowInfo.isGroupRow && rowInfo.groupKeys) {
|
|
17236
|
-
imperativeApi.
|
|
17925
|
+
imperativeApi.rowSelectionApi.toggleGroupRowSelection(
|
|
17926
|
+
rowInfo.groupKeys
|
|
17927
|
+
);
|
|
17237
17928
|
} else {
|
|
17238
|
-
imperativeApi.
|
|
17929
|
+
imperativeApi.rowSelectionApi.toggleRowSelection(rowInfo.id);
|
|
17239
17930
|
}
|
|
17240
17931
|
return true;
|
|
17241
17932
|
} else {
|
|
@@ -17620,9 +18311,23 @@ function handleDOMEvents() {
|
|
|
17620
18311
|
);
|
|
17621
18312
|
}
|
|
17622
18313
|
const removeOnCellClick = context.getState().cellClick.onChange(cellClickHandler);
|
|
18314
|
+
function cellMouseDownHandler(param) {
|
|
18315
|
+
if (!param) {
|
|
18316
|
+
return;
|
|
18317
|
+
}
|
|
18318
|
+
const { event, rowIndex, colIndex } = param;
|
|
18319
|
+
const column = context.getComputed().computedVisibleColumns[colIndex];
|
|
18320
|
+
const columnApi = getColumnApiForColumn(column.id, context);
|
|
18321
|
+
onCellMouseDown(
|
|
18322
|
+
__spreadProps(__spreadValues({}, context), { rowIndex, colIndex, column, columnApi }),
|
|
18323
|
+
event
|
|
18324
|
+
);
|
|
18325
|
+
}
|
|
18326
|
+
const removeOnCellMouseDown = context.getState().cellMouseDown.onChange(cellMouseDownHandler);
|
|
17623
18327
|
return () => {
|
|
17624
18328
|
removeOnKeyDown();
|
|
17625
18329
|
removeOnCellClick();
|
|
18330
|
+
removeOnCellMouseDown();
|
|
17626
18331
|
};
|
|
17627
18332
|
}, []);
|
|
17628
18333
|
}
|
|
@@ -20295,18 +21000,6 @@ var InfiniteTableComponent = React64.memo(
|
|
|
20295
21000
|
scrollerDOMRef
|
|
20296
21001
|
}
|
|
20297
21002
|
), /* @__PURE__ */ React64.createElement(LoadMaskCmp, { visible: loading }, loadingText)), /* @__PURE__ */ React64.createElement(
|
|
20298
|
-
"div",
|
|
20299
|
-
{
|
|
20300
|
-
"data-name": "pinned-start-border",
|
|
20301
|
-
className: PinnedStartIndicatorBorder
|
|
20302
|
-
}
|
|
20303
|
-
), /* @__PURE__ */ React64.createElement(
|
|
20304
|
-
"div",
|
|
20305
|
-
{
|
|
20306
|
-
"data-name": "pinned-end-border",
|
|
20307
|
-
className: PinnedEndIndicatorBorder
|
|
20308
|
-
}
|
|
20309
|
-
), /* @__PURE__ */ React64.createElement(
|
|
20310
21003
|
"div",
|
|
20311
21004
|
{
|
|
20312
21005
|
ref: portalDOMRef,
|
|
@@ -20419,6 +21112,7 @@ var components = {
|
|
|
20419
21112
|
};
|
|
20420
21113
|
// Annotate the CommonJS export names for ESM import in node:
|
|
20421
21114
|
0 && (module.exports = {
|
|
21115
|
+
CellSelectionState,
|
|
20422
21116
|
DataSource,
|
|
20423
21117
|
DataSourceActionType,
|
|
20424
21118
|
DeepMap,
|