@draftbit/core 46.10.3-a0279d.2 → 46.10.3-af3058.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 +5 -23
- package/lib/commonjs/components/Checkbox/context.js +1 -1
- package/package.json +3 -3
- 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/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/ProgressIndicator.js +0 -181
- package/lib/typescript/src/components/DeprecatedCardWrapper.d.ts +0 -15
- 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/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/ProgressIndicator.js +0 -181
- package/src/mappings/ProgressIndicator.ts +0 -190
|
@@ -13,7 +13,8 @@ var _utilities = require("../../utilities");
|
|
|
13
13
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
14
14
|
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); }
|
|
15
15
|
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; }
|
|
16
|
-
var
|
|
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
|
+
let Direction;
|
|
17
18
|
exports.Direction = Direction;
|
|
18
19
|
(function (Direction) {
|
|
19
20
|
Direction["Row"] = "row";
|
|
@@ -71,14 +72,13 @@ const CheckboxGroupRow = _ref => {
|
|
|
71
72
|
textStyles,
|
|
72
73
|
viewStyles
|
|
73
74
|
} = (0, _utilities.extractStyles)(style);
|
|
74
|
-
return /*#__PURE__*/React.createElement(_reactNative.Pressable, {
|
|
75
|
+
return /*#__PURE__*/React.createElement(_reactNative.Pressable, _extends({
|
|
75
76
|
onPress: handlePress,
|
|
76
77
|
style: [styles.mainParent, {
|
|
77
78
|
flexDirection: direction
|
|
78
79
|
}, viewStyles],
|
|
79
|
-
disabled: disabled
|
|
80
|
-
|
|
81
|
-
}, /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
80
|
+
disabled: disabled
|
|
81
|
+
}, rest), /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
82
82
|
style: [styles.label, {
|
|
83
83
|
alignItems: direction === Direction.Row ? "flex-start" : "flex-end"
|
|
84
84
|
}, labelContainerStyle]
|
|
@@ -117,22 +117,4 @@ const styles = _reactNative.StyleSheet.create({
|
|
|
117
117
|
}
|
|
118
118
|
});
|
|
119
119
|
var _default = CheckboxGroupRow;
|
|
120
|
-
exports.default = _default;center",
|
|
121
|
-
justifyContent: "space-around",
|
|
122
|
-
paddingStart: 20,
|
|
123
|
-
minHeight: 50,
|
|
124
|
-
paddingEnd: 20,
|
|
125
|
-
display: "flex",
|
|
126
|
-
..._reactNative.Platform.select({
|
|
127
|
-
web: {
|
|
128
|
-
cursor: "pointer",
|
|
129
|
-
userSelect: "none"
|
|
130
|
-
}
|
|
131
|
-
})
|
|
132
|
-
},
|
|
133
|
-
label: {
|
|
134
|
-
flex: 3
|
|
135
|
-
}
|
|
136
|
-
});
|
|
137
|
-
var _default = CheckboxGroupRow;
|
|
138
120
|
exports.default = _default;
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.checkboxGroupContext = exports.Direction = void 0;
|
|
7
7
|
exports.useCheckboxGroupContext = useCheckboxGroupContext;
|
|
8
8
|
var _react = require("react");
|
|
9
|
-
|
|
9
|
+
var Direction;
|
|
10
10
|
exports.Direction = Direction;
|
|
11
11
|
(function (Direction) {
|
|
12
12
|
Direction["Horizontal"] = "horizontal";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@draftbit/core",
|
|
3
|
-
"version": "46.10.3-
|
|
3
|
+
"version": "46.10.3-af3058.2+af30586",
|
|
4
4
|
"description": "Core (non-native) Components",
|
|
5
5
|
"main": "lib/commonjs/index.js",
|
|
6
6
|
"module": "lib/module/index.js",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"@date-io/date-fns": "^1.3.13",
|
|
43
43
|
"@draftbit/react-theme-provider": "^2.1.1",
|
|
44
|
-
"@draftbit/types": "^46.10.3-
|
|
44
|
+
"@draftbit/types": "^46.10.3-af3058.2+af30586",
|
|
45
45
|
"@material-ui/core": "^4.11.0",
|
|
46
46
|
"@material-ui/pickers": "^3.2.10",
|
|
47
47
|
"@react-native-community/slider": "4.2.3",
|
|
@@ -100,5 +100,5 @@
|
|
|
100
100
|
]
|
|
101
101
|
]
|
|
102
102
|
},
|
|
103
|
-
"gitHead": "
|
|
103
|
+
"gitHead": "af3058667ace3cf9022580d5ef9505ede253b8df"
|
|
104
104
|
}
|
|
@@ -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,188 +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: "Progress Indicator",
|
|
10
|
-
tag: "ProgressIndicator",
|
|
11
|
-
description: "A component used to show current Step in a process",
|
|
12
|
-
category: _types.COMPONENT_TYPES.deprecated,
|
|
13
|
-
stylesPanelSections: _types.BLOCK_STYLES_SECTIONS,
|
|
14
|
-
preview_image_url: "{CLOUDINARY_URL}/Control_Slider.png",
|
|
15
|
-
supports_list_render: false,
|
|
16
|
-
layout: {},
|
|
17
|
-
props: {
|
|
18
|
-
numberOfSteps: {
|
|
19
|
-
group: _types.GROUPS.data,
|
|
20
|
-
label: "Number of Steps",
|
|
21
|
-
description: "The border radius for the thumb",
|
|
22
|
-
editable: true,
|
|
23
|
-
required: false,
|
|
24
|
-
formType: _types.FORM_TYPES.number,
|
|
25
|
-
propType: _types.PROP_TYPES.NUMBER,
|
|
26
|
-
min: 0,
|
|
27
|
-
max: 10,
|
|
28
|
-
step: 1,
|
|
29
|
-
precision: 0,
|
|
30
|
-
defaultValue: 5
|
|
31
|
-
},
|
|
32
|
-
currentStep: {
|
|
33
|
-
group: _types.GROUPS.data,
|
|
34
|
-
label: "Current Step",
|
|
35
|
-
description: "The step that the user is on",
|
|
36
|
-
editable: true,
|
|
37
|
-
required: false,
|
|
38
|
-
formType: _types.FORM_TYPES.number,
|
|
39
|
-
propType: _types.PROP_TYPES.NUMBER,
|
|
40
|
-
min: 0,
|
|
41
|
-
max: 10,
|
|
42
|
-
step: 1,
|
|
43
|
-
precision: 0,
|
|
44
|
-
defaultValue: 5
|
|
45
|
-
},
|
|
46
|
-
stepIndicatorSize: {
|
|
47
|
-
group: _types.GROUPS.basic,
|
|
48
|
-
label: "Step Size",
|
|
49
|
-
description: "The size of the step circle",
|
|
50
|
-
editable: true,
|
|
51
|
-
required: false,
|
|
52
|
-
formType: _types.FORM_TYPES.number,
|
|
53
|
-
propType: _types.PROP_TYPES.NUMBER,
|
|
54
|
-
min: 10,
|
|
55
|
-
max: 100,
|
|
56
|
-
step: 5,
|
|
57
|
-
precision: 0,
|
|
58
|
-
defaultValue: 25
|
|
59
|
-
},
|
|
60
|
-
stepIndicatorLabelFontSize: {
|
|
61
|
-
group: _types.GROUPS.basic,
|
|
62
|
-
label: "Step Font Size",
|
|
63
|
-
description: "The font size of the step number",
|
|
64
|
-
editable: true,
|
|
65
|
-
required: false,
|
|
66
|
-
formType: _types.FORM_TYPES.number,
|
|
67
|
-
propType: _types.PROP_TYPES.NUMBER,
|
|
68
|
-
min: 6,
|
|
69
|
-
max: 36,
|
|
70
|
-
step: 1,
|
|
71
|
-
precision: 0,
|
|
72
|
-
defaultValue: 15
|
|
73
|
-
},
|
|
74
|
-
currentStepIndicatorLabelFontSize: {
|
|
75
|
-
group: _types.GROUPS.basic,
|
|
76
|
-
label: "Current Step Font Size",
|
|
77
|
-
description: "The font size of the current step number",
|
|
78
|
-
editable: true,
|
|
79
|
-
required: false,
|
|
80
|
-
formType: _types.FORM_TYPES.number,
|
|
81
|
-
propType: _types.PROP_TYPES.NUMBER,
|
|
82
|
-
min: 6,
|
|
83
|
-
max: 36,
|
|
84
|
-
step: 1,
|
|
85
|
-
precision: 0,
|
|
86
|
-
defaultValue: 15
|
|
87
|
-
},
|
|
88
|
-
unfinishedColor: {
|
|
89
|
-
group: _types.GROUPS.basic,
|
|
90
|
-
label: "Unfinished Color",
|
|
91
|
-
description: "The color of the step and divider when the step is either not the current step or not finished",
|
|
92
|
-
editable: true,
|
|
93
|
-
required: false,
|
|
94
|
-
formType: _types.FORM_TYPES.color,
|
|
95
|
-
propType: _types.PROP_TYPES.THEME,
|
|
96
|
-
defaultValue: null
|
|
97
|
-
},
|
|
98
|
-
finishedColor: {
|
|
99
|
-
group: _types.GROUPS.basic,
|
|
100
|
-
label: "Finished Color",
|
|
101
|
-
description: "The color of the step and divider when the step is the current step or finished",
|
|
102
|
-
editable: true,
|
|
103
|
-
required: false,
|
|
104
|
-
formType: _types.FORM_TYPES.color,
|
|
105
|
-
propType: _types.PROP_TYPES.THEME,
|
|
106
|
-
defaultValue: null
|
|
107
|
-
},
|
|
108
|
-
stepNumberUnfinishedColor: {
|
|
109
|
-
group: _types.GROUPS.basic,
|
|
110
|
-
label: "Unfinished Number Color",
|
|
111
|
-
description: "The color of the number within the step when unfinished",
|
|
112
|
-
editable: true,
|
|
113
|
-
required: false,
|
|
114
|
-
formType: _types.FORM_TYPES.color,
|
|
115
|
-
propType: _types.PROP_TYPES.THEME,
|
|
116
|
-
defaultValue: null
|
|
117
|
-
},
|
|
118
|
-
stepNumberFinishedColor: {
|
|
119
|
-
group: _types.GROUPS.basic,
|
|
120
|
-
label: "Finished Number Color",
|
|
121
|
-
description: "The color of the number within the step when finished",
|
|
122
|
-
editable: true,
|
|
123
|
-
required: false,
|
|
124
|
-
formType: _types.FORM_TYPES.color,
|
|
125
|
-
propType: _types.PROP_TYPES.THEME,
|
|
126
|
-
defaultValue: null
|
|
127
|
-
},
|
|
128
|
-
stepIndicatorCurrentColor: {
|
|
129
|
-
group: _types.GROUPS.basic,
|
|
130
|
-
label: "Current Step Color",
|
|
131
|
-
description: "The color of current step circle",
|
|
132
|
-
editable: true,
|
|
133
|
-
required: false,
|
|
134
|
-
formType: _types.FORM_TYPES.color,
|
|
135
|
-
propType: _types.PROP_TYPES.THEME,
|
|
136
|
-
defaultValue: null
|
|
137
|
-
},
|
|
138
|
-
stepIndicatorLabelCurrentColor: {
|
|
139
|
-
group: _types.GROUPS.basic,
|
|
140
|
-
label: "Current Step Number Color",
|
|
141
|
-
description: "The color of current number within the step circle",
|
|
142
|
-
editable: true,
|
|
143
|
-
required: false,
|
|
144
|
-
formType: _types.FORM_TYPES.color,
|
|
145
|
-
propType: _types.PROP_TYPES.THEME,
|
|
146
|
-
defaultValue: null
|
|
147
|
-
},
|
|
148
|
-
stepStrokeCurrentColor: {
|
|
149
|
-
group: _types.GROUPS.basic,
|
|
150
|
-
label: "Current Step Border Color",
|
|
151
|
-
description: "The color of current border color of the step",
|
|
152
|
-
editable: true,
|
|
153
|
-
required: false,
|
|
154
|
-
formType: _types.FORM_TYPES.color,
|
|
155
|
-
propType: _types.PROP_TYPES.THEME,
|
|
156
|
-
defaultValue: null
|
|
157
|
-
},
|
|
158
|
-
currentStepStrokeWidth: {
|
|
159
|
-
group: _types.GROUPS.basic,
|
|
160
|
-
label: "Current Step Border Width",
|
|
161
|
-
description: "The width of the border for the current step",
|
|
162
|
-
editable: true,
|
|
163
|
-
required: false,
|
|
164
|
-
formType: _types.FORM_TYPES.number,
|
|
165
|
-
propType: _types.PROP_TYPES.NUMBER,
|
|
166
|
-
min: 1,
|
|
167
|
-
max: 20,
|
|
168
|
-
step: 1,
|
|
169
|
-
precision: 0,
|
|
170
|
-
defaultValue: 0
|
|
171
|
-
},
|
|
172
|
-
currentStepIndicatorSize: {
|
|
173
|
-
group: _types.GROUPS.basic,
|
|
174
|
-
label: "Current Step Size",
|
|
175
|
-
description: "The size of the current step circle",
|
|
176
|
-
editable: true,
|
|
177
|
-
required: false,
|
|
178
|
-
formType: _types.FORM_TYPES.number,
|
|
179
|
-
propType: _types.PROP_TYPES.NUMBER,
|
|
180
|
-
min: 10,
|
|
181
|
-
max: 100,
|
|
182
|
-
step: 5,
|
|
183
|
-
precision: 0,
|
|
184
|
-
defaultValue: null
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
};
|
|
188
|
-
exports.SEED_DATA = SEED_DATA;
|
|
@@ -1,32 +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 React from "react";
|
|
3
|
-
import { withTheme } from "../theming";
|
|
4
|
-
import Touchable from "./Touchable";
|
|
5
|
-
const getWidth = numColumns => {
|
|
6
|
-
switch (numColumns) {
|
|
7
|
-
case 1:
|
|
8
|
-
return "33%";
|
|
9
|
-
case 2:
|
|
10
|
-
return "50%";
|
|
11
|
-
default:
|
|
12
|
-
return "100%";
|
|
13
|
-
}
|
|
14
|
-
};
|
|
15
|
-
const Card = _ref => {
|
|
16
|
-
let {
|
|
17
|
-
numColumns = 3,
|
|
18
|
-
children,
|
|
19
|
-
onPress,
|
|
20
|
-
style,
|
|
21
|
-
...rest
|
|
22
|
-
} = _ref;
|
|
23
|
-
const width = getWidth(numColumns);
|
|
24
|
-
return /*#__PURE__*/React.createElement(Touchable, _extends({
|
|
25
|
-
disabled: !onPress,
|
|
26
|
-
onPress: onPress,
|
|
27
|
-
style: [style, {
|
|
28
|
-
width
|
|
29
|
-
}]
|
|
30
|
-
}, rest), children);
|
|
31
|
-
};
|
|
32
|
-
export default withTheme(Card);
|