@deephaven/components 0.72.1-xcomponent.2 → 0.73.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/Button.d.ts +1 -1
- package/dist/Select.d.ts +1 -1
- package/dist/index.d.ts +0 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -2
- package/dist/index.js.map +1 -1
- package/dist/shortcuts/GlobalShortcuts.d.ts +1 -0
- package/dist/shortcuts/GlobalShortcuts.d.ts.map +1 -1
- package/dist/shortcuts/GlobalShortcuts.js +7 -0
- package/dist/shortcuts/GlobalShortcuts.js.map +1 -1
- package/dist/spectrum/Heading.d.ts +4 -1
- package/dist/spectrum/Heading.d.ts.map +1 -1
- package/dist/spectrum/Heading.js +5 -3
- package/dist/spectrum/Heading.js.map +1 -1
- package/dist/spectrum/ItemContent.d.ts +15 -0
- package/dist/spectrum/ItemContent.d.ts.map +1 -0
- package/dist/spectrum/{picker/PickerItemContent.js → ItemContent.js} +42 -18
- package/dist/spectrum/ItemContent.js.map +1 -0
- package/dist/spectrum/ItemTooltip.d.ts +12 -0
- package/dist/spectrum/ItemTooltip.d.ts.map +1 -0
- package/dist/spectrum/ItemTooltip.js +30 -0
- package/dist/spectrum/ItemTooltip.js.map +1 -0
- package/dist/spectrum/Text.d.ts +4 -1
- package/dist/spectrum/Text.d.ts.map +1 -1
- package/dist/spectrum/Text.js +5 -4
- package/dist/spectrum/Text.js.map +1 -1
- package/dist/spectrum/View.d.ts +4 -1
- package/dist/spectrum/View.d.ts.map +1 -1
- package/dist/spectrum/View.js +5 -3
- package/dist/spectrum/View.js.map +1 -1
- package/dist/spectrum/collections.d.ts +1 -1
- package/dist/spectrum/collections.d.ts.map +1 -1
- package/dist/spectrum/collections.js +1 -1
- package/dist/spectrum/collections.js.map +1 -1
- package/dist/spectrum/icons.d.ts +2 -0
- package/dist/spectrum/icons.d.ts.map +1 -0
- package/dist/spectrum/icons.js +3 -0
- package/dist/spectrum/icons.js.map +1 -0
- package/dist/spectrum/index.d.ts +4 -0
- package/dist/spectrum/index.d.ts.map +1 -1
- package/dist/spectrum/index.js +4 -0
- package/dist/spectrum/index.js.map +1 -1
- package/dist/spectrum/listView/ListView.d.ts +28 -0
- package/dist/spectrum/listView/ListView.d.ts.map +1 -0
- package/dist/spectrum/listView/ListView.js +91 -0
- package/dist/spectrum/listView/ListView.js.map +1 -0
- package/dist/spectrum/listView/index.d.ts +2 -0
- package/dist/spectrum/listView/index.d.ts.map +1 -0
- package/dist/spectrum/listView/index.js +2 -0
- package/dist/spectrum/listView/index.js.map +1 -0
- package/dist/spectrum/picker/Picker.d.ts.map +1 -1
- package/dist/spectrum/picker/Picker.js +9 -60
- package/dist/spectrum/picker/Picker.js.map +1 -1
- package/dist/spectrum/picker/index.d.ts +0 -1
- package/dist/spectrum/picker/index.d.ts.map +1 -1
- package/dist/spectrum/picker/index.js +0 -1
- package/dist/spectrum/picker/index.js.map +1 -1
- package/dist/spectrum/utils/index.d.ts +2 -0
- package/dist/spectrum/utils/index.d.ts.map +1 -1
- package/dist/spectrum/utils/index.js +2 -0
- package/dist/spectrum/utils/index.js.map +1 -1
- package/dist/spectrum/utils/itemUtils.d.ts +21 -11
- package/dist/spectrum/utils/itemUtils.d.ts.map +1 -1
- package/dist/spectrum/utils/itemUtils.js +23 -8
- package/dist/spectrum/utils/itemUtils.js.map +1 -1
- package/dist/spectrum/utils/useRenderNormalizedItem.d.ts +11 -0
- package/dist/spectrum/utils/useRenderNormalizedItem.d.ts.map +1 -0
- package/dist/spectrum/utils/useRenderNormalizedItem.js +40 -0
- package/dist/spectrum/utils/useRenderNormalizedItem.js.map +1 -0
- package/dist/spectrum/utils/useStringifiedMultiSelection.d.ts +43 -0
- package/dist/spectrum/utils/useStringifiedMultiSelection.d.ts.map +1 -0
- package/dist/spectrum/utils/useStringifiedMultiSelection.js +50 -0
- package/dist/spectrum/utils/useStringifiedMultiSelection.js.map +1 -0
- package/dist/theme/index.d.ts +1 -0
- package/dist/theme/index.d.ts.map +1 -1
- package/dist/theme/index.js +1 -0
- package/dist/theme/index.js.map +1 -1
- package/dist/theme/useSpectrumThemeProvider.d.ts +4 -0
- package/dist/theme/useSpectrumThemeProvider.d.ts.map +1 -0
- package/dist/theme/useSpectrumThemeProvider.js +4 -0
- package/dist/theme/useSpectrumThemeProvider.js.map +1 -0
- package/package.json +7 -7
- package/dist/XComponent.d.ts +0 -43
- package/dist/XComponent.d.ts.map +0 -1
- package/dist/XComponent.js +0 -57
- package/dist/XComponent.js.map +0 -1
- package/dist/XComponentMap.d.ts +0 -14
- package/dist/XComponentMap.d.ts.map +0 -1
- package/dist/XComponentMap.js +0 -20
- package/dist/XComponentMap.js.map +0 -1
- package/dist/spectrum/picker/PickerItemContent.d.ts +0 -11
- package/dist/spectrum/picker/PickerItemContent.d.ts.map +0 -1
- package/dist/spectrum/picker/PickerItemContent.js.map +0 -1
package/dist/XComponentMap.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
/** Type for an extended component. Can fetch the original component using `.original` */
|
|
3
|
-
export type XComponentType<P extends Record<string, unknown>> = React.ComponentType<P> & {
|
|
4
|
-
Original: React.ComponentType<P>;
|
|
5
|
-
};
|
|
6
|
-
export declare const XComponentMapContext: React.Context<Map<React.ComponentType<any>, React.ComponentType<any>>>;
|
|
7
|
-
export declare const XComponentMapProvider: React.Provider<Map<React.ComponentType<any>, React.ComponentType<any>>>;
|
|
8
|
-
/**
|
|
9
|
-
* Use the replacement component for the provided component if it exists, or just return the provided component.
|
|
10
|
-
* @param Component Component to check if there's a replacement for
|
|
11
|
-
* @returns The replacement component if it exists, otherwise the original component
|
|
12
|
-
*/
|
|
13
|
-
export declare function useXComponent<P extends Record<string, unknown>>(Component: XComponentType<P>): React.ComponentType<P>;
|
|
14
|
-
//# sourceMappingURL=XComponentMap.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"XComponentMap.d.ts","sourceRoot":"","sources":["../src/XComponentMap.ts"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAE1C,yFAAyF;AACzF,MAAM,MAAM,cAAc,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,IAC1D,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,GAAG;IACvB,QAAQ,EAAE,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;CAClC,CAAC;AAEJ,eAAO,MAAM,oBAAoB,wEAGhC,CAAC;AAEF,eAAO,MAAM,qBAAqB,yEAAgC,CAAC;AAEnE;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7D,SAAS,EAAE,cAAc,CAAC,CAAC,CAAC,GAC3B,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,CAGxB"}
|
package/dist/XComponentMap.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import React, { useContext } from 'react';
|
|
2
|
-
|
|
3
|
-
/** Type for an extended component. Can fetch the original component using `.original` */
|
|
4
|
-
|
|
5
|
-
export var XComponentMapContext = /*#__PURE__*/React.createContext(
|
|
6
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
7
|
-
new Map());
|
|
8
|
-
export var XComponentMapProvider = XComponentMapContext.Provider;
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Use the replacement component for the provided component if it exists, or just return the provided component.
|
|
12
|
-
* @param Component Component to check if there's a replacement for
|
|
13
|
-
* @returns The replacement component if it exists, otherwise the original component
|
|
14
|
-
*/
|
|
15
|
-
export function useXComponent(Component) {
|
|
16
|
-
var _ctx$get;
|
|
17
|
-
var ctx = useContext(XComponentMapContext);
|
|
18
|
-
return (_ctx$get = ctx.get(Component)) !== null && _ctx$get !== void 0 ? _ctx$get : Component.Original;
|
|
19
|
-
}
|
|
20
|
-
//# sourceMappingURL=XComponentMap.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"XComponentMap.js","names":["React","useContext","XComponentMapContext","createContext","Map","XComponentMapProvider","Provider","useXComponent","Component","_ctx$get","ctx","get","Original"],"sources":["../src/XComponentMap.ts"],"sourcesContent":["import React, { useContext } from 'react';\n\n/** Type for an extended component. Can fetch the original component using `.original` */\nexport type XComponentType<P extends Record<string, unknown>> =\n React.ComponentType<P> & {\n Original: React.ComponentType<P>;\n };\n\nexport const XComponentMapContext = React.createContext(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n new Map<React.ComponentType<any>, React.ComponentType<any>>()\n);\n\nexport const XComponentMapProvider = XComponentMapContext.Provider;\n\n/**\n * Use the replacement component for the provided component if it exists, or just return the provided component.\n * @param Component Component to check if there's a replacement for\n * @returns The replacement component if it exists, otherwise the original component\n */\nexport function useXComponent<P extends Record<string, unknown>>(\n Component: XComponentType<P>\n): React.ComponentType<P> {\n const ctx = useContext(XComponentMapContext);\n return ctx.get(Component) ?? Component.Original;\n}\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,UAAU,QAAQ,OAAO;;AAEzC;;AAMA,OAAO,IAAMC,oBAAoB,gBAAGF,KAAK,CAACG,aAAa;AACrD;AACA,IAAIC,GAAG,CAAqD,CAC9D,CAAC;AAED,OAAO,IAAMC,qBAAqB,GAAGH,oBAAoB,CAACI,QAAQ;;AAElE;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,aAAaA,CAC3BC,SAA4B,EACJ;EAAA,IAAAC,QAAA;EACxB,IAAMC,GAAG,GAAGT,UAAU,CAACC,oBAAoB,CAAC;EAC5C,QAAAO,QAAA,GAAOC,GAAG,CAACC,GAAG,CAACH,SAAS,CAAC,cAAAC,QAAA,cAAAA,QAAA,GAAID,SAAS,CAACI,QAAQ;AACjD"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
export interface PickerItemContentProps {
|
|
3
|
-
children: ReactNode;
|
|
4
|
-
}
|
|
5
|
-
/**
|
|
6
|
-
* Picker item content. Text content will be wrapped in a Spectrum Text
|
|
7
|
-
* component with ellipsis overflow handling.
|
|
8
|
-
*/
|
|
9
|
-
export declare function PickerItemContent({ children: content, }: PickerItemContentProps): JSX.Element | null;
|
|
10
|
-
export default PickerItemContent;
|
|
11
|
-
//# sourceMappingURL=PickerItemContent.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PickerItemContent.d.ts","sourceRoot":"","sources":["../../../src/spectrum/picker/PickerItemContent.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA0C,SAAS,EAAE,MAAM,OAAO,CAAC;AAM1E,MAAM,WAAW,sBAAsB;IACrC,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,EAChC,QAAQ,EAAE,OAAO,GAClB,EAAE,sBAAsB,GAAG,GAAG,CAAC,OAAO,GAAG,IAAI,CAyC7C;AAED,eAAe,iBAAiB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PickerItemContent.js","names":["Children","cloneElement","isValidElement","Text","cl","isElementOfType","stylesCommon","jsx","_jsx","Fragment","_Fragment","PickerItemContent","_ref","children","content","String","Array","isArray","map","el","i","_objectSpread","props","UNSAFE_className","spectrumEllipsis"],"sources":["../../../src/spectrum/picker/PickerItemContent.tsx"],"sourcesContent":["import { Children, cloneElement, isValidElement, ReactNode } from 'react';\nimport { Text } from '@adobe/react-spectrum';\nimport cl from 'classnames';\nimport { isElementOfType } from '@deephaven/react-hooks';\nimport stylesCommon from '../../SpectrumComponent.module.scss';\n\nexport interface PickerItemContentProps {\n children: ReactNode;\n}\n\n/**\n * Picker item content. Text content will be wrapped in a Spectrum Text\n * component with ellipsis overflow handling.\n */\nexport function PickerItemContent({\n children: content,\n}: PickerItemContentProps): JSX.Element | null {\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, i) =>\n isElementOfType(el, Text)\n ? cloneElement(el, {\n ...el.props,\n UNSAFE_className: cl(\n el.props.UNSAFE_className,\n stylesCommon.spectrumEllipsis\n ),\n })\n : el\n );\n }\n /* eslint-enable no-param-reassign */\n\n return typeof content === 'string' || typeof content === 'number' ? (\n <Text UNSAFE_className={stylesCommon.spectrumEllipsis}>{content}</Text>\n ) : (\n // eslint-disable-next-line react/jsx-no-useless-fragment\n <>{content}</>\n );\n}\n\nexport default PickerItemContent;\n"],"mappings":";;;;;AAAA,SAASA,QAAQ,EAAEC,YAAY,EAAEC,cAAc,QAAmB,OAAO;AACzE,SAASC,IAAI,QAAQ,uBAAuB;AAC5C,OAAOC,EAAE,MAAM,YAAY;AAC3B,SAASC,eAAe,QAAQ,wBAAwB;AAAC,OAClDC,YAAY;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,QAAA,IAAAC,SAAA;AAMnB;AACA;AACA;AACA;AACA,OAAO,SAASC,iBAAiBA,CAAAC,IAAA,EAEc;EAAA,IAFb;IAChCC,QAAQ,EAAEC;EACY,CAAC,GAAAF,IAAA;EACvB,kBAAIV,cAAc,CAACY,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,GAAGC,MAAM,CAACD,OAAO,CAAC;EAC3B,CAAC,MAAM,IAAIE,KAAK,CAACC,OAAO,CAACH,OAAO,CAAC,EAAE;IACjC;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACAA,OAAO,GAAGd,QAAQ,CAACkB,GAAG,CAACJ,OAAO,EAAE,CAACK,EAAE,EAAEC,CAAC,KACpCf,eAAe,CAACc,EAAE,EAAEhB,IAAI,CAAC,gBACrBF,YAAY,CAACkB,EAAE,EAAAE,aAAA,CAAAA,aAAA,KACVF,EAAE,CAACG,KAAK;MACXC,gBAAgB,EAAEnB,EAAE,CAClBe,EAAE,CAACG,KAAK,CAACC,gBAAgB,EACzBjB,YAAY,CAACkB,gBACf;IAAC,EACF,CAAC,GACFL,EACN,CAAC;EACH;EACA;;EAEA,OAAO,OAAOL,OAAO,KAAK,QAAQ,IAAI,OAAOA,OAAO,KAAK,QAAQ,gBAC/DN,IAAA,CAACL,IAAI;IAACoB,gBAAgB,EAAEjB,YAAY,CAACkB,gBAAiB;IAAAX,QAAA,EAAEC;EAAO,CAAO,CAAC;EAAA;EAEvE;EACAN,IAAA,CAAAE,SAAA;IAAAG,QAAA,EAAGC;EAAO,CAAG,CACd;AACH;AAEA,eAAeH,iBAAiB"}
|