@vitessce/feature-list 3.8.10 → 3.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -715,9 +715,11 @@ const CoordinationType = {
715
715
  OBS_SET_HIGHLIGHT: "obsSetHighlight",
716
716
  OBS_SET_EXPANSION: "obsSetExpansion",
717
717
  OBS_SET_COLOR: "obsSetColor",
718
+ FEATURE_COLOR: "featureColor",
718
719
  FEATURE_HIGHLIGHT: "featureHighlight",
719
720
  FEATURE_SELECTION: "featureSelection",
720
721
  FEATURE_FILTER: "featureFilter",
722
+ FEATURE_FILTER_MODE: "featureFilterMode",
721
723
  FEATURE_VALUE_COLORMAP: "featureValueColormap",
722
724
  FEATURE_VALUE_TRANSFORM: "featureValueTransform",
723
725
  FEATURE_VALUE_COLORMAP_RANGE: "featureValueColormapRange",
@@ -1025,6 +1027,8 @@ const COMPONENT_COORDINATION_TYPES = {
1025
1027
  CoordinationType.OBS_SET_FILTER,
1026
1028
  CoordinationType.OBS_SET_HIGHLIGHT,
1027
1029
  CoordinationType.OBS_SET_COLOR,
1030
+ CoordinationType.FEATURE_COLOR,
1031
+ CoordinationType.FEATURE_FILTER_MODE,
1028
1032
  CoordinationType.FEATURE_HIGHLIGHT,
1029
1033
  CoordinationType.FEATURE_SELECTION,
1030
1034
  CoordinationType.FEATURE_VALUE_COLORMAP,
@@ -1239,6 +1243,8 @@ const COMPONENT_COORDINATION_TYPES = {
1239
1243
  CoordinationType.SPATIAL_SPOT_STROKE_WIDTH,
1240
1244
  CoordinationType.SPATIAL_LAYER_COLOR,
1241
1245
  CoordinationType.OBS_COLOR_ENCODING,
1246
+ CoordinationType.FEATURE_COLOR,
1247
+ CoordinationType.FEATURE_FILTER_MODE,
1242
1248
  CoordinationType.FEATURE_VALUE_COLORMAP,
1243
1249
  CoordinationType.FEATURE_VALUE_COLORMAP_RANGE,
1244
1250
  CoordinationType.FEATURE_SELECTION,
@@ -8916,11 +8922,6 @@ const { tss } = createTss({
8916
8922
  "usePlugin": useMuiThemeStyleOverridesPlugin
8917
8923
  });
8918
8924
  const useStyles$3 = tss.create({});
8919
- function chainPropTypes(propType1, propType2) {
8920
- return function validate(...args) {
8921
- return propType1(...args) || propType2(...args);
8922
- };
8923
- }
8924
8925
  const memoTheme = unstable_memoTheme;
8925
8926
  ({
8926
8927
  // ┌────────────────────────────── Warning ──────────────────────────────┐
@@ -8939,413 +8940,87 @@ const memoTheme = unstable_memoTheme;
8939
8940
  function useDefaultProps(params) {
8940
8941
  return useDefaultProps$1(params);
8941
8942
  }
8942
- function _extends$1() {
8943
- return _extends$1 = Object.assign ? Object.assign.bind() : function(n) {
8944
- for (var e = 1; e < arguments.length; e++) {
8945
- var t = arguments[e];
8946
- for (var r2 in t) ({}).hasOwnProperty.call(t, r2) && (n[r2] = t[r2]);
8947
- }
8948
- return n;
8949
- }, _extends$1.apply(null, arguments);
8950
- }
8951
- function _objectWithoutPropertiesLoose$1(r2, e) {
8952
- if (null == r2) return {};
8953
- var t = {};
8954
- for (var n in r2) if ({}.hasOwnProperty.call(r2, n)) {
8955
- if (-1 !== e.indexOf(n)) continue;
8956
- t[n] = r2[n];
8957
- }
8958
- return t;
8959
- }
8960
- function _setPrototypeOf$1(t, e) {
8961
- return _setPrototypeOf$1 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(t2, e2) {
8962
- return t2.__proto__ = e2, t2;
8963
- }, _setPrototypeOf$1(t, e);
8964
- }
8965
- function _inheritsLoose(t, o) {
8966
- t.prototype = Object.create(o.prototype), t.prototype.constructor = t, _setPrototypeOf$1(t, o);
8967
- }
8968
- const TransitionGroupContext = React__default.createContext(null);
8969
- function _assertThisInitialized$1(e) {
8970
- if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
8971
- return e;
8943
+ function getSvgIconUtilityClass(slot) {
8944
+ return generateUtilityClass("MuiSvgIcon", slot);
8972
8945
  }
8973
- function getChildMapping(children2, mapFn) {
8974
- var mapper = function mapper2(child) {
8975
- return mapFn && isValidElement(child) ? mapFn(child) : child;
8946
+ generateUtilityClasses("MuiSvgIcon", ["root", "colorPrimary", "colorSecondary", "colorAction", "colorError", "colorDisabled", "fontSizeInherit", "fontSizeSmall", "fontSizeMedium", "fontSizeLarge"]);
8947
+ const useUtilityClasses$5 = (ownerState) => {
8948
+ const {
8949
+ color: color2,
8950
+ fontSize,
8951
+ classes
8952
+ } = ownerState;
8953
+ const slots = {
8954
+ root: ["root", color2 !== "inherit" && `color${capitalize(color2)}`, `fontSize${capitalize(fontSize)}`]
8976
8955
  };
8977
- var result = /* @__PURE__ */ Object.create(null);
8978
- if (children2) Children.map(children2, function(c) {
8979
- return c;
8980
- }).forEach(function(child) {
8981
- result[child.key] = mapper(child);
8982
- });
8983
- return result;
8984
- }
8985
- function mergeChildMappings(prev2, next2) {
8986
- prev2 = prev2 || {};
8987
- next2 = next2 || {};
8988
- function getValueForKey(key) {
8989
- return key in next2 ? next2[key] : prev2[key];
8990
- }
8991
- var nextKeysPending = /* @__PURE__ */ Object.create(null);
8992
- var pendingKeys = [];
8993
- for (var prevKey in prev2) {
8994
- if (prevKey in next2) {
8995
- if (pendingKeys.length) {
8996
- nextKeysPending[prevKey] = pendingKeys;
8997
- pendingKeys = [];
8998
- }
8999
- } else {
9000
- pendingKeys.push(prevKey);
9001
- }
9002
- }
9003
- var i;
9004
- var childMapping = {};
9005
- for (var nextKey in next2) {
9006
- if (nextKeysPending[nextKey]) {
9007
- for (i = 0; i < nextKeysPending[nextKey].length; i++) {
9008
- var pendingNextKey = nextKeysPending[nextKey][i];
9009
- childMapping[nextKeysPending[nextKey][i]] = getValueForKey(pendingNextKey);
9010
- }
9011
- }
9012
- childMapping[nextKey] = getValueForKey(nextKey);
9013
- }
9014
- for (i = 0; i < pendingKeys.length; i++) {
9015
- childMapping[pendingKeys[i]] = getValueForKey(pendingKeys[i]);
9016
- }
9017
- return childMapping;
9018
- }
9019
- function getProp(child, prop, props) {
9020
- return props[prop] != null ? props[prop] : child.props[prop];
9021
- }
9022
- function getInitialChildMapping(props, onExited) {
9023
- return getChildMapping(props.children, function(child) {
9024
- return cloneElement(child, {
9025
- onExited: onExited.bind(null, child),
9026
- in: true,
9027
- appear: getProp(child, "appear", props),
9028
- enter: getProp(child, "enter", props),
9029
- exit: getProp(child, "exit", props)
9030
- });
9031
- });
9032
- }
9033
- function getNextChildMapping(nextProps, prevChildMapping, onExited) {
9034
- var nextChildMapping = getChildMapping(nextProps.children);
9035
- var children2 = mergeChildMappings(prevChildMapping, nextChildMapping);
9036
- Object.keys(children2).forEach(function(key) {
9037
- var child = children2[key];
9038
- if (!isValidElement(child)) return;
9039
- var hasPrev = key in prevChildMapping;
9040
- var hasNext = key in nextChildMapping;
9041
- var prevChild = prevChildMapping[key];
9042
- var isLeaving = isValidElement(prevChild) && !prevChild.props.in;
9043
- if (hasNext && (!hasPrev || isLeaving)) {
9044
- children2[key] = cloneElement(child, {
9045
- onExited: onExited.bind(null, child),
9046
- in: true,
9047
- exit: getProp(child, "exit", nextProps),
9048
- enter: getProp(child, "enter", nextProps)
9049
- });
9050
- } else if (!hasNext && hasPrev && !isLeaving) {
9051
- children2[key] = cloneElement(child, {
9052
- in: false
9053
- });
9054
- } else if (hasNext && hasPrev && isValidElement(prevChild)) {
9055
- children2[key] = cloneElement(child, {
9056
- onExited: onExited.bind(null, child),
9057
- in: prevChild.props.in,
9058
- exit: getProp(child, "exit", nextProps),
9059
- enter: getProp(child, "enter", nextProps)
9060
- });
9061
- }
9062
- });
9063
- return children2;
9064
- }
9065
- var values = Object.values || function(obj) {
9066
- return Object.keys(obj).map(function(k) {
9067
- return obj[k];
9068
- });
8956
+ return composeClasses(slots, getSvgIconUtilityClass, classes);
9069
8957
  };
9070
- var defaultProps = {
9071
- component: "div",
9072
- childFactory: function childFactory(child) {
9073
- return child;
8958
+ const SvgIconRoot = styled("svg", {
8959
+ name: "MuiSvgIcon",
8960
+ slot: "Root",
8961
+ overridesResolver: (props, styles) => {
8962
+ const {
8963
+ ownerState
8964
+ } = props;
8965
+ return [styles.root, ownerState.color !== "inherit" && styles[`color${capitalize(ownerState.color)}`], styles[`fontSize${capitalize(ownerState.fontSize)}`]];
9074
8966
  }
9075
- };
9076
- var TransitionGroup = /* @__PURE__ */ function(_React$Component) {
9077
- _inheritsLoose(TransitionGroup2, _React$Component);
9078
- function TransitionGroup2(props, context) {
9079
- var _this;
9080
- _this = _React$Component.call(this, props, context) || this;
9081
- var handleExited = _this.handleExited.bind(_assertThisInitialized$1(_this));
9082
- _this.state = {
9083
- contextValue: {
9084
- isMounting: true
8967
+ })(memoTheme(({
8968
+ theme
8969
+ }) => {
8970
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;
8971
+ return {
8972
+ userSelect: "none",
8973
+ width: "1em",
8974
+ height: "1em",
8975
+ display: "inline-block",
8976
+ flexShrink: 0,
8977
+ transition: (_d = (_a = theme.transitions) == null ? void 0 : _a.create) == null ? void 0 : _d.call(_a, "fill", {
8978
+ duration: (_c = (_b = (theme.vars ?? theme).transitions) == null ? void 0 : _b.duration) == null ? void 0 : _c.shorter
8979
+ }),
8980
+ variants: [
8981
+ {
8982
+ props: (props) => !props.hasSvgAsChild,
8983
+ style: {
8984
+ // the <svg> will define the property that has `currentColor`
8985
+ // for example heroicons uses fill="none" and stroke="currentColor"
8986
+ fill: "currentColor"
8987
+ }
9085
8988
  },
9086
- handleExited,
9087
- firstRender: true
9088
- };
9089
- return _this;
9090
- }
9091
- var _proto = TransitionGroup2.prototype;
9092
- _proto.componentDidMount = function componentDidMount() {
9093
- this.mounted = true;
9094
- this.setState({
9095
- contextValue: {
9096
- isMounting: false
9097
- }
9098
- });
9099
- };
9100
- _proto.componentWillUnmount = function componentWillUnmount() {
9101
- this.mounted = false;
9102
- };
9103
- TransitionGroup2.getDerivedStateFromProps = function getDerivedStateFromProps(nextProps, _ref) {
9104
- var prevChildMapping = _ref.children, handleExited = _ref.handleExited, firstRender = _ref.firstRender;
9105
- return {
9106
- children: firstRender ? getInitialChildMapping(nextProps, handleExited) : getNextChildMapping(nextProps, prevChildMapping, handleExited),
9107
- firstRender: false
9108
- };
9109
- };
9110
- _proto.handleExited = function handleExited(child, node2) {
9111
- var currentChildMapping = getChildMapping(this.props.children);
9112
- if (child.key in currentChildMapping) return;
9113
- if (child.props.onExited) {
9114
- child.props.onExited(node2);
9115
- }
9116
- if (this.mounted) {
9117
- this.setState(function(state) {
9118
- var children2 = _extends$1({}, state.children);
9119
- delete children2[child.key];
9120
- return {
9121
- children: children2
9122
- };
9123
- });
9124
- }
9125
- };
9126
- _proto.render = function render() {
9127
- var _this$props = this.props, Component = _this$props.component, childFactory2 = _this$props.childFactory, props = _objectWithoutPropertiesLoose$1(_this$props, ["component", "childFactory"]);
9128
- var contextValue = this.state.contextValue;
9129
- var children2 = values(this.state.children).map(childFactory2);
9130
- delete props.appear;
9131
- delete props.enter;
9132
- delete props.exit;
9133
- if (Component === null) {
9134
- return /* @__PURE__ */ React__default.createElement(TransitionGroupContext.Provider, {
9135
- value: contextValue
9136
- }, children2);
9137
- }
9138
- return /* @__PURE__ */ React__default.createElement(TransitionGroupContext.Provider, {
9139
- value: contextValue
9140
- }, /* @__PURE__ */ React__default.createElement(Component, props, children2));
9141
- };
9142
- return TransitionGroup2;
9143
- }(React__default.Component);
9144
- TransitionGroup.propTypes = {
9145
- /**
9146
- * `<TransitionGroup>` renders a `<div>` by default. You can change this
9147
- * behavior by providing a `component` prop.
9148
- * If you use React v16+ and would like to avoid a wrapping `<div>` element
9149
- * you can pass in `component={null}`. This is useful if the wrapping div
9150
- * borks your css styles.
9151
- */
9152
- component: PropTypes.any,
9153
- /**
9154
- * A set of `<Transition>` components, that are toggled `in` and out as they
9155
- * leave. the `<TransitionGroup>` will inject specific transition props, so
9156
- * remember to spread them through if you are wrapping the `<Transition>` as
9157
- * with our `<Fade>` example.
9158
- *
9159
- * While this component is meant for multiple `Transition` or `CSSTransition`
9160
- * children, sometimes you may want to have a single transition child with
9161
- * content that you want to be transitioned out and in when you change it
9162
- * (e.g. routes, images etc.) In that case you can change the `key` prop of
9163
- * the transition child as you change its content, this will cause
9164
- * `TransitionGroup` to transition the child out and back in.
9165
- */
9166
- children: PropTypes.node,
9167
- /**
9168
- * A convenience prop that enables or disables appear animations
9169
- * for all children. Note that specifying this will override any defaults set
9170
- * on individual children Transitions.
9171
- */
9172
- appear: PropTypes.bool,
9173
- /**
9174
- * A convenience prop that enables or disables enter animations
9175
- * for all children. Note that specifying this will override any defaults set
9176
- * on individual children Transitions.
9177
- */
9178
- enter: PropTypes.bool,
9179
- /**
9180
- * A convenience prop that enables or disables exit animations
9181
- * for all children. Note that specifying this will override any defaults set
9182
- * on individual children Transitions.
9183
- */
9184
- exit: PropTypes.bool,
9185
- /**
9186
- * You may need to apply reactive updates to a child as it is exiting.
9187
- * This is generally done by using `cloneElement` however in the case of an exiting
9188
- * child the element has already been removed and not accessible to the consumer.
9189
- *
9190
- * If you do need to update a child as it leaves you can provide a `childFactory`
9191
- * to wrap every child, even the ones that are leaving.
9192
- *
9193
- * @type Function(child: ReactElement) -> ReactElement
9194
- */
9195
- childFactory: PropTypes.func
9196
- };
9197
- TransitionGroup.defaultProps = defaultProps;
9198
- const UNINITIALIZED = {};
9199
- function useLazyRef(init, initArg) {
9200
- const ref = React.useRef(UNINITIALIZED);
9201
- if (ref.current === UNINITIALIZED) {
9202
- ref.current = init(initArg);
9203
- }
9204
- return ref;
9205
- }
9206
- const EMPTY$1 = [];
9207
- function useOnMount(fn) {
9208
- React.useEffect(fn, EMPTY$1);
9209
- }
9210
- class Timeout {
9211
- constructor() {
9212
- __publicField(this, "currentId", null);
9213
- __publicField(this, "clear", () => {
9214
- if (this.currentId !== null) {
9215
- clearTimeout(this.currentId);
9216
- this.currentId = null;
9217
- }
9218
- });
9219
- __publicField(this, "disposeEffect", () => {
9220
- return this.clear;
9221
- });
9222
- }
9223
- static create() {
9224
- return new Timeout();
9225
- }
9226
- /**
9227
- * Executes `fn` after `delay`, clearing any previously scheduled call.
9228
- */
9229
- start(delay, fn) {
9230
- this.clear();
9231
- this.currentId = setTimeout(() => {
9232
- this.currentId = null;
9233
- fn();
9234
- }, delay);
9235
- }
9236
- }
9237
- function useTimeout() {
9238
- const timeout = useLazyRef(Timeout.create).current;
9239
- useOnMount(timeout.disposeEffect);
9240
- return timeout;
9241
- }
9242
- function isClassComponent(elementType) {
9243
- const {
9244
- prototype = {}
9245
- } = elementType;
9246
- return Boolean(prototype.isReactComponent);
9247
- }
9248
- function elementTypeAcceptingRef(props, propName, componentName, location, propFullName) {
9249
- const propValue = props[propName];
9250
- const safePropName = propFullName || propName;
9251
- if (propValue == null || // When server-side rendering React doesn't warn either.
9252
- // This is not an accurate check for SSR.
9253
- // This is only in place for emotion compat.
9254
- // TODO: Revisit once https://github.com/facebook/react/issues/20047 is resolved.
9255
- typeof window === "undefined") {
9256
- return null;
9257
- }
9258
- let warningHint;
9259
- if (typeof propValue === "function" && !isClassComponent(propValue)) {
9260
- warningHint = "Did you accidentally provide a plain function component instead?";
9261
- }
9262
- if (warningHint !== void 0) {
9263
- return new Error(`Invalid ${location} \`${safePropName}\` supplied to \`${componentName}\`. Expected an element type that can hold a ref. ${warningHint} For more information see https://mui.com/r/caveat-with-refs-guide`);
9264
- }
9265
- return null;
9266
- }
9267
- const elementTypeAcceptingRef$1 = chainPropTypes(PropTypes.elementType, elementTypeAcceptingRef);
9268
- function getSvgIconUtilityClass(slot) {
9269
- return generateUtilityClass("MuiSvgIcon", slot);
9270
- }
9271
- generateUtilityClasses("MuiSvgIcon", ["root", "colorPrimary", "colorSecondary", "colorAction", "colorError", "colorDisabled", "fontSizeInherit", "fontSizeSmall", "fontSizeMedium", "fontSizeLarge"]);
9272
- const useUtilityClasses$5 = (ownerState) => {
9273
- const {
9274
- color: color2,
9275
- fontSize,
9276
- classes
9277
- } = ownerState;
9278
- const slots = {
9279
- root: ["root", color2 !== "inherit" && `color${capitalize(color2)}`, `fontSize${capitalize(fontSize)}`]
9280
- };
9281
- return composeClasses(slots, getSvgIconUtilityClass, classes);
9282
- };
9283
- const SvgIconRoot = styled("svg", {
9284
- name: "MuiSvgIcon",
9285
- slot: "Root",
9286
- overridesResolver: (props, styles) => {
9287
- const {
9288
- ownerState
9289
- } = props;
9290
- return [styles.root, ownerState.color !== "inherit" && styles[`color${capitalize(ownerState.color)}`], styles[`fontSize${capitalize(ownerState.fontSize)}`]];
9291
- }
9292
- })(memoTheme(({
9293
- theme
9294
- }) => {
9295
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;
9296
- return {
9297
- userSelect: "none",
9298
- width: "1em",
9299
- height: "1em",
9300
- display: "inline-block",
9301
- flexShrink: 0,
9302
- transition: (_d = (_a = theme.transitions) == null ? void 0 : _a.create) == null ? void 0 : _d.call(_a, "fill", {
9303
- duration: (_c = (_b = (theme.vars ?? theme).transitions) == null ? void 0 : _b.duration) == null ? void 0 : _c.shorter
9304
- }),
9305
- variants: [
9306
- {
9307
- props: (props) => !props.hasSvgAsChild,
9308
- style: {
9309
- // the <svg> will define the property that has `currentColor`
9310
- // for example heroicons uses fill="none" and stroke="currentColor"
9311
- fill: "currentColor"
9312
- }
9313
- },
9314
- {
9315
- props: {
9316
- fontSize: "inherit"
9317
- },
9318
- style: {
9319
- fontSize: "inherit"
9320
- }
9321
- },
9322
- {
9323
- props: {
9324
- fontSize: "small"
9325
- },
9326
- style: {
9327
- fontSize: ((_f = (_e = theme.typography) == null ? void 0 : _e.pxToRem) == null ? void 0 : _f.call(_e, 20)) || "1.25rem"
9328
- }
9329
- },
9330
- {
9331
- props: {
9332
- fontSize: "medium"
9333
- },
9334
- style: {
9335
- fontSize: ((_h = (_g = theme.typography) == null ? void 0 : _g.pxToRem) == null ? void 0 : _h.call(_g, 24)) || "1.5rem"
9336
- }
9337
- },
9338
- {
9339
- props: {
9340
- fontSize: "large"
9341
- },
9342
- style: {
9343
- fontSize: ((_j = (_i = theme.typography) == null ? void 0 : _i.pxToRem) == null ? void 0 : _j.call(_i, 35)) || "2.1875rem"
9344
- }
9345
- },
9346
- // TODO v5 deprecate color prop, v6 remove for sx
9347
- ...Object.entries((theme.vars ?? theme).palette).filter(([, value]) => value && value.main).map(([color2]) => {
9348
- var _a2, _b2;
8989
+ {
8990
+ props: {
8991
+ fontSize: "inherit"
8992
+ },
8993
+ style: {
8994
+ fontSize: "inherit"
8995
+ }
8996
+ },
8997
+ {
8998
+ props: {
8999
+ fontSize: "small"
9000
+ },
9001
+ style: {
9002
+ fontSize: ((_f = (_e = theme.typography) == null ? void 0 : _e.pxToRem) == null ? void 0 : _f.call(_e, 20)) || "1.25rem"
9003
+ }
9004
+ },
9005
+ {
9006
+ props: {
9007
+ fontSize: "medium"
9008
+ },
9009
+ style: {
9010
+ fontSize: ((_h = (_g = theme.typography) == null ? void 0 : _g.pxToRem) == null ? void 0 : _h.call(_g, 24)) || "1.5rem"
9011
+ }
9012
+ },
9013
+ {
9014
+ props: {
9015
+ fontSize: "large"
9016
+ },
9017
+ style: {
9018
+ fontSize: ((_j = (_i = theme.typography) == null ? void 0 : _i.pxToRem) == null ? void 0 : _j.call(_i, 35)) || "2.1875rem"
9019
+ }
9020
+ },
9021
+ // TODO v5 deprecate color prop, v6 remove for sx
9022
+ ...Object.entries((theme.vars ?? theme).palette).filter(([, value]) => value && value.main).map(([color2]) => {
9023
+ var _a2, _b2;
9349
9024
  return {
9350
9025
  props: {
9351
9026
  color: color2
@@ -9678,6 +9353,337 @@ function mergeSlotProps$1(externalSlotProps, defaultSlotProps) {
9678
9353
  }
9679
9354
  };
9680
9355
  }
9356
+ function chainPropTypes(propType1, propType2) {
9357
+ return function validate(...args) {
9358
+ return propType1(...args) || propType2(...args);
9359
+ };
9360
+ }
9361
+ function _extends$1() {
9362
+ return _extends$1 = Object.assign ? Object.assign.bind() : function(n) {
9363
+ for (var e = 1; e < arguments.length; e++) {
9364
+ var t = arguments[e];
9365
+ for (var r2 in t) ({}).hasOwnProperty.call(t, r2) && (n[r2] = t[r2]);
9366
+ }
9367
+ return n;
9368
+ }, _extends$1.apply(null, arguments);
9369
+ }
9370
+ function _objectWithoutPropertiesLoose$1(r2, e) {
9371
+ if (null == r2) return {};
9372
+ var t = {};
9373
+ for (var n in r2) if ({}.hasOwnProperty.call(r2, n)) {
9374
+ if (-1 !== e.indexOf(n)) continue;
9375
+ t[n] = r2[n];
9376
+ }
9377
+ return t;
9378
+ }
9379
+ function _setPrototypeOf$1(t, e) {
9380
+ return _setPrototypeOf$1 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(t2, e2) {
9381
+ return t2.__proto__ = e2, t2;
9382
+ }, _setPrototypeOf$1(t, e);
9383
+ }
9384
+ function _inheritsLoose(t, o) {
9385
+ t.prototype = Object.create(o.prototype), t.prototype.constructor = t, _setPrototypeOf$1(t, o);
9386
+ }
9387
+ const TransitionGroupContext = React__default.createContext(null);
9388
+ function _assertThisInitialized$1(e) {
9389
+ if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
9390
+ return e;
9391
+ }
9392
+ function getChildMapping(children2, mapFn) {
9393
+ var mapper = function mapper2(child) {
9394
+ return mapFn && isValidElement(child) ? mapFn(child) : child;
9395
+ };
9396
+ var result = /* @__PURE__ */ Object.create(null);
9397
+ if (children2) Children.map(children2, function(c) {
9398
+ return c;
9399
+ }).forEach(function(child) {
9400
+ result[child.key] = mapper(child);
9401
+ });
9402
+ return result;
9403
+ }
9404
+ function mergeChildMappings(prev2, next2) {
9405
+ prev2 = prev2 || {};
9406
+ next2 = next2 || {};
9407
+ function getValueForKey(key) {
9408
+ return key in next2 ? next2[key] : prev2[key];
9409
+ }
9410
+ var nextKeysPending = /* @__PURE__ */ Object.create(null);
9411
+ var pendingKeys = [];
9412
+ for (var prevKey in prev2) {
9413
+ if (prevKey in next2) {
9414
+ if (pendingKeys.length) {
9415
+ nextKeysPending[prevKey] = pendingKeys;
9416
+ pendingKeys = [];
9417
+ }
9418
+ } else {
9419
+ pendingKeys.push(prevKey);
9420
+ }
9421
+ }
9422
+ var i;
9423
+ var childMapping = {};
9424
+ for (var nextKey in next2) {
9425
+ if (nextKeysPending[nextKey]) {
9426
+ for (i = 0; i < nextKeysPending[nextKey].length; i++) {
9427
+ var pendingNextKey = nextKeysPending[nextKey][i];
9428
+ childMapping[nextKeysPending[nextKey][i]] = getValueForKey(pendingNextKey);
9429
+ }
9430
+ }
9431
+ childMapping[nextKey] = getValueForKey(nextKey);
9432
+ }
9433
+ for (i = 0; i < pendingKeys.length; i++) {
9434
+ childMapping[pendingKeys[i]] = getValueForKey(pendingKeys[i]);
9435
+ }
9436
+ return childMapping;
9437
+ }
9438
+ function getProp(child, prop, props) {
9439
+ return props[prop] != null ? props[prop] : child.props[prop];
9440
+ }
9441
+ function getInitialChildMapping(props, onExited) {
9442
+ return getChildMapping(props.children, function(child) {
9443
+ return cloneElement(child, {
9444
+ onExited: onExited.bind(null, child),
9445
+ in: true,
9446
+ appear: getProp(child, "appear", props),
9447
+ enter: getProp(child, "enter", props),
9448
+ exit: getProp(child, "exit", props)
9449
+ });
9450
+ });
9451
+ }
9452
+ function getNextChildMapping(nextProps, prevChildMapping, onExited) {
9453
+ var nextChildMapping = getChildMapping(nextProps.children);
9454
+ var children2 = mergeChildMappings(prevChildMapping, nextChildMapping);
9455
+ Object.keys(children2).forEach(function(key) {
9456
+ var child = children2[key];
9457
+ if (!isValidElement(child)) return;
9458
+ var hasPrev = key in prevChildMapping;
9459
+ var hasNext = key in nextChildMapping;
9460
+ var prevChild = prevChildMapping[key];
9461
+ var isLeaving = isValidElement(prevChild) && !prevChild.props.in;
9462
+ if (hasNext && (!hasPrev || isLeaving)) {
9463
+ children2[key] = cloneElement(child, {
9464
+ onExited: onExited.bind(null, child),
9465
+ in: true,
9466
+ exit: getProp(child, "exit", nextProps),
9467
+ enter: getProp(child, "enter", nextProps)
9468
+ });
9469
+ } else if (!hasNext && hasPrev && !isLeaving) {
9470
+ children2[key] = cloneElement(child, {
9471
+ in: false
9472
+ });
9473
+ } else if (hasNext && hasPrev && isValidElement(prevChild)) {
9474
+ children2[key] = cloneElement(child, {
9475
+ onExited: onExited.bind(null, child),
9476
+ in: prevChild.props.in,
9477
+ exit: getProp(child, "exit", nextProps),
9478
+ enter: getProp(child, "enter", nextProps)
9479
+ });
9480
+ }
9481
+ });
9482
+ return children2;
9483
+ }
9484
+ var values = Object.values || function(obj) {
9485
+ return Object.keys(obj).map(function(k) {
9486
+ return obj[k];
9487
+ });
9488
+ };
9489
+ var defaultProps = {
9490
+ component: "div",
9491
+ childFactory: function childFactory(child) {
9492
+ return child;
9493
+ }
9494
+ };
9495
+ var TransitionGroup = /* @__PURE__ */ function(_React$Component) {
9496
+ _inheritsLoose(TransitionGroup2, _React$Component);
9497
+ function TransitionGroup2(props, context) {
9498
+ var _this;
9499
+ _this = _React$Component.call(this, props, context) || this;
9500
+ var handleExited = _this.handleExited.bind(_assertThisInitialized$1(_this));
9501
+ _this.state = {
9502
+ contextValue: {
9503
+ isMounting: true
9504
+ },
9505
+ handleExited,
9506
+ firstRender: true
9507
+ };
9508
+ return _this;
9509
+ }
9510
+ var _proto = TransitionGroup2.prototype;
9511
+ _proto.componentDidMount = function componentDidMount() {
9512
+ this.mounted = true;
9513
+ this.setState({
9514
+ contextValue: {
9515
+ isMounting: false
9516
+ }
9517
+ });
9518
+ };
9519
+ _proto.componentWillUnmount = function componentWillUnmount() {
9520
+ this.mounted = false;
9521
+ };
9522
+ TransitionGroup2.getDerivedStateFromProps = function getDerivedStateFromProps(nextProps, _ref) {
9523
+ var prevChildMapping = _ref.children, handleExited = _ref.handleExited, firstRender = _ref.firstRender;
9524
+ return {
9525
+ children: firstRender ? getInitialChildMapping(nextProps, handleExited) : getNextChildMapping(nextProps, prevChildMapping, handleExited),
9526
+ firstRender: false
9527
+ };
9528
+ };
9529
+ _proto.handleExited = function handleExited(child, node2) {
9530
+ var currentChildMapping = getChildMapping(this.props.children);
9531
+ if (child.key in currentChildMapping) return;
9532
+ if (child.props.onExited) {
9533
+ child.props.onExited(node2);
9534
+ }
9535
+ if (this.mounted) {
9536
+ this.setState(function(state) {
9537
+ var children2 = _extends$1({}, state.children);
9538
+ delete children2[child.key];
9539
+ return {
9540
+ children: children2
9541
+ };
9542
+ });
9543
+ }
9544
+ };
9545
+ _proto.render = function render() {
9546
+ var _this$props = this.props, Component = _this$props.component, childFactory2 = _this$props.childFactory, props = _objectWithoutPropertiesLoose$1(_this$props, ["component", "childFactory"]);
9547
+ var contextValue = this.state.contextValue;
9548
+ var children2 = values(this.state.children).map(childFactory2);
9549
+ delete props.appear;
9550
+ delete props.enter;
9551
+ delete props.exit;
9552
+ if (Component === null) {
9553
+ return /* @__PURE__ */ React__default.createElement(TransitionGroupContext.Provider, {
9554
+ value: contextValue
9555
+ }, children2);
9556
+ }
9557
+ return /* @__PURE__ */ React__default.createElement(TransitionGroupContext.Provider, {
9558
+ value: contextValue
9559
+ }, /* @__PURE__ */ React__default.createElement(Component, props, children2));
9560
+ };
9561
+ return TransitionGroup2;
9562
+ }(React__default.Component);
9563
+ TransitionGroup.propTypes = {
9564
+ /**
9565
+ * `<TransitionGroup>` renders a `<div>` by default. You can change this
9566
+ * behavior by providing a `component` prop.
9567
+ * If you use React v16+ and would like to avoid a wrapping `<div>` element
9568
+ * you can pass in `component={null}`. This is useful if the wrapping div
9569
+ * borks your css styles.
9570
+ */
9571
+ component: PropTypes.any,
9572
+ /**
9573
+ * A set of `<Transition>` components, that are toggled `in` and out as they
9574
+ * leave. the `<TransitionGroup>` will inject specific transition props, so
9575
+ * remember to spread them through if you are wrapping the `<Transition>` as
9576
+ * with our `<Fade>` example.
9577
+ *
9578
+ * While this component is meant for multiple `Transition` or `CSSTransition`
9579
+ * children, sometimes you may want to have a single transition child with
9580
+ * content that you want to be transitioned out and in when you change it
9581
+ * (e.g. routes, images etc.) In that case you can change the `key` prop of
9582
+ * the transition child as you change its content, this will cause
9583
+ * `TransitionGroup` to transition the child out and back in.
9584
+ */
9585
+ children: PropTypes.node,
9586
+ /**
9587
+ * A convenience prop that enables or disables appear animations
9588
+ * for all children. Note that specifying this will override any defaults set
9589
+ * on individual children Transitions.
9590
+ */
9591
+ appear: PropTypes.bool,
9592
+ /**
9593
+ * A convenience prop that enables or disables enter animations
9594
+ * for all children. Note that specifying this will override any defaults set
9595
+ * on individual children Transitions.
9596
+ */
9597
+ enter: PropTypes.bool,
9598
+ /**
9599
+ * A convenience prop that enables or disables exit animations
9600
+ * for all children. Note that specifying this will override any defaults set
9601
+ * on individual children Transitions.
9602
+ */
9603
+ exit: PropTypes.bool,
9604
+ /**
9605
+ * You may need to apply reactive updates to a child as it is exiting.
9606
+ * This is generally done by using `cloneElement` however in the case of an exiting
9607
+ * child the element has already been removed and not accessible to the consumer.
9608
+ *
9609
+ * If you do need to update a child as it leaves you can provide a `childFactory`
9610
+ * to wrap every child, even the ones that are leaving.
9611
+ *
9612
+ * @type Function(child: ReactElement) -> ReactElement
9613
+ */
9614
+ childFactory: PropTypes.func
9615
+ };
9616
+ TransitionGroup.defaultProps = defaultProps;
9617
+ const UNINITIALIZED = {};
9618
+ function useLazyRef(init, initArg) {
9619
+ const ref = React.useRef(UNINITIALIZED);
9620
+ if (ref.current === UNINITIALIZED) {
9621
+ ref.current = init(initArg);
9622
+ }
9623
+ return ref;
9624
+ }
9625
+ const EMPTY$1 = [];
9626
+ function useOnMount(fn) {
9627
+ React.useEffect(fn, EMPTY$1);
9628
+ }
9629
+ class Timeout {
9630
+ constructor() {
9631
+ __publicField(this, "currentId", null);
9632
+ __publicField(this, "clear", () => {
9633
+ if (this.currentId !== null) {
9634
+ clearTimeout(this.currentId);
9635
+ this.currentId = null;
9636
+ }
9637
+ });
9638
+ __publicField(this, "disposeEffect", () => {
9639
+ return this.clear;
9640
+ });
9641
+ }
9642
+ static create() {
9643
+ return new Timeout();
9644
+ }
9645
+ /**
9646
+ * Executes `fn` after `delay`, clearing any previously scheduled call.
9647
+ */
9648
+ start(delay, fn) {
9649
+ this.clear();
9650
+ this.currentId = setTimeout(() => {
9651
+ this.currentId = null;
9652
+ fn();
9653
+ }, delay);
9654
+ }
9655
+ }
9656
+ function useTimeout() {
9657
+ const timeout = useLazyRef(Timeout.create).current;
9658
+ useOnMount(timeout.disposeEffect);
9659
+ return timeout;
9660
+ }
9661
+ function isClassComponent(elementType) {
9662
+ const {
9663
+ prototype = {}
9664
+ } = elementType;
9665
+ return Boolean(prototype.isReactComponent);
9666
+ }
9667
+ function elementTypeAcceptingRef(props, propName, componentName, location, propFullName) {
9668
+ const propValue = props[propName];
9669
+ const safePropName = propFullName || propName;
9670
+ if (propValue == null || // When server-side rendering React doesn't warn either.
9671
+ // This is not an accurate check for SSR.
9672
+ // This is only in place for emotion compat.
9673
+ // TODO: Revisit once https://github.com/facebook/react/issues/20047 is resolved.
9674
+ typeof window === "undefined") {
9675
+ return null;
9676
+ }
9677
+ let warningHint;
9678
+ if (typeof propValue === "function" && !isClassComponent(propValue)) {
9679
+ warningHint = "Did you accidentally provide a plain function component instead?";
9680
+ }
9681
+ if (warningHint !== void 0) {
9682
+ return new Error(`Invalid ${location} \`${safePropName}\` supplied to \`${componentName}\`. Expected an element type that can hold a ref. ${warningHint} For more information see https://mui.com/r/caveat-with-refs-guide`);
9683
+ }
9684
+ return null;
9685
+ }
9686
+ const elementTypeAcceptingRef$1 = chainPropTypes(PropTypes.elementType, elementTypeAcceptingRef);
9681
9687
  function isHostComponent(element) {
9682
9688
  return typeof element === "string";
9683
9689
  }
@@ -21265,7 +21271,7 @@ function FeatureList(props) {
21265
21271
  const selectedVisibleKeys = selectionArray.map((s) => s.key).filter(
21266
21272
  (key) => searchResults.includes(key)
21267
21273
  );
21268
- const newSelection = [...selectedHiddenKeys, ...selectedVisibleKeys].filter(Boolean);
21274
+ const newSelection = enableMultiSelect ? [...selectedHiddenKeys, ...selectedVisibleKeys].filter(Boolean) : selectionArray.map((s) => s.key).filter(Boolean);
21269
21275
  if (newSelection.length > 0) {
21270
21276
  setGeneSelection(newSelection);
21271
21277
  } else {
@@ -1 +1 @@
1
- {"version":3,"file":"FeatureList.d.ts","sourceRoot":"","sources":["../src/FeatureList.js"],"names":[],"mappings":"AAkBA,oEA8HC"}
1
+ {"version":3,"file":"FeatureList.d.ts","sourceRoot":"","sources":["../src/FeatureList.js"],"names":[],"mappings":"AAkBA,oEAiIC"}
@@ -36,8 +36,8 @@ export default function FeatureList(props) {
36
36
  ? selection
37
37
  : [selection];
38
38
  const selectedVisibleKeys = selectionArray.map(s => s.key).filter(key => searchResults.includes(key));
39
- const newSelection = [...selectedHiddenKeys, ...selectedVisibleKeys]
40
- .filter(Boolean);
39
+ const newSelection = enableMultiSelect ? ([...selectedHiddenKeys, ...selectedVisibleKeys]
40
+ .filter(Boolean)) : selectionArray.map(s => s.key).filter(Boolean);
41
41
  if (newSelection.length > 0) {
42
42
  setGeneSelection(newSelection);
43
43
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vitessce/feature-list",
3
- "version": "3.8.10",
3
+ "version": "3.9.0",
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/styles": "3.8.10",
25
- "@vitessce/constants-internal": "3.8.10",
26
- "@vitessce/utils": "3.8.10",
27
- "@vitessce/vit-s": "3.8.10"
24
+ "@vitessce/styles": "3.9.0",
25
+ "@vitessce/constants-internal": "3.9.0",
26
+ "@vitessce/utils": "3.9.0",
27
+ "@vitessce/vit-s": "3.9.0"
28
28
  },
29
29
  "devDependencies": {
30
30
  "@testing-library/jest-dom": "^6.6.3",
@@ -63,8 +63,11 @@ export default function FeatureList(props) {
63
63
  const selectedVisibleKeys = selectionArray.map(s => s.key).filter(
64
64
  key => searchResults.includes(key),
65
65
  );
66
- const newSelection = [...selectedHiddenKeys, ...selectedVisibleKeys]
67
- .filter(Boolean);
66
+
67
+ const newSelection = enableMultiSelect ? (
68
+ [...selectedHiddenKeys, ...selectedVisibleKeys]
69
+ .filter(Boolean)
70
+ ) : selectionArray.map(s => s.key).filter(Boolean);
68
71
 
69
72
  if (newSelection.length > 0) {
70
73
  setGeneSelection(newSelection);