Summary: _typescript_

Reviewed By: jknoxville

Differential Revision: D16807179

fbshipit-source-id: b5de66d686394acba6552de139764bb65b3ac652
This commit is contained in:
Daniel Büchele
2019-08-20 05:40:31 -07:00
committed by Facebook Github Bot
parent 1deb3c68f9
commit c8c90ee413
8 changed files with 175 additions and 37 deletions

View File

@@ -21,6 +21,7 @@ type Props = {
children: React.ReactNode;
/** The component that is used to wrap the children. Defaults to `FlexColumn`. */
component: React.ComponentType<any> | string;
onMouseDown: (e: React.MouseEvent) => any;
};
/**

View File

@@ -5,12 +5,12 @@
* @format
*/
import type {Filter} from './types.js';
import {PureComponent} from 'react';
import ContextMenu from '../ContextMenu.tsx';
import textContent from '../../../utils/textContent.tsx';
import styled from '../../styled/index.js';
import {colors} from '../colors.tsx';
import {Filter} from './types.js';
import React, {PureComponent} from 'react';
import ContextMenu from '../ContextMenu';
import textContent from '../../../utils/textContent';
import styled from 'react-emotion';
import {colors} from '../colors';
const FilterText = styled('div')({
display: 'flex',
@@ -40,13 +40,13 @@ const FilterText = styled('div')({
});
type Props = {
children: React.Node,
addFilter: (filter: Filter) => void,
filterKey: string,
children: React.ReactNode;
addFilter: (filter: Filter) => void;
filterKey: string;
};
export default class FilterRow extends PureComponent<Props> {
onClick = (e: SyntheticMouseEvent<>) => {
onClick = (e: React.MouseEvent) => {
if (e.button === 0) {
this.props.addFilter({
type: e.metaKey || e.altKey ? 'exclude' : 'include',

View File

@@ -1,24 +0,0 @@
/**
* Copyright 2018-present Facebook.
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
* @format
*/
export type Filter =
| {
key: string,
value: string,
type: 'include' | 'exclude',
}
| {
key: string,
value: Array<string>,
type: 'enum',
enum: Array<{
label: string,
color?: string,
value: string,
}>,
persistent?: boolean,
};

View File

@@ -0,0 +1,24 @@
/**
* Copyright 2018-present Facebook.
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
* @format
*/
export type Filter =
| {
key: string;
value: string;
type: 'include' | 'exclude';
}
| {
key: string;
value: Array<string>;
type: 'enum';
enum: Array<{
label: string;
color?: string;
value: string;
}>;
persistent?: boolean;
};

View File

@@ -13,7 +13,7 @@ import type {
} from './types.js';
import React from 'react';
import FilterRow from '../filter/FilterRow.js';
import FilterRow from '../filter/FilterRow.tsx';
import styled from '../../styled/index.js';
import FlexRow from '../FlexRow.tsx';
import {colors} from '../colors.tsx';

View File

@@ -5,7 +5,7 @@
* @format
*/
import type {Filter} from '../filter/types.js';
import type {Filter} from '../filter/types.tsx';
import {List} from 'immutable';

View File

@@ -142,7 +142,7 @@ export {default as Label} from './components/Label.tsx';
export {default as Heading} from './components/Heading.tsx';
// filters
export type {Filter} from './components/filter/types.js';
export type {Filter} from './components/filter/types.tsx';
export {default as MarkerTimeline} from './components/MarkerTimeline.tsx';