@vitessce/tooltip 3.9.2 → 3.9.3
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/dist/index.js +1054 -30
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import React__default, { useContext, forwardRef, useRef, useMemo, createContext, createElement,
|
|
2
|
+
import React__default, { useContext, forwardRef, useRef, useMemo, createContext, createElement, PureComponent, useEffect, useState } from "react";
|
|
3
3
|
import * as ReactDOM from "react-dom";
|
|
4
4
|
import { useVitessceContainer } from "@vitessce/vit-s";
|
|
5
5
|
function sheetForTag(tag) {
|
|
@@ -395,9 +395,9 @@ function parse(value, root, parent, rule, rules, rulesets, pseudo, points, decla
|
|
|
395
395
|
function ruleset(value, root, parent, index, offset2, rules, points, type, props, children, length2) {
|
|
396
396
|
var post = offset2 - 1;
|
|
397
397
|
var rule = offset2 === 0 ? rules : [""];
|
|
398
|
-
var
|
|
398
|
+
var size2 = sizeof(rule);
|
|
399
399
|
for (var i = 0, j = 0, k = 0; i < index; ++i)
|
|
400
|
-
for (var x = 0, y = substr(value, post + 1, post = abs(j = points[i])), z = value; x <
|
|
400
|
+
for (var x = 0, y = substr(value, post + 1, post = abs(j = points[i])), z = value; x < size2; ++x)
|
|
401
401
|
if (z = trim(j > 0 ? rule[x] + " " + y : replace(y, /&\f/g, rule[x])))
|
|
402
402
|
props[k++] = z;
|
|
403
403
|
return node(value, root, parent, offset2 === 0 ? RULESET : type, props, children, length2);
|
|
@@ -790,14 +790,14 @@ var createCache = function createCache2(options) {
|
|
|
790
790
|
cache.sheet.hydrate(nodesToHydrate);
|
|
791
791
|
return cache;
|
|
792
792
|
};
|
|
793
|
-
function _extends$
|
|
794
|
-
return _extends$
|
|
793
|
+
function _extends$2() {
|
|
794
|
+
return _extends$2 = Object.assign ? Object.assign.bind() : function(n) {
|
|
795
795
|
for (var e = 1; e < arguments.length; e++) {
|
|
796
796
|
var t = arguments[e];
|
|
797
797
|
for (var r2 in t) ({}).hasOwnProperty.call(t, r2) && (n[r2] = t[r2]);
|
|
798
798
|
}
|
|
799
799
|
return n;
|
|
800
|
-
}, _extends$
|
|
800
|
+
}, _extends$2.apply(null, arguments);
|
|
801
801
|
}
|
|
802
802
|
function getDefaultExportFromCjs(x) {
|
|
803
803
|
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
|
|
@@ -2115,7 +2115,7 @@ var createStyled$1 = function createStyled(tag, options) {
|
|
|
2115
2115
|
}
|
|
2116
2116
|
});
|
|
2117
2117
|
Styled.withComponent = function(nextTag, nextOptions) {
|
|
2118
|
-
var newStyled2 = createStyled(nextTag, _extends$
|
|
2118
|
+
var newStyled2 = createStyled(nextTag, _extends$2({}, options, nextOptions, {
|
|
2119
2119
|
shouldForwardProp: composeShouldForwardProps(Styled, nextOptions, true)
|
|
2120
2120
|
}));
|
|
2121
2121
|
return newStyled2.apply(void 0, styles);
|
|
@@ -5102,6 +5102,56 @@ const systemDefaultTheme$1 = createTheme$1();
|
|
|
5102
5102
|
function useTheme$1(defaultTheme2 = systemDefaultTheme$1) {
|
|
5103
5103
|
return useTheme$2(defaultTheme2);
|
|
5104
5104
|
}
|
|
5105
|
+
const splitProps = (props) => {
|
|
5106
|
+
var _a;
|
|
5107
|
+
const result = {
|
|
5108
|
+
systemProps: {},
|
|
5109
|
+
otherProps: {}
|
|
5110
|
+
};
|
|
5111
|
+
const config = ((_a = props == null ? void 0 : props.theme) == null ? void 0 : _a.unstable_sxConfig) ?? defaultSxConfig;
|
|
5112
|
+
Object.keys(props).forEach((prop) => {
|
|
5113
|
+
if (config[prop]) {
|
|
5114
|
+
result.systemProps[prop] = props[prop];
|
|
5115
|
+
} else {
|
|
5116
|
+
result.otherProps[prop] = props[prop];
|
|
5117
|
+
}
|
|
5118
|
+
});
|
|
5119
|
+
return result;
|
|
5120
|
+
};
|
|
5121
|
+
function extendSxProp$1(props) {
|
|
5122
|
+
const {
|
|
5123
|
+
sx: inSx,
|
|
5124
|
+
...other
|
|
5125
|
+
} = props;
|
|
5126
|
+
const {
|
|
5127
|
+
systemProps,
|
|
5128
|
+
otherProps
|
|
5129
|
+
} = splitProps(other);
|
|
5130
|
+
let finalSx;
|
|
5131
|
+
if (Array.isArray(inSx)) {
|
|
5132
|
+
finalSx = [systemProps, ...inSx];
|
|
5133
|
+
} else if (typeof inSx === "function") {
|
|
5134
|
+
finalSx = (...args) => {
|
|
5135
|
+
const result = inSx(...args);
|
|
5136
|
+
if (!isPlainObject(result)) {
|
|
5137
|
+
return systemProps;
|
|
5138
|
+
}
|
|
5139
|
+
return {
|
|
5140
|
+
...systemProps,
|
|
5141
|
+
...result
|
|
5142
|
+
};
|
|
5143
|
+
};
|
|
5144
|
+
} else {
|
|
5145
|
+
finalSx = {
|
|
5146
|
+
...systemProps,
|
|
5147
|
+
...inSx
|
|
5148
|
+
};
|
|
5149
|
+
}
|
|
5150
|
+
return {
|
|
5151
|
+
...otherProps,
|
|
5152
|
+
sx: finalSx
|
|
5153
|
+
};
|
|
5154
|
+
}
|
|
5105
5155
|
const defaultGenerator = (componentName) => componentName;
|
|
5106
5156
|
const createClassNameGenerator = () => {
|
|
5107
5157
|
let generate = defaultGenerator;
|
|
@@ -6464,17 +6514,17 @@ function createTypography(palette, typography) {
|
|
|
6464
6514
|
}
|
|
6465
6515
|
}
|
|
6466
6516
|
const coef = fontSize / 14;
|
|
6467
|
-
const pxToRem = pxToRem2 || ((
|
|
6468
|
-
const buildVariant = (fontWeight,
|
|
6517
|
+
const pxToRem = pxToRem2 || ((size2) => `${size2 / htmlFontSize * coef}rem`);
|
|
6518
|
+
const buildVariant = (fontWeight, size2, lineHeight, letterSpacing, casing) => ({
|
|
6469
6519
|
fontFamily,
|
|
6470
6520
|
fontWeight,
|
|
6471
|
-
fontSize: pxToRem(
|
|
6521
|
+
fontSize: pxToRem(size2),
|
|
6472
6522
|
// Unitless following https://meyerweb.com/eric/thoughts/2006/02/08/unitless-line-heights/
|
|
6473
6523
|
lineHeight,
|
|
6474
6524
|
// The letter spacing was designed for the Roboto font-family. Using the same letter-spacing
|
|
6475
6525
|
// across font-families can cause issues with the kerning.
|
|
6476
6526
|
...fontFamily === defaultFontFamily ? {
|
|
6477
|
-
letterSpacing: `${round(letterSpacing /
|
|
6527
|
+
letterSpacing: `${round(letterSpacing / size2)}em`
|
|
6478
6528
|
} : {},
|
|
6479
6529
|
...casing,
|
|
6480
6530
|
...allVariants
|
|
@@ -7285,6 +7335,9 @@ const { tss } = createTss({
|
|
|
7285
7335
|
"usePlugin": useMuiThemeStyleOverridesPlugin
|
|
7286
7336
|
});
|
|
7287
7337
|
const useStyles$2 = tss.create({});
|
|
7338
|
+
function internal_createExtendSxProp() {
|
|
7339
|
+
return extendSxProp$1;
|
|
7340
|
+
}
|
|
7288
7341
|
const memoTheme = unstable_memoTheme;
|
|
7289
7342
|
({
|
|
7290
7343
|
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
|
@@ -7401,7 +7454,7 @@ function getPaperUtilityClass(slot) {
|
|
|
7401
7454
|
return generateUtilityClass("MuiPaper", slot);
|
|
7402
7455
|
}
|
|
7403
7456
|
generateUtilityClasses("MuiPaper", ["root", "rounded", "outlined", "elevation", "elevation0", "elevation1", "elevation2", "elevation3", "elevation4", "elevation5", "elevation6", "elevation7", "elevation8", "elevation9", "elevation10", "elevation11", "elevation12", "elevation13", "elevation14", "elevation15", "elevation16", "elevation17", "elevation18", "elevation19", "elevation20", "elevation21", "elevation22", "elevation23", "elevation24"]);
|
|
7404
|
-
const useUtilityClasses = (ownerState) => {
|
|
7457
|
+
const useUtilityClasses$1 = (ownerState) => {
|
|
7405
7458
|
const {
|
|
7406
7459
|
square,
|
|
7407
7460
|
elevation,
|
|
@@ -7474,7 +7527,7 @@ const Paper = /* @__PURE__ */ React.forwardRef(function Paper2(inProps, ref) {
|
|
|
7474
7527
|
square,
|
|
7475
7528
|
variant
|
|
7476
7529
|
};
|
|
7477
|
-
const classes = useUtilityClasses(ownerState);
|
|
7530
|
+
const classes = useUtilityClasses$1(ownerState);
|
|
7478
7531
|
{
|
|
7479
7532
|
if (theme.shadows[elevation] === void 0) {
|
|
7480
7533
|
console.error([`MUI: The elevation provided <Paper elevation={${elevation}}> is not available in the theme.`, `Please make sure that \`theme.shadows[${elevation}]\` is defined.`].join("\n"));
|
|
@@ -7556,6 +7609,23 @@ Paper.propTypes = {
|
|
|
7556
7609
|
*/
|
|
7557
7610
|
variant: PropTypes.oneOfType([PropTypes.oneOf(["elevation", "outlined"]), PropTypes.string])
|
|
7558
7611
|
};
|
|
7612
|
+
function hasCorrectMainProperty(obj) {
|
|
7613
|
+
return typeof obj.main === "string";
|
|
7614
|
+
}
|
|
7615
|
+
function checkSimplePaletteColorValues(obj, additionalPropertiesToCheck = []) {
|
|
7616
|
+
if (!hasCorrectMainProperty(obj)) {
|
|
7617
|
+
return false;
|
|
7618
|
+
}
|
|
7619
|
+
for (const value of additionalPropertiesToCheck) {
|
|
7620
|
+
if (!obj.hasOwnProperty(value) || typeof obj[value] !== "string") {
|
|
7621
|
+
return false;
|
|
7622
|
+
}
|
|
7623
|
+
}
|
|
7624
|
+
return true;
|
|
7625
|
+
}
|
|
7626
|
+
function createSimplePaletteValueFilter(additionalPropertiesToCheck = []) {
|
|
7627
|
+
return ([, value]) => value && checkSimplePaletteColorValues(value, additionalPropertiesToCheck);
|
|
7628
|
+
}
|
|
7559
7629
|
function HTMLElementType(props, propName, componentName, location, propFullName) {
|
|
7560
7630
|
const propValue = props[propName];
|
|
7561
7631
|
const safePropName = propFullName || propName;
|
|
@@ -7639,6 +7709,266 @@ Portal.propTypes = {
|
|
|
7639
7709
|
{
|
|
7640
7710
|
Portal["propTypes"] = exactProp(Portal.propTypes);
|
|
7641
7711
|
}
|
|
7712
|
+
function getTypographyUtilityClass(slot) {
|
|
7713
|
+
return generateUtilityClass("MuiTypography", slot);
|
|
7714
|
+
}
|
|
7715
|
+
generateUtilityClasses("MuiTypography", ["root", "h1", "h2", "h3", "h4", "h5", "h6", "subtitle1", "subtitle2", "body1", "body2", "inherit", "button", "caption", "overline", "alignLeft", "alignRight", "alignCenter", "alignJustify", "noWrap", "gutterBottom", "paragraph"]);
|
|
7716
|
+
const v6Colors = {
|
|
7717
|
+
primary: true,
|
|
7718
|
+
secondary: true,
|
|
7719
|
+
error: true,
|
|
7720
|
+
info: true,
|
|
7721
|
+
success: true,
|
|
7722
|
+
warning: true,
|
|
7723
|
+
textPrimary: true,
|
|
7724
|
+
textSecondary: true,
|
|
7725
|
+
textDisabled: true
|
|
7726
|
+
};
|
|
7727
|
+
const extendSxProp = internal_createExtendSxProp();
|
|
7728
|
+
const useUtilityClasses = (ownerState) => {
|
|
7729
|
+
const {
|
|
7730
|
+
align,
|
|
7731
|
+
gutterBottom,
|
|
7732
|
+
noWrap,
|
|
7733
|
+
paragraph,
|
|
7734
|
+
variant,
|
|
7735
|
+
classes
|
|
7736
|
+
} = ownerState;
|
|
7737
|
+
const slots = {
|
|
7738
|
+
root: ["root", variant, ownerState.align !== "inherit" && `align${capitalize(align)}`, gutterBottom && "gutterBottom", noWrap && "noWrap", paragraph && "paragraph"]
|
|
7739
|
+
};
|
|
7740
|
+
return composeClasses(slots, getTypographyUtilityClass, classes);
|
|
7741
|
+
};
|
|
7742
|
+
const TypographyRoot = styled("span", {
|
|
7743
|
+
name: "MuiTypography",
|
|
7744
|
+
slot: "Root",
|
|
7745
|
+
overridesResolver: (props, styles) => {
|
|
7746
|
+
const {
|
|
7747
|
+
ownerState
|
|
7748
|
+
} = props;
|
|
7749
|
+
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];
|
|
7750
|
+
}
|
|
7751
|
+
})(memoTheme(({
|
|
7752
|
+
theme
|
|
7753
|
+
}) => {
|
|
7754
|
+
var _a;
|
|
7755
|
+
return {
|
|
7756
|
+
margin: 0,
|
|
7757
|
+
variants: [{
|
|
7758
|
+
props: {
|
|
7759
|
+
variant: "inherit"
|
|
7760
|
+
},
|
|
7761
|
+
style: {
|
|
7762
|
+
// Some elements, like <button> on Chrome have default font that doesn't inherit, reset this.
|
|
7763
|
+
font: "inherit",
|
|
7764
|
+
lineHeight: "inherit",
|
|
7765
|
+
letterSpacing: "inherit"
|
|
7766
|
+
}
|
|
7767
|
+
}, ...Object.entries(theme.typography).filter(([variant, value]) => variant !== "inherit" && value && typeof value === "object").map(([variant, value]) => ({
|
|
7768
|
+
props: {
|
|
7769
|
+
variant
|
|
7770
|
+
},
|
|
7771
|
+
style: value
|
|
7772
|
+
})), ...Object.entries(theme.palette).filter(createSimplePaletteValueFilter()).map(([color2]) => ({
|
|
7773
|
+
props: {
|
|
7774
|
+
color: color2
|
|
7775
|
+
},
|
|
7776
|
+
style: {
|
|
7777
|
+
color: (theme.vars || theme).palette[color2].main
|
|
7778
|
+
}
|
|
7779
|
+
})), ...Object.entries(((_a = theme.palette) == null ? void 0 : _a.text) || {}).filter(([, value]) => typeof value === "string").map(([color2]) => ({
|
|
7780
|
+
props: {
|
|
7781
|
+
color: `text${capitalize(color2)}`
|
|
7782
|
+
},
|
|
7783
|
+
style: {
|
|
7784
|
+
color: (theme.vars || theme).palette.text[color2]
|
|
7785
|
+
}
|
|
7786
|
+
})), {
|
|
7787
|
+
props: ({
|
|
7788
|
+
ownerState
|
|
7789
|
+
}) => ownerState.align !== "inherit",
|
|
7790
|
+
style: {
|
|
7791
|
+
textAlign: "var(--Typography-textAlign)"
|
|
7792
|
+
}
|
|
7793
|
+
}, {
|
|
7794
|
+
props: ({
|
|
7795
|
+
ownerState
|
|
7796
|
+
}) => ownerState.noWrap,
|
|
7797
|
+
style: {
|
|
7798
|
+
overflow: "hidden",
|
|
7799
|
+
textOverflow: "ellipsis",
|
|
7800
|
+
whiteSpace: "nowrap"
|
|
7801
|
+
}
|
|
7802
|
+
}, {
|
|
7803
|
+
props: ({
|
|
7804
|
+
ownerState
|
|
7805
|
+
}) => ownerState.gutterBottom,
|
|
7806
|
+
style: {
|
|
7807
|
+
marginBottom: "0.35em"
|
|
7808
|
+
}
|
|
7809
|
+
}, {
|
|
7810
|
+
props: ({
|
|
7811
|
+
ownerState
|
|
7812
|
+
}) => ownerState.paragraph,
|
|
7813
|
+
style: {
|
|
7814
|
+
marginBottom: 16
|
|
7815
|
+
}
|
|
7816
|
+
}]
|
|
7817
|
+
};
|
|
7818
|
+
}));
|
|
7819
|
+
const defaultVariantMapping = {
|
|
7820
|
+
h1: "h1",
|
|
7821
|
+
h2: "h2",
|
|
7822
|
+
h3: "h3",
|
|
7823
|
+
h4: "h4",
|
|
7824
|
+
h5: "h5",
|
|
7825
|
+
h6: "h6",
|
|
7826
|
+
subtitle1: "h6",
|
|
7827
|
+
subtitle2: "h6",
|
|
7828
|
+
body1: "p",
|
|
7829
|
+
body2: "p",
|
|
7830
|
+
inherit: "p"
|
|
7831
|
+
};
|
|
7832
|
+
const Typography = /* @__PURE__ */ React.forwardRef(function Typography2(inProps, ref) {
|
|
7833
|
+
const {
|
|
7834
|
+
color: color2,
|
|
7835
|
+
...themeProps
|
|
7836
|
+
} = useDefaultProps({
|
|
7837
|
+
props: inProps,
|
|
7838
|
+
name: "MuiTypography"
|
|
7839
|
+
});
|
|
7840
|
+
const isSxColor = !v6Colors[color2];
|
|
7841
|
+
const props = extendSxProp({
|
|
7842
|
+
...themeProps,
|
|
7843
|
+
...isSxColor && {
|
|
7844
|
+
color: color2
|
|
7845
|
+
}
|
|
7846
|
+
});
|
|
7847
|
+
const {
|
|
7848
|
+
align = "inherit",
|
|
7849
|
+
className,
|
|
7850
|
+
component,
|
|
7851
|
+
gutterBottom = false,
|
|
7852
|
+
noWrap = false,
|
|
7853
|
+
paragraph = false,
|
|
7854
|
+
variant = "body1",
|
|
7855
|
+
variantMapping = defaultVariantMapping,
|
|
7856
|
+
...other
|
|
7857
|
+
} = props;
|
|
7858
|
+
const ownerState = {
|
|
7859
|
+
...props,
|
|
7860
|
+
align,
|
|
7861
|
+
color: color2,
|
|
7862
|
+
className,
|
|
7863
|
+
component,
|
|
7864
|
+
gutterBottom,
|
|
7865
|
+
noWrap,
|
|
7866
|
+
paragraph,
|
|
7867
|
+
variant,
|
|
7868
|
+
variantMapping
|
|
7869
|
+
};
|
|
7870
|
+
const Component = component || (paragraph ? "p" : variantMapping[variant] || defaultVariantMapping[variant]) || "span";
|
|
7871
|
+
const classes = useUtilityClasses(ownerState);
|
|
7872
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(TypographyRoot, {
|
|
7873
|
+
as: Component,
|
|
7874
|
+
ref,
|
|
7875
|
+
className: clsx(classes.root, className),
|
|
7876
|
+
...other,
|
|
7877
|
+
ownerState,
|
|
7878
|
+
style: {
|
|
7879
|
+
...align !== "inherit" && {
|
|
7880
|
+
"--Typography-textAlign": align
|
|
7881
|
+
},
|
|
7882
|
+
...other.style
|
|
7883
|
+
}
|
|
7884
|
+
});
|
|
7885
|
+
});
|
|
7886
|
+
Typography.propTypes = {
|
|
7887
|
+
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
|
7888
|
+
// │ These PropTypes are generated from the TypeScript type definitions. │
|
|
7889
|
+
// │ To update them, edit the d.ts file and run `pnpm proptypes`. │
|
|
7890
|
+
// └─────────────────────────────────────────────────────────────────────┘
|
|
7891
|
+
/**
|
|
7892
|
+
* Set the text-align on the component.
|
|
7893
|
+
* @default 'inherit'
|
|
7894
|
+
*/
|
|
7895
|
+
align: PropTypes.oneOf(["center", "inherit", "justify", "left", "right"]),
|
|
7896
|
+
/**
|
|
7897
|
+
* The content of the component.
|
|
7898
|
+
*/
|
|
7899
|
+
children: PropTypes.node,
|
|
7900
|
+
/**
|
|
7901
|
+
* Override or extend the styles applied to the component.
|
|
7902
|
+
*/
|
|
7903
|
+
classes: PropTypes.object,
|
|
7904
|
+
/**
|
|
7905
|
+
* @ignore
|
|
7906
|
+
*/
|
|
7907
|
+
className: PropTypes.string,
|
|
7908
|
+
/**
|
|
7909
|
+
* The color of the component.
|
|
7910
|
+
* It supports both default and custom theme colors, which can be added as shown in the
|
|
7911
|
+
* [palette customization guide](https://mui.com/material-ui/customization/palette/#custom-colors).
|
|
7912
|
+
*/
|
|
7913
|
+
color: PropTypes.oneOfType([PropTypes.oneOf(["primary", "secondary", "success", "error", "info", "warning", "textPrimary", "textSecondary", "textDisabled"]), PropTypes.string]),
|
|
7914
|
+
/**
|
|
7915
|
+
* The component used for the root node.
|
|
7916
|
+
* Either a string to use a HTML element or a component.
|
|
7917
|
+
*/
|
|
7918
|
+
component: PropTypes.elementType,
|
|
7919
|
+
/**
|
|
7920
|
+
* If `true`, the text will have a bottom margin.
|
|
7921
|
+
* @default false
|
|
7922
|
+
*/
|
|
7923
|
+
gutterBottom: PropTypes.bool,
|
|
7924
|
+
/**
|
|
7925
|
+
* If `true`, the text will not wrap, but instead will truncate with a text overflow ellipsis.
|
|
7926
|
+
*
|
|
7927
|
+
* Note that text overflow can only happen with block or inline-block level elements
|
|
7928
|
+
* (the element needs to have a width in order to overflow).
|
|
7929
|
+
* @default false
|
|
7930
|
+
*/
|
|
7931
|
+
noWrap: PropTypes.bool,
|
|
7932
|
+
/**
|
|
7933
|
+
* If `true`, the element will be a paragraph element.
|
|
7934
|
+
* @default false
|
|
7935
|
+
* @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.
|
|
7936
|
+
*/
|
|
7937
|
+
paragraph: PropTypes.bool,
|
|
7938
|
+
/**
|
|
7939
|
+
* @ignore
|
|
7940
|
+
*/
|
|
7941
|
+
style: PropTypes.object,
|
|
7942
|
+
/**
|
|
7943
|
+
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
7944
|
+
*/
|
|
7945
|
+
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
7946
|
+
/**
|
|
7947
|
+
* Applies the theme typography styles.
|
|
7948
|
+
* @default 'body1'
|
|
7949
|
+
*/
|
|
7950
|
+
variant: PropTypes.oneOfType([PropTypes.oneOf(["body1", "body2", "button", "caption", "h1", "h2", "h3", "h4", "h5", "h6", "inherit", "overline", "subtitle1", "subtitle2"]), PropTypes.string]),
|
|
7951
|
+
/**
|
|
7952
|
+
* The component maps the variant prop to a range of different HTML element types.
|
|
7953
|
+
* For instance, subtitle1 to `<h6>`.
|
|
7954
|
+
* If you wish to change that mapping, you can provide your own.
|
|
7955
|
+
* Alternatively, you can use the `component` prop.
|
|
7956
|
+
* @default {
|
|
7957
|
+
* h1: 'h1',
|
|
7958
|
+
* h2: 'h2',
|
|
7959
|
+
* h3: 'h3',
|
|
7960
|
+
* h4: 'h4',
|
|
7961
|
+
* h5: 'h5',
|
|
7962
|
+
* h6: 'h6',
|
|
7963
|
+
* subtitle1: 'h6',
|
|
7964
|
+
* subtitle2: 'h6',
|
|
7965
|
+
* body1: 'p',
|
|
7966
|
+
* body2: 'p',
|
|
7967
|
+
* inherit: 'p',
|
|
7968
|
+
* }
|
|
7969
|
+
*/
|
|
7970
|
+
variantMapping: PropTypes.object
|
|
7971
|
+
};
|
|
7642
7972
|
/**!
|
|
7643
7973
|
* @fileOverview Kickass library to create and place poppers near their reference elements.
|
|
7644
7974
|
* @version 1.16.1
|
|
@@ -7877,7 +8207,7 @@ var defineProperty = function(obj, key, value) {
|
|
|
7877
8207
|
}
|
|
7878
8208
|
return obj;
|
|
7879
8209
|
};
|
|
7880
|
-
var _extends = Object.assign || function(target) {
|
|
8210
|
+
var _extends$1 = Object.assign || function(target) {
|
|
7881
8211
|
for (var i = 1; i < arguments.length; i++) {
|
|
7882
8212
|
var source = arguments[i];
|
|
7883
8213
|
for (var key in source) {
|
|
@@ -7889,7 +8219,7 @@ var _extends = Object.assign || function(target) {
|
|
|
7889
8219
|
return target;
|
|
7890
8220
|
};
|
|
7891
8221
|
function getClientRect(offsets) {
|
|
7892
|
-
return _extends({}, offsets, {
|
|
8222
|
+
return _extends$1({}, offsets, {
|
|
7893
8223
|
right: offsets.left + offsets.width,
|
|
7894
8224
|
bottom: offsets.top + offsets.height
|
|
7895
8225
|
});
|
|
@@ -8073,7 +8403,7 @@ function computeAutoPlacement(placement, refRect, popper, reference, boundariesE
|
|
|
8073
8403
|
}
|
|
8074
8404
|
};
|
|
8075
8405
|
var sortedAreas = Object.keys(rects).map(function(key) {
|
|
8076
|
-
return _extends({
|
|
8406
|
+
return _extends$1({
|
|
8077
8407
|
key
|
|
8078
8408
|
}, rects[key], {
|
|
8079
8409
|
area: getArea(rects[key])
|
|
@@ -8381,9 +8711,9 @@ function computeStyle(data, options) {
|
|
|
8381
8711
|
var attributes = {
|
|
8382
8712
|
"x-placement": data.placement
|
|
8383
8713
|
};
|
|
8384
|
-
data.attributes = _extends({}, attributes, data.attributes);
|
|
8385
|
-
data.styles = _extends({}, styles, data.styles);
|
|
8386
|
-
data.arrowStyles = _extends({}, data.offsets.arrow, data.arrowStyles);
|
|
8714
|
+
data.attributes = _extends$1({}, attributes, data.attributes);
|
|
8715
|
+
data.styles = _extends$1({}, styles, data.styles);
|
|
8716
|
+
data.arrowStyles = _extends$1({}, data.offsets.arrow, data.arrowStyles);
|
|
8387
8717
|
return data;
|
|
8388
8718
|
}
|
|
8389
8719
|
function isModifierRequired(modifiers2, requestingName, requestedName) {
|
|
@@ -8518,7 +8848,7 @@ function flip(data, options) {
|
|
|
8518
8848
|
variation = getOppositeVariation(variation);
|
|
8519
8849
|
}
|
|
8520
8850
|
data.placement = placement + (variation ? "-" + variation : "");
|
|
8521
|
-
data.offsets.popper = _extends({}, data.offsets.popper, getPopperOffsets(data.instance.popper, data.offsets.reference, data.placement));
|
|
8851
|
+
data.offsets.popper = _extends$1({}, data.offsets.popper, getPopperOffsets(data.instance.popper, data.offsets.reference, data.placement));
|
|
8522
8852
|
data = runModifiers(data.instance.modifiers, data, "flip");
|
|
8523
8853
|
}
|
|
8524
8854
|
});
|
|
@@ -8561,13 +8891,13 @@ function toValue(str, measurement, popperOffsets, referenceOffsets) {
|
|
|
8561
8891
|
var rect = getClientRect(element);
|
|
8562
8892
|
return rect[measurement] / 100 * value;
|
|
8563
8893
|
} else if (unit === "vh" || unit === "vw") {
|
|
8564
|
-
var
|
|
8894
|
+
var size2 = void 0;
|
|
8565
8895
|
if (unit === "vh") {
|
|
8566
|
-
|
|
8896
|
+
size2 = Math.max(document.documentElement.clientHeight, window.innerHeight || 0);
|
|
8567
8897
|
} else {
|
|
8568
|
-
|
|
8898
|
+
size2 = Math.max(document.documentElement.clientWidth, window.innerWidth || 0);
|
|
8569
8899
|
}
|
|
8570
|
-
return
|
|
8900
|
+
return size2 / 100 * value;
|
|
8571
8901
|
} else {
|
|
8572
8902
|
return value;
|
|
8573
8903
|
}
|
|
@@ -8677,7 +9007,7 @@ function preventOverflow(data, options) {
|
|
|
8677
9007
|
};
|
|
8678
9008
|
order.forEach(function(placement) {
|
|
8679
9009
|
var side = ["left", "top"].indexOf(placement) !== -1 ? "primary" : "secondary";
|
|
8680
|
-
popper = _extends({}, popper, check[side](placement));
|
|
9010
|
+
popper = _extends$1({}, popper, check[side](placement));
|
|
8681
9011
|
});
|
|
8682
9012
|
data.offsets.popper = popper;
|
|
8683
9013
|
return data;
|
|
@@ -8695,7 +9025,7 @@ function shift(data) {
|
|
|
8695
9025
|
start: defineProperty({}, side, reference[side]),
|
|
8696
9026
|
end: defineProperty({}, side, reference[side] + reference[measurement] - popper[measurement])
|
|
8697
9027
|
};
|
|
8698
|
-
data.offsets.popper = _extends({}, popper, shiftOffsets[shiftvariation]);
|
|
9028
|
+
data.offsets.popper = _extends$1({}, popper, shiftOffsets[shiftvariation]);
|
|
8699
9029
|
}
|
|
8700
9030
|
return data;
|
|
8701
9031
|
}
|
|
@@ -9098,7 +9428,7 @@ var Popper$1 = function() {
|
|
|
9098
9428
|
return requestAnimationFrame(_this.update);
|
|
9099
9429
|
};
|
|
9100
9430
|
this.update = debounce(this.update.bind(this));
|
|
9101
|
-
this.options = _extends({}, Popper2.Defaults, options);
|
|
9431
|
+
this.options = _extends$1({}, Popper2.Defaults, options);
|
|
9102
9432
|
this.state = {
|
|
9103
9433
|
isDestroyed: false,
|
|
9104
9434
|
isCreated: false,
|
|
@@ -9107,11 +9437,11 @@ var Popper$1 = function() {
|
|
|
9107
9437
|
this.reference = reference && reference.jquery ? reference[0] : reference;
|
|
9108
9438
|
this.popper = popper && popper.jquery ? popper[0] : popper;
|
|
9109
9439
|
this.options.modifiers = {};
|
|
9110
|
-
Object.keys(_extends({}, Popper2.Defaults.modifiers, options.modifiers)).forEach(function(name) {
|
|
9111
|
-
_this.options.modifiers[name] = _extends({}, Popper2.Defaults.modifiers[name] || {}, options.modifiers ? options.modifiers[name] : {});
|
|
9440
|
+
Object.keys(_extends$1({}, Popper2.Defaults.modifiers, options.modifiers)).forEach(function(name) {
|
|
9441
|
+
_this.options.modifiers[name] = _extends$1({}, Popper2.Defaults.modifiers[name] || {}, options.modifiers ? options.modifiers[name] : {});
|
|
9112
9442
|
});
|
|
9113
9443
|
this.modifiers = Object.keys(this.options.modifiers).map(function(name) {
|
|
9114
|
-
return _extends({
|
|
9444
|
+
return _extends$1({
|
|
9115
9445
|
name
|
|
9116
9446
|
}, _this.options.modifiers[name]);
|
|
9117
9447
|
}).sort(function(a, b) {
|
|
@@ -9341,6 +9671,700 @@ const Popper = React.forwardRef((props, ref) => {
|
|
|
9341
9671
|
...style2
|
|
9342
9672
|
}, children: typeof children === "function" ? children(childProps) : children }) });
|
|
9343
9673
|
});
|
|
9674
|
+
function _extends() {
|
|
9675
|
+
_extends = Object.assign ? Object.assign.bind() : function(target) {
|
|
9676
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
9677
|
+
var source = arguments[i];
|
|
9678
|
+
for (var key in source) {
|
|
9679
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
9680
|
+
target[key] = source[key];
|
|
9681
|
+
}
|
|
9682
|
+
}
|
|
9683
|
+
}
|
|
9684
|
+
return target;
|
|
9685
|
+
};
|
|
9686
|
+
return _extends.apply(this, arguments);
|
|
9687
|
+
}
|
|
9688
|
+
function _assertThisInitialized(self) {
|
|
9689
|
+
if (self === void 0) {
|
|
9690
|
+
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
9691
|
+
}
|
|
9692
|
+
return self;
|
|
9693
|
+
}
|
|
9694
|
+
function _setPrototypeOf(o, p) {
|
|
9695
|
+
_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf2(o2, p2) {
|
|
9696
|
+
o2.__proto__ = p2;
|
|
9697
|
+
return o2;
|
|
9698
|
+
};
|
|
9699
|
+
return _setPrototypeOf(o, p);
|
|
9700
|
+
}
|
|
9701
|
+
function _inheritsLoose(subClass, superClass) {
|
|
9702
|
+
subClass.prototype = Object.create(superClass.prototype);
|
|
9703
|
+
subClass.prototype.constructor = subClass;
|
|
9704
|
+
_setPrototypeOf(subClass, superClass);
|
|
9705
|
+
}
|
|
9706
|
+
var safeIsNaN = Number.isNaN || function ponyfill(value) {
|
|
9707
|
+
return typeof value === "number" && value !== value;
|
|
9708
|
+
};
|
|
9709
|
+
function isEqual(first, second) {
|
|
9710
|
+
if (first === second) {
|
|
9711
|
+
return true;
|
|
9712
|
+
}
|
|
9713
|
+
if (safeIsNaN(first) && safeIsNaN(second)) {
|
|
9714
|
+
return true;
|
|
9715
|
+
}
|
|
9716
|
+
return false;
|
|
9717
|
+
}
|
|
9718
|
+
function areInputsEqual(newInputs, lastInputs) {
|
|
9719
|
+
if (newInputs.length !== lastInputs.length) {
|
|
9720
|
+
return false;
|
|
9721
|
+
}
|
|
9722
|
+
for (var i = 0; i < newInputs.length; i++) {
|
|
9723
|
+
if (!isEqual(newInputs[i], lastInputs[i])) {
|
|
9724
|
+
return false;
|
|
9725
|
+
}
|
|
9726
|
+
}
|
|
9727
|
+
return true;
|
|
9728
|
+
}
|
|
9729
|
+
function memoizeOne(resultFn, isEqual2) {
|
|
9730
|
+
if (isEqual2 === void 0) {
|
|
9731
|
+
isEqual2 = areInputsEqual;
|
|
9732
|
+
}
|
|
9733
|
+
var lastThis;
|
|
9734
|
+
var lastArgs = [];
|
|
9735
|
+
var lastResult;
|
|
9736
|
+
var calledOnce = false;
|
|
9737
|
+
function memoized() {
|
|
9738
|
+
var newArgs = [];
|
|
9739
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
9740
|
+
newArgs[_i] = arguments[_i];
|
|
9741
|
+
}
|
|
9742
|
+
if (calledOnce && lastThis === this && isEqual2(newArgs, lastArgs)) {
|
|
9743
|
+
return lastResult;
|
|
9744
|
+
}
|
|
9745
|
+
lastResult = resultFn.apply(this, newArgs);
|
|
9746
|
+
calledOnce = true;
|
|
9747
|
+
lastThis = this;
|
|
9748
|
+
lastArgs = newArgs;
|
|
9749
|
+
return lastResult;
|
|
9750
|
+
}
|
|
9751
|
+
return memoized;
|
|
9752
|
+
}
|
|
9753
|
+
var hasNativePerformanceNow = typeof performance === "object" && typeof performance.now === "function";
|
|
9754
|
+
var now = hasNativePerformanceNow ? function() {
|
|
9755
|
+
return performance.now();
|
|
9756
|
+
} : function() {
|
|
9757
|
+
return Date.now();
|
|
9758
|
+
};
|
|
9759
|
+
function cancelTimeout(timeoutID) {
|
|
9760
|
+
cancelAnimationFrame(timeoutID.id);
|
|
9761
|
+
}
|
|
9762
|
+
function requestTimeout(callback, delay) {
|
|
9763
|
+
var start = now();
|
|
9764
|
+
function tick() {
|
|
9765
|
+
if (now() - start >= delay) {
|
|
9766
|
+
callback.call(null);
|
|
9767
|
+
} else {
|
|
9768
|
+
timeoutID.id = requestAnimationFrame(tick);
|
|
9769
|
+
}
|
|
9770
|
+
}
|
|
9771
|
+
var timeoutID = {
|
|
9772
|
+
id: requestAnimationFrame(tick)
|
|
9773
|
+
};
|
|
9774
|
+
return timeoutID;
|
|
9775
|
+
}
|
|
9776
|
+
var size = -1;
|
|
9777
|
+
function getScrollbarSize(recalculate) {
|
|
9778
|
+
if (recalculate === void 0) {
|
|
9779
|
+
recalculate = false;
|
|
9780
|
+
}
|
|
9781
|
+
if (size === -1 || recalculate) {
|
|
9782
|
+
var div = document.createElement("div");
|
|
9783
|
+
var style2 = div.style;
|
|
9784
|
+
style2.width = "50px";
|
|
9785
|
+
style2.height = "50px";
|
|
9786
|
+
style2.overflow = "scroll";
|
|
9787
|
+
document.body.appendChild(div);
|
|
9788
|
+
size = div.offsetWidth - div.clientWidth;
|
|
9789
|
+
document.body.removeChild(div);
|
|
9790
|
+
}
|
|
9791
|
+
return size;
|
|
9792
|
+
}
|
|
9793
|
+
var cachedRTLResult = null;
|
|
9794
|
+
function getRTLOffsetType(recalculate) {
|
|
9795
|
+
if (recalculate === void 0) {
|
|
9796
|
+
recalculate = false;
|
|
9797
|
+
}
|
|
9798
|
+
if (cachedRTLResult === null || recalculate) {
|
|
9799
|
+
var outerDiv = document.createElement("div");
|
|
9800
|
+
var outerStyle = outerDiv.style;
|
|
9801
|
+
outerStyle.width = "50px";
|
|
9802
|
+
outerStyle.height = "50px";
|
|
9803
|
+
outerStyle.overflow = "scroll";
|
|
9804
|
+
outerStyle.direction = "rtl";
|
|
9805
|
+
var innerDiv = document.createElement("div");
|
|
9806
|
+
var innerStyle = innerDiv.style;
|
|
9807
|
+
innerStyle.width = "100px";
|
|
9808
|
+
innerStyle.height = "100px";
|
|
9809
|
+
outerDiv.appendChild(innerDiv);
|
|
9810
|
+
document.body.appendChild(outerDiv);
|
|
9811
|
+
if (outerDiv.scrollLeft > 0) {
|
|
9812
|
+
cachedRTLResult = "positive-descending";
|
|
9813
|
+
} else {
|
|
9814
|
+
outerDiv.scrollLeft = 1;
|
|
9815
|
+
if (outerDiv.scrollLeft === 0) {
|
|
9816
|
+
cachedRTLResult = "negative";
|
|
9817
|
+
} else {
|
|
9818
|
+
cachedRTLResult = "positive-ascending";
|
|
9819
|
+
}
|
|
9820
|
+
}
|
|
9821
|
+
document.body.removeChild(outerDiv);
|
|
9822
|
+
return cachedRTLResult;
|
|
9823
|
+
}
|
|
9824
|
+
return cachedRTLResult;
|
|
9825
|
+
}
|
|
9826
|
+
var IS_SCROLLING_DEBOUNCE_INTERVAL$1 = 150;
|
|
9827
|
+
var defaultItemKey$1 = function defaultItemKey3(index, data) {
|
|
9828
|
+
return index;
|
|
9829
|
+
};
|
|
9830
|
+
var devWarningsDirection = null;
|
|
9831
|
+
var devWarningsTagName$1 = null;
|
|
9832
|
+
{
|
|
9833
|
+
if (typeof window !== "undefined" && typeof window.WeakSet !== "undefined") {
|
|
9834
|
+
devWarningsDirection = /* @__PURE__ */ new WeakSet();
|
|
9835
|
+
devWarningsTagName$1 = /* @__PURE__ */ new WeakSet();
|
|
9836
|
+
}
|
|
9837
|
+
}
|
|
9838
|
+
function createListComponent(_ref) {
|
|
9839
|
+
var _class;
|
|
9840
|
+
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;
|
|
9841
|
+
return _class = /* @__PURE__ */ function(_PureComponent) {
|
|
9842
|
+
_inheritsLoose(List, _PureComponent);
|
|
9843
|
+
function List(props) {
|
|
9844
|
+
var _this;
|
|
9845
|
+
_this = _PureComponent.call(this, props) || this;
|
|
9846
|
+
_this._instanceProps = initInstanceProps5(_this.props, _assertThisInitialized(_this));
|
|
9847
|
+
_this._outerRef = void 0;
|
|
9848
|
+
_this._resetIsScrollingTimeoutId = null;
|
|
9849
|
+
_this.state = {
|
|
9850
|
+
instance: _assertThisInitialized(_this),
|
|
9851
|
+
isScrolling: false,
|
|
9852
|
+
scrollDirection: "forward",
|
|
9853
|
+
scrollOffset: typeof _this.props.initialScrollOffset === "number" ? _this.props.initialScrollOffset : 0,
|
|
9854
|
+
scrollUpdateWasRequested: false
|
|
9855
|
+
};
|
|
9856
|
+
_this._callOnItemsRendered = void 0;
|
|
9857
|
+
_this._callOnItemsRendered = memoizeOne(function(overscanStartIndex, overscanStopIndex, visibleStartIndex, visibleStopIndex) {
|
|
9858
|
+
return _this.props.onItemsRendered({
|
|
9859
|
+
overscanStartIndex,
|
|
9860
|
+
overscanStopIndex,
|
|
9861
|
+
visibleStartIndex,
|
|
9862
|
+
visibleStopIndex
|
|
9863
|
+
});
|
|
9864
|
+
});
|
|
9865
|
+
_this._callOnScroll = void 0;
|
|
9866
|
+
_this._callOnScroll = memoizeOne(function(scrollDirection, scrollOffset, scrollUpdateWasRequested) {
|
|
9867
|
+
return _this.props.onScroll({
|
|
9868
|
+
scrollDirection,
|
|
9869
|
+
scrollOffset,
|
|
9870
|
+
scrollUpdateWasRequested
|
|
9871
|
+
});
|
|
9872
|
+
});
|
|
9873
|
+
_this._getItemStyle = void 0;
|
|
9874
|
+
_this._getItemStyle = function(index) {
|
|
9875
|
+
var _this$props = _this.props, direction = _this$props.direction, itemSize = _this$props.itemSize, layout = _this$props.layout;
|
|
9876
|
+
var itemStyleCache = _this._getItemStyleCache(shouldResetStyleCacheOnItemSizeChange && itemSize, shouldResetStyleCacheOnItemSizeChange && layout, shouldResetStyleCacheOnItemSizeChange && direction);
|
|
9877
|
+
var style2;
|
|
9878
|
+
if (itemStyleCache.hasOwnProperty(index)) {
|
|
9879
|
+
style2 = itemStyleCache[index];
|
|
9880
|
+
} else {
|
|
9881
|
+
var _offset = getItemOffset3(_this.props, index, _this._instanceProps);
|
|
9882
|
+
var size2 = getItemSize3(_this.props, index, _this._instanceProps);
|
|
9883
|
+
var isHorizontal = direction === "horizontal" || layout === "horizontal";
|
|
9884
|
+
var isRtl = direction === "rtl";
|
|
9885
|
+
var offsetHorizontal = isHorizontal ? _offset : 0;
|
|
9886
|
+
itemStyleCache[index] = style2 = {
|
|
9887
|
+
position: "absolute",
|
|
9888
|
+
left: isRtl ? void 0 : offsetHorizontal,
|
|
9889
|
+
right: isRtl ? offsetHorizontal : void 0,
|
|
9890
|
+
top: !isHorizontal ? _offset : 0,
|
|
9891
|
+
height: !isHorizontal ? size2 : "100%",
|
|
9892
|
+
width: isHorizontal ? size2 : "100%"
|
|
9893
|
+
};
|
|
9894
|
+
}
|
|
9895
|
+
return style2;
|
|
9896
|
+
};
|
|
9897
|
+
_this._getItemStyleCache = void 0;
|
|
9898
|
+
_this._getItemStyleCache = memoizeOne(function(_, __, ___) {
|
|
9899
|
+
return {};
|
|
9900
|
+
});
|
|
9901
|
+
_this._onScrollHorizontal = function(event) {
|
|
9902
|
+
var _event$currentTarget = event.currentTarget, clientWidth = _event$currentTarget.clientWidth, scrollLeft = _event$currentTarget.scrollLeft, scrollWidth = _event$currentTarget.scrollWidth;
|
|
9903
|
+
_this.setState(function(prevState) {
|
|
9904
|
+
if (prevState.scrollOffset === scrollLeft) {
|
|
9905
|
+
return null;
|
|
9906
|
+
}
|
|
9907
|
+
var direction = _this.props.direction;
|
|
9908
|
+
var scrollOffset = scrollLeft;
|
|
9909
|
+
if (direction === "rtl") {
|
|
9910
|
+
switch (getRTLOffsetType()) {
|
|
9911
|
+
case "negative":
|
|
9912
|
+
scrollOffset = -scrollLeft;
|
|
9913
|
+
break;
|
|
9914
|
+
case "positive-descending":
|
|
9915
|
+
scrollOffset = scrollWidth - clientWidth - scrollLeft;
|
|
9916
|
+
break;
|
|
9917
|
+
}
|
|
9918
|
+
}
|
|
9919
|
+
scrollOffset = Math.max(0, Math.min(scrollOffset, scrollWidth - clientWidth));
|
|
9920
|
+
return {
|
|
9921
|
+
isScrolling: true,
|
|
9922
|
+
scrollDirection: prevState.scrollOffset < scrollOffset ? "forward" : "backward",
|
|
9923
|
+
scrollOffset,
|
|
9924
|
+
scrollUpdateWasRequested: false
|
|
9925
|
+
};
|
|
9926
|
+
}, _this._resetIsScrollingDebounced);
|
|
9927
|
+
};
|
|
9928
|
+
_this._onScrollVertical = function(event) {
|
|
9929
|
+
var _event$currentTarget2 = event.currentTarget, clientHeight = _event$currentTarget2.clientHeight, scrollHeight = _event$currentTarget2.scrollHeight, scrollTop = _event$currentTarget2.scrollTop;
|
|
9930
|
+
_this.setState(function(prevState) {
|
|
9931
|
+
if (prevState.scrollOffset === scrollTop) {
|
|
9932
|
+
return null;
|
|
9933
|
+
}
|
|
9934
|
+
var scrollOffset = Math.max(0, Math.min(scrollTop, scrollHeight - clientHeight));
|
|
9935
|
+
return {
|
|
9936
|
+
isScrolling: true,
|
|
9937
|
+
scrollDirection: prevState.scrollOffset < scrollOffset ? "forward" : "backward",
|
|
9938
|
+
scrollOffset,
|
|
9939
|
+
scrollUpdateWasRequested: false
|
|
9940
|
+
};
|
|
9941
|
+
}, _this._resetIsScrollingDebounced);
|
|
9942
|
+
};
|
|
9943
|
+
_this._outerRefSetter = function(ref) {
|
|
9944
|
+
var outerRef = _this.props.outerRef;
|
|
9945
|
+
_this._outerRef = ref;
|
|
9946
|
+
if (typeof outerRef === "function") {
|
|
9947
|
+
outerRef(ref);
|
|
9948
|
+
} else if (outerRef != null && typeof outerRef === "object" && outerRef.hasOwnProperty("current")) {
|
|
9949
|
+
outerRef.current = ref;
|
|
9950
|
+
}
|
|
9951
|
+
};
|
|
9952
|
+
_this._resetIsScrollingDebounced = function() {
|
|
9953
|
+
if (_this._resetIsScrollingTimeoutId !== null) {
|
|
9954
|
+
cancelTimeout(_this._resetIsScrollingTimeoutId);
|
|
9955
|
+
}
|
|
9956
|
+
_this._resetIsScrollingTimeoutId = requestTimeout(_this._resetIsScrolling, IS_SCROLLING_DEBOUNCE_INTERVAL$1);
|
|
9957
|
+
};
|
|
9958
|
+
_this._resetIsScrolling = function() {
|
|
9959
|
+
_this._resetIsScrollingTimeoutId = null;
|
|
9960
|
+
_this.setState({
|
|
9961
|
+
isScrolling: false
|
|
9962
|
+
}, function() {
|
|
9963
|
+
_this._getItemStyleCache(-1, null);
|
|
9964
|
+
});
|
|
9965
|
+
};
|
|
9966
|
+
return _this;
|
|
9967
|
+
}
|
|
9968
|
+
List.getDerivedStateFromProps = function getDerivedStateFromProps(nextProps, prevState) {
|
|
9969
|
+
validateSharedProps$1(nextProps, prevState);
|
|
9970
|
+
validateProps5(nextProps);
|
|
9971
|
+
return null;
|
|
9972
|
+
};
|
|
9973
|
+
var _proto = List.prototype;
|
|
9974
|
+
_proto.scrollTo = function scrollTo(scrollOffset) {
|
|
9975
|
+
scrollOffset = Math.max(0, scrollOffset);
|
|
9976
|
+
this.setState(function(prevState) {
|
|
9977
|
+
if (prevState.scrollOffset === scrollOffset) {
|
|
9978
|
+
return null;
|
|
9979
|
+
}
|
|
9980
|
+
return {
|
|
9981
|
+
scrollDirection: prevState.scrollOffset < scrollOffset ? "forward" : "backward",
|
|
9982
|
+
scrollOffset,
|
|
9983
|
+
scrollUpdateWasRequested: true
|
|
9984
|
+
};
|
|
9985
|
+
}, this._resetIsScrollingDebounced);
|
|
9986
|
+
};
|
|
9987
|
+
_proto.scrollToItem = function scrollToItem(index, align) {
|
|
9988
|
+
if (align === void 0) {
|
|
9989
|
+
align = "auto";
|
|
9990
|
+
}
|
|
9991
|
+
var _this$props2 = this.props, itemCount = _this$props2.itemCount, layout = _this$props2.layout;
|
|
9992
|
+
var scrollOffset = this.state.scrollOffset;
|
|
9993
|
+
index = Math.max(0, Math.min(index, itemCount - 1));
|
|
9994
|
+
var scrollbarSize = 0;
|
|
9995
|
+
if (this._outerRef) {
|
|
9996
|
+
var outerRef = this._outerRef;
|
|
9997
|
+
if (layout === "vertical") {
|
|
9998
|
+
scrollbarSize = outerRef.scrollWidth > outerRef.clientWidth ? getScrollbarSize() : 0;
|
|
9999
|
+
} else {
|
|
10000
|
+
scrollbarSize = outerRef.scrollHeight > outerRef.clientHeight ? getScrollbarSize() : 0;
|
|
10001
|
+
}
|
|
10002
|
+
}
|
|
10003
|
+
this.scrollTo(getOffsetForIndexAndAlignment5(this.props, index, align, scrollOffset, this._instanceProps, scrollbarSize));
|
|
10004
|
+
};
|
|
10005
|
+
_proto.componentDidMount = function componentDidMount() {
|
|
10006
|
+
var _this$props3 = this.props, direction = _this$props3.direction, initialScrollOffset = _this$props3.initialScrollOffset, layout = _this$props3.layout;
|
|
10007
|
+
if (typeof initialScrollOffset === "number" && this._outerRef != null) {
|
|
10008
|
+
var outerRef = this._outerRef;
|
|
10009
|
+
if (direction === "horizontal" || layout === "horizontal") {
|
|
10010
|
+
outerRef.scrollLeft = initialScrollOffset;
|
|
10011
|
+
} else {
|
|
10012
|
+
outerRef.scrollTop = initialScrollOffset;
|
|
10013
|
+
}
|
|
10014
|
+
}
|
|
10015
|
+
this._callPropsCallbacks();
|
|
10016
|
+
};
|
|
10017
|
+
_proto.componentDidUpdate = function componentDidUpdate() {
|
|
10018
|
+
var _this$props4 = this.props, direction = _this$props4.direction, layout = _this$props4.layout;
|
|
10019
|
+
var _this$state = this.state, scrollOffset = _this$state.scrollOffset, scrollUpdateWasRequested = _this$state.scrollUpdateWasRequested;
|
|
10020
|
+
if (scrollUpdateWasRequested && this._outerRef != null) {
|
|
10021
|
+
var outerRef = this._outerRef;
|
|
10022
|
+
if (direction === "horizontal" || layout === "horizontal") {
|
|
10023
|
+
if (direction === "rtl") {
|
|
10024
|
+
switch (getRTLOffsetType()) {
|
|
10025
|
+
case "negative":
|
|
10026
|
+
outerRef.scrollLeft = -scrollOffset;
|
|
10027
|
+
break;
|
|
10028
|
+
case "positive-ascending":
|
|
10029
|
+
outerRef.scrollLeft = scrollOffset;
|
|
10030
|
+
break;
|
|
10031
|
+
default:
|
|
10032
|
+
var clientWidth = outerRef.clientWidth, scrollWidth = outerRef.scrollWidth;
|
|
10033
|
+
outerRef.scrollLeft = scrollWidth - clientWidth - scrollOffset;
|
|
10034
|
+
break;
|
|
10035
|
+
}
|
|
10036
|
+
} else {
|
|
10037
|
+
outerRef.scrollLeft = scrollOffset;
|
|
10038
|
+
}
|
|
10039
|
+
} else {
|
|
10040
|
+
outerRef.scrollTop = scrollOffset;
|
|
10041
|
+
}
|
|
10042
|
+
}
|
|
10043
|
+
this._callPropsCallbacks();
|
|
10044
|
+
};
|
|
10045
|
+
_proto.componentWillUnmount = function componentWillUnmount() {
|
|
10046
|
+
if (this._resetIsScrollingTimeoutId !== null) {
|
|
10047
|
+
cancelTimeout(this._resetIsScrollingTimeoutId);
|
|
10048
|
+
}
|
|
10049
|
+
};
|
|
10050
|
+
_proto.render = function render() {
|
|
10051
|
+
var _this$props5 = this.props, children = _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;
|
|
10052
|
+
var isScrolling = this.state.isScrolling;
|
|
10053
|
+
var isHorizontal = direction === "horizontal" || layout === "horizontal";
|
|
10054
|
+
var onScroll = isHorizontal ? this._onScrollHorizontal : this._onScrollVertical;
|
|
10055
|
+
var _this$_getRangeToRend = this._getRangeToRender(), startIndex = _this$_getRangeToRend[0], stopIndex = _this$_getRangeToRend[1];
|
|
10056
|
+
var items = [];
|
|
10057
|
+
if (itemCount > 0) {
|
|
10058
|
+
for (var _index = startIndex; _index <= stopIndex; _index++) {
|
|
10059
|
+
items.push(createElement(children, {
|
|
10060
|
+
data: itemData,
|
|
10061
|
+
key: itemKey(_index, itemData),
|
|
10062
|
+
index: _index,
|
|
10063
|
+
isScrolling: useIsScrolling ? isScrolling : void 0,
|
|
10064
|
+
style: this._getItemStyle(_index)
|
|
10065
|
+
}));
|
|
10066
|
+
}
|
|
10067
|
+
}
|
|
10068
|
+
var estimatedTotalSize = getEstimatedTotalSize4(this.props, this._instanceProps);
|
|
10069
|
+
return createElement(outerElementType || outerTagName || "div", {
|
|
10070
|
+
className,
|
|
10071
|
+
onScroll,
|
|
10072
|
+
ref: this._outerRefSetter,
|
|
10073
|
+
style: _extends({
|
|
10074
|
+
position: "relative",
|
|
10075
|
+
height: height2,
|
|
10076
|
+
width: width2,
|
|
10077
|
+
overflow: "auto",
|
|
10078
|
+
WebkitOverflowScrolling: "touch",
|
|
10079
|
+
willChange: "transform",
|
|
10080
|
+
direction
|
|
10081
|
+
}, style2)
|
|
10082
|
+
}, createElement(innerElementType || innerTagName || "div", {
|
|
10083
|
+
children: items,
|
|
10084
|
+
ref: innerRef,
|
|
10085
|
+
style: {
|
|
10086
|
+
height: isHorizontal ? "100%" : estimatedTotalSize,
|
|
10087
|
+
pointerEvents: isScrolling ? "none" : void 0,
|
|
10088
|
+
width: isHorizontal ? estimatedTotalSize : "100%"
|
|
10089
|
+
}
|
|
10090
|
+
}));
|
|
10091
|
+
};
|
|
10092
|
+
_proto._callPropsCallbacks = function _callPropsCallbacks() {
|
|
10093
|
+
if (typeof this.props.onItemsRendered === "function") {
|
|
10094
|
+
var itemCount = this.props.itemCount;
|
|
10095
|
+
if (itemCount > 0) {
|
|
10096
|
+
var _this$_getRangeToRend2 = this._getRangeToRender(), _overscanStartIndex = _this$_getRangeToRend2[0], _overscanStopIndex = _this$_getRangeToRend2[1], _visibleStartIndex = _this$_getRangeToRend2[2], _visibleStopIndex = _this$_getRangeToRend2[3];
|
|
10097
|
+
this._callOnItemsRendered(_overscanStartIndex, _overscanStopIndex, _visibleStartIndex, _visibleStopIndex);
|
|
10098
|
+
}
|
|
10099
|
+
}
|
|
10100
|
+
if (typeof this.props.onScroll === "function") {
|
|
10101
|
+
var _this$state2 = this.state, _scrollDirection = _this$state2.scrollDirection, _scrollOffset = _this$state2.scrollOffset, _scrollUpdateWasRequested = _this$state2.scrollUpdateWasRequested;
|
|
10102
|
+
this._callOnScroll(_scrollDirection, _scrollOffset, _scrollUpdateWasRequested);
|
|
10103
|
+
}
|
|
10104
|
+
};
|
|
10105
|
+
_proto._getRangeToRender = function _getRangeToRender() {
|
|
10106
|
+
var _this$props6 = this.props, itemCount = _this$props6.itemCount, overscanCount = _this$props6.overscanCount;
|
|
10107
|
+
var _this$state3 = this.state, isScrolling = _this$state3.isScrolling, scrollDirection = _this$state3.scrollDirection, scrollOffset = _this$state3.scrollOffset;
|
|
10108
|
+
if (itemCount === 0) {
|
|
10109
|
+
return [0, 0, 0, 0];
|
|
10110
|
+
}
|
|
10111
|
+
var startIndex = getStartIndexForOffset3(this.props, scrollOffset, this._instanceProps);
|
|
10112
|
+
var stopIndex = getStopIndexForStartIndex3(this.props, startIndex, scrollOffset, this._instanceProps);
|
|
10113
|
+
var overscanBackward = !isScrolling || scrollDirection === "backward" ? Math.max(1, overscanCount) : 1;
|
|
10114
|
+
var overscanForward = !isScrolling || scrollDirection === "forward" ? Math.max(1, overscanCount) : 1;
|
|
10115
|
+
return [Math.max(0, startIndex - overscanBackward), Math.max(0, Math.min(itemCount - 1, stopIndex + overscanForward)), startIndex, stopIndex];
|
|
10116
|
+
};
|
|
10117
|
+
return List;
|
|
10118
|
+
}(PureComponent), _class.defaultProps = {
|
|
10119
|
+
direction: "ltr",
|
|
10120
|
+
itemData: void 0,
|
|
10121
|
+
layout: "vertical",
|
|
10122
|
+
overscanCount: 2,
|
|
10123
|
+
useIsScrolling: false
|
|
10124
|
+
}, _class;
|
|
10125
|
+
}
|
|
10126
|
+
var validateSharedProps$1 = function validateSharedProps3(_ref2, _ref3) {
|
|
10127
|
+
var children = _ref2.children, direction = _ref2.direction, height2 = _ref2.height, layout = _ref2.layout, innerTagName = _ref2.innerTagName, outerTagName = _ref2.outerTagName, width2 = _ref2.width;
|
|
10128
|
+
var instance = _ref3.instance;
|
|
10129
|
+
{
|
|
10130
|
+
if (innerTagName != null || outerTagName != null) {
|
|
10131
|
+
if (devWarningsTagName$1 && !devWarningsTagName$1.has(instance)) {
|
|
10132
|
+
devWarningsTagName$1.add(instance);
|
|
10133
|
+
console.warn("The innerTagName and outerTagName props have been deprecated. Please use the innerElementType and outerElementType props instead.");
|
|
10134
|
+
}
|
|
10135
|
+
}
|
|
10136
|
+
var isHorizontal = direction === "horizontal" || layout === "horizontal";
|
|
10137
|
+
switch (direction) {
|
|
10138
|
+
case "horizontal":
|
|
10139
|
+
case "vertical":
|
|
10140
|
+
if (devWarningsDirection && !devWarningsDirection.has(instance)) {
|
|
10141
|
+
devWarningsDirection.add(instance);
|
|
10142
|
+
console.warn('The direction prop should be either "ltr" (default) or "rtl". Please use the layout prop to specify "vertical" (default) or "horizontal" orientation.');
|
|
10143
|
+
}
|
|
10144
|
+
break;
|
|
10145
|
+
case "ltr":
|
|
10146
|
+
case "rtl":
|
|
10147
|
+
break;
|
|
10148
|
+
default:
|
|
10149
|
+
throw Error('An invalid "direction" prop has been specified. Value should be either "ltr" or "rtl". ' + ('"' + direction + '" was specified.'));
|
|
10150
|
+
}
|
|
10151
|
+
switch (layout) {
|
|
10152
|
+
case "horizontal":
|
|
10153
|
+
case "vertical":
|
|
10154
|
+
break;
|
|
10155
|
+
default:
|
|
10156
|
+
throw Error('An invalid "layout" prop has been specified. Value should be either "horizontal" or "vertical". ' + ('"' + layout + '" was specified.'));
|
|
10157
|
+
}
|
|
10158
|
+
if (children == null) {
|
|
10159
|
+
throw Error('An invalid "children" prop has been specified. Value should be a React component. ' + ('"' + (children === null ? "null" : typeof children) + '" was specified.'));
|
|
10160
|
+
}
|
|
10161
|
+
if (isHorizontal && typeof width2 !== "number") {
|
|
10162
|
+
throw Error('An invalid "width" prop has been specified. Horizontal lists must specify a number for width. ' + ('"' + (width2 === null ? "null" : typeof width2) + '" was specified.'));
|
|
10163
|
+
} else if (!isHorizontal && typeof height2 !== "number") {
|
|
10164
|
+
throw Error('An invalid "height" prop has been specified. Vertical lists must specify a number for height. ' + ('"' + (height2 === null ? "null" : typeof height2) + '" was specified.'));
|
|
10165
|
+
}
|
|
10166
|
+
}
|
|
10167
|
+
};
|
|
10168
|
+
var DEFAULT_ESTIMATED_ITEM_SIZE$1 = 50;
|
|
10169
|
+
var getItemMetadata$1 = function getItemMetadata3(props, index, instanceProps) {
|
|
10170
|
+
var _ref = props, itemSize = _ref.itemSize;
|
|
10171
|
+
var itemMetadataMap = instanceProps.itemMetadataMap, lastMeasuredIndex = instanceProps.lastMeasuredIndex;
|
|
10172
|
+
if (index > lastMeasuredIndex) {
|
|
10173
|
+
var offset2 = 0;
|
|
10174
|
+
if (lastMeasuredIndex >= 0) {
|
|
10175
|
+
var itemMetadata = itemMetadataMap[lastMeasuredIndex];
|
|
10176
|
+
offset2 = itemMetadata.offset + itemMetadata.size;
|
|
10177
|
+
}
|
|
10178
|
+
for (var i = lastMeasuredIndex + 1; i <= index; i++) {
|
|
10179
|
+
var size2 = itemSize(i);
|
|
10180
|
+
itemMetadataMap[i] = {
|
|
10181
|
+
offset: offset2,
|
|
10182
|
+
size: size2
|
|
10183
|
+
};
|
|
10184
|
+
offset2 += size2;
|
|
10185
|
+
}
|
|
10186
|
+
instanceProps.lastMeasuredIndex = index;
|
|
10187
|
+
}
|
|
10188
|
+
return itemMetadataMap[index];
|
|
10189
|
+
};
|
|
10190
|
+
var findNearestItem$1 = function findNearestItem3(props, instanceProps, offset2) {
|
|
10191
|
+
var itemMetadataMap = instanceProps.itemMetadataMap, lastMeasuredIndex = instanceProps.lastMeasuredIndex;
|
|
10192
|
+
var lastMeasuredItemOffset = lastMeasuredIndex > 0 ? itemMetadataMap[lastMeasuredIndex].offset : 0;
|
|
10193
|
+
if (lastMeasuredItemOffset >= offset2) {
|
|
10194
|
+
return findNearestItemBinarySearch$1(props, instanceProps, lastMeasuredIndex, 0, offset2);
|
|
10195
|
+
} else {
|
|
10196
|
+
return findNearestItemExponentialSearch$1(props, instanceProps, Math.max(0, lastMeasuredIndex), offset2);
|
|
10197
|
+
}
|
|
10198
|
+
};
|
|
10199
|
+
var findNearestItemBinarySearch$1 = function findNearestItemBinarySearch3(props, instanceProps, high, low, offset2) {
|
|
10200
|
+
while (low <= high) {
|
|
10201
|
+
var middle = low + Math.floor((high - low) / 2);
|
|
10202
|
+
var currentOffset = getItemMetadata$1(props, middle, instanceProps).offset;
|
|
10203
|
+
if (currentOffset === offset2) {
|
|
10204
|
+
return middle;
|
|
10205
|
+
} else if (currentOffset < offset2) {
|
|
10206
|
+
low = middle + 1;
|
|
10207
|
+
} else if (currentOffset > offset2) {
|
|
10208
|
+
high = middle - 1;
|
|
10209
|
+
}
|
|
10210
|
+
}
|
|
10211
|
+
if (low > 0) {
|
|
10212
|
+
return low - 1;
|
|
10213
|
+
} else {
|
|
10214
|
+
return 0;
|
|
10215
|
+
}
|
|
10216
|
+
};
|
|
10217
|
+
var findNearestItemExponentialSearch$1 = function findNearestItemExponentialSearch3(props, instanceProps, index, offset2) {
|
|
10218
|
+
var itemCount = props.itemCount;
|
|
10219
|
+
var interval = 1;
|
|
10220
|
+
while (index < itemCount && getItemMetadata$1(props, index, instanceProps).offset < offset2) {
|
|
10221
|
+
index += interval;
|
|
10222
|
+
interval *= 2;
|
|
10223
|
+
}
|
|
10224
|
+
return findNearestItemBinarySearch$1(props, instanceProps, Math.min(index, itemCount - 1), Math.floor(index / 2), offset2);
|
|
10225
|
+
};
|
|
10226
|
+
var getEstimatedTotalSize = function getEstimatedTotalSize2(_ref2, _ref3) {
|
|
10227
|
+
var itemCount = _ref2.itemCount;
|
|
10228
|
+
var itemMetadataMap = _ref3.itemMetadataMap, estimatedItemSize = _ref3.estimatedItemSize, lastMeasuredIndex = _ref3.lastMeasuredIndex;
|
|
10229
|
+
var totalSizeOfMeasuredItems = 0;
|
|
10230
|
+
if (lastMeasuredIndex >= itemCount) {
|
|
10231
|
+
lastMeasuredIndex = itemCount - 1;
|
|
10232
|
+
}
|
|
10233
|
+
if (lastMeasuredIndex >= 0) {
|
|
10234
|
+
var itemMetadata = itemMetadataMap[lastMeasuredIndex];
|
|
10235
|
+
totalSizeOfMeasuredItems = itemMetadata.offset + itemMetadata.size;
|
|
10236
|
+
}
|
|
10237
|
+
var numUnmeasuredItems = itemCount - lastMeasuredIndex - 1;
|
|
10238
|
+
var totalSizeOfUnmeasuredItems = numUnmeasuredItems * estimatedItemSize;
|
|
10239
|
+
return totalSizeOfMeasuredItems + totalSizeOfUnmeasuredItems;
|
|
10240
|
+
};
|
|
10241
|
+
var VariableSizeList$1 = /* @__PURE__ */ createListComponent({
|
|
10242
|
+
getItemOffset: function getItemOffset(props, index, instanceProps) {
|
|
10243
|
+
return getItemMetadata$1(props, index, instanceProps).offset;
|
|
10244
|
+
},
|
|
10245
|
+
getItemSize: function getItemSize(props, index, instanceProps) {
|
|
10246
|
+
return instanceProps.itemMetadataMap[index].size;
|
|
10247
|
+
},
|
|
10248
|
+
getEstimatedTotalSize,
|
|
10249
|
+
getOffsetForIndexAndAlignment: function getOffsetForIndexAndAlignment3(props, index, align, scrollOffset, instanceProps, scrollbarSize) {
|
|
10250
|
+
var direction = props.direction, height2 = props.height, layout = props.layout, width2 = props.width;
|
|
10251
|
+
var isHorizontal = direction === "horizontal" || layout === "horizontal";
|
|
10252
|
+
var size2 = isHorizontal ? width2 : height2;
|
|
10253
|
+
var itemMetadata = getItemMetadata$1(props, index, instanceProps);
|
|
10254
|
+
var estimatedTotalSize = getEstimatedTotalSize(props, instanceProps);
|
|
10255
|
+
var maxOffset = Math.max(0, Math.min(estimatedTotalSize - size2, itemMetadata.offset));
|
|
10256
|
+
var minOffset = Math.max(0, itemMetadata.offset - size2 + itemMetadata.size + scrollbarSize);
|
|
10257
|
+
if (align === "smart") {
|
|
10258
|
+
if (scrollOffset >= minOffset - size2 && scrollOffset <= maxOffset + size2) {
|
|
10259
|
+
align = "auto";
|
|
10260
|
+
} else {
|
|
10261
|
+
align = "center";
|
|
10262
|
+
}
|
|
10263
|
+
}
|
|
10264
|
+
switch (align) {
|
|
10265
|
+
case "start":
|
|
10266
|
+
return maxOffset;
|
|
10267
|
+
case "end":
|
|
10268
|
+
return minOffset;
|
|
10269
|
+
case "center":
|
|
10270
|
+
return Math.round(minOffset + (maxOffset - minOffset) / 2);
|
|
10271
|
+
case "auto":
|
|
10272
|
+
default:
|
|
10273
|
+
if (scrollOffset >= minOffset && scrollOffset <= maxOffset) {
|
|
10274
|
+
return scrollOffset;
|
|
10275
|
+
} else if (scrollOffset < minOffset) {
|
|
10276
|
+
return minOffset;
|
|
10277
|
+
} else {
|
|
10278
|
+
return maxOffset;
|
|
10279
|
+
}
|
|
10280
|
+
}
|
|
10281
|
+
},
|
|
10282
|
+
getStartIndexForOffset: function getStartIndexForOffset(props, offset2, instanceProps) {
|
|
10283
|
+
return findNearestItem$1(props, instanceProps, offset2);
|
|
10284
|
+
},
|
|
10285
|
+
getStopIndexForStartIndex: function getStopIndexForStartIndex(props, startIndex, scrollOffset, instanceProps) {
|
|
10286
|
+
var direction = props.direction, height2 = props.height, itemCount = props.itemCount, layout = props.layout, width2 = props.width;
|
|
10287
|
+
var isHorizontal = direction === "horizontal" || layout === "horizontal";
|
|
10288
|
+
var size2 = isHorizontal ? width2 : height2;
|
|
10289
|
+
var itemMetadata = getItemMetadata$1(props, startIndex, instanceProps);
|
|
10290
|
+
var maxOffset = scrollOffset + size2;
|
|
10291
|
+
var offset2 = itemMetadata.offset + itemMetadata.size;
|
|
10292
|
+
var stopIndex = startIndex;
|
|
10293
|
+
while (stopIndex < itemCount - 1 && offset2 < maxOffset) {
|
|
10294
|
+
stopIndex++;
|
|
10295
|
+
offset2 += getItemMetadata$1(props, stopIndex, instanceProps).size;
|
|
10296
|
+
}
|
|
10297
|
+
return stopIndex;
|
|
10298
|
+
},
|
|
10299
|
+
initInstanceProps: function initInstanceProps2(props, instance) {
|
|
10300
|
+
var _ref4 = props, estimatedItemSize = _ref4.estimatedItemSize;
|
|
10301
|
+
var instanceProps = {
|
|
10302
|
+
itemMetadataMap: {},
|
|
10303
|
+
estimatedItemSize: estimatedItemSize || DEFAULT_ESTIMATED_ITEM_SIZE$1,
|
|
10304
|
+
lastMeasuredIndex: -1
|
|
10305
|
+
};
|
|
10306
|
+
instance.resetAfterIndex = function(index, shouldForceUpdate) {
|
|
10307
|
+
if (shouldForceUpdate === void 0) {
|
|
10308
|
+
shouldForceUpdate = true;
|
|
10309
|
+
}
|
|
10310
|
+
instanceProps.lastMeasuredIndex = Math.min(instanceProps.lastMeasuredIndex, index - 1);
|
|
10311
|
+
instance._getItemStyleCache(-1);
|
|
10312
|
+
if (shouldForceUpdate) {
|
|
10313
|
+
instance.forceUpdate();
|
|
10314
|
+
}
|
|
10315
|
+
};
|
|
10316
|
+
return instanceProps;
|
|
10317
|
+
},
|
|
10318
|
+
shouldResetStyleCacheOnItemSizeChange: false,
|
|
10319
|
+
validateProps: function validateProps2(_ref5) {
|
|
10320
|
+
var itemSize = _ref5.itemSize;
|
|
10321
|
+
{
|
|
10322
|
+
if (typeof itemSize !== "function") {
|
|
10323
|
+
throw Error('An invalid "itemSize" prop has been specified. Value should be a function. ' + ('"' + (itemSize === null ? "null" : typeof itemSize) + '" was specified.'));
|
|
10324
|
+
}
|
|
10325
|
+
}
|
|
10326
|
+
}
|
|
10327
|
+
});
|
|
10328
|
+
const VariableSizeList = VariableSizeList$1;
|
|
10329
|
+
const LIST_ROW_HEIGHT = 48;
|
|
10330
|
+
makeStyles()(() => ({
|
|
10331
|
+
searchInput: {
|
|
10332
|
+
lineHeight: "initial",
|
|
10333
|
+
height: "auto !important"
|
|
10334
|
+
}
|
|
10335
|
+
}));
|
|
10336
|
+
const OuterElementContext = React__default.createContext({});
|
|
10337
|
+
const OuterElementType = React__default.forwardRef((props, ref) => {
|
|
10338
|
+
const outerProps = React__default.useContext(OuterElementContext);
|
|
10339
|
+
return jsxRuntimeExports.jsx("div", { ref, ...props, ...outerProps });
|
|
10340
|
+
});
|
|
10341
|
+
function ListRow(props) {
|
|
10342
|
+
const { data, index, style: style2 } = props;
|
|
10343
|
+
const dataSet = data[index];
|
|
10344
|
+
const inlineStyle = {
|
|
10345
|
+
...style2,
|
|
10346
|
+
top: style2.top + 8
|
|
10347
|
+
};
|
|
10348
|
+
const [props0, option, getItemLabel] = dataSet;
|
|
10349
|
+
const { key, ...optionProps } = props0;
|
|
10350
|
+
return jsxRuntimeExports.jsx(Typography, { component: "li", ...optionProps, noWrap: true, style: inlineStyle, children: getItemLabel(option) }, key);
|
|
10351
|
+
}
|
|
10352
|
+
function useResetCache(itemCount) {
|
|
10353
|
+
const ref = useRef(null);
|
|
10354
|
+
useEffect(() => {
|
|
10355
|
+
if (ref.current != null) {
|
|
10356
|
+
ref.current.resetAfterIndex(0, true);
|
|
10357
|
+
}
|
|
10358
|
+
}, [itemCount]);
|
|
10359
|
+
return ref;
|
|
10360
|
+
}
|
|
10361
|
+
React__default.forwardRef((props, ref) => {
|
|
10362
|
+
const { children, ...other } = props;
|
|
10363
|
+
const items = children;
|
|
10364
|
+
const itemCount = items.length;
|
|
10365
|
+
const gridRef = useResetCache(itemCount);
|
|
10366
|
+
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 }) }) });
|
|
10367
|
+
});
|
|
9344
10368
|
const useStyles$1 = makeStyles()((theme) => ({
|
|
9345
10369
|
tooltipAnchor: {
|
|
9346
10370
|
position: "relative",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vitessce/tooltip",
|
|
3
|
-
"version": "3.9.
|
|
3
|
+
"version": "3.9.3",
|
|
4
4
|
"author": "HIDIVE Lab at HMS",
|
|
5
5
|
"homepage": "http://vitessce.io",
|
|
6
6
|
"repository": {
|
|
@@ -16,9 +16,9 @@
|
|
|
16
16
|
"dist-tsc"
|
|
17
17
|
],
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@vitessce/
|
|
20
|
-
"@vitessce/
|
|
21
|
-
"@vitessce/utils": "3.9.
|
|
19
|
+
"@vitessce/styles": "3.9.3",
|
|
20
|
+
"@vitessce/vit-s": "3.9.3",
|
|
21
|
+
"@vitessce/utils": "3.9.3"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
24
|
"react": "18.3.1",
|