@xhsreds/reds-rn-next 0.9.0 → 0.9.1-beta202510271514

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 (60) hide show
  1. package/coverage/.tmp/coverage-0.json +1 -1
  2. package/coverage/.tmp/coverage-10.json +1 -1
  3. package/coverage/.tmp/coverage-11.json +1 -1
  4. package/coverage/.tmp/coverage-12.json +1 -1
  5. package/coverage/.tmp/coverage-13.json +1 -1
  6. package/coverage/.tmp/coverage-14.json +1 -1
  7. package/coverage/.tmp/coverage-15.json +1 -1
  8. package/coverage/.tmp/coverage-16.json +1 -1
  9. package/coverage/.tmp/coverage-17.json +1 -1
  10. package/coverage/.tmp/coverage-18.json +1 -1
  11. package/coverage/.tmp/coverage-19.json +1 -1
  12. package/coverage/.tmp/coverage-2.json +1 -1
  13. package/coverage/.tmp/coverage-20.json +1 -1
  14. package/coverage/.tmp/coverage-21.json +1 -1
  15. package/coverage/.tmp/coverage-22.json +1 -1
  16. package/coverage/.tmp/coverage-23.json +1 -1
  17. package/coverage/.tmp/coverage-24.json +1 -1
  18. package/coverage/.tmp/coverage-25.json +1 -1
  19. package/coverage/.tmp/coverage-3.json +1 -1
  20. package/coverage/.tmp/coverage-34.json +1 -1
  21. package/coverage/.tmp/coverage-35.json +1 -1
  22. package/coverage/.tmp/coverage-36.json +1 -1
  23. package/coverage/.tmp/coverage-37.json +1 -1
  24. package/coverage/.tmp/coverage-38.json +1 -1
  25. package/coverage/.tmp/coverage-39.json +1 -1
  26. package/coverage/.tmp/coverage-4.json +1 -1
  27. package/coverage/.tmp/coverage-40.json +1 -1
  28. package/coverage/.tmp/coverage-41.json +1 -1
  29. package/coverage/.tmp/coverage-5.json +1 -1
  30. package/coverage/.tmp/coverage-6.json +1 -1
  31. package/coverage/.tmp/coverage-7.json +1 -1
  32. package/coverage/.tmp/coverage-8.json +1 -1
  33. package/coverage/.tmp/coverage-9.json +1 -1
  34. package/lib/cjs/_chunks/CwkpVXDI.js.map +1 -1
  35. package/lib/cjs/components/Carousel/Carousel.js +9 -2
  36. package/lib/cjs/components/Carousel/Carousel.js.map +1 -1
  37. package/lib/cjs/components/Popover/Popover.js +4 -3
  38. package/lib/cjs/components/Popover/Popover.js.map +1 -1
  39. package/lib/cjs/components/Sheets/styles.js +2 -2
  40. package/lib/cjs/components/Sheets/styles.js.map +1 -1
  41. package/lib/esm/_chunks/Da9cW8JG.js.map +1 -1
  42. package/lib/esm/components/Carousel/Carousel.js +9 -2
  43. package/lib/esm/components/Carousel/Carousel.js.map +1 -1
  44. package/lib/esm/components/Popover/Popover.js +4 -3
  45. package/lib/esm/components/Popover/Popover.js.map +1 -1
  46. package/lib/esm/components/Sheets/styles.js +2 -2
  47. package/lib/esm/components/Sheets/styles.js.map +1 -1
  48. package/lib/src/components/Popover/Popover.d.ts +1 -1
  49. package/lib/src/components/Popover/interface/index.d.ts +1 -0
  50. package/lib/types/components/Popover/Popover.d.ts +1 -1
  51. package/lib/types/components/Popover/interface/index.d.ts +1 -0
  52. package/package.json +2 -2
  53. package/src/components/Carousel/Carousel.tsx +15 -3
  54. package/src/components/Carousel/demo/index.tsx +14 -2
  55. package/src/components/Popover/Popover.tsx +4 -3
  56. package/src/components/Popover/doc/index.mdx +22 -21
  57. package/src/components/Popover/interface/index.ts +1 -0
  58. package/src/components/Sheets/styles.ts +2 -2
  59. package/src/i18n/@types/resources.d.ts +27 -27
  60. package/src/i18n/index.json +31 -31
