@deephaven/components 0.72.1-xcomponent.2 → 0.73.1-beta.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.
Files changed (99) hide show
  1. package/dist/Button.d.ts +1 -1
  2. package/dist/Select.d.ts +1 -1
  3. package/dist/index.d.ts +0 -2
  4. package/dist/index.d.ts.map +1 -1
  5. package/dist/index.js +0 -2
  6. package/dist/index.js.map +1 -1
  7. package/dist/navigation/NavTab.d.ts.map +1 -1
  8. package/dist/navigation/NavTab.js +10 -2
  9. package/dist/navigation/NavTab.js.map +1 -1
  10. package/dist/navigation/NavTabList.d.ts +5 -0
  11. package/dist/navigation/NavTabList.d.ts.map +1 -1
  12. package/dist/navigation/NavTabList.js.map +1 -1
  13. package/dist/shortcuts/GlobalShortcuts.d.ts +1 -0
  14. package/dist/shortcuts/GlobalShortcuts.d.ts.map +1 -1
  15. package/dist/shortcuts/GlobalShortcuts.js +7 -0
  16. package/dist/shortcuts/GlobalShortcuts.js.map +1 -1
  17. package/dist/spectrum/Heading.d.ts +4 -1
  18. package/dist/spectrum/Heading.d.ts.map +1 -1
  19. package/dist/spectrum/Heading.js +5 -3
  20. package/dist/spectrum/Heading.js.map +1 -1
  21. package/dist/spectrum/ItemContent.d.ts +15 -0
  22. package/dist/spectrum/ItemContent.d.ts.map +1 -0
  23. package/dist/spectrum/{picker/PickerItemContent.js → ItemContent.js} +42 -18
  24. package/dist/spectrum/ItemContent.js.map +1 -0
  25. package/dist/spectrum/ItemTooltip.d.ts +12 -0
  26. package/dist/spectrum/ItemTooltip.d.ts.map +1 -0
  27. package/dist/spectrum/ItemTooltip.js +30 -0
  28. package/dist/spectrum/ItemTooltip.js.map +1 -0
  29. package/dist/spectrum/Text.d.ts +4 -1
  30. package/dist/spectrum/Text.d.ts.map +1 -1
  31. package/dist/spectrum/Text.js +5 -4
  32. package/dist/spectrum/Text.js.map +1 -1
  33. package/dist/spectrum/View.d.ts +4 -1
  34. package/dist/spectrum/View.d.ts.map +1 -1
  35. package/dist/spectrum/View.js +5 -3
  36. package/dist/spectrum/View.js.map +1 -1
  37. package/dist/spectrum/collections.d.ts +1 -1
  38. package/dist/spectrum/collections.d.ts.map +1 -1
  39. package/dist/spectrum/collections.js +1 -1
  40. package/dist/spectrum/collections.js.map +1 -1
  41. package/dist/spectrum/icons.d.ts +2 -0
  42. package/dist/spectrum/icons.d.ts.map +1 -0
  43. package/dist/spectrum/icons.js +3 -0
  44. package/dist/spectrum/icons.js.map +1 -0
  45. package/dist/spectrum/index.d.ts +4 -0
  46. package/dist/spectrum/index.d.ts.map +1 -1
  47. package/dist/spectrum/index.js +4 -0
  48. package/dist/spectrum/index.js.map +1 -1
  49. package/dist/spectrum/listView/ListView.d.ts +28 -0
  50. package/dist/spectrum/listView/ListView.d.ts.map +1 -0
  51. package/dist/spectrum/listView/ListView.js +91 -0
  52. package/dist/spectrum/listView/ListView.js.map +1 -0
  53. package/dist/spectrum/listView/index.d.ts +2 -0
  54. package/dist/spectrum/listView/index.d.ts.map +1 -0
  55. package/dist/spectrum/listView/index.js +2 -0
  56. package/dist/spectrum/listView/index.js.map +1 -0
  57. package/dist/spectrum/picker/Picker.d.ts.map +1 -1
  58. package/dist/spectrum/picker/Picker.js +9 -60
  59. package/dist/spectrum/picker/Picker.js.map +1 -1
  60. package/dist/spectrum/picker/index.d.ts +0 -1
  61. package/dist/spectrum/picker/index.d.ts.map +1 -1
  62. package/dist/spectrum/picker/index.js +0 -1
  63. package/dist/spectrum/picker/index.js.map +1 -1
  64. package/dist/spectrum/utils/index.d.ts +2 -0
  65. package/dist/spectrum/utils/index.d.ts.map +1 -1
  66. package/dist/spectrum/utils/index.js +2 -0
  67. package/dist/spectrum/utils/index.js.map +1 -1
  68. package/dist/spectrum/utils/itemUtils.d.ts +21 -11
  69. package/dist/spectrum/utils/itemUtils.d.ts.map +1 -1
  70. package/dist/spectrum/utils/itemUtils.js +23 -8
  71. package/dist/spectrum/utils/itemUtils.js.map +1 -1
  72. package/dist/spectrum/utils/useRenderNormalizedItem.d.ts +11 -0
  73. package/dist/spectrum/utils/useRenderNormalizedItem.d.ts.map +1 -0
  74. package/dist/spectrum/utils/useRenderNormalizedItem.js +40 -0
  75. package/dist/spectrum/utils/useRenderNormalizedItem.js.map +1 -0
  76. package/dist/spectrum/utils/useStringifiedMultiSelection.d.ts +43 -0
  77. package/dist/spectrum/utils/useStringifiedMultiSelection.d.ts.map +1 -0
  78. package/dist/spectrum/utils/useStringifiedMultiSelection.js +50 -0
  79. package/dist/spectrum/utils/useStringifiedMultiSelection.js.map +1 -0
  80. package/dist/theme/index.d.ts +1 -0
  81. package/dist/theme/index.d.ts.map +1 -1
  82. package/dist/theme/index.js +1 -0
  83. package/dist/theme/index.js.map +1 -1
  84. package/dist/theme/useSpectrumThemeProvider.d.ts +4 -0
  85. package/dist/theme/useSpectrumThemeProvider.d.ts.map +1 -0
  86. package/dist/theme/useSpectrumThemeProvider.js +4 -0
  87. package/dist/theme/useSpectrumThemeProvider.js.map +1 -0
  88. package/package.json +7 -7
  89. package/dist/XComponent.d.ts +0 -43
  90. package/dist/XComponent.d.ts.map +0 -1
  91. package/dist/XComponent.js +0 -57
  92. package/dist/XComponent.js.map +0 -1
  93. package/dist/XComponentMap.d.ts +0 -14
  94. package/dist/XComponentMap.d.ts.map +0 -1
  95. package/dist/XComponentMap.js +0 -20
  96. package/dist/XComponentMap.js.map +0 -1
  97. package/dist/spectrum/picker/PickerItemContent.d.ts +0 -11
  98. package/dist/spectrum/picker/PickerItemContent.d.ts.map +0 -1
  99. package/dist/spectrum/picker/PickerItemContent.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"Heading.js","names":["useMemo","Heading","SpectrumHeading","colorValueStyle","jsx","_jsx","props","color","UNSAFE_style","rest","_objectWithoutProperties","_excluded","style","_objectSpread"],"sources":["../../src/spectrum/Heading.tsx"],"sourcesContent":["/* eslint-disable react/jsx-props-no-spreading */\nimport { useMemo } from 'react';\nimport {\n Heading as SpectrumHeading,\n type HeadingProps as SpectrumHeadingProps,\n} from '@adobe/react-spectrum';\nimport { type ColorValue, colorValueStyle } from '../theme/colorUtils';\n\nexport type HeadingProps = SpectrumHeadingProps & {\n color?: ColorValue;\n};\n\n/**\n * A Heading component that re-exports the Spectrum Heading component.\n * It overrides ColorValues to accept CSS color strings and custom\n * variable names from our color paletee and semantic colors.\n *\n * @param props The props for the Heading component\n * @returns The Heading component\n *\n */\n\nexport function Heading(props: HeadingProps): JSX.Element {\n const { color, UNSAFE_style, ...rest } = props;\n const style = useMemo(\n () => ({\n ...UNSAFE_style,\n color: colorValueStyle(color),\n }),\n [color, UNSAFE_style]\n );\n\n return <SpectrumHeading {...rest} UNSAFE_style={style} />;\n}\n\nexport default Heading;\n"],"mappings":";;;;;;;;AAAA;AACA,SAASA,OAAO,QAAQ,OAAO;AAC/B,SACEC,OAAO,IAAIC,eAAe,QAErB,uBAAuB;AAAC,SACLC,eAAe;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAMzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAO,SAASJ,OAAOA,CAACK,KAAmB,EAAe;EACxD,IAAM;MAAEC,KAAK;MAAEC;IAAsB,CAAC,GAAGF,KAAK;IAAdG,IAAI,GAAAC,wBAAA,CAAKJ,KAAK,EAAAK,SAAA;EAC9C,IAAMC,KAAK,GAAGZ,OAAO,CACnB,MAAAa,aAAA,CAAAA,aAAA,KACKL,YAAY;IACfD,KAAK,EAAEJ,eAAe,CAACI,KAAK;EAAC,EAC7B,EACF,CAACA,KAAK,EAAEC,YAAY,CACtB,CAAC;EAED,oBAAOH,IAAA,CAACH,eAAe,EAAAW,aAAA,CAAAA,aAAA,KAAKJ,IAAI;IAAED,YAAY,EAAEI;EAAM,EAAE,CAAC;AAC3D;AAEA,eAAeX,OAAO"}
