mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-04 03:20:44 +00:00
These are all the files from the Tabler react repos, made to work with laravel and webpack.
This commit is contained in:
@@ -0,0 +1,69 @@
|
||||
/* @flow */
|
||||
/* eslint-disable no-use-before-define */
|
||||
|
||||
import type { Key } from 'react';
|
||||
|
||||
type PropsType = { [key: string]: any };
|
||||
type DefaultPropsType = { [key: string]: any };
|
||||
|
||||
export type StringTreeNode = {|
|
||||
type: 'string',
|
||||
value: string,
|
||||
|};
|
||||
|
||||
export type NumberTreeNode = {|
|
||||
type: 'number',
|
||||
value: number,
|
||||
|};
|
||||
|
||||
export type ReactElementTreeNode = {|
|
||||
type: 'ReactElement',
|
||||
displayName: string,
|
||||
props: PropsType,
|
||||
defaultProps: DefaultPropsType,
|
||||
childrens: TreeNode[],
|
||||
|};
|
||||
|
||||
export type ReactFragmentTreeNode = {|
|
||||
type: 'ReactFragment',
|
||||
key: ?Key,
|
||||
childrens: TreeNode[],
|
||||
|};
|
||||
|
||||
export type TreeNode =
|
||||
| StringTreeNode
|
||||
| NumberTreeNode
|
||||
| ReactElementTreeNode
|
||||
| ReactFragmentTreeNode;
|
||||
|
||||
export const createStringTreeNode = (value: string): StringTreeNode => ({
|
||||
type: 'string',
|
||||
value,
|
||||
});
|
||||
|
||||
export const createNumberTreeNode = (value: number): NumberTreeNode => ({
|
||||
type: 'number',
|
||||
value,
|
||||
});
|
||||
|
||||
export const createReactElementTreeNode = (
|
||||
displayName: string,
|
||||
props: PropsType,
|
||||
defaultProps: DefaultPropsType,
|
||||
childrens: TreeNode[]
|
||||
): ReactElementTreeNode => ({
|
||||
type: 'ReactElement',
|
||||
displayName,
|
||||
props,
|
||||
defaultProps,
|
||||
childrens,
|
||||
});
|
||||
|
||||
export const createReactFragmentTreeNode = (
|
||||
key: ?Key,
|
||||
childrens: TreeNode[]
|
||||
): ReactFragmentTreeNode => ({
|
||||
type: 'ReactFragment',
|
||||
key,
|
||||
childrens,
|
||||
});
|
Reference in New Issue
Block a user