@vitessce/feature-list 3.9.2 → 3.9.4

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.
Files changed (2) hide show
  1. package/dist/index.js +998 -11
  2. package/package.json +5 -5
package/dist/index.js CHANGED
@@ -2,7 +2,7 @@ var __defProp = Object.defineProperty;
2
2
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
3
  var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
4
4
  import * as React from "react";
5
- import React__default, { useContext, forwardRef, useRef, useMemo, createContext, createElement, isValidElement, cloneElement, Children, useState, useEffect, useCallback } from "react";
5
+ import React__default, { useContext, forwardRef, useRef, useMemo, createContext, createElement, isValidElement, cloneElement, Children, PureComponent, useEffect, useState, useCallback } from "react";
6
6
  import { usePlotOptionsStyles, OptionsContainer, OptionSelect, useLoaders, useCoordinationScopes, useGridItemSize, useCoordination, useFeatureLabelsData, useExpandedFeatureLabelsMap, useObsFeatureMatrixIndices, useReady, useUrls, TitleInfo } from "@vitessce/vit-s";
7
7
  import * as ReactDOM from "react-dom";
8
8
  function getDefaultExportFromCjs(x) {
@@ -659,6 +659,7 @@ const ViewType = {
659
659
  OBS_SET_COMPOSITION_BAR_PLOT: "obsSetCompositionBarPlot",
660
660
  FEATURE_SET_ENRICHMENT_BAR_PLOT: "featureSetEnrichmentBarPlot",
661
661
  BIOMARKER_SELECT: "biomarkerSelect",
662
+ BIOMARKER_SELECT_ALT: "biomarkerSelectAlt",
662
663
  COMPARATIVE_HEADING: "comparativeHeading",
663
664
  LINK_CONTROLLER: "linkController",
664
665
  NEUROGLANCER: "neuroglancer",
@@ -1419,6 +1420,17 @@ const COMPONENT_COORDINATION_TYPES = {
1419
1420
  CoordinationType.OBS_SET_FILTER
1420
1421
  // TODO: create coordination types for internal state of the biomarker selection view?
1421
1422
  ],
1423
+ [ViewType.BIOMARKER_SELECT_ALT]: [
1424
+ CoordinationType.DATASET,
1425
+ CoordinationType.OBS_TYPE,
1426
+ CoordinationType.SAMPLE_TYPE,
1427
+ CoordinationType.FEATURE_SELECTION,
1428
+ CoordinationType.SAMPLE_SET_SELECTION,
1429
+ CoordinationType.SAMPLE_SET_FILTER,
1430
+ CoordinationType.OBS_SET_SELECTION,
1431
+ CoordinationType.OBS_SET_FILTER
1432
+ // TODO: create coordination types for internal state of the biomarker selection view?
1433
+ ],
1422
1434
  [ViewType.COMPARATIVE_HEADING]: [
1423
1435
  CoordinationType.DATASET,
1424
1436
  CoordinationType.OBS_TYPE,
@@ -6739,6 +6751,56 @@ const systemDefaultTheme$1 = createTheme$1();
6739
6751
  function useTheme$1(defaultTheme2 = systemDefaultTheme$1) {
6740
6752
  return useTheme$2(defaultTheme2);
6741
6753
  }
6754
+ const splitProps = (props) => {
6755
+ var _a;
6756
+ const result = {
6757
+ systemProps: {},
6758
+ otherProps: {}
6759
+ };
6760
+ const config = ((_a = props == null ? void 0 : props.theme) == null ? void 0 : _a.unstable_sxConfig) ?? defaultSxConfig;
6761
+ Object.keys(props).forEach((prop) => {
6762
+ if (config[prop]) {
6763
+ result.systemProps[prop] = props[prop];
6764
+ } else {
6765
+ result.otherProps[prop] = props[prop];
6766
+ }
6767
+ });
6768
+ return result;
6769
+ };
6770
+ function extendSxProp$1(props) {
6771
+ const {
6772
+ sx: inSx,
6773
+ ...other
6774
+ } = props;
6775
+ const {
6776
+ systemProps,
6777
+ otherProps
6778
+ } = splitProps(other);
6779
+ let finalSx;
6780
+ if (Array.isArray(inSx)) {
6781
+ finalSx = [systemProps, ...inSx];
6782
+ } else if (typeof inSx === "function") {
6783
+ finalSx = (...args) => {
6784
+ const result = inSx(...args);
6785
+ if (!isPlainObject(result)) {
6786
+ return systemProps;
6787
+ }
6788
+ return {
6789
+ ...systemProps,
6790
+ ...result
6791
+ };
6792
+ };
6793
+ } else {
6794
+ finalSx = {
6795
+ ...systemProps,
6796
+ ...inSx
6797
+ };
6798
+ }
6799
+ return {
6800
+ ...otherProps,
6801
+ sx: finalSx
6802
+ };
6803
+ }
6742
6804
  const defaultGenerator = (componentName) => componentName;
6743
6805
  const createClassNameGenerator = () => {
6744
6806
  let generate = defaultGenerator;
@@ -8922,6 +8984,9 @@ const { tss } = createTss({
8922
8984
  "usePlugin": useMuiThemeStyleOverridesPlugin
8923
8985
  });
8924
8986
  const useStyles$3 = tss.create({});
8987
+ function internal_createExtendSxProp() {
8988
+ return extendSxProp$1;
8989
+ }
8925
8990
  const memoTheme = unstable_memoTheme;
8926
8991
  ({
8927
8992
  // ┌────────────────────────────── Warning ──────────────────────────────┐
@@ -8944,7 +9009,7 @@ function getSvgIconUtilityClass(slot) {
8944
9009
  return generateUtilityClass("MuiSvgIcon", slot);
8945
9010
  }
8946
9011
  generateUtilityClasses("MuiSvgIcon", ["root", "colorPrimary", "colorSecondary", "colorAction", "colorError", "colorDisabled", "fontSizeInherit", "fontSizeSmall", "fontSizeMedium", "fontSizeLarge"]);
8947
- const useUtilityClasses$5 = (ownerState) => {
9012
+ const useUtilityClasses$6 = (ownerState) => {
8948
9013
  const {
8949
9014
  color: color2,
8950
9015
  fontSize,
@@ -9089,7 +9154,7 @@ const SvgIcon = /* @__PURE__ */ React.forwardRef(function SvgIcon2(inProps, ref)
9089
9154
  if (!inheritViewBox) {
9090
9155
  more.viewBox = viewBox;
9091
9156
  }
9092
- const classes = useUtilityClasses$5(ownerState);
9157
+ const classes = useUtilityClasses$6(ownerState);
9093
9158
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(SvgIconRoot, {
9094
9159
  as: component,
9095
9160
  className: clsx$1(classes.root, className),
@@ -10288,7 +10353,7 @@ function getButtonBaseUtilityClass(slot) {
10288
10353
  return generateUtilityClass("MuiButtonBase", slot);
10289
10354
  }
10290
10355
  const buttonBaseClasses = generateUtilityClasses("MuiButtonBase", ["root", "disabled", "focusVisible"]);
10291
- const useUtilityClasses$4 = (ownerState) => {
10356
+ const useUtilityClasses$5 = (ownerState) => {
10292
10357
  const {
10293
10358
  disabled,
10294
10359
  focusVisible,
@@ -10504,7 +10569,7 @@ const ButtonBase = /* @__PURE__ */ React.forwardRef(function ButtonBase2(inProps
10504
10569
  tabIndex,
10505
10570
  focusVisible
10506
10571
  };
10507
- const classes = useUtilityClasses$4(ownerState);
10572
+ const classes = useUtilityClasses$5(ownerState);
10508
10573
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(ButtonBaseRoot, {
10509
10574
  as: ComponentProp,
10510
10575
  className: clsx$1(classes.root, className),
@@ -10814,7 +10879,7 @@ function getSwitchBaseUtilityClass(slot) {
10814
10879
  return generateUtilityClass("PrivateSwitchBase", slot);
10815
10880
  }
10816
10881
  generateUtilityClasses("PrivateSwitchBase", ["root", "checked", "disabled", "input", "edgeStart", "edgeEnd"]);
10817
- const useUtilityClasses$3 = (ownerState) => {
10882
+ const useUtilityClasses$4 = (ownerState) => {
10818
10883
  const {
10819
10884
  classes,
10820
10885
  checked,
@@ -10951,7 +11016,7 @@ const SwitchBase = /* @__PURE__ */ React.forwardRef(function SwitchBase2(props,
10951
11016
  disableFocusRipple,
10952
11017
  edge
10953
11018
  };
10954
- const classes = useUtilityClasses$3(ownerState);
11019
+ const classes = useUtilityClasses$4(ownerState);
10955
11020
  const externalForwardedProps = {
10956
11021
  slots,
10957
11022
  slotProps: {
@@ -11160,7 +11225,7 @@ function getCheckboxUtilityClass(slot) {
11160
11225
  return generateUtilityClass("MuiCheckbox", slot);
11161
11226
  }
11162
11227
  const checkboxClasses = generateUtilityClasses("MuiCheckbox", ["root", "checked", "disabled", "indeterminate", "colorPrimary", "colorSecondary", "sizeSmall", "sizeMedium"]);
11163
- const useUtilityClasses$2 = (ownerState) => {
11228
+ const useUtilityClasses$3 = (ownerState) => {
11164
11229
  const {
11165
11230
  classes,
11166
11231
  indeterminate,
@@ -11269,7 +11334,7 @@ const Checkbox = /* @__PURE__ */ React.forwardRef(function Checkbox2(inProps, re
11269
11334
  indeterminate,
11270
11335
  size: size2
11271
11336
  };
11272
- const classes = useUtilityClasses$2(ownerState);
11337
+ const classes = useUtilityClasses$3(ownerState);
11273
11338
  const externalInputProps = slotProps.input ?? inputProps;
11274
11339
  const [RootSlot, rootSlotProps] = useSlot("root", {
11275
11340
  ref,
@@ -11418,6 +11483,266 @@ Checkbox.propTypes = {
11418
11483
  */
11419
11484
  value: PropTypes.any
11420
11485
  };
11486
+ function getTypographyUtilityClass(slot) {
11487
+ return generateUtilityClass("MuiTypography", slot);
11488
+ }
11489
+ generateUtilityClasses("MuiTypography", ["root", "h1", "h2", "h3", "h4", "h5", "h6", "subtitle1", "subtitle2", "body1", "body2", "inherit", "button", "caption", "overline", "alignLeft", "alignRight", "alignCenter", "alignJustify", "noWrap", "gutterBottom", "paragraph"]);
11490
+ const v6Colors = {
11491
+ primary: true,
11492
+ secondary: true,
11493
+ error: true,
11494
+ info: true,
11495
+ success: true,
11496
+ warning: true,
11497
+ textPrimary: true,
11498
+ textSecondary: true,
11499
+ textDisabled: true
11500
+ };
11501
+ const extendSxProp = internal_createExtendSxProp();
11502
+ const useUtilityClasses$2 = (ownerState) => {
11503
+ const {
11504
+ align,
11505
+ gutterBottom,
11506
+ noWrap,
11507
+ paragraph,
11508
+ variant,
11509
+ classes
11510
+ } = ownerState;
11511
+ const slots = {
11512
+ root: ["root", variant, ownerState.align !== "inherit" && `align${capitalize(align)}`, gutterBottom && "gutterBottom", noWrap && "noWrap", paragraph && "paragraph"]
11513
+ };
11514
+ return composeClasses(slots, getTypographyUtilityClass, classes);
11515
+ };
11516
+ const TypographyRoot = styled("span", {
11517
+ name: "MuiTypography",
11518
+ slot: "Root",
11519
+ overridesResolver: (props, styles) => {
11520
+ const {
11521
+ ownerState
11522
+ } = props;
11523
+ return [styles.root, ownerState.variant && styles[ownerState.variant], ownerState.align !== "inherit" && styles[`align${capitalize(ownerState.align)}`], ownerState.noWrap && styles.noWrap, ownerState.gutterBottom && styles.gutterBottom, ownerState.paragraph && styles.paragraph];
11524
+ }
11525
+ })(memoTheme(({
11526
+ theme
11527
+ }) => {
11528
+ var _a;
11529
+ return {
11530
+ margin: 0,
11531
+ variants: [{
11532
+ props: {
11533
+ variant: "inherit"
11534
+ },
11535
+ style: {
11536
+ // Some elements, like <button> on Chrome have default font that doesn't inherit, reset this.
11537
+ font: "inherit",
11538
+ lineHeight: "inherit",
11539
+ letterSpacing: "inherit"
11540
+ }
11541
+ }, ...Object.entries(theme.typography).filter(([variant, value]) => variant !== "inherit" && value && typeof value === "object").map(([variant, value]) => ({
11542
+ props: {
11543
+ variant
11544
+ },
11545
+ style: value
11546
+ })), ...Object.entries(theme.palette).filter(createSimplePaletteValueFilter()).map(([color2]) => ({
11547
+ props: {
11548
+ color: color2
11549
+ },
11550
+ style: {
11551
+ color: (theme.vars || theme).palette[color2].main
11552
+ }
11553
+ })), ...Object.entries(((_a = theme.palette) == null ? void 0 : _a.text) || {}).filter(([, value]) => typeof value === "string").map(([color2]) => ({
11554
+ props: {
11555
+ color: `text${capitalize(color2)}`
11556
+ },
11557
+ style: {
11558
+ color: (theme.vars || theme).palette.text[color2]
11559
+ }
11560
+ })), {
11561
+ props: ({
11562
+ ownerState
11563
+ }) => ownerState.align !== "inherit",
11564
+ style: {
11565
+ textAlign: "var(--Typography-textAlign)"
11566
+ }
11567
+ }, {
11568
+ props: ({
11569
+ ownerState
11570
+ }) => ownerState.noWrap,
11571
+ style: {
11572
+ overflow: "hidden",
11573
+ textOverflow: "ellipsis",
11574
+ whiteSpace: "nowrap"
11575
+ }
11576
+ }, {
11577
+ props: ({
11578
+ ownerState
11579
+ }) => ownerState.gutterBottom,
11580
+ style: {
11581
+ marginBottom: "0.35em"
11582
+ }
11583
+ }, {
11584
+ props: ({
11585
+ ownerState
11586
+ }) => ownerState.paragraph,
11587
+ style: {
11588
+ marginBottom: 16
11589
+ }
11590
+ }]
11591
+ };
11592
+ }));
11593
+ const defaultVariantMapping = {
11594
+ h1: "h1",
11595
+ h2: "h2",
11596
+ h3: "h3",
11597
+ h4: "h4",
11598
+ h5: "h5",
11599
+ h6: "h6",
11600
+ subtitle1: "h6",
11601
+ subtitle2: "h6",
11602
+ body1: "p",
11603
+ body2: "p",
11604
+ inherit: "p"
11605
+ };
11606
+ const Typography = /* @__PURE__ */ React.forwardRef(function Typography2(inProps, ref) {
11607
+ const {
11608
+ color: color2,
11609
+ ...themeProps
11610
+ } = useDefaultProps({
11611
+ props: inProps,
11612
+ name: "MuiTypography"
11613
+ });
11614
+ const isSxColor = !v6Colors[color2];
11615
+ const props = extendSxProp({
11616
+ ...themeProps,
11617
+ ...isSxColor && {
11618
+ color: color2
11619
+ }
11620
+ });
11621
+ const {
11622
+ align = "inherit",
11623
+ className,
11624
+ component,
11625
+ gutterBottom = false,
11626
+ noWrap = false,
11627
+ paragraph = false,
11628
+ variant = "body1",
11629
+ variantMapping = defaultVariantMapping,
11630
+ ...other
11631
+ } = props;
11632
+ const ownerState = {
11633
+ ...props,
11634
+ align,
11635
+ color: color2,
11636
+ className,
11637
+ component,
11638
+ gutterBottom,
11639
+ noWrap,
11640
+ paragraph,
11641
+ variant,
11642
+ variantMapping
11643
+ };
11644
+ const Component = component || (paragraph ? "p" : variantMapping[variant] || defaultVariantMapping[variant]) || "span";
11645
+ const classes = useUtilityClasses$2(ownerState);
11646
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(TypographyRoot, {
11647
+ as: Component,
11648
+ ref,
11649
+ className: clsx$1(classes.root, className),
11650
+ ...other,
11651
+ ownerState,
11652
+ style: {
11653
+ ...align !== "inherit" && {
11654
+ "--Typography-textAlign": align
11655
+ },
11656
+ ...other.style
11657
+ }
11658
+ });
11659
+ });
11660
+ Typography.propTypes = {
11661
+ // ┌────────────────────────────── Warning ──────────────────────────────┐
11662
+ // │ These PropTypes are generated from the TypeScript type definitions. │
11663
+ // │ To update them, edit the d.ts file and run `pnpm proptypes`. │
11664
+ // └─────────────────────────────────────────────────────────────────────┘
11665
+ /**
11666
+ * Set the text-align on the component.
11667
+ * @default 'inherit'
11668
+ */
11669
+ align: PropTypes.oneOf(["center", "inherit", "justify", "left", "right"]),
11670
+ /**
11671
+ * The content of the component.
11672
+ */
11673
+ children: PropTypes.node,
11674
+ /**
11675
+ * Override or extend the styles applied to the component.
11676
+ */
11677
+ classes: PropTypes.object,
11678
+ /**
11679
+ * @ignore
11680
+ */
11681
+ className: PropTypes.string,
11682
+ /**
11683
+ * The color of the component.
11684
+ * It supports both default and custom theme colors, which can be added as shown in the
11685
+ * [palette customization guide](https://mui.com/material-ui/customization/palette/#custom-colors).
11686
+ */
11687
+ color: PropTypes.oneOfType([PropTypes.oneOf(["primary", "secondary", "success", "error", "info", "warning", "textPrimary", "textSecondary", "textDisabled"]), PropTypes.string]),
11688
+ /**
11689
+ * The component used for the root node.
11690
+ * Either a string to use a HTML element or a component.
11691
+ */
11692
+ component: PropTypes.elementType,
11693
+ /**
11694
+ * If `true`, the text will have a bottom margin.
11695
+ * @default false
11696
+ */
11697
+ gutterBottom: PropTypes.bool,
11698
+ /**
11699
+ * If `true`, the text will not wrap, but instead will truncate with a text overflow ellipsis.
11700
+ *
11701
+ * Note that text overflow can only happen with block or inline-block level elements
11702
+ * (the element needs to have a width in order to overflow).
11703
+ * @default false
11704
+ */
11705
+ noWrap: PropTypes.bool,
11706
+ /**
11707
+ * If `true`, the element will be a paragraph element.
11708
+ * @default false
11709
+ * @deprecated Use the `component` prop instead. This prop will be removed in a future major release. See [Migrating from deprecated APIs](https://mui.com/material-ui/migration/migrating-from-deprecated-apis/) for more details.
11710
+ */
11711
+ paragraph: PropTypes.bool,
11712
+ /**
11713
+ * @ignore
11714
+ */
11715
+ style: PropTypes.object,
11716
+ /**
11717
+ * The system prop that allows defining system overrides as well as additional CSS styles.
11718
+ */
11719
+ sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
11720
+ /**
11721
+ * Applies the theme typography styles.
11722
+ * @default 'body1'
11723
+ */
11724
+ variant: PropTypes.oneOfType([PropTypes.oneOf(["body1", "body2", "button", "caption", "h1", "h2", "h3", "h4", "h5", "h6", "inherit", "overline", "subtitle1", "subtitle2"]), PropTypes.string]),
11725
+ /**
11726
+ * The component maps the variant prop to a range of different HTML element types.
11727
+ * For instance, subtitle1 to `<h6>`.
11728
+ * If you wish to change that mapping, you can provide your own.
11729
+ * Alternatively, you can use the `component` prop.
11730
+ * @default {
11731
+ * h1: 'h1',
11732
+ * h2: 'h2',
11733
+ * h3: 'h3',
11734
+ * h4: 'h4',
11735
+ * h5: 'h5',
11736
+ * h6: 'h6',
11737
+ * subtitle1: 'h6',
11738
+ * subtitle2: 'h6',
11739
+ * body1: 'p',
11740
+ * body2: 'p',
11741
+ * inherit: 'p',
11742
+ * }
11743
+ */
11744
+ variantMapping: PropTypes.object
11745
+ };
11421
11746
  const TableContext = /* @__PURE__ */ React.createContext();
11422
11747
  {
11423
11748
  TableContext.displayName = "TableContext";
@@ -13492,6 +13817,668 @@ React.forwardRef((props, ref) => {
13492
13817
  ...style2
13493
13818
  }, children: typeof children2 === "function" ? children2(childProps) : children2 }) });
13494
13819
  });
13820
+ var safeIsNaN = Number.isNaN || function ponyfill(value) {
13821
+ return typeof value === "number" && value !== value;
13822
+ };
13823
+ function isEqual$1(first, second) {
13824
+ if (first === second) {
13825
+ return true;
13826
+ }
13827
+ if (safeIsNaN(first) && safeIsNaN(second)) {
13828
+ return true;
13829
+ }
13830
+ return false;
13831
+ }
13832
+ function areInputsEqual(newInputs, lastInputs) {
13833
+ if (newInputs.length !== lastInputs.length) {
13834
+ return false;
13835
+ }
13836
+ for (var i = 0; i < newInputs.length; i++) {
13837
+ if (!isEqual$1(newInputs[i], lastInputs[i])) {
13838
+ return false;
13839
+ }
13840
+ }
13841
+ return true;
13842
+ }
13843
+ function memoizeOne(resultFn, isEqual2) {
13844
+ if (isEqual2 === void 0) {
13845
+ isEqual2 = areInputsEqual;
13846
+ }
13847
+ var lastThis;
13848
+ var lastArgs = [];
13849
+ var lastResult;
13850
+ var calledOnce = false;
13851
+ function memoized() {
13852
+ var newArgs = [];
13853
+ for (var _i = 0; _i < arguments.length; _i++) {
13854
+ newArgs[_i] = arguments[_i];
13855
+ }
13856
+ if (calledOnce && lastThis === this && isEqual2(newArgs, lastArgs)) {
13857
+ return lastResult;
13858
+ }
13859
+ lastResult = resultFn.apply(this, newArgs);
13860
+ calledOnce = true;
13861
+ lastThis = this;
13862
+ lastArgs = newArgs;
13863
+ return lastResult;
13864
+ }
13865
+ return memoized;
13866
+ }
13867
+ var hasNativePerformanceNow = typeof performance === "object" && typeof performance.now === "function";
13868
+ var now = hasNativePerformanceNow ? function() {
13869
+ return performance.now();
13870
+ } : function() {
13871
+ return Date.now();
13872
+ };
13873
+ function cancelTimeout(timeoutID) {
13874
+ cancelAnimationFrame(timeoutID.id);
13875
+ }
13876
+ function requestTimeout(callback, delay) {
13877
+ var start = now();
13878
+ function tick() {
13879
+ if (now() - start >= delay) {
13880
+ callback.call(null);
13881
+ } else {
13882
+ timeoutID.id = requestAnimationFrame(tick);
13883
+ }
13884
+ }
13885
+ var timeoutID = {
13886
+ id: requestAnimationFrame(tick)
13887
+ };
13888
+ return timeoutID;
13889
+ }
13890
+ var size$1 = -1;
13891
+ function getScrollbarSize(recalculate) {
13892
+ if (recalculate === void 0) {
13893
+ recalculate = false;
13894
+ }
13895
+ if (size$1 === -1 || recalculate) {
13896
+ var div = document.createElement("div");
13897
+ var style2 = div.style;
13898
+ style2.width = "50px";
13899
+ style2.height = "50px";
13900
+ style2.overflow = "scroll";
13901
+ document.body.appendChild(div);
13902
+ size$1 = div.offsetWidth - div.clientWidth;
13903
+ document.body.removeChild(div);
13904
+ }
13905
+ return size$1;
13906
+ }
13907
+ var cachedRTLResult = null;
13908
+ function getRTLOffsetType(recalculate) {
13909
+ if (recalculate === void 0) {
13910
+ recalculate = false;
13911
+ }
13912
+ if (cachedRTLResult === null || recalculate) {
13913
+ var outerDiv = document.createElement("div");
13914
+ var outerStyle = outerDiv.style;
13915
+ outerStyle.width = "50px";
13916
+ outerStyle.height = "50px";
13917
+ outerStyle.overflow = "scroll";
13918
+ outerStyle.direction = "rtl";
13919
+ var innerDiv = document.createElement("div");
13920
+ var innerStyle = innerDiv.style;
13921
+ innerStyle.width = "100px";
13922
+ innerStyle.height = "100px";
13923
+ outerDiv.appendChild(innerDiv);
13924
+ document.body.appendChild(outerDiv);
13925
+ if (outerDiv.scrollLeft > 0) {
13926
+ cachedRTLResult = "positive-descending";
13927
+ } else {
13928
+ outerDiv.scrollLeft = 1;
13929
+ if (outerDiv.scrollLeft === 0) {
13930
+ cachedRTLResult = "negative";
13931
+ } else {
13932
+ cachedRTLResult = "positive-ascending";
13933
+ }
13934
+ }
13935
+ document.body.removeChild(outerDiv);
13936
+ return cachedRTLResult;
13937
+ }
13938
+ return cachedRTLResult;
13939
+ }
13940
+ var IS_SCROLLING_DEBOUNCE_INTERVAL$1 = 150;
13941
+ var defaultItemKey$1 = function defaultItemKey3(index, data) {
13942
+ return index;
13943
+ };
13944
+ var devWarningsDirection = null;
13945
+ var devWarningsTagName$1 = null;
13946
+ {
13947
+ if (typeof window !== "undefined" && typeof window.WeakSet !== "undefined") {
13948
+ devWarningsDirection = /* @__PURE__ */ new WeakSet();
13949
+ devWarningsTagName$1 = /* @__PURE__ */ new WeakSet();
13950
+ }
13951
+ }
13952
+ function createListComponent(_ref) {
13953
+ var _class;
13954
+ var getItemOffset3 = _ref.getItemOffset, getEstimatedTotalSize4 = _ref.getEstimatedTotalSize, getItemSize3 = _ref.getItemSize, getOffsetForIndexAndAlignment5 = _ref.getOffsetForIndexAndAlignment, getStartIndexForOffset3 = _ref.getStartIndexForOffset, getStopIndexForStartIndex3 = _ref.getStopIndexForStartIndex, initInstanceProps5 = _ref.initInstanceProps, shouldResetStyleCacheOnItemSizeChange = _ref.shouldResetStyleCacheOnItemSizeChange, validateProps5 = _ref.validateProps;
13955
+ return _class = /* @__PURE__ */ function(_PureComponent) {
13956
+ _inheritsLoose(List2, _PureComponent);
13957
+ function List2(props) {
13958
+ var _this;
13959
+ _this = _PureComponent.call(this, props) || this;
13960
+ _this._instanceProps = initInstanceProps5(_this.props, _assertThisInitialized$1(_this));
13961
+ _this._outerRef = void 0;
13962
+ _this._resetIsScrollingTimeoutId = null;
13963
+ _this.state = {
13964
+ instance: _assertThisInitialized$1(_this),
13965
+ isScrolling: false,
13966
+ scrollDirection: "forward",
13967
+ scrollOffset: typeof _this.props.initialScrollOffset === "number" ? _this.props.initialScrollOffset : 0,
13968
+ scrollUpdateWasRequested: false
13969
+ };
13970
+ _this._callOnItemsRendered = void 0;
13971
+ _this._callOnItemsRendered = memoizeOne(function(overscanStartIndex, overscanStopIndex, visibleStartIndex, visibleStopIndex) {
13972
+ return _this.props.onItemsRendered({
13973
+ overscanStartIndex,
13974
+ overscanStopIndex,
13975
+ visibleStartIndex,
13976
+ visibleStopIndex
13977
+ });
13978
+ });
13979
+ _this._callOnScroll = void 0;
13980
+ _this._callOnScroll = memoizeOne(function(scrollDirection, scrollOffset, scrollUpdateWasRequested) {
13981
+ return _this.props.onScroll({
13982
+ scrollDirection,
13983
+ scrollOffset,
13984
+ scrollUpdateWasRequested
13985
+ });
13986
+ });
13987
+ _this._getItemStyle = void 0;
13988
+ _this._getItemStyle = function(index) {
13989
+ var _this$props = _this.props, direction = _this$props.direction, itemSize = _this$props.itemSize, layout = _this$props.layout;
13990
+ var itemStyleCache = _this._getItemStyleCache(shouldResetStyleCacheOnItemSizeChange && itemSize, shouldResetStyleCacheOnItemSizeChange && layout, shouldResetStyleCacheOnItemSizeChange && direction);
13991
+ var style2;
13992
+ if (itemStyleCache.hasOwnProperty(index)) {
13993
+ style2 = itemStyleCache[index];
13994
+ } else {
13995
+ var _offset = getItemOffset3(_this.props, index, _this._instanceProps);
13996
+ var size2 = getItemSize3(_this.props, index, _this._instanceProps);
13997
+ var isHorizontal = direction === "horizontal" || layout === "horizontal";
13998
+ var isRtl = direction === "rtl";
13999
+ var offsetHorizontal = isHorizontal ? _offset : 0;
14000
+ itemStyleCache[index] = style2 = {
14001
+ position: "absolute",
14002
+ left: isRtl ? void 0 : offsetHorizontal,
14003
+ right: isRtl ? offsetHorizontal : void 0,
14004
+ top: !isHorizontal ? _offset : 0,
14005
+ height: !isHorizontal ? size2 : "100%",
14006
+ width: isHorizontal ? size2 : "100%"
14007
+ };
14008
+ }
14009
+ return style2;
14010
+ };
14011
+ _this._getItemStyleCache = void 0;
14012
+ _this._getItemStyleCache = memoizeOne(function(_, __, ___) {
14013
+ return {};
14014
+ });
14015
+ _this._onScrollHorizontal = function(event) {
14016
+ var _event$currentTarget = event.currentTarget, clientWidth = _event$currentTarget.clientWidth, scrollLeft = _event$currentTarget.scrollLeft, scrollWidth = _event$currentTarget.scrollWidth;
14017
+ _this.setState(function(prevState) {
14018
+ if (prevState.scrollOffset === scrollLeft) {
14019
+ return null;
14020
+ }
14021
+ var direction = _this.props.direction;
14022
+ var scrollOffset = scrollLeft;
14023
+ if (direction === "rtl") {
14024
+ switch (getRTLOffsetType()) {
14025
+ case "negative":
14026
+ scrollOffset = -scrollLeft;
14027
+ break;
14028
+ case "positive-descending":
14029
+ scrollOffset = scrollWidth - clientWidth - scrollLeft;
14030
+ break;
14031
+ }
14032
+ }
14033
+ scrollOffset = Math.max(0, Math.min(scrollOffset, scrollWidth - clientWidth));
14034
+ return {
14035
+ isScrolling: true,
14036
+ scrollDirection: prevState.scrollOffset < scrollOffset ? "forward" : "backward",
14037
+ scrollOffset,
14038
+ scrollUpdateWasRequested: false
14039
+ };
14040
+ }, _this._resetIsScrollingDebounced);
14041
+ };
14042
+ _this._onScrollVertical = function(event) {
14043
+ var _event$currentTarget2 = event.currentTarget, clientHeight = _event$currentTarget2.clientHeight, scrollHeight = _event$currentTarget2.scrollHeight, scrollTop = _event$currentTarget2.scrollTop;
14044
+ _this.setState(function(prevState) {
14045
+ if (prevState.scrollOffset === scrollTop) {
14046
+ return null;
14047
+ }
14048
+ var scrollOffset = Math.max(0, Math.min(scrollTop, scrollHeight - clientHeight));
14049
+ return {
14050
+ isScrolling: true,
14051
+ scrollDirection: prevState.scrollOffset < scrollOffset ? "forward" : "backward",
14052
+ scrollOffset,
14053
+ scrollUpdateWasRequested: false
14054
+ };
14055
+ }, _this._resetIsScrollingDebounced);
14056
+ };
14057
+ _this._outerRefSetter = function(ref) {
14058
+ var outerRef = _this.props.outerRef;
14059
+ _this._outerRef = ref;
14060
+ if (typeof outerRef === "function") {
14061
+ outerRef(ref);
14062
+ } else if (outerRef != null && typeof outerRef === "object" && outerRef.hasOwnProperty("current")) {
14063
+ outerRef.current = ref;
14064
+ }
14065
+ };
14066
+ _this._resetIsScrollingDebounced = function() {
14067
+ if (_this._resetIsScrollingTimeoutId !== null) {
14068
+ cancelTimeout(_this._resetIsScrollingTimeoutId);
14069
+ }
14070
+ _this._resetIsScrollingTimeoutId = requestTimeout(_this._resetIsScrolling, IS_SCROLLING_DEBOUNCE_INTERVAL$1);
14071
+ };
14072
+ _this._resetIsScrolling = function() {
14073
+ _this._resetIsScrollingTimeoutId = null;
14074
+ _this.setState({
14075
+ isScrolling: false
14076
+ }, function() {
14077
+ _this._getItemStyleCache(-1, null);
14078
+ });
14079
+ };
14080
+ return _this;
14081
+ }
14082
+ List2.getDerivedStateFromProps = function getDerivedStateFromProps(nextProps, prevState) {
14083
+ validateSharedProps$1(nextProps, prevState);
14084
+ validateProps5(nextProps);
14085
+ return null;
14086
+ };
14087
+ var _proto = List2.prototype;
14088
+ _proto.scrollTo = function scrollTo(scrollOffset) {
14089
+ scrollOffset = Math.max(0, scrollOffset);
14090
+ this.setState(function(prevState) {
14091
+ if (prevState.scrollOffset === scrollOffset) {
14092
+ return null;
14093
+ }
14094
+ return {
14095
+ scrollDirection: prevState.scrollOffset < scrollOffset ? "forward" : "backward",
14096
+ scrollOffset,
14097
+ scrollUpdateWasRequested: true
14098
+ };
14099
+ }, this._resetIsScrollingDebounced);
14100
+ };
14101
+ _proto.scrollToItem = function scrollToItem(index, align) {
14102
+ if (align === void 0) {
14103
+ align = "auto";
14104
+ }
14105
+ var _this$props2 = this.props, itemCount = _this$props2.itemCount, layout = _this$props2.layout;
14106
+ var scrollOffset = this.state.scrollOffset;
14107
+ index = Math.max(0, Math.min(index, itemCount - 1));
14108
+ var scrollbarSize2 = 0;
14109
+ if (this._outerRef) {
14110
+ var outerRef = this._outerRef;
14111
+ if (layout === "vertical") {
14112
+ scrollbarSize2 = outerRef.scrollWidth > outerRef.clientWidth ? getScrollbarSize() : 0;
14113
+ } else {
14114
+ scrollbarSize2 = outerRef.scrollHeight > outerRef.clientHeight ? getScrollbarSize() : 0;
14115
+ }
14116
+ }
14117
+ this.scrollTo(getOffsetForIndexAndAlignment5(this.props, index, align, scrollOffset, this._instanceProps, scrollbarSize2));
14118
+ };
14119
+ _proto.componentDidMount = function componentDidMount() {
14120
+ var _this$props3 = this.props, direction = _this$props3.direction, initialScrollOffset = _this$props3.initialScrollOffset, layout = _this$props3.layout;
14121
+ if (typeof initialScrollOffset === "number" && this._outerRef != null) {
14122
+ var outerRef = this._outerRef;
14123
+ if (direction === "horizontal" || layout === "horizontal") {
14124
+ outerRef.scrollLeft = initialScrollOffset;
14125
+ } else {
14126
+ outerRef.scrollTop = initialScrollOffset;
14127
+ }
14128
+ }
14129
+ this._callPropsCallbacks();
14130
+ };
14131
+ _proto.componentDidUpdate = function componentDidUpdate() {
14132
+ var _this$props4 = this.props, direction = _this$props4.direction, layout = _this$props4.layout;
14133
+ var _this$state = this.state, scrollOffset = _this$state.scrollOffset, scrollUpdateWasRequested = _this$state.scrollUpdateWasRequested;
14134
+ if (scrollUpdateWasRequested && this._outerRef != null) {
14135
+ var outerRef = this._outerRef;
14136
+ if (direction === "horizontal" || layout === "horizontal") {
14137
+ if (direction === "rtl") {
14138
+ switch (getRTLOffsetType()) {
14139
+ case "negative":
14140
+ outerRef.scrollLeft = -scrollOffset;
14141
+ break;
14142
+ case "positive-ascending":
14143
+ outerRef.scrollLeft = scrollOffset;
14144
+ break;
14145
+ default:
14146
+ var clientWidth = outerRef.clientWidth, scrollWidth = outerRef.scrollWidth;
14147
+ outerRef.scrollLeft = scrollWidth - clientWidth - scrollOffset;
14148
+ break;
14149
+ }
14150
+ } else {
14151
+ outerRef.scrollLeft = scrollOffset;
14152
+ }
14153
+ } else {
14154
+ outerRef.scrollTop = scrollOffset;
14155
+ }
14156
+ }
14157
+ this._callPropsCallbacks();
14158
+ };
14159
+ _proto.componentWillUnmount = function componentWillUnmount() {
14160
+ if (this._resetIsScrollingTimeoutId !== null) {
14161
+ cancelTimeout(this._resetIsScrollingTimeoutId);
14162
+ }
14163
+ };
14164
+ _proto.render = function render() {
14165
+ var _this$props5 = this.props, children2 = _this$props5.children, className = _this$props5.className, direction = _this$props5.direction, height2 = _this$props5.height, innerRef = _this$props5.innerRef, innerElementType = _this$props5.innerElementType, innerTagName = _this$props5.innerTagName, itemCount = _this$props5.itemCount, itemData = _this$props5.itemData, _this$props5$itemKey = _this$props5.itemKey, itemKey = _this$props5$itemKey === void 0 ? defaultItemKey$1 : _this$props5$itemKey, layout = _this$props5.layout, outerElementType = _this$props5.outerElementType, outerTagName = _this$props5.outerTagName, style2 = _this$props5.style, useIsScrolling = _this$props5.useIsScrolling, width2 = _this$props5.width;
14166
+ var isScrolling = this.state.isScrolling;
14167
+ var isHorizontal = direction === "horizontal" || layout === "horizontal";
14168
+ var onScroll6 = isHorizontal ? this._onScrollHorizontal : this._onScrollVertical;
14169
+ var _this$_getRangeToRend = this._getRangeToRender(), startIndex = _this$_getRangeToRend[0], stopIndex = _this$_getRangeToRend[1];
14170
+ var items = [];
14171
+ if (itemCount > 0) {
14172
+ for (var _index = startIndex; _index <= stopIndex; _index++) {
14173
+ items.push(createElement(children2, {
14174
+ data: itemData,
14175
+ key: itemKey(_index, itemData),
14176
+ index: _index,
14177
+ isScrolling: useIsScrolling ? isScrolling : void 0,
14178
+ style: this._getItemStyle(_index)
14179
+ }));
14180
+ }
14181
+ }
14182
+ var estimatedTotalSize = getEstimatedTotalSize4(this.props, this._instanceProps);
14183
+ return createElement(outerElementType || outerTagName || "div", {
14184
+ className,
14185
+ onScroll: onScroll6,
14186
+ ref: this._outerRefSetter,
14187
+ style: _extends$1({
14188
+ position: "relative",
14189
+ height: height2,
14190
+ width: width2,
14191
+ overflow: "auto",
14192
+ WebkitOverflowScrolling: "touch",
14193
+ willChange: "transform",
14194
+ direction
14195
+ }, style2)
14196
+ }, createElement(innerElementType || innerTagName || "div", {
14197
+ children: items,
14198
+ ref: innerRef,
14199
+ style: {
14200
+ height: isHorizontal ? "100%" : estimatedTotalSize,
14201
+ pointerEvents: isScrolling ? "none" : void 0,
14202
+ width: isHorizontal ? estimatedTotalSize : "100%"
14203
+ }
14204
+ }));
14205
+ };
14206
+ _proto._callPropsCallbacks = function _callPropsCallbacks() {
14207
+ if (typeof this.props.onItemsRendered === "function") {
14208
+ var itemCount = this.props.itemCount;
14209
+ if (itemCount > 0) {
14210
+ var _this$_getRangeToRend2 = this._getRangeToRender(), _overscanStartIndex = _this$_getRangeToRend2[0], _overscanStopIndex = _this$_getRangeToRend2[1], _visibleStartIndex = _this$_getRangeToRend2[2], _visibleStopIndex = _this$_getRangeToRend2[3];
14211
+ this._callOnItemsRendered(_overscanStartIndex, _overscanStopIndex, _visibleStartIndex, _visibleStopIndex);
14212
+ }
14213
+ }
14214
+ if (typeof this.props.onScroll === "function") {
14215
+ var _this$state2 = this.state, _scrollDirection = _this$state2.scrollDirection, _scrollOffset = _this$state2.scrollOffset, _scrollUpdateWasRequested = _this$state2.scrollUpdateWasRequested;
14216
+ this._callOnScroll(_scrollDirection, _scrollOffset, _scrollUpdateWasRequested);
14217
+ }
14218
+ };
14219
+ _proto._getRangeToRender = function _getRangeToRender() {
14220
+ var _this$props6 = this.props, itemCount = _this$props6.itemCount, overscanCount = _this$props6.overscanCount;
14221
+ var _this$state3 = this.state, isScrolling = _this$state3.isScrolling, scrollDirection = _this$state3.scrollDirection, scrollOffset = _this$state3.scrollOffset;
14222
+ if (itemCount === 0) {
14223
+ return [0, 0, 0, 0];
14224
+ }
14225
+ var startIndex = getStartIndexForOffset3(this.props, scrollOffset, this._instanceProps);
14226
+ var stopIndex = getStopIndexForStartIndex3(this.props, startIndex, scrollOffset, this._instanceProps);
14227
+ var overscanBackward = !isScrolling || scrollDirection === "backward" ? Math.max(1, overscanCount) : 1;
14228
+ var overscanForward = !isScrolling || scrollDirection === "forward" ? Math.max(1, overscanCount) : 1;
14229
+ return [Math.max(0, startIndex - overscanBackward), Math.max(0, Math.min(itemCount - 1, stopIndex + overscanForward)), startIndex, stopIndex];
14230
+ };
14231
+ return List2;
14232
+ }(PureComponent), _class.defaultProps = {
14233
+ direction: "ltr",
14234
+ itemData: void 0,
14235
+ layout: "vertical",
14236
+ overscanCount: 2,
14237
+ useIsScrolling: false
14238
+ }, _class;
14239
+ }
14240
+ var validateSharedProps$1 = function validateSharedProps3(_ref2, _ref3) {
14241
+ var children2 = _ref2.children, direction = _ref2.direction, height2 = _ref2.height, layout = _ref2.layout, innerTagName = _ref2.innerTagName, outerTagName = _ref2.outerTagName, width2 = _ref2.width;
14242
+ var instance = _ref3.instance;
14243
+ {
14244
+ if (innerTagName != null || outerTagName != null) {
14245
+ if (devWarningsTagName$1 && !devWarningsTagName$1.has(instance)) {
14246
+ devWarningsTagName$1.add(instance);
14247
+ console.warn("The innerTagName and outerTagName props have been deprecated. Please use the innerElementType and outerElementType props instead.");
14248
+ }
14249
+ }
14250
+ var isHorizontal = direction === "horizontal" || layout === "horizontal";
14251
+ switch (direction) {
14252
+ case "horizontal":
14253
+ case "vertical":
14254
+ if (devWarningsDirection && !devWarningsDirection.has(instance)) {
14255
+ devWarningsDirection.add(instance);
14256
+ console.warn('The direction prop should be either "ltr" (default) or "rtl". Please use the layout prop to specify "vertical" (default) or "horizontal" orientation.');
14257
+ }
14258
+ break;
14259
+ case "ltr":
14260
+ case "rtl":
14261
+ break;
14262
+ default:
14263
+ throw Error('An invalid "direction" prop has been specified. Value should be either "ltr" or "rtl". ' + ('"' + direction + '" was specified.'));
14264
+ }
14265
+ switch (layout) {
14266
+ case "horizontal":
14267
+ case "vertical":
14268
+ break;
14269
+ default:
14270
+ throw Error('An invalid "layout" prop has been specified. Value should be either "horizontal" or "vertical". ' + ('"' + layout + '" was specified.'));
14271
+ }
14272
+ if (children2 == null) {
14273
+ throw Error('An invalid "children" prop has been specified. Value should be a React component. ' + ('"' + (children2 === null ? "null" : typeof children2) + '" was specified.'));
14274
+ }
14275
+ if (isHorizontal && typeof width2 !== "number") {
14276
+ throw Error('An invalid "width" prop has been specified. Horizontal lists must specify a number for width. ' + ('"' + (width2 === null ? "null" : typeof width2) + '" was specified.'));
14277
+ } else if (!isHorizontal && typeof height2 !== "number") {
14278
+ throw Error('An invalid "height" prop has been specified. Vertical lists must specify a number for height. ' + ('"' + (height2 === null ? "null" : typeof height2) + '" was specified.'));
14279
+ }
14280
+ }
14281
+ };
14282
+ var DEFAULT_ESTIMATED_ITEM_SIZE$1 = 50;
14283
+ var getItemMetadata$1 = function getItemMetadata3(props, index, instanceProps) {
14284
+ var _ref = props, itemSize = _ref.itemSize;
14285
+ var itemMetadataMap = instanceProps.itemMetadataMap, lastMeasuredIndex = instanceProps.lastMeasuredIndex;
14286
+ if (index > lastMeasuredIndex) {
14287
+ var offset2 = 0;
14288
+ if (lastMeasuredIndex >= 0) {
14289
+ var itemMetadata = itemMetadataMap[lastMeasuredIndex];
14290
+ offset2 = itemMetadata.offset + itemMetadata.size;
14291
+ }
14292
+ for (var i = lastMeasuredIndex + 1; i <= index; i++) {
14293
+ var size2 = itemSize(i);
14294
+ itemMetadataMap[i] = {
14295
+ offset: offset2,
14296
+ size: size2
14297
+ };
14298
+ offset2 += size2;
14299
+ }
14300
+ instanceProps.lastMeasuredIndex = index;
14301
+ }
14302
+ return itemMetadataMap[index];
14303
+ };
14304
+ var findNearestItem$1 = function findNearestItem3(props, instanceProps, offset2) {
14305
+ var itemMetadataMap = instanceProps.itemMetadataMap, lastMeasuredIndex = instanceProps.lastMeasuredIndex;
14306
+ var lastMeasuredItemOffset = lastMeasuredIndex > 0 ? itemMetadataMap[lastMeasuredIndex].offset : 0;
14307
+ if (lastMeasuredItemOffset >= offset2) {
14308
+ return findNearestItemBinarySearch$1(props, instanceProps, lastMeasuredIndex, 0, offset2);
14309
+ } else {
14310
+ return findNearestItemExponentialSearch$1(props, instanceProps, Math.max(0, lastMeasuredIndex), offset2);
14311
+ }
14312
+ };
14313
+ var findNearestItemBinarySearch$1 = function findNearestItemBinarySearch3(props, instanceProps, high, low, offset2) {
14314
+ while (low <= high) {
14315
+ var middle = low + Math.floor((high - low) / 2);
14316
+ var currentOffset = getItemMetadata$1(props, middle, instanceProps).offset;
14317
+ if (currentOffset === offset2) {
14318
+ return middle;
14319
+ } else if (currentOffset < offset2) {
14320
+ low = middle + 1;
14321
+ } else if (currentOffset > offset2) {
14322
+ high = middle - 1;
14323
+ }
14324
+ }
14325
+ if (low > 0) {
14326
+ return low - 1;
14327
+ } else {
14328
+ return 0;
14329
+ }
14330
+ };
14331
+ var findNearestItemExponentialSearch$1 = function findNearestItemExponentialSearch3(props, instanceProps, index, offset2) {
14332
+ var itemCount = props.itemCount;
14333
+ var interval = 1;
14334
+ while (index < itemCount && getItemMetadata$1(props, index, instanceProps).offset < offset2) {
14335
+ index += interval;
14336
+ interval *= 2;
14337
+ }
14338
+ return findNearestItemBinarySearch$1(props, instanceProps, Math.min(index, itemCount - 1), Math.floor(index / 2), offset2);
14339
+ };
14340
+ var getEstimatedTotalSize = function getEstimatedTotalSize2(_ref2, _ref3) {
14341
+ var itemCount = _ref2.itemCount;
14342
+ var itemMetadataMap = _ref3.itemMetadataMap, estimatedItemSize = _ref3.estimatedItemSize, lastMeasuredIndex = _ref3.lastMeasuredIndex;
14343
+ var totalSizeOfMeasuredItems = 0;
14344
+ if (lastMeasuredIndex >= itemCount) {
14345
+ lastMeasuredIndex = itemCount - 1;
14346
+ }
14347
+ if (lastMeasuredIndex >= 0) {
14348
+ var itemMetadata = itemMetadataMap[lastMeasuredIndex];
14349
+ totalSizeOfMeasuredItems = itemMetadata.offset + itemMetadata.size;
14350
+ }
14351
+ var numUnmeasuredItems = itemCount - lastMeasuredIndex - 1;
14352
+ var totalSizeOfUnmeasuredItems = numUnmeasuredItems * estimatedItemSize;
14353
+ return totalSizeOfMeasuredItems + totalSizeOfUnmeasuredItems;
14354
+ };
14355
+ var VariableSizeList$1 = /* @__PURE__ */ createListComponent({
14356
+ getItemOffset: function getItemOffset(props, index, instanceProps) {
14357
+ return getItemMetadata$1(props, index, instanceProps).offset;
14358
+ },
14359
+ getItemSize: function getItemSize(props, index, instanceProps) {
14360
+ return instanceProps.itemMetadataMap[index].size;
14361
+ },
14362
+ getEstimatedTotalSize,
14363
+ getOffsetForIndexAndAlignment: function getOffsetForIndexAndAlignment3(props, index, align, scrollOffset, instanceProps, scrollbarSize2) {
14364
+ var direction = props.direction, height2 = props.height, layout = props.layout, width2 = props.width;
14365
+ var isHorizontal = direction === "horizontal" || layout === "horizontal";
14366
+ var size2 = isHorizontal ? width2 : height2;
14367
+ var itemMetadata = getItemMetadata$1(props, index, instanceProps);
14368
+ var estimatedTotalSize = getEstimatedTotalSize(props, instanceProps);
14369
+ var maxOffset = Math.max(0, Math.min(estimatedTotalSize - size2, itemMetadata.offset));
14370
+ var minOffset = Math.max(0, itemMetadata.offset - size2 + itemMetadata.size + scrollbarSize2);
14371
+ if (align === "smart") {
14372
+ if (scrollOffset >= minOffset - size2 && scrollOffset <= maxOffset + size2) {
14373
+ align = "auto";
14374
+ } else {
14375
+ align = "center";
14376
+ }
14377
+ }
14378
+ switch (align) {
14379
+ case "start":
14380
+ return maxOffset;
14381
+ case "end":
14382
+ return minOffset;
14383
+ case "center":
14384
+ return Math.round(minOffset + (maxOffset - minOffset) / 2);
14385
+ case "auto":
14386
+ default:
14387
+ if (scrollOffset >= minOffset && scrollOffset <= maxOffset) {
14388
+ return scrollOffset;
14389
+ } else if (scrollOffset < minOffset) {
14390
+ return minOffset;
14391
+ } else {
14392
+ return maxOffset;
14393
+ }
14394
+ }
14395
+ },
14396
+ getStartIndexForOffset: function getStartIndexForOffset(props, offset2, instanceProps) {
14397
+ return findNearestItem$1(props, instanceProps, offset2);
14398
+ },
14399
+ getStopIndexForStartIndex: function getStopIndexForStartIndex(props, startIndex, scrollOffset, instanceProps) {
14400
+ var direction = props.direction, height2 = props.height, itemCount = props.itemCount, layout = props.layout, width2 = props.width;
14401
+ var isHorizontal = direction === "horizontal" || layout === "horizontal";
14402
+ var size2 = isHorizontal ? width2 : height2;
14403
+ var itemMetadata = getItemMetadata$1(props, startIndex, instanceProps);
14404
+ var maxOffset = scrollOffset + size2;
14405
+ var offset2 = itemMetadata.offset + itemMetadata.size;
14406
+ var stopIndex = startIndex;
14407
+ while (stopIndex < itemCount - 1 && offset2 < maxOffset) {
14408
+ stopIndex++;
14409
+ offset2 += getItemMetadata$1(props, stopIndex, instanceProps).size;
14410
+ }
14411
+ return stopIndex;
14412
+ },
14413
+ initInstanceProps: function initInstanceProps2(props, instance) {
14414
+ var _ref4 = props, estimatedItemSize = _ref4.estimatedItemSize;
14415
+ var instanceProps = {
14416
+ itemMetadataMap: {},
14417
+ estimatedItemSize: estimatedItemSize || DEFAULT_ESTIMATED_ITEM_SIZE$1,
14418
+ lastMeasuredIndex: -1
14419
+ };
14420
+ instance.resetAfterIndex = function(index, shouldForceUpdate) {
14421
+ if (shouldForceUpdate === void 0) {
14422
+ shouldForceUpdate = true;
14423
+ }
14424
+ instanceProps.lastMeasuredIndex = Math.min(instanceProps.lastMeasuredIndex, index - 1);
14425
+ instance._getItemStyleCache(-1);
14426
+ if (shouldForceUpdate) {
14427
+ instance.forceUpdate();
14428
+ }
14429
+ };
14430
+ return instanceProps;
14431
+ },
14432
+ shouldResetStyleCacheOnItemSizeChange: false,
14433
+ validateProps: function validateProps2(_ref5) {
14434
+ var itemSize = _ref5.itemSize;
14435
+ {
14436
+ if (typeof itemSize !== "function") {
14437
+ throw Error('An invalid "itemSize" prop has been specified. Value should be a function. ' + ('"' + (itemSize === null ? "null" : typeof itemSize) + '" was specified.'));
14438
+ }
14439
+ }
14440
+ }
14441
+ });
14442
+ const VariableSizeList = VariableSizeList$1;
14443
+ const LIST_ROW_HEIGHT = 48;
14444
+ makeStyles()(() => ({
14445
+ searchInput: {
14446
+ lineHeight: "initial",
14447
+ height: "auto !important"
14448
+ }
14449
+ }));
14450
+ const OuterElementContext = React__default.createContext({});
14451
+ const OuterElementType = React__default.forwardRef((props, ref) => {
14452
+ const outerProps = React__default.useContext(OuterElementContext);
14453
+ return jsxRuntimeExports.jsx("div", { ref, ...props, ...outerProps });
14454
+ });
14455
+ function ListRow(props) {
14456
+ const { data, index, style: style2 } = props;
14457
+ const dataSet = data[index];
14458
+ const inlineStyle = {
14459
+ ...style2,
14460
+ top: style2.top + 8
14461
+ };
14462
+ const [props0, option, getItemLabel] = dataSet;
14463
+ const { key, ...optionProps } = props0;
14464
+ return jsxRuntimeExports.jsx(Typography, { component: "li", ...optionProps, noWrap: true, style: inlineStyle, children: getItemLabel(option) }, key);
14465
+ }
14466
+ function useResetCache(itemCount) {
14467
+ const ref = useRef(null);
14468
+ useEffect(() => {
14469
+ if (ref.current != null) {
14470
+ ref.current.resetAfterIndex(0, true);
14471
+ }
14472
+ }, [itemCount]);
14473
+ return ref;
14474
+ }
14475
+ React__default.forwardRef((props, ref) => {
14476
+ const { children: children2, ...other } = props;
14477
+ const items = children2;
14478
+ const itemCount = items.length;
14479
+ const gridRef = useResetCache(itemCount);
14480
+ return jsxRuntimeExports.jsx("div", { ref, children: jsxRuntimeExports.jsx(OuterElementContext.Provider, { value: other, children: jsxRuntimeExports.jsx(VariableSizeList, { height: Math.min(8, itemCount) * LIST_ROW_HEIGHT, itemSize: () => LIST_ROW_HEIGHT, width: "100%", innerElementType: "ul", outerElementType: OuterElementType, overscanCount: 5, ref: gridRef, itemCount, itemData: items, children: ListRow }) }) });
14481
+ });
13495
14482
  function _classCallCheck(a, n) {
13496
14483
  if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function");
13497
14484
  }
@@ -16048,7 +17035,7 @@ var Grid = /* @__PURE__ */ function(_React$PureComponent) {
16048
17035
  }, {
16049
17036
  key: "componentDidMount",
16050
17037
  value: function componentDidMount() {
16051
- var _this$props4 = this.props, getScrollbarSize = _this$props4.getScrollbarSize, height2 = _this$props4.height, scrollLeft = _this$props4.scrollLeft, scrollToColumn = _this$props4.scrollToColumn, scrollTop = _this$props4.scrollTop, scrollToRow = _this$props4.scrollToRow, width2 = _this$props4.width;
17038
+ var _this$props4 = this.props, getScrollbarSize2 = _this$props4.getScrollbarSize, height2 = _this$props4.height, scrollLeft = _this$props4.scrollLeft, scrollToColumn = _this$props4.scrollToColumn, scrollTop = _this$props4.scrollTop, scrollToRow = _this$props4.scrollToRow, width2 = _this$props4.width;
16052
17039
  var instanceProps = this.state.instanceProps;
16053
17040
  this._initialScrollTop = 0;
16054
17041
  this._initialScrollLeft = 0;
@@ -16058,7 +17045,7 @@ var Grid = /* @__PURE__ */ function(_React$PureComponent) {
16058
17045
  var stateUpdate2 = _objectSpread$4(_objectSpread$4({}, prevState), {}, {
16059
17046
  needToResetStyleCache: false
16060
17047
  });
16061
- stateUpdate2.instanceProps.scrollbarSize = getScrollbarSize();
17048
+ stateUpdate2.instanceProps.scrollbarSize = getScrollbarSize2();
16062
17049
  stateUpdate2.instanceProps.scrollbarSizeMeasured = true;
16063
17050
  return stateUpdate2;
16064
17051
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vitessce/feature-list",
3
- "version": "3.9.2",
3
+ "version": "3.9.4",
4
4
  "author": "HIDIVE Lab at HMS",
5
5
  "homepage": "http://vitessce.io",
6
6
  "repository": {
@@ -21,10 +21,10 @@
21
21
  "react-virtualized": "^9.22.6",
22
22
  "uuid": "^9.0.0",
23
23
  "react-aria": "^3.28.0",
24
- "@vitessce/constants-internal": "3.9.2",
25
- "@vitessce/utils": "3.9.2",
26
- "@vitessce/vit-s": "3.9.2",
27
- "@vitessce/styles": "3.9.2"
24
+ "@vitessce/styles": "3.9.4",
25
+ "@vitessce/constants-internal": "3.9.4",
26
+ "@vitessce/utils": "3.9.4",
27
+ "@vitessce/vit-s": "3.9.4"
28
28
  },
29
29
  "devDependencies": {
30
30
  "@testing-library/jest-dom": "^6.6.3",