@draftbit/core 46.4.4-8e5cf2.2 → 46.4.4-926784.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonjs/components/Container.js +5 -17
- package/lib/commonjs/index.js +83 -37
- package/lib/commonjs/mappings/HtmlElements.js +125 -0
- package/lib/commonjs/utilities.js +2 -2
- package/lib/module/components/CircularProgress.js +15 -7
- package/lib/module/components/Justification.js +0 -1
- package/lib/module/components/Portal/PortalHost.js +26 -15
- package/lib/module/components/Text.js +35 -9
- package/lib/module/components/TextField.js +62 -30
- package/lib/module/index.js +1 -1
- package/lib/module/mappings/HtmlElements.js +116 -0
- package/lib/module/utilities.js +3 -3
- package/lib/typescript/src/index.d.ts +1 -1
- package/lib/typescript/src/mappings/HtmlElements.d.ts +49 -0
- package/lib/typescript/src/utilities.d.ts +3 -3
- package/package.json +4 -3
- package/src/index.js +1 -1
- package/src/index.tsx +1 -8
- package/src/mappings/HtmlElements.js +141 -0
- package/src/mappings/HtmlElements.ts +151 -0
- package/src/utilities.js +2 -5
- package/src/utilities.ts +2 -13
- package/lib/commonjs/components/Table/Table.js +0 -35
- package/lib/commonjs/components/Table/TableCell.js +0 -50
- package/lib/commonjs/components/Table/TableHeader.js +0 -41
- package/lib/commonjs/components/Table/TablePaginator.js +0 -17
- package/lib/commonjs/components/Table/TableRow.js +0 -47
- package/lib/commonjs/components/Table/TableTitle.js +0 -60
- package/lib/commonjs/components/Table/index.js +0 -55
- package/lib/commonjs/mappings/Table.js +0 -102
- package/lib/module/components/Table/Table.js +0 -23
- package/lib/module/components/Table/TableCell.js +0 -37
- package/lib/module/components/Table/TableHeader.js +0 -27
- package/lib/module/components/Table/TablePaginator.js +0 -6
- package/lib/module/components/Table/TableRow.js +0 -33
- package/lib/module/components/Table/TableTitle.js +0 -47
- package/lib/module/components/Table/index.js +0 -6
- package/lib/module/mappings/Table.js +0 -93
- package/lib/typescript/src/components/Table/Table.d.ts +0 -8
- package/lib/typescript/src/components/Table/TableCell.d.ts +0 -10
- package/lib/typescript/src/components/Table/TableHeader.d.ts +0 -12
- package/lib/typescript/src/components/Table/TablePaginator.d.ts +0 -3
- package/lib/typescript/src/components/Table/TableRow.d.ts +0 -12
- package/lib/typescript/src/components/Table/TableTitle.d.ts +0 -12
- package/lib/typescript/src/components/Table/index.d.ts +0 -6
- package/lib/typescript/src/mappings/Table.d.ts +0 -148
- package/src/components/Table/Table.js +0 -10
- package/src/components/Table/Table.tsx +0 -22
- package/src/components/Table/TableCell.js +0 -21
- package/src/components/Table/TableCell.tsx +0 -44
- package/src/components/Table/TableHeader.js +0 -11
- package/src/components/Table/TableHeader.tsx +0 -28
- package/src/components/Table/TablePaginator.js +0 -5
- package/src/components/Table/TablePaginator.tsx +0 -10
- package/src/components/Table/TableRow.js +0 -16
- package/src/components/Table/TableRow.tsx +0 -31
- package/src/components/Table/TableTitle.js +0 -28
- package/src/components/Table/TableTitle.tsx +0 -58
- package/src/components/Table/index.js +0 -6
- package/src/components/Table/index.tsx +0 -6
- package/src/mappings/Table.js +0 -136
- package/src/mappings/Table.ts +0 -144
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import {
|
|
2
|
+
COMPONENT_TYPES,
|
|
3
|
+
createTextProp,
|
|
4
|
+
FORM_TYPES,
|
|
5
|
+
GROUPS,
|
|
6
|
+
StylesPanelSections,
|
|
7
|
+
Triggers,
|
|
8
|
+
} from "@draftbit/types";
|
|
9
|
+
const SEED_DATA_TRIGGERS = [Triggers.OnValueChange];
|
|
10
|
+
|
|
11
|
+
const ELEMENT_PROPS = {
|
|
12
|
+
category: COMPONENT_TYPES.element,
|
|
13
|
+
doc_link: "https://www.npmjs.com/package/@expo/html-elements",
|
|
14
|
+
code_link: "https://github.com/expo/expo/tree/master/packages/html-elements",
|
|
15
|
+
stylesPanelSections: [
|
|
16
|
+
StylesPanelSections.Typography,
|
|
17
|
+
StylesPanelSections.LayoutSelectedItem,
|
|
18
|
+
StylesPanelSections.MarginsAndPaddings,
|
|
19
|
+
StylesPanelSections.Effects,
|
|
20
|
+
],
|
|
21
|
+
layout: {
|
|
22
|
+
margin: 0,
|
|
23
|
+
},
|
|
24
|
+
triggers: SEED_DATA_TRIGGERS,
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
const HEADING_PROPS = {
|
|
28
|
+
...ELEMENT_PROPS,
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export const SEED_DATA = [
|
|
32
|
+
{
|
|
33
|
+
name: "H1",
|
|
34
|
+
tag: "H1",
|
|
35
|
+
...HEADING_PROPS,
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
name: "H2",
|
|
39
|
+
tag: "H2",
|
|
40
|
+
...HEADING_PROPS,
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
name: "H3",
|
|
44
|
+
tag: "H3",
|
|
45
|
+
...HEADING_PROPS,
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
name: "H4",
|
|
49
|
+
tag: "H4",
|
|
50
|
+
...HEADING_PROPS,
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
name: "H5",
|
|
54
|
+
tag: "H5",
|
|
55
|
+
...HEADING_PROPS,
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
name: "H6",
|
|
59
|
+
tag: "H6",
|
|
60
|
+
...HEADING_PROPS,
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
name: "Anchor",
|
|
64
|
+
tag: "A",
|
|
65
|
+
...ELEMENT_PROPS,
|
|
66
|
+
props: {
|
|
67
|
+
href: createTextProp({
|
|
68
|
+
label: "href",
|
|
69
|
+
description: "Specify the URL",
|
|
70
|
+
defaultValue: "",
|
|
71
|
+
}),
|
|
72
|
+
target: {
|
|
73
|
+
group: GROUPS.basic,
|
|
74
|
+
label: "target",
|
|
75
|
+
description: "decide where link should open",
|
|
76
|
+
formType: FORM_TYPES.flatArray,
|
|
77
|
+
defaultValue: "_blank",
|
|
78
|
+
options: ["_blank", "_self", "_parent", "_top"],
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
name: "Paragraph",
|
|
84
|
+
tag: "P",
|
|
85
|
+
...ELEMENT_PROPS,
|
|
86
|
+
props: {
|
|
87
|
+
// NOTE - Keeping the props commented until we figure out a way to use this props from draftbit side.
|
|
88
|
+
// strong: createBoolProp({
|
|
89
|
+
// label: "Strong",
|
|
90
|
+
// description: "Strong",
|
|
91
|
+
// }),
|
|
92
|
+
// strike: createBoolProp({
|
|
93
|
+
// label: "Strike",
|
|
94
|
+
// description: "Strike through",
|
|
95
|
+
// }),
|
|
96
|
+
// italic: createBoolProp({
|
|
97
|
+
// label: "Italic",
|
|
98
|
+
// description: "Italic Fonts",
|
|
99
|
+
// }),
|
|
100
|
+
// bold: createBoolProp({
|
|
101
|
+
// label: "Bold",
|
|
102
|
+
// description: "Bold",
|
|
103
|
+
// }),
|
|
104
|
+
},
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
name: "Code",
|
|
108
|
+
tag: "Code",
|
|
109
|
+
...ELEMENT_PROPS,
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
name: "Pre",
|
|
113
|
+
tag: "Pre",
|
|
114
|
+
...ELEMENT_PROPS,
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
name: "Mark",
|
|
118
|
+
tag: "Mark",
|
|
119
|
+
...ELEMENT_PROPS,
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
name: "BR",
|
|
123
|
+
tag: "BR",
|
|
124
|
+
...ELEMENT_PROPS,
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
name: "BlockQuote",
|
|
128
|
+
tag: "BlockQuote",
|
|
129
|
+
...ELEMENT_PROPS,
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
name: "Time",
|
|
133
|
+
tag: "Time",
|
|
134
|
+
...ELEMENT_PROPS,
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
name: "UL",
|
|
138
|
+
tag: "UL",
|
|
139
|
+
...ELEMENT_PROPS,
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
name: "LI",
|
|
143
|
+
tag: "LI",
|
|
144
|
+
...ELEMENT_PROPS,
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
name: "HR",
|
|
148
|
+
tag: "HR",
|
|
149
|
+
...ELEMENT_PROPS,
|
|
150
|
+
},
|
|
151
|
+
];
|
package/src/utilities.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { StyleSheet } from "react-native";
|
|
2
|
-
import { isString, isNumber, pick, pickBy, identity
|
|
2
|
+
import { isString, isNumber, pick, pickBy, identity } from "lodash";
|
|
3
3
|
export function extractStyles(style) {
|
|
4
4
|
const { color, fontFamily, fontWeight, fontSize, lineHeight, letterSpacing, textTransform, textAlign, textDecorationLine, textDecorationColor, textDecorationStyle, ...viewStyles } = StyleSheet.flatten(style || {});
|
|
5
5
|
const textStyles = {
|
|
@@ -15,10 +15,7 @@ export function extractStyles(style) {
|
|
|
15
15
|
textDecorationColor,
|
|
16
16
|
textDecorationStyle,
|
|
17
17
|
};
|
|
18
|
-
return {
|
|
19
|
-
viewStyles: omitBy(viewStyles, isNil),
|
|
20
|
-
textStyles: omitBy(textStyles, isNil),
|
|
21
|
-
};
|
|
18
|
+
return { viewStyles, textStyles };
|
|
22
19
|
}
|
|
23
20
|
export const borderStyleNames = [
|
|
24
21
|
"borderRadius",
|
package/src/utilities.ts
CHANGED
|
@@ -1,13 +1,5 @@
|
|
|
1
1
|
import { StyleSheet, StyleProp, TextStyle } from "react-native";
|
|
2
|
-
import {
|
|
3
|
-
isString,
|
|
4
|
-
isNumber,
|
|
5
|
-
pick,
|
|
6
|
-
pickBy,
|
|
7
|
-
identity,
|
|
8
|
-
omitBy,
|
|
9
|
-
isNil,
|
|
10
|
-
} from "lodash";
|
|
2
|
+
import { isString, isNumber, pick, pickBy, identity } from "lodash";
|
|
11
3
|
|
|
12
4
|
export function extractStyles(style: StyleProp<any>) {
|
|
13
5
|
const {
|
|
@@ -39,10 +31,7 @@ export function extractStyles(style: StyleProp<any>) {
|
|
|
39
31
|
textDecorationStyle,
|
|
40
32
|
};
|
|
41
33
|
|
|
42
|
-
return {
|
|
43
|
-
viewStyles: omitBy(viewStyles, isNil),
|
|
44
|
-
textStyles: omitBy(textStyles, isNil),
|
|
45
|
-
};
|
|
34
|
+
return { viewStyles, textStyles };
|
|
46
35
|
}
|
|
47
36
|
|
|
48
37
|
export const borderStyleNames = [
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
|
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
|
|
10
|
-
var _reactNative = require("react-native");
|
|
11
|
-
|
|
12
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
-
|
|
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
|
-
|
|
16
|
-
const Table = _ref => {
|
|
17
|
-
let {
|
|
18
|
-
children,
|
|
19
|
-
style,
|
|
20
|
-
...rest
|
|
21
|
-
} = _ref;
|
|
22
|
-
return /*#__PURE__*/_react.default.createElement(_reactNative.View, _extends({}, rest, {
|
|
23
|
-
style: [styles.wrapper, style]
|
|
24
|
-
}), children);
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
const styles = _reactNative.StyleSheet.create({
|
|
28
|
-
wrapper: {
|
|
29
|
-
display: "flex",
|
|
30
|
-
flexDirection: "column"
|
|
31
|
-
}
|
|
32
|
-
});
|
|
33
|
-
|
|
34
|
-
var _default = Table;
|
|
35
|
-
exports.default = _default;
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
|
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
|
|
10
|
-
var _reactNative = require("react-native");
|
|
11
|
-
|
|
12
|
-
var _utilities = require("../../utilities");
|
|
13
|
-
|
|
14
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
-
|
|
16
|
-
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); }
|
|
17
|
-
|
|
18
|
-
const TableCell = _ref => {
|
|
19
|
-
let {
|
|
20
|
-
children,
|
|
21
|
-
style,
|
|
22
|
-
numeric,
|
|
23
|
-
value,
|
|
24
|
-
...rest
|
|
25
|
-
} = _ref;
|
|
26
|
-
const {
|
|
27
|
-
textStyles,
|
|
28
|
-
viewStyles
|
|
29
|
-
} = (0, _utilities.extractStyles)(style);
|
|
30
|
-
return /*#__PURE__*/_react.default.createElement(_reactNative.View, _extends({}, rest, {
|
|
31
|
-
style: [styles.wrapper, numeric && styles.right, viewStyles]
|
|
32
|
-
}), /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
33
|
-
numberOfLines: 1,
|
|
34
|
-
style: textStyles
|
|
35
|
-
}, children, value));
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
const styles = _reactNative.StyleSheet.create({
|
|
39
|
-
wrapper: {
|
|
40
|
-
flex: 1,
|
|
41
|
-
display: "flex",
|
|
42
|
-
flexDirection: "row"
|
|
43
|
-
},
|
|
44
|
-
right: {
|
|
45
|
-
justifyContent: "flex-end"
|
|
46
|
-
}
|
|
47
|
-
});
|
|
48
|
-
|
|
49
|
-
var _default = TableCell;
|
|
50
|
-
exports.default = _default;
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
|
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
|
|
10
|
-
var _reactNative = require("react-native");
|
|
11
|
-
|
|
12
|
-
var _theming = require("../../theming");
|
|
13
|
-
|
|
14
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
-
|
|
16
|
-
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); }
|
|
17
|
-
|
|
18
|
-
const TableHeader = _ref => {
|
|
19
|
-
let {
|
|
20
|
-
children,
|
|
21
|
-
style,
|
|
22
|
-
theme,
|
|
23
|
-
...rest
|
|
24
|
-
} = _ref;
|
|
25
|
-
return /*#__PURE__*/_react.default.createElement(_reactNative.View, _extends({}, rest, {
|
|
26
|
-
style: [styles.wrapper, {
|
|
27
|
-
borderBottomColor: theme.colors.medium
|
|
28
|
-
}, style]
|
|
29
|
-
}), children);
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
const styles = _reactNative.StyleSheet.create({
|
|
33
|
-
wrapper: {
|
|
34
|
-
display: "flex",
|
|
35
|
-
flexDirection: "row"
|
|
36
|
-
}
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
var _default = (0, _theming.withTheme)(TableHeader);
|
|
40
|
-
|
|
41
|
-
exports.default = _default;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
|
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
|
|
10
|
-
var _reactNative = require("react-native");
|
|
11
|
-
|
|
12
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
-
|
|
14
|
-
const TablePaginator = () => /*#__PURE__*/_react.default.createElement(_reactNative.View, null, /*#__PURE__*/_react.default.createElement(_reactNative.Text, null, "Table Paginator"));
|
|
15
|
-
|
|
16
|
-
var _default = TablePaginator;
|
|
17
|
-
exports.default = _default;
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
|
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
|
|
10
|
-
var _reactNative = require("react-native");
|
|
11
|
-
|
|
12
|
-
var _theming = require("../../theming");
|
|
13
|
-
|
|
14
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
-
|
|
16
|
-
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); }
|
|
17
|
-
|
|
18
|
-
const TableRow = _ref => {
|
|
19
|
-
let {
|
|
20
|
-
children,
|
|
21
|
-
style,
|
|
22
|
-
theme,
|
|
23
|
-
...rest
|
|
24
|
-
} = _ref;
|
|
25
|
-
return /*#__PURE__*/_react.default.createElement(_reactNative.View, _extends({}, rest, {
|
|
26
|
-
style: [styles.container, {
|
|
27
|
-
borderBottomColor: theme.colors.light
|
|
28
|
-
}, style]
|
|
29
|
-
}), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
30
|
-
style: styles.content
|
|
31
|
-
}, children));
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
const styles = _reactNative.StyleSheet.create({
|
|
35
|
-
container: {
|
|
36
|
-
display: "flex",
|
|
37
|
-
flexDirection: "row"
|
|
38
|
-
},
|
|
39
|
-
content: {
|
|
40
|
-
flex: 1,
|
|
41
|
-
flexDirection: "row"
|
|
42
|
-
}
|
|
43
|
-
});
|
|
44
|
-
|
|
45
|
-
var _default = (0, _theming.withTheme)(TableRow);
|
|
46
|
-
|
|
47
|
-
exports.default = _default;
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
|
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
|
|
10
|
-
var _reactNative = require("react-native");
|
|
11
|
-
|
|
12
|
-
var _utilities = require("../../utilities");
|
|
13
|
-
|
|
14
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
-
|
|
16
|
-
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); }
|
|
17
|
-
|
|
18
|
-
const TableTitle = _ref => {
|
|
19
|
-
let {
|
|
20
|
-
children,
|
|
21
|
-
style,
|
|
22
|
-
numeric = false,
|
|
23
|
-
isAscending = false,
|
|
24
|
-
numberOfLines = 1,
|
|
25
|
-
title,
|
|
26
|
-
...rest
|
|
27
|
-
} = _ref;
|
|
28
|
-
const {
|
|
29
|
-
textStyles,
|
|
30
|
-
viewStyles
|
|
31
|
-
} = (0, _utilities.extractStyles)(style);
|
|
32
|
-
return /*#__PURE__*/_react.default.createElement(_reactNative.View, _extends({}, rest, {
|
|
33
|
-
style: [styles.wrapper, numeric && styles.right, viewStyles]
|
|
34
|
-
}), /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
35
|
-
style: [isAscending ? styles.sorted : {
|
|
36
|
-
color: "gray"
|
|
37
|
-
}, textStyles],
|
|
38
|
-
numberOfLines: numberOfLines
|
|
39
|
-
}, children, title));
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
const styles = _reactNative.StyleSheet.create({
|
|
43
|
-
wrapper: {
|
|
44
|
-
flex: 1,
|
|
45
|
-
display: "flex",
|
|
46
|
-
flexDirection: "row"
|
|
47
|
-
},
|
|
48
|
-
right: {
|
|
49
|
-
justifyContent: "flex-end"
|
|
50
|
-
},
|
|
51
|
-
sorted: {// marginLeft: 8,
|
|
52
|
-
},
|
|
53
|
-
icon: {
|
|
54
|
-
height: 24,
|
|
55
|
-
justifyContent: "center"
|
|
56
|
-
}
|
|
57
|
-
});
|
|
58
|
-
|
|
59
|
-
var _default = TableTitle;
|
|
60
|
-
exports.default = _default;
|
|
@@ -1,55 +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, "TableHeader", {
|
|
19
|
-
enumerable: true,
|
|
20
|
-
get: function () {
|
|
21
|
-
return _TableHeader.default;
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
|
-
Object.defineProperty(exports, "TablePaginator", {
|
|
25
|
-
enumerable: true,
|
|
26
|
-
get: function () {
|
|
27
|
-
return _TablePaginator.default;
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
|
-
Object.defineProperty(exports, "TableRow", {
|
|
31
|
-
enumerable: true,
|
|
32
|
-
get: function () {
|
|
33
|
-
return _TableRow.default;
|
|
34
|
-
}
|
|
35
|
-
});
|
|
36
|
-
Object.defineProperty(exports, "TableTitle", {
|
|
37
|
-
enumerable: true,
|
|
38
|
-
get: function () {
|
|
39
|
-
return _TableTitle.default;
|
|
40
|
-
}
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
var _Table = _interopRequireDefault(require("./Table"));
|
|
44
|
-
|
|
45
|
-
var _TableHeader = _interopRequireDefault(require("./TableHeader"));
|
|
46
|
-
|
|
47
|
-
var _TablePaginator = _interopRequireDefault(require("./TablePaginator"));
|
|
48
|
-
|
|
49
|
-
var _TableRow = _interopRequireDefault(require("./TableRow"));
|
|
50
|
-
|
|
51
|
-
var _TableCell = _interopRequireDefault(require("./TableCell"));
|
|
52
|
-
|
|
53
|
-
var _TableTitle = _interopRequireDefault(require("./TableTitle"));
|
|
54
|
-
|
|
55
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.SEED_DATA = void 0;
|
|
7
|
-
|
|
8
|
-
var _types = require("@draftbit/types");
|
|
9
|
-
|
|
10
|
-
const SEED_DATA = [{
|
|
11
|
-
name: "Table",
|
|
12
|
-
tag: "Table",
|
|
13
|
-
category: _types.COMPONENT_TYPES.container,
|
|
14
|
-
stylesPanelSections: [_types.StylesPanelSections.Background, _types.StylesPanelSections.Borders, _types.StylesPanelSections.Size, _types.StylesPanelSections.MarginsAndPaddings, _types.StylesPanelSections.Position, _types.StylesPanelSections.Effects],
|
|
15
|
-
layout: {
|
|
16
|
-
width: "100%"
|
|
17
|
-
},
|
|
18
|
-
props: {}
|
|
19
|
-
}, {
|
|
20
|
-
name: "Table Row",
|
|
21
|
-
tag: "TableRow",
|
|
22
|
-
category: _types.COMPONENT_TYPES.container,
|
|
23
|
-
stylesPanelSections: [_types.StylesPanelSections.Background, _types.StylesPanelSections.Borders, _types.StylesPanelSections.Size, _types.StylesPanelSections.MarginsAndPaddings, _types.StylesPanelSections.Position, _types.StylesPanelSections.Effects],
|
|
24
|
-
layout: {
|
|
25
|
-
paddingLeft: 16,
|
|
26
|
-
paddingRight: 16,
|
|
27
|
-
borderBottomWidth: 1,
|
|
28
|
-
borderStyle: "solid"
|
|
29
|
-
},
|
|
30
|
-
props: {}
|
|
31
|
-
}, {
|
|
32
|
-
name: "Table Cell",
|
|
33
|
-
tag: "TableCell",
|
|
34
|
-
category: _types.COMPONENT_TYPES.container,
|
|
35
|
-
layout: {
|
|
36
|
-
paddingTop: 16,
|
|
37
|
-
paddingBottom: 16,
|
|
38
|
-
paddingLeft: 8,
|
|
39
|
-
paddingRight: 8
|
|
40
|
-
},
|
|
41
|
-
stylesPanelSections: [_types.StylesPanelSections.Typography, _types.StylesPanelSections.Background, _types.StylesPanelSections.Borders, _types.StylesPanelSections.Size, _types.StylesPanelSections.MarginsAndPaddings, _types.StylesPanelSections.Position, _types.StylesPanelSections.Effects],
|
|
42
|
-
props: {
|
|
43
|
-
numeric: (0, _types.createBoolProp)({
|
|
44
|
-
label: "Is Numeric Cell?",
|
|
45
|
-
description: "Does the cell contain a numeric value?",
|
|
46
|
-
group: _types.GROUPS.data
|
|
47
|
-
}),
|
|
48
|
-
value: (0, _types.createTextProp)({
|
|
49
|
-
label: "Cell Value",
|
|
50
|
-
description: "Table Cell Value",
|
|
51
|
-
group: _types.GROUPS.data
|
|
52
|
-
})
|
|
53
|
-
}
|
|
54
|
-
}, {
|
|
55
|
-
name: "Table Header",
|
|
56
|
-
tag: "TableHeader",
|
|
57
|
-
category: _types.COMPONENT_TYPES.container,
|
|
58
|
-
stylesPanelSections: [_types.StylesPanelSections.Background, _types.StylesPanelSections.Borders, _types.StylesPanelSections.Size, _types.StylesPanelSections.MarginsAndPaddings, _types.StylesPanelSections.Position, _types.StylesPanelSections.Effects],
|
|
59
|
-
layout: {
|
|
60
|
-
paddingLeft: 16,
|
|
61
|
-
paddingRight: 16,
|
|
62
|
-
borderBottomWidth: 1,
|
|
63
|
-
borderStyle: "solid",
|
|
64
|
-
backgroundColor: "#EFEFEF"
|
|
65
|
-
},
|
|
66
|
-
props: {}
|
|
67
|
-
}, {
|
|
68
|
-
name: "Table Title",
|
|
69
|
-
tag: "TableTitle",
|
|
70
|
-
category: _types.COMPONENT_TYPES.container,
|
|
71
|
-
stylesPanelSections: [_types.StylesPanelSections.Typography, _types.StylesPanelSections.Background, _types.StylesPanelSections.Borders, _types.StylesPanelSections.Size, _types.StylesPanelSections.MarginsAndPaddings, _types.StylesPanelSections.Position, _types.StylesPanelSections.Effects],
|
|
72
|
-
layout: {
|
|
73
|
-
fontSize: 14,
|
|
74
|
-
paddingTop: 16,
|
|
75
|
-
paddingBottom: 16,
|
|
76
|
-
paddingLeft: 8,
|
|
77
|
-
paddingRight: 8
|
|
78
|
-
},
|
|
79
|
-
props: {
|
|
80
|
-
numeric: (0, _types.createBoolProp)({
|
|
81
|
-
label: "Is Numeric Cell?",
|
|
82
|
-
description: "Does the cell contain a numeric value?",
|
|
83
|
-
group: _types.GROUPS.data
|
|
84
|
-
}),
|
|
85
|
-
value: (0, _types.createTextProp)({
|
|
86
|
-
label: "Cell Value",
|
|
87
|
-
description: "Table Cell Value",
|
|
88
|
-
group: _types.GROUPS.data
|
|
89
|
-
}),
|
|
90
|
-
isAscending: (0, _types.createBoolProp)({
|
|
91
|
-
label: "Is Ascending?",
|
|
92
|
-
description: "Does the cell contain a numeric value?",
|
|
93
|
-
group: _types.GROUPS.data
|
|
94
|
-
}),
|
|
95
|
-
numberOfLines: (0, _types.createNumberProp)({
|
|
96
|
-
label: "Number of Lines",
|
|
97
|
-
description: "Number of Lines",
|
|
98
|
-
group: _types.GROUPS.basic
|
|
99
|
-
})
|
|
100
|
-
}
|
|
101
|
-
}];
|
|
102
|
-
exports.SEED_DATA = SEED_DATA;
|
|
@@ -1,23 +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
|
-
|
|
3
|
-
import React from "react";
|
|
4
|
-
import { View, StyleSheet } from "react-native";
|
|
5
|
-
|
|
6
|
-
const Table = _ref => {
|
|
7
|
-
let {
|
|
8
|
-
children,
|
|
9
|
-
style,
|
|
10
|
-
...rest
|
|
11
|
-
} = _ref;
|
|
12
|
-
return /*#__PURE__*/React.createElement(View, _extends({}, rest, {
|
|
13
|
-
style: [styles.wrapper, style]
|
|
14
|
-
}), children);
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
const styles = StyleSheet.create({
|
|
18
|
-
wrapper: {
|
|
19
|
-
display: "flex",
|
|
20
|
-
flexDirection: "column"
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
export default Table;
|
|
@@ -1,37 +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
|
-
|
|
3
|
-
import React from "react";
|
|
4
|
-
import { View, Text, StyleSheet } from "react-native";
|
|
5
|
-
import { extractStyles } from "../../utilities";
|
|
6
|
-
|
|
7
|
-
const TableCell = _ref => {
|
|
8
|
-
let {
|
|
9
|
-
children,
|
|
10
|
-
style,
|
|
11
|
-
numeric,
|
|
12
|
-
value,
|
|
13
|
-
...rest
|
|
14
|
-
} = _ref;
|
|
15
|
-
const {
|
|
16
|
-
textStyles,
|
|
17
|
-
viewStyles
|
|
18
|
-
} = extractStyles(style);
|
|
19
|
-
return /*#__PURE__*/React.createElement(View, _extends({}, rest, {
|
|
20
|
-
style: [styles.wrapper, numeric && styles.right, viewStyles]
|
|
21
|
-
}), /*#__PURE__*/React.createElement(Text, {
|
|
22
|
-
numberOfLines: 1,
|
|
23
|
-
style: textStyles
|
|
24
|
-
}, children, value));
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
const styles = StyleSheet.create({
|
|
28
|
-
wrapper: {
|
|
29
|
-
flex: 1,
|
|
30
|
-
display: "flex",
|
|
31
|
-
flexDirection: "row"
|
|
32
|
-
},
|
|
33
|
-
right: {
|
|
34
|
-
justifyContent: "flex-end"
|
|
35
|
-
}
|
|
36
|
-
});
|
|
37
|
-
export default TableCell;
|