@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
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,32 @@
|
|
|
1
1
|
# @osdk/react-components
|
|
2
2
|
|
|
3
|
+
## 0.2.0-beta.17
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 7542c11: add remove button to filter list items and memoize dnd accessibility props
|
|
8
|
+
- 05618c3: Add validation state to editable cell
|
|
9
|
+
|
|
10
|
+
### Patch Changes
|
|
11
|
+
|
|
12
|
+
- @osdk/api@2.8.0-beta.20
|
|
13
|
+
- @osdk/client@2.8.0-beta.20
|
|
14
|
+
- @osdk/react@0.10.0-beta.8
|
|
15
|
+
|
|
16
|
+
## 0.2.0-beta.16
|
|
17
|
+
|
|
18
|
+
### Minor Changes
|
|
19
|
+
|
|
20
|
+
- 06095fa: Restructure FilterList into base and osdk layers
|
|
21
|
+
- f6649a5: add collapsible panel, select all, include/exclude toggle, per-item colors, histogram display modes, and session persistence support to filter list
|
|
22
|
+
- 1135a27: Update Blueprint css import
|
|
23
|
+
|
|
24
|
+
### Patch Changes
|
|
25
|
+
|
|
26
|
+
- @osdk/api@2.8.0-beta.19
|
|
27
|
+
- @osdk/client@2.8.0-beta.19
|
|
28
|
+
- @osdk/react@0.10.0-beta.8
|
|
29
|
+
|
|
3
30
|
## 0.2.0-beta.15
|
|
4
31
|
|
|
5
32
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# @osdk/react-components
|
|
2
2
|
|
|
3
|
+
> **⚠️ Beta Release**: This package is currently in beta. Please use the latest beta version for the most up-to-date features and fixes.
|
|
4
|
+
|
|
3
5
|
React components for building Foundry applications. These components are Ontology-aware — pass in OSDK entities, and they handle data loading, caching, and state management automatically.
|
|
4
6
|
|
|
5
7
|
Built on top of [@osdk/react](../react), these components use OSDK hooks internally to provide ready-to-use UI elements. While @osdk/react gives you low-level hooks for data fetching, @osdk/react-components provides UI widgets for common patterns like tables and forms.
|
|
@@ -12,7 +14,7 @@ Run the command to install:
|
|
|
12
14
|
- @osdk/react-components-styles - The default styles for the components
|
|
13
15
|
|
|
14
16
|
```sh
|
|
15
|
-
npm install @osdk/react-components @osdk/react-components-styles
|
|
17
|
+
npm install @osdk/react-components@beta @osdk/react-components-styles@beta
|
|
16
18
|
```
|
|
17
19
|
|
|
18
20
|
**Peer Dependencies:**
|
|
@@ -77,7 +79,7 @@ The components that this package will provide are:
|
|
|
77
79
|
|
|
78
80
|
| Component | Description | Documentation |
|
|
79
81
|
| ------------- | ---------------------------------------------------------------------------------- | ------------------------------ |
|
|
80
|
-
| `ObjectTable` | Displays an Object Set as a sortable, paginated table
|
|
82
|
+
| `ObjectTable` | Displays an Object Set as a sortable, paginated table with inline editing support | [Guide](./docs/ObjectTable.md) |
|
|
81
83
|
| `FilterList` | Visualize a high-level summary of objects data to allow users to filter that data. | - |
|
|
82
84
|
| `ActionForm` | Auto-generated form for executing Ontology Actions | - |
|
|
83
85
|
|
|
@@ -91,7 +93,7 @@ See `@osdk/react-components-styles` README on how to apply custom themes and sty
|
|
|
91
93
|
|
|
92
94
|
```ts
|
|
93
95
|
import { ObjectTable } from "@osdk/react-components/experimental";
|
|
94
|
-
import {
|
|
96
|
+
import { Employee } from "@your-osdk-package";
|
|
95
97
|
|
|
96
98
|
function EmployeeDirectory() {
|
|
97
99
|
return (
|
|
@@ -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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C,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":[]}
|
|
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,SAA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F;;MAEA;MACA,IAAIG,EAAE,CAAEM,aAAa,CAAC,0BAA0B,CAAC,IAAI,IAAI,EAAE;QACzD;MACF;MAEArB,KAAK,CAACsB,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.js";
|
|
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;AAC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zB,KAAA,CAAAK,aAAA,QAAAO,QAAA;IAAKc,KAAK,EAAC,IAAI;IAACC,MAAM,EAAC,IAAI;IAACC,OAAO,EAAC,WAAW;IAACC,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,11 @@
|
|
|
1
|
+
// CSS Module proxy for Tooltip.module.css
|
|
2
|
+
const styles = {
|
|
3
|
+
"osdkTooltipTrigger": "Tooltip-module__osdkTooltipTrigger___KY5Ck6WI",
|
|
4
|
+
"osdkTooltipPositioner": "Tooltip-module__osdkTooltipPositioner___3DC1bpvr",
|
|
5
|
+
"osdkTooltipPopup": "Tooltip-module__osdkTooltipPopup___QgGaKttX",
|
|
6
|
+
"osdkTooltipArrow": "Tooltip-module__osdkTooltipArrow___42KD-Edu",
|
|
7
|
+
"tooltipArrowFill": "Tooltip-module__tooltipArrowFill___4DZeMWmZ",
|
|
8
|
+
"tooltipArrowOuterStroke": "Tooltip-module__tooltipArrowOuterStroke___ATRD8XzR"
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export default styles;
|
|
@@ -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
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FilterInput.js","names":["React","memo","useCallback","ContainsTextInput","ToggleInput","LinkedPropertyInput","PropertyFilterInput","FilterInputInner","objectType","objectSet","definition","filterState","onFilterStateChanged","whereClause","createElement","FilterInputContent","FilterInput","type","HasLinkInput","KeywordSearchInput","placeholder","label","renderInput","customFilterState","Fragment","state","hasLink","handleChange","enabled","onChange","searchTerm","undefined","operator","newSearchTerm","value"],"sources":["FilterInput.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 { ObjectSet, ObjectTypeDefinition, WhereClause } from \"@osdk/api\";\nimport React, { memo, useCallback } from \"react\";\nimport { ContainsTextInput } from \"./base/inputs/ContainsTextInput.js\";\nimport { ToggleInput } from \"./base/inputs/ToggleInput.js\";\nimport type { FilterDefinitionUnion } from \"./FilterListApi.js\";\nimport type { FilterState } from \"./FilterListItemApi.js\";\nimport { LinkedPropertyInput } from \"./inputs/LinkedPropertyInput.js\";\nimport { PropertyFilterInput } from \"./inputs/PropertyFilterInput.js\";\n\ninterface FilterInputProps<Q extends ObjectTypeDefinition> {\n objectType: Q;\n objectSet: ObjectSet<Q>;\n definition: FilterDefinitionUnion<Q>;\n filterState: FilterState | undefined;\n onFilterStateChanged: (state: FilterState) => void;\n whereClause: WhereClause<Q>;\n}\n\nfunction FilterInputInner<Q extends ObjectTypeDefinition>({\n objectType,\n objectSet,\n definition,\n filterState,\n onFilterStateChanged,\n whereClause,\n}: FilterInputProps<Q>): React.ReactElement {\n return (\n <FilterInputContent\n objectType={objectType}\n objectSet={objectSet}\n definition={definition}\n filterState={filterState}\n onFilterStateChanged={onFilterStateChanged}\n whereClause={whereClause}\n />\n );\n}\n\nexport const FilterInput = memo(FilterInputInner) as typeof FilterInputInner;\n\nfunction FilterInputContent<Q extends ObjectTypeDefinition>({\n objectType,\n objectSet,\n definition,\n filterState,\n onFilterStateChanged,\n whereClause,\n}: FilterInputProps<Q>): React.ReactElement {\n switch (definition.type) {\n case \"HAS_LINK\":\n return (\n <HasLinkInput\n filterState={filterState}\n onFilterStateChanged={onFilterStateChanged}\n />\n );\n\n case \"LINKED_PROPERTY\":\n return (\n <LinkedPropertyInput\n objectSet={objectSet}\n definition={definition}\n filterState={filterState}\n onFilterStateChanged={onFilterStateChanged}\n />\n );\n\n case \"KEYWORD_SEARCH\":\n return (\n <KeywordSearchInput\n filterState={filterState}\n onFilterStateChanged={onFilterStateChanged}\n placeholder={definition.label ?? \"Search...\"}\n />\n );\n\n case \"CUSTOM\": {\n if (!definition.renderInput) {\n return (\n <div data-unsupported=\"true\">Custom filter missing renderInput</div>\n );\n }\n const customFilterState = filterState?.type === \"custom\"\n ? filterState\n : definition.filterState;\n return (\n <>\n {definition.renderInput({\n objectSet,\n filterState: customFilterState,\n onFilterStateChanged: (state) => onFilterStateChanged(state),\n })}\n </>\n );\n }\n\n case \"PROPERTY\":\n return (\n <PropertyFilterInput\n objectType={objectType}\n objectSet={objectSet}\n definition={definition}\n filterState={filterState}\n onFilterStateChanged={onFilterStateChanged}\n whereClause={whereClause}\n />\n );\n\n default:\n return <div data-unsupported=\"true\">Unsupported filter type</div>;\n }\n}\n\ninterface HasLinkInputProps {\n filterState: FilterState | undefined;\n onFilterStateChanged: (state: FilterState) => void;\n}\n\nconst HasLinkInput = memo(function HasLinkInput({\n filterState,\n onFilterStateChanged,\n}: HasLinkInputProps): React.ReactElement {\n const hasLink = filterState?.type === \"hasLink\"\n ? filterState.hasLink\n : false;\n\n const handleChange = useCallback(\n (hasLink: boolean) => {\n onFilterStateChanged({ type: \"hasLink\", hasLink });\n },\n [onFilterStateChanged],\n );\n\n return <ToggleInput enabled={hasLink} onChange={handleChange} />;\n});\n\ninterface KeywordSearchInputProps {\n filterState: FilterState | undefined;\n onFilterStateChanged: (state: FilterState) => void;\n placeholder: string;\n}\n\nconst KeywordSearchInput = memo(function KeywordSearchInput({\n filterState,\n onFilterStateChanged,\n placeholder,\n}: KeywordSearchInputProps): React.ReactElement {\n const searchTerm = filterState?.type === \"keywordSearch\"\n ? filterState.searchTerm\n : undefined;\n const operator = filterState?.type === \"keywordSearch\"\n ? filterState.operator\n : \"AND\";\n\n const handleChange = useCallback(\n (newSearchTerm: string | undefined) => {\n onFilterStateChanged({\n type: \"keywordSearch\",\n searchTerm: newSearchTerm ?? \"\",\n operator,\n });\n },\n [onFilterStateChanged, operator],\n );\n\n return (\n <ContainsTextInput\n value={searchTerm}\n onChange={handleChange}\n placeholder={placeholder}\n />\n );\n});\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,OAAOA,KAAK,IAAIC,IAAI,EAAEC,WAAW,QAAQ,OAAO;AAChD,SAASC,iBAAiB,QAAQ,oCAAoC;AACtE,SAASC,WAAW,QAAQ,8BAA8B;AAG1D,SAASC,mBAAmB,QAAQ,iCAAiC;AACrE,SAASC,mBAAmB,QAAQ,iCAAiC;AAWrE,SAASC,gBAAgBA,CAAiC;EACxDC,UAAU;EACVC,SAAS;EACT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