@draftbit/core 46.9.1-26da3e.2 → 46.9.1-2a60b8.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonjs/components/Container.js +4 -15
- package/lib/commonjs/components/YotubePlayer.js +38 -0
- package/lib/commonjs/constants.js +1 -1
- package/lib/commonjs/index.js +7 -19
- package/lib/commonjs/mappings/ActionSheet.js +1 -1
- package/lib/commonjs/mappings/ActionSheetCancel.js +1 -1
- package/lib/commonjs/mappings/ActionSheetItem.js +1 -1
- package/lib/commonjs/mappings/MapCallout.js +1 -1
- package/lib/commonjs/mappings/MapMarker.js +1 -1
- package/lib/commonjs/mappings/YoutubePlayer.js +44 -0
- package/lib/module/components/Accordion/AccordionItem.js +25 -4
- package/lib/module/components/YotubePlayer.js +30 -0
- package/lib/module/index.js +1 -1
- package/lib/module/mappings/ActionSheet.js +1 -1
- package/lib/module/mappings/ActionSheetCancel.js +1 -1
- package/lib/module/mappings/ActionSheetItem.js +1 -1
- package/lib/module/mappings/MapCallout.js +2 -2
- package/lib/module/mappings/MapMarker.js +2 -2
- package/lib/module/mappings/YoutubePlayer.js +37 -0
- package/lib/typescript/src/components/YotubePlayer.d.ts +12 -0
- package/lib/typescript/src/components/YotubePlayer.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +1 -1
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/mappings/ActionSheet.d.ts.map +1 -1
- package/lib/typescript/src/mappings/ActionSheetCancel.d.ts.map +1 -1
- package/lib/typescript/src/mappings/ActionSheetItem.d.ts.map +1 -1
- package/lib/typescript/src/mappings/MapCallout.d.ts.map +1 -1
- package/lib/typescript/src/mappings/MapMarker.d.ts.map +1 -1
- package/lib/typescript/src/mappings/YoutubePlayer.d.ts +37 -0
- package/lib/typescript/src/mappings/YoutubePlayer.d.ts.map +1 -0
- package/package.json +6 -4
- package/src/components/YotubePlayer.js +10 -0
- package/src/components/YotubePlayer.tsx +38 -0
- package/src/index.js +1 -1
- package/src/index.tsx +1 -1
- package/src/mappings/ActionSheet.js +4 -1
- package/src/mappings/ActionSheet.ts +4 -1
- package/src/mappings/ActionSheetCancel.js +4 -1
- package/src/mappings/ActionSheetCancel.ts +4 -1
- package/src/mappings/ActionSheetItem.js +4 -1
- package/src/mappings/ActionSheetItem.ts +4 -1
- package/src/mappings/MapCallout.js +6 -2
- package/src/mappings/MapCallout.ts +6 -2
- package/src/mappings/MapMarker.js +6 -2
- package/src/mappings/MapMarker.ts +6 -2
- package/src/mappings/YoutubePlayer.js +37 -0
- package/src/mappings/YoutubePlayer.ts +43 -0
- package/lib/commonjs/components/Table/Table.js +0 -50
- package/lib/commonjs/components/Table/TableCell.js +0 -49
- package/lib/commonjs/components/Table/TableCommon.js +0 -30
- package/lib/commonjs/components/Table/TableRow.js +0 -57
- package/lib/commonjs/components/Table/index.js +0 -27
- package/lib/commonjs/mappings/Table.js +0 -143
- package/lib/module/components/Table/Table.js +0 -42
- package/lib/module/components/Table/TableCell.js +0 -41
- package/lib/module/components/Table/TableCommon.js +0 -21
- package/lib/module/components/Table/TableRow.js +0 -49
- package/lib/module/components/Table/index.js +0 -3
- package/lib/module/mappings/Table.js +0 -136
- package/lib/typescript/src/components/Table/Table.d.ts +0 -13
- package/lib/typescript/src/components/Table/Table.d.ts.map +0 -1
- package/lib/typescript/src/components/Table/TableCell.d.ts +0 -9
- package/lib/typescript/src/components/Table/TableCell.d.ts.map +0 -1
- package/lib/typescript/src/components/Table/TableCommon.d.ts +0 -20
- package/lib/typescript/src/components/Table/TableCommon.d.ts.map +0 -1
- package/lib/typescript/src/components/Table/TableRow.d.ts +0 -9
- package/lib/typescript/src/components/Table/TableRow.d.ts.map +0 -1
- package/lib/typescript/src/components/Table/index.d.ts +0 -4
- package/lib/typescript/src/components/Table/index.d.ts.map +0 -1
- package/lib/typescript/src/mappings/Table.d.ts +0 -314
- package/lib/typescript/src/mappings/Table.d.ts.map +0 -1
- package/src/components/Table/Table.js +0 -25
- package/src/components/Table/Table.tsx +0 -56
- package/src/components/Table/TableCell.js +0 -31
- package/src/components/Table/TableCell.tsx +0 -63
- package/src/components/Table/TableCommon.js +0 -12
- package/src/components/Table/TableCommon.ts +0 -40
- package/src/components/Table/TableRow.js +0 -32
- package/src/components/Table/TableRow.tsx +0 -65
- package/src/components/Table/index.js +0 -3
- package/src/components/Table/index.tsx +0 -3
- package/src/mappings/Table.js +0 -137
- package/src/mappings/Table.ts +0 -161
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { ScrollView, StyleProp, ViewStyle } from "react-native";
|
|
3
|
-
import { Theme } from "../../styles/DefaultTheme";
|
|
4
|
-
import { withTheme } from "../../theming";
|
|
5
|
-
import {
|
|
6
|
-
generateBorderStyles,
|
|
7
|
-
TableProps,
|
|
8
|
-
TableStyleContext,
|
|
9
|
-
TableStyleProps,
|
|
10
|
-
} from "./TableCommon";
|
|
11
|
-
|
|
12
|
-
export interface Props extends TableProps {
|
|
13
|
-
style?: StyleProp<ViewStyle>;
|
|
14
|
-
theme: Theme;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
const Table: React.FC<React.PropsWithChildren<Props>> = ({
|
|
18
|
-
theme,
|
|
19
|
-
borderWidth = 1,
|
|
20
|
-
borderColor = theme.colors.divider,
|
|
21
|
-
borderStyle = "solid",
|
|
22
|
-
drawTopBorder = true,
|
|
23
|
-
drawBottomBorder = false,
|
|
24
|
-
drawStartBorder = false,
|
|
25
|
-
drawEndBorder = false,
|
|
26
|
-
cellVerticalPadding = 10,
|
|
27
|
-
cellHorizontalPadding = 10,
|
|
28
|
-
children,
|
|
29
|
-
style,
|
|
30
|
-
}) => {
|
|
31
|
-
const contextValue: TableStyleProps = {
|
|
32
|
-
borderColor,
|
|
33
|
-
borderStyle,
|
|
34
|
-
borderWidth,
|
|
35
|
-
cellHorizontalPadding,
|
|
36
|
-
cellVerticalPadding,
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
const borderViewStyle = generateBorderStyles({
|
|
40
|
-
borderColor,
|
|
41
|
-
borderWidth,
|
|
42
|
-
borderStyle,
|
|
43
|
-
drawTopBorder,
|
|
44
|
-
drawBottomBorder,
|
|
45
|
-
drawStartBorder,
|
|
46
|
-
drawEndBorder,
|
|
47
|
-
});
|
|
48
|
-
|
|
49
|
-
return (
|
|
50
|
-
<TableStyleContext.Provider value={contextValue}>
|
|
51
|
-
<ScrollView style={[borderViewStyle, style]}>{children}</ScrollView>
|
|
52
|
-
</TableStyleContext.Provider>
|
|
53
|
-
);
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
export default withTheme(Table);
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { View, StyleSheet } from "react-native";
|
|
3
|
-
import { generateBorderStyles, TableStyleContext, } from "./TableCommon";
|
|
4
|
-
const TableCell = ({ borderWidth, borderColor, borderStyle, drawTopBorder = false, drawBottomBorder = false, drawStartBorder = false, drawEndBorder = true, cellVerticalPadding, cellHorizontalPadding, children, style, }) => {
|
|
5
|
-
const parentContextValue = React.useContext(TableStyleContext);
|
|
6
|
-
const borderViewStyle = generateBorderStyles({
|
|
7
|
-
borderColor: borderColor || parentContextValue.borderColor,
|
|
8
|
-
borderWidth: borderWidth || parentContextValue.borderWidth,
|
|
9
|
-
borderStyle: borderStyle || parentContextValue.borderStyle,
|
|
10
|
-
drawTopBorder,
|
|
11
|
-
drawBottomBorder,
|
|
12
|
-
drawStartBorder,
|
|
13
|
-
drawEndBorder,
|
|
14
|
-
});
|
|
15
|
-
return (React.createElement(View, { style: [
|
|
16
|
-
styles.cellContainer,
|
|
17
|
-
borderViewStyle,
|
|
18
|
-
{
|
|
19
|
-
paddingVertical: cellVerticalPadding || parentContextValue.cellVerticalPadding,
|
|
20
|
-
paddingHorizontal: cellHorizontalPadding || parentContextValue.cellHorizontalPadding,
|
|
21
|
-
},
|
|
22
|
-
style,
|
|
23
|
-
] }, children));
|
|
24
|
-
};
|
|
25
|
-
const styles = StyleSheet.create({
|
|
26
|
-
cellContainer: {
|
|
27
|
-
flex: 1,
|
|
28
|
-
flexDirection: "row",
|
|
29
|
-
},
|
|
30
|
-
});
|
|
31
|
-
export default TableCell;
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { View, StyleProp, ViewStyle, StyleSheet } from "react-native";
|
|
3
|
-
import {
|
|
4
|
-
generateBorderStyles,
|
|
5
|
-
TableProps,
|
|
6
|
-
TableStyleContext,
|
|
7
|
-
} from "./TableCommon";
|
|
8
|
-
|
|
9
|
-
export interface Props extends TableProps {
|
|
10
|
-
style?: StyleProp<ViewStyle>;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
const TableCell: React.FC<React.PropsWithChildren<Props>> = ({
|
|
14
|
-
borderWidth,
|
|
15
|
-
borderColor,
|
|
16
|
-
borderStyle,
|
|
17
|
-
drawTopBorder = false,
|
|
18
|
-
drawBottomBorder = false,
|
|
19
|
-
drawStartBorder = false,
|
|
20
|
-
drawEndBorder = true,
|
|
21
|
-
cellVerticalPadding,
|
|
22
|
-
cellHorizontalPadding,
|
|
23
|
-
children,
|
|
24
|
-
style,
|
|
25
|
-
}) => {
|
|
26
|
-
const parentContextValue = React.useContext(TableStyleContext);
|
|
27
|
-
|
|
28
|
-
const borderViewStyle = generateBorderStyles({
|
|
29
|
-
borderColor: borderColor || parentContextValue.borderColor,
|
|
30
|
-
borderWidth: borderWidth || parentContextValue.borderWidth,
|
|
31
|
-
borderStyle: borderStyle || parentContextValue.borderStyle,
|
|
32
|
-
drawTopBorder,
|
|
33
|
-
drawBottomBorder,
|
|
34
|
-
drawStartBorder,
|
|
35
|
-
drawEndBorder,
|
|
36
|
-
});
|
|
37
|
-
return (
|
|
38
|
-
<View
|
|
39
|
-
style={[
|
|
40
|
-
styles.cellContainer,
|
|
41
|
-
borderViewStyle,
|
|
42
|
-
{
|
|
43
|
-
paddingVertical:
|
|
44
|
-
cellVerticalPadding || parentContextValue.cellVerticalPadding,
|
|
45
|
-
paddingHorizontal:
|
|
46
|
-
cellHorizontalPadding || parentContextValue.cellHorizontalPadding,
|
|
47
|
-
},
|
|
48
|
-
style,
|
|
49
|
-
]}
|
|
50
|
-
>
|
|
51
|
-
{children}
|
|
52
|
-
</View>
|
|
53
|
-
);
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
const styles = StyleSheet.create({
|
|
57
|
-
cellContainer: {
|
|
58
|
-
flex: 1,
|
|
59
|
-
flexDirection: "row",
|
|
60
|
-
},
|
|
61
|
-
});
|
|
62
|
-
|
|
63
|
-
export default TableCell;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
export const TableStyleContext = React.createContext({});
|
|
3
|
-
export function generateBorderStyles({ borderColor, borderWidth, borderStyle, drawTopBorder, drawBottomBorder, drawStartBorder, drawEndBorder, }) {
|
|
4
|
-
return {
|
|
5
|
-
borderColor,
|
|
6
|
-
borderStyle,
|
|
7
|
-
borderTopWidth: drawTopBorder ? borderWidth : 0,
|
|
8
|
-
borderBottomWidth: drawBottomBorder ? borderWidth : 0,
|
|
9
|
-
borderStartWidth: drawStartBorder ? borderWidth : 0,
|
|
10
|
-
borderEndWidth: drawEndBorder ? borderWidth : 0,
|
|
11
|
-
};
|
|
12
|
-
}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { ViewStyle } from "react-native";
|
|
3
|
-
|
|
4
|
-
type BorderStyle = "solid" | "dotted" | "dashed";
|
|
5
|
-
|
|
6
|
-
export const TableStyleContext = React.createContext<TableStyleProps>({});
|
|
7
|
-
|
|
8
|
-
export interface TableStyleProps {
|
|
9
|
-
borderWidth?: number;
|
|
10
|
-
borderColor?: string;
|
|
11
|
-
borderStyle?: BorderStyle;
|
|
12
|
-
cellVerticalPadding?: number;
|
|
13
|
-
cellHorizontalPadding?: number;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export interface TableProps extends TableStyleProps {
|
|
17
|
-
drawTopBorder?: boolean;
|
|
18
|
-
drawBottomBorder?: boolean;
|
|
19
|
-
drawStartBorder?: boolean;
|
|
20
|
-
drawEndBorder?: boolean;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export function generateBorderStyles({
|
|
24
|
-
borderColor,
|
|
25
|
-
borderWidth,
|
|
26
|
-
borderStyle,
|
|
27
|
-
drawTopBorder,
|
|
28
|
-
drawBottomBorder,
|
|
29
|
-
drawStartBorder,
|
|
30
|
-
drawEndBorder,
|
|
31
|
-
}: TableProps): ViewStyle {
|
|
32
|
-
return {
|
|
33
|
-
borderColor,
|
|
34
|
-
borderStyle,
|
|
35
|
-
borderTopWidth: drawTopBorder ? borderWidth : 0,
|
|
36
|
-
borderBottomWidth: drawBottomBorder ? borderWidth : 0,
|
|
37
|
-
borderStartWidth: drawStartBorder ? borderWidth : 0,
|
|
38
|
-
borderEndWidth: drawEndBorder ? borderWidth : 0,
|
|
39
|
-
};
|
|
40
|
-
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { View, StyleSheet } from "react-native";
|
|
3
|
-
import { generateBorderStyles, TableStyleContext, } from "./TableCommon";
|
|
4
|
-
const TableRow = ({ borderWidth, borderColor, borderStyle, drawTopBorder = false, drawBottomBorder = true, drawStartBorder = true, drawEndBorder = false, cellVerticalPadding, cellHorizontalPadding, children, style, }) => {
|
|
5
|
-
const parentContextValue = React.useContext(TableStyleContext);
|
|
6
|
-
//Create context to use and pass to children based on own props or fall back to parent provided context
|
|
7
|
-
const contextValue = {
|
|
8
|
-
borderColor: borderColor || parentContextValue.borderColor,
|
|
9
|
-
borderStyle: borderStyle || parentContextValue.borderStyle,
|
|
10
|
-
borderWidth: borderWidth || parentContextValue.borderWidth,
|
|
11
|
-
cellHorizontalPadding: cellHorizontalPadding || parentContextValue.cellHorizontalPadding,
|
|
12
|
-
cellVerticalPadding: cellVerticalPadding || parentContextValue.cellVerticalPadding,
|
|
13
|
-
};
|
|
14
|
-
const borderViewStyle = generateBorderStyles({
|
|
15
|
-
borderColor: contextValue.borderColor,
|
|
16
|
-
borderWidth: contextValue.borderWidth,
|
|
17
|
-
borderStyle: contextValue.borderStyle,
|
|
18
|
-
drawTopBorder,
|
|
19
|
-
drawBottomBorder,
|
|
20
|
-
drawStartBorder,
|
|
21
|
-
drawEndBorder,
|
|
22
|
-
});
|
|
23
|
-
return (React.createElement(TableStyleContext.Provider, { value: contextValue },
|
|
24
|
-
React.createElement(View, { style: [borderViewStyle, style, styles.cellsContainer] }, children)));
|
|
25
|
-
};
|
|
26
|
-
const styles = StyleSheet.create({
|
|
27
|
-
cellsContainer: {
|
|
28
|
-
flex: 1,
|
|
29
|
-
flexDirection: "row",
|
|
30
|
-
},
|
|
31
|
-
});
|
|
32
|
-
export default TableRow;
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { View, StyleProp, ViewStyle, StyleSheet } from "react-native";
|
|
3
|
-
import {
|
|
4
|
-
generateBorderStyles,
|
|
5
|
-
TableProps,
|
|
6
|
-
TableStyleContext,
|
|
7
|
-
TableStyleProps,
|
|
8
|
-
} from "./TableCommon";
|
|
9
|
-
|
|
10
|
-
export interface Props extends TableProps {
|
|
11
|
-
style?: StyleProp<ViewStyle>;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
const TableRow: React.FC<React.PropsWithChildren<Props>> = ({
|
|
15
|
-
borderWidth,
|
|
16
|
-
borderColor,
|
|
17
|
-
borderStyle,
|
|
18
|
-
drawTopBorder = false,
|
|
19
|
-
drawBottomBorder = true,
|
|
20
|
-
drawStartBorder = true,
|
|
21
|
-
drawEndBorder = false,
|
|
22
|
-
cellVerticalPadding,
|
|
23
|
-
cellHorizontalPadding,
|
|
24
|
-
children,
|
|
25
|
-
style,
|
|
26
|
-
}) => {
|
|
27
|
-
const parentContextValue = React.useContext(TableStyleContext);
|
|
28
|
-
|
|
29
|
-
//Create context to use and pass to children based on own props or fall back to parent provided context
|
|
30
|
-
const contextValue: TableStyleProps = {
|
|
31
|
-
borderColor: borderColor || parentContextValue.borderColor,
|
|
32
|
-
borderStyle: borderStyle || parentContextValue.borderStyle,
|
|
33
|
-
borderWidth: borderWidth || parentContextValue.borderWidth,
|
|
34
|
-
cellHorizontalPadding:
|
|
35
|
-
cellHorizontalPadding || parentContextValue.cellHorizontalPadding,
|
|
36
|
-
cellVerticalPadding:
|
|
37
|
-
cellVerticalPadding || parentContextValue.cellVerticalPadding,
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
const borderViewStyle = generateBorderStyles({
|
|
41
|
-
borderColor: contextValue.borderColor,
|
|
42
|
-
borderWidth: contextValue.borderWidth,
|
|
43
|
-
borderStyle: contextValue.borderStyle,
|
|
44
|
-
drawTopBorder,
|
|
45
|
-
drawBottomBorder,
|
|
46
|
-
drawStartBorder,
|
|
47
|
-
drawEndBorder,
|
|
48
|
-
});
|
|
49
|
-
return (
|
|
50
|
-
<TableStyleContext.Provider value={contextValue}>
|
|
51
|
-
<View style={[borderViewStyle, style, styles.cellsContainer]}>
|
|
52
|
-
{children}
|
|
53
|
-
</View>
|
|
54
|
-
</TableStyleContext.Provider>
|
|
55
|
-
);
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
const styles = StyleSheet.create({
|
|
59
|
-
cellsContainer: {
|
|
60
|
-
flex: 1,
|
|
61
|
-
flexDirection: "row",
|
|
62
|
-
},
|
|
63
|
-
});
|
|
64
|
-
|
|
65
|
-
export default TableRow;
|
package/src/mappings/Table.js
DELETED
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
import { COMPONENT_TYPES, StylesPanelSections, createColorProp, createStaticBoolProp, createStaticNumberProp, BLOCK_STYLES_SECTIONS, CONTAINER_COMPONENT_STYLES_SECTIONS, createTextEnumProp, } from "@draftbit/types";
|
|
2
|
-
const SHARED_SEED_DATA_PROPS = {
|
|
3
|
-
borderWidth: createStaticNumberProp({
|
|
4
|
-
label: "Border Width",
|
|
5
|
-
description: "Specifies the width of the border. Passed down to child Table(Row/Cell) components unless overridden",
|
|
6
|
-
required: false,
|
|
7
|
-
defaultValue: null,
|
|
8
|
-
}),
|
|
9
|
-
borderColor: createColorProp({
|
|
10
|
-
label: "Border Color",
|
|
11
|
-
description: "Specifies the color of the border. Passed down to child Table(Row/Cell) components unless overridden",
|
|
12
|
-
defaultValue: null,
|
|
13
|
-
}),
|
|
14
|
-
borderStyle: createTextEnumProp({
|
|
15
|
-
label: "Border Style",
|
|
16
|
-
description: "Specifies the style of the border. Passed down to child Table(Row/Cell) components unless overridden",
|
|
17
|
-
options: ["solid", "dotted", "dashed"],
|
|
18
|
-
defaultValue: null,
|
|
19
|
-
}),
|
|
20
|
-
drawTopBorder: createStaticBoolProp({
|
|
21
|
-
label: "Draw Top Border",
|
|
22
|
-
description: "Whether to draw the top border at this layer of the Table tree or not",
|
|
23
|
-
defaultValue: false,
|
|
24
|
-
}),
|
|
25
|
-
drawBottomBorder: createStaticBoolProp({
|
|
26
|
-
label: "Draw Bottom Border",
|
|
27
|
-
description: "Whether to draw the bottom border at this layer of the Table tree or not",
|
|
28
|
-
defaultValue: false,
|
|
29
|
-
}),
|
|
30
|
-
drawStartBorder: createStaticBoolProp({
|
|
31
|
-
label: "Draw Start Border",
|
|
32
|
-
description: "Whether to draw the start border at this layer of the Table tree or not",
|
|
33
|
-
defaultValue: false,
|
|
34
|
-
}),
|
|
35
|
-
drawEndBorder: createStaticBoolProp({
|
|
36
|
-
label: "Draw End Border",
|
|
37
|
-
description: "Whether to draw the end border at this layer of the Table tree or not",
|
|
38
|
-
defaultValue: false,
|
|
39
|
-
}),
|
|
40
|
-
};
|
|
41
|
-
export const SEED_DATA = [
|
|
42
|
-
{
|
|
43
|
-
name: "Table",
|
|
44
|
-
tag: "Table",
|
|
45
|
-
description: "Top level table container",
|
|
46
|
-
category: COMPONENT_TYPES.table,
|
|
47
|
-
stylesPanelSections: BLOCK_STYLES_SECTIONS,
|
|
48
|
-
props: {
|
|
49
|
-
...SHARED_SEED_DATA_PROPS,
|
|
50
|
-
borderWidth: { ...SHARED_SEED_DATA_PROPS.borderWidth, defaultValue: 1 },
|
|
51
|
-
borderColor: {
|
|
52
|
-
...SHARED_SEED_DATA_PROPS.borderColor,
|
|
53
|
-
defaultValue: "divider",
|
|
54
|
-
},
|
|
55
|
-
borderStyle: {
|
|
56
|
-
...SHARED_SEED_DATA_PROPS.borderStyle,
|
|
57
|
-
defaultValue: "solid",
|
|
58
|
-
},
|
|
59
|
-
drawTopBorder: {
|
|
60
|
-
...SHARED_SEED_DATA_PROPS.drawTopBorder,
|
|
61
|
-
defaultValue: true,
|
|
62
|
-
},
|
|
63
|
-
cellVerticalPadding: createStaticNumberProp({
|
|
64
|
-
label: "Cell Vertical Padding",
|
|
65
|
-
description: "Specifies the vertical padding of the cell. Passed down to child Table Row components unless overridden",
|
|
66
|
-
required: false,
|
|
67
|
-
defaultValue: 10,
|
|
68
|
-
}),
|
|
69
|
-
cellHorizontalPadding: createStaticNumberProp({
|
|
70
|
-
label: "Cell Horizontal Padding",
|
|
71
|
-
description: "Specifies the horizontal padding of the cell. Passed down to child Table Row components unless overridden",
|
|
72
|
-
required: false,
|
|
73
|
-
defaultValue: 10,
|
|
74
|
-
}),
|
|
75
|
-
},
|
|
76
|
-
},
|
|
77
|
-
{
|
|
78
|
-
name: "Table Row",
|
|
79
|
-
tag: "TableRow",
|
|
80
|
-
description: "Table Row container",
|
|
81
|
-
category: COMPONENT_TYPES.table,
|
|
82
|
-
stylesPanelSections: [StylesPanelSections.Background],
|
|
83
|
-
props: {
|
|
84
|
-
...SHARED_SEED_DATA_PROPS,
|
|
85
|
-
drawStartBorder: {
|
|
86
|
-
...SHARED_SEED_DATA_PROPS.drawStartBorder,
|
|
87
|
-
defaultValue: true,
|
|
88
|
-
},
|
|
89
|
-
drawBottomBorder: {
|
|
90
|
-
...SHARED_SEED_DATA_PROPS.drawBottomBorder,
|
|
91
|
-
defaultValue: true,
|
|
92
|
-
},
|
|
93
|
-
cellVerticalPadding: createStaticNumberProp({
|
|
94
|
-
label: "Cell Vertical Padding",
|
|
95
|
-
description: "Specifies the vertical padding of the cell. Passed down to child Table Cell components unless overridden",
|
|
96
|
-
required: false,
|
|
97
|
-
defaultValue: null,
|
|
98
|
-
}),
|
|
99
|
-
cellHorizontalPadding: createStaticNumberProp({
|
|
100
|
-
label: "Cell Horizontal Padding",
|
|
101
|
-
description: "Specifies the horizontal padding of the cell. Passed down to child Table Cell components unless overridden",
|
|
102
|
-
required: false,
|
|
103
|
-
defaultValue: null,
|
|
104
|
-
}),
|
|
105
|
-
},
|
|
106
|
-
},
|
|
107
|
-
{
|
|
108
|
-
name: "Table Cell",
|
|
109
|
-
tag: "TableCell",
|
|
110
|
-
description: "Table Cell container",
|
|
111
|
-
category: COMPONENT_TYPES.table,
|
|
112
|
-
stylesPanelSections: CONTAINER_COMPONENT_STYLES_SECTIONS.filter((item) => item !== StylesPanelSections.Borders),
|
|
113
|
-
layout: {
|
|
114
|
-
flex: 1,
|
|
115
|
-
flexDirection: "row",
|
|
116
|
-
},
|
|
117
|
-
props: {
|
|
118
|
-
...SHARED_SEED_DATA_PROPS,
|
|
119
|
-
drawEndBorder: {
|
|
120
|
-
...SHARED_SEED_DATA_PROPS.drawEndBorder,
|
|
121
|
-
defaultValue: true,
|
|
122
|
-
},
|
|
123
|
-
cellVerticalPadding: createStaticNumberProp({
|
|
124
|
-
label: "Vertical Padding",
|
|
125
|
-
description: "Specifies the vertical padding of the cell",
|
|
126
|
-
required: false,
|
|
127
|
-
defaultValue: null,
|
|
128
|
-
}),
|
|
129
|
-
cellHorizontalPadding: createStaticNumberProp({
|
|
130
|
-
label: "Horizontal Padding",
|
|
131
|
-
description: "Specifies the horizontal padding of the cell",
|
|
132
|
-
required: false,
|
|
133
|
-
defaultValue: null,
|
|
134
|
-
}),
|
|
135
|
-
},
|
|
136
|
-
},
|
|
137
|
-
];
|
package/src/mappings/Table.ts
DELETED
|
@@ -1,161 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
COMPONENT_TYPES,
|
|
3
|
-
StylesPanelSections,
|
|
4
|
-
createColorProp,
|
|
5
|
-
createStaticBoolProp,
|
|
6
|
-
createStaticNumberProp,
|
|
7
|
-
BLOCK_STYLES_SECTIONS,
|
|
8
|
-
CONTAINER_COMPONENT_STYLES_SECTIONS,
|
|
9
|
-
createTextEnumProp,
|
|
10
|
-
} from "@draftbit/types";
|
|
11
|
-
|
|
12
|
-
const SHARED_SEED_DATA_PROPS = {
|
|
13
|
-
borderWidth: createStaticNumberProp({
|
|
14
|
-
label: "Border Width",
|
|
15
|
-
description:
|
|
16
|
-
"Specifies the width of the border. Passed down to child Table(Row/Cell) components unless overridden",
|
|
17
|
-
required: false,
|
|
18
|
-
defaultValue: null,
|
|
19
|
-
}),
|
|
20
|
-
borderColor: createColorProp({
|
|
21
|
-
label: "Border Color",
|
|
22
|
-
description:
|
|
23
|
-
"Specifies the color of the border. Passed down to child Table(Row/Cell) components unless overridden",
|
|
24
|
-
defaultValue: null,
|
|
25
|
-
}),
|
|
26
|
-
borderStyle: createTextEnumProp({
|
|
27
|
-
label: "Border Style",
|
|
28
|
-
description:
|
|
29
|
-
"Specifies the style of the border. Passed down to child Table(Row/Cell) components unless overridden",
|
|
30
|
-
options: ["solid", "dotted", "dashed"],
|
|
31
|
-
defaultValue: null,
|
|
32
|
-
}),
|
|
33
|
-
drawTopBorder: createStaticBoolProp({
|
|
34
|
-
label: "Draw Top Border",
|
|
35
|
-
description:
|
|
36
|
-
"Whether to draw the top border at this layer of the Table tree or not",
|
|
37
|
-
defaultValue: false,
|
|
38
|
-
}),
|
|
39
|
-
drawBottomBorder: createStaticBoolProp({
|
|
40
|
-
label: "Draw Bottom Border",
|
|
41
|
-
description:
|
|
42
|
-
"Whether to draw the bottom border at this layer of the Table tree or not",
|
|
43
|
-
defaultValue: false,
|
|
44
|
-
}),
|
|
45
|
-
drawStartBorder: createStaticBoolProp({
|
|
46
|
-
label: "Draw Start Border",
|
|
47
|
-
description:
|
|
48
|
-
"Whether to draw the start border at this layer of the Table tree or not",
|
|
49
|
-
defaultValue: false,
|
|
50
|
-
}),
|
|
51
|
-
drawEndBorder: createStaticBoolProp({
|
|
52
|
-
label: "Draw End Border",
|
|
53
|
-
description:
|
|
54
|
-
"Whether to draw the end border at this layer of the Table tree or not",
|
|
55
|
-
defaultValue: false,
|
|
56
|
-
}),
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
export const SEED_DATA = [
|
|
60
|
-
{
|
|
61
|
-
name: "Table",
|
|
62
|
-
tag: "Table",
|
|
63
|
-
description: "Top level table container",
|
|
64
|
-
category: COMPONENT_TYPES.table,
|
|
65
|
-
stylesPanelSections: BLOCK_STYLES_SECTIONS,
|
|
66
|
-
props: {
|
|
67
|
-
...SHARED_SEED_DATA_PROPS,
|
|
68
|
-
borderWidth: { ...SHARED_SEED_DATA_PROPS.borderWidth, defaultValue: 1 },
|
|
69
|
-
borderColor: {
|
|
70
|
-
...SHARED_SEED_DATA_PROPS.borderColor,
|
|
71
|
-
defaultValue: "divider",
|
|
72
|
-
},
|
|
73
|
-
borderStyle: {
|
|
74
|
-
...SHARED_SEED_DATA_PROPS.borderStyle,
|
|
75
|
-
defaultValue: "solid",
|
|
76
|
-
},
|
|
77
|
-
drawTopBorder: {
|
|
78
|
-
...SHARED_SEED_DATA_PROPS.drawTopBorder,
|
|
79
|
-
defaultValue: true,
|
|
80
|
-
},
|
|
81
|
-
cellVerticalPadding: createStaticNumberProp({
|
|
82
|
-
label: "Cell Vertical Padding",
|
|
83
|
-
description:
|
|
84
|
-
"Specifies the vertical padding of the cell. Passed down to child Table Row components unless overridden",
|
|
85
|
-
required: false,
|
|
86
|
-
defaultValue: 10,
|
|
87
|
-
}),
|
|
88
|
-
cellHorizontalPadding: createStaticNumberProp({
|
|
89
|
-
label: "Cell Horizontal Padding",
|
|
90
|
-
description:
|
|
91
|
-
"Specifies the horizontal padding of the cell. Passed down to child Table Row components unless overridden",
|
|
92
|
-
required: false,
|
|
93
|
-
defaultValue: 10,
|
|
94
|
-
}),
|
|
95
|
-
},
|
|
96
|
-
},
|
|
97
|
-
{
|
|
98
|
-
name: "Table Row",
|
|
99
|
-
tag: "TableRow",
|
|
100
|
-
description: "Table Row container",
|
|
101
|
-
category: COMPONENT_TYPES.table,
|
|
102
|
-
stylesPanelSections: [StylesPanelSections.Background],
|
|
103
|
-
props: {
|
|
104
|
-
...SHARED_SEED_DATA_PROPS,
|
|
105
|
-
drawStartBorder: {
|
|
106
|
-
...SHARED_SEED_DATA_PROPS.drawStartBorder,
|
|
107
|
-
defaultValue: true,
|
|
108
|
-
},
|
|
109
|
-
drawBottomBorder: {
|
|
110
|
-
...SHARED_SEED_DATA_PROPS.drawBottomBorder,
|
|
111
|
-
defaultValue: true,
|
|
112
|
-
},
|
|
113
|
-
cellVerticalPadding: createStaticNumberProp({
|
|
114
|
-
label: "Cell Vertical Padding",
|
|
115
|
-
description:
|
|
116
|
-
"Specifies the vertical padding of the cell. Passed down to child Table Cell components unless overridden",
|
|
117
|
-
required: false,
|
|
118
|
-
defaultValue: null,
|
|
119
|
-
}),
|
|
120
|
-
cellHorizontalPadding: createStaticNumberProp({
|
|
121
|
-
label: "Cell Horizontal Padding",
|
|
122
|
-
description:
|
|
123
|
-
"Specifies the horizontal padding of the cell. Passed down to child Table Cell components unless overridden",
|
|
124
|
-
required: false,
|
|
125
|
-
defaultValue: null,
|
|
126
|
-
}),
|
|
127
|
-
},
|
|
128
|
-
},
|
|
129
|
-
{
|
|
130
|
-
name: "Table Cell",
|
|
131
|
-
tag: "TableCell",
|
|
132
|
-
description: "Table Cell container",
|
|
133
|
-
category: COMPONENT_TYPES.table,
|
|
134
|
-
stylesPanelSections: CONTAINER_COMPONENT_STYLES_SECTIONS.filter(
|
|
135
|
-
(item) => item !== StylesPanelSections.Borders
|
|
136
|
-
),
|
|
137
|
-
layout: {
|
|
138
|
-
flex: 1,
|
|
139
|
-
flexDirection: "row",
|
|
140
|
-
},
|
|
141
|
-
props: {
|
|
142
|
-
...SHARED_SEED_DATA_PROPS,
|
|
143
|
-
drawEndBorder: {
|
|
144
|
-
...SHARED_SEED_DATA_PROPS.drawEndBorder,
|
|
145
|
-
defaultValue: true,
|
|
146
|
-
},
|
|
147
|
-
cellVerticalPadding: createStaticNumberProp({
|
|
148
|
-
label: "Vertical Padding",
|
|
149
|
-
description: "Specifies the vertical padding of the cell",
|
|
150
|
-
required: false,
|
|
151
|
-
defaultValue: null,
|
|
152
|
-
}),
|
|
153
|
-
cellHorizontalPadding: createStaticNumberProp({
|
|
154
|
-
label: "Horizontal Padding",
|
|
155
|
-
description: "Specifies the horizontal padding of the cell",
|
|
156
|
-
required: false,
|
|
157
|
-
defaultValue: null,
|
|
158
|
-
}),
|
|
159
|
-
},
|
|
160
|
-
},
|
|
161
|
-
];
|