@draftbit/core 46.8.1-2f0fda.2 → 46.8.1-51e99b.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/Accordion/AccordionItem.js +23 -4
- package/lib/commonjs/components/Picker/Picker.js +8 -9
- package/lib/commonjs/components/ScreenContainer.js +2 -1
- package/lib/commonjs/index.js +0 -7
- package/lib/module/components/Picker/Picker.js +8 -9
- package/lib/module/components/ScreenContainer.js +2 -1
- package/lib/module/index.js +0 -1
- package/lib/typescript/src/components/Picker/Picker.d.ts.map +1 -1
- package/lib/typescript/src/components/ScreenContainer.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +0 -1
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/package.json +3 -4
- package/src/components/Picker/Picker.js +7 -8
- package/src/components/Picker/Picker.tsx +7 -9
- package/src/components/ScreenContainer.js +2 -1
- package/src/components/ScreenContainer.tsx +2 -1
- package/src/index.js +0 -1
- package/src/index.tsx +0 -2
- package/lib/commonjs/components/Shadow.js +0 -42
- package/lib/commonjs/mappings/Shadow.js +0 -94
- package/lib/module/components/Shadow.js +0 -34
- package/lib/module/mappings/Shadow.js +0 -87
- package/lib/typescript/src/components/Shadow.d.ts +0 -24
- package/lib/typescript/src/components/Shadow.d.ts.map +0 -1
- package/lib/typescript/src/mappings/Shadow.d.ts +0 -173
- package/lib/typescript/src/mappings/Shadow.d.ts.map +0 -1
- package/src/components/Shadow.js +0 -16
- package/src/components/Shadow.tsx +0 -58
- package/src/mappings/Shadow.js +0 -87
- package/src/mappings/Shadow.ts +0 -95
|
@@ -12,7 +12,6 @@ var _theming = require("../../theming");
|
|
|
12
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
13
|
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); }
|
|
14
14
|
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; }
|
|
15
|
-
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); }
|
|
16
15
|
const AccordionItem = _ref => {
|
|
17
16
|
let {
|
|
18
17
|
Icon,
|
|
@@ -27,9 +26,10 @@ const AccordionItem = _ref => {
|
|
|
27
26
|
textStyles,
|
|
28
27
|
viewStyles
|
|
29
28
|
} = (0, _utilities.extractStyles)(style);
|
|
30
|
-
return /*#__PURE__*/React.createElement(_reactNative.Pressable,
|
|
31
|
-
style: [styles.container, viewStyles]
|
|
32
|
-
|
|
29
|
+
return /*#__PURE__*/React.createElement(_reactNative.Pressable, {
|
|
30
|
+
style: [styles.container, viewStyles],
|
|
31
|
+
...rest
|
|
32
|
+
}, /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
33
33
|
style: styles.row
|
|
34
34
|
}, icon ? /*#__PURE__*/React.createElement(Icon, {
|
|
35
35
|
name: icon,
|
|
@@ -61,4 +61,23 @@ const styles = _reactNative.StyleSheet.create({
|
|
|
61
61
|
}
|
|
62
62
|
});
|
|
63
63
|
var _default = (0, _theming.withTheme)(AccordionItem);
|
|
64
|
+
exports.default = _default;.StyleSheet.create({
|
|
65
|
+
container: {
|
|
66
|
+
padding: 8
|
|
67
|
+
},
|
|
68
|
+
row: {
|
|
69
|
+
flexDirection: "row",
|
|
70
|
+
alignItems: "center",
|
|
71
|
+
paddingLeft: 8
|
|
72
|
+
},
|
|
73
|
+
item: {
|
|
74
|
+
marginVertical: 6,
|
|
75
|
+
paddingLeft: 8
|
|
76
|
+
},
|
|
77
|
+
content: {
|
|
78
|
+
flex: 1,
|
|
79
|
+
justifyContent: "center"
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
var _default = (0, _theming.withTheme)(AccordionItem);
|
|
64
83
|
exports.default = _default;
|
|
@@ -46,6 +46,9 @@ const isWeb = _reactNative.Platform.OS === "web";
|
|
|
46
46
|
const unstyledColor = "rgba(165, 173, 183, 1)";
|
|
47
47
|
const disabledColor = "rgb(240, 240, 240)";
|
|
48
48
|
const errorColor = "rgba(255, 69, 100, 1)";
|
|
49
|
+
|
|
50
|
+
//Empty string for 'value' is treated as a non-value
|
|
51
|
+
//reason: Draftbit uses empty string as initial value for string state*/
|
|
49
52
|
const Picker = _ref => {
|
|
50
53
|
var _find$label, _find;
|
|
51
54
|
let {
|
|
@@ -76,12 +79,12 @@ const Picker = _ref => {
|
|
|
76
79
|
setPickerVisible(!pickerVisible);
|
|
77
80
|
};
|
|
78
81
|
React.useEffect(() => {
|
|
79
|
-
if (value != null) {
|
|
82
|
+
if (value != null && value !== "") {
|
|
80
83
|
setInternalValue(value);
|
|
81
84
|
}
|
|
82
85
|
}, [value]);
|
|
83
86
|
React.useEffect(() => {
|
|
84
|
-
if (defaultValue != null) {
|
|
87
|
+
if (defaultValue != null && defaultValue !== "") {
|
|
85
88
|
setInternalValue(defaultValue);
|
|
86
89
|
}
|
|
87
90
|
}, [defaultValue]);
|
|
@@ -96,11 +99,7 @@ const Picker = _ref => {
|
|
|
96
99
|
_reactNative.Keyboard.dismiss();
|
|
97
100
|
}
|
|
98
101
|
}, [pickerVisible, autoDismissKeyboard]);
|
|
99
|
-
const
|
|
100
|
-
const pickerOptions = placeholder ? [{
|
|
101
|
-
value: placeholder,
|
|
102
|
-
label: placeholder
|
|
103
|
-
}, ...normalizedOptions] : normalizedOptions;
|
|
102
|
+
const pickerOptions = normalizeOptions(options);
|
|
104
103
|
const {
|
|
105
104
|
viewStyles,
|
|
106
105
|
textStyles
|
|
@@ -200,10 +199,10 @@ const Picker = _ref => {
|
|
|
200
199
|
} : {})
|
|
201
200
|
};
|
|
202
201
|
const handleValueChange = (newValue, itemIndex) => {
|
|
203
|
-
if (
|
|
202
|
+
if (newValue !== "") {
|
|
204
203
|
onValueChange === null || onValueChange === void 0 ? void 0 : onValueChange(newValue, itemIndex);
|
|
204
|
+
setInternalValue(newValue);
|
|
205
205
|
}
|
|
206
|
-
setInternalValue(newValue);
|
|
207
206
|
};
|
|
208
207
|
return (
|
|
209
208
|
/*#__PURE__*/
|
|
@@ -12,6 +12,7 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
12
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
13
|
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); }
|
|
14
14
|
function ScreenContainer(_ref) {
|
|
15
|
+
var _StyleSheet$flatten;
|
|
15
16
|
let {
|
|
16
17
|
scrollable = false,
|
|
17
18
|
hasSafeArea = false,
|
|
@@ -22,7 +23,7 @@ function ScreenContainer(_ref) {
|
|
|
22
23
|
children,
|
|
23
24
|
...rest
|
|
24
25
|
} = _ref;
|
|
25
|
-
const backgroundColor = theme.colors.background;
|
|
26
|
+
const backgroundColor = ((_StyleSheet$flatten = _reactNative.StyleSheet.flatten(style)) === null || _StyleSheet$flatten === void 0 ? void 0 : _StyleSheet$flatten.backgroundColor) || theme.colors.background;
|
|
26
27
|
const edges = ["left", "right"];
|
|
27
28
|
if (hasSafeArea || hasTopSafeArea) {
|
|
28
29
|
edges.push("top");
|
package/lib/commonjs/index.js
CHANGED
|
@@ -273,12 +273,6 @@ Object.defineProperty(exports, "ScreenContainer", {
|
|
|
273
273
|
return _ScreenContainer.default;
|
|
274
274
|
}
|
|
275
275
|
});
|
|
276
|
-
Object.defineProperty(exports, "Shadow", {
|
|
277
|
-
enumerable: true,
|
|
278
|
-
get: function () {
|
|
279
|
-
return _Shadow.default;
|
|
280
|
-
}
|
|
281
|
-
});
|
|
282
276
|
Object.defineProperty(exports, "Slider", {
|
|
283
277
|
enumerable: true,
|
|
284
278
|
get: function () {
|
|
@@ -419,7 +413,6 @@ var _ActionSheet = require("./components/ActionSheet");
|
|
|
419
413
|
var _Swiper = require("./components/Swiper");
|
|
420
414
|
var _Layout = require("./components/Layout");
|
|
421
415
|
var _index = require("./components/RadioButton/index");
|
|
422
|
-
var _Shadow = _interopRequireDefault(require("./components/Shadow"));
|
|
423
416
|
var _DeckSwiper = require("./components/DeckSwiper");
|
|
424
417
|
var _DatePicker = _interopRequireDefault(require("./components/DatePicker/DatePicker"));
|
|
425
418
|
var _Picker = _interopRequireDefault(require("./components/Picker/Picker"));
|
|
@@ -37,6 +37,9 @@ const isWeb = Platform.OS === "web";
|
|
|
37
37
|
const unstyledColor = "rgba(165, 173, 183, 1)";
|
|
38
38
|
const disabledColor = "rgb(240, 240, 240)";
|
|
39
39
|
const errorColor = "rgba(255, 69, 100, 1)";
|
|
40
|
+
|
|
41
|
+
//Empty string for 'value' is treated as a non-value
|
|
42
|
+
//reason: Draftbit uses empty string as initial value for string state*/
|
|
40
43
|
const Picker = _ref => {
|
|
41
44
|
var _find$label, _find;
|
|
42
45
|
let {
|
|
@@ -67,12 +70,12 @@ const Picker = _ref => {
|
|
|
67
70
|
setPickerVisible(!pickerVisible);
|
|
68
71
|
};
|
|
69
72
|
React.useEffect(() => {
|
|
70
|
-
if (value != null) {
|
|
73
|
+
if (value != null && value !== "") {
|
|
71
74
|
setInternalValue(value);
|
|
72
75
|
}
|
|
73
76
|
}, [value]);
|
|
74
77
|
React.useEffect(() => {
|
|
75
|
-
if (defaultValue != null) {
|
|
78
|
+
if (defaultValue != null && defaultValue !== "") {
|
|
76
79
|
setInternalValue(defaultValue);
|
|
77
80
|
}
|
|
78
81
|
}, [defaultValue]);
|
|
@@ -87,11 +90,7 @@ const Picker = _ref => {
|
|
|
87
90
|
Keyboard.dismiss();
|
|
88
91
|
}
|
|
89
92
|
}, [pickerVisible, autoDismissKeyboard]);
|
|
90
|
-
const
|
|
91
|
-
const pickerOptions = placeholder ? [{
|
|
92
|
-
value: placeholder,
|
|
93
|
-
label: placeholder
|
|
94
|
-
}, ...normalizedOptions] : normalizedOptions;
|
|
93
|
+
const pickerOptions = normalizeOptions(options);
|
|
95
94
|
const {
|
|
96
95
|
viewStyles,
|
|
97
96
|
textStyles
|
|
@@ -191,10 +190,10 @@ const Picker = _ref => {
|
|
|
191
190
|
} : {})
|
|
192
191
|
};
|
|
193
192
|
const handleValueChange = (newValue, itemIndex) => {
|
|
194
|
-
if (
|
|
193
|
+
if (newValue !== "") {
|
|
195
194
|
onValueChange === null || onValueChange === void 0 ? void 0 : onValueChange(newValue, itemIndex);
|
|
195
|
+
setInternalValue(newValue);
|
|
196
196
|
}
|
|
197
|
-
setInternalValue(newValue);
|
|
198
197
|
};
|
|
199
198
|
return (
|
|
200
199
|
/*#__PURE__*/
|
|
@@ -4,6 +4,7 @@ import { StyleSheet, ScrollView, View } from "react-native";
|
|
|
4
4
|
import { SafeAreaView } from "react-native-safe-area-context";
|
|
5
5
|
import { withTheme } from "../theming";
|
|
6
6
|
function ScreenContainer(_ref) {
|
|
7
|
+
var _StyleSheet$flatten;
|
|
7
8
|
let {
|
|
8
9
|
scrollable = false,
|
|
9
10
|
hasSafeArea = false,
|
|
@@ -14,7 +15,7 @@ function ScreenContainer(_ref) {
|
|
|
14
15
|
children,
|
|
15
16
|
...rest
|
|
16
17
|
} = _ref;
|
|
17
|
-
const backgroundColor = theme.colors.background;
|
|
18
|
+
const backgroundColor = ((_StyleSheet$flatten = StyleSheet.flatten(style)) === null || _StyleSheet$flatten === void 0 ? void 0 : _StyleSheet$flatten.backgroundColor) || theme.colors.background;
|
|
18
19
|
const edges = ["left", "right"];
|
|
19
20
|
if (hasSafeArea || hasTopSafeArea) {
|
|
20
21
|
edges.push("top");
|
package/lib/module/index.js
CHANGED
|
@@ -31,7 +31,6 @@ export { ActionSheet, ActionSheetItem, ActionSheetCancel } from "./components/Ac
|
|
|
31
31
|
export { Swiper, SwiperItem } from "./components/Swiper";
|
|
32
32
|
export { Center, Circle, Square, Row, Stack, Spacer } from "./components/Layout";
|
|
33
33
|
export { RadioButton, RadioButtonGroup, RadioButtonRow, RadioButtonFieldGroup } from "./components/RadioButton/index";
|
|
34
|
-
export { default as Shadow } from "./components/Shadow";
|
|
35
34
|
export { DeckSwiper, DeckSwiperCard } from "./components/DeckSwiper";
|
|
36
35
|
|
|
37
36
|
/* Deprecated: Fix or Delete! */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Picker.d.ts","sourceRoot":"","sources":["../../../../../src/components/Picker/Picker.tsx"],"names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CAAC,EAAE,OAAO,CAAC;IAC9B,KAAK,EAAE,KAAK,CAAC;IACb,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;CACxB,CAAC;;;;AAyaF,wBAAiC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScreenContainer.d.ts","sourceRoot":"","sources":["../../../../src/components/ScreenContainer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAGL,SAAS,EACT,SAAS,EAEV,MAAM,cAAc,CAAC;AAItB,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAEpD,aAAK,oBAAoB,GAAG;IAC1B,UAAU,EAAE,OAAO,CAAC;IACpB,WAAW,EAAE,OAAO,CAAC;IACrB,cAAc,EAAE,OAAO,CAAC;IACxB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,KAAK,EAAE,KAAK,CAAC;IACb,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B,CAAC;AAEF,iBAAS,eAAe,CAAC,EACvB,UAAkB,EAClB,WAAmB,EACnB,iBAAyB,EACzB,cAAsB,EACtB,KAAK,EACL,KAAK,EACL,QAAQ,EACR,GAAG,IAAI,EACR,EAAE,oBAAoB,
|
|
1
|
+
{"version":3,"file":"ScreenContainer.d.ts","sourceRoot":"","sources":["../../../../src/components/ScreenContainer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAGL,SAAS,EACT,SAAS,EAEV,MAAM,cAAc,CAAC;AAItB,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAEpD,aAAK,oBAAoB,GAAG;IAC1B,UAAU,EAAE,OAAO,CAAC;IACpB,WAAW,EAAE,OAAO,CAAC;IACrB,cAAc,EAAE,OAAO,CAAC;IACxB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,KAAK,EAAE,KAAK,CAAC;IACb,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B,CAAC;AAEF,iBAAS,eAAe,CAAC,EACvB,UAAkB,EAClB,WAAmB,EACnB,iBAAyB,EACzB,cAAsB,EACtB,KAAK,EACL,KAAK,EACL,QAAQ,EACR,GAAG,IAAI,EACR,EAAE,oBAAoB,eAyCtB;;;;AAYD,wBAA0C"}
|
|
@@ -31,7 +31,6 @@ export { ActionSheet, ActionSheetItem, ActionSheetCancel, } from "./components/A
|
|
|
31
31
|
export { Swiper, SwiperItem } from "./components/Swiper";
|
|
32
32
|
export { Center, Circle, Square, Row, Stack, Spacer, } from "./components/Layout";
|
|
33
33
|
export { RadioButton, RadioButtonGroup, RadioButtonRow, RadioButtonFieldGroup, } from "./components/RadioButton/index";
|
|
34
|
-
export { default as Shadow } from "./components/Shadow";
|
|
35
34
|
export { DeckSwiper, DeckSwiperCard } from "./components/DeckSwiper";
|
|
36
35
|
export { default as DatePicker } from "./components/DatePicker/DatePicker";
|
|
37
36
|
export { default as Picker } from "./components/Picker/Picker";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AACrD,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAEhE,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACzC,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,qBAAqB,CAAC;AACxD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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.8.1-
|
|
44
|
+
"@draftbit/types": "^46.8.1-51e99b.2+51e99b7",
|
|
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",
|
|
@@ -55,7 +55,6 @@
|
|
|
55
55
|
"lodash.tonumber": "^4.0.3",
|
|
56
56
|
"react-native-deck-swiper": "^2.0.12",
|
|
57
57
|
"react-native-modal-datetime-picker": "^13.0.0",
|
|
58
|
-
"react-native-shadow-2": "^7.0.6",
|
|
59
58
|
"react-native-svg": "12.3.0",
|
|
60
59
|
"react-native-typography": "^1.4.1",
|
|
61
60
|
"react-native-web-swiper": "^2.2.3"
|
|
@@ -93,5 +92,5 @@
|
|
|
93
92
|
]
|
|
94
93
|
]
|
|
95
94
|
},
|
|
96
|
-
"gitHead": "
|
|
95
|
+
"gitHead": "51e99b7793aa55d2311507fe4fa965c16eab5bd5"
|
|
97
96
|
}
|
|
@@ -36,6 +36,8 @@ const isWeb = Platform.OS === "web";
|
|
|
36
36
|
const unstyledColor = "rgba(165, 173, 183, 1)";
|
|
37
37
|
const disabledColor = "rgb(240, 240, 240)";
|
|
38
38
|
const errorColor = "rgba(255, 69, 100, 1)";
|
|
39
|
+
//Empty string for 'value' is treated as a non-value
|
|
40
|
+
//reason: Draftbit uses empty string as initial value for string state*/
|
|
39
41
|
const Picker = ({ error, options = [], onValueChange, defaultValue, Icon, style, placeholder, value, disabled = false, assistiveText, label, iconColor = unstyledColor, iconSize = 24, leftIconMode = "inset", leftIconName, placeholderTextColor = unstyledColor, rightIconName, type = "solid", autoDismissKeyboard = true, }) => {
|
|
40
42
|
var _a, _b;
|
|
41
43
|
const androidPickerRef = React.useRef(undefined);
|
|
@@ -45,12 +47,12 @@ const Picker = ({ error, options = [], onValueChange, defaultValue, Icon, style,
|
|
|
45
47
|
setPickerVisible(!pickerVisible);
|
|
46
48
|
};
|
|
47
49
|
React.useEffect(() => {
|
|
48
|
-
if (value != null) {
|
|
50
|
+
if (value != null && value !== "") {
|
|
49
51
|
setInternalValue(value);
|
|
50
52
|
}
|
|
51
53
|
}, [value]);
|
|
52
54
|
React.useEffect(() => {
|
|
53
|
-
if (defaultValue != null) {
|
|
55
|
+
if (defaultValue != null && defaultValue !== "") {
|
|
54
56
|
setInternalValue(defaultValue);
|
|
55
57
|
}
|
|
56
58
|
}, [defaultValue]);
|
|
@@ -65,10 +67,7 @@ const Picker = ({ error, options = [], onValueChange, defaultValue, Icon, style,
|
|
|
65
67
|
Keyboard.dismiss();
|
|
66
68
|
}
|
|
67
69
|
}, [pickerVisible, autoDismissKeyboard]);
|
|
68
|
-
const
|
|
69
|
-
const pickerOptions = placeholder
|
|
70
|
-
? [{ value: placeholder, label: placeholder }, ...normalizedOptions]
|
|
71
|
-
: normalizedOptions;
|
|
70
|
+
const pickerOptions = normalizeOptions(options);
|
|
72
71
|
const { viewStyles, textStyles } = extractStyles(style);
|
|
73
72
|
const additionalBorderStyles = ["backgroundColor"];
|
|
74
73
|
const additionalMarginStyles = [
|
|
@@ -163,10 +162,10 @@ const Picker = ({ error, options = [], onValueChange, defaultValue, Icon, style,
|
|
|
163
162
|
...(disabled ? { color: unstyledColor } : {}),
|
|
164
163
|
};
|
|
165
164
|
const handleValueChange = (newValue, itemIndex) => {
|
|
166
|
-
if (
|
|
165
|
+
if (newValue !== "") {
|
|
167
166
|
onValueChange === null || onValueChange === void 0 ? void 0 : onValueChange(newValue, itemIndex);
|
|
167
|
+
setInternalValue(newValue);
|
|
168
168
|
}
|
|
169
|
-
setInternalValue(newValue);
|
|
170
169
|
};
|
|
171
170
|
return (
|
|
172
171
|
/* marginsContainer */
|
|
@@ -92,6 +92,8 @@ const unstyledColor = "rgba(165, 173, 183, 1)";
|
|
|
92
92
|
const disabledColor = "rgb(240, 240, 240)";
|
|
93
93
|
const errorColor = "rgba(255, 69, 100, 1)";
|
|
94
94
|
|
|
95
|
+
//Empty string for 'value' is treated as a non-value
|
|
96
|
+
//reason: Draftbit uses empty string as initial value for string state*/
|
|
95
97
|
const Picker: React.FC<PickerProps> = ({
|
|
96
98
|
error,
|
|
97
99
|
options = [],
|
|
@@ -126,13 +128,13 @@ const Picker: React.FC<PickerProps> = ({
|
|
|
126
128
|
};
|
|
127
129
|
|
|
128
130
|
React.useEffect(() => {
|
|
129
|
-
if (value != null) {
|
|
131
|
+
if (value != null && value !== "") {
|
|
130
132
|
setInternalValue(value);
|
|
131
133
|
}
|
|
132
134
|
}, [value]);
|
|
133
135
|
|
|
134
136
|
React.useEffect(() => {
|
|
135
|
-
if (defaultValue != null) {
|
|
137
|
+
if (defaultValue != null && defaultValue !== "") {
|
|
136
138
|
setInternalValue(defaultValue);
|
|
137
139
|
}
|
|
138
140
|
}, [defaultValue]);
|
|
@@ -149,11 +151,7 @@ const Picker: React.FC<PickerProps> = ({
|
|
|
149
151
|
}
|
|
150
152
|
}, [pickerVisible, autoDismissKeyboard]);
|
|
151
153
|
|
|
152
|
-
const
|
|
153
|
-
|
|
154
|
-
const pickerOptions = placeholder
|
|
155
|
-
? [{ value: placeholder, label: placeholder }, ...normalizedOptions]
|
|
156
|
-
: normalizedOptions;
|
|
154
|
+
const pickerOptions = normalizeOptions(options);
|
|
157
155
|
|
|
158
156
|
const { viewStyles, textStyles } = extractStyles(style);
|
|
159
157
|
|
|
@@ -304,10 +302,10 @@ const Picker: React.FC<PickerProps> = ({
|
|
|
304
302
|
};
|
|
305
303
|
|
|
306
304
|
const handleValueChange = (newValue: string, itemIndex: number) => {
|
|
307
|
-
if (
|
|
305
|
+
if (newValue !== "") {
|
|
308
306
|
onValueChange?.(newValue, itemIndex);
|
|
307
|
+
setInternalValue(newValue);
|
|
309
308
|
}
|
|
310
|
-
setInternalValue(newValue);
|
|
311
309
|
};
|
|
312
310
|
|
|
313
311
|
return (
|
|
@@ -3,7 +3,8 @@ import { StyleSheet, ScrollView, View, } from "react-native";
|
|
|
3
3
|
import { SafeAreaView } from "react-native-safe-area-context";
|
|
4
4
|
import { withTheme } from "../theming";
|
|
5
5
|
function ScreenContainer({ scrollable = false, hasSafeArea = false, hasBottomSafeArea = false, hasTopSafeArea = false, theme, style, children, ...rest }) {
|
|
6
|
-
|
|
6
|
+
var _a;
|
|
7
|
+
const backgroundColor = ((_a = StyleSheet.flatten(style)) === null || _a === void 0 ? void 0 : _a.backgroundColor) || theme.colors.background;
|
|
7
8
|
const edges = ["left", "right"];
|
|
8
9
|
if (hasSafeArea || hasTopSafeArea) {
|
|
9
10
|
edges.push("top");
|
|
@@ -31,7 +31,8 @@ function ScreenContainer({
|
|
|
31
31
|
children,
|
|
32
32
|
...rest
|
|
33
33
|
}: ScreenContainerProps) {
|
|
34
|
-
const backgroundColor =
|
|
34
|
+
const backgroundColor =
|
|
35
|
+
StyleSheet.flatten(style)?.backgroundColor || theme.colors.background;
|
|
35
36
|
|
|
36
37
|
const edges: Edge[] = ["left", "right"];
|
|
37
38
|
if (hasSafeArea || hasTopSafeArea) {
|
package/src/index.js
CHANGED
|
@@ -31,7 +31,6 @@ export { ActionSheet, ActionSheetItem, ActionSheetCancel, } from "./components/A
|
|
|
31
31
|
export { Swiper, SwiperItem } from "./components/Swiper";
|
|
32
32
|
export { Center, Circle, Square, Row, Stack, Spacer, } from "./components/Layout";
|
|
33
33
|
export { RadioButton, RadioButtonGroup, RadioButtonRow, RadioButtonFieldGroup, } from "./components/RadioButton/index";
|
|
34
|
-
export { default as Shadow } from "./components/Shadow";
|
|
35
34
|
export { DeckSwiper, DeckSwiperCard } from "./components/DeckSwiper";
|
|
36
35
|
/* Deprecated: Fix or Delete! */
|
|
37
36
|
export { default as DatePicker } from "./components/DatePicker/DatePicker";
|
package/src/index.tsx
CHANGED
|
@@ -1,42 +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 _reactNativeShadow = require("react-native-shadow-2");
|
|
9
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
|
-
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); }
|
|
11
|
-
const Shadow = _ref => {
|
|
12
|
-
let {
|
|
13
|
-
offsetX = 0,
|
|
14
|
-
offsetY = 0,
|
|
15
|
-
showShadowSideStart = true,
|
|
16
|
-
showShadowSideEnd = true,
|
|
17
|
-
showShadowSideTop = true,
|
|
18
|
-
showShadowSideBottom = true,
|
|
19
|
-
showShadowCornerTopStart = true,
|
|
20
|
-
showShadowCornerTopEnd = true,
|
|
21
|
-
showShadowCornerBottomStart = true,
|
|
22
|
-
showShadowCornerBottomEnd = true,
|
|
23
|
-
...rest
|
|
24
|
-
} = _ref;
|
|
25
|
-
return /*#__PURE__*/_react.default.createElement(_reactNativeShadow.Shadow, _extends({
|
|
26
|
-
offset: [offsetX, offsetY],
|
|
27
|
-
sides: {
|
|
28
|
-
start: showShadowSideStart,
|
|
29
|
-
end: showShadowSideEnd,
|
|
30
|
-
top: showShadowSideTop,
|
|
31
|
-
bottom: showShadowSideBottom
|
|
32
|
-
},
|
|
33
|
-
corners: {
|
|
34
|
-
topStart: showShadowCornerTopStart,
|
|
35
|
-
topEnd: showShadowCornerTopEnd,
|
|
36
|
-
bottomStart: showShadowCornerBottomStart,
|
|
37
|
-
bottomEnd: showShadowCornerBottomEnd
|
|
38
|
-
}
|
|
39
|
-
}, rest));
|
|
40
|
-
};
|
|
41
|
-
var _default = Shadow;
|
|
42
|
-
exports.default = _default;
|
|
@@ -1,94 +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: "Shadow",
|
|
10
|
-
tag: "Shadow",
|
|
11
|
-
description: "A cross-platform, universal shadow.",
|
|
12
|
-
category: _types.COMPONENT_TYPES.view,
|
|
13
|
-
stylesPanelSections: _types.CONTAINER_COMPONENT_STYLES_SECTIONS,
|
|
14
|
-
props: {
|
|
15
|
-
disabled: (0, _types.createDisabledProp)({
|
|
16
|
-
description: "Disables the shadow."
|
|
17
|
-
}),
|
|
18
|
-
startColor: (0, _types.createColorProp)({
|
|
19
|
-
label: "Start Color",
|
|
20
|
-
description: "The initial gradient color of the shadow.",
|
|
21
|
-
defaultValue: null
|
|
22
|
-
}),
|
|
23
|
-
endColor: (0, _types.createColorProp)({
|
|
24
|
-
label: "End Color",
|
|
25
|
-
description: "The final gradient color of the shadow.",
|
|
26
|
-
defaultValue: null
|
|
27
|
-
}),
|
|
28
|
-
distance: (0, _types.createStaticNumberProp)({
|
|
29
|
-
label: "Distance",
|
|
30
|
-
description: "The distance of the shadow."
|
|
31
|
-
}),
|
|
32
|
-
paintInside: (0, _types.createStaticBoolProp)({
|
|
33
|
-
label: "Paint Inside",
|
|
34
|
-
description: "Apply the shadow below/inside the content.",
|
|
35
|
-
defaultValue: null
|
|
36
|
-
}),
|
|
37
|
-
stretch: (0, _types.createStaticBoolProp)({
|
|
38
|
-
label: "Stretch",
|
|
39
|
-
description: "Force children to occupy all available horizontal space.",
|
|
40
|
-
defaultValue: null
|
|
41
|
-
}),
|
|
42
|
-
offsetX: (0, _types.createStaticNumberProp)({
|
|
43
|
-
label: "Offset X",
|
|
44
|
-
description: "Moves the shadow in the x direction",
|
|
45
|
-
defeaultValue: 0
|
|
46
|
-
}),
|
|
47
|
-
offsetY: (0, _types.createStaticNumberProp)({
|
|
48
|
-
label: "Offset Y",
|
|
49
|
-
description: "Moves the shadow in the y direction",
|
|
50
|
-
defeaultValue: 0
|
|
51
|
-
}),
|
|
52
|
-
showShadowSideStart: (0, _types.createStaticBoolProp)({
|
|
53
|
-
label: "Show Shadow Start",
|
|
54
|
-
description: "Whether to show shadow on the start side or not",
|
|
55
|
-
defaultValue: true
|
|
56
|
-
}),
|
|
57
|
-
showShadowSideEnd: (0, _types.createStaticBoolProp)({
|
|
58
|
-
label: "Show Shadow End",
|
|
59
|
-
description: "Whether to show shadow on the end side or not",
|
|
60
|
-
defaultValue: true
|
|
61
|
-
}),
|
|
62
|
-
showShadowSideTop: (0, _types.createStaticBoolProp)({
|
|
63
|
-
label: "Show Shadow Top",
|
|
64
|
-
description: "Whether to show shadow on the top side or not",
|
|
65
|
-
defaultValue: true
|
|
66
|
-
}),
|
|
67
|
-
showShadowSideBottom: (0, _types.createStaticBoolProp)({
|
|
68
|
-
label: "Show Shadow Bottom",
|
|
69
|
-
description: "Whether to show shadow on the bottom side or not",
|
|
70
|
-
defaultValue: true
|
|
71
|
-
}),
|
|
72
|
-
showShadowCornerTopStart: (0, _types.createStaticBoolProp)({
|
|
73
|
-
label: "Show Shadow Top Start Corner",
|
|
74
|
-
description: "Whether to show shadow on the top start corner or not",
|
|
75
|
-
defaultValue: true
|
|
76
|
-
}),
|
|
77
|
-
showShadowCornerTopEnd: (0, _types.createStaticBoolProp)({
|
|
78
|
-
label: "Show Shadow Top End Corner",
|
|
79
|
-
description: "Whether to show shadow on the top end corner or not",
|
|
80
|
-
defaultValue: true
|
|
81
|
-
}),
|
|
82
|
-
showShadowCornerBottomStart: (0, _types.createStaticBoolProp)({
|
|
83
|
-
label: "Show Shadow Bottom Start Corner",
|
|
84
|
-
description: "Whether to show shadow on the bottom start corner or not",
|
|
85
|
-
defaultValue: true
|
|
86
|
-
}),
|
|
87
|
-
showShadowCornerBottomEnd: (0, _types.createStaticBoolProp)({
|
|
88
|
-
label: "Show Shadow Bottom End Corner",
|
|
89
|
-
description: "Whether to show shadow on the bottom end corner or not",
|
|
90
|
-
defaultValue: true
|
|
91
|
-
})
|
|
92
|
-
}
|
|
93
|
-
};
|
|
94
|
-
exports.SEED_DATA = SEED_DATA;
|
|
@@ -1,34 +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 { Shadow as ShadowComponent } from "react-native-shadow-2";
|
|
4
|
-
const Shadow = _ref => {
|
|
5
|
-
let {
|
|
6
|
-
offsetX = 0,
|
|
7
|
-
offsetY = 0,
|
|
8
|
-
showShadowSideStart = true,
|
|
9
|
-
showShadowSideEnd = true,
|
|
10
|
-
showShadowSideTop = true,
|
|
11
|
-
showShadowSideBottom = true,
|
|
12
|
-
showShadowCornerTopStart = true,
|
|
13
|
-
showShadowCornerTopEnd = true,
|
|
14
|
-
showShadowCornerBottomStart = true,
|
|
15
|
-
showShadowCornerBottomEnd = true,
|
|
16
|
-
...rest
|
|
17
|
-
} = _ref;
|
|
18
|
-
return /*#__PURE__*/React.createElement(ShadowComponent, _extends({
|
|
19
|
-
offset: [offsetX, offsetY],
|
|
20
|
-
sides: {
|
|
21
|
-
start: showShadowSideStart,
|
|
22
|
-
end: showShadowSideEnd,
|
|
23
|
-
top: showShadowSideTop,
|
|
24
|
-
bottom: showShadowSideBottom
|
|
25
|
-
},
|
|
26
|
-
corners: {
|
|
27
|
-
topStart: showShadowCornerTopStart,
|
|
28
|
-
topEnd: showShadowCornerTopEnd,
|
|
29
|
-
bottomStart: showShadowCornerBottomStart,
|
|
30
|
-
bottomEnd: showShadowCornerBottomEnd
|
|
31
|
-
}
|
|
32
|
-
}, rest));
|
|
33
|
-
};
|
|
34
|
-
export default Shadow;
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
import { COMPONENT_TYPES, CONTAINER_COMPONENT_STYLES_SECTIONS, createColorProp, createStaticNumberProp, createStaticBoolProp, createDisabledProp } from "@draftbit/types";
|
|
2
|
-
export const SEED_DATA = {
|
|
3
|
-
name: "Shadow",
|
|
4
|
-
tag: "Shadow",
|
|
5
|
-
description: "A cross-platform, universal shadow.",
|
|
6
|
-
category: COMPONENT_TYPES.view,
|
|
7
|
-
stylesPanelSections: CONTAINER_COMPONENT_STYLES_SECTIONS,
|
|
8
|
-
props: {
|
|
9
|
-
disabled: createDisabledProp({
|
|
10
|
-
description: "Disables the shadow."
|
|
11
|
-
}),
|
|
12
|
-
startColor: createColorProp({
|
|
13
|
-
label: "Start Color",
|
|
14
|
-
description: "The initial gradient color of the shadow.",
|
|
15
|
-
defaultValue: null
|
|
16
|
-
}),
|
|
17
|
-
endColor: createColorProp({
|
|
18
|
-
label: "End Color",
|
|
19
|
-
description: "The final gradient color of the shadow.",
|
|
20
|
-
defaultValue: null
|
|
21
|
-
}),
|
|
22
|
-
distance: createStaticNumberProp({
|
|
23
|
-
label: "Distance",
|
|
24
|
-
description: "The distance of the shadow."
|
|
25
|
-
}),
|
|
26
|
-
paintInside: createStaticBoolProp({
|
|
27
|
-
label: "Paint Inside",
|
|
28
|
-
description: "Apply the shadow below/inside the content.",
|
|
29
|
-
defaultValue: null
|
|
30
|
-
}),
|
|
31
|
-
stretch: createStaticBoolProp({
|
|
32
|
-
label: "Stretch",
|
|
33
|
-
description: "Force children to occupy all available horizontal space.",
|
|
34
|
-
defaultValue: null
|
|
35
|
-
}),
|
|
36
|
-
offsetX: createStaticNumberProp({
|
|
37
|
-
label: "Offset X",
|
|
38
|
-
description: "Moves the shadow in the x direction",
|
|
39
|
-
defeaultValue: 0
|
|
40
|
-
}),
|
|
41
|
-
offsetY: createStaticNumberProp({
|
|
42
|
-
label: "Offset Y",
|
|
43
|
-
description: "Moves the shadow in the y direction",
|
|
44
|
-
defeaultValue: 0
|
|
45
|
-
}),
|
|
46
|
-
showShadowSideStart: createStaticBoolProp({
|
|
47
|
-
label: "Show Shadow Start",
|
|
48
|
-
description: "Whether to show shadow on the start side or not",
|
|
49
|
-
defaultValue: true
|
|
50
|
-
}),
|
|
51
|
-
showShadowSideEnd: createStaticBoolProp({
|
|
52
|
-
label: "Show Shadow End",
|
|
53
|
-
description: "Whether to show shadow on the end side or not",
|
|
54
|
-
defaultValue: true
|
|
55
|
-
}),
|
|
56
|
-
showShadowSideTop: createStaticBoolProp({
|
|
57
|
-
label: "Show Shadow Top",
|
|
58
|
-
description: "Whether to show shadow on the top side or not",
|
|
59
|
-
defaultValue: true
|
|
60
|
-
}),
|
|
61
|
-
showShadowSideBottom: createStaticBoolProp({
|
|
62
|
-
label: "Show Shadow Bottom",
|
|
63
|
-
description: "Whether to show shadow on the bottom side or not",
|
|
64
|
-
defaultValue: true
|
|
65
|
-
}),
|
|
66
|
-
showShadowCornerTopStart: createStaticBoolProp({
|
|
67
|
-
label: "Show Shadow Top Start Corner",
|
|
68
|
-
description: "Whether to show shadow on the top start corner or not",
|
|
69
|
-
defaultValue: true
|
|
70
|
-
}),
|
|
71
|
-
showShadowCornerTopEnd: createStaticBoolProp({
|
|
72
|
-
label: "Show Shadow Top End Corner",
|
|
73
|
-
description: "Whether to show shadow on the top end corner or not",
|
|
74
|
-
defaultValue: true
|
|
75
|
-
}),
|
|
76
|
-
showShadowCornerBottomStart: createStaticBoolProp({
|
|
77
|
-
label: "Show Shadow Bottom Start Corner",
|
|
78
|
-
description: "Whether to show shadow on the bottom start corner or not",
|
|
79
|
-
defaultValue: true
|
|
80
|
-
}),
|
|
81
|
-
showShadowCornerBottomEnd: createStaticBoolProp({
|
|
82
|
-
label: "Show Shadow Bottom End Corner",
|
|
83
|
-
description: "Whether to show shadow on the bottom end corner or not",
|
|
84
|
-
defaultValue: true
|
|
85
|
-
})
|
|
86
|
-
}
|
|
87
|
-
};
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { StyleProp, ViewStyle } from "react-native";
|
|
3
|
-
interface ShadowProps {
|
|
4
|
-
disabled?: boolean;
|
|
5
|
-
startColor?: string;
|
|
6
|
-
endColor?: string;
|
|
7
|
-
distance?: number;
|
|
8
|
-
paintInside?: boolean;
|
|
9
|
-
stretch?: boolean;
|
|
10
|
-
offsetX?: number;
|
|
11
|
-
offsetY?: number;
|
|
12
|
-
showShadowSideStart?: boolean;
|
|
13
|
-
showShadowSideEnd?: boolean;
|
|
14
|
-
showShadowSideTop?: boolean;
|
|
15
|
-
showShadowSideBottom?: boolean;
|
|
16
|
-
showShadowCornerTopStart?: boolean;
|
|
17
|
-
showShadowCornerTopEnd?: boolean;
|
|
18
|
-
showShadowCornerBottomStart?: boolean;
|
|
19
|
-
showShadowCornerBottomEnd?: boolean;
|
|
20
|
-
style?: StyleProp<ViewStyle>;
|
|
21
|
-
}
|
|
22
|
-
declare const Shadow: React.FC<React.PropsWithChildren<ShadowProps>>;
|
|
23
|
-
export default Shadow;
|
|
24
|
-
//# sourceMappingURL=Shadow.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Shadow.d.ts","sourceRoot":"","sources":["../../../../src/components/Shadow.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAGpD,UAAU,WAAW;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,wBAAwB,CAAC,EAAE,OAAO,CAAC;IACnC,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,2BAA2B,CAAC,EAAE,OAAO,CAAC;IACtC,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B;AAED,QAAA,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,iBAAiB,CAAC,WAAW,CAAC,CA+B1D,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
|
@@ -1,173 +0,0 @@
|
|
|
1
|
-
export declare const SEED_DATA: {
|
|
2
|
-
name: string;
|
|
3
|
-
tag: string;
|
|
4
|
-
description: string;
|
|
5
|
-
category: string;
|
|
6
|
-
stylesPanelSections: string[];
|
|
7
|
-
props: {
|
|
8
|
-
disabled: {
|
|
9
|
-
label: string;
|
|
10
|
-
description: string;
|
|
11
|
-
group: string;
|
|
12
|
-
editable: boolean;
|
|
13
|
-
required: boolean;
|
|
14
|
-
formType: string;
|
|
15
|
-
propType: string;
|
|
16
|
-
defaultValue: null;
|
|
17
|
-
};
|
|
18
|
-
startColor: {
|
|
19
|
-
group: string;
|
|
20
|
-
label: string;
|
|
21
|
-
description: string;
|
|
22
|
-
editable: boolean;
|
|
23
|
-
required: boolean;
|
|
24
|
-
defaultValue: null;
|
|
25
|
-
formType: string;
|
|
26
|
-
propType: string;
|
|
27
|
-
};
|
|
28
|
-
endColor: {
|
|
29
|
-
group: string;
|
|
30
|
-
label: string;
|
|
31
|
-
description: string;
|
|
32
|
-
editable: boolean;
|
|
33
|
-
required: boolean;
|
|
34
|
-
defaultValue: null;
|
|
35
|
-
formType: string;
|
|
36
|
-
propType: string;
|
|
37
|
-
};
|
|
38
|
-
distance: {
|
|
39
|
-
label: string;
|
|
40
|
-
description: string;
|
|
41
|
-
formType: string;
|
|
42
|
-
propType: string;
|
|
43
|
-
group: string;
|
|
44
|
-
defaultValue: null;
|
|
45
|
-
editable: boolean;
|
|
46
|
-
required: boolean;
|
|
47
|
-
step: number;
|
|
48
|
-
};
|
|
49
|
-
paintInside: {
|
|
50
|
-
label: string;
|
|
51
|
-
description: string;
|
|
52
|
-
formType: string;
|
|
53
|
-
propType: string;
|
|
54
|
-
defaultValue: boolean;
|
|
55
|
-
editable: boolean;
|
|
56
|
-
required: boolean;
|
|
57
|
-
group: string;
|
|
58
|
-
};
|
|
59
|
-
stretch: {
|
|
60
|
-
label: string;
|
|
61
|
-
description: string;
|
|
62
|
-
formType: string;
|
|
63
|
-
propType: string;
|
|
64
|
-
defaultValue: boolean;
|
|
65
|
-
editable: boolean;
|
|
66
|
-
required: boolean;
|
|
67
|
-
group: string;
|
|
68
|
-
};
|
|
69
|
-
offsetX: {
|
|
70
|
-
label: string;
|
|
71
|
-
description: string;
|
|
72
|
-
formType: string;
|
|
73
|
-
propType: string;
|
|
74
|
-
group: string;
|
|
75
|
-
defaultValue: null;
|
|
76
|
-
editable: boolean;
|
|
77
|
-
required: boolean;
|
|
78
|
-
step: number;
|
|
79
|
-
};
|
|
80
|
-
offsetY: {
|
|
81
|
-
label: string;
|
|
82
|
-
description: string;
|
|
83
|
-
formType: string;
|
|
84
|
-
propType: string;
|
|
85
|
-
group: string;
|
|
86
|
-
defaultValue: null;
|
|
87
|
-
editable: boolean;
|
|
88
|
-
required: boolean;
|
|
89
|
-
step: number;
|
|
90
|
-
};
|
|
91
|
-
showShadowSideStart: {
|
|
92
|
-
label: string;
|
|
93
|
-
description: string;
|
|
94
|
-
formType: string;
|
|
95
|
-
propType: string;
|
|
96
|
-
defaultValue: boolean;
|
|
97
|
-
editable: boolean;
|
|
98
|
-
required: boolean;
|
|
99
|
-
group: string;
|
|
100
|
-
};
|
|
101
|
-
showShadowSideEnd: {
|
|
102
|
-
label: string;
|
|
103
|
-
description: string;
|
|
104
|
-
formType: string;
|
|
105
|
-
propType: string;
|
|
106
|
-
defaultValue: boolean;
|
|
107
|
-
editable: boolean;
|
|
108
|
-
required: boolean;
|
|
109
|
-
group: string;
|
|
110
|
-
};
|
|
111
|
-
showShadowSideTop: {
|
|
112
|
-
label: string;
|
|
113
|
-
description: string;
|
|
114
|
-
formType: string;
|
|
115
|
-
propType: string;
|
|
116
|
-
defaultValue: boolean;
|
|
117
|
-
editable: boolean;
|
|
118
|
-
required: boolean;
|
|
119
|
-
group: string;
|
|
120
|
-
};
|
|
121
|
-
showShadowSideBottom: {
|
|
122
|
-
label: string;
|
|
123
|
-
description: string;
|
|
124
|
-
formType: string;
|
|
125
|
-
propType: string;
|
|
126
|
-
defaultValue: boolean;
|
|
127
|
-
editable: boolean;
|
|
128
|
-
required: boolean;
|
|
129
|
-
group: string;
|
|
130
|
-
};
|
|
131
|
-
showShadowCornerTopStart: {
|
|
132
|
-
label: string;
|
|
133
|
-
description: string;
|
|
134
|
-
formType: string;
|
|
135
|
-
propType: string;
|
|
136
|
-
defaultValue: boolean;
|
|
137
|
-
editable: boolean;
|
|
138
|
-
required: boolean;
|
|
139
|
-
group: string;
|
|
140
|
-
};
|
|
141
|
-
showShadowCornerTopEnd: {
|
|
142
|
-
label: string;
|
|
143
|
-
description: string;
|
|
144
|
-
formType: string;
|
|
145
|
-
propType: string;
|
|
146
|
-
defaultValue: boolean;
|
|
147
|
-
editable: boolean;
|
|
148
|
-
required: boolean;
|
|
149
|
-
group: string;
|
|
150
|
-
};
|
|
151
|
-
showShadowCornerBottomStart: {
|
|
152
|
-
label: string;
|
|
153
|
-
description: string;
|
|
154
|
-
formType: string;
|
|
155
|
-
propType: string;
|
|
156
|
-
defaultValue: boolean;
|
|
157
|
-
editable: boolean;
|
|
158
|
-
required: boolean;
|
|
159
|
-
group: string;
|
|
160
|
-
};
|
|
161
|
-
showShadowCornerBottomEnd: {
|
|
162
|
-
label: string;
|
|
163
|
-
description: string;
|
|
164
|
-
formType: string;
|
|
165
|
-
propType: string;
|
|
166
|
-
defaultValue: boolean;
|
|
167
|
-
editable: boolean;
|
|
168
|
-
required: boolean;
|
|
169
|
-
group: string;
|
|
170
|
-
};
|
|
171
|
-
};
|
|
172
|
-
};
|
|
173
|
-
//# sourceMappingURL=Shadow.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Shadow.d.ts","sourceRoot":"","sources":["../../../../src/mappings/Shadow.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqFrB,CAAC"}
|
package/src/components/Shadow.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { Shadow as ShadowComponent } from "react-native-shadow-2";
|
|
3
|
-
const Shadow = ({ offsetX = 0, offsetY = 0, showShadowSideStart = true, showShadowSideEnd = true, showShadowSideTop = true, showShadowSideBottom = true, showShadowCornerTopStart = true, showShadowCornerTopEnd = true, showShadowCornerBottomStart = true, showShadowCornerBottomEnd = true, ...rest }) => {
|
|
4
|
-
return (React.createElement(ShadowComponent, { offset: [offsetX, offsetY], sides: {
|
|
5
|
-
start: showShadowSideStart,
|
|
6
|
-
end: showShadowSideEnd,
|
|
7
|
-
top: showShadowSideTop,
|
|
8
|
-
bottom: showShadowSideBottom,
|
|
9
|
-
}, corners: {
|
|
10
|
-
topStart: showShadowCornerTopStart,
|
|
11
|
-
topEnd: showShadowCornerTopEnd,
|
|
12
|
-
bottomStart: showShadowCornerBottomStart,
|
|
13
|
-
bottomEnd: showShadowCornerBottomEnd,
|
|
14
|
-
}, ...rest }));
|
|
15
|
-
};
|
|
16
|
-
export default Shadow;
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { StyleProp, ViewStyle } from "react-native";
|
|
3
|
-
import { Shadow as ShadowComponent } from "react-native-shadow-2";
|
|
4
|
-
|
|
5
|
-
interface ShadowProps {
|
|
6
|
-
disabled?: boolean;
|
|
7
|
-
startColor?: string;
|
|
8
|
-
endColor?: string;
|
|
9
|
-
distance?: number;
|
|
10
|
-
paintInside?: boolean;
|
|
11
|
-
stretch?: boolean;
|
|
12
|
-
offsetX?: number;
|
|
13
|
-
offsetY?: number;
|
|
14
|
-
showShadowSideStart?: boolean;
|
|
15
|
-
showShadowSideEnd?: boolean;
|
|
16
|
-
showShadowSideTop?: boolean;
|
|
17
|
-
showShadowSideBottom?: boolean;
|
|
18
|
-
showShadowCornerTopStart?: boolean;
|
|
19
|
-
showShadowCornerTopEnd?: boolean;
|
|
20
|
-
showShadowCornerBottomStart?: boolean;
|
|
21
|
-
showShadowCornerBottomEnd?: boolean;
|
|
22
|
-
style?: StyleProp<ViewStyle>;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
const Shadow: React.FC<React.PropsWithChildren<ShadowProps>> = ({
|
|
26
|
-
offsetX = 0,
|
|
27
|
-
offsetY = 0,
|
|
28
|
-
showShadowSideStart = true,
|
|
29
|
-
showShadowSideEnd = true,
|
|
30
|
-
showShadowSideTop = true,
|
|
31
|
-
showShadowSideBottom = true,
|
|
32
|
-
showShadowCornerTopStart = true,
|
|
33
|
-
showShadowCornerTopEnd = true,
|
|
34
|
-
showShadowCornerBottomStart = true,
|
|
35
|
-
showShadowCornerBottomEnd = true,
|
|
36
|
-
...rest
|
|
37
|
-
}) => {
|
|
38
|
-
return (
|
|
39
|
-
<ShadowComponent
|
|
40
|
-
offset={[offsetX, offsetY]}
|
|
41
|
-
sides={{
|
|
42
|
-
start: showShadowSideStart,
|
|
43
|
-
end: showShadowSideEnd,
|
|
44
|
-
top: showShadowSideTop,
|
|
45
|
-
bottom: showShadowSideBottom,
|
|
46
|
-
}}
|
|
47
|
-
corners={{
|
|
48
|
-
topStart: showShadowCornerTopStart,
|
|
49
|
-
topEnd: showShadowCornerTopEnd,
|
|
50
|
-
bottomStart: showShadowCornerBottomStart,
|
|
51
|
-
bottomEnd: showShadowCornerBottomEnd,
|
|
52
|
-
}}
|
|
53
|
-
{...rest}
|
|
54
|
-
/>
|
|
55
|
-
);
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
export default Shadow;
|
package/src/mappings/Shadow.js
DELETED
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
import { COMPONENT_TYPES, CONTAINER_COMPONENT_STYLES_SECTIONS, createColorProp, createStaticNumberProp, createStaticBoolProp, createDisabledProp, } from "@draftbit/types";
|
|
2
|
-
export const SEED_DATA = {
|
|
3
|
-
name: "Shadow",
|
|
4
|
-
tag: "Shadow",
|
|
5
|
-
description: "A cross-platform, universal shadow.",
|
|
6
|
-
category: COMPONENT_TYPES.view,
|
|
7
|
-
stylesPanelSections: CONTAINER_COMPONENT_STYLES_SECTIONS,
|
|
8
|
-
props: {
|
|
9
|
-
disabled: createDisabledProp({
|
|
10
|
-
description: "Disables the shadow.",
|
|
11
|
-
}),
|
|
12
|
-
startColor: createColorProp({
|
|
13
|
-
label: "Start Color",
|
|
14
|
-
description: "The initial gradient color of the shadow.",
|
|
15
|
-
defaultValue: null,
|
|
16
|
-
}),
|
|
17
|
-
endColor: createColorProp({
|
|
18
|
-
label: "End Color",
|
|
19
|
-
description: "The final gradient color of the shadow.",
|
|
20
|
-
defaultValue: null,
|
|
21
|
-
}),
|
|
22
|
-
distance: createStaticNumberProp({
|
|
23
|
-
label: "Distance",
|
|
24
|
-
description: "The distance of the shadow.",
|
|
25
|
-
}),
|
|
26
|
-
paintInside: createStaticBoolProp({
|
|
27
|
-
label: "Paint Inside",
|
|
28
|
-
description: "Apply the shadow below/inside the content.",
|
|
29
|
-
defaultValue: null,
|
|
30
|
-
}),
|
|
31
|
-
stretch: createStaticBoolProp({
|
|
32
|
-
label: "Stretch",
|
|
33
|
-
description: "Force children to occupy all available horizontal space.",
|
|
34
|
-
defaultValue: null,
|
|
35
|
-
}),
|
|
36
|
-
offsetX: createStaticNumberProp({
|
|
37
|
-
label: "Offset X",
|
|
38
|
-
description: "Moves the shadow in the x direction",
|
|
39
|
-
defeaultValue: 0,
|
|
40
|
-
}),
|
|
41
|
-
offsetY: createStaticNumberProp({
|
|
42
|
-
label: "Offset Y",
|
|
43
|
-
description: "Moves the shadow in the y direction",
|
|
44
|
-
defeaultValue: 0,
|
|
45
|
-
}),
|
|
46
|
-
showShadowSideStart: createStaticBoolProp({
|
|
47
|
-
label: "Show Shadow Start",
|
|
48
|
-
description: "Whether to show shadow on the start side or not",
|
|
49
|
-
defaultValue: true,
|
|
50
|
-
}),
|
|
51
|
-
showShadowSideEnd: createStaticBoolProp({
|
|
52
|
-
label: "Show Shadow End",
|
|
53
|
-
description: "Whether to show shadow on the end side or not",
|
|
54
|
-
defaultValue: true,
|
|
55
|
-
}),
|
|
56
|
-
showShadowSideTop: createStaticBoolProp({
|
|
57
|
-
label: "Show Shadow Top",
|
|
58
|
-
description: "Whether to show shadow on the top side or not",
|
|
59
|
-
defaultValue: true,
|
|
60
|
-
}),
|
|
61
|
-
showShadowSideBottom: createStaticBoolProp({
|
|
62
|
-
label: "Show Shadow Bottom",
|
|
63
|
-
description: "Whether to show shadow on the bottom side or not",
|
|
64
|
-
defaultValue: true,
|
|
65
|
-
}),
|
|
66
|
-
showShadowCornerTopStart: createStaticBoolProp({
|
|
67
|
-
label: "Show Shadow Top Start Corner",
|
|
68
|
-
description: "Whether to show shadow on the top start corner or not",
|
|
69
|
-
defaultValue: true,
|
|
70
|
-
}),
|
|
71
|
-
showShadowCornerTopEnd: createStaticBoolProp({
|
|
72
|
-
label: "Show Shadow Top End Corner",
|
|
73
|
-
description: "Whether to show shadow on the top end corner or not",
|
|
74
|
-
defaultValue: true,
|
|
75
|
-
}),
|
|
76
|
-
showShadowCornerBottomStart: createStaticBoolProp({
|
|
77
|
-
label: "Show Shadow Bottom Start Corner",
|
|
78
|
-
description: "Whether to show shadow on the bottom start corner or not",
|
|
79
|
-
defaultValue: true,
|
|
80
|
-
}),
|
|
81
|
-
showShadowCornerBottomEnd: createStaticBoolProp({
|
|
82
|
-
label: "Show Shadow Bottom End Corner",
|
|
83
|
-
description: "Whether to show shadow on the bottom end corner or not",
|
|
84
|
-
defaultValue: true,
|
|
85
|
-
}),
|
|
86
|
-
},
|
|
87
|
-
};
|
package/src/mappings/Shadow.ts
DELETED
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
COMPONENT_TYPES,
|
|
3
|
-
CONTAINER_COMPONENT_STYLES_SECTIONS,
|
|
4
|
-
createColorProp,
|
|
5
|
-
createStaticNumberProp,
|
|
6
|
-
createStaticBoolProp,
|
|
7
|
-
createDisabledProp,
|
|
8
|
-
} from "@draftbit/types";
|
|
9
|
-
|
|
10
|
-
export const SEED_DATA = {
|
|
11
|
-
name: "Shadow",
|
|
12
|
-
tag: "Shadow",
|
|
13
|
-
description: "A cross-platform, universal shadow.",
|
|
14
|
-
category: COMPONENT_TYPES.view,
|
|
15
|
-
stylesPanelSections: CONTAINER_COMPONENT_STYLES_SECTIONS,
|
|
16
|
-
props: {
|
|
17
|
-
disabled: createDisabledProp({
|
|
18
|
-
description: "Disables the shadow.",
|
|
19
|
-
}),
|
|
20
|
-
startColor: createColorProp({
|
|
21
|
-
label: "Start Color",
|
|
22
|
-
description: "The initial gradient color of the shadow.",
|
|
23
|
-
defaultValue: null,
|
|
24
|
-
}),
|
|
25
|
-
endColor: createColorProp({
|
|
26
|
-
label: "End Color",
|
|
27
|
-
description: "The final gradient color of the shadow.",
|
|
28
|
-
defaultValue: null,
|
|
29
|
-
}),
|
|
30
|
-
distance: createStaticNumberProp({
|
|
31
|
-
label: "Distance",
|
|
32
|
-
description: "The distance of the shadow.",
|
|
33
|
-
}),
|
|
34
|
-
paintInside: createStaticBoolProp({
|
|
35
|
-
label: "Paint Inside",
|
|
36
|
-
description: "Apply the shadow below/inside the content.",
|
|
37
|
-
defaultValue: null,
|
|
38
|
-
}),
|
|
39
|
-
stretch: createStaticBoolProp({
|
|
40
|
-
label: "Stretch",
|
|
41
|
-
description: "Force children to occupy all available horizontal space.",
|
|
42
|
-
defaultValue: null,
|
|
43
|
-
}),
|
|
44
|
-
offsetX: createStaticNumberProp({
|
|
45
|
-
label: "Offset X",
|
|
46
|
-
description: "Moves the shadow in the x direction",
|
|
47
|
-
defeaultValue: 0,
|
|
48
|
-
}),
|
|
49
|
-
offsetY: createStaticNumberProp({
|
|
50
|
-
label: "Offset Y",
|
|
51
|
-
description: "Moves the shadow in the y direction",
|
|
52
|
-
defeaultValue: 0,
|
|
53
|
-
}),
|
|
54
|
-
showShadowSideStart: createStaticBoolProp({
|
|
55
|
-
label: "Show Shadow Start",
|
|
56
|
-
description: "Whether to show shadow on the start side or not",
|
|
57
|
-
defaultValue: true,
|
|
58
|
-
}),
|
|
59
|
-
showShadowSideEnd: createStaticBoolProp({
|
|
60
|
-
label: "Show Shadow End",
|
|
61
|
-
description: "Whether to show shadow on the end side or not",
|
|
62
|
-
defaultValue: true,
|
|
63
|
-
}),
|
|
64
|
-
showShadowSideTop: createStaticBoolProp({
|
|
65
|
-
label: "Show Shadow Top",
|
|
66
|
-
description: "Whether to show shadow on the top side or not",
|
|
67
|
-
defaultValue: true,
|
|
68
|
-
}),
|
|
69
|
-
showShadowSideBottom: createStaticBoolProp({
|
|
70
|
-
label: "Show Shadow Bottom",
|
|
71
|
-
description: "Whether to show shadow on the bottom side or not",
|
|
72
|
-
defaultValue: true,
|
|
73
|
-
}),
|
|
74
|
-
showShadowCornerTopStart: createStaticBoolProp({
|
|
75
|
-
label: "Show Shadow Top Start Corner",
|
|
76
|
-
description: "Whether to show shadow on the top start corner or not",
|
|
77
|
-
defaultValue: true,
|
|
78
|
-
}),
|
|
79
|
-
showShadowCornerTopEnd: createStaticBoolProp({
|
|
80
|
-
label: "Show Shadow Top End Corner",
|
|
81
|
-
description: "Whether to show shadow on the top end corner or not",
|
|
82
|
-
defaultValue: true,
|
|
83
|
-
}),
|
|
84
|
-
showShadowCornerBottomStart: createStaticBoolProp({
|
|
85
|
-
label: "Show Shadow Bottom Start Corner",
|
|
86
|
-
description: "Whether to show shadow on the bottom start corner or not",
|
|
87
|
-
defaultValue: true,
|
|
88
|
-
}),
|
|
89
|
-
showShadowCornerBottomEnd: createStaticBoolProp({
|
|
90
|
-
label: "Show Shadow Bottom End Corner",
|
|
91
|
-
description: "Whether to show shadow on the bottom end corner or not",
|
|
92
|
-
defaultValue: true,
|
|
93
|
-
}),
|
|
94
|
-
},
|
|
95
|
-
};
|