@draftbit/core 46.9.1-c1e2bf.2 → 46.9.1-c72bba.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 (95) 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 +123 -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 +61 -0
  7. package/lib/commonjs/components/Table/index.js +27 -0
  8. package/lib/commonjs/index.js +19 -7
  9. package/lib/commonjs/mappings/ActionSheet.js +1 -1
  10. package/lib/commonjs/mappings/ActionSheetCancel.js +1 -1
  11. package/lib/commonjs/mappings/ActionSheetItem.js +1 -1
  12. package/lib/commonjs/mappings/MapCallout.js +1 -1
  13. package/lib/commonjs/mappings/MapMarker.js +1 -1
  14. package/lib/commonjs/mappings/Table.js +140 -0
  15. package/lib/module/components/RadioButton/RadioButton.js +13 -1
  16. package/lib/module/components/Table/Table.js +114 -0
  17. package/lib/module/components/Table/TableCell.js +41 -0
  18. package/lib/module/components/Table/TableCommon.js +21 -0
  19. package/lib/module/components/Table/TableRow.js +53 -0
  20. package/lib/module/components/Table/index.js +3 -0
  21. package/lib/module/index.js +1 -1
  22. package/lib/module/mappings/ActionSheet.js +1 -1
  23. package/lib/module/mappings/ActionSheetCancel.js +1 -1
  24. package/lib/module/mappings/ActionSheetItem.js +1 -1
  25. package/lib/module/mappings/MapCallout.js +2 -2
  26. package/lib/module/mappings/MapMarker.js +2 -2
  27. package/lib/module/mappings/Table.js +133 -0
  28. package/lib/typescript/src/components/Table/Table.d.ts +19 -0
  29. package/lib/typescript/src/components/Table/Table.d.ts.map +1 -0
  30. package/lib/typescript/src/components/Table/TableCell.d.ts +9 -0
  31. package/lib/typescript/src/components/Table/TableCell.d.ts.map +1 -0
  32. package/lib/typescript/src/components/Table/TableCommon.d.ts +20 -0
  33. package/lib/typescript/src/components/Table/TableCommon.d.ts.map +1 -0
  34. package/lib/typescript/src/components/Table/TableRow.d.ts +14 -0
  35. package/lib/typescript/src/components/Table/TableRow.d.ts.map +1 -0
  36. package/lib/typescript/src/components/Table/index.d.ts +4 -0
  37. package/lib/typescript/src/components/Table/index.d.ts.map +1 -0
  38. package/lib/typescript/src/index.d.ts +1 -1
  39. package/lib/typescript/src/index.d.ts.map +1 -1
  40. package/lib/typescript/src/mappings/ActionSheet.d.ts.map +1 -1
  41. package/lib/typescript/src/mappings/ActionSheetCancel.d.ts.map +1 -1
  42. package/lib/typescript/src/mappings/ActionSheetItem.d.ts.map +1 -1
  43. package/lib/typescript/src/mappings/MapCallout.d.ts.map +1 -1
  44. package/lib/typescript/src/mappings/MapMarker.d.ts.map +1 -1
  45. package/lib/typescript/src/mappings/Table.d.ts +337 -0
  46. package/lib/typescript/src/mappings/Table.d.ts.map +1 -0
  47. package/package.json +3 -5
  48. package/src/components/Table/Table.js +93 -0
  49. package/src/components/Table/Table.tsx +176 -0
  50. package/src/components/Table/TableCell.js +31 -0
  51. package/src/components/Table/TableCell.tsx +63 -0
  52. package/src/components/Table/TableCommon.js +12 -0
  53. package/src/components/Table/TableCommon.ts +40 -0
  54. package/src/components/Table/TableRow.js +37 -0
  55. package/src/components/Table/TableRow.tsx +77 -0
  56. package/src/components/Table/index.js +3 -0
  57. package/src/components/Table/index.tsx +3 -0
  58. package/src/index.js +1 -1
  59. package/src/index.tsx +1 -1
  60. package/src/mappings/ActionSheet.js +4 -1
  61. package/src/mappings/ActionSheet.ts +4 -1
  62. package/src/mappings/ActionSheetCancel.js +4 -1
  63. package/src/mappings/ActionSheetCancel.ts +4 -1
  64. package/src/mappings/ActionSheetItem.js +4 -1
  65. package/src/mappings/ActionSheetItem.ts +4 -1
  66. package/src/mappings/MapCallout.js +6 -2
  67. package/src/mappings/MapCallout.ts +6 -2
  68. package/src/mappings/MapMarker.js +6 -2
  69. package/src/mappings/MapMarker.ts +6 -2
  70. package/src/mappings/Table.js +150 -0
  71. package/src/mappings/Table.ts +170 -0
  72. package/lib/commonjs/components/BottomSheet/BottomSheet.js +0 -88
  73. package/lib/commonjs/components/BottomSheet/BottomSheetComponent.js +0 -464
  74. package/lib/commonjs/components/BottomSheet/index.js +0 -13
  75. package/lib/commonjs/mappings/BottomSheet.js +0 -74
  76. package/lib/module/components/BottomSheet/BottomSheet.js +0 -80
  77. package/lib/module/components/BottomSheet/BottomSheetComponent.js +0 -470
  78. package/lib/module/components/BottomSheet/index.js +0 -1
  79. package/lib/module/mappings/BottomSheet.js +0 -67
  80. package/lib/typescript/src/components/BottomSheet/BottomSheet.d.ts +0 -20
  81. package/lib/typescript/src/components/BottomSheet/BottomSheet.d.ts.map +0 -1
  82. package/lib/typescript/src/components/BottomSheet/BottomSheetComponent.d.ts +0 -170
  83. package/lib/typescript/src/components/BottomSheet/BottomSheetComponent.d.ts.map +0 -1
  84. package/lib/typescript/src/components/BottomSheet/index.d.ts +0 -2
  85. package/lib/typescript/src/components/BottomSheet/index.d.ts.map +0 -1
  86. package/lib/typescript/src/mappings/BottomSheet.d.ts +0 -119
  87. package/lib/typescript/src/mappings/BottomSheet.d.ts.map +0 -1
  88. package/src/components/BottomSheet/BottomSheet.js +0 -56
  89. package/src/components/BottomSheet/BottomSheet.tsx +0 -120
  90. package/src/components/BottomSheet/BottomSheetComponent.js +0 -437
  91. package/src/components/BottomSheet/BottomSheetComponent.tsx +0 -895
  92. package/src/components/BottomSheet/index.js +0 -1
  93. package/src/components/BottomSheet/index.ts +0 -1
  94. package/src/mappings/BottomSheet.js +0 -64
  95. package/src/mappings/BottomSheet.ts +0 -78
