@draftbit/core 46.10.3-877a3f.2 → 46.10.3-a0279d.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/Checkbox/CheckboxGroupRow.js +23 -5
- package/lib/commonjs/components/Table/Table.js +123 -0
- package/lib/commonjs/components/Table/TableCell.js +49 -0
- package/lib/commonjs/components/Table/TableCommon.js +30 -0
- package/lib/commonjs/components/Table/TableRow.js +61 -0
- package/lib/commonjs/components/Table/index.js +27 -0
- package/lib/commonjs/constants.js +1 -1
- package/lib/commonjs/index.js +19 -7
- package/lib/commonjs/mappings/NativeBase/Layout.js +9 -14
- package/lib/commonjs/mappings/Table.js +140 -0
- package/lib/module/components/DeprecatedFAB.js +3 -23
- package/lib/module/components/Elevation.js +2 -14
- package/lib/module/components/Table/Table.js +114 -0
- package/lib/module/components/Table/TableCell.js +41 -0
- package/lib/module/components/Table/TableCommon.js +21 -0
- package/lib/module/components/Table/TableRow.js +53 -0
- package/lib/module/components/Table/index.js +3 -0
- package/lib/module/index.js +1 -1
- package/lib/module/mappings/NativeBase/Layout.js +10 -15
- package/lib/module/mappings/Table.js +133 -0
- package/lib/typescript/src/components/Table/Table.d.ts +19 -0
- package/lib/typescript/src/components/Table/Table.d.ts.map +1 -0
- package/lib/typescript/src/components/Table/TableCell.d.ts +9 -0
- package/lib/typescript/src/components/Table/TableCell.d.ts.map +1 -0
- package/lib/typescript/src/components/Table/TableCommon.d.ts +20 -0
- package/lib/typescript/src/components/Table/TableCommon.d.ts.map +1 -0
- package/lib/typescript/src/components/Table/TableRow.d.ts +14 -0
- package/lib/typescript/src/components/Table/TableRow.d.ts.map +1 -0
- package/lib/typescript/src/components/Table/index.d.ts +4 -0
- package/lib/typescript/src/components/Table/index.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/NativeBase/Layout.d.ts +16 -27
- package/lib/typescript/src/mappings/NativeBase/Layout.d.ts.map +1 -1
- package/lib/typescript/src/mappings/Table.d.ts +337 -0
- package/lib/typescript/src/mappings/Table.d.ts.map +1 -0
- package/package.json +3 -3
- package/src/components/Table/Table.js +93 -0
- package/src/components/Table/Table.tsx +176 -0
- package/src/components/Table/TableCell.js +31 -0
- package/src/components/Table/TableCell.tsx +63 -0
- package/src/components/Table/TableCommon.js +12 -0
- package/src/components/Table/TableCommon.ts +40 -0
- package/src/components/Table/TableRow.js +37 -0
- package/src/components/Table/TableRow.tsx +77 -0
- package/src/components/Table/index.js +3 -0
- package/src/components/Table/index.tsx +3 -0
- package/src/index.js +1 -1
- package/src/index.tsx +2 -1
- package/src/mappings/NativeBase/Layout.js +19 -13
- package/src/mappings/NativeBase/Layout.ts +19 -13
- package/src/mappings/Table.js +150 -0
- package/src/mappings/Table.ts +170 -0
- package/lib/commonjs/components/Container.js +0 -93
- package/lib/commonjs/mappings/Container.js +0 -37
- package/lib/module/components/Container.js +0 -83
- package/lib/module/mappings/Container.js +0 -30
- package/lib/typescript/src/components/Container.d.ts +0 -21
- package/lib/typescript/src/components/Container.d.ts.map +0 -1
- package/lib/typescript/src/mappings/Container.d.ts +0 -55
- package/lib/typescript/src/mappings/Container.d.ts.map +0 -1
- package/src/components/Container.js +0 -43
- package/src/components/Container.tsx +0 -116
- package/src/mappings/Container.js +0 -30
- package/src/mappings/Container.ts +0 -41
|
@@ -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,93 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var React = _interopRequireWildcard(require("react"));
|
|
8
|
-
var _reactNative = require("react-native");
|
|
9
|
-
var _theming = require("../theming");
|
|
10
|
-
var _Elevation = _interopRequireDefault(require("./Elevation"));
|
|
11
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
13
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
14
|
-
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); }
|
|
15
|
-
const Container = _ref => {
|
|
16
|
-
let {
|
|
17
|
-
useThemeGutterPadding,
|
|
18
|
-
borderColor,
|
|
19
|
-
borderWidth,
|
|
20
|
-
backgroundColor,
|
|
21
|
-
backgroundImage,
|
|
22
|
-
backgroundImageResizeMode,
|
|
23
|
-
elevation,
|
|
24
|
-
style,
|
|
25
|
-
children,
|
|
26
|
-
theme,
|
|
27
|
-
// eslint-disable-line @typescript-eslint/no-unused-vars
|
|
28
|
-
...rest
|
|
29
|
-
} = _ref;
|
|
30
|
-
const {
|
|
31
|
-
flex,
|
|
32
|
-
flexGrow,
|
|
33
|
-
flexWrap,
|
|
34
|
-
flexBasis,
|
|
35
|
-
flexShrink,
|
|
36
|
-
flexDirection,
|
|
37
|
-
alignContent,
|
|
38
|
-
justifyContent,
|
|
39
|
-
alignItems,
|
|
40
|
-
padding,
|
|
41
|
-
paddingTop,
|
|
42
|
-
paddingBottom,
|
|
43
|
-
paddingLeft,
|
|
44
|
-
paddingRight,
|
|
45
|
-
paddingVertical,
|
|
46
|
-
paddingHorizontal,
|
|
47
|
-
...styleProp
|
|
48
|
-
} = _reactNative.StyleSheet.flatten(style) || {};
|
|
49
|
-
const containerStyle = {
|
|
50
|
-
backgroundColor,
|
|
51
|
-
borderColor,
|
|
52
|
-
borderWidth,
|
|
53
|
-
width: "100%",
|
|
54
|
-
...styleProp
|
|
55
|
-
};
|
|
56
|
-
const innerStyle = {
|
|
57
|
-
flex,
|
|
58
|
-
flexGrow,
|
|
59
|
-
flexWrap,
|
|
60
|
-
flexBasis,
|
|
61
|
-
flexShrink,
|
|
62
|
-
flexDirection,
|
|
63
|
-
alignContent,
|
|
64
|
-
justifyContent,
|
|
65
|
-
alignItems,
|
|
66
|
-
padding,
|
|
67
|
-
paddingTop,
|
|
68
|
-
paddingBottom,
|
|
69
|
-
paddingLeft,
|
|
70
|
-
paddingRight,
|
|
71
|
-
paddingVertical,
|
|
72
|
-
paddingHorizontal: paddingHorizontal || useThemeGutterPadding ? 16 : 0
|
|
73
|
-
};
|
|
74
|
-
const Wrap = elevation ? _Elevation.default : _reactNative.View;
|
|
75
|
-
if (elevation) containerStyle.elevation = elevation;
|
|
76
|
-
return /*#__PURE__*/React.createElement(Wrap, _extends({
|
|
77
|
-
style: [containerStyle, style]
|
|
78
|
-
}, rest), backgroundImage ? /*#__PURE__*/React.createElement(_reactNative.ImageBackground, {
|
|
79
|
-
source: typeof backgroundImage === "string" ? {
|
|
80
|
-
uri: backgroundImage
|
|
81
|
-
} : backgroundImage,
|
|
82
|
-
resizeMode: backgroundImageResizeMode,
|
|
83
|
-
style: {
|
|
84
|
-
flex: 1
|
|
85
|
-
}
|
|
86
|
-
}, /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
87
|
-
style: innerStyle
|
|
88
|
-
}, children)) : /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
89
|
-
style: innerStyle
|
|
90
|
-
}, children));
|
|
91
|
-
};
|
|
92
|
-
var _default = (0, _theming.withTheme)(Container);
|
|
93
|
-
exports.default = _default;
|
|
@@ -1,37 +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 SEED_DATA = {
|
|
9
|
-
name: "Container",
|
|
10
|
-
tag: "Container",
|
|
11
|
-
description: "A container component with gutter padding",
|
|
12
|
-
category: _types.COMPONENT_TYPES.deprecated,
|
|
13
|
-
stylesPanelSections: _types.CONTAINER_COMPONENT_STYLES_SECTIONS,
|
|
14
|
-
layout: {
|
|
15
|
-
height: 250
|
|
16
|
-
},
|
|
17
|
-
props: {
|
|
18
|
-
useThemeGutterPadding: {
|
|
19
|
-
group: _types.GROUPS.basic,
|
|
20
|
-
label: "Use gutter padding",
|
|
21
|
-
description: "When true, uses the theme gutter spacing as the container's horizontal padding",
|
|
22
|
-
formType: _types.FORM_TYPES.boolean,
|
|
23
|
-
propType: _types.PROP_TYPES.BOOLEAN,
|
|
24
|
-
defaultValue: false,
|
|
25
|
-
editable: false,
|
|
26
|
-
required: true
|
|
27
|
-
},
|
|
28
|
-
backgroundImage: (0, _types.createImageProp)({
|
|
29
|
-
label: "Background Image",
|
|
30
|
-
description: "Apply a custom background image",
|
|
31
|
-
defaultValue: null
|
|
32
|
-
}),
|
|
33
|
-
backgroundImageResizeMode: (0, _types.createResizeModeProp)(),
|
|
34
|
-
elevation: (0, _types.createElevationType)(0)
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
exports.SEED_DATA = SEED_DATA;
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
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); }
|
|
2
|
-
import * as React from "react";
|
|
3
|
-
import { View, ImageBackground, StyleSheet } from "react-native";
|
|
4
|
-
import { withTheme } from "../theming";
|
|
5
|
-
import Elevation from "./Elevation";
|
|
6
|
-
const Container = _ref => {
|
|
7
|
-
let {
|
|
8
|
-
useThemeGutterPadding,
|
|
9
|
-
borderColor,
|
|
10
|
-
borderWidth,
|
|
11
|
-
backgroundColor,
|
|
12
|
-
backgroundImage,
|
|
13
|
-
backgroundImageResizeMode,
|
|
14
|
-
elevation,
|
|
15
|
-
style,
|
|
16
|
-
children,
|
|
17
|
-
theme,
|
|
18
|
-
// eslint-disable-line @typescript-eslint/no-unused-vars
|
|
19
|
-
...rest
|
|
20
|
-
} = _ref;
|
|
21
|
-
const {
|
|
22
|
-
flex,
|
|
23
|
-
flexGrow,
|
|
24
|
-
flexWrap,
|
|
25
|
-
flexBasis,
|
|
26
|
-
flexShrink,
|
|
27
|
-
flexDirection,
|
|
28
|
-
alignContent,
|
|
29
|
-
justifyContent,
|
|
30
|
-
alignItems,
|
|
31
|
-
padding,
|
|
32
|
-
paddingTop,
|
|
33
|
-
paddingBottom,
|
|
34
|
-
paddingLeft,
|
|
35
|
-
paddingRight,
|
|
36
|
-
paddingVertical,
|
|
37
|
-
paddingHorizontal,
|
|
38
|
-
...styleProp
|
|
39
|
-
} = StyleSheet.flatten(style) || {};
|
|
40
|
-
const containerStyle = {
|
|
41
|
-
backgroundColor,
|
|
42
|
-
borderColor,
|
|
43
|
-
borderWidth,
|
|
44
|
-
width: "100%",
|
|
45
|
-
...styleProp
|
|
46
|
-
};
|
|
47
|
-
const innerStyle = {
|
|
48
|
-
flex,
|
|
49
|
-
flexGrow,
|
|
50
|
-
flexWrap,
|
|
51
|
-
flexBasis,
|
|
52
|
-
flexShrink,
|
|
53
|
-
flexDirection,
|
|
54
|
-
alignContent,
|
|
55
|
-
justifyContent,
|
|
56
|
-
alignItems,
|
|
57
|
-
padding,
|
|
58
|
-
paddingTop,
|
|
59
|
-
paddingBottom,
|
|
60
|
-
paddingLeft,
|
|
61
|
-
paddingRight,
|
|
62
|
-
paddingVertical,
|
|
63
|
-
paddingHorizontal: paddingHorizontal || useThemeGutterPadding ? 16 : 0
|
|
64
|
-
};
|
|
65
|
-
const Wrap = elevation ? Elevation : View;
|
|
66
|
-
if (elevation) containerStyle.elevation = elevation;
|
|
67
|
-
return /*#__PURE__*/React.createElement(Wrap, _extends({
|
|
68
|
-
style: [containerStyle, style]
|
|
69
|
-
}, rest), backgroundImage ? /*#__PURE__*/React.createElement(ImageBackground, {
|
|
70
|
-
source: typeof backgroundImage === "string" ? {
|
|
71
|
-
uri: backgroundImage
|
|
72
|
-
} : backgroundImage,
|
|
73
|
-
resizeMode: backgroundImageResizeMode,
|
|
74
|
-
style: {
|
|
75
|
-
flex: 1
|
|
76
|
-
}
|
|
77
|
-
}, /*#__PURE__*/React.createElement(View, {
|
|
78
|
-
style: innerStyle
|
|
79
|
-
}, children)) : /*#__PURE__*/React.createElement(View, {
|
|
80
|
-
style: innerStyle
|
|
81
|
-
}, children));
|
|
82
|
-
};
|
|
83
|
-
export default withTheme(Container);
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { GROUPS, COMPONENT_TYPES, FORM_TYPES, PROP_TYPES, createElevationType, createImageProp, createResizeModeProp, CONTAINER_COMPONENT_STYLES_SECTIONS } from "@draftbit/types";
|
|
2
|
-
export const SEED_DATA = {
|
|
3
|
-
name: "Container",
|
|
4
|
-
tag: "Container",
|
|
5
|
-
description: "A container component with gutter padding",
|
|
6
|
-
category: COMPONENT_TYPES.deprecated,
|
|
7
|
-
stylesPanelSections: CONTAINER_COMPONENT_STYLES_SECTIONS,
|
|
8
|
-
layout: {
|
|
9
|
-
height: 250
|
|
10
|
-
},
|
|
11
|
-
props: {
|
|
12
|
-
useThemeGutterPadding: {
|
|
13
|
-
group: GROUPS.basic,
|
|
14
|
-
label: "Use gutter padding",
|
|
15
|
-
description: "When true, uses the theme gutter spacing as the container's horizontal padding",
|
|
16
|
-
formType: FORM_TYPES.boolean,
|
|
17
|
-
propType: PROP_TYPES.BOOLEAN,
|
|
18
|
-
defaultValue: false,
|
|
19
|
-
editable: false,
|
|
20
|
-
required: true
|
|
21
|
-
},
|
|
22
|
-
backgroundImage: createImageProp({
|
|
23
|
-
label: "Background Image",
|
|
24
|
-
description: "Apply a custom background image",
|
|
25
|
-
defaultValue: null
|
|
26
|
-
}),
|
|
27
|
-
backgroundImageResizeMode: createResizeModeProp(),
|
|
28
|
-
elevation: createElevationType(0)
|
|
29
|
-
}
|
|
30
|
-
};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import { ImageSourcePropType, StyleProp, ViewStyle } from "react-native";
|
|
3
|
-
import type { Theme } from "../styles/DefaultTheme";
|
|
4
|
-
import { ResizeModeType } from "./ResizeMode";
|
|
5
|
-
declare type Props = {
|
|
6
|
-
theme: Theme;
|
|
7
|
-
useThemeGutterPadding: boolean;
|
|
8
|
-
borderColor: string;
|
|
9
|
-
borderWidth: number;
|
|
10
|
-
backgroundColor: string;
|
|
11
|
-
backgroundImage?: string | ImageSourcePropType;
|
|
12
|
-
backgroundImageResizeMode?: ResizeModeType;
|
|
13
|
-
elevation?: number;
|
|
14
|
-
style?: StyleProp<ViewStyle>;
|
|
15
|
-
children?: React.ReactNode;
|
|
16
|
-
};
|
|
17
|
-
declare const _default: React.ComponentType<import("@draftbit/react-theme-provider").$Without<React.PropsWithChildren<Props>, "theme"> & {
|
|
18
|
-
theme?: import("@draftbit/react-theme-provider").$DeepPartial<any> | undefined;
|
|
19
|
-
}> & import("@draftbit/react-theme-provider/typings/hoist-non-react-statics").NonReactStatics<React.ComponentType<React.PropsWithChildren<Props>> & React.FC<React.PropsWithChildren<Props>>, {}>;
|
|
20
|
-
export default _default;
|
|
21
|
-
//# sourceMappingURL=Container.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Container.d.ts","sourceRoot":"","sources":["../../../../src/components/Container.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAGL,mBAAmB,EACnB,SAAS,EAET,SAAS,EACV,MAAM,cAAc,CAAC;AAItB,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE9C,aAAK,KAAK,GAAG;IACX,KAAK,EAAE,KAAK,CAAC;IACb,qBAAqB,EAAE,OAAO,CAAC;IAC/B,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,EAAE,MAAM,CAAC;IACxB,eAAe,CAAC,EAAE,MAAM,GAAG,mBAAmB,CAAC;IAC/C,yBAAyB,CAAC,EAAE,cAAc,CAAC;IAC3C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B,CAAC;;;;AAyFF,wBAAoC"}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
export declare const SEED_DATA: {
|
|
2
|
-
name: string;
|
|
3
|
-
tag: string;
|
|
4
|
-
description: string;
|
|
5
|
-
category: string;
|
|
6
|
-
stylesPanelSections: string[];
|
|
7
|
-
layout: {
|
|
8
|
-
height: number;
|
|
9
|
-
};
|
|
10
|
-
props: {
|
|
11
|
-
useThemeGutterPadding: {
|
|
12
|
-
group: string;
|
|
13
|
-
label: string;
|
|
14
|
-
description: string;
|
|
15
|
-
formType: string;
|
|
16
|
-
propType: string;
|
|
17
|
-
defaultValue: boolean;
|
|
18
|
-
editable: boolean;
|
|
19
|
-
required: boolean;
|
|
20
|
-
};
|
|
21
|
-
backgroundImage: {
|
|
22
|
-
label: string;
|
|
23
|
-
description: string;
|
|
24
|
-
group: string;
|
|
25
|
-
formType: string;
|
|
26
|
-
propType: string;
|
|
27
|
-
defaultValue: string;
|
|
28
|
-
editable: boolean;
|
|
29
|
-
required: boolean;
|
|
30
|
-
};
|
|
31
|
-
backgroundImageResizeMode: {
|
|
32
|
-
group: string;
|
|
33
|
-
label: string;
|
|
34
|
-
description: string;
|
|
35
|
-
editable: boolean;
|
|
36
|
-
required: boolean;
|
|
37
|
-
defaultValue: string;
|
|
38
|
-
formType: string;
|
|
39
|
-
propType: string;
|
|
40
|
-
options: string[];
|
|
41
|
-
};
|
|
42
|
-
elevation: {
|
|
43
|
-
defaultValue: any;
|
|
44
|
-
label: string;
|
|
45
|
-
description: string;
|
|
46
|
-
formType: string;
|
|
47
|
-
propType: string;
|
|
48
|
-
options: number[];
|
|
49
|
-
editable: boolean;
|
|
50
|
-
required: boolean;
|
|
51
|
-
group: string;
|
|
52
|
-
};
|
|
53
|
-
};
|
|
54
|
-
};
|
|
55
|
-
//# sourceMappingURL=Container.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Container.d.ts","sourceRoot":"","sources":["../../../../src/mappings/Container.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6BrB,CAAC"}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import { View, ImageBackground, StyleSheet, } from "react-native";
|
|
3
|
-
import { withTheme } from "../theming";
|
|
4
|
-
import Elevation from "./Elevation";
|
|
5
|
-
const Container = ({ useThemeGutterPadding, borderColor, borderWidth, backgroundColor, backgroundImage, backgroundImageResizeMode, elevation, style, children, theme, // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
6
|
-
...rest }) => {
|
|
7
|
-
const { flex, flexGrow, flexWrap, flexBasis, flexShrink, flexDirection, alignContent, justifyContent, alignItems, padding, paddingTop, paddingBottom, paddingLeft, paddingRight, paddingVertical, paddingHorizontal, ...styleProp } = StyleSheet.flatten(style) || {};
|
|
8
|
-
const containerStyle = {
|
|
9
|
-
backgroundColor,
|
|
10
|
-
borderColor,
|
|
11
|
-
borderWidth,
|
|
12
|
-
width: "100%",
|
|
13
|
-
...styleProp,
|
|
14
|
-
};
|
|
15
|
-
const innerStyle = {
|
|
16
|
-
flex,
|
|
17
|
-
flexGrow,
|
|
18
|
-
flexWrap,
|
|
19
|
-
flexBasis,
|
|
20
|
-
flexShrink,
|
|
21
|
-
flexDirection,
|
|
22
|
-
alignContent,
|
|
23
|
-
justifyContent,
|
|
24
|
-
alignItems,
|
|
25
|
-
padding,
|
|
26
|
-
paddingTop,
|
|
27
|
-
paddingBottom,
|
|
28
|
-
paddingLeft,
|
|
29
|
-
paddingRight,
|
|
30
|
-
paddingVertical,
|
|
31
|
-
paddingHorizontal: paddingHorizontal || useThemeGutterPadding ? 16 : 0,
|
|
32
|
-
};
|
|
33
|
-
const Wrap = elevation ? Elevation : View;
|
|
34
|
-
if (elevation)
|
|
35
|
-
containerStyle.elevation = elevation;
|
|
36
|
-
return (React.createElement(Wrap, { style: [containerStyle, style], ...rest }, backgroundImage ? (React.createElement(ImageBackground, { source: typeof backgroundImage === "string"
|
|
37
|
-
? { uri: backgroundImage }
|
|
38
|
-
: backgroundImage, resizeMode: backgroundImageResizeMode, style: {
|
|
39
|
-
flex: 1,
|
|
40
|
-
} },
|
|
41
|
-
React.createElement(View, { style: innerStyle }, children))) : (React.createElement(View, { style: innerStyle }, children))));
|
|
42
|
-
};
|
|
43
|
-
export default withTheme(Container);
|
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import {
|
|
3
|
-
View,
|
|
4
|
-
ImageBackground,
|
|
5
|
-
ImageSourcePropType,
|
|
6
|
-
StyleProp,
|
|
7
|
-
StyleSheet,
|
|
8
|
-
ViewStyle,
|
|
9
|
-
} from "react-native";
|
|
10
|
-
import { withTheme } from "../theming";
|
|
11
|
-
|
|
12
|
-
import Elevation from "./Elevation";
|
|
13
|
-
import type { Theme } from "../styles/DefaultTheme";
|
|
14
|
-
import { ResizeModeType } from "./ResizeMode";
|
|
15
|
-
|
|
16
|
-
type Props = {
|
|
17
|
-
theme: Theme;
|
|
18
|
-
useThemeGutterPadding: boolean;
|
|
19
|
-
borderColor: string;
|
|
20
|
-
borderWidth: number;
|
|
21
|
-
backgroundColor: string;
|
|
22
|
-
backgroundImage?: string | ImageSourcePropType;
|
|
23
|
-
backgroundImageResizeMode?: ResizeModeType;
|
|
24
|
-
elevation?: number;
|
|
25
|
-
style?: StyleProp<ViewStyle>;
|
|
26
|
-
children?: React.ReactNode;
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
const Container: React.FC<React.PropsWithChildren<Props>> = ({
|
|
30
|
-
useThemeGutterPadding,
|
|
31
|
-
borderColor,
|
|
32
|
-
borderWidth,
|
|
33
|
-
backgroundColor,
|
|
34
|
-
backgroundImage,
|
|
35
|
-
backgroundImageResizeMode,
|
|
36
|
-
elevation,
|
|
37
|
-
style,
|
|
38
|
-
children,
|
|
39
|
-
theme, // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
40
|
-
...rest
|
|
41
|
-
}) => {
|
|
42
|
-
const {
|
|
43
|
-
flex,
|
|
44
|
-
flexGrow,
|
|
45
|
-
flexWrap,
|
|
46
|
-
flexBasis,
|
|
47
|
-
flexShrink,
|
|
48
|
-
flexDirection,
|
|
49
|
-
alignContent,
|
|
50
|
-
justifyContent,
|
|
51
|
-
alignItems,
|
|
52
|
-
padding,
|
|
53
|
-
paddingTop,
|
|
54
|
-
paddingBottom,
|
|
55
|
-
paddingLeft,
|
|
56
|
-
paddingRight,
|
|
57
|
-
paddingVertical,
|
|
58
|
-
paddingHorizontal,
|
|
59
|
-
...styleProp
|
|
60
|
-
} = StyleSheet.flatten(style) || {};
|
|
61
|
-
|
|
62
|
-
const containerStyle: StyleProp<ViewStyle> = {
|
|
63
|
-
backgroundColor,
|
|
64
|
-
borderColor,
|
|
65
|
-
borderWidth,
|
|
66
|
-
width: "100%",
|
|
67
|
-
...styleProp,
|
|
68
|
-
};
|
|
69
|
-
|
|
70
|
-
const innerStyle: StyleProp<ViewStyle> = {
|
|
71
|
-
flex,
|
|
72
|
-
flexGrow,
|
|
73
|
-
flexWrap,
|
|
74
|
-
flexBasis,
|
|
75
|
-
flexShrink,
|
|
76
|
-
flexDirection,
|
|
77
|
-
alignContent,
|
|
78
|
-
justifyContent,
|
|
79
|
-
alignItems,
|
|
80
|
-
padding,
|
|
81
|
-
paddingTop,
|
|
82
|
-
paddingBottom,
|
|
83
|
-
paddingLeft,
|
|
84
|
-
paddingRight,
|
|
85
|
-
paddingVertical,
|
|
86
|
-
paddingHorizontal: paddingHorizontal || useThemeGutterPadding ? 16 : 0,
|
|
87
|
-
};
|
|
88
|
-
|
|
89
|
-
const Wrap = elevation ? Elevation : View;
|
|
90
|
-
|
|
91
|
-
if (elevation) containerStyle.elevation = elevation;
|
|
92
|
-
|
|
93
|
-
return (
|
|
94
|
-
<Wrap style={[containerStyle, style]} {...rest}>
|
|
95
|
-
{backgroundImage ? (
|
|
96
|
-
<ImageBackground
|
|
97
|
-
source={
|
|
98
|
-
typeof backgroundImage === "string"
|
|
99
|
-
? { uri: backgroundImage }
|
|
100
|
-
: backgroundImage
|
|
101
|
-
}
|
|
102
|
-
resizeMode={backgroundImageResizeMode}
|
|
103
|
-
style={{
|
|
104
|
-
flex: 1,
|
|
105
|
-
}}
|
|
106
|
-
>
|
|
107
|
-
<View style={innerStyle}>{children}</View>
|
|
108
|
-
</ImageBackground>
|
|
109
|
-
) : (
|
|
110
|
-
<View style={innerStyle}>{children}</View>
|
|
111
|
-
)}
|
|
112
|
-
</Wrap>
|
|
113
|
-
);
|
|
114
|
-
};
|
|
115
|
-
|
|
116
|
-
export default withTheme(Container);
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { GROUPS, COMPONENT_TYPES, FORM_TYPES, PROP_TYPES, createElevationType, createImageProp, createResizeModeProp, CONTAINER_COMPONENT_STYLES_SECTIONS, } from "@draftbit/types";
|
|
2
|
-
export const SEED_DATA = {
|
|
3
|
-
name: "Container",
|
|
4
|
-
tag: "Container",
|
|
5
|
-
description: "A container component with gutter padding",
|
|
6
|
-
category: COMPONENT_TYPES.deprecated,
|
|
7
|
-
stylesPanelSections: CONTAINER_COMPONENT_STYLES_SECTIONS,
|
|
8
|
-
layout: {
|
|
9
|
-
height: 250,
|
|
10
|
-
},
|
|
11
|
-
props: {
|
|
12
|
-
useThemeGutterPadding: {
|
|
13
|
-
group: GROUPS.basic,
|
|
14
|
-
label: "Use gutter padding",
|
|
15
|
-
description: "When true, uses the theme gutter spacing as the container's horizontal padding",
|
|
16
|
-
formType: FORM_TYPES.boolean,
|
|
17
|
-
propType: PROP_TYPES.BOOLEAN,
|
|
18
|
-
defaultValue: false,
|
|
19
|
-
editable: false,
|
|
20
|
-
required: true,
|
|
21
|
-
},
|
|
22
|
-
backgroundImage: createImageProp({
|
|
23
|
-
label: "Background Image",
|
|
24
|
-
description: "Apply a custom background image",
|
|
25
|
-
defaultValue: null,
|
|
26
|
-
}),
|
|
27
|
-
backgroundImageResizeMode: createResizeModeProp(),
|
|
28
|
-
elevation: createElevationType(0),
|
|
29
|
-
},
|
|
30
|
-
};
|