@mpxjs/webpack-plugin 2.10.24-test.1 → 2.11.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.
Files changed (128) hide show
  1. package/LICENSE +433 -0
  2. package/lib/index.js +4 -1
  3. package/lib/platform/style/wx/index.js +44 -38
  4. package/lib/platform/template/wx/component-config/picker.js +0 -6
  5. package/lib/resolver/AddEnvPlugin.js +1 -1
  6. package/lib/resolver/AddModePlugin.js +1 -1
  7. package/lib/resolver/ExtendComponentsPlugin.js +68 -0
  8. package/lib/runtime/components/extends/section-list.mpx +14 -0
  9. package/lib/runtime/components/react/dist/mpx-button.d.ts +0 -1
  10. package/lib/runtime/components/react/dist/mpx-button.jsx +2 -2
  11. package/lib/runtime/components/react/dist/mpx-camera.d.ts +0 -1
  12. package/lib/runtime/components/react/dist/mpx-camera.jsx +36 -4
  13. package/lib/runtime/components/react/dist/mpx-canvas/index.d.ts +0 -1
  14. package/lib/runtime/components/react/dist/mpx-canvas/index.jsx +1 -2
  15. package/lib/runtime/components/react/dist/mpx-checkbox-group.d.ts +0 -1
  16. package/lib/runtime/components/react/dist/mpx-checkbox-group.jsx +2 -2
  17. package/lib/runtime/components/react/dist/mpx-checkbox.d.ts +0 -1
  18. package/lib/runtime/components/react/dist/mpx-checkbox.jsx +2 -2
  19. package/lib/runtime/components/react/dist/mpx-form.d.ts +0 -1
  20. package/lib/runtime/components/react/dist/mpx-form.jsx +2 -2
  21. package/lib/runtime/components/react/dist/mpx-icon/index.d.ts +0 -1
  22. package/lib/runtime/components/react/dist/mpx-icon/index.jsx +2 -2
  23. package/lib/runtime/components/react/dist/mpx-image.d.ts +0 -1
  24. package/lib/runtime/components/react/dist/mpx-image.jsx +2 -2
  25. package/lib/runtime/components/react/dist/mpx-inline-text.jsx +13 -4
  26. package/lib/runtime/components/react/dist/mpx-input.d.ts +0 -1
  27. package/lib/runtime/components/react/dist/mpx-input.jsx +16 -8
  28. package/lib/runtime/components/react/dist/mpx-label.d.ts +0 -1
  29. package/lib/runtime/components/react/dist/mpx-label.jsx +2 -2
  30. package/lib/runtime/components/react/dist/mpx-movable-area.d.ts +0 -1
  31. package/lib/runtime/components/react/dist/mpx-movable-area.jsx +2 -2
  32. package/lib/runtime/components/react/dist/mpx-movable-view.d.ts +0 -1
  33. package/lib/runtime/components/react/dist/mpx-movable-view.jsx +2 -2
  34. package/lib/runtime/components/react/dist/mpx-nav.jsx +1 -1
  35. package/lib/runtime/components/react/dist/mpx-picker/index.jsx +72 -23
  36. package/lib/runtime/components/react/dist/mpx-picker/multiSelector.jsx +2 -2
  37. package/lib/runtime/components/react/dist/mpx-picker/type.d.ts +4 -0
  38. package/lib/runtime/components/react/dist/mpx-picker-view/index.jsx +6 -8
  39. package/lib/runtime/components/react/dist/mpx-picker-view/pickerVIewContext.d.ts +0 -2
  40. package/lib/runtime/components/react/dist/mpx-picker-view/pickerVIewContext.js +0 -5
  41. package/lib/runtime/components/react/dist/mpx-picker-view-column/index.d.ts +1 -0
  42. package/lib/runtime/components/react/dist/mpx-picker-view-column/index.jsx +34 -14
  43. package/lib/runtime/components/react/dist/mpx-picker-view-column/pickerViewColumnItem.d.ts +0 -2
  44. package/lib/runtime/components/react/dist/mpx-picker-view-column/pickerViewColumnItem.jsx +4 -5
  45. package/lib/runtime/components/react/dist/mpx-picker-view-column/pickerViewColumnItemLite.d.ts +0 -2
  46. package/lib/runtime/components/react/dist/mpx-picker-view-column/pickerViewColumnItemLite.jsx +3 -5
  47. package/lib/runtime/components/react/dist/mpx-popup/index.d.ts +5 -4
  48. package/lib/runtime/components/react/dist/mpx-popup/index.jsx +2 -2
  49. package/lib/runtime/components/react/dist/mpx-popup/popupBase.jsx +3 -2
  50. package/lib/runtime/components/react/dist/mpx-progress.d.ts +0 -1
  51. package/lib/runtime/components/react/dist/mpx-progress.jsx +1 -2
  52. package/lib/runtime/components/react/dist/mpx-radio-group.d.ts +0 -1
  53. package/lib/runtime/components/react/dist/mpx-radio-group.jsx +2 -2
  54. package/lib/runtime/components/react/dist/mpx-radio.d.ts +0 -1
  55. package/lib/runtime/components/react/dist/mpx-radio.jsx +2 -2
  56. package/lib/runtime/components/react/dist/mpx-rich-text/index.d.ts +0 -1
  57. package/lib/runtime/components/react/dist/mpx-rich-text/index.jsx +1 -2
  58. package/lib/runtime/components/react/dist/mpx-scroll-view.d.ts +0 -1
  59. package/lib/runtime/components/react/dist/mpx-scroll-view.jsx +2 -2
  60. package/lib/runtime/components/react/dist/mpx-section-list.d.ts +51 -0
  61. package/lib/runtime/components/react/dist/mpx-section-list.jsx +376 -0
  62. package/lib/runtime/components/react/dist/mpx-simple-text.jsx +27 -14
  63. package/lib/runtime/components/react/dist/mpx-simple-view.d.ts +1 -0
  64. package/lib/runtime/components/react/dist/mpx-slider.d.ts +0 -1
  65. package/lib/runtime/components/react/dist/mpx-slider.jsx +1 -2
  66. package/lib/runtime/components/react/dist/mpx-sticky-header.d.ts +0 -1
  67. package/lib/runtime/components/react/dist/mpx-sticky-header.jsx +2 -2
  68. package/lib/runtime/components/react/dist/mpx-sticky-section.d.ts +0 -1
  69. package/lib/runtime/components/react/dist/mpx-sticky-section.jsx +2 -2
  70. package/lib/runtime/components/react/dist/mpx-swiper-item.d.ts +0 -1
  71. package/lib/runtime/components/react/dist/mpx-swiper.d.ts +0 -1
  72. package/lib/runtime/components/react/dist/mpx-swiper.jsx +1 -2
  73. package/lib/runtime/components/react/dist/mpx-switch.d.ts +0 -1
  74. package/lib/runtime/components/react/dist/mpx-switch.jsx +1 -2
  75. package/lib/runtime/components/react/dist/mpx-text.d.ts +0 -1
  76. package/lib/runtime/components/react/dist/mpx-text.jsx +22 -8
  77. package/lib/runtime/components/react/dist/mpx-video.d.ts +0 -1
  78. package/lib/runtime/components/react/dist/mpx-video.jsx +1 -2
  79. package/lib/runtime/components/react/dist/mpx-view.d.ts +0 -1
  80. package/lib/runtime/components/react/dist/mpx-view.jsx +1 -2
  81. package/lib/runtime/components/react/dist/mpx-web-view.d.ts +2 -1
  82. package/lib/runtime/components/react/dist/utils.d.ts +6 -9
  83. package/lib/runtime/components/react/dist/utils.jsx +70 -84
  84. package/lib/runtime/components/react/mpx-button.tsx +1 -3
  85. package/lib/runtime/components/react/mpx-camera.tsx +40 -5
  86. package/lib/runtime/components/react/mpx-canvas/index.tsx +5 -5
  87. package/lib/runtime/components/react/mpx-checkbox-group.tsx +1 -3
  88. package/lib/runtime/components/react/mpx-checkbox.tsx +1 -3
  89. package/lib/runtime/components/react/mpx-form.tsx +1 -3
  90. package/lib/runtime/components/react/mpx-icon/index.tsx +1 -3
  91. package/lib/runtime/components/react/mpx-image.tsx +2 -5
  92. package/lib/runtime/components/react/mpx-inline-text.tsx +13 -4
  93. package/lib/runtime/components/react/mpx-input.tsx +19 -10
  94. package/lib/runtime/components/react/mpx-label.tsx +1 -3
  95. package/lib/runtime/components/react/mpx-movable-area.tsx +2 -3
  96. package/lib/runtime/components/react/mpx-movable-view.tsx +1 -3
  97. package/lib/runtime/components/react/mpx-nav.tsx +1 -1
  98. package/lib/runtime/components/react/mpx-picker/index.tsx +100 -29
  99. package/lib/runtime/components/react/mpx-picker/multiSelector.tsx +3 -3
  100. package/lib/runtime/components/react/mpx-picker/selector.tsx +1 -1
  101. package/lib/runtime/components/react/mpx-picker/type.ts +4 -0
  102. package/lib/runtime/components/react/mpx-picker-view/index.tsx +12 -17
  103. package/lib/runtime/components/react/mpx-picker-view/pickerVIewContext.ts +0 -9
  104. package/lib/runtime/components/react/mpx-picker-view-column/index.tsx +44 -21
  105. package/lib/runtime/components/react/mpx-picker-view-column/pickerViewColumnItem.tsx +1 -9
  106. package/lib/runtime/components/react/mpx-picker-view-column/pickerViewColumnItemLite.tsx +0 -9
  107. package/lib/runtime/components/react/mpx-popup/index.tsx +7 -3
  108. package/lib/runtime/components/react/mpx-popup/popupBase.tsx +3 -2
  109. package/lib/runtime/components/react/mpx-progress.tsx +0 -3
  110. package/lib/runtime/components/react/mpx-radio-group.tsx +1 -3
  111. package/lib/runtime/components/react/mpx-radio.tsx +1 -3
  112. package/lib/runtime/components/react/mpx-rich-text/index.tsx +0 -3
  113. package/lib/runtime/components/react/mpx-scroll-view.tsx +1 -3
  114. package/lib/runtime/components/react/mpx-section-list.tsx +557 -0
  115. package/lib/runtime/components/react/mpx-simple-text.tsx +26 -13
  116. package/lib/runtime/components/react/mpx-slider.tsx +0 -3
  117. package/lib/runtime/components/react/mpx-sticky-header.tsx +1 -3
  118. package/lib/runtime/components/react/mpx-sticky-section.tsx +1 -3
  119. package/lib/runtime/components/react/mpx-swiper-item.tsx +0 -1
  120. package/lib/runtime/components/react/mpx-swiper.tsx +0 -3
  121. package/lib/runtime/components/react/mpx-switch.tsx +0 -3
  122. package/lib/runtime/components/react/mpx-text.tsx +21 -9
  123. package/lib/runtime/components/react/mpx-video.tsx +0 -3
  124. package/lib/runtime/components/react/mpx-view.tsx +0 -3
  125. package/lib/runtime/components/react/mpx-web-view.tsx +4 -3
  126. package/lib/runtime/components/react/utils.tsx +82 -88
  127. package/lib/template-compiler/compiler.js +6 -0
  128. package/package.json +5 -5