@@ -0,0 +1,170 @@
1
+ import {
2
+ COMPONENT_TYPES,
3
+ StylesPanelSections,
4
+ createColorProp,
5
+ createStaticBoolProp,
6
+ createStaticNumberProp,
7
+ createTextEnumProp,
8
+ } from "@draftbit/types";
9
+
10
+ const SHARED_SEED_DATA_PROPS = {
11
+ borderWidth: createStaticNumberProp({
12
+ label: "Border Width",
13
+ description:
14
+ "Specifies the width of the border. Passed down to child Table(Row/Cell) components unless overridden",
15
+ required: false,
16
+ defaultValue: null,
17
+ }),
18
+ borderColor: createColorProp({
19
+ label: "Border Color",
20
+ description:
21
+ "Specifies the color of the border. Passed down to child Table(Row/Cell) components unless overridden",
22
+ defaultValue: null,
23
+ }),
24
+ borderStyle: createTextEnumProp({
25
+ label: "Border Style",
26
+ description:
27
+ "Specifies the style of the border. Passed down to child Table(Row/Cell) components unless overridden",
28
+ options: ["solid", "dotted", "dashed"],
29
+ defaultValue: null,
30
+ }),
31
+ drawTopBorder: createStaticBoolProp({
32
+ label: "Draw Top Border",
33
+ description:
34
+ "Whether to draw the top border at this layer of the Table tree or not",
35
+ defaultValue: false,
36
+ }),
37
+ drawBottomBorder: createStaticBoolProp({
38
+ label: "Draw Bottom Border",
39
+ description:
40
+ "Whether to draw the bottom border at this layer of the Table tree or not",
41
+ defaultValue: false,
42
+ }),
43
+ drawStartBorder: createStaticBoolProp({
44
+ label: "Draw Start Border",
45
+ description:
46
+ "Whether to draw the start border at this layer of the Table tree or not",
47
+ defaultValue: false,
48
+ }),
49
+ drawEndBorder: createStaticBoolProp({
50
+ label: "Draw End Border",
51
+ description:
52
+ "Whether to draw the end border at this layer of the Table tree or not",
53
+ defaultValue: false,
54
+ }),
55
+ cellVerticalPadding: createStaticNumberProp({
56
+ label: "Cell Vertical Padding",
57
+ description:
58
+ "Specifies the vertical padding of the cell. Passed down to TableCell components unless overridden",
59
+ required: false,
60
+ defaultValue: null,
61
+ }),
62
+ cellHorizontalPadding: createStaticNumberProp({
63
+ label: "Cell Horizontal Padding",
64
+ description:
65
+ "Specifies the horizontal padding of the cell. Passed down to TableCell components unless overridden",
66
+ required: false,
67
+ defaultValue: null,
68
+ }),
69
+ };
70
+
71
+ export const SEED_DATA = [
72
+ {
73
+ name: "Table",
74
+ tag: "Table",
75
+ description: "Top level table container",
76
+ category: COMPONENT_TYPES.table,
77
+ stylesPanelSections: [
78
+ StylesPanelSections.Size,
79
+ StylesPanelSections.Margins,
80
+ StylesPanelSections.Position,
81
+ StylesPanelSections.Effects,
82
+ StylesPanelSections.Background,
83
+ StylesPanelSections.LayoutSelectedItem,
84
+ ],
85
+ layout: {
86
+ flex: 1,
87
+ },
88
+ props: {
89
+ ...SHARED_SEED_DATA_PROPS,
90
+ borderWidth: { ...SHARED_SEED_DATA_PROPS.borderWidth, defaultValue: 1 },
91
+ borderColor: {
92
+ ...SHARED_SEED_DATA_PROPS.borderColor,
93
+ defaultValue: "divider",
94
+ },
95
+ borderStyle: {
96
+ ...SHARED_SEED_DATA_PROPS.borderStyle,
97
+ defaultValue: "solid",
98
+ },
99
+ drawTopBorder: {
100
+ ...SHARED_SEED_DATA_PROPS.drawTopBorder,
101
+ defaultValue: true,
102
+ },
103
+ cellVerticalPadding: {
104
+ ...SHARED_SEED_DATA_PROPS.cellVerticalPadding,
105
+ defaultValue: 10,
106
+ },
107
+ cellHorizontalPadding: {
108
+ ...SHARED_SEED_DATA_PROPS.cellHorizontalPadding,
109
+ defaultValue: 10,
110
+ },
111
+ showsVerticalScrollIndicator: createStaticBoolProp({
112
+ label: "Show Vertical Scroll Indicator",
113
+ description:
114
+ "When true, shows a vertical scroll indicator. The default value is true.",
115
+ defaultValue: true,
116
+ }),
117
+ },
118
+ },
119
+ {
120
+ name: "Table Row",
121
+ tag: "TableRow",
122
+ description: "Table Row container",
123
+ category: COMPONENT_TYPES.table,
124
+ stylesPanelSections: [StylesPanelSections.Background],
125
+ props: {
126
+ ...SHARED_SEED_DATA_PROPS,
127
+ drawStartBorder: {
128
+ ...SHARED_SEED_DATA_PROPS.drawStartBorder,
129
+ defaultValue: true,
130
+ },
131
+ drawBottomBorder: {
132
+ ...SHARED_SEED_DATA_PROPS.drawBottomBorder,
133
+ defaultValue: true,
134
+ },
135
+ isTableHeader: createStaticBoolProp({
136
+ label: "Header",
137
+ description:
138
+ "Whether this row is a header or not (changes background and sticks while scrolling)",
139
+ defaultValue: false,
140
+ }),
141
+ },
142
+ },
143
+ {
144
+ name: "Table Cell",
145
+ tag: "TableCell",
146
+ description: "Table Cell container",
147
+ category: COMPONENT_TYPES.table,
148
+ stylesPanelSections: [
149
+ StylesPanelSections.LayoutFlexItems,
150
+ StylesPanelSections.LayoutSelectedItem,
151
+ StylesPanelSections.LayoutContent,
152
+ StylesPanelSections.Background,
153
+ StylesPanelSections.Size,
154
+ StylesPanelSections.MarginsAndPaddings,
155
+ StylesPanelSections.Position,
156
+ StylesPanelSections.Effects,
157
+ ],
158
+ layout: {
159
+ flex: 1,
160
+ flexDirection: "row",
161
+ },
162
+ props: {
163
+ ...SHARED_SEED_DATA_PROPS,
164
+ drawEndBorder: {
165
+ ...SHARED_SEED_DATA_PROPS.drawEndBorder,
166
+ defaultValue: true,
167
+ },
168
+ },
169
+ },
170
+ ];
@@ -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;