1
+ {"version":3,"file":"Heading.js","names":["forwardRef","useMemo","Heading","SpectrumHeading","colorValueStyle","jsx","_jsx","props","forwardedRef","color","UNSAFE_style","rest","_objectWithoutProperties","_excluded","style","_objectSpread","ref","displayName"],"sources":["../../src/spectrum/Heading.tsx"],"sourcesContent":["/* eslint-disable react/jsx-props-no-spreading */\nimport { forwardRef, useMemo } from 'react';\nimport {\n Heading as SpectrumHeading,\n type HeadingProps as SpectrumHeadingProps,\n} from '@adobe/react-spectrum';\nimport type { DOMRefValue } from '@react-types/shared';\nimport { type ColorValue, colorValueStyle } from '../theme/colorUtils';\n\nexport type HeadingProps = SpectrumHeadingProps & {\n color?: ColorValue;\n};\n\n/**\n * A Heading component that re-exports the Spectrum Heading component.\n * It overrides ColorValues to accept CSS color strings and custom\n * variable names from our color paletee and semantic colors.\n *\n * @param props The props for the Heading component\n * @returns The Heading component\n *\n */\n\nexport const Heading = forwardRef<\n DOMRefValue<HTMLHeadingElement>,\n HeadingProps\n>((props, forwardedRef): JSX.Element => {\n const { color, UNSAFE_style, ...rest } = props;\n const style = useMemo(\n () => ({\n ...UNSAFE_style,\n color: colorValueStyle(color),\n }),\n [color, UNSAFE_style]\n );\n\n return <SpectrumHeading {...rest} ref={forwardedRef} UNSAFE_style={style} />;\n});\n\nHeading.displayName = 'Heading';\n\nexport default Heading;\n"],"mappings":";;;;;;;;AAAA;AACA,SAASA,UAAU,EAAEC,OAAO,QAAQ,OAAO;AAC3C,SACEC,OAAO,IAAIC,eAAe,QAErB,uBAAuB;AAAC,SAELC,eAAe;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAMzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAO,IAAMJ,OAAO,gBAAGF,UAAU,CAG/B,CAACO,KAAK,EAAEC,YAAY,KAAkB;EACtC,IAAM;MAAEC,KAAK;MAAEC;IAAsB,CAAC,GAAGH,KAAK;IAAdI,IAAI,GAAAC,wBAAA,CAAKL,KAAK,EAAAM,SAAA;EAC9C,IAAMC,KAAK,GAAGb,OAAO,CACnB,MAAAc,aAAA,CAAAA,aAAA,KACKL,YAAY;IACfD,KAAK,EAAEL,eAAe,CAACK,KAAK;EAAC,EAC7B,EACF,CAACA,KAAK,EAAEC,YAAY,CACtB,CAAC;EAED,oBAAOJ,IAAA,CAACH,eAAe,EAAAY,aAAA,CAAAA,aAAA,KAAKJ,IAAI;IAAEK,GAAG,EAAER,YAAa;IAACE,YAAY,EAAEI;EAAM,EAAE,CAAC;AAC9E,CAAC,CAAC;AAEFZ,OAAO,CAACe,WAAW,GAAG,SAAS;AAE/B,eAAef,OAAO"}
@@ -0,0 +1,15 @@
1
+ import { ReactNode } from 'react';
2
+ import { TooltipOptions } from './utils';
3
+ export interface ItemContentProps {
4
+ children: ReactNode;
5
+ tooltipOptions?: TooltipOptions | null;
6
+ }
7
+ /**
8
+ * Item content. Text content will be wrapped in a Spectrum Text
9
+ * component with ellipsis overflow handling. If text content overflows and
10
+ * tooltipOptions are provided a tooltip will be displayed when hovering over
11
+ * the item content.
12
+ */
13
+ export declare function ItemContent({ children: content, tooltipOptions, }: ItemContentProps): JSX.Element | null;
14
+ export default ItemContent;
15
+ //# sourceMappingURL=ItemContent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ItemContent.d.ts","sourceRoot":"","sources":["../../src/spectrum/ItemContent.tsx"],"names":[],"mappings":"AAAA,OAAO,EAIL,SAAS,EAEV,MAAM,OAAO,CAAC;AAIf,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAIzC,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE,SAAS,CAAC;IACpB,cAAc,CAAC,EAAE,cAAc,GAAG,IAAI,CAAC;CACxC;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,EAC1B,QAAQ,EAAE,OAAO,EACjB,cAAc,GACf,EAAE,gBAAgB,GAAG,GAAG,CAAC,OAAO,GAAG,IAAI,CAsEvC;AAED,eAAe,WAAW,CAAC"}
@@ -3,21 +3,39 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
3
3
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
4
4
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
5
5
  function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
6
- import { Children, cloneElement, isValidElement } from 'react';
7
- import { Text } from '@adobe/react-spectrum';
6
+ import { Children, cloneElement, isValidElement, useState } from 'react';
8
7
  import cl from 'classnames';
9
- import { isElementOfType } from '@deephaven/react-hooks';
10
- import stylesCommon from "../../SpectrumComponent.module.css";
8
+ import { isElementOfType, useCheckOverflow } from '@deephaven/react-hooks';
9
+ import { Text } from "./Text.js";
10
+ import ItemTooltip from "./ItemTooltip.js";
11
+ import stylesCommon from "../SpectrumComponent.module.css";
11
12
  import { jsx as _jsx } from "react/jsx-runtime";
12
13
  import { Fragment as _Fragment } from "react/jsx-runtime";
14
+ import { jsxs as _jsxs } from "react/jsx-runtime";
13
15
  /**
14
- * Picker item content. Text content will be wrapped in a Spectrum Text
15
- * component with ellipsis overflow handling.
16
+ * Item content. Text content will be wrapped in a Spectrum Text
17
+ * component with ellipsis overflow handling. If text content overflows and
18
+ * tooltipOptions are provided a tooltip will be displayed when hovering over
19
+ * the item content.
16
20
  */
