@mpxjs/webpack-plugin 2.10.17-beta.3 → 2.10.17-beta.6
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/config.js +60 -0
- package/lib/file-loader.js +4 -1
- package/lib/global.d.ts +245 -0
- package/lib/index.js +29 -2
- package/lib/json-compiler/index.js +13 -4
- package/lib/loader.js +4 -0
- package/lib/platform/json/wx/index.js +6 -0
- package/lib/platform/style/wx/index.js +57 -33
- package/lib/platform/template/wx/component-config/ad.js +5 -0
- package/lib/platform/template/wx/component-config/button.js +10 -3
- package/lib/platform/template/wx/component-config/camera.js +25 -3
- package/lib/platform/template/wx/component-config/canvas.js +8 -1
- package/lib/platform/template/wx/component-config/cover-image.js +7 -2
- package/lib/platform/template/wx/component-config/cover-view.js +3 -1
- package/lib/platform/template/wx/component-config/form.js +27 -2
- package/lib/platform/template/wx/component-config/image.js +5 -0
- package/lib/platform/template/wx/component-config/input.js +11 -1
- package/lib/platform/template/wx/component-config/label.js +10 -2
- package/lib/platform/template/wx/component-config/map.js +11 -0
- package/lib/platform/template/wx/component-config/movable-area.js +4 -1
- package/lib/platform/template/wx/component-config/movable-view.js +17 -2
- package/lib/platform/template/wx/component-config/navigator.js +26 -0
- package/lib/platform/template/wx/component-config/picker-view.js +12 -0
- package/lib/platform/template/wx/component-config/picker.js +3 -1
- package/lib/platform/template/wx/component-config/progress.js +11 -1
- package/lib/platform/template/wx/component-config/rich-text.js +5 -0
- package/lib/platform/template/wx/component-config/scroll-view.js +12 -1
- package/lib/platform/template/wx/component-config/slider.js +8 -0
- package/lib/platform/template/wx/component-config/swiper-item.js +5 -2
- package/lib/platform/template/wx/component-config/swiper.js +10 -0
- package/lib/platform/template/wx/component-config/text.js +5 -0
- package/lib/platform/template/wx/component-config/textarea.js +20 -3
- package/lib/platform/template/wx/component-config/unsupported.js +10 -1
- package/lib/platform/template/wx/component-config/video.js +10 -0
- package/lib/platform/template/wx/index.js +21 -1
- package/lib/react/LoadAsyncChunkModule.js +1 -1
- package/lib/react/processStyles.js +21 -9
- package/lib/react/style-helper.js +76 -13
- package/lib/resolver/AddModePlugin.js +23 -8
- package/lib/runtime/components/react/animationHooks/index.ts +75 -0
- package/lib/runtime/components/react/animationHooks/useAnimationAPIHooks.ts +198 -0
- package/lib/runtime/components/react/animationHooks/useTransitionHooks.ts +297 -0
- package/lib/runtime/components/react/animationHooks/utils.ts +196 -0
- package/lib/runtime/components/react/context.ts +7 -1
- package/lib/runtime/components/react/dist/animationHooks/index.d.ts +15 -0
- package/lib/runtime/components/react/dist/animationHooks/index.js +67 -0
- package/lib/runtime/components/react/dist/animationHooks/useAnimationAPIHooks.d.ts +3 -0
- package/lib/runtime/components/react/dist/animationHooks/useAnimationAPIHooks.js +182 -0
- package/lib/runtime/components/react/dist/animationHooks/useTransitionHooks.d.ts +3 -0
- package/lib/runtime/components/react/dist/animationHooks/useTransitionHooks.js +274 -0
- package/lib/runtime/components/react/dist/animationHooks/utils.d.ts +109 -0
- package/lib/runtime/components/react/dist/animationHooks/utils.js +150 -0
- package/lib/runtime/components/react/dist/context.d.ts +6 -2
- package/lib/runtime/components/react/dist/event.config.d.ts +0 -1
- package/lib/runtime/components/react/dist/getInnerListeners.d.ts +0 -1
- package/lib/runtime/components/react/dist/mpx-async-suspense.d.ts +0 -1
- package/lib/runtime/components/react/dist/mpx-button.d.ts +0 -1
- package/lib/runtime/components/react/dist/mpx-camera.d.ts +31 -0
- package/lib/runtime/components/react/dist/mpx-camera.jsx +236 -0
- package/lib/runtime/components/react/dist/mpx-canvas/Bus.d.ts +0 -1
- package/lib/runtime/components/react/dist/mpx-canvas/CanvasGradient.d.ts +0 -1
- package/lib/runtime/components/react/dist/mpx-canvas/CanvasRenderingContext2D.d.ts +0 -1
- package/lib/runtime/components/react/dist/mpx-canvas/Image.d.ts +0 -1
- package/lib/runtime/components/react/dist/mpx-canvas/ImageData.d.ts +0 -1
- package/lib/runtime/components/react/dist/mpx-canvas/constructorsRegistry.d.ts +0 -1
- package/lib/runtime/components/react/dist/mpx-canvas/html.d.ts +0 -1
- package/lib/runtime/components/react/dist/mpx-canvas/index.d.ts +0 -1
- package/lib/runtime/components/react/dist/mpx-canvas/utils.d.ts +0 -1
- package/lib/runtime/components/react/dist/mpx-checkbox-group.d.ts +0 -1
- package/lib/runtime/components/react/dist/mpx-checkbox.d.ts +0 -1
- package/lib/runtime/components/react/dist/mpx-form.d.ts +0 -1
- package/lib/runtime/components/react/dist/mpx-icon/index.d.ts +0 -1
- package/lib/runtime/components/react/dist/mpx-image.d.ts +0 -1
- package/lib/runtime/components/react/dist/mpx-inline-text.d.ts +0 -1
- package/lib/runtime/components/react/dist/mpx-input.d.ts +2 -1
- package/lib/runtime/components/react/dist/mpx-input.jsx +10 -9
- package/lib/runtime/components/react/dist/mpx-keyboard-avoiding-view.d.ts +0 -1
- package/lib/runtime/components/react/dist/mpx-keyboard-avoiding-view.jsx +7 -2
- package/lib/runtime/components/react/dist/mpx-label.d.ts +0 -1
- package/lib/runtime/components/react/dist/mpx-movable-area.d.ts +0 -1
- package/lib/runtime/components/react/dist/mpx-movable-view.d.ts +0 -1
- package/lib/runtime/components/react/dist/mpx-nav.d.ts +0 -1
- package/lib/runtime/components/react/dist/mpx-navigator.d.ts +0 -1
- package/lib/runtime/components/react/dist/mpx-picker/date.d.ts +0 -1
- package/lib/runtime/components/react/dist/mpx-picker/dateData.d.ts +0 -1
- package/lib/runtime/components/react/dist/mpx-picker/index.d.ts +0 -1
- package/lib/runtime/components/react/dist/mpx-picker/multiSelector.d.ts +0 -1
- package/lib/runtime/components/react/dist/mpx-picker/region.d.ts +0 -1
- package/lib/runtime/components/react/dist/mpx-picker/regionData.d.ts +0 -1
- package/lib/runtime/components/react/dist/mpx-picker/selector.d.ts +0 -1
- package/lib/runtime/components/react/dist/mpx-picker/time.d.ts +0 -1
- package/lib/runtime/components/react/dist/mpx-picker/type.d.ts +0 -1
- package/lib/runtime/components/react/dist/mpx-picker-view/index.d.ts +0 -1
- package/lib/runtime/components/react/dist/mpx-picker-view/pickerVIewContext.d.ts +0 -1
- package/lib/runtime/components/react/dist/mpx-picker-view-column/index.d.ts +0 -1
- package/lib/runtime/components/react/dist/mpx-picker-view-column/pickerViewColumnItem.d.ts +0 -1
- package/lib/runtime/components/react/dist/mpx-picker-view-column/pickerViewColumnItemLite.d.ts +0 -1
- package/lib/runtime/components/react/dist/mpx-picker-view-column/pickerViewFaces.d.ts +0 -1
- package/lib/runtime/components/react/dist/mpx-picker-view-column/pickerViewIndicator.d.ts +0 -1
- package/lib/runtime/components/react/dist/mpx-picker-view-column/pickerViewMask.d.ts +0 -1
- package/lib/runtime/components/react/dist/mpx-popup/index.d.ts +0 -1
- package/lib/runtime/components/react/dist/mpx-popup/popupBase.d.ts +0 -1
- package/lib/runtime/components/react/dist/mpx-portal/index.d.ts +0 -1
- package/lib/runtime/components/react/dist/mpx-portal/portal-host.d.ts +0 -1
- package/lib/runtime/components/react/dist/mpx-portal/portal-manager.d.ts +0 -1
- package/lib/runtime/components/react/dist/mpx-portal/portal-manager.jsx +2 -2
- package/lib/runtime/components/react/dist/mpx-progress.d.ts +0 -1
- package/lib/runtime/components/react/dist/mpx-radio-group.d.ts +0 -1
- package/lib/runtime/components/react/dist/mpx-radio.d.ts +0 -1
- package/lib/runtime/components/react/dist/mpx-rich-text/html.d.ts +0 -1
- package/lib/runtime/components/react/dist/mpx-rich-text/index.d.ts +0 -1
- package/lib/runtime/components/react/dist/mpx-root-portal.d.ts +0 -1
- package/lib/runtime/components/react/dist/mpx-scroll-view.d.ts +0 -1
- package/lib/runtime/components/react/dist/mpx-simple-text.d.ts +0 -1
- package/lib/runtime/components/react/dist/mpx-simple-view.d.ts +0 -1
- package/lib/runtime/components/react/dist/mpx-slider.d.ts +0 -1
- package/lib/runtime/components/react/dist/mpx-sticky-header.d.ts +0 -1
- package/lib/runtime/components/react/dist/mpx-sticky-section.d.ts +0 -1
- package/lib/runtime/components/react/dist/mpx-swiper-item.d.ts +0 -1
- package/lib/runtime/components/react/dist/mpx-swiper.d.ts +11 -1
- package/lib/runtime/components/react/dist/mpx-swiper.jsx +71 -39
- package/lib/runtime/components/react/dist/mpx-switch.d.ts +0 -1
- package/lib/runtime/components/react/dist/mpx-text.d.ts +0 -1
- package/lib/runtime/components/react/dist/mpx-textarea.d.ts +0 -1
- package/lib/runtime/components/react/dist/mpx-video.d.ts +0 -1
- package/lib/runtime/components/react/dist/mpx-view.d.ts +3 -3
- package/lib/runtime/components/react/dist/mpx-view.jsx +22 -8
- package/lib/runtime/components/react/dist/mpx-web-view.d.ts +0 -1
- package/lib/runtime/components/react/dist/mpx-web-view.jsx +1 -1
- package/lib/runtime/components/react/dist/parser.d.ts +0 -1
- package/lib/runtime/components/react/dist/useNodesRef.d.ts +0 -1
- package/lib/runtime/components/react/dist/utils.d.ts +1 -1
- package/lib/runtime/components/react/dist/utils.jsx +34 -13
- package/lib/runtime/components/react/mpx-camera.tsx +327 -0
- package/lib/runtime/components/react/mpx-input.tsx +15 -9
- package/lib/runtime/components/react/mpx-keyboard-avoiding-view.tsx +7 -2
- package/lib/runtime/components/react/mpx-portal/portal-manager.tsx +2 -2
- package/lib/runtime/components/react/mpx-swiper.tsx +86 -37
- package/lib/runtime/components/react/mpx-view.tsx +27 -12
- package/lib/runtime/components/react/mpx-web-view.tsx +1 -1
- package/lib/runtime/components/react/tsconfig.json +26 -0
- package/lib/runtime/components/react/types/global.d.ts +1 -0
- package/lib/runtime/components/react/utils.tsx +34 -16
- package/lib/runtime/optionProcessor.js +5 -0
- package/lib/runtime/optionProcessorReact.js +7 -0
- package/lib/runtime/stringify.wxs +2 -2
- package/lib/style-compiler/strip-conditional-loader/rebaseUrl.js +225 -0
- package/lib/style-compiler/strip-conditional-loader.js +76 -185
- package/lib/template-compiler/compiler.js +1 -3
- package/lib/utils/dom-tag-config.js +1 -1
- package/lib/utils/string.js +25 -1
- package/package.json +6 -4
- package/lib/runtime/components/react/dist/context.d.ts.map +0 -1
- package/lib/runtime/components/react/dist/event.config.d.ts.map +0 -1
- package/lib/runtime/components/react/dist/getInnerListeners.d.ts.map +0 -1
- package/lib/runtime/components/react/dist/mpx-async-suspense.d.ts.map +0 -1
- package/lib/runtime/components/react/dist/mpx-button.d.ts.map +0 -1
- package/lib/runtime/components/react/dist/mpx-canvas/Bus.d.ts.map +0 -1
- package/lib/runtime/components/react/dist/mpx-canvas/CanvasGradient.d.ts.map +0 -1
- package/lib/runtime/components/react/dist/mpx-canvas/CanvasRenderingContext2D.d.ts.map +0 -1
- package/lib/runtime/components/react/dist/mpx-canvas/Image.d.ts.map +0 -1
- package/lib/runtime/components/react/dist/mpx-canvas/ImageData.d.ts.map +0 -1
- package/lib/runtime/components/react/dist/mpx-canvas/constructorsRegistry.d.ts.map +0 -1
- package/lib/runtime/components/react/dist/mpx-canvas/html.d.ts.map +0 -1
- package/lib/runtime/components/react/dist/mpx-canvas/index.d.ts.map +0 -1
- package/lib/runtime/components/react/dist/mpx-canvas/utils.d.ts.map +0 -1
- package/lib/runtime/components/react/dist/mpx-checkbox-group.d.ts.map +0 -1
- package/lib/runtime/components/react/dist/mpx-checkbox.d.ts.map +0 -1
- package/lib/runtime/components/react/dist/mpx-form.d.ts.map +0 -1
- package/lib/runtime/components/react/dist/mpx-icon/index.d.ts.map +0 -1
- package/lib/runtime/components/react/dist/mpx-image.d.ts.map +0 -1
- package/lib/runtime/components/react/dist/mpx-inline-text.d.ts.map +0 -1
- package/lib/runtime/components/react/dist/mpx-input.d.ts.map +0 -1
- package/lib/runtime/components/react/dist/mpx-keyboard-avoiding-view.d.ts.map +0 -1
- package/lib/runtime/components/react/dist/mpx-label.d.ts.map +0 -1
- package/lib/runtime/components/react/dist/mpx-movable-area.d.ts.map +0 -1
- package/lib/runtime/components/react/dist/mpx-movable-view.d.ts.map +0 -1
- package/lib/runtime/components/react/dist/mpx-nav.d.ts.map +0 -1
- package/lib/runtime/components/react/dist/mpx-navigator.d.ts.map +0 -1
- package/lib/runtime/components/react/dist/mpx-picker/date.d.ts.map +0 -1
- package/lib/runtime/components/react/dist/mpx-picker/dateData.d.ts.map +0 -1
- package/lib/runtime/components/react/dist/mpx-picker/index.d.ts.map +0 -1
- package/lib/runtime/components/react/dist/mpx-picker/multiSelector.d.ts.map +0 -1
- package/lib/runtime/components/react/dist/mpx-picker/region.d.ts.map +0 -1
- package/lib/runtime/components/react/dist/mpx-picker/regionData.d.ts.map +0 -1
- package/lib/runtime/components/react/dist/mpx-picker/selector.d.ts.map +0 -1
- package/lib/runtime/components/react/dist/mpx-picker/time.d.ts.map +0 -1
- package/lib/runtime/components/react/dist/mpx-picker/type.d.ts.map +0 -1
- package/lib/runtime/components/react/dist/mpx-picker-view/index.d.ts.map +0 -1
- package/lib/runtime/components/react/dist/mpx-picker-view/pickerVIewContext.d.ts.map +0 -1
- package/lib/runtime/components/react/dist/mpx-picker-view-column/index.d.ts.map +0 -1
- package/lib/runtime/components/react/dist/mpx-picker-view-column/pickerViewColumnItem.d.ts.map +0 -1
- package/lib/runtime/components/react/dist/mpx-picker-view-column/pickerViewColumnItemLite.d.ts.map +0 -1
- package/lib/runtime/components/react/dist/mpx-picker-view-column/pickerViewFaces.d.ts.map +0 -1
- package/lib/runtime/components/react/dist/mpx-picker-view-column/pickerViewIndicator.d.ts.map +0 -1
- package/lib/runtime/components/react/dist/mpx-picker-view-column/pickerViewMask.d.ts.map +0 -1
- package/lib/runtime/components/react/dist/mpx-popup/index.d.ts.map +0 -1
- package/lib/runtime/components/react/dist/mpx-popup/popupBase.d.ts.map +0 -1
- package/lib/runtime/components/react/dist/mpx-portal/index.d.ts.map +0 -1
- package/lib/runtime/components/react/dist/mpx-portal/portal-host.d.ts.map +0 -1
- package/lib/runtime/components/react/dist/mpx-portal/portal-manager.d.ts.map +0 -1
- package/lib/runtime/components/react/dist/mpx-progress.d.ts.map +0 -1
- package/lib/runtime/components/react/dist/mpx-radio-group.d.ts.map +0 -1
- package/lib/runtime/components/react/dist/mpx-radio.d.ts.map +0 -1
- package/lib/runtime/components/react/dist/mpx-rich-text/html.d.ts.map +0 -1
- package/lib/runtime/components/react/dist/mpx-rich-text/index.d.ts.map +0 -1
- package/lib/runtime/components/react/dist/mpx-root-portal.d.ts.map +0 -1
- package/lib/runtime/components/react/dist/mpx-scroll-view.d.ts.map +0 -1
- package/lib/runtime/components/react/dist/mpx-simple-text.d.ts.map +0 -1
- package/lib/runtime/components/react/dist/mpx-simple-view.d.ts.map +0 -1
- package/lib/runtime/components/react/dist/mpx-slider.d.ts.map +0 -1
- package/lib/runtime/components/react/dist/mpx-sticky-header.d.ts.map +0 -1
- package/lib/runtime/components/react/dist/mpx-sticky-section.d.ts.map +0 -1
- package/lib/runtime/components/react/dist/mpx-swiper-item.d.ts.map +0 -1
- package/lib/runtime/components/react/dist/mpx-swiper.d.ts.map +0 -1
- package/lib/runtime/components/react/dist/mpx-switch.d.ts.map +0 -1
- package/lib/runtime/components/react/dist/mpx-text.d.ts.map +0 -1
- package/lib/runtime/components/react/dist/mpx-textarea.d.ts.map +0 -1
- package/lib/runtime/components/react/dist/mpx-video.d.ts.map +0 -1
- package/lib/runtime/components/react/dist/mpx-view.d.ts.map +0 -1
- package/lib/runtime/components/react/dist/mpx-web-view.d.ts.map +0 -1
- package/lib/runtime/components/react/dist/parser.d.ts.map +0 -1
- package/lib/runtime/components/react/dist/useAnimationHooks.d.ts +0 -33
- package/lib/runtime/components/react/dist/useAnimationHooks.d.ts.map +0 -1
- package/lib/runtime/components/react/dist/useAnimationHooks.js +0 -289
- package/lib/runtime/components/react/dist/useNodesRef.d.ts.map +0 -1
- package/lib/runtime/components/react/dist/utils.d.ts.map +0 -1
- package/lib/runtime/components/react/useAnimationHooks.ts +0 -320
|
@@ -31,7 +31,9 @@ export interface InputProps {
|
|
|
31
31
|
'parent-font-size'?: number;
|
|
32
32
|
'parent-width'?: number;
|
|
33
33
|
'parent-height'?: number;
|
|
34
|
+
'keyboard-type'?: string;
|
|
34
35
|
'adjust-position': boolean;
|
|
36
|
+
'hold-keyboard'?: boolean;
|
|
35
37
|
bindinput?: (evt: NativeSyntheticEvent<TextInputTextInputEventData> | unknown) => void;
|
|
36
38
|
bindfocus?: (evt: NativeSyntheticEvent<TextInputFocusEventData> | unknown) => void;
|
|
37
39
|
bindblur?: (evt: NativeSyntheticEvent<TextInputFocusEventData> | unknown) => void;
|
|
@@ -47,4 +49,3 @@ export interface PrivateInputProps {
|
|
|
47
49
|
type FinalInputProps = InputProps & PrivateInputProps;
|
|
48
50
|
declare const Input: import("react").ForwardRefExoticComponent<InputProps & PrivateInputProps & import("react").RefAttributes<HandlerRef<TextInput, FinalInputProps>>>;
|
|
49
51
|
export default Input;
|
|
50
|
-
//# sourceMappingURL=mpx-input.d.ts.map
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
* ✔ selection-start
|
|
19
19
|
* ✔ selection-end
|
|
20
20
|
* ✔ adjust-position
|
|
21
|
-
*
|
|
21
|
+
* ✔ hold-keyboard
|
|
22
22
|
* ✘ safe-password-cert-path
|
|
23
23
|
* ✘ safe-password-length
|
|
24
24
|
* ✘ safe-password-time-stamp
|
|
@@ -40,19 +40,19 @@
|
|
|
40
40
|
import { forwardRef, useRef, useState, useContext, useEffect, createElement } from 'react';
|
|
41
41
|
import { TextInput } from 'react-native';
|
|
42
42
|
import { warn } from '@mpxjs/utils';
|
|
43
|
-
import { useUpdateEffect, useTransformStyle, useLayout, extendObject
|
|
43
|
+
import { useUpdateEffect, useTransformStyle, useLayout, extendObject } from './utils';
|
|
44
44
|
import useInnerProps, { getCustomEvent } from './getInnerListeners';
|
|
45
45
|
import useNodesRef from './useNodesRef';
|
|
46
46
|
import { FormContext, KeyboardAvoidContext } from './context';
|
|
47
47
|
import Portal from './mpx-portal';
|
|
48
|
-
const
|
|
49
|
-
text: '
|
|
48
|
+
const inputModeMap = {
|
|
49
|
+
text: 'text',
|
|
50
50
|
number: 'numeric',
|
|
51
|
-
idcard: '
|
|
52
|
-
digit:
|
|
51
|
+
idcard: 'text',
|
|
52
|
+
digit: 'decimal'
|
|
53
53
|
};
|
|
54
54
|
const Input = forwardRef((props, ref) => {
|
|
55
|
-
const { style = {}, allowFontScaling = false, type = 'text', value, password, 'placeholder-style': placeholderStyle = {}, disabled, maxlength = 140, 'cursor-spacing': cursorSpacing = 0, 'auto-focus': autoFocus, focus, 'confirm-type': confirmType = 'done', 'confirm-hold': confirmHold = false, cursor, 'cursor-color': cursorColor, 'selection-start': selectionStart = -1, 'selection-end': selectionEnd = -1, 'enable-var': enableVar, 'external-var-context': externalVarContext, 'parent-font-size': parentFontSize, 'parent-width': parentWidth, 'parent-height': parentHeight, 'adjust-position': adjustPosition = true, bindinput, bindfocus, bindblur, bindconfirm, bindselectionchange,
|
|
55
|
+
const { style = {}, allowFontScaling = false, type = 'text', value, password, 'placeholder-style': placeholderStyle = {}, disabled, maxlength = 140, 'cursor-spacing': cursorSpacing = 0, 'auto-focus': autoFocus, focus, 'confirm-type': confirmType = 'done', 'confirm-hold': confirmHold = false, cursor, 'cursor-color': cursorColor, 'selection-start': selectionStart = -1, 'selection-end': selectionEnd = -1, 'enable-var': enableVar, 'external-var-context': externalVarContext, 'parent-font-size': parentFontSize, 'parent-width': parentWidth, 'parent-height': parentHeight, 'adjust-position': adjustPosition = true, 'keyboard-type': originalKeyboardType, 'hold-keyboard': holdKeyboard = false, bindinput, bindfocus, bindblur, bindconfirm, bindselectionchange,
|
|
56
56
|
// private
|
|
57
57
|
multiline, 'auto-height': autoHeight, bindlinechange } = props;
|
|
58
58
|
const formContext = useContext(FormContext);
|
|
@@ -72,7 +72,6 @@ const Input = forwardRef((props, ref) => {
|
|
|
72
72
|
return value + '';
|
|
73
73
|
return '';
|
|
74
74
|
};
|
|
75
|
-
const keyboardType = keyboardTypeMap[type];
|
|
76
75
|
const defaultValue = parseValue(value);
|
|
77
76
|
const textAlignVertical = multiline ? 'top' : 'auto';
|
|
78
77
|
const tmpValue = useRef(defaultValue);
|
|
@@ -149,6 +148,7 @@ const Input = forwardRef((props, ref) => {
|
|
|
149
148
|
cursorSpacing,
|
|
150
149
|
ref: nodeRef,
|
|
151
150
|
adjustPosition,
|
|
151
|
+
holdKeyboard,
|
|
152
152
|
// fix: iOS 会在 onFocus 之前触发 keyboardWillShow 并且赋值 keyboardHeight
|
|
153
153
|
// 这里手动同步下 keyboardHeight,防止 onFocus setKeyboardAvoidContext 删掉 keyboardHeight
|
|
154
154
|
keyboardHeight: keyboardAvoid?.current?.keyboardHeight
|
|
@@ -286,7 +286,8 @@ const Input = forwardRef((props, ref) => {
|
|
|
286
286
|
ref: nodeRef,
|
|
287
287
|
style: extendObject({}, normalStyle, layoutStyle),
|
|
288
288
|
allowFontScaling,
|
|
289
|
-
|
|
289
|
+
inputMode: originalKeyboardType ? undefined : inputModeMap[type],
|
|
290
|
+
keyboardType: originalKeyboardType,
|
|
290
291
|
secureTextEntry: !!password,
|
|
291
292
|
defaultValue: defaultValue,
|
|
292
293
|
value: inputValue,
|
|
@@ -15,8 +15,10 @@ const KeyboardAvoidingView = ({ children, style, contentContainerStyle }) => {
|
|
|
15
15
|
// 因此增加状态标记 + cancelAnimation 来优化
|
|
16
16
|
const isShow = useRef(false);
|
|
17
17
|
const animatedStyle = useAnimatedStyle(() => ({
|
|
18
|
-
// translate/position top
|
|
19
|
-
|
|
18
|
+
// translate/position top+ overflow hidden 在 android 上时因为键盘顶起让页面高度变小,同时元素位置上移
|
|
19
|
+
// 此时最底部的区域是超出了页面高度的,hidden生效就被隐藏掉,因此需要 android 配置聚焦时禁用高度缩小
|
|
20
|
+
// margin-top 因为在 react-native 上和 flex 1 同时存在时,负值只会让容器高度整体变高,不会让元素上移
|
|
21
|
+
transform: [{ translateY: -offset.value }],
|
|
20
22
|
flexBasis: basic.value
|
|
21
23
|
}));
|
|
22
24
|
const resetKeyboard = () => {
|
|
@@ -38,6 +40,9 @@ const KeyboardAvoidingView = ({ children, style, contentContainerStyle }) => {
|
|
|
38
40
|
};
|
|
39
41
|
const onTouchEnd = ({ nativeEvent }) => {
|
|
40
42
|
if (nativeEvent.origin !== 'input') {
|
|
43
|
+
if (keyboardAvoid?.current?.holdKeyboard) {
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
41
46
|
Keyboard.isVisible() && Keyboard.dismiss();
|
|
42
47
|
}
|
|
43
48
|
};
|
|
@@ -18,4 +18,3 @@ interface MovableAreaProps {
|
|
|
18
18
|
}
|
|
19
19
|
declare const _MovableArea: import("react").ForwardRefExoticComponent<MovableAreaProps & import("react").RefAttributes<HandlerRef<View, MovableAreaProps>>>;
|
|
20
20
|
export default _MovableArea;
|
|
21
|
-
//# sourceMappingURL=mpx-movable-area.d.ts.map
|
|
@@ -63,4 +63,3 @@ interface MovableViewProps {
|
|
|
63
63
|
}
|
|
64
64
|
declare const _MovableView: import("react").ForwardRefExoticComponent<MovableViewProps & import("react").RefAttributes<HandlerRef<View, MovableViewProps>>>;
|
|
65
65
|
export default _MovableView;
|
|
66
|
-
//# sourceMappingURL=mpx-movable-view.d.ts.map
|
|
@@ -4,4 +4,3 @@ import { DateProps } from './type';
|
|
|
4
4
|
import { HandlerRef } from '../useNodesRef';
|
|
5
5
|
declare const PickerDate: React.ForwardRefExoticComponent<Omit<DateProps, "ref"> & React.RefAttributes<HandlerRef<View, DateProps>>>;
|
|
6
6
|
export default PickerDate;
|
|
7
|
-
//# sourceMappingURL=date.d.ts.map
|
|
@@ -5,4 +5,3 @@ export declare const years: string[];
|
|
|
5
5
|
export declare const months: string[];
|
|
6
6
|
export declare const daysInMonthLength: (year: number, month: number) => 30 | 28 | 29 | 31;
|
|
7
7
|
export declare const daysInMonth: (year: number, month: number) => string[];
|
|
8
|
-
//# sourceMappingURL=dateData.d.ts.map
|
|
@@ -4,4 +4,3 @@ import { HandlerRef } from '../useNodesRef';
|
|
|
4
4
|
import { PickerProps } from './type';
|
|
5
5
|
declare const Picker: React.ForwardRefExoticComponent<(Omit<import("./type").DateProps, "ref"> | Omit<import("./type").SelectorProps, "ref"> | Omit<import("./type").MultiSelectorProps, "ref"> | Omit<import("./type").TimeProps, "ref"> | Omit<import("./type").RegionProps, "ref">) & React.RefAttributes<HandlerRef<View, PickerProps>>>;
|
|
6
6
|
export default Picker;
|
|
7
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -4,4 +4,3 @@ import { MultiSelectorProps } from './type';
|
|
|
4
4
|
import { HandlerRef } from '../useNodesRef';
|
|
5
5
|
declare const PickerMultiSelector: React.ForwardRefExoticComponent<Omit<MultiSelectorProps, "ref"> & React.RefAttributes<HandlerRef<View, MultiSelectorProps>>>;
|
|
6
6
|
export default PickerMultiSelector;
|
|
7
|
-
//# sourceMappingURL=multiSelector.d.ts.map
|
|
@@ -4,4 +4,3 @@ import { RegionProps } from './type';
|
|
|
4
4
|
import { HandlerRef } from '../useNodesRef';
|
|
5
5
|
declare const PickerRegion: React.ForwardRefExoticComponent<Omit<RegionProps, "ref"> & React.RefAttributes<HandlerRef<View, RegionProps>>>;
|
|
6
6
|
export default PickerRegion;
|
|
7
|
-
//# sourceMappingURL=region.d.ts.map
|
|
@@ -4,4 +4,3 @@ import { SelectorProps } from './type';
|
|
|
4
4
|
import { HandlerRef } from '../useNodesRef';
|
|
5
5
|
declare const PickerSelector: React.ForwardRefExoticComponent<Omit<SelectorProps, "ref"> & React.RefAttributes<HandlerRef<View, SelectorProps>>>;
|
|
6
6
|
export default PickerSelector;
|
|
7
|
-
//# sourceMappingURL=selector.d.ts.map
|
|
@@ -4,4 +4,3 @@ import { TimeProps } from './type';
|
|
|
4
4
|
import { HandlerRef } from '../useNodesRef';
|
|
5
5
|
declare const PickerTime: React.ForwardRefExoticComponent<Omit<TimeProps, "ref"> & React.RefAttributes<HandlerRef<View, TimeProps>>>;
|
|
6
6
|
export default PickerTime;
|
|
7
|
-
//# sourceMappingURL=time.d.ts.map
|
|
@@ -6,4 +6,3 @@ export declare const usePickerViewColumnAnimationContext: () => ContextValue;
|
|
|
6
6
|
export declare const PickerViewStyleContext: import("react").Context<Record<string, any> | undefined>;
|
|
7
7
|
export declare const usePickerViewStyleContext: () => Record<string, any> | undefined;
|
|
8
8
|
export {};
|
|
9
|
-
//# sourceMappingURL=pickerVIewContext.d.ts.map
|
|
@@ -14,4 +14,3 @@ export declare const degToRad: (deg: number) => number;
|
|
|
14
14
|
export declare const calcPickerHeight: (faces: Faces[], itemHeight: number) => number;
|
|
15
15
|
export declare const calcHeightOffsets: (itemHeight: number) => number[];
|
|
16
16
|
export declare const createFaces: (itemHeight: number, visibleCount: number) => Faces[];
|
|
17
|
-
//# sourceMappingURL=pickerViewFaces.d.ts.map
|
|
@@ -7,7 +7,7 @@ const _PortalManager = forwardRef((props, ref) => {
|
|
|
7
7
|
setState((prevState) => ({
|
|
8
8
|
portals: [...prevState.portals, { key, children }]
|
|
9
9
|
}));
|
|
10
|
-
}, [
|
|
10
|
+
}, []);
|
|
11
11
|
const update = useCallback((key, children) => {
|
|
12
12
|
setState((prevState) => ({
|
|
13
13
|
portals: prevState.portals.map((item) => {
|
|
@@ -17,7 +17,7 @@ const _PortalManager = forwardRef((props, ref) => {
|
|
|
17
17
|
return item;
|
|
18
18
|
})
|
|
19
19
|
}));
|
|
20
|
-
}, [
|
|
20
|
+
}, []);
|
|
21
21
|
const unmount = useCallback((key) => {
|
|
22
22
|
setState((prevState) => ({
|
|
23
23
|
portals: prevState.portals.filter((item) => item.key !== key)
|
|
@@ -18,4 +18,3 @@ export interface RadioGroupProps {
|
|
|
18
18
|
}
|
|
19
19
|
declare const radioGroup: import("react").ForwardRefExoticComponent<RadioGroupProps & import("react").RefAttributes<HandlerRef<View, RadioGroupProps>>>;
|
|
20
20
|
export default radioGroup;
|
|
21
|
-
//# sourceMappingURL=mpx-radio-group.d.ts.map
|
|
@@ -52,4 +52,3 @@ declare const _ScrollView: import("react").ForwardRefExoticComponent<ScrollViewP
|
|
|
52
52
|
children?: ReactNode;
|
|
53
53
|
} & import("react-native-gesture-handler").NativeViewGestureHandlerProps & import("react").RefAttributes<import("react").ComponentType<any>>> & import("react-native").ScrollView & View, ScrollViewProps>>>;
|
|
54
54
|
export default _ScrollView;
|
|
55
|
-
//# sourceMappingURL=mpx-scroll-view.d.ts.map
|
|
@@ -15,4 +15,3 @@ interface StickyHeaderProps {
|
|
|
15
15
|
}
|
|
16
16
|
declare const _StickyHeader: import("react").ForwardRefExoticComponent<StickyHeaderProps & import("react").RefAttributes<HandlerRef<View, StickyHeaderProps>>>;
|
|
17
17
|
export default _StickyHeader;
|
|
18
|
-
//# sourceMappingURL=mpx-sticky-header.d.ts.map
|
|
@@ -13,4 +13,3 @@ interface StickySectionProps {
|
|
|
13
13
|
}
|
|
14
14
|
declare const _StickySection: import("react").ForwardRefExoticComponent<StickySectionProps & import("react").RefAttributes<HandlerRef<View, StickySectionProps>>>;
|
|
15
15
|
export default _StickySection;
|
|
16
|
-
//# sourceMappingURL=mpx-sticky-section.d.ts.map
|
|
@@ -5,6 +5,11 @@ import { GestureHandler } from './utils';
|
|
|
5
5
|
/**
|
|
6
6
|
* ✔ indicator-dots
|
|
7
7
|
* ✔ indicator-color
|
|
8
|
+
* ✔ indicator-width
|
|
9
|
+
* ✔ indicator-height
|
|
10
|
+
* ✔ indicator-radius
|
|
11
|
+
* ✔ indicator-spacing
|
|
12
|
+
* ✔ indicator-margin
|
|
8
13
|
* ✔ indicator-active-color
|
|
9
14
|
* ✔ autoplay
|
|
10
15
|
* ✔ current
|
|
@@ -29,6 +34,11 @@ interface SwiperProps {
|
|
|
29
34
|
scale?: boolean;
|
|
30
35
|
'indicator-dots'?: boolean;
|
|
31
36
|
'indicator-color'?: string;
|
|
37
|
+
'indicator-width'?: number;
|
|
38
|
+
'indicator-height'?: number;
|
|
39
|
+
'indicator-spacing'?: number;
|
|
40
|
+
'indicator-radius'?: number;
|
|
41
|
+
'indicator-margin'?: number;
|
|
32
42
|
'indicator-active-color'?: string;
|
|
33
43
|
vertical?: boolean;
|
|
34
44
|
style: {
|
|
@@ -46,8 +56,8 @@ interface SwiperProps {
|
|
|
46
56
|
'wait-for'?: Array<GestureHandler>;
|
|
47
57
|
'simultaneous-handlers'?: Array<GestureHandler>;
|
|
48
58
|
disableGesture?: boolean;
|
|
59
|
+
'display-multiple-items'?: number;
|
|
49
60
|
bindchange?: (event: NativeSyntheticEvent<TouchEvent> | unknown) => void;
|
|
50
61
|
}
|
|
51
62
|
declare const SwiperWrapper: React.ForwardRefExoticComponent<SwiperProps & React.RefAttributes<HandlerRef<View, SwiperProps>>>;
|
|
52
63
|
export default SwiperWrapper;
|
|
53
|
-
//# sourceMappingURL=mpx-swiper.d.ts.map
|