@deephaven/components 0.82.0 → 0.82.1-alpha-combobox.11
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/SearchableCombobox.d.ts +2 -2
- package/dist/SearchableCombobox.d.ts.map +1 -1
- package/dist/SearchableCombobox.js.map +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -1
- package/dist/index.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 +10 -3
- package/dist/spectrum/collections.js.map +1 -1
- package/dist/spectrum/comboBox/ComboBox.d.ts +7 -0
- package/dist/spectrum/comboBox/ComboBox.d.ts.map +1 -0
- package/dist/spectrum/comboBox/ComboBox.js +41 -0
- package/dist/spectrum/comboBox/ComboBox.js.map +1 -0
- package/dist/spectrum/comboBox/ComboBoxNormalized.d.ts +15 -0
- package/dist/spectrum/comboBox/ComboBoxNormalized.d.ts.map +1 -0
- package/dist/spectrum/comboBox/ComboBoxNormalized.js +42 -0
- package/dist/spectrum/comboBox/ComboBoxNormalized.js.map +1 -0
- package/dist/spectrum/comboBox/index.d.ts +3 -0
- package/dist/spectrum/comboBox/index.d.ts.map +1 -0
- package/dist/spectrum/comboBox/index.js +3 -0
- package/dist/spectrum/comboBox/index.js.map +1 -0
- package/dist/spectrum/index.d.ts +1 -1
- package/dist/spectrum/index.d.ts.map +1 -1
- package/dist/spectrum/index.js +1 -1
- package/dist/spectrum/index.js.map +1 -1
- package/dist/spectrum/listView/ListViewWrapper.js.map +1 -1
- package/dist/spectrum/picker/Picker.d.ts +2 -25
- package/dist/spectrum/picker/Picker.d.ts.map +1 -1
- package/dist/spectrum/picker/Picker.js +20 -68
- package/dist/spectrum/picker/Picker.js.map +1 -1
- package/dist/spectrum/picker/PickerNormalized.d.ts +2 -9
- package/dist/spectrum/picker/PickerNormalized.d.ts.map +1 -1
- package/dist/spectrum/picker/PickerNormalized.js +13 -80
- package/dist/spectrum/picker/PickerNormalized.js.map +1 -1
- package/dist/spectrum/picker/PickerProps.d.ts +64 -0
- package/dist/spectrum/picker/PickerProps.d.ts.map +1 -0
- package/dist/spectrum/picker/PickerProps.js +2 -0
- package/dist/spectrum/picker/PickerProps.js.map +1 -0
- package/dist/spectrum/picker/index.d.ts +4 -0
- package/dist/spectrum/picker/index.d.ts.map +1 -1
- package/dist/spectrum/picker/index.js +4 -0
- package/dist/spectrum/picker/index.js.map +1 -1
- package/dist/spectrum/picker/usePickerItemScale.d.ts +9 -0
- package/dist/spectrum/picker/usePickerItemScale.d.ts.map +1 -0
- package/dist/spectrum/picker/usePickerItemScale.js +17 -0
- package/dist/spectrum/picker/usePickerItemScale.js.map +1 -0
- package/dist/spectrum/picker/usePickerNormalizedProps.d.ts +27 -0
- package/dist/spectrum/picker/usePickerNormalizedProps.d.ts.map +1 -0
- package/dist/spectrum/picker/usePickerNormalizedProps.js +101 -0
- package/dist/spectrum/picker/usePickerNormalizedProps.js.map +1 -0
- package/dist/spectrum/picker/usePickerProps.d.ts +28 -0
- package/dist/spectrum/picker/usePickerProps.d.ts.map +1 -0
- package/dist/spectrum/picker/usePickerProps.js +75 -0
- package/dist/spectrum/picker/usePickerProps.js.map +1 -0
- package/dist/spectrum/picker/usePickerScrollOnOpen.d.ts +3 -3
- package/dist/spectrum/picker/usePickerScrollOnOpen.d.ts.map +1 -1
- package/dist/spectrum/picker/usePickerScrollOnOpen.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 +7 -2
- package/dist/spectrum/utils/itemUtils.d.ts.map +1 -1
- package/dist/spectrum/utils/itemUtils.js +13 -0
- package/dist/spectrum/utils/itemUtils.js.map +1 -1
- package/dist/spectrum/utils/itemWrapperUtils.d.ts.map +1 -1
- package/dist/spectrum/utils/itemWrapperUtils.js +2 -2
- package/dist/spectrum/utils/itemWrapperUtils.js.map +1 -1
- package/dist/spectrum/utils/useOnChangeTrackUncontrolled.d.ts +19 -0
- package/dist/spectrum/utils/useOnChangeTrackUncontrolled.d.ts.map +1 -0
- package/dist/spectrum/utils/useOnChangeTrackUncontrolled.js +31 -0
- package/dist/spectrum/utils/useOnChangeTrackUncontrolled.js.map +1 -0
- package/dist/spectrum/utils/useStaticItemInitialScrollPosition.d.ts +10 -0
- package/dist/spectrum/utils/useStaticItemInitialScrollPosition.d.ts.map +1 -0
- package/dist/spectrum/utils/useStaticItemInitialScrollPosition.js +27 -0
- package/dist/spectrum/utils/useStaticItemInitialScrollPosition.js.map +1 -0
- package/dist/spectrum/utils/useStringifiedSelection.d.ts +2 -2
- package/dist/spectrum/utils/useStringifiedSelection.d.ts.map +1 -1
- package/dist/spectrum/utils/useStringifiedSelection.js.map +1 -1
- package/package.json +7 -7
- package/dist/ComboBox.d.ts +0 -120
- package/dist/ComboBox.d.ts.map +0 -1
- package/dist/ComboBox.js +0 -497
- package/dist/ComboBox.js.map +0 -1
- package/dist/spectrum/pickers.d.ts +0 -2
- package/dist/spectrum/pickers.d.ts.map +0 -1
- package/dist/spectrum/pickers.js +0 -2
- package/dist/spectrum/pickers.js.map +0 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { Key } from 'react';
|
|
2
2
|
import { SpectrumComboBoxProps } from '@adobe/react-spectrum';
|
|
3
|
-
import type {
|
|
3
|
+
import type { DOMRefValue } from '@react-types/shared';
|
|
4
4
|
export interface SearchableComboboxProps<TItem, TKey extends Key> extends Omit<SpectrumComboBoxProps<TItem>, 'children' | 'menuTrigger' | 'onSelectionChange'> {
|
|
5
5
|
getItemDisplayText: (item: TItem | null | undefined) => string | null;
|
|
6
6
|
getKey: (item: TItem | null | undefined) => TKey | null;
|
|
7
|
-
scrollRef: React.RefObject<
|
|
7
|
+
scrollRef: React.RefObject<DOMRefValue>;
|
|
8
8
|
onSelectionChange: (key: TKey | null) => void;
|
|
9
9
|
}
|
|
10
10
|
export declare function SearchableCombobox<TItem, TKey extends Key>({ scrollRef, getItemDisplayText, getKey, ...props }: SearchableComboboxProps<TItem, TKey>): JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SearchableCombobox.d.ts","sourceRoot":"","sources":["../src/SearchableCombobox.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,GAAG,EAAe,MAAM,OAAO,CAAC;AACzC,OAAO,EAAkB,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"SearchableCombobox.d.ts","sourceRoot":"","sources":["../src/SearchableCombobox.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,GAAG,EAAe,MAAM,OAAO,CAAC;AACzC,OAAO,EAAkB,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAC9E,OAAO,KAAK,EAAE,WAAW,EAAgB,MAAM,qBAAqB,CAAC;AAGrE,MAAM,WAAW,uBAAuB,CAAC,KAAK,EAAE,IAAI,SAAS,GAAG,CAC9D,SAAQ,IAAI,CACV,qBAAqB,CAAC,KAAK,CAAC,EAC5B,UAAU,GAAG,aAAa,GAAG,mBAAmB,CACjD;IACD,kBAAkB,EAAE,CAAC,IAAI,EAAE,KAAK,GAAG,IAAI,GAAG,SAAS,KAAK,MAAM,GAAG,IAAI,CAAC;IACtE,MAAM,EAAE,CAAC,IAAI,EAAE,KAAK,GAAG,IAAI,GAAG,SAAS,KAAK,IAAI,GAAG,IAAI,CAAC;IACxD,SAAS,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;IACxC,iBAAiB,EAAE,CAAC,GAAG,EAAE,IAAI,GAAG,IAAI,KAAK,IAAI,CAAC;CAC/C;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,IAAI,SAAS,GAAG,EAAE,EAC1D,SAAS,EACT,kBAAkB,EAClB,MAAM,EACN,GAAG,KAAK,EACT,EAAE,uBAAuB,CAAC,KAAK,EAAE,IAAI,CAAC,GAAG,GAAG,CAAC,OAAO,CA4BpD;AAED,eAAe,kBAAkB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SearchableCombobox.js","names":["useCallback","ComboBox","Item","TextWithTooltip","jsx","_jsx","SearchableCombobox","_ref","scrollRef","getItemDisplayText","getKey","props","_objectWithoutProperties","_excluded","renderItem","item","key","displayText","textValue","String","children","text","_objectSpread","ref","menuTrigger","onSelectionChange"],"sources":["../src/SearchableCombobox.tsx"],"sourcesContent":["/* eslint-disable react/jsx-props-no-spreading */\nimport { Key, useCallback } from 'react';\nimport { ComboBox, Item, SpectrumComboBoxProps } from '@adobe/react-spectrum';\nimport type { FocusableRef } from '@react-types/shared';\nimport
|
|
1
|
+
{"version":3,"file":"SearchableCombobox.js","names":["useCallback","ComboBox","Item","TextWithTooltip","jsx","_jsx","SearchableCombobox","_ref","scrollRef","getItemDisplayText","getKey","props","_objectWithoutProperties","_excluded","renderItem","item","key","displayText","textValue","String","children","text","_objectSpread","ref","menuTrigger","onSelectionChange"],"sources":["../src/SearchableCombobox.tsx"],"sourcesContent":["/* eslint-disable react/jsx-props-no-spreading */\nimport { Key, useCallback } from 'react';\nimport { ComboBox, Item, SpectrumComboBoxProps } from '@adobe/react-spectrum';\nimport type { DOMRefValue, FocusableRef } from '@react-types/shared';\nimport TextWithTooltip from './TextWithTooltip';\n\nexport interface SearchableComboboxProps<TItem, TKey extends Key>\n extends Omit<\n SpectrumComboBoxProps<TItem>,\n 'children' | 'menuTrigger' | 'onSelectionChange'\n > {\n getItemDisplayText: (item: TItem | null | undefined) => string | null;\n getKey: (item: TItem | null | undefined) => TKey | null;\n scrollRef: React.RefObject<DOMRefValue>;\n onSelectionChange: (key: TKey | null) => void;\n}\n\nexport function SearchableCombobox<TItem, TKey extends Key>({\n scrollRef,\n getItemDisplayText,\n getKey,\n ...props\n}: SearchableComboboxProps<TItem, TKey>): JSX.Element {\n const renderItem = useCallback(\n item => {\n const key = getKey(item);\n const displayText = getItemDisplayText(item);\n\n return (\n <Item key={key} textValue={displayText ?? String(key)}>\n <TextWithTooltip text={displayText} />\n </Item>\n );\n },\n [getItemDisplayText, getKey]\n );\n\n return (\n <ComboBox\n {...props}\n // The `ref`prop type defined by React Spectrum is incorrect here\n ref={scrollRef as unknown as FocusableRef<HTMLElement>}\n menuTrigger=\"focus\"\n // Type assertion is necessary since <ComboBox> types don't recognize the\n // generic key arg\n onSelectionChange={props.onSelectionChange as (key: Key | null) => void}\n >\n {renderItem}\n </ComboBox>\n );\n}\n\nexport default SearchableCombobox;\n"],"mappings":";;;;;;;;AAAA;AACA,SAAcA,WAAW,QAAQ,OAAO;AACxC,SAASC,QAAQ,EAAEC,IAAI,QAA+B,uBAAuB;AAAC,OAEvEC,eAAe;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAatB,OAAO,SAASC,kBAAkBA,CAAAC,IAAA,EAKoB;EAAA,IALM;MAC1DC,SAAS;MACTC,kBAAkB;MAClBC;IAEoC,CAAC,GAAAH,IAAA;IADlCI,KAAK,GAAAC,wBAAA,CAAAL,IAAA,EAAAM,SAAA;EAER,IAAMC,UAAU,GAAGd,WAAW,CAC5Be,IAAI,IAAI;IACN,IAAMC,GAAG,GAAGN,MAAM,CAACK,IAAI,CAAC;IACxB,IAAME,WAAW,GAAGR,kBAAkB,CAACM,IAAI,CAAC;IAE5C,oBACEV,IAAA,CAACH,IAAI;MAAWgB,SAAS,EAAED,WAAW,aAAXA,WAAW,cAAXA,WAAW,GAAIE,MAAM,CAACH,GAAG,CAAE;MAAAI,QAAA,eACpDf,IAAA,CAACF,eAAe;QAACkB,IAAI,EAAEJ;MAAY,CAAE;IAAC,GAD7BD,GAEL,CAAC;EAEX,CAAC,EACD,CAACP,kBAAkB,EAAEC,MAAM,CAC7B,CAAC;EAED,oBACEL,IAAA,CAACJ,QAAQ,EAAAqB,aAAA,CAAAA,aAAA,KACHX,KAAK;IACT;IACAY,GAAG,EAAEf,SAAkD;IACvDgB,WAAW,EAAC;IACZ;IACA;IAAA;IACAC,iBAAiB,EAAEd,KAAK,CAACc,iBAA+C;IAAAL,QAAA,EAEvEN;EAAU,EACH,CAAC;AAEf;AAEA,eAAeR,kBAAkB"}
|
package/dist/index.d.ts
CHANGED
|
@@ -9,7 +9,6 @@ export { default as CardFlip } from './CardFlip';
|
|
|
9
9
|
export * from './context-actions';
|
|
10
10
|
export { default as Collapse } from './Collapse';
|
|
11
11
|
export { default as Checkbox } from './Checkbox';
|
|
12
|
-
export { default as ComboBox } from './ComboBox';
|
|
13
12
|
export { default as CopyButton } from './CopyButton';
|
|
14
13
|
export { default as CustomTimeSelect } from './CustomTimeSelect';
|
|
15
14
|
export * from './DateTimeInput';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAC9C,cAAc,WAAW,CAAC;AAC1B,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACnE,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AACrE,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,cAAc,CAAC;AACrD,cAAc,UAAU,CAAC;AACzB,cAAc,iBAAiB,CAAC;AAChC,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,YAAY,CAAC;AACjD,cAAc,mBAAmB,CAAC;AAClC,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAAE,OAAO,IAAI,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAC9C,cAAc,WAAW,CAAC;AAC1B,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACnE,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AACrE,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,cAAc,CAAC;AACrD,cAAc,UAAU,CAAC;AACzB,cAAc,iBAAiB,CAAC;AAChC,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,YAAY,CAAC;AACjD,cAAc,mBAAmB,CAAC;AAClC,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACjE,cAAc,iBAAiB,CAAC;AAChC,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AACzE,cAAc,WAAW,CAAC;AAC1B,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACnE,cAAc,qBAAqB,CAAC;AACpC,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACjE,cAAc,iBAAiB,CAAC;AAChC,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,OAAO,IAAI,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AACjF,cAAc,4BAA4B,CAAC;AAC3C,cAAc,YAAY,CAAC;AAC3B,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACzD,cAAc,gBAAgB,CAAC;AAC/B,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,eAAe,CAAC;AACvD,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC;AAC7B,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,UAAU,CAAC;AAC7C,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,OAAO,EAAE,OAAO,IAAI,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAC/E,cAAc,sBAAsB,CAAC;AACrC,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAC/D,cAAc,mBAAmB,CAAC;AAClC,cAAc,aAAa,CAAC;AAC5B,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAC7D,cAAc,YAAY,CAAC;AAC3B,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAClC,cAAc,SAAS,CAAC;AACxB,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACnE,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,YAAY,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -8,7 +8,6 @@ export { default as CardFlip } from "./CardFlip.js";
|
|
|
8
8
|
export * from "./context-actions/index.js";
|
|
9
9
|
export { default as Collapse } from "./Collapse.js";
|
|
10
10
|
export { default as Checkbox } from "./Checkbox.js";
|
|
11
|
-
export { default as ComboBox } from "./ComboBox.js";
|
|
12
11
|
export { default as CopyButton } from "./CopyButton.js";
|
|
13
12
|
export { default as CustomTimeSelect } from "./CustomTimeSelect.js";
|
|
14
13
|
export * from "./DateTimeInput.js";
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["default","AutoCompleteInput","AutoResizeTextarea","BasicModal","CardFlip","Collapse","Checkbox","
|
|
1
|
+
{"version":3,"file":"index.js","names":["default","AutoCompleteInput","AutoResizeTextarea","BasicModal","CardFlip","Collapse","Checkbox","CopyButton","CustomTimeSelect","DateInput","DebouncedSearchInput","DraggableItemList","DragUtils","EditableItemList","ErrorView","HierarchicalCheckboxMenu","ItemListItem","LoadingOverlay","LoadingSpinner","DropdownMenu","MaskedInput","Option","RandomAreaPlotAnimation","Select","SearchInput","SelectValueList","SocketedButton","ThemeExport","TimeInput","TimeSlider","ToastNotification","UISwitch"],"sources":["../src/index.ts"],"sourcesContent":["export type { Range } from '@deephaven/utils';\nexport * from './actions';\nexport { default as AutoCompleteInput } from './AutoCompleteInput';\nexport { default as AutoResizeTextarea } from './AutoResizeTextarea';\nexport { default as BasicModal } from './BasicModal';\nexport * from './Button';\nexport * from './BulkActionBar';\nexport { default as CardFlip } from './CardFlip';\nexport * from './context-actions';\nexport { default as Collapse } from './Collapse';\nexport { default as Checkbox } from './Checkbox';\nexport { default as CopyButton } from './CopyButton';\nexport { default as CustomTimeSelect } from './CustomTimeSelect';\nexport * from './DateTimeInput';\nexport { default as DateInput } from './DateInput';\nexport { default as DebouncedSearchInput } from './DebouncedSearchInput';\nexport * from './dialogs';\nexport { default as DraggableItemList } from './DraggableItemList';\nexport * from './DraggableItemList';\nexport { default as DragUtils } from './DragUtils';\nexport { default as EditableItemList } from './EditableItemList';\nexport * from './ErrorBoundary';\nexport { default as ErrorView } from './ErrorView';\nexport { default as HierarchicalCheckboxMenu } from './HierarchicalCheckboxMenu';\nexport * from './HierarchicalCheckboxMenu';\nexport * from './ItemList';\nexport { default as ItemListItem } from './ItemListItem';\nexport { default as LoadingOverlay } from './LoadingOverlay';\nexport { default as LoadingSpinner } from './LoadingSpinner';\nexport { default as DropdownMenu } from './menu-actions';\nexport * from './menu-actions';\nexport { default as MaskedInput } from './MaskedInput';\nexport * from './MaskedInput';\nexport * from './MaskedInputUtils';\nexport * from './navigation';\nexport { default as Option } from './Option';\nexport * from './popper';\nexport * from './modal';\nexport { default as RandomAreaPlotAnimation } from './RandomAreaPlotAnimation';\nexport * from './SearchableCombobox';\nexport { default as Select } from './Select';\nexport { default as SearchInput } from './SearchInput';\nexport { default as SelectValueList } from './SelectValueList';\nexport * from './SelectValueList';\nexport * from './shortcuts';\nexport { default as SocketedButton } from './SocketedButton';\nexport * from './spectrum';\nexport * from './SplitButtonGroup';\nexport * from './TableViewEmptyState';\nexport * from './TextWithTooltip';\nexport * from './theme';\nexport * from './transitions';\nexport { default as ThemeExport } from './ThemeExport';\nexport { default as TimeInput } from './TimeInput';\nexport { default as TimeSlider } from './TimeSlider';\nexport { default as ToastNotification } from './ToastNotification';\nexport { default as UISwitch } from './UISwitch';\n"],"mappings":";SAESA,OAAO,IAAIC,iBAAiB;AAAA,SAC5BD,OAAO,IAAIE,kBAAkB;AAAA,SAC7BF,OAAO,IAAIG,UAAU;AAAA;AAAA;AAAA,SAGrBH,OAAO,IAAII,QAAQ;AAAA;AAAA,SAEnBJ,OAAO,IAAIK,QAAQ;AAAA,SACnBL,OAAO,IAAIM,QAAQ;AAAA,SACnBN,OAAO,IAAIO,UAAU;AAAA,SACrBP,OAAO,IAAIQ,gBAAgB;AAAA;AAAA,SAE3BR,OAAO,IAAIS,SAAS;AAAA,SACpBT,OAAO,IAAIU,oBAAoB;AAAA;AAAA,SAE/BV,OAAO,IAAIW,iBAAiB;AAAA;AAAA,SAE5BX,OAAO,IAAIY,SAAS;AAAA,SACpBZ,OAAO,IAAIa,gBAAgB;AAAA;AAAA,SAE3Bb,OAAO,IAAIc,SAAS;AAAA,SACpBd,OAAO,IAAIe,wBAAwB;AAAA;AAAA;AAAA,SAGnCf,OAAO,IAAIgB,YAAY;AAAA,SACvBhB,OAAO,IAAIiB,cAAc;AAAA,SACzBjB,OAAO,IAAIkB,cAAc;AAAA,SACzBlB,OAAO,IAAImB,YAAY;AAAA;AAAA,SAEvBnB,OAAO,IAAIoB,WAAW;AAAA;AAAA;AAAA;AAAA,SAItBpB,OAAO,IAAIqB,MAAM;AAAA;AAAA;AAAA,SAGjBrB,OAAO,IAAIsB,uBAAuB;AAAA;AAAA,SAElCtB,OAAO,IAAIuB,MAAM;AAAA,SACjBvB,OAAO,IAAIwB,WAAW;AAAA,SACtBxB,OAAO,IAAIyB,eAAe;AAAA;AAAA;AAAA,SAG1BzB,OAAO,IAAI0B,cAAc;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,SAOzB1B,OAAO,IAAI2B,WAAW;AAAA,SACtB3B,OAAO,IAAI4B,SAAS;AAAA,SACpB5B,OAAO,IAAI6B,UAAU;AAAA,SACrB7B,OAAO,IAAI8B,iBAAiB;AAAA,SAC5B9B,OAAO,IAAI+B,QAAQ"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { ActionBar, type SpectrumActionBarProps as ActionBarProps, MenuTrigger, type SpectrumMenuTriggerProps as MenuTriggerProps, TagGroup, type SpectrumTagGroupProps as TagGroupProps, } from '@adobe/react-spectrum';
|
|
1
|
+
export { ActionBar, type SpectrumActionBarProps as ActionBarProps, type SpectrumComboBoxProps, MenuTrigger, type SpectrumMenuTriggerProps as MenuTriggerProps, type SpectrumPickerProps, 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,
|
|
1
|
+
{"version":3,"file":"collections.d.ts","sourceRoot":"","sources":["../../src/spectrum/collections.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,KAAK,sBAAsB,IAAI,cAAc,EAG7C,KAAK,qBAAqB,EAE1B,WAAW,EACX,KAAK,wBAAwB,IAAI,gBAAgB,EAIjD,KAAK,mBAAmB,EACxB,QAAQ,EACR,KAAK,qBAAqB,IAAI,aAAa,GAC5C,MAAM,uBAAuB,CAAC"}
|
|
@@ -1,6 +1,13 @@
|
|
|
1
|
-
export { ActionBar
|
|
1
|
+
export { ActionBar
|
|
2
|
+
|
|
3
|
+
// ComboBox is exported from ComboBox.tsx as a custom DH component. Re-exporting
|
|
4
|
+
// the Spectrum props type for upstream consumers that need to compose prop types.
|
|
5
|
+
,
|
|
2
6
|
// ListBox - we aren't planning to support this component
|
|
3
|
-
MenuTrigger
|
|
7
|
+
MenuTrigger
|
|
8
|
+
|
|
4
9
|
// TableView - we aren't planning to support this component
|
|
5
|
-
|
|
10
|
+
// Picker is exported from Picker.tsx as a custom DH component. Re-exporting
|
|
11
|
+
// the Spectrum props type for upstream consumers that need to compose prop types.
|
|
12
|
+
, TagGroup } from '@adobe/react-spectrum';
|
|
6
13
|
//# sourceMappingURL=collections.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collections.js","names":["ActionBar","MenuTrigger","TagGroup"],"sources":["../../src/spectrum/collections.ts"],"sourcesContent":["export {\n ActionBar,\n type SpectrumActionBarProps as ActionBarProps,\n // ListBox - we aren't planning to support this component\n MenuTrigger,\n type SpectrumMenuTriggerProps as MenuTriggerProps,\n // TableView - we aren't planning to support this component\n TagGroup,\n type SpectrumTagGroupProps as TagGroupProps,\n} from '@adobe/react-spectrum';\n"],"mappings":"AAAA,SACEA
|
|
1
|
+
{"version":3,"file":"collections.js","names":["ActionBar","MenuTrigger","TagGroup"],"sources":["../../src/spectrum/collections.ts"],"sourcesContent":["export {\n ActionBar,\n type SpectrumActionBarProps as ActionBarProps,\n // ComboBox is exported from ComboBox.tsx as a custom DH component. Re-exporting\n // the Spectrum props type for upstream consumers that need to compose prop types.\n type SpectrumComboBoxProps,\n // ListBox - we aren't planning to support this component\n MenuTrigger,\n type SpectrumMenuTriggerProps as MenuTriggerProps,\n // TableView - we aren't planning to support this component\n // Picker is exported from Picker.tsx as a custom DH component. Re-exporting\n // the Spectrum props type for upstream consumers that need to compose prop types.\n type SpectrumPickerProps,\n TagGroup,\n type SpectrumTagGroupProps as TagGroupProps,\n} from '@adobe/react-spectrum';\n"],"mappings":"AAAA,SACEA;;AAEA;AACA;AAAA;AAEA;AACAC;;AAEA;AACA;AACA;AAAA,EAEAC,QAAQ,QAEH,uBAAuB"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { SpectrumComboBoxProps } from '@adobe/react-spectrum';
|
|
3
|
+
import type { NormalizedItem } from '../utils';
|
|
4
|
+
import { PickerPropsT } from '../picker';
|
|
5
|
+
export type ComboBoxProps = PickerPropsT<SpectrumComboBoxProps<NormalizedItem>>;
|
|
6
|
+
export declare function ComboBox({ UNSAFE_className, ...props }: ComboBoxProps): JSX.Element;
|
|
7
|
+
//# sourceMappingURL=ComboBox.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ComboBox.d.ts","sourceRoot":"","sources":["../../../src/spectrum/comboBox/ComboBox.tsx"],"names":[],"mappings":";AAAA,OAAO,EAEL,qBAAqB,EACtB,MAAM,uBAAuB,CAAC;AAG/B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAkB,MAAM,WAAW,CAAC;AAEzD,MAAM,MAAM,aAAa,GAAG,YAAY,CAAC,qBAAqB,CAAC,cAAc,CAAC,CAAC,CAAC;AAEhF,wBAAgB,QAAQ,CAAC,EACvB,gBAAgB,EAChB,GAAG,KAAK,EACT,EAAE,aAAa,GAAG,GAAG,CAAC,OAAO,CA6B7B"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
var _excluded = ["UNSAFE_className"],
|
|
2
|
+
_excluded2 = ["defaultSelectedKey", "disabledKeys", "ref", "selectedKey"];
|
|
3
|
+
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; }
|
|
4
|
+
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; }
|
|
5
|
+
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; }
|
|
6
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
7
|
+
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); }
|
|
8
|
+
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; }
|
|
9
|
+
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; }
|
|
10
|
+
import { ComboBox as SpectrumComboBox } from '@adobe/react-spectrum';
|
|
11
|
+
import cl from 'classnames';
|
|
12
|
+
import { usePickerProps } from "../picker/index.js";
|
|
13
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
|
+
export function ComboBox(_ref) {
|
|
15
|
+
var {
|
|
16
|
+
UNSAFE_className
|
|
17
|
+
} = _ref,
|
|
18
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
19
|
+
var _usePickerProps = usePickerProps(props),
|
|
20
|
+
{
|
|
21
|
+
defaultSelectedKey,
|
|
22
|
+
disabledKeys,
|
|
23
|
+
ref,
|
|
24
|
+
selectedKey
|
|
25
|
+
} = _usePickerProps,
|
|
26
|
+
comboBoxProps = _objectWithoutProperties(_usePickerProps, _excluded2);
|
|
27
|
+
return /*#__PURE__*/_jsx(SpectrumComboBox
|
|
28
|
+
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
29
|
+
, _objectSpread(_objectSpread({}, comboBoxProps), {}, {
|
|
30
|
+
UNSAFE_className: cl('dh-combobox', UNSAFE_className),
|
|
31
|
+
ref: ref
|
|
32
|
+
// Type assertions are necessary here since Spectrum types don't account
|
|
33
|
+
// for number and boolean key values even though they are valid runtime
|
|
34
|
+
// values.
|
|
35
|
+
,
|
|
36
|
+
defaultSelectedKey: defaultSelectedKey,
|
|
37
|
+
disabledKeys: disabledKeys,
|
|
38
|
+
selectedKey: selectedKey
|
|
39
|
+
}));
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=ComboBox.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ComboBox.js","names":["ComboBox","SpectrumComboBox","cl","usePickerProps","jsx","_jsx","_ref","UNSAFE_className","props","_objectWithoutProperties","_excluded","_usePickerProps","defaultSelectedKey","disabledKeys","ref","selectedKey","comboBoxProps","_excluded2","_objectSpread"],"sources":["../../../src/spectrum/comboBox/ComboBox.tsx"],"sourcesContent":["import {\n ComboBox as SpectrumComboBox,\n SpectrumComboBoxProps,\n} from '@adobe/react-spectrum';\nimport type { FocusableRef } from '@react-types/shared';\nimport cl from 'classnames';\nimport type { NormalizedItem } from '../utils';\nimport { PickerPropsT, usePickerProps } from '../picker';\n\nexport type ComboBoxProps = PickerPropsT<SpectrumComboBoxProps<NormalizedItem>>;\n\nexport function ComboBox({\n UNSAFE_className,\n ...props\n}: ComboBoxProps): JSX.Element {\n const {\n defaultSelectedKey,\n disabledKeys,\n ref,\n selectedKey,\n ...comboBoxProps\n } = usePickerProps(props);\n\n return (\n <SpectrumComboBox\n // eslint-disable-next-line react/jsx-props-no-spreading\n {...comboBoxProps}\n UNSAFE_className={cl('dh-combobox', UNSAFE_className)}\n ref={ref as FocusableRef<HTMLElement>}\n // Type assertions are necessary here since Spectrum types don't account\n // for number and boolean key values even though they are valid runtime\n // values.\n defaultSelectedKey={\n defaultSelectedKey as SpectrumComboBoxProps<NormalizedItem>['defaultSelectedKey']\n }\n disabledKeys={\n disabledKeys as SpectrumComboBoxProps<NormalizedItem>['disabledKeys']\n }\n selectedKey={\n selectedKey as SpectrumComboBoxProps<NormalizedItem>['selectedKey']\n }\n />\n );\n}\n"],"mappings":";;;;;;;;;AAAA,SACEA,QAAQ,IAAIC,gBAAgB,QAEvB,uBAAuB;AAE9B,OAAOC,EAAE,MAAM,YAAY;AAAC,SAELC,cAAc;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAIrC,OAAO,SAASL,QAAQA,CAAAM,IAAA,EAGO;EAAA,IAHN;MACvBC;IAEa,CAAC,GAAAD,IAAA;IADXE,KAAK,GAAAC,wBAAA,CAAAH,IAAA,EAAAI,SAAA;EAER,IAAAC,eAAA,GAMIR,cAAc,CAACK,KAAK,CAAC;IANnB;MACJI,kBAAkB;MAClBC,YAAY;MACZC,GAAG;MACHC;IAEF,CAAC,GAAAJ,eAAA;IADIK,aAAa,GAAAP,wBAAA,CAAAE,eAAA,EAAAM,UAAA;EAGlB,oBACEZ,IAAA,CAACJ;EACC;EAAA,EAAAiB,aAAA,CAAAA,aAAA,KACIF,aAAa;IACjBT,gBAAgB,EAAEL,EAAE,CAAC,aAAa,EAAEK,gBAAgB,CAAE;IACtDO,GAAG,EAAEA;IACL;IACA;IACA;IAAA;IACAF,kBAAkB,EAChBA,kBACD;IACDC,YAAY,EACVA,YACD;IACDE,WAAW,EACTA;EACD,EACF,CAAC;AAEN"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { PickerNormalizedPropsT } from '../picker';
|
|
3
|
+
import { ComboBoxProps } from './ComboBox';
|
|
4
|
+
export type ComboBoxNormalizedProps = PickerNormalizedPropsT<ComboBoxProps>;
|
|
5
|
+
/**
|
|
6
|
+
* ComboBox that takes an array of `NormalizedItem` or `NormalizedSection` items
|
|
7
|
+
* as children and uses a render item function to render the items. `NormalizedItem`
|
|
8
|
+
* and `NormalizedSection` datums always provide a `key` property but have an
|
|
9
|
+
* optional `item` property that can be lazy loaded. This is necessary to support
|
|
10
|
+
* windowed data since we need a representative key for every item in the
|
|
11
|
+
* collection.
|
|
12
|
+
*/
|
|
13
|
+
export declare function ComboBoxNormalized({ UNSAFE_className, ...props }: ComboBoxNormalizedProps): JSX.Element;
|
|
14
|
+
export default ComboBoxNormalized;
|
|
15
|
+
//# sourceMappingURL=ComboBoxNormalized.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ComboBoxNormalized.d.ts","sourceRoot":"","sources":["../../../src/spectrum/comboBox/ComboBoxNormalized.tsx"],"names":[],"mappings":";AAGA,OAAO,EAAE,sBAAsB,EAA4B,MAAM,WAAW,CAAC;AAC7E,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAE3C,MAAM,MAAM,uBAAuB,GAAG,sBAAsB,CAAC,aAAa,CAAC,CAAC;AAE5E;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,EACjC,gBAAgB,EAChB,GAAG,KAAK,EACT,EAAE,uBAAuB,GAAG,GAAG,CAAC,OAAO,CAiBvC;AAED,eAAe,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
var _excluded = ["UNSAFE_className"],
|
|
2
|
+
_excluded2 = ["forceRerenderKey", "ref"];
|
|
3
|
+
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; }
|
|
4
|
+
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; }
|
|
5
|
+
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; }
|
|
6
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
7
|
+
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); }
|
|
8
|
+
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; }
|
|
9
|
+
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; }
|
|
10
|
+
import { ComboBox as SpectrumComboBox } from '@adobe/react-spectrum';
|
|
11
|
+
import cl from 'classnames';
|
|
12
|
+
import { usePickerNormalizedProps } from "../picker/index.js";
|
|
13
|
+
import { createElement as _createElement } from "react";
|
|
14
|
+
/**
|
|
15
|
+
* ComboBox that takes an array of `NormalizedItem` or `NormalizedSection` items
|
|
16
|
+
* as children and uses a render item function to render the items. `NormalizedItem`
|
|
17
|
+
* and `NormalizedSection` datums always provide a `key` property but have an
|
|
18
|
+
* optional `item` property that can be lazy loaded. This is necessary to support
|
|
19
|
+
* windowed data since we need a representative key for every item in the
|
|
20
|
+
* collection.
|
|
21
|
+
*/
|
|
22
|
+
export function ComboBoxNormalized(_ref) {
|
|
23
|
+
var {
|
|
24
|
+
UNSAFE_className
|
|
25
|
+
} = _ref,
|
|
26
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
27
|
+
var _usePickerNormalizedP = usePickerNormalizedProps(props),
|
|
28
|
+
{
|
|
29
|
+
forceRerenderKey,
|
|
30
|
+
ref
|
|
31
|
+
} = _usePickerNormalizedP,
|
|
32
|
+
pickerProps = _objectWithoutProperties(_usePickerNormalizedP, _excluded2);
|
|
33
|
+
return /*#__PURE__*/_createElement(SpectrumComboBox
|
|
34
|
+
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
35
|
+
, _objectSpread(_objectSpread({}, pickerProps), {}, {
|
|
36
|
+
key: forceRerenderKey,
|
|
37
|
+
ref: ref,
|
|
38
|
+
UNSAFE_className: cl('dh-combobox', 'dh-combobox-normalized', UNSAFE_className)
|
|
39
|
+
}));
|
|
40
|
+
}
|
|
41
|
+
export default ComboBoxNormalized;
|
|
42
|
+
//# sourceMappingURL=ComboBoxNormalized.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ComboBoxNormalized.js","names":["ComboBox","SpectrumComboBox","cl","usePickerNormalizedProps","createElement","_createElement","ComboBoxNormalized","_ref","UNSAFE_className","props","_objectWithoutProperties","_excluded","_usePickerNormalizedP","forceRerenderKey","ref","pickerProps","_excluded2","_objectSpread","key"],"sources":["../../../src/spectrum/comboBox/ComboBoxNormalized.tsx"],"sourcesContent":["import { ComboBox as SpectrumComboBox } from '@adobe/react-spectrum';\nimport { FocusableRef } from '@react-types/shared';\nimport cl from 'classnames';\nimport { PickerNormalizedPropsT, usePickerNormalizedProps } from '../picker';\nimport { ComboBoxProps } from './ComboBox';\n\nexport type ComboBoxNormalizedProps = PickerNormalizedPropsT<ComboBoxProps>;\n\n/**\n * ComboBox that takes an array of `NormalizedItem` or `NormalizedSection` items\n * as children and uses a render item function to render the items. `NormalizedItem`\n * and `NormalizedSection` datums always provide a `key` property but have an\n * optional `item` property that can be lazy loaded. This is necessary to support\n * windowed data since we need a representative key for every item in the\n * collection.\n */\nexport function ComboBoxNormalized({\n UNSAFE_className,\n ...props\n}: ComboBoxNormalizedProps): JSX.Element {\n const { forceRerenderKey, ref, ...pickerProps } =\n usePickerNormalizedProps<ComboBoxNormalizedProps>(props);\n\n return (\n <SpectrumComboBox\n // eslint-disable-next-line react/jsx-props-no-spreading\n {...pickerProps}\n key={forceRerenderKey}\n ref={ref as FocusableRef<HTMLElement>}\n UNSAFE_className={cl(\n 'dh-combobox',\n 'dh-combobox-normalized',\n UNSAFE_className\n )}\n />\n );\n}\n\nexport default ComboBoxNormalized;\n"],"mappings":";;;;;;;;;AAAA,SAASA,QAAQ,IAAIC,gBAAgB,QAAQ,uBAAuB;AAEpE,OAAOC,EAAE,MAAM,YAAY;AAAC,SACKC,wBAAwB;AAAA,SAAAC,aAAA,IAAAC,cAAA;AAKzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,kBAAkBA,CAAAC,IAAA,EAGO;EAAA,IAHN;MACjCC;IAEuB,CAAC,GAAAD,IAAA;IADrBE,KAAK,GAAAC,wBAAA,CAAAH,IAAA,EAAAI,SAAA;EAER,IAAAC,qBAAA,GACET,wBAAwB,CAA0BM,KAAK,CAAC;IADpD;MAAEI,gBAAgB;MAAEC;IAAoB,CAAC,GAAAF,qBAAA;IAAbG,WAAW,GAAAL,wBAAA,CAAAE,qBAAA,EAAAI,UAAA;EAG7C,oBACEX,cAAA,CAACJ;EACC;EAAA,EAAAgB,aAAA,CAAAA,aAAA,KACIF,WAAW;IACfG,GAAG,EAAEL,gBAAiB;IACtBC,GAAG,EAAEA,GAAiC;IACtCN,gBAAgB,EAAEN,EAAE,CAClB,aAAa,EACb,wBAAwB,EACxBM,gBACF;EAAE,EACH,CAAC;AAEN;AAEA,eAAeF,kBAAkB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/spectrum/comboBox/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,sBAAsB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../src/spectrum/comboBox/index.ts"],"sourcesContent":["export * from './ComboBox';\nexport * from './ComboBoxNormalized';\n"],"mappings":""}
|
package/dist/spectrum/index.d.ts
CHANGED
|
@@ -10,7 +10,6 @@ export * from './icons';
|
|
|
10
10
|
export * from './layout';
|
|
11
11
|
export * from './navigation';
|
|
12
12
|
export * from './overlays';
|
|
13
|
-
export * from './pickers';
|
|
14
13
|
export * from './shared';
|
|
15
14
|
export * from './status';
|
|
16
15
|
/**
|
|
@@ -18,6 +17,7 @@ export * from './status';
|
|
|
18
17
|
*/
|
|
19
18
|
export * from './ActionMenu';
|
|
20
19
|
export * from './ActionGroup';
|
|
20
|
+
export * from './comboBox';
|
|
21
21
|
export * from './ListActionGroup';
|
|
22
22
|
export * from './ListActionMenu';
|
|
23
23
|
export * from './listView';
|
|
@@ -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,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,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,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AAEzB;;GAEG;AACH,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,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"}
|
package/dist/spectrum/index.js
CHANGED
|
@@ -10,7 +10,6 @@ export * from "./icons.js";
|
|
|
10
10
|
export * from "./layout.js";
|
|
11
11
|
export * from "./navigation.js";
|
|
12
12
|
export * from "./overlays.js";
|
|
13
|
-
export * from "./pickers.js";
|
|
14
13
|
export * from "./shared.js";
|
|
15
14
|
export * from "./status.js";
|
|
16
15
|
/**
|
|
@@ -18,6 +17,7 @@ export * from "./status.js";
|
|
|
18
17
|
*/
|
|
19
18
|
export * from "./ActionMenu.js";
|
|
20
19
|
export * from "./ActionGroup.js";
|
|
20
|
+
export * from "./comboBox/index.js";
|
|
21
21
|
export * from "./ListActionGroup.js";
|
|
22
22
|
export * from "./ListActionMenu.js";
|
|
23
23
|
export * from "./listView/index.js";
|
|
@@ -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 './icons';\nexport * from './layout';\nexport * from './navigation';\nexport * from './overlays';\nexport * from './
|
|
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 './shared';\nexport * from './status';\n\n/**\n * Custom DH components wrapping React Spectrum components.\n */\nexport * from './ActionMenu';\nexport * from './ActionGroup';\nexport * from './comboBox';\nexport * from './ListActionGroup';\nexport * from './ListActionMenu';\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;AAeA;AACA;AACA;AAFA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAcA;AACA;AACA;AAFA;AAAA;AAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ListViewWrapper.js","names":["ListView","SpectrumListView","extractSpectrumHTMLElement","useContentRect","useOnScrollRef","EMPTY_FUNCTION","cl","useSpectrumThemeProvider","Flex","separateSpectrumProps","jsx","_jsx","ListViewWrapper","props","_styleProps$minHeight","_listViewProps$densit","ariaLabelProps","componentProps","styleProps","onScroll","listViewProps","_objectWithoutProperties","_excluded","scale","scrollRef","ref","contentRectRef","contentRect","_objectSpread","direction","minHeight","UNSAFE_className","concat","density","children","height"],"sources":["../../../src/spectrum/listView/ListViewWrapper.tsx"],"sourcesContent":["import {\n ListView as SpectrumListView,\n SpectrumListViewProps,\n} from '@adobe/react-spectrum';\nimport {\n extractSpectrumHTMLElement,\n useContentRect,\n useOnScrollRef,\n} from '@deephaven/react-hooks';\nimport { EMPTY_FUNCTION } from '@deephaven/utils';\nimport cl from 'classnames';\nimport { useSpectrumThemeProvider } from '../../theme';\nimport { Flex } from '../layout';\nimport { separateSpectrumProps } from '../utils';\nimport './ListViewWrapper.scss';\n\nexport interface ListViewWrapperProps<T> extends SpectrumListViewProps<T> {\n /** Handler that is called when the picker is scrolled. */\n onScroll?: (event: Event) => void;\n}\n\n/**\n * Helper component to wrap a ListView with the appropriate styling + scroll\n * handling. This is used by both the `@deephaven/components` `ListView` and\n * the `@deephaven/jsapi-components` `ListView` (via `ListViewNormalized`) to\n * ensure consistency.\n *\n * Note that This component will usually not be used directly. Instead, it is\n * recommended to use\n * - `@deephaven/components`'s `ListView` for non-table data sources\n * - `@deephaven/jsapi-components`'s `ListView` for table data sources\n */\nexport function ListViewWrapper<T>(\n props: ListViewWrapperProps<T>\n): JSX.Element {\n const { ariaLabelProps, componentProps, styleProps } =\n separateSpectrumProps(props);\n\n const { onScroll = EMPTY_FUNCTION, ...listViewProps } = componentProps;\n\n const { scale } = useSpectrumThemeProvider();\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
|
|
1
|
+
{"version":3,"file":"ListViewWrapper.js","names":["ListView","SpectrumListView","extractSpectrumHTMLElement","useContentRect","useOnScrollRef","EMPTY_FUNCTION","cl","useSpectrumThemeProvider","Flex","separateSpectrumProps","jsx","_jsx","ListViewWrapper","props","_styleProps$minHeight","_listViewProps$densit","ariaLabelProps","componentProps","styleProps","onScroll","listViewProps","_objectWithoutProperties","_excluded","scale","scrollRef","ref","contentRectRef","contentRect","_objectSpread","direction","minHeight","UNSAFE_className","concat","density","children","height"],"sources":["../../../src/spectrum/listView/ListViewWrapper.tsx"],"sourcesContent":["import {\n ListView as SpectrumListView,\n SpectrumListViewProps,\n} from '@adobe/react-spectrum';\nimport {\n extractSpectrumHTMLElement,\n useContentRect,\n useOnScrollRef,\n} from '@deephaven/react-hooks';\nimport { EMPTY_FUNCTION } from '@deephaven/utils';\nimport cl from 'classnames';\nimport { useSpectrumThemeProvider } from '../../theme';\nimport { Flex } from '../layout';\nimport { separateSpectrumProps } from '../utils';\nimport './ListViewWrapper.scss';\n\nexport interface ListViewWrapperProps<T> extends SpectrumListViewProps<T> {\n /** Handler that is called when the picker is scrolled. */\n onScroll?: (event: Event) => void;\n}\n\n/**\n * Helper component to wrap a ListView with the appropriate styling + scroll\n * handling. This is used by both the `@deephaven/components` `ListView` and\n * the `@deephaven/jsapi-components` `ListView` (via `ListViewNormalized`) to\n * ensure consistency.\n *\n * Note that This component will usually not be used directly. Instead, it is\n * recommended to use\n * - `@deephaven/components`'s `ListView` for non-table data sources\n * - `@deephaven/jsapi-components`'s `ListView` for table data sources\n */\nexport function ListViewWrapper<T>(\n props: ListViewWrapperProps<T>\n): JSX.Element {\n const { ariaLabelProps, componentProps, styleProps } =\n separateSpectrumProps(props);\n\n const { onScroll = EMPTY_FUNCTION, ...listViewProps } = componentProps;\n\n const { scale } = useSpectrumThemeProvider();\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<HTMLDivElement>\n );\n\n return (\n <Flex\n direction=\"column\"\n ref={contentRectRef}\n // eslint-disable-next-line react/jsx-props-no-spreading\n {...styleProps}\n // Set min-height to 1px so that `ListView` is rendered whenever container\n // is visible. This prevents the height from shrinking to zero as a result\n // of a parent grid or flex container calculating content sizes. The\n // container height can still be zero when it is not being displayed such\n // as when one of its parents have `display: none`.\n minHeight={styleProps.minHeight ?? 1}\n UNSAFE_className={cl(\n 'dh-list-view-wrapper',\n `dh-list-view-wrapper-density-${listViewProps.density ?? 'regular'}`,\n `dh-list-view-wrapper-scale-${scale}`,\n styleProps.UNSAFE_className\n )}\n >\n {/**\n * Only render ListView if parent is visible. Some time in the future we\n * should consider using `checkVisibility()` once it has better browser\n * support.\n */}\n {contentRect.height === 0 ? null : (\n <SpectrumListView\n ref={scrollRef}\n // eslint-disable-next-line react/jsx-props-no-spreading\n {...ariaLabelProps}\n // eslint-disable-next-line react/jsx-props-no-spreading\n {...listViewProps}\n />\n )}\n </Flex>\n );\n}\n\nexport default ListViewWrapper;\n"],"mappings":";;;;;;;;AAAA,SACEA,QAAQ,IAAIC,gBAAgB,QAEvB,uBAAuB;AAC9B,SACEC,0BAA0B,EAC1BC,cAAc,EACdC,cAAc,QACT,wBAAwB;AAC/B,SAASC,cAAc,QAAQ,kBAAkB;AACjD,OAAOC,EAAE,MAAM,YAAY;AAAC,SACnBC,wBAAwB;AAAA,SACxBC,IAAI;AAAA,SACJC,qBAAqB;AAAA;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAQ9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,eAAeA,CAC7BC,KAA8B,EACjB;EAAA,IAAAC,qBAAA,EAAAC,qBAAA;EACb,IAAM;IAAEC,cAAc;IAAEC,cAAc;IAAEC;EAAW,CAAC,GAClDT,qBAAqB,CAACI,KAAK,CAAC;EAE9B,IAAM;MAAEM,QAAQ,GAAGd;IAAiC,CAAC,GAAGY,cAAc;IAAhCG,aAAa,GAAAC,wBAAA,CAAKJ,cAAc,EAAAK,SAAA;EAEtE,IAAM;IAAEC;EAAM,CAAC,GAAGhB,wBAAwB,CAAC,CAAC;EAE5C,IAAMiB,SAAS,GAAGpB,cAAc,CAACe,QAAQ,EAAEjB,0BAA0B,CAAC;;EAEtE;EACA;EACA;EACA,IAAM;IAAEuB,GAAG,EAAEC,cAAc;IAAEC;EAAY,CAAC,GAAGxB,cAAc,CACzDD,0BACF,CAAC;EAED,oBACES,IAAA,CAACH,IAAI,EAAAoB,aAAA,CAAAA,aAAA;IACHC,SAAS,EAAC,QAAQ;IAClBJ,GAAG,EAAEC;IACL;EAAA,GACIR,UAAU;IACd;IACA;IACA;IACA;IACA;IACAY,SAAS,GAAAhB,qBAAA,GAAEI,UAAU,CAACY,SAAS,cAAAhB,qBAAA,cAAAA,qBAAA,GAAI,CAAE;IACrCiB,gBAAgB,EAAEzB,EAAE,CAClB,sBAAsB,kCAAA0B,MAAA,EAAAjB,qBAAA,GACUK,aAAa,CAACa,OAAO,cAAAlB,qBAAA,cAAAA,qBAAA,GAAI,SAAS,iCAAAiB,MAAA,CACpCT,KAAK,GACnCL,UAAU,CAACa,gBACb,CAAE;IAAAG,QAAA,EAODP,WAAW,CAACQ,MAAM,KAAK,CAAC,GAAG,IAAI,gBAC9BxB,IAAA,CAACV,gBAAgB,EAAA2B,aAAA,CAAAA,aAAA;MACfH,GAAG,EAAED;MACL;IAAA,GACIR,cAAc,GAEdI,aAAa,CAClB;EACF,EACG,CAAC;AAEX;AAEA,eAAeR,eAAe"}
|
|
@@ -1,28 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import {
|
|
3
|
-
export type PickerProps = {
|
|
4
|
-
children: ItemOrSection | ItemOrSection[];
|
|
5
|
-
/** Can be set to true or a TooltipOptions to enable item tooltips */
|
|
6
|
-
tooltip?: boolean | TooltipOptions;
|
|
7
|
-
/** The currently selected key in the collection (controlled). */
|
|
8
|
-
selectedKey?: ItemKey | null;
|
|
9
|
-
/** The initial selected key in the collection (uncontrolled). */
|
|
10
|
-
defaultSelectedKey?: 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?: (key: ItemKey) => 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?: (key: ItemKey) => void;
|
|
25
|
-
} & Omit<NormalizedSpectrumPickerProps, 'children' | 'items' | 'onSelectionChange' | 'selectedKey' | 'defaultSelectedKey'>;
|
|
2
|
+
import type { PickerProps } from './PickerProps';
|
|
26
3
|
/**
|
|
27
4
|
* Picker component for selecting items from a list of items. Items can be
|
|
28
5
|
* provided via the `children` prop. Each item can be a string, number, boolean,
|
|
@@ -30,6 +7,6 @@ export type PickerProps = {
|
|
|
30
7
|
* for the Spectrum Picker component.
|
|
31
8
|
* See https://react-spectrum.adobe.com/react-spectrum/Picker.html
|
|
32
9
|
*/
|
|
33
|
-
export declare function Picker({
|
|
10
|
+
export declare function Picker({ UNSAFE_className, ...props }: PickerProps): JSX.Element;
|
|
34
11
|
export default Picker;
|
|
35
12
|
//# sourceMappingURL=Picker.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Picker.d.ts","sourceRoot":"","sources":["../../../src/spectrum/picker/Picker.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"Picker.d.ts","sourceRoot":"","sources":["../../../src/spectrum/picker/Picker.tsx"],"names":[],"mappings":";AAMA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAGjD;;;;;;GAMG;AACH,wBAAgB,MAAM,CAAC,EACrB,gBAAgB,EAChB,GAAG,KAAK,EACT,EAAE,WAAW,GAAG,GAAG,CAAC,OAAO,CAuB3B;AAED,eAAe,MAAM,CAAC"}
|
|
@@ -1,22 +1,15 @@
|
|
|
1
|
-
var _excluded = ["
|
|
1
|
+
var _excluded = ["UNSAFE_className"],
|
|
2
|
+
_excluded2 = ["defaultSelectedKey", "disabledKeys", "selectedKey"];
|
|
2
3
|
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
4
|
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
5
|
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
6
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
6
7
|
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 asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
8
|
-
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
9
8
|
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; }
|
|
10
9
|
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; }
|
|
11
|
-
import { useCallback, useMemo, useState } from 'react';
|
|
12
10
|
import { Picker as SpectrumPicker } from '@adobe/react-spectrum';
|
|
13
11
|
import cl from 'classnames';
|
|
14
|
-
import {
|
|
15
|
-
import { getPositionOfSelectedItemElement, normalizeTooltipOptions, isItemElementWithDescription, isSectionElement } from "../utils/itemUtils.js";
|
|
16
|
-
import { wrapItemChildren } from "../utils/itemWrapperUtils.js";
|
|
17
|
-
import usePickerScrollOnOpen from "./usePickerScrollOnOpen.js";
|
|
18
|
-
import { useSpectrumThemeProvider } from "../../theme/index.js";
|
|
19
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
|
+
import { usePickerProps } from "./usePickerProps.js";
|
|
20
13
|
/**
|
|
21
14
|
* Picker component for selecting items from a list of items. Items can be
|
|
22
15
|
* provided via the `children` prop. Each item can be a string, number, boolean,
|
|
@@ -24,71 +17,30 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
24
17
|
* for the Spectrum Picker component.
|
|
25
18
|
* See https://react-spectrum.adobe.com/react-spectrum/Picker.html
|
|
26
19
|
*/
|
|
20
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
27
21
|
export function Picker(_ref) {
|
|
28
22
|
var {
|
|
29
|
-
children,
|
|
30
|
-
tooltip = true,
|
|
31
|
-
defaultSelectedKey,
|
|
32
|
-
selectedKey,
|
|
33
|
-
onChange,
|
|
34
|
-
onOpenChange,
|
|
35
|
-
onScroll = EMPTY_FUNCTION,
|
|
36
|
-
onSelectionChange,
|
|
37
|
-
// eslint-disable-next-line camelcase
|
|
38
23
|
UNSAFE_className
|
|
39
24
|
} = _ref,
|
|
40
|
-
|
|
41
|
-
var
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
// for explicit `undefined` to identify uncontrolled mode.
|
|
49
|
-
var isUncontrolled = selectedKey === undefined;
|
|
50
|
-
var [uncontrolledSelectedKey, setUncontrolledSelectedKey] = useState(defaultSelectedKey);
|
|
51
|
-
var wrappedItems = useMemo(() => ensureArray(wrapItemChildren(children, tooltipOptions)), [children, tooltipOptions]);
|
|
52
|
-
|
|
53
|
-
// Item descriptions and Section elements introduce variable item heights.
|
|
54
|
-
// This throws off scroll position calculations, so we disable auto scrolling
|
|
55
|
-
// if either of these are found.
|
|
56
|
-
var disableScrollOnOpen = useMemo(() => wrappedItems.some(item => isSectionElement(item) || isItemElementWithDescription(item)), [wrappedItems]);
|
|
57
|
-
var getInitialScrollPosition = useCallback( /*#__PURE__*/_asyncToGenerator(function* () {
|
|
58
|
-
return disableScrollOnOpen ? null : getPositionOfSelectedItemElement({
|
|
59
|
-
items: wrappedItems,
|
|
60
|
-
itemHeight,
|
|
61
|
-
selectedKey: isUncontrolled ? uncontrolledSelectedKey : selectedKey,
|
|
62
|
-
topOffset: PICKER_TOP_OFFSET
|
|
63
|
-
});
|
|
64
|
-
}), [disableScrollOnOpen, isUncontrolled, itemHeight, selectedKey, uncontrolledSelectedKey, wrappedItems]);
|
|
65
|
-
var onSelectionChangeInternal = useCallback(key => {
|
|
66
|
-
var _ref3;
|
|
67
|
-
// If our component is uncontrolled, track the selected key internally
|
|
68
|
-
// so that we can scroll to the selected item if the user re-opens
|
|
69
|
-
if (isUncontrolled) {
|
|
70
|
-
setUncontrolledSelectedKey(key);
|
|
71
|
-
}
|
|
72
|
-
(_ref3 = onChange !== null && onChange !== void 0 ? onChange : onSelectionChange) === null || _ref3 === void 0 ? void 0 : _ref3(key);
|
|
73
|
-
}, [isUncontrolled, onChange, onSelectionChange]);
|
|
74
|
-
var {
|
|
75
|
-
ref: scrollRef,
|
|
76
|
-
onOpenChange: onOpenChangeInternal
|
|
77
|
-
} = usePickerScrollOnOpen({
|
|
78
|
-
getInitialScrollPosition,
|
|
79
|
-
onScroll,
|
|
80
|
-
onOpenChange
|
|
81
|
-
});
|
|
25
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
26
|
+
var _usePickerProps = usePickerProps(props),
|
|
27
|
+
{
|
|
28
|
+
defaultSelectedKey,
|
|
29
|
+
disabledKeys,
|
|
30
|
+
selectedKey
|
|
31
|
+
} = _usePickerProps,
|
|
32
|
+
pickerProps = _objectWithoutProperties(_usePickerProps, _excluded2);
|
|
82
33
|
return /*#__PURE__*/_jsx(SpectrumPicker
|
|
83
34
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
84
|
-
, _objectSpread(_objectSpread({},
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
35
|
+
, _objectSpread(_objectSpread({}, pickerProps), {}, {
|
|
36
|
+
UNSAFE_className: cl('dh-picker', UNSAFE_className)
|
|
37
|
+
// Type assertions are necessary here since Spectrum types don't account
|
|
38
|
+
// for number and boolean key values even though they are valid runtime
|
|
39
|
+
// values.
|
|
40
|
+
,
|
|
88
41
|
defaultSelectedKey: defaultSelectedKey,
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
children: wrappedItems
|
|
42
|
+
disabledKeys: disabledKeys,
|
|
43
|
+
selectedKey: selectedKey
|
|
92
44
|
}));
|
|
93
45
|
}
|
|
94
46
|
export default Picker;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Picker.js","names":["
|
|
1
|
+
{"version":3,"file":"Picker.js","names":["Picker","SpectrumPicker","cl","usePickerProps","jsx","_jsx","_ref","UNSAFE_className","props","_objectWithoutProperties","_excluded","_usePickerProps","defaultSelectedKey","disabledKeys","selectedKey","pickerProps","_excluded2","_objectSpread"],"sources":["../../../src/spectrum/picker/Picker.tsx"],"sourcesContent":["import {\n Picker as SpectrumPicker,\n SpectrumPickerProps,\n} from '@adobe/react-spectrum';\nimport cl from 'classnames';\nimport type { NormalizedItem } from '../utils';\nimport type { PickerProps } from './PickerProps';\nimport { usePickerProps } from './usePickerProps';\n\n/**\n * Picker component for selecting items from a list of items. Items can be\n * provided via the `children` prop. Each item can be a string,\tnumber, boolean,\n * or a Spectrum <Item> element. The remaining props are just\tpass through props\n * for the Spectrum Picker component.\n * See https://react-spectrum.adobe.com/react-spectrum/Picker.html\n */\nexport function Picker({\n UNSAFE_className,\n ...props\n}: PickerProps): JSX.Element {\n const { defaultSelectedKey, disabledKeys, selectedKey, ...pickerProps } =\n usePickerProps<PickerProps, HTMLDivElement>(props);\n\n return (\n <SpectrumPicker\n // eslint-disable-next-line react/jsx-props-no-spreading\n {...pickerProps}\n UNSAFE_className={cl('dh-picker', UNSAFE_className)}\n // Type assertions are necessary here since Spectrum types don't account\n // for number and boolean key values even though they are valid runtime\n // values.\n defaultSelectedKey={\n defaultSelectedKey as SpectrumPickerProps<NormalizedItem>['defaultSelectedKey']\n }\n disabledKeys={\n disabledKeys as SpectrumPickerProps<NormalizedItem>['disabledKeys']\n }\n selectedKey={\n selectedKey as SpectrumPickerProps<NormalizedItem>['selectedKey']\n }\n />\n );\n}\n\nexport default Picker;\n"],"mappings":";;;;;;;;;AAAA,SACEA,MAAM,IAAIC,cAAc,QAEnB,uBAAuB;AAC9B,OAAOC,EAAE,MAAM,YAAY;AAAC,SAGnBC,cAAc;AAEvB;AACA;AACA;AACA;AACA;AACA;AACA;AANA,SAAAC,GAAA,IAAAC,IAAA;AAOA,OAAO,SAASL,MAAMA,CAAAM,IAAA,EAGO;EAAA,IAHN;MACrBC;IAEW,CAAC,GAAAD,IAAA;IADTE,KAAK,GAAAC,wBAAA,CAAAH,IAAA,EAAAI,SAAA;EAER,IAAAC,eAAA,GACER,cAAc,CAA8BK,KAAK,CAAC;IAD9C;MAAEI,kBAAkB;MAAEC,YAAY;MAAEC;IAA4B,CAAC,GAAAH,eAAA;IAAbI,WAAW,GAAAN,wBAAA,CAAAE,eAAA,EAAAK,UAAA;EAGrE,oBACEX,IAAA,CAACJ;EACC;EAAA,EAAAgB,aAAA,CAAAA,aAAA,KACIF,WAAW;IACfR,gBAAgB,EAAEL,EAAE,CAAC,WAAW,EAAEK,gBAAgB;IAClD;IACA;IACA;IAAA;IACAK,kBAAkB,EAChBA,kBACD;IACDC,YAAY,EACVA,YACD;IACDC,WAAW,EACTA;EACD,EACF,CAAC;AAEN;AAEA,eAAed,MAAM"}
|