@draftbit/core 43.4.9-f2446b.0 → 43.4.11-421a19.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/ActionSheet/ActionSheetCancel.js.map +1 -1
- package/lib/commonjs/components/ActionSheet/index.js.map +1 -1
- package/lib/commonjs/components/AnimatedCircularProgress.js +3 -11
- package/lib/commonjs/components/AnimatedCircularProgress.js.map +1 -1
- package/lib/commonjs/components/AspectRatio.js +3 -16
- package/lib/commonjs/components/AspectRatio.js.map +1 -1
- package/lib/commonjs/components/Button.js +11 -29
- package/lib/commonjs/components/Button.js.map +1 -1
- package/lib/commonjs/components/Card.js.map +1 -1
- package/lib/commonjs/components/CardBlock.js +5 -13
- package/lib/commonjs/components/CardBlock.js.map +1 -1
- package/lib/commonjs/components/CardContainerShortImage.js +5 -18
- package/lib/commonjs/components/CardContainerShortImage.js.map +1 -1
- package/lib/commonjs/components/CardInline.js.map +1 -1
- package/lib/commonjs/components/Carousel.js +5 -20
- package/lib/commonjs/components/Carousel.js.map +1 -1
- package/lib/commonjs/components/Checkbox/context.js +1 -1
- package/lib/commonjs/components/Checkbox/context.js.map +1 -1
- package/lib/commonjs/components/Checkbox/index.js.map +1 -1
- package/lib/commonjs/components/CircleImage.js +3 -17
- package/lib/commonjs/components/CircleImage.js.map +1 -1
- package/lib/commonjs/components/CircularProgress.js.map +1 -1
- package/lib/commonjs/components/Config.js.map +1 -1
- package/lib/commonjs/components/Container.js +5 -16
- package/lib/commonjs/components/Container.js.map +1 -1
- package/lib/commonjs/components/DatePicker/DatePickerComponent.web.js.map +1 -1
- package/lib/commonjs/components/DeprecatedButton.js +4 -19
- package/lib/commonjs/components/DeprecatedButton.js.map +1 -1
- package/lib/commonjs/components/DeprecatedCardWrapper.js +2 -14
- package/lib/commonjs/components/DeprecatedCardWrapper.js.map +1 -1
- package/lib/commonjs/components/Divider.js +3 -13
- package/lib/commonjs/components/Divider.js.map +1 -1
- package/lib/commonjs/components/FieldSearchBarFull.js.map +1 -1
- package/lib/commonjs/components/Header.js.map +1 -1
- package/lib/commonjs/components/HeaderLarge.js.map +1 -1
- package/lib/commonjs/components/HeaderOverline.js.map +1 -1
- package/lib/commonjs/components/Image.js +4 -15
- package/lib/commonjs/components/Image.js.map +1 -1
- package/lib/commonjs/components/Justification.js +1 -2
- package/lib/commonjs/components/NumberInput.js +17 -30
- package/lib/commonjs/components/NumberInput.js.map +1 -1
- package/lib/commonjs/components/Picker/PickerComponent.android.js +6 -20
- package/lib/commonjs/components/Picker/PickerComponent.android.js.map +1 -1
- package/lib/commonjs/components/Picker/PickerComponent.ios.js +10 -30
- package/lib/commonjs/components/Picker/PickerComponent.ios.js.map +1 -1
- package/lib/commonjs/components/Picker/PickerComponent.web.js +6 -20
- package/lib/commonjs/components/Picker/PickerComponent.web.js.map +1 -1
- package/lib/commonjs/components/Portal/PortalConsumer.js.map +1 -1
- package/lib/commonjs/components/Portal/PortalHost.js.map +1 -1
- package/lib/commonjs/components/Portal/PortalManager.js.map +1 -1
- package/lib/commonjs/components/ProgressIndicator.js.map +1 -1
- package/lib/commonjs/components/RadioButton/RadioButton.js +3 -15
- package/lib/commonjs/components/RadioButton/RadioButton.js.map +1 -1
- package/lib/commonjs/components/RadioButton/RadioButtonFieldGroup.js +2 -11
- package/lib/commonjs/components/RadioButton/RadioButtonFieldGroup.js.map +1 -1
- package/lib/commonjs/components/RadioButton/RadioButtonGroup.js +5 -16
- package/lib/commonjs/components/RadioButton/RadioButtonGroup.js.map +1 -1
- package/lib/commonjs/components/RadioButton/RadioButtonRow.js +6 -23
- package/lib/commonjs/components/RadioButton/RadioButtonRow.js.map +1 -1
- package/lib/commonjs/components/ResizeMode.js +1 -2
- package/lib/commonjs/components/Row.js.map +1 -1
- package/lib/commonjs/components/RowBodyIcon.js.map +1 -1
- package/lib/commonjs/components/RowHeadlineImageCaption.js.map +1 -1
- package/lib/commonjs/components/RowHeadlineImageIcon.js.map +1 -1
- package/lib/commonjs/components/ScreenContainer.js +5 -18
- package/lib/commonjs/components/ScreenContainer.js.map +1 -1
- package/lib/commonjs/components/Slider.js +5 -22
- package/lib/commonjs/components/Slider.js.map +1 -1
- package/lib/commonjs/components/StarRating.js +5 -23
- package/lib/commonjs/components/StarRating.js.map +1 -1
- package/lib/commonjs/components/Surface.js +3 -10
- package/lib/commonjs/components/Surface.js.map +1 -1
- package/lib/commonjs/components/Swiper/Swiper.js.map +1 -1
- package/lib/commonjs/components/Swiper/SwiperItem.js.map +1 -1
- package/lib/commonjs/components/ToggleButton.js +3 -17
- package/lib/commonjs/components/ToggleButton.js.map +1 -1
- package/lib/commonjs/components/Touchable.js +3 -16
- package/lib/commonjs/components/Touchable.js.map +1 -1
- package/lib/commonjs/components/Touchable.web.js.map +1 -1
- package/lib/commonjs/components/Typography.js.map +1 -1
- package/lib/commonjs/components/useAuthState.js.map +1 -1
- package/lib/commonjs/mappings/ActionSheetCancel.js.map +1 -1
- package/lib/commonjs/mappings/ActionSheetItem.js.map +1 -1
- package/lib/commonjs/mappings/AudioPlayer.js.map +1 -1
- package/lib/commonjs/mappings/Button.js.map +1 -1
- package/lib/commonjs/mappings/CardContainer.js.map +1 -1
- package/lib/commonjs/mappings/DatePicker.js.map +1 -1
- package/lib/commonjs/mappings/Icon.js +3 -1
- package/lib/commonjs/mappings/Icon.js.map +1 -1
- package/lib/commonjs/mappings/KeyboardAwareScrollView.js +48 -0
- package/lib/commonjs/mappings/KeyboardAwareScrollView.js.map +1 -0
- package/lib/commonjs/mappings/ProgressBar.js.map +1 -1
- package/lib/commonjs/mappings/ProgressIndicator.js.map +1 -1
- package/lib/commonjs/mappings/RowBodyIcon.js.map +1 -1
- package/lib/commonjs/mappings/RowHeadlineImageCaption.js.map +1 -1
- package/lib/commonjs/mappings/RowHeadlineImageIcon.js.map +1 -1
- package/lib/commonjs/mappings/Text.js.map +1 -1
- package/lib/commonjs/mappings/TextArea.js.map +1 -1
- package/lib/module/components/DeprecatedCardWrapper.js +5 -4
- package/lib/module/components/DeprecatedCardWrapper.js.map +1 -1
- package/lib/module/components/NumberInput.js +15 -17
- package/lib/module/components/NumberInput.js.map +1 -1
- package/lib/module/components/Swiper/Swiper.js.map +1 -1
- package/lib/module/mappings/ActivityIndicator.js.map +1 -1
- package/lib/module/mappings/AvatarEdit.js.map +1 -1
- package/lib/module/mappings/Icon.js +3 -1
- package/lib/module/mappings/Icon.js.map +1 -1
- package/lib/module/mappings/KeyboardAwareScrollView.js +39 -0
- package/lib/module/mappings/KeyboardAwareScrollView.js.map +1 -0
- package/lib/typescript/src/mappings/Icon.d.ts +1 -1
- package/lib/typescript/src/mappings/KeyboardAwareScrollView.d.ts +82 -0
- package/package.json +3 -3
- package/src/components/NumberInput.js +13 -14
- package/src/components/NumberInput.tsx +16 -31
- package/src/mappings/Icon.js +4 -1
- package/src/mappings/Icon.ts +4 -1
- package/src/mappings/KeyboardAwareScrollView.js +38 -0
- package/src/mappings/KeyboardAwareScrollView.ts +48 -0
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
function _extends() { _extends = Object.assign || 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
|
+
|
|
1
3
|
import React from "react";
|
|
2
4
|
import { withTheme } from "../theming";
|
|
3
5
|
import Touchable from "./Touchable";
|
|
@@ -24,14 +26,13 @@ const Card = _ref => {
|
|
|
24
26
|
...rest
|
|
25
27
|
} = _ref;
|
|
26
28
|
const width = getWidth(numColumns);
|
|
27
|
-
return /*#__PURE__*/React.createElement(Touchable, {
|
|
29
|
+
return /*#__PURE__*/React.createElement(Touchable, _extends({
|
|
28
30
|
disabled: !onPress,
|
|
29
31
|
onPress: onPress,
|
|
30
32
|
style: [style, {
|
|
31
33
|
width
|
|
32
|
-
}]
|
|
33
|
-
|
|
34
|
-
}, children);
|
|
34
|
+
}]
|
|
35
|
+
}, rest), children);
|
|
35
36
|
};
|
|
36
37
|
|
|
37
38
|
export default withTheme(Card);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["DeprecatedCardWrapper.
|
|
1
|
+
{"version":3,"sources":["DeprecatedCardWrapper.tsx"],"names":["React","withTheme","Touchable","getWidth","numColumns","Card","children","onPress","style","rest","width"],"mappings":";;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,SAASC,SAAT,QAA0B,YAA1B;AACA,OAAOC,SAAP,MAAsB,aAAtB;;AAYA,MAAMC,QAAQ,GAAIC,UAAD,IAAwB;AACvC,UAAQA,UAAR;AACE,SAAK,CAAL;AACE,aAAO,KAAP;;AACF,SAAK,CAAL;AACE,aAAO,KAAP;;AACF;AACE,aAAO,MAAP;AANJ;AAQD,CATD;;AAWA,MAAMC,IAAqB,GAAG,QAMxB;AAAA,MANyB;AAC7BD,IAAAA,UAAU,GAAG,CADgB;AAE7BE,IAAAA,QAF6B;AAG7BC,IAAAA,OAH6B;AAI7BC,IAAAA,KAJ6B;AAK7B,OAAGC;AAL0B,GAMzB;AACJ,QAAMC,KAAK,GAAGP,QAAQ,CAACC,UAAD,CAAtB;AACA,sBACE,oBAAC,SAAD;AACE,IAAA,QAAQ,EAAE,CAACG,OADb;AAEE,IAAA,OAAO,EAAEA,OAFX;AAGE,IAAA,KAAK,EAAE,CAACC,KAAD,EAAQ;AAAEE,MAAAA;AAAF,KAAR;AAHT,KAIMD,IAJN,GAMGH,QANH,CADF;AAUD,CAlBD;;AAoBA,eAAeL,SAAS,CAACI,IAAD,CAAxB","sourcesContent":["import React from \"react\";\nimport { withTheme } from \"../theming\";\nimport Touchable from \"./Touchable\";\nimport { StyleProp, ViewStyle } from \"react-native\";\nimport theme from \"../styles/DefaultTheme\";\n\ntype Props = {\n numColumns?: number;\n children?: React.ReactNode;\n onPress?: () => void;\n style?: StyleProp<ViewStyle>;\n theme: typeof theme;\n};\n\nconst getWidth = (numColumns: number) => {\n switch (numColumns) {\n case 1:\n return \"33%\";\n case 2:\n return \"50%\";\n default:\n return \"100%\";\n }\n};\n\nconst Card: React.FC<Props> = ({\n numColumns = 3,\n children,\n onPress,\n style,\n ...rest\n}) => {\n const width = getWidth(numColumns);\n return (\n <Touchable\n disabled={!onPress}\n onPress={onPress}\n style={[style, { width }]}\n {...rest}\n >\n {children}\n </Touchable>\n );\n};\n\nexport default withTheme(Card);\n"]}
|
|
@@ -11,15 +11,16 @@ const NumberInput = _ref => {
|
|
|
11
11
|
defaultValue,
|
|
12
12
|
...props
|
|
13
13
|
} = _ref;
|
|
14
|
+
const [currentStringNumberValue, setCurrentStringNumberValue] = useState("0");
|
|
14
15
|
|
|
15
|
-
const formatValueToStringNumber =
|
|
16
|
+
const formatValueToStringNumber = valueToFormat => {
|
|
16
17
|
if (valueToFormat != null) {
|
|
17
18
|
if (isString(valueToFormat) && valueToFormat !== "") {
|
|
18
19
|
if (/^0[1-9]$/.test(valueToFormat)) {
|
|
19
20
|
return valueToFormat.slice(1);
|
|
20
21
|
} else if (/^[+-]?([0-9]+\.?[0-9]*|\.[0-9]+)$/.test(valueToFormat)) {
|
|
21
22
|
return valueToFormat;
|
|
22
|
-
} else
|
|
23
|
+
} else {
|
|
23
24
|
return currentStringNumberValue;
|
|
24
25
|
}
|
|
25
26
|
} else if (isNumber(valueToFormat) && !isNaN(valueToFormat)) {
|
|
@@ -28,31 +29,28 @@ const NumberInput = _ref => {
|
|
|
28
29
|
}
|
|
29
30
|
|
|
30
31
|
return "0";
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
const [currentStringNumberValue, setCurrentStringNumberValue] = useState(formatValueToStringNumber("0"));
|
|
34
|
-
|
|
35
|
-
const handleChangeText = newValue => {
|
|
36
|
-
const newStringNumberValue = formatValueToStringNumber(newValue, currentStringNumberValue);
|
|
37
|
-
const number = parseFloat(newStringNumberValue);
|
|
38
|
-
setCurrentStringNumberValue(newStringNumberValue);
|
|
39
|
-
onChangeText === null || onChangeText === void 0 ? void 0 : onChangeText(number);
|
|
40
|
-
};
|
|
41
|
-
/* set currentStringNumberValue directly to defaultValue if it exists on load
|
|
42
|
-
( no need to use TextInput's defaultValue because its value is always controlled & set ) */
|
|
32
|
+
}; // set currentStringNumberValue as defaultValue prop if there is a differnce on first render only
|
|
43
33
|
|
|
44
34
|
|
|
45
35
|
useEffect(() => {
|
|
46
|
-
const defaultStringNumberValue = formatValueToStringNumber(defaultValue
|
|
36
|
+
const defaultStringNumberValue = formatValueToStringNumber(defaultValue);
|
|
47
37
|
|
|
48
38
|
if (currentStringNumberValue !== defaultStringNumberValue) {
|
|
49
39
|
setCurrentStringNumberValue(defaultStringNumberValue);
|
|
50
40
|
} // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
51
41
|
|
|
52
|
-
}, []);
|
|
42
|
+
}, []);
|
|
43
|
+
|
|
44
|
+
const handleChangeText = newValue => {
|
|
45
|
+
const newStringNumberValue = formatValueToStringNumber(newValue);
|
|
46
|
+
const number = parseFloat(newStringNumberValue);
|
|
47
|
+
setCurrentStringNumberValue(newStringNumberValue);
|
|
48
|
+
onChangeText === null || onChangeText === void 0 ? void 0 : onChangeText(number);
|
|
49
|
+
}; // run handleChangeText with value prop only when value prop changes (and first render to reset currentStringNumberValue)
|
|
50
|
+
|
|
53
51
|
|
|
54
52
|
useEffect(() => {
|
|
55
|
-
const nextStringNumberValue = formatValueToStringNumber(value
|
|
53
|
+
const nextStringNumberValue = formatValueToStringNumber(value);
|
|
56
54
|
|
|
57
55
|
if (currentStringNumberValue !== nextStringNumberValue) {
|
|
58
56
|
handleChangeText(nextStringNumberValue);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["NumberInput.tsx"],"names":["React","useEffect","useState","TextInput","isString","isNumber","isNaN","NumberInput","onChangeText","value","defaultValue","props","
|
|
1
|
+
{"version":3,"sources":["NumberInput.tsx"],"names":["React","useEffect","useState","TextInput","isString","isNumber","isNaN","NumberInput","onChangeText","value","defaultValue","props","currentStringNumberValue","setCurrentStringNumberValue","formatValueToStringNumber","valueToFormat","test","slice","toString","defaultStringNumberValue","handleChangeText","newValue","newStringNumberValue","number","parseFloat","nextStringNumberValue"],"mappings":";;AAAA,OAAOA,KAAP,IAAoBC,SAApB,EAA+BC,QAA/B,QAA+C,OAA/C;AACA,SAASC,SAAT,QAA0B,cAA1B;AACA,SAASC,QAAT,EAAmBC,QAAnB,EAA6BC,KAA7B,QAA0C,QAA1C;;AAQA,MAAMC,WAAsB,GAAG,QAKzB;AAAA,MAL0B;AAC9BC,IAAAA,YAD8B;AAE9BC,IAAAA,KAF8B;AAG9BC,IAAAA,YAH8B;AAI9B,OAAGC;AAJ2B,GAK1B;AACJ,QAAM,CAACC,wBAAD,EAA2BC,2BAA3B,IAA0DX,QAAQ,CAAC,GAAD,CAAxE;;AAEA,QAAMY,yBAAyB,GAAIC,aAAD,IAAqC;AACrE,QAAIA,aAAa,IAAI,IAArB,EAA2B;AACzB,UAAIX,QAAQ,CAACW,aAAD,CAAR,IAA2BA,aAAa,KAAK,EAAjD,EAAqD;AACnD,YAAI,WAAWC,IAAX,CAAgBD,aAAhB,CAAJ,EAAoC;AAClC,iBAAOA,aAAa,CAACE,KAAd,CAAoB,CAApB,CAAP;AACD,SAFD,MAEO,IAAI,oCAAoCD,IAApC,CAAyCD,aAAzC,CAAJ,EAA6D;AAClE,iBAAOA,aAAP;AACD,SAFM,MAEA;AACL,iBAAOH,wBAAP;AACD;AACF,OARD,MAQO,IAAIP,QAAQ,CAACU,aAAD,CAAR,IAA2B,CAACT,KAAK,CAACS,aAAD,CAArC,EAAsD;AAC3D,eAAOA,aAAa,CAACG,QAAd,EAAP;AACD;AACF;;AAED,WAAO,GAAP;AACD,GAhBD,CAHI,CAqBJ;;;AACAjB,EAAAA,SAAS,CAAC,MAAM;AACd,UAAMkB,wBAAwB,GAAGL,yBAAyB,CAACJ,YAAD,CAA1D;;AAEA,QAAIE,wBAAwB,KAAKO,wBAAjC,EAA2D;AACzDN,MAAAA,2BAA2B,CAACM,wBAAD,CAA3B;AACD,KALa,CAMd;;AACD,GAPQ,EAON,EAPM,CAAT;;AASA,QAAMC,gBAAgB,GAAIC,QAAD,IAAsB;AAC7C,UAAMC,oBAAoB,GAAGR,yBAAyB,CAACO,QAAD,CAAtD;AACA,UAAME,MAAM,GAAGC,UAAU,CAACF,oBAAD,CAAzB;AAEAT,IAAAA,2BAA2B,CAACS,oBAAD,CAA3B;AACAd,IAAAA,YAAY,SAAZ,IAAAA,YAAY,WAAZ,YAAAA,YAAY,CAAGe,MAAH,CAAZ;AACD,GAND,CA/BI,CAuCJ;;;AACAtB,EAAAA,SAAS,CAAC,MAAM;AACd,UAAMwB,qBAAqB,GAAGX,yBAAyB,CAACL,KAAD,CAAvD;;AAEA,QAAIG,wBAAwB,KAAKa,qBAAjC,EAAwD;AACtDL,MAAAA,gBAAgB,CAACK,qBAAD,CAAhB;AACD,KALa,CAMd;;AACD,GAPQ,EAON,CAAChB,KAAD,CAPM,CAAT;AASA,sBACE,oBAAC,SAAD;AACE,IAAA,YAAY,EAAC,SADf;AAEE,IAAA,KAAK,EAAEG,wBAFT;AAGE,IAAA,YAAY,EAAEQ;AAHhB,KAIMT,KAJN,EADF;AAQD,CA9DD;;AAgEA,eAAeJ,WAAf","sourcesContent":["import React, { FC, useEffect, useState } from \"react\";\nimport { TextInput } from \"react-native\";\nimport { isString, isNumber, isNaN } from \"lodash\";\n\ninterface Props {\n value?: number | string;\n defaultValue?: number | string;\n onChangeText?: (value?: number) => void;\n}\n\nconst NumberInput: FC<Props> = ({\n onChangeText,\n value,\n defaultValue,\n ...props\n}) => {\n const [currentStringNumberValue, setCurrentStringNumberValue] = useState(\"0\");\n\n const formatValueToStringNumber = (valueToFormat?: number | string) => {\n if (valueToFormat != null) {\n if (isString(valueToFormat) && valueToFormat !== \"\") {\n if (/^0[1-9]$/.test(valueToFormat)) {\n return valueToFormat.slice(1);\n } else if (/^[+-]?([0-9]+\\.?[0-9]*|\\.[0-9]+)$/.test(valueToFormat)) {\n return valueToFormat;\n } else {\n return currentStringNumberValue;\n }\n } else if (isNumber(valueToFormat) && !isNaN(valueToFormat)) {\n return valueToFormat.toString();\n }\n }\n\n return \"0\";\n };\n\n // set currentStringNumberValue as defaultValue prop if there is a differnce on first render only\n useEffect(() => {\n const defaultStringNumberValue = formatValueToStringNumber(defaultValue);\n\n if (currentStringNumberValue !== defaultStringNumberValue) {\n setCurrentStringNumberValue(defaultStringNumberValue);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n const handleChangeText = (newValue: string) => {\n const newStringNumberValue = formatValueToStringNumber(newValue);\n const number = parseFloat(newStringNumberValue);\n\n setCurrentStringNumberValue(newStringNumberValue);\n onChangeText?.(number);\n };\n\n // run handleChangeText with value prop only when value prop changes (and first render to reset currentStringNumberValue)\n useEffect(() => {\n const nextStringNumberValue = formatValueToStringNumber(value);\n\n if (currentStringNumberValue !== nextStringNumberValue) {\n handleChangeText(nextStringNumberValue);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [value]);\n\n return (\n <TextInput\n keyboardType=\"numeric\"\n value={currentStringNumberValue}\n onChangeText={handleChangeText}\n {...props}\n />\n );\n};\n\nexport default NumberInput;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["Swiper.
|
|
1
|
+
{"version":3,"sources":["Swiper.js"],"names":["React","View","SwiperComponent","Swiper","vertical","loop","timeout","from","prevTitle","nextTitle","prevTitleColor","nextTitleColor","dotsTouchable","dotColor","dotActiveColor","children","style","createElement","controlsProps","prevTitleStyle","color","nextTitleStyle","dotProps","badgeStyle","backgroundColor","dotActiveStyle"],"mappings":"AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,SAASC,IAAT,QAAqB,cAArB;AACA,OAAOC,eAAP,MAA4B,yBAA5B;;AACA,MAAMC,MAAM,GAAG;AAAA,MAAC;AAAEC,IAAAA,QAAQ,GAAG,KAAb;AAAoBC,IAAAA,IAAI,GAAG,KAA3B;AAAkCC,IAAAA,OAAO,GAAG,CAA5C;AAA+CC,IAAAA,IAAI,GAAG,CAAtD;AAAyDC,IAAAA,SAAS,GAAG,EAArE;AAAyEC,IAAAA,SAAS,GAAG,EAArF;AAAyFC,IAAAA,cAAzF;AAAyGC,IAAAA,cAAzG;AAAyHC,IAAAA,aAAa,GAAG,IAAzI;AAA+IC,IAAAA,QAA/I;AAAyJC,IAAAA,cAAzJ;AAAyKC,IAAAA,QAAzK;AAAmLC,IAAAA;AAAnL,GAAD;AAAA,sBAAkMhB,KAAK,CAACiB,aAAN,CAAoBhB,IAApB,EAA0B;AAAEe,IAAAA,KAAK,EAAEA;AAAT,GAA1B,eAC7MhB,KAAK,CAACiB,aAAN,CAAoBf,eAApB,EAAqC;AAAEK,IAAAA,IAAI,EAAEA,IAAR;AAAcF,IAAAA,IAAI,EAAEA,IAApB;AAA0BC,IAAAA,OAAO,EAAEA,OAAnC;AAA4CF,IAAAA,QAAQ,EAAEA,QAAtD;AAAgEc,IAAAA,aAAa,EAAE;AAC5GV,MAAAA,SAD4G;AAE5GC,MAAAA,SAF4G;AAG5GU,MAAAA,cAAc,EAAE;AAAEC,QAAAA,KAAK,EAAEV;AAAT,OAH4F;AAI5GW,MAAAA,cAAc,EAAE;AAAED,QAAAA,KAAK,EAAET;AAAT,OAJ4F;AAK5GC,MAAAA,aAL4G;AAM5G,UAAIC,QAAQ,GACN;AAAES,QAAAA,QAAQ,EAAE;AAAEC,UAAAA,UAAU,EAAE;AAAEC,YAAAA,eAAe,EAAEX;AAAnB;AAAd;AAAZ,OADM,GAEN,EAFN,CAN4G;AAS5G,UAAIC,cAAc,GACZ;AAAEW,QAAAA,cAAc,EAAE;AAAED,UAAAA,eAAe,EAAEV;AAAnB;AAAlB,OADY,GAEZ,EAFN;AAT4G;AAA/E,GAArC,EAYSC,QAZT,CAD6M,CAAlM;AAAA,CAAf;;AAcA,eAAeZ,MAAf","sourcesContent":["import React from \"react\";\nimport { View } from \"react-native\";\nimport SwiperComponent from \"react-native-web-swiper\";\nconst Swiper = ({ vertical = false, loop = false, timeout = 0, from = 0, prevTitle = \"\", nextTitle = \"\", prevTitleColor, nextTitleColor, dotsTouchable = true, dotColor, dotActiveColor, children, style, }) => (React.createElement(View, { style: style },\n React.createElement(SwiperComponent, { from: from, loop: loop, timeout: timeout, vertical: vertical, controlsProps: {\n prevTitle,\n nextTitle,\n prevTitleStyle: { color: prevTitleColor },\n nextTitleStyle: { color: nextTitleColor },\n dotsTouchable,\n ...(dotColor\n ? { dotProps: { badgeStyle: { backgroundColor: dotColor } } }\n : {}),\n ...(dotActiveColor\n ? { dotActiveStyle: { backgroundColor: dotActiveColor } }\n : {}),\n } }, children)));\nexport default Swiper;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["ActivityIndicator.
|
|
1
|
+
{"version":3,"sources":["ActivityIndicator.ts"],"names":["COMPONENT_TYPES","FORM_TYPES","PROP_TYPES","GROUPS","SEED_DATA","name","tag","description","doc_link","code_link","category","input","layout","width","height","props","size","label","options","formType","flatArray","propType","STRING","editable","required","defaultValue","group","basic","animating","boolean","BOOLEAN","hidesWhenStopped","color","THEME"],"mappings":"AAAA,SACEA,eADF,EAEEC,UAFF,EAGEC,UAHF,EAIEC,MAJF,QAKO,iBALP;AAOA,OAAO,MAAMC,SAAS,GAAG;AACvBC,EAAAA,IAAI,EAAE,oBADiB;AAEvBC,EAAAA,GAAG,EAAE,mBAFkB;AAGvBC,EAAAA,WAAW,EAAE,wCAHU;AAIvBC,EAAAA,QAAQ,EACN,sEALqB;AAMvBC,EAAAA,SAAS,EACP,2IAPqB;AAQvBC,EAAAA,QAAQ,EAAEV,eAAe,CAACW,KARH;AASvBC,EAAAA,MAAM,EAAE;AAAEC,IAAAA,KAAK,EAAE,EAAT;AAAaC,IAAAA,MAAM,EAAE;AAArB,GATe;AAUvBC,EAAAA,KAAK,EAAE;AACLC,IAAAA,IAAI,EAAE;AACJC,MAAAA,KAAK,EAAE,MADH;AAEJV,MAAAA,WAAW,EAAE,oDAFT;AAGJW,MAAAA,OAAO,EAAE,CAAC,OAAD,EAAU,OAAV,CAHL;AAIJC,MAAAA,QAAQ,EAAElB,UAAU,CAACmB,SAJjB;AAKJC,MAAAA,QAAQ,EAAEnB,UAAU,CAACoB,MALjB;AAMJC,MAAAA,QAAQ,EAAE,IANN;AAOJC,MAAAA,QAAQ,EAAE,KAPN;AAQJC,MAAAA,YAAY,EAAE,OARV;AASJC,MAAAA,KAAK,EAAEvB,MAAM,CAACwB;AATV,KADD;AAYLC,IAAAA,SAAS,EAAE;AACTX,MAAAA,KAAK,EAAE,UADE;AAETV,MAAAA,WAAW,EAAE,uDAFJ;AAGTY,MAAAA,QAAQ,EAAElB,UAAU,CAAC4B,OAHZ;AAITR,MAAAA,QAAQ,EAAEnB,UAAU,CAAC4B,OAJZ;AAKTP,MAAAA,QAAQ,EAAE,IALD;AAMTC,MAAAA,QAAQ,EAAE,KAND;AAOTC,MAAAA,YAAY,EAAE,IAPL;AAQTC,MAAAA,KAAK,EAAEvB,MAAM,CAACwB;AARL,KAZN;AAsBLI,IAAAA,gBAAgB,EAAE;AAChBd,MAAAA,KAAK,EAAE,mBADS;AAEhBV,MAAAA,WAAW,EACT,sEAHc;AAIhBY,MAAAA,QAAQ,EAAElB,UAAU,CAAC4B,OAJL;AAKhBR,MAAAA,QAAQ,EAAEnB,UAAU,CAAC4B,OALL;AAMhBP,MAAAA,QAAQ,EAAE,IANM;AAOhBC,MAAAA,QAAQ,EAAE,KAPM;AAQhBC,MAAAA,YAAY,EAAE,IARE;AAShBC,MAAAA,KAAK,EAAEvB,MAAM,CAACwB;AATE,KAtBb;AAiCLK,IAAAA,KAAK,EAAE;AACLf,MAAAA,KAAK,EAAE,OADF;AAELV,MAAAA,WAAW,EAAE,oDAFR;AAGLY,MAAAA,QAAQ,EAAElB,UAAU,CAAC+B,KAHhB;AAILX,MAAAA,QAAQ,EAAEnB,UAAU,CAAC+B,KAJhB;AAKLV,MAAAA,QAAQ,EAAE,IALL;AAMLC,MAAAA,QAAQ,EAAE,KANL;AAOLC,MAAAA,YAAY,EAAE,IAPT;AAQLC,MAAAA,KAAK,EAAEvB,MAAM,CAACwB;AART;AAjCF;AAVgB,CAAlB","sourcesContent":["import {\n COMPONENT_TYPES,\n FORM_TYPES,\n PROP_TYPES,\n GROUPS,\n} from \"@draftbit/types\";\n\nexport const SEED_DATA = {\n name: \"Activity Indicator\",\n tag: \"ActivityIndicator\",\n description: \"Displays a circular loading indicator.\",\n doc_link:\n \"https://docs.expo.io/versions/latest/react-native/activityindicator/\",\n code_link:\n \"https://github.com/expo/expo/blob/master/ios/versioned-react-native/ABI32_0_0/Libraries/Components/ActivityIndicator/ActivityIndicator.js\",\n category: COMPONENT_TYPES.input,\n layout: { width: 36, height: 36 },\n props: {\n size: {\n label: \"Size\",\n description: \"The size of the loading indicator (Default: small)\",\n options: [\"small\", \"large\"],\n formType: FORM_TYPES.flatArray,\n propType: PROP_TYPES.STRING,\n editable: true,\n required: false,\n defaultValue: \"small\",\n group: GROUPS.basic,\n },\n animating: {\n label: \"Spinning\",\n description: \"Whether to show the loading indicator (Default: true)\",\n formType: FORM_TYPES.boolean,\n propType: PROP_TYPES.BOOLEAN,\n editable: true,\n required: false,\n defaultValue: true,\n group: GROUPS.basic,\n },\n hidesWhenStopped: {\n label: \"Hide When Stopped\",\n description:\n \"Whether the indicator should hide when not animating (Default: true)\",\n formType: FORM_TYPES.boolean,\n propType: PROP_TYPES.BOOLEAN,\n editable: true,\n required: false,\n defaultValue: true,\n group: GROUPS.basic,\n },\n color: {\n label: \"Color\",\n description: \"The color of the loading indicator (Default: gray)\",\n formType: FORM_TYPES.color,\n propType: PROP_TYPES.THEME,\n editable: true,\n required: false,\n defaultValue: null,\n group: GROUPS.basic,\n },\n },\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["AvatarEdit.
|
|
1
|
+
{"version":3,"sources":["AvatarEdit.js"],"names":["GROUPS","COMPONENT_TYPES","FORM_TYPES","PROP_TYPES","SEED_DATA","name","tag","description","category","deprecated","layout","width","height","props","size","group","basic","label","editable","required","formType","number","propType","NUMBER","min","max","precision","step","defaultValue","image","data","ASSET"],"mappings":"AAAA,SAASA,MAAT,EAAiBC,eAAjB,EAAkCC,UAAlC,EAA8CC,UAA9C,QAAiE,iBAAjE;AACA,OAAO,MAAMC,SAAS,GAAG;AACrBC,EAAAA,IAAI,EAAE,aADe;AAErBC,EAAAA,GAAG,EAAE,YAFgB;AAGrBC,EAAAA,WAAW,EAAE,8CAHQ;AAIrBC,EAAAA,QAAQ,EAAEP,eAAe,CAACQ,UAJL;AAKrBC,EAAAA,MAAM,EAAE;AACJC,IAAAA,KAAK,EAAE,EADH;AAEJC,IAAAA,MAAM,EAAE;AAFJ,GALa;AASrBC,EAAAA,KAAK,EAAE;AACHC,IAAAA,IAAI,EAAE;AACFC,MAAAA,KAAK,EAAEf,MAAM,CAACgB,KADZ;AAEFC,MAAAA,KAAK,EAAE,MAFL;AAGFV,MAAAA,WAAW,EAAE,gCAHX;AAIFW,MAAAA,QAAQ,EAAE,IAJR;AAKFC,MAAAA,QAAQ,EAAE,KALR;AAMFC,MAAAA,QAAQ,EAAElB,UAAU,CAACmB,MANnB;AAOFC,MAAAA,QAAQ,EAAEnB,UAAU,CAACoB,MAPnB;AAQFC,MAAAA,GAAG,EAAE,CARH;AASFC,MAAAA,GAAG,EAAE,GATH;AAUFC,MAAAA,SAAS,EAAE,CAVT;AAWFC,MAAAA,IAAI,EAAE,CAXJ;AAYFC,MAAAA,YAAY,EAAE;AAZZ,KADH;AAeHC,IAAAA,KAAK,EAAE;AACHd,MAAAA,KAAK,EAAEf,MAAM,CAAC8B,IADX;AAEHb,MAAAA,KAAK,EAAE,OAFJ;AAGHV,MAAAA,WAAW,EAAE,mBAHV;AAIHW,MAAAA,QAAQ,EAAE,IAJP;AAKHC,MAAAA,QAAQ,EAAE,IALP;AAMHC,MAAAA,QAAQ,EAAElB,UAAU,CAAC2B,KANlB;AAOHP,MAAAA,QAAQ,EAAEnB,UAAU,CAAC4B,KAPlB;AAQHH,MAAAA,YAAY,EAAE;AARX;AAfJ;AATc,CAAlB","sourcesContent":["import { GROUPS, COMPONENT_TYPES, FORM_TYPES, PROP_TYPES, } from \"@draftbit/types\";\nexport const SEED_DATA = {\n name: \"Avatar Edit\",\n tag: \"AvatarEdit\",\n description: \"An avatar with an edit icon in the top right\",\n category: COMPONENT_TYPES.deprecated,\n layout: {\n width: 64,\n height: 64,\n },\n props: {\n size: {\n group: GROUPS.basic,\n label: \"Size\",\n description: \"Size of avatar / width, height\",\n editable: true,\n required: false,\n formType: FORM_TYPES.number,\n propType: PROP_TYPES.NUMBER,\n min: 0,\n max: 300,\n precision: 0,\n step: 1,\n defaultValue: 80,\n },\n image: {\n group: GROUPS.data,\n label: \"Image\",\n description: \"Name of the image\",\n editable: true,\n required: true,\n formType: FORM_TYPES.image,\n propType: PROP_TYPES.ASSET,\n defaultValue: \"brightness-5\",\n },\n },\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["Icon.ts"],"names":["COMPONENT_TYPES","GROUPS","createNumberProp","createColorProp","createIconProp","SEED_DATA","name","tag","description","category","basic","layout","props","
|
|
1
|
+
{"version":3,"sources":["Icon.ts"],"names":["COMPONENT_TYPES","GROUPS","createNumberProp","createColorProp","createIconProp","SEED_DATA","name","tag","description","category","basic","layout","props","group","data","color","size","label","defaultValue","min","max","step","precision"],"mappings":"AAAA,SACEA,eADF,EAEEC,MAFF,EAGEC,gBAHF,EAIEC,eAJF,EAKEC,cALF,QAMO,iBANP;AAQA,OAAO,MAAMC,SAAS,GAAG;AACvBC,EAAAA,IAAI,EAAE,MADiB;AAEvBC,EAAAA,GAAG,EAAE,MAFkB;AAGvBC,EAAAA,WAAW,EAAE,SAHU;AAIvBC,EAAAA,QAAQ,EAAET,eAAe,CAACU,KAJH;AAKvBC,EAAAA,MAAM,EAAE,EALe;AAMvBC,EAAAA,KAAK,EAAE;AACLN,IAAAA,IAAI,EAAE,EACJ,GAAGF,cAAc,EADb;AAEJS,MAAAA,KAAK,EAAEZ,MAAM,CAACa;AAFV,KADD;AAKLC,IAAAA,KAAK,EAAEZ,eAAe,EALjB;AAMLa,IAAAA,IAAI,EAAEd,gBAAgB,CAAC;AACrBW,MAAAA,KAAK,EAAEZ,MAAM,CAACS,KADO;AAErBO,MAAAA,KAAK,EAAE,MAFc;AAGrBT,MAAAA,WAAW,EAAE,+BAHQ;AAIrBU,MAAAA,YAAY,EAAE,EAJO;AAKrBC,MAAAA,GAAG,EAAE,EALgB;AAMrBC,MAAAA,GAAG,EAAE,GANgB;AAOrBC,MAAAA,IAAI,EAAE,CAPe;AAQrBC,MAAAA,SAAS,EAAE;AARU,KAAD;AANjB;AANgB,CAAlB","sourcesContent":["import {\n COMPONENT_TYPES,\n GROUPS,\n createNumberProp,\n createColorProp,\n createIconProp,\n} from \"@draftbit/types\";\n\nexport const SEED_DATA = {\n name: \"Icon\",\n tag: \"Icon\",\n description: \"An icon\",\n category: COMPONENT_TYPES.basic,\n layout: {},\n props: {\n name: {\n ...createIconProp(),\n group: GROUPS.data,\n },\n color: createColorProp(),\n size: createNumberProp({\n group: GROUPS.basic,\n label: \"Size\",\n description: \"Width and height of your icon\",\n defaultValue: 24,\n min: 16,\n max: 128,\n step: 1,\n precision: 0,\n }),\n },\n};\n"]}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { COMPONENT_TYPES, createStaticBoolProp, createStaticNumberProp } from "@draftbit/types";
|
|
2
|
+
export const SEED_DATA = {
|
|
3
|
+
name: "Keyboard Aware Scroll View",
|
|
4
|
+
tag: "KeyboardAwareScrollView",
|
|
5
|
+
description: "View that moves pushes the content when virtual keyboard is open.",
|
|
6
|
+
category: COMPONENT_TYPES.layout,
|
|
7
|
+
layout: {},
|
|
8
|
+
props: {
|
|
9
|
+
viewIsInsideTabBar: createStaticBoolProp({
|
|
10
|
+
label: "View Is Inside TabBar",
|
|
11
|
+
description: "Adds an extra offset that represents the TabBarIOS height."
|
|
12
|
+
}),
|
|
13
|
+
enableAutomaticScroll: createStaticBoolProp({
|
|
14
|
+
label: "Enable Automatic Scroll",
|
|
15
|
+
description: "When focus in TextInput will scroll the position, default is enabled"
|
|
16
|
+
}),
|
|
17
|
+
extraHeight: createStaticNumberProp({
|
|
18
|
+
label: "Extra Height",
|
|
19
|
+
description: "Adds an extra offset when focusing the TextInputs"
|
|
20
|
+
}),
|
|
21
|
+
extraScrollHeight: createStaticNumberProp({
|
|
22
|
+
label: "Extra Scroll Height",
|
|
23
|
+
description: "Adds an extra offset to the keyboard. Useful if you want to stick elements above the keyboard"
|
|
24
|
+
}),
|
|
25
|
+
enableResetScrollToCoords: createStaticBoolProp({
|
|
26
|
+
label: "Enable Reset Scroll To Coordinates",
|
|
27
|
+
description: "Lets the user enable or disable automatic resetScrollToCoords"
|
|
28
|
+
}),
|
|
29
|
+
keyboardOpeningTime: createStaticNumberProp({
|
|
30
|
+
label: "Keyboard Opening Time",
|
|
31
|
+
description: "Sets the delay time before scrolling to new position, default is 250"
|
|
32
|
+
}),
|
|
33
|
+
enableOnAndroid: createStaticBoolProp({
|
|
34
|
+
label: "Enable On Android",
|
|
35
|
+
description: "Enable Android Support"
|
|
36
|
+
})
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
//# sourceMappingURL=KeyboardAwareScrollView.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["KeyboardAwareScrollView.ts"],"names":["COMPONENT_TYPES","createStaticBoolProp","createStaticNumberProp","SEED_DATA","name","tag","description","category","layout","props","viewIsInsideTabBar","label","enableAutomaticScroll","extraHeight","extraScrollHeight","enableResetScrollToCoords","keyboardOpeningTime","enableOnAndroid"],"mappings":"AAAA,SACEA,eADF,EAEEC,oBAFF,EAGEC,sBAHF,QAIO,iBAJP;AAMA,OAAO,MAAMC,SAAS,GAAG;AACvBC,EAAAA,IAAI,EAAE,4BADiB;AAEvBC,EAAAA,GAAG,EAAE,yBAFkB;AAGvBC,EAAAA,WAAW,EACT,mEAJqB;AAKvBC,EAAAA,QAAQ,EAAEP,eAAe,CAACQ,MALH;AAMvBA,EAAAA,MAAM,EAAE,EANe;AAOvBC,EAAAA,KAAK,EAAE;AACLC,IAAAA,kBAAkB,EAAET,oBAAoB,CAAC;AACvCU,MAAAA,KAAK,EAAE,uBADgC;AAEvCL,MAAAA,WAAW,EAAE;AAF0B,KAAD,CADnC;AAKLM,IAAAA,qBAAqB,EAAEX,oBAAoB,CAAC;AAC1CU,MAAAA,KAAK,EAAE,yBADmC;AAE1CL,MAAAA,WAAW,EACT;AAHwC,KAAD,CALtC;AAULO,IAAAA,WAAW,EAAEX,sBAAsB,CAAC;AAClCS,MAAAA,KAAK,EAAE,cAD2B;AAElCL,MAAAA,WAAW,EAAE;AAFqB,KAAD,CAV9B;AAcLQ,IAAAA,iBAAiB,EAAEZ,sBAAsB,CAAC;AACxCS,MAAAA,KAAK,EAAE,qBADiC;AAExCL,MAAAA,WAAW,EACT;AAHsC,KAAD,CAdpC;AAmBLS,IAAAA,yBAAyB,EAAEd,oBAAoB,CAAC;AAC9CU,MAAAA,KAAK,EAAE,oCADuC;AAE9CL,MAAAA,WAAW,EACT;AAH4C,KAAD,CAnB1C;AAwBLU,IAAAA,mBAAmB,EAAEd,sBAAsB,CAAC;AAC1CS,MAAAA,KAAK,EAAE,uBADmC;AAE1CL,MAAAA,WAAW,EACT;AAHwC,KAAD,CAxBtC;AA6BLW,IAAAA,eAAe,EAAEhB,oBAAoB,CAAC;AACpCU,MAAAA,KAAK,EAAE,mBAD6B;AAEpCL,MAAAA,WAAW,EAAE;AAFuB,KAAD;AA7BhC;AAPgB,CAAlB","sourcesContent":["import {\n COMPONENT_TYPES,\n createStaticBoolProp,\n createStaticNumberProp,\n} from \"@draftbit/types\";\n\nexport const SEED_DATA = {\n name: \"Keyboard Aware Scroll View\",\n tag: \"KeyboardAwareScrollView\",\n description:\n \"View that moves pushes the content when virtual keyboard is open.\",\n category: COMPONENT_TYPES.layout,\n layout: {},\n props: {\n viewIsInsideTabBar: createStaticBoolProp({\n label: \"View Is Inside TabBar\",\n description: \"Adds an extra offset that represents the TabBarIOS height.\",\n }),\n enableAutomaticScroll: createStaticBoolProp({\n label: \"Enable Automatic Scroll\",\n description:\n \"When focus in TextInput will scroll the position, default is enabled\",\n }),\n extraHeight: createStaticNumberProp({\n label: \"Extra Height\",\n description: \"Adds an extra offset when focusing the TextInputs\",\n }),\n extraScrollHeight: createStaticNumberProp({\n label: \"Extra Scroll Height\",\n description:\n \"Adds an extra offset to the keyboard. Useful if you want to stick elements above the keyboard\",\n }),\n enableResetScrollToCoords: createStaticBoolProp({\n label: \"Enable Reset Scroll To Coordinates\",\n description:\n \"Lets the user enable or disable automatic resetScrollToCoords\",\n }),\n keyboardOpeningTime: createStaticNumberProp({\n label: \"Keyboard Opening Time\",\n description:\n \"Sets the delay time before scrolling to new position, default is 250\",\n }),\n enableOnAndroid: createStaticBoolProp({\n label: \"Enable On Android\",\n description: \"Enable Android Support\",\n }),\n },\n};\n"]}
|
|
@@ -6,6 +6,7 @@ export declare const SEED_DATA: {
|
|
|
6
6
|
layout: {};
|
|
7
7
|
props: {
|
|
8
8
|
name: {
|
|
9
|
+
group: string;
|
|
9
10
|
label: string;
|
|
10
11
|
description: string;
|
|
11
12
|
formType: string;
|
|
@@ -13,7 +14,6 @@ export declare const SEED_DATA: {
|
|
|
13
14
|
defaultValue: string;
|
|
14
15
|
required: boolean;
|
|
15
16
|
editable: boolean;
|
|
16
|
-
group: string;
|
|
17
17
|
};
|
|
18
18
|
color: {
|
|
19
19
|
group: string;
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
export declare const SEED_DATA: {
|
|
2
|
+
name: string;
|
|
3
|
+
tag: string;
|
|
4
|
+
description: string;
|
|
5
|
+
category: string;
|
|
6
|
+
layout: {};
|
|
7
|
+
props: {
|
|
8
|
+
viewIsInsideTabBar: {
|
|
9
|
+
label: string;
|
|
10
|
+
description: string;
|
|
11
|
+
formType: string;
|
|
12
|
+
propType: string;
|
|
13
|
+
defaultValue: boolean;
|
|
14
|
+
editable: boolean;
|
|
15
|
+
required: boolean;
|
|
16
|
+
group: string;
|
|
17
|
+
};
|
|
18
|
+
enableAutomaticScroll: {
|
|
19
|
+
label: string;
|
|
20
|
+
description: string;
|
|
21
|
+
formType: string;
|
|
22
|
+
propType: string;
|
|
23
|
+
defaultValue: boolean;
|
|
24
|
+
editable: boolean;
|
|
25
|
+
required: boolean;
|
|
26
|
+
group: string;
|
|
27
|
+
};
|
|
28
|
+
extraHeight: {
|
|
29
|
+
label: string;
|
|
30
|
+
description: string;
|
|
31
|
+
formType: string;
|
|
32
|
+
propType: string;
|
|
33
|
+
group: string;
|
|
34
|
+
defaultValue: null;
|
|
35
|
+
editable: boolean;
|
|
36
|
+
required: boolean;
|
|
37
|
+
step: number;
|
|
38
|
+
};
|
|
39
|
+
extraScrollHeight: {
|
|
40
|
+
label: string;
|
|
41
|
+
description: string;
|
|
42
|
+
formType: string;
|
|
43
|
+
propType: string;
|
|
44
|
+
group: string;
|
|
45
|
+
defaultValue: null;
|
|
46
|
+
editable: boolean;
|
|
47
|
+
required: boolean;
|
|
48
|
+
step: number;
|
|
49
|
+
};
|
|
50
|
+
enableResetScrollToCoords: {
|
|
51
|
+
label: string;
|
|
52
|
+
description: string;
|
|
53
|
+
formType: string;
|
|
54
|
+
propType: string;
|
|
55
|
+
defaultValue: boolean;
|
|
56
|
+
editable: boolean;
|
|
57
|
+
required: boolean;
|
|
58
|
+
group: string;
|
|
59
|
+
};
|
|
60
|
+
keyboardOpeningTime: {
|
|
61
|
+
label: string;
|
|
62
|
+
description: string;
|
|
63
|
+
formType: string;
|
|
64
|
+
propType: string;
|
|
65
|
+
group: string;
|
|
66
|
+
defaultValue: null;
|
|
67
|
+
editable: boolean;
|
|
68
|
+
required: boolean;
|
|
69
|
+
step: number;
|
|
70
|
+
};
|
|
71
|
+
enableOnAndroid: {
|
|
72
|
+
label: string;
|
|
73
|
+
description: string;
|
|
74
|
+
formType: string;
|
|
75
|
+
propType: string;
|
|
76
|
+
defaultValue: boolean;
|
|
77
|
+
editable: boolean;
|
|
78
|
+
required: boolean;
|
|
79
|
+
group: string;
|
|
80
|
+
};
|
|
81
|
+
};
|
|
82
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@draftbit/core",
|
|
3
|
-
"version": "43.4.
|
|
3
|
+
"version": "43.4.11-421a19.2+421a1949",
|
|
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": "^43.4.
|
|
44
|
+
"@draftbit/types": "^43.4.10",
|
|
45
45
|
"@material-ui/core": "^4.11.0",
|
|
46
46
|
"@material-ui/pickers": "^3.2.10",
|
|
47
47
|
"@react-native-community/slider": "4.1.7",
|
|
@@ -80,5 +80,5 @@
|
|
|
80
80
|
]
|
|
81
81
|
]
|
|
82
82
|
},
|
|
83
|
-
"gitHead": "
|
|
83
|
+
"gitHead": "421a1949982ee262ed6188497586ca441786dfee"
|
|
84
84
|
}
|
|
@@ -2,7 +2,8 @@ import React, { useEffect, useState } from "react";
|
|
|
2
2
|
import { TextInput } from "react-native";
|
|
3
3
|
import { isString, isNumber, isNaN } from "lodash";
|
|
4
4
|
const NumberInput = ({ onChangeText, value, defaultValue, ...props }) => {
|
|
5
|
-
const
|
|
5
|
+
const [currentStringNumberValue, setCurrentStringNumberValue] = useState("0");
|
|
6
|
+
const formatValueToStringNumber = (valueToFormat) => {
|
|
6
7
|
if (valueToFormat != null) {
|
|
7
8
|
if (isString(valueToFormat) && valueToFormat !== "") {
|
|
8
9
|
if (/^0[1-9]$/.test(valueToFormat)) {
|
|
@@ -11,7 +12,7 @@ const NumberInput = ({ onChangeText, value, defaultValue, ...props }) => {
|
|
|
11
12
|
else if (/^[+-]?([0-9]+\.?[0-9]*|\.[0-9]+)$/.test(valueToFormat)) {
|
|
12
13
|
return valueToFormat;
|
|
13
14
|
}
|
|
14
|
-
else
|
|
15
|
+
else {
|
|
15
16
|
return currentStringNumberValue;
|
|
16
17
|
}
|
|
17
18
|
}
|
|
@@ -21,25 +22,23 @@ const NumberInput = ({ onChangeText, value, defaultValue, ...props }) => {
|
|
|
21
22
|
}
|
|
22
23
|
return "0";
|
|
23
24
|
};
|
|
24
|
-
|
|
25
|
-
const handleChangeText = (newValue) => {
|
|
26
|
-
const newStringNumberValue = formatValueToStringNumber(newValue, currentStringNumberValue);
|
|
27
|
-
const number = parseFloat(newStringNumberValue);
|
|
28
|
-
setCurrentStringNumberValue(newStringNumberValue);
|
|
29
|
-
onChangeText?.(number);
|
|
30
|
-
};
|
|
31
|
-
/* set currentStringNumberValue directly to defaultValue if it exists on load
|
|
32
|
-
( no need to use TextInput's defaultValue because its value is always controlled & set ) */
|
|
25
|
+
// set currentStringNumberValue as defaultValue prop if there is a differnce on first render only
|
|
33
26
|
useEffect(() => {
|
|
34
|
-
const defaultStringNumberValue = formatValueToStringNumber(defaultValue
|
|
27
|
+
const defaultStringNumberValue = formatValueToStringNumber(defaultValue);
|
|
35
28
|
if (currentStringNumberValue !== defaultStringNumberValue) {
|
|
36
29
|
setCurrentStringNumberValue(defaultStringNumberValue);
|
|
37
30
|
}
|
|
38
31
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
39
32
|
}, []);
|
|
40
|
-
|
|
33
|
+
const handleChangeText = (newValue) => {
|
|
34
|
+
const newStringNumberValue = formatValueToStringNumber(newValue);
|
|
35
|
+
const number = parseFloat(newStringNumberValue);
|
|
36
|
+
setCurrentStringNumberValue(newStringNumberValue);
|
|
37
|
+
onChangeText?.(number);
|
|
38
|
+
};
|
|
39
|
+
// run handleChangeText with value prop only when value prop changes (and first render to reset currentStringNumberValue)
|
|
41
40
|
useEffect(() => {
|
|
42
|
-
const nextStringNumberValue = formatValueToStringNumber(value
|
|
41
|
+
const nextStringNumberValue = formatValueToStringNumber(value);
|
|
43
42
|
if (currentStringNumberValue !== nextStringNumberValue) {
|
|
44
43
|
handleChangeText(nextStringNumberValue);
|
|
45
44
|
}
|
|
@@ -14,17 +14,16 @@ const NumberInput: FC<Props> = ({
|
|
|
14
14
|
defaultValue,
|
|
15
15
|
...props
|
|
16
16
|
}) => {
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
) => {
|
|
17
|
+
const [currentStringNumberValue, setCurrentStringNumberValue] = useState("0");
|
|
18
|
+
|
|
19
|
+
const formatValueToStringNumber = (valueToFormat?: number | string) => {
|
|
21
20
|
if (valueToFormat != null) {
|
|
22
21
|
if (isString(valueToFormat) && valueToFormat !== "") {
|
|
23
22
|
if (/^0[1-9]$/.test(valueToFormat)) {
|
|
24
23
|
return valueToFormat.slice(1);
|
|
25
24
|
} else if (/^[+-]?([0-9]+\.?[0-9]*|\.[0-9]+)$/.test(valueToFormat)) {
|
|
26
25
|
return valueToFormat;
|
|
27
|
-
} else
|
|
26
|
+
} else {
|
|
28
27
|
return currentStringNumberValue;
|
|
29
28
|
}
|
|
30
29
|
} else if (isNumber(valueToFormat) && !isNaN(valueToFormat)) {
|
|
@@ -35,28 +34,9 @@ const NumberInput: FC<Props> = ({
|
|
|
35
34
|
return "0";
|
|
36
35
|
};
|
|
37
36
|
|
|
38
|
-
|
|
39
|
-
formatValueToStringNumber("0")
|
|
40
|
-
);
|
|
41
|
-
|
|
42
|
-
const handleChangeText = (newValue: string) => {
|
|
43
|
-
const newStringNumberValue = formatValueToStringNumber(
|
|
44
|
-
newValue,
|
|
45
|
-
currentStringNumberValue
|
|
46
|
-
);
|
|
47
|
-
const number = parseFloat(newStringNumberValue);
|
|
48
|
-
|
|
49
|
-
setCurrentStringNumberValue(newStringNumberValue);
|
|
50
|
-
onChangeText?.(number);
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
/* set currentStringNumberValue directly to defaultValue if it exists on load
|
|
54
|
-
( no need to use TextInput's defaultValue because its value is always controlled & set ) */
|
|
37
|
+
// set currentStringNumberValue as defaultValue prop if there is a differnce on first render only
|
|
55
38
|
useEffect(() => {
|
|
56
|
-
const defaultStringNumberValue = formatValueToStringNumber(
|
|
57
|
-
defaultValue,
|
|
58
|
-
currentStringNumberValue
|
|
59
|
-
);
|
|
39
|
+
const defaultStringNumberValue = formatValueToStringNumber(defaultValue);
|
|
60
40
|
|
|
61
41
|
if (currentStringNumberValue !== defaultStringNumberValue) {
|
|
62
42
|
setCurrentStringNumberValue(defaultStringNumberValue);
|
|
@@ -64,12 +44,17 @@ const NumberInput: FC<Props> = ({
|
|
|
64
44
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
65
45
|
}, []);
|
|
66
46
|
|
|
67
|
-
|
|
47
|
+
const handleChangeText = (newValue: string) => {
|
|
48
|
+
const newStringNumberValue = formatValueToStringNumber(newValue);
|
|
49
|
+
const number = parseFloat(newStringNumberValue);
|
|
50
|
+
|
|
51
|
+
setCurrentStringNumberValue(newStringNumberValue);
|
|
52
|
+
onChangeText?.(number);
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
// run handleChangeText with value prop only when value prop changes (and first render to reset currentStringNumberValue)
|
|
68
56
|
useEffect(() => {
|
|
69
|
-
const nextStringNumberValue = formatValueToStringNumber(
|
|
70
|
-
value,
|
|
71
|
-
currentStringNumberValue
|
|
72
|
-
);
|
|
57
|
+
const nextStringNumberValue = formatValueToStringNumber(value);
|
|
73
58
|
|
|
74
59
|
if (currentStringNumberValue !== nextStringNumberValue) {
|
|
75
60
|
handleChangeText(nextStringNumberValue);
|
package/src/mappings/Icon.js
CHANGED
package/src/mappings/Icon.ts
CHANGED
|
@@ -13,7 +13,10 @@ export const SEED_DATA = {
|
|
|
13
13
|
category: COMPONENT_TYPES.basic,
|
|
14
14
|
layout: {},
|
|
15
15
|
props: {
|
|
16
|
-
name:
|
|
16
|
+
name: {
|
|
17
|
+
...createIconProp(),
|
|
18
|
+
group: GROUPS.data,
|
|
19
|
+
},
|
|
17
20
|
color: createColorProp(),
|
|
18
21
|
size: createNumberProp({
|
|
19
22
|
group: GROUPS.basic,
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { COMPONENT_TYPES, createStaticBoolProp, createStaticNumberProp, } from "@draftbit/types";
|
|
2
|
+
export const SEED_DATA = {
|
|
3
|
+
name: "Keyboard Aware Scroll View",
|
|
4
|
+
tag: "KeyboardAwareScrollView",
|
|
5
|
+
description: "View that moves pushes the content when virtual keyboard is open.",
|
|
6
|
+
category: COMPONENT_TYPES.layout,
|
|
7
|
+
layout: {},
|
|
8
|
+
props: {
|
|
9
|
+
viewIsInsideTabBar: createStaticBoolProp({
|
|
10
|
+
label: "View Is Inside TabBar",
|
|
11
|
+
description: "Adds an extra offset that represents the TabBarIOS height.",
|
|
12
|
+
}),
|
|
13
|
+
enableAutomaticScroll: createStaticBoolProp({
|
|
14
|
+
label: "Enable Automatic Scroll",
|
|
15
|
+
description: "When focus in TextInput will scroll the position, default is enabled",
|
|
16
|
+
}),
|
|
17
|
+
extraHeight: createStaticNumberProp({
|
|
18
|
+
label: "Extra Height",
|
|
19
|
+
description: "Adds an extra offset when focusing the TextInputs",
|
|
20
|
+
}),
|
|
21
|
+
extraScrollHeight: createStaticNumberProp({
|
|
22
|
+
label: "Extra Scroll Height",
|
|
23
|
+
description: "Adds an extra offset to the keyboard. Useful if you want to stick elements above the keyboard",
|
|
24
|
+
}),
|
|
25
|
+
enableResetScrollToCoords: createStaticBoolProp({
|
|
26
|
+
label: "Enable Reset Scroll To Coordinates",
|
|
27
|
+
description: "Lets the user enable or disable automatic resetScrollToCoords",
|
|
28
|
+
}),
|
|
29
|
+
keyboardOpeningTime: createStaticNumberProp({
|
|
30
|
+
label: "Keyboard Opening Time",
|
|
31
|
+
description: "Sets the delay time before scrolling to new position, default is 250",
|
|
32
|
+
}),
|
|
33
|
+
enableOnAndroid: createStaticBoolProp({
|
|
34
|
+
label: "Enable On Android",
|
|
35
|
+
description: "Enable Android Support",
|
|
36
|
+
}),
|
|
37
|
+
},
|
|
38
|
+
};
|