@infinite-table/infinite-react 10.1.4 → 10.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -5
- package/index.css +1 -1
- package/index.d.ts +158 -135
- package/index.dev.js +889 -568
- package/index.dev.mjs +899 -578
- package/index.js +8 -8
- package/index.mjs +8 -8
- package/package.json +2 -2
- package/theme/balsam.css +209 -19
- package/theme/default.css +13 -9
- package/theme/minimalist.css +205 -33
- package/theme/ocean.css +205 -29
- package/theme/paper.css +649 -0
- package/theme/shadcn.css +102 -7
- package/theme/sheet.css +489 -0
- package/theme/terminal.css +473 -0
package/index.dev.mjs
CHANGED
|
@@ -1200,6 +1200,9 @@ var WRAPPER_STYLE = {
|
|
|
1200
1200
|
fontSize: 0,
|
|
1201
1201
|
overflow: "hidden"
|
|
1202
1202
|
};
|
|
1203
|
+
function toWatchedCSSValue(varName) {
|
|
1204
|
+
return varName.startsWith("var(") || varName.startsWith("calc(") ? varName : `var(${varName})`;
|
|
1205
|
+
}
|
|
1203
1206
|
|
|
1204
1207
|
// src/components/CSSNumericVariableWatch/index.tsx
|
|
1205
1208
|
var useCSSVariableWatch = (params) => {
|
|
@@ -1233,7 +1236,7 @@ var CSSNumericVariableWatch = (props) => {
|
|
|
1233
1236
|
...props,
|
|
1234
1237
|
ref: domRef
|
|
1235
1238
|
});
|
|
1236
|
-
const height2 =
|
|
1239
|
+
const height2 = toWatchedCSSValue(props.varName);
|
|
1237
1240
|
const { allowInts = false } = props;
|
|
1238
1241
|
return /* @__PURE__ */ React2.createElement(
|
|
1239
1242
|
"div",
|
|
@@ -1520,6 +1523,7 @@ var DevToolsTracks = {
|
|
|
1520
1523
|
};
|
|
1521
1524
|
|
|
1522
1525
|
// src/utils/devTools/index.ts
|
|
1526
|
+
var MEASURE_NAME_PREFIX = "\u200B";
|
|
1523
1527
|
var DevToolsMarker = class _DevToolsMarker {
|
|
1524
1528
|
constructor(debugId) {
|
|
1525
1529
|
this.debugId = debugId;
|
|
@@ -1557,7 +1561,8 @@ var DevToolsMarker = class _DevToolsMarker {
|
|
|
1557
1561
|
const tooltip = markerDetails.tooltip || this.markerDetails.tooltip;
|
|
1558
1562
|
const label = markerDetails.label || this.markerDetails.label || "Unknown";
|
|
1559
1563
|
const track = markerDetails.track || this.markerDetails.track || "Unknown";
|
|
1560
|
-
|
|
1564
|
+
const measureName = MEASURE_NAME_PREFIX + label;
|
|
1565
|
+
performance.measure(measureName, {
|
|
1561
1566
|
start,
|
|
1562
1567
|
end,
|
|
1563
1568
|
detail: {
|
|
@@ -1571,6 +1576,7 @@ var DevToolsMarker = class _DevToolsMarker {
|
|
|
1571
1576
|
}
|
|
1572
1577
|
}
|
|
1573
1578
|
});
|
|
1579
|
+
performance.clearMeasures(measureName);
|
|
1574
1580
|
return this;
|
|
1575
1581
|
};
|
|
1576
1582
|
this.debugId = debugId;
|
|
@@ -2165,7 +2171,35 @@ function stripVar(cssVariableWithVarString) {
|
|
|
2165
2171
|
|
|
2166
2172
|
// src/components/InfiniteTable/components/icons/Icon.tsx
|
|
2167
2173
|
import * as React6 from "react";
|
|
2174
|
+
|
|
2175
|
+
// src/components/InfiniteTable/components/icons/Icon.css.ts
|
|
2176
|
+
var IconCustomMaskCls = { expandCollapse: "_1jm33zv0", loading: "_1jm33zv1", done: "_1jm33zv2", clear: "_1jm33zv3", hidden: "_1jm33zv4", filterOperatorContains: "_1jm33zv5", filterOperatorStartsWith: "_1jm33zv6", filterOperatorEndsWith: "_1jm33zv7", filterOperatorEq: "_1jm33zv8", filterOperatorNeq: "_1jm33zv9", filterOperatorGt: "_1jm33zva", filterOperatorGte: "_1jm33zvb", filterOperatorLt: "_1jm33zvc", filterOperatorLte: "_1jm33zvd" };
|
|
2177
|
+
var LoadingIconSpinWhenCustomCls = "_1jm33zvf";
|
|
2178
|
+
|
|
2179
|
+
// src/components/InfiniteTable/components/icons/customizableIcons.ts
|
|
2180
|
+
var CUSTOMIZABLE_ICONS = {
|
|
2181
|
+
expandCollapse: "expand-collapse",
|
|
2182
|
+
loading: "loading",
|
|
2183
|
+
done: "done",
|
|
2184
|
+
clear: "clear",
|
|
2185
|
+
hidden: "hidden",
|
|
2186
|
+
filterOperatorContains: "filter-operator-contains",
|
|
2187
|
+
filterOperatorStartsWith: "filter-operator-starts-with",
|
|
2188
|
+
filterOperatorEndsWith: "filter-operator-ends-with",
|
|
2189
|
+
filterOperatorEq: "filter-operator-eq",
|
|
2190
|
+
filterOperatorNeq: "filter-operator-neq",
|
|
2191
|
+
filterOperatorGt: "filter-operator-gt",
|
|
2192
|
+
filterOperatorGte: "filter-operator-gte",
|
|
2193
|
+
filterOperatorLt: "filter-operator-lt",
|
|
2194
|
+
filterOperatorLte: "filter-operator-lte"
|
|
2195
|
+
};
|
|
2196
|
+
|
|
2197
|
+
// src/components/InfiniteTable/components/icons/InfiniteIconClassName.ts
|
|
2198
|
+
var InfiniteIconClassName = "InfiniteIcon";
|
|
2199
|
+
|
|
2200
|
+
// src/components/InfiniteTable/components/icons/Icon.tsx
|
|
2168
2201
|
var Icon = (props) => {
|
|
2202
|
+
const { icon, ...svgProps } = props;
|
|
2169
2203
|
const size = props.size ?? `var(--infinite-icon-size)`;
|
|
2170
2204
|
const style2 = {
|
|
2171
2205
|
flex: "none",
|
|
@@ -2176,7 +2210,21 @@ var Icon = (props) => {
|
|
|
2176
2210
|
};
|
|
2177
2211
|
return (
|
|
2178
2212
|
//@ts-ignore
|
|
2179
|
-
/* @__PURE__ */ React6.createElement(
|
|
2213
|
+
/* @__PURE__ */ React6.createElement(
|
|
2214
|
+
"svg",
|
|
2215
|
+
{
|
|
2216
|
+
viewBox: "0 0 24 24",
|
|
2217
|
+
...svgProps,
|
|
2218
|
+
className: icon ? join(
|
|
2219
|
+
props.className,
|
|
2220
|
+
IconCustomMaskCls[icon],
|
|
2221
|
+
InfiniteIconClassName,
|
|
2222
|
+
`${InfiniteIconClassName}-${CUSTOMIZABLE_ICONS[icon]}`
|
|
2223
|
+
) : props.className,
|
|
2224
|
+
style: style2
|
|
2225
|
+
},
|
|
2226
|
+
props.children
|
|
2227
|
+
)
|
|
2180
2228
|
);
|
|
2181
2229
|
};
|
|
2182
2230
|
|
|
@@ -2222,55 +2270,55 @@ var iconPaths = {
|
|
|
2222
2270
|
|
|
2223
2271
|
// src/components/InfiniteTable/components/icons/IncludesOperatorIcon.tsx
|
|
2224
2272
|
var IncludesOperatorIcon = (props) => {
|
|
2225
|
-
return /* @__PURE__ */ React7.createElement(Icon, { ...props }, iconPaths.includesOperator.map((d) => /* @__PURE__ */ React7.createElement("path", { key: d, d })));
|
|
2273
|
+
return /* @__PURE__ */ React7.createElement(Icon, { ...props, icon: "filterOperatorContains" }, iconPaths.includesOperator.map((d) => /* @__PURE__ */ React7.createElement("path", { key: d, d })));
|
|
2226
2274
|
};
|
|
2227
2275
|
|
|
2228
2276
|
// src/components/InfiniteTable/components/icons/EndsWithOperatorIcon.tsx
|
|
2229
2277
|
import * as React8 from "react";
|
|
2230
2278
|
var EndsWithOperatorIcon = (props) => {
|
|
2231
|
-
return /* @__PURE__ */ React8.createElement(Icon, { ...props }, /* @__PURE__ */ React8.createElement("path", { d: iconPaths.endsWithOperator[0] }));
|
|
2279
|
+
return /* @__PURE__ */ React8.createElement(Icon, { ...props, icon: "filterOperatorEndsWith" }, /* @__PURE__ */ React8.createElement("path", { d: iconPaths.endsWithOperator[0] }));
|
|
2232
2280
|
};
|
|
2233
2281
|
|
|
2234
2282
|
// src/components/InfiniteTable/components/icons/EqualOperatorIcon.tsx
|
|
2235
2283
|
import * as React9 from "react";
|
|
2236
2284
|
var EqualOperatorIcon = (props) => {
|
|
2237
|
-
return /* @__PURE__ */ React9.createElement(Icon, { ...props }, /* @__PURE__ */ React9.createElement("path", { d: iconPaths.eqOperator[0] }));
|
|
2285
|
+
return /* @__PURE__ */ React9.createElement(Icon, { ...props, icon: "filterOperatorEq" }, /* @__PURE__ */ React9.createElement("path", { d: iconPaths.eqOperator[0] }));
|
|
2238
2286
|
};
|
|
2239
2287
|
|
|
2240
2288
|
// src/components/InfiniteTable/components/icons/GTEOperatorIcon.tsx
|
|
2241
2289
|
import * as React10 from "react";
|
|
2242
2290
|
var GTEOperatorIcon = (props) => {
|
|
2243
|
-
return /* @__PURE__ */ React10.createElement(Icon, { ...props }, /* @__PURE__ */ React10.createElement("path", { d: iconPaths.gteOperator[0] }));
|
|
2291
|
+
return /* @__PURE__ */ React10.createElement(Icon, { ...props, icon: "filterOperatorGte" }, /* @__PURE__ */ React10.createElement("path", { d: iconPaths.gteOperator[0] }));
|
|
2244
2292
|
};
|
|
2245
2293
|
|
|
2246
2294
|
// src/components/InfiniteTable/components/icons/GTOperatorIcon.tsx
|
|
2247
2295
|
import * as React11 from "react";
|
|
2248
2296
|
var GTOperatorIcon = (props) => {
|
|
2249
|
-
return /* @__PURE__ */ React11.createElement(Icon, { ...props }, /* @__PURE__ */ React11.createElement("path", { d: iconPaths.gtOperator[0] }));
|
|
2297
|
+
return /* @__PURE__ */ React11.createElement(Icon, { ...props, icon: "filterOperatorGt" }, /* @__PURE__ */ React11.createElement("path", { d: iconPaths.gtOperator[0] }));
|
|
2250
2298
|
};
|
|
2251
2299
|
|
|
2252
2300
|
// src/components/InfiniteTable/components/icons/LTEOperatorIcon.tsx
|
|
2253
2301
|
import * as React12 from "react";
|
|
2254
2302
|
var LTEOperatorIcon = (props) => {
|
|
2255
|
-
return /* @__PURE__ */ React12.createElement(Icon, { ...props }, /* @__PURE__ */ React12.createElement("path", { d: iconPaths.lteOperator[0] }));
|
|
2303
|
+
return /* @__PURE__ */ React12.createElement(Icon, { ...props, icon: "filterOperatorLte" }, /* @__PURE__ */ React12.createElement("path", { d: iconPaths.lteOperator[0] }));
|
|
2256
2304
|
};
|
|
2257
2305
|
|
|
2258
2306
|
// src/components/InfiniteTable/components/icons/LTOperatorIcon.tsx
|
|
2259
2307
|
import * as React13 from "react";
|
|
2260
2308
|
var LTOperatorIcon = (props) => {
|
|
2261
|
-
return /* @__PURE__ */ React13.createElement(Icon, { ...props }, /* @__PURE__ */ React13.createElement("path", { d: iconPaths.ltOperator[0] }));
|
|
2309
|
+
return /* @__PURE__ */ React13.createElement(Icon, { ...props, icon: "filterOperatorLt" }, /* @__PURE__ */ React13.createElement("path", { d: iconPaths.ltOperator[0] }));
|
|
2262
2310
|
};
|
|
2263
2311
|
|
|
2264
2312
|
// src/components/InfiniteTable/components/icons/NotEqualOperatorIcon.tsx
|
|
2265
2313
|
import * as React14 from "react";
|
|
2266
2314
|
var NotEqualOperatorIcon = (props) => {
|
|
2267
|
-
return /* @__PURE__ */ React14.createElement(Icon, { ...props }, /* @__PURE__ */ React14.createElement("path", { d: iconPaths.neqOperator[0] }));
|
|
2315
|
+
return /* @__PURE__ */ React14.createElement(Icon, { ...props, icon: "filterOperatorNeq" }, /* @__PURE__ */ React14.createElement("path", { d: iconPaths.neqOperator[0] }));
|
|
2268
2316
|
};
|
|
2269
2317
|
|
|
2270
2318
|
// src/components/InfiniteTable/components/icons/StartsWithOperatorIcon.tsx
|
|
2271
2319
|
import * as React15 from "react";
|
|
2272
2320
|
var StartsWithOperatorIcon = (props) => {
|
|
2273
|
-
return /* @__PURE__ */ React15.createElement(Icon, { ...props }, /* @__PURE__ */ React15.createElement("path", { d: iconPaths.startsWithOperator[0] }));
|
|
2321
|
+
return /* @__PURE__ */ React15.createElement(Icon, { ...props, icon: "filterOperatorStartsWith" }, /* @__PURE__ */ React15.createElement("path", { d: iconPaths.startsWithOperator[0] }));
|
|
2274
2322
|
};
|
|
2275
2323
|
|
|
2276
2324
|
// src/components/InfiniteTable/components/FilterEditors.tsx
|
|
@@ -2410,11 +2458,9 @@ var HeaderSortIconIndexCls = "_12zfob16";
|
|
|
2410
2458
|
var HeaderSortIconRecipe = createRuntimeFn({ defaultClassName: "_12zfob12", variantClassNames: { align: { start: "_12zfob13", center: "_12zfob14", end: "_12zfob15" } }, defaultVariants: {}, compoundVariants: [] });
|
|
2411
2459
|
var HeaderWrapperCls = "_12zfob12l _16lm1iw35 _16lm1iw1 _16lm1iw1p _16lm1iw2h";
|
|
2412
2460
|
|
|
2413
|
-
// src/components/InfiniteTable/components/icons/InfiniteIconClassName.ts
|
|
2414
|
-
var InfiniteIconClassName = "InfiniteIcon";
|
|
2415
|
-
|
|
2416
2461
|
// src/components/InfiniteTable/components/icons/FilterIcon/FilterIcon.css.ts
|
|
2417
2462
|
var FilterIconCls = "_1nnkya20 _16lm1iw1p _16lm1iw2f _16lm1iw1 _16lm1iw32 _16lm1iw2j";
|
|
2463
|
+
var FilterIconLineCls = "_1nnkya21";
|
|
2418
2464
|
|
|
2419
2465
|
// src/components/InfiniteTable/components/icons/FilterIcon/shared.ts
|
|
2420
2466
|
var defaultLineStyle = {
|
|
@@ -2483,9 +2529,27 @@ function FilterIcon(props) {
|
|
|
2483
2529
|
},
|
|
2484
2530
|
index
|
|
2485
2531
|
) : null,
|
|
2486
|
-
/* @__PURE__ */ React16.createElement(
|
|
2487
|
-
|
|
2488
|
-
|
|
2532
|
+
/* @__PURE__ */ React16.createElement(
|
|
2533
|
+
"div",
|
|
2534
|
+
{
|
|
2535
|
+
className: FilterIconLineCls,
|
|
2536
|
+
style: { width: sizes[0], ...lineStyle }
|
|
2537
|
+
}
|
|
2538
|
+
),
|
|
2539
|
+
/* @__PURE__ */ React16.createElement(
|
|
2540
|
+
"div",
|
|
2541
|
+
{
|
|
2542
|
+
className: FilterIconLineCls,
|
|
2543
|
+
style: { width: sizes[1], ...lineStyle }
|
|
2544
|
+
}
|
|
2545
|
+
),
|
|
2546
|
+
/* @__PURE__ */ React16.createElement(
|
|
2547
|
+
"div",
|
|
2548
|
+
{
|
|
2549
|
+
className: FilterIconLineCls,
|
|
2550
|
+
style: { width: sizes[2], ...lineStyle }
|
|
2551
|
+
}
|
|
2552
|
+
)
|
|
2489
2553
|
);
|
|
2490
2554
|
}
|
|
2491
2555
|
|
|
@@ -4175,7 +4239,7 @@ var InternalVars = { currentColumnTransformX: "var(--_16hkbkc0)", y: "var(--_16h
|
|
|
4175
4239
|
|
|
4176
4240
|
// src/components/InfiniteTable/vars.css.ts
|
|
4177
4241
|
var CSS_LOADED_VALUE = "true";
|
|
4178
|
-
var ThemeVars = { loaded: "var(--infinite-loaded)", themeName: "var(--infinite-theme-name)", themeMode: "var(--infinite-theme-mode)", color: { accent: "var(--infinite-accent-color)", success: "var(--infinite-success-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)", focusOutline: "var(--infinite-focus-outline)", background: "var(--infinite-background)", iconSize: "var(--infinite-icon-size)", runtime: { bodyWidth: "var(--infinite-runtime-body-content-width)", totalVisibleColumnsWidthValue: "var(--infinite-runtime-total-visible-columns-width)", totalVisibleColumnsWidthVar: "var(--infinite-runtime-total-visible-columns-width-var)", visibleColumnsCount: "var(--infinite-runtime-visible-columns-count)", browserScrollbarWidth: "var(--infinite-runtime-browser-scrollbar-width)" }, components: { GroupingToolbar: { color: "var(--infinite-grouping-toolbar-color)", background: "var(--infinite-grouping-toolbar-background)", rejectBackground: "var(--infinite-grouping-toolbar-reject-background)", activeBackground: "var(--infinite-grouping-toolbar-active-background)", activeBackgroundAlpha: "var(--infinite-grouping-toolbar-active-background-alpha)", padding: "var(--infinite-grouping-toolbar-padding)", border: "var(--infinite-grouping-toolbar-border)", rejectBorder: "var(--infinite-grouping-toolbar-reject-border)", gap: "var(--infinite-grouping-toolbar-gap)" }, GroupingToolbarItem: { border: "var(--infinite-grouping-toolbar-item-border)", borderRadius: "var(--infinite-grouping-toolbar-item-border-radius)", activeBorder: "var(--infinite-grouping-toolbar-item-active-border)", background: "var(--infinite-grouping-toolbar-item-background)", activeBackground: "var(--infinite-grouping-toolbar-item-active-background)", activeBackgroundAlpha: "var(--infinite-grouping-toolbar-item-active-background-alpha)" }, 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)", border: "var(--infinite-header-cell-border)", padding: "var(--infinite-header-cell-padding)", paddingX: "var(--infinite-header-cell-padding-x)", paddingY: "var(--infinite-header-cell-padding-y)", iconSize: "var(--infinite-header-cell-icon-size)", menuIconLineWidth: "var(--infinite-header-cell-menu-icon-line-width)", sortIconMargin: "var(--infinite-header-cell-sort-icon-margin)", borderRight: "var(--infinite-header-cell-border-right)", resizeHandleActiveAreaWidth: "var(--infinite-resize-handle-active-area-width)", resizeHandleWidth: "var(--infinite-resize-handle-width)", resizeHandleHoverBackground: "var(--infinite-resize-handle-hover-background)", resizeHandleConstrainedHoverBackground: "var(--infinite-resize-handle-constrained-hover-background)", filterOperatorPaddingX: "var(--infinite-filter-operator-padding-x)", filterEditorPaddingX: "var(--infinite-filter-editor-padding-x)", filterEditorMarginX: "var(--infinite-filter-editor-margin-x)", filterOperatorPaddingY: "var(--infinite-filter-operator-padding-y)", filterEditorPaddingY: "var(--infinite-filter-editor-padding-y)", filterEditorMarginY: "var(--infinite-filter-editor-margin-y)", filterEditorBackground: "var(--infinite-filter-editor-background)", filterEditorBorder: "var(--infinite-filter-editor-border)", filterEditorFocusBorderColor: "var(--infinite-filter-editor-focus-border-color)", filterEditorBorderRadius: "var(--infinite-filter-editor-border-radius)", filterEditorColor: "var(--infinite-filter-editor-color)" }, ActiveCellIndicator: { inset: "var(--infinite-active-cell-indicator-inset)" }, Cell: { flashingDuration: "var(--infinite-flashing-duration)", flashingAnimationName: "var(--infinite-flashing-animation-name)", flashingOverlayZIndex: "var(--infinite-flashing-overlay-z-index)", flashingBackground: "var(--infinite-flashing-background)", flashingUpBackground: "var(--infinite-flashing-up-background)", flashingDownBackground: "var(--infinite-flashing-down-background)", padding: "var(--infinite-cell-padding)", borderWidth: "var(--infinite-cell-border-width)", borderColor: "var(--infinite-cell-border-color)", border: "var(--infinite-cell-border)", borderLeft: "var(--infinite-cell-border-left)", borderRight: "var(--infinite-cell-border-right)", borderTop: "var(--infinite-cell-border-top)", 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)", horizontalLayoutColumnReorderDisabledPageOpacity: "var(--infinite-horizontal-layout-column-reorder-disabled-page-opacity)", color: "var(--infinite-cell-color)", selectedBackground: "var(--infinite-selected-cell-background)", selectedBackgroundDefault: "var(--infinite-selected-cell-background-default)", selectedBackgroundAlpha: "var(--infinite-selected-cell-background-alpha)", selectedBackgroundAlphaWhenTableUnfocused: "var(--infinite-selected-cell-background-alpha--table-unfocused)", selectedBorderColor: "var(--infinite-selected-cell-border-color)", selectedBorderWidth: "var(--infinite-selected-cell-border-width)", selectedBorderStyle: "var(--infinite-selected-cell-border-style)", selectedBorder: "var(--infinite-selected-cell-border)", activeBackgroundAlpha: "var(--infinite-active-cell-background-alpha)", activeBackgroundAlphaWhenTableUnfocused: "var(--infinite-active-cell-background-alpha--table-unfocused)", activeBackground: "var(--infinite-active-cell-background)", activeBackgroundDefault: "var(--infinite-active-cell-background-default)", 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)" }, ExpandCollapseIcon: { color: "var(--infinite-expand-collapse-icon-color)" }, Menu: { background: "var(--infinite-menu-background)", color: "var(--infinite-menu-color)", separatorColor: "var(--infinite-menu-separator-color)", padding: "var(--infinite-menu-padding)", cellPaddingVertical: "var(--infinite-menu-cell-padding-vertical)", cellPaddingHorizontal: "var(--infinite-menu-cell-padding-horizontal)", cellMarginVertical: "var(--infinite-menu-cell-margin-vertical)", itemDisabledBackground: "var(--infinite-menu-item-disabled-background)", itemActiveBackground: "var(--infinite-menu-item-active-background)", itemActiveOpacity: "var(--infinite-menu-item-active-opacity)", itemPressedOpacity: "var(--infinite-menu-item-pressed-opacity)", itemPressedBackground: "var(--infinite-menu-item-pressed-background)", itemDisabledOpacity: "var(--infinite-menu-item-disabled-opacity)", borderRadius: "var(--infinite-menu-border-radius)", shadowColor: "var(--infinite-menu-shadow-color)" }, RowDetail: { background: "var(--infinite-rowdetail-background)", padding: "var(--infinite-rowdetail-padding)", gridHeight: "var(--infinite-rowdetail-grid-height)" }, Row: { background: "var(--infinite-row-background)", oddBackground: "var(--infinite-row-odd-background)", disabledBackground: "var(--infinite-row-disabled-background)", oddDisabledBackground: "var(--infinite-row-odd-disabled-background)", selectedBackground: "var(--infinite-row-selected-background)", disabledOpacity: "var(--infinite-row-disabled-opacity)", 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)", selectedDisabledBackground: "var(--infinite-row-selected-disabled-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)" } } };
|
|
4242
|
+
var ThemeVars = { loaded: "var(--infinite-loaded)", themeName: "var(--infinite-theme-name)", themeMode: "var(--infinite-theme-mode)", color: { accent: "var(--infinite-accent-color)", success: "var(--infinite-success-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)", baseFontSize: "var(--infinite-font-size)", minHeight: "var(--infinite-min-height)", borderRadius: "var(--infinite-border-radius)", focusOutline: "var(--infinite-focus-outline)", background: "var(--infinite-background)", iconSize: "var(--infinite-icon-size)", rowHeight: "var(--infinite-row-height)", densityScale: "var(--infinite-density-scale)", icons: { expandCollapse: "var(--infinite-icon-expand-collapse)", loading: "var(--infinite-icon-loading)", sortAsc: "var(--infinite-icon-sort-asc)", sortDesc: "var(--infinite-icon-sort-desc)", filter: "var(--infinite-icon-filter)", menu: "var(--infinite-icon-menu)", done: "var(--infinite-icon-done)", clear: "var(--infinite-icon-clear)", hidden: "var(--infinite-icon-hidden)", filterOperatorContains: "var(--infinite-icon-filter-operator-contains)", filterOperatorStartsWith: "var(--infinite-icon-filter-operator-starts-with)", filterOperatorEndsWith: "var(--infinite-icon-filter-operator-ends-with)", filterOperatorEq: "var(--infinite-icon-filter-operator-eq)", filterOperatorNeq: "var(--infinite-icon-filter-operator-neq)", filterOperatorGt: "var(--infinite-icon-filter-operator-gt)", filterOperatorGte: "var(--infinite-icon-filter-operator-gte)", filterOperatorLt: "var(--infinite-icon-filter-operator-lt)", filterOperatorLte: "var(--infinite-icon-filter-operator-lte)" }, runtime: { bodyWidth: "var(--infinite-runtime-body-content-width)", totalVisibleColumnsWidthValue: "var(--infinite-runtime-total-visible-columns-width)", totalVisibleColumnsWidthVar: "var(--infinite-runtime-total-visible-columns-width-var)", visibleColumnsCount: "var(--infinite-runtime-visible-columns-count)", browserScrollbarWidth: "var(--infinite-runtime-browser-scrollbar-width)" }, components: { GroupingToolbar: { color: "var(--infinite-grouping-toolbar-color)", background: "var(--infinite-grouping-toolbar-background)", rejectBackground: "var(--infinite-grouping-toolbar-reject-background)", activeBackground: "var(--infinite-grouping-toolbar-active-background)", activeBackgroundAlpha: "var(--infinite-grouping-toolbar-active-background-alpha)", padding: "var(--infinite-grouping-toolbar-padding)", border: "var(--infinite-grouping-toolbar-border)", rejectBorder: "var(--infinite-grouping-toolbar-reject-border)", gap: "var(--infinite-grouping-toolbar-gap)" }, GroupingToolbarItem: { border: "var(--infinite-grouping-toolbar-item-border)", borderRadius: "var(--infinite-grouping-toolbar-item-border-radius)", activeBorder: "var(--infinite-grouping-toolbar-item-active-border)", background: "var(--infinite-grouping-toolbar-item-background)", activeBackground: "var(--infinite-grouping-toolbar-item-active-background)", activeBackgroundAlpha: "var(--infinite-grouping-toolbar-item-active-background-alpha)" }, 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)", border: "var(--infinite-header-cell-border)", padding: "var(--infinite-header-cell-padding)", paddingX: "var(--infinite-header-cell-padding-x)", paddingY: "var(--infinite-header-cell-padding-y)", iconSize: "var(--infinite-header-cell-icon-size)", menuIconLineWidth: "var(--infinite-header-cell-menu-icon-line-width)", sortIconMargin: "var(--infinite-header-cell-sort-icon-margin)", borderRight: "var(--infinite-header-cell-border-right)", resizeHandleActiveAreaWidth: "var(--infinite-resize-handle-active-area-width)", resizeHandleWidth: "var(--infinite-resize-handle-width)", resizeHandleHoverBackground: "var(--infinite-resize-handle-hover-background)", resizeHandleConstrainedHoverBackground: "var(--infinite-resize-handle-constrained-hover-background)", filterOperatorPaddingX: "var(--infinite-filter-operator-padding-x)", filterEditorPaddingX: "var(--infinite-filter-editor-padding-x)", filterEditorMarginX: "var(--infinite-filter-editor-margin-x)", filterOperatorPaddingY: "var(--infinite-filter-operator-padding-y)", filterEditorPaddingY: "var(--infinite-filter-editor-padding-y)", filterEditorMarginY: "var(--infinite-filter-editor-margin-y)", filterEditorBackground: "var(--infinite-filter-editor-background)", filterEditorBorder: "var(--infinite-filter-editor-border)", filterEditorFocusBorderColor: "var(--infinite-filter-editor-focus-border-color)", filterEditorBorderRadius: "var(--infinite-filter-editor-border-radius)", filterEditorColor: "var(--infinite-filter-editor-color)" }, ActiveCellIndicator: { inset: "var(--infinite-active-cell-indicator-inset)" }, Cell: { flashingDuration: "var(--infinite-flashing-duration)", flashingAnimationName: "var(--infinite-flashing-animation-name)", flashingOverlayZIndex: "var(--infinite-flashing-overlay-z-index)", flashingBackground: "var(--infinite-flashing-background)", flashingUpBackground: "var(--infinite-flashing-up-background)", flashingDownBackground: "var(--infinite-flashing-down-background)", padding: "var(--infinite-cell-padding)", paddingX: "var(--infinite-cell-padding-x)", paddingY: "var(--infinite-cell-padding-y)", borderWidth: "var(--infinite-cell-border-width)", borderColor: "var(--infinite-cell-border-color)", border: "var(--infinite-cell-border)", borderLeft: "var(--infinite-cell-border-left)", borderRight: "var(--infinite-cell-border-right)", borderTop: "var(--infinite-cell-border-top)", 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)", horizontalLayoutColumnReorderDisabledPageOpacity: "var(--infinite-horizontal-layout-column-reorder-disabled-page-opacity)", color: "var(--infinite-cell-color)", selectedBackground: "var(--infinite-selected-cell-background)", selectedBackgroundDefault: "var(--infinite-selected-cell-background-default)", selectedBackgroundAlpha: "var(--infinite-selected-cell-background-alpha)", selectedBackgroundAlphaWhenTableUnfocused: "var(--infinite-selected-cell-background-alpha--table-unfocused)", selectedBorderColor: "var(--infinite-selected-cell-border-color)", selectedBorderWidth: "var(--infinite-selected-cell-border-width)", selectedBorderStyle: "var(--infinite-selected-cell-border-style)", selectedBorder: "var(--infinite-selected-cell-border)", activeBackgroundAlpha: "var(--infinite-active-cell-background-alpha)", activeBackgroundAlphaWhenTableUnfocused: "var(--infinite-active-cell-background-alpha--table-unfocused)", activeBackground: "var(--infinite-active-cell-background)", activeBackgroundDefault: "var(--infinite-active-cell-background-default)", 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)" }, ExpandCollapseIcon: { color: "var(--infinite-expand-collapse-icon-color)" }, Menu: { background: "var(--infinite-menu-background)", color: "var(--infinite-menu-color)", separatorColor: "var(--infinite-menu-separator-color)", padding: "var(--infinite-menu-padding)", cellPaddingVertical: "var(--infinite-menu-cell-padding-vertical)", cellPaddingHorizontal: "var(--infinite-menu-cell-padding-horizontal)", cellMarginVertical: "var(--infinite-menu-cell-margin-vertical)", itemDisabledBackground: "var(--infinite-menu-item-disabled-background)", itemActiveBackground: "var(--infinite-menu-item-active-background)", itemActiveOpacity: "var(--infinite-menu-item-active-opacity)", itemPressedOpacity: "var(--infinite-menu-item-pressed-opacity)", itemPressedBackground: "var(--infinite-menu-item-pressed-background)", itemDisabledOpacity: "var(--infinite-menu-item-disabled-opacity)", borderRadius: "var(--infinite-menu-border-radius)", shadowColor: "var(--infinite-menu-shadow-color)" }, RowDetail: { background: "var(--infinite-rowdetail-background)", padding: "var(--infinite-rowdetail-padding)", gridHeight: "var(--infinite-rowdetail-grid-height)" }, Row: { background: "var(--infinite-row-background)", oddBackground: "var(--infinite-row-odd-background)", disabledBackground: "var(--infinite-row-disabled-background)", oddDisabledBackground: "var(--infinite-row-odd-disabled-background)", selectedBackground: "var(--infinite-row-selected-background)", disabledOpacity: "var(--infinite-row-disabled-opacity)", 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)", selectedDisabledBackground: "var(--infinite-row-selected-disabled-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)" } } };
|
|
4179
4243
|
var columnHeaderHeightName = "column-header-height";
|
|
4180
4244
|
|
|
4181
4245
|
// src/components/InfiniteTable/utils/infiniteDOMUtils.ts
|
|
@@ -5193,6 +5257,7 @@ function reorderColumnsOnDrag(params) {
|
|
|
5193
5257
|
setProxyPosition,
|
|
5194
5258
|
setDragColumnOutside,
|
|
5195
5259
|
getCurrentDragSourceAndTarget,
|
|
5260
|
+
groupingToolbarDragListId,
|
|
5196
5261
|
api: imperativeApi,
|
|
5197
5262
|
horizontalLayoutPageIndex,
|
|
5198
5263
|
pageWidth
|
|
@@ -5485,7 +5550,7 @@ function reorderColumnsOnDrag(params) {
|
|
|
5485
5550
|
},
|
|
5486
5551
|
onMove(mousePosition) {
|
|
5487
5552
|
const currentColHeaderRect = updatePositionAndDiff(mousePosition);
|
|
5488
|
-
if (getCurrentDragSourceAndTarget().dropTargetListId ===
|
|
5553
|
+
if (getCurrentDragSourceAndTarget().dropTargetListId === groupingToolbarDragListId || allowColumnHideOnDrag && !acceptDropToReorderRect.containsPoint(
|
|
5489
5554
|
currentColHeaderRect.getCenter()
|
|
5490
5555
|
)) {
|
|
5491
5556
|
if (allowColumnHideOnDrag) {
|
|
@@ -5822,17 +5887,18 @@ var _DragManager = class _DragManager {
|
|
|
5822
5887
|
return _DragManager.emitter.on(event, callback);
|
|
5823
5888
|
}
|
|
5824
5889
|
static registerDragInteractionTarget(dragInteractionTarget) {
|
|
5825
|
-
|
|
5890
|
+
const { listId } = dragInteractionTarget;
|
|
5891
|
+
const current = _DragManager.dragInteractionTargetsMap.get(listId);
|
|
5892
|
+
if (current && current !== dragInteractionTarget) {
|
|
5826
5893
|
console.warn(
|
|
5827
|
-
`DragInteractionTarget with listId ${
|
|
5894
|
+
`DragInteractionTarget with listId ${listId} already registered`
|
|
5828
5895
|
);
|
|
5829
5896
|
return;
|
|
5830
5897
|
}
|
|
5831
|
-
|
|
5832
|
-
|
|
5833
|
-
dragInteractionTarget
|
|
5834
|
-
|
|
5835
|
-
_DragManager.emit("register", dragInteractionTarget);
|
|
5898
|
+
if (!current) {
|
|
5899
|
+
_DragManager.dragInteractionTargetsMap.set(listId, dragInteractionTarget);
|
|
5900
|
+
_DragManager.emit("register", dragInteractionTarget);
|
|
5901
|
+
}
|
|
5836
5902
|
return () => {
|
|
5837
5903
|
_DragManager.unregisterDragInteractionTarget(dragInteractionTarget);
|
|
5838
5904
|
};
|
|
@@ -5846,13 +5912,11 @@ var _DragManager = class _DragManager {
|
|
|
5846
5912
|
if (!dragInteractionTarget) {
|
|
5847
5913
|
return;
|
|
5848
5914
|
}
|
|
5849
|
-
|
|
5850
|
-
|
|
5851
|
-
`DragInteractionTarget with listId ${dragInteractionTarget.listId} not found`
|
|
5852
|
-
);
|
|
5915
|
+
const { listId } = dragInteractionTarget;
|
|
5916
|
+
if (_DragManager.dragInteractionTargetsMap.get(listId) !== dragInteractionTarget) {
|
|
5853
5917
|
return;
|
|
5854
5918
|
}
|
|
5855
|
-
_DragManager.dragInteractionTargetsMap.delete(
|
|
5919
|
+
_DragManager.dragInteractionTargetsMap.delete(listId);
|
|
5856
5920
|
dragInteractionTarget.unregister();
|
|
5857
5921
|
_DragManager.emit("unregister", dragInteractionTarget);
|
|
5858
5922
|
}
|
|
@@ -5949,6 +6013,14 @@ var _DragManager = class _DragManager {
|
|
|
5949
6013
|
let insideTargetEvent = null;
|
|
5950
6014
|
const events = [];
|
|
5951
6015
|
_DragManager.withDragMove(dragOperation, (interactionTarget, { event: event2 }) => {
|
|
6016
|
+
if (dragOperation.cancelled) {
|
|
6017
|
+
event2 = {
|
|
6018
|
+
...event2,
|
|
6019
|
+
dropTargetListId: null,
|
|
6020
|
+
dropIndex: -1,
|
|
6021
|
+
outside: false
|
|
6022
|
+
};
|
|
6023
|
+
}
|
|
5952
6024
|
interactionTarget.drop(event2);
|
|
5953
6025
|
events.push(event2);
|
|
5954
6026
|
if (!event2.outside) {
|
|
@@ -6014,6 +6086,11 @@ var DragOperation = class extends EventEmitter {
|
|
|
6014
6086
|
constructor(options) {
|
|
6015
6087
|
super(options.listeners);
|
|
6016
6088
|
this.phase = "start";
|
|
6089
|
+
/**
|
|
6090
|
+
* Whether the drag was cancelled - the browser took the pointer away -
|
|
6091
|
+
* rather than dropped.
|
|
6092
|
+
*/
|
|
6093
|
+
this.cancelled = false;
|
|
6017
6094
|
this.currentOffset = {
|
|
6018
6095
|
top: 0,
|
|
6019
6096
|
left: 0
|
|
@@ -6042,6 +6119,13 @@ var DragOperation = class extends EventEmitter {
|
|
|
6042
6119
|
this.phase = "drop";
|
|
6043
6120
|
this.emit("drop", this);
|
|
6044
6121
|
}
|
|
6122
|
+
/**
|
|
6123
|
+
* Ends the drag without a drop.
|
|
6124
|
+
*/
|
|
6125
|
+
cancel() {
|
|
6126
|
+
this.cancelled = true;
|
|
6127
|
+
this.drop();
|
|
6128
|
+
}
|
|
6045
6129
|
move(point) {
|
|
6046
6130
|
if (this.phase !== "start" && this.phase !== "move") {
|
|
6047
6131
|
return;
|
|
@@ -6080,6 +6164,11 @@ var DragDropProviderContext = React20.createContext({
|
|
|
6080
6164
|
var useDragDropProvider = () => {
|
|
6081
6165
|
return React20.useContext(DragDropProviderContext);
|
|
6082
6166
|
};
|
|
6167
|
+
var DragDropProviderIdContext = React20.createContext("");
|
|
6168
|
+
var useDragListId = (name) => {
|
|
6169
|
+
const providerId = React20.useContext(DragDropProviderIdContext);
|
|
6170
|
+
return providerId ? `${name}-${providerId}` : name;
|
|
6171
|
+
};
|
|
6083
6172
|
var DragDropProvider = (props) => {
|
|
6084
6173
|
const [state, setState] = React20.useState({
|
|
6085
6174
|
dragSourceListId: null,
|
|
@@ -6087,6 +6176,7 @@ var DragDropProvider = (props) => {
|
|
|
6087
6176
|
dragItemId: "",
|
|
6088
6177
|
status: "accepted"
|
|
6089
6178
|
});
|
|
6179
|
+
const providerId = React20.useId();
|
|
6090
6180
|
const stateRef = React20.useRef(state);
|
|
6091
6181
|
stateRef.current = state;
|
|
6092
6182
|
const getCurrentDragSourceAndTarget = React20.useCallback(() => {
|
|
@@ -6144,9 +6234,13 @@ var DragDropProvider = (props) => {
|
|
|
6144
6234
|
removeDragDrop();
|
|
6145
6235
|
};
|
|
6146
6236
|
}, [DragManager, setState]);
|
|
6147
|
-
return /* @__PURE__ */ React20.createElement(DragDropProviderContext.Provider, { value: contextValue }, typeof props.children === "function" ? props.children(contextValue) : props.children);
|
|
6237
|
+
return /* @__PURE__ */ React20.createElement(DragDropProviderIdContext.Provider, { value: providerId }, /* @__PURE__ */ React20.createElement(DragDropProviderContext.Provider, { value: contextValue }, typeof props.children === "function" ? props.children(contextValue) : props.children));
|
|
6148
6238
|
};
|
|
6149
6239
|
|
|
6240
|
+
// src/components/InfiniteTable/components/draggable/dragListNames.ts
|
|
6241
|
+
var HEADER_DRAG_LIST_NAME = "header";
|
|
6242
|
+
var GROUPING_TOOLBAR_DRAG_LIST_NAME = "grouping-toolbar";
|
|
6243
|
+
|
|
6150
6244
|
// src/components/InfiniteTable/components/InfiniteTableBody/bodyClassName.ts
|
|
6151
6245
|
var InfiniteTableBodyClassName = `${rootClassName}Body`;
|
|
6152
6246
|
var getBodyNode = (root) => {
|
|
@@ -6193,6 +6287,9 @@ var useColumnPointerEvents = ({
|
|
|
6193
6287
|
const [proxyPosition, setProxyPosition] = useState6(null);
|
|
6194
6288
|
const [dragColumnOutside, setDragColumnOutside] = useState6(false);
|
|
6195
6289
|
const { getCurrentDragSourceAndTarget } = useDragDropProvider();
|
|
6290
|
+
const groupingToolbarDragListId = useDragListId(
|
|
6291
|
+
GROUPING_TOOLBAR_DRAG_LIST_NAME
|
|
6292
|
+
);
|
|
6196
6293
|
const { getComputed, getState, api, computedDraggable, rootRef, actions } = useInfiniteTableSelector((ctx) => {
|
|
6197
6294
|
return {
|
|
6198
6295
|
actions: ctx.actions,
|
|
@@ -6269,6 +6366,7 @@ var useColumnPointerEvents = ({
|
|
|
6269
6366
|
dragColumnHeaderTargetRect: targetRect,
|
|
6270
6367
|
dragColumnId: columnId,
|
|
6271
6368
|
getCurrentDragSourceAndTarget,
|
|
6369
|
+
groupingToolbarDragListId,
|
|
6272
6370
|
api,
|
|
6273
6371
|
infiniteDOMNode: rootRef.current,
|
|
6274
6372
|
setProxyPosition,
|
|
@@ -6409,7 +6507,7 @@ var useColumnPointerEvents = ({
|
|
|
6409
6507
|
target.addEventListener("pointerup", onPointerUp);
|
|
6410
6508
|
target.setPointerCapture(e.pointerId);
|
|
6411
6509
|
},
|
|
6412
|
-
[columnId, horizontalLayoutPageIndex]
|
|
6510
|
+
[columnId, horizontalLayoutPageIndex, groupingToolbarDragListId]
|
|
6413
6511
|
);
|
|
6414
6512
|
return {
|
|
6415
6513
|
onPointerDown: computedDraggable ? onPointerDown : defaultPointerDown,
|
|
@@ -10214,6 +10312,7 @@ function ExpandCollapseIcon(props) {
|
|
|
10214
10312
|
className: join(
|
|
10215
10313
|
props.className,
|
|
10216
10314
|
ExpanderIconCls,
|
|
10315
|
+
IconCustomMaskCls.expandCollapse,
|
|
10217
10316
|
ExpanderIconClsVariants({
|
|
10218
10317
|
direction: direction || "start",
|
|
10219
10318
|
expanded,
|
|
@@ -11627,6 +11726,10 @@ function RenderHeaderCellHookComponent(props) {
|
|
|
11627
11726
|
// src/components/InfiniteTable/components/icons/MenuIcon.tsx
|
|
11628
11727
|
import * as React27 from "react";
|
|
11629
11728
|
|
|
11729
|
+
// src/components/InfiniteTable/components/icons/MenuIcon.css.ts
|
|
11730
|
+
var MenuIconLineCls = "yhvuzb1";
|
|
11731
|
+
var MenuIconWithDefaultLinesCls = "yhvuzb0";
|
|
11732
|
+
|
|
11630
11733
|
// src/components/InfiniteTable/components/icons/menuIconAttributes.ts
|
|
11631
11734
|
var MenuIconDataAttributes = keyMirror({
|
|
11632
11735
|
"data-name": ""
|
|
@@ -11641,7 +11744,7 @@ var defaultLineStyle2 = {
|
|
|
11641
11744
|
width: "100%",
|
|
11642
11745
|
pointerEvents: "none"
|
|
11643
11746
|
};
|
|
11644
|
-
var lineClassName = `${InfiniteIconClassName}-menu
|
|
11747
|
+
var lineClassName = join(`${InfiniteIconClassName}-menu`, MenuIconLineCls);
|
|
11645
11748
|
function MenuIcon(props) {
|
|
11646
11749
|
const {
|
|
11647
11750
|
style: style2,
|
|
@@ -11670,7 +11773,8 @@ function MenuIcon(props) {
|
|
|
11670
11773
|
reserveSpaceWhenHidden
|
|
11671
11774
|
}),
|
|
11672
11775
|
InfiniteIconClassName,
|
|
11673
|
-
`${InfiniteIconClassName}-menu
|
|
11776
|
+
`${InfiniteIconClassName}-menu`,
|
|
11777
|
+
children == null ? MenuIconWithDefaultLinesCls : ""
|
|
11674
11778
|
)
|
|
11675
11779
|
},
|
|
11676
11780
|
children ?? /* @__PURE__ */ React27.createElement(React27.Fragment, null, /* @__PURE__ */ React27.createElement("div", { className: lineClassName, style: lineStyle }), /* @__PURE__ */ React27.createElement("div", { className: lineClassName, style: lineStyle }), /* @__PURE__ */ React27.createElement("div", { className: lineClassName, style: lineStyle }))
|
|
@@ -11683,6 +11787,8 @@ import { useEffect as useEffect10, useState as useState9 } from "react";
|
|
|
11683
11787
|
|
|
11684
11788
|
// src/components/InfiniteTable/components/icons/SortIcon/SortIcon.css.ts
|
|
11685
11789
|
var SortIconCls = "_1b8djff0 _16lm1iw1p _16lm1iw2f _16lm1iw1 _16lm1iw32";
|
|
11790
|
+
var SortIconDirectionCls = { asc: "_1b8djff1", desc: "_1b8djff2", none: "_1b8djff3" };
|
|
11791
|
+
var SortIconLineCls = "_1b8djff4";
|
|
11686
11792
|
|
|
11687
11793
|
// src/components/InfiniteTable/components/icons/SortIcon/shared.ts
|
|
11688
11794
|
var defaultLineStyle3 = {
|
|
@@ -11743,6 +11849,7 @@ function SortIcon(props) {
|
|
|
11743
11849
|
if (!rendered && !props.forceSize) {
|
|
11744
11850
|
return null;
|
|
11745
11851
|
}
|
|
11852
|
+
const directionName = direction === 1 ? "asc" : direction === -1 ? "desc" : "none";
|
|
11746
11853
|
const indexStyle = {};
|
|
11747
11854
|
if (direction === -1) {
|
|
11748
11855
|
indexStyle.top = "100%";
|
|
@@ -11756,7 +11863,9 @@ function SortIcon(props) {
|
|
|
11756
11863
|
className,
|
|
11757
11864
|
InfiniteIconClassName,
|
|
11758
11865
|
SortIconCls,
|
|
11759
|
-
|
|
11866
|
+
SortIconDirectionCls[directionName],
|
|
11867
|
+
`${InfiniteIconClassName}-sort`,
|
|
11868
|
+
`${InfiniteIconClassName}-sort--${directionName}`
|
|
11760
11869
|
)
|
|
11761
11870
|
},
|
|
11762
11871
|
showIndex ? /* @__PURE__ */ React28.createElement(
|
|
@@ -11771,12 +11880,25 @@ function SortIcon(props) {
|
|
|
11771
11880
|
/* @__PURE__ */ React28.createElement(
|
|
11772
11881
|
"div",
|
|
11773
11882
|
{
|
|
11883
|
+
className: SortIconLineCls,
|
|
11774
11884
|
style: { width: sizes[0], ...lineStyle },
|
|
11775
11885
|
onTransitionEnd
|
|
11776
11886
|
}
|
|
11777
11887
|
),
|
|
11778
|
-
/* @__PURE__ */ React28.createElement(
|
|
11779
|
-
|
|
11888
|
+
/* @__PURE__ */ React28.createElement(
|
|
11889
|
+
"div",
|
|
11890
|
+
{
|
|
11891
|
+
className: SortIconLineCls,
|
|
11892
|
+
style: { width: sizes[1], ...lineStyle }
|
|
11893
|
+
}
|
|
11894
|
+
),
|
|
11895
|
+
/* @__PURE__ */ React28.createElement(
|
|
11896
|
+
"div",
|
|
11897
|
+
{
|
|
11898
|
+
className: SortIconLineCls,
|
|
11899
|
+
style: { width: sizes[2], ...lineStyle }
|
|
11900
|
+
}
|
|
11901
|
+
)
|
|
11780
11902
|
);
|
|
11781
11903
|
}
|
|
11782
11904
|
|
|
@@ -12329,7 +12451,7 @@ function dampenByTime(proposedScroll, dragStartTime, config) {
|
|
|
12329
12451
|
return MIN_SCROLL;
|
|
12330
12452
|
}
|
|
12331
12453
|
const pct = (runTime - accelerateAt) / (stopDampeningAt - accelerateAt);
|
|
12332
|
-
return Math.ceil(proposedScroll * config.ease(pct));
|
|
12454
|
+
return Math.max(MIN_SCROLL, Math.ceil(proposedScroll * config.ease(pct)));
|
|
12333
12455
|
}
|
|
12334
12456
|
function getScrollForAxis(point, containerStart, containerEnd, containerSize, config, dragStartTime, shouldUseDampening) {
|
|
12335
12457
|
if (point < containerStart || point > containerEnd) {
|
|
@@ -12477,20 +12599,12 @@ var AutoScroller = class {
|
|
|
12477
12599
|
}
|
|
12478
12600
|
};
|
|
12479
12601
|
|
|
12480
|
-
// src/components/InfiniteTable/components/draggable/
|
|
12481
|
-
var
|
|
12482
|
-
|
|
12483
|
-
|
|
12484
|
-
|
|
12485
|
-
|
|
12486
|
-
dragListId: "",
|
|
12487
|
-
status: "accepted",
|
|
12488
|
-
dragSourceListId: null,
|
|
12489
|
-
dropTargetListId: null
|
|
12490
|
-
});
|
|
12491
|
-
var useDragListContext = () => {
|
|
12492
|
-
return React31.useContext(DragListContext);
|
|
12493
|
-
};
|
|
12602
|
+
// src/components/InfiniteTable/components/draggable/dragListController.ts
|
|
12603
|
+
var DRAG_LIST_ATTRIBUTE = "data-drag-list-id";
|
|
12604
|
+
var DRAG_ITEM_ATTRIBUTE = "data-drag-item-id";
|
|
12605
|
+
var DRAG_ITEM_LIST_ATTRIBUTE = "data-drag-item-list-id";
|
|
12606
|
+
var DRAG_ITEM_SELECTOR = `[${DRAG_ITEM_ATTRIBUTE}]`;
|
|
12607
|
+
var RETURN_NULL = () => null;
|
|
12494
12608
|
var defaultUpdatePosition = (options) => {
|
|
12495
12609
|
const { node, offset } = options;
|
|
12496
12610
|
if (!offset) {
|
|
@@ -12511,8 +12625,6 @@ function getDraggableItemNodes(domRef, dragListId) {
|
|
|
12511
12625
|
}
|
|
12512
12626
|
function getDraggableItems(domRef, dragListId) {
|
|
12513
12627
|
const dragItems = getDraggableItemNodes(domRef, dragListId);
|
|
12514
|
-
if (!dragItems || dragItems.length === 0) {
|
|
12515
|
-
}
|
|
12516
12628
|
const draggableItems = Array.from(dragItems).map((item) => {
|
|
12517
12629
|
const id = getDraggableItemId(item);
|
|
12518
12630
|
const rect = item.getBoundingClientRect();
|
|
@@ -12560,55 +12672,54 @@ function createInteractionTarget(params) {
|
|
|
12560
12672
|
const target = new DragInteractionTarget(getInteractionTargetData(params));
|
|
12561
12673
|
return target;
|
|
12562
12674
|
}
|
|
12563
|
-
function
|
|
12564
|
-
const
|
|
12565
|
-
|
|
12566
|
-
const setInteractionTarget = useCallback17(
|
|
12567
|
-
(interactionTarget2) => {
|
|
12568
|
-
if (interactionTarget2) {
|
|
12569
|
-
DragManager.registerDragInteractionTarget(interactionTarget2);
|
|
12570
|
-
} else {
|
|
12571
|
-
const currentInteractionTarget = getInteractionTarget();
|
|
12572
|
-
if (currentInteractionTarget) {
|
|
12573
|
-
DragManager.unregisterDragInteractionTarget(currentInteractionTarget);
|
|
12574
|
-
}
|
|
12575
|
-
}
|
|
12576
|
-
doSetInteractionTarget(interactionTarget2);
|
|
12577
|
-
},
|
|
12578
|
-
[]
|
|
12675
|
+
function findDragListElement(domRef, dragListId) {
|
|
12676
|
+
const dragList = document.querySelector(
|
|
12677
|
+
`[${DRAG_LIST_ATTRIBUTE}="${dragListId}"]`
|
|
12579
12678
|
);
|
|
12580
|
-
|
|
12581
|
-
|
|
12582
|
-
|
|
12583
|
-
|
|
12584
|
-
|
|
12585
|
-
|
|
12586
|
-
|
|
12587
|
-
|
|
12588
|
-
|
|
12589
|
-
|
|
12590
|
-
|
|
12591
|
-
|
|
12592
|
-
|
|
12593
|
-
|
|
12594
|
-
|
|
12595
|
-
|
|
12596
|
-
|
|
12597
|
-
|
|
12598
|
-
|
|
12599
|
-
|
|
12600
|
-
|
|
12601
|
-
|
|
12602
|
-
|
|
12603
|
-
|
|
12604
|
-
|
|
12605
|
-
}
|
|
12606
|
-
|
|
12607
|
-
|
|
12608
|
-
|
|
12609
|
-
|
|
12610
|
-
|
|
12611
|
-
|
|
12679
|
+
if (dragList) {
|
|
12680
|
+
domRef.current = dragList;
|
|
12681
|
+
} else {
|
|
12682
|
+
console.warn(
|
|
12683
|
+
`DragList with id "${dragListId}" not found. You're probably not spreading the domProps to the parent element. Make sure you also include the "className" prop.`
|
|
12684
|
+
);
|
|
12685
|
+
}
|
|
12686
|
+
}
|
|
12687
|
+
function replaceRegisteredInteractionTarget(registeredTargetRef, interactionTarget) {
|
|
12688
|
+
const registeredTarget = registeredTargetRef.current;
|
|
12689
|
+
if (registeredTarget && registeredTarget !== interactionTarget) {
|
|
12690
|
+
DragManager.unregisterDragInteractionTarget(registeredTarget);
|
|
12691
|
+
}
|
|
12692
|
+
registeredTargetRef.current = interactionTarget;
|
|
12693
|
+
if (interactionTarget) {
|
|
12694
|
+
DragManager.registerDragInteractionTarget(interactionTarget);
|
|
12695
|
+
}
|
|
12696
|
+
}
|
|
12697
|
+
function acceptDragsFromOtherLists(options) {
|
|
12698
|
+
const { getProps, domRef, setInteractionTarget } = options;
|
|
12699
|
+
return DragManager.on("register", (interactionTarget) => {
|
|
12700
|
+
const { dragListId, acceptDropsFrom, orientation, shouldAcceptDrop } = getProps();
|
|
12701
|
+
const interactionTargetData = interactionTarget.getData();
|
|
12702
|
+
if (!interactionTargetData.initial) {
|
|
12703
|
+
return;
|
|
12704
|
+
}
|
|
12705
|
+
if (interactionTargetData.listId === dragListId) {
|
|
12706
|
+
return;
|
|
12707
|
+
}
|
|
12708
|
+
if (acceptDropsFrom?.includes(interactionTargetData.listId)) {
|
|
12709
|
+
const newInteractionTarget = createInteractionTarget({
|
|
12710
|
+
domRef,
|
|
12711
|
+
orientation,
|
|
12712
|
+
dragListId,
|
|
12713
|
+
initial: false,
|
|
12714
|
+
acceptDropsFrom,
|
|
12715
|
+
shouldAcceptDrop
|
|
12716
|
+
});
|
|
12717
|
+
interactionTarget.once("unregister", () => {
|
|
12718
|
+
setInteractionTarget(null);
|
|
12719
|
+
});
|
|
12720
|
+
setInteractionTarget(newInteractionTarget);
|
|
12721
|
+
}
|
|
12722
|
+
});
|
|
12612
12723
|
}
|
|
12613
12724
|
function createDefaultProxy(dragItemNode, initialRect) {
|
|
12614
12725
|
const proxy = dragItemNode.cloneNode(true);
|
|
@@ -12644,6 +12755,444 @@ function cleanupProxy(proxyStateRef) {
|
|
|
12644
12755
|
state.originalNode.style.visibility = "";
|
|
12645
12756
|
proxyStateRef.current = null;
|
|
12646
12757
|
}
|
|
12758
|
+
function getDragItemNodes(dragItemsRef, domRef, dragListId) {
|
|
12759
|
+
let dragItems = dragItemsRef.current;
|
|
12760
|
+
if (!dragItems || dragItems.length === 0) {
|
|
12761
|
+
dragItems = getDraggableItemNodes(domRef, dragListId);
|
|
12762
|
+
dragItemsRef.current = dragItems;
|
|
12763
|
+
}
|
|
12764
|
+
return dragItems;
|
|
12765
|
+
}
|
|
12766
|
+
function bindInteractionTarget(interactionTarget, options) {
|
|
12767
|
+
const {
|
|
12768
|
+
dragListId,
|
|
12769
|
+
orientation,
|
|
12770
|
+
domRef,
|
|
12771
|
+
proxyStateRef,
|
|
12772
|
+
sourceScrollOffsetRef,
|
|
12773
|
+
dragItemsRef,
|
|
12774
|
+
getDragItems,
|
|
12775
|
+
getOnDrop,
|
|
12776
|
+
getOnAcceptDrop,
|
|
12777
|
+
getOnRemove,
|
|
12778
|
+
getUpdatePosition,
|
|
12779
|
+
updateDragOperationSourceAndTarget,
|
|
12780
|
+
updateDragProxyRenderState
|
|
12781
|
+
} = options;
|
|
12782
|
+
const removeOnDragStart = interactionTarget.on(
|
|
12783
|
+
"start",
|
|
12784
|
+
({ dragItem, dragSourceListId, dropTargetListId }) => {
|
|
12785
|
+
updateDragOperationSourceAndTarget({
|
|
12786
|
+
dragSourceListId,
|
|
12787
|
+
dropTargetListId,
|
|
12788
|
+
dragItemId: dragItem.id,
|
|
12789
|
+
status: "accepted"
|
|
12790
|
+
});
|
|
12791
|
+
}
|
|
12792
|
+
);
|
|
12793
|
+
const removeOnDragMove = interactionTarget.on(
|
|
12794
|
+
"move",
|
|
12795
|
+
({ offsetsForItems, items, status, dragItem }) => {
|
|
12796
|
+
if (status === "rejected") {
|
|
12797
|
+
return;
|
|
12798
|
+
}
|
|
12799
|
+
const dragItems = getDragItems();
|
|
12800
|
+
const updatePosition = getUpdatePosition();
|
|
12801
|
+
const proxyState = proxyStateRef.current;
|
|
12802
|
+
items.forEach((item, index) => {
|
|
12803
|
+
let offset = offsetsForItems[index];
|
|
12804
|
+
const node = dragItems[index];
|
|
12805
|
+
if (!node) {
|
|
12806
|
+
return;
|
|
12807
|
+
}
|
|
12808
|
+
if (proxyState && item.id === proxyState.dragItemId) {
|
|
12809
|
+
return;
|
|
12810
|
+
}
|
|
12811
|
+
if (!proxyState && item.id === dragItem.id) {
|
|
12812
|
+
const scrollOffset = sourceScrollOffsetRef.current;
|
|
12813
|
+
offset = {
|
|
12814
|
+
left: offset.left + scrollOffset.left,
|
|
12815
|
+
top: offset.top + scrollOffset.top
|
|
12816
|
+
};
|
|
12817
|
+
}
|
|
12818
|
+
updatePosition({
|
|
12819
|
+
id: item.id,
|
|
12820
|
+
node,
|
|
12821
|
+
offset
|
|
12822
|
+
});
|
|
12823
|
+
});
|
|
12824
|
+
}
|
|
12825
|
+
);
|
|
12826
|
+
const removeOnDragDrop = interactionTarget.on("drop", (params) => {
|
|
12827
|
+
const {
|
|
12828
|
+
sortedIndexes,
|
|
12829
|
+
dragIndex,
|
|
12830
|
+
dropIndex,
|
|
12831
|
+
dragItem,
|
|
12832
|
+
items,
|
|
12833
|
+
dragSourceListId,
|
|
12834
|
+
dropTargetListId,
|
|
12835
|
+
outside,
|
|
12836
|
+
status
|
|
12837
|
+
} = params;
|
|
12838
|
+
const dragItems = getDragItems();
|
|
12839
|
+
dragItemsRef.current = [];
|
|
12840
|
+
const onAcceptDrop = getOnAcceptDrop();
|
|
12841
|
+
const onRemove = getOnRemove();
|
|
12842
|
+
const onDrop = getOnDrop();
|
|
12843
|
+
const updatePosition = getUpdatePosition();
|
|
12844
|
+
items.forEach((item, index) => {
|
|
12845
|
+
const node = dragItems[index];
|
|
12846
|
+
if (!node) {
|
|
12847
|
+
return;
|
|
12848
|
+
}
|
|
12849
|
+
updatePosition({
|
|
12850
|
+
id: item.id,
|
|
12851
|
+
node,
|
|
12852
|
+
offset: null
|
|
12853
|
+
});
|
|
12854
|
+
});
|
|
12855
|
+
cleanupProxy(proxyStateRef);
|
|
12856
|
+
updateDragProxyRenderState((prev) => {
|
|
12857
|
+
if (!prev) return prev;
|
|
12858
|
+
requestAnimationFrame(() => updateDragProxyRenderState(RETURN_NULL));
|
|
12859
|
+
return { ...prev, dragItemId: null };
|
|
12860
|
+
});
|
|
12861
|
+
const accepted = status === "accepted";
|
|
12862
|
+
if (dragListId === dropTargetListId && dragSourceListId !== dragListId) {
|
|
12863
|
+
if (onAcceptDrop && accepted) {
|
|
12864
|
+
onAcceptDrop({
|
|
12865
|
+
dragItemId: dragItem.id,
|
|
12866
|
+
dragSourceListId,
|
|
12867
|
+
dropTargetListId,
|
|
12868
|
+
dragIndex,
|
|
12869
|
+
dropIndex,
|
|
12870
|
+
dropItemId: items[dropIndex]?.id
|
|
12871
|
+
});
|
|
12872
|
+
}
|
|
12873
|
+
}
|
|
12874
|
+
let callbackFn = null;
|
|
12875
|
+
if (dropIndex === -1 && dragSourceListId === dragListId && dropTargetListId === dragListId && outside) {
|
|
12876
|
+
callbackFn = onRemove;
|
|
12877
|
+
}
|
|
12878
|
+
if (dropIndex !== -1 && dropTargetListId === dragListId && dragSourceListId === dragListId) {
|
|
12879
|
+
callbackFn = onDrop;
|
|
12880
|
+
}
|
|
12881
|
+
if (callbackFn) {
|
|
12882
|
+
callbackFn?.(sortedIndexes, {
|
|
12883
|
+
dragIndex,
|
|
12884
|
+
dropIndex,
|
|
12885
|
+
dragItemId: items[dragIndex].id,
|
|
12886
|
+
dropItemId: items[dropIndex]?.id
|
|
12887
|
+
});
|
|
12888
|
+
}
|
|
12889
|
+
});
|
|
12890
|
+
let targetAutoScroller = null;
|
|
12891
|
+
let targetScrollContainer = null;
|
|
12892
|
+
let targetScrollHandler = null;
|
|
12893
|
+
let targetPointermoveHandler = null;
|
|
12894
|
+
if (!interactionTarget.getData().initial && domRef.current) {
|
|
12895
|
+
targetAutoScroller = new AutoScroller({
|
|
12896
|
+
orientation,
|
|
12897
|
+
onScroll: () => {
|
|
12898
|
+
}
|
|
12899
|
+
});
|
|
12900
|
+
targetAutoScroller.start(domRef.current);
|
|
12901
|
+
targetScrollContainer = targetAutoScroller.getScrollContainer();
|
|
12902
|
+
if (targetScrollContainer) {
|
|
12903
|
+
let lastScroll = orientation === "vertical" ? targetScrollContainer.scrollTop : targetScrollContainer.scrollLeft;
|
|
12904
|
+
targetScrollHandler = () => {
|
|
12905
|
+
const current = orientation === "vertical" ? targetScrollContainer.scrollTop : targetScrollContainer.scrollLeft;
|
|
12906
|
+
const delta = current - lastScroll;
|
|
12907
|
+
lastScroll = current;
|
|
12908
|
+
if (delta !== 0) {
|
|
12909
|
+
interactionTarget.adjustForScroll(delta);
|
|
12910
|
+
DragManager.retriggerMove();
|
|
12911
|
+
}
|
|
12912
|
+
};
|
|
12913
|
+
targetScrollContainer.addEventListener("scroll", targetScrollHandler);
|
|
12914
|
+
}
|
|
12915
|
+
targetPointermoveHandler = (e) => {
|
|
12916
|
+
targetAutoScroller.updatePointer({
|
|
12917
|
+
left: e.clientX,
|
|
12918
|
+
top: e.clientY
|
|
12919
|
+
});
|
|
12920
|
+
};
|
|
12921
|
+
getGlobal().addEventListener("pointermove", targetPointermoveHandler);
|
|
12922
|
+
}
|
|
12923
|
+
return () => {
|
|
12924
|
+
removeOnDragStart();
|
|
12925
|
+
removeOnDragMove();
|
|
12926
|
+
removeOnDragDrop();
|
|
12927
|
+
if (targetAutoScroller) {
|
|
12928
|
+
targetAutoScroller.stop();
|
|
12929
|
+
}
|
|
12930
|
+
if (targetScrollContainer && targetScrollHandler) {
|
|
12931
|
+
targetScrollContainer.removeEventListener("scroll", targetScrollHandler);
|
|
12932
|
+
}
|
|
12933
|
+
if (targetPointermoveHandler) {
|
|
12934
|
+
getGlobal().removeEventListener("pointermove", targetPointermoveHandler);
|
|
12935
|
+
}
|
|
12936
|
+
};
|
|
12937
|
+
}
|
|
12938
|
+
function startDragOnPointerDown(e, props, options) {
|
|
12939
|
+
const {
|
|
12940
|
+
dragListId,
|
|
12941
|
+
orientation,
|
|
12942
|
+
acceptDropsFrom,
|
|
12943
|
+
preserveDragSpace,
|
|
12944
|
+
onDragProxySetup
|
|
12945
|
+
} = props;
|
|
12946
|
+
const {
|
|
12947
|
+
domRef,
|
|
12948
|
+
proxyStateRef,
|
|
12949
|
+
sourceScrollOffsetRef,
|
|
12950
|
+
dragItemsRef,
|
|
12951
|
+
setInteractionTarget,
|
|
12952
|
+
updateDragProxyRenderState
|
|
12953
|
+
} = options;
|
|
12954
|
+
const dragStrategy = props.dragStrategy ?? "proxy";
|
|
12955
|
+
const useProxy = dragStrategy === "proxy" && !props.renderDragProxy;
|
|
12956
|
+
const useRenderProxy = dragStrategy === "proxy" && !!props.renderDragProxy;
|
|
12957
|
+
const proxyMove = props.onDragProxyMove ?? defaultDragProxyMove;
|
|
12958
|
+
const target = e.currentTarget;
|
|
12959
|
+
let dragItemId = target.getAttribute(DRAG_ITEM_ATTRIBUTE);
|
|
12960
|
+
if (dragItemId == null) {
|
|
12961
|
+
const parentDragItem = selectParent(target, DRAG_ITEM_SELECTOR);
|
|
12962
|
+
if (parentDragItem) {
|
|
12963
|
+
dragItemId = parentDragItem.getAttribute(DRAG_ITEM_ATTRIBUTE);
|
|
12964
|
+
}
|
|
12965
|
+
}
|
|
12966
|
+
if (dragItemId == null) {
|
|
12967
|
+
console.warn(
|
|
12968
|
+
`Could not find drag item id for element`,
|
|
12969
|
+
target,
|
|
12970
|
+
`Make sure you have a parent element with a ${DRAG_ITEM_ATTRIBUTE} attribute`
|
|
12971
|
+
);
|
|
12972
|
+
return;
|
|
12973
|
+
}
|
|
12974
|
+
dragItemId = `${dragItemId}`;
|
|
12975
|
+
let dragOperation = null;
|
|
12976
|
+
const dragItems = getDraggableItemNodes(domRef, dragListId);
|
|
12977
|
+
dragItemsRef.current = dragItems;
|
|
12978
|
+
const interactionTarget = createInteractionTarget({
|
|
12979
|
+
domRef,
|
|
12980
|
+
orientation,
|
|
12981
|
+
dragListId,
|
|
12982
|
+
acceptDropsFrom,
|
|
12983
|
+
initial: true,
|
|
12984
|
+
preserveDragSpace
|
|
12985
|
+
});
|
|
12986
|
+
const draggableItems = interactionTarget.getData().draggableItems;
|
|
12987
|
+
const dragIndex = draggableItems.findIndex((item) => item.id === dragItemId);
|
|
12988
|
+
if (dragIndex === -1) {
|
|
12989
|
+
return;
|
|
12990
|
+
}
|
|
12991
|
+
const dragItem = draggableItems[dragIndex];
|
|
12992
|
+
const dragItemNode = dragItems[dragIndex]?.getAttribute(DRAG_ITEM_ATTRIBUTE) === `${dragItemId}` ? dragItems[dragIndex] : dragItems.find(
|
|
12993
|
+
(node) => node.getAttribute(DRAG_ITEM_ATTRIBUTE) === `${dragItemId}`
|
|
12994
|
+
);
|
|
12995
|
+
setInteractionTarget(interactionTarget);
|
|
12996
|
+
const initialCoords = {
|
|
12997
|
+
left: e.clientX,
|
|
12998
|
+
top: e.clientY
|
|
12999
|
+
};
|
|
13000
|
+
let lastPointer = { left: e.clientX, top: e.clientY };
|
|
13001
|
+
sourceScrollOffsetRef.current = { top: 0, left: 0 };
|
|
13002
|
+
const autoScroller = new AutoScroller({
|
|
13003
|
+
orientation,
|
|
13004
|
+
onScroll: () => {
|
|
13005
|
+
}
|
|
13006
|
+
});
|
|
13007
|
+
if (domRef.current) {
|
|
13008
|
+
autoScroller.start(domRef.current);
|
|
13009
|
+
}
|
|
13010
|
+
const scrollContainer = autoScroller.getScrollContainer();
|
|
13011
|
+
let lastSourceScroll = scrollContainer ? orientation === "vertical" ? scrollContainer.scrollTop : scrollContainer.scrollLeft : 0;
|
|
13012
|
+
function fireDragMove() {
|
|
13013
|
+
if (!dragOperation) return;
|
|
13014
|
+
dragOperation.move({
|
|
13015
|
+
left: lastPointer.left,
|
|
13016
|
+
top: lastPointer.top
|
|
13017
|
+
});
|
|
13018
|
+
}
|
|
13019
|
+
const onContainerScroll = () => {
|
|
13020
|
+
if (!scrollContainer) return;
|
|
13021
|
+
const current = orientation === "vertical" ? scrollContainer.scrollTop : scrollContainer.scrollLeft;
|
|
13022
|
+
const delta = current - lastSourceScroll;
|
|
13023
|
+
lastSourceScroll = current;
|
|
13024
|
+
if (delta !== 0) {
|
|
13025
|
+
interactionTarget.adjustForScroll(delta);
|
|
13026
|
+
if (orientation === "vertical") {
|
|
13027
|
+
sourceScrollOffsetRef.current.top += delta;
|
|
13028
|
+
} else {
|
|
13029
|
+
sourceScrollOffsetRef.current.left += delta;
|
|
13030
|
+
}
|
|
13031
|
+
}
|
|
13032
|
+
fireDragMove();
|
|
13033
|
+
};
|
|
13034
|
+
scrollContainer?.addEventListener("scroll", onContainerScroll);
|
|
13035
|
+
const onPointerMove = (e2) => {
|
|
13036
|
+
lastPointer = { left: e2.clientX, top: e2.clientY };
|
|
13037
|
+
if (!dragOperation) {
|
|
13038
|
+
dragOperation = DragManager.startDrag(
|
|
13039
|
+
{
|
|
13040
|
+
listId: dragListId,
|
|
13041
|
+
dragItem,
|
|
13042
|
+
dragIndex
|
|
13043
|
+
},
|
|
13044
|
+
initialCoords
|
|
13045
|
+
);
|
|
13046
|
+
if (dragItemNode && useProxy) {
|
|
13047
|
+
const rect = dragItemNode.getBoundingClientRect();
|
|
13048
|
+
let cachedProxy = null;
|
|
13049
|
+
const setupParams = {
|
|
13050
|
+
dragItemNode,
|
|
13051
|
+
dragItemId: `${dragItemId}`,
|
|
13052
|
+
initialRect: rect,
|
|
13053
|
+
initialCoords,
|
|
13054
|
+
get proxyElement() {
|
|
13055
|
+
if (!cachedProxy) {
|
|
13056
|
+
cachedProxy = createDefaultProxy(dragItemNode, rect);
|
|
13057
|
+
}
|
|
13058
|
+
return cachedProxy;
|
|
13059
|
+
}
|
|
13060
|
+
};
|
|
13061
|
+
const setupResult = onDragProxySetup?.(setupParams);
|
|
13062
|
+
const proxyElement = setupResult?.proxyElement ?? setupParams.proxyElement;
|
|
13063
|
+
dragItemNode.style.visibility = "hidden";
|
|
13064
|
+
proxyStateRef.current = {
|
|
13065
|
+
proxyElement,
|
|
13066
|
+
originalNode: dragItemNode,
|
|
13067
|
+
dragItemId: `${dragItemId}`,
|
|
13068
|
+
initialRect: rect,
|
|
13069
|
+
cleanup: setupResult?.cleanup
|
|
13070
|
+
};
|
|
13071
|
+
}
|
|
13072
|
+
if (dragItemNode && useRenderProxy) {
|
|
13073
|
+
const rect = dragItemNode.getBoundingClientRect();
|
|
13074
|
+
dragItemNode.style.visibility = "hidden";
|
|
13075
|
+
proxyStateRef.current = {
|
|
13076
|
+
proxyElement: dragItemNode,
|
|
13077
|
+
originalNode: dragItemNode,
|
|
13078
|
+
dragItemId: `${dragItemId}`,
|
|
13079
|
+
initialRect: rect,
|
|
13080
|
+
// Portal handles its own DOM; only restore visibility.
|
|
13081
|
+
cleanup: () => {
|
|
13082
|
+
}
|
|
13083
|
+
};
|
|
13084
|
+
const initialRenderState = {
|
|
13085
|
+
dragItemId: `${dragItemId}`,
|
|
13086
|
+
initialRect: rect,
|
|
13087
|
+
dx: 0,
|
|
13088
|
+
dy: 0
|
|
13089
|
+
};
|
|
13090
|
+
updateDragProxyRenderState(() => initialRenderState);
|
|
13091
|
+
}
|
|
13092
|
+
}
|
|
13093
|
+
const dx = e2.clientX - initialCoords.left;
|
|
13094
|
+
const dy = e2.clientY - initialCoords.top;
|
|
13095
|
+
if (useRenderProxy) {
|
|
13096
|
+
updateDragProxyRenderState((prev) => prev ? { ...prev, dx, dy } : prev);
|
|
13097
|
+
} else {
|
|
13098
|
+
const proxyState = proxyStateRef.current;
|
|
13099
|
+
if (proxyState) {
|
|
13100
|
+
proxyMove({ proxyElement: proxyState.proxyElement, dx, dy });
|
|
13101
|
+
}
|
|
13102
|
+
}
|
|
13103
|
+
autoScroller.updatePointer({
|
|
13104
|
+
left: e2.clientX,
|
|
13105
|
+
top: e2.clientY
|
|
13106
|
+
});
|
|
13107
|
+
fireDragMove();
|
|
13108
|
+
};
|
|
13109
|
+
const preventNativeDrag = (e2) => {
|
|
13110
|
+
e2.preventDefault();
|
|
13111
|
+
};
|
|
13112
|
+
const endDrag = (cancelled) => {
|
|
13113
|
+
autoScroller.stop();
|
|
13114
|
+
scrollContainer?.removeEventListener("scroll", onContainerScroll);
|
|
13115
|
+
win.removeEventListener("pointermove", onPointerMove);
|
|
13116
|
+
win.removeEventListener("pointerup", onPointerUp);
|
|
13117
|
+
win.removeEventListener("pointercancel", onPointerCancel);
|
|
13118
|
+
win.removeEventListener("dragstart", preventNativeDrag, true);
|
|
13119
|
+
if (useRenderProxy) {
|
|
13120
|
+
updateDragProxyRenderState(
|
|
13121
|
+
(prev) => prev ? { ...prev, dragItemId: null } : prev
|
|
13122
|
+
);
|
|
13123
|
+
requestAnimationFrame(() => {
|
|
13124
|
+
updateDragProxyRenderState(RETURN_NULL);
|
|
13125
|
+
});
|
|
13126
|
+
}
|
|
13127
|
+
if (!dragOperation) {
|
|
13128
|
+
cleanupProxy(proxyStateRef);
|
|
13129
|
+
setInteractionTarget(null);
|
|
13130
|
+
return;
|
|
13131
|
+
}
|
|
13132
|
+
if (cancelled) {
|
|
13133
|
+
dragOperation.cancel();
|
|
13134
|
+
} else {
|
|
13135
|
+
dragOperation.drop();
|
|
13136
|
+
}
|
|
13137
|
+
dragOperation = null;
|
|
13138
|
+
};
|
|
13139
|
+
const onPointerUp = () => endDrag(false);
|
|
13140
|
+
const onPointerCancel = () => endDrag(true);
|
|
13141
|
+
const win = getGlobal();
|
|
13142
|
+
win.addEventListener("pointermove", onPointerMove);
|
|
13143
|
+
win.addEventListener("pointerup", onPointerUp);
|
|
13144
|
+
win.addEventListener("pointercancel", onPointerCancel);
|
|
13145
|
+
win.addEventListener("dragstart", preventNativeDrag, true);
|
|
13146
|
+
}
|
|
13147
|
+
|
|
13148
|
+
// src/components/InfiniteTable/components/draggable/DragList.tsx
|
|
13149
|
+
var DragListContext = React31.createContext({
|
|
13150
|
+
dragItemId: null,
|
|
13151
|
+
onDragItemPointerDown: () => {
|
|
13152
|
+
},
|
|
13153
|
+
draggingInProgress: false,
|
|
13154
|
+
dragListId: "",
|
|
13155
|
+
status: "accepted",
|
|
13156
|
+
dragSourceListId: null,
|
|
13157
|
+
dropTargetListId: null
|
|
13158
|
+
});
|
|
13159
|
+
var useDragListContext = () => {
|
|
13160
|
+
return React31.useContext(DragListContext);
|
|
13161
|
+
};
|
|
13162
|
+
function useInteractionTarget(domRef, props) {
|
|
13163
|
+
const getProps = useLatest(props);
|
|
13164
|
+
const [interactionTarget, doSetInteractionTarget] = React31.useState(null);
|
|
13165
|
+
const registeredTargetRef = React31.useRef(null);
|
|
13166
|
+
const setInteractionTarget = useCallback17(
|
|
13167
|
+
(interactionTarget2) => {
|
|
13168
|
+
replaceRegisteredInteractionTarget(
|
|
13169
|
+
registeredTargetRef,
|
|
13170
|
+
interactionTarget2
|
|
13171
|
+
);
|
|
13172
|
+
doSetInteractionTarget(interactionTarget2);
|
|
13173
|
+
},
|
|
13174
|
+
[]
|
|
13175
|
+
);
|
|
13176
|
+
const getInteractionTarget = useLatest(interactionTarget);
|
|
13177
|
+
useEffect11(() => {
|
|
13178
|
+
return () => {
|
|
13179
|
+
DragManager.unregisterDragInteractionTarget(registeredTargetRef.current);
|
|
13180
|
+
registeredTargetRef.current = null;
|
|
13181
|
+
};
|
|
13182
|
+
}, []);
|
|
13183
|
+
useEffect11(() => {
|
|
13184
|
+
return acceptDragsFromOtherLists({
|
|
13185
|
+
getProps,
|
|
13186
|
+
domRef,
|
|
13187
|
+
setInteractionTarget
|
|
13188
|
+
});
|
|
13189
|
+
}, [getProps]);
|
|
13190
|
+
return {
|
|
13191
|
+
interactionTarget,
|
|
13192
|
+
setInteractionTarget,
|
|
13193
|
+
getInteractionTarget
|
|
13194
|
+
};
|
|
13195
|
+
}
|
|
12647
13196
|
var DragList = (props) => {
|
|
12648
13197
|
const domRef = React31.useRef(null);
|
|
12649
13198
|
const proxyStateRef = React31.useRef(null);
|
|
@@ -12666,375 +13215,42 @@ var DragList = (props) => {
|
|
|
12666
13215
|
props
|
|
12667
13216
|
);
|
|
12668
13217
|
useEffect11(() => {
|
|
12669
|
-
|
|
12670
|
-
`[${DRAG_LIST_ATTRIBUTE}="${props.dragListId}"]`
|
|
12671
|
-
);
|
|
12672
|
-
if (dragList) {
|
|
12673
|
-
domRef.current = dragList;
|
|
12674
|
-
} else {
|
|
12675
|
-
console.warn(
|
|
12676
|
-
`DragList with id "${props.dragListId}" not found. You're probably not spreading the domProps to the parent element. Make sure you also include the "className" prop.`
|
|
12677
|
-
);
|
|
12678
|
-
}
|
|
13218
|
+
findDragListElement(domRef, props.dragListId);
|
|
12679
13219
|
}, [props.dragListId]);
|
|
12680
13220
|
useEffect11(() => {
|
|
12681
13221
|
if (interactionTarget) {
|
|
12682
|
-
|
|
12683
|
-
|
|
12684
|
-
|
|
12685
|
-
|
|
12686
|
-
|
|
12687
|
-
|
|
12688
|
-
|
|
12689
|
-
|
|
12690
|
-
|
|
12691
|
-
|
|
12692
|
-
|
|
12693
|
-
|
|
12694
|
-
|
|
12695
|
-
|
|
12696
|
-
({ offsetsForItems, items, status: status2, dragItem }) => {
|
|
12697
|
-
if (status2 === "rejected") {
|
|
12698
|
-
return;
|
|
12699
|
-
}
|
|
12700
|
-
const dragItems = getDragItems();
|
|
12701
|
-
const updatePosition = getUpdatePosition();
|
|
12702
|
-
const proxyState = proxyStateRef.current;
|
|
12703
|
-
items.forEach((item, index) => {
|
|
12704
|
-
let offset = offsetsForItems[index];
|
|
12705
|
-
const node = dragItems[index];
|
|
12706
|
-
if (!node) {
|
|
12707
|
-
return;
|
|
12708
|
-
}
|
|
12709
|
-
if (proxyState && item.id === proxyState.dragItemId) {
|
|
12710
|
-
return;
|
|
12711
|
-
}
|
|
12712
|
-
if (!proxyState && item.id === dragItem.id) {
|
|
12713
|
-
const scrollOffset = sourceScrollOffsetRef.current;
|
|
12714
|
-
offset = {
|
|
12715
|
-
left: offset.left + scrollOffset.left,
|
|
12716
|
-
top: offset.top + scrollOffset.top
|
|
12717
|
-
};
|
|
12718
|
-
}
|
|
12719
|
-
updatePosition({
|
|
12720
|
-
id: item.id,
|
|
12721
|
-
node,
|
|
12722
|
-
offset
|
|
12723
|
-
});
|
|
12724
|
-
});
|
|
12725
|
-
}
|
|
12726
|
-
);
|
|
12727
|
-
const removeOnDragDrop = interactionTarget.on("drop", (params) => {
|
|
12728
|
-
const {
|
|
12729
|
-
sortedIndexes,
|
|
12730
|
-
dragIndex,
|
|
12731
|
-
dropIndex,
|
|
12732
|
-
dragItem,
|
|
12733
|
-
items,
|
|
12734
|
-
dragSourceListId: dragSourceListId2,
|
|
12735
|
-
dropTargetListId: dropTargetListId2,
|
|
12736
|
-
outside,
|
|
12737
|
-
status: status2
|
|
12738
|
-
} = params;
|
|
12739
|
-
const dragItems = getDragItems();
|
|
12740
|
-
dragItemsRef.current = [];
|
|
12741
|
-
const onAcceptDrop = getOnAcceptDrop();
|
|
12742
|
-
const onRemove = getOnRemove();
|
|
12743
|
-
const onDrop = getOnDrop();
|
|
12744
|
-
const updatePosition = getUpdatePosition();
|
|
12745
|
-
items.forEach((item, index) => {
|
|
12746
|
-
const node = dragItems[index];
|
|
12747
|
-
if (!node) {
|
|
12748
|
-
return;
|
|
12749
|
-
}
|
|
12750
|
-
updatePosition({
|
|
12751
|
-
id: item.id,
|
|
12752
|
-
node,
|
|
12753
|
-
offset: null
|
|
12754
|
-
});
|
|
12755
|
-
});
|
|
12756
|
-
cleanupProxy(proxyStateRef);
|
|
12757
|
-
setDragProxyRenderState((prev) => {
|
|
12758
|
-
if (!prev) return prev;
|
|
12759
|
-
requestAnimationFrame(() => setDragProxyRenderState(null));
|
|
12760
|
-
return { ...prev, dragItemId: null };
|
|
12761
|
-
});
|
|
12762
|
-
const accepted = status2 === "accepted";
|
|
12763
|
-
if (dragListId === dropTargetListId2 && dragSourceListId2 !== dragListId) {
|
|
12764
|
-
if (onAcceptDrop && accepted) {
|
|
12765
|
-
onAcceptDrop({
|
|
12766
|
-
dragItemId: dragItem.id,
|
|
12767
|
-
dragSourceListId: dragSourceListId2,
|
|
12768
|
-
dropTargetListId: dropTargetListId2,
|
|
12769
|
-
dragIndex,
|
|
12770
|
-
dropIndex,
|
|
12771
|
-
dropItemId: items[dropIndex]?.id
|
|
12772
|
-
});
|
|
12773
|
-
}
|
|
12774
|
-
}
|
|
12775
|
-
let callbackFn = null;
|
|
12776
|
-
if (dropIndex === -1 && dragSourceListId2 === dragListId && dropTargetListId2 === dragListId && outside) {
|
|
12777
|
-
callbackFn = onRemove;
|
|
12778
|
-
}
|
|
12779
|
-
if (dropIndex !== -1 && dropTargetListId2 === dragListId && dragSourceListId2 === dragListId) {
|
|
12780
|
-
callbackFn = onDrop;
|
|
12781
|
-
}
|
|
12782
|
-
if (callbackFn) {
|
|
12783
|
-
callbackFn?.(sortedIndexes, {
|
|
12784
|
-
dragIndex,
|
|
12785
|
-
dropIndex,
|
|
12786
|
-
dragItemId: items[dragIndex].id,
|
|
12787
|
-
dropItemId: items[dropIndex]?.id
|
|
12788
|
-
});
|
|
12789
|
-
}
|
|
13222
|
+
return bindInteractionTarget(interactionTarget, {
|
|
13223
|
+
dragListId: props.dragListId,
|
|
13224
|
+
orientation: props.orientation,
|
|
13225
|
+
domRef,
|
|
13226
|
+
proxyStateRef,
|
|
13227
|
+
sourceScrollOffsetRef,
|
|
13228
|
+
dragItemsRef,
|
|
13229
|
+
getDragItems,
|
|
13230
|
+
getOnDrop,
|
|
13231
|
+
getOnAcceptDrop,
|
|
13232
|
+
getOnRemove,
|
|
13233
|
+
getUpdatePosition,
|
|
13234
|
+
updateDragOperationSourceAndTarget,
|
|
13235
|
+
updateDragProxyRenderState: setDragProxyRenderState
|
|
12790
13236
|
});
|
|
12791
|
-
let targetAutoScroller = null;
|
|
12792
|
-
let targetScrollContainer = null;
|
|
12793
|
-
let targetScrollHandler = null;
|
|
12794
|
-
let targetPointermoveHandler = null;
|
|
12795
|
-
if (!interactionTarget.getData().initial && domRef.current) {
|
|
12796
|
-
targetAutoScroller = new AutoScroller({
|
|
12797
|
-
orientation: props.orientation,
|
|
12798
|
-
onScroll: () => {
|
|
12799
|
-
}
|
|
12800
|
-
});
|
|
12801
|
-
targetAutoScroller.start(domRef.current);
|
|
12802
|
-
targetScrollContainer = targetAutoScroller.getScrollContainer();
|
|
12803
|
-
if (targetScrollContainer) {
|
|
12804
|
-
let lastScroll = props.orientation === "vertical" ? targetScrollContainer.scrollTop : targetScrollContainer.scrollLeft;
|
|
12805
|
-
targetScrollHandler = () => {
|
|
12806
|
-
const current = props.orientation === "vertical" ? targetScrollContainer.scrollTop : targetScrollContainer.scrollLeft;
|
|
12807
|
-
const delta = current - lastScroll;
|
|
12808
|
-
lastScroll = current;
|
|
12809
|
-
if (delta !== 0) {
|
|
12810
|
-
interactionTarget.adjustForScroll(delta);
|
|
12811
|
-
DragManager.retriggerMove();
|
|
12812
|
-
}
|
|
12813
|
-
};
|
|
12814
|
-
targetScrollContainer.addEventListener("scroll", targetScrollHandler);
|
|
12815
|
-
}
|
|
12816
|
-
targetPointermoveHandler = (e) => {
|
|
12817
|
-
targetAutoScroller.updatePointer({
|
|
12818
|
-
left: e.clientX,
|
|
12819
|
-
top: e.clientY
|
|
12820
|
-
});
|
|
12821
|
-
};
|
|
12822
|
-
getGlobal().addEventListener("pointermove", targetPointermoveHandler);
|
|
12823
|
-
}
|
|
12824
|
-
return () => {
|
|
12825
|
-
removeOnDragStart();
|
|
12826
|
-
removeOnDragMove();
|
|
12827
|
-
removeOnDragDrop();
|
|
12828
|
-
if (targetAutoScroller) {
|
|
12829
|
-
targetAutoScroller.stop();
|
|
12830
|
-
}
|
|
12831
|
-
if (targetScrollContainer && targetScrollHandler) {
|
|
12832
|
-
targetScrollContainer.removeEventListener(
|
|
12833
|
-
"scroll",
|
|
12834
|
-
targetScrollHandler
|
|
12835
|
-
);
|
|
12836
|
-
}
|
|
12837
|
-
if (targetPointermoveHandler) {
|
|
12838
|
-
getGlobal().removeEventListener(
|
|
12839
|
-
"pointermove",
|
|
12840
|
-
targetPointermoveHandler
|
|
12841
|
-
);
|
|
12842
|
-
}
|
|
12843
|
-
};
|
|
12844
13237
|
}
|
|
12845
13238
|
return void 0;
|
|
12846
13239
|
}, [interactionTarget, props.dragListId]);
|
|
12847
13240
|
const dragItemsRef = React31.useRef([]);
|
|
12848
13241
|
const getDragItems = useCallback17(() => {
|
|
12849
|
-
|
|
12850
|
-
if (!dragItems || dragItems.length === 0) {
|
|
12851
|
-
dragItems = getDraggableItemNodes(domRef, props.dragListId);
|
|
12852
|
-
dragItemsRef.current = dragItems;
|
|
12853
|
-
}
|
|
12854
|
-
return dragItems;
|
|
13242
|
+
return getDragItemNodes(dragItemsRef, domRef, props.dragListId);
|
|
12855
13243
|
}, [props.dragListId]);
|
|
12856
13244
|
const onDragItemPointerDown = useCallback17(
|
|
12857
13245
|
(e) => {
|
|
12858
|
-
|
|
12859
|
-
let dragItemId2 = target.getAttribute(DRAG_ITEM_ATTRIBUTE);
|
|
12860
|
-
if (dragItemId2 == null) {
|
|
12861
|
-
const parentDragItem = selectParent(target, DRAG_ITEM_SELECTOR);
|
|
12862
|
-
if (parentDragItem) {
|
|
12863
|
-
dragItemId2 = parentDragItem.getAttribute(DRAG_ITEM_ATTRIBUTE);
|
|
12864
|
-
}
|
|
12865
|
-
}
|
|
12866
|
-
if (dragItemId2 == null) {
|
|
12867
|
-
console.warn(
|
|
12868
|
-
`Could not find drag item id for element`,
|
|
12869
|
-
target,
|
|
12870
|
-
`Make sure you have a parent element with a ${DRAG_ITEM_ATTRIBUTE} attribute`
|
|
12871
|
-
);
|
|
12872
|
-
return;
|
|
12873
|
-
}
|
|
12874
|
-
dragItemId2 = `${dragItemId2}`;
|
|
12875
|
-
let dragOperation = null;
|
|
12876
|
-
const dragItems = getDraggableItemNodes(domRef, props.dragListId);
|
|
12877
|
-
dragItemsRef.current = dragItems;
|
|
12878
|
-
const interactionTarget2 = createInteractionTarget({
|
|
13246
|
+
startDragOnPointerDown(e, props, {
|
|
12879
13247
|
domRef,
|
|
12880
|
-
|
|
12881
|
-
|
|
12882
|
-
|
|
12883
|
-
|
|
12884
|
-
|
|
13248
|
+
proxyStateRef,
|
|
13249
|
+
sourceScrollOffsetRef,
|
|
13250
|
+
dragItemsRef,
|
|
13251
|
+
setInteractionTarget,
|
|
13252
|
+
updateDragProxyRenderState: setDragProxyRenderState
|
|
12885
13253
|
});
|
|
12886
|
-
const draggableItems = interactionTarget2.getData().draggableItems;
|
|
12887
|
-
const dragIndex = draggableItems.findIndex(
|
|
12888
|
-
(item) => item.id === dragItemId2
|
|
12889
|
-
);
|
|
12890
|
-
if (dragIndex === -1) {
|
|
12891
|
-
return;
|
|
12892
|
-
}
|
|
12893
|
-
const dragItem = draggableItems[dragIndex];
|
|
12894
|
-
const dragItemNode = dragItems[dragIndex]?.getAttribute(DRAG_ITEM_ATTRIBUTE) === `${dragItemId2}` ? dragItems[dragIndex] : dragItems.find(
|
|
12895
|
-
(node) => node.getAttribute(DRAG_ITEM_ATTRIBUTE) === `${dragItemId2}`
|
|
12896
|
-
);
|
|
12897
|
-
setInteractionTarget(interactionTarget2);
|
|
12898
|
-
const initialCoords = {
|
|
12899
|
-
left: e.clientX,
|
|
12900
|
-
top: e.clientY
|
|
12901
|
-
};
|
|
12902
|
-
let lastPointer = { left: e.clientX, top: e.clientY };
|
|
12903
|
-
sourceScrollOffsetRef.current = { top: 0, left: 0 };
|
|
12904
|
-
const autoScroller = new AutoScroller({
|
|
12905
|
-
orientation: props.orientation,
|
|
12906
|
-
onScroll: () => {
|
|
12907
|
-
}
|
|
12908
|
-
});
|
|
12909
|
-
if (domRef.current) {
|
|
12910
|
-
autoScroller.start(domRef.current);
|
|
12911
|
-
}
|
|
12912
|
-
const scrollContainer = autoScroller.getScrollContainer();
|
|
12913
|
-
let lastSourceScroll = scrollContainer ? props.orientation === "vertical" ? scrollContainer.scrollTop : scrollContainer.scrollLeft : 0;
|
|
12914
|
-
function fireDragMove() {
|
|
12915
|
-
if (!dragOperation) return;
|
|
12916
|
-
dragOperation.move({
|
|
12917
|
-
left: lastPointer.left,
|
|
12918
|
-
top: lastPointer.top
|
|
12919
|
-
});
|
|
12920
|
-
}
|
|
12921
|
-
const onContainerScroll = () => {
|
|
12922
|
-
if (!scrollContainer) return;
|
|
12923
|
-
const current = props.orientation === "vertical" ? scrollContainer.scrollTop : scrollContainer.scrollLeft;
|
|
12924
|
-
const delta = current - lastSourceScroll;
|
|
12925
|
-
lastSourceScroll = current;
|
|
12926
|
-
if (delta !== 0) {
|
|
12927
|
-
interactionTarget2.adjustForScroll(delta);
|
|
12928
|
-
if (props.orientation === "vertical") {
|
|
12929
|
-
sourceScrollOffsetRef.current.top += delta;
|
|
12930
|
-
} else {
|
|
12931
|
-
sourceScrollOffsetRef.current.left += delta;
|
|
12932
|
-
}
|
|
12933
|
-
}
|
|
12934
|
-
fireDragMove();
|
|
12935
|
-
};
|
|
12936
|
-
scrollContainer?.addEventListener("scroll", onContainerScroll);
|
|
12937
|
-
const dragStrategy = props.dragStrategy ?? "proxy";
|
|
12938
|
-
const useProxy = dragStrategy === "proxy" && !props.renderDragProxy;
|
|
12939
|
-
const useRenderProxy = dragStrategy === "proxy" && !!props.renderDragProxy;
|
|
12940
|
-
const proxyMove = props.onDragProxyMove ?? defaultDragProxyMove;
|
|
12941
|
-
const onPointerMove = (e2) => {
|
|
12942
|
-
lastPointer = { left: e2.clientX, top: e2.clientY };
|
|
12943
|
-
if (!dragOperation) {
|
|
12944
|
-
dragOperation = DragManager.startDrag(
|
|
12945
|
-
{
|
|
12946
|
-
listId: props.dragListId,
|
|
12947
|
-
dragItem,
|
|
12948
|
-
dragIndex
|
|
12949
|
-
},
|
|
12950
|
-
initialCoords
|
|
12951
|
-
);
|
|
12952
|
-
if (dragItemNode && useProxy) {
|
|
12953
|
-
const rect = dragItemNode.getBoundingClientRect();
|
|
12954
|
-
let cachedProxy = null;
|
|
12955
|
-
const setupParams = {
|
|
12956
|
-
dragItemNode,
|
|
12957
|
-
dragItemId: `${dragItemId2}`,
|
|
12958
|
-
initialRect: rect,
|
|
12959
|
-
initialCoords,
|
|
12960
|
-
get proxyElement() {
|
|
12961
|
-
if (!cachedProxy) {
|
|
12962
|
-
cachedProxy = createDefaultProxy(dragItemNode, rect);
|
|
12963
|
-
}
|
|
12964
|
-
return cachedProxy;
|
|
12965
|
-
}
|
|
12966
|
-
};
|
|
12967
|
-
const setupResult = props.onDragProxySetup?.(setupParams);
|
|
12968
|
-
const proxyElement = setupResult?.proxyElement ?? setupParams.proxyElement;
|
|
12969
|
-
dragItemNode.style.visibility = "hidden";
|
|
12970
|
-
proxyStateRef.current = {
|
|
12971
|
-
proxyElement,
|
|
12972
|
-
originalNode: dragItemNode,
|
|
12973
|
-
dragItemId: `${dragItemId2}`,
|
|
12974
|
-
initialRect: rect,
|
|
12975
|
-
cleanup: setupResult?.cleanup
|
|
12976
|
-
};
|
|
12977
|
-
}
|
|
12978
|
-
if (dragItemNode && useRenderProxy) {
|
|
12979
|
-
const rect = dragItemNode.getBoundingClientRect();
|
|
12980
|
-
dragItemNode.style.visibility = "hidden";
|
|
12981
|
-
proxyStateRef.current = {
|
|
12982
|
-
proxyElement: dragItemNode,
|
|
12983
|
-
originalNode: dragItemNode,
|
|
12984
|
-
dragItemId: `${dragItemId2}`,
|
|
12985
|
-
initialRect: rect,
|
|
12986
|
-
// Portal handles its own DOM; only restore visibility.
|
|
12987
|
-
cleanup: () => {
|
|
12988
|
-
}
|
|
12989
|
-
};
|
|
12990
|
-
setDragProxyRenderState({
|
|
12991
|
-
dragItemId: `${dragItemId2}`,
|
|
12992
|
-
initialRect: rect,
|
|
12993
|
-
dx: 0,
|
|
12994
|
-
dy: 0
|
|
12995
|
-
});
|
|
12996
|
-
}
|
|
12997
|
-
}
|
|
12998
|
-
const dx = e2.clientX - initialCoords.left;
|
|
12999
|
-
const dy = e2.clientY - initialCoords.top;
|
|
13000
|
-
if (useRenderProxy) {
|
|
13001
|
-
setDragProxyRenderState(
|
|
13002
|
-
(prev) => prev ? { ...prev, dx, dy } : prev
|
|
13003
|
-
);
|
|
13004
|
-
} else {
|
|
13005
|
-
const proxyState = proxyStateRef.current;
|
|
13006
|
-
if (proxyState) {
|
|
13007
|
-
proxyMove({ proxyElement: proxyState.proxyElement, dx, dy });
|
|
13008
|
-
}
|
|
13009
|
-
}
|
|
13010
|
-
autoScroller.updatePointer({
|
|
13011
|
-
left: e2.clientX,
|
|
13012
|
-
top: e2.clientY
|
|
13013
|
-
});
|
|
13014
|
-
fireDragMove();
|
|
13015
|
-
};
|
|
13016
|
-
const onPointerUp = () => {
|
|
13017
|
-
autoScroller.stop();
|
|
13018
|
-
scrollContainer?.removeEventListener("scroll", onContainerScroll);
|
|
13019
|
-
getGlobal().removeEventListener("pointermove", onPointerMove);
|
|
13020
|
-
if (useRenderProxy) {
|
|
13021
|
-
setDragProxyRenderState(
|
|
13022
|
-
(prev) => prev ? { ...prev, dragItemId: null } : prev
|
|
13023
|
-
);
|
|
13024
|
-
requestAnimationFrame(() => {
|
|
13025
|
-
setDragProxyRenderState(null);
|
|
13026
|
-
});
|
|
13027
|
-
}
|
|
13028
|
-
if (!dragOperation) {
|
|
13029
|
-
cleanupProxy(proxyStateRef);
|
|
13030
|
-
setInteractionTarget(null);
|
|
13031
|
-
return;
|
|
13032
|
-
}
|
|
13033
|
-
dragOperation.drop();
|
|
13034
|
-
dragOperation = null;
|
|
13035
|
-
};
|
|
13036
|
-
getGlobal().addEventListener("pointermove", onPointerMove);
|
|
13037
|
-
getGlobal().addEventListener("pointerup", onPointerUp, { once: true });
|
|
13038
13254
|
},
|
|
13039
13255
|
[
|
|
13040
13256
|
props.orientation,
|
|
@@ -13084,10 +13300,6 @@ var DragList = (props) => {
|
|
|
13084
13300
|
ref: proxyRefCallback
|
|
13085
13301
|
}) : null);
|
|
13086
13302
|
};
|
|
13087
|
-
var DRAG_LIST_ATTRIBUTE = "data-drag-list-id";
|
|
13088
|
-
var DRAG_ITEM_ATTRIBUTE = "data-drag-item-id";
|
|
13089
|
-
var DRAG_ITEM_LIST_ATTRIBUTE = "data-drag-item-list-id";
|
|
13090
|
-
var DRAG_ITEM_SELECTOR = `[${DRAG_ITEM_ATTRIBUTE}]`;
|
|
13091
13303
|
var DragItemContext = React31.createContext({
|
|
13092
13304
|
dragItemId: "",
|
|
13093
13305
|
dragListId: "",
|
|
@@ -13147,7 +13359,7 @@ DragList.DraggableItem = DraggableItem;
|
|
|
13147
13359
|
// src/components/InfiniteTable/components/icons/HiddenIcon.tsx
|
|
13148
13360
|
import * as React32 from "react";
|
|
13149
13361
|
var HiddenIcon = (props) => {
|
|
13150
|
-
return /* @__PURE__ */ React32.createElement(Icon, { ...props, viewBox: "0 -960 960 960" }, /* @__PURE__ */ React32.createElement("path", { d: iconPaths.hidden[0] }));
|
|
13362
|
+
return /* @__PURE__ */ React32.createElement(Icon, { ...props, icon: "hidden", viewBox: "0 -960 960 960" }, /* @__PURE__ */ React32.createElement("path", { d: iconPaths.hidden[0] }));
|
|
13151
13363
|
};
|
|
13152
13364
|
|
|
13153
13365
|
// src/components/InfiniteTable/components/InfiniteTablePublicHeader/index.tsx
|
|
@@ -14501,13 +14713,13 @@ var MatrixBrain = class extends Logger {
|
|
|
14501
14713
|
* transforms that follow the scroll position should use.
|
|
14502
14714
|
*/
|
|
14503
14715
|
getDOMScrollPosition(scrollPosition = this.getScrollPosition()) {
|
|
14504
|
-
const
|
|
14505
|
-
if (!
|
|
14716
|
+
const origin = this.getScrollOrigin();
|
|
14717
|
+
if (!origin.scrollTop && !origin.scrollLeft) {
|
|
14506
14718
|
return scrollPosition;
|
|
14507
14719
|
}
|
|
14508
14720
|
return {
|
|
14509
|
-
scrollTop: scrollPosition.scrollTop -
|
|
14510
|
-
scrollLeft: scrollPosition.scrollLeft -
|
|
14721
|
+
scrollTop: scrollPosition.scrollTop - origin.scrollTop,
|
|
14722
|
+
scrollLeft: scrollPosition.scrollLeft - origin.scrollLeft
|
|
14511
14723
|
};
|
|
14512
14724
|
}
|
|
14513
14725
|
// a method (not an arrow property) so subclasses can call it via super
|
|
@@ -14541,8 +14753,8 @@ var MatrixBrain = class extends Logger {
|
|
|
14541
14753
|
if (this.destroyed) {
|
|
14542
14754
|
return;
|
|
14543
14755
|
}
|
|
14544
|
-
const
|
|
14545
|
-
this.onScrollOriginChangeFns.forEach((fn) => fn(
|
|
14756
|
+
const origin = this.getScrollOrigin();
|
|
14757
|
+
this.onScrollOriginChangeFns.forEach((fn) => fn(origin));
|
|
14546
14758
|
}
|
|
14547
14759
|
doUpdateRenderCount(which = ALL_DIRECTIONS) {
|
|
14548
14760
|
if (!this.availableWidth || !this.availableHeight) {
|
|
@@ -18091,11 +18303,12 @@ function InfiniteTableInternalHeaderFn(props) {
|
|
|
18091
18303
|
dataSourceStatePartialForHeaderCell
|
|
18092
18304
|
]
|
|
18093
18305
|
);
|
|
18306
|
+
const headerDragListId = useDragListId(HEADER_DRAG_LIST_NAME);
|
|
18094
18307
|
return /* @__PURE__ */ React46.createElement(
|
|
18095
18308
|
DragList,
|
|
18096
18309
|
{
|
|
18097
18310
|
orientation: "horizontal",
|
|
18098
|
-
dragListId:
|
|
18311
|
+
dragListId: headerDragListId,
|
|
18099
18312
|
dragStrategy: "inline",
|
|
18100
18313
|
onDrop: emptyFn3,
|
|
18101
18314
|
updatePosition: emptyFn3
|
|
@@ -18365,7 +18578,7 @@ function InfiniteTableHeaderCellFn(props) {
|
|
|
18365
18578
|
filterDelay
|
|
18366
18579
|
} = props;
|
|
18367
18580
|
const { allRowsSelected, someRowsSelected, selectionMode } = dataSourceStatePartialForHeaderCell;
|
|
18368
|
-
const { onDragItemPointerDown } = useDragListContext();
|
|
18581
|
+
const { onDragItemPointerDown, dragListId } = useDragListContext();
|
|
18369
18582
|
const {
|
|
18370
18583
|
api,
|
|
18371
18584
|
getComputed,
|
|
@@ -18664,7 +18877,7 @@ function InfiniteTableHeaderCellFn(props) {
|
|
|
18664
18877
|
"data-field": `${column.field || ""}`,
|
|
18665
18878
|
"data-column-id": column.id,
|
|
18666
18879
|
[DRAG_ITEM_ATTRIBUTE]: column.id,
|
|
18667
|
-
[DRAG_ITEM_LIST_ATTRIBUTE]:
|
|
18880
|
+
[DRAG_ITEM_LIST_ATTRIBUTE]: dragListId,
|
|
18668
18881
|
"data-header-align": align2,
|
|
18669
18882
|
"data-name": "HeaderCell",
|
|
18670
18883
|
"data-sort": column.computedSortedAsc ? "asc" : column.computedSortedDesc ? "desc" : "none",
|
|
@@ -18795,25 +19008,40 @@ function decamelize(str, options) {
|
|
|
18795
19008
|
).toLowerCase();
|
|
18796
19009
|
}
|
|
18797
19010
|
|
|
18798
|
-
// src/components/InfiniteTable/components/InfiniteTableLicenseFooter/
|
|
18799
|
-
var
|
|
19011
|
+
// src/components/InfiniteTable/components/InfiniteTableLicenseFooter/licenseFooterShared.ts
|
|
19012
|
+
var LICENSE_FOOTER_LINK = "https://infinite-table.com";
|
|
19013
|
+
var LICENSE_FOOTER_INVALID_MESSAGE = "Invalid Infinite Table license. See console for details.";
|
|
19014
|
+
var baseFooterStyle = {
|
|
18800
19015
|
padding: ThemeVars.spacing[2],
|
|
18801
19016
|
textAlign: "end",
|
|
18802
19017
|
opacity: "1",
|
|
18803
19018
|
visibility: "visible",
|
|
18804
19019
|
display: "block",
|
|
18805
|
-
fontSize: "0.85rem"
|
|
19020
|
+
fontSize: "0.85rem"
|
|
19021
|
+
};
|
|
19022
|
+
var missingFooterStyle = {
|
|
19023
|
+
...baseFooterStyle,
|
|
18806
19024
|
background: "white",
|
|
18807
19025
|
color: "black"
|
|
18808
19026
|
};
|
|
18809
|
-
var
|
|
18810
|
-
|
|
19027
|
+
var invalidFooterStyle = {
|
|
19028
|
+
...baseFooterStyle,
|
|
19029
|
+
// pale red, with dark red text
|
|
19030
|
+
background: "#fee2e2",
|
|
19031
|
+
color: "#991b1b"
|
|
19032
|
+
};
|
|
19033
|
+
var baseAnchorStyle = {
|
|
19034
|
+
opacity: "1",
|
|
18811
19035
|
visibility: "visible",
|
|
18812
19036
|
display: "inline-block",
|
|
18813
19037
|
pointerEvents: "all",
|
|
18814
|
-
color: "black",
|
|
18815
19038
|
textDecoration: "underline"
|
|
18816
19039
|
};
|
|
19040
|
+
var missingAnchorStyle = { ...baseAnchorStyle, color: "black" };
|
|
19041
|
+
var invalidAnchorStyle = { ...baseAnchorStyle, color: "#991b1b" };
|
|
19042
|
+
function getLicenseFooterStyles(invalid) {
|
|
19043
|
+
return invalid ? { footer: invalidFooterStyle, anchor: invalidAnchorStyle } : { footer: missingFooterStyle, anchor: missingAnchorStyle };
|
|
19044
|
+
}
|
|
18817
19045
|
var enforceStyle = (node, style2) => {
|
|
18818
19046
|
if (!node) {
|
|
18819
19047
|
return;
|
|
@@ -18826,8 +19054,26 @@ var enforceStyle = (node, style2) => {
|
|
|
18826
19054
|
);
|
|
18827
19055
|
}
|
|
18828
19056
|
};
|
|
19057
|
+
function enforceLicenseFooterStyle(getNode, invalid) {
|
|
19058
|
+
const styles = getLicenseFooterStyles(invalid);
|
|
19059
|
+
const forceStyle = () => {
|
|
19060
|
+
setTimeout(() => {
|
|
19061
|
+
const node = getNode();
|
|
19062
|
+
enforceStyle(node, styles.footer);
|
|
19063
|
+
enforceStyle(node?.querySelector("a") ?? null, styles.anchor);
|
|
19064
|
+
});
|
|
19065
|
+
};
|
|
19066
|
+
forceStyle();
|
|
19067
|
+
const intervalId = setInterval(forceStyle, 1e3);
|
|
19068
|
+
return () => {
|
|
19069
|
+
clearInterval(intervalId);
|
|
19070
|
+
};
|
|
19071
|
+
}
|
|
19072
|
+
|
|
19073
|
+
// src/components/InfiniteTable/components/InfiniteTableLicenseFooter/index.tsx
|
|
18829
19074
|
var InfiniteTableLicenseFooter = React50.forwardRef(
|
|
18830
19075
|
function InfiniteTableLicenseFooter2(props, ref) {
|
|
19076
|
+
const { invalid = false, ...domProps } = props;
|
|
18831
19077
|
const { rootClassName: rootClassName12 } = useInternalProps();
|
|
18832
19078
|
const domRef = React50.useRef(null);
|
|
18833
19079
|
const domCallback = React50.useCallback((node) => {
|
|
@@ -18842,42 +19088,33 @@ var InfiniteTableLicenseFooter = React50.forwardRef(
|
|
|
18842
19088
|
}
|
|
18843
19089
|
}, []);
|
|
18844
19090
|
useEffect18(() => {
|
|
18845
|
-
|
|
18846
|
-
|
|
18847
|
-
|
|
18848
|
-
enforceStyle(
|
|
18849
|
-
domRef.current?.firstElementChild,
|
|
18850
|
-
anchorStyle
|
|
18851
|
-
);
|
|
18852
|
-
});
|
|
18853
|
-
};
|
|
18854
|
-
forceStyle();
|
|
18855
|
-
const intervalId = setInterval(forceStyle, 1e3);
|
|
18856
|
-
return () => {
|
|
18857
|
-
clearInterval(intervalId);
|
|
18858
|
-
};
|
|
18859
|
-
}, []);
|
|
19091
|
+
return enforceLicenseFooterStyle(() => domRef.current, invalid);
|
|
19092
|
+
}, [invalid]);
|
|
19093
|
+
const styles = getLicenseFooterStyles(invalid);
|
|
18860
19094
|
return /* @__PURE__ */ React50.createElement(
|
|
18861
19095
|
"div",
|
|
18862
19096
|
{
|
|
18863
19097
|
ref: domCallback,
|
|
18864
|
-
...
|
|
19098
|
+
...domProps,
|
|
18865
19099
|
className: join(
|
|
18866
19100
|
`${rootClassName12}-Footer`,
|
|
19101
|
+
invalid ? `${rootClassName12}-Footer--invalid` : null,
|
|
18867
19102
|
FooterCls,
|
|
18868
|
-
|
|
19103
|
+
domProps.className
|
|
18869
19104
|
),
|
|
18870
|
-
style:
|
|
19105
|
+
style: styles.footer
|
|
18871
19106
|
},
|
|
19107
|
+
invalid ? `${LICENSE_FOOTER_INVALID_MESSAGE} ` : null,
|
|
18872
19108
|
"Powered by",
|
|
18873
19109
|
" ",
|
|
18874
19110
|
/* @__PURE__ */ React50.createElement(
|
|
18875
19111
|
"a",
|
|
18876
19112
|
{
|
|
18877
|
-
href:
|
|
19113
|
+
href: LICENSE_FOOTER_LINK,
|
|
18878
19114
|
rel: "noopener noreferrer",
|
|
18879
19115
|
role: "link",
|
|
18880
|
-
target: "_blank"
|
|
19116
|
+
target: "_blank",
|
|
19117
|
+
style: styles.anchor
|
|
18881
19118
|
},
|
|
18882
19119
|
"Infinite Table"
|
|
18883
19120
|
)
|
|
@@ -22211,10 +22448,47 @@ function treeTraverse(treeParams, traverseOptions, data) {
|
|
|
22211
22448
|
var numberComparator = function(first, second) {
|
|
22212
22449
|
return first - second;
|
|
22213
22450
|
};
|
|
22451
|
+
var LOCALES_WITH_FAST_LOCALE_COMPARE = /* @__PURE__ */ new Set([
|
|
22452
|
+
"ca",
|
|
22453
|
+
"de",
|
|
22454
|
+
"de-AT",
|
|
22455
|
+
"en",
|
|
22456
|
+
"en-DE",
|
|
22457
|
+
"en-GB",
|
|
22458
|
+
"en-US",
|
|
22459
|
+
"fi",
|
|
22460
|
+
"fr",
|
|
22461
|
+
"id",
|
|
22462
|
+
"id-ID",
|
|
22463
|
+
"it",
|
|
22464
|
+
"ms",
|
|
22465
|
+
"nl",
|
|
22466
|
+
"pl",
|
|
22467
|
+
"pt",
|
|
22468
|
+
"ro",
|
|
22469
|
+
"sl",
|
|
22470
|
+
"sv",
|
|
22471
|
+
"sw",
|
|
22472
|
+
"vi"
|
|
22473
|
+
]);
|
|
22474
|
+
var collator;
|
|
22475
|
+
function getCollator() {
|
|
22476
|
+
try {
|
|
22477
|
+
const defaultCollator = new Intl.Collator();
|
|
22478
|
+
return LOCALES_WITH_FAST_LOCALE_COMPARE.has(
|
|
22479
|
+
defaultCollator.resolvedOptions().locale
|
|
22480
|
+
) ? null : defaultCollator;
|
|
22481
|
+
} catch (ex) {
|
|
22482
|
+
return null;
|
|
22483
|
+
}
|
|
22484
|
+
}
|
|
22214
22485
|
var stringComparator = function(first, second) {
|
|
22215
22486
|
first = `${first}`;
|
|
22216
22487
|
second = `${second}`;
|
|
22217
|
-
|
|
22488
|
+
if (collator === void 0) {
|
|
22489
|
+
collator = getCollator();
|
|
22490
|
+
}
|
|
22491
|
+
return collator ? collator.compare(first, second) : first.localeCompare(second);
|
|
22218
22492
|
};
|
|
22219
22493
|
var dateComparator = function(first, second) {
|
|
22220
22494
|
return first - second;
|
|
@@ -25805,6 +26079,7 @@ function concludeReducer(params) {
|
|
|
25805
26079
|
} else {
|
|
25806
26080
|
state.groupDeepMap = void 0;
|
|
25807
26081
|
state.pivotColumns = void 0;
|
|
26082
|
+
state.pivotColumnGroups = void 0;
|
|
25808
26083
|
state.groupRowsIndexesInDataArray = void 0;
|
|
25809
26084
|
const arrayDifferentAfterSortStep = previousState.postSortDataArray != state.postSortDataArray;
|
|
25810
26085
|
if (arrayDifferentAfterSortStep || groupsDepsChanged || selectionDepsChanged || rowDisabledStateDepsChanged || rowInfoReducersChanged) {
|
|
@@ -26858,6 +27133,46 @@ var ScrollListener = class {
|
|
|
26858
27133
|
}
|
|
26859
27134
|
};
|
|
26860
27135
|
|
|
27136
|
+
// src/components/InfiniteTable/utils/toCSSVarName.ts
|
|
27137
|
+
var toCSSVarName = (value) => `--infinite-${value}`;
|
|
27138
|
+
|
|
27139
|
+
// src/components/InfiniteTable/shared.ts
|
|
27140
|
+
var DEFAULT_ROW_HEIGHT = 40;
|
|
27141
|
+
var DEFAULT_COLUMN_HEADER_HEIGHT = toCSSVarName(
|
|
27142
|
+
columnHeaderHeightName
|
|
27143
|
+
);
|
|
27144
|
+
var DENSITY_SCALE = `var(${toCSSVarName("density-scale")}, 1)`;
|
|
27145
|
+
var DEFAULT_ROW_HEIGHT_CSS_VALUE = `calc(var(${toCSSVarName(
|
|
27146
|
+
"row-height"
|
|
27147
|
+
)}, ${DEFAULT_ROW_HEIGHT}px) * ${DENSITY_SCALE})`;
|
|
27148
|
+
var DEFAULT_COLUMN_HEADER_HEIGHT_CSS_VALUE = `calc(var(${DEFAULT_COLUMN_HEADER_HEIGHT}) * ${DENSITY_SCALE})`;
|
|
27149
|
+
function getRowHeightFromCSSValue(value, state) {
|
|
27150
|
+
if (!value) {
|
|
27151
|
+
return null;
|
|
27152
|
+
}
|
|
27153
|
+
if (state.rowHeightCSSVar !== DEFAULT_ROW_HEIGHT_CSS_VALUE) {
|
|
27154
|
+
return value;
|
|
27155
|
+
}
|
|
27156
|
+
if (!isThemeCSSLoaded()) {
|
|
27157
|
+
return null;
|
|
27158
|
+
}
|
|
27159
|
+
const rowHeight = Math.round(value);
|
|
27160
|
+
return rowHeight === state.rowHeight ? null : rowHeight;
|
|
27161
|
+
}
|
|
27162
|
+
var CSS_LOADED_VAR_NAME = toCSSVarName("loaded");
|
|
27163
|
+
function isThemeCSSLoaded() {
|
|
27164
|
+
if (typeof document === "undefined" || typeof getComputedStyle !== "function") {
|
|
27165
|
+
return false;
|
|
27166
|
+
}
|
|
27167
|
+
return getComputedStyle(document.documentElement).getPropertyValue(CSS_LOADED_VAR_NAME).trim() === CSS_LOADED_VALUE;
|
|
27168
|
+
}
|
|
27169
|
+
function getColumnHeaderHeightFromCSSValue(value, state) {
|
|
27170
|
+
if (!value) {
|
|
27171
|
+
return null;
|
|
27172
|
+
}
|
|
27173
|
+
return state.columnHeaderHeightCSSVar === DEFAULT_COLUMN_HEADER_HEIGHT_CSS_VALUE ? Math.round(value) : value;
|
|
27174
|
+
}
|
|
27175
|
+
|
|
26861
27176
|
// src/components/InfiniteTable/state/computeColumnGroupsDepths.ts
|
|
26862
27177
|
function computeColumnGroupsDepths(columnGroups, columnGroupVisibility) {
|
|
26863
27178
|
const map2 = /* @__PURE__ */ new Map();
|
|
@@ -27426,7 +27741,9 @@ var forwardProps4 = (_setupState) => {
|
|
|
27426
27741
|
pivotGrandTotalColumnPosition: 1,
|
|
27427
27742
|
// groupRenderStrategy: (groupRenderStrategy) =>
|
|
27428
27743
|
// groupRenderStrategy ?? 'multi-column',
|
|
27429
|
-
|
|
27744
|
+
// keep undefined - it means "use InfiniteTable.licenseKey", while an
|
|
27745
|
+
// empty string means "no license key"
|
|
27746
|
+
licenseKey: (licenseKey) => licenseKey,
|
|
27430
27747
|
keyboardSelection: (keyboardSelection) => keyboardSelection ?? true,
|
|
27431
27748
|
multiRowSelectionWith: (multiRowSelectionWith) => multiRowSelectionWith ?? "checkbox",
|
|
27432
27749
|
activeRowIndex: 1,
|
|
@@ -27436,7 +27753,12 @@ var forwardProps4 = (_setupState) => {
|
|
|
27436
27753
|
showZebraRows: (showZebraRows) => showZebraRows ?? true,
|
|
27437
27754
|
showHoverRows: (showHoverRows) => showHoverRows ?? true,
|
|
27438
27755
|
virtualizeColumns: (virtualizeColumns) => virtualizeColumns ?? true,
|
|
27439
|
-
rowHeight: (rowHeight) => typeof rowHeight === "number" || typeof rowHeight === "function" ? rowHeight :
|
|
27756
|
+
rowHeight: (rowHeight) => typeof rowHeight === "number" || typeof rowHeight === "function" ? rowHeight : (
|
|
27757
|
+
// when not specified, the row height comes from the theme (and density)
|
|
27758
|
+
// via a CSS watcher - but we start with the old default, so the first render
|
|
27759
|
+
// is the same as before
|
|
27760
|
+
rowHeight === DEFAULT_ROW_HEIGHT_CSS_VALUE ? DEFAULT_ROW_HEIGHT : 0
|
|
27761
|
+
),
|
|
27440
27762
|
rowDetailHeight: (rowDetailHeight) => typeof rowDetailHeight === "number" || typeof rowDetailHeight === "function" ? rowDetailHeight : 300,
|
|
27441
27763
|
columnHeaderHeight: (columnHeaderHeight) => typeof columnHeaderHeight === "number" ? columnHeaderHeight : 30,
|
|
27442
27764
|
columns: 1,
|
|
@@ -27524,8 +27846,10 @@ function getMappedCallbacks2() {
|
|
|
27524
27846
|
var mapPropsToState = (params) => {
|
|
27525
27847
|
const { props, state, oldState, parentState } = params;
|
|
27526
27848
|
const computedColumnGroups = state.pivotColumnGroups || state.columnGroups;
|
|
27527
|
-
const columnGroupsDepthsMap = state.columnGroups && state.columnGroups != oldState?.columnGroups || state.columnGroups && state.columnGroupVisibility != oldState?.columnGroupVisibility ||
|
|
27528
|
-
|
|
27849
|
+
const columnGroupsDepthsMap = state.columnGroups && state.columnGroups != oldState?.columnGroups || state.columnGroups && state.columnGroupVisibility != oldState?.columnGroupVisibility || // also when the pivot column groups go away, as the header has to go back
|
|
27850
|
+
// to the depth of `columnGroups` (or to a single row, when there are none)
|
|
27851
|
+
state.pivotColumnGroups != oldState?.pivotColumnGroups ? computeColumnGroupsDepths(
|
|
27852
|
+
computedColumnGroups ?? EMPTY_OBJECT,
|
|
27529
27853
|
state.columnGroupVisibility
|
|
27530
27854
|
) : state.columnGroupsDepthsMap;
|
|
27531
27855
|
const groupBy = parentState?.groupBy;
|
|
@@ -27592,7 +27916,10 @@ var mapPropsToState = (params) => {
|
|
|
27592
27916
|
computedColumnGroups,
|
|
27593
27917
|
rowHeightCSSVar: typeof props.rowHeight === "string" ? props.rowHeight : "",
|
|
27594
27918
|
rowDetailHeightCSSVar: typeof props.rowDetailHeight === "string" ? props.rowDetailHeight : "",
|
|
27595
|
-
columnHeaderHeightCSSVar: typeof props.columnHeaderHeight === "string" ? props.columnHeaderHeight ||
|
|
27919
|
+
columnHeaderHeightCSSVar: typeof props.columnHeaderHeight === "string" ? !props.columnHeaderHeight || props.columnHeaderHeight === DEFAULT_COLUMN_HEADER_HEIGHT ? (
|
|
27920
|
+
// the theme column header height, scaled by the density
|
|
27921
|
+
DEFAULT_COLUMN_HEADER_HEIGHT_CSS_VALUE
|
|
27922
|
+
) : props.columnHeaderHeight : ""
|
|
27596
27923
|
};
|
|
27597
27924
|
if (state.devToolsDetected && state.debugId) {
|
|
27598
27925
|
const devToolsOverrides = DEV_TOOLS_INFINITE_OVERRIDES.get(state.debugId);
|
|
@@ -27740,6 +28067,8 @@ var LoadingIcon = (props) => {
|
|
|
27740
28067
|
className: join(
|
|
27741
28068
|
props.className,
|
|
27742
28069
|
LoadingIconCls,
|
|
28070
|
+
IconCustomMaskCls.loading,
|
|
28071
|
+
LoadingIconSpinWhenCustomCls,
|
|
27743
28072
|
"InfiniteIcon",
|
|
27744
28073
|
"InfiniteIcon-loading"
|
|
27745
28074
|
)
|
|
@@ -28757,8 +29086,9 @@ function useComputed(options) {
|
|
|
28757
29086
|
};
|
|
28758
29087
|
});
|
|
28759
29088
|
useState20(() => {
|
|
28760
|
-
onRowHeightCSSVarChange.onChange((
|
|
28761
|
-
|
|
29089
|
+
onRowHeightCSSVarChange.onChange((value) => {
|
|
29090
|
+
const rowHeight2 = getRowHeightFromCSSValue(value, getState());
|
|
29091
|
+
if (rowHeight2 != null) {
|
|
28762
29092
|
componentActions.rowHeight = rowHeight2;
|
|
28763
29093
|
}
|
|
28764
29094
|
});
|
|
@@ -28773,8 +29103,12 @@ function useComputed(options) {
|
|
|
28773
29103
|
componentActions.rowDetailHeight = rowDetailHeight2;
|
|
28774
29104
|
}
|
|
28775
29105
|
});
|
|
28776
|
-
onColumnHeaderHeightCSSVarChange.onChange((
|
|
28777
|
-
|
|
29106
|
+
onColumnHeaderHeightCSSVarChange.onChange((value) => {
|
|
29107
|
+
const columnHeaderHeight = getColumnHeaderHeightFromCSSValue(
|
|
29108
|
+
value,
|
|
29109
|
+
getState()
|
|
29110
|
+
);
|
|
29111
|
+
if (columnHeaderHeight != null) {
|
|
28778
29112
|
componentActions.columnHeaderHeight = columnHeaderHeight;
|
|
28779
29113
|
}
|
|
28780
29114
|
});
|
|
@@ -29019,7 +29353,7 @@ var logLicenseError = (lines, fn = console.error.bind(console)) => {
|
|
|
29019
29353
|
});
|
|
29020
29354
|
fn("*".repeat(max));
|
|
29021
29355
|
};
|
|
29022
|
-
var
|
|
29356
|
+
var checkLicense = (licenseKey = "", packageInfo, fn) => {
|
|
29023
29357
|
let details;
|
|
29024
29358
|
try {
|
|
29025
29359
|
details = decode(licenseKey);
|
|
@@ -29032,7 +29366,7 @@ var isValidLicense = (licenseKey = "", packageInfo, fn) => {
|
|
|
29032
29366
|
],
|
|
29033
29367
|
fn
|
|
29034
29368
|
);
|
|
29035
|
-
return
|
|
29369
|
+
return "invalid";
|
|
29036
29370
|
}
|
|
29037
29371
|
const currentVersionReleaseDate = new Date(packageInfo.publishedAt);
|
|
29038
29372
|
const licenseEndDate = new Date(details.end);
|
|
@@ -29048,14 +29382,16 @@ Your Infinite Table license has expired on ${licenseEndDate.toDateString()}.
|
|
|
29048
29382
|
],
|
|
29049
29383
|
fn
|
|
29050
29384
|
);
|
|
29051
|
-
return
|
|
29385
|
+
return "expired";
|
|
29052
29386
|
}
|
|
29053
|
-
return
|
|
29387
|
+
return "valid";
|
|
29054
29388
|
};
|
|
29055
29389
|
var decode = (licenseKey) => {
|
|
29056
29390
|
let crc = "";
|
|
29057
29391
|
let fields = licenseKey.split("|").map((part) => {
|
|
29058
|
-
|
|
29392
|
+
const separatorIndex = part.indexOf("=");
|
|
29393
|
+
const name = separatorIndex === -1 ? part : part.slice(0, separatorIndex);
|
|
29394
|
+
const value = separatorIndex === -1 ? "" : part.slice(separatorIndex + 1);
|
|
29059
29395
|
if (name === "C") {
|
|
29060
29396
|
crc = value;
|
|
29061
29397
|
}
|
|
@@ -29092,40 +29428,29 @@ var decode = (licenseKey) => {
|
|
|
29092
29428
|
return fieldsToLicenseDetails(fields);
|
|
29093
29429
|
};
|
|
29094
29430
|
|
|
29431
|
+
// src/components/InfiniteTable/hooks/useLicense/getLicenseStatus.ts
|
|
29432
|
+
function getLicenseStatus(licenseKey = "", options) {
|
|
29433
|
+
if (options.isDetail) {
|
|
29434
|
+
return "valid";
|
|
29435
|
+
}
|
|
29436
|
+
const result = checkLicense(licenseKey, {
|
|
29437
|
+
publishedAt: 1794927344373,
|
|
29438
|
+
version: "10.2.0"
|
|
29439
|
+
});
|
|
29440
|
+
if (result === "invalid" && !licenseKey) {
|
|
29441
|
+
return "missing";
|
|
29442
|
+
}
|
|
29443
|
+
return result;
|
|
29444
|
+
}
|
|
29445
|
+
|
|
29095
29446
|
// src/components/InfiniteTable/hooks/useLicense/useLicense.ts
|
|
29096
|
-
var SANDPACK_REGEX = /(https):\/\/\d+\-\d+\-\d+\-(sandpack\.codesandbox\.io)/g;
|
|
29097
|
-
var SANDBOX_REGEX = /(https):\/\/\S+(\.csb\.app)/g;
|
|
29098
|
-
var origin = typeof window !== "undefined" ? window.location.origin : "";
|
|
29099
|
-
var isInsideSandpack = () => {
|
|
29100
|
-
const [_fullUrl, protocol, sandpackUrl] = Array.from(
|
|
29101
|
-
SANDPACK_REGEX.exec(origin) || []
|
|
29102
|
-
);
|
|
29103
|
-
return protocol === "https" && sandpackUrl === "sandpack.codesandbox.io";
|
|
29104
|
-
};
|
|
29105
|
-
var isInsideSandbox = () => {
|
|
29106
|
-
const [_fullUrl, protocol, sandboxUrl] = Array.from(
|
|
29107
|
-
SANDBOX_REGEX.exec(origin) || []
|
|
29108
|
-
);
|
|
29109
|
-
return protocol === "https" && sandboxUrl === ".csb.app";
|
|
29110
|
-
};
|
|
29111
|
-
var isInsidePlayground = isInsideSandbox() || isInsideSandpack();
|
|
29112
29447
|
var useLicense = (licenseKey = "") => {
|
|
29113
29448
|
const masterRowInfo = useMasterRowInfo();
|
|
29114
29449
|
const isDetail = !!masterRowInfo;
|
|
29115
|
-
|
|
29116
|
-
|
|
29117
|
-
|
|
29118
|
-
|
|
29119
|
-
let valid2 = isValidLicense(licenseKey, {
|
|
29120
|
-
publishedAt: 1624970570587,
|
|
29121
|
-
version: "10.1.4"
|
|
29122
|
-
});
|
|
29123
|
-
if (!licenseKey && !valid2 && isInsidePlayground) {
|
|
29124
|
-
return true;
|
|
29125
|
-
}
|
|
29126
|
-
return valid2;
|
|
29127
|
-
}, [licenseKey, isDetail]);
|
|
29128
|
-
return valid;
|
|
29450
|
+
return useMemo17(
|
|
29451
|
+
() => getLicenseStatus(licenseKey, { isDetail }),
|
|
29452
|
+
[licenseKey, isDetail]
|
|
29453
|
+
);
|
|
29129
29454
|
};
|
|
29130
29455
|
|
|
29131
29456
|
// src/components/InfiniteTable/hooks/useScrollToActiveCell.ts
|
|
@@ -31794,13 +32119,13 @@ import * as React68 from "react";
|
|
|
31794
32119
|
// src/components/InfiniteTable/components/icons/ClearIcon.tsx
|
|
31795
32120
|
import * as React66 from "react";
|
|
31796
32121
|
var ClearIcon = (props) => {
|
|
31797
|
-
return /* @__PURE__ */ React66.createElement(Icon, { ...props }, /* @__PURE__ */ React66.createElement("path", { d: iconPaths.clear[0] }));
|
|
32122
|
+
return /* @__PURE__ */ React66.createElement(Icon, { ...props, icon: "clear" }, /* @__PURE__ */ React66.createElement("path", { d: iconPaths.clear[0] }));
|
|
31798
32123
|
};
|
|
31799
32124
|
|
|
31800
32125
|
// src/components/InfiniteTable/components/icons/DoneIcon.tsx
|
|
31801
32126
|
import * as React67 from "react";
|
|
31802
32127
|
var DoneIcon = (props) => {
|
|
31803
|
-
return /* @__PURE__ */ React67.createElement(Icon, { ...props }, /* @__PURE__ */ React67.createElement("path", { d: iconPaths.done[0] }));
|
|
32128
|
+
return /* @__PURE__ */ React67.createElement(Icon, { ...props, icon: "done" }, /* @__PURE__ */ React67.createElement("path", { d: iconPaths.done[0] }));
|
|
31804
32129
|
};
|
|
31805
32130
|
|
|
31806
32131
|
// src/components/InfiniteTable/utils/getFilterOperatorMenuForColumn.tsx
|
|
@@ -33001,11 +33326,11 @@ function useInfinitePortalContainer() {
|
|
|
33001
33326
|
|
|
33002
33327
|
// src/components/InfiniteTable/components/GroupingToolbar/index.tsx
|
|
33003
33328
|
import * as React73 from "react";
|
|
33004
|
-
import { useCallback as useCallback33 } from "react";
|
|
33329
|
+
import { useCallback as useCallback33, useMemo as useMemo20 } from "react";
|
|
33005
33330
|
|
|
33006
33331
|
// src/components/InfiniteTable/components/GroupingToolbar/index.css.ts
|
|
33007
33332
|
var GroupingToolbarItemClearCls = "hs68h8j _16lm1iwk _16lm1iwx _16lm1iw2n";
|
|
33008
|
-
var GroupingToolbarItemRecipe = createRuntimeFn({ defaultClassName: "hs68h8e
|
|
33333
|
+
var GroupingToolbarItemRecipe = createRuntimeFn({ defaultClassName: "hs68h8e _16lm1iw1x _16lm1iw2j _16lm1iw1p", variantClassNames: { active: { true: "hs68h8f _16lm1iwn _16lm1iw1h", false: "_16lm1iwo" }, draggingInProgress: { true: "hs68h8h", false: "hs68h8i" } }, defaultVariants: {}, compoundVariants: [] });
|
|
33009
33334
|
var GroupingToolbarPlaceholderCls = "hs68h81";
|
|
33010
33335
|
var GroupingToolbarRecipe = createRuntimeFn({ defaultClassName: "hs68h80 _16lm1iw1p", variantClassNames: { orientation: { horizontal: "_16lm1iw2h _16lm1iw2j", vertical: "_16lm1iw2f" }, draggingInProgress: { true: "_16lm1iw1h", false: "hs68h86" }, dropRejected: { true: "hs68h87", false: "hs68h88" }, active: { true: "hs68h89", false: "hs68h8a" } }, defaultVariants: {}, compoundVariants: [[{ dropRejected: true, active: true }, "hs68h8b"], [{ dropRejected: false, active: true }, "hs68h8c"], [{ active: false, dropRejected: false }, "hs68h8d"]] });
|
|
33011
33336
|
|
|
@@ -33073,8 +33398,8 @@ var getFastClickHandler = (callback, prevHandler) => {
|
|
|
33073
33398
|
};
|
|
33074
33399
|
function GroupingToolbarItem(props) {
|
|
33075
33400
|
const { column, onClear, components: components2, field, id, toggleSorting } = props;
|
|
33076
|
-
const { dragSourceListId, dragItemId } = useDragListContext();
|
|
33077
|
-
const draggingInProgress = dragSourceListId ===
|
|
33401
|
+
const { dragSourceListId, dragItemId, dragListId } = useDragListContext();
|
|
33402
|
+
const draggingInProgress = dragSourceListId === dragListId;
|
|
33078
33403
|
const context = useInfiniteTableStableContext();
|
|
33079
33404
|
const columnHeader = (column ? getColumnLabel(column.id, context, "grouping-toolbar") : field) ?? id;
|
|
33080
33405
|
const sortIcon = column ? /* @__PURE__ */ React73.createElement(
|
|
@@ -33086,7 +33411,7 @@ function GroupingToolbarItem(props) {
|
|
|
33086
33411
|
}
|
|
33087
33412
|
) : null;
|
|
33088
33413
|
const header = /* @__PURE__ */ React73.createElement(React73.Fragment, null, columnHeader, sortIcon);
|
|
33089
|
-
const active = dragItemId === id && dragSourceListId ===
|
|
33414
|
+
const active = dragItemId === id && dragSourceListId === dragListId;
|
|
33090
33415
|
const className = join(
|
|
33091
33416
|
GroupingToolbarItemRecipe({
|
|
33092
33417
|
draggingInProgress,
|
|
@@ -33116,7 +33441,6 @@ function GroupingToolbarItem(props) {
|
|
|
33116
33441
|
}
|
|
33117
33442
|
);
|
|
33118
33443
|
}
|
|
33119
|
-
var GROUPING_TOOLBAR_DRAG_LIST_ID = "grouping-toolbar";
|
|
33120
33444
|
function GroupingToolbar(props) {
|
|
33121
33445
|
const { groupBy } = useDataSourceSelector((ctx) => {
|
|
33122
33446
|
return {
|
|
@@ -33134,8 +33458,14 @@ function GroupingToolbar(props) {
|
|
|
33134
33458
|
);
|
|
33135
33459
|
const { dropTargetListId, dragSourceListId } = useDragDropProvider();
|
|
33136
33460
|
const { fieldsToColumn, computedColumnsMap } = getComputed();
|
|
33137
|
-
const
|
|
33138
|
-
const
|
|
33461
|
+
const dragListId = useDragListId(GROUPING_TOOLBAR_DRAG_LIST_NAME);
|
|
33462
|
+
const headerDragListId = useDragListId(HEADER_DRAG_LIST_NAME);
|
|
33463
|
+
const acceptDropsFrom = useMemo20(
|
|
33464
|
+
() => [headerDragListId, dragListId],
|
|
33465
|
+
[headerDragListId, dragListId]
|
|
33466
|
+
);
|
|
33467
|
+
const active = dropTargetListId === dragListId;
|
|
33468
|
+
const draggingInProgress = dragSourceListId === dragListId;
|
|
33139
33469
|
const PlaceholderComponent = props.components?.Placeholder ?? PlaceholderDefault;
|
|
33140
33470
|
const HostComponent = props.components?.Host ?? HostDefault;
|
|
33141
33471
|
const children = !groupBy.length ? /* @__PURE__ */ React73.createElement(
|
|
@@ -33208,8 +33538,8 @@ function GroupingToolbar(props) {
|
|
|
33208
33538
|
DragList,
|
|
33209
33539
|
{
|
|
33210
33540
|
orientation,
|
|
33211
|
-
dragListId
|
|
33212
|
-
acceptDropsFrom
|
|
33541
|
+
dragListId,
|
|
33542
|
+
acceptDropsFrom,
|
|
33213
33543
|
onDrop,
|
|
33214
33544
|
dragStrategy: "inline",
|
|
33215
33545
|
onAcceptDrop,
|
|
@@ -33249,7 +33579,7 @@ function GroupingToolbar(props) {
|
|
|
33249
33579
|
import * as React78 from "react";
|
|
33250
33580
|
|
|
33251
33581
|
// src/components/InfiniteTable/hooks/useCellRendering.tsx
|
|
33252
|
-
import { useMemo as
|
|
33582
|
+
import { useMemo as useMemo22 } from "react";
|
|
33253
33583
|
import { useCallback as useCallback34, useEffect as useEffect39, useRef as useRef33 } from "react";
|
|
33254
33584
|
import * as React75 from "react";
|
|
33255
33585
|
|
|
@@ -33294,7 +33624,7 @@ import * as React74 from "react";
|
|
|
33294
33624
|
var RowDetailRecipe = createRuntimeFn({ defaultClassName: "evqes20", variantClassNames: {}, defaultVariants: {}, compoundVariants: [] });
|
|
33295
33625
|
|
|
33296
33626
|
// src/components/InfiniteTable/components/InfiniteTableRow/useRegisterDetail.ts
|
|
33297
|
-
import { useMemo as
|
|
33627
|
+
import { useMemo as useMemo21 } from "react";
|
|
33298
33628
|
|
|
33299
33629
|
// src/components/InfiniteTable/components/InfiniteTableRow/registerDetailShared.ts
|
|
33300
33630
|
function restoreDetailStateForRowId(rowId, options) {
|
|
@@ -33422,11 +33752,11 @@ function useRegisterDetail(props) {
|
|
|
33422
33752
|
getMasterState: ctx.getState
|
|
33423
33753
|
};
|
|
33424
33754
|
});
|
|
33425
|
-
const { currentRowCache, cacheCalledByRowDetailRenderer } =
|
|
33755
|
+
const { currentRowCache, cacheCalledByRowDetailRenderer } = useMemo21(
|
|
33426
33756
|
() => createCurrentRowCache(rowInfo.id, rowDetailsCache),
|
|
33427
33757
|
[rowDetailsCache, rowInfo.id]
|
|
33428
33758
|
);
|
|
33429
|
-
const masterDetailContextValue =
|
|
33759
|
+
const masterDetailContextValue = useMemo21(() => {
|
|
33430
33760
|
return createMasterDetailContextValue({
|
|
33431
33761
|
rowInfo,
|
|
33432
33762
|
currentRowCache,
|
|
@@ -33570,7 +33900,7 @@ function useCellRendering(param) {
|
|
|
33570
33900
|
toggleGroupRow,
|
|
33571
33901
|
columnSize
|
|
33572
33902
|
} = computed;
|
|
33573
|
-
const visibleColumnIds =
|
|
33903
|
+
const visibleColumnIds = useMemo22(
|
|
33574
33904
|
() => computedVisibleColumns.map((column) => column.id),
|
|
33575
33905
|
[computedVisibleColumns]
|
|
33576
33906
|
);
|
|
@@ -33672,7 +34002,7 @@ function useCellRendering(param) {
|
|
|
33672
34002
|
onReady({ api: imperativeApi, dataSourceApi });
|
|
33673
34003
|
}
|
|
33674
34004
|
}, [ready]);
|
|
33675
|
-
const dataSourceStatePartialForCell =
|
|
34005
|
+
const dataSourceStatePartialForCell = useMemo22(() => {
|
|
33676
34006
|
return {
|
|
33677
34007
|
isNodeReadOnly: isNodeReadOnly2,
|
|
33678
34008
|
selectionMode,
|
|
@@ -33798,7 +34128,7 @@ function useCellRendering(param) {
|
|
|
33798
34128
|
dataSourceStatePartialForCell
|
|
33799
34129
|
]
|
|
33800
34130
|
);
|
|
33801
|
-
const renderDetailRow =
|
|
34131
|
+
const renderDetailRow = useMemo22(() => {
|
|
33802
34132
|
if (!isRowDetailsExpanded) {
|
|
33803
34133
|
return void 0;
|
|
33804
34134
|
}
|
|
@@ -33910,7 +34240,7 @@ function LoadMaskFn(props) {
|
|
|
33910
34240
|
var LoadMask = React77.memo(LoadMaskFn);
|
|
33911
34241
|
|
|
33912
34242
|
// src/components/InfiniteTable/components/InfiniteTableBody/index.tsx
|
|
33913
|
-
import { useMemo as
|
|
34243
|
+
import { useMemo as useMemo23 } from "react";
|
|
33914
34244
|
var _HOVERED_CLASS_NAMES = [
|
|
33915
34245
|
RowHoverCls,
|
|
33916
34246
|
`${InfiniteTableColumnCellClassName}--hovered`
|
|
@@ -34027,7 +34357,7 @@ function InfiniteTableBody(props) {
|
|
|
34027
34357
|
});
|
|
34028
34358
|
const { autoFocus, tabIndex } = domProps ?? {};
|
|
34029
34359
|
useToggleWrapRowsHorizontally();
|
|
34030
|
-
const hoverClassNames =
|
|
34360
|
+
const hoverClassNames = useMemo23(() => {
|
|
34031
34361
|
if (!showHoverRows) {
|
|
34032
34362
|
return void 0;
|
|
34033
34363
|
}
|
|
@@ -34084,15 +34414,6 @@ function useInfiniteColumnApi(columnId) {
|
|
|
34084
34414
|
return useInfiniteTableSelector((ctx) => ctx.api.getColumnApi(columnId));
|
|
34085
34415
|
}
|
|
34086
34416
|
|
|
34087
|
-
// src/components/InfiniteTable/utils/toCSSVarName.ts
|
|
34088
|
-
var toCSSVarName = (value) => `--infinite-${value}`;
|
|
34089
|
-
|
|
34090
|
-
// src/components/InfiniteTable/shared.ts
|
|
34091
|
-
var DEFAULT_ROW_HEIGHT = 40;
|
|
34092
|
-
var DEFAULT_COLUMN_HEADER_HEIGHT = toCSSVarName(
|
|
34093
|
-
columnHeaderHeightName
|
|
34094
|
-
);
|
|
34095
|
-
|
|
34096
34417
|
// src/components/InfiniteTable/index.tsx
|
|
34097
34418
|
var InfiniteTableClassName = internalProps.rootClassName;
|
|
34098
34419
|
var { ManagedComponentContextProvider: InfiniteTableRoot } = buildManagedComponent({
|
|
@@ -34159,7 +34480,7 @@ var InfiniteTableComponent = React79.memo(
|
|
|
34159
34480
|
activeCellIndex
|
|
34160
34481
|
} = componentState;
|
|
34161
34482
|
let { licenseKey } = componentState;
|
|
34162
|
-
if (
|
|
34483
|
+
if (licenseKey === void 0 && InfiniteTable.licenseKey) {
|
|
34163
34484
|
licenseKey = InfiniteTable.licenseKey;
|
|
34164
34485
|
}
|
|
34165
34486
|
useScrollToActiveRow(activeRowIndex, dataArrayLength, api);
|
|
@@ -34178,7 +34499,7 @@ var InfiniteTableComponent = React79.memo(
|
|
|
34178
34499
|
);
|
|
34179
34500
|
return brain.onVerticalRenderRangeChange(onChange);
|
|
34180
34501
|
}, [brain, scrollStopDelay]);
|
|
34181
|
-
const
|
|
34502
|
+
const licenseStatus = useLicense(licenseKey);
|
|
34182
34503
|
const {
|
|
34183
34504
|
// remove autoFocus and tabIndex from the domProps
|
|
34184
34505
|
// that will be spread on the root DOM element
|
|
@@ -34279,7 +34600,7 @@ var InfiniteTableComponent = React79.memo(
|
|
|
34279
34600
|
onChange: onColumnHeaderHeightCSSVarChange
|
|
34280
34601
|
}
|
|
34281
34602
|
) : null,
|
|
34282
|
-
|
|
34603
|
+
licenseStatus === "valid" ? null : /* @__PURE__ */ React79.createElement(InfiniteTableLicenseFooter, { invalid: licenseStatus === "invalid" }),
|
|
34283
34604
|
/* @__PURE__ */ React79.createElement(FocusDetect, null)
|
|
34284
34605
|
);
|
|
34285
34606
|
}
|
|
@@ -34376,7 +34697,7 @@ var InfiniteTable = function(props) {
|
|
|
34376
34697
|
InfiniteTableRoot,
|
|
34377
34698
|
{
|
|
34378
34699
|
repeatWrappedGroupRows: !!props.wrapRowsHorizontally,
|
|
34379
|
-
rowHeight:
|
|
34700
|
+
rowHeight: DEFAULT_ROW_HEIGHT_CSS_VALUE,
|
|
34380
34701
|
columnHeaderHeight: DEFAULT_COLUMN_HEADER_HEIGHT,
|
|
34381
34702
|
...props
|
|
34382
34703
|
},
|