@osdk/react-components 0.2.0-beta.27 → 0.2.0-beta.29
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/CHANGELOG.md +15 -0
- package/README.md +58 -3
- package/build/browser/action-form/FormFieldApi.js.map +1 -1
- package/build/browser/action-form/fields/FormFieldRenderer.js +8 -0
- package/build/browser/action-form/fields/FormFieldRenderer.js.map +1 -1
- package/build/browser/action-form/fields/NumberInputField.js +130 -0
- package/build/browser/action-form/fields/NumberInputField.js.map +1 -0
- package/build/browser/action-form/fields/NumberInputField.module.css +96 -0
- package/build/browser/action-form/fields/NumberInputField.module.css.js +9 -0
- package/build/browser/base-components/checkbox/Checkbox.js +6 -2
- package/build/browser/base-components/checkbox/Checkbox.js.map +1 -1
- package/build/browser/base-components/checkbox/Checkbox.module.css +15 -2
- package/build/browser/base-components/combobox/Combobox.js +14 -1
- package/build/browser/base-components/combobox/Combobox.js.map +1 -1
- package/build/browser/base-components/combobox/Combobox.module.css +16 -6
- package/build/browser/base-components/combobox/Combobox.module.css.js +1 -0
- package/build/browser/base-components/searchable-menu/SearchableMenu.js +86 -0
- package/build/browser/base-components/searchable-menu/SearchableMenu.js.map +1 -0
- package/build/browser/base-components/searchable-menu/SearchableMenu.module.css +80 -0
- package/build/browser/base-components/searchable-menu/SearchableMenu.module.css.js +10 -0
- package/build/browser/filter-list/FilterList.js +3 -1
- package/build/browser/filter-list/FilterList.js.map +1 -1
- package/build/browser/filter-list/FilterListApi.js.map +1 -1
- package/build/browser/filter-list/FilterListItemApi.js.map +1 -1
- package/build/browser/filter-list/base/AddFilterPopover.js +10 -21
- package/build/browser/filter-list/base/AddFilterPopover.js.map +1 -1
- package/build/browser/filter-list/base/AddFilterPopover.module.css +6 -40
- package/build/browser/filter-list/base/AddFilterPopover.module.css.js +1 -4
- package/build/browser/filter-list/base/BaseFilterList.js +4 -2
- package/build/browser/filter-list/base/BaseFilterList.js.map +1 -1
- package/build/browser/filter-list/base/ExcludeDropdown.js +4 -3
- package/build/browser/filter-list/base/ExcludeDropdown.js.map +1 -1
- package/build/browser/filter-list/base/ExcludeDropdown.module.css +7 -5
- package/build/browser/filter-list/base/FilterIcons.js +9 -3
- package/build/browser/filter-list/base/FilterIcons.js.map +1 -1
- package/build/browser/filter-list/base/FilterInputExcludeRow.js +14 -2
- package/build/browser/filter-list/base/FilterInputExcludeRow.js.map +1 -1
- package/build/browser/filter-list/base/FilterList.module.css +19 -6
- package/build/browser/filter-list/base/FilterList.module.css.js +1 -0
- package/build/browser/filter-list/base/FilterListContent.js +38 -17
- package/build/browser/filter-list/base/FilterListContent.js.map +1 -1
- package/build/browser/filter-list/base/FilterListHeader.js +1 -1
- package/build/browser/filter-list/base/FilterListHeader.js.map +1 -1
- package/build/browser/filter-list/base/FilterListHeader.module.css +8 -3
- package/build/browser/filter-list/base/FilterListItem.js +33 -1
- package/build/browser/filter-list/base/FilterListItem.js.map +1 -1
- package/build/browser/filter-list/base/FilterListItem.module.css +15 -6
- package/build/browser/filter-list/base/FilterListItem.module.css.js +1 -0
- package/build/browser/filter-list/base/SortableFilterListItem.js +3 -2
- package/build/browser/filter-list/base/SortableFilterListItem.js.map +1 -1
- package/build/browser/filter-list/base/inputs/ListogramInput.js +26 -11
- package/build/browser/filter-list/base/inputs/ListogramInput.js.map +1 -1
- package/build/browser/filter-list/base/inputs/ListogramInput.module.css +31 -0
- package/build/browser/filter-list/base/inputs/ListogramInput.module.css.js +2 -0
- package/build/browser/filter-list/base/inputs/MultiSelectInput.js +26 -43
- package/build/browser/filter-list/base/inputs/MultiSelectInput.js.map +1 -1
- package/build/browser/filter-list/base/inputs/MultiSelectInput.module.css +7 -8
- package/build/browser/filter-list/base/inputs/MultiSelectInput.module.css.js +1 -2
- package/build/browser/filter-list/base/inputs/NullValueWrapper.js +1 -1
- package/build/browser/filter-list/base/inputs/NullValueWrapper.js.map +1 -1
- package/build/browser/filter-list/base/inputs/RangeInput.js +5 -3
- package/build/browser/filter-list/base/inputs/RangeInput.js.map +1 -1
- package/build/browser/filter-list/base/inputs/RangeInput.module.css +7 -7
- package/build/browser/filter-list/base/inputs/SingleSelectInput.js +21 -30
- package/build/browser/filter-list/base/inputs/SingleSelectInput.js.map +1 -1
- package/build/browser/filter-list/base/inputs/SingleSelectInput.module.css +13 -23
- package/build/browser/filter-list/base/inputs/SingleSelectInput.module.css.js +3 -1
- package/build/browser/filter-list/base/inputs/index.js +0 -1
- package/build/browser/filter-list/base/inputs/index.js.map +1 -1
- package/build/browser/filter-list/hooks/useFilterListState.js +16 -12
- package/build/browser/filter-list/hooks/useFilterListState.js.map +1 -1
- package/build/browser/filter-list/hooks/usePropertyAggregation.js +7 -2
- package/build/browser/filter-list/hooks/usePropertyAggregation.js.map +1 -1
- package/build/browser/filter-list/inputs/ContainsTextFilterInput.js +1 -1
- package/build/browser/filter-list/inputs/ContainsTextFilterInput.js.map +1 -1
- package/build/browser/filter-list/inputs/LinkedPropertyInput.js +0 -35
- package/build/browser/filter-list/inputs/LinkedPropertyInput.js.map +1 -1
- package/build/browser/filter-list/inputs/ListogramFilterInput.js +14 -3
- package/build/browser/filter-list/inputs/ListogramFilterInput.js.map +1 -1
- package/build/browser/filter-list/inputs/MultiSelectFilterInput.js +9 -1
- package/build/browser/filter-list/inputs/MultiSelectFilterInput.js.map +1 -1
- package/build/browser/filter-list/inputs/PropertyFilterInput.js +1 -14
- package/build/browser/filter-list/inputs/PropertyFilterInput.js.map +1 -1
- package/build/browser/filter-list/inputs/SingleSelectFilterInput.js +9 -1
- package/build/browser/filter-list/inputs/SingleSelectFilterInput.js.map +1 -1
- package/build/browser/filter-list/inputs/TextTagsFilterInput.js +9 -1
- package/build/browser/filter-list/inputs/TextTagsFilterInput.js.map +1 -1
- package/build/browser/filter-list/utils/filterStateToWhereClause.js +2 -7
- package/build/browser/filter-list/utils/filterStateToWhereClause.js.map +1 -1
- package/build/browser/object-table/ColumnConfigDialog.module.css +1 -2
- package/build/browser/object-table/MultiColumnSortDialog.js +22 -59
- package/build/browser/object-table/MultiColumnSortDialog.js.map +1 -1
- package/build/browser/object-table/MultiColumnSortDialog.module.css +0 -64
- package/build/browser/object-table/MultiColumnSortDialog.module.css.js +0 -5
- package/build/browser/styles.css +324 -272
- package/build/cjs/public/experimental.cjs +1673 -1605
- package/build/cjs/public/experimental.cjs.map +1 -1
- package/build/cjs/public/experimental.css +501 -462
- package/build/cjs/public/experimental.css.map +1 -1
- package/build/cjs/public/experimental.d.cts +31 -26
- package/build/esm/action-form/FormFieldApi.js.map +1 -1
- package/build/esm/action-form/fields/FormFieldRenderer.js +8 -0
- package/build/esm/action-form/fields/FormFieldRenderer.js.map +1 -1
- package/build/esm/action-form/fields/NumberInputField.js +130 -0
- package/build/esm/action-form/fields/NumberInputField.js.map +1 -0
- package/build/esm/action-form/fields/NumberInputField.module.css +96 -0
- package/build/esm/base-components/checkbox/Checkbox.js +6 -2
- package/build/esm/base-components/checkbox/Checkbox.js.map +1 -1
- package/build/esm/base-components/checkbox/Checkbox.module.css +15 -2
- package/build/esm/base-components/combobox/Combobox.js +14 -1
- package/build/esm/base-components/combobox/Combobox.js.map +1 -1
- package/build/esm/base-components/combobox/Combobox.module.css +16 -6
- package/build/esm/base-components/searchable-menu/SearchableMenu.js +86 -0
- package/build/esm/base-components/searchable-menu/SearchableMenu.js.map +1 -0
- package/build/esm/base-components/searchable-menu/SearchableMenu.module.css +80 -0
- package/build/esm/filter-list/FilterList.js +3 -1
- package/build/esm/filter-list/FilterList.js.map +1 -1
- package/build/esm/filter-list/FilterListApi.js.map +1 -1
- package/build/esm/filter-list/FilterListItemApi.js.map +1 -1
- package/build/esm/filter-list/base/AddFilterPopover.js +10 -21
- package/build/esm/filter-list/base/AddFilterPopover.js.map +1 -1
- package/build/esm/filter-list/base/AddFilterPopover.module.css +6 -40
- package/build/esm/filter-list/base/BaseFilterList.js +4 -2
- package/build/esm/filter-list/base/BaseFilterList.js.map +1 -1
- package/build/esm/filter-list/base/ExcludeDropdown.js +4 -3
- package/build/esm/filter-list/base/ExcludeDropdown.js.map +1 -1
- package/build/esm/filter-list/base/ExcludeDropdown.module.css +7 -5
- package/build/esm/filter-list/base/FilterIcons.js +9 -3
- package/build/esm/filter-list/base/FilterIcons.js.map +1 -1
- package/build/esm/filter-list/base/FilterInputExcludeRow.js +14 -2
- package/build/esm/filter-list/base/FilterInputExcludeRow.js.map +1 -1
- package/build/esm/filter-list/base/FilterList.module.css +19 -6
- package/build/esm/filter-list/base/FilterListContent.js +38 -17
- package/build/esm/filter-list/base/FilterListContent.js.map +1 -1
- package/build/esm/filter-list/base/FilterListHeader.js +1 -1
- package/build/esm/filter-list/base/FilterListHeader.js.map +1 -1
- package/build/esm/filter-list/base/FilterListHeader.module.css +8 -3
- package/build/esm/filter-list/base/FilterListItem.js +33 -1
- package/build/esm/filter-list/base/FilterListItem.js.map +1 -1
- package/build/esm/filter-list/base/FilterListItem.module.css +15 -6
- package/build/esm/filter-list/base/SortableFilterListItem.js +3 -2
- package/build/esm/filter-list/base/SortableFilterListItem.js.map +1 -1
- package/build/esm/filter-list/base/inputs/ListogramInput.js +26 -11
- package/build/esm/filter-list/base/inputs/ListogramInput.js.map +1 -1
- package/build/esm/filter-list/base/inputs/ListogramInput.module.css +31 -0
- package/build/esm/filter-list/base/inputs/MultiSelectInput.js +26 -43
- package/build/esm/filter-list/base/inputs/MultiSelectInput.js.map +1 -1
- package/build/esm/filter-list/base/inputs/MultiSelectInput.module.css +7 -8
- package/build/esm/filter-list/base/inputs/NullValueWrapper.js +1 -1
- package/build/esm/filter-list/base/inputs/NullValueWrapper.js.map +1 -1
- package/build/esm/filter-list/base/inputs/RangeInput.js +5 -3
- package/build/esm/filter-list/base/inputs/RangeInput.js.map +1 -1
- package/build/esm/filter-list/base/inputs/RangeInput.module.css +7 -7
- package/build/esm/filter-list/base/inputs/SingleSelectInput.js +21 -30
- package/build/esm/filter-list/base/inputs/SingleSelectInput.js.map +1 -1
- package/build/esm/filter-list/base/inputs/SingleSelectInput.module.css +13 -23
- package/build/esm/filter-list/base/inputs/index.js +0 -1
- package/build/esm/filter-list/base/inputs/index.js.map +1 -1
- package/build/esm/filter-list/hooks/useFilterListState.js +16 -12
- package/build/esm/filter-list/hooks/useFilterListState.js.map +1 -1
- package/build/esm/filter-list/hooks/usePropertyAggregation.js +7 -2
- package/build/esm/filter-list/hooks/usePropertyAggregation.js.map +1 -1
- package/build/esm/filter-list/inputs/ContainsTextFilterInput.js +1 -1
- package/build/esm/filter-list/inputs/ContainsTextFilterInput.js.map +1 -1
- package/build/esm/filter-list/inputs/LinkedPropertyInput.js +0 -35
- package/build/esm/filter-list/inputs/LinkedPropertyInput.js.map +1 -1
- package/build/esm/filter-list/inputs/ListogramFilterInput.js +14 -3
- package/build/esm/filter-list/inputs/ListogramFilterInput.js.map +1 -1
- package/build/esm/filter-list/inputs/MultiSelectFilterInput.js +9 -1
- package/build/esm/filter-list/inputs/MultiSelectFilterInput.js.map +1 -1
- package/build/esm/filter-list/inputs/PropertyFilterInput.js +1 -14
- package/build/esm/filter-list/inputs/PropertyFilterInput.js.map +1 -1
- package/build/esm/filter-list/inputs/SingleSelectFilterInput.js +9 -1
- package/build/esm/filter-list/inputs/SingleSelectFilterInput.js.map +1 -1
- package/build/esm/filter-list/inputs/TextTagsFilterInput.js +9 -1
- package/build/esm/filter-list/inputs/TextTagsFilterInput.js.map +1 -1
- package/build/esm/filter-list/utils/filterStateToWhereClause.js +2 -7
- package/build/esm/filter-list/utils/filterStateToWhereClause.js.map +1 -1
- package/build/esm/object-table/ColumnConfigDialog.module.css +1 -2
- package/build/esm/object-table/MultiColumnSortDialog.js +22 -59
- package/build/esm/object-table/MultiColumnSortDialog.js.map +1 -1
- package/build/esm/object-table/MultiColumnSortDialog.module.css +0 -64
- package/build/types/action-form/FormFieldApi.d.ts +22 -4
- package/build/types/action-form/FormFieldApi.d.ts.map +1 -1
- package/build/types/action-form/fields/FormFieldRenderer.d.ts.map +1 -1
- package/build/types/action-form/fields/NumberInputField.d.ts +3 -0
- package/build/types/action-form/fields/NumberInputField.d.ts.map +1 -0
- package/build/types/base-components/checkbox/Checkbox.d.ts +2 -1
- package/build/types/base-components/checkbox/Checkbox.d.ts.map +1 -1
- package/build/types/base-components/combobox/Combobox.d.ts +6 -1
- package/build/types/base-components/combobox/Combobox.d.ts.map +1 -1
- package/build/types/base-components/searchable-menu/SearchableMenu.d.ts +18 -0
- package/build/types/base-components/searchable-menu/SearchableMenu.d.ts.map +1 -0
- package/build/types/filter-list/FilterListApi.d.ts +0 -7
- package/build/types/filter-list/FilterListApi.d.ts.map +1 -1
- package/build/types/filter-list/FilterListItemApi.d.ts +10 -7
- package/build/types/filter-list/FilterListItemApi.d.ts.map +1 -1
- package/build/types/filter-list/base/AddFilterPopover.d.ts.map +1 -1
- package/build/types/filter-list/base/ExcludeDropdown.d.ts.map +1 -1
- package/build/types/filter-list/base/FilterIcons.d.ts +1 -0
- package/build/types/filter-list/base/FilterIcons.d.ts.map +1 -1
- package/build/types/filter-list/base/FilterInputExcludeRow.d.ts +2 -1
- package/build/types/filter-list/base/FilterInputExcludeRow.d.ts.map +1 -1
- package/build/types/filter-list/base/FilterListContent.d.ts.map +1 -1
- package/build/types/filter-list/base/FilterListItem.d.ts.map +1 -1
- package/build/types/filter-list/base/SortableFilterListItem.d.ts +2 -1
- package/build/types/filter-list/base/SortableFilterListItem.d.ts.map +1 -1
- package/build/types/filter-list/base/inputs/ListogramInput.d.ts +2 -1
- package/build/types/filter-list/base/inputs/ListogramInput.d.ts.map +1 -1
- package/build/types/filter-list/base/inputs/MultiSelectInput.d.ts +1 -3
- package/build/types/filter-list/base/inputs/MultiSelectInput.d.ts.map +1 -1
- package/build/types/filter-list/base/inputs/RangeInput.d.ts.map +1 -1
- package/build/types/filter-list/base/inputs/SingleSelectInput.d.ts.map +1 -1
- package/build/types/filter-list/base/inputs/index.d.ts +0 -1
- package/build/types/filter-list/base/inputs/index.d.ts.map +1 -1
- package/build/types/filter-list/hooks/useFilterListState.d.ts +1 -0
- package/build/types/filter-list/hooks/useFilterListState.d.ts.map +1 -1
- package/build/types/filter-list/hooks/usePropertyAggregation.d.ts +1 -0
- package/build/types/filter-list/hooks/usePropertyAggregation.d.ts.map +1 -1
- package/build/types/filter-list/inputs/LinkedPropertyInput.d.ts.map +1 -1
- package/build/types/filter-list/inputs/ListogramFilterInput.d.ts.map +1 -1
- package/build/types/filter-list/inputs/MultiSelectFilterInput.d.ts.map +1 -1
- package/build/types/filter-list/inputs/PropertyFilterInput.d.ts.map +1 -1
- package/build/types/filter-list/inputs/SingleSelectFilterInput.d.ts.map +1 -1
- package/build/types/filter-list/inputs/TextTagsFilterInput.d.ts.map +1 -1
- package/build/types/filter-list/utils/filterStateToWhereClause.d.ts +1 -1
- package/build/types/filter-list/utils/filterStateToWhereClause.d.ts.map +1 -1
- package/build/types/object-table/MultiColumnSortDialog.d.ts.map +1 -1
- package/package.json +5 -5
- package/build/browser/filter-list/base/inputs/CheckboxListInput.js +0 -83
- package/build/browser/filter-list/base/inputs/CheckboxListInput.js.map +0 -1
- package/build/browser/filter-list/base/inputs/CheckboxListInput.module.css +0 -65
- package/build/browser/filter-list/base/inputs/CheckboxListInput.module.css.js +0 -10
- package/build/browser/filter-list/base/inputs/CheckboxListSkeleton.js +0 -46
- package/build/browser/filter-list/base/inputs/CheckboxListSkeleton.js.map +0 -1
- package/build/browser/filter-list/base/inputs/CheckboxListSkeleton.module.css +0 -32
- package/build/browser/filter-list/base/inputs/CheckboxListSkeleton.module.css.js +0 -8
- package/build/browser/filter-list/inputs/CheckboxListFilterInput.js +0 -66
- package/build/browser/filter-list/inputs/CheckboxListFilterInput.js.map +0 -1
- package/build/esm/filter-list/base/inputs/CheckboxListInput.js +0 -83
- package/build/esm/filter-list/base/inputs/CheckboxListInput.js.map +0 -1
- package/build/esm/filter-list/base/inputs/CheckboxListInput.module.css +0 -65
- package/build/esm/filter-list/base/inputs/CheckboxListSkeleton.js +0 -46
- package/build/esm/filter-list/base/inputs/CheckboxListSkeleton.js.map +0 -1
- package/build/esm/filter-list/base/inputs/CheckboxListSkeleton.module.css +0 -32
- package/build/esm/filter-list/inputs/CheckboxListFilterInput.js +0 -66
- package/build/esm/filter-list/inputs/CheckboxListFilterInput.js.map +0 -1
- package/build/types/filter-list/base/inputs/CheckboxListInput.d.ts +0 -16
- package/build/types/filter-list/base/inputs/CheckboxListInput.d.ts.map +0 -1
- package/build/types/filter-list/base/inputs/CheckboxListSkeleton.d.ts +0 -2
- package/build/types/filter-list/base/inputs/CheckboxListSkeleton.d.ts.map +0 -1
- package/build/types/filter-list/inputs/CheckboxListFilterInput.d.ts +0 -17
- package/build/types/filter-list/inputs/CheckboxListFilterInput.d.ts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Combobox.js","names":["Combobox","BaseUICombobox","Cross","Search","classnames","React","styles","ComboboxSearchInput","className","rest","createElement","osdkComboboxInputWrapper","osdkComboboxSearchIcon","Input","_extends","osdkComboboxInput","ComboboxInput","ComboboxPositioner","children","Positioner","osdkComboboxPositioner","sideOffset","ComboboxPopup","Popup","osdkComboboxPopup","ComboboxItem","Item","osdkComboboxItem","ComboboxChips","Chips","render","props","ComboboxChip","Chip","osdkComboboxChip","ComboboxChipRemove","ChipRemove","osdkComboboxChipRemove","ComboboxClear","Clear","osdkComboboxClear","ComboboxEmpty","Empty","osdkComboboxEmpty","ComboboxList","List","osdkComboboxList","Root","SearchInput","Portal","Value"],"sources":["Combobox.tsx"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n Combobox as BaseUICombobox,\n type ComboboxChipProps,\n type ComboboxChipRemoveProps,\n type ComboboxClearProps,\n type ComboboxInputProps,\n type ComboboxItemProps,\n type ComboboxListProps,\n type ComboboxPopupProps,\n type ComboboxPositionerProps,\n} from \"@base-ui/react/combobox\";\nimport { Cross, Search } from \"@blueprintjs/icons\";\nimport classnames from \"classnames\";\nimport React from \"react\";\nimport styles from \"./Combobox.module.css\";\n\ninterface ComboboxInputComponentProps\n extends Omit<ComboboxInputProps, \"className\">\n{\n className?: string;\n}\n\nfunction ComboboxSearchInput({\n className,\n ...rest\n}: ComboboxInputComponentProps): React.ReactElement {\n return (\n <div className={classnames(styles.osdkComboboxInputWrapper, className)}>\n <Search className={styles.osdkComboboxSearchIcon} />\n <BaseUICombobox.Input className={styles.osdkComboboxInput} {...rest} />\n </div>\n );\n}\n\nfunction ComboboxInput({\n className,\n ...rest\n}: ComboboxInputComponentProps): React.ReactElement {\n return (\n <BaseUICombobox.Input\n className={classnames(styles.osdkComboboxInput, className)}\n {...rest}\n />\n );\n}\n\ninterface ComboboxPositionerComponentProps\n extends Omit<ComboboxPositionerProps, \"className\">\n{\n className?: string;\n}\n\nfunction ComboboxPositioner({\n className,\n children,\n ...rest\n}: ComboboxPositionerComponentProps): React.ReactElement {\n return (\n <BaseUICombobox.Positioner\n className={classnames(styles.osdkComboboxPositioner, className)}\n sideOffset={4}\n {...rest}\n >\n {children}\n </BaseUICombobox.Positioner>\n );\n}\n\ninterface ComboboxPopupComponentProps\n extends Omit<ComboboxPopupProps, \"className\">\n{\n className?: string;\n}\n\nfunction ComboboxPopup({\n className,\n children,\n ...rest\n}: ComboboxPopupComponentProps): React.ReactElement {\n return (\n <BaseUICombobox.Popup\n className={classnames(styles.osdkComboboxPopup, className)}\n {...rest}\n >\n {children}\n </BaseUICombobox.Popup>\n );\n}\n\ninterface ComboboxItemComponentProps\n extends Omit<ComboboxItemProps, \"className\">\n{\n className?: string;\n}\n\nfunction ComboboxItem({\n className,\n children,\n ...rest\n}: ComboboxItemComponentProps): React.ReactElement {\n return (\n <BaseUICombobox.Item\n className={classnames(styles.osdkComboboxItem, className)}\n {...rest}\n >\n {children}\n </BaseUICombobox.Item>\n );\n}\n\nfunction ComboboxChips({\n children,\n className,\n}: {\n children: React.ReactNode;\n className?: string;\n}): React.ReactElement {\n return (\n <BaseUICombobox.Chips\n render={(props) => (\n <div\n {...props}\n className={classnames(styles.osdkComboboxInputWrapper, className)}\n >\n {props.children}\n </div>\n )}\n >\n {children}\n </BaseUICombobox.Chips>\n );\n}\n\ninterface ComboboxChipComponentProps\n extends Omit<ComboboxChipProps, \"className\">\n{\n className?: string;\n}\n\nfunction ComboboxChip({\n className,\n children,\n ...rest\n}: ComboboxChipComponentProps): React.ReactElement {\n return (\n <BaseUICombobox.Chip\n className={classnames(styles.osdkComboboxChip, className)}\n {...rest}\n >\n {children}\n </BaseUICombobox.Chip>\n );\n}\n\ninterface ComboboxChipRemoveComponentProps\n extends Omit<ComboboxChipRemoveProps, \"className\">\n{\n className?: string;\n}\n\nfunction ComboboxChipRemove({\n className,\n ...rest\n}: ComboboxChipRemoveComponentProps): React.ReactElement {\n return (\n <BaseUICombobox.ChipRemove\n className={classnames(styles.osdkComboboxChipRemove, className)}\n aria-label=\"Remove\"\n {...rest}\n >\n <Cross />\n </BaseUICombobox.ChipRemove>\n );\n}\n\ninterface ComboboxClearComponentProps\n extends Omit<ComboboxClearProps, \"className\">\n{\n className?: string;\n}\n\nfunction ComboboxClear({\n className,\n ...rest\n}: ComboboxClearComponentProps): React.ReactElement {\n return (\n <BaseUICombobox.Clear\n className={classnames(styles.osdkComboboxClear, className)}\n aria-label=\"Clear all\"\n {...rest}\n >\n <Cross />\n </BaseUICombobox.Clear>\n );\n}\n\nfunction ComboboxEmpty({\n children,\n className,\n}: {\n children: React.ReactNode;\n className?: string;\n}): React.ReactElement {\n return (\n <BaseUICombobox.Empty\n className={classnames(styles.osdkComboboxEmpty, className)}\n >\n {children}\n </BaseUICombobox.Empty>\n );\n}\n\ninterface ComboboxListComponentProps\n extends Omit<ComboboxListProps, \"className\">\n{\n className?: string;\n}\n\nfunction ComboboxList({\n className,\n children,\n ...rest\n}: ComboboxListComponentProps): React.ReactElement {\n return (\n <BaseUICombobox.List\n className={classnames(styles.osdkComboboxList, className)}\n {...rest}\n >\n {children}\n </BaseUICombobox.List>\n );\n}\n\nexport const Combobox: {\n Root: typeof BaseUICombobox.Root;\n SearchInput: typeof ComboboxSearchInput;\n Input: typeof ComboboxInput;\n Portal: typeof BaseUICombobox.Portal;\n Positioner: typeof ComboboxPositioner;\n Popup: typeof ComboboxPopup;\n List: typeof ComboboxList;\n Item: typeof ComboboxItem;\n Chips: typeof ComboboxChips;\n Chip: typeof ComboboxChip;\n ChipRemove: typeof ComboboxChipRemove;\n Clear: typeof ComboboxClear;\n Empty: typeof ComboboxEmpty;\n Value: typeof BaseUICombobox.Value;\n} = {\n Root: BaseUICombobox.Root,\n SearchInput: ComboboxSearchInput,\n Input: ComboboxInput,\n Portal: BaseUICombobox.Portal,\n Positioner: ComboboxPositioner,\n Popup: ComboboxPopup,\n List: ComboboxList,\n Item: ComboboxItem,\n Chips: ComboboxChips,\n Chip: ComboboxChip,\n ChipRemove: ComboboxChipRemove,\n Clear: ComboboxClear,\n Empty: ComboboxEmpty,\n Value: BaseUICombobox.Value,\n};\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SACEA,QAAQ,IAAIC,cAAc,QASrB,yBAAyB;AAChC,SAASC,KAAK,EAAEC,MAAM,QAAQ,oBAAoB;AAClD,OAAOC,UAAU,MAAM,YAAY;AACnC,OAAOC,KAAK,MAAM,OAAO;AACzB,OAAOC,MAAM,MAAM,uBAAuB;AAQ1C,SAASC,mBAAmBA,CAAC;EAC3BC,SAAS;EACT,GAAGC;AACwB,CAAC,EAAsB;EAClD,oBACEJ,KAAA,CAAAK,aAAA;I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B,QAAA;IACnBN,SAAS,EAAEJ,UAAU,CAACE,MAAM,CAACkC,iBAAiB,EAAEhC,SAAS,CAAE;IAC3D,cAAW;EAAW,GAClBC,IAAI,gBAERJ,KAAA,CAAAK,aAAA,CAACR,KAAK,MAAE,CACY,CAAC;AAE3B;AAEA,SAASuC,aAAaA,CAAC;EACrBvB,QAAQ;EACRV;AAIF,CAAC,EAAsB;EACrB,oBACEH,KAAA,CAAAK,aAAA,CAACT,cAAc,CAACyC,KAAK;IACnBlC,SAAS,EAAEJ,UAAU,CAACE,MAAM,CAACqC,iBAAiB,EAAEnC,SAAS;EAAE,GAE1DU,QACmB,CAAC;AAE3B;AAQA,SAAS0B,YAAYA,CAAC;EACpBpC,SAAS;EACTU,QAAQ;EACR,GAAGT;AACuB,CAAC,EAAsB;EACjD,oBACEJ,KAAA,CAAAK,aAAA,CAACT,cAAc,CAAC4C,IAAI,EAAA/B,QAAA;IAClBN,SAAS,EAAEJ,UAAU,CAACE,MAAM,CAACwC,gBAAgB,EAAEtC,SAAS;EAAE,GACtDC,IAAI,GAEPS,QACkB,CAAC;AAE1B;AAEA,OAAO,MAAMlB,QAeZ,GAAG;EACF+C,IAAI,EAAE9C,cAAc,CAAC8C,IAAI;EACzBC,WAAW,EAAEzC,mBAAmB;EAChCM,KAAK,EAAEG,aAAa;EACpBiC,MAAM,EAAEhD,cAAc,CAACgD,MAAM;EAC7B9B,UAAU,EAAEF,kBAAkB;EAC9BM,KAAK,EAAED,aAAa;EACpBuB,IAAI,EAAED,YAAY;EAClBlB,IAAI,EAAED,YAAY;EAClBI,KAAK,EAAED,aAAa;EACpBK,IAAI,EAAED,YAAY;EAClBI,UAAU,EAAED,kBAAkB;EAC9BI,KAAK,EAAED,aAAa;EACpBI,KAAK,EAAED,aAAa;EACpBS,KAAK,EAAEjD,cAAc,CAACiD;AACxB,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"Combobox.js","names":["Combobox","BaseUICombobox","Cross","Search","Tick","classnames","React","styles","ComboboxSearchInput","className","rest","createElement","osdkComboboxInputWrapper","osdkComboboxSearchIcon","Input","_extends","osdkComboboxInput","ComboboxInput","ComboboxPositioner","children","Positioner","osdkComboboxPositioner","sideOffset","ComboboxPopup","Popup","osdkComboboxPopup","ComboboxItem","Item","osdkComboboxItem","ComboboxChips","Chips","render","props","ComboboxChip","Chip","osdkComboboxChip","ComboboxChipRemove","ChipRemove","osdkComboboxChipRemove","ComboboxClear","Clear","osdkComboboxClear","ComboboxEmpty","Empty","osdkComboboxEmpty","ComboboxList","List","osdkComboboxList","ComboboxItemIndicator","ItemIndicator","osdkComboboxItemIndicator","keepMounted","size","Root","SearchInput","Portal","Value"],"sources":["Combobox.tsx"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n Combobox as BaseUICombobox,\n type ComboboxChipProps,\n type ComboboxChipRemoveProps,\n type ComboboxClearProps,\n type ComboboxInputProps,\n type ComboboxItemIndicatorProps,\n type ComboboxItemProps,\n type ComboboxListProps,\n type ComboboxPopupProps,\n type ComboboxPositionerProps,\n} from \"@base-ui/react/combobox\";\nimport { Cross, Search, Tick } from \"@blueprintjs/icons\";\nimport classnames from \"classnames\";\nimport React from \"react\";\nimport styles from \"./Combobox.module.css\";\n\ninterface ComboboxInputComponentProps\n extends Omit<ComboboxInputProps, \"className\">\n{\n className?: string;\n}\n\nfunction ComboboxSearchInput({\n className,\n ...rest\n}: ComboboxInputComponentProps): React.ReactElement {\n return (\n <div className={classnames(styles.osdkComboboxInputWrapper, className)}>\n <Search className={styles.osdkComboboxSearchIcon} />\n <BaseUICombobox.Input className={styles.osdkComboboxInput} {...rest} />\n </div>\n );\n}\n\nfunction ComboboxInput({\n className,\n ...rest\n}: ComboboxInputComponentProps): React.ReactElement {\n return (\n <BaseUICombobox.Input\n className={classnames(styles.osdkComboboxInput, className)}\n {...rest}\n />\n );\n}\n\ninterface ComboboxPositionerComponentProps\n extends Omit<ComboboxPositionerProps, \"className\">\n{\n className?: string;\n}\n\nfunction ComboboxPositioner({\n className,\n children,\n ...rest\n}: ComboboxPositionerComponentProps): React.ReactElement {\n return (\n <BaseUICombobox.Positioner\n className={classnames(styles.osdkComboboxPositioner, className)}\n sideOffset={4}\n {...rest}\n >\n {children}\n </BaseUICombobox.Positioner>\n );\n}\n\ninterface ComboboxPopupComponentProps\n extends Omit<ComboboxPopupProps, \"className\">\n{\n className?: string;\n}\n\nfunction ComboboxPopup({\n className,\n children,\n ...rest\n}: ComboboxPopupComponentProps): React.ReactElement {\n return (\n <BaseUICombobox.Popup\n className={classnames(styles.osdkComboboxPopup, className)}\n {...rest}\n >\n {children}\n </BaseUICombobox.Popup>\n );\n}\n\ninterface ComboboxItemComponentProps\n extends Omit<ComboboxItemProps, \"className\">\n{\n className?: string;\n}\n\nfunction ComboboxItem({\n className,\n children,\n ...rest\n}: ComboboxItemComponentProps): React.ReactElement {\n return (\n <BaseUICombobox.Item\n className={classnames(styles.osdkComboboxItem, className)}\n {...rest}\n >\n {children}\n </BaseUICombobox.Item>\n );\n}\n\nfunction ComboboxChips({\n children,\n className,\n}: {\n children: React.ReactNode;\n className?: string;\n}): React.ReactElement {\n return (\n <BaseUICombobox.Chips\n render={(props) => (\n <div\n {...props}\n className={classnames(styles.osdkComboboxInputWrapper, className)}\n >\n {props.children}\n </div>\n )}\n >\n {children}\n </BaseUICombobox.Chips>\n );\n}\n\ninterface ComboboxChipComponentProps\n extends Omit<ComboboxChipProps, \"className\">\n{\n className?: string;\n}\n\nfunction ComboboxChip({\n className,\n children,\n ...rest\n}: ComboboxChipComponentProps): React.ReactElement {\n return (\n <BaseUICombobox.Chip\n className={classnames(styles.osdkComboboxChip, className)}\n {...rest}\n >\n {children}\n </BaseUICombobox.Chip>\n );\n}\n\ninterface ComboboxChipRemoveComponentProps\n extends Omit<ComboboxChipRemoveProps, \"className\">\n{\n className?: string;\n}\n\nfunction ComboboxChipRemove({\n className,\n ...rest\n}: ComboboxChipRemoveComponentProps): React.ReactElement {\n return (\n <BaseUICombobox.ChipRemove\n className={classnames(styles.osdkComboboxChipRemove, className)}\n aria-label=\"Remove\"\n {...rest}\n >\n <Cross />\n </BaseUICombobox.ChipRemove>\n );\n}\n\ninterface ComboboxClearComponentProps\n extends Omit<ComboboxClearProps, \"className\">\n{\n className?: string;\n}\n\nfunction ComboboxClear({\n className,\n ...rest\n}: ComboboxClearComponentProps): React.ReactElement {\n return (\n <BaseUICombobox.Clear\n className={classnames(styles.osdkComboboxClear, className)}\n aria-label=\"Clear all\"\n {...rest}\n >\n <Cross />\n </BaseUICombobox.Clear>\n );\n}\n\nfunction ComboboxEmpty({\n children,\n className,\n}: {\n children: React.ReactNode;\n className?: string;\n}): React.ReactElement {\n return (\n <BaseUICombobox.Empty\n className={classnames(styles.osdkComboboxEmpty, className)}\n >\n {children}\n </BaseUICombobox.Empty>\n );\n}\n\ninterface ComboboxListComponentProps\n extends Omit<ComboboxListProps, \"className\">\n{\n className?: string;\n}\n\nfunction ComboboxList({\n className,\n children,\n ...rest\n}: ComboboxListComponentProps): React.ReactElement {\n return (\n <BaseUICombobox.List\n className={classnames(styles.osdkComboboxList, className)}\n {...rest}\n >\n {children}\n </BaseUICombobox.List>\n );\n}\n\ninterface ComboboxItemIndicatorComponentProps\n extends Omit<ComboboxItemIndicatorProps, \"className\">\n{\n className?: string;\n}\n\nfunction ComboboxItemIndicator({\n className,\n children,\n ...rest\n}: ComboboxItemIndicatorComponentProps): React.ReactElement {\n return (\n <BaseUICombobox.ItemIndicator\n className={classnames(styles.osdkComboboxItemIndicator, className)}\n keepMounted={true}\n {...rest}\n >\n {children ?? <Tick size={16} />}\n </BaseUICombobox.ItemIndicator>\n );\n}\n\nexport const Combobox: {\n Root: typeof BaseUICombobox.Root;\n SearchInput: typeof ComboboxSearchInput;\n Input: typeof ComboboxInput;\n Portal: typeof BaseUICombobox.Portal;\n Positioner: typeof ComboboxPositioner;\n Popup: typeof ComboboxPopup;\n List: typeof ComboboxList;\n Item: typeof ComboboxItem;\n ItemIndicator: typeof ComboboxItemIndicator;\n Chips: typeof ComboboxChips;\n Chip: typeof ComboboxChip;\n ChipRemove: typeof ComboboxChipRemove;\n Clear: typeof ComboboxClear;\n Empty: typeof ComboboxEmpty;\n Value: typeof BaseUICombobox.Value;\n} = {\n Root: BaseUICombobox.Root,\n SearchInput: ComboboxSearchInput,\n Input: ComboboxInput,\n Portal: BaseUICombobox.Portal,\n Positioner: ComboboxPositioner,\n Popup: ComboboxPopup,\n List: ComboboxList,\n Item: ComboboxItem,\n ItemIndicator: ComboboxItemIndicator,\n Chips: ComboboxChips,\n Chip: ComboboxChip,\n ChipRemove: ComboboxChipRemove,\n Clear: ComboboxClear,\n Empty: ComboboxEmpty,\n Value: BaseUICombobox.Value,\n};\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SACEA,QAAQ,IAAIC,cAAc,QAUrB,yBAAyB;AAChC,SAASC,KAAK,EAAEC,MAAM,EAAEC,IAAI,QAAQ,oBAAoB;AACxD,OAAOC,UAAU,MAAM,YAAY;AACnC,OAAOC,KAAK,MAAM,OAAO;AACzB,OAAOC,MAAM,MAAM,uBAAuB;AAQ1C,SAASC,mBAAmBA,CAAC;EAC3BC,SAAS;EACT,GAAGC;AACwB,CAAC,EAAsB;EAClD,oBACEJ,KAAA,CAAAK,aAAA;IAAKF,SAAS,EAAEJ,UAAU,CAACE,MAAM,CAACK,wBAAwB,EAAEH,SAAS;EAAE,gBACrEH,KAAA,CAAAK,aAA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AAY;EAClBlB,IAAI,EAAED,YAAY;EAClBuB,aAAa,EAAED,qBAAqB;EACpClB,KAAK,EAAED,aAAa;EACpBK,IAAI,EAAED,YAAY;EAClBI,UAAU,EAAED,kBAAkB;EAC9BI,KAAK,EAAED,aAAa;EACpBI,KAAK,EAAED,aAAa;EACpBc,KAAK,EAAEvD,cAAc,CAACuD;AACxB,CAAC","ignoreList":[]}
|
|
@@ -89,12 +89,7 @@
|
|
|
89
89
|
--osdk-combobox-focus-border-color,
|
|
90
90
|
var(--osdk-intent-primary-rest)
|
|
91
91
|
);
|
|
92
|
-
outline:
|
|
93
|
-
solid var(--osdk-combobox-focus-color, var(--osdk-emphasis-focus-color));
|
|
94
|
-
outline-offset: var(
|
|
95
|
-
--osdk-combobox-focus-offset,
|
|
96
|
-
var(--osdk-emphasis-focus-offset)
|
|
97
|
-
);
|
|
92
|
+
outline: none;
|
|
98
93
|
}
|
|
99
94
|
|
|
100
95
|
.osdkComboboxInputWrapper & {
|
|
@@ -165,6 +160,7 @@
|
|
|
165
160
|
.osdkComboboxItem {
|
|
166
161
|
display: flex;
|
|
167
162
|
align-items: center;
|
|
163
|
+
gap: calc(var(--osdk-combobox-spacing, var(--osdk-surface-spacing)) * 1.5);
|
|
168
164
|
padding: calc(var(--osdk-combobox-spacing, var(--osdk-surface-spacing)) * 1.5)
|
|
169
165
|
calc(var(--osdk-combobox-spacing, var(--osdk-surface-spacing)) * 2);
|
|
170
166
|
border-radius: var(
|
|
@@ -220,6 +216,20 @@
|
|
|
220
216
|
}
|
|
221
217
|
}
|
|
222
218
|
|
|
219
|
+
.osdkComboboxItemIndicator {
|
|
220
|
+
display: flex;
|
|
221
|
+
align-items: center;
|
|
222
|
+
justify-content: center;
|
|
223
|
+
width: calc(var(--osdk-combobox-spacing, var(--osdk-surface-spacing)) * 4);
|
|
224
|
+
flex-shrink: 0;
|
|
225
|
+
color: var(--osdk-combobox-item-color-selected, var(--osdk-intent-primary-rest));
|
|
226
|
+
visibility: hidden;
|
|
227
|
+
|
|
228
|
+
&[data-selected] {
|
|
229
|
+
visibility: visible;
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
|
|
223
233
|
.osdkComboboxChips {
|
|
224
234
|
display: flex;
|
|
225
235
|
flex-wrap: wrap;
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2026 Palantir Technologies, Inc. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import { Menu } from "@base-ui/react/menu";
|
|
18
|
+
import classnames from "classnames";
|
|
19
|
+
import React, { memo, useCallback, useMemo, useState } from "react";
|
|
20
|
+
import { SearchBar } from "../search-bar/SearchBar.js";
|
|
21
|
+
import styles from "./SearchableMenu.module.css";
|
|
22
|
+
function SearchableMenuInner({
|
|
23
|
+
items,
|
|
24
|
+
onItemSelected,
|
|
25
|
+
trigger,
|
|
26
|
+
triggerClassName,
|
|
27
|
+
disabled,
|
|
28
|
+
searchPlaceholder = "Search",
|
|
29
|
+
emptyMessage = "No matching items",
|
|
30
|
+
className
|
|
31
|
+
}) {
|
|
32
|
+
const [searchQuery, setSearchQuery] = useState("");
|
|
33
|
+
const filteredItems = useMemo(() => {
|
|
34
|
+
const query = searchQuery.toLowerCase().trim();
|
|
35
|
+
if (!query) return items;
|
|
36
|
+
return items.filter(item => item.label.toLowerCase().includes(query));
|
|
37
|
+
}, [items, searchQuery]);
|
|
38
|
+
const handleSearchChange = useCallback(event => {
|
|
39
|
+
setSearchQuery(event.target.value);
|
|
40
|
+
}, []);
|
|
41
|
+
const handleMenuOpenChange = useCallback(open => {
|
|
42
|
+
if (open) {
|
|
43
|
+
setSearchQuery("");
|
|
44
|
+
}
|
|
45
|
+
}, []);
|
|
46
|
+
const handleKeyDown = useCallback(event => {
|
|
47
|
+
event.stopPropagation();
|
|
48
|
+
}, []);
|
|
49
|
+
return /*#__PURE__*/React.createElement(Menu.Root, {
|
|
50
|
+
onOpenChange: handleMenuOpenChange
|
|
51
|
+
}, /*#__PURE__*/React.createElement(Menu.Trigger, {
|
|
52
|
+
className: triggerClassName,
|
|
53
|
+
disabled: disabled
|
|
54
|
+
}, trigger), /*#__PURE__*/React.createElement(Menu.Portal, null, /*#__PURE__*/React.createElement(Menu.Positioner, {
|
|
55
|
+
className: classnames(styles.positioner, className),
|
|
56
|
+
sideOffset: 4
|
|
57
|
+
}, /*#__PURE__*/React.createElement(Menu.Popup, {
|
|
58
|
+
className: styles.popup
|
|
59
|
+
}, /*#__PURE__*/React.createElement(SearchBar, {
|
|
60
|
+
value: searchQuery,
|
|
61
|
+
onChange: handleSearchChange,
|
|
62
|
+
placeholder: searchPlaceholder,
|
|
63
|
+
"aria-label": searchPlaceholder,
|
|
64
|
+
className: styles.searchContainer,
|
|
65
|
+
onKeyDown: handleKeyDown
|
|
66
|
+
}), filteredItems.map(item => /*#__PURE__*/React.createElement(SearchableMenuItemRow, {
|
|
67
|
+
key: item.key,
|
|
68
|
+
item: item,
|
|
69
|
+
onItemSelected: onItemSelected
|
|
70
|
+
})), filteredItems.length === 0 && /*#__PURE__*/React.createElement("div", {
|
|
71
|
+
className: styles.emptyState
|
|
72
|
+
}, emptyMessage)))));
|
|
73
|
+
}
|
|
74
|
+
export const SearchableMenu = /*#__PURE__*/memo(SearchableMenuInner);
|
|
75
|
+
function SearchableMenuItemRowInner({
|
|
76
|
+
item,
|
|
77
|
+
onItemSelected
|
|
78
|
+
}) {
|
|
79
|
+
const handleClick = useCallback(() => onItemSelected(item.key), [onItemSelected, item.key]);
|
|
80
|
+
return /*#__PURE__*/React.createElement(Menu.Item, {
|
|
81
|
+
className: styles.menuItem,
|
|
82
|
+
onClick: handleClick
|
|
83
|
+
}, item.label);
|
|
84
|
+
}
|
|
85
|
+
const SearchableMenuItemRow = /*#__PURE__*/memo(SearchableMenuItemRowInner);
|
|
86
|
+
//# sourceMappingURL=SearchableMenu.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SearchableMenu.js","names":["Menu","classnames","React","memo","useCallback","useMemo","useState","SearchBar","styles","SearchableMenuInner","items","onItemSelected","trigger","triggerClassName","disabled","searchPlaceholder","emptyMessage","className","searchQuery","setSearchQuery","filteredItems","query","toLowerCase","trim","filter","item","label","includes","handleSearchChange","event","target","value","handleMenuOpenChange","open","handleKeyDown","stopPropagation","createElement","Root","onOpenChange","Trigger","Portal","Positioner","positioner","sideOffset","Popup","popup","onChange","placeholder","searchContainer","onKeyDown","map","SearchableMenuItemRow","key","length","emptyState","SearchableMenu","SearchableMenuItemRowInner","handleClick","Item","menuItem","onClick"],"sources":["SearchableMenu.tsx"],"sourcesContent":["/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Menu } from \"@base-ui/react/menu\";\nimport classnames from \"classnames\";\nimport React, { memo, useCallback, useMemo, useState } from \"react\";\nimport { SearchBar } from \"../search-bar/SearchBar.js\";\nimport styles from \"./SearchableMenu.module.css\";\n\nexport interface SearchableMenuItem {\n key: string;\n label: string;\n}\n\ninterface SearchableMenuProps {\n items: SearchableMenuItem[];\n onItemSelected: (key: string) => void;\n trigger: React.ReactNode;\n triggerClassName?: string;\n disabled?: boolean;\n searchPlaceholder?: string;\n emptyMessage?: string;\n className?: string;\n}\n\nfunction SearchableMenuInner({\n items,\n onItemSelected,\n trigger,\n triggerClassName,\n disabled,\n searchPlaceholder = \"Search\",\n emptyMessage = \"No matching items\",\n className,\n}: SearchableMenuProps): React.ReactElement {\n const [searchQuery, setSearchQuery] = useState(\"\");\n\n const filteredItems = useMemo(() => {\n const query = searchQuery.toLowerCase().trim();\n if (!query) return items;\n return items.filter((item) => item.label.toLowerCase().includes(query));\n }, [items, searchQuery]);\n\n const handleSearchChange = useCallback(\n (event: React.ChangeEvent<HTMLInputElement>) => {\n setSearchQuery(event.target.value);\n },\n [],\n );\n\n const handleMenuOpenChange = useCallback((open: boolean) => {\n if (open) {\n setSearchQuery(\"\");\n }\n }, []);\n\n const handleKeyDown = useCallback(\n (event: React.KeyboardEvent<HTMLInputElement>) => {\n event.stopPropagation();\n },\n [],\n );\n\n return (\n <Menu.Root onOpenChange={handleMenuOpenChange}>\n <Menu.Trigger\n className={triggerClassName}\n disabled={disabled}\n >\n {trigger}\n </Menu.Trigger>\n <Menu.Portal>\n <Menu.Positioner\n className={classnames(styles.positioner, className)}\n sideOffset={4}\n >\n <Menu.Popup className={styles.popup}>\n <SearchBar\n value={searchQuery}\n onChange={handleSearchChange}\n placeholder={searchPlaceholder}\n aria-label={searchPlaceholder}\n className={styles.searchContainer}\n onKeyDown={handleKeyDown}\n />\n {filteredItems.map((item) => (\n <SearchableMenuItemRow\n key={item.key}\n item={item}\n onItemSelected={onItemSelected}\n />\n ))}\n {filteredItems.length === 0 && (\n <div className={styles.emptyState}>\n {emptyMessage}\n </div>\n )}\n </Menu.Popup>\n </Menu.Positioner>\n </Menu.Portal>\n </Menu.Root>\n );\n}\n\nexport const SearchableMenu: React.MemoExoticComponent<\n typeof SearchableMenuInner\n> = memo(SearchableMenuInner);\n\nfunction SearchableMenuItemRowInner(\n { item, onItemSelected }: {\n item: SearchableMenuItem;\n onItemSelected: (key: string) => void;\n },\n): React.ReactElement {\n const handleClick = useCallback(\n () => onItemSelected(item.key),\n [onItemSelected, item.key],\n );\n\n return (\n <Menu.Item\n className={styles.menuItem}\n onClick={handleClick}\n >\n {item.label}\n </Menu.Item>\n );\n}\n\nconst SearchableMenuItemRow = memo(SearchableMenuItemRowInner);\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,IAAI,QAAQ,qBAAqB;AAC1C,OAAOC,UAAU,MAAM,YAAY;AACnC,OAAOC,KAAK,IAAIC,IAAI,EAAEC,WAAW,EAAEC,OAAO,EAAEC,QAAQ,QAAQ,OAAO;AACnE,SAASC,SAAS,QAAQ,4BAA4B;AACtD,OAAOC,MAAM,MAAM,6BAA6B;AAkBhD,SAASC,mBAAmBA,CAAC;EAC3BC,KAAK;EACLC,cAAc;EACdC,OAAO;EACPC,gBAAgB;EAChBC,QAAQ;EACRC,iBAAiB,GAAG,QAAQ;EAC5BC,YAAY,GAAG,mBAAmB;EAClCC;AACmB,CAAC,EAAsB;EAC1C,MAAM,CAACC,WAAW,EAAEC,cAAc,CAAC,GAAGb,QAAQ,CAAC,EAAE,CAAC;EAElD,MAAMc,aAAa,GAAGf,OAAO,CAAC,MAAM;IAClC,MAAMgB,KAAK,GAAGH,WAAW,CAACI,WAAW,CAAC,CAAC,CAACC,IAAI,CAAC,CAAC;IAC9C,IAAI,CAACF,KAAK,EAAE,OAAOX,KAAK;IACxB,OAAOA,KAAK,CAACc,MAAM,CAAEC,IAAI,IAAKA,IAAI,CAACC,KAAK,CAACJ,WAAW,CAAC,CAAC,CAACK,QAAQ,CAACN,KAAK,CAAC,CAAC;EACzE,CAAC,EAAE,CAACX,KAAK,EAAEQ,WAAW,CAAC,CAAC;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CAAAkC,aAAA,CAACe,qBAAqB;IACpBC,GAAG,EAAE3B,IAAI,CAAC2B,GAAI;IACd3B,IAAI,EAAEA,IAAK;IACXd,cAAc,EAAEA;EAAe,CAChC,CACF,CAAC,EACDS,aAAa,CAACiC,MAAM,KAAK,CAAC,iBACzBnD,KAAA,CAAAkC,aAAA;IAAKnB,SAAS,EAAET,MAAM,CAAC8C;EAAW,GAC/BtC,YACE,CAEG,CACG,CACN,CACJ,CAAC;AAEhB;AAEA,OAAO,MAAMuC,cAEZ,gBAAGpD,IAAI,CAACM,mBAAmB,CAAC;AAE7B,SAAS+C,0BAA0BA,CACjC;EAAE/B,IAAI;EAAEd;AAGR,CAAC,EACmB;EACpB,MAAM8C,WAAW,GAAGrD,WAAW,CAC7B,MAAMO,cAAc,CAACc,IAAI,CAAC2B,GAAG,CAAC,EAC9B,CAACzC,cAAc,EAAEc,IAAI,CAAC2B,GAAG,CAC3B,CAAC;EAED,oBACElD,KAAA,CAAAkC,aAAA,CAACpC,IAAI,CAAC0D,IAAI;IACRzC,SAAS,EAAET,MAAM,CAACmD,QAAS;IAC3BC,OAAO,EAAEH;EAAY,GAEpBhC,IAAI,CAACC,KACG,CAAC;AAEhB;AAEA,MAAMyB,qBAAqB,gBAAGhD,IAAI,CAACqD,0BAA0B,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2026 Palantir Technologies, Inc. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
.positioner {
|
|
18
|
+
z-index: var(--osdk-surface-z-index-3);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.popup {
|
|
22
|
+
background-color: var(--osdk-surface-background-color-default-rest);
|
|
23
|
+
border: var(--osdk-surface-border);
|
|
24
|
+
border-radius: var(--osdk-surface-border-radius);
|
|
25
|
+
box-shadow: var(--osdk-surface-shadow-2);
|
|
26
|
+
max-height: calc(var(--osdk-dialog-max-height) * 0.5);
|
|
27
|
+
overflow-y: auto;
|
|
28
|
+
width: var(--anchor-width);
|
|
29
|
+
|
|
30
|
+
&:focus {
|
|
31
|
+
outline: none;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
&:focus-visible {
|
|
35
|
+
outline: var(--osdk-focus-outline);
|
|
36
|
+
outline-offset: var(--osdk-focus-visible-outline-offset);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.searchContainer {
|
|
41
|
+
border: none;
|
|
42
|
+
border-bottom: var(--osdk-surface-border);
|
|
43
|
+
border-radius: 0;
|
|
44
|
+
position: sticky;
|
|
45
|
+
top: 0;
|
|
46
|
+
background-color: var(--osdk-surface-background-color-default-rest);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.menuItem {
|
|
50
|
+
display: block;
|
|
51
|
+
width: 100%;
|
|
52
|
+
text-align: left;
|
|
53
|
+
padding: calc(var(--osdk-surface-spacing) * 2)
|
|
54
|
+
calc(var(--osdk-surface-spacing) * 3);
|
|
55
|
+
background: none;
|
|
56
|
+
border: none;
|
|
57
|
+
cursor: pointer;
|
|
58
|
+
font-size: var(--osdk-typography-size-body-medium);
|
|
59
|
+
color: var(--osdk-typography-color-default-rest);
|
|
60
|
+
overflow: hidden;
|
|
61
|
+
text-overflow: ellipsis;
|
|
62
|
+
white-space: nowrap;
|
|
63
|
+
|
|
64
|
+
&:hover,
|
|
65
|
+
&[data-highlighted] {
|
|
66
|
+
background-color: var(--osdk-surface-background-color-default-hover);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
&:focus-visible {
|
|
70
|
+
outline: var(--osdk-focus-outline);
|
|
71
|
+
outline-offset: var(--osdk-focus-visible-outline-offset);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.emptyState {
|
|
76
|
+
padding: calc(var(--osdk-surface-spacing) * 3);
|
|
77
|
+
text-align: center;
|
|
78
|
+
color: var(--osdk-typography-color-muted);
|
|
79
|
+
font-size: var(--osdk-typography-size-body-medium);
|
|
80
|
+
}
|
|
@@ -44,6 +44,7 @@ export function FilterList(props) {
|
|
|
44
44
|
const {
|
|
45
45
|
filterStates,
|
|
46
46
|
setFilterState,
|
|
47
|
+
clearFilterState,
|
|
47
48
|
perFilterWhereClauses,
|
|
48
49
|
activeFilterCount,
|
|
49
50
|
reset
|
|
@@ -71,11 +72,12 @@ export function FilterList(props) {
|
|
|
71
72
|
}, [filterDefinitions]);
|
|
72
73
|
const effectiveVisibleDefinitions = uncontrolledAddFilterMode ? managedVisibleDefinitions : simpleVisibleDefinitions;
|
|
73
74
|
const handleFilterRemoved = useCallback(filterKey => {
|
|
75
|
+
clearFilterState(filterKey);
|
|
74
76
|
if (uncontrolledAddFilterMode) {
|
|
75
77
|
hideFilter(filterKey);
|
|
76
78
|
}
|
|
77
79
|
onFilterRemoved?.(filterKey);
|
|
78
|
-
}, [uncontrolledAddFilterMode, hideFilter, onFilterRemoved]);
|
|
80
|
+
}, [clearFilterState, uncontrolledAddFilterMode, hideFilter, onFilterRemoved]);
|
|
79
81
|
const handleFilterShown = useCallback(filterKey => {
|
|
80
82
|
showFilter(filterKey);
|
|
81
83
|
onFilterAdded?.(filterKey, filterDefinitions ?? []);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FilterList.js","names":["React","useCallback","useMemo","AddFilterPopover","BaseFilterList","FilterInput","useFilterListState","useFilterVisibility","getFilterKey","getFilterLabel","FilterList","props","objectSet","title","titleIcon","collapsed","onCollapsedChange","filterDefinitions","addFilterMode","showResetButton","onReset","showActiveFilterCount","className","enableSorting","onFilterAdded","onFilterRemoved","renderAddFilterButton","objectType","$objectSetInternals","def","filterStates","setFilterState","perFilterWhereClauses","activeFilterCount","reset","uncontrolledAddFilterMode","getIsVisible","isVisible","visibleDefinitions","managedVisibleDefinitions","hiddenDefinitions","managedHiddenDefinitions","showFilter","hideFilter","hasVisibilityChanges","resetVisibility","handleReset","simpleVisibleDefinitions","undefined","filter","effectiveVisibleDefinitions","handleFilterRemoved","filterKey","handleFilterShown","hiddenFilterItems","map","key","label","effectiveRenderAddFilterButton","length","createElement","onShowFilter","renderTrigger","effectiveOnFilterRemoved","renderInput","definition","filterState","onFilterStateChanged","searchQuery","excludeRowOpen","whereClause","get"],"sources":["FilterList.tsx"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { ObjectTypeDefinition, WhereClause } from \"@osdk/api\";\nimport React, { useCallback, useMemo } from \"react\";\nimport { AddFilterPopover } from \"./base/AddFilterPopover.js\";\nimport { BaseFilterList } from \"./base/BaseFilterList.js\";\nimport type { RenderFilterInput } from \"./base/BaseFilterListApi.js\";\nimport { FilterInput } from \"./FilterInput.js\";\nimport type {\n FilterDefinitionUnion,\n FilterListProps,\n} from \"./FilterListApi.js\";\nimport { useFilterListState } from \"./hooks/useFilterListState.js\";\nimport { useFilterVisibility } from \"./hooks/useFilterVisibility.js\";\nimport { getFilterKey } from \"./utils/getFilterKey.js\";\nimport { getFilterLabel } from \"./utils/getFilterLabel.js\";\n\nexport function FilterList<Q extends ObjectTypeDefinition>(\n props: FilterListProps<Q>,\n): React.ReactElement {\n const {\n objectSet,\n title,\n titleIcon,\n collapsed,\n onCollapsedChange,\n filterDefinitions,\n addFilterMode = \"uncontrolled\",\n showResetButton = false,\n onReset,\n showActiveFilterCount = false,\n className,\n enableSorting,\n onFilterAdded,\n onFilterRemoved,\n renderAddFilterButton,\n } = props;\n\n const objectType = objectSet.$objectSetInternals.def;\n\n const {\n filterStates,\n setFilterState,\n perFilterWhereClauses,\n activeFilterCount,\n reset,\n } = useFilterListState(props);\n\n const uncontrolledAddFilterMode = addFilterMode === \"uncontrolled\";\n\n const getIsVisible = useCallback(\n (def: FilterDefinitionUnion<Q>) => def.isVisible !== false,\n [],\n );\n\n const {\n visibleDefinitions: managedVisibleDefinitions,\n hiddenDefinitions: managedHiddenDefinitions,\n showFilter,\n hideFilter,\n hasVisibilityChanges,\n resetVisibility,\n } = useFilterVisibility(filterDefinitions, getFilterKey, getIsVisible);\n\n const handleReset = useCallback(() => {\n reset();\n resetVisibility();\n onReset?.();\n }, [reset, resetVisibility, onReset]);\n\n const simpleVisibleDefinitions = useMemo(() => {\n if (filterDefinitions == null) {\n return undefined;\n }\n return filterDefinitions.filter(\n (def: FilterDefinitionUnion<Q>) => def.isVisible !== false,\n );\n }, [filterDefinitions]);\n\n const effectiveVisibleDefinitions = uncontrolledAddFilterMode\n ? managedVisibleDefinitions\n : simpleVisibleDefinitions;\n\n const handleFilterRemoved = useCallback(\n (filterKey: string) => {\n if (uncontrolledAddFilterMode) {\n hideFilter(filterKey);\n }\n onFilterRemoved?.(filterKey);\n },\n [uncontrolledAddFilterMode, hideFilter, onFilterRemoved],\n );\n\n const handleFilterShown = useCallback(\n (filterKey: string) => {\n showFilter(filterKey);\n onFilterAdded?.(filterKey, filterDefinitions ?? []);\n },\n [showFilter, onFilterAdded, filterDefinitions],\n );\n\n const hiddenFilterItems = useMemo(\n () =>\n managedHiddenDefinitions.map((def) => ({\n key: getFilterKey(def),\n label: getFilterLabel(def),\n })),\n [managedHiddenDefinitions],\n );\n\n const effectiveRenderAddFilterButton = useMemo(() => {\n if (uncontrolledAddFilterMode) {\n if (managedHiddenDefinitions.length === 0) {\n return undefined;\n }\n return () => (\n <AddFilterPopover\n hiddenDefinitions={hiddenFilterItems}\n onShowFilter={handleFilterShown}\n renderTrigger={renderAddFilterButton}\n />\n );\n }\n return renderAddFilterButton;\n }, [\n uncontrolledAddFilterMode,\n managedHiddenDefinitions.length,\n hiddenFilterItems,\n handleFilterShown,\n renderAddFilterButton,\n ]);\n\n const effectiveOnFilterRemoved = uncontrolledAddFilterMode\n ? handleFilterRemoved\n : onFilterRemoved;\n\n const renderInput = useCallback<RenderFilterInput<FilterDefinitionUnion<Q>>>(\n (\n {\n definition,\n filterKey,\n filterState,\n onFilterStateChanged,\n searchQuery,\n excludeRowOpen,\n },\n ) => (\n <FilterInput\n objectType={objectType}\n objectSet={objectSet}\n definition={definition}\n filterState={filterState}\n onFilterStateChanged={onFilterStateChanged}\n whereClause={perFilterWhereClauses.get(filterKey)\n ?? ({} as WhereClause<Q>)}\n searchQuery={searchQuery}\n excludeRowOpen={excludeRowOpen}\n />\n ),\n [objectType, objectSet, perFilterWhereClauses],\n );\n\n return (\n <BaseFilterList\n title={title}\n titleIcon={titleIcon}\n collapsed={collapsed}\n onCollapsedChange={onCollapsedChange}\n filterDefinitions={effectiveVisibleDefinitions}\n filterStates={filterStates}\n onFilterStateChanged={setFilterState}\n renderInput={renderInput}\n getFilterKey={getFilterKey}\n getFilterLabel={getFilterLabel}\n activeFilterCount={activeFilterCount}\n onReset={handleReset}\n showResetButton={showResetButton}\n showActiveFilterCount={showActiveFilterCount}\n hasVisibilityChanges={hasVisibilityChanges}\n enableSorting={enableSorting}\n onFilterRemoved={effectiveOnFilterRemoved}\n className={className}\n renderAddFilterButton={effectiveRender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iBAAiB,EAAEiC,2BAA4B;IAC/CpB,YAAY,EAAEA,YAAa;IAC3BqC,oBAAoB,EAAEpC,cAAe;IACrCiC,WAAW,EAAEA,WAAY;IACzBxD,YAAY,EAAEA,YAAa;IAC3BC,cAAc,EAAEA,cAAe;IAC/BwB,iBAAiB,EAAEA,iBAAkB;IACrCb,OAAO,EAAE0B,WAAY;IACrB3B,eAAe,EAAEA,eAAgB;IACjCE,qBAAqB,EAAEA,qBAAsB;IAC7CuB,oBAAoB,EAAEA,oBAAqB;IAC3CrB,aAAa,EAAEA,aAAc;IAC7BE,eAAe,EAAEsC,wBAAyB;IAC1CzC,SAAS,EAAEA,SAAU;IACrBI,qBAAqB,EAAEgC;EAA+B,CACvD,CAAC;AAEN","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"FilterList.js","names":["React","useCallback","useMemo","AddFilterPopover","BaseFilterList","FilterInput","useFilterListState","useFilterVisibility","getFilterKey","getFilterLabel","FilterList","props","objectSet","title","titleIcon","collapsed","onCollapsedChange","filterDefinitions","addFilterMode","showResetButton","onReset","showActiveFilterCount","className","enableSorting","onFilterAdded","onFilterRemoved","renderAddFilterButton","objectType","$objectSetInternals","def","filterStates","setFilterState","clearFilterState","perFilterWhereClauses","activeFilterCount","reset","uncontrolledAddFilterMode","getIsVisible","isVisible","visibleDefinitions","managedVisibleDefinitions","hiddenDefinitions","managedHiddenDefinitions","showFilter","hideFilter","hasVisibilityChanges","resetVisibility","handleReset","simpleVisibleDefinitions","undefined","filter","effectiveVisibleDefinitions","handleFilterRemoved","filterKey","handleFilterShown","hiddenFilterItems","map","key","label","effectiveRenderAddFilterButton","length","createElement","onShowFilter","renderTrigger","effectiveOnFilterRemoved","renderInput","definition","filterState","onFilterStateChanged","searchQuery","excludeRowOpen","whereClause","get"],"sources":["FilterList.tsx"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { ObjectTypeDefinition, WhereClause } from \"@osdk/api\";\nimport React, { useCallback, useMemo } from \"react\";\nimport { AddFilterPopover } from \"./base/AddFilterPopover.js\";\nimport { BaseFilterList } from \"./base/BaseFilterList.js\";\nimport type { RenderFilterInput } from \"./base/BaseFilterListApi.js\";\nimport { FilterInput } from \"./FilterInput.js\";\nimport type {\n FilterDefinitionUnion,\n FilterListProps,\n} from \"./FilterListApi.js\";\nimport { useFilterListState } from \"./hooks/useFilterListState.js\";\nimport { useFilterVisibility } from \"./hooks/useFilterVisibility.js\";\nimport { getFilterKey } from \"./utils/getFilterKey.js\";\nimport { getFilterLabel } from \"./utils/getFilterLabel.js\";\n\nexport function FilterList<Q extends ObjectTypeDefinition>(\n props: FilterListProps<Q>,\n): React.ReactElement {\n const {\n objectSet,\n title,\n titleIcon,\n collapsed,\n onCollapsedChange,\n filterDefinitions,\n addFilterMode = \"uncontrolled\",\n showResetButton = false,\n onReset,\n showActiveFilterCount = false,\n className,\n enableSorting,\n onFilterAdded,\n onFilterRemoved,\n renderAddFilterButton,\n } = props;\n\n const objectType = objectSet.$objectSetInternals.def;\n\n const {\n filterStates,\n setFilterState,\n clearFilterState,\n perFilterWhereClauses,\n activeFilterCount,\n reset,\n } = useFilterListState(props);\n\n const uncontrolledAddFilterMode = addFilterMode === \"uncontrolled\";\n\n const getIsVisible = useCallback(\n (def: FilterDefinitionUnion<Q>) => def.isVisible !== false,\n [],\n );\n\n const {\n visibleDefinitions: managedVisibleDefinitions,\n hiddenDefinitions: managedHiddenDefinitions,\n showFilter,\n hideFilter,\n hasVisibilityChanges,\n resetVisibility,\n } = useFilterVisibility(filterDefinitions, getFilterKey, getIsVisible);\n\n const handleReset = useCallback(() => {\n reset();\n resetVisibility();\n onReset?.();\n }, [reset, resetVisibility, onReset]);\n\n const simpleVisibleDefinitions = useMemo(() => {\n if (filterDefinitions == null) {\n return undefined;\n }\n return filterDefinitions.filter(\n (def: FilterDefinitionUnion<Q>) => def.isVisible !== false,\n );\n }, [filterDefinitions]);\n\n const effectiveVisibleDefinitions = uncontrolledAddFilterMode\n ? managedVisibleDefinitions\n : simpleVisibleDefinitions;\n\n const handleFilterRemoved = useCallback(\n (filterKey: string) => {\n clearFilterState(filterKey);\n if (uncontrolledAddFilterMode) {\n hideFilter(filterKey);\n }\n onFilterRemoved?.(filterKey);\n },\n [clearFilterState, uncontrolledAddFilterMode, hideFilter, onFilterRemoved],\n );\n\n const handleFilterShown = useCallback(\n (filterKey: string) => {\n showFilter(filterKey);\n onFilterAdded?.(filterKey, filterDefinitions ?? []);\n },\n [showFilter, onFilterAdded, filterDefinitions],\n );\n\n const hiddenFilterItems = useMemo(\n () =>\n managedHiddenDefinitions.map((def) => ({\n key: getFilterKey(def),\n label: getFilterLabel(def),\n })),\n [managedHiddenDefinitions],\n );\n\n const effectiveRenderAddFilterButton = useMemo(() => {\n if (uncontrolledAddFilterMode) {\n if (managedHiddenDefinitions.length === 0) {\n return undefined;\n }\n return () => (\n <AddFilterPopover\n hiddenDefinitions={hiddenFilterItems}\n onShowFilter={handleFilterShown}\n renderTrigger={renderAddFilterButton}\n />\n );\n }\n return renderAddFilterButton;\n }, [\n uncontrolledAddFilterMode,\n managedHiddenDefinitions.length,\n hiddenFilterItems,\n handleFilterShown,\n renderAddFilterButton,\n ]);\n\n const effectiveOnFilterRemoved = uncontrolledAddFilterMode\n ? handleFilterRemoved\n : onFilterRemoved;\n\n const renderInput = useCallback<RenderFilterInput<FilterDefinitionUnion<Q>>>(\n (\n {\n definition,\n filterKey,\n filterState,\n onFilterStateChanged,\n searchQuery,\n excludeRowOpen,\n },\n ) => (\n <FilterInput\n objectType={objectType}\n objectSet={objectSet}\n definition={definition}\n filterState={filterState}\n onFilterStateChanged={onFilterStateChanged}\n whereClause={perFilterWhereClauses.get(filterKey)\n ?? ({} as WhereClause<Q>)}\n searchQuery={searchQuery}\n excludeRowOpen={excludeRowOpen}\n />\n ),\n [objectType, objectSet, perFilterWhereClauses],\n );\n\n return (\n <BaseFilterList\n title={title}\n titleIcon={titleIcon}\n collapsed={collapsed}\n onCollapsedChange={onCollapsedChange}\n filterDefinitions={effectiveVisibleDefinitions}\n filterStates={filterStates}\n onFilterStateChanged={setFilterState}\n renderInput={renderInput}\n getFilterKey={getFilterKey}\n getFilterLabel={getFilterLabel}\n activeFilterCount={activeFilterCount}\n onReset={handleReset}\n showResetButton={showResetButton}\n showActiveFilterCount={showActiveFilterCount}\n hasVisibilityChanges={hasVisibilityChanges}\n enableSorting={enableSorting}\n onFilterRemoved={effectiveOnFilterRemoved}\n className={className}\n renderAddFilterButton={effectiveRenderAddFilterButton}\n />\n );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,OAAOA,KAAK,IAAIC,WAAW,EAAEC,OAAO,QAAQ,OAAO;AACnD,SAASC,gBAAgB,QAAQ,4BAA4B;AAC7D,SAASC,cAAc,QAAQ,0BAA0B;AAEzD,SAASC,WAAW,QAAQ,kBAAkB;AAK9C,SAASC,kBAAkB,QAAQ,+BAA+B;AAClE,SAASC,mBAAmB,QAAQ,gCAAgC;AACpE,SAASC,YAAY,QAAQ,yBAAyB;AACtD,SAASC,cAAc,QAAQ,2BAA2B;AAE1D,OAAO,SAASC,UAAUA,CACxBC,KAAyB,EACL;EACpB,MAAM;IACJC,SAAS;IACTC,KAAK;IACLC,SAAS;IACTC,SAAS;IACTC,iBAAiB;IACjBC,iBAAiB;IACjBC,aAAa,GAAG,cAAc;IAC9BC,eAAe,GAAG,KAAK;IACvBC,OAAO;IACPC,qBAAqB,GAAG,KAAK;IAC7BC,S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W,CAC7B,CACE;IACEiE,UAAU;IACVb,SAAS;IACTc,WAAW;IACXC,oBAAoB;IACpBC,WAAW;IACXC;EACF,CAAC,kBAEDtE,KAAA,CAAA6D,aAAA,CAACxD,WAAW;IACVsB,UAAU,EAAEA,UAAW;IACvBf,SAAS,EAAEA,SAAU;IACrBsD,UAAU,EAAEA,UAAW;IACvBC,WAAW,EAAEA,WAAY;IACzBC,oBAAoB,EAAEA,oBAAqB;IAC3CG,WAAW,EAAEtC,qBAAqB,CAACuC,GAAG,CAACnB,SAAS,CAAC,IAC3C,CAAC,CAAqB;IAC5BgB,WAAW,EAAEA,WAAY;IACzBC,cAAc,EAAEA;EAAe,CAChC,CACF,EACD,CAAC3C,UAAU,EAAEf,SAAS,EAAEqB,qBAAqB,CAC/C,CAAC;EAED,oBACEjC,KAAA,CAAA6D,aAAA,CAACzD,cAAc;IACbS,KAAK,EAAEA,KAAM;IACbC,SAAS,EAAEA,SAAU;IACrBC,SAAS,EAAEA,SAAU;IACrBC,iBAAiB,EAAEA,iBAAkB;IACrCC,iBAAiB,EAAEkC,2BAA4B;IAC/CrB,YAAY,EAAEA,YAAa;IAC3BsC,oBAAoB,EAAErC,cAAe;IACrCkC,WAAW,EAAEA,WAAY;IACzBzD,YAAY,EAAEA,YAAa;IAC3BC,cAAc,EAAEA,cAAe;IAC/ByB,iBAAiB,EAAEA,iBAAkB;IACrCd,OAAO,EAAE2B,WAAY;IACrB5B,eAAe,EAAEA,eAAgB;IACjCE,qBAAqB,EAAEA,qBAAsB;IAC7CwB,oBAAoB,EAAEA,oBAAqB;IAC3CtB,aAAa,EAAEA,aAAc;IAC7BE,eAAe,EAAEuC,wBAAyB;IAC1C1C,SAAS,EAAEA,SAAU;IACrBI,qBAAqB,EAAEiC;EAA+B,CACvD,CAAC;AAEN","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FilterListApi.js","names":[],"sources":["FilterListApi.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type {\n LinkNames,\n ObjectSet,\n ObjectTypeDefinition,\n WhereClause,\n} from \"@osdk/api\";\nimport type React from \"react\";\nimport type { ReactNode } from \"react\";\nimport type {\n FilterState as FilterStateType,\n PropertyFilterDefinition,\n} from \"./FilterListItemApi.js\";\nimport type { CustomFilterDefinition } from \"./types/CustomRendererTypes.js\";\nimport type { KeywordSearchFilterDefinition } from \"./types/KeywordSearchTypes.js\";\nimport type {\n HasLinkFilterDefinition,\n LinkedPropertyFilterDefinition,\n} from \"./types/LinkedFilterTypes.js\";\n\n/**\n * Union type of all filter definition types\n */\nexport type FilterDefinitionUnion<Q extends ObjectTypeDefinition> =\n | PropertyFilterDefinition<Q>\n | HasLinkFilterDefinition<Q>\n | LinkedPropertyFilterDefinition<Q, LinkNames<Q>>\n | KeywordSearchFilterDefinition<Q>\n | CustomFilterDefinition<Q>;\n\n/**\n * Extract the key from a filter definition union\n */\nexport type FilterKey<Q extends ObjectTypeDefinition> =\n FilterDefinitionUnion<Q> extends infer D ? D extends { key: infer K } ? K\n : D extends { linkName: infer L } ? L\n : never\n : never;\n\n/**\n * Extract the filter state from a filter definition union\n */\nexport type FilterState<Q extends ObjectTypeDefinition> =\n FilterDefinitionUnion<Q> extends infer D\n ? D extends { filterState: infer S } ? S\n : never\n : never;\n\n/**\n * Map from filter definition objects to their current state.\n * Uses object identity for keys, ensuring stable lookups across reorders.\n */\nexport type FilterStatesMap<Q extends ObjectTypeDefinition> = Map<\n FilterDefinitionUnion<Q>,\n FilterStateType\n>;\n\nexport interface FilterListProps<Q extends ObjectTypeDefinition> {\n /**\n * The set of objects to be filtered\n */\n objectSet: ObjectSet<Q>;\n\n /**\n * Optional title to display in the filter list header\n */\n title?: ReactNode;\n\n /**\n * Optional icon to display next to the title\n */\n titleIcon?: React.ReactNode;\n\n /**\n * The definition for all supported filter items in the list\n * If not supplied, all filterable properties will be available\n */\n filterDefinitions?: Array<FilterDefinitionUnion<Q>>;\n\n /**\n * The current where clause to filter the objectSet.\n * If provided, the filter clause is controlled.\n */\n filterClause?: WhereClause<Q>;\n\n /**\n * Called when the filter clause changes.\n *
|
|
1
|
+
{"version":3,"file":"FilterListApi.js","names":[],"sources":["FilterListApi.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type {\n LinkNames,\n ObjectSet,\n ObjectTypeDefinition,\n WhereClause,\n} from \"@osdk/api\";\nimport type React from \"react\";\nimport type { ReactNode } from \"react\";\nimport type {\n FilterState as FilterStateType,\n PropertyFilterDefinition,\n} from \"./FilterListItemApi.js\";\nimport type { CustomFilterDefinition } from \"./types/CustomRendererTypes.js\";\nimport type { KeywordSearchFilterDefinition } from \"./types/KeywordSearchTypes.js\";\nimport type {\n HasLinkFilterDefinition,\n LinkedPropertyFilterDefinition,\n} from \"./types/LinkedFilterTypes.js\";\n\n/**\n * Union type of all filter definition types\n */\nexport type FilterDefinitionUnion<Q extends ObjectTypeDefinition> =\n | PropertyFilterDefinition<Q>\n | HasLinkFilterDefinition<Q>\n | LinkedPropertyFilterDefinition<Q, LinkNames<Q>>\n | KeywordSearchFilterDefinition<Q>\n | CustomFilterDefinition<Q>;\n\n/**\n * Extract the key from a filter definition union\n */\nexport type FilterKey<Q extends ObjectTypeDefinition> =\n FilterDefinitionUnion<Q> extends infer D ? D extends { key: infer K } ? K\n : D extends { linkName: infer L } ? L\n : never\n : never;\n\n/**\n * Extract the filter state from a filter definition union\n */\nexport type FilterState<Q extends ObjectTypeDefinition> =\n FilterDefinitionUnion<Q> extends infer D\n ? D extends { filterState: infer S } ? S\n : never\n : never;\n\n/**\n * Map from filter definition objects to their current state.\n * Uses object identity for keys, ensuring stable lookups across reorders.\n */\nexport type FilterStatesMap<Q extends ObjectTypeDefinition> = Map<\n FilterDefinitionUnion<Q>,\n FilterStateType\n>;\n\nexport interface FilterListProps<Q extends ObjectTypeDefinition> {\n /**\n * The set of objects to be filtered\n */\n objectSet: ObjectSet<Q>;\n\n /**\n * Optional title to display in the filter list header\n */\n title?: ReactNode;\n\n /**\n * Optional icon to display next to the title\n */\n titleIcon?: React.ReactNode;\n\n /**\n * The definition for all supported filter items in the list\n * If not supplied, all filterable properties will be available\n */\n filterDefinitions?: Array<FilterDefinitionUnion<Q>>;\n\n /**\n * The current where clause to filter the objectSet.\n * If provided, the filter clause is controlled.\n */\n filterClause?: WhereClause<Q>;\n\n /**\n * Called when the filter clause changes.\n * Required in controlled mode.\n *\n * @param newClause The updated filter clause\n */\n onFilterClauseChanged?: (newClause: WhereClause<Q>) => void;\n\n /**\n * Called when filter state changes\n *\n * @param definition The filter definition whose state changed\n * @param newState The updated filter state\n */\n onFilterStateChanged?: (\n definition: FilterDefinitionUnion<Q>,\n newState: FilterStateType,\n ) => void;\n\n /**\n * Controls how filter visibility (add/remove) is managed.\n *\n * - `\"uncontrolled\"` (default): FilterList manages visibility internally.\n * An \"Add filter\" popover is rendered for filters with `isVisible: false`,\n * and each visible filter shows a remove button.\n * - `\"controlled\"`: The consumer manages which filters are visible via\n * `filterDefinitions`. Filters with `isVisible: false` are excluded from\n * the rendered list.\n *\n * @default \"uncontrolled\"\n */\n addFilterMode?: \"controlled\" | \"uncontrolled\";\n\n /**\n * Called when a filter is added (shown).\n *\n * In uncontrolled mode, this fires when a user selects a hidden filter\n * from the \"Add filter\" popover.\n *\n * @param filterKey The key of the added filter\n * @param newDefinitions The current filter definitions array\n */\n onFilterAdded?: (\n filterKey: FilterKey<Q>,\n newDefinitions: Array<FilterDefinitionUnion<Q>>,\n ) => void;\n\n /**\n * Called when a filter is removed (hidden).\n *\n * In uncontrolled mode, this fires as a notification after the filter\n * is hidden internally.\n *\n * @param filterKey The key of the removed filter\n */\n onFilterRemoved?: (filterKey: FilterKey<Q>) => void;\n\n /**\n * Enable drag-and-drop reordering of filters.\n * When true, drag handles are rendered and filters can be reordered.\n * Reorder state is managed internally; consumers who need to track order\n * should use controlled filterDefinitions.\n */\n enableSorting?: boolean;\n\n /**\n * Whether the filter list panel is collapsed\n */\n collapsed?: boolean;\n\n /**\n * Called when the collapsed state changes\n */\n onCollapsedChange?: (collapsed: boolean) => void;\n\n /**\n * Initial filter states for hydrating from external storage.\n * These states are merged over definition defaults on mount.\n * Use onFilterStateChanged to persist state changes externally.\n */\n initialFilterStates?: Map<string, FilterStateType>;\n\n /**\n * Show reset filters button in header\n */\n showResetButton?: boolean;\n\n /**\n * Called when reset button is clicked\n */\n onReset?: () => void;\n\n /**\n * Show count of active filters in header\n */\n showActiveFilterCount?: boolean;\n\n /**\n * Additional CSS class name\n */\n className?: string;\n\n /**\n * Custom render function for the \"Add filter\" button.\n *\n * - In uncontrolled mode: customizes the trigger element for the built-in\n * add-filter popover. The popover behavior is handled automatically.\n * - In controlled mode: replaces the entire add-filter button area.\n * The consumer is responsible for all add-filter behavior.\n */\n renderAddFilterButton?: () => React.ReactNode;\n}\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FilterListItemApi.js","names":[],"sources":["FilterListItemApi.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type {\n CompileTimeMetadata,\n ObjectSet,\n ObjectTypeDefinition,\n PropertyKeys,\n WirePropertyTypes,\n} from \"@osdk/api\";\nimport type { CustomFilterState } from \"./types/CustomRendererTypes.js\";\nimport type { KeywordSearchFilterState } from \"./types/KeywordSearchTypes.js\";\nimport type {\n HasLinkFilterState,\n LinkedPropertyFilterState,\n} from \"./types/LinkedFilterTypes.js\";\n\n/**\n * Helper type to extract the property type from an ObjectTypeDefinition given a property key\n */\nexport type PropertyTypeFromKey<\n Q extends ObjectTypeDefinition,\n K extends PropertyKeys<Q>,\n> = CompileTimeMetadata<Q>[\"properties\"][K][\"type\"];\n\n/**\n * All available filter component types\n */\nexport type FilterComponentType =\n | \"LISTOGRAM\"\n | \"DATE_RANGE\"\n | \"NUMBER_RANGE\"\n | \"TEXT_TAGS\"\n | \"CONTAINS_TEXT\"\n | \"SINGLE_SELECT\"\n | \"MULTI_SELECT\"\n | \"SINGLE_DATE\"\n | \"MULTI_DATE\"\n | \"TIMELINE\"\n | \"
|
|
1
|
+
{"version":3,"file":"FilterListItemApi.js","names":[],"sources":["FilterListItemApi.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type {\n CompileTimeMetadata,\n ObjectSet,\n ObjectTypeDefinition,\n PropertyKeys,\n WirePropertyTypes,\n} from \"@osdk/api\";\nimport type { CustomFilterState } from \"./types/CustomRendererTypes.js\";\nimport type { KeywordSearchFilterState } from \"./types/KeywordSearchTypes.js\";\nimport type {\n HasLinkFilterState,\n LinkedPropertyFilterState,\n} from \"./types/LinkedFilterTypes.js\";\n\n/**\n * Helper type to extract the property type from an ObjectTypeDefinition given a property key\n */\nexport type PropertyTypeFromKey<\n Q extends ObjectTypeDefinition,\n K extends PropertyKeys<Q>,\n> = CompileTimeMetadata<Q>[\"properties\"][K][\"type\"];\n\n/**\n * All available filter component types\n */\nexport type FilterComponentType =\n | \"LISTOGRAM\"\n | \"DATE_RANGE\"\n | \"NUMBER_RANGE\"\n | \"TEXT_TAGS\"\n | \"CONTAINS_TEXT\"\n | \"SINGLE_SELECT\"\n | \"MULTI_SELECT\"\n | \"SINGLE_DATE\"\n | \"MULTI_DATE\"\n | \"TIMELINE\"\n | \"TOGGLE\";\n\n/**\n * Gets valid component types for a given property type\n */\nexport type ValidComponentsForPropertyType<P extends WirePropertyTypes> =\n P extends \"boolean\" ? \"LISTOGRAM\" | \"SINGLE_SELECT\" | \"TOGGLE\"\n : P extends \"string\" ?\n | \"LISTOGRAM\"\n | \"TEXT_TAGS\"\n | \"CONTAINS_TEXT\"\n | \"SINGLE_SELECT\"\n | \"MULTI_SELECT\"\n : P extends \"datetime\" | \"timestamp\"\n ? \"DATE_RANGE\" | \"SINGLE_DATE\" | \"MULTI_DATE\" | \"TIMELINE\"\n : P extends\n | \"double\"\n | \"integer\"\n | \"long\"\n | \"float\"\n | \"short\"\n | \"byte\"\n | \"decimal\" ? \"NUMBER_RANGE\" | \"SINGLE_SELECT\" | \"MULTI_SELECT\"\n : never;\n\n/**\n * Union of all possible filter states\n */\nexport type FilterState =\n | ExactMatchFilterState<string | boolean>\n | DateRangeFilterState\n | ContainsTextFilterState\n | NumberRangeFilterState\n | SelectFilterState<string | boolean | number>\n | SelectFilterState<Date>\n | TimelineFilterState\n | ToggleFilterState\n | HasLinkFilterState\n | LinkedPropertyFilterState\n | KeywordSearchFilterState\n | CustomFilterState;\n\n/**\n * Maps component types to their corresponding state types\n */\nexport interface FilterStateByComponentType {\n LISTOGRAM: ExactMatchFilterState<string | boolean>;\n DATE_RANGE: DateRangeFilterState;\n TEXT_TAGS: ExactMatchFilterState<string>;\n CONTAINS_TEXT: ContainsTextFilterState;\n NUMBER_RANGE: NumberRangeFilterState;\n SINGLE_SELECT: SelectFilterState<string | boolean | number>;\n MULTI_SELECT: SelectFilterState<string | boolean | number>;\n SINGLE_DATE: SelectFilterState<Date>;\n MULTI_DATE: SelectFilterState<Date>;\n TIMELINE: TimelineFilterState;\n TOGGLE: ToggleFilterState;\n}\n\n/**\n * All filter state discriminator types\n */\nexport type FilterStateType =\n | \"EXACT_MATCH\"\n | \"DATE_RANGE\"\n | \"NUMBER_RANGE\"\n | \"CONTAINS_TEXT\"\n | \"SELECT\"\n | \"TIMELINE\"\n | \"TOGGLE\"\n | \"hasLink\"\n | \"linkedProperty\"\n | \"keywordSearch\"\n | \"custom\";\n\n/**\n * Base interface for all filter states\n * Contains common properties shared across all filter types\n */\nexport interface BaseFilterState {\n /**\n * The type of filter component\n */\n type: FilterStateType;\n\n /**\n * If true, the objects satisfying the filter are excluded\n * @default false\n */\n isExcluding?: boolean;\n\n /**\n * If true, include objects that have no value\n * @default false\n */\n includeNull?: boolean;\n}\n\nexport interface ExactMatchFilterState<T = string | boolean>\n extends BaseFilterState\n{\n type: \"EXACT_MATCH\";\n values: T[];\n}\n\nexport interface DateRangeFilterState extends BaseFilterState {\n type: \"DATE_RANGE\";\n /**\n * The earliest date the user can select\n */\n minValue?: Date;\n /**\n * The latest date the user can select\n */\n maxValue?: Date;\n}\n\nexport interface ContainsTextFilterState extends BaseFilterState {\n type: \"CONTAINS_TEXT\";\n value?: string;\n}\n\nexport interface NumberRangeFilterState extends BaseFilterState {\n type: \"NUMBER_RANGE\";\n /**\n * Minimum numeric value (inclusive)\n */\n minValue?: number;\n /**\n * Maximum numeric value (inclusive)\n */\n maxValue?: number;\n}\n\n/**\n * Consolidated state type for select-based filters.\n * Used by SINGLE_SELECT, MULTI_SELECT, SINGLE_DATE, and MULTI_DATE.\n */\nexport interface SelectFilterState<T = string | boolean | number | Date>\n extends BaseFilterState\n{\n type: \"SELECT\";\n selectedValues: T[];\n}\n\nexport interface TimelineFilterState extends BaseFilterState {\n type: \"TIMELINE\";\n startDate?: Date;\n endDate?: Date;\n granularity?: \"day\" | \"week\" | \"month\" | \"quarter\" | \"year\";\n}\n\nexport interface ToggleFilterState extends BaseFilterState {\n type: \"TOGGLE\";\n enabled: boolean;\n}\n\n/**\n * A property filter definition specifies configuration for filtering on a single property\n *\n * The component type C must be compatible with the property type derived from the key.\n * For example, boolean properties can only use LISTOGRAM or SINGLE_SELECT,\n * while string properties can use LISTOGRAM, TEXT_TAGS, CONTAINS_TEXT, SINGLE_SELECT, or MULTI_SELECT.\n */\nexport interface PropertyFilterDefinition<\n Q extends ObjectTypeDefinition,\n K extends PropertyKeys<Q> = PropertyKeys<Q>,\n C extends ValidComponentsForPropertyType<\n PropertyTypeFromKey<Q, K>\n > = ValidComponentsForPropertyType<PropertyTypeFromKey<Q, K>>,\n> {\n /**\n * Discriminator for filter definition type\n */\n type: \"PROPERTY\";\n\n /**\n * Optional unique identifier for stable keying across filter reorders.\n */\n id?: string;\n\n /**\n * The property key to filter on\n */\n key: K;\n\n /**\n * Display label for the filter\n */\n label?: string;\n\n /**\n * The filter component type to render\n * Must be compatible with the property type derived from the key, see ValidComponentsForPropertyType\n */\n filterComponent: C;\n\n /**\n * The current state of the filter.\n * If provided, the filter is controlled.\n */\n filterState: FilterStateByComponentType[C];\n\n /**\n * Maps filter values to colors for visual differentiation.\n * Used by LISTOGRAM (per-row bar colors).\n */\n colorMap?: Record<string, string>;\n\n /**\n * Configuration for LISTOGRAM display mode.\n * Only applies when filterComponent is \"LISTOGRAM\".\n */\n listogramConfig?: {\n displayMode?: \"full\" | \"count\" | \"minimal\";\n /**\n * Number of items shown before \"View all\" link appears\n * @default 5\n */\n maxVisibleItems?: number;\n };\n\n /**\n * Controls whether this filter is rendered.\n * When false, the filter is hidden but its state is preserved.\n * @default true\n */\n isVisible?: boolean;\n}\n\n/**\n * Props for a single filter list item component.\n * Extends PropertyFilterDefinition with runtime props for rendering.\n */\nexport interface FilterListItemProps<\n Q extends ObjectTypeDefinition,\n K extends PropertyKeys<Q> = PropertyKeys<Q>,\n C extends ValidComponentsForPropertyType<\n PropertyTypeFromKey<Q, K>\n > = ValidComponentsForPropertyType<PropertyTypeFromKey<Q, K>>,\n> extends PropertyFilterDefinition<Q, K, C> {\n objectSet: ObjectSet<Q>;\n\n /**\n * Called when the state of the filter changes.\n * Required in controlled mode.\n */\n onFilterStateChanged: (state: FilterStateByComponentType[C]) => void;\n\n onFilterRemoved?: (key: PropertyKeys<Q>) => void;\n}\n"],"mappings":"","ignoreList":[]}
|
|
@@ -14,33 +14,22 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
import {
|
|
18
|
-
import
|
|
17
|
+
import React, { memo } from "react";
|
|
18
|
+
import { SearchableMenu } from "../../base-components/searchable-menu/SearchableMenu.js";
|
|
19
19
|
import styles from "./AddFilterPopover.module.css";
|
|
20
20
|
function AddFilterPopoverInner({
|
|
21
21
|
hiddenDefinitions,
|
|
22
22
|
onShowFilter,
|
|
23
23
|
renderTrigger
|
|
24
24
|
}) {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
}, renderTrigger != null ? renderTrigger() : "+ Add filter"), /*#__PURE__*/React.createElement(Menu.Portal, null, /*#__PURE__*/React.createElement(Menu.Positioner, {
|
|
34
|
-
className: styles.positioner,
|
|
35
|
-
sideOffset: 4
|
|
36
|
-
}, /*#__PURE__*/React.createElement(Menu.Popup, {
|
|
37
|
-
className: styles.popup
|
|
38
|
-
}, hiddenDefinitions.map(item => /*#__PURE__*/React.createElement(Menu.Item, {
|
|
39
|
-
key: item.key,
|
|
40
|
-
className: styles.menuItem,
|
|
41
|
-
"data-key": item.key,
|
|
42
|
-
onClick: handleItemClick
|
|
43
|
-
}, item.label))))));
|
|
25
|
+
return /*#__PURE__*/React.createElement(SearchableMenu, {
|
|
26
|
+
items: hiddenDefinitions,
|
|
27
|
+
onItemSelected: onShowFilter,
|
|
28
|
+
trigger: renderTrigger != null ? renderTrigger() : "+ Add filter",
|
|
29
|
+
triggerClassName: renderTrigger == null ? styles.trigger : undefined,
|
|
30
|
+
searchPlaceholder: "Search filters",
|
|
31
|
+
emptyMessage: "No matching filters"
|
|
32
|
+
});
|
|
44
33
|
}
|
|
45
34
|
export const AddFilterPopover = /*#__PURE__*/memo(AddFilterPopoverInner);
|
|
46
35
|
//# sourceMappingURL=AddFilterPopover.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AddFilterPopover.js","names":["
|
|
1
|
+
{"version":3,"file":"AddFilterPopover.js","names":["React","memo","SearchableMenu","styles","AddFilterPopoverInner","hiddenDefinitions","onShowFilter","renderTrigger","createElement","items","onItemSelected","trigger","triggerClassName","undefined","searchPlaceholder","emptyMessage","AddFilterPopover"],"sources":["AddFilterPopover.tsx"],"sourcesContent":["/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React, { memo } from \"react\";\nimport { SearchableMenu } from \"../../base-components/searchable-menu/SearchableMenu.js\";\nimport styles from \"./AddFilterPopover.module.css\";\n\ninterface HiddenFilterItem {\n key: string;\n label: string;\n}\n\ninterface AddFilterPopoverProps {\n hiddenDefinitions: Array<HiddenFilterItem>;\n onShowFilter: (key: string) => void;\n renderTrigger?: () => React.ReactNode;\n}\n\nfunction AddFilterPopoverInner({\n hiddenDefinitions,\n onShowFilter,\n renderTrigger,\n}: AddFilterPopoverProps): React.ReactElement {\n return (\n <SearchableMenu\n items={hiddenDefinitions}\n onItemSelected={onShowFilter}\n trigger={renderTrigger != null ? renderTrigger() : \"+ Add filter\"}\n triggerClassName={renderTrigger == null ? styles.trigger : undefined}\n searchPlaceholder=\"Search filters\"\n emptyMessage=\"No matching filters\"\n />\n );\n}\n\nexport const AddFilterPopover: React.MemoExoticComponent<\n typeof AddFilterPopoverInner\n> = memo(AddFilterPopoverInner);\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAOA,KAAK,IAAIC,IAAI,QAAQ,OAAO;AACnC,SAASC,cAAc,QAAQ,yDAAyD;AACxF,OAAOC,MAAM,MAAM,+BAA+B;AAalD,SAASC,qBAAqBA,CAAC;EAC7BC,iBAAiB;EACjBC,YAAY;EACZC;AACqB,CAAC,EAAsB;EAC5C,oBACEP,KAAA,CAAAQ,aAAA,CAACN,cAAc;IACbO,KAAK,EAAEJ,iBAAkB;IACzBK,cAAc,EAAEJ,YAAa;IAC7BK,OAAO,EAAEJ,aAAa,IAAI,IAAI,GAAGA,aAAa,CAAC,CAAC,GAAG,cAAe;IAClEK,gBAAgB,EAAEL,aAAa,IAAI,IAAI,GAAGJ,MAAM,CAACQ,OAAO,GAAGE,SAAU;IACrEC,iBAAiB,EAAC,gBAAgB;IAClCC,YAAY,EAAC;EAAqB,CACnC,CAAC;AAEN;AAEA,OAAO,MAAMC,gBAEZ,gBAAGf,IAAI,CAACG,qBAAqB,CAAC","ignoreList":[]}
|
|
@@ -15,13 +15,17 @@
|
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
17
|
.trigger {
|
|
18
|
+
display: flex;
|
|
19
|
+
align-items: center;
|
|
20
|
+
justify-content: center;
|
|
18
21
|
font-family: var(--osdk-filter-header-font-family);
|
|
19
22
|
font-size: var(--osdk-filter-header-reset-font-size);
|
|
20
|
-
color: var(--osdk-
|
|
23
|
+
color: var(--osdk-typography-color-default-rest);
|
|
21
24
|
background: var(--osdk-filter-header-button-bg);
|
|
22
|
-
border:
|
|
25
|
+
border: var(--osdk-filter-list-addButton-border);
|
|
23
26
|
cursor: pointer;
|
|
24
27
|
padding: var(--osdk-filter-header-reset-padding);
|
|
28
|
+
min-height: var(--osdk-filter-list-addButton-height);
|
|
25
29
|
border-radius: var(--osdk-filter-header-button-border-radius);
|
|
26
30
|
transition: background-color var(--osdk-filter-header-button-transition);
|
|
27
31
|
width: 100%;
|
|
@@ -43,41 +47,3 @@
|
|
|
43
47
|
transition: none;
|
|
44
48
|
}
|
|
45
49
|
}
|
|
46
|
-
|
|
47
|
-
.positioner {
|
|
48
|
-
z-index: var(--osdk-surface-z-index-3);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
.popup {
|
|
52
|
-
background: var(--osdk-filter-item-menu-bg);
|
|
53
|
-
border: var(--osdk-filter-item-menu-border);
|
|
54
|
-
border-radius: var(--osdk-filter-item-menu-border-radius);
|
|
55
|
-
box-shadow: var(--osdk-filter-item-menu-shadow);
|
|
56
|
-
padding: var(--osdk-filter-item-menu-padding);
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
.menuItem {
|
|
60
|
-
display: flex;
|
|
61
|
-
align-items: center;
|
|
62
|
-
gap: var(--osdk-surface-spacing);
|
|
63
|
-
padding: var(--osdk-filter-item-menu-item-padding);
|
|
64
|
-
font-family: var(--osdk-filter-item-menu-item-font-family);
|
|
65
|
-
font-size: var(--osdk-filter-item-menu-item-font-size);
|
|
66
|
-
color: var(--osdk-filter-item-menu-item-color);
|
|
67
|
-
border-radius: var(--osdk-filter-item-menu-item-border-radius);
|
|
68
|
-
cursor: pointer;
|
|
69
|
-
border: none;
|
|
70
|
-
background: transparent;
|
|
71
|
-
width: 100%;
|
|
72
|
-
text-align: left;
|
|
73
|
-
|
|
74
|
-
&:hover,
|
|
75
|
-
&[data-highlighted] {
|
|
76
|
-
background: var(--osdk-filter-item-menu-item-bg-hover);
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
&:focus-visible {
|
|
80
|
-
outline: var(--osdk-filter-input-focus-outline-width) solid var(--osdk-filter-input-focus-outline-color);
|
|
81
|
-
outline-offset: var(--osdk-filter-input-focus-outline-offset);
|
|
82
|
-
}
|
|
83
|
-
}
|
|
@@ -72,7 +72,9 @@ export function BaseFilterList(props) {
|
|
|
72
72
|
showActiveFilterCount: showActiveFilterCount,
|
|
73
73
|
activeFilterCount: activeFilterCount,
|
|
74
74
|
hasVisibilityChanges: hasVisibilityChanges
|
|
75
|
-
}), /*#__PURE__*/React.createElement(
|
|
75
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
76
|
+
className: styles.scrollableContent
|
|
77
|
+
}, /*#__PURE__*/React.createElement(FilterListContent, {
|
|
76
78
|
filterDefinitions: filterDefinitions,
|
|
77
79
|
filterStates: filterStates,
|
|
78
80
|
onFilterStateChanged: onFilterStateChanged,
|
|
@@ -81,7 +83,7 @@ export function BaseFilterList(props) {
|
|
|
81
83
|
getFilterKey: getFilterKey,
|
|
82
84
|
getFilterLabel: getFilterLabel,
|
|
83
85
|
enableSorting: enableSorting
|
|
84
|
-
}), (renderAddFilterButton != null || onFilterAdded != null) && /*#__PURE__*/React.createElement("div", {
|
|
86
|
+
})), (renderAddFilterButton != null || onFilterAdded != null) && /*#__PURE__*/React.createElement("div", {
|
|
85
87
|
className: styles.addButtonContainer
|
|
86
88
|
}, renderAddFilterButton ? renderAddFilterButton() : /*#__PURE__*/React.createElement(Button, {
|
|
87
89
|
type: "button",
|