@infinite-table/infinite-react 2.0.8 → 3.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.css +1 -1
- package/index.d.ts +144 -15
- package/index.dev.js +976 -203
- package/index.dev.mjs +975 -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,307 @@ 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
|
+
selectColumn(colId) {
|
|
12160
|
+
this.setCellSelected(this.wildcard, colId, true);
|
|
12161
|
+
}
|
|
12162
|
+
deselectColumn(colId) {
|
|
12163
|
+
this.setCellSelected(this.wildcard, colId, false);
|
|
12164
|
+
}
|
|
12165
|
+
setCellSelected(rowId, colId, selected) {
|
|
12166
|
+
const wildcardRow = rowId === this.wildcard;
|
|
12167
|
+
const wildcardColumn = colId === this.wildcard;
|
|
12168
|
+
const isSelected = this.isCellSelected(rowId, colId);
|
|
12169
|
+
if (isSelected === selected) {
|
|
12170
|
+
return;
|
|
12171
|
+
}
|
|
12172
|
+
const clearKeys = [];
|
|
12173
|
+
if (wildcardRow) {
|
|
12174
|
+
const deselectedRowsForColumn = this.deselectedColumnsToRows.get(colId);
|
|
12175
|
+
const selectedRowsForColumn = this.selectedColumnsToRows.get(colId);
|
|
12176
|
+
deselectedRowsForColumn == null ? void 0 : deselectedRowsForColumn.forEach((rowId2) => {
|
|
12177
|
+
if (rowId2 === this.wildcard) {
|
|
12178
|
+
return;
|
|
12179
|
+
}
|
|
12180
|
+
this.setCellInDeselection(rowId2, colId, false);
|
|
12181
|
+
});
|
|
12182
|
+
selectedRowsForColumn == null ? void 0 : selectedRowsForColumn.forEach((rowId2) => {
|
|
12183
|
+
if (rowId2 === this.wildcard) {
|
|
12184
|
+
return;
|
|
12185
|
+
}
|
|
12186
|
+
this.setCellInSelection(rowId2, colId, false);
|
|
12187
|
+
});
|
|
12188
|
+
[...this.cache.keys()].forEach((key) => {
|
|
12189
|
+
const [rowId2, c] = key;
|
|
12190
|
+
if (c === colId) {
|
|
12191
|
+
clearKeys.push([rowId2, colId]);
|
|
12192
|
+
}
|
|
12193
|
+
});
|
|
12194
|
+
}
|
|
12195
|
+
if (wildcardColumn) {
|
|
12196
|
+
const deselectedColumnsForRow = this.deselectedRowsToColumns.get(colId);
|
|
12197
|
+
const selectedColumnsForRow = this.selectedRowsToColumns.get(colId);
|
|
12198
|
+
deselectedColumnsForRow == null ? void 0 : deselectedColumnsForRow.forEach((colId2) => {
|
|
12199
|
+
if (colId2 === this.wildcard) {
|
|
12200
|
+
return;
|
|
12201
|
+
}
|
|
12202
|
+
this.setCellInDeselection(rowId, colId2, false);
|
|
12203
|
+
});
|
|
12204
|
+
selectedColumnsForRow == null ? void 0 : selectedColumnsForRow.forEach((colId2) => {
|
|
12205
|
+
if (colId2 === this.wildcard) {
|
|
12206
|
+
return;
|
|
12207
|
+
}
|
|
12208
|
+
this.setCellInSelection(rowId, colId2, false);
|
|
12209
|
+
});
|
|
12210
|
+
[...this.cache.keys()].forEach((key) => {
|
|
12211
|
+
const [row] = key;
|
|
12212
|
+
if (row === rowId) {
|
|
12213
|
+
clearKeys.push([rowId, colId]);
|
|
12214
|
+
}
|
|
12215
|
+
});
|
|
12216
|
+
}
|
|
12217
|
+
const cacheKey = [rowId, colId];
|
|
12218
|
+
clearKeys.forEach((key) => {
|
|
12219
|
+
this.cache.delete(key);
|
|
12220
|
+
});
|
|
12221
|
+
this.cache.delete(cacheKey);
|
|
12222
|
+
if (selected) {
|
|
12223
|
+
if (this.defaultSelection) {
|
|
12224
|
+
const cellsForThisRow = this.deselectedRowsToColumns.get(rowId);
|
|
12225
|
+
if (cellsForThisRow && cellsForThisRow.has(colId)) {
|
|
12226
|
+
this.setCellInDeselection(rowId, colId, false);
|
|
12227
|
+
}
|
|
12228
|
+
const deselectedColumnsForWildcardRow = this.deselectedRowsToColumns.get(this.wildcard);
|
|
12229
|
+
const deselectedRowsForWildcardColumn = this.deselectedColumnsToRows.get(this.wildcard);
|
|
12230
|
+
if ((deselectedColumnsForWildcardRow == null ? void 0 : deselectedColumnsForWildcardRow.has(colId)) || (deselectedRowsForWildcardColumn == null ? void 0 : deselectedRowsForWildcardColumn.has(rowId))) {
|
|
12231
|
+
this.setCellInSelection(rowId, colId, true);
|
|
12232
|
+
}
|
|
12233
|
+
} else {
|
|
12234
|
+
const cellsForThisRow = this.deselectedRowsToColumns.get(rowId);
|
|
12235
|
+
if (cellsForThisRow && cellsForThisRow.has(colId)) {
|
|
12236
|
+
this.setCellInDeselection(rowId, colId, false);
|
|
12237
|
+
}
|
|
12238
|
+
this.setCellInSelection(rowId, colId, true);
|
|
12239
|
+
}
|
|
12240
|
+
} else {
|
|
12241
|
+
if (this.defaultSelection) {
|
|
12242
|
+
const cellsForThisRow = this.selectedRowsToColumns.get(rowId);
|
|
12243
|
+
if (cellsForThisRow == null ? void 0 : cellsForThisRow.has(colId)) {
|
|
12244
|
+
this.setCellInSelection(rowId, colId, false);
|
|
12245
|
+
}
|
|
12246
|
+
this.setCellInDeselection(rowId, colId, true);
|
|
12247
|
+
} else {
|
|
12248
|
+
const cellsForThisRow = this.selectedRowsToColumns.get(rowId);
|
|
12249
|
+
if (cellsForThisRow == null ? void 0 : cellsForThisRow.has(colId)) {
|
|
12250
|
+
this.setCellInSelection(rowId, colId, false);
|
|
12251
|
+
}
|
|
12252
|
+
const selectedColumnsForWildcardRow = this.selectedRowsToColumns.get(
|
|
12253
|
+
this.wildcard
|
|
12254
|
+
);
|
|
12255
|
+
const selectedRowsForWildcardColumn = this.selectedColumnsToRows.get(
|
|
12256
|
+
this.wildcard
|
|
12257
|
+
);
|
|
12258
|
+
if ((selectedColumnsForWildcardRow == null ? void 0 : selectedColumnsForWildcardRow.has(colId)) || (selectedRowsForWildcardColumn == null ? void 0 : selectedRowsForWildcardColumn.has(rowId))) {
|
|
12259
|
+
this.setCellInDeselection(rowId, colId, true);
|
|
12260
|
+
return;
|
|
12261
|
+
}
|
|
12262
|
+
}
|
|
12263
|
+
}
|
|
12264
|
+
}
|
|
12265
|
+
setCellInDeselection(rowId, colId, selected) {
|
|
12266
|
+
if (selected) {
|
|
12267
|
+
const deselectedColsForRow = this.deselectedRowsToColumns.get(rowId) || /* @__PURE__ */ new Set();
|
|
12268
|
+
deselectedColsForRow.add(colId);
|
|
12269
|
+
this.deselectedRowsToColumns.set(rowId, deselectedColsForRow);
|
|
12270
|
+
} else {
|
|
12271
|
+
const deselectedColsForRow = this.deselectedRowsToColumns.get(rowId);
|
|
12272
|
+
if (deselectedColsForRow) {
|
|
12273
|
+
deselectedColsForRow.delete(colId);
|
|
12274
|
+
if (deselectedColsForRow.size === 0) {
|
|
12275
|
+
this.deselectedRowsToColumns.delete(rowId);
|
|
12276
|
+
}
|
|
12277
|
+
}
|
|
12278
|
+
}
|
|
12279
|
+
if (selected) {
|
|
12280
|
+
const deselectedRowsForColumn = this.deselectedColumnsToRows.get(colId) || /* @__PURE__ */ new Set();
|
|
12281
|
+
deselectedRowsForColumn.add(rowId);
|
|
12282
|
+
this.deselectedColumnsToRows.set(colId, deselectedRowsForColumn);
|
|
12283
|
+
} else {
|
|
12284
|
+
const deselectedRowsForColumn = this.deselectedColumnsToRows.get(colId);
|
|
12285
|
+
if (deselectedRowsForColumn) {
|
|
12286
|
+
deselectedRowsForColumn.delete(rowId);
|
|
12287
|
+
if (deselectedRowsForColumn.size === 0) {
|
|
12288
|
+
this.deselectedColumnsToRows.delete(colId);
|
|
12289
|
+
}
|
|
12290
|
+
}
|
|
12291
|
+
}
|
|
12292
|
+
}
|
|
12293
|
+
setCellInSelection(rowId, colId, selected) {
|
|
12294
|
+
if (rowId === this.wildcard && colId === this.wildcard) {
|
|
12295
|
+
throw new Error(
|
|
12296
|
+
"rowId and colId cannot be used as a wildcard at the same time!"
|
|
12297
|
+
);
|
|
12298
|
+
}
|
|
12299
|
+
if (selected) {
|
|
12300
|
+
const selectedColsForRow = this.selectedRowsToColumns.get(rowId) || /* @__PURE__ */ new Set();
|
|
12301
|
+
selectedColsForRow.add(colId);
|
|
12302
|
+
this.selectedRowsToColumns.set(rowId, selectedColsForRow);
|
|
12303
|
+
} else {
|
|
12304
|
+
const selectedColsForRow = this.selectedRowsToColumns.get(rowId);
|
|
12305
|
+
if (selectedColsForRow) {
|
|
12306
|
+
selectedColsForRow.delete(colId);
|
|
12307
|
+
if (selectedColsForRow.size === 0) {
|
|
12308
|
+
this.selectedRowsToColumns.delete(rowId);
|
|
12309
|
+
}
|
|
12310
|
+
}
|
|
12311
|
+
}
|
|
12312
|
+
if (selected) {
|
|
12313
|
+
const selectedRowsForColumn = this.selectedColumnsToRows.get(colId) || /* @__PURE__ */ new Set();
|
|
12314
|
+
selectedRowsForColumn.add(rowId);
|
|
12315
|
+
this.selectedColumnsToRows.set(colId, selectedRowsForColumn);
|
|
12316
|
+
} else {
|
|
12317
|
+
const selectedRowsForColumn = this.selectedColumnsToRows.get(colId);
|
|
12318
|
+
if (selectedRowsForColumn) {
|
|
12319
|
+
selectedRowsForColumn.delete(rowId);
|
|
12320
|
+
if (selectedRowsForColumn.size === 0) {
|
|
12321
|
+
this.selectedColumnsToRows.delete(colId);
|
|
12322
|
+
}
|
|
12323
|
+
}
|
|
12324
|
+
}
|
|
12325
|
+
}
|
|
12326
|
+
update(stateObject) {
|
|
12327
|
+
const selectedCells = stateObject.selectedCells || null;
|
|
12328
|
+
const deselectedCells = stateObject.deselectedCells || null;
|
|
12329
|
+
this.selectedRowsToColumns.clear();
|
|
12330
|
+
this.selectedColumnsToRows.clear();
|
|
12331
|
+
this.deselectedRowsToColumns.clear();
|
|
12332
|
+
this.deselectedColumnsToRows.clear();
|
|
12333
|
+
this.cache.clear();
|
|
12334
|
+
if (selectedCells) {
|
|
12335
|
+
selectedCells.forEach(([rowId, colId]) => {
|
|
12336
|
+
this.setCellInSelection(rowId, colId, true);
|
|
12337
|
+
});
|
|
12338
|
+
}
|
|
12339
|
+
if (deselectedCells) {
|
|
12340
|
+
deselectedCells.forEach(([rowId, colId]) => {
|
|
12341
|
+
this.setCellInDeselection(rowId, colId, true);
|
|
12342
|
+
});
|
|
12343
|
+
}
|
|
12344
|
+
this.defaultSelection = stateObject.defaultSelection;
|
|
12345
|
+
}
|
|
12346
|
+
isCellSelected(rowId, colId) {
|
|
12347
|
+
var _a, _b;
|
|
12348
|
+
const cacheKey = [rowId, colId];
|
|
12349
|
+
const { cache } = this;
|
|
12350
|
+
const selected = cache.get(cacheKey);
|
|
12351
|
+
if (selected != null) {
|
|
12352
|
+
return selected;
|
|
12353
|
+
}
|
|
12354
|
+
const returnFalse3 = () => {
|
|
12355
|
+
cache.set(cacheKey, false);
|
|
12356
|
+
return false;
|
|
12357
|
+
};
|
|
12358
|
+
const returnTrue = () => {
|
|
12359
|
+
cache.set(cacheKey, true);
|
|
12360
|
+
return true;
|
|
12361
|
+
};
|
|
12362
|
+
const deselectedRowsForWildcardColumn = this.deselectedColumnsToRows.get(
|
|
12363
|
+
this.wildcard
|
|
12364
|
+
);
|
|
12365
|
+
const deselectedColumnsForWildcardRow = this.deselectedRowsToColumns.get(
|
|
12366
|
+
this.wildcard
|
|
12367
|
+
);
|
|
12368
|
+
const selectedRowsForWildcardColumn = this.selectedColumnsToRows.get(
|
|
12369
|
+
this.wildcard
|
|
12370
|
+
);
|
|
12371
|
+
const selectedColumnsForWildcardRow = this.selectedRowsToColumns.get(
|
|
12372
|
+
this.wildcard
|
|
12373
|
+
);
|
|
12374
|
+
let defaultSelection = this.defaultSelection;
|
|
12375
|
+
if (defaultSelection) {
|
|
12376
|
+
const cols2 = this.deselectedRowsToColumns.get(rowId);
|
|
12377
|
+
if (cols2 && cols2.has(colId)) {
|
|
12378
|
+
return returnFalse3();
|
|
12379
|
+
}
|
|
12380
|
+
if ((deselectedRowsForWildcardColumn == null ? void 0 : deselectedRowsForWildcardColumn.has(rowId)) || (deselectedColumnsForWildcardRow == null ? void 0 : deselectedColumnsForWildcardRow.has(colId))) {
|
|
12381
|
+
if ((_a = this.selectedRowsToColumns.get(rowId)) == null ? void 0 : _a.has(colId)) {
|
|
12382
|
+
return returnTrue();
|
|
12383
|
+
}
|
|
12384
|
+
return returnFalse3();
|
|
12385
|
+
}
|
|
12386
|
+
return returnTrue();
|
|
12387
|
+
}
|
|
12388
|
+
const cols = this.selectedRowsToColumns.get(rowId);
|
|
12389
|
+
if (cols && cols.has(colId)) {
|
|
12390
|
+
return returnTrue();
|
|
12391
|
+
}
|
|
12392
|
+
if ((selectedRowsForWildcardColumn == null ? void 0 : selectedRowsForWildcardColumn.has(rowId)) || (selectedColumnsForWildcardRow == null ? void 0 : selectedColumnsForWildcardRow.has(colId))) {
|
|
12393
|
+
if ((_b = this.deselectedRowsToColumns.get(rowId)) == null ? void 0 : _b.has(colId)) {
|
|
12394
|
+
return returnFalse3();
|
|
12395
|
+
}
|
|
12396
|
+
return returnTrue();
|
|
12397
|
+
}
|
|
12398
|
+
return returnFalse3();
|
|
12399
|
+
}
|
|
12400
|
+
getState() {
|
|
12401
|
+
const deselectedCells = [];
|
|
12402
|
+
const selectedCells = [];
|
|
12403
|
+
this.deselectedRowsToColumns.forEach((cols, rowId) => {
|
|
12404
|
+
cols.forEach((colId) => {
|
|
12405
|
+
deselectedCells.push([rowId, colId]);
|
|
12406
|
+
});
|
|
12407
|
+
});
|
|
12408
|
+
this.selectedRowsToColumns.forEach((cols, rowId) => {
|
|
12409
|
+
cols.forEach((colId) => {
|
|
12410
|
+
selectedCells.push([rowId, colId]);
|
|
12411
|
+
});
|
|
12412
|
+
});
|
|
12413
|
+
return {
|
|
12414
|
+
defaultSelection: this.defaultSelection,
|
|
12415
|
+
deselectedCells,
|
|
12416
|
+
selectedCells
|
|
12417
|
+
};
|
|
12418
|
+
}
|
|
12419
|
+
};
|
|
12420
|
+
|
|
12032
12421
|
// src/components/DataSource/RowSelectionState.ts
|
|
12033
12422
|
var RowSelectionState = class {
|
|
12034
12423
|
constructor(state, getConfig, _forTestingOnly) {
|
|
@@ -12590,7 +12979,10 @@ var haveDepsChanged = (state1, state2, deps) => {
|
|
|
12590
12979
|
}
|
|
12591
12980
|
return false;
|
|
12592
12981
|
};
|
|
12593
|
-
function
|
|
12982
|
+
function returnFalse2() {
|
|
12983
|
+
return false;
|
|
12984
|
+
}
|
|
12985
|
+
function toRowInfo(data, id, index, isRowSelected, cellSelectionState) {
|
|
12594
12986
|
const rowInfo = {
|
|
12595
12987
|
dataSourceHasGrouping: false,
|
|
12596
12988
|
data,
|
|
@@ -12598,11 +12990,17 @@ function toRowInfo(data, id, index, isRowSelected) {
|
|
|
12598
12990
|
indexInAll: index,
|
|
12599
12991
|
isGroupRow: false,
|
|
12600
12992
|
selfLoaded: true,
|
|
12601
|
-
rowSelected: false
|
|
12993
|
+
rowSelected: false,
|
|
12994
|
+
isCellSelected: returnFalse2
|
|
12602
12995
|
};
|
|
12603
12996
|
if (isRowSelected) {
|
|
12604
12997
|
rowInfo.rowSelected = isRowSelected(rowInfo);
|
|
12605
12998
|
}
|
|
12999
|
+
if (cellSelectionState) {
|
|
13000
|
+
rowInfo.isCellSelected = (colId) => {
|
|
13001
|
+
return cellSelectionState.isCellSelected(rowInfo.id, colId);
|
|
13002
|
+
};
|
|
13003
|
+
}
|
|
12606
13004
|
return rowInfo;
|
|
12607
13005
|
}
|
|
12608
13006
|
function filterDataSource(params) {
|
|
@@ -12783,6 +13181,7 @@ function concludeReducer(params) {
|
|
|
12783
13181
|
state.postSortDataArray = dataArray;
|
|
12784
13182
|
let rowInfoDataArray = state.dataArray;
|
|
12785
13183
|
const rowSelectionState = state.rowSelection instanceof RowSelectionState ? state.rowSelection : void 0;
|
|
13184
|
+
const cellSelectionState = state.cellSelection instanceof CellSelectionState ? state.cellSelection : void 0;
|
|
12786
13185
|
rowSelectionState == null ? void 0 : rowSelectionState.xcache();
|
|
12787
13186
|
let isRowSelected = state.selectionMode === "single-row" ? (rowInfo) => {
|
|
12788
13187
|
return rowInfo.id === state.rowSelection;
|
|
@@ -12841,6 +13240,19 @@ function concludeReducer(params) {
|
|
|
12841
13240
|
reducerKeys: rowInfoReducerKeys,
|
|
12842
13241
|
rowInfo: {}
|
|
12843
13242
|
};
|
|
13243
|
+
const withRowInfoForReducers = rowInfoReducerResults ? (rowInfo) => {
|
|
13244
|
+
rowInfoReducersShape.rowInfo = rowInfo;
|
|
13245
|
+
computeRowInfoReducersFor(rowInfoReducersShape);
|
|
13246
|
+
} : void 0;
|
|
13247
|
+
const withRowInfoForCellSelection = cellSelectionState ? (rowInfo) => {
|
|
13248
|
+
rowInfo.isCellSelected = (colId) => {
|
|
13249
|
+
return cellSelectionState.isCellSelected(rowInfo.id, colId);
|
|
13250
|
+
};
|
|
13251
|
+
} : void 0;
|
|
13252
|
+
const withRowInfo = withRowInfoForReducers || withRowInfoForCellSelection ? composeFunctions(
|
|
13253
|
+
withRowInfoForReducers,
|
|
13254
|
+
withRowInfoForCellSelection
|
|
13255
|
+
) : void 0;
|
|
12844
13256
|
const flattenResult = enhancedFlatten({
|
|
12845
13257
|
groupResult,
|
|
12846
13258
|
lazyLoad: !!state.lazyLoad,
|
|
@@ -12848,10 +13260,7 @@ function concludeReducer(params) {
|
|
|
12848
13260
|
toPrimaryKey,
|
|
12849
13261
|
isRowSelected,
|
|
12850
13262
|
rowSelectionState,
|
|
12851
|
-
withRowInfo
|
|
12852
|
-
rowInfoReducersShape.rowInfo = rowInfo;
|
|
12853
|
-
computeRowInfoReducersFor(rowInfoReducersShape);
|
|
12854
|
-
} : void 0,
|
|
13263
|
+
withRowInfo,
|
|
12855
13264
|
groupRowsState: state.groupRowsState,
|
|
12856
13265
|
generateGroupRows: state.generateGroupRows
|
|
12857
13266
|
});
|
|
@@ -12901,7 +13310,8 @@ function concludeReducer(params) {
|
|
|
12901
13310
|
data,
|
|
12902
13311
|
data ? toPrimaryKey(data) : index,
|
|
12903
13312
|
index,
|
|
12904
|
-
isRowSelected
|
|
13313
|
+
isRowSelected,
|
|
13314
|
+
cellSelectionState
|
|
12905
13315
|
);
|
|
12906
13316
|
if (rowInfoReducerResults) {
|
|
12907
13317
|
rowInfoReducersShape.rowInfo = rowInfo;
|
|
@@ -13775,7 +14185,9 @@ function deriveStateFromProps(params) {
|
|
|
13775
14185
|
}
|
|
13776
14186
|
}
|
|
13777
14187
|
let rowSelectionState = null;
|
|
14188
|
+
let cellSelectionState = null;
|
|
13778
14189
|
let currentRowSelection = props.rowSelection !== void 0 ? props.rowSelection : state.rowSelection === void 0 ? props.defaultRowSelection !== void 0 ? props.defaultRowSelection : null : state.rowSelection;
|
|
14190
|
+
let currentCellSelection = props.cellSelection !== void 0 ? props.cellSelection : state.cellSelection === void 0 ? props.defaultCellSelection !== void 0 ? props.defaultCellSelection : null : state.cellSelection || null;
|
|
13779
14191
|
if (selectionMode !== false) {
|
|
13780
14192
|
if (selectionMode === "single-row" || selectionMode === "multi-row") {
|
|
13781
14193
|
if (currentRowSelection === null) {
|
|
@@ -13794,6 +14206,15 @@ function deriveStateFromProps(params) {
|
|
|
13794
14206
|
);
|
|
13795
14207
|
}
|
|
13796
14208
|
}
|
|
14209
|
+
if (selectionMode === "single-cell" || selectionMode === "multi-cell") {
|
|
14210
|
+
if (currentCellSelection === null) {
|
|
14211
|
+
cellSelectionState = selectionMode === "single-cell" ? null : new CellSelectionState();
|
|
14212
|
+
} else {
|
|
14213
|
+
cellSelectionState = currentCellSelection instanceof CellSelectionState ? currentCellSelection : new CellSelectionState(
|
|
14214
|
+
currentCellSelection
|
|
14215
|
+
);
|
|
14216
|
+
}
|
|
14217
|
+
}
|
|
13797
14218
|
}
|
|
13798
14219
|
const primaryKeyDescriptor = state.primaryKey;
|
|
13799
14220
|
const toPrimaryKey = typeof primaryKeyDescriptor === "function" ? (data) => primaryKeyDescriptor(data) : (data) => data[primaryKeyDescriptor];
|
|
@@ -13810,8 +14231,8 @@ function deriveStateFromProps(params) {
|
|
|
13810
14231
|
const result = {
|
|
13811
14232
|
selectionMode,
|
|
13812
14233
|
groupRowsState,
|
|
13813
|
-
// for whatever reason I had to do this cast to appease TS
|
|
13814
14234
|
rowSelection: rowSelectionState,
|
|
14235
|
+
cellSelection: cellSelectionState,
|
|
13815
14236
|
toPrimaryKey,
|
|
13816
14237
|
operatorsByFilterType,
|
|
13817
14238
|
controlledSort,
|
|
@@ -13863,6 +14284,22 @@ function getMappedCallbacks() {
|
|
|
13863
14284
|
"multi-row"
|
|
13864
14285
|
]
|
|
13865
14286
|
};
|
|
14287
|
+
},
|
|
14288
|
+
cellSelection: (cellSelection, state) => {
|
|
14289
|
+
if (state.selectionMode === "single-cell") {
|
|
14290
|
+
return {
|
|
14291
|
+
callbackParams: [
|
|
14292
|
+
cellSelection instanceof CellSelectionState ? cellSelection.getState().selectedCells : null,
|
|
14293
|
+
"single-cell"
|
|
14294
|
+
]
|
|
14295
|
+
};
|
|
14296
|
+
}
|
|
14297
|
+
return {
|
|
14298
|
+
callbackParams: [
|
|
14299
|
+
cellSelection.getState(),
|
|
14300
|
+
"multi-cell"
|
|
14301
|
+
]
|
|
14302
|
+
};
|
|
13866
14303
|
}
|
|
13867
14304
|
};
|
|
13868
14305
|
}
|
|
@@ -14079,6 +14516,157 @@ function notNullable(value) {
|
|
|
14079
14516
|
return true;
|
|
14080
14517
|
}
|
|
14081
14518
|
|
|
14519
|
+
// src/components/InfiniteTable/api/getCellSelectionApi.ts
|
|
14520
|
+
function ensureMinMaxCellPositionByIndex(start, end) {
|
|
14521
|
+
let { rowIndex: startRowIndex, colIndex: startColIndex } = start;
|
|
14522
|
+
let { rowIndex: endRowIndex, colIndex: endColIndex } = end;
|
|
14523
|
+
const [colStart, colEnd] = startColIndex > endColIndex ? [endColIndex, startColIndex] : [startColIndex, endColIndex];
|
|
14524
|
+
const [rowStart, rowEnd] = startRowIndex > endRowIndex ? [endRowIndex, startRowIndex] : [startRowIndex, endRowIndex];
|
|
14525
|
+
return [
|
|
14526
|
+
{ rowIndex: rowStart, colIndex: colStart },
|
|
14527
|
+
{ rowIndex: rowEnd, colIndex: colEnd }
|
|
14528
|
+
];
|
|
14529
|
+
}
|
|
14530
|
+
function getCellSelectionApi(param) {
|
|
14531
|
+
const {
|
|
14532
|
+
getComputed,
|
|
14533
|
+
// getState,
|
|
14534
|
+
getDataSourceState,
|
|
14535
|
+
// componentActions,
|
|
14536
|
+
dataSourceActions
|
|
14537
|
+
} = param;
|
|
14538
|
+
const getCellSelectionPosition = (options) => {
|
|
14539
|
+
var _a, _b, _c;
|
|
14540
|
+
const rowId = (_b = options.rowId) != null ? _b : (_a = getRowInfoAt(options.rowIndex, getDataSourceState)) == null ? void 0 : _a.id;
|
|
14541
|
+
const colId = (_c = options.colId) != null ? _c : getComputed().computedVisibleColumns[options.colIndex].id;
|
|
14542
|
+
return [rowId, colId];
|
|
14543
|
+
};
|
|
14544
|
+
const cellSelectionApi = {
|
|
14545
|
+
deselectAll: () => {
|
|
14546
|
+
const dataSourceState = getDataSourceState();
|
|
14547
|
+
const cellSelection = dataSourceState.cellSelection;
|
|
14548
|
+
if (!cellSelection) {
|
|
14549
|
+
return;
|
|
14550
|
+
}
|
|
14551
|
+
const newCellSelection = new CellSelectionState(cellSelection);
|
|
14552
|
+
newCellSelection.deselectAll();
|
|
14553
|
+
dataSourceActions.cellSelection = newCellSelection;
|
|
14554
|
+
},
|
|
14555
|
+
clear: () => {
|
|
14556
|
+
cellSelectionApi.deselectAll();
|
|
14557
|
+
},
|
|
14558
|
+
selectAll: () => {
|
|
14559
|
+
const dataSourceState = getDataSourceState();
|
|
14560
|
+
const cellSelection = dataSourceState.cellSelection;
|
|
14561
|
+
if (!cellSelection) {
|
|
14562
|
+
return;
|
|
14563
|
+
}
|
|
14564
|
+
const newCellSelection = new CellSelectionState(cellSelection);
|
|
14565
|
+
newCellSelection.selectAll();
|
|
14566
|
+
dataSourceActions.cellSelection = newCellSelection;
|
|
14567
|
+
},
|
|
14568
|
+
selectRange: (startOptions, endOptions) => {
|
|
14569
|
+
cellSelectionApi.setRangeSelected(startOptions, endOptions, true);
|
|
14570
|
+
},
|
|
14571
|
+
deselectRange: (startOptions, endOptions) => {
|
|
14572
|
+
cellSelectionApi.setRangeSelected(startOptions, endOptions, false);
|
|
14573
|
+
},
|
|
14574
|
+
setRangeSelected: (startOptions, endOptions, selected) => {
|
|
14575
|
+
const dataSourceState = getDataSourceState();
|
|
14576
|
+
const cellSelection = dataSourceState.cellSelection;
|
|
14577
|
+
if (!cellSelection) {
|
|
14578
|
+
return;
|
|
14579
|
+
}
|
|
14580
|
+
const newCellSelection = new CellSelectionState(cellSelection);
|
|
14581
|
+
const [startRowId, startColId] = getCellSelectionPosition(startOptions);
|
|
14582
|
+
const [endRowId, endColId] = getCellSelectionPosition(endOptions);
|
|
14583
|
+
const startCol = getComputed().computedVisibleColumnsMap.get(startColId);
|
|
14584
|
+
const endCol = getComputed().computedVisibleColumnsMap.get(endColId);
|
|
14585
|
+
if (!startCol || !endCol) {
|
|
14586
|
+
return;
|
|
14587
|
+
}
|
|
14588
|
+
const startColIndex = startCol.computedVisibleIndex;
|
|
14589
|
+
const endColIndex = endCol.computedVisibleIndex;
|
|
14590
|
+
const startRowInfo = getRowInfoAt(startRowId, getDataSourceState);
|
|
14591
|
+
const endRowInfo = getRowInfoAt(endRowId, getDataSourceState);
|
|
14592
|
+
if (!startRowInfo || !endRowInfo) {
|
|
14593
|
+
return;
|
|
14594
|
+
}
|
|
14595
|
+
const startRowIndex = startRowInfo.indexInAll;
|
|
14596
|
+
const endRowIndex = endRowInfo.indexInAll;
|
|
14597
|
+
const [start, end] = ensureMinMaxCellPositionByIndex(
|
|
14598
|
+
{ rowIndex: startRowIndex, colIndex: startColIndex },
|
|
14599
|
+
{ rowIndex: endRowIndex, colIndex: endColIndex }
|
|
14600
|
+
);
|
|
14601
|
+
for (let i = start.rowIndex; i <= end.rowIndex; i++) {
|
|
14602
|
+
for (let j = start.colIndex; j <= end.colIndex; j++) {
|
|
14603
|
+
const pos = {
|
|
14604
|
+
rowIndex: i,
|
|
14605
|
+
colIndex: j
|
|
14606
|
+
};
|
|
14607
|
+
const [pk, colId] = getCellSelectionPosition(pos);
|
|
14608
|
+
if (selected) {
|
|
14609
|
+
newCellSelection.selectCell(pk, colId);
|
|
14610
|
+
} else {
|
|
14611
|
+
newCellSelection.deselectCell(pk, colId);
|
|
14612
|
+
}
|
|
14613
|
+
}
|
|
14614
|
+
}
|
|
14615
|
+
dataSourceActions.cellSelection = newCellSelection;
|
|
14616
|
+
},
|
|
14617
|
+
isCellSelected: (options) => {
|
|
14618
|
+
var _a, _b;
|
|
14619
|
+
const [pk, colId] = getCellSelectionPosition(options);
|
|
14620
|
+
return (_b = (_a = getDataSourceState().cellSelection) == null ? void 0 : _a.isCellSelected(pk, colId)) != null ? _b : false;
|
|
14621
|
+
},
|
|
14622
|
+
selectCell: (options) => {
|
|
14623
|
+
const cellSelection = getDataSourceState().cellSelection;
|
|
14624
|
+
if (!cellSelection) {
|
|
14625
|
+
return;
|
|
14626
|
+
}
|
|
14627
|
+
const [pk, colId] = getCellSelectionPosition(options);
|
|
14628
|
+
const newCellSelection = options.clear ? new CellSelectionState() : new CellSelectionState(cellSelection);
|
|
14629
|
+
newCellSelection.selectCell(pk, colId);
|
|
14630
|
+
dataSourceActions.cellSelection = newCellSelection;
|
|
14631
|
+
},
|
|
14632
|
+
deselectCell: (options) => {
|
|
14633
|
+
const cellSelection = getDataSourceState().cellSelection;
|
|
14634
|
+
if (!cellSelection) {
|
|
14635
|
+
return;
|
|
14636
|
+
}
|
|
14637
|
+
const [pk, colId] = getCellSelectionPosition(options);
|
|
14638
|
+
const newCellSelection = new CellSelectionState(cellSelection);
|
|
14639
|
+
newCellSelection.deselectCell(pk, colId);
|
|
14640
|
+
dataSourceActions.cellSelection = newCellSelection;
|
|
14641
|
+
},
|
|
14642
|
+
selectColumn: (colId, options) => {
|
|
14643
|
+
if (options == null ? void 0 : options.clear) {
|
|
14644
|
+
cellSelectionApi.deselectAll();
|
|
14645
|
+
}
|
|
14646
|
+
const cellSelection = getDataSourceState().cellSelection;
|
|
14647
|
+
if (!cellSelection) {
|
|
14648
|
+
return;
|
|
14649
|
+
}
|
|
14650
|
+
const newCellSelection = new CellSelectionState(cellSelection);
|
|
14651
|
+
newCellSelection.selectColumn(colId);
|
|
14652
|
+
dataSourceActions.cellSelection = newCellSelection;
|
|
14653
|
+
},
|
|
14654
|
+
deselectColumn: (colId) => {
|
|
14655
|
+
const cellSelection = getDataSourceState().cellSelection;
|
|
14656
|
+
if (!cellSelection) {
|
|
14657
|
+
return;
|
|
14658
|
+
}
|
|
14659
|
+
const newCellSelection = new CellSelectionState(cellSelection);
|
|
14660
|
+
newCellSelection.deselectColumn(colId);
|
|
14661
|
+
dataSourceActions.cellSelection = newCellSelection;
|
|
14662
|
+
}
|
|
14663
|
+
};
|
|
14664
|
+
if (false) {
|
|
14665
|
+
globalThis.cellSelectionApi = cellSelectionApi;
|
|
14666
|
+
}
|
|
14667
|
+
return cellSelectionApi;
|
|
14668
|
+
}
|
|
14669
|
+
|
|
14082
14670
|
// src/components/InfiniteTable/api/getImperativeApi.ts
|
|
14083
14671
|
function isSortInfoForColumn(sortInfo, col) {
|
|
14084
14672
|
if (sortInfo.id) {
|
|
@@ -14463,10 +15051,15 @@ var InfiniteTableApiImpl = class {
|
|
|
14463
15051
|
return true;
|
|
14464
15052
|
};
|
|
14465
15053
|
this.context = context;
|
|
14466
|
-
this.
|
|
15054
|
+
this.rowSelectionApi = getRowSelectionApi({
|
|
14467
15055
|
dataSourceActions: context.dataSourceActions,
|
|
14468
15056
|
getDataSourceState: context.getDataSourceState
|
|
14469
15057
|
});
|
|
15058
|
+
this.cellSelectionApi = getCellSelectionApi({
|
|
15059
|
+
dataSourceActions: context.dataSourceActions,
|
|
15060
|
+
getDataSourceState: context.getDataSourceState,
|
|
15061
|
+
getComputed: context.getComputed
|
|
15062
|
+
});
|
|
14470
15063
|
}
|
|
14471
15064
|
get actions() {
|
|
14472
15065
|
return this.context.actions;
|
|
@@ -15074,6 +15667,8 @@ function useCellRendering(param) {
|
|
|
15074
15667
|
groupRenderStrategy,
|
|
15075
15668
|
brain,
|
|
15076
15669
|
showZebraRows,
|
|
15670
|
+
cellClassName,
|
|
15671
|
+
cellStyle,
|
|
15077
15672
|
rowStyle,
|
|
15078
15673
|
rowClassName,
|
|
15079
15674
|
onScrollToTop,
|
|
@@ -15180,7 +15775,9 @@ function useCellRendering(param) {
|
|
|
15180
15775
|
columnsMap: computedColumnsMap,
|
|
15181
15776
|
fieldsToColumn,
|
|
15182
15777
|
rowStyle,
|
|
15183
|
-
rowClassName
|
|
15778
|
+
rowClassName,
|
|
15779
|
+
cellStyle,
|
|
15780
|
+
cellClassName
|
|
15184
15781
|
};
|
|
15185
15782
|
return /* @__PURE__ */ React51.createElement(InfiniteTableColumnCell, __spreadValues({}, cellProps));
|
|
15186
15783
|
},
|
|
@@ -15195,7 +15792,9 @@ function useCellRendering(param) {
|
|
|
15195
15792
|
showZebraRows,
|
|
15196
15793
|
repaintId,
|
|
15197
15794
|
rowStyle,
|
|
15198
|
-
rowClassName
|
|
15795
|
+
rowClassName,
|
|
15796
|
+
cellClassName,
|
|
15797
|
+
cellStyle
|
|
15199
15798
|
]
|
|
15200
15799
|
);
|
|
15201
15800
|
return {
|
|
@@ -15207,6 +15806,118 @@ function useCellRendering(param) {
|
|
|
15207
15806
|
// src/components/InfiniteTable/hooks/useComputed.ts
|
|
15208
15807
|
var import_react48 = require("react");
|
|
15209
15808
|
|
|
15809
|
+
// src/components/InfiniteTable/utils/MultiCellSelector.ts
|
|
15810
|
+
var MultiCellSelector = class {
|
|
15811
|
+
constructor(options) {
|
|
15812
|
+
this.multiSelectStartPosition = { rowIndex: 0, colIndex: 0 };
|
|
15813
|
+
this.getPrimaryKeyByIndex = options.getPrimaryKeyByIndex;
|
|
15814
|
+
this.getColumnIdByIndex = options.getColumnIdByIndex;
|
|
15815
|
+
}
|
|
15816
|
+
getCellSelectionPosition(position2) {
|
|
15817
|
+
const { rowIndex, colIndex } = position2;
|
|
15818
|
+
const rowId = this.getPrimaryKeyByIndex(rowIndex);
|
|
15819
|
+
const columnId = this.getColumnIdByIndex(colIndex);
|
|
15820
|
+
if (rowId === void 0 || !columnId) {
|
|
15821
|
+
return void 0;
|
|
15822
|
+
}
|
|
15823
|
+
return [rowId, columnId];
|
|
15824
|
+
}
|
|
15825
|
+
set cellSelectionState(cellSelectionState) {
|
|
15826
|
+
this._cellSelectionState = cellSelectionState;
|
|
15827
|
+
}
|
|
15828
|
+
get cellSelectionState() {
|
|
15829
|
+
return this._cellSelectionState;
|
|
15830
|
+
}
|
|
15831
|
+
/**
|
|
15832
|
+
* This is the single click, without any modifier
|
|
15833
|
+
*/
|
|
15834
|
+
resetClick(position2) {
|
|
15835
|
+
this.cellSelectionState.deselectAll();
|
|
15836
|
+
const cellSelectionPosition = this.getCellSelectionPosition(position2);
|
|
15837
|
+
if (!cellSelectionPosition) {
|
|
15838
|
+
return;
|
|
15839
|
+
}
|
|
15840
|
+
this.cellSelectionState.deselectAll();
|
|
15841
|
+
this.cellSelectionState.selectCell(...cellSelectionPosition);
|
|
15842
|
+
this.multiSelectStartPosition = position2;
|
|
15843
|
+
this.multiSelectEndPosition = void 0;
|
|
15844
|
+
}
|
|
15845
|
+
/**
|
|
15846
|
+
* This is the click with ctrl/cmd key pressed
|
|
15847
|
+
* @param position CellPosition
|
|
15848
|
+
*/
|
|
15849
|
+
singleAddClick(position2) {
|
|
15850
|
+
const cellSelectionPosition = this.getCellSelectionPosition(position2);
|
|
15851
|
+
if (!cellSelectionPosition) {
|
|
15852
|
+
return;
|
|
15853
|
+
}
|
|
15854
|
+
if (this.cellSelectionState.isCellSelected(...cellSelectionPosition)) {
|
|
15855
|
+
this.cellSelectionState.deselectCell(...cellSelectionPosition);
|
|
15856
|
+
const nextPos = {
|
|
15857
|
+
rowIndex: position2.rowIndex + 1,
|
|
15858
|
+
colIndex: position2.colIndex
|
|
15859
|
+
};
|
|
15860
|
+
if (this.getCellSelectionPosition(nextPos)) {
|
|
15861
|
+
this.multiSelectStartPosition = nextPos;
|
|
15862
|
+
}
|
|
15863
|
+
} else {
|
|
15864
|
+
this.cellSelectionState.selectCell(...cellSelectionPosition);
|
|
15865
|
+
this.multiSelectStartPosition = position2;
|
|
15866
|
+
this.multiSelectEndPosition = void 0;
|
|
15867
|
+
}
|
|
15868
|
+
}
|
|
15869
|
+
multiSelectClick(position2) {
|
|
15870
|
+
if (!this.multiSelectStartPosition) {
|
|
15871
|
+
return;
|
|
15872
|
+
}
|
|
15873
|
+
const cellSelectionPosition = this.getCellSelectionPosition(position2);
|
|
15874
|
+
if (!cellSelectionPosition) {
|
|
15875
|
+
return;
|
|
15876
|
+
}
|
|
15877
|
+
if (this.multiSelectEndPosition) {
|
|
15878
|
+
this.deselectRange(
|
|
15879
|
+
this.multiSelectStartPosition,
|
|
15880
|
+
this.multiSelectEndPosition
|
|
15881
|
+
);
|
|
15882
|
+
}
|
|
15883
|
+
this.selectRange(this.multiSelectStartPosition, position2);
|
|
15884
|
+
this.multiSelectEndPosition = position2;
|
|
15885
|
+
}
|
|
15886
|
+
setRangeSelected(startPosition, endPosition, selected) {
|
|
15887
|
+
const [start, end] = ensureMinMaxCellPositionByIndex(
|
|
15888
|
+
startPosition,
|
|
15889
|
+
endPosition
|
|
15890
|
+
);
|
|
15891
|
+
const startSelectionPosition = this.getCellSelectionPosition(start);
|
|
15892
|
+
const endSelectionPosition = this.getCellSelectionPosition(end);
|
|
15893
|
+
if (!startSelectionPosition || !endSelectionPosition) {
|
|
15894
|
+
return;
|
|
15895
|
+
}
|
|
15896
|
+
for (let i = start.rowIndex; i <= end.rowIndex; i++) {
|
|
15897
|
+
for (let j = start.colIndex; j <= end.colIndex; j++) {
|
|
15898
|
+
const selectionPosition = this.getCellSelectionPosition({
|
|
15899
|
+
rowIndex: i,
|
|
15900
|
+
colIndex: j
|
|
15901
|
+
});
|
|
15902
|
+
if (!selectionPosition) {
|
|
15903
|
+
continue;
|
|
15904
|
+
}
|
|
15905
|
+
if (selected) {
|
|
15906
|
+
this.cellSelectionState.selectCell(...selectionPosition);
|
|
15907
|
+
} else {
|
|
15908
|
+
this.cellSelectionState.deselectCell(...selectionPosition);
|
|
15909
|
+
}
|
|
15910
|
+
}
|
|
15911
|
+
}
|
|
15912
|
+
}
|
|
15913
|
+
deselectRange(startPosition, endPosition) {
|
|
15914
|
+
this.setRangeSelected(startPosition, endPosition, false);
|
|
15915
|
+
}
|
|
15916
|
+
selectRange(startPosition, endPosition) {
|
|
15917
|
+
this.setRangeSelected(startPosition, endPosition, true);
|
|
15918
|
+
}
|
|
15919
|
+
};
|
|
15920
|
+
|
|
15210
15921
|
// src/components/InfiniteTable/utils/MultiRowSelector.ts
|
|
15211
15922
|
function ensureMinMax(start, end) {
|
|
15212
15923
|
return start < end ? [start, end] : [end, start];
|
|
@@ -15642,8 +16353,10 @@ var forwardProps4 = (setupState) => {
|
|
|
15642
16353
|
columnDefaultFilterable: 1,
|
|
15643
16354
|
columnDefaultSortable: 1,
|
|
15644
16355
|
rowStyle: 1,
|
|
16356
|
+
cellStyle: 1,
|
|
15645
16357
|
rowProps: 1,
|
|
15646
16358
|
rowClassName: 1,
|
|
16359
|
+
cellClassName: 1,
|
|
15647
16360
|
pinnedStartMaxWidth: 1,
|
|
15648
16361
|
pinnedEndMaxWidth: 1,
|
|
15649
16362
|
pivotColumn: 1,
|
|
@@ -16501,7 +17214,8 @@ function useComputed() {
|
|
|
16501
17214
|
const {
|
|
16502
17215
|
componentActions: dataSourceActions,
|
|
16503
17216
|
componentState: dataSourceState,
|
|
16504
|
-
getState: getDataSourceState
|
|
17217
|
+
getState: getDataSourceState,
|
|
17218
|
+
api: dataSourceApi
|
|
16505
17219
|
} = useDataSourceContextValue();
|
|
16506
17220
|
const {
|
|
16507
17221
|
columnOrder,
|
|
@@ -16604,8 +17318,19 @@ function useComputed() {
|
|
|
16604
17318
|
});
|
|
16605
17319
|
return multiRowSelector2;
|
|
16606
17320
|
});
|
|
17321
|
+
const getComputedVisibleColumns = useLatest(computedVisibleColumns);
|
|
17322
|
+
const [multiCellSelector] = (0, import_react48.useState)(() => {
|
|
17323
|
+
return new MultiCellSelector({
|
|
17324
|
+
getPrimaryKeyByIndex: dataSourceApi.getPrimaryKeyByIndex,
|
|
17325
|
+
getColumnIdByIndex: (colIndex) => {
|
|
17326
|
+
var _a2;
|
|
17327
|
+
return ((_a2 = getComputedVisibleColumns()[colIndex]) == null ? void 0 : _a2.id) || "";
|
|
17328
|
+
}
|
|
17329
|
+
});
|
|
17330
|
+
});
|
|
16607
17331
|
return {
|
|
16608
17332
|
multiRowSelector,
|
|
17333
|
+
multiCellSelector,
|
|
16609
17334
|
scrollbars,
|
|
16610
17335
|
columnSize,
|
|
16611
17336
|
rowspan,
|
|
@@ -16807,7 +17532,7 @@ var useLicense = (licenseKey = "") => {
|
|
|
16807
17532
|
const valid = (0, import_react49.useMemo)(() => {
|
|
16808
17533
|
let valid2 = isValidLicense(licenseKey, {
|
|
16809
17534
|
publishedAt: 1624970570587,
|
|
16810
|
-
version: "
|
|
17535
|
+
version: "3.0.1"
|
|
16811
17536
|
});
|
|
16812
17537
|
if (!licenseKey && !valid2 && isInsidePlayground) {
|
|
16813
17538
|
return true;
|
|
@@ -16903,6 +17628,7 @@ var import_react52 = require("react");
|
|
|
16903
17628
|
function onCellClick(context, event) {
|
|
16904
17629
|
var _a, _b;
|
|
16905
17630
|
updateRowSelectionOnCellClick(context, event);
|
|
17631
|
+
updateCellSelectionOnCellClick(context, event);
|
|
16906
17632
|
if (event.detail === 2) {
|
|
16907
17633
|
onCellDoubleClick(context, event);
|
|
16908
17634
|
}
|
|
@@ -16916,6 +17642,38 @@ function onCellDoubleClick(context, _event) {
|
|
|
16916
17642
|
columnId: column.id
|
|
16917
17643
|
});
|
|
16918
17644
|
}
|
|
17645
|
+
function updateCellSelectionOnCellClick(context, event) {
|
|
17646
|
+
const {
|
|
17647
|
+
getDataSourceState,
|
|
17648
|
+
getComputed,
|
|
17649
|
+
rowIndex,
|
|
17650
|
+
colIndex,
|
|
17651
|
+
dataSourceActions
|
|
17652
|
+
} = context;
|
|
17653
|
+
const dataSourceState = getDataSourceState();
|
|
17654
|
+
const { selectionMode, cellSelection: existingCellSelection } = dataSourceState;
|
|
17655
|
+
if (!existingCellSelection) {
|
|
17656
|
+
return;
|
|
17657
|
+
}
|
|
17658
|
+
if (selectionMode !== "multi-cell") {
|
|
17659
|
+
return;
|
|
17660
|
+
}
|
|
17661
|
+
const { multiCellSelector } = getComputed();
|
|
17662
|
+
const cellSelection = new CellSelectionState(existingCellSelection);
|
|
17663
|
+
multiCellSelector.cellSelectionState = cellSelection;
|
|
17664
|
+
const position2 = {
|
|
17665
|
+
rowIndex,
|
|
17666
|
+
colIndex
|
|
17667
|
+
};
|
|
17668
|
+
if (event.metaKey || event.ctrlKey) {
|
|
17669
|
+
multiCellSelector.singleAddClick(position2);
|
|
17670
|
+
} else if (event.shiftKey) {
|
|
17671
|
+
multiCellSelector.multiSelectClick(position2);
|
|
17672
|
+
} else {
|
|
17673
|
+
multiCellSelector.resetClick(position2);
|
|
17674
|
+
}
|
|
17675
|
+
dataSourceActions.cellSelection = cellSelection;
|
|
17676
|
+
}
|
|
16919
17677
|
function updateRowSelectionOnCellClick(context, event) {
|
|
16920
17678
|
const {
|
|
16921
17679
|
rowIndex,
|
|
@@ -16954,14 +17712,24 @@ function updateRowSelectionOnCellClick(context, event) {
|
|
|
16954
17712
|
} else if (selectionMode === "single-row") {
|
|
16955
17713
|
const id = dataArray[rowIndex].id;
|
|
16956
17714
|
if (event.metaKey || event.ctrlKey) {
|
|
16957
|
-
api.
|
|
17715
|
+
api.rowSelectionApi.toggleRowSelection(id);
|
|
16958
17716
|
} else {
|
|
16959
|
-
api.
|
|
17717
|
+
api.rowSelectionApi.selectRow(id);
|
|
16960
17718
|
}
|
|
16961
17719
|
}
|
|
16962
17720
|
return false;
|
|
16963
17721
|
}
|
|
16964
17722
|
|
|
17723
|
+
// src/components/InfiniteTable/eventHandlers/onCellMouseDown.ts
|
|
17724
|
+
function onCellMouseDown(context, event) {
|
|
17725
|
+
if (event.detail === 2) {
|
|
17726
|
+
return;
|
|
17727
|
+
}
|
|
17728
|
+
updateCellSelectionOnCellMouseDown(context);
|
|
17729
|
+
}
|
|
17730
|
+
function updateCellSelectionOnCellMouseDown(_context) {
|
|
17731
|
+
}
|
|
17732
|
+
|
|
16965
17733
|
// src/components/utils/clamp.ts
|
|
16966
17734
|
function clamp(value, min, max) {
|
|
16967
17735
|
return Math.min(Math.max(value, min), max);
|
|
@@ -17216,7 +17984,7 @@ function handleKeyboardSelection(context, keyboardEvent) {
|
|
|
17216
17984
|
return false;
|
|
17217
17985
|
}
|
|
17218
17986
|
if (selectionMode === "single-row" && key === " ") {
|
|
17219
|
-
imperativeApi.
|
|
17987
|
+
imperativeApi.rowSelectionApi.toggleRowSelection(rowInfo.id);
|
|
17220
17988
|
return true;
|
|
17221
17989
|
}
|
|
17222
17990
|
if (selectionMode !== "multi-row") {
|
|
@@ -17233,9 +18001,11 @@ function handleKeyboardSelection(context, keyboardEvent) {
|
|
|
17233
18001
|
if (key === " ") {
|
|
17234
18002
|
if (groupBy.length) {
|
|
17235
18003
|
if (rowInfo.isGroupRow && rowInfo.groupKeys) {
|
|
17236
|
-
imperativeApi.
|
|
18004
|
+
imperativeApi.rowSelectionApi.toggleGroupRowSelection(
|
|
18005
|
+
rowInfo.groupKeys
|
|
18006
|
+
);
|
|
17237
18007
|
} else {
|
|
17238
|
-
imperativeApi.
|
|
18008
|
+
imperativeApi.rowSelectionApi.toggleRowSelection(rowInfo.id);
|
|
17239
18009
|
}
|
|
17240
18010
|
return true;
|
|
17241
18011
|
} else {
|
|
@@ -17620,9 +18390,23 @@ function handleDOMEvents() {
|
|
|
17620
18390
|
);
|
|
17621
18391
|
}
|
|
17622
18392
|
const removeOnCellClick = context.getState().cellClick.onChange(cellClickHandler);
|
|
18393
|
+
function cellMouseDownHandler(param) {
|
|
18394
|
+
if (!param) {
|
|
18395
|
+
return;
|
|
18396
|
+
}
|
|
18397
|
+
const { event, rowIndex, colIndex } = param;
|
|
18398
|
+
const column = context.getComputed().computedVisibleColumns[colIndex];
|
|
18399
|
+
const columnApi = getColumnApiForColumn(column.id, context);
|
|
18400
|
+
onCellMouseDown(
|
|
18401
|
+
__spreadProps(__spreadValues({}, context), { rowIndex, colIndex, column, columnApi }),
|
|
18402
|
+
event
|
|
18403
|
+
);
|
|
18404
|
+
}
|
|
18405
|
+
const removeOnCellMouseDown = context.getState().cellMouseDown.onChange(cellMouseDownHandler);
|
|
17623
18406
|
return () => {
|
|
17624
18407
|
removeOnKeyDown();
|
|
17625
18408
|
removeOnCellClick();
|
|
18409
|
+
removeOnCellMouseDown();
|
|
17626
18410
|
};
|
|
17627
18411
|
}, []);
|
|
17628
18412
|
}
|
|
@@ -20295,18 +21079,6 @@ var InfiniteTableComponent = React64.memo(
|
|
|
20295
21079
|
scrollerDOMRef
|
|
20296
21080
|
}
|
|
20297
21081
|
), /* @__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
21082
|
"div",
|
|
20311
21083
|
{
|
|
20312
21084
|
ref: portalDOMRef,
|
|
@@ -20419,6 +21191,7 @@ var components = {
|
|
|
20419
21191
|
};
|
|
20420
21192
|
// Annotate the CommonJS export names for ESM import in node:
|
|
20421
21193
|
0 && (module.exports = {
|
|
21194
|
+
CellSelectionState,
|
|
20422
21195
|
DataSource,
|
|
20423
21196
|
DataSourceActionType,
|
|
20424
21197
|
DeepMap,
|