@osdk/react-components 0.2.0-beta.15 → 0.2.0-beta.17
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 +27 -0
- package/README.md +5 -3
- package/build/browser/base-components/action-button/ActionButton.module.css +0 -4
- package/build/browser/base-components/checkbox/Checkbox.module.css +0 -4
- package/build/browser/base-components/dialog/Dialog.module.css +0 -8
- package/build/browser/base-components/draggable-list/DraggableList.js +4 -2
- package/build/browser/base-components/draggable-list/DraggableList.js.map +1 -1
- package/build/browser/base-components/draggable-list/DraggableList.module.css +0 -8
- package/build/browser/base-components/tooltip/Tooltip.js +91 -0
- package/build/browser/base-components/tooltip/Tooltip.js.map +1 -0
- package/build/browser/base-components/tooltip/Tooltip.module.css +70 -0
- package/build/browser/base-components/tooltip/Tooltip.module.css.js +11 -0
- package/build/browser/base-components/tooltip/index.js +18 -0
- package/build/browser/base-components/tooltip/index.js.map +1 -0
- package/build/browser/filter-list/FilterInput.js +132 -0
- package/build/browser/filter-list/FilterInput.js.map +1 -0
- package/build/browser/filter-list/FilterList.js +91 -0
- package/build/browser/filter-list/FilterList.js.map +1 -0
- 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/{FilterList.js → BaseFilterList.js} +30 -31
- package/build/browser/filter-list/base/BaseFilterList.js.map +1 -0
- package/build/browser/filter-list/base/BaseFilterListApi.js +2 -0
- package/build/browser/filter-list/base/BaseFilterListApi.js.map +1 -0
- package/build/browser/filter-list/base/FilterIcons.js +63 -0
- package/build/browser/filter-list/base/FilterIcons.js.map +1 -0
- package/build/browser/filter-list/base/FilterList.module.css +22 -1
- package/build/browser/filter-list/base/FilterList.module.css.js +2 -0
- package/build/browser/filter-list/base/FilterListContent.js +21 -20
- package/build/browser/filter-list/base/FilterListContent.js.map +1 -1
- package/build/browser/filter-list/base/FilterListHeader.js +8 -3
- package/build/browser/filter-list/base/FilterListHeader.js.map +1 -1
- package/build/browser/filter-list/base/FilterListHeader.module.css +25 -1
- package/build/browser/filter-list/base/FilterListHeader.module.css.js +3 -0
- package/build/browser/filter-list/base/FilterListItem.js +36 -17
- package/build/browser/filter-list/base/FilterListItem.js.map +1 -1
- package/build/browser/filter-list/base/FilterListItem.module.css +58 -2
- package/build/browser/filter-list/base/FilterListItem.module.css.js +2 -0
- package/build/browser/filter-list/base/SortableFilterListItem.js +6 -6
- package/build/browser/filter-list/base/SortableFilterListItem.js.map +1 -1
- package/build/browser/filter-list/base/index.js +1 -2
- package/build/browser/filter-list/base/index.js.map +1 -1
- package/build/browser/filter-list/base/inputs/CheckboxListInput.js +34 -15
- package/build/browser/filter-list/base/inputs/CheckboxListInput.js.map +1 -1
- package/build/browser/filter-list/base/inputs/CheckboxListInput.module.css +13 -0
- package/build/browser/filter-list/base/inputs/CheckboxListInput.module.css.js +2 -1
- package/build/browser/filter-list/base/inputs/DateRangeInput.js.map +1 -1
- package/build/browser/filter-list/base/inputs/ListogramInput.js +17 -21
- package/build/browser/filter-list/base/inputs/ListogramInput.js.map +1 -1
- package/build/browser/filter-list/base/inputs/ListogramInput.module.css +25 -19
- package/build/browser/filter-list/base/inputs/MultiDateInput.module.css +6 -4
- package/build/browser/filter-list/base/inputs/MultiSelectInput.js +7 -14
- package/build/browser/filter-list/base/inputs/MultiSelectInput.js.map +1 -1
- package/build/browser/filter-list/base/inputs/MultiSelectInput.module.css +4 -1
- package/build/browser/filter-list/base/inputs/MultiSelectInput.module.css.js +1 -1
- package/build/browser/filter-list/base/inputs/NullValueWrapper.js +4 -23
- package/build/browser/filter-list/base/inputs/NullValueWrapper.js.map +1 -1
- package/build/browser/filter-list/base/inputs/NullValueWrapper.module.css +3 -2
- package/build/browser/filter-list/base/inputs/NumberRangeInput.js.map +1 -1
- package/build/browser/filter-list/base/inputs/RangeInput.js +2 -32
- package/build/browser/filter-list/base/inputs/RangeInput.js.map +1 -1
- package/build/browser/filter-list/base/inputs/RangeInput.module.css +16 -14
- package/build/browser/filter-list/base/inputs/SingleDateInput.module.css +2 -1
- package/build/browser/filter-list/base/inputs/SingleSelectInput.js +6 -13
- package/build/browser/filter-list/base/inputs/SingleSelectInput.js.map +1 -1
- package/build/browser/filter-list/base/inputs/TextTagsInput.js +6 -14
- package/build/browser/filter-list/base/inputs/TextTagsInput.js.map +1 -1
- package/build/browser/filter-list/base/inputs/TimelineInput.js +2 -2
- package/build/browser/filter-list/base/inputs/TimelineInput.js.map +1 -1
- package/build/browser/filter-list/base/inputs/TimelineInput.module.css +14 -12
- package/build/browser/filter-list/base/inputs/shared.module.css +5 -4
- package/build/browser/filter-list/hooks/useFilterListState.js +29 -9
- package/build/browser/filter-list/hooks/useFilterListState.js.map +1 -1
- package/build/browser/filter-list/hooks/usePropertyAggregation.js.map +1 -1
- package/build/browser/filter-list/inputs/CheckboxListFilterInput.js +56 -0
- package/build/browser/filter-list/inputs/CheckboxListFilterInput.js.map +1 -0
- package/build/browser/filter-list/inputs/ContainsTextFilterInput.js +38 -0
- package/build/browser/filter-list/inputs/ContainsTextFilterInput.js.map +1 -0
- package/build/browser/filter-list/inputs/DateRangeFilterInput.js +105 -0
- package/build/browser/filter-list/inputs/DateRangeFilterInput.js.map +1 -0
- package/build/browser/filter-list/inputs/LinkedPropertyInput.js +508 -0
- package/build/browser/filter-list/inputs/LinkedPropertyInput.js.map +1 -0
- package/build/browser/filter-list/inputs/ListogramFilterInput.js +62 -0
- package/build/browser/filter-list/inputs/ListogramFilterInput.js.map +1 -0
- package/build/browser/filter-list/inputs/MultiDateFilterInput.js +38 -0
- package/build/browser/filter-list/inputs/MultiDateFilterInput.js.map +1 -0
- package/build/browser/filter-list/inputs/MultiSelectFilterInput.js +55 -0
- package/build/browser/filter-list/inputs/MultiSelectFilterInput.js.map +1 -0
- package/build/browser/filter-list/inputs/NumberRangeFilterInput.js +105 -0
- package/build/browser/filter-list/inputs/NumberRangeFilterInput.js.map +1 -0
- package/build/browser/filter-list/inputs/PropertyFilterInput.js +129 -0
- package/build/browser/filter-list/inputs/PropertyFilterInput.js.map +1 -0
- package/build/browser/filter-list/inputs/SingleDateFilterInput.js +38 -0
- package/build/browser/filter-list/inputs/SingleDateFilterInput.js.map +1 -0
- package/build/browser/filter-list/inputs/SingleSelectFilterInput.js +55 -0
- package/build/browser/filter-list/inputs/SingleSelectFilterInput.js.map +1 -0
- package/build/browser/filter-list/inputs/TextTagsFilterInput.js +54 -0
- package/build/browser/filter-list/inputs/TextTagsFilterInput.js.map +1 -0
- package/build/browser/filter-list/inputs/TimelineFilterInput.js +49 -0
- package/build/browser/filter-list/inputs/TimelineFilterInput.js.map +1 -0
- package/build/browser/filter-list/inputs/ToggleFilterInput.js +36 -0
- package/build/browser/filter-list/inputs/ToggleFilterInput.js.map +1 -0
- package/build/browser/filter-list/types/AggregationTypes.js +2 -0
- package/build/browser/filter-list/types/AggregationTypes.js.map +1 -0
- package/build/browser/filter-list/types/LinkedFilterTypes.js.map +1 -1
- package/build/browser/filter-list/types/index.js +0 -2
- package/build/browser/filter-list/types/index.js.map +1 -1
- package/build/browser/filter-list/utils/filterStateSerialization.js +42 -0
- package/build/browser/filter-list/utils/filterStateSerialization.js.map +1 -0
- package/build/browser/filter-list/utils/filterStateToWhereClause.js +36 -13
- package/build/browser/filter-list/utils/filterStateToWhereClause.js.map +1 -1
- package/build/browser/filter-list/utils/filterValues.js +26 -0
- package/build/browser/filter-list/utils/filterValues.js.map +1 -1
- package/build/browser/object-table/ColumnConfigDialog.module.css +0 -9
- package/build/browser/object-table/DefaultCellRenderer.js +6 -1
- package/build/browser/object-table/DefaultCellRenderer.js.map +1 -1
- package/build/browser/object-table/EditableCell.js +76 -9
- package/build/browser/object-table/EditableCell.js.map +1 -1
- package/build/browser/object-table/EditableCell.module.css +47 -8
- package/build/browser/object-table/EditableCell.module.css.js +5 -1
- package/build/browser/object-table/MultiColumnSortDialog.js +4 -1
- package/build/browser/object-table/MultiColumnSortDialog.js.map +1 -1
- package/build/browser/object-table/MultiColumnSortDialog.module.css +0 -4
- package/build/browser/object-table/ObjectTable.js +4 -1
- package/build/browser/object-table/ObjectTable.js.map +1 -1
- package/build/browser/object-table/ObjectTableApi.js.map +1 -1
- package/build/browser/object-table/SelectionCells.js +1 -0
- package/build/browser/object-table/SelectionCells.js.map +1 -1
- package/build/browser/object-table/Table.js +2 -2
- package/build/browser/object-table/Table.js.map +1 -1
- package/build/browser/object-table/TableBody.js +1 -1
- package/build/browser/object-table/TableBody.js.map +1 -1
- package/build/browser/object-table/TableEditContainer.js +27 -16
- package/build/browser/object-table/TableEditContainer.js.map +1 -1
- package/build/browser/object-table/TableEditContainer.module.css +27 -0
- package/build/browser/object-table/TableEditContainer.module.css.js +5 -1
- package/build/browser/object-table/TableHeaderWithPopover.module.css +0 -12
- package/build/browser/object-table/TableRow.js +2 -2
- package/build/browser/object-table/TableRow.js.map +1 -1
- package/build/browser/object-table/hooks/useColumnDefs.js +2 -1
- package/build/browser/object-table/hooks/useColumnDefs.js.map +1 -1
- package/build/browser/object-table/hooks/useEditableTable.js +21 -2
- package/build/browser/object-table/hooks/useEditableTable.js.map +1 -1
- package/build/browser/object-table/utils/types.js.map +1 -1
- package/build/browser/public/experimental.js +4 -1
- package/build/browser/public/experimental.js.map +1 -1
- package/build/browser/shared/ErrorBoundary.module.css +14 -14
- package/build/browser/styles.css +354 -132
- package/build/cjs/public/experimental.cjs +2955 -2165
- package/build/cjs/public/experimental.cjs.map +1 -1
- package/build/cjs/public/experimental.css +669 -496
- package/build/cjs/public/experimental.css.map +1 -1
- package/build/cjs/public/experimental.d.cts +80 -6
- package/build/esm/base-components/action-button/ActionButton.module.css +0 -4
- package/build/esm/base-components/checkbox/Checkbox.module.css +0 -4
- package/build/esm/base-components/dialog/Dialog.module.css +0 -8
- package/build/esm/base-components/draggable-list/DraggableList.js +4 -2
- package/build/esm/base-components/draggable-list/DraggableList.js.map +1 -1
- package/build/esm/base-components/draggable-list/DraggableList.module.css +0 -8
- package/build/esm/base-components/tooltip/Tooltip.js +91 -0
- package/build/esm/base-components/tooltip/Tooltip.js.map +1 -0
- package/build/esm/base-components/tooltip/Tooltip.module.css +70 -0
- package/build/esm/base-components/tooltip/index.js +18 -0
- package/build/esm/base-components/tooltip/index.js.map +1 -0
- package/build/esm/filter-list/FilterInput.js +132 -0
- package/build/esm/filter-list/FilterInput.js.map +1 -0
- package/build/esm/filter-list/FilterList.js +91 -0
- package/build/esm/filter-list/FilterList.js.map +1 -0
- 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/{FilterList.js → BaseFilterList.js} +30 -31
- package/build/esm/filter-list/base/BaseFilterList.js.map +1 -0
- package/build/esm/filter-list/base/BaseFilterListApi.js +2 -0
- package/build/esm/filter-list/base/BaseFilterListApi.js.map +1 -0
- package/build/esm/filter-list/base/FilterIcons.js +63 -0
- package/build/esm/filter-list/base/FilterIcons.js.map +1 -0
- package/build/esm/filter-list/base/FilterList.module.css +22 -1
- package/build/esm/filter-list/base/FilterListContent.js +21 -20
- package/build/esm/filter-list/base/FilterListContent.js.map +1 -1
- package/build/esm/filter-list/base/FilterListHeader.js +8 -3
- package/build/esm/filter-list/base/FilterListHeader.js.map +1 -1
- package/build/esm/filter-list/base/FilterListHeader.module.css +25 -1
- package/build/esm/filter-list/base/FilterListItem.js +36 -17
- package/build/esm/filter-list/base/FilterListItem.js.map +1 -1
- package/build/esm/filter-list/base/FilterListItem.module.css +58 -2
- package/build/esm/filter-list/base/SortableFilterListItem.js +6 -6
- package/build/esm/filter-list/base/SortableFilterListItem.js.map +1 -1
- package/build/esm/filter-list/base/index.js +1 -2
- package/build/esm/filter-list/base/index.js.map +1 -1
- package/build/esm/filter-list/base/inputs/CheckboxListInput.js +34 -15
- package/build/esm/filter-list/base/inputs/CheckboxListInput.js.map +1 -1
- package/build/esm/filter-list/base/inputs/CheckboxListInput.module.css +13 -0
- package/build/esm/filter-list/base/inputs/DateRangeInput.js.map +1 -1
- package/build/esm/filter-list/base/inputs/ListogramInput.js +17 -21
- package/build/esm/filter-list/base/inputs/ListogramInput.js.map +1 -1
- package/build/esm/filter-list/base/inputs/ListogramInput.module.css +25 -19
- package/build/esm/filter-list/base/inputs/MultiDateInput.module.css +6 -4
- package/build/esm/filter-list/base/inputs/MultiSelectInput.js +7 -14
- package/build/esm/filter-list/base/inputs/MultiSelectInput.js.map +1 -1
- package/build/esm/filter-list/base/inputs/MultiSelectInput.module.css +4 -1
- package/build/esm/filter-list/base/inputs/NullValueWrapper.js +4 -23
- package/build/esm/filter-list/base/inputs/NullValueWrapper.js.map +1 -1
- package/build/esm/filter-list/base/inputs/NullValueWrapper.module.css +3 -2
- package/build/esm/filter-list/base/inputs/NumberRangeInput.js.map +1 -1
- package/build/esm/filter-list/base/inputs/RangeInput.js +2 -32
- package/build/esm/filter-list/base/inputs/RangeInput.js.map +1 -1
- package/build/esm/filter-list/base/inputs/RangeInput.module.css +16 -14
- package/build/esm/filter-list/base/inputs/SingleDateInput.module.css +2 -1
- package/build/esm/filter-list/base/inputs/SingleSelectInput.js +6 -13
- package/build/esm/filter-list/base/inputs/SingleSelectInput.js.map +1 -1
- package/build/esm/filter-list/base/inputs/TextTagsInput.js +6 -14
- package/build/esm/filter-list/base/inputs/TextTagsInput.js.map +1 -1
- package/build/esm/filter-list/base/inputs/TimelineInput.js +2 -2
- package/build/esm/filter-list/base/inputs/TimelineInput.js.map +1 -1
- package/build/esm/filter-list/base/inputs/TimelineInput.module.css +14 -12
- package/build/esm/filter-list/base/inputs/shared.module.css +5 -4
- package/build/esm/filter-list/hooks/useFilterListState.js +29 -9
- package/build/esm/filter-list/hooks/useFilterListState.js.map +1 -1
- package/build/esm/filter-list/hooks/usePropertyAggregation.js.map +1 -1
- package/build/esm/filter-list/inputs/CheckboxListFilterInput.js +56 -0
- package/build/esm/filter-list/inputs/CheckboxListFilterInput.js.map +1 -0
- package/build/esm/filter-list/inputs/ContainsTextFilterInput.js +38 -0
- package/build/esm/filter-list/inputs/ContainsTextFilterInput.js.map +1 -0
- package/build/esm/filter-list/inputs/DateRangeFilterInput.js +105 -0
- package/build/esm/filter-list/inputs/DateRangeFilterInput.js.map +1 -0
- package/build/esm/filter-list/inputs/LinkedPropertyInput.js +508 -0
- package/build/esm/filter-list/inputs/LinkedPropertyInput.js.map +1 -0
- package/build/esm/filter-list/inputs/ListogramFilterInput.js +62 -0
- package/build/esm/filter-list/inputs/ListogramFilterInput.js.map +1 -0
- package/build/esm/filter-list/inputs/MultiDateFilterInput.js +38 -0
- package/build/esm/filter-list/inputs/MultiDateFilterInput.js.map +1 -0
- package/build/esm/filter-list/inputs/MultiSelectFilterInput.js +55 -0
- package/build/esm/filter-list/inputs/MultiSelectFilterInput.js.map +1 -0
- package/build/esm/filter-list/inputs/NumberRangeFilterInput.js +105 -0
- package/build/esm/filter-list/inputs/NumberRangeFilterInput.js.map +1 -0
- package/build/esm/filter-list/inputs/PropertyFilterInput.js +129 -0
- package/build/esm/filter-list/inputs/PropertyFilterInput.js.map +1 -0
- package/build/esm/filter-list/inputs/SingleDateFilterInput.js +38 -0
- package/build/esm/filter-list/inputs/SingleDateFilterInput.js.map +1 -0
- package/build/esm/filter-list/inputs/SingleSelectFilterInput.js +55 -0
- package/build/esm/filter-list/inputs/SingleSelectFilterInput.js.map +1 -0
- package/build/esm/filter-list/inputs/TextTagsFilterInput.js +54 -0
- package/build/esm/filter-list/inputs/TextTagsFilterInput.js.map +1 -0
- package/build/esm/filter-list/inputs/TimelineFilterInput.js +49 -0
- package/build/esm/filter-list/inputs/TimelineFilterInput.js.map +1 -0
- package/build/esm/filter-list/inputs/ToggleFilterInput.js +36 -0
- package/build/esm/filter-list/inputs/ToggleFilterInput.js.map +1 -0
- package/build/esm/filter-list/types/AggregationTypes.js +2 -0
- package/build/esm/filter-list/types/AggregationTypes.js.map +1 -0
- package/build/esm/filter-list/types/LinkedFilterTypes.js.map +1 -1
- package/build/esm/filter-list/types/index.js +0 -2
- package/build/esm/filter-list/types/index.js.map +1 -1
- package/build/esm/filter-list/utils/filterStateSerialization.js +42 -0
- package/build/esm/filter-list/utils/filterStateSerialization.js.map +1 -0
- package/build/esm/filter-list/utils/filterStateToWhereClause.js +36 -13
- package/build/esm/filter-list/utils/filterStateToWhereClause.js.map +1 -1
- package/build/esm/filter-list/utils/filterValues.js +26 -0
- package/build/esm/filter-list/utils/filterValues.js.map +1 -1
- package/build/esm/object-table/ColumnConfigDialog.module.css +0 -9
- package/build/esm/object-table/DefaultCellRenderer.js +6 -1
- package/build/esm/object-table/DefaultCellRenderer.js.map +1 -1
- package/build/esm/object-table/EditableCell.js +76 -9
- package/build/esm/object-table/EditableCell.js.map +1 -1
- package/build/esm/object-table/EditableCell.module.css +47 -8
- package/build/esm/object-table/MultiColumnSortDialog.js +4 -1
- package/build/esm/object-table/MultiColumnSortDialog.js.map +1 -1
- package/build/esm/object-table/MultiColumnSortDialog.module.css +0 -4
- package/build/esm/object-table/ObjectTable.js +4 -1
- package/build/esm/object-table/ObjectTable.js.map +1 -1
- package/build/esm/object-table/ObjectTableApi.js.map +1 -1
- package/build/esm/object-table/SelectionCells.js +1 -0
- package/build/esm/object-table/SelectionCells.js.map +1 -1
- package/build/esm/object-table/Table.js +2 -2
- package/build/esm/object-table/Table.js.map +1 -1
- package/build/esm/object-table/TableBody.js +1 -1
- package/build/esm/object-table/TableBody.js.map +1 -1
- package/build/esm/object-table/TableEditContainer.js +27 -16
- package/build/esm/object-table/TableEditContainer.js.map +1 -1
- package/build/esm/object-table/TableEditContainer.module.css +27 -0
- package/build/esm/object-table/TableHeaderWithPopover.module.css +0 -12
- package/build/esm/object-table/TableRow.js +2 -2
- package/build/esm/object-table/TableRow.js.map +1 -1
- package/build/esm/object-table/hooks/useColumnDefs.js +2 -1
- package/build/esm/object-table/hooks/useColumnDefs.js.map +1 -1
- package/build/esm/object-table/hooks/useEditableTable.js +21 -2
- package/build/esm/object-table/hooks/useEditableTable.js.map +1 -1
- package/build/esm/object-table/utils/types.js.map +1 -1
- package/build/esm/public/experimental.js +4 -1
- package/build/esm/public/experimental.js.map +1 -1
- package/build/esm/shared/ErrorBoundary.module.css +14 -14
- package/build/types/base-components/tooltip/Tooltip.d.ts +31 -0
- package/build/types/base-components/tooltip/Tooltip.d.ts.map +1 -0
- package/build/types/base-components/tooltip/index.d.ts +1 -0
- package/build/types/base-components/tooltip/index.d.ts.map +1 -0
- package/build/types/filter-list/{base/FilterInput.d.ts → FilterInput.d.ts} +2 -2
- package/build/types/filter-list/FilterInput.d.ts.map +1 -0
- package/build/types/filter-list/{base/FilterList.d.ts → FilterList.d.ts} +1 -1
- package/build/types/filter-list/FilterList.d.ts.map +1 -0
- package/build/types/filter-list/FilterListApi.d.ts +14 -0
- package/build/types/filter-list/FilterListApi.d.ts.map +1 -1
- package/build/types/filter-list/FilterListItemApi.d.ts +13 -0
- package/build/types/filter-list/FilterListItemApi.d.ts.map +1 -1
- package/build/types/filter-list/base/BaseFilterList.d.ts +3 -0
- package/build/types/filter-list/base/BaseFilterList.d.ts.map +1 -0
- package/build/types/filter-list/base/BaseFilterListApi.d.ts +29 -0
- package/build/types/filter-list/base/BaseFilterListApi.d.ts.map +1 -0
- package/build/types/filter-list/base/FilterIcons.d.ts +4 -0
- package/build/types/filter-list/base/FilterIcons.d.ts.map +1 -0
- package/build/types/filter-list/base/FilterListContent.d.ts +8 -8
- package/build/types/filter-list/base/FilterListContent.d.ts.map +1 -1
- package/build/types/filter-list/base/FilterListHeader.d.ts.map +1 -1
- package/build/types/filter-list/base/FilterListItem.d.ts +7 -8
- package/build/types/filter-list/base/FilterListItem.d.ts.map +1 -1
- package/build/types/filter-list/base/SortableFilterListItem.d.ts +7 -8
- package/build/types/filter-list/base/SortableFilterListItem.d.ts.map +1 -1
- package/build/types/filter-list/base/index.d.ts +2 -2
- package/build/types/filter-list/base/index.d.ts.map +1 -1
- package/build/types/filter-list/base/inputs/CheckboxListInput.d.ts +7 -13
- package/build/types/filter-list/base/inputs/CheckboxListInput.d.ts.map +1 -1
- package/build/types/filter-list/base/inputs/DateRangeInput.d.ts +7 -12
- package/build/types/filter-list/base/inputs/DateRangeInput.d.ts.map +1 -1
- package/build/types/filter-list/base/inputs/ListogramInput.d.ts +10 -13
- package/build/types/filter-list/base/inputs/ListogramInput.d.ts.map +1 -1
- package/build/types/filter-list/base/inputs/MultiSelectInput.d.ts +7 -13
- package/build/types/filter-list/base/inputs/MultiSelectInput.d.ts.map +1 -1
- package/build/types/filter-list/base/inputs/NullValueWrapper.d.ts +5 -11
- package/build/types/filter-list/base/inputs/NullValueWrapper.d.ts.map +1 -1
- package/build/types/filter-list/base/inputs/NumberRangeInput.d.ts +7 -12
- package/build/types/filter-list/base/inputs/NumberRangeInput.d.ts.map +1 -1
- package/build/types/filter-list/base/inputs/RangeInput.d.ts +7 -14
- package/build/types/filter-list/base/inputs/RangeInput.d.ts.map +1 -1
- package/build/types/filter-list/base/inputs/SingleSelectInput.d.ts +7 -13
- package/build/types/filter-list/base/inputs/SingleSelectInput.d.ts.map +1 -1
- package/build/types/filter-list/base/inputs/TextTagsInput.d.ts +7 -13
- package/build/types/filter-list/base/inputs/TextTagsInput.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 +2 -5
- package/build/types/filter-list/hooks/usePropertyAggregation.d.ts.map +1 -1
- package/build/types/filter-list/inputs/CheckboxListFilterInput.d.ts +14 -0
- package/build/types/filter-list/inputs/CheckboxListFilterInput.d.ts.map +1 -0
- package/build/types/filter-list/inputs/ContainsTextFilterInput.d.ts +10 -0
- package/build/types/filter-list/inputs/ContainsTextFilterInput.d.ts.map +1 -0
- package/build/types/filter-list/inputs/DateRangeFilterInput.d.ts +12 -0
- package/build/types/filter-list/inputs/DateRangeFilterInput.d.ts.map +1 -0
- package/build/types/filter-list/{base/inputs → inputs}/LinkedPropertyInput.d.ts +2 -2
- package/build/types/filter-list/inputs/LinkedPropertyInput.d.ts.map +1 -0
- package/build/types/filter-list/inputs/ListogramFilterInput.d.ts +16 -0
- package/build/types/filter-list/inputs/ListogramFilterInput.d.ts.map +1 -0
- package/build/types/filter-list/inputs/MultiDateFilterInput.d.ts +9 -0
- package/build/types/filter-list/inputs/MultiDateFilterInput.d.ts.map +1 -0
- package/build/types/filter-list/inputs/MultiSelectFilterInput.d.ts +13 -0
- package/build/types/filter-list/inputs/MultiSelectFilterInput.d.ts.map +1 -0
- package/build/types/filter-list/inputs/NumberRangeFilterInput.d.ts +12 -0
- package/build/types/filter-list/inputs/NumberRangeFilterInput.d.ts.map +1 -0
- package/build/types/filter-list/inputs/PropertyFilterInput.d.ts +17 -0
- package/build/types/filter-list/inputs/PropertyFilterInput.d.ts.map +1 -0
- package/build/types/filter-list/inputs/SingleDateFilterInput.d.ts +9 -0
- package/build/types/filter-list/inputs/SingleDateFilterInput.d.ts.map +1 -0
- package/build/types/filter-list/inputs/SingleSelectFilterInput.d.ts +13 -0
- package/build/types/filter-list/inputs/SingleSelectFilterInput.d.ts.map +1 -0
- package/build/types/filter-list/inputs/TextTagsFilterInput.d.ts +13 -0
- package/build/types/filter-list/inputs/TextTagsFilterInput.d.ts.map +1 -0
- package/build/types/filter-list/inputs/TimelineFilterInput.d.ts +9 -0
- package/build/types/filter-list/inputs/TimelineFilterInput.d.ts.map +1 -0
- package/build/types/filter-list/inputs/ToggleFilterInput.d.ts +9 -0
- package/build/types/filter-list/inputs/ToggleFilterInput.d.ts.map +1 -0
- package/build/types/filter-list/types/AggregationTypes.d.ts +5 -0
- package/build/types/filter-list/types/AggregationTypes.d.ts.map +1 -0
- package/build/types/filter-list/types/LinkedFilterTypes.d.ts +0 -19
- package/build/types/filter-list/types/LinkedFilterTypes.d.ts.map +1 -1
- package/build/types/filter-list/types/index.d.ts +0 -2
- package/build/types/filter-list/types/index.d.ts.map +1 -1
- package/build/types/filter-list/utils/filterStateSerialization.d.ts +3 -0
- package/build/types/filter-list/utils/filterStateSerialization.d.ts.map +1 -0
- 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/filter-list/utils/filterValues.d.ts +2 -0
- package/build/types/filter-list/utils/filterValues.d.ts.map +1 -1
- package/build/types/object-table/EditableCell.d.ts +8 -2
- package/build/types/object-table/EditableCell.d.ts.map +1 -1
- package/build/types/object-table/ObjectTableApi.d.ts +7 -0
- package/build/types/object-table/ObjectTableApi.d.ts.map +1 -1
- package/build/types/object-table/Table.d.ts +4 -0
- package/build/types/object-table/Table.d.ts.map +1 -1
- package/build/types/object-table/TableEditContainer.d.ts +1 -1
- package/build/types/object-table/TableEditContainer.d.ts.map +1 -1
- package/build/types/object-table/TableRow.d.ts +2 -2
- package/build/types/object-table/TableRow.d.ts.map +1 -1
- package/build/types/object-table/hooks/useEditableTable.d.ts.map +1 -1
- package/build/types/object-table/utils/types.d.ts +7 -4
- package/build/types/object-table/utils/types.d.ts.map +1 -1
- package/build/types/public/experimental.d.ts +4 -1
- package/build/types/public/experimental.d.ts.map +1 -1
- package/package.json +5 -5
- package/build/browser/filter-list/base/FilterInput.js +0 -542
- package/build/browser/filter-list/base/FilterInput.js.map +0 -1
- package/build/browser/filter-list/base/FilterList.js.map +0 -1
- package/build/browser/filter-list/base/inputs/LinkedPropertyInput.js +0 -237
- package/build/browser/filter-list/base/inputs/LinkedPropertyInput.js.map +0 -1
- package/build/browser/filter-list/types/AddFilterMenuTypes.js +0 -2
- package/build/browser/filter-list/types/AddFilterMenuTypes.js.map +0 -1
- package/build/browser/filter-list/types/FilterPanelTypes.js +0 -2
- package/build/browser/filter-list/types/FilterPanelTypes.js.map +0 -1
- package/build/esm/filter-list/base/FilterInput.js +0 -542
- package/build/esm/filter-list/base/FilterInput.js.map +0 -1
- package/build/esm/filter-list/base/FilterList.js.map +0 -1
- package/build/esm/filter-list/base/inputs/LinkedPropertyInput.js +0 -237
- package/build/esm/filter-list/base/inputs/LinkedPropertyInput.js.map +0 -1
- package/build/esm/filter-list/types/AddFilterMenuTypes.js +0 -2
- package/build/esm/filter-list/types/AddFilterMenuTypes.js.map +0 -1
- package/build/esm/filter-list/types/FilterPanelTypes.js +0 -2
- package/build/esm/filter-list/types/FilterPanelTypes.js.map +0 -1
- package/build/types/filter-list/base/FilterInput.d.ts.map +0 -1
- package/build/types/filter-list/base/FilterList.d.ts.map +0 -1
- package/build/types/filter-list/base/inputs/LinkedPropertyInput.d.ts.map +0 -1
- package/build/types/filter-list/types/AddFilterMenuTypes.d.ts +0 -56
- package/build/types/filter-list/types/AddFilterMenuTypes.d.ts.map +0 -1
- package/build/types/filter-list/types/FilterPanelTypes.d.ts +0 -18
- package/build/types/filter-list/types/FilterPanelTypes.d.ts.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ObjectTypeDefinition, ObjectSet, WhereClause, PropertyKeys, LinkNames, LinkedType, WirePropertyTypes, CompileTimeMetadata, ObjectOrInterfaceDefinition, SimplePropertyDef, QueryDefinition, DerivedProperty, Osdk, PrimaryKeyType } from '@osdk/api';
|
|
2
1
|
import * as React from 'react';
|
|
3
2
|
import React__default, { ReactNode, ReactElement } from 'react';
|
|
3
|
+
import { ObjectTypeDefinition, ObjectSet, WhereClause, PropertyKeys, LinkNames, LinkedType, WirePropertyTypes, CompileTimeMetadata, ObjectOrInterfaceDefinition, SimplePropertyDef, QueryDefinition, DerivedProperty, Osdk, PrimaryKeyType } from '@osdk/api';
|
|
4
4
|
import { RowData, Table, Cell, VisibilityState, ColumnOrderState } from '@tanstack/react-table';
|
|
5
5
|
|
|
6
6
|
/**
|
|
@@ -319,6 +319,19 @@ interface PropertyFilterDefinition<Q extends ObjectTypeDefinition, K extends Pro
|
|
|
319
319
|
* If provided, the filter is controlled.
|
|
320
320
|
*/
|
|
321
321
|
filterState: FilterStateByComponentType[C];
|
|
322
|
+
/**
|
|
323
|
+
* Maps filter values to colors for visual differentiation.
|
|
324
|
+
* Used by CHECKBOX_LIST (color dots) and LISTOGRAM (per-row bar colors).
|
|
325
|
+
*/
|
|
326
|
+
colorMap?: Record<string, string>;
|
|
327
|
+
/**
|
|
328
|
+
* Configuration for LISTOGRAM display mode.
|
|
329
|
+
* Only applies when filterComponent is "LISTOGRAM".
|
|
330
|
+
*/
|
|
331
|
+
listogramConfig?: {
|
|
332
|
+
displayMode?: "full" | "count" | "minimal";
|
|
333
|
+
maxVisibleItems?: number;
|
|
334
|
+
};
|
|
322
335
|
/**
|
|
323
336
|
* Controls whether this filter is rendered.
|
|
324
337
|
* When false, the filter is hidden but its state is preserved.
|
|
@@ -340,6 +353,36 @@ interface FilterListItemProps<Q extends ObjectTypeDefinition, K extends Property
|
|
|
340
353
|
onFilterRemoved?: (key: PropertyKeys<Q>) => void;
|
|
341
354
|
}
|
|
342
355
|
|
|
356
|
+
type RenderFilterInput<D> = (props: {
|
|
357
|
+
definition: D;
|
|
358
|
+
filterKey: string;
|
|
359
|
+
filterState: FilterState | undefined;
|
|
360
|
+
onFilterStateChanged: (state: FilterState) => void;
|
|
361
|
+
}) => React__default.ReactNode;
|
|
362
|
+
interface BaseFilterListProps<D> {
|
|
363
|
+
filterDefinitions?: Array<D>;
|
|
364
|
+
filterStates: Map<string, FilterState>;
|
|
365
|
+
onFilterStateChanged: (filterKey: string, state: FilterState) => void;
|
|
366
|
+
renderInput: RenderFilterInput<D>;
|
|
367
|
+
getFilterKey: (definition: D) => string;
|
|
368
|
+
getFilterLabel: (definition: D) => string;
|
|
369
|
+
activeFilterCount: number;
|
|
370
|
+
onReset?: () => void;
|
|
371
|
+
onFilterAdded?: () => void;
|
|
372
|
+
onFilterRemoved?: (filterKey: string) => void;
|
|
373
|
+
collapsed?: boolean;
|
|
374
|
+
onCollapsedChange?: (collapsed: boolean) => void;
|
|
375
|
+
title?: string;
|
|
376
|
+
titleIcon?: React__default.ReactNode;
|
|
377
|
+
showResetButton?: boolean;
|
|
378
|
+
showActiveFilterCount?: boolean;
|
|
379
|
+
enableSorting?: boolean;
|
|
380
|
+
className?: string;
|
|
381
|
+
renderAddFilterButton?: () => React__default.ReactNode;
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
declare function BaseFilterList<D>(props: BaseFilterListProps<D>): React__default.ReactElement;
|
|
385
|
+
|
|
343
386
|
/**
|
|
344
387
|
* Union type of all filter definition types
|
|
345
388
|
*/
|
|
@@ -418,6 +461,20 @@ interface FilterListProps<Q extends ObjectTypeDefinition> {
|
|
|
418
461
|
* should use controlled filterDefinitions.
|
|
419
462
|
*/
|
|
420
463
|
enableSorting?: boolean;
|
|
464
|
+
/**
|
|
465
|
+
* Whether the filter list panel is collapsed
|
|
466
|
+
*/
|
|
467
|
+
collapsed?: boolean;
|
|
468
|
+
/**
|
|
469
|
+
* Called when the collapsed state changes
|
|
470
|
+
*/
|
|
471
|
+
onCollapsedChange?: (collapsed: boolean) => void;
|
|
472
|
+
/**
|
|
473
|
+
* Initial filter states for hydrating from external storage.
|
|
474
|
+
* These states are merged over definition defaults on mount.
|
|
475
|
+
* Use onFilterStateChanged to persist state changes externally.
|
|
476
|
+
*/
|
|
477
|
+
initialFilterStates?: Map<string, FilterState>;
|
|
421
478
|
/**
|
|
422
479
|
* Show reset filters button in header
|
|
423
480
|
*/
|
|
@@ -443,6 +500,9 @@ interface FilterListProps<Q extends ObjectTypeDefinition> {
|
|
|
443
500
|
|
|
444
501
|
declare function FilterList<Q extends ObjectTypeDefinition>(props: FilterListProps<Q>): React__default.ReactElement;
|
|
445
502
|
|
|
503
|
+
declare function serializeFilterStates(states: Map<string, FilterState>): string;
|
|
504
|
+
declare function deserializeFilterStates(json: string): Map<string, FilterState>;
|
|
505
|
+
|
|
446
506
|
interface ColumnOption {
|
|
447
507
|
id: string;
|
|
448
508
|
name: string;
|
|
@@ -453,11 +513,11 @@ interface CellIdentifier {
|
|
|
453
513
|
columnId: string;
|
|
454
514
|
}
|
|
455
515
|
interface CellEditInfo<TData extends RowData = unknown, CellValue = unknown> extends CellIdentifier {
|
|
456
|
-
newValue: CellValue;
|
|
457
|
-
oldValue: CellValue;
|
|
516
|
+
newValue: CellValue | null;
|
|
517
|
+
oldValue: CellValue | null;
|
|
458
518
|
originalRowData: TData;
|
|
459
519
|
}
|
|
460
|
-
type
|
|
520
|
+
type EditModeState = {
|
|
461
521
|
type: "always";
|
|
462
522
|
isActive: true;
|
|
463
523
|
} | {
|
|
@@ -470,7 +530,10 @@ interface EditableConfig<TData extends RowData = unknown, CellValue = unknown> {
|
|
|
470
530
|
onCellEdit: (cellId: string, info: CellEditInfo<TData, CellValue>) => void;
|
|
471
531
|
onSubmitEdits?: () => Promise<boolean>;
|
|
472
532
|
clearEdits: () => void;
|
|
473
|
-
|
|
533
|
+
editModeState: EditModeState;
|
|
534
|
+
onCellValidationError: (cellId: string, error: string) => void;
|
|
535
|
+
validationErrors: Map<string, string>;
|
|
536
|
+
clearCellValidationError: (cellId: string) => void;
|
|
474
537
|
}
|
|
475
538
|
|
|
476
539
|
type ColumnDefinition<Q extends ObjectOrInterfaceDefinition, RDPs extends Record<string, SimplePropertyDef> = Record<string, never>, FunctionColumns extends Record<string, QueryDefinition<{}>> = Record<string, never>> = {
|
|
@@ -490,6 +553,13 @@ type ColumnDefinition<Q extends ObjectOrInterfaceDefinition, RDPs extends Record
|
|
|
490
553
|
orderable?: boolean;
|
|
491
554
|
filterable?: boolean;
|
|
492
555
|
editable?: boolean;
|
|
556
|
+
/**
|
|
557
|
+
* Additional function to validate the cell value during edit
|
|
558
|
+
*
|
|
559
|
+
* @param value the current cell value
|
|
560
|
+
* @returns a promise that resolves to an error message string if validation fails, or undefined if validation succeeds
|
|
561
|
+
*/
|
|
562
|
+
validateEdit?: (value: unknown) => Promise<string | undefined>;
|
|
493
563
|
renderCell?: (object: Osdk.Instance<Q, "$allBaseProperties", PropertyKeys<Q>, RDPs>, locator: ColumnDefinitionLocator<Q, RDPs, FunctionColumns>) => React.ReactNode;
|
|
494
564
|
/**
|
|
495
565
|
* If provided, this will be used in the column header.
|
|
@@ -752,11 +822,15 @@ declare module "@tanstack/react-table" {
|
|
|
752
822
|
isVisible?: boolean;
|
|
753
823
|
editable?: boolean;
|
|
754
824
|
dataType?: string;
|
|
825
|
+
validateEdit?: (value: unknown) => Promise<string | undefined>;
|
|
755
826
|
}
|
|
756
827
|
interface TableMeta<TData extends RowData = unknown> {
|
|
757
828
|
onCellEdit?: (cellId: string, info: CellEditInfo<TData, unknown>) => void;
|
|
829
|
+
onCellValidationError?: (cellId: string, error: string) => void;
|
|
830
|
+
clearCellValidationError?: (cellId: string) => void;
|
|
758
831
|
cellEdits?: Record<string, CellEditInfo<TData, unknown>>;
|
|
759
832
|
isInEditMode?: boolean;
|
|
833
|
+
validationErrors?: Map<string, string>;
|
|
760
834
|
}
|
|
761
835
|
}
|
|
762
836
|
interface BaseTableProps<TData extends RowData> {
|
|
@@ -789,4 +863,4 @@ interface ColumnConfigDialogProps {
|
|
|
789
863
|
}
|
|
790
864
|
declare function ColumnConfigDialog({ isOpen, onClose, columnOptions, currentVisibility, currentColumnOrder, onApply, isValidConfig, }: ColumnConfigDialogProps): React__default.ReactElement | null;
|
|
791
865
|
|
|
792
|
-
export { BaseTable, type BaseTableProps, type CellEditInfo, ColumnConfigDialog, type ColumnConfigDialogProps, type ColumnConfigOptions, type ColumnDefinition, type ColumnDefinitionLocator, type FilterComponentType, type FilterDefinitionUnion, FilterList, type FilterListItemProps, type FilterListProps, type FilterState, ObjectTable, type ObjectTableProps, type PropertyFilterDefinition };
|
|
866
|
+
export { BaseFilterList, type BaseFilterListProps, BaseTable, type BaseTableProps, type CellEditInfo, ColumnConfigDialog, type ColumnConfigDialogProps, type ColumnConfigOptions, type ColumnDefinition, type ColumnDefinitionLocator, type FilterComponentType, type FilterDefinitionUnion, FilterList, type FilterListItemProps, type FilterListProps, type FilterState, ObjectTable, type ObjectTableProps, type PropertyFilterDefinition, type RenderFilterInput, deserializeFilterStates, serializeFilterStates };
|
|
@@ -36,10 +36,6 @@
|
|
|
36
36
|
z-index: var(--osdk-surface-z-index-2);
|
|
37
37
|
display: flex;
|
|
38
38
|
flex-direction: column;
|
|
39
|
-
|
|
40
|
-
&:focus {
|
|
41
|
-
outline: none;
|
|
42
|
-
}
|
|
43
39
|
}
|
|
44
40
|
|
|
45
41
|
.header {
|
|
@@ -84,10 +80,6 @@
|
|
|
84
80
|
background-color: var(--osdk-surface-background-color-default-hover);
|
|
85
81
|
}
|
|
86
82
|
|
|
87
|
-
&:focus {
|
|
88
|
-
outline: none;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
83
|
&:focus-visible {
|
|
92
84
|
outline: var(--osdk-focus-outline);
|
|
93
85
|
outline-offset: var(--osdk-focus-visible-outline-offset);
|
|
@@ -56,7 +56,8 @@ function DraggableListItem({
|
|
|
56
56
|
className: styles.dragHandle,
|
|
57
57
|
"aria-label": `Reorder ${item.label}`
|
|
58
58
|
}, attributes, listeners), /*#__PURE__*/React.createElement(DragHandleVertical, {
|
|
59
|
-
className: styles.icon
|
|
59
|
+
className: styles.icon,
|
|
60
|
+
color: "currentColor"
|
|
60
61
|
})), /*#__PURE__*/React.createElement("div", {
|
|
61
62
|
className: styles.itemContent
|
|
62
63
|
}, renderContent ? renderContent(item) : item.label), onRemove && /*#__PURE__*/React.createElement(Button, {
|
|
@@ -64,7 +65,8 @@ function DraggableListItem({
|
|
|
64
65
|
onClick: handleRemove,
|
|
65
66
|
"aria-label": `Remove ${item.label}`
|
|
66
67
|
}, /*#__PURE__*/React.createElement(RemoveIcon, {
|
|
67
|
-
className: styles.icon
|
|
68
|
+
className: styles.icon,
|
|
69
|
+
color: "currentColor"
|
|
68
70
|
})));
|
|
69
71
|
}
|
|
70
72
|
export function DraggableList({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DraggableList.js","names":["Button","DragHandleVertical","SmallCross","Trash","closestCenter","DndContext","BaseDndContext","KeyboardSensor","PointerSensor","useSensor","useSensors","SortableContext","sortableKeyboardCoordinates","useSortable","verticalListSortingStrategy","CSS","classNames","React","useCallback","useEffect","useMemo","useRef","styles","DraggableListItem","item","onRemove","removeIconVariant","renderContent","attributes","listeners","setNodeRef","transform","transition","isDragging","id","style","Transform","toString","handleRemove","RemoveIcon","createElement","ref","className","draggableItem","_extends","dragHandle","label","icon","itemContent","removeButton","onClick","DraggableList","items","onReorder","emptyMessage","itemIds","map","sensors","activationConstraint","distance","coordinateGetter","handleDragEnd","event","active","over","oldIndex","findIndex","newIndex","containerRef","useKeyboardEvents","draggableListContainer","collisionDetection","onDragEnd","strategy","key","length","emptyState","el","current","ARROW_KEYS","Set","handleCapture","has","querySelector","stopPropagation","document","dispatchEvent","KeyboardEvent","code","bubbles","addEventListener","removeEventListener"],"sources":["DraggableList.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 { Button } from \"@base-ui/react/button\";\nimport { DragHandleVertical, SmallCross, Trash } from \"@blueprintjs/icons\";\nimport {\n closestCenter,\n DndContext as BaseDndContext,\n type DragEndEvent,\n KeyboardSensor,\n PointerSensor,\n useSensor,\n useSensors,\n} from \"@dnd-kit/core\";\nimport {\n SortableContext,\n sortableKeyboardCoordinates,\n useSortable,\n verticalListSortingStrategy,\n} from \"@dnd-kit/sortable\";\nimport { CSS } from \"@dnd-kit/utilities\";\nimport classNames from \"classnames\";\nimport type { RefObject } from \"react\";\nimport React, { useCallback, useEffect, useMemo, useRef } from \"react\";\nimport styles from \"./DraggableList.module.css\";\n\nexport interface DraggableItem {\n id: string;\n label: string;\n}\n\ntype RemoveIconVariant = \"trash\" | \"cross\";\n\ninterface DraggableListItemProps<T extends DraggableItem> {\n item: T;\n onRemove?: (id: string) => void;\n removeIconVariant?: RemoveIconVariant;\n renderContent?: (item: T) => React.ReactNode;\n}\n\nfunction DraggableListItem<T extends DraggableItem>({\n item,\n onRemove,\n removeIconVariant = \"trash\",\n renderContent,\n}: DraggableListItemProps<T>): React.ReactElement {\n const {\n attributes,\n listeners,\n setNodeRef,\n transform,\n transition,\n isDragging,\n } = useSortable({ id: item.id });\n\n const style = {\n transform: CSS.Transform.toString(transform),\n transition,\n };\n\n const handleRemove = useCallback(() => {\n onRemove?.(item.id);\n }, [item.id, onRemove]);\n\n const RemoveIcon = removeIconVariant === \"trash\" ? Trash : SmallCross;\n\n return (\n <div\n ref={setNodeRef}\n style={style}\n className={styles.draggableItem}\n data-dragging={isDragging}\n >\n <div\n className={styles.dragHandle}\n aria-label={`Reorder ${item.label}`}\n {...attributes}\n {...listeners}\n >\n <DragHandleVertical className={styles.icon} />\n </div>\n <div className={styles.itemContent}>\n {renderContent ? renderContent(item) : item.label}\n </div>\n {onRemove && (\n <Button\n className={styles.removeButton}\n onClick={handleRemove}\n aria-label={`Remove ${item.label}`}\n >\n <RemoveIcon className={styles.icon} />\n </Button>\n )}\n </div>\n );\n}\n\nexport interface DraggableListProps<T extends DraggableItem> {\n items: T[];\n onReorder: (fromIndex: number, toIndex: number) => void;\n onRemove: (id: string) => void;\n removeIconVariant?: RemoveIconVariant;\n renderContent?: (item: T) => React.ReactNode;\n emptyMessage?: string;\n className?: string;\n}\n\nexport function DraggableList<T extends DraggableItem>({\n items,\n onReorder,\n onRemove,\n removeIconVariant = \"cross\",\n renderContent,\n emptyMessage,\n className,\n}: DraggableListProps<T>): React.ReactElement {\n const itemIds = useMemo(() => items.map((item) => item.id), [items]);\n const sensors = useSensors(\n useSensor(PointerSensor, {\n activationConstraint: {\n distance: 5,\n },\n }),\n useSensor(KeyboardSensor, {\n coordinateGetter: sortableKeyboardCoordinates,\n }),\n );\n\n const handleDragEnd = useCallback(\n (event: DragEndEvent) => {\n const { active, over } = event;\n\n if (over && active.id !== over.id) {\n const oldIndex = items.findIndex((item) => item.id === active.id);\n const newIndex = items.findIndex((item) => item.id === over.id);\n onReorder(oldIndex, newIndex);\n }\n },\n [items, onReorder],\n );\n\n const containerRef = useRef<HTMLDivElement>(null);\n\n useKeyboardEvents(containerRef);\n\n // TODO: Revert when @types/react is fixed\n const DndContext = BaseDndContext as any;\n\n return (\n <div\n ref={containerRef}\n className={classNames(styles.draggableListContainer, className)}\n >\n <DndContext\n sensors={sensors}\n collisionDetection={closestCenter}\n onDragEnd={handleDragEnd}\n >\n <SortableContext\n items={itemIds}\n strategy={verticalListSortingStrategy}\n >\n {items.map((item) => (\n <DraggableListItem<T>\n key={item.id}\n item={item}\n onRemove={onRemove}\n removeIconVariant={removeIconVariant}\n renderContent={renderContent}\n />\n ))}\n </SortableContext>\n </DndContext>\n {items.length === 0 && emptyMessage && (\n <div className={styles.emptyState}>{emptyMessage}</div>\n )}\n </div>\n );\n}\n\nconst useKeyboardEvents = (containerRef: RefObject<HTMLDivElement>) => {\n // Base UI's DialogPopup calls stopPropagation on arrow key events, which\n // prevents them from reaching @dnd-kit's document-level KeyboardSensor\n // listener. We use a native capture-phase listener to intercept arrow keys\n // before the dialog can swallow them, and re-dispatch them on the document\n // so @dnd-kit can process keyboard-driven reordering.\n useEffect(() => {\n const el = containerRef.current;\n if (el == null) {\n return;\n }\n\n const ARROW_KEYS = new Set([\n \"ArrowUp\",\n \"ArrowDown\",\n \"ArrowLeft\",\n \"ArrowRight\",\n ]);\n\n function handleCapture(event: KeyboardEvent) {\n if (!ARROW_KEYS.has(event.key)) {\n return;\n }\n\n // Only intercept when a drag is active (an item has [data-dragging=\"true\"])\n if (el!.querySelector(\"[data-dragging=\\\"true\\\"]\") == null) {\n return;\n }\n\n event.stopPropagation();\n\n document.dispatchEvent(\n new KeyboardEvent(\"keydown\", {\n key: event.key,\n code: event.code,\n bubbles: true,\n }),\n );\n }\n\n el.addEventListener(\"keydown\", handleCapture, true);\n return () => el.removeEventListener(\"keydown\", handleCapture, true);\n }, [containerRef]);\n};\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,MAAM,QAAQ,uBAAuB;AAC9C,SAASC,kBAAkB,EAAEC,UAAU,EAAEC,KAAK,QAAQ,oBAAoB;AAC1E,SACEC,aAAa,EACbC,UAAU,IAAIC,cAAc,EAE5BC,cAAc,EACdC,aAAa,EACbC,SAAS,EACTC,UAAU,QACL,eAAe;AACtB,SACEC,eAAe,EACfC,2BAA2B,EAC3BC,WAAW,EACXC,2BAA2B,QACtB,mBAAmB;AAC1B,SAASC,GAAG,QAAQ,oBAAoB;AACxC,OAAOC,UAAU,MAAM,YAAY;AAEnC,OAAOC,KAAK,IAAIC,WAAW,EAAEC,SAAS,EAAEC,OAAO,EAAEC,MAAM,QAAQ,OAAO;AACtE,OAAOC,MAAM,MAAM,4BAA4B;AAgB/C,SAASC,iBAAiBA,CAA0B;EAClDC,IAAI;EACJC,QAAQ;EACRC,iBAAiB,GAAG,OAAO;EAC3BC;AACyB,CAAC,EAAsB;EAChD,MAAM;IACJC,UAAU;IACVC,SAAS;IACTC,UAAU;IACVC,SAAS;IACTC,UAAU;IACVC;EACF,CAAC,GAAGpB,WAAW,CAAC;IAAEqB,EAAE,EAAEV,IAAI,CAACU;EAAG,CAAC,CAAC;EAEhC,MAAMC,KAAK,GAAG;IACZJ,SAAS,EAAEhB,GAAG,CAACqB,SAAS,CAACC,QAAQ,CAACN,SAAS,CAAC;IAC5CC;EACF,CAAC;EAED,MAAMM,YAAY,GAAGpB,WAAW,CAAC,MAAM;IACrCO,QAAQ,GAAGD,IAAI,CAACU,EAAE,CAAC;EACrB,CAAC,EAAE,CAACV,IAAI,CAACU,EAAE,EAAET,QAAQ,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,EAAE,CAACc,mBAAmB,CAAC,SAAS,EAAEV,aAAa,EAAE,IAAI,CAAC;EACrE,CAAC,EAAE,CAACb,YAAY,CAAC,CAAC;AACpB,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"DraggableList.js","names":["Button","DragHandleVertical","SmallCross","Trash","closestCenter","DndContext","BaseDndContext","KeyboardSensor","PointerSensor","useSensor","useSensors","SortableContext","sortableKeyboardCoordinates","useSortable","verticalListSortingStrategy","CSS","classNames","React","useCallback","useEffect","useMemo","useRef","styles","DraggableListItem","item","onRemove","removeIconVariant","renderContent","attributes","listeners","setNodeRef","transform","transition","isDragging","id","style","Transform","toString","handleRemove","RemoveIcon","createElement","ref","className","draggableItem","_extends","dragHandle","label","icon","color","itemContent","removeButton","onClick","DraggableList","items","onReorder","emptyMessage","itemIds","map","sensors","activationConstraint","distance","coordinateGetter","handleDragEnd","event","active","over","oldIndex","findIndex","newIndex","containerRef","useKeyboardEvents","draggableListContainer","collisionDetection","onDragEnd","strategy","key","length","emptyState","el","current","ARROW_KEYS","Set","handleCapture","has","querySelector","stopPropagation","document","dispatchEvent","KeyboardEvent","code","bubbles","addEventListener","removeEventListener"],"sources":["DraggableList.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 { Button } from \"@base-ui/react/button\";\nimport { DragHandleVertical, SmallCross, Trash } from \"@blueprintjs/icons\";\nimport {\n closestCenter,\n DndContext as BaseDndContext,\n type DragEndEvent,\n KeyboardSensor,\n PointerSensor,\n useSensor,\n useSensors,\n} from \"@dnd-kit/core\";\nimport {\n SortableContext,\n sortableKeyboardCoordinates,\n useSortable,\n verticalListSortingStrategy,\n} from \"@dnd-kit/sortable\";\nimport { CSS } from \"@dnd-kit/utilities\";\nimport classNames from \"classnames\";\nimport type { RefObject } from \"react\";\nimport React, { useCallback, useEffect, useMemo, useRef } from \"react\";\nimport styles from \"./DraggableList.module.css\";\n\nexport interface DraggableItem {\n id: string;\n label: string;\n}\n\ntype RemoveIconVariant = \"trash\" | \"cross\";\n\ninterface DraggableListItemProps<T extends DraggableItem> {\n item: T;\n onRemove?: (id: string) => void;\n removeIconVariant?: RemoveIconVariant;\n renderContent?: (item: T) => React.ReactNode;\n}\n\nfunction DraggableListItem<T extends DraggableItem>({\n item,\n onRemove,\n removeIconVariant = \"trash\",\n renderContent,\n}: DraggableListItemProps<T>): React.ReactElement {\n const {\n attributes,\n listeners,\n setNodeRef,\n transform,\n transition,\n isDragging,\n } = useSortable({ id: item.id });\n\n const style = {\n transform: CSS.Transform.toString(transform),\n transition,\n };\n\n const handleRemove = useCallback(() => {\n onRemove?.(item.id);\n }, [item.id, onRemove]);\n\n const RemoveIcon = removeIconVariant === \"trash\" ? Trash : SmallCross;\n\n return (\n <div\n ref={setNodeRef}\n style={style}\n className={styles.draggableItem}\n data-dragging={isDragging}\n >\n <div\n className={styles.dragHandle}\n aria-label={`Reorder ${item.label}`}\n {...attributes}\n {...listeners}\n >\n <DragHandleVertical className={styles.icon} color={\"currentColor\"} />\n </div>\n <div className={styles.itemContent}>\n {renderContent ? renderContent(item) : item.label}\n </div>\n {onRemove && (\n <Button\n className={styles.removeButton}\n onClick={handleRemove}\n aria-label={`Remove ${item.label}`}\n >\n <RemoveIcon className={styles.icon} color={\"currentColor\"} />\n </Button>\n )}\n </div>\n );\n}\n\nexport interface DraggableListProps<T extends DraggableItem> {\n items: T[];\n onReorder: (fromIndex: number, toIndex: number) => void;\n onRemove: (id: string) => void;\n removeIconVariant?: RemoveIconVariant;\n renderContent?: (item: T) => React.ReactNode;\n emptyMessage?: string;\n className?: string;\n}\n\nexport function DraggableList<T extends DraggableItem>({\n items,\n onReorder,\n onRemove,\n removeIconVariant = \"cross\",\n renderContent,\n emptyMessage,\n className,\n}: DraggableListProps<T>): React.ReactElement {\n const itemIds = useMemo(() => items.map((item) => item.id), [items]);\n const sensors = useSensors(\n useSensor(PointerSensor, {\n activationConstraint: {\n distance: 5,\n },\n }),\n useSensor(KeyboardSensor, {\n coordinateGetter: sortableKeyboardCoordinates,\n }),\n );\n\n const handleDragEnd = useCallback(\n (event: DragEndEvent) => {\n const { active, over } = event;\n\n if (over && active.id !== over.id) {\n const oldIndex = items.findIndex((item) => item.id === active.id);\n const newIndex = items.findIndex((item) => item.id === over.id);\n onReorder(oldIndex, newIndex);\n }\n },\n [items, onReorder],\n );\n\n const containerRef = useRef<HTMLDivElement>(null);\n\n useKeyboardEvents(containerRef);\n\n // TODO: Revert when @types/react is fixed\n const DndContext = BaseDndContext as any;\n\n return (\n <div\n ref={containerRef}\n className={classNames(styles.draggableListContainer, className)}\n >\n <DndContext\n sensors={sensors}\n collisionDetection={closestCenter}\n onDragEnd={handleDragEnd}\n >\n <SortableContext\n items={itemIds}\n strategy={verticalListSortingStrategy}\n >\n {items.map((item) => (\n <DraggableListItem<T>\n key={item.id}\n item={item}\n onRemove={onRemove}\n removeIconVariant={removeIconVariant}\n renderContent={renderContent}\n />\n ))}\n </SortableContext>\n </DndContext>\n {items.length === 0 && emptyMessage && (\n <div className={styles.emptyState}>{emptyMessage}</div>\n )}\n </div>\n );\n}\n\nconst useKeyboardEvents = (containerRef: RefObject<HTMLDivElement>) => {\n // Base UI's DialogPopup calls stopPropagation on arrow key events, which\n // prevents them from reaching @dnd-kit's document-level KeyboardSensor\n // listener. We use a native capture-phase listener to intercept arrow keys\n // before the dialog can swallow them, and re-dispatch them on the document\n // so @dnd-kit can process keyboard-driven reordering.\n useEffect(() => {\n const el = containerRef.current;\n if (el == null) {\n return;\n }\n\n const ARROW_KEYS = new Set([\n \"ArrowUp\",\n \"ArrowDown\",\n \"ArrowLeft\",\n \"ArrowRight\",\n ]);\n\n function handleCapture(event: KeyboardEvent) {\n if (!ARROW_KEYS.has(event.key)) {\n return;\n }\n\n // Only intercept when a drag is active (an item has [data-dragging=\"true\"])\n if (el!.querySelector(\"[data-dragging=\\\"true\\\"]\") == null) {\n return;\n }\n\n event.stopPropagation();\n\n document.dispatchEvent(\n new KeyboardEvent(\"keydown\", {\n key: event.key,\n code: event.code,\n bubbles: true,\n }),\n );\n }\n\n el.addEventListener(\"keydown\", handleCapture, true);\n return () => el.removeEventListener(\"keydown\", handleCapture, true);\n }, [containerRef]);\n};\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,MAAM,QAAQ,uBAAuB;AAC9C,SAASC,kBAAkB,EAAEC,UAAU,EAAEC,KAAK,QAAQ,oBAAoB;AAC1E,SACEC,aAAa,EACbC,UAAU,IAAIC,cAAc,EAE5BC,cAAc,EACdC,aAAa,EACbC,SAAS,EACTC,UAAU,QACL,eAAe;AACtB,SACEC,eAAe,EACfC,2BAA2B,EAC3BC,WAAW,EACXC,2BAA2B,QACtB,mBAAmB;AAC1B,SAASC,GAAG,QAAQ,oBAAoB;AACxC,OAAOC,UAAU,MAAM,YAAY;AAEnC,OAAOC,KAAK,IAAIC,WAAW,EAAEC,SAAS,EAAEC,OAAO,EAAEC,MAAM,QAAQ,OAAO;AACtE,OAAOC,MAAM,MAAM,4BAA4B;AAgB/C,SAASC,iBAAiBA,CAA0B;EAClDC,IAAI;EACJC,QAAQ;EACRC,iBAAiB,GAAG,OAAO;EAC3BC;AACyB,CAAC,EAAsB;EAChD,MAAM;IACJC,UAAU;IACVC,SAAS;IACTC,UAAU;IACVC,SAAS;IACTC,UAAU;IACVC;EACF,CAAC,GAAGpB,WAAW,CAAC;IAAEqB,EAAE,EAAEV,IAAI,CAACU;EAAG,CAAC,CAAC;EAEh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B,eAAe,CAAC,CAAC;MAEvBC,QAAQ,CAACC,aAAa,CACpB,IAAIC,aAAa,CAAC,SAAS,EAAE;QAC3Bb,GAAG,EAAEZ,KAAK,CAACY,GAAG;QACdc,IAAI,EAAE1B,KAAK,CAAC0B,IAAI;QAChBC,OAAO,EAAE;MACX,CAAC,CACH,CAAC;IACH;IAEAZ,EAAE,CAACa,gBAAgB,CAAC,SAAS,EAAET,aAAa,EAAE,IAAI,CAAC;IACnD,OAAO,MAAMJ,EAAE,CAACc,mBAAmB,CAAC,SAAS,EAAEV,aAAa,EAAE,IAAI,CAAC;EACrE,CAAC,EAAE,CAACb,YAAY,CAAC,CAAC;AACpB,CAAC","ignoreList":[]}
|
|
@@ -51,10 +51,6 @@
|
|
|
51
51
|
cursor: var(--osdk-drag-handle-cursor-active);
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
&:focus {
|
|
55
|
-
outline: none;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
54
|
&:focus-visible {
|
|
59
55
|
outline: var(--osdk-focus-outline);
|
|
60
56
|
outline-offset: var(--osdk-focus-visible-outline-offset);
|
|
@@ -90,10 +86,6 @@
|
|
|
90
86
|
);
|
|
91
87
|
}
|
|
92
88
|
|
|
93
|
-
&:focus {
|
|
94
|
-
outline: none;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
89
|
&:focus-visible {
|
|
98
90
|
outline: var(--osdk-focus-outline);
|
|
99
91
|
outline-offset: var(--osdk-focus-visible-outline-offset);
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
2
|
+
/*
|
|
3
|
+
* Copyright 2026 Palantir Technologies, Inc. All rights reserved.
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
import { Tooltip as BaseUITooltip } from "@base-ui/react/tooltip";
|
|
19
|
+
import classnames from "classnames";
|
|
20
|
+
import React from "react";
|
|
21
|
+
import styles from "./Tooltip.module.css";
|
|
22
|
+
function TooltipRoot({
|
|
23
|
+
children,
|
|
24
|
+
...rest
|
|
25
|
+
}) {
|
|
26
|
+
return /*#__PURE__*/React.createElement(BaseUITooltip.Root, rest, children);
|
|
27
|
+
}
|
|
28
|
+
function TooltipProvider({
|
|
29
|
+
children,
|
|
30
|
+
...rest
|
|
31
|
+
}) {
|
|
32
|
+
return /*#__PURE__*/React.createElement(BaseUITooltip.Provider, rest, children);
|
|
33
|
+
}
|
|
34
|
+
function TooltipTrigger({
|
|
35
|
+
className,
|
|
36
|
+
children,
|
|
37
|
+
...rest
|
|
38
|
+
}) {
|
|
39
|
+
return /*#__PURE__*/React.createElement(BaseUITooltip.Trigger, _extends({
|
|
40
|
+
className: classnames(styles.osdkTooltipTrigger, className)
|
|
41
|
+
}, rest), children);
|
|
42
|
+
}
|
|
43
|
+
function TooltipPositioner({
|
|
44
|
+
className,
|
|
45
|
+
children,
|
|
46
|
+
sideOffset = 4,
|
|
47
|
+
...rest
|
|
48
|
+
}) {
|
|
49
|
+
return /*#__PURE__*/React.createElement(BaseUITooltip.Positioner, _extends({
|
|
50
|
+
className: classnames(styles.osdkTooltipPositioner, className),
|
|
51
|
+
sideOffset: sideOffset
|
|
52
|
+
}, rest), children);
|
|
53
|
+
}
|
|
54
|
+
function TooltipPopup({
|
|
55
|
+
className,
|
|
56
|
+
children,
|
|
57
|
+
...rest
|
|
58
|
+
}) {
|
|
59
|
+
return /*#__PURE__*/React.createElement(BaseUITooltip.Popup, _extends({
|
|
60
|
+
className: classnames(styles.osdkTooltipPopup, className)
|
|
61
|
+
}, rest), children);
|
|
62
|
+
}
|
|
63
|
+
export function TooltipArrow() {
|
|
64
|
+
return /*#__PURE__*/React.createElement(BaseUITooltip.Arrow, {
|
|
65
|
+
className: styles.osdkTooltipArrow
|
|
66
|
+
}, /*#__PURE__*/React.createElement(ArrowSvg, null));
|
|
67
|
+
}
|
|
68
|
+
function ArrowSvg(props) {
|
|
69
|
+
return /*#__PURE__*/React.createElement("svg", _extends({
|
|
70
|
+
width: "20",
|
|
71
|
+
height: "10",
|
|
72
|
+
viewBox: "0 0 20 10",
|
|
73
|
+
fill: "none"
|
|
74
|
+
}, props), /*#__PURE__*/React.createElement("path", {
|
|
75
|
+
d: "M9.66437 2.60207L4.80758 6.97318C4.07308 7.63423 3.11989 8 2.13172 8H0V10H20V8H18.5349C17.5468 8 16.5936 7.63423 15.8591 6.97318L11.0023 2.60207C10.622 2.2598 10.0447 2.25979 9.66437 2.60207Z",
|
|
76
|
+
className: styles.tooltipArrowFill
|
|
77
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
78
|
+
d: "M8.99542 1.85876C9.75604 1.17425 10.9106 1.17422 11.6713 1.85878L16.5281 6.22989C17.0789 6.72568 17.7938 7.00001 18.5349 7.00001L15.89 7L11.0023 2.60207C10.622 2.2598 10.0447 2.2598 9.66436 2.60207L4.77734 7L2.13171 7.00001C2.87284 7.00001 3.58774 6.72568 4.13861 6.22989L8.99542 1.85876Z",
|
|
79
|
+
className: styles.tooltipArrowOuterStroke
|
|
80
|
+
}));
|
|
81
|
+
}
|
|
82
|
+
export const Tooltip = {
|
|
83
|
+
Root: TooltipRoot,
|
|
84
|
+
Provider: TooltipProvider,
|
|
85
|
+
Trigger: TooltipTrigger,
|
|
86
|
+
Portal: BaseUITooltip.Portal,
|
|
87
|
+
Positioner: TooltipPositioner,
|
|
88
|
+
Popup: TooltipPopup,
|
|
89
|
+
Arrow: TooltipArrow
|
|
90
|
+
};
|
|
91
|
+
//# sourceMappingURL=Tooltip.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Tooltip.js","names":["Tooltip","BaseUITooltip","classnames","React","styles","TooltipRoot","children","rest","createElement","Root","TooltipProvider","Provider","TooltipTrigger","className","Trigger","_extends","osdkTooltipTrigger","TooltipPositioner","sideOffset","Positioner","osdkTooltipPositioner","TooltipPopup","Popup","osdkTooltipPopup","TooltipArrow","Arrow","osdkTooltipArrow","ArrowSvg","props","width","height","viewBox","fill","d","tooltipArrowFill","tooltipArrowOuterStroke","Portal"],"sources":["Tooltip.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 {\n Tooltip as BaseUITooltip,\n type TooltipPopupProps,\n type TooltipPositionerProps,\n type TooltipProviderProps,\n type TooltipRootProps,\n type TooltipTriggerProps,\n} from \"@base-ui/react/tooltip\";\nimport classnames from \"classnames\";\nimport React from \"react\";\nimport styles from \"./Tooltip.module.css\";\n\nexport interface TooltipProps extends Omit<TooltipRootProps, \"className\"> {}\n\nfunction TooltipRoot({\n children,\n ...rest\n}: TooltipProps): React.ReactElement {\n return (\n <BaseUITooltip.Root {...rest}>\n {children}\n </BaseUITooltip.Root>\n );\n}\n\ninterface TooltipProviderComponentProps\n extends Omit<TooltipProviderProps, \"className\">\n{\n className?: string;\n}\n\nfunction TooltipProvider({\n children,\n ...rest\n}: TooltipProviderComponentProps): React.ReactElement {\n return (\n <BaseUITooltip.Provider\n {...rest}\n >\n {children}\n </BaseUITooltip.Provider>\n );\n}\n\ninterface TooltipTriggerComponentProps\n extends Omit<TooltipTriggerProps, \"className\">\n{\n className?: string;\n}\n\nfunction TooltipTrigger({\n className,\n children,\n ...rest\n}: TooltipTriggerComponentProps): React.ReactElement {\n return (\n <BaseUITooltip.Trigger\n className={classnames(styles.osdkTooltipTrigger, className)}\n {...rest}\n >\n {children}\n </BaseUITooltip.Trigger>\n );\n}\n\ninterface TooltipPositionerComponentProps\n extends Omit<TooltipPositionerProps, \"className\">\n{\n className?: string;\n}\n\nfunction TooltipPositioner({\n className,\n children,\n sideOffset = 4,\n ...rest\n}: TooltipPositionerComponentProps): React.ReactElement {\n return (\n <BaseUITooltip.Positioner\n className={classnames(styles.osdkTooltipPositioner, className)}\n sideOffset={sideOffset}\n {...rest}\n >\n {children}\n </BaseUITooltip.Positioner>\n );\n}\n\ninterface TooltipPopupComponentProps\n extends Omit<TooltipPopupProps, \"className\">\n{\n className?: string;\n}\n\nfunction TooltipPopup({\n className,\n children,\n ...rest\n}: TooltipPopupComponentProps): React.ReactElement {\n return (\n <BaseUITooltip.Popup\n className={classnames(styles.osdkTooltipPopup, className)}\n {...rest}\n >\n {children}\n </BaseUITooltip.Popup>\n );\n}\n\nexport function TooltipArrow(): React.ReactElement {\n return (\n <BaseUITooltip.Arrow className={styles.osdkTooltipArrow}>\n <ArrowSvg />\n </BaseUITooltip.Arrow>\n );\n}\n\nfunction ArrowSvg(props: React.ComponentProps<\"svg\">) {\n return (\n <svg width=\"20\" height=\"10\" viewBox=\"0 0 20 10\" fill=\"none\" {...props}>\n <path\n d=\"M9.66437 2.60207L4.80758 6.97318C4.07308 7.63423 3.11989 8 2.13172 8H0V10H20V8H18.5349C17.5468 8 16.5936 7.63423 15.8591 6.97318L11.0023 2.60207C10.622 2.2598 10.0447 2.25979 9.66437 2.60207Z\"\n className={styles.tooltipArrowFill}\n />\n <path\n d=\"M8.99542 1.85876C9.75604 1.17425 10.9106 1.17422 11.6713 1.85878L16.5281 6.22989C17.0789 6.72568 17.7938 7.00001 18.5349 7.00001L15.89 7L11.0023 2.60207C10.622 2.2598 10.0447 2.2598 9.66436 2.60207L4.77734 7L2.13171 7.00001C2.87284 7.00001 3.58774 6.72568 4.13861 6.22989L8.99542 1.85876Z\"\n className={styles.tooltipArrowOuterStroke}\n />\n </svg>\n );\n}\n\nexport const Tooltip: {\n Root: typeof TooltipRoot;\n Provider: typeof TooltipProvider;\n Trigger: typeof TooltipTrigger;\n Portal: typeof BaseUITooltip.Portal;\n Positioner: typeof TooltipPositioner;\n Popup: typeof TooltipPopup;\n Arrow: typeof TooltipArrow;\n} = {\n Root: TooltipRoot,\n Provider: TooltipProvider,\n Trigger: TooltipTrigger,\n Portal: BaseUITooltip.Portal,\n Positioner: TooltipPositioner,\n Popup: TooltipPopup,\n Arrow: TooltipArrow,\n};\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SACEA,OAAO,IAAIC,aAAa,QAMnB,wBAAwB;AAC/B,OAAOC,UAAU,MAAM,YAAY;AACnC,OAAOC,KAAK,MAAM,OAAO;AACzB,OAAOC,MAAM,MAAM,sBAAsB;AAIzC,SAASC,WAAWA,CAAC;EACnBC,QAAQ;EACR,GAAGC;AACS,CAAC,EAAsB;EACnC,oBACEJ,KAAA,CAAAK,aAAA,CAACP,aAAa,CAACQ,IAAI,EAAKF,IAAI,EACzBD,QACiB,CAAC;AAEzB;AAQA,SAASI,eAAeA,CAAC;EACvBJ,QAAQ;EACR,GAAGC;AAC0B,CAAC,EAAsB;EACpD,oBACEJ,KAAA,CAAAK,aAAA,CAACP,aAAa,CAACU,QAAQ,EACjBJ,IAAI,EAEPD,QACqB,CAAC;A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AACC,IAAI,EAAC;EAAM,GAAKJ,KAAK,gBACnEzB,KAAA,CAAAK,aAAA;IACEyB,CAAC,EAAC,iMAAiM;IACnMpB,SAAS,EAAET,MAAM,CAAC8B;EAAiB,CACpC,CAAC,eACF/B,KAAA,CAAAK,aAAA;IACEyB,CAAC,EAAC,kSAAkS;IACpSpB,SAAS,EAAET,MAAM,CAAC+B;EAAwB,CAC3C,CACE,CAAC;AAEV;AAEA,OAAO,MAAMnC,OAQZ,GAAG;EACFS,IAAI,EAAEJ,WAAW;EACjBM,QAAQ,EAAED,eAAe;EACzBI,OAAO,EAAEF,cAAc;EACvBwB,MAAM,EAAEnC,aAAa,CAACmC,MAAM;EAC5BjB,UAAU,EAAEF,iBAAiB;EAC7BK,KAAK,EAAED,YAAY;EACnBI,KAAK,EAAED;AACT,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,70 @@
|
|
|
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
|
+
.osdkTooltipTrigger {
|
|
18
|
+
border: none;
|
|
19
|
+
background: inherit;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.osdkTooltipPositioner {
|
|
23
|
+
z-index: var(--osdk-tooltip-z-index);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.osdkTooltipPopup {
|
|
27
|
+
padding: var(--osdk-tooltip-padding);
|
|
28
|
+
background-color: var(--osdk-tooltip-bg);
|
|
29
|
+
border-radius: var(--osdk-surface-border-radius);
|
|
30
|
+
box-shadow: var(--osdk-tooltip-shadow);
|
|
31
|
+
max-width: var(--osdk-tooltip-max-width);
|
|
32
|
+
font-size: var(--osdk-tooltip-font-size);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/*
|
|
36
|
+
* Hardcoded values are copied from base ui example
|
|
37
|
+
* https://base-ui.com/react/components/tooltip
|
|
38
|
+
*
|
|
39
|
+
* */
|
|
40
|
+
.osdkTooltipArrow {
|
|
41
|
+
display: flex;
|
|
42
|
+
|
|
43
|
+
&[data-side="top"] {
|
|
44
|
+
bottom: -8px;
|
|
45
|
+
rotate: 180deg;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
&[data-side="bottom"] {
|
|
49
|
+
top: -8px;
|
|
50
|
+
rotate: 0deg;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
&[data-side="left"] {
|
|
54
|
+
right: -13px;
|
|
55
|
+
rotate: 90deg;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
&[data-side="right"] {
|
|
59
|
+
left: -13px;
|
|
60
|
+
rotate: -90deg;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.tooltipArrowFill {
|
|
65
|
+
fill: var(--osdk-tooltip-bg);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.tooltipArrowOuterStroke {
|
|
69
|
+
fill: var(--osdk-tooltip-border-color);
|
|
70
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
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
|
+
export { Tooltip, TooltipArrow } from "./Tooltip.js";
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["Tooltip","TooltipArrow"],"sources":["index.ts"],"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\nexport { Tooltip, TooltipArrow, type TooltipProps } from \"./Tooltip.js\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,OAAO,EAAEC,YAAY,QAA2B,cAAc","ignoreList":[]}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2025 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 React, { memo, useCallback } from "react";
|
|
18
|
+
import { ContainsTextInput } from "./base/inputs/ContainsTextInput.js";
|
|
19
|
+
import { ToggleInput } from "./base/inputs/ToggleInput.js";
|
|
20
|
+
import { LinkedPropertyInput } from "./inputs/LinkedPropertyInput.js";
|
|
21
|
+
import { PropertyFilterInput } from "./inputs/PropertyFilterInput.js";
|
|
22
|
+
function FilterInputInner({
|
|
23
|
+
objectType,
|
|
24
|
+
objectSet,
|
|
25
|
+
definition,
|
|
26
|
+
filterState,
|
|
27
|
+
onFilterStateChanged,
|
|
28
|
+
whereClause
|
|
29
|
+
}) {
|
|
30
|
+
return /*#__PURE__*/React.createElement(FilterInputContent, {
|
|
31
|
+
objectType: objectType,
|
|
32
|
+
objectSet: objectSet,
|
|
33
|
+
definition: definition,
|
|
34
|
+
filterState: filterState,
|
|
35
|
+
onFilterStateChanged: onFilterStateChanged,
|
|
36
|
+
whereClause: whereClause
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
export const FilterInput = /*#__PURE__*/memo(FilterInputInner);
|
|
40
|
+
function FilterInputContent({
|
|
41
|
+
objectType,
|
|
42
|
+
objectSet,
|
|
43
|
+
definition,
|
|
44
|
+
filterState,
|
|
45
|
+
onFilterStateChanged,
|
|
46
|
+
whereClause
|
|
47
|
+
}) {
|
|
48
|
+
switch (definition.type) {
|
|
49
|
+
case "HAS_LINK":
|
|
50
|
+
return /*#__PURE__*/React.createElement(HasLinkInput, {
|
|
51
|
+
filterState: filterState,
|
|
52
|
+
onFilterStateChanged: onFilterStateChanged
|
|
53
|
+
});
|
|
54
|
+
case "LINKED_PROPERTY":
|
|
55
|
+
return /*#__PURE__*/React.createElement(LinkedPropertyInput, {
|
|
56
|
+
objectSet: objectSet,
|
|
57
|
+
definition: definition,
|
|
58
|
+
filterState: filterState,
|
|
59
|
+
onFilterStateChanged: onFilterStateChanged
|
|
60
|
+
});
|
|
61
|
+
case "KEYWORD_SEARCH":
|
|
62
|
+
return /*#__PURE__*/React.createElement(KeywordSearchInput, {
|
|
63
|
+
filterState: filterState,
|
|
64
|
+
onFilterStateChanged: onFilterStateChanged,
|
|
65
|
+
placeholder: definition.label ?? "Search..."
|
|
66
|
+
});
|
|
67
|
+
case "CUSTOM":
|
|
68
|
+
{
|
|
69
|
+
if (!definition.renderInput) {
|
|
70
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
71
|
+
"data-unsupported": "true"
|
|
72
|
+
}, "Custom filter missing renderInput");
|
|
73
|
+
}
|
|
74
|
+
const customFilterState = filterState?.type === "custom" ? filterState : definition.filterState;
|
|
75
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, definition.renderInput({
|
|
76
|
+
objectSet,
|
|
77
|
+
filterState: customFilterState,
|
|
78
|
+
onFilterStateChanged: state => onFilterStateChanged(state)
|
|
79
|
+
}));
|
|
80
|
+
}
|
|
81
|
+
case "PROPERTY":
|
|
82
|
+
return /*#__PURE__*/React.createElement(PropertyFilterInput, {
|
|
83
|
+
objectType: objectType,
|
|
84
|
+
objectSet: objectSet,
|
|
85
|
+
definition: definition,
|
|
86
|
+
filterState: filterState,
|
|
87
|
+
onFilterStateChanged: onFilterStateChanged,
|
|
88
|
+
whereClause: whereClause
|
|
89
|
+
});
|
|
90
|
+
default:
|
|
91
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
92
|
+
"data-unsupported": "true"
|
|
93
|
+
}, "Unsupported filter type");
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
const HasLinkInput = /*#__PURE__*/memo(function ({
|
|
97
|
+
filterState,
|
|
98
|
+
onFilterStateChanged
|
|
99
|
+
}) {
|
|
100
|
+
const hasLink = filterState?.type === "hasLink" ? filterState.hasLink : false;
|
|
101
|
+
const handleChange = useCallback(hasLink => {
|
|
102
|
+
onFilterStateChanged({
|
|
103
|
+
type: "hasLink",
|
|
104
|
+
hasLink
|
|
105
|
+
});
|
|
106
|
+
}, [onFilterStateChanged]);
|
|
107
|
+
return /*#__PURE__*/React.createElement(ToggleInput, {
|
|
108
|
+
enabled: hasLink,
|
|
109
|
+
onChange: handleChange
|
|
110
|
+
});
|
|
111
|
+
});
|
|
112
|
+
const KeywordSearchInput = /*#__PURE__*/memo(function ({
|
|
113
|
+
filterState,
|
|
114
|
+
onFilterStateChanged,
|
|
115
|
+
placeholder
|
|
116
|
+
}) {
|
|
117
|
+
const searchTerm = filterState?.type === "keywordSearch" ? filterState.searchTerm : undefined;
|
|
118
|
+
const operator = filterState?.type === "keywordSearch" ? filterState.operator : "AND";
|
|
119
|
+
const handleChange = useCallback(newSearchTerm => {
|
|
120
|
+
onFilterStateChanged({
|
|
121
|
+
type: "keywordSearch",
|
|
122
|
+
searchTerm: newSearchTerm ?? "",
|
|
123
|
+
operator
|
|
124
|
+
});
|
|
125
|
+
}, [onFilterStateChanged, operator]);
|
|
126
|
+
return /*#__PURE__*/React.createElement(ContainsTextInput, {
|
|
127
|
+
value: searchTerm,
|
|
128
|
+
onChange: handleChange,
|
|
129
|
+
placeholder: placeholder
|
|
130
|
+
});
|
|
131
|
+
});
|
|
132
|
+
//# sourceMappingURL=FilterInput.js.map
|