@@ -1 +1 @@
1
- {"version":3,"file":"styles.js","sources":["../../../../src/components/Sheets/styles.ts"],"sourcesContent":["import { StyleSheet } from \"react-native\";\nimport { typography } from \"@xhsreds/reds-token-next\";\n\nconst styles = StyleSheet.create({\n wrapper: {\n position: \"absolute\",\n bottom: 0,\n left: 0,\n right: 0,\n top: 0,\n },\n mask: {\n width: \"100%\",\n height: \"100%\",\n position: \"absolute\",\n bottom: 0,\n left: 0,\n right: 0,\n top: 0,\n },\n picker: {\n borderTopLeftRadius: 12,\n borderTopRightRadius: 12,\n position: \"absolute\",\n bottom: 0,\n left: 0,\n right: 0,\n },\n labelContainer: {\n display: \"flex\",\n justifyContent: \"space-between\",\n alignItems: \"center\",\n flexDirection: \"row\",\n height: 44,\n paddingLeft: 16,\n paddingRight: 16,\n borderTopLeftRadius: 12,\n borderTopRightRadius: 12,\n },\n leftLabelContainer: {\n display: \"flex\",\n justifyContent: \"flex-start\",\n alignItems: \"center\",\n flexDirection: \"row\",\n height: 44,\n paddingLeft: 16,\n paddingRight: 16,\n borderTopLeftRadius: 12,\n borderTopRightRadius: 12,\n },\n cancel: {\n fontSize: typography.B1LooseFontSize,\n fontWeight: typography.B1LooseFontWeight,\n },\n confirm: {\n fontSize: typography.B1LooseFontSize,\n fontWeight: typography.T3FontWeight,\n },\n label: {\n fontSize: typography.B1LooseFontSize,\n fontWeight: typography.T3FontWeight,\n },\n iconBg: {\n width: 28,\n height: 28,\n borderRadius: 28,\n display: \"flex\",\n justifyContent: \"center\",\n alignItems: \"center\",\n },\n dragableContainer: {\n width: \"100%\",\n height: 20,\n display: \"flex\",\n justifyContent: \"center\",\n alignItems: \"center\",\n },\n dragable: {\n width: 33,\n height: 4,\n borderRadius: 10,\n },\n block: {\n width: 28,\n height: 28,\n },\n actionContainer: {\n display: \"flex\",\n justifyContent: \"space-between\",\n alignItems: \"center\",\n flexDirection: \"row\",\n width: \"100%\",\n paddingHorizontal: 56,\n },\n action: {\n flex: 1,\n marginHorizontal: 12,\n },\n});\n\nexport default styles;\n"],"names":["styles","StyleSheet","create","wrapper","position","bottom","left","right","top","mask","width","height","picker","borderTopLeftRadius","borderTopRightRadius","labelContainer","display","justifyContent","alignItems","flexDirection","paddingLeft","paddingRight","leftLabelContainer","cancel","fontSize","typography","B1LooseFontSize","fontWeight","B1LooseFontWeight","confirm","T3FontWeight","label","iconBg","borderRadius","dragableContainer","dragable","block","actionContainer","paddingHorizontal","action","flex","marginHorizontal"],"mappings":";;;AAGA,IAAMA,MAAA,GAASC,WA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,MAAA;AACP4B,IAAAA,iBAAmB,EAAA,EAAA;GACrB;AACAC,EAAAA,MAAQ,EAAA;AACNC,IAAAA,IAAM,EAAA,CAAA;AACNC,IAAAA,gBAAkB,EAAA,EAAA;AACpB,GAAA;AACF,CAAC;;;;"}
1
+ {"version":3,"file":"styles.js","sources":["../../../../src/components/Sheets/styles.ts"],"sourcesContent":["import { StyleSheet } from \"react-native\";\nimport { typography } from \"@xhsreds/reds-token-next\";\n\nconst styles = StyleSheet.create({\n wrapper: {\n position: \"absolute\",\n bottom: 0,\n left: 0,\n right: 0,\n top: 0,\n },\n mask: {\n width: \"100%\",\n height: \"100%\",\n position: \"absolute\",\n bottom: 0,\n left: 0,\n right: 0,\n top: 0,\n },\n picker: {\n borderTopLeftRadius: 12,\n borderTopRightRadius: 12,\n position: \"absolute\",\n bottom: 0,\n left: 0,\n right: 0,\n },\n labelContainer: {\n display: \"flex\",\n justifyContent: \"space-between\",\n alignItems: \"center\",\n flexDirection: \"row\",\n height: 44,\n paddingLeft: 16,\n paddingRight: 16,\n borderTopLeftRadius: 12,\n borderTopRightRadius: 12,\n },\n leftLabelContainer: {\n display: \"flex\",\n justifyContent: \"flex-start\",\n alignItems: \"center\",\n flexDirection: \"row\",\n height: 44,\n paddingLeft: 16,\n paddingRight: 16,\n borderTopLeftRadius: 12,\n borderTopRightRadius: 12,\n },\n cancel: {\n fontSize: typography.B2LooseSwitchFontSize,\n fontWeight: typography.B1LooseFontWeight,\n },\n confirm: {\n fontSize: typography.B2LooseSwitchFontSize,\n fontWeight: typography.T3FontWeight,\n },\n label: {\n fontSize: typography.B1LooseFontSize,\n fontWeight: typography.T3FontWeight,\n },\n iconBg: {\n width: 28,\n height: 28,\n borderRadius: 28,\n display: \"flex\",\n justifyContent: \"center\",\n alignItems: \"center\",\n },\n dragableContainer: {\n width: \"100%\",\n height: 20,\n display: \"flex\",\n justifyContent: \"center\",\n alignItems: \"center\",\n },\n dragable: {\n width: 33,\n height: 4,\n borderRadius: 10,\n },\n block: {\n width: 28,\n height: 28,\n },\n actionContainer: {\n display: \"flex\",\n justifyContent: \"space-between\",\n alignItems: \"center\",\n flexDirection: \"row\",\n width: \"100%\",\n paddingHorizontal: 56,\n },\n action: {\n flex: 1,\n marginHorizontal: 12,\n },\n});\n\nexport default styles;\n"],"names":["styles","StyleSheet","create","wrapper","position","bottom","left","right","top","mask","width","height","picker","borderTopLeftRadius","borderTopRightRadius","labelContainer","display","justifyContent","alignItems","flexDirection","paddingLeft","paddingRight","leftLabelContainer","cancel","fontSize","typography","B2LooseSwitchFontSize","fontWeight","B1LooseFontWeight","confirm","T3FontWeight","label","B1LooseFontSize","iconBg","borderRadius","dragableContainer","dragable","block","actionContainer","paddingHorizontal","action","flex","marginHorizontal"],"mappings":";;;AAGA,IAAMA,MAAA,GAASC,WAAWC,MAAO,CAAA;AAC/BC,EAAAA,OAAS,EAAA;AACPC,IAAAA,QAAU,EAAA,UAAA;AACVC,IAAAA,MAAQ,EAAA,CAAA;AACRC,IAAAA,IAAM,EAAA,CAAA;AACNC,IAAAA,KAAO,EAAA,CAAA;AACPC,IAAAA,GAAK,EAAA,CAAA;GACP;AACAC,EAAAA,IAAM,EAAA;AACJC,IAAAA,KAAO,EAAA,MAAA;AACPC,IAAAA,MAAQ,EAAA,MAAA;AACRP,IAAAA,QAAU,EAAA,UAAA;AACVC,IAAAA,MAAQ,EAAA,CAAA;AACRC,IAAAA,IAAM,EAAA,CAAA;AACNC,IAAAA,KAAO,EAAA,CAAA;AACPC,IAAAA,GAAK,EAAA,CAAA;GACP;AACAI,EAAAA,MAAQ,EAAA;AACNC,IAAAA,mBAAqB,EAAA,EAAA;AACrBC,IAAAA,oBAAsB,EAAA,EAAA;AACtBV,IAAAA,QAAU,EAAA,UAAA;AACVC,IAAAA,MAAQ,EAAA,CAAA;AACRC,IAAAA,IAAM,EAAA,CAAA;AACNC,IAAAA,KAAO,EAAA,CAAA;GACT;AACAQ,EAAAA,cAAgB,EAAA;AACdC,IAAAA,O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AACRK,IAAAA,OAAS,EAAA,MAAA;AACTC,IAAAA,cAAgB,EAAA,QAAA;AAChBC,IAAAA,UAAY,EAAA,QAAA;GACd;AACAkB,EAAAA,QAAU,EAAA;AACR1B,IAAAA,KAAO,EAAA,EAAA;AACPC,IAAAA,MAAQ,EAAA,CAAA;AACRuB,IAAAA,YAAc,EAAA,EAAA;GAChB;AACAG,EAAAA,KAAO,EAAA;AACL3B,IAAAA,KAAO,EAAA,EAAA;AACPC,IAAAA,MAAQ,EAAA,EAAA;GACV;AACA2B,EAAAA,eAAiB,EAAA;AACftB,IAAAA,OAAS,EAAA,MAAA;AACTC,IAAAA,cAAgB,EAAA,eAAA;AAChBC,IAAAA,UAAY,EAAA,QAAA;AACZC,IAAAA,aAAe,EAAA,KAAA;AACfT,IAAAA,KAAO,EAAA,MAAA;AACP6B,IAAAA,iBAAmB,EAAA,EAAA;GACrB;AACAC,EAAAA,MAAQ,EAAA;AACNC,IAAAA,IAAM,EAAA,CAAA;AACNC,IAAAA,gBAAkB,EAAA,EAAA;AACpB,GAAA;AACF,CAAC;;;;"}
@@ -1,4 +1,4 @@
1
1
  import React from "react";
