@draftbit/core 46.2.2-45fcc3.0 → 46.2.2-ed5a9c.0
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.
|
@@ -27,7 +27,11 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
27
27
|
|
|
28
28
|
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; }
|
|
29
29
|
|
|
30
|
+
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); }
|
|
31
|
+
|
|
30
32
|
const Picker = _ref => {
|
|
33
|
+
var _options$find$label, _options$find;
|
|
34
|
+
|
|
31
35
|
let {
|
|
32
36
|
style,
|
|
33
37
|
options,
|
|
@@ -37,9 +41,6 @@ const Picker = _ref => {
|
|
|
37
41
|
onValueChange: onValueChangeOverride = () => {},
|
|
38
42
|
...props
|
|
39
43
|
} = _ref;
|
|
40
|
-
|
|
41
|
-
var _a, _b;
|
|
42
|
-
|
|
43
44
|
const {
|
|
44
45
|
viewStyles: {
|
|
45
46
|
borderRadius,
|
|
@@ -86,7 +87,7 @@ const Picker = _ref => {
|
|
|
86
87
|
};
|
|
87
88
|
|
|
88
89
|
const stylesWithoutMargin = style && (0, _lodash.default)(_reactNative.StyleSheet.flatten(style), ["margin", "marginTop", "marginRight", "marginBottom", "marginLeft"]);
|
|
89
|
-
const selectedLabel = selectedValue && ((
|
|
90
|
+
const selectedLabel = selectedValue && ((_options$find$label = (_options$find = options.find(o => o.value === selectedValue)) === null || _options$find === void 0 ? void 0 : _options$find.label) !== null && _options$find$label !== void 0 ? _options$find$label : selectedValue);
|
|
90
91
|
return /*#__PURE__*/React.createElement(_Touchable.default, {
|
|
91
92
|
disabled: disabled,
|
|
92
93
|
onPress: toggleFocus,
|
|
@@ -110,27 +111,7 @@ const Picker = _ref => {
|
|
|
110
111
|
key: o.value
|
|
111
112
|
}))), /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
112
113
|
pointerEvents: "none"
|
|
113
|
-
}, /*#__PURE__*/React.createElement(_TextField.default, {
|
|
114
|
-
value: selectedLabel,
|
|
115
|
-
placeholder: placeholder,
|
|
116
|
-
// @ts-ignore
|
|
117
|
-
ref: textField,
|
|
118
|
-
disabled: disabled,
|
|
119
|
-
// @ts-expect-error
|
|
120
|
-
style: stylesWithoutMargin
|
|
121
|
-
}))));
|
|
122
|
-
};
|
|
123
|
-
|
|
124
|
-
const styles = _reactNative.StyleSheet.create({
|
|
125
|
-
container: {
|
|
126
|
-
alignSelf: "stretch"
|
|
127
|
-
}
|
|
128
|
-
});
|
|
129
|
-
|
|
130
|
-
var _default = (0, _theming.withTheme)(Picker);
|
|
131
|
-
|
|
132
|
-
exports.default = _default;
|
|
133
|
-
//# sourceMappingURL=PickerComponent.android.js.mapeElement(_TextField.default, _extends({}, props, {
|
|
114
|
+
}, /*#__PURE__*/React.createElement(_TextField.default, _extends({}, props, {
|
|
134
115
|
value: selectedLabel,
|
|
135
116
|
placeholder: placeholder // @ts-ignore
|
|
136
117
|
,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Picker","style","options","placeholder","selectedValue","disabled","onValueChange","onValueChangeOverride","props","
|
|
1
|
+
{"version":3,"names":["Picker","style","options","placeholder","selectedValue","disabled","onValueChange","onValueChangeOverride","props","viewStyles","borderRadius","borderWidth","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderColor","backgroundColor","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","extractStyles","textField","React","useRef","undefined","itemValue","itemIndex","toggleFocus","current","stylesWithoutMargin","omit","StyleSheet","flatten","selectedLabel","find","o","value","label","styles","container","opacity","position","top","left","right","bottom","width","map","create","alignSelf","withTheme"],"sources":["PickerComponent.android.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { View, StyleSheet } from \"react-native\";\nimport omit from \"lodash.omit\";\nimport { withTheme } from \"../../theming\";\nimport { Picker as NativePicker } from \"@react-native-picker/picker\";\nimport { extractStyles } from \"../../utilities\";\n\nimport TextField from \"../TextField\";\nimport Touchable from \"../Touchable\";\nimport { PickerComponentProps } from \"./PickerTypes\";\n\nconst Picker: React.FC<PickerComponentProps> = ({\n style,\n options,\n placeholder,\n selectedValue,\n disabled = false,\n onValueChange: onValueChangeOverride = () => {},\n ...props\n}) => {\n const {\n viewStyles: {\n borderRadius, // eslint-disable-line @typescript-eslint/no-unused-vars\n borderWidth, // eslint-disable-line @typescript-eslint/no-unused-vars\n borderTopWidth, // eslint-disable-line @typescript-eslint/no-unused-vars\n borderRightWidth, // eslint-disable-line @typescript-eslint/no-unused-vars\n borderBottomWidth, // eslint-disable-line @typescript-eslint/no-unused-vars\n borderLeftWidth, // eslint-disable-line @typescript-eslint/no-unused-vars\n borderColor, // eslint-disable-line @typescript-eslint/no-unused-vars\n backgroundColor, // eslint-disable-line @typescript-eslint/no-unused-vars\n padding, // eslint-disable-line @typescript-eslint/no-unused-vars\n paddingTop, // eslint-disable-line @typescript-eslint/no-unused-vars\n paddingRight, // eslint-disable-line @typescript-eslint/no-unused-vars\n paddingBottom, // eslint-disable-line @typescript-eslint/no-unused-vars\n paddingLeft, // eslint-disable-line @typescript-eslint/no-unused-vars\n ...viewStyles\n },\n } = extractStyles(style);\n\n const textField = React.useRef<typeof TextField | undefined>(undefined);\n\n const onValueChange = (itemValue: string, itemIndex: number) => {\n toggleFocus();\n onValueChangeOverride(itemValue, itemIndex);\n };\n\n const toggleFocus = () => {\n if (!disabled) {\n // @ts-ignore\n textField.current.toggleFocus(); // cannot determine if method exists due to component being wrapped in a withTheme()\n }\n };\n\n const stylesWithoutMargin =\n style &&\n omit(StyleSheet.flatten(style), [\n \"margin\",\n \"marginTop\",\n \"marginRight\",\n \"marginBottom\",\n \"marginLeft\",\n ]);\n\n const selectedLabel =\n selectedValue &&\n (options.find((o) => o.value === selectedValue)?.label ?? selectedValue);\n\n return (\n <Touchable\n disabled={disabled}\n onPress={toggleFocus}\n style={[styles.container, viewStyles]}\n >\n <View>\n <NativePicker\n enabled={!disabled}\n selectedValue={selectedValue}\n onValueChange={onValueChange}\n style={{\n opacity: 0,\n position: \"absolute\",\n top: 0,\n left: 0,\n right: 0,\n bottom: 0,\n width: \"100%\",\n }}\n >\n {options.map((o) => (\n <NativePicker.Item label={o.label} value={o.value} key={o.value} />\n ))}\n </NativePicker>\n <View pointerEvents=\"none\">\n <TextField\n {...props}\n value={selectedLabel}\n placeholder={placeholder}\n // @ts-ignore\n ref={textField} // cannot determine if ref is of correct type due to component being wrapped in a withTheme()\n disabled={disabled}\n // @ts-expect-error\n style={stylesWithoutMargin}\n />\n </View>\n </View>\n </Touchable>\n );\n};\n\nconst styles = StyleSheet.create({\n container: {\n alignSelf: \"stretch\",\n },\n});\n\nexport default withTheme(Picker);\n"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAEA;;AACA;;;;;;;;;;AAGA,MAAMA,MAAsC,GAAG,QAQzC;EAAA;;EAAA,IAR0C;IAC9CC,KAD8C;IAE9CC,OAF8C;IAG9CC,WAH8C;IAI9CC,aAJ8C;IAK9CC,QAAQ,GAAG,KALmC;IAM9CC,aAAa,EAAEC,qBAA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nB;EAHT,gBAKE,oBAAC,iBAAD,qBACE,oBAAC,cAAD;IACE,OAAO,EAAE,CAACJ,QADZ;IAEE,aAAa,EAAED,aAFjB;IAGE,aAAa,EAAEE,aAHjB;IAIE,KAAK,EAAE;MACLqC,OAAO,EAAE,CADJ;MAELC,QAAQ,EAAE,UAFL;MAGLC,GAAG,EAAE,CAHA;MAILC,IAAI,EAAE,CAJD;MAKLC,KAAK,EAAE,CALF;MAMLC,MAAM,EAAE,CANH;MAOLC,KAAK,EAAE;IAPF;EAJT,GAcG/C,OAAO,CAACgD,GAAR,CAAaZ,CAAD,iBACX,oBAAC,cAAD,CAAc,IAAd;IAAmB,KAAK,EAAEA,CAAC,CAACE,KAA5B;IAAmC,KAAK,EAAEF,CAAC,CAACC,KAA5C;IAAmD,GAAG,EAAED,CAAC,CAACC;EAA1D,EADD,CAdH,CADF,eAmBE,oBAAC,iBAAD;IAAM,aAAa,EAAC;EAApB,gBACE,oBAAC,kBAAD,eACM/B,KADN;IAEE,KAAK,EAAE4B,aAFT;IAGE,WAAW,EAAEjC,WAHf,CAIE;IAJF;IAKE,GAAG,EAAEqB,SALP,CAKkB;IALlB;IAME,QAAQ,EAAEnB,QANZ,CAOE;IAPF;IAQE,KAAK,EAAE2B;EART,GADF,CAnBF,CALF,CADF;AAwCD,CAhGD;;AAkGA,MAAMS,MAAM,GAAGP,uBAAA,CAAWiB,MAAX,CAAkB;EAC/BT,SAAS,EAAE;IACTU,SAAS,EAAE;EADF;AADoB,CAAlB,CAAf;;eAMe,IAAAC,kBAAA,EAAUrD,MAAV,C"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@draftbit/core",
|
|
3
|
-
"version": "46.2.2-
|
|
3
|
+
"version": "46.2.2-ed5a9c.0+ed5a9cbd",
|
|
4
4
|
"description": "Core (non-native) Components",
|
|
5
5
|
"main": "lib/commonjs/index.js",
|
|
6
6
|
"module": "lib/module/index.js",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"@date-io/date-fns": "^1.3.13",
|
|
43
43
|
"@draftbit/react-theme-provider": "^2.1.1",
|
|
44
|
-
"@draftbit/types": "^46.2.
|
|
44
|
+
"@draftbit/types": "^46.2.2-ed5a9c.0+ed5a9cbd",
|
|
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",
|
|
@@ -79,5 +79,5 @@
|
|
|
79
79
|
]
|
|
80
80
|
]
|
|
81
81
|
},
|
|
82
|
-
"gitHead": "
|
|
82
|
+
"gitHead": "ed5a9cbdc8d2ff3facabc7307b9a8ff36f571f67"
|
|
83
83
|
}
|