tamagui 1.125.19 → 1.125.20
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/cjs/views/Input.cjs +9 -11
- package/dist/cjs/views/Input.js +21 -10
- package/dist/cjs/views/Input.js.map +1 -1
- package/dist/cjs/views/Input.native.js +23 -10
- package/dist/cjs/views/Input.native.js.map +2 -2
- package/dist/esm/views/Input.js +21 -10
- package/dist/esm/views/Input.js.map +1 -1
- package/dist/esm/views/Input.mjs +9 -11
- package/dist/esm/views/Input.mjs.map +1 -1
- package/dist/esm/views/Input.native.js +19 -19
- package/dist/esm/views/Input.native.js.map +1 -1
- package/dist/jsx/views/Input.js +21 -10
- package/dist/jsx/views/Input.js.map +1 -1
- package/dist/jsx/views/Input.mjs +9 -11
- package/dist/jsx/views/Input.mjs.map +1 -1
- package/dist/jsx/views/Input.native.js +23 -10
- package/dist/jsx/views/Input.native.js.map +2 -2
- package/dist/native.js +65 -33
- package/dist/native.js.map +2 -2
- package/dist/test.native.js +65 -33
- package/dist/test.native.js.map +2 -2
- package/package.json +55 -55
- package/src/views/Input.tsx +26 -15
- package/types/views/Input.d.ts +1 -1
- package/types/views/Input.d.ts.map +1 -1
package/dist/native.js
CHANGED
|
@@ -19412,22 +19412,26 @@ var require_Dialog_native = __commonJS({
|
|
|
19412
19412
|
unstyled: process.env.TAMAGUI_HEADLESS === "1"
|
|
19413
19413
|
}
|
|
19414
19414
|
}), DialogPortalItem = function(props) {
|
|
19415
|
-
var { __scopeDialog, children, space, spaceDirection, separator } = props, themeName = (0, import_core12.useThemeName)(), context = useDialogContext(PORTAL_NAME, props.__scopeDialog), childrenSpaced = children;
|
|
19416
|
-
|
|
19415
|
+
var { __scopeDialog, children, space, spaceDirection, separator } = props, themeName = (0, import_core12.useThemeName)(), context = useDialogContext(PORTAL_NAME, props.__scopeDialog), isAdapted = (0, import_adapt.useAdaptIsActive)(), childrenSpaced = children;
|
|
19416
|
+
(space || separator) && (childrenSpaced = (0, import_core12.spacedChildren)({
|
|
19417
19417
|
children,
|
|
19418
19418
|
separator,
|
|
19419
19419
|
space,
|
|
19420
19420
|
direction: spaceDirection
|
|
19421
|
-
}))
|
|
19422
|
-
|
|
19423
|
-
|
|
19424
|
-
|
|
19425
|
-
|
|
19426
|
-
|
|
19427
|
-
|
|
19428
|
-
})
|
|
19421
|
+
}));
|
|
19422
|
+
var content = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(DialogProvider, {
|
|
19423
|
+
scope: __scopeDialog,
|
|
19424
|
+
...context,
|
|
19425
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_core12.Theme, {
|
|
19426
|
+
name: themeName,
|
|
19427
|
+
children: childrenSpaced
|
|
19429
19428
|
})
|
|
19430
19429
|
});
|
|
19430
|
+
return isAdapted ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_adapt.AdaptPortalContents, {
|
|
19431
|
+
children: content
|
|
19432
|
+
}) : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_portal2.PortalItem, {
|
|
19433
|
+
children: content
|
|
19434
|
+
});
|
|
19431
19435
|
}, DialogPortal = function(props) {
|
|
19432
19436
|
var { __scopeDialog, forceMount, children, ...frameProps } = props, context = useDialogContext(PORTAL_NAME, __scopeDialog), isShowing = forceMount || context.open, [isFullyHidden, setIsFullyHidden] = React4.useState(!isShowing), isAdapted = (0, import_adapt.useAdaptIsActive)();
|
|
19433
19437
|
isShowing && isFullyHidden && setIsFullyHidden(!1);
|
|
@@ -19460,7 +19464,10 @@ var require_Dialog_native = __commonJS({
|
|
|
19460
19464
|
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(PassthroughTheme, {
|
|
19461
19465
|
children: framedContents
|
|
19462
19466
|
})
|
|
19463
|
-
}) : framedContents
|
|
19467
|
+
}) : isAdapted ? framedContents : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(DialogPortalItem, {
|
|
19468
|
+
__scopeDialog,
|
|
19469
|
+
children: framedContents
|
|
19470
|
+
});
|
|
19464
19471
|
}
|
|
19465
19472
|
return children;
|
|
19466
19473
|
}, PassthroughTheme = function(param) {
|
|
@@ -21823,31 +21830,42 @@ var require_focusableInputHOC_native = __commonJS({
|
|
|
21823
21830
|
module2.exports = __toCommonJS2(focusableInputHOC_exports);
|
|
21824
21831
|
var import_compose_refs = require_index_native11(), import_web = require_index_native14(), import_react3 = __toESM2(require("react")), import_registerFocusable = require_registerFocusable_native();
|
|
21825
21832
|
function useFocusable2(param) {
|
|
21826
|
-
var { isInput, props, ref } = param, { id, onChangeText, value, defaultValue } = props, inputValue = import_react3.default.useRef(value || defaultValue || ""), unregisterFocusable = import_react3.default.useRef(),
|
|
21833
|
+
var { isInput, props, ref } = param, { id, onChangeText, value, defaultValue } = props, inputValue = import_react3.default.useRef(value || defaultValue || ""), unregisterFocusable = import_react3.default.useRef(), focusAndSelect = import_react3.default.useCallback(function(input) {
|
|
21834
|
+
input.focus(), input.setSelection && typeof inputValue.current == "string" && input.setSelection(0, inputValue.current.length);
|
|
21835
|
+
}, []), registerFocusableHandler = import_react3.default.useCallback(function(input) {
|
|
21827
21836
|
var _unregisterFocusable_current;
|
|
21828
|
-
id
|
|
21837
|
+
!id || !input || ((_unregisterFocusable_current = unregisterFocusable.current) === null || _unregisterFocusable_current === void 0 || _unregisterFocusable_current.call(unregisterFocusable), unregisterFocusable.current = (0, import_registerFocusable.registerFocusable)(id, {
|
|
21829
21838
|
focus: input.focus,
|
|
21830
21839
|
...isInput && {
|
|
21831
|
-
|
|
21832
|
-
|
|
21833
|
-
input.focus(), input.setSelection && typeof inputValue.current == "string" && input.setSelection(0, inputValue.current.length);
|
|
21840
|
+
focusAndSelect: function() {
|
|
21841
|
+
return focusAndSelect(input);
|
|
21834
21842
|
}
|
|
21835
21843
|
}
|
|
21836
21844
|
}));
|
|
21837
21845
|
}, [
|
|
21846
|
+
id,
|
|
21838
21847
|
isInput,
|
|
21839
|
-
|
|
21840
|
-
]),
|
|
21848
|
+
focusAndSelect
|
|
21849
|
+
]), inputRef = import_react3.default.useCallback(function(input) {
|
|
21850
|
+
input && registerFocusableHandler(input);
|
|
21851
|
+
}, [
|
|
21852
|
+
registerFocusableHandler
|
|
21853
|
+
]), handleChangeText = (0, import_web.useEvent)(function(value2) {
|
|
21854
|
+
inputValue.current = value2, onChangeText == null || onChangeText(value2);
|
|
21855
|
+
});
|
|
21841
21856
|
return import_react3.default.useEffect(function() {
|
|
21842
21857
|
return function() {
|
|
21843
21858
|
var _unregisterFocusable_current;
|
|
21844
21859
|
(_unregisterFocusable_current = unregisterFocusable.current) === null || _unregisterFocusable_current === void 0 || _unregisterFocusable_current.call(unregisterFocusable);
|
|
21845
21860
|
};
|
|
21846
21861
|
}, []), {
|
|
21847
|
-
ref:
|
|
21848
|
-
|
|
21849
|
-
|
|
21850
|
-
|
|
21862
|
+
ref: import_react3.default.useMemo(function() {
|
|
21863
|
+
return (0, import_compose_refs.composeRefs)(ref, inputRef);
|
|
21864
|
+
}, [
|
|
21865
|
+
ref,
|
|
21866
|
+
inputRef
|
|
21867
|
+
]),
|
|
21868
|
+
onChangeText: handleChangeText
|
|
21851
21869
|
};
|
|
21852
21870
|
}
|
|
21853
21871
|
}
|
|
@@ -29032,7 +29050,8 @@ var require_Slider_native = __commonJS({
|
|
|
29032
29050
|
var RANGE_NAME = "SliderTrackActive", SliderTrackActiveFrame = (0, import_core12.styled)(import_SliderImpl.SliderFrame, {
|
|
29033
29051
|
name: "SliderTrackActive",
|
|
29034
29052
|
backgroundColor: "$background",
|
|
29035
|
-
position: "absolute"
|
|
29053
|
+
position: "absolute",
|
|
29054
|
+
pointerEvents: "box-none"
|
|
29036
29055
|
}), SliderTrackActive = /* @__PURE__ */ React4.forwardRef(function(props, forwardedRef) {
|
|
29037
29056
|
var { __scopeSlider, ...rangeProps } = props, context = (0, import_constants22.useSliderContext)(RANGE_NAME, __scopeSlider), orientation = (0, import_constants22.useSliderOrientationContext)(RANGE_NAME, __scopeSlider), ref = React4.useRef(null), composedRefs = (0, import_compose_refs.useComposedRefs)(forwardedRef, ref), valuesCount = context.values.length, percentages = context.values.map(function(value) {
|
|
29038
29057
|
return (0, import_helpers3.convertValueToPercentage)(value, context.min, context.max);
|
|
@@ -31688,19 +31707,32 @@ var defaultStyles = {
|
|
|
31688
31707
|
});
|
|
31689
31708
|
});
|
|
31690
31709
|
function useInputProps(props, ref) {
|
|
31691
|
-
var
|
|
31692
|
-
// @ts-ignore
|
|
31710
|
+
var theme = (0, import_core7.useTheme)(), focusableProps = (0, import_focusable.useFocusable)({
|
|
31693
31711
|
props,
|
|
31694
31712
|
ref,
|
|
31695
31713
|
isInput: !0
|
|
31696
|
-
}),
|
|
31697
|
-
|
|
31698
|
-
|
|
31699
|
-
|
|
31700
|
-
|
|
31701
|
-
|
|
31702
|
-
|
|
31703
|
-
|
|
31714
|
+
}), placeholderTextColor = import_react.default.useMemo(function() {
|
|
31715
|
+
var _theme_placeholderColorProp, _theme_placeholderColor, placeholderColorProp = props.placeholderTextColor, _theme_placeholderColorProp_get, _ref;
|
|
31716
|
+
return (_ref = (_theme_placeholderColorProp_get = (_theme_placeholderColorProp = theme[placeholderColorProp]) === null || _theme_placeholderColorProp === void 0 ? void 0 : _theme_placeholderColorProp.get()) !== null && _theme_placeholderColorProp_get !== void 0 ? _theme_placeholderColorProp_get : placeholderColorProp) !== null && _ref !== void 0 ? _ref : (_theme_placeholderColor = theme.placeholderColor) === null || _theme_placeholderColor === void 0 ? void 0 : _theme_placeholderColor.get();
|
|
31717
|
+
}, [
|
|
31718
|
+
props.placeholderTextColor,
|
|
31719
|
+
theme
|
|
31720
|
+
]);
|
|
31721
|
+
return import_react.default.useMemo(function() {
|
|
31722
|
+
return {
|
|
31723
|
+
ref: focusableProps.ref,
|
|
31724
|
+
readOnly: props.disabled,
|
|
31725
|
+
...props,
|
|
31726
|
+
placeholderTextColor,
|
|
31727
|
+
onChangeText: focusableProps.onChangeText
|
|
31728
|
+
};
|
|
31729
|
+
}, [
|
|
31730
|
+
focusableProps.ref,
|
|
31731
|
+
focusableProps.onChangeText,
|
|
31732
|
+
props.disabled,
|
|
31733
|
+
props,
|
|
31734
|
+
placeholderTextColor
|
|
31735
|
+
]);
|
|
31704
31736
|
}
|
|
31705
31737
|
|
|
31706
31738
|
// src/views/Spinner.tsx
|