| undefined) => {
event && this._dashDoc && (this._dashDoc[this._fieldKey] = event.target.value);
};
@computed get values() {
if (this._props.expanded) return [];
const vals = FilterPanel.gatherFieldValues(DocListCast(Doc.ActiveDashboard?.data), this._fieldKey, []);
return vals.strings.map(facet => ({ value: facet, label: facet }));
}
render() {
return (
{this._props.hideKey || this._hideKey ? null : (
{(Doc.AreProtosEqual(DocCast(this._textBoxDoc.rootDocument) ?? this._textBoxDoc, DocCast(this._dashDoc?.rootDocument) ?? this._dashDoc) ? '' : this._dashDoc?.title + ':') + this._fieldKey}
)}
{this._props.fieldKey.startsWith('#') ? null : this.fieldValueContent}
{!this.values.length ? null : (
)}
);
}
}
@observer
export class DashFieldViewMenu extends AntimodeMenu {
static Instance: DashFieldViewMenu;
static createFieldView: (e: React.MouseEvent) => void = emptyFunction;
static toggleFieldHide: () => void = emptyFunction;
constructor(props: any) {
super(props);
DashFieldViewMenu.Instance = this;
}
showFields = (e: React.MouseEvent) => {
DashFieldViewMenu.createFieldView(e);
DashFieldViewMenu.Instance.fadeOut(true);
};
toggleFieldHide = (e: React.MouseEvent) => {
DashFieldViewMenu.toggleFieldHide();
DashFieldViewMenu.Instance.fadeOut(true);
};
@observable _fieldKey = '';
@action
public show = (x: number, y: number, fieldKey: string) => {
this._fieldKey = fieldKey;
this.jumpTo(x, y, true);
const hideMenu = () => {
this.fadeOut(true);
document.removeEventListener('pointerdown', hideMenu, true);
};
document.addEventListener('pointerdown', hideMenu, true);
};
render() {
return this.getElement(
{`Show Pivot Viewer for '${this._fieldKey}'`}}>
);
}
}