@infinite-table/infinite-react 0.4.10 → 0.4.13
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 +4 -4
- package/index.css +146 -59
- package/index.d.ts +112 -38
- package/index.esm.css +146 -59
- package/index.esm.js +448 -165
- package/index.js +409 -131
- package/package.json +11 -2
package/index.js
CHANGED
|
@@ -632,6 +632,8 @@ __export(exports, {
|
|
|
632
632
|
InfiniteTable: () => InfiniteTable,
|
|
633
633
|
InfiniteTableClassName: () => InfiniteTableClassName,
|
|
634
634
|
InfiniteTableComponent: () => InfiniteTableComponent,
|
|
635
|
+
Menu: () => Menu,
|
|
636
|
+
MenuItem: () => MenuItem,
|
|
635
637
|
NumberFilterEditor: () => NumberFilterEditor,
|
|
636
638
|
RowSelectionState: () => RowSelectionState,
|
|
637
639
|
StringFilterEditor: () => StringFilterEditor,
|
|
@@ -1096,7 +1098,7 @@ function stripVar(cssVariableWithVarString) {
|
|
|
1096
1098
|
|
|
1097
1099
|
// src/components/InfiniteTable/theme.css.ts
|
|
1098
1100
|
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)" };
|
|
1099
|
-
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)" } } };
|
|
1101
|
+
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)" } } };
|
|
1100
1102
|
var columnHeaderHeightName = "column-header-height";
|
|
1101
1103
|
|
|
1102
1104
|
// src/utils/selectParent.ts
|
|
@@ -3652,11 +3654,11 @@ var useRerender = () => {
|
|
|
3652
3654
|
};
|
|
3653
3655
|
|
|
3654
3656
|
// src/components/InfiniteTable/components/ActiveCellIndicator.css.ts
|
|
3655
|
-
var ActiveCellIndicatorCls = { visible: "nxbq1c2 nxbq1c1
|
|
3656
|
-
var ActiveIndicatorWrapperCls = "
|
|
3657
|
+
var ActiveCellIndicatorCls = { visible: "nxbq1c2 nxbq1c1 _16lm1iwi _16lm1iw3 _16lm1iw1b _16lm1iw19", hidden: "nxbq1c3 nxbq1c1 _16lm1iwi _16lm1iw3 _16lm1iw1b _16lm1iw19" };
|
|
3658
|
+
var ActiveIndicatorWrapperCls = "_16lm1iwi _16lm1iw3 _16lm1iw1b _16lm1iw19 _16lm1iw15 _16lm1iwr";
|
|
3657
3659
|
|
|
3658
3660
|
// src/components/InfiniteTable/components/ActiveRowIndicator.css.ts
|
|
3659
|
-
var ActiveRowIndicatorCls = { visible: "j26lrx1 j26lrx0
|
|
3661
|
+
var ActiveRowIndicatorCls = { visible: "j26lrx1 j26lrx0 _16lm1iwi _16lm1iw3 _16lm1iw18 _16lm1iw19 _16lm1iw1b", hidden: "j26lrx2 j26lrx0 _16lm1iwi _16lm1iw3 _16lm1iw18 _16lm1iw19 _16lm1iw1b" };
|
|
3660
3662
|
|
|
3661
3663
|
// src/components/InfiniteTable/components/ActiveRowIndicator.tsx
|
|
3662
3664
|
var { rootClassName: rootClassName3 } = internalProps;
|
|
@@ -4186,20 +4188,20 @@ var useInternalProps = () => {
|
|
|
4186
4188
|
};
|
|
4187
4189
|
|
|
4188
4190
|
// src/components/InfiniteTable/utilities.css.ts
|
|
4189
|
-
var alignItems = { center: "
|
|
4190
|
-
var cssEllipsisClassName = "
|
|
4191
|
-
var cursor = { pointer: "
|
|
4192
|
-
var display = { flex: "
|
|
4193
|
-
var flex = { "1": "
|
|
4194
|
-
var flexFlow = { column: "
|
|
4195
|
-
var justifyContent = { center: "
|
|
4196
|
-
var left = { "0": "
|
|
4197
|
-
var overflow = { hidden: "
|
|
4191
|
+
var alignItems = { center: "_16lm1iw1n", stretch: "_16lm1iw1o" };
|
|
4192
|
+
var cssEllipsisClassName = "_16lm1iw1y _16lm1iw1z _16lm1iw1s";
|
|
4193
|
+
var cursor = { pointer: "_16lm1iwf", "default": "_16lm1iwg", colResize: "_16lm1iwh" };
|
|
4194
|
+
var display = { flex: "_16lm1iww", contents: "_16lm1iwx", none: "_16lm1iwy", block: "_16lm1iwz", grid: "_16lm1iw10", inlineBlock: "_16lm1iw11", inlineFlex: "_16lm1iw12", inlineGrid: "_16lm1iw13" };
|
|
4195
|
+
var flex = { "1": "_16lm1iwj", none: "_16lm1iwk" };
|
|
4196
|
+
var flexFlow = { column: "_16lm1iw1j", columnReverse: "_16lm1iw1k", row: "_16lm1iw1l", rowReverse: "_16lm1iw1m" };
|
|
4197
|
+
var justifyContent = { center: "_16lm1iw1p", start: "_16lm1iw1q", end: "_16lm1iw1r" };
|
|
4198
|
+
var left = { "0": "_16lm1iw1b", "100%": "_16lm1iw1c", auto: "_16lm1iw1d" };
|
|
4199
|
+
var overflow = { hidden: "_16lm1iw1s", auto: "_16lm1iw1t", visible: "_16lm1iw1u" };
|
|
4198
4200
|
var position = { relative: "_16lm1iw1", absolute: "_16lm1iw2", sticky: "_16lm1iw3", fixed: "_16lm1iw4" };
|
|
4199
|
-
var top = { "0": "
|
|
4200
|
-
var transformTranslateZero = "
|
|
4201
|
-
var userSelect = { none: "
|
|
4202
|
-
var zIndex = { "1": "
|
|
4201
|
+
var top = { "0": "_16lm1iw19", "100%": "_16lm1iw1a" };
|
|
4202
|
+
var transformTranslateZero = "_16lm1iwb";
|
|
4203
|
+
var userSelect = { none: "_16lm1iw14" };
|
|
4204
|
+
var zIndex = { "1": "_16lm1iwl", "10": "_16lm1iwm", "100": "_16lm1iwn", "1000": "_16lm1iwo", "10000": "_16lm1iwp", "100000": "_16lm1iwq", "1000000": "_16lm1iwr", "10000000": "_16lm1iws", "1k": "_16lm1iwt", "10k": "_16lm1iwu", "100k": "_16lm1iwv" };
|
|
4203
4205
|
|
|
4204
4206
|
// src/components/InfiniteTable/components/InfiniteTableBody/InfiniteTableBody.tsx
|
|
4205
4207
|
var InfiniteTableBody = React14.forwardRef(function InfiniteTableBody2(props, ref) {
|
|
@@ -4323,6 +4325,10 @@ function useCellClassName(column, baseClasses, variants, extraFlags) {
|
|
|
4323
4325
|
if (extraFlags.rowSelected) {
|
|
4324
4326
|
result.push(...baseClasses.map((c) => `${c}--row-selected`));
|
|
4325
4327
|
}
|
|
4328
|
+
if (extraFlags.groupRow) {
|
|
4329
|
+
result.push(...baseClasses.map((c) => `${c}--group-row`));
|
|
4330
|
+
result.push(...baseClasses.map((c) => `${c}--${extraFlags.rowExpanded ? "group-row-expanded" : "group-row-collapsed"}`));
|
|
4331
|
+
}
|
|
4326
4332
|
if (column.computedPinned) {
|
|
4327
4333
|
result.push(...baseClasses.map((c) => `${c}--pinned-${column.computedPinned}`));
|
|
4328
4334
|
} else {
|
|
@@ -4356,14 +4362,14 @@ var useInfiniteTable = () => {
|
|
|
4356
4362
|
// src/components/InfiniteTable/InfiniteCls.css.ts
|
|
4357
4363
|
var import_createRuntimeFn = __toModule(require_vanilla_extract_recipes_createRuntimeFn_cjs());
|
|
4358
4364
|
var FooterCls = "_16lm1iw1";
|
|
4359
|
-
var InfiniteCls = "_1yeub2v0 _16lm1iw1
|
|
4365
|
+
var InfiniteCls = "_1yeub2v0 _16lm1iw1 _16lm1iww _16lm1iw1j _16lm1iw0";
|
|
4360
4366
|
var InfiniteClsHasPinnedEnd = "_1yeub2vo";
|
|
4361
4367
|
var InfiniteClsHasPinnedStart = "_1yeub2vn";
|
|
4362
4368
|
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"]] });
|
|
4363
4369
|
var InfiniteClsShiftingColumns = "_1yeub2vl";
|
|
4364
|
-
var PinnedEndIndicatorBorder = "_1yeub2vr _1yeub2vp _16lm1iw2
|
|
4370
|
+
var PinnedEndIndicatorBorder = "_1yeub2vr _1yeub2vp _16lm1iw2 _16lm1iw19 _16lm1iwh _16lm1iw14 _16lm1iw17 _16lm1iw1w _16lm1iwi _16lm1iws";
|
|
4365
4371
|
var PinnedRowsContainerClsVariants = (0, import_createRuntimeFn.createRuntimeFn)({ defaultClassName: "", variantClassNames: { pinned: { start: "_1yeub2vi", end: "_1yeub2vj", false: "_1yeub2vk" } }, defaultVariants: {}, compoundVariants: [] });
|
|
4366
|
-
var PinnedStartIndicatorBorder = "_1yeub2vq _1yeub2vp _16lm1iw2
|
|
4372
|
+
var PinnedStartIndicatorBorder = "_1yeub2vq _1yeub2vp _16lm1iw2 _16lm1iw19 _16lm1iwh _16lm1iw14 _16lm1iw17 _16lm1iw1w _16lm1iwi _16lm1iws";
|
|
4367
4373
|
|
|
4368
4374
|
// src/components/utils/getScrollbarWidth.ts
|
|
4369
4375
|
var scrollbarWidth;
|
|
@@ -5096,7 +5102,7 @@ var useColumnPointerEvents = ({
|
|
|
5096
5102
|
};
|
|
5097
5103
|
};
|
|
5098
5104
|
|
|
5099
|
-
// src/components/InfiniteTable/utils/
|
|
5105
|
+
// src/components/InfiniteTable/utils/RenderHookComponentForInfinite.tsx
|
|
5100
5106
|
var React22 = __toModule(require("react"));
|
|
5101
5107
|
|
|
5102
5108
|
// src/components/InfiniteTable/components/InfiniteTableRow/InfiniteTableColumnCell.tsx
|
|
@@ -5120,8 +5126,8 @@ var import_react17 = __toModule(require("react"));
|
|
|
5120
5126
|
|
|
5121
5127
|
// src/components/InfiniteTable/components/icons/ExpanderIcon.css.ts
|
|
5122
5128
|
var import_createRuntimeFn2 = __toModule(require_vanilla_extract_recipes_createRuntimeFn_cjs());
|
|
5123
|
-
var ExpanderIconCls = "_16lm1iw6
|
|
5124
|
-
var ExpanderIconClsVariants = (0, import_createRuntimeFn2.createRuntimeFn)({ defaultClassName: "", variantClassNames: { expanded: { true: "
|
|
5129
|
+
var ExpanderIconCls = "_16lm1iw6 _16lm1iwk _16lm1iwf";
|
|
5130
|
+
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"]] });
|
|
5125
5131
|
|
|
5126
5132
|
// src/components/InfiniteTable/components/icons/ExpanderIcon.tsx
|
|
5127
5133
|
function ExpanderIcon(props) {
|
|
@@ -5161,7 +5167,7 @@ function ExpanderIcon(props) {
|
|
|
5161
5167
|
var React17 = __toModule(require("react"));
|
|
5162
5168
|
|
|
5163
5169
|
// src/components/InfiniteTable/components/icons/LoadingIcon.css.ts
|
|
5164
|
-
var LoadingIconCls = "
|
|
5170
|
+
var LoadingIconCls = "_16lm1iw9 _16lm1iwk _16lm1iwf";
|
|
5165
5171
|
|
|
5166
5172
|
// src/components/InfiniteTable/components/icons/LoadingIcon.tsx
|
|
5167
5173
|
var LoadingIcon = (props) => {
|
|
@@ -5359,7 +5365,7 @@ function objectValuesExcept(obj, exceptList) {
|
|
|
5359
5365
|
|
|
5360
5366
|
// src/components/InfiniteTable/components/cell.css.ts
|
|
5361
5367
|
var import_createRuntimeFn4 = __toModule(require_vanilla_extract_recipes_createRuntimeFn_cjs());
|
|
5362
|
-
var ColumnCellCls = "_1eexc2a6 _1eexc2a5
|
|
5368
|
+
var ColumnCellCls = "_1eexc2a6 _1eexc2a5 _16lm1iww _16lm1iw1l _16lm1iw1n _16lm1iw2 _16lm1iw1x _16lm1iw1y _16lm1iw14";
|
|
5363
5369
|
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"]] });
|
|
5364
5370
|
var SelectionCheckboxCls = "_1eexc2a7";
|
|
5365
5371
|
|
|
@@ -5368,7 +5374,7 @@ var React19 = __toModule(require("react"));
|
|
|
5368
5374
|
var import_react18 = __toModule(require("react"));
|
|
5369
5375
|
|
|
5370
5376
|
// src/components/InfiniteTable/components/CheckBox.css.ts
|
|
5371
|
-
var CheckBoxCls = "
|
|
5377
|
+
var CheckBoxCls = "_16lm1iwf";
|
|
5372
5378
|
|
|
5373
5379
|
// src/components/InfiniteTable/components/CheckBox.tsx
|
|
5374
5380
|
function forwardProps2() {
|
|
@@ -5710,6 +5716,7 @@ function InfiniteTableColumnCellFn(props) {
|
|
|
5710
5716
|
context: renderingContext
|
|
5711
5717
|
});
|
|
5712
5718
|
const renderParam = renderParams;
|
|
5719
|
+
const renderParamRef = React21.useRef(renderParam);
|
|
5713
5720
|
const onClick = (0, import_react19.useCallback)((event) => {
|
|
5714
5721
|
const colIndex = column.computedVisibleIndex;
|
|
5715
5722
|
getState().cellClick({
|
|
@@ -5793,6 +5800,7 @@ function InfiniteTableColumnCellFn(props) {
|
|
|
5793
5800
|
})
|
|
5794
5801
|
});
|
|
5795
5802
|
}
|
|
5803
|
+
renderParamRef.current = renderParam;
|
|
5796
5804
|
if (column.render) {
|
|
5797
5805
|
return /* @__PURE__ */ React21.createElement(RenderCellHookComponent, {
|
|
5798
5806
|
render: column.render,
|
|
@@ -5849,10 +5857,20 @@ function InfiniteTableColumnCellFn(props) {
|
|
|
5849
5857
|
onClick,
|
|
5850
5858
|
onMouseDown,
|
|
5851
5859
|
cssEllipsis: (_a = column.cssEllipsis) != null ? _a : true,
|
|
5852
|
-
className: join(useCellClassName(column, [InfiniteTableColumnCellClassName, InfiniteTableCellClassName], ColumnCellRecipe, {
|
|
5860
|
+
className: join(useCellClassName(column, [InfiniteTableColumnCellClassName, InfiniteTableCellClassName], ColumnCellRecipe, {
|
|
5861
|
+
dragging: false,
|
|
5862
|
+
zebra,
|
|
5863
|
+
rowActive,
|
|
5864
|
+
rowSelected,
|
|
5865
|
+
groupRow: rowInfo.isGroupRow,
|
|
5866
|
+
rowExpanded: rowInfo.isGroupRow ? !rowInfo.collapsed : false
|
|
5867
|
+
}), colClassName, rowComputedClassName),
|
|
5853
5868
|
renderChildren
|
|
5854
5869
|
};
|
|
5855
|
-
|
|
5870
|
+
const ContextProvider = InfiniteTableColumnCellContext.Provider;
|
|
5871
|
+
return /* @__PURE__ */ React21.createElement(ContextProvider, {
|
|
5872
|
+
value: renderParamRef.current
|
|
5873
|
+
}, /* @__PURE__ */ React21.createElement(InfiniteTableCell, __spreadValues({}, cellProps)));
|
|
5856
5874
|
}
|
|
5857
5875
|
var InfiniteTableColumnCell = React21.memo(InfiniteTableColumnCellFn);
|
|
5858
5876
|
function useInfiniteColumnCell() {
|
|
@@ -5860,11 +5878,13 @@ function useInfiniteColumnCell() {
|
|
|
5860
5878
|
return result;
|
|
5861
5879
|
}
|
|
5862
5880
|
|
|
5863
|
-
// src/components/
|
|
5881
|
+
// src/components/RenderHookComponent.tsx
|
|
5864
5882
|
function RenderHookComponent(props) {
|
|
5865
5883
|
var _a;
|
|
5866
5884
|
return (_a = props.render(props.renderParam)) != null ? _a : null;
|
|
5867
5885
|
}
|
|
5886
|
+
|
|
5887
|
+
// src/components/InfiniteTable/utils/RenderHookComponentForInfinite.tsx
|
|
5868
5888
|
function RenderCellHookComponent(props) {
|
|
5869
5889
|
const ContextProvider = InfiniteTableColumnCellContext.Provider;
|
|
5870
5890
|
return /* @__PURE__ */ React22.createElement(ContextProvider, {
|
|
@@ -5926,19 +5946,19 @@ var import_react20 = __toModule(require("react"));
|
|
|
5926
5946
|
|
|
5927
5947
|
// src/components/InfiniteTable/components/InfiniteTableHeader/header.css.ts
|
|
5928
5948
|
var import_createRuntimeFn5 = __toModule(require_vanilla_extract_recipes_createRuntimeFn_cjs());
|
|
5929
|
-
var CellCls = "_1eexc2a5
|
|
5930
|
-
var HeaderCellContentRecipe = (0, import_createRuntimeFn5.createRuntimeFn)({ defaultClassName: "_12zfob11e
|
|
5931
|
-
var HeaderCellProxy = "_12zfob1k
|
|
5932
|
-
var HeaderCellRecipe = (0, import_createRuntimeFn5.createRuntimeFn)({ defaultClassName: "_12zfob1l
|
|
5933
|
-
var HeaderClsRecipe = (0, import_createRuntimeFn5.createRuntimeFn)({ defaultClassName: "_12zfob16
|
|
5934
|
-
var HeaderFilterCls = "_12zfob11j
|
|
5935
|
-
var HeaderFilterEditorCls = "
|
|
5936
|
-
var HeaderGroupCls = "_12zfob11i
|
|
5949
|
+
var CellCls = "_1eexc2a5 _16lm1iww _16lm1iw1l _16lm1iw1n _16lm1iw2 _16lm1iw1x _16lm1iw1y _16lm1iw14";
|
|
5950
|
+
var HeaderCellContentRecipe = (0, import_createRuntimeFn5.createRuntimeFn)({ defaultClassName: "_12zfob11e _16lm1iw16 _16lm1iw18 _16lm1iww _16lm1iw1l _16lm1iw1n", variantClassNames: { filtered: { false: "_12zfob11f", true: "_12zfob11g" } }, defaultVariants: {}, compoundVariants: [] });
|
|
5951
|
+
var HeaderCellProxy = "_12zfob1k _16lm1iw1y _16lm1iw1z _16lm1iw1s";
|
|
5952
|
+
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"]] });
|
|
5953
|
+
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"]] });
|
|
5954
|
+
var HeaderFilterCls = "_12zfob11j _16lm1iww _16lm1iw1l _16lm1iw1n _16lm1iw1";
|
|
5955
|
+
var HeaderFilterEditorCls = "_16lm1iw18 _16lm1iw16";
|
|
5956
|
+
var HeaderGroupCls = "_12zfob11i _16lm1iww _16lm1iw1l _16lm1iw1n";
|
|
5937
5957
|
var HeaderScrollbarPlaceholderCls = "_12zfob15 _16lm1iw2";
|
|
5938
5958
|
var HeaderSortIconCls = "_16lm1iw1";
|
|
5939
5959
|
var HeaderSortIconIndexCls = "_12zfob14";
|
|
5940
5960
|
var HeaderSortIconRecipe = (0, import_createRuntimeFn5.createRuntimeFn)({ defaultClassName: "", variantClassNames: { align: { start: "_12zfob11", center: "_12zfob12", end: "_12zfob13" } }, defaultVariants: {}, compoundVariants: [] });
|
|
5941
|
-
var HeaderWrapperCls = "_12zfob11h
|
|
5961
|
+
var HeaderWrapperCls = "_12zfob11h _16lm1iw1s _16lm1iw1 _16lm1iww _16lm1iw1l";
|
|
5942
5962
|
|
|
5943
5963
|
// src/components/InfiniteTable/components/icons/SortIcon.tsx
|
|
5944
5964
|
var defaultLineStyle = {
|
|
@@ -6501,9 +6521,9 @@ function getColumnGroupResizer(colIndexes, config) {
|
|
|
6501
6521
|
|
|
6502
6522
|
// src/components/InfiniteTable/components/InfiniteTableHeader/ResizeHandle/ResizeHandle.css.ts
|
|
6503
6523
|
var import_createRuntimeFn6 = __toModule(require_vanilla_extract_recipes_createRuntimeFn_cjs());
|
|
6504
|
-
var ResizeHandleCls = "zneyzh0 _16lm1iw2
|
|
6505
|
-
var ResizeHandleDraggerClsRecipe = (0, import_createRuntimeFn6.createRuntimeFn)({ defaultClassName: "zneyzhb _16lm1iw2
|
|
6506
|
-
var ResizeHandleRecipeCls = (0, import_createRuntimeFn6.createRuntimeFn)({ defaultClassName: "", variantClassNames: { computedPinned: { start: "zneyzh1", end: "zneyzh2
|
|
6524
|
+
var ResizeHandleCls = "zneyzh0 _16lm1iw2 _16lm1iw19 _16lm1iw1g _16lm1iw1e _16lm1iwh _16lm1iw1s";
|
|
6525
|
+
var ResizeHandleDraggerClsRecipe = (0, import_createRuntimeFn6.createRuntimeFn)({ defaultClassName: "zneyzhb _16lm1iw2 _16lm1iw19 _16lm1iw1e", variantClassNames: { constrained: { false: "zneyzhc", true: "zneyzhd" } }, defaultVariants: {}, compoundVariants: [] });
|
|
6526
|
+
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"]] });
|
|
6507
6527
|
|
|
6508
6528
|
// src/components/InfiniteTable/components/InfiniteTableHeader/ResizeHandle/index.tsx
|
|
6509
6529
|
var { rootClassName: rootClassName8 } = internalProps;
|
|
@@ -6886,7 +6906,9 @@ function InfiniteTableHeaderCell(props) {
|
|
|
6886
6906
|
dragging,
|
|
6887
6907
|
rowSelected: false,
|
|
6888
6908
|
zebra: false,
|
|
6889
|
-
rowActive: false
|
|
6909
|
+
rowActive: false,
|
|
6910
|
+
groupRow: false,
|
|
6911
|
+
rowExpanded: false
|
|
6890
6912
|
}), CellCls),
|
|
6891
6913
|
cssEllipsis: (_e = (_d = column.headerCssEllipsis) != null ? _d : column.cssEllipsis) != null ? _e : true,
|
|
6892
6914
|
afterChildren: /* @__PURE__ */ React28.createElement(React28.Fragment, null, showColumnFilters ? column.computedFilterable ? /* @__PURE__ */ React28.createElement(InfiniteTableColumnHeaderFilter, {
|
|
@@ -7478,8 +7500,8 @@ var InfiniteTableLicenseFooter = React34.forwardRef(function InfiniteTableLicens
|
|
|
7478
7500
|
var React35 = __toModule(require("react"));
|
|
7479
7501
|
|
|
7480
7502
|
// src/components/InfiniteTable/components/LoadMask.css.ts
|
|
7481
|
-
var LoadMaskCls = { visible: "qy58ya1 qy58ya0 _16lm1iw2
|
|
7482
|
-
var LoadMaskOverlayCls = "qy58ya3 _16lm1iw2
|
|
7503
|
+
var LoadMaskCls = { visible: "qy58ya1 qy58ya0 _16lm1iw2 _16lm1iw19 _16lm1iw1b _16lm1iw1g _16lm1iw1e", hidden: "qy58ya2 qy58ya0 _16lm1iw2 _16lm1iw19 _16lm1iw1b _16lm1iw1g _16lm1iw1e" };
|
|
7504
|
+
var LoadMaskOverlayCls = "qy58ya3 _16lm1iw2 _16lm1iw19 _16lm1iw1b _16lm1iw1g _16lm1iw1e";
|
|
7483
7505
|
var LoadMaskTextCls = "qy58ya4";
|
|
7484
7506
|
|
|
7485
7507
|
// src/components/InfiniteTable/components/LoadMask.tsx
|
|
@@ -7528,12 +7550,14 @@ function deepClone(source) {
|
|
|
7528
7550
|
return target;
|
|
7529
7551
|
}
|
|
7530
7552
|
|
|
7531
|
-
// src/utils/groupAndPivot/
|
|
7532
|
-
var LAZY_ROOT_KEY_FOR_GROUPS = "____root____";
|
|
7533
|
-
var NOT_LOADED_YET_KEY_PREFIX = "____not_loaded_yet____";
|
|
7553
|
+
// src/utils/groupAndPivot/defaultToKey.ts
|
|
7534
7554
|
function DEFAULT_TO_KEY(value) {
|
|
7535
7555
|
return value;
|
|
7536
7556
|
}
|
|
7557
|
+
|
|
7558
|
+
// src/utils/groupAndPivot/index.ts
|
|
7559
|
+
var LAZY_ROOT_KEY_FOR_GROUPS = "____root____";
|
|
7560
|
+
var NOT_LOADED_YET_KEY_PREFIX = "____not_loaded_yet____";
|
|
7537
7561
|
function initReducers(reducers) {
|
|
7538
7562
|
if (!reducers || !Object.keys(reducers).length) {
|
|
7539
7563
|
return {};
|
|
@@ -7606,6 +7630,14 @@ function lazyGroup(groupParams, rootData) {
|
|
|
7606
7630
|
if (currentGroupKeys.length == groupBy.length && groupBy.length) {
|
|
7607
7631
|
if (current) {
|
|
7608
7632
|
current.items = dataArray;
|
|
7633
|
+
for (let i = 0, len = currentGroupKeys.length; i < len; i++) {
|
|
7634
|
+
const currentKeys = currentGroupKeys.slice(0, i);
|
|
7635
|
+
const deepMapGroupValue = deepMap.get(currentKeys);
|
|
7636
|
+
if (deepMapGroupValue) {
|
|
7637
|
+
deepMapGroupValue.items = deepMapGroupValue.items || [];
|
|
7638
|
+
deepMapGroupValue.items = deepMapGroupValue.items.concat(dataArray);
|
|
7639
|
+
}
|
|
7640
|
+
}
|
|
7609
7641
|
indexer.indexArray(dataArray, toPrimaryKey);
|
|
7610
7642
|
}
|
|
7611
7643
|
return next == null ? void 0 : next();
|
|
@@ -7626,7 +7658,7 @@ function lazyGroup(groupParams, rootData) {
|
|
|
7626
7658
|
continue;
|
|
7627
7659
|
}
|
|
7628
7660
|
const dataObject = dataArray[i].data;
|
|
7629
|
-
const dataKeys = dataArray[i].keys;
|
|
7661
|
+
const dataKeys = dataArray[i].keys || [];
|
|
7630
7662
|
if (dataKeys.length) {
|
|
7631
7663
|
const key = dataKeys[dataKeys.length - 1];
|
|
7632
7664
|
currentGroupKeys.push(key);
|
|
@@ -7695,14 +7727,6 @@ function processGroup(deepMap, currentGroupKeys, currentPivotKeys, item, itemInd
|
|
|
7695
7727
|
currentPivotKeys.length = 0;
|
|
7696
7728
|
}
|
|
7697
7729
|
}
|
|
7698
|
-
function getGroupKeysForDataItem(data, groupBy) {
|
|
7699
|
-
return groupBy.reduce((groupKeys, groupBy2) => {
|
|
7700
|
-
const { field: groupByProperty, toKey: groupToKey } = groupBy2;
|
|
7701
|
-
const key = (groupToKey || DEFAULT_TO_KEY)(data[groupByProperty], data);
|
|
7702
|
-
groupKeys.push(key);
|
|
7703
|
-
return groupKeys;
|
|
7704
|
-
}, []);
|
|
7705
|
-
}
|
|
7706
7730
|
function group(groupParams, data) {
|
|
7707
7731
|
const {
|
|
7708
7732
|
groupBy,
|
|
@@ -7804,7 +7828,7 @@ function flatten(groupResult) {
|
|
|
7804
7828
|
}
|
|
7805
7829
|
function getEnhancedGroupData(options, deepMapValue) {
|
|
7806
7830
|
var _a;
|
|
7807
|
-
const { groupBy, groupKeys,
|
|
7831
|
+
const { groupBy, groupKeys, parents, reducers, lazyLoad } = options;
|
|
7808
7832
|
const groupNesting = groupKeys.length;
|
|
7809
7833
|
const {
|
|
7810
7834
|
items: groupItems,
|
|
@@ -7839,7 +7863,7 @@ function getEnhancedGroupData(options, deepMapValue) {
|
|
|
7839
7863
|
selectedChildredCount: 0,
|
|
7840
7864
|
deselectedChildredCount: 0,
|
|
7841
7865
|
id: `${groupKeys}`,
|
|
7842
|
-
collapsed,
|
|
7866
|
+
collapsed: false,
|
|
7843
7867
|
dataSourceHasGrouping: true,
|
|
7844
7868
|
selfLoaded,
|
|
7845
7869
|
error: options.error,
|
|
@@ -7898,7 +7922,7 @@ function enhancedFlatten(param) {
|
|
|
7898
7922
|
var _a, _b;
|
|
7899
7923
|
const items = deepMapValue.items;
|
|
7900
7924
|
const groupNesting = groupKeys.length;
|
|
7901
|
-
|
|
7925
|
+
let collapsed = (_a = groupRowsState == null ? void 0 : groupRowsState.isGroupRowCollapsed(groupKeys)) != null ? _a : false;
|
|
7902
7926
|
indexInParentGroups.push(indexInGroup);
|
|
7903
7927
|
const enhancedGroupData = getEnhancedGroupData({
|
|
7904
7928
|
lazyLoad,
|
|
@@ -7911,11 +7935,10 @@ function enhancedFlatten(param) {
|
|
|
7911
7935
|
groupKeys,
|
|
7912
7936
|
error: deepMapValue.error,
|
|
7913
7937
|
totalChildrenCount: deepMapValue.totalChildrenCount,
|
|
7914
|
-
childrenLoading: deepMapValue.childrenLoading,
|
|
7938
|
+
childrenLoading: (deepMapValue.childrenLoading || !collapsed && !deepMapValue.childrenAvailable) && lazyLoad,
|
|
7915
7939
|
childrenAvailable: deepMapValue.childrenAvailable,
|
|
7916
7940
|
directChildrenCount: groupKeys.length === groupByStrings.length ? deepMapValue.items.length : deepMap.getDirectChildrenSizeFor(groupKeys),
|
|
7917
|
-
directChildrenLoadedCount: 0
|
|
7918
|
-
collapsed
|
|
7941
|
+
directChildrenLoadedCount: 0
|
|
7919
7942
|
}, deepMapValue);
|
|
7920
7943
|
if (isRowSelected) {
|
|
7921
7944
|
enhancedGroupData.rowSelected = isRowSelected(enhancedGroupData);
|
|
@@ -7927,6 +7950,10 @@ function enhancedFlatten(param) {
|
|
|
7927
7950
|
}
|
|
7928
7951
|
const parent = parents[parents.length - 1];
|
|
7929
7952
|
const parentCollapsed = (_b = parent == null ? void 0 : parent.collapsed) != null ? _b : false;
|
|
7953
|
+
if (parentCollapsed) {
|
|
7954
|
+
collapsed = true;
|
|
7955
|
+
}
|
|
7956
|
+
enhancedGroupData.collapsed = collapsed;
|
|
7930
7957
|
let include = generateGroupRows || collapsed;
|
|
7931
7958
|
if (parentCollapsed) {
|
|
7932
7959
|
include = false;
|
|
@@ -7934,27 +7961,16 @@ function enhancedFlatten(param) {
|
|
|
7934
7961
|
if (include) {
|
|
7935
7962
|
result.push(enhancedGroupData);
|
|
7936
7963
|
}
|
|
7937
|
-
|
|
7938
|
-
|
|
7939
|
-
|
|
7940
|
-
|
|
7941
|
-
|
|
7942
|
-
}
|
|
7943
|
-
parent2.collapsedChildrenCount += enhancedGroupData.groupCount;
|
|
7944
|
-
parent2.collapsedGroupsCount += 1;
|
|
7945
|
-
});
|
|
7946
|
-
} else {
|
|
7947
|
-
if (!parentCollapsed) {
|
|
7948
|
-
parents.forEach((parent2) => {
|
|
7949
|
-
parent2.deepRowInfoArray.push(enhancedGroupData);
|
|
7950
|
-
});
|
|
7951
|
-
}
|
|
7952
|
-
}
|
|
7964
|
+
enhancedGroupData.collapsedChildrenCount = 0;
|
|
7965
|
+
parents.forEach((parent2) => {
|
|
7966
|
+
parent2.deepRowInfoArray.push(enhancedGroupData);
|
|
7967
|
+
parent2.collapsedGroupsCount += collapsed ? 1 : 0;
|
|
7968
|
+
});
|
|
7953
7969
|
if (parent && enhancedGroupData.selfLoaded && lazyLoad) {
|
|
7954
7970
|
parent.directChildrenLoadedCount += 1;
|
|
7955
7971
|
}
|
|
7956
7972
|
parents.push(enhancedGroupData);
|
|
7957
|
-
const continueWithChildren =
|
|
7973
|
+
const continueWithChildren = true;
|
|
7958
7974
|
if (continueWithChildren) {
|
|
7959
7975
|
if (!next) {
|
|
7960
7976
|
if (!pivot) {
|
|
@@ -7992,9 +8008,10 @@ function enhancedFlatten(param) {
|
|
|
7992
8008
|
if (last && item) {
|
|
7993
8009
|
parent2.directChildrenLoadedCount += 1;
|
|
7994
8010
|
}
|
|
7995
|
-
if (
|
|
7996
|
-
parent2.
|
|
8011
|
+
if (collapsed) {
|
|
8012
|
+
parent2.collapsedChildrenCount += 1;
|
|
7997
8013
|
}
|
|
8014
|
+
parent2.deepRowInfoArray.push(rowInfo);
|
|
7998
8015
|
});
|
|
7999
8016
|
if (!collapsed) {
|
|
8000
8017
|
result[startIndex + index] = rowInfo;
|
|
@@ -8660,8 +8677,10 @@ function useLazyLoadRange() {
|
|
|
8660
8677
|
const {
|
|
8661
8678
|
lazyLoadBatchSize,
|
|
8662
8679
|
lazyLoad,
|
|
8680
|
+
originalLazyGroupDataChangeDetect,
|
|
8663
8681
|
notifyRenderRangeChange,
|
|
8664
8682
|
dataArray,
|
|
8683
|
+
groupRowsState,
|
|
8665
8684
|
scrollStopDelayUpdatedByTable
|
|
8666
8685
|
} = componentState;
|
|
8667
8686
|
const latestRenderRangeRef = (0, import_react30.useRef)(null);
|
|
@@ -8690,20 +8709,27 @@ function useLazyLoadRange() {
|
|
|
8690
8709
|
}, cache);
|
|
8691
8710
|
};
|
|
8692
8711
|
const debouncedLoadRange = (0, import_react30.useMemo)(() => debounce(loadRange, { wait: scrollStopDelayUpdatedByTable }), [scrollStopDelayUpdatedByTable]);
|
|
8693
|
-
(
|
|
8712
|
+
useEffectWithChanges((changes) => {
|
|
8694
8713
|
if (lazyLoad) {
|
|
8714
|
+
if (changes.originalLazyGroupDataChangeDetect || changes.groupRowsState) {
|
|
8715
|
+
loadRange(notifyRenderRangeChange.get());
|
|
8716
|
+
}
|
|
8695
8717
|
return notifyRenderRangeChange.onChange((renderRange) => {
|
|
8696
8718
|
latestRenderRangeRef.current = renderRange;
|
|
8697
8719
|
loadRange(renderRange);
|
|
8698
8720
|
});
|
|
8699
8721
|
}
|
|
8700
8722
|
return;
|
|
8701
|
-
},
|
|
8723
|
+
}, {
|
|
8724
|
+
lazyLoadBatchSize,
|
|
8725
|
+
lazyLoad,
|
|
8726
|
+
originalLazyGroupDataChangeDetect,
|
|
8727
|
+
groupRowsState
|
|
8728
|
+
});
|
|
8702
8729
|
(0, import_react30.useEffect)(() => {
|
|
8703
8730
|
if (lazyLoadBatchSize && lazyLoadBatchSize > 0) {
|
|
8704
8731
|
debouncedLoadRange();
|
|
8705
8732
|
}
|
|
8706
|
-
return;
|
|
8707
8733
|
}, [dataArray]);
|
|
8708
8734
|
}
|
|
8709
8735
|
function lazyLoadRange(options, cache) {
|
|
@@ -8793,6 +8819,16 @@ function lazyLoadRange(options, cache) {
|
|
|
8793
8819
|
}, initialPromise);
|
|
8794
8820
|
}
|
|
8795
8821
|
|
|
8822
|
+
// src/utils/groupAndPivot/getGroupKeysForDataItem.ts
|
|
8823
|
+
function getGroupKeysForDataItem(data, groupBy) {
|
|
8824
|
+
return groupBy.reduce((groupKeys, groupBy2) => {
|
|
8825
|
+
const { field: groupByProperty, toKey: groupToKey } = groupBy2;
|
|
8826
|
+
const key = (groupToKey || DEFAULT_TO_KEY)(data[groupByProperty], data);
|
|
8827
|
+
groupKeys.push(key);
|
|
8828
|
+
return groupKeys;
|
|
8829
|
+
}, []);
|
|
8830
|
+
}
|
|
8831
|
+
|
|
8796
8832
|
// src/components/DataSource/RowSelectionState.ts
|
|
8797
8833
|
var RowSelectionState = class {
|
|
8798
8834
|
constructor(state, getConfig, _forTestingOnly) {
|
|
@@ -8869,8 +8905,8 @@ var RowSelectionState = class {
|
|
|
8869
8905
|
getGroupByLength() {
|
|
8870
8906
|
return this.getConfig().groupBy.length;
|
|
8871
8907
|
}
|
|
8872
|
-
static from(rowSeleStateObject, getConfig,
|
|
8873
|
-
return new RowSelectionState(rowSeleStateObject, getConfig,
|
|
8908
|
+
static from(rowSeleStateObject, getConfig, overrides) {
|
|
8909
|
+
return new RowSelectionState(rowSeleStateObject, getConfig, overrides);
|
|
8874
8910
|
}
|
|
8875
8911
|
update(stateObject) {
|
|
8876
8912
|
var _a, _b;
|
|
@@ -9238,6 +9274,9 @@ var RowSelectionState = class {
|
|
|
9238
9274
|
};
|
|
9239
9275
|
|
|
9240
9276
|
// src/components/InfiniteTable/api/getSelectionApi.ts
|
|
9277
|
+
function cloneRowSelection(rowSelection, stateOrGetDataSourceState) {
|
|
9278
|
+
return new RowSelectionState(rowSelection, rowSelectionStateConfigGetter(stateOrGetDataSourceState));
|
|
9279
|
+
}
|
|
9241
9280
|
function rowSelectionStateConfigGetter(stateOrStateGetter) {
|
|
9242
9281
|
return () => {
|
|
9243
9282
|
const state = typeof stateOrStateGetter === "function" ? stateOrStateGetter() : stateOrStateGetter;
|
|
@@ -9580,16 +9619,7 @@ var forwardProps3 = (setupState) => {
|
|
|
9580
9619
|
collapseGroupRowsOnDataFunctionChange: (collapseGroupRowsOnDataFunctionChange) => collapseGroupRowsOnDataFunctionChange != null ? collapseGroupRowsOnDataFunctionChange : true,
|
|
9581
9620
|
loading: (loading) => loading != null ? loading : false,
|
|
9582
9621
|
sortInfo: (sortInfo) => normalizeSortInfo(sortInfo, setupState.propsCache.get("sortInfo")),
|
|
9583
|
-
groupBy: (groupBy) => groupBy != null ? groupBy : []
|
|
9584
|
-
groupRowsState: (groupRowsState) => {
|
|
9585
|
-
if (groupRowsState && !(groupRowsState instanceof GroupRowsState)) {
|
|
9586
|
-
groupRowsState = new GroupRowsState(groupRowsState);
|
|
9587
|
-
}
|
|
9588
|
-
return groupRowsState || new GroupRowsState({
|
|
9589
|
-
expandedRows: true,
|
|
9590
|
-
collapsedRows: []
|
|
9591
|
-
});
|
|
9592
|
-
}
|
|
9622
|
+
groupBy: (groupBy) => groupBy != null ? groupBy : []
|
|
9593
9623
|
};
|
|
9594
9624
|
};
|
|
9595
9625
|
function getLivePaginationCursorValue(livePaginationCursorProp, state) {
|
|
@@ -9648,8 +9678,17 @@ function mapPropsToState(params) {
|
|
|
9648
9678
|
}
|
|
9649
9679
|
const primaryKeyDescriptor = state.primaryKey;
|
|
9650
9680
|
const toPrimaryKey = typeof primaryKeyDescriptor === "function" ? (data) => primaryKeyDescriptor(data) : (data) => data[primaryKeyDescriptor];
|
|
9681
|
+
let groupRowsState = props.groupRowsState || state.groupRowsState || props.defaultGroupRowsState;
|
|
9682
|
+
if (groupRowsState && !(groupRowsState instanceof GroupRowsState)) {
|
|
9683
|
+
groupRowsState = new GroupRowsState(groupRowsState);
|
|
9684
|
+
}
|
|
9685
|
+
groupRowsState = groupRowsState || new GroupRowsState(state.lazyLoad ? { expandedRows: [], collapsedRows: true } : {
|
|
9686
|
+
expandedRows: true,
|
|
9687
|
+
collapsedRows: []
|
|
9688
|
+
});
|
|
9651
9689
|
const result = {
|
|
9652
9690
|
selectionMode,
|
|
9691
|
+
groupRowsState,
|
|
9653
9692
|
rowSelection: rowSelectionState,
|
|
9654
9693
|
toPrimaryKey,
|
|
9655
9694
|
operatorsByFilterType,
|
|
@@ -12392,7 +12431,7 @@ var useLicense = (licenseKey = "") => {
|
|
|
12392
12431
|
const valid = (0, import_react44.useMemo)(() => {
|
|
12393
12432
|
let valid2 = isValidLicense(licenseKey, {
|
|
12394
12433
|
publishedAt: 1624970570587,
|
|
12395
|
-
version: "0.4.
|
|
12434
|
+
version: "0.4.13"
|
|
12396
12435
|
});
|
|
12397
12436
|
if (!licenseKey && !valid2 && isInsidePlayground) {
|
|
12398
12437
|
return true;
|
|
@@ -12727,7 +12766,14 @@ function onCellClick(context, event) {
|
|
|
12727
12766
|
updateRowSelectionOnCellClick(context, event);
|
|
12728
12767
|
}
|
|
12729
12768
|
function updateRowSelectionOnCellClick(context, event) {
|
|
12730
|
-
const {
|
|
12769
|
+
const {
|
|
12770
|
+
rowIndex,
|
|
12771
|
+
getDataSourceState,
|
|
12772
|
+
getComputed,
|
|
12773
|
+
dataSourceActions,
|
|
12774
|
+
api,
|
|
12775
|
+
cloneRowSelection: cloneRowSelection2
|
|
12776
|
+
} = context;
|
|
12731
12777
|
const { multiRowSelector, renderSelectionCheckBox } = getComputed();
|
|
12732
12778
|
const dataSourceState = getDataSourceState();
|
|
12733
12779
|
const { selectionMode, groupBy, dataArray } = dataSourceState;
|
|
@@ -12739,7 +12785,7 @@ function updateRowSelectionOnCellClick(context, event) {
|
|
|
12739
12785
|
return false;
|
|
12740
12786
|
}
|
|
12741
12787
|
let { rowSelection: rowSelectionState } = dataSourceState;
|
|
12742
|
-
rowSelectionState =
|
|
12788
|
+
rowSelectionState = cloneRowSelection2(rowSelectionState);
|
|
12743
12789
|
multiRowSelector.rowSelectionState = rowSelectionState;
|
|
12744
12790
|
if (rowSelectionState && typeof rowSelectionState === "object") {
|
|
12745
12791
|
if (event.shiftKey) {
|
|
@@ -12769,8 +12815,9 @@ function clamp(value, min, max) {
|
|
|
12769
12815
|
}
|
|
12770
12816
|
|
|
12771
12817
|
// src/components/InfiniteTable/eventHandlers/keyboardNavigation.ts
|
|
12772
|
-
function handleRowNavigation(options) {
|
|
12773
|
-
const {
|
|
12818
|
+
function handleRowNavigation(options, event) {
|
|
12819
|
+
const { getState, getDataSourceState, actions, api } = options;
|
|
12820
|
+
const { key } = event;
|
|
12774
12821
|
const dataArray = getDataSourceState().dataArray;
|
|
12775
12822
|
const arrLength = dataArray.length;
|
|
12776
12823
|
const state = getState();
|
|
@@ -12835,16 +12882,15 @@ function handleRowNavigation(options) {
|
|
|
12835
12882
|
actions.activeRowIndex = activeRowIndex;
|
|
12836
12883
|
return true;
|
|
12837
12884
|
}
|
|
12838
|
-
function handleCellNavigation(options) {
|
|
12885
|
+
function handleCellNavigation(options, event) {
|
|
12839
12886
|
const {
|
|
12840
12887
|
api,
|
|
12841
|
-
key,
|
|
12842
|
-
shiftKey,
|
|
12843
12888
|
getState,
|
|
12844
12889
|
getComputed,
|
|
12845
12890
|
getDataSourceState,
|
|
12846
12891
|
actions
|
|
12847
12892
|
} = options;
|
|
12893
|
+
const { key, shiftKey } = event;
|
|
12848
12894
|
const dataArray = getDataSourceState().dataArray;
|
|
12849
12895
|
const state = getState();
|
|
12850
12896
|
const { activeCellIndex, brain } = state;
|
|
@@ -12934,18 +12980,19 @@ var validKeys = {
|
|
|
12934
12980
|
Enter: true,
|
|
12935
12981
|
" ": true
|
|
12936
12982
|
};
|
|
12937
|
-
function handleKeyboardNavigation(options) {
|
|
12983
|
+
function handleKeyboardNavigation(options, event) {
|
|
12984
|
+
const { key } = event;
|
|
12938
12985
|
const { getState } = options;
|
|
12939
12986
|
const state = getState();
|
|
12940
12987
|
const { activeRowIndex, activeCellIndex, keyboardNavigation } = state;
|
|
12941
|
-
if (!validKeys[
|
|
12988
|
+
if (!validKeys[key]) {
|
|
12942
12989
|
return false;
|
|
12943
12990
|
}
|
|
12944
12991
|
if (activeRowIndex != null && keyboardNavigation === "row") {
|
|
12945
|
-
return handleRowNavigation(options);
|
|
12992
|
+
return handleRowNavigation(options, event);
|
|
12946
12993
|
}
|
|
12947
12994
|
if (activeCellIndex != null && keyboardNavigation === "cell") {
|
|
12948
|
-
return handleCellNavigation(options);
|
|
12995
|
+
return handleCellNavigation(options, event);
|
|
12949
12996
|
}
|
|
12950
12997
|
return false;
|
|
12951
12998
|
}
|
|
@@ -12956,16 +13003,15 @@ var validKeys2 = {
|
|
|
12956
13003
|
" ": true,
|
|
12957
13004
|
a: true
|
|
12958
13005
|
};
|
|
12959
|
-
function handleKeyboardSelection(context) {
|
|
13006
|
+
function handleKeyboardSelection(context, keyboardEvent) {
|
|
12960
13007
|
const {
|
|
12961
13008
|
getState,
|
|
12962
13009
|
getDataSourceState,
|
|
12963
13010
|
dataSourceActions,
|
|
12964
13011
|
api: imperativeApi,
|
|
12965
|
-
|
|
12966
|
-
ctrlKey,
|
|
12967
|
-
metaKey
|
|
13012
|
+
cloneRowSelection: cloneRowSelection2
|
|
12968
13013
|
} = context;
|
|
13014
|
+
const { key, ctrlKey, metaKey } = keyboardEvent;
|
|
12969
13015
|
if (!validKeys2[key]) {
|
|
12970
13016
|
return false;
|
|
12971
13017
|
}
|
|
@@ -12994,21 +13040,21 @@ function handleKeyboardSelection(context) {
|
|
|
12994
13040
|
return false;
|
|
12995
13041
|
}
|
|
12996
13042
|
if (key === "a" && (ctrlKey || metaKey)) {
|
|
12997
|
-
const rowSelectionState =
|
|
13043
|
+
const rowSelectionState = cloneRowSelection2(rowSelection);
|
|
12998
13044
|
rowSelectionState.selectAll();
|
|
12999
13045
|
dataSourceActions.rowSelection = rowSelectionState;
|
|
13000
13046
|
return true;
|
|
13001
13047
|
}
|
|
13002
13048
|
if (key === " ") {
|
|
13003
13049
|
if (groupBy.length) {
|
|
13004
|
-
if (rowInfo.isGroupRow) {
|
|
13050
|
+
if (rowInfo.isGroupRow && rowInfo.groupKeys) {
|
|
13005
13051
|
imperativeApi.selectionApi.toggleGroupRowSelection(rowInfo.groupKeys);
|
|
13006
13052
|
} else {
|
|
13007
13053
|
imperativeApi.selectionApi.toggleRowSelection(rowInfo.id);
|
|
13008
13054
|
}
|
|
13009
13055
|
return true;
|
|
13010
13056
|
} else {
|
|
13011
|
-
const event = __spreadValues({},
|
|
13057
|
+
const event = __spreadValues({}, keyboardEvent);
|
|
13012
13058
|
const { renderSelectionCheckBox } = context.getComputed();
|
|
13013
13059
|
if (renderSelectionCheckBox) {
|
|
13014
13060
|
event.metaKey = false;
|
|
@@ -13023,15 +13069,14 @@ function handleKeyboardSelection(context) {
|
|
|
13023
13069
|
// src/components/InfiniteTable/eventHandlers/onKeyDown.ts
|
|
13024
13070
|
function onKeyDown(context, event) {
|
|
13025
13071
|
const keyboardHandlerContext = __spreadProps(__spreadValues({}, context), {
|
|
13026
|
-
|
|
13027
|
-
|
|
13028
|
-
|
|
13029
|
-
shiftKey: event.shiftKey
|
|
13072
|
+
cloneRowSelection: (rowSelection) => {
|
|
13073
|
+
return cloneRowSelection(rowSelection, context.getDataSourceState);
|
|
13074
|
+
}
|
|
13030
13075
|
});
|
|
13031
|
-
if (handleKeyboardSelection(keyboardHandlerContext)) {
|
|
13076
|
+
if (handleKeyboardSelection(keyboardHandlerContext, event)) {
|
|
13032
13077
|
event.preventDefault();
|
|
13033
13078
|
}
|
|
13034
|
-
if (handleKeyboardNavigation(keyboardHandlerContext)) {
|
|
13079
|
+
if (handleKeyboardNavigation(keyboardHandlerContext, event)) {
|
|
13035
13080
|
event.preventDefault();
|
|
13036
13081
|
}
|
|
13037
13082
|
}
|
|
@@ -13052,7 +13097,10 @@ function useEventHandlersContext() {
|
|
|
13052
13097
|
getState,
|
|
13053
13098
|
actions,
|
|
13054
13099
|
getDataSourceState,
|
|
13055
|
-
dataSourceActions
|
|
13100
|
+
dataSourceActions,
|
|
13101
|
+
cloneRowSelection: (rowSelection) => {
|
|
13102
|
+
return cloneRowSelection(rowSelection, getDataSourceState);
|
|
13103
|
+
}
|
|
13056
13104
|
};
|
|
13057
13105
|
return context2;
|
|
13058
13106
|
}, [getState, actions, getDataSourceState, dataSourceActions]);
|
|
@@ -13062,13 +13110,7 @@ function handleDOMEvents() {
|
|
|
13062
13110
|
const context = useEventHandlersContext();
|
|
13063
13111
|
(0, import_react48.useEffect)(() => {
|
|
13064
13112
|
const removeOnKeyDown = context.getState().keyDown.onChange((event) => {
|
|
13065
|
-
onKeyDown(
|
|
13066
|
-
key: event.key,
|
|
13067
|
-
metaKey: event.metaKey,
|
|
13068
|
-
ctrlKey: event.ctrlKey,
|
|
13069
|
-
shiftKey: event.shiftKey,
|
|
13070
|
-
preventDefault: () => event.preventDefault()
|
|
13071
|
-
}), event);
|
|
13113
|
+
onKeyDown(context, event);
|
|
13072
13114
|
});
|
|
13073
13115
|
function cellClickHandler(cellClickParam) {
|
|
13074
13116
|
if (!cellClickParam) {
|
|
@@ -13082,10 +13124,10 @@ function handleDOMEvents() {
|
|
|
13082
13124
|
key: "",
|
|
13083
13125
|
preventDefault: () => event.preventDefault()
|
|
13084
13126
|
};
|
|
13085
|
-
onCellClick(
|
|
13127
|
+
onCellClick(__spreadProps(__spreadValues({}, context), {
|
|
13086
13128
|
rowIndex: cellClickParam.rowIndex,
|
|
13087
13129
|
colIndex: cellClickParam.colIndex
|
|
13088
|
-
}), virtualEvent)
|
|
13130
|
+
}), virtualEvent);
|
|
13089
13131
|
}
|
|
13090
13132
|
const removeOnCellClick = context.getState().cellClick.onChange(cellClickHandler);
|
|
13091
13133
|
return () => {
|
|
@@ -13280,8 +13322,244 @@ InfiniteTable.defaultProps = {
|
|
|
13280
13322
|
columnHeaderHeight: toCSSVarName(columnHeaderHeightName)
|
|
13281
13323
|
};
|
|
13282
13324
|
|
|
13325
|
+
// src/components/Menu/index.tsx
|
|
13326
|
+
var React39 = __toModule(require("react"));
|
|
13327
|
+
var import_react49 = __toModule(require("react"));
|
|
13328
|
+
|
|
13329
|
+
// src/components/Menu/MenuCls.css.ts
|
|
13330
|
+
var import_createRuntimeFn7 = __toModule(require_vanilla_extract_recipes_createRuntimeFn_cjs());
|
|
13331
|
+
var MenuCls = "db3arf0 _16lm1iw0 _16lm1iw1 _16lm1iw13 _16lm1iw1j _16lm1iw7";
|
|
13332
|
+
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"]] });
|
|
13333
|
+
var MenuRowCls = "_16lm1iwx";
|
|
13334
|
+
var MenuSeparatorCls = "db3arfc";
|
|
13335
|
+
|
|
13336
|
+
// src/components/Menu/index.tsx
|
|
13337
|
+
var SEPARATOR = "-";
|
|
13338
|
+
function MenuSeparator() {
|
|
13339
|
+
return /* @__PURE__ */ React39.createElement("hr", {
|
|
13340
|
+
className: MenuSeparatorCls
|
|
13341
|
+
});
|
|
13342
|
+
}
|
|
13343
|
+
var toRuntimeItem = ({ columns, activeItemKey }, item) => {
|
|
13344
|
+
const menuItem = item && (item.key != null || item.label != null) ? item : null;
|
|
13345
|
+
const menuDecoration = menuItem === null ? item === SEPARATOR ? /* @__PURE__ */ React39.createElement(MenuSeparator, null) : item : null;
|
|
13346
|
+
const runtimeItem = menuItem != null ? {
|
|
13347
|
+
type: "item",
|
|
13348
|
+
disabled: !!menuItem.disabled,
|
|
13349
|
+
active: menuItem.key === activeItemKey,
|
|
13350
|
+
value: menuItem,
|
|
13351
|
+
span: menuItem.span || 1,
|
|
13352
|
+
key: menuItem.key,
|
|
13353
|
+
menu: menuItem.menu || null
|
|
13354
|
+
} : {
|
|
13355
|
+
type: "decoration",
|
|
13356
|
+
value: menuDecoration,
|
|
13357
|
+
span: columns.length,
|
|
13358
|
+
style: {
|
|
13359
|
+
gridColumnStart: 1,
|
|
13360
|
+
gridColumnEnd: columns.length + 10
|
|
13361
|
+
}
|
|
13362
|
+
};
|
|
13363
|
+
return runtimeItem;
|
|
13364
|
+
};
|
|
13365
|
+
function childrenToRuntimeItems(context, children) {
|
|
13366
|
+
return React39.Children.map(children, (child) => {
|
|
13367
|
+
if (child == null ? void 0 : child.props.__is_menu_item) {
|
|
13368
|
+
const itemProps = __spreadValues({}, child.props);
|
|
13369
|
+
if (!itemProps.key) {
|
|
13370
|
+
itemProps.key = child.key;
|
|
13371
|
+
}
|
|
13372
|
+
if (!itemProps.description) {
|
|
13373
|
+
itemProps.description = child.props.children;
|
|
13374
|
+
}
|
|
13375
|
+
if (!itemProps.label) {
|
|
13376
|
+
itemProps.label = itemProps.children;
|
|
13377
|
+
}
|
|
13378
|
+
return toRuntimeItem(context, itemProps);
|
|
13379
|
+
}
|
|
13380
|
+
return toRuntimeItem(context, child);
|
|
13381
|
+
}) || [];
|
|
13382
|
+
}
|
|
13383
|
+
var defaultColumns = [
|
|
13384
|
+
{
|
|
13385
|
+
name: "label"
|
|
13386
|
+
}
|
|
13387
|
+
];
|
|
13388
|
+
function Menu(props) {
|
|
13389
|
+
const _a = props, {
|
|
13390
|
+
children,
|
|
13391
|
+
items,
|
|
13392
|
+
columns: cols,
|
|
13393
|
+
addSubmenuColumnIfNeeded
|
|
13394
|
+
} = _a, domProps = __objRest(_a, [
|
|
13395
|
+
"children",
|
|
13396
|
+
"items",
|
|
13397
|
+
"columns",
|
|
13398
|
+
"addSubmenuColumnIfNeeded"
|
|
13399
|
+
]);
|
|
13400
|
+
const [activeItemKey, setActiveItemKey] = (0, import_react49.useState)(null);
|
|
13401
|
+
const columns = cols || defaultColumns;
|
|
13402
|
+
let runtimeItems = [];
|
|
13403
|
+
let renderedChildren = null;
|
|
13404
|
+
const context = { columns, activeItemKey };
|
|
13405
|
+
if (items) {
|
|
13406
|
+
runtimeItems = items.map(toRuntimeItem.bind(null, context));
|
|
13407
|
+
} else if (!items && typeof children !== "function") {
|
|
13408
|
+
runtimeItems = childrenToRuntimeItems(context, children);
|
|
13409
|
+
}
|
|
13410
|
+
if (addSubmenuColumnIfNeeded) {
|
|
13411
|
+
const hasSubmenus = runtimeItems.filter((item) => item.type === "item" && item.menu != null).length > 0;
|
|
13412
|
+
if (hasSubmenus && !columns.find((col) => col.name == "submenu")) {
|
|
13413
|
+
columns.push({
|
|
13414
|
+
name: "submenu",
|
|
13415
|
+
render: ({ domProps: domProps2, item }) => {
|
|
13416
|
+
return item.menu ? /* @__PURE__ */ React39.createElement("div", __spreadValues({}, domProps2), /* @__PURE__ */ React39.createElement(ExpanderIcon, null)) : /* @__PURE__ */ React39.createElement("div", __spreadValues({}, domProps2));
|
|
13417
|
+
}
|
|
13418
|
+
});
|
|
13419
|
+
}
|
|
13420
|
+
}
|
|
13421
|
+
renderedChildren = runtimeItems.map((runtimeItem, index) => /* @__PURE__ */ React39.createElement(RuntimeItemRenderer, {
|
|
13422
|
+
columns,
|
|
13423
|
+
item: runtimeItem,
|
|
13424
|
+
index,
|
|
13425
|
+
onClick: (item) => setActiveItemKey(item.key)
|
|
13426
|
+
}));
|
|
13427
|
+
const gridTemplateColumns = columns.map((col) => {
|
|
13428
|
+
return col.width || (typeof col.flex === "number" ? `${col.flex}fr` : col.flex) || "auto";
|
|
13429
|
+
}).join(" ");
|
|
13430
|
+
const style = __spreadProps(__spreadValues({}, domProps.style), {
|
|
13431
|
+
gridTemplateColumns,
|
|
13432
|
+
gridTemplateRows: runtimeItems.map(() => `auto`).join(" ")
|
|
13433
|
+
});
|
|
13434
|
+
function handleKeydown(event) {
|
|
13435
|
+
const selectableRuntimeItems = runtimeItems.filter((item) => item.type === "item" && !item.disabled);
|
|
13436
|
+
let activeIndex = selectableRuntimeItems.findIndex((runtimeItem) => runtimeItem.key === activeItemKey);
|
|
13437
|
+
let newActiveIndex = activeIndex;
|
|
13438
|
+
const validKeys3 = {
|
|
13439
|
+
ArrowUp: () => {
|
|
13440
|
+
newActiveIndex--;
|
|
13441
|
+
},
|
|
13442
|
+
ArrowDown: () => {
|
|
13443
|
+
newActiveIndex++;
|
|
13444
|
+
},
|
|
13445
|
+
PageUp: () => {
|
|
13446
|
+
newActiveIndex = 0;
|
|
13447
|
+
},
|
|
13448
|
+
PageDown: () => {
|
|
13449
|
+
newActiveIndex = selectableRuntimeItems.length - 1;
|
|
13450
|
+
}
|
|
13451
|
+
};
|
|
13452
|
+
const fn = validKeys3[event.key];
|
|
13453
|
+
if (fn) {
|
|
13454
|
+
fn();
|
|
13455
|
+
}
|
|
13456
|
+
newActiveIndex = clamp(newActiveIndex, 0, selectableRuntimeItems.length - 1);
|
|
13457
|
+
if (newActiveIndex != activeIndex) {
|
|
13458
|
+
setActiveItemKey(selectableRuntimeItems[newActiveIndex].key);
|
|
13459
|
+
}
|
|
13460
|
+
}
|
|
13461
|
+
return /* @__PURE__ */ React39.createElement("div", __spreadProps(__spreadValues({}, domProps), {
|
|
13462
|
+
onKeyDown: (event) => {
|
|
13463
|
+
if (domProps.onKeyDown) {
|
|
13464
|
+
domProps.onKeyDown(event);
|
|
13465
|
+
}
|
|
13466
|
+
handleKeydown(event);
|
|
13467
|
+
},
|
|
13468
|
+
tabIndex: 0,
|
|
13469
|
+
className: join(MenuCls, domProps.className),
|
|
13470
|
+
style
|
|
13471
|
+
}), renderedChildren);
|
|
13472
|
+
}
|
|
13473
|
+
var menuDefaultProps = {
|
|
13474
|
+
addSubmenuColumnIfNeeded: true
|
|
13475
|
+
};
|
|
13476
|
+
Menu.defaultProps = menuDefaultProps;
|
|
13477
|
+
function RuntimeItemRenderer(props) {
|
|
13478
|
+
const [hover, setHover] = React39.useState(false);
|
|
13479
|
+
const [pressed, setPressed] = React39.useState(false);
|
|
13480
|
+
const { columns, item, index } = props;
|
|
13481
|
+
const key = item.type === "item" ? item.value.key : index;
|
|
13482
|
+
let content = null;
|
|
13483
|
+
if (item.type === "decoration") {
|
|
13484
|
+
content = /* @__PURE__ */ React39.createElement("div", {
|
|
13485
|
+
style: item.style
|
|
13486
|
+
}, item.value);
|
|
13487
|
+
} else {
|
|
13488
|
+
let spanIndex = 0;
|
|
13489
|
+
content = columns.map((col, i) => {
|
|
13490
|
+
const target = item.value;
|
|
13491
|
+
const field = col.field || col.name;
|
|
13492
|
+
const start = i + 1;
|
|
13493
|
+
const end = start + item.span;
|
|
13494
|
+
if (start < spanIndex) {
|
|
13495
|
+
return null;
|
|
13496
|
+
}
|
|
13497
|
+
spanIndex = end;
|
|
13498
|
+
const style = __spreadProps(__spreadValues(__spreadValues({}, col.style), item.style), {
|
|
13499
|
+
gridColumnStart: start,
|
|
13500
|
+
gridColumnEnd: end
|
|
13501
|
+
});
|
|
13502
|
+
const domProps = {
|
|
13503
|
+
style,
|
|
13504
|
+
className: MenuItemCls({
|
|
13505
|
+
hover,
|
|
13506
|
+
disabled: !!item.disabled,
|
|
13507
|
+
active: item.active,
|
|
13508
|
+
pressed
|
|
13509
|
+
}),
|
|
13510
|
+
onMouseEnter: () => {
|
|
13511
|
+
if (!item.disabled) {
|
|
13512
|
+
setHover(true);
|
|
13513
|
+
}
|
|
13514
|
+
},
|
|
13515
|
+
onMouseLeave: () => {
|
|
13516
|
+
if (!item.disabled) {
|
|
13517
|
+
setHover(false);
|
|
13518
|
+
}
|
|
13519
|
+
},
|
|
13520
|
+
onMouseDown: () => {
|
|
13521
|
+
if (!item.disabled) {
|
|
13522
|
+
setPressed(true);
|
|
13523
|
+
}
|
|
13524
|
+
},
|
|
13525
|
+
onMouseUp: () => {
|
|
13526
|
+
if (!item.disabled) {
|
|
13527
|
+
setPressed(false);
|
|
13528
|
+
}
|
|
13529
|
+
},
|
|
13530
|
+
onClick: () => {
|
|
13531
|
+
if (!item.disabled) {
|
|
13532
|
+
props.onClick(item);
|
|
13533
|
+
}
|
|
13534
|
+
}
|
|
13535
|
+
};
|
|
13536
|
+
return col.render ? /* @__PURE__ */ React39.createElement(RenderHookComponent, {
|
|
13537
|
+
render: col.render,
|
|
13538
|
+
renderParam: {
|
|
13539
|
+
item: target,
|
|
13540
|
+
column: col,
|
|
13541
|
+
value: target[field],
|
|
13542
|
+
domProps
|
|
13543
|
+
}
|
|
13544
|
+
}) : /* @__PURE__ */ React39.createElement("div", __spreadValues({
|
|
13545
|
+
key: `${key}-${field}`
|
|
13546
|
+
}, domProps), target[field]);
|
|
13547
|
+
}).filter(Boolean);
|
|
13548
|
+
}
|
|
13549
|
+
return /* @__PURE__ */ React39.createElement("div", {
|
|
13550
|
+
className: MenuRowCls
|
|
13551
|
+
}, content);
|
|
13552
|
+
}
|
|
13553
|
+
function MenuItem(_props) {
|
|
13554
|
+
return null;
|
|
13555
|
+
}
|
|
13556
|
+
MenuItem.defaultProps = {
|
|
13557
|
+
__is_menu_item: true
|
|
13558
|
+
};
|
|
13559
|
+
|
|
13283
13560
|
// src/index.tsx
|
|
13284
13561
|
var components = {
|
|
13285
13562
|
CheckBox: InfiniteCheckBox,
|
|
13286
13563
|
LoadMask
|
|
13287
13564
|
};
|
|
13565
|
+
//!collapsed || lazyLoad;
|