2
2
  import { RedsPopover } from "./interface/index";
3
- declare const _default: ({ mode, opacity, content, children, isControl, placement, closeOnClickAgain, trigger, zIndex, visible, onVisibleChange, onClickMask: _onClickMask, popContainerStyle, arrowStyles: propsArrowStyles, offset, duration, hostName, maxWidth, arrowOffset, }: RedsPopover) => React.JSX.Element;
3
+ declare const _default: ({ mode, opacity, content, children, isControl, placement, closeOnClickAgain, trigger, zIndex, visible, onVisibleChange, onClickMask: _onClickMask, popContainerStyle, arrowStyles: propsArrowStyles, offset, duration, animation_duration, hostName, maxWidth, arrowOffset, }: RedsPopover) => React.JSX.Element;
4
4
  export default _default;
@@ -12,6 +12,7 @@ export interface RedsPopover {
12
12
  mode?: "light" | "dark" | "alwaysLight" | "alwaysDark";
13
13
  trigger?: "click" | "touch";
14
14
  duration?: number;
15
+ animation_duration?: number;
15
16
  zIndex?: number;
16
17
  popContainerStyle?: ViewStyle;
17
18
  closeOnClickAgain?: boolean;
@@ -1,4 +1,4 @@
1
1
  import React from "react";
2
2
  import { RedsPopover } from "./interface/index";
3
- declare const _default: ({ mode, opacity, content, children, isControl, placement, closeOnClickAgain, trigger, zIndex, visible, onVisibleChange, onClickMask: _onClickMask, popContainerStyle, arrowStyles: propsArrowStyles, offset, duration, hostName, maxWidth, arrowOffset, }: RedsPopover) => React.JSX.Element;
3
+ declare const _default: ({ mode, opacity, content, children, isControl, placement, closeOnClickAgain, trigger, zIndex, visible, onVisibleChange, onClickMask: _onClickMask, popContainerStyle, arrowStyles: propsArrowStyles, offset, duration, animation_duration, hostName, maxWidth, arrowOffset, }: RedsPopover) => React.JSX.Element;
4
4
  export default _default;
@@ -12,6 +12,7 @@ export interface RedsPopover {
12
12
  mode?: "light" | "dark" | "alwaysLight" | "alwaysDark";
13
13
  trigger?: "click" | "touch";
14
14
  duration?: number;
15
+ animation_duration?: number;
15
16
  zIndex?: number;
16
17
  popContainerStyle?: ViewStyle;
17
18
  closeOnClickAgain?: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xhsreds/reds-rn-next",
3
- "version": "0.9.0",
3
+ "version": "0.9.1-beta202510271514",
4
4
  "author": "贾斌(呀哈) <jiabin@xiaohongshu.com>",
5
5
  "license": "ISC",
6
6
  "dependencies": {
@@ -26,7 +26,7 @@
26
26
  "react-native-fs": "2.20.0",
27
27
  "react-native-svg": "13.14.0",
28
28
  "@xhs/react-native-harmony": "*",
29
- "@xhsreds/reds-token-next": "0.9.0"
29
+ "@xhsreds/reds-token-next": "0.9.1-beta202510271514"
30
30
  },
31
31
  "peerDependenciesMeta": {
32
32
  "ozone-schema-web": {
@@ -238,8 +238,8 @@ export const Carousel: React.FC<RedsCarousel> = (props) => {
238
238
 
239
239
  requestAnimationFrame(() => {
240
240
  let scrollOffset = index * offsetPerItem;
241
-
242
- if (props.playingMode !== "normal") {
241
+ // 修复:只有在无限循环模式下才需要减去containerPadding
242
+ if (props.playingMode !== "normal" && props.infinite) {
243
243
  scrollOffset -= containerPadding;
244
244
  }
245
245
 
@@ -287,10 +287,18 @@ export const Carousel: React.FC<RedsCarousel> = (props) => {
287
287
  props.direction === "horizontal" ? event.nativeEvent.contentOffset.x : event.nativeEvent.contentOffset.y;
288
288
 
289
289
  let index: number;
290
+ // 修复:对于非无限循环的compact模式,需要调整偏移量计算
290
291
  if (props.playingMode === "normal") {
291
292
  index = Math.round(offset / offsetPerItem);
292
293
  } else {
293
- index = Math.round((offset + containerPadding) / offsetPerItem);
294
+ // 对于compact和card模式
295
+ if (!props.infinite) {
296
+ // 非无限循环模式:不需要加containerPadding,因为滚动时已经考虑了padding
297
+ index = Math.round(offset / offsetPerItem);
298
+ } else {
299
+ // 无限循环模式:需要加containerPadding
300
+ index = Math.round((offset + containerPadding) / offsetPerItem);
301
+ }
294
302
  }
295
303
 
296
304
  index = Math.max(0, Math.min(index, extendedData.length - 1));
@@ -312,6 +320,10 @@ export const Carousel: React.FC<RedsCarousel> = (props) => {
312
320
  const clampedIndex = Math.max(0, Math.min(index, length - 1));
313
321
  setCurrentIndex(clampedIndex);
314
322
  setRealIndex(clampedIndex);
323
+ // 修复:确保滚动到正确位置
324
+ if (props.playingMode !== "normal") {
325
+ scrollToIndex(clampedIndex, true);
326
+ }
315
327
  }
316
328
 
317
329
  setIsScrolling(false);
@@ -1,6 +1,6 @@
1
1
  import React, { useState } from "react";
2
2
  import { View, Text, StyleSheet, ScrollView, Image as RNImage } from "react-native";
3
- import { Carousel } from "@xhs/reds-rn-next";
3
+ import { Carousel, CarouselType } from "@xhs/reds-rn-next";
4
4
  const styles = StyleSheet.create({
5
5
  container: {
6
6
  paddingBottom: 100,
@@ -54,6 +54,18 @@ export default function App() {
54
54
  handlable={false}
55
55
  />
56
56
  <Carousel
57
+ data={images}
58
+ autoPlay={false}
59
+ currentIndex={3}
60
+ onChange={handleChange}
61
+ onClick={handleClick}
62
+ displayNumbers={true}
63
+ // duration={3000}
64
+ playingMode={CarouselType.PLAYINGMODE.COMPACT}
65
+ handlable={true}
66
+ infinite={false}
67
+ />
68
+ {/* <Carousel
57
69
  autoPlay={true}
58
70
  currentIndex={3}
59
71
  onChange={handleChange}
@@ -82,7 +94,7 @@ export default function App() {
82
94
  {images.map((item, idx) => (
83
95
  <RNImage style={{ width: 300, height: 200 }} source={{ uri: item }} />
84
96
  ))}
85
- </Carousel>
97
+ </Carousel> */}
86
98
  {/* <Desc>自动播放(默认轮播间隔1000ms)</Desc>
87
99
  <Carousel data={images} duration={3000} />
88
100
 
@@ -24,6 +24,7 @@ export default ({
24
24
  arrowStyles: propsArrowStyles,
25
25
  offset,
26
26
  duration,
27
+ animation_duration,
27
28
  hostName,
28
29
  maxWidth,
29
30
  arrowOffset,
@@ -121,18 +122,18 @@ export default ({
121
122
  if (layout.x !== defaultValue) {
122
123
  Animated.timing(progress, {
123
124
  toValue: 1,
124
- duration: duration ?? 400,
125
+ duration: animation_duration ?? 400,
125
126
  useNativeDriver: false,
126
127
  }).start();
127
128
  }
128
129
  } else {
129
130
  Animated.timing(progress, {
130
131
  toValue: 0,
131
- duration: duration ?? 400,
132
+ duration: animation_duration ?? 400,
132
133
  useNativeDriver: false,
133
134
  }).start();
134
135
  }
135
- }, [_visible, layout]);
136
+ }, [_visible, layout, animation_duration]);
136
137
 
137
138
  const onMaskChange = (event: GestureResponderEvent, value: boolean) => {
138
139
  if (isControl) return;
@@ -8,27 +8,28 @@ import BaseDemo from "!!raw-loader!../demo/index.tsx";
8
8
 
9
9
  ### Props
10
10
 
11
- | 属性 | 描述 | 类型 | 默认值 |
12
- | ----------------- | --------------------------------- | --------------------------------------------------------------------------------------------------- | --------------- |
13
- | visible | 是否显示气泡 | boolean | undefined |
14
- | placement | 气泡方向 | "top-start" &#124; "top" &#124; "top-end" &#124; "bottom-start" &#124; "bottom" &#124; "bottom-end" | top |
15
- | content | 弹出内容 | ReactNode &#124; (() => ReactNode) | |
16
- | opacity | 遮罩透明度 | number | 0 |
17
- | mode | 主题色 | "light" &#124; "dark" &#124; "alwaysLight" &#124; "alwaysDark" | light |
18
- | trigger | 触发方式 | "click" &#124; "touch" | click |
19
- | duration | 固定时间后popover消失 | number | |
20
- | zIndex | 层级 | number | 1000 |
21
- | popContainerStyle | 气泡框的样式 | ViewStyle | `{}` |
22
- | closeOnClickAgain | 再次点击关闭 | boolean | true |
23
- | children | popover 作用的目标节点 | ReactNode | |
24
- | floatingStyles | floating style | ViewStyle | `{}` |
25
- | arrowStyles | arrow style | ImageStyle | `{}` |
26
- | isControl | 是否受控 | boolean | false |
27
- | offset | 气泡偏移位置 用于特殊场景适配 | Offset | `{"x":0,"y":0}` |
28
- | arrowOffset | 气泡箭头偏移位置 用于特殊场景适配 | Offset | `{"x":0,"y":0}` |
29
- | hostName | hostName | string | root |
30
- | maxWidth | popover最大宽度 | number | 280 |
31
- | layoutChange | 布局是否变化 | any | `{}` |
11
+ | 属性 | 描述 | 类型 | 默认值 |
12
+ | ------------------ | --------------------------------- | --------------------------------------------------------------------------------------------------- | --------------- |
13
+ | visible | 是否显示气泡 | boolean | undefined |
14
+ | placement | 气泡方向 | "top-start" &#124; "top" &#124; "top-end" &#124; "bottom-start" &#124; "bottom" &#124; "bottom-end" | top |
15
+ | content | 弹出内容 | ReactNode &#124; (() => ReactNode) | |
16
+ | opacity | 遮罩透明度 | number | 0 |
17
+ | mode | 主题色 | "light" &#124; "dark" &#124; "alwaysLight" &#124; "alwaysDark" | light |
18
+ | trigger | 触发方式 | "click" &#124; "touch" | click |
19
+ | duration | 固定时间后popover消失 | number | |
20
+ | animation_duration | animation_duration 动画时间 | number | |
21
+ | zIndex | 层级 | number | 1000 |
22
+ | popContainerStyle | 气泡框的样式 | ViewStyle | `{}` |
23
+ | closeOnClickAgain | 再次点击关闭 | boolean | true |
24
+ | children | popover 作用的目标节点 | ReactNode | |
25
+ | floatingStyles | floating style | ViewStyle | `{}` |
26
+ | arrowStyles | arrow style | ImageStyle | `{}` |
27
+ | isControl | 是否受控 | boolean | false |
28
+ | offset | 气泡偏移位置 用于特殊场景适配 | Offset | `{"x":0,"y":0}` |
29
+ | arrowOffset | 气泡箭头偏移位置 用于特殊场景适配 | Offset | `{"x":0,"y":0}` |
30
+ | hostName | hostName | string | root |
31
+ | maxWidth | popover最大宽度 | number | 280 |
32
+ | layoutChange | 布局是否变化 | any | `{}` |
32
33
 
33
34
  ### Events
34
35
 
@@ -12,6 +12,7 @@ export interface RedsPopover {
12
12
  mode?: "light" | "dark" | "alwaysLight" | "alwaysDark";
13
13
  trigger?: "click" | "touch";
14
14
  duration?: number;
15
+ animation_duration?: number;
15
16
  zIndex?: number;
16
17
  popContainerStyle?: ViewStyle;
17
18
  closeOnClickAgain?: boolean;
@@ -49,11 +49,11 @@ const styles = StyleSheet.create({
49
49
  borderTopRightRadius: 12,
50
50
  },
51
51
  cancel: {
52
- fontSize: typography.B1LooseFontSize,
52
+ fontSize: typography.B2LooseSwitchFontSize,
53
53
  fontWeight: typography.B1LooseFontWeight,
54
54
  },
55
55
  confirm: {
56
- fontSize: typography.B1LooseFontSize,
56
+ fontSize: typography.B2LooseSwitchFontSize,
57
57
  fontWeight: typography.T3FontWeight,
58
58
  },
59
59
  label: {
@@ -1,32 +1,32 @@
1
1
  interface Resources {
2
2
  componentKey: {
3
- sureKey: "Confirm";
4
- satisfyKey: "Satisfy";
5
- confirmKey: "Confirm";
6
- uploadingKey: "Uploading";
7
- resetKey: "Reset";
8
- NoDataKey: "No data available at the moment";
9
- liveStreamingKey: "live";
10
- generallyKey: "Generally";
11
- uploadFailedKey: "Upload failed";
12
- submitKey: "Submit";
13
- requestSuccessfulKey: "Request successful";
14
- cancelKey: "Cancel";
15
- PullDownToRefreshKey: "Pull down to refresh";
16
- selectAllKey: "SelectAll";
17
- requestDataKey: "Request data";
18
- closeKey: "Close";
19
- veryBadKey: "Very bad";
20
- searchKey: "Search";
21
- expandKey: "Expand";
22
- IDCardPhotoKey: "ID card photo";
23
- finishKey: "Finish";
24
- surpriseKey: "Surprise";
25
- releaseRefreshKey: "Release refresh";
26
- nationalEmblemSideOfIDCardKey: "National emblem side of ID card";
27
- buttonKey: "Button";
28
- jumpKey: "Jump";
29
- disappointmentKey: "Disappointment";
3
+ sureKey: "確定";
4
+ satisfyKey: "滿意";
5
+ confirmKey: "確認";
6
+ uploadingKey: "上傳中";
7
+ resetKey: "重置";
8
+ NoDataKey: "暫無數據";
9
+ liveStreamingKey: "直播";
10
+ generallyKey: "一般";
11
+ uploadFailedKey: "上傳失敗";
12
+ submitKey: "提交";
13
+ requestSuccessfulKey: "請求成功";
14
+ cancelKey: "取消";
15
+ PullDownToRefreshKey: "下拉重繪";
16
+ selectAllKey: "全選";
17
+ requestDataKey: "請求數據中";
18
+ closeKey: "收起";
19
+ veryBadKey: "極差";
20
+ searchKey: "蒐索";
21
+ expandKey: "展開";
22
+ IDCardPhotoKey: "身份證人像面";
23
+ finishKey: "完成";
24
+ surpriseKey: "驚喜";
25
+ releaseRefreshKey: "鬆開重繪";
26
+ nationalEmblemSideOfIDCardKey: "身份证国徽面";
27
+ buttonKey: "按鈕";
28
+ jumpKey: "跳轉";
29
+ disappointmentKey: "失望";
30
30
  };
31
31
  }
32
32
  export default Resources;
@@ -1,4 +1,35 @@
1
1
  {
2
+ "zh_tw": {
3
+ "componentKey": {
4
+ "sureKey": "確定",
5
+ "satisfyKey": "滿意",
6
+ "confirmKey": "確認",
7
+ "uploadingKey": "上傳中",
8
+ "resetKey": "重置",
9
+ "NoDataKey": "暫無數據",
10
+ "liveStreamingKey": "直播",
11
+ "generallyKey": "一般",
12
+ "uploadFailedKey": "上傳失敗",
13
+ "submitKey": "提交",
14
+ "requestSuccessfulKey": "請求成功",
15
+ "cancelKey": "取消",
16
+ "PullDownToRefreshKey": "下拉重繪",
17
+ "selectAllKey": "全選",
18
+ "requestDataKey": "請求數據中",
19
+ "closeKey": "收起",
20
+ "veryBadKey": "極差",
21
+ "searchKey": "蒐索",
22
+ "expandKey": "展開",
23
+ "IDCardPhotoKey": "身份證人像面",
24
+ "finishKey": "完成",
25
+ "surpriseKey": "驚喜",
26
+ "releaseRefreshKey": "鬆開重繪",
27
+ "nationalEmblemSideOfIDCardKey": "身份证国徽面",
28
+ "buttonKey": "按鈕",
29
+ "jumpKey": "跳轉",
30
+ "disappointmentKey": "失望"
31
+ }
32
+ },
2
33
  "en_us": {
3
34
  "componentKey": {
4
35
  "sureKey": "Confirm",
@@ -60,36 +91,5 @@
60
91
  "jumpKey": "跳转",
61
92
  "disappointmentKey": "失望"
62
93
  }
63
- },
64
- "zh_tw": {
65
- "componentKey": {
66
- "sureKey": "確定",
67
- "satisfyKey": "滿意",
68
- "confirmKey": "確認",
69
- "uploadingKey": "上傳中",
70
- "resetKey": "重置",
71
- "NoDataKey": "暫無數據",
72
- "liveStreamingKey": "直播",
73
- "generallyKey": "一般",
74
- "uploadFailedKey": "上傳失敗",
75
- "submitKey": "提交",
76
- "requestSuccessfulKey": "請求成功",
77
- "cancelKey": "取消",
78
- "PullDownToRefreshKey": "下拉重繪",
79
- "selectAllKey": "全選",
80
- "requestDataKey": "請求數據中",
81
- "closeKey": "收起",
82
- "veryBadKey": "極差",
83
- "searchKey": "蒐索",
84
- "expandKey": "展開",
85
- "IDCardPhotoKey": "身份證人像面",
86
- "finishKey": "完成",
87
- "surpriseKey": "驚喜",
88
- "releaseRefreshKey": "鬆開重繪",
89
- "nationalEmblemSideOfIDCardKey": "身份证国徽面",
90
- "buttonKey": "按鈕",
91
- "jumpKey": "跳轉",
92
- "disappointmentKey": "失望"
93
- }
94
94
  }
95
95
  }