@rahmatsaputra-my-id/react-js-library 0.0.77 → 0.0.79
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/dist/index.es.js
CHANGED
|
@@ -185680,7 +185680,7 @@ var styles$1 = {
|
|
|
185680
185680
|
};
|
|
185681
185681
|
|
|
185682
185682
|
var TextInput = function (_a) {
|
|
185683
|
-
var _b = _a.borderColor, borderColor = _b === void 0 ? colors.gray : _b, _c = _a.borderRadius, borderRadius = _c === void 0 ? 4 : _c, _d = _a.bottom, bottom = _d === void 0 ? 0 : _d, _e = _a.center, center = _e === void 0 ? false : _e, _f = _a.label, label = _f === void 0 ? false : _f, _g = _a.labelError, labelError = _g === void 0 ? false : _g, _h = _a.left, left = _h === void 0 ? 0 : _h, _j = _a.multiline, multiline = _j === void 0 ? false : _j, _k = _a.padding, padding = _k === void 0 ? 0 : _k, _l = _a.right, right = _l === void 0 ? 0 : _l, _m = _a.rows, rows = _m === void 0 ? 1 : _m, _o = _a.maxRows, maxRows = _o === void 0 ? 4 : _o, _p = _a.style, style = _p === void 0 ? {} : _p, _q = _a.styleLabel, styleLabel = _q === void 0 ? {} : _q, _r = _a.styleTextInput, styleTextInput = _r === void 0 ? {} : _r, _s = _a.top, top = _s === void 0 ? 0 : _s, value = _a.value, onChange = _a.onChange, handleOnScanQr = _a.handleOnScanQr, _t = _a.isInputRupiah, isInputRupiah = _t === void 0 ? false : _t, _u = _a.isInputNumber, isInputNumber = _u === void 0 ? false : _u, _v = _a.
|
|
185683
|
+
var _b = _a.borderColor, borderColor = _b === void 0 ? colors.gray : _b, _c = _a.borderRadius, borderRadius = _c === void 0 ? 4 : _c, _d = _a.bottom, bottom = _d === void 0 ? 0 : _d, _e = _a.center, center = _e === void 0 ? false : _e, _f = _a.label, label = _f === void 0 ? false : _f, _g = _a.labelError, labelError = _g === void 0 ? false : _g, _h = _a.left, left = _h === void 0 ? 0 : _h, _j = _a.multiline, multiline = _j === void 0 ? false : _j, _k = _a.padding, padding = _k === void 0 ? 0 : _k, _l = _a.right, right = _l === void 0 ? 0 : _l, _m = _a.rows, rows = _m === void 0 ? 1 : _m, _o = _a.maxRows, maxRows = _o === void 0 ? 4 : _o, _p = _a.style, style = _p === void 0 ? {} : _p, _q = _a.styleLabel, styleLabel = _q === void 0 ? {} : _q, _r = _a.styleTextInput, styleTextInput = _r === void 0 ? {} : _r, _s = _a.top, top = _s === void 0 ? 0 : _s, value = _a.value, onChange = _a.onChange, handleOnScanQr = _a.handleOnScanQr, _t = _a.isInputRupiah, isInputRupiah = _t === void 0 ? false : _t, _u = _a.isInputNumber, isInputNumber = _u === void 0 ? false : _u, _v = _a.isInputPassword, isInputPassword = _v === void 0 ? false : _v, props = __rest(_a, ["borderColor", "borderRadius", "bottom", "center", "label", "labelError", "left", "multiline", "padding", "right", "rows", "maxRows", "style", "styleLabel", "styleTextInput", "top", "value", "onChange", "handleOnScanQr", "isInputRupiah", "isInputNumber", "isInputPassword"]);
|
|
185684
185684
|
var _w = useState(false), isScannerVisible = _w[0], setIsScannerVisible = _w[1];
|
|
185685
185685
|
var _x = useState(false), showPassword = _x[0], setShowPassword = _x[1];
|
|
185686
185686
|
var textAreaRef = useRef(null);
|
|
@@ -185726,14 +185726,14 @@ var TextInput = function (_a) {
|
|
|
185726
185726
|
}, [value, multiline]);
|
|
185727
185727
|
var adjustedStyleTextInput = __assign(__assign({}, styleTextInput), { paddingRight: handleOnScanQr ? 40 : styleTextInput.paddingRight, resize: 'none' });
|
|
185728
185728
|
var stylesTextInput = __assign(__assign({ borderColor: borderColor, borderRadius: borderRadius, textAlign: center ? 'center' : 'left', paddingBottom: multiline ? 16 : 8, flex: 1 }, styles$1.textArea), adjustedStyleTextInput);
|
|
185729
|
-
var inputType =
|
|
185729
|
+
var inputType = isInputPassword
|
|
185730
185730
|
? showPassword
|
|
185731
185731
|
? 'text'
|
|
185732
185732
|
: 'password'
|
|
185733
185733
|
: isInputRupiah || isInputNumber
|
|
185734
185734
|
? 'tel'
|
|
185735
185735
|
: 'text';
|
|
185736
|
-
return (jsxs(Fragment, { children: [jsxs(View, __assign({ style: styles$1.container }, { children: [jsxs(View, __assign({ style: __assign({ marginTop: top, marginRight: right, marginBottom: bottom, marginLeft: left, padding: padding }, style) }, { children: [label && (jsx(Text$1, { style: __assign(__assign({}, styles$1.label), styleLabel), children: label })), jsxs(View, __assign({ style: styles$1.textInputEyesContainer }, { children: [multiline ? (jsx("textarea", __assign({}, props, { ref: textAreaRef, rows: rows, inputMode: isInputNumber ? 'numeric' : 'text', style: stylesTextInput, value: isInputRupiah ? formatRupiahDisplay(value) : (value !== null && value !== void 0 ? value : ''), onChange: handleChange }))) : (jsx("input", __assign({}, props, { type: inputType, inputMode: isInputNumber ? 'numeric' : 'text', style: stylesTextInput, value: isInputRupiah ? formatRupiahDisplay(value) : (value !== null && value !== void 0 ? value : ''), onChange: handleChange }))),
|
|
185736
|
+
return (jsxs(Fragment, { children: [jsxs(View, __assign({ style: styles$1.container }, { children: [jsxs(View, __assign({ style: __assign({ marginTop: top, marginRight: right, marginBottom: bottom, marginLeft: left, padding: padding }, style) }, { children: [label && (jsx(Text$1, { style: __assign(__assign({}, styles$1.label), styleLabel), children: label })), jsxs(View, __assign({ style: styles$1.textInputEyesContainer }, { children: [multiline ? (jsx("textarea", __assign({}, props, { ref: textAreaRef, rows: rows, inputMode: isInputNumber ? 'numeric' : 'text', style: stylesTextInput, value: isInputRupiah ? formatRupiahDisplay(value) : (value !== null && value !== void 0 ? value : ''), onChange: handleChange }))) : (jsx("input", __assign({}, props, { type: inputType, inputMode: isInputNumber ? 'numeric' : 'text', style: stylesTextInput, value: isInputRupiah ? formatRupiahDisplay(value) : (value !== null && value !== void 0 ? value : ''), onChange: handleChange }))), isInputPassword && (jsx(TouchableOpacity, __assign({ style: styles$1.eye, onPress: function () { return setShowPassword(function (prev) { return !prev; }); } }, { children: jsx(Icon, { size: 20, name: showPassword ? 'Eye' : 'EyeSlash', color: 'black' }) })))] })), labelError ? (jsx(Text$1, { style: styles$1.labelError, children: labelError })) : null] })), handleOnScanQr && (jsx(TouchableOpacity, __assign({ style: label
|
|
185737
185737
|
? styles$1.scanQrImageContainerWithLabel
|
|
185738
185738
|
: styles$1.scanQrImageContainer, onPress: function () {
|
|
185739
185739
|
handleOnScanQr();
|
package/dist/index.js
CHANGED
|
@@ -185689,7 +185689,7 @@ var styles$1 = {
|
|
|
185689
185689
|
};
|
|
185690
185690
|
|
|
185691
185691
|
var TextInput = function (_a) {
|
|
185692
|
-
var _b = _a.borderColor, borderColor = _b === void 0 ? colors.gray : _b, _c = _a.borderRadius, borderRadius = _c === void 0 ? 4 : _c, _d = _a.bottom, bottom = _d === void 0 ? 0 : _d, _e = _a.center, center = _e === void 0 ? false : _e, _f = _a.label, label = _f === void 0 ? false : _f, _g = _a.labelError, labelError = _g === void 0 ? false : _g, _h = _a.left, left = _h === void 0 ? 0 : _h, _j = _a.multiline, multiline = _j === void 0 ? false : _j, _k = _a.padding, padding = _k === void 0 ? 0 : _k, _l = _a.right, right = _l === void 0 ? 0 : _l, _m = _a.rows, rows = _m === void 0 ? 1 : _m, _o = _a.maxRows, maxRows = _o === void 0 ? 4 : _o, _p = _a.style, style = _p === void 0 ? {} : _p, _q = _a.styleLabel, styleLabel = _q === void 0 ? {} : _q, _r = _a.styleTextInput, styleTextInput = _r === void 0 ? {} : _r, _s = _a.top, top = _s === void 0 ? 0 : _s, value = _a.value, onChange = _a.onChange, handleOnScanQr = _a.handleOnScanQr, _t = _a.isInputRupiah, isInputRupiah = _t === void 0 ? false : _t, _u = _a.isInputNumber, isInputNumber = _u === void 0 ? false : _u, _v = _a.
|
|
185692
|
+
var _b = _a.borderColor, borderColor = _b === void 0 ? colors.gray : _b, _c = _a.borderRadius, borderRadius = _c === void 0 ? 4 : _c, _d = _a.bottom, bottom = _d === void 0 ? 0 : _d, _e = _a.center, center = _e === void 0 ? false : _e, _f = _a.label, label = _f === void 0 ? false : _f, _g = _a.labelError, labelError = _g === void 0 ? false : _g, _h = _a.left, left = _h === void 0 ? 0 : _h, _j = _a.multiline, multiline = _j === void 0 ? false : _j, _k = _a.padding, padding = _k === void 0 ? 0 : _k, _l = _a.right, right = _l === void 0 ? 0 : _l, _m = _a.rows, rows = _m === void 0 ? 1 : _m, _o = _a.maxRows, maxRows = _o === void 0 ? 4 : _o, _p = _a.style, style = _p === void 0 ? {} : _p, _q = _a.styleLabel, styleLabel = _q === void 0 ? {} : _q, _r = _a.styleTextInput, styleTextInput = _r === void 0 ? {} : _r, _s = _a.top, top = _s === void 0 ? 0 : _s, value = _a.value, onChange = _a.onChange, handleOnScanQr = _a.handleOnScanQr, _t = _a.isInputRupiah, isInputRupiah = _t === void 0 ? false : _t, _u = _a.isInputNumber, isInputNumber = _u === void 0 ? false : _u, _v = _a.isInputPassword, isInputPassword = _v === void 0 ? false : _v, props = __rest(_a, ["borderColor", "borderRadius", "bottom", "center", "label", "labelError", "left", "multiline", "padding", "right", "rows", "maxRows", "style", "styleLabel", "styleTextInput", "top", "value", "onChange", "handleOnScanQr", "isInputRupiah", "isInputNumber", "isInputPassword"]);
|
|
185693
185693
|
var _w = React.useState(false), isScannerVisible = _w[0], setIsScannerVisible = _w[1];
|
|
185694
185694
|
var _x = React.useState(false), showPassword = _x[0], setShowPassword = _x[1];
|
|
185695
185695
|
var textAreaRef = React.useRef(null);
|
|
@@ -185735,14 +185735,14 @@ var TextInput = function (_a) {
|
|
|
185735
185735
|
}, [value, multiline]);
|
|
185736
185736
|
var adjustedStyleTextInput = __assign(__assign({}, styleTextInput), { paddingRight: handleOnScanQr ? 40 : styleTextInput.paddingRight, resize: 'none' });
|
|
185737
185737
|
var stylesTextInput = __assign(__assign({ borderColor: borderColor, borderRadius: borderRadius, textAlign: center ? 'center' : 'left', paddingBottom: multiline ? 16 : 8, flex: 1 }, styles$1.textArea), adjustedStyleTextInput);
|
|
185738
|
-
var inputType =
|
|
185738
|
+
var inputType = isInputPassword
|
|
185739
185739
|
? showPassword
|
|
185740
185740
|
? 'text'
|
|
185741
185741
|
: 'password'
|
|
185742
185742
|
: isInputRupiah || isInputNumber
|
|
185743
185743
|
? 'tel'
|
|
185744
185744
|
: 'text';
|
|
185745
|
-
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs(View, __assign({ style: styles$1.container }, { children: [jsxRuntime.jsxs(View, __assign({ style: __assign({ marginTop: top, marginRight: right, marginBottom: bottom, marginLeft: left, padding: padding }, style) }, { children: [label && (jsxRuntime.jsx(Text$1, { style: __assign(__assign({}, styles$1.label), styleLabel), children: label })), jsxRuntime.jsxs(View, __assign({ style: styles$1.textInputEyesContainer }, { children: [multiline ? (jsxRuntime.jsx("textarea", __assign({}, props, { ref: textAreaRef, rows: rows, inputMode: isInputNumber ? 'numeric' : 'text', style: stylesTextInput, value: isInputRupiah ? formatRupiahDisplay(value) : (value !== null && value !== void 0 ? value : ''), onChange: handleChange }))) : (jsxRuntime.jsx("input", __assign({}, props, { type: inputType, inputMode: isInputNumber ? 'numeric' : 'text', style: stylesTextInput, value: isInputRupiah ? formatRupiahDisplay(value) : (value !== null && value !== void 0 ? value : ''), onChange: handleChange }))),
|
|
185745
|
+
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs(View, __assign({ style: styles$1.container }, { children: [jsxRuntime.jsxs(View, __assign({ style: __assign({ marginTop: top, marginRight: right, marginBottom: bottom, marginLeft: left, padding: padding }, style) }, { children: [label && (jsxRuntime.jsx(Text$1, { style: __assign(__assign({}, styles$1.label), styleLabel), children: label })), jsxRuntime.jsxs(View, __assign({ style: styles$1.textInputEyesContainer }, { children: [multiline ? (jsxRuntime.jsx("textarea", __assign({}, props, { ref: textAreaRef, rows: rows, inputMode: isInputNumber ? 'numeric' : 'text', style: stylesTextInput, value: isInputRupiah ? formatRupiahDisplay(value) : (value !== null && value !== void 0 ? value : ''), onChange: handleChange }))) : (jsxRuntime.jsx("input", __assign({}, props, { type: inputType, inputMode: isInputNumber ? 'numeric' : 'text', style: stylesTextInput, value: isInputRupiah ? formatRupiahDisplay(value) : (value !== null && value !== void 0 ? value : ''), onChange: handleChange }))), isInputPassword && (jsxRuntime.jsx(TouchableOpacity, __assign({ style: styles$1.eye, onPress: function () { return setShowPassword(function (prev) { return !prev; }); } }, { children: jsxRuntime.jsx(Icon, { size: 20, name: showPassword ? 'Eye' : 'EyeSlash', color: 'black' }) })))] })), labelError ? (jsxRuntime.jsx(Text$1, { style: styles$1.labelError, children: labelError })) : null] })), handleOnScanQr && (jsxRuntime.jsx(TouchableOpacity, __assign({ style: label
|
|
185746
185746
|
? styles$1.scanQrImageContainerWithLabel
|
|
185747
185747
|
: styles$1.scanQrImageContainer, onPress: function () {
|
|
185748
185748
|
handleOnScanQr();
|