+
{i18n.t('Select values, or type a numerical filter:')}
+
{'> 5 — ' + i18n.t('greater than 5')}
+
{'>= 5 — ' + i18n.t('greater than or equal to 5')}
+
{'< 5, <= 5 — ' + i18n.t('less than (or equal to) 5')}
+
{'2, > 8 — ' + i18n.t('equal to 2 OR greater than 8')}
+
{'> 3 & < 8 — ' + i18n.t('greater than 3 AND less than 8')}
+
+)
+const TEXT_FILTER_HELP = (
+
+
{i18n.t('Select values, or type text')}
+
{i18n.t('to match rows that contain it')}
+
+)
+const NUMERIC_INPUT_DISALLOWED = /[^0-9.\-<>=,&\s]/g
+
+const helpTooltipModifiers = [
+ { name: 'offset', options: { offset: [0, 4] } },
+ { name: 'flip', enabled: false },
+]
+
+const FilterHelpTooltip = ({
+ content,
+ placement,
+ estimatedHeight,
+ dataTest,
+ children,
+}) => {
+ const [open, setOpen] = useState(false)
+ const referenceRef = useRef(null)
+ const openTimerRef = useRef(null)
+ const closeTimerRef = useRef(null)
+
+ const onOpen = () => {
+ clearTimeout(closeTimerRef.current)
+ openTimerRef.current = setTimeout(() => setOpen(true), 200)
+ }
+
+ const onClose = () => {
+ clearTimeout(openTimerRef.current)
+ closeTimerRef.current = setTimeout(() => setOpen(false), 200)
+ }
+
+ useEffect(
+ () => () => {
+ clearTimeout(openTimerRef.current)
+ clearTimeout(closeTimerRef.current)
+ },
+ []
+ )
+
+ const referenceRect = referenceRef.current?.getBoundingClientRect()
+ let spaceAvailable = Infinity
+ if (referenceRect) {
+ spaceAvailable =
+ placement === 'top'
+ ? referenceRect.top
+ : window.innerHeight - referenceRect.bottom
+ }
+ const hasRoom = spaceAvailable >= estimatedHeight
+
+ return (
+ onDragStart(evt)}
- onDragEnd={(evt) => onDragEnd(evt)}
+ onPointerDown={onPointerDown}
+ onPointerMove={onPointerMove}
+ onPointerUp={onPointerUp}
+ onPointerCancel={onPointerUp}
>
-
+
+
+
)
}
diff --git a/src/components/datatable/TableContextMenu.jsx b/src/components/datatable/TableContextMenu.jsx
index 21f582693..add98bcb6 100644
--- a/src/components/datatable/TableContextMenu.jsx
+++ b/src/components/datatable/TableContextMenu.jsx
@@ -24,7 +24,13 @@ import { drillUpDown } from '../../util/map.js'
import { useCachedData } from '../cachedDataProvider/CachedDataProvider.jsx'
import { IconZoomIn16 } from '../core/icons.jsx'
-const TableContextMenu = ({ contextMenu, layer, selectedIds, onClose }) => {
+const TableContextMenu = ({
+ contextMenu,
+ layer,
+ selectedIds,
+ filteredIds,
+ onClose,
+}) => {
const anchorRef = useRef()
const dispatch = useDispatch()
const {
@@ -191,6 +197,23 @@ const TableContextMenu = ({ contextMenu, layer, selectedIds, onClose }) => {
onClose()
}}
/>
+