@draftbit/core 46.9.1-20b4a7.2 → 46.9.1-26da3e.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.
Files changed (69) hide show
  1. package/lib/commonjs/components/CircleImage.js +1 -15
  2. package/lib/commonjs/components/Container.js +15 -4
  3. package/lib/commonjs/components/Table/Table.js +50 -0
  4. package/lib/commonjs/components/Table/TableCell.js +49 -0
  5. package/lib/commonjs/components/Table/TableCommon.js +30 -0
  6. package/lib/commonjs/components/Table/TableRow.js +57 -0
  7. package/lib/commonjs/components/Table/index.js +27 -0
  8. package/lib/commonjs/index.js +19 -7
  9. package/lib/commonjs/mappings/Table.js +143 -0
  10. package/lib/module/components/Table/Table.js +42 -0
  11. package/lib/module/components/Table/TableCell.js +41 -0
  12. package/lib/module/components/Table/TableCommon.js +21 -0
  13. package/lib/module/components/Table/TableRow.js +49 -0
  14. package/lib/module/components/Table/index.js +3 -0
  15. package/lib/module/index.js +1 -1
  16. package/lib/module/mappings/Table.js +136 -0
  17. package/lib/typescript/src/components/Table/Table.d.ts +13 -0
  18. package/lib/typescript/src/components/Table/Table.d.ts.map +1 -0
  19. package/lib/typescript/src/components/Table/TableCell.d.ts +9 -0
  20. package/lib/typescript/src/components/Table/TableCell.d.ts.map +1 -0
  21. package/lib/typescript/src/components/Table/TableCommon.d.ts +20 -0
  22. package/lib/typescript/src/components/Table/TableCommon.d.ts.map +1 -0
  23. package/lib/typescript/src/components/Table/TableRow.d.ts +9 -0
  24. package/lib/typescript/src/components/Table/TableRow.d.ts.map +1 -0
  25. package/lib/typescript/src/components/Table/index.d.ts +4 -0
  26. package/lib/typescript/src/components/Table/index.d.ts.map +1 -0
  27. package/lib/typescript/src/index.d.ts +1 -1
  28. package/lib/typescript/src/index.d.ts.map +1 -1
  29. package/lib/typescript/src/mappings/Table.d.ts +314 -0
  30. package/lib/typescript/src/mappings/Table.d.ts.map +1 -0
  31. package/package.json +3 -5
  32. package/src/components/Table/Table.js +25 -0
  33. package/src/components/Table/Table.tsx +56 -0
  34. package/src/components/Table/TableCell.js +31 -0
  35. package/src/components/Table/TableCell.tsx +63 -0
  36. package/src/components/Table/TableCommon.js +12 -0
  37. package/src/components/Table/TableCommon.ts +40 -0
  38. package/src/components/Table/TableRow.js +32 -0
  39. package/src/components/Table/TableRow.tsx +65 -0
  40. package/src/components/Table/index.js +3 -0
  41. package/src/components/Table/index.tsx +3 -0
  42. package/src/index.js +1 -1
  43. package/src/index.tsx +1 -1
  44. package/src/mappings/Table.js +137 -0
  45. package/src/mappings/Table.ts +161 -0
  46. package/lib/commonjs/components/BottomSheet/BottomSheet.js +0 -88
  47. package/lib/commonjs/components/BottomSheet/BottomSheetComponent.js +0 -464
  48. package/lib/commonjs/components/BottomSheet/index.js +0 -13
  49. package/lib/commonjs/mappings/BottomSheet.js +0 -70
  50. package/lib/module/components/BottomSheet/BottomSheet.js +0 -80
  51. package/lib/module/components/BottomSheet/BottomSheetComponent.js +0 -470
  52. package/lib/module/components/BottomSheet/index.js +0 -1
  53. package/lib/module/mappings/BottomSheet.js +0 -63
  54. package/lib/typescript/src/components/BottomSheet/BottomSheet.d.ts +0 -20
  55. package/lib/typescript/src/components/BottomSheet/BottomSheet.d.ts.map +0 -1
  56. package/lib/typescript/src/components/BottomSheet/BottomSheetComponent.d.ts +0 -170
  57. package/lib/typescript/src/components/BottomSheet/BottomSheetComponent.d.ts.map +0 -1
  58. package/lib/typescript/src/components/BottomSheet/index.d.ts +0 -2
  59. package/lib/typescript/src/components/BottomSheet/index.d.ts.map +0 -1
  60. package/lib/typescript/src/mappings/BottomSheet.d.ts +0 -115
  61. package/lib/typescript/src/mappings/BottomSheet.d.ts.map +0 -1
  62. package/src/components/BottomSheet/BottomSheet.js +0 -56
  63. package/src/components/BottomSheet/BottomSheet.tsx +0 -120
  64. package/src/components/BottomSheet/BottomSheetComponent.js +0 -437
  65. package/src/components/BottomSheet/BottomSheetComponent.tsx +0 -895
  66. package/src/components/BottomSheet/index.js +0 -1
  67. package/src/components/BottomSheet/index.ts +0 -1
  68. package/src/mappings/BottomSheet.js +0 -63
  69. package/src/mappings/BottomSheet.ts +0 -77
@@ -0,0 +1,31 @@
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;
@@ -0,0 +1,63 @@
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;
@@ -0,0 +1,12 @@
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
+ }
@@ -0,0 +1,40 @@
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
+ }
@@ -0,0 +1,32 @@
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;
@@ -0,0 +1,65 @@
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;
@@ -0,0 +1,3 @@
1
+ export { default as Table } from "./Table";
2
+ export { default as TableRow } from "./TableRow";
3
+ export { default as TableCell } from "./TableCell";
@@ -0,0 +1,3 @@
1
+ export { default as Table } from "./Table";
2
+ export { default as TableRow } from "./TableRow";
3
+ export { default as TableCell } from "./TableCell";
package/src/index.js CHANGED
@@ -35,7 +35,7 @@ export { default as Shadow } from "./components/Shadow";
35
35
  export { DeckSwiper, DeckSwiperCard } from "./components/DeckSwiper";
36
36
  export { TabView, TabViewItem } from "./components/TabView";
37
37
  export { default as Markdown } from "./components/Markdown";
38
- export { BottomSheet } from "./components/BottomSheet";
38
+ export { Table, TableRow, TableCell } from "./components/Table";
39
39
  /* Deprecated: Fix or Delete! */
40
40
  export { default as DatePicker } from "./components/DatePicker/DatePicker";
41
41
  export { default as Picker } from "./components/Picker/Picker";
package/src/index.tsx CHANGED
@@ -58,7 +58,7 @@ export { DeckSwiper, DeckSwiperCard } from "./components/DeckSwiper";
58
58
  export { TabView, TabViewItem } from "./components/TabView";
59
59
  export { default as Markdown } from "./components/Markdown";
60
60
 
61
- export { BottomSheet } from "./components/BottomSheet";
61
+ export { Table, TableRow, TableCell } from "./components/Table";
62
62
 
63
63
  /* Deprecated: Fix or Delete! */
64
64
  export { default as DatePicker } from "./components/DatePicker/DatePicker";
@@ -0,0 +1,137 @@
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
+ ];
@@ -0,0 +1,161 @@
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
+ ];
@@ -1,88 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- var _react = _interopRequireDefault(require("react"));
8
- var _reactNative = require("react-native");
9
- var _BottomSheetComponent = _interopRequireDefault(require("./BottomSheetComponent"));
10
- var _theming = require("../../theming");
11
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
12
- function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
13
- const BottomSheet = _ref => {
14
- let {
15
- theme,
16
- snapPoints = ["10%", "50%", "80%"],
17
- initialSnapIndex = 0,
18
- showHandle = true,
19
- handleColor = theme.colors.divider,
20
- topBorderRadius = 20,
21
- borderWidth = 1,
22
- borderColor = theme.colors.divider,
23
- onSettle,
24
- style,
25
- children,
26
- ...rest
27
- } = _ref;
28
- const backgroundColor = (style === null || style === void 0 ? void 0 : style.backgroundColor) || theme.colors.background;
29
- return /*#__PURE__*/_react.default.createElement(_reactNative.View, {
30
- style: styles.parentContainer,
31
- pointerEvents: "box-none"
32
- }, /*#__PURE__*/_react.default.createElement(_BottomSheetComponent.default, _extends({
33
- componentType: "ScrollView",
34
- snapPoints: snapPoints,
35
- initialSnapIndex: initialSnapIndex,
36
- renderHandle: () => /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, showHandle && /*#__PURE__*/_react.default.createElement(_reactNative.View, {
37
- style: [styles.handleContainer, {
38
- backgroundColor,
39
- borderTopLeftRadius: topBorderRadius,
40
- borderTopRightRadius: topBorderRadius
41
- }]
42
- }, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
43
- style: [styles.handle, {
44
- backgroundColor: handleColor
45
- }]
46
- }))),
47
- contentContainerStyle: [styles.contentContainerStyle, style],
48
- containerStyle: _reactNative.StyleSheet.flatten([styles.containerStyle, {
49
- backgroundColor,
50
- borderTopLeftRadius: topBorderRadius,
51
- borderTopRightRadius: topBorderRadius,
52
- borderWidth,
53
- borderColor
54
- }]),
55
- onSettle: onSettle
56
- }, rest), children));
57
- };
58
- const styles = _reactNative.StyleSheet.create({
59
- //Render on top of everything
60
- parentContainer: {
61
- position: "absolute",
62
- left: 0,
63
- right: 0,
64
- top: 0,
65
- bottom: 0,
66
- zIndex: 10,
67
- overflow: "hidden"
68
- },
69
- contentContainerStyle: {
70
- paddingHorizontal: 16,
71
- paddingVertical: 10
72
- },
73
- containerStyle: {
74
- flex: 1,
75
- overflow: "hidden"
76
- },
77
- handleContainer: {
78
- alignItems: "center",
79
- paddingVertical: 20
80
- },
81
- handle: {
82
- width: 40,
83
- height: 2,
84
- borderRadius: 4
85
- }
86
- });
87
- var _default = (0, _theming.withTheme)(BottomSheet);
88
- exports.default = _default;