@scripso-homepad/ui 0.4.18 → 0.4.19
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/{chunk-U7OSCJKA.js → chunk-THZ3HYMF.js} +32 -6
- package/dist/chunk-THZ3HYMF.js.map +1 -0
- package/dist/index.cjs +98 -48
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +70 -46
- package/dist/index.js.map +1 -1
- package/dist/web/index.cjs +31 -5
- package/dist/web/index.cjs.map +1 -1
- package/dist/web/index.css +1 -6
- package/dist/web/index.css.map +1 -1
- package/dist/web/index.js +2 -2
- package/dist/web/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/Button.tsx +1 -1
- package/src/components/Input.tsx +40 -0
- package/src/components/PhoneInput.tsx +11 -0
- package/src/components/Select.tsx +26 -15
- package/src/web/components/TableActionsMenu.tsx +1 -1
- package/src/web/components/drawer-scroll.css +1 -7
- package/dist/chunk-U7OSCJKA.js.map +0 -1
package/dist/web/index.cjs
CHANGED
|
@@ -28875,6 +28875,25 @@ function renderInputIcon(icon, color) {
|
|
|
28875
28875
|
}
|
|
28876
28876
|
return icon;
|
|
28877
28877
|
}
|
|
28878
|
+
var INTEGER_KEYBOARD_TYPES = /* @__PURE__ */ new Set([
|
|
28879
|
+
"numeric",
|
|
28880
|
+
"number-pad",
|
|
28881
|
+
"phone-pad"
|
|
28882
|
+
]);
|
|
28883
|
+
function sanitizeNumericInput(value, keyboardType) {
|
|
28884
|
+
if (keyboardType === "decimal-pad") {
|
|
28885
|
+
const normalized = value.replace(/,/g, ".").replace(/[^\d.]/g, "");
|
|
28886
|
+
const separatorIndex = normalized.indexOf(".");
|
|
28887
|
+
if (separatorIndex === -1) {
|
|
28888
|
+
return normalized;
|
|
28889
|
+
}
|
|
28890
|
+
return normalized.slice(0, separatorIndex + 1) + normalized.slice(separatorIndex + 1).replace(/\./g, "");
|
|
28891
|
+
}
|
|
28892
|
+
if (keyboardType && INTEGER_KEYBOARD_TYPES.has(keyboardType)) {
|
|
28893
|
+
return value.replace(/\D/g, "");
|
|
28894
|
+
}
|
|
28895
|
+
return value;
|
|
28896
|
+
}
|
|
28878
28897
|
function Input({
|
|
28879
28898
|
label,
|
|
28880
28899
|
leftIcon,
|
|
@@ -28897,6 +28916,8 @@ function Input({
|
|
|
28897
28916
|
showPasswordToggle,
|
|
28898
28917
|
onFocus,
|
|
28899
28918
|
onBlur,
|
|
28919
|
+
onChangeText,
|
|
28920
|
+
keyboardType,
|
|
28900
28921
|
multiline,
|
|
28901
28922
|
textAlignVertical,
|
|
28902
28923
|
...props
|
|
@@ -28931,6 +28952,9 @@ function Input({
|
|
|
28931
28952
|
setFocused(false);
|
|
28932
28953
|
onBlur?.(event);
|
|
28933
28954
|
}
|
|
28955
|
+
function handleChangeText(value) {
|
|
28956
|
+
onChangeText?.(sanitizeNumericInput(value, keyboardType));
|
|
28957
|
+
}
|
|
28934
28958
|
const helperMessage = error ?? hint;
|
|
28935
28959
|
function togglePasswordVisibility() {
|
|
28936
28960
|
if (!isDisabled) {
|
|
@@ -28981,6 +29005,7 @@ function Input({
|
|
|
28981
29005
|
],
|
|
28982
29006
|
placeholderTextColor: fieldStyles.placeholder,
|
|
28983
29007
|
editable,
|
|
29008
|
+
keyboardType,
|
|
28984
29009
|
multiline,
|
|
28985
29010
|
secureTextEntry: effectiveSecureTextEntry,
|
|
28986
29011
|
textAlign: "left",
|
|
@@ -28988,7 +29013,8 @@ function Input({
|
|
|
28988
29013
|
onFocus: handleFocus,
|
|
28989
29014
|
onBlur: handleBlur,
|
|
28990
29015
|
accessibilityState: { disabled: isDisabled },
|
|
28991
|
-
...props
|
|
29016
|
+
...props,
|
|
29017
|
+
onChangeText: handleChangeText
|
|
28992
29018
|
}
|
|
28993
29019
|
),
|
|
28994
29020
|
trailingIcon ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles2.iconSlot, children: trailingIcon }) : null
|
|
@@ -30583,7 +30609,7 @@ function TableActionsMenu({
|
|
|
30583
30609
|
{
|
|
30584
30610
|
ref: triggerRef,
|
|
30585
30611
|
variant: "menu",
|
|
30586
|
-
icon: /* @__PURE__ */ jsxRuntime.jsx(TableMoreIcon, { className: "size-
|
|
30612
|
+
icon: /* @__PURE__ */ jsxRuntime.jsx(TableMoreIcon, { className: "size-5" }),
|
|
30587
30613
|
ariaLabel: triggerAriaLabel,
|
|
30588
30614
|
onClick: () => setOpen((current) => !current),
|
|
30589
30615
|
"aria-expanded": open,
|
|
@@ -30997,7 +31023,8 @@ var styles3 = reactNative.StyleSheet.create({
|
|
|
30997
31023
|
justifyContent: "center"
|
|
30998
31024
|
},
|
|
30999
31025
|
withIcon: {
|
|
31000
|
-
justifyContent: "space-between"
|
|
31026
|
+
justifyContent: "space-between",
|
|
31027
|
+
gap: 24
|
|
31001
31028
|
},
|
|
31002
31029
|
disabled: {
|
|
31003
31030
|
opacity: 0.6
|
|
@@ -31011,8 +31038,7 @@ var styles3 = reactNative.StyleSheet.create({
|
|
|
31011
31038
|
},
|
|
31012
31039
|
labelWithIcon: {
|
|
31013
31040
|
flex: 1,
|
|
31014
|
-
flexShrink: 1
|
|
31015
|
-
marginRight: 8
|
|
31041
|
+
flexShrink: 1
|
|
31016
31042
|
},
|
|
31017
31043
|
iconContainer: {
|
|
31018
31044
|
alignItems: "center",
|