@infinite-table/infinite-react 0.4.9 → 0.4.12
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/README.md +3 -3
- package/index.css +146 -59
- package/index.d.ts +113 -39
- package/index.esm.css +146 -59
- package/index.esm.js +412 -134
- package/index.js +408 -134
- package/package.json +11 -2
package/index.esm.js
CHANGED
|
@@ -1105,7 +1105,7 @@ function stripVar(cssVariableWithVarString) {
|
|
|
1105
1105
|
|
|
1106
1106
|
// src/components/InfiniteTable/theme.css.ts
|
|
1107
1107
|
var InternalVars = { currentColumnWidth: "var(--_1slvgu90)", currentColumnTransformX: "var(--_1slvgu91)", currentColumnTransformY: "var(--_1slvgu92)", activeCellRowOffset: "var(--_1slvgu93)", activeCellRowHeight: "var(--_1slvgu94)", activeCellOffsetX: "var(--_1slvgu95)", activeCellOffsetY: "var(--_1slvgu96)", scrollTopForActiveRow: "var(--_1slvgu97)", activeCellColWidth: "var(--_1slvgu98)", activeCellColOffset: "var(--_1slvgu99)", columnReorderEffectDurationAtIndex: "var(--_1slvgu9a)", columnWidthAtIndex: "var(--_1slvgu9b)", columnOffsetAtIndex: "var(--_1slvgu9c)", columnOffsetAtIndexWhileReordering: "var(--_1slvgu9d)", columnZIndexAtIndex: "var(--_1slvgu9e)", pinnedStartWidth: "var(--_1slvgu9f)", pinnedEndWidth: "var(--_1slvgu9g)", pinnedEndOffset: "var(--_1slvgu9h)", computedVisibleColumnsCount: "var(--_1slvgu9i)", baseZIndexForCells: "var(--_1slvgu9j)", bodyWidth: "var(--_1slvgu9k)", bodyHeight: "var(--_1slvgu9l)", scrollbarWidthHorizontal: "var(--_1slvgu9m)", scrollbarWidthVertical: "var(--_1slvgu9n)", scrollLeft: "var(--_1slvgu9o)", scrollTop: "var(--_1slvgu9p)" };
|
|
1108
|
-
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)", 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)", 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)" }, 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)", activeBorderColor_R: "var(--infinite-active-cell-border-color--r)", activeBorderColor_G: "var(--infinite-active-cell-border-color--g)", activeBorderColor_B: "var(--infinite-active-cell-border-color--b)", 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)" }, 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)" } } };
|
|
1108
|
+
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)", 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)", 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)" }, 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)", activeBorderColor_R: "var(--infinite-active-cell-border-color--r)", activeBorderColor_G: "var(--infinite-active-cell-border-color--g)", activeBorderColor_B: "var(--infinite-active-cell-border-color--b)", 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)", itemHoverBackground: "var(--infinite-menu-item-hover-background)", itemHoverOpacity: "var(--infinite-menu-item-hover-opacity)", itemPressedOpacity: "var(--infinite-menu-item-pressed-opacity)", itemPressedBackground: "var(--infinite-menu-item-pressed-background)", itemDisabledOpacity: "var(--infinite-menu-item-disabled-opacity)" }, 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)" } } };
|
|
1109
1109
|
var columnHeaderHeightName = "column-header-height";
|
|
1110
1110
|
|
|
1111
1111
|
// src/utils/selectParent.ts
|
|
@@ -3664,11 +3664,11 @@ var useRerender = () => {
|
|
|
3664
3664
|
};
|
|
3665
3665
|
|
|
3666
3666
|
// src/components/InfiniteTable/components/ActiveCellIndicator.css.ts
|
|
3667
|
-
var ActiveCellIndicatorCls = { visible: "nxbq1c2 nxbq1c1
|
|
3668
|
-
var ActiveIndicatorWrapperCls = "
|
|
3667
|
+
var ActiveCellIndicatorCls = { visible: "nxbq1c2 nxbq1c1 _16lm1iwi _16lm1iw3 _16lm1iw1b _16lm1iw19", hidden: "nxbq1c3 nxbq1c1 _16lm1iwi _16lm1iw3 _16lm1iw1b _16lm1iw19" };
|
|
3668
|
+
var ActiveIndicatorWrapperCls = "_16lm1iwi _16lm1iw3 _16lm1iw1b _16lm1iw19 _16lm1iw15 _16lm1iwr";
|
|
3669
3669
|
|
|
3670
3670
|
// src/components/InfiniteTable/components/ActiveRowIndicator.css.ts
|
|
3671
|
-
var ActiveRowIndicatorCls = { visible: "j26lrx1 j26lrx0
|
|
3671
|
+
var ActiveRowIndicatorCls = { visible: "j26lrx1 j26lrx0 _16lm1iwi _16lm1iw3 _16lm1iw18 _16lm1iw19 _16lm1iw1b", hidden: "j26lrx2 j26lrx0 _16lm1iwi _16lm1iw3 _16lm1iw18 _16lm1iw19 _16lm1iw1b" };
|
|
3672
3672
|
|
|
3673
3673
|
// src/components/InfiniteTable/components/ActiveRowIndicator.tsx
|
|
3674
3674
|
var { rootClassName: rootClassName3 } = internalProps;
|
|
@@ -4215,20 +4215,20 @@ var useInternalProps = () => {
|
|
|
4215
4215
|
};
|
|
4216
4216
|
|
|
4217
4217
|
// src/components/InfiniteTable/utilities.css.ts
|
|
4218
|
-
var alignItems = { center: "
|
|
4219
|
-
var cssEllipsisClassName = "
|
|
4220
|
-
var cursor = { pointer: "
|
|
4221
|
-
var display = { flex: "
|
|
4222
|
-
var flex = { "1": "
|
|
4223
|
-
var flexFlow = { column: "
|
|
4224
|
-
var justifyContent = { center: "
|
|
4225
|
-
var left = { "0": "
|
|
4226
|
-
var overflow = { hidden: "
|
|
4218
|
+
var alignItems = { center: "_16lm1iw1n", stretch: "_16lm1iw1o" };
|
|
4219
|
+
var cssEllipsisClassName = "_16lm1iw1y _16lm1iw1z _16lm1iw1s";
|
|
4220
|
+
var cursor = { pointer: "_16lm1iwf", "default": "_16lm1iwg", colResize: "_16lm1iwh" };
|
|
4221
|
+
var display = { flex: "_16lm1iww", contents: "_16lm1iwx", none: "_16lm1iwy", block: "_16lm1iwz", grid: "_16lm1iw10", inlineBlock: "_16lm1iw11", inlineFlex: "_16lm1iw12", inlineGrid: "_16lm1iw13" };
|
|
4222
|
+
var flex = { "1": "_16lm1iwj", none: "_16lm1iwk" };
|
|
4223
|
+
var flexFlow = { column: "_16lm1iw1j", columnReverse: "_16lm1iw1k", row: "_16lm1iw1l", rowReverse: "_16lm1iw1m" };
|
|
4224
|
+
var justifyContent = { center: "_16lm1iw1p", start: "_16lm1iw1q", end: "_16lm1iw1r" };
|
|
4225
|
+
var left = { "0": "_16lm1iw1b", "100%": "_16lm1iw1c", auto: "_16lm1iw1d" };
|
|
4226
|
+
var overflow = { hidden: "_16lm1iw1s", auto: "_16lm1iw1t", visible: "_16lm1iw1u" };
|
|
4227
4227
|
var position = { relative: "_16lm1iw1", absolute: "_16lm1iw2", sticky: "_16lm1iw3", fixed: "_16lm1iw4" };
|
|
4228
|
-
var top = { "0": "
|
|
4229
|
-
var transformTranslateZero = "
|
|
4230
|
-
var userSelect = { none: "
|
|
4231
|
-
var zIndex = { "1": "
|
|
4228
|
+
var top = { "0": "_16lm1iw19", "100%": "_16lm1iw1a" };
|
|
4229
|
+
var transformTranslateZero = "_16lm1iwb";
|
|
4230
|
+
var userSelect = { none: "_16lm1iw14" };
|
|
4231
|
+
var zIndex = { "1": "_16lm1iwl", "10": "_16lm1iwm", "100": "_16lm1iwn", "1000": "_16lm1iwo", "10000": "_16lm1iwp", "100000": "_16lm1iwq", "1000000": "_16lm1iwr", "10000000": "_16lm1iws", "1k": "_16lm1iwt", "10k": "_16lm1iwu", "100k": "_16lm1iwv" };
|
|
4232
4232
|
|
|
4233
4233
|
// src/components/InfiniteTable/components/InfiniteTableBody/InfiniteTableBody.tsx
|
|
4234
4234
|
var InfiniteTableBody = forwardRef2(function InfiniteTableBody2(props, ref) {
|
|
@@ -4360,6 +4360,10 @@ function useCellClassName(column, baseClasses, variants, extraFlags) {
|
|
|
4360
4360
|
if (extraFlags.rowSelected) {
|
|
4361
4361
|
result.push(...baseClasses.map((c) => `${c}--row-selected`));
|
|
4362
4362
|
}
|
|
4363
|
+
if (extraFlags.groupRow) {
|
|
4364
|
+
result.push(...baseClasses.map((c) => `${c}--group-row`));
|
|
4365
|
+
result.push(...baseClasses.map((c) => `${c}--${extraFlags.rowExpanded ? "group-row-expanded" : "group-row-collapsed"}`));
|
|
4366
|
+
}
|
|
4363
4367
|
if (column.computedPinned) {
|
|
4364
4368
|
result.push(...baseClasses.map((c) => `${c}--pinned-${column.computedPinned}`));
|
|
4365
4369
|
} else {
|
|
@@ -4393,14 +4397,14 @@ var useInfiniteTable = () => {
|
|
|
4393
4397
|
// src/components/InfiniteTable/InfiniteCls.css.ts
|
|
4394
4398
|
var import_createRuntimeFn = __toModule(require_vanilla_extract_recipes_createRuntimeFn_cjs());
|
|
4395
4399
|
var FooterCls = "_16lm1iw1";
|
|
4396
|
-
var InfiniteCls = "_1yeub2v0 _16lm1iw1
|
|
4400
|
+
var InfiniteCls = "_1yeub2v0 _16lm1iw1 _16lm1iww _16lm1iw1j _16lm1iw0";
|
|
4397
4401
|
var InfiniteClsHasPinnedEnd = "_1yeub2vo";
|
|
4398
4402
|
var InfiniteClsHasPinnedStart = "_1yeub2vn";
|
|
4399
4403
|
var InfiniteClsRecipe = (0, import_createRuntimeFn.createRuntimeFn)({ defaultClassName: "", variantClassNames: { focused: { true: "_1yeub2v2", false: "_1yeub2v3" }, focusedWithin: { true: "_1yeub2v4", false: "_1yeub2v5" }, hasPinnedStart: { true: "_1yeub2v6", false: "_1yeub2v7" }, hasPinnedEnd: { true: "_1yeub2v8", false: "_1yeub2v9" }, hasPinnedStartOverflow: { true: "_1yeub2va", false: "_1yeub2vb" }, hasPinnedEndOverflow: { true: "_1yeub2vc", false: "_1yeub2vd" } }, defaultVariants: {}, compoundVariants: [[{ focused: false, focusedWithin: false }, "_1yeub2ve"]] });
|
|
4400
4404
|
var InfiniteClsShiftingColumns = "_1yeub2vl";
|
|
4401
|
-
var PinnedEndIndicatorBorder = "_1yeub2vr _1yeub2vp _16lm1iw2
|
|
4405
|
+
var PinnedEndIndicatorBorder = "_1yeub2vr _1yeub2vp _16lm1iw2 _16lm1iw19 _16lm1iwh _16lm1iw14 _16lm1iw17 _16lm1iw1w _16lm1iwi _16lm1iws";
|
|
4402
4406
|
var PinnedRowsContainerClsVariants = (0, import_createRuntimeFn.createRuntimeFn)({ defaultClassName: "", variantClassNames: { pinned: { start: "_1yeub2vi", end: "_1yeub2vj", false: "_1yeub2vk" } }, defaultVariants: {}, compoundVariants: [] });
|
|
4403
|
-
var PinnedStartIndicatorBorder = "_1yeub2vq _1yeub2vp _16lm1iw2
|
|
4407
|
+
var PinnedStartIndicatorBorder = "_1yeub2vq _1yeub2vp _16lm1iw2 _16lm1iw19 _16lm1iwh _16lm1iw14 _16lm1iw17 _16lm1iw1w _16lm1iwi _16lm1iws";
|
|
4404
4408
|
|
|
4405
4409
|
// src/components/utils/getScrollbarWidth.ts
|
|
4406
4410
|
var scrollbarWidth;
|
|
@@ -5133,7 +5137,7 @@ var useColumnPointerEvents = ({
|
|
|
5133
5137
|
};
|
|
5134
5138
|
};
|
|
5135
5139
|
|
|
5136
|
-
// src/components/InfiniteTable/utils/
|
|
5140
|
+
// src/components/InfiniteTable/utils/RenderHookComponentForInfinite.tsx
|
|
5137
5141
|
import {
|
|
5138
5142
|
createElement as createElement19
|
|
5139
5143
|
} from "react";
|
|
@@ -5169,8 +5173,8 @@ import { useState as useState6 } from "react";
|
|
|
5169
5173
|
|
|
5170
5174
|
// src/components/InfiniteTable/components/icons/ExpanderIcon.css.ts
|
|
5171
5175
|
var import_createRuntimeFn2 = __toModule(require_vanilla_extract_recipes_createRuntimeFn_cjs());
|
|
5172
|
-
var ExpanderIconCls = "_16lm1iw6
|
|
5173
|
-
var ExpanderIconClsVariants = (0, import_createRuntimeFn2.createRuntimeFn)({ defaultClassName: "", variantClassNames: { expanded: { true: "
|
|
5176
|
+
var ExpanderIconCls = "_16lm1iw6 _16lm1iwk _16lm1iwf";
|
|
5177
|
+
var ExpanderIconClsVariants = (0, import_createRuntimeFn2.createRuntimeFn)({ defaultClassName: "", variantClassNames: { expanded: { true: "_16lm1iwd", false: "_198z9782" }, direction: { end: "_198z9783", start: "_198z9784" } }, defaultVariants: {}, compoundVariants: [[{ expanded: false, direction: "end" }, "_16lm1iwe"]] });
|
|
5174
5178
|
|
|
5175
5179
|
// src/components/InfiniteTable/components/icons/ExpanderIcon.tsx
|
|
5176
5180
|
function ExpanderIcon(props) {
|
|
@@ -5212,7 +5216,7 @@ import {
|
|
|
5212
5216
|
} from "react";
|
|
5213
5217
|
|
|
5214
5218
|
// src/components/InfiniteTable/components/icons/LoadingIcon.css.ts
|
|
5215
|
-
var LoadingIconCls = "
|
|
5219
|
+
var LoadingIconCls = "_16lm1iw9 _16lm1iwk _16lm1iwf";
|
|
5216
5220
|
|
|
5217
5221
|
// src/components/InfiniteTable/components/icons/LoadingIcon.tsx
|
|
5218
5222
|
var LoadingIcon = (props) => {
|
|
@@ -5410,7 +5414,7 @@ function objectValuesExcept(obj, exceptList) {
|
|
|
5410
5414
|
|
|
5411
5415
|
// src/components/InfiniteTable/components/cell.css.ts
|
|
5412
5416
|
var import_createRuntimeFn4 = __toModule(require_vanilla_extract_recipes_createRuntimeFn_cjs());
|
|
5413
|
-
var ColumnCellCls = "_1eexc2a6 _1eexc2a5
|
|
5417
|
+
var ColumnCellCls = "_1eexc2a6 _1eexc2a5 _16lm1iww _16lm1iw1l _16lm1iw1n _16lm1iw2 _16lm1iw1x _16lm1iw1y _16lm1iw14";
|
|
5414
5418
|
var ColumnCellRecipe = (0, import_createRuntimeFn4.createRuntimeFn)({ defaultClassName: "_1eexc2a8", variantClassNames: { dragging: { false: "_1eexc2a9", true: "_1eexc2aa" }, rowActive: { false: "_1eexc2ab", true: "_1eexc2ac" }, zebra: { false: "_1eexc2ad", even: "_1eexc2ae", odd: "_1eexc2af" }, rowSelected: { true: "_1eexc2ag", false: "_1eexc2ah", null: "_1eexc2ai" }, first: { true: "_1eexc2aj", false: "_1eexc2ak" }, last: { true: "_1eexc2al", false: "_1eexc2am" }, groupByField: { true: "_1eexc2an", false: "_1eexc2ao" }, firstInCategory: { true: "_1eexc2ap", false: "_1eexc2aq" }, lastInCategory: { true: "_1eexc2ar", false: "_1eexc2as" }, pinned: { start: "_1eexc2at", end: "_1eexc2au", false: "_1eexc2av" }, filtered: { true: "_1eexc2aw", false: "_1eexc2ax" } }, defaultVariants: {}, compoundVariants: [[{ pinned: "start", lastInCategory: true }, "_1eexc2ay"], [{ pinned: "start", firstInCategory: true }, "_1eexc2az"], [{ pinned: "end", firstInCategory: true }, "_1eexc2a10"], [{ pinned: "end", lastInCategory: true }, "_1eexc2a11"]] });
|
|
5415
5419
|
var SelectionCheckboxCls = "_1eexc2a7";
|
|
5416
5420
|
|
|
@@ -5421,7 +5425,7 @@ import {
|
|
|
5421
5425
|
import { useEffect as useEffect10, useRef as useRef11 } from "react";
|
|
5422
5426
|
|
|
5423
5427
|
// src/components/InfiniteTable/components/CheckBox.css.ts
|
|
5424
|
-
var CheckBoxCls = "
|
|
5428
|
+
var CheckBoxCls = "_16lm1iwf";
|
|
5425
5429
|
|
|
5426
5430
|
// src/components/InfiniteTable/components/CheckBox.tsx
|
|
5427
5431
|
function forwardProps2() {
|
|
@@ -5906,7 +5910,14 @@ function InfiniteTableColumnCellFn(props) {
|
|
|
5906
5910
|
onClick,
|
|
5907
5911
|
onMouseDown,
|
|
5908
5912
|
cssEllipsis: (_a = column.cssEllipsis) != null ? _a : true,
|
|
5909
|
-
className: join(useCellClassName(column, [InfiniteTableColumnCellClassName, InfiniteTableCellClassName], ColumnCellRecipe, {
|
|
5913
|
+
className: join(useCellClassName(column, [InfiniteTableColumnCellClassName, InfiniteTableCellClassName], ColumnCellRecipe, {
|
|
5914
|
+
dragging: false,
|
|
5915
|
+
zebra,
|
|
5916
|
+
rowActive,
|
|
5917
|
+
rowSelected,
|
|
5918
|
+
groupRow: rowInfo.isGroupRow,
|
|
5919
|
+
rowExpanded: rowInfo.isGroupRow ? !rowInfo.collapsed : false
|
|
5920
|
+
}), colClassName, rowComputedClassName),
|
|
5910
5921
|
renderChildren
|
|
5911
5922
|
};
|
|
5912
5923
|
return /* @__PURE__ */ createElement18(InfiniteTableCell, __spreadValues({}, cellProps));
|
|
@@ -5917,11 +5928,13 @@ function useInfiniteColumnCell() {
|
|
|
5917
5928
|
return result;
|
|
5918
5929
|
}
|
|
5919
5930
|
|
|
5920
|
-
// src/components/
|
|
5931
|
+
// src/components/RenderHookComponent.tsx
|
|
5921
5932
|
function RenderHookComponent(props) {
|
|
5922
5933
|
var _a;
|
|
5923
5934
|
return (_a = props.render(props.renderParam)) != null ? _a : null;
|
|
5924
5935
|
}
|
|
5936
|
+
|
|
5937
|
+
// src/components/InfiniteTable/utils/RenderHookComponentForInfinite.tsx
|
|
5925
5938
|
function RenderCellHookComponent(props) {
|
|
5926
5939
|
const ContextProvider = InfiniteTableColumnCellContext.Provider;
|
|
5927
5940
|
return /* @__PURE__ */ createElement19(ContextProvider, {
|
|
@@ -5987,19 +6000,19 @@ import { useEffect as useEffect11, useState as useState7 } from "react";
|
|
|
5987
6000
|
|
|
5988
6001
|
// src/components/InfiniteTable/components/InfiniteTableHeader/header.css.ts
|
|
5989
6002
|
var import_createRuntimeFn5 = __toModule(require_vanilla_extract_recipes_createRuntimeFn_cjs());
|
|
5990
|
-
var CellCls = "_1eexc2a5
|
|
5991
|
-
var HeaderCellContentRecipe = (0, import_createRuntimeFn5.createRuntimeFn)({ defaultClassName: "_12zfob11e
|
|
5992
|
-
var HeaderCellProxy = "_12zfob1k
|
|
5993
|
-
var HeaderCellRecipe = (0, import_createRuntimeFn5.createRuntimeFn)({ defaultClassName: "_12zfob1l
|
|
5994
|
-
var HeaderClsRecipe = (0, import_createRuntimeFn5.createRuntimeFn)({ defaultClassName: "_12zfob16
|
|
5995
|
-
var HeaderFilterCls = "_12zfob11j
|
|
5996
|
-
var HeaderFilterEditorCls = "
|
|
5997
|
-
var HeaderGroupCls = "_12zfob11i
|
|
6003
|
+
var CellCls = "_1eexc2a5 _16lm1iww _16lm1iw1l _16lm1iw1n _16lm1iw2 _16lm1iw1x _16lm1iw1y _16lm1iw14";
|
|
6004
|
+
var HeaderCellContentRecipe = (0, import_createRuntimeFn5.createRuntimeFn)({ defaultClassName: "_12zfob11e _16lm1iw16 _16lm1iw18 _16lm1iww _16lm1iw1l _16lm1iw1n", variantClassNames: { filtered: { false: "_12zfob11f", true: "_12zfob11g" } }, defaultVariants: {}, compoundVariants: [] });
|
|
6005
|
+
var HeaderCellProxy = "_12zfob1k _16lm1iw1y _16lm1iw1z _16lm1iw1s";
|
|
6006
|
+
var HeaderCellRecipe = (0, import_createRuntimeFn5.createRuntimeFn)({ defaultClassName: "_12zfob1l _16lm1iwz", variantClassNames: { rowActive: { false: "_12zfob1m", true: "_12zfob1n" }, rowSelected: { false: "_12zfob1o", true: "_12zfob1p", null: "_12zfob1q" }, zebra: { false: "_12zfob1r", even: "_12zfob1s", odd: "_12zfob1t" }, dragging: { true: "_12zfob1u", false: "_12zfob1v" }, first: { true: "_12zfob1w", false: "_12zfob1x" }, last: { true: "_12zfob1y", false: "_12zfob1z" }, groupByField: { true: "_12zfob110", false: "_12zfob111" }, firstInCategory: { true: "_12zfob112", false: "_12zfob113" }, lastInCategory: { true: "_12zfob114", false: "_12zfob115" }, pinned: { start: "_12zfob116", end: "_12zfob117", false: "_12zfob118" }, filtered: { true: "_12zfob119", false: "_12zfob11a" } }, defaultVariants: {}, compoundVariants: [[{ pinned: "start", lastInCategory: true }, "_12zfob11b"], [{ pinned: "end", firstInCategory: true }, "_12zfob11c"], [{ pinned: false, lastInCategory: true }, "_12zfob11d"]] });
|
|
6007
|
+
var HeaderClsRecipe = (0, import_createRuntimeFn5.createRuntimeFn)({ defaultClassName: "_12zfob16 _16lm1iwz _16lm1iw2", variantClassNames: { pinned: { start: "_12zfob17", end: "_12zfob18", false: "_12zfob19" }, firstInCategory: { true: "_12zfob1a", false: "_12zfob1b" }, lastInCategory: { true: "_12zfob1c", false: "_12zfob1d" }, overflow: { true: "_12zfob1e", false: "_12zfob1f" } }, defaultVariants: {}, compoundVariants: [[{ overflow: true, pinned: "start" }, "_12zfob1g"], [{ pinned: "start", firstInCategory: true }, "_12zfob1h"], [{ overflow: true, pinned: "end" }, "_12zfob1i"], [{ pinned: "end", lastInCategory: true }, "_12zfob1j"]] });
|
|
6008
|
+
var HeaderFilterCls = "_12zfob11j _16lm1iww _16lm1iw1l _16lm1iw1n _16lm1iw1";
|
|
6009
|
+
var HeaderFilterEditorCls = "_16lm1iw18 _16lm1iw16";
|
|
6010
|
+
var HeaderGroupCls = "_12zfob11i _16lm1iww _16lm1iw1l _16lm1iw1n";
|
|
5998
6011
|
var HeaderScrollbarPlaceholderCls = "_12zfob15 _16lm1iw2";
|
|
5999
6012
|
var HeaderSortIconCls = "_16lm1iw1";
|
|
6000
6013
|
var HeaderSortIconIndexCls = "_12zfob14";
|
|
6001
6014
|
var HeaderSortIconRecipe = (0, import_createRuntimeFn5.createRuntimeFn)({ defaultClassName: "", variantClassNames: { align: { start: "_12zfob11", center: "_12zfob12", end: "_12zfob13" } }, defaultVariants: {}, compoundVariants: [] });
|
|
6002
|
-
var HeaderWrapperCls = "_12zfob11h
|
|
6015
|
+
var HeaderWrapperCls = "_12zfob11h _16lm1iw1s _16lm1iw1 _16lm1iww _16lm1iw1l";
|
|
6003
6016
|
|
|
6004
6017
|
// src/components/InfiniteTable/components/icons/SortIcon.tsx
|
|
6005
6018
|
var defaultLineStyle = {
|
|
@@ -6569,9 +6582,9 @@ function getColumnGroupResizer(colIndexes, config) {
|
|
|
6569
6582
|
|
|
6570
6583
|
// src/components/InfiniteTable/components/InfiniteTableHeader/ResizeHandle/ResizeHandle.css.ts
|
|
6571
6584
|
var import_createRuntimeFn6 = __toModule(require_vanilla_extract_recipes_createRuntimeFn_cjs());
|
|
6572
|
-
var ResizeHandleCls = "zneyzh0 _16lm1iw2
|
|
6573
|
-
var ResizeHandleDraggerClsRecipe = (0, import_createRuntimeFn6.createRuntimeFn)({ defaultClassName: "zneyzhb _16lm1iw2
|
|
6574
|
-
var ResizeHandleRecipeCls = (0, import_createRuntimeFn6.createRuntimeFn)({ defaultClassName: "", variantClassNames: { computedPinned: { start: "zneyzh1", end: "zneyzh2
|
|
6585
|
+
var ResizeHandleCls = "zneyzh0 _16lm1iw2 _16lm1iw19 _16lm1iw1g _16lm1iw1e _16lm1iwh _16lm1iw1s";
|
|
6586
|
+
var ResizeHandleDraggerClsRecipe = (0, import_createRuntimeFn6.createRuntimeFn)({ defaultClassName: "zneyzhb _16lm1iw2 _16lm1iw19 _16lm1iw1e", variantClassNames: { constrained: { false: "zneyzhc", true: "zneyzhd" } }, defaultVariants: {}, compoundVariants: [] });
|
|
6587
|
+
var ResizeHandleRecipeCls = (0, import_createRuntimeFn6.createRuntimeFn)({ defaultClassName: "", variantClassNames: { computedPinned: { start: "zneyzh1", end: "zneyzh2 _16lm1iw1b _16lm1iw1i", false: "zneyzh3" }, computedFirstInCategory: { true: "zneyzh4", false: "zneyzh5" }, computedLastInCategory: { true: "zneyzh6", false: "zneyzh7" } }, defaultVariants: {}, compoundVariants: [[{ computedPinned: "end", computedLastInCategory: false, computedFirstInCategory: true }, "zneyzh8"], [{ computedPinned: false, computedFirstInCategory: false, computedLastInCategory: true }, "zneyzh9"], [{ computedPinned: "start", computedFirstInCategory: false, computedLastInCategory: true }, "zneyzha"]] });
|
|
6575
6588
|
|
|
6576
6589
|
// src/components/InfiniteTable/components/InfiniteTableHeader/ResizeHandle/index.tsx
|
|
6577
6590
|
var { rootClassName: rootClassName8 } = internalProps;
|
|
@@ -6954,7 +6967,9 @@ function InfiniteTableHeaderCell(props) {
|
|
|
6954
6967
|
dragging,
|
|
6955
6968
|
rowSelected: false,
|
|
6956
6969
|
zebra: false,
|
|
6957
|
-
rowActive: false
|
|
6970
|
+
rowActive: false,
|
|
6971
|
+
groupRow: false,
|
|
6972
|
+
rowExpanded: false
|
|
6958
6973
|
}), CellCls),
|
|
6959
6974
|
cssEllipsis: (_e = (_d = column.headerCssEllipsis) != null ? _d : column.cssEllipsis) != null ? _e : true,
|
|
6960
6975
|
afterChildren: /* @__PURE__ */ createElement25(Fragment3, null, showColumnFilters ? column.computedFilterable ? /* @__PURE__ */ createElement25(InfiniteTableColumnHeaderFilter, {
|
|
@@ -7568,8 +7583,8 @@ import {
|
|
|
7568
7583
|
} from "react";
|
|
7569
7584
|
|
|
7570
7585
|
// src/components/InfiniteTable/components/LoadMask.css.ts
|
|
7571
|
-
var LoadMaskCls = { visible: "qy58ya1 qy58ya0 _16lm1iw2
|
|
7572
|
-
var LoadMaskOverlayCls = "qy58ya3 _16lm1iw2
|
|
7586
|
+
var LoadMaskCls = { visible: "qy58ya1 qy58ya0 _16lm1iw2 _16lm1iw19 _16lm1iw1b _16lm1iw1g _16lm1iw1e", hidden: "qy58ya2 qy58ya0 _16lm1iw2 _16lm1iw19 _16lm1iw1b _16lm1iw1g _16lm1iw1e" };
|
|
7587
|
+
var LoadMaskOverlayCls = "qy58ya3 _16lm1iw2 _16lm1iw19 _16lm1iw1b _16lm1iw1g _16lm1iw1e";
|
|
7573
7588
|
var LoadMaskTextCls = "qy58ya4";
|
|
7574
7589
|
|
|
7575
7590
|
// src/components/InfiniteTable/components/LoadMask.tsx
|
|
@@ -7618,12 +7633,14 @@ function deepClone(source) {
|
|
|
7618
7633
|
return target;
|
|
7619
7634
|
}
|
|
7620
7635
|
|
|
7621
|
-
// src/utils/groupAndPivot/
|
|
7622
|
-
var LAZY_ROOT_KEY_FOR_GROUPS = "____root____";
|
|
7623
|
-
var NOT_LOADED_YET_KEY_PREFIX = "____not_loaded_yet____";
|
|
7636
|
+
// src/utils/groupAndPivot/defaultToKey.ts
|
|
7624
7637
|
function DEFAULT_TO_KEY(value) {
|
|
7625
7638
|
return value;
|
|
7626
7639
|
}
|
|
7640
|
+
|
|
7641
|
+
// src/utils/groupAndPivot/index.ts
|
|
7642
|
+
var LAZY_ROOT_KEY_FOR_GROUPS = "____root____";
|
|
7643
|
+
var NOT_LOADED_YET_KEY_PREFIX = "____not_loaded_yet____";
|
|
7627
7644
|
function initReducers(reducers) {
|
|
7628
7645
|
if (!reducers || !Object.keys(reducers).length) {
|
|
7629
7646
|
return {};
|
|
@@ -7696,6 +7713,14 @@ function lazyGroup(groupParams, rootData) {
|
|
|
7696
7713
|
if (currentGroupKeys.length == groupBy.length && groupBy.length) {
|
|
7697
7714
|
if (current) {
|
|
7698
7715
|
current.items = dataArray;
|
|
7716
|
+
for (let i = 0, len = currentGroupKeys.length; i < len; i++) {
|
|
7717
|
+
const currentKeys = currentGroupKeys.slice(0, i);
|
|
7718
|
+
const deepMapGroupValue = deepMap.get(currentKeys);
|
|
7719
|
+
if (deepMapGroupValue) {
|
|
7720
|
+
deepMapGroupValue.items = deepMapGroupValue.items || [];
|
|
7721
|
+
deepMapGroupValue.items = deepMapGroupValue.items.concat(dataArray);
|
|
7722
|
+
}
|
|
7723
|
+
}
|
|
7699
7724
|
indexer.indexArray(dataArray, toPrimaryKey);
|
|
7700
7725
|
}
|
|
7701
7726
|
return next == null ? void 0 : next();
|
|
@@ -7716,7 +7741,7 @@ function lazyGroup(groupParams, rootData) {
|
|
|
7716
7741
|
continue;
|
|
7717
7742
|
}
|
|
7718
7743
|
const dataObject = dataArray[i].data;
|
|
7719
|
-
const dataKeys = dataArray[i].keys;
|
|
7744
|
+
const dataKeys = dataArray[i].keys || [];
|
|
7720
7745
|
if (dataKeys.length) {
|
|
7721
7746
|
const key = dataKeys[dataKeys.length - 1];
|
|
7722
7747
|
currentGroupKeys.push(key);
|
|
@@ -7785,14 +7810,6 @@ function processGroup(deepMap, currentGroupKeys, currentPivotKeys, item, itemInd
|
|
|
7785
7810
|
currentPivotKeys.length = 0;
|
|
7786
7811
|
}
|
|
7787
7812
|
}
|
|
7788
|
-
function getGroupKeysForDataItem(data, groupBy) {
|
|
7789
|
-
return groupBy.reduce((groupKeys, groupBy2) => {
|
|
7790
|
-
const { field: groupByProperty, toKey: groupToKey } = groupBy2;
|
|
7791
|
-
const key = (groupToKey || DEFAULT_TO_KEY)(data[groupByProperty], data);
|
|
7792
|
-
groupKeys.push(key);
|
|
7793
|
-
return groupKeys;
|
|
7794
|
-
}, []);
|
|
7795
|
-
}
|
|
7796
7813
|
function group(groupParams, data) {
|
|
7797
7814
|
const {
|
|
7798
7815
|
groupBy,
|
|
@@ -7894,7 +7911,7 @@ function flatten(groupResult) {
|
|
|
7894
7911
|
}
|
|
7895
7912
|
function getEnhancedGroupData(options, deepMapValue) {
|
|
7896
7913
|
var _a;
|
|
7897
|
-
const { groupBy, groupKeys,
|
|
7914
|
+
const { groupBy, groupKeys, parents, reducers, lazyLoad } = options;
|
|
7898
7915
|
const groupNesting = groupKeys.length;
|
|
7899
7916
|
const {
|
|
7900
7917
|
items: groupItems,
|
|
@@ -7929,7 +7946,7 @@ function getEnhancedGroupData(options, deepMapValue) {
|
|
|
7929
7946
|
selectedChildredCount: 0,
|
|
7930
7947
|
deselectedChildredCount: 0,
|
|
7931
7948
|
id: `${groupKeys}`,
|
|
7932
|
-
collapsed,
|
|
7949
|
+
collapsed: false,
|
|
7933
7950
|
dataSourceHasGrouping: true,
|
|
7934
7951
|
selfLoaded,
|
|
7935
7952
|
error: options.error,
|
|
@@ -7988,7 +8005,7 @@ function enhancedFlatten(param) {
|
|
|
7988
8005
|
var _a, _b;
|
|
7989
8006
|
const items = deepMapValue.items;
|
|
7990
8007
|
const groupNesting = groupKeys.length;
|
|
7991
|
-
|
|
8008
|
+
let collapsed = (_a = groupRowsState == null ? void 0 : groupRowsState.isGroupRowCollapsed(groupKeys)) != null ? _a : false;
|
|
7992
8009
|
indexInParentGroups.push(indexInGroup);
|
|
7993
8010
|
const enhancedGroupData = getEnhancedGroupData({
|
|
7994
8011
|
lazyLoad,
|
|
@@ -8001,11 +8018,10 @@ function enhancedFlatten(param) {
|
|
|
8001
8018
|
groupKeys,
|
|
8002
8019
|
error: deepMapValue.error,
|
|
8003
8020
|
totalChildrenCount: deepMapValue.totalChildrenCount,
|
|
8004
|
-
childrenLoading: deepMapValue.childrenLoading,
|
|
8021
|
+
childrenLoading: (deepMapValue.childrenLoading || !collapsed && !deepMapValue.childrenAvailable) && lazyLoad,
|
|
8005
8022
|
childrenAvailable: deepMapValue.childrenAvailable,
|
|
8006
8023
|
directChildrenCount: groupKeys.length === groupByStrings.length ? deepMapValue.items.length : deepMap.getDirectChildrenSizeFor(groupKeys),
|
|
8007
|
-
directChildrenLoadedCount: 0
|
|
8008
|
-
collapsed
|
|
8024
|
+
directChildrenLoadedCount: 0
|
|
8009
8025
|
}, deepMapValue);
|
|
8010
8026
|
if (isRowSelected) {
|
|
8011
8027
|
enhancedGroupData.rowSelected = isRowSelected(enhancedGroupData);
|
|
@@ -8017,6 +8033,10 @@ function enhancedFlatten(param) {
|
|
|
8017
8033
|
}
|
|
8018
8034
|
const parent = parents[parents.length - 1];
|
|
8019
8035
|
const parentCollapsed = (_b = parent == null ? void 0 : parent.collapsed) != null ? _b : false;
|
|
8036
|
+
if (parentCollapsed) {
|
|
8037
|
+
collapsed = true;
|
|
8038
|
+
}
|
|
8039
|
+
enhancedGroupData.collapsed = collapsed;
|
|
8020
8040
|
let include = generateGroupRows || collapsed;
|
|
8021
8041
|
if (parentCollapsed) {
|
|
8022
8042
|
include = false;
|
|
@@ -8024,27 +8044,16 @@ function enhancedFlatten(param) {
|
|
|
8024
8044
|
if (include) {
|
|
8025
8045
|
result.push(enhancedGroupData);
|
|
8026
8046
|
}
|
|
8027
|
-
|
|
8028
|
-
|
|
8029
|
-
|
|
8030
|
-
|
|
8031
|
-
|
|
8032
|
-
}
|
|
8033
|
-
parent2.collapsedChildrenCount += enhancedGroupData.groupCount;
|
|
8034
|
-
parent2.collapsedGroupsCount += 1;
|
|
8035
|
-
});
|
|
8036
|
-
} else {
|
|
8037
|
-
if (!parentCollapsed) {
|
|
8038
|
-
parents.forEach((parent2) => {
|
|
8039
|
-
parent2.deepRowInfoArray.push(enhancedGroupData);
|
|
8040
|
-
});
|
|
8041
|
-
}
|
|
8042
|
-
}
|
|
8047
|
+
enhancedGroupData.collapsedChildrenCount = 0;
|
|
8048
|
+
parents.forEach((parent2) => {
|
|
8049
|
+
parent2.deepRowInfoArray.push(enhancedGroupData);
|
|
8050
|
+
parent2.collapsedGroupsCount += collapsed ? 1 : 0;
|
|
8051
|
+
});
|
|
8043
8052
|
if (parent && enhancedGroupData.selfLoaded && lazyLoad) {
|
|
8044
8053
|
parent.directChildrenLoadedCount += 1;
|
|
8045
8054
|
}
|
|
8046
8055
|
parents.push(enhancedGroupData);
|
|
8047
|
-
const continueWithChildren =
|
|
8056
|
+
const continueWithChildren = true;
|
|
8048
8057
|
if (continueWithChildren) {
|
|
8049
8058
|
if (!next) {
|
|
8050
8059
|
if (!pivot) {
|
|
@@ -8082,9 +8091,10 @@ function enhancedFlatten(param) {
|
|
|
8082
8091
|
if (last && item) {
|
|
8083
8092
|
parent2.directChildrenLoadedCount += 1;
|
|
8084
8093
|
}
|
|
8085
|
-
if (
|
|
8086
|
-
parent2.
|
|
8094
|
+
if (collapsed) {
|
|
8095
|
+
parent2.collapsedChildrenCount += 1;
|
|
8087
8096
|
}
|
|
8097
|
+
parent2.deepRowInfoArray.push(rowInfo);
|
|
8088
8098
|
});
|
|
8089
8099
|
if (!collapsed) {
|
|
8090
8100
|
result[startIndex + index] = rowInfo;
|
|
@@ -8753,8 +8763,10 @@ function useLazyLoadRange() {
|
|
|
8753
8763
|
const {
|
|
8754
8764
|
lazyLoadBatchSize,
|
|
8755
8765
|
lazyLoad,
|
|
8766
|
+
originalLazyGroupDataChangeDetect,
|
|
8756
8767
|
notifyRenderRangeChange,
|
|
8757
8768
|
dataArray,
|
|
8769
|
+
groupRowsState,
|
|
8758
8770
|
scrollStopDelayUpdatedByTable
|
|
8759
8771
|
} = componentState;
|
|
8760
8772
|
const latestRenderRangeRef = useRef18(null);
|
|
@@ -8783,20 +8795,27 @@ function useLazyLoadRange() {
|
|
|
8783
8795
|
}, cache);
|
|
8784
8796
|
};
|
|
8785
8797
|
const debouncedLoadRange = useMemo7(() => debounce(loadRange, { wait: scrollStopDelayUpdatedByTable }), [scrollStopDelayUpdatedByTable]);
|
|
8786
|
-
|
|
8798
|
+
useEffectWithChanges((changes) => {
|
|
8787
8799
|
if (lazyLoad) {
|
|
8800
|
+
if (changes.originalLazyGroupDataChangeDetect || changes.groupRowsState) {
|
|
8801
|
+
loadRange(notifyRenderRangeChange.get());
|
|
8802
|
+
}
|
|
8788
8803
|
return notifyRenderRangeChange.onChange((renderRange) => {
|
|
8789
8804
|
latestRenderRangeRef.current = renderRange;
|
|
8790
8805
|
loadRange(renderRange);
|
|
8791
8806
|
});
|
|
8792
8807
|
}
|
|
8793
8808
|
return;
|
|
8794
|
-
},
|
|
8809
|
+
}, {
|
|
8810
|
+
lazyLoadBatchSize,
|
|
8811
|
+
lazyLoad,
|
|
8812
|
+
originalLazyGroupDataChangeDetect,
|
|
8813
|
+
groupRowsState
|
|
8814
|
+
});
|
|
8795
8815
|
useEffect17(() => {
|
|
8796
8816
|
if (lazyLoadBatchSize && lazyLoadBatchSize > 0) {
|
|
8797
8817
|
debouncedLoadRange();
|
|
8798
8818
|
}
|
|
8799
|
-
return;
|
|
8800
8819
|
}, [dataArray]);
|
|
8801
8820
|
}
|
|
8802
8821
|
function lazyLoadRange(options, cache) {
|
|
@@ -8886,6 +8905,16 @@ function lazyLoadRange(options, cache) {
|
|
|
8886
8905
|
}, initialPromise);
|
|
8887
8906
|
}
|
|
8888
8907
|
|
|
8908
|
+
// src/utils/groupAndPivot/getGroupKeysForDataItem.ts
|
|
8909
|
+
function getGroupKeysForDataItem(data, groupBy) {
|
|
8910
|
+
return groupBy.reduce((groupKeys, groupBy2) => {
|
|
8911
|
+
const { field: groupByProperty, toKey: groupToKey } = groupBy2;
|
|
8912
|
+
const key = (groupToKey || DEFAULT_TO_KEY)(data[groupByProperty], data);
|
|
8913
|
+
groupKeys.push(key);
|
|
8914
|
+
return groupKeys;
|
|
8915
|
+
}, []);
|
|
8916
|
+
}
|
|
8917
|
+
|
|
8889
8918
|
// src/components/DataSource/RowSelectionState.ts
|
|
8890
8919
|
var RowSelectionState = class {
|
|
8891
8920
|
constructor(state, getConfig, _forTestingOnly) {
|
|
@@ -8962,8 +8991,8 @@ var RowSelectionState = class {
|
|
|
8962
8991
|
getGroupByLength() {
|
|
8963
8992
|
return this.getConfig().groupBy.length;
|
|
8964
8993
|
}
|
|
8965
|
-
static from(rowSeleStateObject, getConfig,
|
|
8966
|
-
return new RowSelectionState(rowSeleStateObject, getConfig,
|
|
8994
|
+
static from(rowSeleStateObject, getConfig, overrides) {
|
|
8995
|
+
return new RowSelectionState(rowSeleStateObject, getConfig, overrides);
|
|
8967
8996
|
}
|
|
8968
8997
|
update(stateObject) {
|
|
8969
8998
|
var _a, _b;
|
|
@@ -9245,7 +9274,8 @@ var RowSelectionState = class {
|
|
|
9245
9274
|
if (cachedResult != null) {
|
|
9246
9275
|
return cachedResult;
|
|
9247
9276
|
}
|
|
9248
|
-
|
|
9277
|
+
const groupByLength = this.getGroupByLength();
|
|
9278
|
+
if (groupKeys.length > groupByLength) {
|
|
9249
9279
|
const result2 = this.isRowSelected(groupKeys) ? { selectedCount: 1, deselectedCount: 0 } : {
|
|
9250
9280
|
selectedCount: 0,
|
|
9251
9281
|
deselectedCount: 1
|
|
@@ -9253,7 +9283,7 @@ var RowSelectionState = class {
|
|
|
9253
9283
|
this.selectionCountCache.set(groupKeys, result2);
|
|
9254
9284
|
return result2;
|
|
9255
9285
|
}
|
|
9256
|
-
if (this.onlyUsePrimaryKeys) {
|
|
9286
|
+
if (groupByLength && this.onlyUsePrimaryKeys) {
|
|
9257
9287
|
const allKeys2 = this.getAllPrimaryKeysInsideGroup(groupKeys);
|
|
9258
9288
|
let selectedCount2 = 0;
|
|
9259
9289
|
let deselectedCount2 = 0;
|
|
@@ -9330,13 +9360,16 @@ var RowSelectionState = class {
|
|
|
9330
9360
|
};
|
|
9331
9361
|
|
|
9332
9362
|
// src/components/InfiniteTable/api/getSelectionApi.ts
|
|
9363
|
+
function cloneRowSelection(rowSelection, stateOrGetDataSourceState) {
|
|
9364
|
+
return new RowSelectionState(rowSelection, rowSelectionStateConfigGetter(stateOrGetDataSourceState));
|
|
9365
|
+
}
|
|
9333
9366
|
function rowSelectionStateConfigGetter(stateOrStateGetter) {
|
|
9334
9367
|
return () => {
|
|
9335
9368
|
const state = typeof stateOrStateGetter === "function" ? stateOrStateGetter() : stateOrStateGetter;
|
|
9336
9369
|
return {
|
|
9337
9370
|
lazyLoad: !!state.lazyLoad,
|
|
9338
9371
|
toPrimaryKey: state.toPrimaryKey,
|
|
9339
|
-
onlyUsePrimaryKeys: state.
|
|
9372
|
+
onlyUsePrimaryKeys: !state.useGroupKeysForMultiRowSelection,
|
|
9340
9373
|
groupBy: state.groupBy,
|
|
9341
9374
|
groupDeepMap: state.groupDeepMap,
|
|
9342
9375
|
indexer: state.indexer,
|
|
@@ -9658,7 +9691,7 @@ var forwardProps3 = (setupState) => {
|
|
|
9658
9691
|
livePagination: 1,
|
|
9659
9692
|
filterFunction: 1,
|
|
9660
9693
|
filterValue: 1,
|
|
9661
|
-
|
|
9694
|
+
useGroupKeysForMultiRowSelection: (useGroupKeysForMultiRowSelection) => useGroupKeysForMultiRowSelection != null ? useGroupKeysForMultiRowSelection : false,
|
|
9662
9695
|
filterDelay: (filterDelay) => filterDelay != null ? filterDelay : 200,
|
|
9663
9696
|
filterTypes: (filterTypes) => {
|
|
9664
9697
|
return __spreadValues(__spreadValues({}, defaultFilterTypes), filterTypes);
|
|
@@ -9672,16 +9705,7 @@ var forwardProps3 = (setupState) => {
|
|
|
9672
9705
|
collapseGroupRowsOnDataFunctionChange: (collapseGroupRowsOnDataFunctionChange) => collapseGroupRowsOnDataFunctionChange != null ? collapseGroupRowsOnDataFunctionChange : true,
|
|
9673
9706
|
loading: (loading) => loading != null ? loading : false,
|
|
9674
9707
|
sortInfo: (sortInfo) => normalizeSortInfo(sortInfo, setupState.propsCache.get("sortInfo")),
|
|
9675
|
-
groupBy: (groupBy) => groupBy != null ? groupBy : []
|
|
9676
|
-
groupRowsState: (groupRowsState) => {
|
|
9677
|
-
if (groupRowsState && !(groupRowsState instanceof GroupRowsState)) {
|
|
9678
|
-
groupRowsState = new GroupRowsState(groupRowsState);
|
|
9679
|
-
}
|
|
9680
|
-
return groupRowsState || new GroupRowsState({
|
|
9681
|
-
expandedRows: true,
|
|
9682
|
-
collapsedRows: []
|
|
9683
|
-
});
|
|
9684
|
-
}
|
|
9708
|
+
groupBy: (groupBy) => groupBy != null ? groupBy : []
|
|
9685
9709
|
};
|
|
9686
9710
|
};
|
|
9687
9711
|
function getLivePaginationCursorValue(livePaginationCursorProp, state) {
|
|
@@ -9740,8 +9764,17 @@ function mapPropsToState(params) {
|
|
|
9740
9764
|
}
|
|
9741
9765
|
const primaryKeyDescriptor = state.primaryKey;
|
|
9742
9766
|
const toPrimaryKey = typeof primaryKeyDescriptor === "function" ? (data) => primaryKeyDescriptor(data) : (data) => data[primaryKeyDescriptor];
|
|
9767
|
+
let groupRowsState = props.groupRowsState || state.groupRowsState || props.defaultGroupRowsState;
|
|
9768
|
+
if (groupRowsState && !(groupRowsState instanceof GroupRowsState)) {
|
|
9769
|
+
groupRowsState = new GroupRowsState(groupRowsState);
|
|
9770
|
+
}
|
|
9771
|
+
groupRowsState = groupRowsState || new GroupRowsState(state.lazyLoad ? { expandedRows: [], collapsedRows: true } : {
|
|
9772
|
+
expandedRows: true,
|
|
9773
|
+
collapsedRows: []
|
|
9774
|
+
});
|
|
9743
9775
|
const result = {
|
|
9744
9776
|
selectionMode,
|
|
9777
|
+
groupRowsState,
|
|
9745
9778
|
rowSelection: rowSelectionState,
|
|
9746
9779
|
toPrimaryKey,
|
|
9747
9780
|
operatorsByFilterType,
|
|
@@ -12490,7 +12523,7 @@ var useLicense = (licenseKey = "") => {
|
|
|
12490
12523
|
const valid = useMemo11(() => {
|
|
12491
12524
|
let valid2 = isValidLicense(licenseKey, {
|
|
12492
12525
|
publishedAt: 1624970570587,
|
|
12493
|
-
version: "0.4.
|
|
12526
|
+
version: "0.4.12"
|
|
12494
12527
|
});
|
|
12495
12528
|
if (!licenseKey && !valid2 && isInsidePlayground) {
|
|
12496
12529
|
return true;
|
|
@@ -12825,7 +12858,14 @@ function onCellClick(context, event) {
|
|
|
12825
12858
|
updateRowSelectionOnCellClick(context, event);
|
|
12826
12859
|
}
|
|
12827
12860
|
function updateRowSelectionOnCellClick(context, event) {
|
|
12828
|
-
const {
|
|
12861
|
+
const {
|
|
12862
|
+
rowIndex,
|
|
12863
|
+
getDataSourceState,
|
|
12864
|
+
getComputed,
|
|
12865
|
+
dataSourceActions,
|
|
12866
|
+
api,
|
|
12867
|
+
cloneRowSelection: cloneRowSelection2
|
|
12868
|
+
} = context;
|
|
12829
12869
|
const { multiRowSelector, renderSelectionCheckBox } = getComputed();
|
|
12830
12870
|
const dataSourceState = getDataSourceState();
|
|
12831
12871
|
const { selectionMode, groupBy, dataArray } = dataSourceState;
|
|
@@ -12837,7 +12877,7 @@ function updateRowSelectionOnCellClick(context, event) {
|
|
|
12837
12877
|
return false;
|
|
12838
12878
|
}
|
|
12839
12879
|
let { rowSelection: rowSelectionState } = dataSourceState;
|
|
12840
|
-
rowSelectionState =
|
|
12880
|
+
rowSelectionState = cloneRowSelection2(rowSelectionState);
|
|
12841
12881
|
multiRowSelector.rowSelectionState = rowSelectionState;
|
|
12842
12882
|
if (rowSelectionState && typeof rowSelectionState === "object") {
|
|
12843
12883
|
if (event.shiftKey) {
|
|
@@ -12867,8 +12907,9 @@ function clamp(value, min, max) {
|
|
|
12867
12907
|
}
|
|
12868
12908
|
|
|
12869
12909
|
// src/components/InfiniteTable/eventHandlers/keyboardNavigation.ts
|
|
12870
|
-
function handleRowNavigation(options) {
|
|
12871
|
-
const {
|
|
12910
|
+
function handleRowNavigation(options, event) {
|
|
12911
|
+
const { getState, getDataSourceState, actions, api } = options;
|
|
12912
|
+
const { key } = event;
|
|
12872
12913
|
const dataArray = getDataSourceState().dataArray;
|
|
12873
12914
|
const arrLength = dataArray.length;
|
|
12874
12915
|
const state = getState();
|
|
@@ -12933,16 +12974,15 @@ function handleRowNavigation(options) {
|
|
|
12933
12974
|
actions.activeRowIndex = activeRowIndex;
|
|
12934
12975
|
return true;
|
|
12935
12976
|
}
|
|
12936
|
-
function handleCellNavigation(options) {
|
|
12977
|
+
function handleCellNavigation(options, event) {
|
|
12937
12978
|
const {
|
|
12938
12979
|
api,
|
|
12939
|
-
key,
|
|
12940
|
-
shiftKey,
|
|
12941
12980
|
getState,
|
|
12942
12981
|
getComputed,
|
|
12943
12982
|
getDataSourceState,
|
|
12944
12983
|
actions
|
|
12945
12984
|
} = options;
|
|
12985
|
+
const { key, shiftKey } = event;
|
|
12946
12986
|
const dataArray = getDataSourceState().dataArray;
|
|
12947
12987
|
const state = getState();
|
|
12948
12988
|
const { activeCellIndex, brain } = state;
|
|
@@ -13032,18 +13072,19 @@ var validKeys = {
|
|
|
13032
13072
|
Enter: true,
|
|
13033
13073
|
" ": true
|
|
13034
13074
|
};
|
|
13035
|
-
function handleKeyboardNavigation(options) {
|
|
13075
|
+
function handleKeyboardNavigation(options, event) {
|
|
13076
|
+
const { key } = event;
|
|
13036
13077
|
const { getState } = options;
|
|
13037
13078
|
const state = getState();
|
|
13038
13079
|
const { activeRowIndex, activeCellIndex, keyboardNavigation } = state;
|
|
13039
|
-
if (!validKeys[
|
|
13080
|
+
if (!validKeys[key]) {
|
|
13040
13081
|
return false;
|
|
13041
13082
|
}
|
|
13042
13083
|
if (activeRowIndex != null && keyboardNavigation === "row") {
|
|
13043
|
-
return handleRowNavigation(options);
|
|
13084
|
+
return handleRowNavigation(options, event);
|
|
13044
13085
|
}
|
|
13045
13086
|
if (activeCellIndex != null && keyboardNavigation === "cell") {
|
|
13046
|
-
return handleCellNavigation(options);
|
|
13087
|
+
return handleCellNavigation(options, event);
|
|
13047
13088
|
}
|
|
13048
13089
|
return false;
|
|
13049
13090
|
}
|
|
@@ -13054,16 +13095,15 @@ var validKeys2 = {
|
|
|
13054
13095
|
" ": true,
|
|
13055
13096
|
a: true
|
|
13056
13097
|
};
|
|
13057
|
-
function handleKeyboardSelection(context) {
|
|
13098
|
+
function handleKeyboardSelection(context, keyboardEvent) {
|
|
13058
13099
|
const {
|
|
13059
13100
|
getState,
|
|
13060
13101
|
getDataSourceState,
|
|
13061
13102
|
dataSourceActions,
|
|
13062
13103
|
api: imperativeApi,
|
|
13063
|
-
|
|
13064
|
-
ctrlKey,
|
|
13065
|
-
metaKey
|
|
13104
|
+
cloneRowSelection: cloneRowSelection2
|
|
13066
13105
|
} = context;
|
|
13106
|
+
const { key, ctrlKey, metaKey } = keyboardEvent;
|
|
13067
13107
|
if (!validKeys2[key]) {
|
|
13068
13108
|
return false;
|
|
13069
13109
|
}
|
|
@@ -13092,21 +13132,21 @@ function handleKeyboardSelection(context) {
|
|
|
13092
13132
|
return false;
|
|
13093
13133
|
}
|
|
13094
13134
|
if (key === "a" && (ctrlKey || metaKey)) {
|
|
13095
|
-
const rowSelectionState =
|
|
13135
|
+
const rowSelectionState = cloneRowSelection2(rowSelection);
|
|
13096
13136
|
rowSelectionState.selectAll();
|
|
13097
13137
|
dataSourceActions.rowSelection = rowSelectionState;
|
|
13098
13138
|
return true;
|
|
13099
13139
|
}
|
|
13100
13140
|
if (key === " ") {
|
|
13101
13141
|
if (groupBy.length) {
|
|
13102
|
-
if (rowInfo.isGroupRow) {
|
|
13142
|
+
if (rowInfo.isGroupRow && rowInfo.groupKeys) {
|
|
13103
13143
|
imperativeApi.selectionApi.toggleGroupRowSelection(rowInfo.groupKeys);
|
|
13104
13144
|
} else {
|
|
13105
13145
|
imperativeApi.selectionApi.toggleRowSelection(rowInfo.id);
|
|
13106
13146
|
}
|
|
13107
13147
|
return true;
|
|
13108
13148
|
} else {
|
|
13109
|
-
const event = __spreadValues({},
|
|
13149
|
+
const event = __spreadValues({}, keyboardEvent);
|
|
13110
13150
|
const { renderSelectionCheckBox } = context.getComputed();
|
|
13111
13151
|
if (renderSelectionCheckBox) {
|
|
13112
13152
|
event.metaKey = false;
|
|
@@ -13121,15 +13161,14 @@ function handleKeyboardSelection(context) {
|
|
|
13121
13161
|
// src/components/InfiniteTable/eventHandlers/onKeyDown.ts
|
|
13122
13162
|
function onKeyDown(context, event) {
|
|
13123
13163
|
const keyboardHandlerContext = __spreadProps(__spreadValues({}, context), {
|
|
13124
|
-
|
|
13125
|
-
|
|
13126
|
-
|
|
13127
|
-
shiftKey: event.shiftKey
|
|
13164
|
+
cloneRowSelection: (rowSelection) => {
|
|
13165
|
+
return cloneRowSelection(rowSelection, context.getDataSourceState);
|
|
13166
|
+
}
|
|
13128
13167
|
});
|
|
13129
|
-
if (handleKeyboardSelection(keyboardHandlerContext)) {
|
|
13168
|
+
if (handleKeyboardSelection(keyboardHandlerContext, event)) {
|
|
13130
13169
|
event.preventDefault();
|
|
13131
13170
|
}
|
|
13132
|
-
if (handleKeyboardNavigation(keyboardHandlerContext)) {
|
|
13171
|
+
if (handleKeyboardNavigation(keyboardHandlerContext, event)) {
|
|
13133
13172
|
event.preventDefault();
|
|
13134
13173
|
}
|
|
13135
13174
|
}
|
|
@@ -13150,7 +13189,10 @@ function useEventHandlersContext() {
|
|
|
13150
13189
|
getState,
|
|
13151
13190
|
actions,
|
|
13152
13191
|
getDataSourceState,
|
|
13153
|
-
dataSourceActions
|
|
13192
|
+
dataSourceActions,
|
|
13193
|
+
cloneRowSelection: (rowSelection) => {
|
|
13194
|
+
return cloneRowSelection(rowSelection, getDataSourceState);
|
|
13195
|
+
}
|
|
13154
13196
|
};
|
|
13155
13197
|
return context2;
|
|
13156
13198
|
}, [getState, actions, getDataSourceState, dataSourceActions]);
|
|
@@ -13160,13 +13202,7 @@ function handleDOMEvents() {
|
|
|
13160
13202
|
const context = useEventHandlersContext();
|
|
13161
13203
|
useEffect29(() => {
|
|
13162
13204
|
const removeOnKeyDown = context.getState().keyDown.onChange((event) => {
|
|
13163
|
-
onKeyDown(
|
|
13164
|
-
key: event.key,
|
|
13165
|
-
metaKey: event.metaKey,
|
|
13166
|
-
ctrlKey: event.ctrlKey,
|
|
13167
|
-
shiftKey: event.shiftKey,
|
|
13168
|
-
preventDefault: () => event.preventDefault()
|
|
13169
|
-
}), event);
|
|
13205
|
+
onKeyDown(context, event);
|
|
13170
13206
|
});
|
|
13171
13207
|
function cellClickHandler(cellClickParam) {
|
|
13172
13208
|
if (!cellClickParam) {
|
|
@@ -13180,10 +13216,10 @@ function handleDOMEvents() {
|
|
|
13180
13216
|
key: "",
|
|
13181
13217
|
preventDefault: () => event.preventDefault()
|
|
13182
13218
|
};
|
|
13183
|
-
onCellClick(
|
|
13219
|
+
onCellClick(__spreadProps(__spreadValues({}, context), {
|
|
13184
13220
|
rowIndex: cellClickParam.rowIndex,
|
|
13185
13221
|
colIndex: cellClickParam.colIndex
|
|
13186
|
-
}), virtualEvent)
|
|
13222
|
+
}), virtualEvent);
|
|
13187
13223
|
}
|
|
13188
13224
|
const removeOnCellClick = context.getState().cellClick.onChange(cellClickHandler);
|
|
13189
13225
|
return () => {
|
|
@@ -13378,6 +13414,245 @@ InfiniteTable.defaultProps = {
|
|
|
13378
13414
|
columnHeaderHeight: toCSSVarName(columnHeaderHeightName)
|
|
13379
13415
|
};
|
|
13380
13416
|
|
|
13417
|
+
// src/components/Menu/index.tsx
|
|
13418
|
+
import {
|
|
13419
|
+
Children,
|
|
13420
|
+
createElement as createElement36,
|
|
13421
|
+
useState as useState16
|
|
13422
|
+
} from "react";
|
|
13423
|
+
import { useState as useState17 } from "react";
|
|
13424
|
+
|
|
13425
|
+
// src/components/Menu/MenuCls.css.ts
|
|
13426
|
+
var import_createRuntimeFn7 = __toModule(require_vanilla_extract_recipes_createRuntimeFn_cjs());
|
|
13427
|
+
var MenuCls = "db3arf0 _16lm1iw0 _16lm1iw1 _16lm1iw13 _16lm1iw1j _16lm1iw7";
|
|
13428
|
+
var MenuItemCls = (0, import_createRuntimeFn7.createRuntimeFn)({ defaultClassName: "db3arf2 _16lm1iww _16lm1iw1n _16lm1iw14", variantClassNames: { disabled: { true: "db3arf3 _16lm1iwg _16lm1iw14", false: "_16lm1iwf" }, hover: { true: "db3arf5", false: "db3arf6" }, pressed: { false: "db3arf7", true: "db3arf8" }, active: { true: "db3arf9", false: "db3arfa" } }, defaultVariants: {}, compoundVariants: [[{ pressed: true, hover: true }, "db3arfb"]] });
|
|
13429
|
+
var MenuRowCls = "_16lm1iwx";
|
|
13430
|
+
var MenuSeparatorCls = "db3arfc";
|
|
13431
|
+
|
|
13432
|
+
// src/components/Menu/index.tsx
|
|
13433
|
+
var SEPARATOR = "-";
|
|
13434
|
+
function MenuSeparator() {
|
|
13435
|
+
return /* @__PURE__ */ createElement36("hr", {
|
|
13436
|
+
className: MenuSeparatorCls
|
|
13437
|
+
});
|
|
13438
|
+
}
|
|
13439
|
+
var toRuntimeItem = ({ columns, activeItemKey }, item) => {
|
|
13440
|
+
const menuItem = item && (item.key != null || item.label != null) ? item : null;
|
|
13441
|
+
const menuDecoration = menuItem === null ? item === SEPARATOR ? /* @__PURE__ */ createElement36(MenuSeparator, null) : item : null;
|
|
13442
|
+
const runtimeItem = menuItem != null ? {
|
|
13443
|
+
type: "item",
|
|
13444
|
+
disabled: !!menuItem.disabled,
|
|
13445
|
+
active: menuItem.key === activeItemKey,
|
|
13446
|
+
value: menuItem,
|
|
13447
|
+
span: menuItem.span || 1,
|
|
13448
|
+
key: menuItem.key,
|
|
13449
|
+
menu: menuItem.menu || null
|
|
13450
|
+
} : {
|
|
13451
|
+
type: "decoration",
|
|
13452
|
+
value: menuDecoration,
|
|
13453
|
+
span: columns.length,
|
|
13454
|
+
style: {
|
|
13455
|
+
gridColumnStart: 1,
|
|
13456
|
+
gridColumnEnd: columns.length + 10
|
|
13457
|
+
}
|
|
13458
|
+
};
|
|
13459
|
+
return runtimeItem;
|
|
13460
|
+
};
|
|
13461
|
+
function childrenToRuntimeItems(context, children) {
|
|
13462
|
+
return Children.map(children, (child) => {
|
|
13463
|
+
if (child == null ? void 0 : child.props.__is_menu_item) {
|
|
13464
|
+
const itemProps = __spreadValues({}, child.props);
|
|
13465
|
+
if (!itemProps.key) {
|
|
13466
|
+
itemProps.key = child.key;
|
|
13467
|
+
}
|
|
13468
|
+
if (!itemProps.description) {
|
|
13469
|
+
itemProps.description = child.props.children;
|
|
13470
|
+
}
|
|
13471
|
+
if (!itemProps.label) {
|
|
13472
|
+
itemProps.label = itemProps.children;
|
|
13473
|
+
}
|
|
13474
|
+
return toRuntimeItem(context, itemProps);
|
|
13475
|
+
}
|
|
13476
|
+
return toRuntimeItem(context, child);
|
|
13477
|
+
}) || [];
|
|
13478
|
+
}
|
|
13479
|
+
var defaultColumns = [
|
|
13480
|
+
{
|
|
13481
|
+
name: "label"
|
|
13482
|
+
}
|
|
13483
|
+
];
|
|
13484
|
+
function Menu(props) {
|
|
13485
|
+
const _a = props, {
|
|
13486
|
+
children,
|
|
13487
|
+
items,
|
|
13488
|
+
columns: cols,
|
|
13489
|
+
addSubmenuColumnIfNeeded
|
|
13490
|
+
} = _a, domProps = __objRest(_a, [
|
|
13491
|
+
"children",
|
|
13492
|
+
"items",
|
|
13493
|
+
"columns",
|
|
13494
|
+
"addSubmenuColumnIfNeeded"
|
|
13495
|
+
]);
|
|
13496
|
+
const [activeItemKey, setActiveItemKey] = useState17(null);
|
|
13497
|
+
const columns = cols || defaultColumns;
|
|
13498
|
+
let runtimeItems = [];
|
|
13499
|
+
let renderedChildren = null;
|
|
13500
|
+
const context = { columns, activeItemKey };
|
|
13501
|
+
if (items) {
|
|
13502
|
+
runtimeItems = items.map(toRuntimeItem.bind(null, context));
|
|
13503
|
+
} else if (!items && typeof children !== "function") {
|
|
13504
|
+
runtimeItems = childrenToRuntimeItems(context, children);
|
|
13505
|
+
}
|
|
13506
|
+
if (addSubmenuColumnIfNeeded) {
|
|
13507
|
+
const hasSubmenus = runtimeItems.filter((item) => item.type === "item" && item.menu != null).length > 0;
|
|
13508
|
+
if (hasSubmenus && !columns.find((col) => col.name == "submenu")) {
|
|
13509
|
+
columns.push({
|
|
13510
|
+
name: "submenu",
|
|
13511
|
+
render: ({ domProps: domProps2, item }) => {
|
|
13512
|
+
return item.menu ? /* @__PURE__ */ createElement36("div", __spreadValues({}, domProps2), /* @__PURE__ */ createElement36(ExpanderIcon, null)) : /* @__PURE__ */ createElement36("div", __spreadValues({}, domProps2));
|
|
13513
|
+
}
|
|
13514
|
+
});
|
|
13515
|
+
}
|
|
13516
|
+
}
|
|
13517
|
+
renderedChildren = runtimeItems.map((runtimeItem, index) => /* @__PURE__ */ createElement36(RuntimeItemRenderer, {
|
|
13518
|
+
columns,
|
|
13519
|
+
item: runtimeItem,
|
|
13520
|
+
index,
|
|
13521
|
+
onClick: (item) => setActiveItemKey(item.key)
|
|
13522
|
+
}));
|
|
13523
|
+
const gridTemplateColumns = columns.map((col) => {
|
|
13524
|
+
return col.width || (typeof col.flex === "number" ? `${col.flex}fr` : col.flex) || "auto";
|
|
13525
|
+
}).join(" ");
|
|
13526
|
+
const style = __spreadProps(__spreadValues({}, domProps.style), {
|
|
13527
|
+
gridTemplateColumns,
|
|
13528
|
+
gridTemplateRows: runtimeItems.map(() => `auto`).join(" ")
|
|
13529
|
+
});
|
|
13530
|
+
function handleKeydown(event) {
|
|
13531
|
+
const selectableRuntimeItems = runtimeItems.filter((item) => item.type === "item" && !item.disabled);
|
|
13532
|
+
let activeIndex = selectableRuntimeItems.findIndex((runtimeItem) => runtimeItem.key === activeItemKey);
|
|
13533
|
+
let newActiveIndex = activeIndex;
|
|
13534
|
+
const validKeys3 = {
|
|
13535
|
+
ArrowUp: () => {
|
|
13536
|
+
newActiveIndex--;
|
|
13537
|
+
},
|
|
13538
|
+
ArrowDown: () => {
|
|
13539
|
+
newActiveIndex++;
|
|
13540
|
+
},
|
|
13541
|
+
PageUp: () => {
|
|
13542
|
+
newActiveIndex = 0;
|
|
13543
|
+
},
|
|
13544
|
+
PageDown: () => {
|
|
13545
|
+
newActiveIndex = selectableRuntimeItems.length - 1;
|
|
13546
|
+
}
|
|
13547
|
+
};
|
|
13548
|
+
const fn = validKeys3[event.key];
|
|
13549
|
+
if (fn) {
|
|
13550
|
+
fn();
|
|
13551
|
+
}
|
|
13552
|
+
newActiveIndex = clamp(newActiveIndex, 0, selectableRuntimeItems.length - 1);
|
|
13553
|
+
if (newActiveIndex != activeIndex) {
|
|
13554
|
+
setActiveItemKey(selectableRuntimeItems[newActiveIndex].key);
|
|
13555
|
+
}
|
|
13556
|
+
}
|
|
13557
|
+
return /* @__PURE__ */ createElement36("div", __spreadProps(__spreadValues({}, domProps), {
|
|
13558
|
+
onKeyDown: (event) => {
|
|
13559
|
+
if (domProps.onKeyDown) {
|
|
13560
|
+
domProps.onKeyDown(event);
|
|
13561
|
+
}
|
|
13562
|
+
handleKeydown(event);
|
|
13563
|
+
},
|
|
13564
|
+
tabIndex: 0,
|
|
13565
|
+
className: join(MenuCls, domProps.className),
|
|
13566
|
+
style
|
|
13567
|
+
}), renderedChildren);
|
|
13568
|
+
}
|
|
13569
|
+
var menuDefaultProps = {
|
|
13570
|
+
addSubmenuColumnIfNeeded: true
|
|
13571
|
+
};
|
|
13572
|
+
Menu.defaultProps = menuDefaultProps;
|
|
13573
|
+
function RuntimeItemRenderer(props) {
|
|
13574
|
+
const [hover, setHover] = useState16(false);
|
|
13575
|
+
const [pressed, setPressed] = useState16(false);
|
|
13576
|
+
const { columns, item, index } = props;
|
|
13577
|
+
const key = item.type === "item" ? item.value.key : index;
|
|
13578
|
+
let content = null;
|
|
13579
|
+
if (item.type === "decoration") {
|
|
13580
|
+
content = /* @__PURE__ */ createElement36("div", {
|
|
13581
|
+
style: item.style
|
|
13582
|
+
}, item.value);
|
|
13583
|
+
} else {
|
|
13584
|
+
let spanIndex = 0;
|
|
13585
|
+
content = columns.map((col, i) => {
|
|
13586
|
+
const target = item.value;
|
|
13587
|
+
const field = col.field || col.name;
|
|
13588
|
+
const start = i + 1;
|
|
13589
|
+
const end = start + item.span;
|
|
13590
|
+
if (start < spanIndex) {
|
|
13591
|
+
return null;
|
|
13592
|
+
}
|
|
13593
|
+
spanIndex = end;
|
|
13594
|
+
const style = __spreadProps(__spreadValues(__spreadValues({}, col.style), item.style), {
|
|
13595
|
+
gridColumnStart: start,
|
|
13596
|
+
gridColumnEnd: end
|
|
13597
|
+
});
|
|
13598
|
+
const domProps = {
|
|
13599
|
+
style,
|
|
13600
|
+
className: MenuItemCls({
|
|
13601
|
+
hover,
|
|
13602
|
+
disabled: !!item.disabled,
|
|
13603
|
+
active: item.active,
|
|
13604
|
+
pressed
|
|
13605
|
+
}),
|
|
13606
|
+
onMouseEnter: () => {
|
|
13607
|
+
if (!item.disabled) {
|
|
13608
|
+
setHover(true);
|
|
13609
|
+
}
|
|
13610
|
+
},
|
|
13611
|
+
onMouseLeave: () => {
|
|
13612
|
+
if (!item.disabled) {
|
|
13613
|
+
setHover(false);
|
|
13614
|
+
}
|
|
13615
|
+
},
|
|
13616
|
+
onMouseDown: () => {
|
|
13617
|
+
if (!item.disabled) {
|
|
13618
|
+
setPressed(true);
|
|
13619
|
+
}
|
|
13620
|
+
},
|
|
13621
|
+
onMouseUp: () => {
|
|
13622
|
+
if (!item.disabled) {
|
|
13623
|
+
setPressed(false);
|
|
13624
|
+
}
|
|
13625
|
+
},
|
|
13626
|
+
onClick: () => {
|
|
13627
|
+
if (!item.disabled) {
|
|
13628
|
+
props.onClick(item);
|
|
13629
|
+
}
|
|
13630
|
+
}
|
|
13631
|
+
};
|
|
13632
|
+
return col.render ? /* @__PURE__ */ createElement36(RenderHookComponent, {
|
|
13633
|
+
render: col.render,
|
|
13634
|
+
renderParam: {
|
|
13635
|
+
item: target,
|
|
13636
|
+
column: col,
|
|
13637
|
+
value: target[field],
|
|
13638
|
+
domProps
|
|
13639
|
+
}
|
|
13640
|
+
}) : /* @__PURE__ */ createElement36("div", __spreadValues({
|
|
13641
|
+
key: `${key}-${field}`
|
|
13642
|
+
}, domProps), target[field]);
|
|
13643
|
+
}).filter(Boolean);
|
|
13644
|
+
}
|
|
13645
|
+
return /* @__PURE__ */ createElement36("div", {
|
|
13646
|
+
className: MenuRowCls
|
|
13647
|
+
}, content);
|
|
13648
|
+
}
|
|
13649
|
+
function MenuItem(_props) {
|
|
13650
|
+
return null;
|
|
13651
|
+
}
|
|
13652
|
+
MenuItem.defaultProps = {
|
|
13653
|
+
__is_menu_item: true
|
|
13654
|
+
};
|
|
13655
|
+
|
|
13381
13656
|
// src/index.tsx
|
|
13382
13657
|
var components = {
|
|
13383
13658
|
CheckBox: InfiniteCheckBox,
|
|
@@ -13390,6 +13665,8 @@ export {
|
|
|
13390
13665
|
InfiniteTable,
|
|
13391
13666
|
InfiniteTableClassName,
|
|
13392
13667
|
InfiniteTableComponent,
|
|
13668
|
+
Menu,
|
|
13669
|
+
MenuItem,
|
|
13393
13670
|
NumberFilterEditor,
|
|
13394
13671
|
RowSelectionState,
|
|
13395
13672
|
StringFilterEditor,
|
|
@@ -13409,3 +13686,4 @@ export {
|
|
|
13409
13686
|
useInfiniteColumnCell,
|
|
13410
13687
|
useInfiniteHeaderCell
|
|
13411
13688
|
};
|
|
13689
|
+
//!collapsed || lazyLoad;
|