@@ -111,7 +111,7 @@ const getFixedHeight = (viewWidth, viewHeight, ratio) => {
111
111
  return !fixed ? viewHeight : fixed;
112
112
  };
113
113
  const Image = forwardRef((props, ref) => {
114
- const { src = '', mode = 'scaleToFill', style = {}, 'enable-var': enableVar, 'parent-font-size': parentFontSize, 'enable-fast-image': enableFastImage, 'parent-width': parentWidth, 'parent-height': parentHeight, 'is-svg': isSvgProp, bindload, binderror } = props;
114
+ const { src = '', mode = 'scaleToFill', style = {}, 'enable-var': enableVar, 'enable-fast-image': enableFastImage, 'parent-width': parentWidth, 'parent-height': parentHeight, 'is-svg': isSvgProp, bindload, binderror } = props;
115
115
  const styleObj = extendObject({}, style, OVERFLOW_HIDDEN_STYLE);
116
116
  const nodeRef = useRef(null);
117
117
  const isSvg = useMemo(() => isSvgProp || isSvgSource(src), [isSvgProp, src]);
@@ -140,7 +140,7 @@ const Image = forwardRef((props, ref) => {
140
140
  setLoaded(true);
141
141
  }
142
142
  };
143
- const { hasPositionFixed, hasSelfPercent, normalStyle, setWidth, setHeight } = useTransformStyle(styleObj, { enableVar, transformRadiusPercent: isAndroid && !isSvg && !isLayoutMode, parentFontSize, parentWidth, parentHeight, defaultStyle: DEFAULT_IMAGE_STYLE });
143
+ const { hasPositionFixed, hasSelfPercent, normalStyle, setWidth, setHeight } = useTransformStyle(styleObj, { enableVar, transformRadiusPercent: isAndroid && !isSvg && !isLayoutMode, parentWidth, parentHeight, defaultStyle: DEFAULT_IMAGE_STYLE });
144
144
  // normalStyle 已合入 DEFAULT_IMAGE_STYLE,对外暴露完整 style(含 default 兜底的 width/height)
145
145
  useNodesRef(props, ref, nodeRef, {
146
146
  style: normalStyle
@@ -1,14 +1,23 @@
1
1
  import { Text } from 'react-native';
2
2
  import { createElement, useContext } from 'react';
3
- import { extendObject, getDefaultAllowFontScaling } from './utils';
3
+ import { extendObject, getDefaultAllowFontScaling, resolveTextLineHeightPercentStyle } from './utils';
4
4
  import { TextPassThroughContext } from './context';
5
5
  const InlineText = (props) => {
6
6
  const inheritedText = useContext(TextPassThroughContext);
7
- const style = extendObject({}, inheritedText?.textStyle, props.style);
8
- const mergedProps = extendObject({}, inheritedText?.pendingTextProps, props, { style });
7
+ const mergedStyle = inheritedText?.textStyle
8
+ ? extendObject({}, inheritedText.textStyle)
9
+ : undefined;
10
+ // inline-text 只包裹裸文本,消费继承文本样式中的相对 lineHeight,不处理本地样式。
11
+ if (inheritedText?.textStyle) {
12
+ resolveTextLineHeightPercentStyle(mergedStyle, inheritedText.textStyle);
13
+ }
14
+ const mergedProps = inheritedText?.pendingTextProps
15
+ ? extendObject({}, inheritedText.pendingTextProps, props)
16
+ : props;
9
17
  const { allowFontScaling, children } = mergedProps;
10
18
  return createElement(Text, extendObject({}, mergedProps, {
11
- allowFontScaling: allowFontScaling ?? getDefaultAllowFontScaling()
19
+ allowFontScaling: allowFontScaling ?? getDefaultAllowFontScaling(),
20
+ style: mergedStyle
12
21
  }), children);
13
22
  };
14
23
  InlineText.displayName = 'MpxInlineText';
@@ -27,7 +27,6 @@ export interface InputProps {
27
27
  };
28
28
  'enable-offset'?: boolean;
29
29
  'enable-var'?: boolean;
30
- 'parent-font-size'?: number;
31
30
  'parent-width'?: number;
32
31
  'parent-height'?: number;
33
32
  'keyboard-type'?: string;
@@ -52,7 +52,7 @@ const inputModeMap = {
52
52
  digit: 'decimal'
53
53
  };
54
54
  const Input = forwardRef((props, ref) => {
55
- const { style = {}, allowFontScaling, 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, '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,
55
+ const { style = {}, allowFontScaling, 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, '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);
@@ -84,7 +84,7 @@ const Input = forwardRef((props, ref) => {
84
84
  const [contentHeight, setContentHeight] = useState(0);
85
85
  const [selection, setSelection] = useState({ start: -1, end: tmpValue.current.length });
86
86
  const styleObj = extendObject({ padding: 0, backgroundColor: '#fff' }, style, multiline && autoHeight ? { height: 'auto' } : {});
87
- const { hasPositionFixed, hasSelfPercent, normalStyle, setWidth, setHeight } = useTransformStyle(styleObj, { enableVar, parentFontSize, parentWidth, parentHeight });
87
+ const { hasPositionFixed, hasSelfPercent, normalStyle, setWidth, setHeight } = useTransformStyle(styleObj, { enableVar, parentWidth, parentHeight });
88
88
  const nodeRef = useRef(null);
89
89
  useNodesRef(props, ref, nodeRef, {
90
90
  style: normalStyle
@@ -153,7 +153,7 @@ const Input = forwardRef((props, ref) => {
153
153
  // auto-focus/focus 不会触发而是在 useEffect 中初始化
154
154
  setKeyboardAvoidContext();
155
155
  };
156
- const onTouchEnd = (evt) => {
156
+ const markEventOrigin = (evt) => {
157
157
  evt.nativeEvent.origin = 'input';
158
158
  };
159
159
  const onFocus = (evt) => {
@@ -286,7 +286,14 @@ const Input = forwardRef((props, ref) => {
286
286
  // React Native 的 TextInput 在 textAlign center + placeholder 时光标会跑到右边
287
287
  // 这个问题只在 Android 上出现
288
288
  // 参考:https://github.com/facebook/react-native/issues/28794 (Android only)
289
- const needMultilineFix = isAndroid && !multiline;
289
+ const conditionalTextInputProps = {};
290
+ if (isAndroid && !multiline && props.placeholder && normalStyle.textAlign === 'center') {
291
+ conditionalTextInputProps.multiline = true;
292
+ conditionalTextInputProps.numberOfLines = 1;
293
+ }
294
+ if (!multiline || confirmType !== 'return') {
295
+ conditionalTextInputProps.enterKeyHint = confirmType;
296
+ }
290
297
  const innerProps = useInnerProps(extendObject({}, props, layoutProps, {
291
298
  ref: nodeRef,
292
299
  style: extendObject({}, normalStyle, layoutStyle),
@@ -301,20 +308,21 @@ const Input = forwardRef((props, ref) => {
301
308
  autoFocus: isAutoFocus,
302
309
  selection: selectionStart > -1 || typeof cursor === 'number' ? selection : undefined,
303
310
  selectionColor: cursorColor,
304
- blurOnSubmit: multiline ? confirmType !== 'return' : !confirmHold,
311
+ submitBehavior: multiline ? (confirmType === 'return' ? 'newline' : 'blurAndSubmit') : (confirmHold ? 'submit' : 'blurAndSubmit'),
305
312
  underlineColorAndroid: 'rgba(0,0,0,0)',
306
313
  textAlignVertical: textAlignVertical,
307
314
  placeholderTextColor: placeholderStyle?.color,
308
- multiline: multiline || needMultilineFix,
315
+ multiline,
309
316
  onTouchStart,
310
- onTouchEnd,
317
+ onTouchEnd: markEventOrigin,
318
+ onTouchMove: markEventOrigin,
311
319
  onFocus,
312
320
  onBlur,
313
321
  onChange,
314
322
  onSelectionChange,
315
323
  onContentSizeChange,
316
324
  onSubmitEditing: bindconfirm && onSubmitEditing
317
- }, needMultilineFix ? { numberOfLines: 1 } : {}, !!multiline && confirmType === 'return' ? {} : { enterKeyHint: confirmType }), [
325
+ }, conditionalTextInputProps), [
318
326
  'name',
319
327
  'type',
320
328
  'maxlength',
@@ -10,7 +10,6 @@ export interface LabelProps {
10
10
  'enable-offset'?: boolean;
11
11
  'enable-var'?: boolean;
12
12
  'enable-text-pass-through'?: boolean;
13
- 'parent-font-size'?: number;
14
13
  'parent-width'?: number;
15
14
  'parent-height'?: number;
16
15
  children: ReactNode;
@@ -12,12 +12,12 @@ import Portal from './mpx-portal';
12
12
  const Label = forwardRef((labelProps, ref) => {
13
13
  const { textProps, innerProps: props = {} } = splitProps(labelProps);
14
14
  const propsRef = useRef({});
15
- const { style = {}, 'enable-var': enableVar, 'enable-text-pass-through': enableTextPassThrough, 'parent-font-size': parentFontSize, 'parent-width': parentWidth, 'parent-height': parentHeight } = props;
15
+ const { style = {}, 'enable-var': enableVar, 'enable-text-pass-through': enableTextPassThrough, 'parent-width': parentWidth, 'parent-height': parentHeight } = props;
16
16
  propsRef.current = props;
17
17
  const defaultStyle = {
18
18
  flexDirection: 'row'
19
19
  };
20
- const { hasPositionFixed, hasSelfPercent, normalStyle, hasVarDec, varContextRef, setWidth, setHeight } = useTransformStyle(style, { enableVar, parentFontSize, parentWidth, parentHeight, defaultStyle });
20
+ const { hasPositionFixed, hasSelfPercent, normalStyle, hasVarDec, varContextRef, setWidth, setHeight } = useTransformStyle(style, { enableVar, parentWidth, parentHeight, defaultStyle });
21
21
  const nodeRef = useRef(null);
22
22
  useNodesRef(props, ref, nodeRef, { style: normalStyle });
23
23
  const { layoutRef, layoutStyle, layoutProps } = useLayout({ props, hasSelfPercent, setWidth, setHeight, nodeRef });
@@ -11,7 +11,6 @@ interface MovableAreaProps {
11
11
  height?: number;
12
12
  'enable-offset'?: boolean;
13
13
  'enable-var'?: boolean;
14
- 'parent-font-size'?: number;
15
14
  'parent-width'?: number;
16
15
  'parent-height'?: number;
17
16
  }
@@ -9,8 +9,8 @@ import { MovableAreaContext } from './context';
9
9
  import { useTransformStyle, wrapChildren, useLayout, extendObject } from './utils';
10
10
  import Portal from './mpx-portal';
11
11
  const _MovableArea = forwardRef((props, ref) => {
12
- const { style = {}, 'enable-var': enableVar, 'parent-font-size': parentFontSize, 'parent-width': parentWidth, 'parent-height': parentHeight } = props;
13
- const { hasSelfPercent, normalStyle, hasVarDec, varContextRef, hasPositionFixed, setWidth, setHeight } = useTransformStyle(style, { enableVar, parentFontSize, parentWidth, parentHeight });
12
+ const { style = {}, 'enable-var': enableVar, 'parent-width': parentWidth, 'parent-height': parentHeight } = props;
13
+ const { hasSelfPercent, normalStyle, hasVarDec, varContextRef, hasPositionFixed, setWidth, setHeight } = useTransformStyle(style, { enableVar, parentWidth, parentHeight });
14
14
  const movableViewRef = useRef(null);
15
15
  useNodesRef(props, ref, movableViewRef, {
16
16
  style: normalStyle
@@ -56,7 +56,6 @@ interface MovableViewProps {
56
56
  inertia?: boolean;
57
57
  'enable-var'?: boolean;
58
58
  'enable-text-pass-through'?: boolean;
59
- 'parent-font-size'?: number;
60
59
  'parent-width'?: number;
61
60
  'parent-height'?: number;
62
61
  'disable-event-passthrough'?: boolean;
@@ -129,8 +129,8 @@ const _MovableView = forwardRef((movableViewProps, ref) => {
129
129
  const hasLayoutRef = useRef(false);
130
130
  const propsRef = useRef({});
131
131
  propsRef.current = (props || {});
132
- const { x = 0, y = 0, inertia = false, disabled = false, animation = true, damping = 20, friction = 2, 'out-of-bounds': outOfBounds = false, 'enable-var': enableVar, 'enable-text-pass-through': enableTextPassThrough, 'parent-font-size': parentFontSize, 'parent-width': parentWidth, 'parent-height': parentHeight, direction = 'none', 'disable-event-passthrough': disableEventPassthrough = false, 'simultaneous-handlers': originSimultaneousHandlers = [], 'wait-for': waitFor = [], style = {}, changeThrottleTime = 60, bindtouchstart, catchtouchstart, bindhtouchmove, bindvtouchmove, bindtouchmove, catchhtouchmove, catchvtouchmove, catchtouchmove, bindtouchend, catchtouchend, bindchange } = props;
133
- const { hasSelfPercent, normalStyle, hasVarDec, varContextRef, setWidth, setHeight } = useTransformStyle(Object.assign({}, style, styles.container), { enableVar, parentFontSize, parentWidth, parentHeight });
132
+ const { x = 0, y = 0, inertia = false, disabled = false, animation = true, damping = 20, friction = 2, 'out-of-bounds': outOfBounds = false, 'enable-var': enableVar, 'enable-text-pass-through': enableTextPassThrough, 'parent-width': parentWidth, 'parent-height': parentHeight, direction = 'none', 'disable-event-passthrough': disableEventPassthrough = false, 'simultaneous-handlers': originSimultaneousHandlers = [], 'wait-for': waitFor = [], style = {}, changeThrottleTime = 60, bindtouchstart, catchtouchstart, bindhtouchmove, bindvtouchmove, bindtouchmove, catchhtouchmove, catchvtouchmove, catchtouchmove, bindtouchend, catchtouchend, bindchange } = props;
133
+ const { hasSelfPercent, normalStyle, hasVarDec, varContextRef, setWidth, setHeight } = useTransformStyle(Object.assign({}, style, styles.container), { enableVar, parentWidth, parentHeight });
134
134
  const navigation = useNavigation();
135
135
  const prevSimultaneousHandlersRef = useRef(originSimultaneousHandlers || []);
136
136
  const prevWaitForHandlersRef = useRef(waitFor || []);
@@ -86,7 +86,7 @@ const MpxNav = memo(({ pageConfig, navigation }) => {
86
86
  };
87
87
  const isCustom = innerPageConfig.navigationStyle === 'custom';
88
88
  const navigationBarTextStyle = useMemo(() => validBarTextStyle(innerPageConfig.navigationBarTextStyle), [innerPageConfig.navigationBarTextStyle]);
89
- // 状态栏的颜色
89
+ // 状态栏由 MpxNav 根据页面配置统一控制,避免 native-stack screenOptions 在页面切换时覆盖页面级配置。
90
90
  const statusBarElement = (<StatusBar translucent backgroundColor='transparent' barStyle={navigationBarTextStyle === NavColor.White ? 'light-content' : 'dark-content'}></StatusBar>);
91
91
  if (isCustom)
92
92
  return statusBarElement;
@@ -6,10 +6,11 @@ import PickerMultiSelector from './multiSelector';
6
6
  import PickerTime from './time';
7
7
  import PickerDate from './date';
8
8
  import PickerRegion from './region';
9
+ import Portal from '../mpx-portal';
9
10
  import { FormContext, RouteContext } from '../context';
10
11
  import useNodesRef from '../useNodesRef';
11
12
  import useInnerProps, { getCustomEvent } from '../getInnerListeners';
12
- import { extendObject, useLayout } from '../utils';
13
+ import { extendObject, splitProps, splitStyle, useLayout, useTextPassThrough, useTransformStyle, wrapChildren } from '../utils';
13
14
  import { createPopupManager } from '../mpx-popup';
14
15
  /**
15
16
  * ✔ mode
@@ -103,27 +104,48 @@ const buttonTextMap = {
103
104
  confirm: 'Confirm'
104
105
  }
105
106
  };
106
- const Picker = forwardRef((props, ref) => {
107
- const { mode, value, range = null, children, disabled, bindcancel, bindchange, 'header-text': headerText = '' } = props;
107
+ const Picker = forwardRef((pickerProps, ref) => {
108
+ const { textProps, innerProps: splitInnerProps } = splitProps(pickerProps);
109
+ const props = (splitInnerProps || {});
110
+ const { mode, value, range = [], children, disabled, bindcancel, bindchange, 'header-text': headerText = '', style, 'enable-var': enableVar, 'enable-text-pass-through': enableTextPassThrough, 'parent-width': parentWidth, 'parent-height': parentHeight } = props;
111
+ const modalProps = props;
112
+ const rangeKey = modalProps['range-key'];
108
113
  const { pageId } = useContext(RouteContext) || {};
109
114
  const buttonText = buttonTextMap[global.__mpx?.i18n?.locale || 'zh-CN'];
110
115
  const pickerValue = useRef(value);
111
116
  pickerValue.current = Array.isArray(value) ? value.slice() : value;
112
117
  const nodeRef = useRef(null);
113
118
  const pickerRef = useRef(null);
114
- const { open, show, hide, remove } = useRef(createPopupManager()).current;
115
- useNodesRef(props, ref, nodeRef);
116
- const { layoutRef, layoutProps } = useLayout({
119
+ const { open, show, hide, remove, update } = useRef(createPopupManager()).current;
120
+ const { normalStyle, hasVarDec, varContextRef, hasSelfPercent, hasPositionFixed, setWidth, setHeight } = useTransformStyle(style, { enableVar, parentWidth, parentHeight });
121
+ const { textStyle, backgroundStyle, innerStyle = {} } = splitStyle(normalStyle);
122
+ const textPassThrough = useTextPassThrough(textStyle, textProps, { enableTextPassThrough });
123
+ if (backgroundStyle) {
124
+ warn('Picker does not support background image-related styles!');
125
+ }
126
+ useNodesRef(props, ref, nodeRef, {
127
+ style: normalStyle
128
+ });
129
+ const { layoutRef, layoutProps, layoutStyle } = useLayout({
117
130
  props,
118
- hasSelfPercent: false,
131
+ hasSelfPercent,
132
+ setWidth,
133
+ setHeight,
119
134
  nodeRef
120
135
  });
121
136
  const innerProps = useInnerProps(extendObject({}, props, {
122
- ref: nodeRef
137
+ ref: nodeRef,
138
+ style: extendObject({}, innerStyle, layoutStyle)
123
139
  }, layoutProps), [
124
140
  'mode',
125
141
  'value',
126
142
  'range',
143
+ 'range-key',
144
+ 'start',
145
+ 'end',
146
+ 'fields',
147
+ 'level',
148
+ 'custom-item',
127
149
  'disabled',
128
150
  'bindcancel',
129
151
  'bindchange',
@@ -133,9 +155,9 @@ const Picker = forwardRef((props, ref) => {
133
155
  ], { layoutRef });
134
156
  useEffect(() => {
135
157
  if (range && pickerRef.current && mode === "multiSelector" /* PickerMode.MULTI_SELECTOR */) {
136
- pickerRef.current.updateRange?.(range);
158
+ pickerRef.current.updateRange?.(range, rangeKey);
137
159
  }
138
- }, [JSON.stringify(range)]);
160
+ }, [JSON.stringify(range), rangeKey, mode]);
139
161
  /** --- form 表单组件内部方法 --- */
140
162
  const getValue = () => {
141
163
  return pickerValue.current;
@@ -185,14 +207,8 @@ const Picker = forwardRef((props, ref) => {
185
207
  bindchange?.(eventData);
186
208
  hide();
187
209
  };
188
- const specificProps = extendObject({}, innerProps, {
189
- mode,
190
- children,
191
- bindchange: onChange,
192
- bindcolumnchange: onColumnChange,
193
- getRange: () => range
194
- });
195
- const renderPickerContent = () => {
210
+ const getContentHeight = () => headerText ? 350 : 310;
211
+ const getPickerContent = () => {
196
212
  if (disabled) {
197
213
  return null;
198
214
  }
@@ -200,9 +216,21 @@ const Picker = forwardRef((props, ref) => {
200
216
  if (!(_mode in pickerModalMap)) {
201
217
  return warn(`[Mpx runtime warn]: Unsupported <picker> mode: ${mode}`);
202
218
  }
219
+ const specificProps = {
220
+ mode: _mode,
221
+ range,
222
+ 'range-key': rangeKey,
223
+ start: modalProps.start,
224
+ end: modalProps.end,
225
+ fields: modalProps.fields,
226
+ level: modalProps.level,
227
+ 'custom-item': modalProps['custom-item'],
228
+ bindchange: onChange,
229
+ bindcolumnchange: onColumnChange
230
+ };
203
231
  const _value = value;
204
232
  const PickerModal = pickerModalMap[_mode];
205
- const renderPickerModal = (<>
233
+ return (<>
206
234
  {headerText && (<View style={[styles.header]}>
207
235
  <Text style={[styles.headerText]}>{headerText}</Text>
208
236
  </View>)}
@@ -216,16 +244,37 @@ const Picker = forwardRef((props, ref) => {
216
244
  </View>
217
245
  </View>
218
246
  </>);
219
- const contentHeight = headerText ? 350 : 310;
220
- open(renderPickerModal, pageId, { contentHeight });
247
+ };
248
+ const openPickerContent = () => {
249
+ const renderPickerModal = getPickerContent();
250
+ if (!renderPickerModal) {
251
+ return;
252
+ }
253
+ open(renderPickerModal, pageId, { contentHeight: getContentHeight() });
221
254
  };
222
255
  useEffect(() => {
223
- renderPickerContent();
256
+ openPickerContent();
224
257
  return () => {
225
258
  remove();
226
259
  };
227
260
  }, []);
228
- return createElement(TouchableWithoutFeedback, { onPress: show }, createElement(View, innerProps, children));
261
+ const showPicker = () => {
262
+ const renderPickerModal = getPickerContent();
263
+ if (!renderPickerModal) {
264
+ return;
265
+ }
266
+ update(renderPickerModal, { contentHeight: getContentHeight() });
267
+ show();
268
+ };
269
+ const finalComponent = createElement(TouchableWithoutFeedback, { onPress: showPicker }, createElement(View, innerProps, wrapChildren(children, {
270
+ hasVarDec,
271
+ varContext: varContextRef.current,
272
+ textPassThrough
273
+ })));
274
+ if (hasPositionFixed) {
275
+ return createElement(Portal, null, finalComponent);
276
+ }
277
+ return finalComponent;
229
278
  });
230
279
  Picker.displayName = 'MpxPicker';
231
280
  export default Picker;
@@ -41,8 +41,8 @@ const PickerMultiSelector = forwardRef((props, ref) => {
41
41
  setFormatValue(newValue);
42
42
  }
43
43
  }, [formatValue]);
44
- const updateRange = (newRange) => {
45
- const range = formatRangeFun(newRange.slice(), props['range-key']);
44
+ const updateRange = (newRange, rangeKey) => {
45
+ const range = formatRangeFun(newRange.slice(), rangeKey);
46
46
  setFormatRange(range);
47
47
  };
48
48
  const _props = useRef(props);
@@ -25,6 +25,10 @@ export interface BasePickerProps {
25
25
  /** 作为表单组件时的名称 */
26
26
  name?: string;
27
27
  style?: Record<string, any>;
28
+ 'enable-var'?: boolean;
29
+ 'enable-text-pass-through'?: boolean;
30
+ 'parent-width'?: number;
31
+ 'parent-height'?: number;
28
32
  children?: React.ReactNode;
29
33
  range?: RangeItem[];
30
34
  ref?: any;
@@ -3,7 +3,6 @@ import React, { createElement, forwardRef, useRef } from 'react';
3
3
  import useInnerProps, { getCustomEvent } from '../getInnerListeners';
4
4
  import useNodesRef from '../useNodesRef';
5
5
  import { useLayout, splitProps, splitStyle, wrapChildren, useTransformStyle, extendObject, useTextPassThrough } from '../utils';
6
- import { PickerViewStyleContext } from './pickerVIewContext';
7
6
  import Portal from '../mpx-portal';
8
7
  const styles = {
9
8
  wrapper: {
@@ -82,12 +81,7 @@ const _PickerView = forwardRef((props, ref) => {
82
81
  pickerMaskStyle,
83
82
  enableWheelAnimation
84
83
  });
85
- const realElement = React.cloneElement(child, wrappedProps);
86
- return wrapChildren(realElement, {
87
- hasVarDec,
88
- varContext: varContextRef.current,
89
- textPassThrough
90
- });
84
+ return React.cloneElement(child, wrappedProps);
91
85
  };
92
86
  const validateChildInitialIndex = (index, data) => {
93
87
  return Math.max(0, Math.min(value[index] || 0, data.length - 1));
@@ -117,7 +111,11 @@ const _PickerView = forwardRef((props, ref) => {
117
111
  onInitialChange(isInvalid, validValue);
118
112
  return renderColumns;
119
113
  };
120
- const finalComponent = createElement(PickerViewStyleContext.Provider, { value: textStyle }, createElement(View, innerProps, createElement(View, { style: [styles.wrapper] }, renderPickerColumns())));
114
+ const finalComponent = createElement(View, innerProps, createElement(View, { style: [styles.wrapper] }, wrapChildren(renderPickerColumns(), {
115
+ hasVarDec,
116
+ varContext: varContextRef.current,
117
+ textPassThrough
118
+ })));
121
119
  if (hasPositionFixed) {
122
120
  return createElement(Portal, null, finalComponent);
123
121
  }
@@ -3,6 +3,4 @@ import { SharedValue } from 'react-native-reanimated';
3
3
  type ContextValue = SharedValue<number>;
4
4
  export declare const PickerViewColumnAnimationContext: import("react").Context<ContextValue | undefined>;
5
5
  export declare const usePickerViewColumnAnimationContext: () => ContextValue;
6
- export declare const PickerViewStyleContext: import("react").Context<Record<string, any> | undefined>;
7
- export declare const usePickerViewStyleContext: () => Record<string, any> | undefined;
8
6
  export {};
@@ -7,8 +7,3 @@ export const usePickerViewColumnAnimationContext = () => {
7
7
  }
8
8
  return value;
9
9
  };
10
- export const PickerViewStyleContext = createContext(undefined);
11
- export const usePickerViewStyleContext = () => {
12
- const value = useContext(PickerViewStyleContext);
13
- return value;
14
- };
@@ -17,6 +17,7 @@ interface ColumnProps {
17
17
  pickerMaskStyle: Record<string, any>;
18
18
  pickerIndicatorStyle: Record<string, any>;
19
19
  enableWheelAnimation?: boolean;
20
+ 'enable-text-pass-through'?: boolean;
20
21
  }
21
22
  declare const _PickerViewColumn: React.ForwardRefExoticComponent<ColumnProps & React.RefAttributes<HandlerRef<ScrollView & View, ColumnProps>>>;
22
23
  export default _PickerViewColumn;
@@ -1,7 +1,7 @@
1
1
  import React, { forwardRef, useRef, useState, useMemo, useEffect, useCallback, createElement } from 'react';
2
2
  import { StyleSheet, View } from 'react-native';
3
3
  import Reanimated, { useAnimatedRef, useScrollViewOffset } from 'react-native-reanimated';
4
- import { useTransformStyle, splitStyle, splitProps, useLayout, usePrevious, isAndroid, isIOS, isHarmony, extendObject } from '../utils';
4
+ import { useTransformStyle, splitStyle, splitProps, useLayout, usePrevious, isAndroid, isIOS, isHarmony, extendObject, useTextPassThrough, wrapChildren } from '../utils';
5
5
  import useNodesRef from '../useNodesRef';
6
6
  import PickerIndicator from './pickerViewIndicator';
7
7
  import PickerMask from './pickerViewMask';
@@ -11,17 +11,18 @@ import { PickerViewColumnAnimationContext } from '../mpx-picker-view/pickerVIewC
11
11
  import { calcHeightOffsets } from './pickerViewFaces';
12
12
  const visibleCount = 5;
13
13
  const _PickerViewColumn = forwardRef((props, ref) => {
14
- const { columnData, columnIndex, initialIndex, onSelectChange, style, wrapperStyle, pickerMaskStyle, pickerIndicatorStyle, enableWheelAnimation = true, 'enable-var': enableVar } = props;
15
- const { normalStyle, hasSelfPercent, setWidth, setHeight } = useTransformStyle(style, { enableVar });
16
- const { textStyle = {} } = splitStyle(normalStyle);
17
- const { textProps = {} } = splitProps(props);
14
+ const { columnData, columnIndex, initialIndex, onSelectChange, style, wrapperStyle, pickerMaskStyle, pickerIndicatorStyle, enableWheelAnimation = true, 'enable-var': enableVar, 'enable-text-pass-through': enableTextPassThrough } = props;
15
+ const { normalStyle, hasVarDec, varContextRef, hasSelfPercent, setWidth, setHeight } = useTransformStyle(style, { enableVar });
16
+ const { textStyle } = splitStyle(normalStyle);
17
+ const { textProps } = splitProps(props);
18
+ const textPassThrough = useTextPassThrough(textStyle, textProps, { enableTextPassThrough });
18
19
  const scrollViewRef = useAnimatedRef();
19
20
  const offsetYShared = useScrollViewOffset(scrollViewRef);
20
21
  useNodesRef(props, ref, scrollViewRef, {
21
22
  style: normalStyle
22
23
  });
23
24
  const { height: pickerH, itemHeight } = wrapperStyle;
24
- const [itemRawH, setItemRawH] = useState(itemHeight);
25
+ const [itemRawH, setItemRawH] = useState(Math.round(itemHeight));
25
26
  const maxIndex = useMemo(() => columnData.length - 1, [columnData]);
26
27
  const prevScrollingInfo = useRef({ index: initialIndex, y: 0 });
27
28
  const dragging = useRef(false);
@@ -39,7 +40,7 @@ const _PickerViewColumn = forwardRef((props, ref) => {
39
40
  setHeight,
40
41
  nodeRef: scrollViewRef
41
42
  });
42
- const paddingHeight = useMemo(() => Math.round((pickerH - itemHeight) / 2), [pickerH, itemHeight]);
43
+ const paddingHeight = useMemo(() => (pickerH - itemRawH) / 2, [pickerH, itemRawH]);
43
44
  const snapToOffsets = useMemo(() => Array.from({ length: maxIndex + 1 }, (_, i) => i * itemRawH), [maxIndex, itemRawH]);
44
45
  const contentContainerStyle = useMemo(() => {
45
46
  return [{ paddingVertical: paddingHeight }];
@@ -73,6 +74,15 @@ const _PickerViewColumn = forwardRef((props, ref) => {
73
74
  clearTimerScrollTo();
74
75
  };
75
76
  }, []);
77
+ // `contentOffset` prop sets visual position but does not fire scroll events,
78
+ // so `offsetYShared` (from `useScrollViewOffset`) stays at 0 until the user scrolls.
79
+ // Directly sync it whenever `itemRawH` is established so wheel animation renders correctly.
80
+ useEffect(() => {
81
+ if (!itemRawH || dragging.current || scrolling.current) {
82
+ return;
83
+ }
84
+ offsetYShared.value = activeIndex.current * itemRawH;
85
+ }, [itemRawH]);
76
86
  useEffect(() => {
77
87
  if (!scrollViewRef.current ||
78
88
  !itemRawH ||
@@ -94,13 +104,19 @@ const _PickerViewColumn = forwardRef((props, ref) => {
94
104
  activeIndex.current = initialIndex;
95
105
  }, isIOS ? 0 : 200);
96
106
  }, [itemRawH, maxIndex, initialIndex]);
107
+ useEffect(() => {
108
+ const roundedH = Math.round(itemHeight);
109
+ if (roundedH) {
110
+ setItemRawH(roundedH);
111
+ }
112
+ }, [itemHeight]);
97
113
  const onItemLayout = useCallback((e) => {
98
114
  const { height: rawH } = e.nativeEvent.layout;
99
115
  const roundedH = Math.round(rawH);
100
- if (roundedH && roundedH !== itemRawH) {
116
+ if (roundedH) {
101
117
  setItemRawH(roundedH);
102
118
  }
103
- }, [itemRawH]);
119
+ }, []);
104
120
  const resetScrollPosition = useCallback((y) => {
105
121
  if (dragging.current || scrolling.current) {
106
122
  return;
@@ -210,8 +226,8 @@ const _PickerViewColumn = forwardRef((props, ref) => {
210
226
  }, [itemRawH, maxIndex, calcOffset, onMomentumScrollEnd]);
211
227
  const renderInnerchild = () => columnData.map((item, index) => {
212
228
  return enableWheelAnimation
213
- ? (<MpxPickerViewColumnItem key={index} item={item} index={index} itemHeight={itemHeight} textStyle={textStyle} textProps={textProps} visibleCount={visibleCount} onItemLayout={onItemLayout}/>)
214
- : (<MpxPickerViewColumnItemLite key={index} item={item} index={index} itemHeight={itemHeight} textStyle={textStyle} textProps={textProps} onItemLayout={onItemLayout}/>);
229
+ ? (<MpxPickerViewColumnItem key={index} item={item} index={index} itemHeight={itemRawH} visibleCount={visibleCount} onItemLayout={onItemLayout}/>)
230
+ : (<MpxPickerViewColumnItemLite key={index} item={item} index={index} itemHeight={itemRawH} onItemLayout={onItemLayout}/>);
215
231
  });
216
232
  const renderScollView = () => {
217
233
  const innerProps = extendObject({}, layoutProps, {
@@ -235,10 +251,14 @@ const _PickerViewColumn = forwardRef((props, ref) => {
235
251
  contentContainerStyle,
236
252
  contentOffset: { x: 0, y: initialContentOffsetY }
237
253
  });
238
- return createElement(PickerViewColumnAnimationContext.Provider, { value: offsetYShared }, createElement(Reanimated.ScrollView, innerProps, renderInnerchild()));
254
+ return createElement(PickerViewColumnAnimationContext.Provider, { value: offsetYShared }, createElement(Reanimated.ScrollView, innerProps, wrapChildren(renderInnerchild(), {
255
+ hasVarDec,
256
+ varContext: varContextRef.current,
257
+ textPassThrough
258
+ })));
239
259
  };
240
- const renderIndicator = () => (<PickerIndicator itemHeight={itemHeight} indicatorItemStyle={pickerIndicatorStyle}/>);
241
- const renderMask = () => (<PickerMask itemHeight={itemHeight} maskContainerStyle={pickerMaskStyle}/>);
260
+ const renderIndicator = () => (<PickerIndicator itemHeight={itemRawH} indicatorItemStyle={pickerIndicatorStyle}/>);
261
+ const renderMask = () => (<PickerMask itemHeight={itemRawH} maskContainerStyle={pickerMaskStyle}/>);
242
262
  return (<View style={[styles.wrapper, normalStyle]}>
243
263
  {renderScollView()}
244
264
  {renderMask()}
@@ -5,9 +5,7 @@ interface PickerColumnItemProps {
5
5
  index: number;
6
6
  itemHeight: number;
7
7
  itemWidth?: number | '100%';
8
- textStyle: Record<string, any>;
9
8
  visibleCount: number;
10
- textProps?: any;
11
9
  onItemLayout?: (e: LayoutChangeEvent) => void;
12
10
  }
13
11
  declare const PickerViewColumnItem: React.FC<PickerColumnItemProps>;
@@ -2,9 +2,8 @@ import React, { useMemo } from 'react';
2
2
  import Reanimated, { Extrapolation, interpolate, useAnimatedStyle } from 'react-native-reanimated';
3
3
  import { extendObject } from '../utils';
4
4
  import { createFaces } from './pickerViewFaces';
5
- import { usePickerViewColumnAnimationContext, usePickerViewStyleContext } from '../mpx-picker-view/pickerVIewContext';
6
- const PickerViewColumnItem = ({ item, index, itemHeight, itemWidth = '100%', textStyle, textProps, visibleCount, onItemLayout }) => {
7
- const textStyleFromAncestor = usePickerViewStyleContext();
5
+ import { usePickerViewColumnAnimationContext } from '../mpx-picker-view/pickerVIewContext';
6
+ const PickerViewColumnItem = ({ item, index, itemHeight, itemWidth = '100%', visibleCount, onItemLayout }) => {
8
7
  const offsetYShared = usePickerViewColumnAnimationContext();
9
8
  const facesShared = useMemo(() => createFaces(itemHeight, visibleCount), [itemHeight, visibleCount]);
10
9
  const animatedStyles = useAnimatedStyle(() => {
@@ -21,8 +20,8 @@ const PickerViewColumnItem = ({ item, index, itemHeight, itemWidth = '100%', tex
21
20
  const strKey = `picker-column-item-${index}`;
22
21
  const restProps = index === 0 ? { onLayout: onItemLayout } : {};
23
22
  const itemProps = extendObject({
24
- style: extendObject({ height: itemHeight, width: '100%' }, textStyleFromAncestor, textStyle, item.props.style)
25
- }, textProps, restProps);
23
+ style: extendObject({ height: itemHeight, width: '100%' }, item.props.style)
24
+ }, restProps);
26
25
  const realItem = React.cloneElement(item, itemProps);
27
26
  return (<Reanimated.View key={strKey} style={[
28
27
  { height: itemHeight, width: itemWidth, pointerEvents: 'none' },
@@ -5,8 +5,6 @@ interface PickerColumnItemProps {
5
5
  index: number;
6
6
  itemHeight: number;
7
7
  itemWidth?: number | '100%';
8
- textStyle: Record<string, any>;
9
- textProps?: any;
10
8
  onItemLayout?: (e: LayoutChangeEvent) => void;
11
9
  }
12
10
  declare const PickerViewColumnItem: React.FC<PickerColumnItemProps>;
@@ -1,14 +1,12 @@
1
1
  import React from 'react';
2
2
  import { View } from 'react-native';
3
3
  import { extendObject } from '../utils';
4
- import { usePickerViewStyleContext } from '../mpx-picker-view/pickerVIewContext';
5
- const PickerViewColumnItem = ({ item, index, itemHeight, itemWidth = '100%', textStyle, textProps, onItemLayout }) => {
6
- const textStyleFromAncestor = usePickerViewStyleContext();
4
+ const PickerViewColumnItem = ({ item, index, itemHeight, itemWidth = '100%', onItemLayout }) => {
7
5
  const strKey = `picker-column-item-${index}`;
8
6
  const restProps = index === 0 ? { onLayout: onItemLayout } : {};
9
7
  const itemProps = extendObject({
10
- style: extendObject({ height: itemHeight, width: '100%' }, textStyleFromAncestor, textStyle, item.props.style)
11
- }, textProps, restProps);
8
+ style: extendObject({ height: itemHeight, width: '100%' }, item.props.style)
9
+ }, restProps);
12
10
  const realItem = React.cloneElement(item, itemProps);
13
11
  return (<View key={strKey} style={[
14
12
  { height: itemHeight, width: itemWidth, pointerEvents: 'none' }