@draftbit/core 46.10.3-ccc53a.2 → 46.10.3-cf3748.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/context.js +1 -1
- package/lib/commonjs/components/Table/Table.js +123 -0
- package/lib/commonjs/components/Table/TableCell.js +49 -0
- package/lib/commonjs/components/Table/TableRow.js +61 -0
- package/lib/commonjs/components/Table/index.js +51 -0
- package/lib/commonjs/index.js +19 -0
- package/lib/commonjs/mappings/Table.js +140 -0
- package/lib/module/components/Table/Table.js +114 -0
- package/lib/module/components/Table/TableCell.js +41 -0
- package/lib/module/components/Table/TableRow.js +53 -0
- package/lib/module/components/Table/index.js +24 -0
- package/lib/module/constants.js +0 -1
- package/lib/module/index.js +1 -0
- 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/{DeprecatedCardWrapper.d.ts → Table/TableRow.d.ts} +7 -8
- package/lib/typescript/src/components/Table/TableRow.d.ts.map +1 -0
- package/lib/typescript/src/components/Table/index.d.ts +22 -0
- package/lib/typescript/src/components/Table/index.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +1 -0
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/mappings/{CardBlock.d.ts → Table.d.ts} +129 -81
- 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 +59 -0
- package/src/components/Table/TableRow.js +37 -0
- package/src/components/Table/TableRow.tsx +77 -0
- package/src/components/Table/index.js +15 -0
- package/src/components/Table/index.tsx +44 -0
- package/src/index.js +1 -0
- package/src/index.tsx +2 -0
- package/src/mappings/Table.js +150 -0
- package/src/mappings/Table.ts +170 -0
- package/lib/commonjs/components/DeprecatedCardWrapper.js +0 -40
- package/lib/commonjs/components/DeprecatedFAB.js +0 -157
- package/lib/commonjs/components/ProgressIndicator.js +0 -55
- package/lib/commonjs/components/ResizeMode.js +0 -5
- package/lib/commonjs/mappings/CardBlock.js +0 -126
- package/lib/commonjs/mappings/CardContainer.js +0 -108
- package/lib/commonjs/mappings/CardContainerRating.js +0 -130
- package/lib/commonjs/mappings/CardContainerShortImage.js +0 -124
- package/lib/commonjs/mappings/CardInline.js +0 -59
- package/lib/commonjs/mappings/ProgressIndicator.js +0 -188
- package/lib/module/components/DeprecatedCardWrapper.js +0 -32
- package/lib/module/components/DeprecatedFAB.js +0 -147
- package/lib/module/components/ProgressIndicator.js +0 -45
- package/lib/module/components/ResizeMode.js +0 -1
- package/lib/module/mappings/CardBlock.js +0 -119
- package/lib/module/mappings/CardContainer.js +0 -101
- package/lib/module/mappings/CardContainerRating.js +0 -123
- package/lib/module/mappings/CardContainerShortImage.js +0 -117
- package/lib/module/mappings/CardInline.js +0 -52
- package/lib/module/mappings/ProgressIndicator.js +0 -181
- package/lib/typescript/src/components/DeprecatedCardWrapper.d.ts.map +0 -1
- package/lib/typescript/src/components/DeprecatedFAB.d.ts +0 -56
- package/lib/typescript/src/components/DeprecatedFAB.d.ts.map +0 -1
- package/lib/typescript/src/components/ProgressIndicator.d.ts +0 -24
- package/lib/typescript/src/components/ProgressIndicator.d.ts.map +0 -1
- package/lib/typescript/src/components/ResizeMode.d.ts +0 -2
- package/lib/typescript/src/components/ResizeMode.d.ts.map +0 -1
- package/lib/typescript/src/mappings/CardBlock.d.ts.map +0 -1
- package/lib/typescript/src/mappings/CardContainer.d.ts +0 -102
- package/lib/typescript/src/mappings/CardContainer.d.ts.map +0 -1
- package/lib/typescript/src/mappings/CardContainerRating.d.ts +0 -108
- package/lib/typescript/src/mappings/CardContainerRating.d.ts.map +0 -1
- package/lib/typescript/src/mappings/CardContainerShortImage.d.ts +0 -139
- package/lib/typescript/src/mappings/CardContainerShortImage.d.ts.map +0 -1
- package/lib/typescript/src/mappings/CardInline.d.ts +0 -62
- package/lib/typescript/src/mappings/CardInline.d.ts.map +0 -1
- package/lib/typescript/src/mappings/ProgressIndicator.d.ts +0 -181
- package/lib/typescript/src/mappings/ProgressIndicator.d.ts.map +0 -1
- package/src/components/DeprecatedCardWrapper.js +0 -18
- package/src/components/DeprecatedCardWrapper.tsx +0 -46
- package/src/components/DeprecatedFAB.js +0 -114
- package/src/components/DeprecatedFAB.tsx +0 -231
- package/src/components/ProgressIndicator.js +0 -27
- package/src/components/ProgressIndicator.tsx +0 -71
- package/src/components/ResizeMode.js +0 -1
- package/src/components/ResizeMode.ts +0 -7
- package/src/mappings/CardBlock.js +0 -123
- package/src/mappings/CardBlock.ts +0 -136
- package/src/mappings/CardContainer.js +0 -104
- package/src/mappings/CardContainer.ts +0 -116
- package/src/mappings/CardContainerRating.js +0 -126
- package/src/mappings/CardContainerRating.ts +0 -137
- package/src/mappings/CardContainerShortImage.js +0 -120
- package/src/mappings/CardContainerShortImage.ts +0 -130
- package/src/mappings/CardInline.js +0 -52
- package/src/mappings/CardInline.ts +0 -61
- package/src/mappings/ProgressIndicator.js +0 -181
- package/src/mappings/ProgressIndicator.ts +0 -190
|
@@ -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,40 +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 _theming = require("../theming");
|
|
9
|
-
var _Touchable = _interopRequireDefault(require("./Touchable"));
|
|
10
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
-
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); }
|
|
12
|
-
const getWidth = numColumns => {
|
|
13
|
-
switch (numColumns) {
|
|
14
|
-
case 1:
|
|
15
|
-
return "33%";
|
|
16
|
-
case 2:
|
|
17
|
-
return "50%";
|
|
18
|
-
default:
|
|
19
|
-
return "100%";
|
|
20
|
-
}
|
|
21
|
-
};
|
|
22
|
-
const Card = _ref => {
|
|
23
|
-
let {
|
|
24
|
-
numColumns = 3,
|
|
25
|
-
children,
|
|
26
|
-
onPress,
|
|
27
|
-
style,
|
|
28
|
-
...rest
|
|
29
|
-
} = _ref;
|
|
30
|
-
const width = getWidth(numColumns);
|
|
31
|
-
return /*#__PURE__*/_react.default.createElement(_Touchable.default, _extends({
|
|
32
|
-
disabled: !onPress,
|
|
33
|
-
onPress: onPress,
|
|
34
|
-
style: [style, {
|
|
35
|
-
width
|
|
36
|
-
}]
|
|
37
|
-
}, rest), children);
|
|
38
|
-
};
|
|
39
|
-
var _default = (0, _theming.withTheme)(Card);
|
|
40
|
-
exports.default = _default;
|
|
@@ -1,157 +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 _color = _interopRequireDefault(require("color"));
|
|
10
|
-
var _Config = _interopRequireDefault(require("./Config"));
|
|
11
|
-
var _Text = _interopRequireDefault(require("./Text"));
|
|
12
|
-
var _Elevation = _interopRequireDefault(require("./Elevation"));
|
|
13
|
-
var _theming = require("../theming");
|
|
14
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
-
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); }
|
|
16
|
-
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; }
|
|
17
|
-
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); }
|
|
18
|
-
const FAB = _ref => {
|
|
19
|
-
let {
|
|
20
|
-
Icon,
|
|
21
|
-
icon,
|
|
22
|
-
disabled = false,
|
|
23
|
-
type = "solid",
|
|
24
|
-
loading = false,
|
|
25
|
-
color: colorOverride,
|
|
26
|
-
label,
|
|
27
|
-
onPress,
|
|
28
|
-
elevation = 0,
|
|
29
|
-
style,
|
|
30
|
-
theme: {
|
|
31
|
-
colors,
|
|
32
|
-
disabledOpacity,
|
|
33
|
-
roundness,
|
|
34
|
-
typography
|
|
35
|
-
},
|
|
36
|
-
...rest
|
|
37
|
-
} = _ref;
|
|
38
|
-
let backgroundColor, borderColor, textColor, borderWidth;
|
|
39
|
-
const buttonColor = colorOverride || colors.primary;
|
|
40
|
-
if (type === "standard" || type === "extended" || type === "fixed") {
|
|
41
|
-
backgroundColor = buttonColor;
|
|
42
|
-
if (disabled) {
|
|
43
|
-
textColor = (0, _color.default)(colors.surface).alpha(disabledOpacity).rgb().string();
|
|
44
|
-
} else {
|
|
45
|
-
textColor = colors.surface;
|
|
46
|
-
}
|
|
47
|
-
} else {
|
|
48
|
-
backgroundColor = "transparent";
|
|
49
|
-
if (disabled) {
|
|
50
|
-
textColor = (0, _color.default)(buttonColor).alpha(disabledOpacity).rgb().string();
|
|
51
|
-
} else {
|
|
52
|
-
textColor = buttonColor;
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
if (type === "outline") {
|
|
56
|
-
if (disabled) {
|
|
57
|
-
borderColor = (0, _color.default)(buttonColor).alpha(disabledOpacity).rgb().string();
|
|
58
|
-
} else {
|
|
59
|
-
borderColor = buttonColor;
|
|
60
|
-
}
|
|
61
|
-
borderWidth = _reactNative.StyleSheet.hairlineWidth;
|
|
62
|
-
} else {
|
|
63
|
-
borderColor = "transparent";
|
|
64
|
-
borderWidth = 0;
|
|
65
|
-
}
|
|
66
|
-
const buttonStyle = {
|
|
67
|
-
backgroundColor,
|
|
68
|
-
borderColor,
|
|
69
|
-
borderWidth,
|
|
70
|
-
borderRadius: roundness,
|
|
71
|
-
alignItems: "center",
|
|
72
|
-
justifyContent: "center"
|
|
73
|
-
};
|
|
74
|
-
const buttonStyles = [styles.button, buttonStyle];
|
|
75
|
-
const contentStyle = [styles.content];
|
|
76
|
-
const textStyle = {
|
|
77
|
-
textAlign: "center",
|
|
78
|
-
color: textColor
|
|
79
|
-
};
|
|
80
|
-
const iconStyle = [styles.icon, {
|
|
81
|
-
width: _Config.default.buttonIconSize
|
|
82
|
-
}];
|
|
83
|
-
if (type === "standard" || type === "outline") {
|
|
84
|
-
buttonStyle.width = _Config.default.FABSize;
|
|
85
|
-
buttonStyle.height = _Config.default.FABSize;
|
|
86
|
-
buttonStyle.borderRadius = _Config.default.FABBorderRadius;
|
|
87
|
-
contentStyle.push({
|
|
88
|
-
width: _Config.default.FABSize,
|
|
89
|
-
height: _Config.default.FABSize
|
|
90
|
-
});
|
|
91
|
-
}
|
|
92
|
-
if (type === "extended" || type === "fixed") {
|
|
93
|
-
iconStyle.push({
|
|
94
|
-
marginLeft: 16,
|
|
95
|
-
marginRight: -8
|
|
96
|
-
});
|
|
97
|
-
textStyle.margin = 16;
|
|
98
|
-
}
|
|
99
|
-
if (type === "fixed") {
|
|
100
|
-
buttonStyles.push({
|
|
101
|
-
height: _Config.default.FABFixedHeight,
|
|
102
|
-
alignSelf: "stretch"
|
|
103
|
-
});
|
|
104
|
-
}
|
|
105
|
-
return /*#__PURE__*/React.createElement(_Elevation.default, {
|
|
106
|
-
style: [{
|
|
107
|
-
elevation
|
|
108
|
-
}, style]
|
|
109
|
-
}, /*#__PURE__*/React.createElement(_reactNative.Pressable, _extends({}, rest, {
|
|
110
|
-
onPress: onPress,
|
|
111
|
-
accessibilityState: {
|
|
112
|
-
disabled
|
|
113
|
-
},
|
|
114
|
-
accessibilityRole: "button",
|
|
115
|
-
disabled: disabled || loading,
|
|
116
|
-
style: buttonStyles
|
|
117
|
-
}), /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
118
|
-
style: styles.content
|
|
119
|
-
}, icon && loading !== true ? /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
120
|
-
style: iconStyle
|
|
121
|
-
}, /*#__PURE__*/React.createElement(Icon, {
|
|
122
|
-
name: icon,
|
|
123
|
-
size: _Config.default.buttonIconSize,
|
|
124
|
-
color: textColor
|
|
125
|
-
})) : null, loading ? /*#__PURE__*/React.createElement(_reactNative.ActivityIndicator, {
|
|
126
|
-
size: "small",
|
|
127
|
-
color: textColor,
|
|
128
|
-
style: iconStyle
|
|
129
|
-
}) : null, label ? /*#__PURE__*/React.createElement(_Text.default, {
|
|
130
|
-
numberOfLines: 1,
|
|
131
|
-
style: [textStyle, typography.button]
|
|
132
|
-
}, label) : null)));
|
|
133
|
-
};
|
|
134
|
-
const styles = _reactNative.StyleSheet.create({
|
|
135
|
-
button: {
|
|
136
|
-
borderStyle: "solid"
|
|
137
|
-
},
|
|
138
|
-
content: {
|
|
139
|
-
flexDirection: "row",
|
|
140
|
-
alignItems: "center",
|
|
141
|
-
justifyContent: "center"
|
|
142
|
-
},
|
|
143
|
-
icon: {
|
|
144
|
-
alignItems: "center",
|
|
145
|
-
justifyContent: "center",
|
|
146
|
-
width: _Config.default.buttonIconSize
|
|
147
|
-
},
|
|
148
|
-
fixed: {
|
|
149
|
-
left: 0,
|
|
150
|
-
right: 0,
|
|
151
|
-
bottom: 0,
|
|
152
|
-
height: 64,
|
|
153
|
-
borderRadius: 0
|
|
154
|
-
}
|
|
155
|
-
});
|
|
156
|
-
var _default = (0, _theming.withTheme)(FAB);
|
|
157
|
-
exports.default = _default;
|
|
@@ -1,55 +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 _StepIndicator = _interopRequireDefault(require("./StepIndicator"));
|
|
9
|
-
var _theming = require("../theming");
|
|
10
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
-
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); }
|
|
12
|
-
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; }
|
|
13
|
-
const ProgressIndicator = _ref => {
|
|
14
|
-
let {
|
|
15
|
-
numberOfSteps,
|
|
16
|
-
currentStep,
|
|
17
|
-
currentStepStrokeWidth = 3,
|
|
18
|
-
stepStrokeCurrentColor = "primary",
|
|
19
|
-
stepIndicatorSize,
|
|
20
|
-
currentStepIndicatorSize,
|
|
21
|
-
stepIndicatorCurrentColor,
|
|
22
|
-
stepIndicatorLabelCurrentColor,
|
|
23
|
-
stepIndicatorLabelFontSize = 12,
|
|
24
|
-
stepNumberFinishedColor = "strongInverse",
|
|
25
|
-
stepNumberUnfinishedColor = "primary",
|
|
26
|
-
unfinishedColor = "light",
|
|
27
|
-
finishedColor = "primary",
|
|
28
|
-
theme
|
|
29
|
-
} = _ref;
|
|
30
|
-
const currentPosition = currentStep - 1;
|
|
31
|
-
return /*#__PURE__*/React.createElement(_StepIndicator.default, {
|
|
32
|
-
stepCount: numberOfSteps,
|
|
33
|
-
currentPosition: currentPosition,
|
|
34
|
-
customStyles: {
|
|
35
|
-
stepIndicatorSize,
|
|
36
|
-
currentStepIndicatorSize: currentStepIndicatorSize ? currentStepIndicatorSize : stepIndicatorSize,
|
|
37
|
-
stepStrokeFinishedColor: finishedColor,
|
|
38
|
-
stepStrokeUnFinishedColor: unfinishedColor,
|
|
39
|
-
separatorFinishedColor: finishedColor,
|
|
40
|
-
separatorUnFinishedColor: unfinishedColor,
|
|
41
|
-
stepIndicatorFinishedColor: finishedColor,
|
|
42
|
-
stepIndicatorUnFinishedColor: unfinishedColor,
|
|
43
|
-
currentStepStrokeWidth,
|
|
44
|
-
stepStrokeCurrentColor: stepStrokeCurrentColor || stepIndicatorCurrentColor,
|
|
45
|
-
stepIndicatorLabelUnFinishedColor: stepNumberUnfinishedColor,
|
|
46
|
-
stepIndicatorLabelFinishedColor: stepNumberFinishedColor,
|
|
47
|
-
stepIndicatorCurrentColor: stepIndicatorCurrentColor || unfinishedColor,
|
|
48
|
-
stepIndicatorLabelCurrentColor: stepIndicatorLabelCurrentColor || stepNumberUnfinishedColor,
|
|
49
|
-
stepIndicatorLabelFontSize,
|
|
50
|
-
labelFontFamily: theme.typography.body1.fontFamily
|
|
51
|
-
}
|
|
52
|
-
});
|
|
53
|
-
};
|
|
54
|
-
var _default = (0, _theming.withTheme)(ProgressIndicator);
|
|
55
|
-
exports.default = _default;
|
|
@@ -1,126 +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_PROPS = {
|
|
9
|
-
image: {
|
|
10
|
-
group: _types.GROUPS.data,
|
|
11
|
-
label: "Image",
|
|
12
|
-
description: "Image",
|
|
13
|
-
formType: _types.FORM_TYPES.image,
|
|
14
|
-
propType: _types.PROP_TYPES.ASSET,
|
|
15
|
-
defaultValue: null,
|
|
16
|
-
editable: true,
|
|
17
|
-
required: false
|
|
18
|
-
},
|
|
19
|
-
title: {
|
|
20
|
-
group: _types.GROUPS.data,
|
|
21
|
-
label: "Title",
|
|
22
|
-
description: "Text to display",
|
|
23
|
-
formType: _types.FORM_TYPES.string,
|
|
24
|
-
propType: _types.PROP_TYPES.STRING,
|
|
25
|
-
defaultValue: "Beautiful West Coast Villa",
|
|
26
|
-
editable: true,
|
|
27
|
-
required: false
|
|
28
|
-
},
|
|
29
|
-
leftDescription: {
|
|
30
|
-
group: _types.GROUPS.data,
|
|
31
|
-
label: "Left description",
|
|
32
|
-
description: "Text to display on the left",
|
|
33
|
-
formType: _types.FORM_TYPES.string,
|
|
34
|
-
propType: _types.PROP_TYPES.STRING,
|
|
35
|
-
defaultValue: "San Diego",
|
|
36
|
-
editable: true,
|
|
37
|
-
required: false
|
|
38
|
-
},
|
|
39
|
-
rightDescription: {
|
|
40
|
-
group: _types.GROUPS.data,
|
|
41
|
-
label: "Right description",
|
|
42
|
-
description: "Text to display on the right",
|
|
43
|
-
formType: _types.FORM_TYPES.string,
|
|
44
|
-
propType: _types.PROP_TYPES.STRING,
|
|
45
|
-
defaultValue: "$100",
|
|
46
|
-
editable: true,
|
|
47
|
-
required: false
|
|
48
|
-
},
|
|
49
|
-
aspectRatio: {
|
|
50
|
-
group: _types.GROUPS.basic,
|
|
51
|
-
label: "Aspect ratio",
|
|
52
|
-
description: "Aspect ratio of the image",
|
|
53
|
-
formType: _types.FORM_TYPES.aspectRatio,
|
|
54
|
-
propType: _types.PROP_TYPES.NUMBER,
|
|
55
|
-
defaultValue: 1.5,
|
|
56
|
-
editable: true,
|
|
57
|
-
required: false
|
|
58
|
-
},
|
|
59
|
-
titleCentered: {
|
|
60
|
-
group: _types.GROUPS.basic,
|
|
61
|
-
label: "Title centered",
|
|
62
|
-
description: "Whether to center the title",
|
|
63
|
-
formType: _types.FORM_TYPES.boolean,
|
|
64
|
-
propType: _types.PROP_TYPES.BOOLEAN,
|
|
65
|
-
defaultValue: false,
|
|
66
|
-
editable: true,
|
|
67
|
-
required: false
|
|
68
|
-
},
|
|
69
|
-
elevation: (0, _types.createElevationType)(2)
|
|
70
|
-
};
|
|
71
|
-
const SEED_DATA = [{
|
|
72
|
-
name: "Small Card",
|
|
73
|
-
tag: "CardBlock",
|
|
74
|
-
description: "An elevated card with a title and description, that takes up one third of its container.",
|
|
75
|
-
category: _types.COMPONENT_TYPES.card,
|
|
76
|
-
props: {
|
|
77
|
-
...SEED_DATA_PROPS,
|
|
78
|
-
numColumns: (0, _types.createNumColumnsType)({
|
|
79
|
-
defaultValue: 1
|
|
80
|
-
})
|
|
81
|
-
}
|
|
82
|
-
}, {
|
|
83
|
-
name: "Medium Block Card",
|
|
84
|
-
tag: "CardBlock",
|
|
85
|
-
description: "An elevated card with a title and description, that takes up one half of its container.",
|
|
86
|
-
category: _types.COMPONENT_TYPES.card,
|
|
87
|
-
props: {
|
|
88
|
-
...SEED_DATA_PROPS,
|
|
89
|
-
icon: {
|
|
90
|
-
group: _types.GROUPS.basic,
|
|
91
|
-
label: "Icon",
|
|
92
|
-
description: "Icon to display on the top right",
|
|
93
|
-
formType: _types.FORM_TYPES.icon,
|
|
94
|
-
propType: _types.PROP_TYPES.STRING,
|
|
95
|
-
defaultValue: null,
|
|
96
|
-
editable: true,
|
|
97
|
-
required: true
|
|
98
|
-
},
|
|
99
|
-
numColumns: (0, _types.createNumColumnsType)({
|
|
100
|
-
defaultValue: 2
|
|
101
|
-
})
|
|
102
|
-
}
|
|
103
|
-
}, {
|
|
104
|
-
name: "Large Block Card",
|
|
105
|
-
tag: "CardBlock",
|
|
106
|
-
description: "An elevated card with a title and description, that takes up the full width its container.",
|
|
107
|
-
category: _types.COMPONENT_TYPES.card,
|
|
108
|
-
stylesPanelSections: _types.BLOCK_STYLES_SECTIONS,
|
|
109
|
-
props: {
|
|
110
|
-
...SEED_DATA_PROPS,
|
|
111
|
-
icon: {
|
|
112
|
-
group: _types.GROUPS.basic,
|
|
113
|
-
label: "Icon",
|
|
114
|
-
description: "Icon to display on the top right",
|
|
115
|
-
formType: _types.FORM_TYPES.icon,
|
|
116
|
-
propType: _types.PROP_TYPES.STRING,
|
|
117
|
-
defaultValue: null,
|
|
118
|
-
editable: true,
|
|
119
|
-
required: true
|
|
120
|
-
},
|
|
121
|
-
numColumns: (0, _types.createNumColumnsType)({
|
|
122
|
-
defaultValue: 3
|
|
123
|
-
})
|
|
124
|
-
}
|
|
125
|
-
}];
|
|
126
|
-
exports.SEED_DATA = SEED_DATA;
|
|
@@ -1,108 +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_PROPS = {
|
|
9
|
-
image: {
|
|
10
|
-
label: "Image",
|
|
11
|
-
description: "Image",
|
|
12
|
-
formType: _types.FORM_TYPES.image,
|
|
13
|
-
propType: _types.PROP_TYPES.ASSET,
|
|
14
|
-
defaultValue: null,
|
|
15
|
-
editable: true,
|
|
16
|
-
required: true,
|
|
17
|
-
group: _types.GROUPS.data
|
|
18
|
-
},
|
|
19
|
-
title: {
|
|
20
|
-
label: "Title",
|
|
21
|
-
description: "Text to display",
|
|
22
|
-
formType: _types.FORM_TYPES.string,
|
|
23
|
-
propType: _types.PROP_TYPES.STRING,
|
|
24
|
-
defaultValue: "Beautiful West Coast Villa",
|
|
25
|
-
editable: true,
|
|
26
|
-
required: false,
|
|
27
|
-
group: _types.GROUPS.data
|
|
28
|
-
},
|
|
29
|
-
leftDescription: {
|
|
30
|
-
label: "Left description",
|
|
31
|
-
description: "Text to display on the left",
|
|
32
|
-
formType: _types.FORM_TYPES.string,
|
|
33
|
-
propType: _types.PROP_TYPES.STRING,
|
|
34
|
-
defaultValue: "San Diego",
|
|
35
|
-
editable: true,
|
|
36
|
-
required: false,
|
|
37
|
-
group: _types.GROUPS.data
|
|
38
|
-
},
|
|
39
|
-
rightDescription: {
|
|
40
|
-
label: "Right description",
|
|
41
|
-
description: "Text to display on the right",
|
|
42
|
-
formType: _types.FORM_TYPES.string,
|
|
43
|
-
propType: _types.PROP_TYPES.STRING,
|
|
44
|
-
defaultValue: "$100",
|
|
45
|
-
editable: true,
|
|
46
|
-
required: false,
|
|
47
|
-
group: _types.GROUPS.data
|
|
48
|
-
},
|
|
49
|
-
icon: {
|
|
50
|
-
label: "Icon",
|
|
51
|
-
description: "Icon to display on the top right",
|
|
52
|
-
formType: _types.FORM_TYPES.icon,
|
|
53
|
-
propType: _types.PROP_TYPES.STRING /* OR ASSET TODO TEST ME */,
|
|
54
|
-
defaultValue: null,
|
|
55
|
-
editable: true,
|
|
56
|
-
required: false,
|
|
57
|
-
group: _types.GROUPS.basic
|
|
58
|
-
},
|
|
59
|
-
aspectRatio: {
|
|
60
|
-
label: "Aspect ratio",
|
|
61
|
-
description: "Aspect ratio of the image",
|
|
62
|
-
formType: _types.FORM_TYPES.aspectRatio,
|
|
63
|
-
propType: _types.PROP_TYPES.NUMBER,
|
|
64
|
-
defaultValue: 1.5,
|
|
65
|
-
editable: true,
|
|
66
|
-
required: false,
|
|
67
|
-
group: _types.GROUPS.basic
|
|
68
|
-
},
|
|
69
|
-
textCentered: {
|
|
70
|
-
label: "Centered Text",
|
|
71
|
-
description: "Whether to center the text",
|
|
72
|
-
formType: _types.FORM_TYPES.boolean,
|
|
73
|
-
propType: _types.PROP_TYPES.BOOLEAN,
|
|
74
|
-
defaultValue: false,
|
|
75
|
-
editable: true,
|
|
76
|
-
required: false,
|
|
77
|
-
group: _types.GROUPS.basic
|
|
78
|
-
},
|
|
79
|
-
elevation: (0, _types.createElevationType)(2)
|
|
80
|
-
};
|
|
81
|
-
const SEED_DATA = [{
|
|
82
|
-
name: "Medium Card",
|
|
83
|
-
tag: "CardContainer",
|
|
84
|
-
description: "An elevated card with a title and description, that takes up half of its container.",
|
|
85
|
-
category: _types.COMPONENT_TYPES.card,
|
|
86
|
-
stylesPanelSections: _types.BLOCK_STYLES_SECTIONS,
|
|
87
|
-
layout: null,
|
|
88
|
-
props: {
|
|
89
|
-
...SEED_DATA_PROPS,
|
|
90
|
-
numColumns: (0, _types.createNumColumnsType)({
|
|
91
|
-
defaultValue: 2
|
|
92
|
-
})
|
|
93
|
-
}
|
|
94
|
-
}, {
|
|
95
|
-
name: "Large Card",
|
|
96
|
-
tag: "CardContainer",
|
|
97
|
-
description: "An elevated card with a title and description, that takes up its full container.",
|
|
98
|
-
category: _types.COMPONENT_TYPES.card,
|
|
99
|
-
stylesPanelSections: _types.BLOCK_STYLES_SECTIONS,
|
|
100
|
-
layout: null,
|
|
101
|
-
props: {
|
|
102
|
-
...SEED_DATA_PROPS,
|
|
103
|
-
numColumns: (0, _types.createNumColumnsType)({
|
|
104
|
-
defaultValue: 3
|
|
105
|
-
})
|
|
106
|
-
}
|
|
107
|
-
}];
|
|
108
|
-
exports.SEED_DATA = SEED_DATA;
|