MCPcopy Create free account
hub / github.com/microsoft/SandDance / _PositionedColumnMap

Function _PositionedColumnMap

docs/app/js/sanddance-app.js:353–407  ·  view source on GitHub ↗
(props1)

Source from the content-addressed store, hash-verified

351 return n + "px";
352}
353function _PositionedColumnMap(props1) {
354 class __PositionedColumnMap extends (0, _base.base).react.Component {
355 constructor(props){
356 super(props);
357 const { left , top } = props;
358 this.state = {
359 left,
360 top
361 };
362 this.dropdownRef = (0, _base.base).react.createRef();
363 }
364 focus() {
365 if (!this.focused) {
366 this.focused = true;
367 this.dropdownRef.current.focus(true);
368 }
369 }
370 componentDidMount() {
371 const size = (0, _sanddanceReact.SandDance).VegaDeckGl.util.outerSize(this.div);
372 const over = {
373 left: Math.max(0, this.state.left + size.width - this.props.container.offsetWidth),
374 top: Math.max(0, this.state.top + size.height - this.props.container.offsetHeight)
375 };
376 if (over.left || over.top) {
377 let { left , top } = this.state;
378 left -= over.left;
379 top -= over.top;
380 this.setState({
381 left,
382 top
383 });
384 } else this.focus();
385 }
386 componentDidUpdate() {
387 this.focus();
388 }
389 render() {
390 return (0, _base.base).react.createElement("div", {
391 ref: (div)=>{
392 if (div) this.div = div;
393 },
394 className: "sanddance-columnMap-absolute",
395 style: {
396 position: "absolute",
397 left: px(this.state.left),
398 top: px(this.state.top)
399 }
400 }, (0, _base.base).react.createElement((0, _columnMap.ColumnMap), Object.assign({}, this.props, {
401 componentRef: this.dropdownRef,
402 hideSignals: true
403 })));
404 }
405 }
406 return new __PositionedColumnMap(props1);
407}
408const PositionedColumnMap = _PositionedColumnMap;
409
410},{"./base":"b6Cy1","./controls/columnMap":"6MgAn","@msrvida/sanddance-react":"4uo3s","@parcel/transformer-js/src/esmodule-helpers.js":"jA2du"}],"6MgAn":[function(require,module,exports) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected