@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.
Files changed (83) hide show
  1. package/lib/commonjs/components/Container.js +4 -15
  2. package/lib/commonjs/components/YotubePlayer.js +38 -0
  3. package/lib/commonjs/constants.js +1 -1
  4. package/lib/commonjs/index.js +7 -19
  5. package/lib/commonjs/mappings/ActionSheet.js +1 -1
  6. package/lib/commonjs/mappings/ActionSheetCancel.js +1 -1
  7. package/lib/commonjs/mappings/ActionSheetItem.js +1 -1
  8. package/lib/commonjs/mappings/MapCallout.js +1 -1
  9. package/lib/commonjs/mappings/MapMarker.js +1 -1
  10. package/lib/commonjs/mappings/YoutubePlayer.js +44 -0
  11. package/lib/module/components/Accordion/AccordionItem.js +25 -4
  12. package/lib/module/components/YotubePlayer.js +30 -0
  13. package/lib/module/index.js +1 -1
  14. package/lib/module/mappings/ActionSheet.js +1 -1
  15. package/lib/module/mappings/ActionSheetCancel.js +1 -1
  16. package/lib/module/mappings/ActionSheetItem.js +1 -1
  17. package/lib/module/mappings/MapCallout.js +2 -2
  18. package/lib/module/mappings/MapMarker.js +2 -2
  19. package/lib/module/mappings/YoutubePlayer.js +37 -0
  20. package/lib/typescript/src/components/YotubePlayer.d.ts +12 -0
  21. package/lib/typescript/src/components/YotubePlayer.d.ts.map +1 -0
  22. package/lib/typescript/src/index.d.ts +1 -1
  23. package/lib/typescript/src/index.d.ts.map +1 -1
  24. package/lib/typescript/src/mappings/ActionSheet.d.ts.map +1 -1
  25. package/lib/typescript/src/mappings/ActionSheetCancel.d.ts.map +1 -1
  26. package/lib/typescript/src/mappings/ActionSheetItem.d.ts.map +1 -1
  27. package/lib/typescript/src/mappings/MapCallout.d.ts.map +1 -1
  28. package/lib/typescript/src/mappings/MapMarker.d.ts.map +1 -1
  29. package/lib/typescript/src/mappings/YoutubePlayer.d.ts +37 -0
  30. package/lib/typescript/src/mappings/YoutubePlayer.d.ts.map +1 -0
  31. package/package.json +6 -4
  32. package/src/components/YotubePlayer.js +10 -0
  33. package/src/components/YotubePlayer.tsx +38 -0
  34. package/src/index.js +1 -1
  35. package/src/index.tsx +1 -1
  36. package/src/mappings/ActionSheet.js +4 -1
  37. package/src/mappings/ActionSheet.ts +4 -1
  38. package/src/mappings/ActionSheetCancel.js +4 -1
  39. package/src/mappings/ActionSheetCancel.ts +4 -1
  40. package/src/mappings/ActionSheetItem.js +4 -1
  41. package/src/mappings/ActionSheetItem.ts +4 -1
  42. package/src/mappings/MapCallout.js +6 -2
  43. package/src/mappings/MapCallout.ts +6 -2
  44. package/src/mappings/MapMarker.js +6 -2
  45. package/src/mappings/MapMarker.ts +6 -2
  46. package/src/mappings/YoutubePlayer.js +37 -0
  47. package/src/mappings/YoutubePlayer.ts +43 -0
  48. package/lib/commonjs/components/Table/Table.js +0 -50
  49. package/lib/commonjs/components/Table/TableCell.js +0 -49
  50. package/lib/commonjs/components/Table/TableCommon.js +0 -30
  51. package/lib/commonjs/components/Table/TableRow.js +0 -57
  52. package/lib/commonjs/components/Table/index.js +0 -27
  53. package/lib/commonjs/mappings/Table.js +0 -143
  54. package/lib/module/components/Table/Table.js +0 -42
  55. package/lib/module/components/Table/TableCell.js +0 -41
  56. package/lib/module/components/Table/TableCommon.js +0 -21
  57. package/lib/module/components/Table/TableRow.js +0 -49
  58. package/lib/module/components/Table/index.js +0 -3
  59. package/lib/module/mappings/Table.js +0 -136
  60. package/lib/typescript/src/components/Table/Table.d.ts +0 -13
  61. package/lib/typescript/src/components/Table/Table.d.ts.map +0 -1
  62. package/lib/typescript/src/components/Table/TableCell.d.ts +0 -9
  63. package/lib/typescript/src/components/Table/TableCell.d.ts.map +0 -1
  64. package/lib/typescript/src/components/Table/TableCommon.d.ts +0 -20
  65. package/lib/typescript/src/components/Table/TableCommon.d.ts.map +0 -1
  66. package/lib/typescript/src/components/Table/TableRow.d.ts +0 -9
  67. package/lib/typescript/src/components/Table/TableRow.d.ts.map +0 -1
  68. package/lib/typescript/src/components/Table/index.d.ts +0 -4
  69. package/lib/typescript/src/components/Table/index.d.ts.map +0 -1
  70. package/lib/typescript/src/mappings/Table.d.ts +0 -314
  71. package/lib/typescript/src/mappings/Table.d.ts.map +0 -1
  72. package/src/components/Table/Table.js +0 -25
  73. package/src/components/Table/Table.tsx +0 -56
  74. package/src/components/Table/TableCell.js +0 -31
  75. package/src/components/Table/TableCell.tsx +0 -63
  76. package/src/components/Table/TableCommon.js +0 -12
  77. package/src/components/Table/TableCommon.ts +0 -40
  78. package/src/components/Table/TableRow.js +0 -32
  79. package/src/components/Table/TableRow.tsx +0 -65
  80. package/src/components/Table/index.js +0 -3
  81. package/src/components/Table/index.tsx +0 -3
  82. package/src/mappings/Table.js +0 -137
  83. package/src/mappings/Table.ts +0 -161
@@ -10,7 +10,10 @@ export const SEED_DATA = {
10
10
  tag: "ActionSheet",
11
11
  description: "Action Sheet container",
12
12
  category: COMPONENT_TYPES.actionsheet,
13
- stylesPanelSections: [StylesPanelSections.Size, StylesPanelSections.Margins],
13
+ stylesPanelSections: [
14
+ StylesPanelSections.Margins,
15
+ StylesPanelSections.Effects,
16
+ ],
14
17
  props: {
15
18
  visible: createStaticBoolProp({
16
19
  group: GROUPS.data,
@@ -3,7 +3,10 @@ export const SEED_DATA = {
3
3
  name: "Action Sheet Cancel",
4
4
  tag: "ActionSheetCancel",
5
5
  description: "Action Sheet cancel",
6
- stylesPanelSections: [StylesPanelSections.Size, StylesPanelSections.Margins],
6
+ stylesPanelSections: [
7
+ StylesPanelSections.Margins,
8
+ StylesPanelSections.Effects,
9
+ ],
7
10
  category: COMPONENT_TYPES.actionsheet,
8
11
  triggers: [Triggers.OnPress],
9
12
  props: {
@@ -12,7 +12,10 @@ export const SEED_DATA = {
12
12
  name: "Action Sheet Cancel",
13
13
  tag: "ActionSheetCancel",
14
14
  description: "Action Sheet cancel",
15
- stylesPanelSections: [StylesPanelSections.Size, StylesPanelSections.Margins],
15
+ stylesPanelSections: [
16
+ StylesPanelSections.Margins,
17
+ StylesPanelSections.Effects,
18
+ ],
16
19
  category: COMPONENT_TYPES.actionsheet,
17
20
  triggers: [Triggers.OnPress],
18
21
  props: {
@@ -4,7 +4,10 @@ export const SEED_DATA = {
4
4
  tag: "ActionSheetItem",
5
5
  description: "Action Sheet item",
6
6
  category: COMPONENT_TYPES.actionsheet,
7
- stylesPanelSections: [StylesPanelSections.Size, StylesPanelSections.Margins],
7
+ stylesPanelSections: [
8
+ StylesPanelSections.Margins,
9
+ StylesPanelSections.Effects,
10
+ ],
8
11
  triggers: [Triggers.OnPress],
9
12
  layout: {
10
13
  textAlign: "center",
@@ -13,7 +13,10 @@ export const SEED_DATA = {
13
13
  tag: "ActionSheetItem",
14
14
  description: "Action Sheet item",
15
15
  category: COMPONENT_TYPES.actionsheet,
16
- stylesPanelSections: [StylesPanelSections.Size, StylesPanelSections.Margins],
16
+ stylesPanelSections: [
17
+ StylesPanelSections.Margins,
18
+ StylesPanelSections.Effects,
19
+ ],
17
20
  triggers: [Triggers.OnPress],
18
21
  layout: {
19
22
  textAlign: "center",
@@ -1,9 +1,13 @@
1
- import { COMPONENT_TYPES, createActionProp, createBoolProp, GROUPS, Triggers, CONTAINER_COMPONENT_STYLES_SECTIONS, } from "@draftbit/types";
1
+ import { COMPONENT_TYPES, createActionProp, createBoolProp, GROUPS, Triggers, StylesPanelSections, } from "@draftbit/types";
2
2
  export const SEED_DATA = {
3
3
  name: "Map Callout",
4
4
  tag: "MapCallout",
5
5
  packageName: "@draftbit/maps",
6
- stylesPanelSections: CONTAINER_COMPONENT_STYLES_SECTIONS,
6
+ stylesPanelSections: [
7
+ StylesPanelSections.Size,
8
+ StylesPanelSections.Margins,
9
+ StylesPanelSections.Effects,
10
+ ],
7
11
  description: "An info window to display on top of a marker when it is clicked",
8
12
  category: COMPONENT_TYPES.map,
9
13
  triggers: [Triggers.OnPress],
@@ -4,14 +4,18 @@ import {
4
4
  createBoolProp,
5
5
  GROUPS,
6
6
  Triggers,
7
- CONTAINER_COMPONENT_STYLES_SECTIONS,
7
+ StylesPanelSections,
8
8
  } from "@draftbit/types";
9
9
 
10
10
  export const SEED_DATA = {
11
11
  name: "Map Callout",
12
12
  tag: "MapCallout",
13
13
  packageName: "@draftbit/maps",
14
- stylesPanelSections: CONTAINER_COMPONENT_STYLES_SECTIONS,
14
+ stylesPanelSections: [
15
+ StylesPanelSections.Size,
16
+ StylesPanelSections.Margins,
17
+ StylesPanelSections.Effects,
18
+ ],
15
19
  description:
16
20
  "An info window to display on top of a marker when it is clicked",
17
21
  category: COMPONENT_TYPES.map,
@@ -1,11 +1,15 @@
1
- import { COMPONENT_TYPES, createBoolProp, createColorProp, createNumberProp, createTextProp, GROUPS, CONTAINER_COMPONENT_STYLES_SECTIONS, } from "@draftbit/types";
1
+ import { COMPONENT_TYPES, createBoolProp, createColorProp, createNumberProp, createTextProp, GROUPS, StylesPanelSections, } from "@draftbit/types";
2
2
  export const SEED_DATA = {
3
3
  name: "Map Marker",
4
4
  tag: "MapMarker",
5
5
  packageName: "@draftbit/maps",
6
6
  description: "A marker to show inside map view",
7
7
  category: COMPONENT_TYPES.map,
8
- stylesPanelSections: CONTAINER_COMPONENT_STYLES_SECTIONS,
8
+ stylesPanelSections: [
9
+ StylesPanelSections.Size,
10
+ StylesPanelSections.Margins,
11
+ StylesPanelSections.Effects,
12
+ ],
9
13
  layout: {},
10
14
  props: {
11
15
  latitude: createNumberProp({
@@ -5,7 +5,7 @@ import {
5
5
  createNumberProp,
6
6
  createTextProp,
7
7
  GROUPS,
8
- CONTAINER_COMPONENT_STYLES_SECTIONS,
8
+ StylesPanelSections,
9
9
  } from "@draftbit/types";
10
10
 
11
11
  export const SEED_DATA = {
@@ -14,7 +14,11 @@ export const SEED_DATA = {
14
14
  packageName: "@draftbit/maps",
15
15
  description: "A marker to show inside map view",
16
16
  category: COMPONENT_TYPES.map,
17
- stylesPanelSections: CONTAINER_COMPONENT_STYLES_SECTIONS,
17
+ stylesPanelSections: [
18
+ StylesPanelSections.Size,
19
+ StylesPanelSections.Margins,
20
+ StylesPanelSections.Effects,
21
+ ],
18
22
  layout: {},
19
23
  props: {
20
24
  latitude: createNumberProp({
@@ -0,0 +1,37 @@
1
+ import { BLOCK_STYLES_SECTIONS, COMPONENT_TYPES, createStaticBoolProp, createTextProp, } from "@draftbit/types";
2
+ export const SEED_DATA = {
3
+ name: "Youtube Player",
4
+ tag: "YoutubePlayer",
5
+ description: "Plays a youtube video form a Youtube video or playlist id",
6
+ doc_link: "https://lonelycpp.github.io/react-native-youtube-iframe",
7
+ code_link: "https://github.com/LonelyCpp/react-native-youtube-iframe",
8
+ category: COMPONENT_TYPES.media,
9
+ stylesPanelSections: BLOCK_STYLES_SECTIONS,
10
+ layout: {
11
+ height: 250,
12
+ },
13
+ props: {
14
+ videoId: createTextProp({
15
+ label: "Video ID",
16
+ description: "VideoId of the Youtube video.",
17
+ defaultValue: null,
18
+ }),
19
+ playlist: createTextProp({
20
+ label: "Playlist",
21
+ description: "Playlist of the Youtube videos.",
22
+ defaultValue: null,
23
+ }),
24
+ mute: createStaticBoolProp({
25
+ label: "Mute Audio",
26
+ description: "Mute the audio of the video.",
27
+ defaultValue: false,
28
+ required: false,
29
+ }),
30
+ autoplay: createStaticBoolProp({
31
+ label: "Auto Play",
32
+ description: "Autoplay the video on load.",
33
+ defaultValue: false,
34
+ required: false,
35
+ }),
36
+ },
37
+ };
@@ -0,0 +1,43 @@
1
+ import {
2
+ BLOCK_STYLES_SECTIONS,
3
+ COMPONENT_TYPES,
4
+ createStaticBoolProp,
5
+ createTextProp,
6
+ } from "@draftbit/types";
7
+
8
+ export const SEED_DATA = {
9
+ name: "Youtube Player",
10
+ tag: "YoutubePlayer",
11
+ description: "Plays a youtube video form a Youtube video or playlist id",
12
+ doc_link: "https://lonelycpp.github.io/react-native-youtube-iframe",
13
+ code_link: "https://github.com/LonelyCpp/react-native-youtube-iframe",
14
+ category: COMPONENT_TYPES.media,
15
+ stylesPanelSections: BLOCK_STYLES_SECTIONS,
16
+ layout: {
17
+ height: 250,
18
+ },
19
+ props: {
20
+ videoId: createTextProp({
21
+ label: "Video ID",
22
+ description: "VideoId of the Youtube video.",
23
+ defaultValue: null,
24
+ }),
25
+ playlist: createTextProp({
26
+ label: "Playlist",
27
+ description: "Playlist of the Youtube videos.",
28
+ defaultValue: null,
29
+ }),
30
+ mute: createStaticBoolProp({
31
+ label: "Mute Audio",
32
+ description: "Mute the audio of the video.",
33
+ defaultValue: false,
34
+ required: false,
35
+ }),
36
+ autoplay: createStaticBoolProp({
37
+ label: "Auto Play",
38
+ description: "Autoplay the video on load.",
39
+ defaultValue: false,
40
+ required: false,
41
+ }),
42
+ },
43
+ };
@@ -1,50 +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 _theming = require("../../theming");
10
- var _TableCommon = require("./TableCommon");
11
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
12
- const Table = _ref => {
13
- let {
14
- theme,
15
- borderWidth = 1,
16
- borderColor = theme.colors.divider,
17
- borderStyle = "solid",
18
- drawTopBorder = true,
19
- drawBottomBorder = false,
20
- drawStartBorder = false,
21
- drawEndBorder = false,
22
- cellVerticalPadding = 10,
23
- cellHorizontalPadding = 10,
24
- children,
25
- style
26
- } = _ref;
27
- const contextValue = {
28
- borderColor,
29
- borderStyle,
30
- borderWidth,
31
- cellHorizontalPadding,
32
- cellVerticalPadding
33
- };
34
- const borderViewStyle = (0, _TableCommon.generateBorderStyles)({
35
- borderColor,
36
- borderWidth,
37
- borderStyle,
38
- drawTopBorder,
39
- drawBottomBorder,
40
- drawStartBorder,
41
- drawEndBorder
42
- });
43
- return /*#__PURE__*/_react.default.createElement(_TableCommon.TableStyleContext.Provider, {
44
- value: contextValue
45
- }, /*#__PURE__*/_react.default.createElement(_reactNative.ScrollView, {
46
- style: [borderViewStyle, style]
47
- }, children));
48
- };
49
- var _default = (0, _theming.withTheme)(Table);
50
- exports.default = _default;
@@ -1,49 +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 _TableCommon = require("./TableCommon");
10
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
- const TableCell = _ref => {
12
- let {
13
- borderWidth,
14
- borderColor,
15
- borderStyle,
16
- drawTopBorder = false,
17
- drawBottomBorder = false,
18
- drawStartBorder = false,
19
- drawEndBorder = true,
20
- cellVerticalPadding,
21
- cellHorizontalPadding,
22
- children,
23
- style
24
- } = _ref;
25
- const parentContextValue = _react.default.useContext(_TableCommon.TableStyleContext);
26
- const borderViewStyle = (0, _TableCommon.generateBorderStyles)({
27
- borderColor: borderColor || parentContextValue.borderColor,
28
- borderWidth: borderWidth || parentContextValue.borderWidth,
29
- borderStyle: borderStyle || parentContextValue.borderStyle,
30
- drawTopBorder,
31
- drawBottomBorder,
32
- drawStartBorder,
33
- drawEndBorder
34
- });
35
- return /*#__PURE__*/_react.default.createElement(_reactNative.View, {
36
- style: [styles.cellContainer, borderViewStyle, {
37
- paddingVertical: cellVerticalPadding || parentContextValue.cellVerticalPadding,
38
- paddingHorizontal: cellHorizontalPadding || parentContextValue.cellHorizontalPadding
39
- }, style]
40
- }, children);
41
- };
42
- const styles = _reactNative.StyleSheet.create({
43
- cellContainer: {
44
- flex: 1,
45
- flexDirection: "row"
46
- }
47
- });
48
- var _default = TableCell;
49
- exports.default = _default;
@@ -1,30 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.TableStyleContext = void 0;
7
- exports.generateBorderStyles = generateBorderStyles;
8
- var _react = _interopRequireDefault(require("react"));
9
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
10
- const TableStyleContext = /*#__PURE__*/_react.default.createContext({});
11
- exports.TableStyleContext = TableStyleContext;
12
- function generateBorderStyles(_ref) {
13
- let {
14
- borderColor,
15
- borderWidth,
16
- borderStyle,
17
- drawTopBorder,
18
- drawBottomBorder,
19
- drawStartBorder,
20
- drawEndBorder
21
- } = _ref;
22
- return {
23
- borderColor,
24
- borderStyle,
25
- borderTopWidth: drawTopBorder ? borderWidth : 0,
26
- borderBottomWidth: drawBottomBorder ? borderWidth : 0,
27
- borderStartWidth: drawStartBorder ? borderWidth : 0,
28
- borderEndWidth: drawEndBorder ? borderWidth : 0
29
- };
30
- }
@@ -1,57 +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 _TableCommon = require("./TableCommon");
10
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
- const TableRow = _ref => {
12
- let {
13
- borderWidth,
14
- borderColor,
15
- borderStyle,
16
- drawTopBorder = false,
17
- drawBottomBorder = true,
18
- drawStartBorder = true,
19
- drawEndBorder = false,
20
- cellVerticalPadding,
21
- cellHorizontalPadding,
22
- children,
23
- style
24
- } = _ref;
25
- const parentContextValue = _react.default.useContext(_TableCommon.TableStyleContext);
26
-
27
- //Create context to use and pass to children based on own props or fall back to parent provided context
28
- const contextValue = {
29
- borderColor: borderColor || parentContextValue.borderColor,
30
- borderStyle: borderStyle || parentContextValue.borderStyle,
31
- borderWidth: borderWidth || parentContextValue.borderWidth,
32
- cellHorizontalPadding: cellHorizontalPadding || parentContextValue.cellHorizontalPadding,
33
- cellVerticalPadding: cellVerticalPadding || parentContextValue.cellVerticalPadding
34
- };
35
- const borderViewStyle = (0, _TableCommon.generateBorderStyles)({
36
- borderColor: contextValue.borderColor,
37
- borderWidth: contextValue.borderWidth,
38
- borderStyle: contextValue.borderStyle,
39
- drawTopBorder,
40
- drawBottomBorder,
41
- drawStartBorder,
42
- drawEndBorder
43
- });
44
- return /*#__PURE__*/_react.default.createElement(_TableCommon.TableStyleContext.Provider, {
45
- value: contextValue
46
- }, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
47
- style: [borderViewStyle, style, styles.cellsContainer]
48
- }, children));
49
- };
50
- const styles = _reactNative.StyleSheet.create({
51
- cellsContainer: {
52
- flex: 1,
53
- flexDirection: "row"
54
- }
55
- });
56
- var _default = TableRow;
57
- exports.default = _default;
@@ -1,27 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- Object.defineProperty(exports, "Table", {
7
- enumerable: true,
8
- get: function () {
9
- return _Table.default;
10
- }
11
- });
12
- Object.defineProperty(exports, "TableCell", {
13
- enumerable: true,
14
- get: function () {
15
- return _TableCell.default;
16
- }
17
- });
18
- Object.defineProperty(exports, "TableRow", {
19
- enumerable: true,
20
- get: function () {
21
- return _TableRow.default;
22
- }
23
- });
24
- var _Table = _interopRequireDefault(require("./Table"));
25
- var _TableRow = _interopRequireDefault(require("./TableRow"));
26
- var _TableCell = _interopRequireDefault(require("./TableCell"));
27
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@@ -1,143 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.SEED_DATA = void 0;
7
- var _types = require("@draftbit/types");
8
- const SHARED_SEED_DATA_PROPS = {
9
- borderWidth: (0, _types.createStaticNumberProp)({
10
- label: "Border Width",
11
- description: "Specifies the width of the border. Passed down to child Table(Row/Cell) components unless overridden",
12
- required: false,
13
- defaultValue: null
14
- }),
15
- borderColor: (0, _types.createColorProp)({
16
- label: "Border Color",
17
- description: "Specifies the color of the border. Passed down to child Table(Row/Cell) components unless overridden",
18
- defaultValue: null
19
- }),
20
- borderStyle: (0, _types.createTextEnumProp)({
21
- label: "Border Style",
22
- description: "Specifies the style of the border. Passed down to child Table(Row/Cell) components unless overridden",
23
- options: ["solid", "dotted", "dashed"],
24
- defaultValue: null
25
- }),
26
- drawTopBorder: (0, _types.createStaticBoolProp)({
27
- label: "Draw Top Border",
28
- description: "Whether to draw the top border at this layer of the Table tree or not",
29
- defaultValue: false
30
- }),
31
- drawBottomBorder: (0, _types.createStaticBoolProp)({
32
- label: "Draw Bottom Border",
33
- description: "Whether to draw the bottom border at this layer of the Table tree or not",
34
- defaultValue: false
35
- }),
36
- drawStartBorder: (0, _types.createStaticBoolProp)({
37
- label: "Draw Start Border",
38
- description: "Whether to draw the start border at this layer of the Table tree or not",
39
- defaultValue: false
40
- }),
41
- drawEndBorder: (0, _types.createStaticBoolProp)({
42
- label: "Draw End Border",
43
- description: "Whether to draw the end border at this layer of the Table tree or not",
44
- defaultValue: false
45
- })
46
- };
47
- const SEED_DATA = [{
48
- name: "Table",
49
- tag: "Table",
50
- description: "Top level table container",
51
- category: _types.COMPONENT_TYPES.table,
52
- stylesPanelSections: _types.BLOCK_STYLES_SECTIONS,
53
- props: {
54
- ...SHARED_SEED_DATA_PROPS,
55
- borderWidth: {
56
- ...SHARED_SEED_DATA_PROPS.borderWidth,
57
- defaultValue: 1
58
- },
59
- borderColor: {
60
- ...SHARED_SEED_DATA_PROPS.borderColor,
61
- defaultValue: "divider"
62
- },
63
- borderStyle: {
64
- ...SHARED_SEED_DATA_PROPS.borderStyle,
65
- defaultValue: "solid"
66
- },
67
- drawTopBorder: {
68
- ...SHARED_SEED_DATA_PROPS.drawTopBorder,
69
- defaultValue: true
70
- },
71
- cellVerticalPadding: (0, _types.createStaticNumberProp)({
72
- label: "Cell Vertical Padding",
73
- description: "Specifies the vertical padding of the cell. Passed down to child Table Row components unless overridden",
74
- required: false,
75
- defaultValue: 10
76
- }),
77
- cellHorizontalPadding: (0, _types.createStaticNumberProp)({
78
- label: "Cell Horizontal Padding",
79
- description: "Specifies the horizontal padding of the cell. Passed down to child Table Row components unless overridden",
80
- required: false,
81
- defaultValue: 10
82
- })
83
- }
84
- }, {
85
- name: "Table Row",
86
- tag: "TableRow",
87
- description: "Table Row container",
88
- category: _types.COMPONENT_TYPES.table,
89
- stylesPanelSections: [_types.StylesPanelSections.Background],
90
- props: {
91
- ...SHARED_SEED_DATA_PROPS,
92
- drawStartBorder: {
93
- ...SHARED_SEED_DATA_PROPS.drawStartBorder,
94
- defaultValue: true
95
- },
96
- drawBottomBorder: {
97
- ...SHARED_SEED_DATA_PROPS.drawBottomBorder,
98
- defaultValue: true
99
- },
100
- cellVerticalPadding: (0, _types.createStaticNumberProp)({
101
- label: "Cell Vertical Padding",
102
- description: "Specifies the vertical padding of the cell. Passed down to child Table Cell components unless overridden",
103
- required: false,
104
- defaultValue: null
105
- }),
106
- cellHorizontalPadding: (0, _types.createStaticNumberProp)({
107
- label: "Cell Horizontal Padding",
108
- description: "Specifies the horizontal padding of the cell. Passed down to child Table Cell components unless overridden",
109
- required: false,
110
- defaultValue: null
111
- })
112
- }
113
- }, {
114
- name: "Table Cell",
115
- tag: "TableCell",
116
- description: "Table Cell container",
117
- category: _types.COMPONENT_TYPES.table,
118
- stylesPanelSections: _types.CONTAINER_COMPONENT_STYLES_SECTIONS.filter(item => item !== _types.StylesPanelSections.Borders),
119
- layout: {
120
- flex: 1,
121
- flexDirection: "row"
122
- },
123
- props: {
124
- ...SHARED_SEED_DATA_PROPS,
125
- drawEndBorder: {
126
- ...SHARED_SEED_DATA_PROPS.drawEndBorder,
127
- defaultValue: true
128
- },
129
- cellVerticalPadding: (0, _types.createStaticNumberProp)({
130
- label: "Vertical Padding",
131
- description: "Specifies the vertical padding of the cell",
132
- required: false,
133
- defaultValue: null
134
- }),
135
- cellHorizontalPadding: (0, _types.createStaticNumberProp)({
136
- label: "Horizontal Padding",
137
- description: "Specifies the horizontal padding of the cell",
138
- required: false,
139
- defaultValue: null
140
- })
141
- }
142
- }];
143
- exports.SEED_DATA = SEED_DATA;
@@ -1,42 +0,0 @@
1
- import React from "react";
2
- import { ScrollView } from "react-native";
3
- import { withTheme } from "../../theming";
4
- import { generateBorderStyles, TableStyleContext } from "./TableCommon";
5
- const Table = _ref => {
6
- let {
7
- theme,
8
- borderWidth = 1,
9
- borderColor = theme.colors.divider,
10
- borderStyle = "solid",
11
- drawTopBorder = true,
12
- drawBottomBorder = false,
13
- drawStartBorder = false,
14
- drawEndBorder = false,
15
- cellVerticalPadding = 10,
16
- cellHorizontalPadding = 10,
17
- children,
18
- style
19
- } = _ref;
20
- const contextValue = {
21
- borderColor,
22
- borderStyle,
23
- borderWidth,
24
- cellHorizontalPadding,
25
- cellVerticalPadding
26
- };
27
- const borderViewStyle = generateBorderStyles({
28
- borderColor,
29
- borderWidth,
30
- borderStyle,
31
- drawTopBorder,
32
- drawBottomBorder,
33
- drawStartBorder,
34
- drawEndBorder
35
- });
36
- return /*#__PURE__*/React.createElement(TableStyleContext.Provider, {
37
- value: contextValue
38
- }, /*#__PURE__*/React.createElement(ScrollView, {
39
- style: [borderViewStyle, style]
40
- }, children));
41
- };
42
- export default withTheme(Table);
@@ -1,41 +0,0 @@
1
- import React from "react";
2
- import { View, StyleSheet } from "react-native";
3
- import { generateBorderStyles, TableStyleContext } from "./TableCommon";
4
- const TableCell = _ref => {
5
- let {
6
- borderWidth,
7
- borderColor,
8
- borderStyle,
9
- drawTopBorder = false,
10
- drawBottomBorder = false,
11
- drawStartBorder = false,
12
- drawEndBorder = true,
13
- cellVerticalPadding,
14
- cellHorizontalPadding,
15
- children,
16
- style
17
- } = _ref;
18
- const parentContextValue = React.useContext(TableStyleContext);
19
- const borderViewStyle = generateBorderStyles({
20
- borderColor: borderColor || parentContextValue.borderColor,
21
- borderWidth: borderWidth || parentContextValue.borderWidth,
22
- borderStyle: borderStyle || parentContextValue.borderStyle,
23
- drawTopBorder,
24
- drawBottomBorder,
25
- drawStartBorder,
26
- drawEndBorder
27
- });
28
- return /*#__PURE__*/React.createElement(View, {
29
- style: [styles.cellContainer, borderViewStyle, {
30
- paddingVertical: cellVerticalPadding || parentContextValue.cellVerticalPadding,
31
- paddingHorizontal: cellHorizontalPadding || parentContextValue.cellHorizontalPadding
32
- }, style]
33
- }, children);
34
- };
35
- const styles = StyleSheet.create({
36
- cellContainer: {
37
- flex: 1,
38
- flexDirection: "row"
39
- }
40
- });
41
- export default TableCell;