17
- export function PickerItemContent(_ref) {
21
+ export function ItemContent(_ref) {
18
22
  var {
19
- children: content
23
+ children: content,
24
+ tooltipOptions
20
25
  } = _ref;
26
+ var {
27
+ checkOverflow,
28
+ isOverflowing,
29
+ resetIsOverflowing
30
+ } = useCheckOverflow();
31
+ var [previousContent, setPreviousContent] = useState(content);
32
+
33
+ // Reset `isOverflowing` if content changes. It will get re-calculated as
34
+ // `Text` components render.
35
+ if (previousContent !== content) {
36
+ setPreviousContent(content);
37
+ resetIsOverflowing();
38
+ }
21
39
  if ( /*#__PURE__*/isValidElement(content)) {
22
40
  return content;
23
41
  }
@@ -38,21 +56,27 @@ export function PickerItemContent(_ref) {
38
56
  // <Text>Some Label</Text>
39
57
  // <Text slot="description">Some Description</Text>
40
58
  // </Item>
41
- content = Children.map(content, (el, i) => isElementOfType(el, Text) ? /*#__PURE__*/cloneElement(el, _objectSpread(_objectSpread({}, el.props), {}, {
59
+ content = Children.map(content, el => isElementOfType(el, Text) ? /*#__PURE__*/cloneElement(el, _objectSpread(_objectSpread({}, el.props), {}, {
60
+ ref: checkOverflow,
42
61
  UNSAFE_className: cl(el.props.UNSAFE_className, stylesCommon.spectrumEllipsis)
43
62
  })) : el);
44
63
  }
64
+ if (typeof content === 'string' || typeof content === 'number') {
65
+ content = /*#__PURE__*/_jsx(Text, {
66
+ ref: checkOverflow,
67
+ UNSAFE_className: stylesCommon.spectrumEllipsis,
68
+ children: content
69
+ });
70
+ }
45
71
  /* eslint-enable no-param-reassign */
46
72
 
47
- return typeof content === 'string' || typeof content === 'number' ? /*#__PURE__*/_jsx(Text, {
48
- UNSAFE_className: stylesCommon.spectrumEllipsis,
49
- children: content
50
- }) :
51
- /*#__PURE__*/
52
- // eslint-disable-next-line react/jsx-no-useless-fragment
53
- _jsx(_Fragment, {
73
+ var tooltip = tooltipOptions == null || !isOverflowing ? null : /*#__PURE__*/_jsx(ItemTooltip, {
74
+ options: tooltipOptions,
54
75
  children: content
55
76
  });
77
+ return /*#__PURE__*/_jsxs(_Fragment, {
78
+ children: [content, tooltip]
79
+ });
56
80
  }
57
- export default PickerItemContent;
58
- //# sourceMappingURL=PickerItemContent.js.map
81
+ export default ItemContent;
82
+ //# sourceMappingURL=ItemContent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ItemContent.js","names":["Children","cloneElement","isValidElement","useState","cl","isElementOfType","useCheckOverflow","Text","ItemTooltip","stylesCommon","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","ItemContent","_ref","children","content","tooltipOptions","checkOverflow","isOverflowing","resetIsOverflowing","previousContent","setPreviousContent","String","Array","isArray","map","el","_objectSpread","props","ref","UNSAFE_className","spectrumEllipsis","tooltip","options"],"sources":["../../src/spectrum/ItemContent.tsx"],"sourcesContent":["import {\n Children,\n cloneElement,\n isValidElement,\n ReactNode,\n useState,\n} from 'react';\nimport cl from 'classnames';\nimport { isElementOfType, useCheckOverflow } from '@deephaven/react-hooks';\nimport { Text } from './Text';\nimport { TooltipOptions } from './utils';\nimport ItemTooltip from './ItemTooltip';\nimport stylesCommon from '../SpectrumComponent.module.scss';\n\nexport interface ItemContentProps {\n children: ReactNode;\n tooltipOptions?: TooltipOptions | null;\n}\n\n/**\n * Item content. Text content will be wrapped in a Spectrum Text\n * component with ellipsis overflow handling. If text content overflows and\n * tooltipOptions are provided a tooltip will be displayed when hovering over\n * the item content.\n */\nexport function ItemContent({\n children: content,\n tooltipOptions,\n}: ItemContentProps): JSX.Element | null {\n const { checkOverflow, isOverflowing, resetIsOverflowing } =\n useCheckOverflow();\n\n const [previousContent, setPreviousContent] = useState(content);\n\n // Reset `isOverflowing` if content changes. It will get re-calculated as\n // `Text` components render.\n if (previousContent !== content) {\n setPreviousContent(content);\n resetIsOverflowing();\n }\n\n if (isValidElement(content)) {\n return content;\n }\n\n /* eslint-disable no-param-reassign */\n if (content === '') {\n // Prevent the item height from collapsing when the content is empty\n content = '\\xa0'; // Non-breaking space\n } else if (typeof content === 'boolean') {\n // Boolean values need to be stringified to render\n content = String(content);\n } else if (Array.isArray(content)) {\n // For cases where there are multiple `Text` children, add a css class to\n // handle overflow. The primary use case for multiple text nodes is when a\n // description is provided for an item. e.g.\n // <Item textValue=\"Some Text\">\n // <SomeIcon />\n // <Text>Some Label</Text>\n // <Text slot=\"description\">Some Description</Text>\n // </Item>\n content = Children.map(content, el =>\n isElementOfType(el, Text)\n ? cloneElement(el, {\n ...el.props,\n ref: checkOverflow,\n UNSAFE_className: cl(\n el.props.UNSAFE_className,\n stylesCommon.spectrumEllipsis\n ),\n })\n : el\n );\n }\n\n if (typeof content === 'string' || typeof content === 'number') {\n content = (\n <Text\n ref={checkOverflow}\n UNSAFE_className={stylesCommon.spectrumEllipsis}\n >\n {content}\n </Text>\n );\n }\n /* eslint-enable no-param-reassign */\n\n const tooltip =\n tooltipOptions == null || !isOverflowing ? null : (\n <ItemTooltip options={tooltipOptions}>{content}</ItemTooltip>\n );\n\n return (\n <>\n {content}\n {tooltip}\n </>\n );\n}\n\nexport default ItemContent;\n"],"mappings":";;;;;AAAA,SACEA,QAAQ,EACRC,YAAY,EACZC,cAAc,EAEdC,QAAQ,QACH,OAAO;AACd,OAAOC,EAAE,MAAM,YAAY;AAC3B,SAASC,eAAe,EAAEC,gBAAgB,QAAQ,wBAAwB;AAAC,SAClEC,IAAI;AAAA,OAENC,WAAW;AAAA,OACXC,YAAY;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,QAAA,IAAAC,SAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAOnB;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,WAAWA,CAAAC,IAAA,EAGc;EAAA,IAHb;IAC1BC,QAAQ,EAAEC,OAAO;IACjBC;EACgB,CAAC,GAAAH,IAAA;EACjB,IAAM;IAAEI,aAAa;IAAEC,aAAa;IAAEC;EAAmB,CAAC,GACxDjB,gBAAgB,CAAC,CAAC;EAEpB,IAAM,CAACkB,eAAe,EAAEC,kBAAkB,CAAC,GAAGtB,QAAQ,CAACgB,OAAO,CAAC;;EAE/D;EACA;EACA,IAAIK,eAAe,KAAKL,OAAO,EAAE;IAC/BM,kBAAkB,CAACN,OAAO,CAAC;IAC3BI,kBAAkB,CAAC,CAAC;EACtB;EAEA,kBAAIrB,cAAc,CAACiB,OAAO,CAAC,EAAE;IAC3B,OAAOA,OAAO;EAChB;;EAEA;EACA,IAAIA,OAAO,KAAK,EAAE,EAAE;IAClB;IACAA,OAAO,GAAG,MAAM,CAAC,CAAC;EACpB,CAAC,MAAM,IAAI,OAAOA,OAAO,KAAK,SAAS,EAAE;IACvC;IACAA,OAAO,GAAGO,MAAM,CAACP,OAAO,CAAC;EAC3B,CAAC,MAAM,IAAIQ,KAAK,CAACC,OAAO,CAACT,OAAO,CAAC,EAAE;IACjC;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACAA,OAAO,GAAGnB,QAAQ,CAAC6B,GAAG,CAACV,OAAO,EAAEW,EAAE,IAChCzB,eAAe,CAACyB,EAAE,EAAEvB,IAAI,CAAC,gBACrBN,YAAY,CAAC6B,EAAE,EAAAC,aAAA,CAAAA,aAAA,KACVD,EAAE,CAACE,KAAK;MACXC,GAAG,EAAEZ,aAAa;MAClBa,gBAAgB,EAAE9B,EAAE,CAClB0B,EAAE,CAACE,KAAK,CAACE,gBAAgB,EACzBzB,YAAY,CAAC0B,gBACf;IAAC,EACF,CAAC,GACFL,EACN,CAAC;EACH;EAEA,IAAI,OAAOX,OAAO,KAAK,QAAQ,IAAI,OAAOA,OAAO,KAAK,QAAQ,EAAE;IAC9DA,OAAO,gBACLR,IAAA,CAACJ,IAAI;MACH0B,GAAG,EAAEZ,aAAc;MACnBa,gBAAgB,EAAEzB,YAAY,CAAC0B,gBAAiB;MAAAjB,QAAA,EAE/CC;IAAO,CACJ,CACP;EACH;EACA;;EAEA,IAAMiB,OAAO,GACXhB,cAAc,IAAI,IAAI,IAAI,CAACE,aAAa,GAAG,IAAI,gBAC7CX,IAAA,CAACH,WAAW;IAAC6B,OAAO,EAAEjB,cAAe;IAAAF,QAAA,EAAEC;EAAO,CAAc,CAC7D;EAEH,oBACEJ,KAAA,CAAAF,SAAA;IAAAK,QAAA,GACGC,OAAO,EACPiB,OAAO;EAAA,CACR,CAAC;AAEP;AAEA,eAAepB,WAAW"}
@@ -0,0 +1,12 @@
1
+ import { ReactNode } from 'react';
2
+ import { TooltipOptions } from './utils';
3
+ export interface ItemTooltipProps {
4
+ children: ReactNode;
5
+ options: TooltipOptions;
6
+ }
7
+ /**
8
+ * Tooltip for `<Item>` content.
9
+ */
10
+ export declare function ItemTooltip({ children, options, }: ItemTooltipProps): JSX.Element;
11
+ export default ItemTooltip;
12
+ //# sourceMappingURL=ItemTooltip.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ItemTooltip.d.ts","sourceRoot":"","sources":["../../src/spectrum/ItemTooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAKzC,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE,SAAS,CAAC;IACpB,OAAO,EAAE,cAAc,CAAC;CACzB;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,EAC1B,QAAQ,EACR,OAAO,GACR,EAAE,gBAAgB,GAAG,GAAG,CAAC,OAAO,CAehC;AAED,eAAe,WAAW,CAAC"}
@@ -0,0 +1,30 @@
1
+ import { isElementOfType } from '@deephaven/react-hooks';
2
+ import { Tooltip } from "../popper/index.js";
3
+ import { Flex } from "./layout.js";
4
+ import { Text } from "./Text.js";
5
+ import { jsx as _jsx } from "react/jsx-runtime";
6
+ /**
7
+ * Tooltip for `<Item>` content.
8
+ */
9
+ export function ItemTooltip(_ref) {
10
+ var {
11
+ children,
12
+ options
13
+ } = _ref;
14
+ if (Array.isArray(children)) {
15
+ return /*#__PURE__*/_jsx(Tooltip, {
16
+ options: options,
17
+ children: /*#__PURE__*/_jsx(Flex, {
18
+ direction: "column",
19
+ alignItems: "start",
20
+ children: children.filter(node => isElementOfType(node, Text))
21
+ })
22
+ });
23
+ }
24
+ return /*#__PURE__*/_jsx(Tooltip, {
25
+ options: options,
26
+ children: children
27
+ });
28
+ }
29
+ export default ItemTooltip;
30
+ //# sourceMappingURL=ItemTooltip.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ItemTooltip.js","names":["isElementOfType","Tooltip","Flex","Text","jsx","_jsx","ItemTooltip","_ref","children","options","Array","isArray","direction","alignItems","filter","node"],"sources":["../../src/spectrum/ItemTooltip.tsx"],"sourcesContent":["import { ReactNode } from 'react';\nimport { isElementOfType } from '@deephaven/react-hooks';\nimport { TooltipOptions } from './utils';\nimport { Tooltip } from '../popper';\nimport { Flex } from './layout';\nimport { Text } from './Text';\n\nexport interface ItemTooltipProps {\n children: ReactNode;\n options: TooltipOptions;\n}\n\n/**\n * Tooltip for `<Item>` content.\n */\nexport function ItemTooltip({\n children,\n options,\n}: ItemTooltipProps): JSX.Element {\n if (Array.isArray(children)) {\n return (\n <Tooltip options={options}>\n {/* Multiple children scenarios include a `<Text>` node for the label \n and at least 1 of an optional icon or `<Text slot=\"description\">` node.\n In such cases we only show the label and description `<Text>` nodes. */}\n <Flex direction=\"column\" alignItems=\"start\">\n {children.filter(node => isElementOfType(node, Text))}\n </Flex>\n </Tooltip>\n );\n }\n\n return <Tooltip options={options}>{children}</Tooltip>;\n}\n\nexport default ItemTooltip;\n"],"mappings":"AACA,SAASA,eAAe,QAAQ,wBAAwB;AAAC,SAEhDC,OAAO;AAAA,SACPC,IAAI;AAAA,SACJC,IAAI;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAOb;AACA;AACA;AACA,OAAO,SAASC,WAAWA,CAAAC,IAAA,EAGO;EAAA,IAHN;IAC1BC,QAAQ;IACRC;EACgB,CAAC,GAAAF,IAAA;EACjB,IAAIG,KAAK,CAACC,OAAO,CAACH,QAAQ,CAAC,EAAE;IAC3B,oBACEH,IAAA,CAACJ,OAAO;MAACQ,OAAO,EAAEA,OAAQ;MAAAD,QAAA,eAIxBH,IAAA,CAACH,IAAI;QAACU,SAAS,EAAC,QAAQ;QAACC,UAAU,EAAC,OAAO;QAAAL,QAAA,EACxCA,QAAQ,CAACM,MAAM,CAACC,IAAI,IAAIf,eAAe,CAACe,IAAI,EAAEZ,IAAI,CAAC;MAAC,CACjD;IAAC,CACA,CAAC;EAEd;EAEA,oBAAOE,IAAA,CAACJ,OAAO;IAACQ,OAAO,EAAEA,OAAQ;IAAAD,QAAA,EAAEA;EAAQ,CAAU,CAAC;AACxD;AAEA,eAAeF,WAAW"}
@@ -1,5 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import { type TextProps as SpectrumTextProps } from '@adobe/react-spectrum';
3
+ import type { DOMRefValue } from '@react-types/shared';
3
4
  import { type ColorValue } from '../theme/colorUtils';
4
5
  export type TextProps = SpectrumTextProps & {
5
6
  color?: ColorValue;
@@ -13,6 +14,8 @@ export type TextProps = SpectrumTextProps & {
13
14
  * @returns The Text component
14
15
  *
15
16
  */
16
- export declare function Text(props: TextProps): JSX.Element;
17
+ export declare const Text: import("react").ForwardRefExoticComponent<SpectrumTextProps & {
18
+ color?: ColorValue;
19
+ } & import("react").RefAttributes<DOMRefValue<HTMLSpanElement>>>;
17
20
  export default Text;
18
21
  //# sourceMappingURL=Text.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Text.d.ts","sourceRoot":"","sources":["../../src/spectrum/Text.tsx"],"names":[],"mappings":";AAEA,OAAO,EAEL,KAAK,SAAS,IAAI,iBAAiB,EACpC,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,KAAK,UAAU,EAAmB,MAAM,qBAAqB,CAAC;AAEvE,MAAM,MAAM,SAAS,GAAG,iBAAiB,GAAG;IAC1C,KAAK,CAAC,EAAE,UAAU,CAAC;CACpB,CAAC;AAEF;;;;;;;;GAQG;AAEH,wBAAgB,IAAI,CAAC,KAAK,EAAE,SAAS,GAAG,GAAG,CAAC,OAAO,CAWlD;AAED,eAAe,IAAI,CAAC"}
1
+ {"version":3,"file":"Text.d.ts","sourceRoot":"","sources":["../../src/spectrum/Text.tsx"],"names":[],"mappings":";AAEA,OAAO,EAEL,KAAK,SAAS,IAAI,iBAAiB,EACpC,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,KAAK,UAAU,EAAmB,MAAM,qBAAqB,CAAC;AAEvE,MAAM,MAAM,SAAS,GAAG,iBAAiB,GAAG;IAC1C,KAAK,CAAC,EAAE,UAAU,CAAC;CACpB,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,IAAI;YAZP,UAAU;gEAyBnB,CAAC;AAIF,eAAe,IAAI,CAAC"}
@@ -7,7 +7,7 @@ function _toPrimitive(input, hint) { if (typeof input !== "object" || input ===
7
7
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
8
8
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
9
9
  /* eslint-disable react/jsx-props-no-spreading */
10
- import { useMemo } from 'react';
10
+ import { forwardRef, useMemo } from 'react';
11
11
  import { Text as SpectrumText } from '@adobe/react-spectrum';
12
12
  import { colorValueStyle } from "../theme/colorUtils.js";
13
13
  import { jsx as _jsx } from "react/jsx-runtime";
@@ -20,8 +20,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
20
20
  * @returns The Text component
21
21
  *
22
22
  */
23
-
24
- export function Text(props) {
23
+ export var Text = /*#__PURE__*/forwardRef((props, forwardedRef) => {
25
24
  var {
26
25
  color,
27
26
  UNSAFE_style
@@ -31,8 +30,10 @@ export function Text(props) {
31
30
  color: colorValueStyle(color)
32
31
  }), [color, UNSAFE_style]);
33
32
  return /*#__PURE__*/_jsx(SpectrumText, _objectSpread(_objectSpread({}, rest), {}, {
33
+ ref: forwardedRef,
34
34
  UNSAFE_style: style
35
35
  }));
36
- }
36
+ });
37
+ Text.displayName = 'Text';
37
38
  export default Text;
38
39
  //# sourceMappingURL=Text.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Text.js","names":["useMemo","Text","SpectrumText","colorValueStyle","jsx","_jsx","props","color","UNSAFE_style","rest","_objectWithoutProperties","_excluded","style","_objectSpread"],"sources":["../../src/spectrum/Text.tsx"],"sourcesContent":["/* eslint-disable react/jsx-props-no-spreading */\nimport { useMemo } from 'react';\nimport {\n Text as SpectrumText,\n type TextProps as SpectrumTextProps,\n} from '@adobe/react-spectrum';\nimport { type ColorValue, colorValueStyle } from '../theme/colorUtils';\n\nexport type TextProps = SpectrumTextProps & {\n color?: ColorValue;\n};\n\n/**\n * A Text component that re-exports the Spectrum Text component.\n * It overrides ColorValues to accept CSS color strings and custom\n * variable names from our color paletee and semantic colors.\n *\n * @param props The props for the Text component\n * @returns The Text component\n *\n */\n\nexport function Text(props: TextProps): JSX.Element {\n const { color, UNSAFE_style, ...rest } = props;\n const style = useMemo(\n () => ({\n ...UNSAFE_style,\n color: colorValueStyle(color),\n }),\n [color, UNSAFE_style]\n );\n\n return <SpectrumText {...rest} UNSAFE_style={style} />;\n}\n\nexport default Text;\n"],"mappings":";;;;;;;;AAAA;AACA,SAASA,OAAO,QAAQ,OAAO;AAC/B,SACEC,IAAI,IAAIC,YAAY,QAEf,uBAAuB;AAAC,SACLC,eAAe;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAMzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAO,SAASJ,IAAIA,CAACK,KAAgB,EAAe;EAClD,IAAM;MAAEC,KAAK;MAAEC;IAAsB,CAAC,GAAGF,KAAK;IAAdG,IAAI,GAAAC,wBAAA,CAAKJ,KAAK,EAAAK,SAAA;EAC9C,IAAMC,KAAK,GAAGZ,OAAO,CACnB,MAAAa,aAAA,CAAAA,aAAA,KACKL,YAAY;IACfD,KAAK,EAAEJ,eAAe,CAACI,KAAK;EAAC,EAC7B,EACF,CAACA,KAAK,EAAEC,YAAY,CACtB,CAAC;EAED,oBAAOH,IAAA,CAACH,YAAY,EAAAW,aAAA,CAAAA,aAAA,KAAKJ,IAAI;IAAED,YAAY,EAAEI;EAAM,EAAE,CAAC;AACxD;AAEA,eAAeX,IAAI"}
1
+ {"version":3,"file":"Text.js","names":["forwardRef","useMemo","Text","SpectrumText","colorValueStyle","jsx","_jsx","props","forwardedRef","color","UNSAFE_style","rest","_objectWithoutProperties","_excluded","style","_objectSpread","ref","displayName"],"sources":["../../src/spectrum/Text.tsx"],"sourcesContent":["/* eslint-disable react/jsx-props-no-spreading */\nimport { forwardRef, useMemo } from 'react';\nimport {\n Text as SpectrumText,\n type TextProps as SpectrumTextProps,\n} from '@adobe/react-spectrum';\nimport type { DOMRefValue } from '@react-types/shared';\nimport { type ColorValue, colorValueStyle } from '../theme/colorUtils';\n\nexport type TextProps = SpectrumTextProps & {\n color?: ColorValue;\n};\n\n/**\n * A Text component that re-exports the Spectrum Text component.\n * It overrides ColorValues to accept CSS color strings and custom\n * variable names from our color paletee and semantic colors.\n *\n * @param props The props for the Text component\n * @returns The Text component\n *\n */\nexport const Text = forwardRef<DOMRefValue<HTMLSpanElement>, TextProps>(\n (props, forwardedRef): JSX.Element => {\n const { color, UNSAFE_style, ...rest } = props;\n const style = useMemo(\n () => ({\n ...UNSAFE_style,\n color: colorValueStyle(color),\n }),\n [color, UNSAFE_style]\n );\n\n return <SpectrumText {...rest} ref={forwardedRef} UNSAFE_style={style} />;\n }\n);\n\nText.displayName = 'Text';\n\nexport default Text;\n"],"mappings":";;;;;;;;AAAA;AACA,SAASA,UAAU,EAAEC,OAAO,QAAQ,OAAO;AAC3C,SACEC,IAAI,IAAIC,YAAY,QAEf,uBAAuB;AAAC,SAELC,eAAe;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAMzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,IAAMJ,IAAI,gBAAGF,UAAU,CAC5B,CAACO,KAAK,EAAEC,YAAY,KAAkB;EACpC,IAAM;MAAEC,KAAK;MAAEC;IAAsB,CAAC,GAAGH,KAAK;IAAdI,IAAI,GAAAC,wBAAA,CAAKL,KAAK,EAAAM,SAAA;EAC9C,IAAMC,KAAK,GAAGb,OAAO,CACnB,MAAAc,aAAA,CAAAA,aAAA,KACKL,YAAY;IACfD,KAAK,EAAEL,eAAe,CAACK,KAAK;EAAC,EAC7B,EACF,CAACA,KAAK,EAAEC,YAAY,CACtB,CAAC;EAED,oBAAOJ,IAAA,CAACH,YAAY,EAAAY,aAAA,CAAAA,aAAA,KAAKJ,IAAI;IAAEK,GAAG,EAAER,YAAa;IAACE,YAAY,EAAEI;EAAM,EAAE,CAAC;AAC3E,CACF,CAAC;AAEDZ,IAAI,CAACe,WAAW,GAAG,MAAM;AAEzB,eAAef,IAAI"}
@@ -1,5 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import { type ViewProps as SpectrumViewProps } from '@adobe/react-spectrum';
3
+ import type { DOMRefValue } from '@react-types/shared';
3
4
  import { type ColorValue } from '../theme/colorUtils';
4
5
  export type ViewProps = Omit<SpectrumViewProps<6>, 'backgroundColor'> & {
5
6
  backgroundColor?: ColorValue;
@@ -13,6 +14,8 @@ export type ViewProps = Omit<SpectrumViewProps<6>, 'backgroundColor'> & {
13
14
  * @returns The View component
14
15
  *
15
16
  */
16
- export declare function View(props: ViewProps): JSX.Element;
17
+ export declare const View: import("react").ForwardRefExoticComponent<Omit<SpectrumViewProps<6>, "backgroundColor"> & {
18
+ backgroundColor?: ColorValue;
19
+ } & import("react").RefAttributes<DOMRefValue<HTMLElement>>>;
17
20
  export default View;
18
21
  //# sourceMappingURL=View.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"View.d.ts","sourceRoot":"","sources":["../../src/spectrum/View.tsx"],"names":[],"mappings":";AAEA,OAAO,EAEL,KAAK,SAAS,IAAI,iBAAiB,EACpC,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,KAAK,UAAU,EAAmB,MAAM,qBAAqB,CAAC;AAEvE,MAAM,MAAM,SAAS,GAAG,IAAI,CAAC,iBAAiB,CAAC,CAAC,CAAC,EAAE,iBAAiB,CAAC,GAAG;IACtE,eAAe,CAAC,EAAE,UAAU,CAAC;CAC9B,CAAC;AAEF;;;;;;;;GAQG;AAEH,wBAAgB,IAAI,CAAC,KAAK,EAAE,SAAS,GAAG,GAAG,CAAC,OAAO,CAWlD;AAED,eAAe,IAAI,CAAC"}
1
+ {"version":3,"file":"View.d.ts","sourceRoot":"","sources":["../../src/spectrum/View.tsx"],"names":[],"mappings":";AAEA,OAAO,EAEL,KAAK,SAAS,IAAI,iBAAiB,EACpC,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,KAAK,UAAU,EAAmB,MAAM,qBAAqB,CAAC;AAEvE,MAAM,MAAM,SAAS,GAAG,IAAI,CAAC,iBAAiB,CAAC,CAAC,CAAC,EAAE,iBAAiB,CAAC,GAAG;IACtE,eAAe,CAAC,EAAE,UAAU,CAAC;CAC9B,CAAC;AAEF;;;;;;;;GAQG;AAEH,eAAO,MAAM,IAAI;sBAbG,UAAU;4DA0B7B,CAAC;AAIF,eAAe,IAAI,CAAC"}
@@ -7,7 +7,7 @@ function _toPrimitive(input, hint) { if (typeof input !== "object" || input ===
7
7
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
8
8
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
9
9
  /* eslint-disable react/jsx-props-no-spreading */
10
- import { useMemo } from 'react';
10
+ import { forwardRef, useMemo } from 'react';
11
11
  import { View as SpectrumView } from '@adobe/react-spectrum';
12
12
  import { colorValueStyle } from "../theme/colorUtils.js";
13
13
  import { jsx as _jsx } from "react/jsx-runtime";
@@ -21,7 +21,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
21
21
  *
22
22
  */
23
23
 
24
- export function View(props) {
24
+ export var View = /*#__PURE__*/forwardRef((props, forwardedRef) => {
25
25
  var {
26
26
  backgroundColor,
27
27
  UNSAFE_style
@@ -31,8 +31,10 @@ export function View(props) {
31
31
  backgroundColor: colorValueStyle(backgroundColor)
32
32
  }), [backgroundColor, UNSAFE_style]);
33
33
  return /*#__PURE__*/_jsx(SpectrumView, _objectSpread(_objectSpread({}, rest), {}, {
34
+ ref: forwardedRef,
34
35
  UNSAFE_style: style
35
36
  }));
36
- }
37
+ });
38
+ View.displayName = 'View';
37
39
  export default View;
38
40
  //# sourceMappingURL=View.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"View.js","names":["useMemo","View","SpectrumView","colorValueStyle","jsx","_jsx","props","backgroundColor","UNSAFE_style","rest","_objectWithoutProperties","_excluded","style","_objectSpread"],"sources":["../../src/spectrum/View.tsx"],"sourcesContent":["/* eslint-disable react/jsx-props-no-spreading */\nimport { useMemo } from 'react';\nimport {\n View as SpectrumView,\n type ViewProps as SpectrumViewProps,\n} from '@adobe/react-spectrum';\nimport { type ColorValue, colorValueStyle } from '../theme/colorUtils';\n\nexport type ViewProps = Omit<SpectrumViewProps<6>, 'backgroundColor'> & {\n backgroundColor?: ColorValue;\n};\n\n/**\n * A View component that re-exports the Spectrum View component.\n * However, it overrides ColorValues to accept CSS color strings and\n * our custom variable names from our color paletee and semantic colors.\n *\n * @param props The props for the View component\n * @returns The View component\n *\n */\n\nexport function View(props: ViewProps): JSX.Element {\n const { backgroundColor, UNSAFE_style, ...rest } = props;\n const style = useMemo(\n () => ({\n ...UNSAFE_style,\n backgroundColor: colorValueStyle(backgroundColor),\n }),\n [backgroundColor, UNSAFE_style]\n );\n\n return <SpectrumView {...rest} UNSAFE_style={style} />;\n}\n\nexport default View;\n"],"mappings":";;;;;;;;AAAA;AACA,SAASA,OAAO,QAAQ,OAAO;AAC/B,SACEC,IAAI,IAAIC,YAAY,QAEf,uBAAuB;AAAC,SACLC,eAAe;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAMzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAO,SAASJ,IAAIA,CAACK,KAAgB,EAAe;EAClD,IAAM;MAAEC,eAAe;MAAEC;IAAsB,CAAC,GAAGF,KAAK;IAAdG,IAAI,GAAAC,wBAAA,CAAKJ,KAAK,EAAAK,SAAA;EACxD,IAAMC,KAAK,GAAGZ,OAAO,CACnB,MAAAa,aAAA,CAAAA,aAAA,KACKL,YAAY;IACfD,eAAe,EAAEJ,eAAe,CAACI,eAAe;EAAC,EACjD,EACF,CAACA,eAAe,EAAEC,YAAY,CAChC,CAAC;EAED,oBAAOH,IAAA,CAACH,YAAY,EAAAW,aAAA,CAAAA,aAAA,KAAKJ,IAAI;IAAED,YAAY,EAAEI;EAAM,EAAE,CAAC;AACxD;AAEA,eAAeX,IAAI"}
1
+ {"version":3,"file":"View.js","names":["forwardRef","useMemo","View","SpectrumView","colorValueStyle","jsx","_jsx","props","forwardedRef","backgroundColor","UNSAFE_style","rest","_objectWithoutProperties","_excluded","style","_objectSpread","ref","displayName"],"sources":["../../src/spectrum/View.tsx"],"sourcesContent":["/* eslint-disable react/jsx-props-no-spreading */\nimport { forwardRef, useMemo } from 'react';\nimport {\n View as SpectrumView,\n type ViewProps as SpectrumViewProps,\n} from '@adobe/react-spectrum';\nimport type { DOMRefValue } from '@react-types/shared';\nimport { type ColorValue, colorValueStyle } from '../theme/colorUtils';\n\nexport type ViewProps = Omit<SpectrumViewProps<6>, 'backgroundColor'> & {\n backgroundColor?: ColorValue;\n};\n\n/**\n * A View component that re-exports the Spectrum View component.\n * However, it overrides ColorValues to accept CSS color strings and\n * our custom variable names from our color paletee and semantic colors.\n *\n * @param props The props for the View component\n * @returns The View component\n *\n */\n\nexport const View = forwardRef<DOMRefValue<HTMLElement>, ViewProps>(\n (props, forwardedRef): JSX.Element => {\n const { backgroundColor, UNSAFE_style, ...rest } = props;\n const style = useMemo(\n () => ({\n ...UNSAFE_style,\n backgroundColor: colorValueStyle(backgroundColor),\n }),\n [backgroundColor, UNSAFE_style]\n );\n\n return <SpectrumView {...rest} ref={forwardedRef} UNSAFE_style={style} />;\n }\n);\n\nView.displayName = 'View';\n\nexport default View;\n"],"mappings":";;;;;;;;AAAA;AACA,SAASA,UAAU,EAAEC,OAAO,QAAQ,OAAO;AAC3C,SACEC,IAAI,IAAIC,YAAY,QAEf,uBAAuB;AAAC,SAELC,eAAe;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAMzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAO,IAAMJ,IAAI,gBAAGF,UAAU,CAC5B,CAACO,KAAK,EAAEC,YAAY,KAAkB;EACpC,IAAM;MAAEC,eAAe;MAAEC;IAAsB,CAAC,GAAGH,KAAK;IAAdI,IAAI,GAAAC,wBAAA,CAAKL,KAAK,EAAAM,SAAA;EACxD,IAAMC,KAAK,GAAGb,OAAO,CACnB,MAAAc,aAAA,CAAAA,aAAA,KACKL,YAAY;IACfD,eAAe,EAAEL,eAAe,CAACK,eAAe;EAAC,EACjD,EACF,CAACA,eAAe,EAAEC,YAAY,CAChC,CAAC;EAED,oBAAOJ,IAAA,CAACH,YAAY,EAAAY,aAAA,CAAAA,aAAA,KAAKJ,IAAI;IAAEK,GAAG,EAAER,YAAa;IAACE,YAAY,EAAEI;EAAM,EAAE,CAAC;AAC3E,CACF,CAAC;AAEDZ,IAAI,CAACe,WAAW,GAAG,MAAM;AAEzB,eAAef,IAAI"}
@@ -1,2 +1,2 @@
1
- export { ActionBar, type SpectrumActionBarProps as ActionBarProps, ActionMenu, type SpectrumActionMenuProps as ActionMenuProps, ListView, type SpectrumListViewProps as ListViewProps, MenuTrigger, type SpectrumMenuTriggerProps as MenuTriggerProps, TagGroup, type SpectrumTagGroupProps as TagGroupProps, } from '@adobe/react-spectrum';
1
+ export { ActionBar, type SpectrumActionBarProps as ActionBarProps, ActionMenu, type SpectrumActionMenuProps as ActionMenuProps, MenuTrigger, type SpectrumMenuTriggerProps as MenuTriggerProps, TagGroup, type SpectrumTagGroupProps as TagGroupProps, } from '@adobe/react-spectrum';
2
2
  //# sourceMappingURL=collections.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"collections.d.ts","sourceRoot":"","sources":["../../src/spectrum/collections.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,KAAK,sBAAsB,IAAI,cAAc,EAC7C,UAAU,EACV,KAAK,uBAAuB,IAAI,eAAe,EAC/C,QAAQ,EACR,KAAK,qBAAqB,IAAI,aAAa,EAC3C,WAAW,EACX,KAAK,wBAAwB,IAAI,gBAAgB,EACjD,QAAQ,EACR,KAAK,qBAAqB,IAAI,aAAa,GAC5C,MAAM,uBAAuB,CAAC"}
1
+ {"version":3,"file":"collections.d.ts","sourceRoot":"","sources":["../../src/spectrum/collections.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,KAAK,sBAAsB,IAAI,cAAc,EAC7C,UAAU,EACV,KAAK,uBAAuB,IAAI,eAAe,EAC/C,WAAW,EACX,KAAK,wBAAwB,IAAI,gBAAgB,EACjD,QAAQ,EACR,KAAK,qBAAqB,IAAI,aAAa,GAC5C,MAAM,uBAAuB,CAAC"}
@@ -1,2 +1,2 @@
1
- export { ActionBar, ActionMenu, ListView, MenuTrigger, TagGroup } from '@adobe/react-spectrum';
1
+ export { ActionBar, ActionMenu, MenuTrigger, TagGroup } from '@adobe/react-spectrum';
2
2
  //# sourceMappingURL=collections.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"collections.js","names":["ActionBar","ActionMenu","ListView","MenuTrigger","TagGroup"],"sources":["../../src/spectrum/collections.ts"],"sourcesContent":["export {\n ActionBar,\n type SpectrumActionBarProps as ActionBarProps,\n ActionMenu,\n type SpectrumActionMenuProps as ActionMenuProps,\n ListView,\n type SpectrumListViewProps as ListViewProps,\n MenuTrigger,\n type SpectrumMenuTriggerProps as MenuTriggerProps,\n TagGroup,\n type SpectrumTagGroupProps as TagGroupProps,\n} from '@adobe/react-spectrum';\n"],"mappings":"AAAA,SACEA,SAAS,EAETC,UAAU,EAEVC,QAAQ,EAERC,WAAW,EAEXC,QAAQ,QAEH,uBAAuB"}
1
+ {"version":3,"file":"collections.js","names":["ActionBar","ActionMenu","MenuTrigger","TagGroup"],"sources":["../../src/spectrum/collections.ts"],"sourcesContent":["export {\n ActionBar,\n type SpectrumActionBarProps as ActionBarProps,\n ActionMenu,\n type SpectrumActionMenuProps as ActionMenuProps,\n MenuTrigger,\n type SpectrumMenuTriggerProps as MenuTriggerProps,\n TagGroup,\n type SpectrumTagGroupProps as TagGroupProps,\n} from '@adobe/react-spectrum';\n"],"mappings":"AAAA,SACEA,SAAS,EAETC,UAAU,EAEVC,WAAW,EAEXC,QAAQ,QAEH,uBAAuB"}
@@ -0,0 +1,2 @@
1
+ export { Icon } from '@adobe/react-spectrum';
2
+ //# sourceMappingURL=icons.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"icons.d.ts","sourceRoot":"","sources":["../../src/spectrum/icons.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC"}
@@ -0,0 +1,3 @@
1
+ // eslint-disable-next-line import/prefer-default-export
2
+ export { Icon } from '@adobe/react-spectrum';
3
+ //# sourceMappingURL=icons.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"icons.js","names":["Icon"],"sources":["../../src/spectrum/icons.ts"],"sourcesContent":["// eslint-disable-next-line import/prefer-default-export\nexport { Icon } from '@adobe/react-spectrum';\n"],"mappings":"AAAA;AACA,SAASA,IAAI,QAAQ,uBAAuB"}
@@ -6,6 +6,7 @@ export * from './collections';
6
6
  export * from './content';
7
7
  export * from './dateAndTime';
8
8
  export * from './forms';
9
+ export * from './icons';
9
10
  export * from './layout';
10
11
  export * from './navigation';
11
12
  export * from './overlays';
@@ -15,6 +16,7 @@ export * from './status';
15
16
  /**
16
17
  * Custom DH components wrapping React Spectrum components.
17
18
  */
19
+ export * from './listView';
18
20
  export * from './picker';
19
21
  export * from './Heading';
20
22
  export * from './Text';
@@ -22,5 +24,7 @@ export * from './View';
22
24
  /**
23
25
  * Custom DH spectrum utils
24
26
  */
27
+ export * from './ItemContent';
28
+ export * from './ItemTooltip';
25
29
  export * from './utils';
26
30
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/spectrum/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AAEzB;;GAEG;AACH,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AAEvB;;GAEG;AACH,cAAc,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/spectrum/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AAEzB;;GAEG;AACH,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AAEvB;;GAEG;AACH,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,SAAS,CAAC"}
@@ -6,6 +6,7 @@ export * from "./collections.js";
6
6
  export * from "./content.js";
7
7
  export * from "./dateAndTime.js";
8
8
  export * from "./forms.js";
9
+ export * from "./icons.js";
9
10
  export * from "./layout.js";
10
11
  export * from "./navigation.js";
11
12
  export * from "./overlays.js";
@@ -15,6 +16,7 @@ export * from "./status.js";
15
16
  /**
16
17
  * Custom DH components wrapping React Spectrum components.
17
18
  */
19
+ export * from "./listView/index.js";
18
20
  export * from "./picker/index.js";
19
21
  export * from "./Heading.js";
20
22
  export * from "./Text.js";
@@ -22,5 +24,7 @@ export * from "./View.js";
22
24
  /**
23
25
  * Custom DH spectrum utils
24
26
  */
27
+ export * from "./ItemContent.js";
28
+ export * from "./ItemTooltip.js";
25
29
  export * from "./utils/index.js";
26
30
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../src/spectrum/index.ts"],"sourcesContent":["/**\n * Re-exporting React Spectrum components + props.\n */\nexport * from './buttons';\nexport * from './collections';\nexport * from './content';\nexport * from './dateAndTime';\nexport * from './forms';\nexport * from './layout';\nexport * from './navigation';\nexport * from './overlays';\nexport * from './pickers';\nexport * from './shared';\nexport * from './status';\n\n/**\n * Custom DH components wrapping React Spectrum components.\n */\nexport * from './picker';\nexport * from './Heading';\nexport * from './Text';\nexport * from './View';\n\n/**\n * Custom DH spectrum utils\n */\nexport * from './utils';\n"],"mappings":"AAAA;AACA;AACA;AAFA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAeA;AACA;AACA;AAFA;AAAA;AAAA;AAAA;AAQA;AACA;AACA;AAFA"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../src/spectrum/index.ts"],"sourcesContent":["/**\n * Re-exporting React Spectrum components + props.\n */\nexport * from './buttons';\nexport * from './collections';\nexport * from './content';\nexport * from './dateAndTime';\nexport * from './forms';\nexport * from './icons';\nexport * from './layout';\nexport * from './navigation';\nexport * from './overlays';\nexport * from './pickers';\nexport * from './shared';\nexport * from './status';\n\n/**\n * Custom DH components wrapping React Spectrum components.\n */\nexport * from './listView';\nexport * from './picker';\nexport * from './Heading';\nexport * from './Text';\nexport * from './View';\n\n/**\n * Custom DH spectrum utils\n */\nexport * from './ItemContent';\nexport * from './ItemTooltip';\nexport * from './utils';\n"],"mappings":"AAAA;AACA;AACA;AAFA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAgBA;AACA;AACA;AAFA;AAAA;AAAA;AAAA;AAAA;AASA;AACA;AACA;AAFA;AAAA;AAAA"}
@@ -0,0 +1,28 @@
1
+ /// <reference types="react" />
2
+ import { SpectrumListViewProps } from '@adobe/react-spectrum';
3
+ import { ItemElementOrPrimitive, ItemKey, ItemSelection, NormalizedItem, TooltipOptions } from '../utils';
4
+ export type ListViewProps = {
5
+ children: ItemElementOrPrimitive | ItemElementOrPrimitive[] | NormalizedItem[];
6
+ /** Can be set to true or a TooltipOptions to enable item tooltips */
7
+ tooltip?: boolean | TooltipOptions;
8
+ selectedKeys?: 'all' | Iterable<ItemKey>;
9
+ defaultSelectedKeys?: 'all' | Iterable<ItemKey>;
10
+ disabledKeys?: Iterable<ItemKey>;
11
+ /**
12
+ * Handler that is called when the selection change.
13
+ * Note that under the hood, this is just an alias for Spectrum's
14
+ * `onSelectionChange`. We are renaming for better consistency with other
15
+ * components.
16
+ */
17
+ onChange?: (keys: ItemSelection) => void;
18
+ /** Handler that is called when the picker is scrolled. */
19
+ onScroll?: (event: Event) => void;
20
+ /**
21
+ * Handler that is called when the selection changes.
22
+ * @deprecated Use `onChange` instead
23
+ */
24
+ onSelectionChange?: (keys: ItemSelection) => void;
25
+ } & Omit<SpectrumListViewProps<NormalizedItem>, 'children' | 'items' | 'selectedKeys' | 'defaultSelectedKeys' | 'disabledKeys' | 'onSelectionChange'>;
26
+ export declare function ListView({ children, tooltip, selectedKeys, defaultSelectedKeys, disabledKeys, UNSAFE_className, onChange, onScroll, onSelectionChange, ...spectrumListViewProps }: ListViewProps): JSX.Element | null;
27
+ export default ListView;
28
+ //# sourceMappingURL=ListView.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ListView.d.ts","sourceRoot":"","sources":["../../../src/spectrum/listView/ListView.tsx"],"names":[],"mappings":";AAEA,OAAO,EAEL,qBAAqB,EACtB,MAAM,uBAAuB,CAAC;AAQ/B,OAAO,EACL,sBAAsB,EACtB,OAAO,EACP,aAAa,EACb,cAAc,EAGd,cAAc,EAGf,MAAM,UAAU,CAAC;AAElB,MAAM,MAAM,aAAa,GAAG;IAC1B,QAAQ,EACJ,sBAAsB,GACtB,sBAAsB,EAAE,GACxB,cAAc,EAAE,CAAC;IACrB,qEAAqE;IACrE,OAAO,CAAC,EAAE,OAAO,GAAG,cAAc,CAAC;IACnC,YAAY,CAAC,EAAE,KAAK,GAAG,QAAQ,CAAC,OAAO,CAAC,CAAC;IACzC,mBAAmB,CAAC,EAAE,KAAK,GAAG,QAAQ,CAAC,OAAO,CAAC,CAAC;IAChD,YAAY,CAAC,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC;IACjC;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,aAAa,KAAK,IAAI,CAAC;IAEzC,0DAA0D;IAC1D,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IAElC;;;OAGG;IACH,iBAAiB,CAAC,EAAE,CAAC,IAAI,EAAE,aAAa,KAAK,IAAI,CAAC;CACnD,GAAG,IAAI,CACN,qBAAqB,CAAC,cAAc,CAAC,EACnC,UAAU,GACV,OAAO,GACP,cAAc,GACd,qBAAqB,GACrB,cAAc,GACd,mBAAmB,CACtB,CAAC;AAEF,wBAAgB,QAAQ,CAAC,EACvB,QAAQ,EACR,OAAc,EACd,YAAY,EACZ,mBAAmB,EACnB,YAAY,EACZ,gBAAgB,EAChB,QAAQ,EACR,QAAyB,EACzB,iBAAiB,EACjB,GAAG,qBAAqB,EACzB,EAAE,aAAa,GAAG,GAAG,CAAC,OAAO,GAAG,IAAI,CAwEpC;AAED,eAAe,QAAQ,CAAC"}
@@ -0,0 +1,91 @@
1
+ var _excluded = ["children", "tooltip", "selectedKeys", "defaultSelectedKeys", "disabledKeys", "UNSAFE_className", "onChange", "onScroll", "onSelectionChange"];
2
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
3
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
4
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
5
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
6
+ function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
7
+ function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
8
+ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
9
+ import { useMemo } from 'react';
10
+ import cl from 'classnames';
11
+ import { ListView as SpectrumListView } from '@adobe/react-spectrum';
12
+ import { EMPTY_FUNCTION } from '@deephaven/utils';
13
+ import { extractSpectrumHTMLElement, useContentRect, useOnScrollRef } from '@deephaven/react-hooks';
14
+ import { Flex } from "../layout.js";
15
+ import { normalizeItemList, normalizeTooltipOptions, useRenderNormalizedItem, useStringifiedMultiSelection } from "../utils/index.js";
16
+ import { Fragment as _Fragment } from "react/jsx-runtime";
17
+ import { jsx as _jsx } from "react/jsx-runtime";
18
+ export function ListView(_ref) {
19
+ var _spectrumListViewProp;
20
+ var {
21
+ children,
22
+ tooltip = true,
23
+ selectedKeys,
24
+ defaultSelectedKeys,
25
+ disabledKeys,
26
+ UNSAFE_className,
27
+ onChange,
28
+ onScroll = EMPTY_FUNCTION,
29
+ onSelectionChange
30
+ } = _ref,
31
+ spectrumListViewProps = _objectWithoutProperties(_ref, _excluded);
32
+ var normalizedItems = useMemo(() => normalizeItemList(children), [children]);
33
+ var tooltipOptions = useMemo(() => normalizeTooltipOptions(tooltip, 'bottom'), [tooltip]);
34
+ var renderNormalizedItem = useRenderNormalizedItem(tooltipOptions);
35
+ var {
36
+ selectedStringKeys,
37
+ defaultSelectedStringKeys,
38
+ disabledStringKeys,
39
+ onStringSelectionChange
40
+ } = useStringifiedMultiSelection({
41
+ normalizedItems,
42
+ selectedKeys,
43
+ defaultSelectedKeys,
44
+ disabledKeys,
45
+ onChange: onChange !== null && onChange !== void 0 ? onChange : onSelectionChange
46
+ });
47
+ var scrollRef = useOnScrollRef(onScroll, extractSpectrumHTMLElement);
48
+
49
+ // Spectrum ListView crashes when it has zero height. Track the contentRect
50
+ // of the parent container and only render the ListView when it has a non-zero
51
+ // height. See https://github.com/adobe/react-spectrum/issues/6213
52
+ var {
53
+ ref: contentRectRef,
54
+ contentRect
55
+ } = useContentRect(extractSpectrumHTMLElement);
56
+ return /*#__PURE__*/_jsx(Flex, {
57
+ ref: contentRectRef,
58
+ direction: "column",
59
+ flex: (_spectrumListViewProp = spectrumListViewProps.flex) !== null && _spectrumListViewProp !== void 0 ? _spectrumListViewProp : 1,
60
+ minHeight: 0,
61
+ UNSAFE_className: cl('dh-list-view', UNSAFE_className),
62
+ children: contentRect.height === 0 ?
63
+ /*#__PURE__*/
64
+ // Use &nbsp; to ensure content has a non-zero height. This ensures the
65
+ // container will also have a non-zero height unless its height is
66
+ // explicitly set to zero. Example use case:
67
+ // 1. Tab containing ListView is visible. Container height is non-zero.
68
+ // ListView is rendered.
69
+ // 2. Tab is hidden. Container height is explicitly constrained to zero.
70
+ // ListView is not rendered.
71
+ // 3. Tab is shown again. Height constraint is removed. Resize observer
72
+ // fires and shows non-zero height due to the &nbsp; (without this,
73
+ // the height would remain zero forever since ListView hasn't rendered yet)
74
+ // 4. ListView is rendered again.
75
+ _jsx(_Fragment, {
76
+ children: "\xA0"
77
+ }) : /*#__PURE__*/_jsx(SpectrumListView
78
+ // eslint-disable-next-line react/jsx-props-no-spreading
79
+ , _objectSpread(_objectSpread({}, spectrumListViewProps), {}, {
80
+ ref: scrollRef,
81
+ items: normalizedItems,
82
+ selectedKeys: selectedStringKeys,
83
+ defaultSelectedKeys: defaultSelectedStringKeys,
84
+ disabledKeys: disabledStringKeys,
85
+ onSelectionChange: onStringSelectionChange,
86
+ children: renderNormalizedItem
87
+ }))
88
+ });
89
+ }
90
+ export default ListView;
91
+ //# sourceMappingURL=ListView.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ListView.js","names":["useMemo","cl","ListView","SpectrumListView","EMPTY_FUNCTION","extractSpectrumHTMLElement","useContentRect","useOnScrollRef","Flex","normalizeItemList","normalizeTooltipOptions","useRenderNormalizedItem","useStringifiedMultiSelection","Fragment","_Fragment","jsx","_jsx","_ref","_spectrumListViewProp","children","tooltip","selectedKeys","defaultSelectedKeys","disabledKeys","UNSAFE_className","onChange","onScroll","onSelectionChange","spectrumListViewProps","_objectWithoutProperties","_excluded","normalizedItems","tooltipOptions","renderNormalizedItem","selectedStringKeys","defaultSelectedStringKeys","disabledStringKeys","onStringSelectionChange","scrollRef","ref","contentRectRef","contentRect","direction","flex","minHeight","height","_objectSpread","items"],"sources":["../../../src/spectrum/listView/ListView.tsx"],"sourcesContent":["import { useMemo } from 'react';\nimport cl from 'classnames';\nimport {\n ListView as SpectrumListView,\n SpectrumListViewProps,\n} from '@adobe/react-spectrum';\nimport { EMPTY_FUNCTION } from '@deephaven/utils';\nimport {\n extractSpectrumHTMLElement,\n useContentRect,\n useOnScrollRef,\n} from '@deephaven/react-hooks';\nimport { Flex } from '../layout';\nimport {\n ItemElementOrPrimitive,\n ItemKey,\n ItemSelection,\n NormalizedItem,\n normalizeItemList,\n normalizeTooltipOptions,\n TooltipOptions,\n useRenderNormalizedItem,\n useStringifiedMultiSelection,\n} from '../utils';\n\nexport type ListViewProps = {\n children:\n | ItemElementOrPrimitive\n | ItemElementOrPrimitive[]\n | NormalizedItem[];\n /** Can be set to true or a TooltipOptions to enable item tooltips */\n tooltip?: boolean | TooltipOptions;\n selectedKeys?: 'all' | Iterable<ItemKey>;\n defaultSelectedKeys?: 'all' | Iterable<ItemKey>;\n disabledKeys?: Iterable<ItemKey>;\n /**\n * Handler that is called when the selection change.\n * Note that under the hood, this is just an alias for Spectrum's\n * `onSelectionChange`. We are renaming for better consistency with other\n * components.\n */\n onChange?: (keys: ItemSelection) => void;\n\n /** Handler that is called when the picker is scrolled. */\n onScroll?: (event: Event) => void;\n\n /**\n * Handler that is called when the selection changes.\n * @deprecated Use `onChange` instead\n */\n onSelectionChange?: (keys: ItemSelection) => void;\n} & Omit<\n SpectrumListViewProps<NormalizedItem>,\n | 'children'\n | 'items'\n | 'selectedKeys'\n | 'defaultSelectedKeys'\n | 'disabledKeys'\n | 'onSelectionChange'\n>;\n\nexport function ListView({\n children,\n tooltip = true,\n selectedKeys,\n defaultSelectedKeys,\n disabledKeys,\n UNSAFE_className,\n onChange,\n onScroll = EMPTY_FUNCTION,\n onSelectionChange,\n ...spectrumListViewProps\n}: ListViewProps): JSX.Element | null {\n const normalizedItems = useMemo(\n () => normalizeItemList(children),\n [children]\n );\n\n const tooltipOptions = useMemo(\n () => normalizeTooltipOptions(tooltip, 'bottom'),\n [tooltip]\n );\n\n const renderNormalizedItem = useRenderNormalizedItem(tooltipOptions);\n\n const {\n selectedStringKeys,\n defaultSelectedStringKeys,\n disabledStringKeys,\n onStringSelectionChange,\n } = useStringifiedMultiSelection({\n normalizedItems,\n selectedKeys,\n defaultSelectedKeys,\n disabledKeys,\n onChange: onChange ?? onSelectionChange,\n });\n\n const scrollRef = useOnScrollRef(onScroll, extractSpectrumHTMLElement);\n\n // Spectrum ListView crashes when it has zero height. Track the contentRect\n // of the parent container and only render the ListView when it has a non-zero\n // height. See https://github.com/adobe/react-spectrum/issues/6213\n const { ref: contentRectRef, contentRect } = useContentRect(\n extractSpectrumHTMLElement\n );\n\n return (\n <Flex\n ref={contentRectRef}\n direction=\"column\"\n flex={spectrumListViewProps.flex ?? 1}\n minHeight={0}\n UNSAFE_className={cl('dh-list-view', UNSAFE_className)}\n >\n {contentRect.height === 0 ? (\n // Use &nbsp; to ensure content has a non-zero height. This ensures the\n // container will also have a non-zero height unless its height is\n // explicitly set to zero. Example use case:\n // 1. Tab containing ListView is visible. Container height is non-zero.\n // ListView is rendered.\n // 2. Tab is hidden. Container height is explicitly constrained to zero.\n // ListView is not rendered.\n // 3. Tab is shown again. Height constraint is removed. Resize observer\n // fires and shows non-zero height due to the &nbsp; (without this,\n // the height would remain zero forever since ListView hasn't rendered yet)\n // 4. ListView is rendered again.\n <>&nbsp;</>\n ) : (\n <SpectrumListView\n // eslint-disable-next-line react/jsx-props-no-spreading\n {...spectrumListViewProps}\n ref={scrollRef}\n items={normalizedItems}\n selectedKeys={selectedStringKeys}\n defaultSelectedKeys={defaultSelectedStringKeys}\n disabledKeys={disabledStringKeys}\n onSelectionChange={onStringSelectionChange}\n >\n {renderNormalizedItem}\n </SpectrumListView>\n )}\n </Flex>\n );\n}\n\nexport default ListView;\n"],"mappings":";;;;;;;;AAAA,SAASA,OAAO,QAAQ,OAAO;AAC/B,OAAOC,EAAE,MAAM,YAAY;AAC3B,SACEC,QAAQ,IAAIC,gBAAgB,QAEvB,uBAAuB;AAC9B,SAASC,cAAc,QAAQ,kBAAkB;AACjD,SACEC,0BAA0B,EAC1BC,cAAc,EACdC,cAAc,QACT,wBAAwB;AAAC,SACvBC,IAAI;AAAA,SAMXC,iBAAiB,EACjBC,uBAAuB,EAEvBC,uBAAuB,EACvBC,4BAA4B;AAAA,SAAAC,QAAA,IAAAC,SAAA;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAuC9B,OAAO,SAASd,QAAQA,CAAAe,IAAA,EAWc;EAAA,IAAAC,qBAAA;EAAA,IAXb;MACvBC,QAAQ;MACRC,OAAO,GAAG,IAAI;MACdC,YAAY;MACZC,mBAAmB;MACnBC,YAAY;MACZC,gBAAgB;MAChBC,QAAQ;MACRC,QAAQ,GAAGtB,cAAc;MACzBuB;IAEa,CAAC,GAAAV,IAAA;IADXW,qBAAqB,GAAAC,wBAAA,CAAAZ,IAAA,EAAAa,SAAA;EAExB,IAAMC,eAAe,GAAG/B,OAAO,CAC7B,MAAMS,iBAAiB,CAACU,QAAQ,CAAC,EACjC,CAACA,QAAQ,CACX,CAAC;EAED,IAAMa,cAAc,GAAGhC,OAAO,CAC5B,MAAMU,uBAAuB,CAACU,OAAO,EAAE,QAAQ,CAAC,EAChD,CAACA,OAAO,CACV,CAAC;EAED,IAAMa,oBAAoB,GAAGtB,uBAAuB,CAACqB,cAAc,CAAC;EAEpE,IAAM;IACJE,kBAAkB;IAClBC,yBAAyB;IACzBC,kBAAkB;IAClBC;EACF,CAAC,GAAGzB,4BAA4B,CAAC;IAC/BmB,eAAe;IACfV,YAAY;IACZC,mBAAmB;IACnBC,YAAY;IACZE,QAAQ,EAAEA,QAAQ,aAARA,QAAQ,cAARA,QAAQ,GAAIE;EACxB,CAAC,CAAC;EAEF,IAAMW,SAAS,GAAG/B,cAAc,CAACmB,QAAQ,EAAErB,0BAA0B,CAAC;;EAEtE;EACA;EACA;EACA,IAAM;IAAEkC,GAAG,EAAEC,cAAc;IAAEC;EAAY,CAAC,GAAGnC,cAAc,CACzDD,0BACF,CAAC;EAED,oBACEW,IAAA,CAACR,IAAI;IACH+B,GAAG,EAAEC,cAAe;IACpBE,SAAS,EAAC,QAAQ;IAClBC,IAAI,GAAAzB,qBAAA,GAAEU,qBAAqB,CAACe,IAAI,cAAAzB,qBAAA,cAAAA,qBAAA,GAAI,CAAE;IACtC0B,SAAS,EAAE,CAAE;IACbpB,gBAAgB,EAAEvB,EAAE,CAAC,cAAc,EAAEuB,gBAAgB,CAAE;IAAAL,QAAA,EAEtDsB,WAAW,CAACI,MAAM,KAAK,CAAC;IAAA;IACvB;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA7B,IAAA,CAAAF,SAAA;MAAAK,QAAA,EAAE;IAAM,CAAE,CAAC,gBAEXH,IAAA,CAACb;IACC;IAAA,EAAA2C,aAAA,CAAAA,aAAA,KACIlB,qBAAqB;MACzBW,GAAG,EAAED,SAAU;MACfS,KAAK,EAAEhB,eAAgB;MACvBV,YAAY,EAAEa,kBAAmB;MACjCZ,mBAAmB,EAAEa,yBAA0B;MAC/CZ,YAAY,EAAEa,kBAAmB;MACjCT,iBAAiB,EAAEU,uBAAwB;MAAAlB,QAAA,EAE1Cc;IAAoB,EACL;EACnB,CACG,CAAC;AAEX;AAEA,eAAe/B,QAAQ"}
@@ -0,0 +1,2 @@
1
+ export * from './ListView';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/spectrum/listView/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from "./ListView.js";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../src/spectrum/listView/index.ts"],"sourcesContent":["export * from './ListView';\n"],"mappings":""}