@seakoi/native-ui 1.1.2 → 1.2.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 (224) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/dist/commonjs/components/base/carousel/carousel-indicator.js +56 -0
  3. package/dist/commonjs/components/base/carousel/carousel-slides.js +140 -0
  4. package/dist/commonjs/components/base/carousel/carousel.js +114 -122
  5. package/dist/commonjs/components/base/carousel/hooks/index.js +0 -14
  6. package/dist/commonjs/components/base/carousel/hooks/use-carousel-index.js +16 -13
  7. package/dist/commonjs/components/base/carousel/hooks/use-carousel-lifecycle.js +6 -2
  8. package/dist/commonjs/components/base/carousel/hooks/use-carousel-pan-responder.js +40 -12
  9. package/dist/commonjs/components/base/carousel/hooks/use-carousel-position.js +6 -2
  10. package/dist/commonjs/components/base/carousel/index.js +1 -15
  11. package/dist/commonjs/components/base/carousel/style/index.js +12 -0
  12. package/dist/commonjs/components/base/date-picker/date-picker.js +56 -44
  13. package/dist/commonjs/components/base/date-picker/date-range-picker.js +142 -50
  14. package/dist/commonjs/components/base/date-picker/style/index.js +15 -0
  15. package/dist/commonjs/components/base/date-picker-view/date-picker-view.js +19 -53
  16. package/dist/commonjs/components/base/date-picker-view/index.js +0 -22
  17. package/dist/commonjs/components/base/index.js +30 -8
  18. package/dist/commonjs/components/base/picker/index.js +26 -4
  19. package/dist/commonjs/components/base/picker/picker-content.js +60 -0
  20. package/dist/commonjs/components/base/picker/picker-context.js +9 -0
  21. package/dist/commonjs/components/base/picker/picker-field.js +37 -0
  22. package/dist/commonjs/components/base/picker/picker.js +22 -96
  23. package/dist/commonjs/components/base/picker/style/index.js +1 -3
  24. package/dist/commonjs/components/base/picker-backup/base-picker-container.js +50 -0
  25. package/dist/commonjs/components/base/picker-backup/index.js +27 -0
  26. package/dist/commonjs/components/base/picker-backup/picker-backup.js +75 -0
  27. package/dist/commonjs/components/base/picker-backup/picker-copy.js +106 -0
  28. package/dist/commonjs/components/base/{picker → picker-backup}/picker-trigger.js +5 -5
  29. package/dist/commonjs/components/base/picker-backup/style/index.js +19 -0
  30. package/dist/commonjs/components/base/picker-backup/utils.js +53 -0
  31. package/dist/commonjs/components/base/picker-view/picker-view-column.js +15 -0
  32. package/dist/commonjs/components/base/picker-view/picker-view.js +4 -4
  33. package/dist/commonjs/components/base/tag/index.js +20 -0
  34. package/dist/commonjs/components/base/tag/style/index.js +89 -0
  35. package/dist/commonjs/components/base/tag/tag-context.js +12 -0
  36. package/dist/commonjs/components/base/tag/tag-group.js +35 -0
  37. package/dist/commonjs/components/base/tag/tag.js +47 -0
  38. package/dist/commonjs/components/base/tag/types.js +5 -0
  39. package/dist/module/components/base/carousel/carousel-indicator.js +51 -0
  40. package/dist/module/components/base/carousel/carousel-slides.js +135 -0
  41. package/dist/module/components/base/carousel/carousel.js +116 -124
  42. package/dist/module/components/base/carousel/hooks/index.js +0 -2
  43. package/dist/module/components/base/carousel/hooks/use-carousel-index.js +15 -11
  44. package/dist/module/components/base/carousel/hooks/use-carousel-lifecycle.js +6 -2
  45. package/dist/module/components/base/carousel/hooks/use-carousel-pan-responder.js +40 -11
  46. package/dist/module/components/base/carousel/hooks/use-carousel-position.js +5 -1
  47. package/dist/module/components/base/carousel/index.js +1 -5
  48. package/dist/module/components/base/carousel/style/index.js +12 -0
  49. package/dist/module/components/base/date-picker/date-picker.js +60 -48
  50. package/dist/module/components/base/date-picker/date-range-picker.js +146 -54
  51. package/dist/module/components/base/date-picker/style/index.js +11 -0
  52. package/dist/module/components/base/date-picker-view/date-picker-view.js +23 -57
  53. package/dist/module/components/base/date-picker-view/index.js +1 -3
  54. package/dist/module/components/base/index.js +2 -0
  55. package/dist/module/components/base/picker/index.js +9 -1
  56. package/dist/module/components/base/picker/picker-content.js +54 -0
  57. package/dist/module/components/base/picker/picker-context.js +4 -0
  58. package/dist/module/components/base/picker/picker-field.js +32 -0
  59. package/dist/module/components/base/picker/picker.js +25 -99
  60. package/dist/module/components/base/picker/style/index.js +1 -3
  61. package/dist/module/components/base/picker-backup/base-picker-container.js +44 -0
  62. package/dist/module/components/base/picker-backup/index.js +4 -0
  63. package/dist/module/components/base/picker-backup/picker-backup.js +69 -0
  64. package/dist/module/components/base/picker-backup/picker-copy.js +101 -0
  65. package/dist/module/components/base/{picker → picker-backup}/picker-trigger.js +2 -2
  66. package/dist/module/components/base/picker-backup/style/index.js +15 -0
  67. package/dist/module/components/base/picker-backup/utils.js +48 -0
  68. package/dist/module/components/base/picker-view/picker-view-column.js +15 -0
  69. package/dist/module/components/base/picker-view/picker-view.js +4 -4
  70. package/dist/module/components/base/tag/index.js +5 -0
  71. package/dist/module/components/base/tag/style/index.js +85 -0
  72. package/dist/module/components/base/tag/tag-context.js +8 -0
  73. package/dist/module/components/base/tag/tag-group.js +29 -0
  74. package/dist/module/components/base/tag/tag.js +41 -0
  75. package/dist/module/components/base/tag/types.js +3 -0
  76. package/dist/typescript/components/base/carousel/carousel-indicator.d.ts +42 -0
  77. package/dist/typescript/components/base/carousel/carousel-indicator.d.ts.map +1 -0
  78. package/dist/typescript/components/base/carousel/carousel-slides.d.ts +49 -0
  79. package/dist/typescript/components/base/carousel/carousel-slides.d.ts.map +1 -0
  80. package/dist/typescript/components/base/carousel/carousel.d.ts +16 -11
  81. package/dist/typescript/components/base/carousel/carousel.d.ts.map +1 -1
  82. package/dist/typescript/components/base/carousel/hooks/index.d.ts +0 -2
  83. package/dist/typescript/components/base/carousel/hooks/index.d.ts.map +1 -1
  84. package/dist/typescript/components/base/carousel/hooks/use-carousel-index.d.ts.map +1 -1
  85. package/dist/typescript/components/base/carousel/hooks/use-carousel-lifecycle.d.ts.map +1 -1
  86. package/dist/typescript/components/base/carousel/hooks/use-carousel-pan-responder.d.ts.map +1 -1
  87. package/dist/typescript/components/base/carousel/hooks/use-carousel-position.d.ts.map +1 -1
  88. package/dist/typescript/components/base/carousel/index.d.ts +1 -4
  89. package/dist/typescript/components/base/carousel/index.d.ts.map +1 -1
  90. package/dist/typescript/components/base/carousel/style/index.d.ts +12 -0
  91. package/dist/typescript/components/base/carousel/style/index.d.ts.map +1 -1
  92. package/dist/typescript/components/base/carousel/types.d.ts +8 -17
  93. package/dist/typescript/components/base/carousel/types.d.ts.map +1 -1
  94. package/dist/typescript/components/base/date-picker/date-picker.d.ts +4 -2
  95. package/dist/typescript/components/base/date-picker/date-picker.d.ts.map +1 -1
  96. package/dist/typescript/components/base/date-picker/date-range-picker.d.ts +12 -3
  97. package/dist/typescript/components/base/date-picker/date-range-picker.d.ts.map +1 -1
  98. package/dist/typescript/components/base/date-picker/style/index.d.ts +9 -0
  99. package/dist/typescript/components/base/date-picker/style/index.d.ts.map +1 -0
  100. package/dist/typescript/components/base/date-picker-view/date-picker-view.d.ts +1 -6
  101. package/dist/typescript/components/base/date-picker-view/date-picker-view.d.ts.map +1 -1
  102. package/dist/typescript/components/base/date-picker-view/index.d.ts +0 -2
  103. package/dist/typescript/components/base/date-picker-view/index.d.ts.map +1 -1
  104. package/dist/typescript/components/base/date-picker-view/types.d.ts +1 -1
  105. package/dist/typescript/components/base/index.d.ts +2 -0
  106. package/dist/typescript/components/base/index.d.ts.map +1 -1
  107. package/dist/typescript/components/base/picker/index.d.ts +7 -1
  108. package/dist/typescript/components/base/picker/index.d.ts.map +1 -1
  109. package/dist/typescript/components/base/picker/picker-content.d.ts +15 -0
  110. package/dist/typescript/components/base/picker/picker-content.d.ts.map +1 -0
  111. package/dist/typescript/components/base/picker/picker-context.d.ts +18 -0
  112. package/dist/typescript/components/base/picker/picker-context.d.ts.map +1 -0
  113. package/dist/typescript/components/base/picker/picker-field.d.ts +10 -0
  114. package/dist/typescript/components/base/picker/picker-field.d.ts.map +1 -0
  115. package/dist/typescript/components/base/picker/picker.d.ts +13 -11
  116. package/dist/typescript/components/base/picker/picker.d.ts.map +1 -1
  117. package/dist/typescript/components/base/picker/style/index.d.ts +0 -2
  118. package/dist/typescript/components/base/picker/style/index.d.ts.map +1 -1
  119. package/dist/typescript/components/base/picker-backup/base-picker-container.d.ts +15 -0
  120. package/dist/typescript/components/base/picker-backup/base-picker-container.d.ts.map +1 -0
  121. package/dist/typescript/components/base/picker-backup/index.d.ts +3 -0
  122. package/dist/typescript/components/base/picker-backup/index.d.ts.map +1 -0
  123. package/dist/typescript/components/base/picker-backup/picker-backup.d.ts +26 -0
  124. package/dist/typescript/components/base/picker-backup/picker-backup.d.ts.map +1 -0
  125. package/dist/typescript/components/base/picker-backup/picker-copy.d.ts +13 -0
  126. package/dist/typescript/components/base/picker-backup/picker-copy.d.ts.map +1 -0
  127. package/dist/typescript/components/base/picker-backup/picker-trigger.d.ts.map +1 -0
  128. package/dist/typescript/components/base/picker-backup/style/index.d.ts +13 -0
  129. package/dist/typescript/components/base/picker-backup/style/index.d.ts.map +1 -0
  130. package/dist/typescript/components/base/picker-backup/utils.d.ts +8 -0
  131. package/dist/typescript/components/base/picker-backup/utils.d.ts.map +1 -0
  132. package/dist/typescript/components/base/picker-view/picker-view-column.d.ts.map +1 -1
  133. package/dist/typescript/components/base/picker-view/utils/picker.d.ts +3 -3
  134. package/dist/typescript/components/base/picker-view/utils/picker.d.ts.map +1 -1
  135. package/dist/typescript/components/base/tag/index.d.ts +5 -0
  136. package/dist/typescript/components/base/tag/index.d.ts.map +1 -0
  137. package/dist/typescript/components/base/tag/style/index.d.ts +61 -0
  138. package/dist/typescript/components/base/tag/style/index.d.ts.map +1 -0
  139. package/dist/typescript/components/base/tag/tag-context.d.ts +3 -0
  140. package/dist/typescript/components/base/tag/tag-context.d.ts.map +1 -0
  141. package/dist/typescript/components/base/tag/tag-group.d.ts +4 -0
  142. package/dist/typescript/components/base/tag/tag-group.d.ts.map +1 -0
  143. package/dist/typescript/components/base/tag/tag.d.ts +4 -0
  144. package/dist/typescript/components/base/tag/tag.d.ts.map +1 -0
  145. package/dist/typescript/components/base/tag/types.d.ts +48 -0
  146. package/dist/typescript/components/base/tag/types.d.ts.map +1 -0
  147. package/package.json +12 -4
  148. package/src/components/base/carousel/carousel-indicator.tsx +80 -0
  149. package/src/components/base/carousel/carousel-slides.tsx +177 -0
  150. package/src/components/base/carousel/carousel.tsx +108 -118
  151. package/src/components/base/carousel/hooks/index.ts +0 -2
  152. package/src/components/base/carousel/hooks/use-carousel-index.ts +13 -9
  153. package/src/components/base/carousel/hooks/use-carousel-lifecycle.ts +4 -3
  154. package/src/components/base/carousel/hooks/use-carousel-pan-responder.ts +40 -16
  155. package/src/components/base/carousel/hooks/use-carousel-position.ts +4 -1
  156. package/src/components/base/carousel/index.ts +1 -3
  157. package/src/components/base/carousel/style/index.ts +12 -0
  158. package/src/components/base/carousel/types.ts +8 -21
  159. package/src/components/base/date-picker/date-picker.tsx +64 -61
  160. package/src/components/base/date-picker/date-range-picker.tsx +178 -70
  161. package/src/components/base/date-picker/style/index.ts +10 -0
  162. package/src/components/base/date-picker-view/date-picker-view.tsx +21 -68
  163. package/src/components/base/date-picker-view/index.ts +0 -2
  164. package/src/components/base/date-picker-view/types.ts +1 -1
  165. package/src/components/base/index.ts +2 -0
  166. package/src/components/base/picker/index.ts +11 -1
  167. package/src/components/base/picker/picker-content.tsx +75 -0
  168. package/src/components/base/picker/picker-context.ts +19 -0
  169. package/src/components/base/picker/picker-field.tsx +50 -0
  170. package/src/components/base/picker/picker.tsx +38 -114
  171. package/src/components/base/picker/style/index.ts +0 -2
  172. package/src/components/base/picker-backup/base-picker-container.tsx +55 -0
  173. package/src/components/base/picker-backup/index.ts +2 -0
  174. package/src/components/base/picker-backup/picker-backup.tsx +110 -0
  175. package/src/components/base/picker-backup/picker-copy.tsx +125 -0
  176. package/src/components/base/{picker → picker-backup}/picker-trigger.tsx +2 -2
  177. package/src/components/base/picker-backup/style/index.ts +14 -0
  178. package/src/components/base/picker-backup/utils.ts +62 -0
  179. package/src/components/base/picker-view/picker-view-column.tsx +20 -0
  180. package/src/components/base/picker-view/picker-view.tsx +4 -4
  181. package/src/components/base/picker-view/utils/picker.ts +3 -5
  182. package/src/components/base/tag/index.ts +5 -0
  183. package/src/components/base/tag/style/index.tsx +84 -0
  184. package/src/components/base/tag/tag-context.ts +9 -0
  185. package/src/components/base/tag/tag-group.tsx +31 -0
  186. package/src/components/base/tag/tag.tsx +50 -0
  187. package/src/components/base/tag/types.ts +71 -0
  188. package/dist/commonjs/components/base/carousel/carousel-item.js +0 -45
  189. package/dist/commonjs/components/base/carousel/constants.js +0 -25
  190. package/dist/commonjs/components/base/carousel/hooks/use-carousel-indicator.js +0 -63
  191. package/dist/commonjs/components/base/carousel/hooks/use-carousel-slides.js +0 -95
  192. package/dist/commonjs/components/base/carousel/utils.js +0 -63
  193. package/dist/commonjs/components/base/date-picker-view/date-range-picker-view.js +0 -145
  194. package/dist/commonjs/components/base/date-picker-view/date-time-picker.js +0 -39
  195. package/dist/module/components/base/carousel/carousel-item.js +0 -40
  196. package/dist/module/components/base/carousel/constants.js +0 -21
  197. package/dist/module/components/base/carousel/hooks/use-carousel-indicator.js +0 -58
  198. package/dist/module/components/base/carousel/hooks/use-carousel-slides.js +0 -90
  199. package/dist/module/components/base/carousel/utils.js +0 -55
  200. package/dist/module/components/base/date-picker-view/date-range-picker-view.js +0 -138
  201. package/dist/module/components/base/date-picker-view/date-time-picker.js +0 -34
  202. package/dist/typescript/components/base/carousel/carousel-item.d.ts +0 -26
  203. package/dist/typescript/components/base/carousel/carousel-item.d.ts.map +0 -1
  204. package/dist/typescript/components/base/carousel/constants.d.ts +0 -17
  205. package/dist/typescript/components/base/carousel/constants.d.ts.map +0 -1
  206. package/dist/typescript/components/base/carousel/hooks/use-carousel-indicator.d.ts +0 -37
  207. package/dist/typescript/components/base/carousel/hooks/use-carousel-indicator.d.ts.map +0 -1
  208. package/dist/typescript/components/base/carousel/hooks/use-carousel-slides.d.ts +0 -51
  209. package/dist/typescript/components/base/carousel/hooks/use-carousel-slides.d.ts.map +0 -1
  210. package/dist/typescript/components/base/carousel/utils.d.ts +0 -25
  211. package/dist/typescript/components/base/carousel/utils.d.ts.map +0 -1
  212. package/dist/typescript/components/base/date-picker-view/date-range-picker-view.d.ts +0 -26
  213. package/dist/typescript/components/base/date-picker-view/date-range-picker-view.d.ts.map +0 -1
  214. package/dist/typescript/components/base/date-picker-view/date-time-picker.d.ts +0 -3
  215. package/dist/typescript/components/base/date-picker-view/date-time-picker.d.ts.map +0 -1
  216. package/dist/typescript/components/base/picker/picker-trigger.d.ts.map +0 -1
  217. package/src/components/base/carousel/carousel-item.tsx +0 -35
  218. package/src/components/base/carousel/constants.ts +0 -19
  219. package/src/components/base/carousel/hooks/use-carousel-indicator.tsx +0 -84
  220. package/src/components/base/carousel/hooks/use-carousel-slides.tsx +0 -131
  221. package/src/components/base/carousel/utils.ts +0 -55
  222. package/src/components/base/date-picker-view/date-range-picker-view.tsx +0 -191
  223. package/src/components/base/date-picker-view/date-time-picker.tsx +0 -34
  224. /package/dist/typescript/components/base/{picker → picker-backup}/picker-trigger.d.ts +0 -0
@@ -1,37 +0,0 @@
1
- import type { CarouselProps } from '../types';
2
- interface UseCarouselIndicatorParams {
3
- indicator: CarouselProps['indicator'];
4
- indicatorProps: CarouselProps['indicatorProps'];
5
- total: number;
6
- current: number;
7
- activeColor: string;
8
- inactiveColor: string;
9
- styles: {
10
- indicatorContainer: object;
11
- indicatorDot: object;
12
- indicatorDotActive: object;
13
- };
14
- }
15
- /**
16
- * 轮播图指示器渲染 Hook
17
- *
18
- * 负责渲染轮播图底部的指示器(小圆点),支持自定义指示器或使用默认样式。
19
- * 当轮播项总数小于等于 1 时,不显示指示器。
20
- *
21
- * @param params - Hook 参数配置
22
- * @param params.indicator - 指示器配置(false 表示不显示,函数表示自定义渲染)
23
- * @param params.indicatorProps - 指示器属性配置(颜色、样式)
24
- * @param params.total - 轮播项总数
25
- * @param params.current - 当前激活的索引
26
- * @param params.activeColor - 激活状态的指示器颜色
27
- * @param params.inactiveColor - 非激活状态的指示器颜色
28
- * @param params.styles - 指示器样式对象
29
- *
30
- * @returns Hook 返回值
31
- * @returns renderIndicator - 渲染指示器的方法,返回 ReactNode 或 null
32
- */
33
- export declare const useCarouselIndicator: (params: UseCarouselIndicatorParams) => {
34
- renderIndicator: (this: unknown) => string | number | bigint | boolean | Iterable<import("react").ReactNode> | Promise<string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<import("react").ReactNode> | null | undefined> | import("react").JSX.Element | null | undefined;
35
- };
36
- export {};
37
- //# sourceMappingURL=use-carousel-indicator.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"use-carousel-indicator.d.ts","sourceRoot":"","sources":["../../../../../../src/components/base/carousel/hooks/use-carousel-indicator.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAE9C,UAAU,0BAA0B;IAClC,SAAS,EAAE,aAAa,CAAC,WAAW,CAAC,CAAC;IACtC,cAAc,EAAE,aAAa,CAAC,gBAAgB,CAAC,CAAC;IAChD,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE;QACN,kBAAkB,EAAE,MAAM,CAAC;QAC3B,YAAY,EAAE,MAAM,CAAC;QACrB,kBAAkB,EAAE,MAAM,CAAC;KAC5B,CAAC;CACH;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,oBAAoB,GAAI,QAAQ,0BAA0B;;CA8CtE,CAAC"}
@@ -1,51 +0,0 @@
1
- import { type ReactElement } from 'react';
2
- import { type ViewStyle } from 'react-native';
3
- import type { CarouselItemProps } from '../types';
4
- interface UseCarouselSlidesParams {
5
- children: ReactElement<CarouselItemProps> | ReactElement<CarouselItemProps>[] | ((index: number) => ReactElement<CarouselItemProps>) | undefined;
6
- total: number;
7
- virtualRange: {
8
- start: number;
9
- end: number;
10
- isVirtual: boolean;
11
- } | null;
12
- loopEnabled: boolean;
13
- clonesBefore: number;
14
- slideWrapperStyle: ViewStyle;
15
- spacerStyles: {
16
- leading: ViewStyle;
17
- trailing: ViewStyle;
18
- leadingSize: number;
19
- trailingSize: number;
20
- } | null;
21
- slideStyles: {
22
- slide: ViewStyle;
23
- };
24
- }
25
- /**
26
- * 轮播图滑块渲染 Hook
27
- *
28
- * 负责渲染轮播图的滑块内容,支持静态子组件和 render prop 两种方式。
29
- * 实现虚拟渲染优化,仅渲染可见范围内的滑块,并处理循环播放时的克隆逻辑。
30
- * 为虚拟渲染添加前后占位空间,确保滚动位置正确。
31
- *
32
- * @param params - Hook 参数配置
33
- * @param params.children - 轮播项内容(静态子组件或 render prop 函数)
34
- * @param params.total - 轮播项总数
35
- * @param params.virtualRange - 虚拟渲染范围(start、end、isVirtual)
36
- * @param params.loopEnabled - 是否启用循环播放
37
- * @param params.clonesBefore - 循环播放时前置克隆节点数量
38
- * @param params.slideWrapperStyle - 滑块包装器样式
39
- * @param params.spacerStyles - 虚拟渲染占位空间样式
40
- * @param params.slideStyles - 滑块样式对象
41
- *
42
- * @returns Hook 返回值
43
- * @returns staticSlides - 静态滑块数组(仅在非 render prop 模式下有值)
44
- * @returns renderSlides - 渲染滑块的方法,返回 ReactNode 或 null
45
- */
46
- export declare const useCarouselSlides: (params: UseCarouselSlidesParams) => {
47
- staticSlides: ReactElement<unknown, string | import("react").JSXElementConstructor<any>>[];
48
- renderSlides: (this: unknown) => import("react").JSX.Element | null;
49
- };
50
- export {};
51
- //# sourceMappingURL=use-carousel-slides.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"use-carousel-slides.d.ts","sourceRoot":"","sources":["../../../../../../src/components/base/carousel/hooks/use-carousel-slides.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,YAAY,EAAW,MAAM,OAAO,CAAC;AACnD,OAAO,EAAQ,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAEpD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAGlD,UAAU,uBAAuB;IAC/B,QAAQ,EACJ,YAAY,CAAC,iBAAiB,CAAC,GAC/B,YAAY,CAAC,iBAAiB,CAAC,EAAE,GACjC,CAAC,CAAC,KAAK,EAAE,MAAM,KAAK,YAAY,CAAC,iBAAiB,CAAC,CAAC,GACpD,SAAS,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE;QACZ,KAAK,EAAE,MAAM,CAAC;QACd,GAAG,EAAE,MAAM,CAAC;QACZ,SAAS,EAAE,OAAO,CAAC;KACpB,GAAG,IAAI,CAAC;IACT,WAAW,EAAE,OAAO,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,iBAAiB,EAAE,SAAS,CAAC;IAC7B,YAAY,EAAE;QACZ,OAAO,EAAE,SAAS,CAAC;QACnB,QAAQ,EAAE,SAAS,CAAC;QACpB,WAAW,EAAE,MAAM,CAAC;QACpB,YAAY,EAAE,MAAM,CAAC;KACtB,GAAG,IAAI,CAAC;IACT,WAAW,EAAE;QACX,KAAK,EAAE,SAAS,CAAC;KAClB,CAAC;CACH;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,iBAAiB,GAAI,QAAQ,uBAAuB;;;CA2EhE,CAAC"}
@@ -1,25 +0,0 @@
1
- import { type ReactElement } from 'react';
2
- import type { CarouselItemProps, CarouselProps } from './types';
3
- export declare const isRenderPropChildren: (children: CarouselProps["children"]) => children is (index: number) => ReactElement<CarouselItemProps>;
4
- export declare const normalizeChildren: (children: CarouselProps["children"], total: number) => ReactElement[];
5
- export declare const getDefaultTotal: (children: CarouselProps["children"]) => number;
6
- /**
7
- * 计算轮播边界索引范围
8
- *
9
- * @param params - 参数配置
10
- * @param params.total - 轮播项总数
11
- * @param params.slideSize - 单个滑块所占百分比 (0-100)
12
- * @param params.trackOffset - 轨道偏移百分比 (0-100)
13
- * @param params.stuckAtBoundary - 是否在边界处卡住
14
- * @returns 边界索引范围 { min, max }
15
- */
16
- export declare const getBoundaryIndexRange: (params: {
17
- total: number;
18
- slideSize: number;
19
- trackOffset: number;
20
- stuckAtBoundary: boolean;
21
- }) => {
22
- min: number;
23
- max: number;
24
- };
25
- //# sourceMappingURL=utils.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../src/components/base/carousel/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,YAAY,EAAE,MAAM,OAAO,CAAC;AAEpD,OAAO,KAAK,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAEhE,eAAO,MAAM,oBAAoB,GAC/B,UAAU,aAAa,CAAC,UAAU,CAAC,KAClC,QAAQ,IAAI,CAAC,KAAK,EAAE,MAAM,KAAK,YAAY,CAAC,iBAAiB,CAE/D,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAC5B,UAAU,aAAa,CAAC,UAAU,CAAC,EACnC,OAAO,MAAM,KACZ,YAAY,EAMd,CAAC;AAEF,eAAO,MAAM,eAAe,GAAI,UAAU,aAAa,CAAC,UAAU,CAAC,WAIlE,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,qBAAqB,GAAI,QAAQ;IAC5C,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,EAAE,OAAO,CAAC;CAC1B;;;CAYA,CAAC"}
@@ -1,26 +0,0 @@
1
- import React from 'react';
2
- import { type ModalHeaderBaseProps } from '#components/base';
3
- import type { DateTimePickerProps } from './types';
4
- export interface DateRangePickerViewProps extends Omit<DateTimePickerProps, 'value' | 'defaultValue' | 'onChange'>, ModalHeaderBaseProps {
5
- /** 当前值(受控) */
6
- value?: [Date, Date];
7
- /** 默认值 (非受控) */
8
- defaultValue?: [Date, Date];
9
- /** 值变化时的回调 */
10
- onChange?: (value: [Date, Date]) => void;
11
- /** start 开始时间的占位文案 */
12
- startText?: string;
13
- /** end 结束时间的占位文案 */
14
- endText?: string;
15
- /** 确定按钮文案 */
16
- confirmText?: string;
17
- /** 重置按钮文案 */
18
- resetText?: string;
19
- /**
20
- * 自定义格式化函数。
21
- * 配置参考 https://day.js.org/docs/zh-CN/display/format
22
- */
23
- formatter: string | ((date: Date) => string);
24
- }
25
- export declare const DateRangePickerView: React.FC<DateRangePickerViewProps>;
26
- //# sourceMappingURL=date-range-picker-view.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"date-range-picker-view.d.ts","sourceRoot":"","sources":["../../../../../src/components/base/date-picker-view/date-range-picker-view.tsx"],"names":[],"mappings":"AACA,OAAO,KAAoD,MAAM,OAAO,CAAC;AAEzE,OAAO,EAKL,KAAK,oBAAoB,EAE1B,MAAM,kBAAkB,CAAC;AAG1B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAGnD,MAAM,WAAW,wBACf,SAAQ,IAAI,CAAC,mBAAmB,EAAE,OAAO,GAAG,cAAc,GAAG,UAAU,CAAC,EACtE,oBAAoB;IACtB,cAAc;IACd,KAAK,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IACrB,gBAAgB;IAChB,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IAC5B,cAAc;IACd,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC,KAAK,IAAI,CAAC;IACzC,sBAAsB;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,oBAAoB;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,aAAa;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa;IACb,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,SAAS,EAAE,MAAM,GAAG,CAAC,CAAC,IAAI,EAAE,IAAI,KAAK,MAAM,CAAC,CAAC;CAC9C;AAID,eAAO,MAAM,mBAAmB,EAAE,KAAK,CAAC,EAAE,CAAC,wBAAwB,CAoJlE,CAAC"}
@@ -1,3 +0,0 @@
1
- import type { DateTimePickerProps } from './types';
2
- export declare const DateTimePicker: React.FC<DateTimePickerProps>;
3
- //# sourceMappingURL=date-time-picker.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"date-time-picker.d.ts","sourceRoot":"","sources":["../../../../../src/components/base/date-picker-view/date-time-picker.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAEnD,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CAyBxD,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"picker-trigger.d.ts","sourceRoot":"","sources":["../../../../../src/components/base/picker/picker-trigger.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAuC,MAAM,OAAO,CAAC;AAC5D,OAAO,EAAE,KAAK,SAAS,EAAoB,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAShF,yBAAyB;AACzB,MAAM,WAAW,kBAAkB;IACjC,YAAY;IACZ,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC9B,WAAW;IACX,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW;IACX,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,qBAAqB;IACrB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,aAAa;IACb,QAAQ,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC;IAC9B,gBAAgB;IAChB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,MAAM,WAAW,4BAA4B,CAAC,CAAC,CAC7C,SAAQ,IAAI,CAAC,kBAAkB,EAAE,aAAa,GAAG,SAAS,CAAC;IAC3D,gBAAgB;IAChB,KAAK,CAAC,EAAE,CAAC,CAAC;IACV,cAAc;IACd,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,CAAC;IAC9B,eAAe;IACf,YAAY,CAAC,EAAE,CAAC,CAAC;CAClB;AAED,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAmDtD,CAAC"}
@@ -1,35 +0,0 @@
1
- import type { FC, PropsWithChildren } from 'react';
2
- import { View } from 'react-native';
3
-
4
- import type { CarouselItemProps } from './types';
5
-
6
- const FULL_SIZE_STYLE = { height: '100%', width: '100%' } as const;
7
-
8
- /**
9
- * 轮播项组件
10
- *
11
- * 用于包裹轮播图中的每一项内容,自动填充父容器的宽高。
12
- *
13
- * @example
14
- * ```tsx
15
- * <Carousel>
16
- * <Carousel.Item>
17
- * <Image source={image1} />
18
- * </Carousel.Item>
19
- * <Carousel.Item>
20
- * <Image source={image2} />
21
- * </Carousel.Item>
22
- * </Carousel>
23
- * ```
24
- *
25
- * @param props - 组件属性
26
- * @param props.children - 轮播项内容
27
- * @param props.style - 容器样式
28
- * @returns 轮播项组件
29
- */
30
- export const CarouselItem: FC<PropsWithChildren<CarouselItemProps>> = ({
31
- children,
32
- style,
33
- }) => {
34
- return <View style={[FULL_SIZE_STYLE, style]}>{children}</View>;
35
- };
@@ -1,19 +0,0 @@
1
- /**
2
- * 轮播图动画时长(毫秒)
3
- */
4
- export const CAROUSEL_ANIMATION_DURATION = 300;
5
-
6
- /**
7
- * 橡皮筋效果阻尼系数
8
- */
9
- export const RUBBERBAND_DAMPING = 0.35;
10
-
11
- /**
12
- * 手势识别最小移动距离(像素)
13
- */
14
- export const GESTURE_MIN_DISTANCE = 5;
15
-
16
- /**
17
- * 速度投影系数(用于计算惯性滑动距离)
18
- */
19
- export const VELOCITY_PROJECTION_FACTOR = 2000;
@@ -1,84 +0,0 @@
1
- import { useMemoizedFn } from 'ahooks';
2
- import { StyleSheet, View } from 'react-native';
3
-
4
- import type { CarouselProps } from '../types';
5
-
6
- interface UseCarouselIndicatorParams {
7
- indicator: CarouselProps['indicator'];
8
- indicatorProps: CarouselProps['indicatorProps'];
9
- total: number;
10
- current: number;
11
- activeColor: string;
12
- inactiveColor: string;
13
- styles: {
14
- indicatorContainer: object;
15
- indicatorDot: object;
16
- indicatorDotActive: object;
17
- };
18
- }
19
-
20
- /**
21
- * 轮播图指示器渲染 Hook
22
- *
23
- * 负责渲染轮播图底部的指示器(小圆点),支持自定义指示器或使用默认样式。
24
- * 当轮播项总数小于等于 1 时,不显示指示器。
25
- *
26
- * @param params - Hook 参数配置
27
- * @param params.indicator - 指示器配置(false 表示不显示,函数表示自定义渲染)
28
- * @param params.indicatorProps - 指示器属性配置(颜色、样式)
29
- * @param params.total - 轮播项总数
30
- * @param params.current - 当前激活的索引
31
- * @param params.activeColor - 激活状态的指示器颜色
32
- * @param params.inactiveColor - 非激活状态的指示器颜色
33
- * @param params.styles - 指示器样式对象
34
- *
35
- * @returns Hook 返回值
36
- * @returns renderIndicator - 渲染指示器的方法,返回 ReactNode 或 null
37
- */
38
- export const useCarouselIndicator = (params: UseCarouselIndicatorParams) => {
39
- const {
40
- indicator,
41
- indicatorProps,
42
- total,
43
- current,
44
- activeColor,
45
- inactiveColor,
46
- styles,
47
- } = params;
48
-
49
- const renderIndicator = useMemoizedFn(() => {
50
- if (indicator === false) return null;
51
- if (total <= 1) return null;
52
-
53
- if (typeof indicator === 'function') {
54
- return indicator(total, current);
55
- }
56
-
57
- const dotActiveColor = indicatorProps?.color ?? activeColor;
58
-
59
- return (
60
- <View
61
- style={StyleSheet.flatten([
62
- styles.indicatorContainer,
63
- indicatorProps?.style,
64
- ])}
65
- >
66
- {Array.from({ length: total }, (_, i) => {
67
- const isActive = i === current;
68
- return (
69
- <View
70
- key={i}
71
- style={StyleSheet.flatten([
72
- styles.indicatorDot,
73
- { backgroundColor: isActive ? dotActiveColor : inactiveColor },
74
- isActive && styles.indicatorDotActive,
75
- ])}
76
- />
77
- );
78
- })}
79
- </View>
80
- );
81
- });
82
-
83
- return { renderIndicator };
84
- };
@@ -1,131 +0,0 @@
1
- import { useMemoizedFn } from 'ahooks';
2
- import { clamp } from 'lodash-es';
3
- import { type ReactElement, useMemo } from 'react';
4
- import { View, type ViewStyle } from 'react-native';
5
-
6
- import type { CarouselItemProps } from '../types';
7
- import { isRenderPropChildren, normalizeChildren } from '../utils';
8
-
9
- interface UseCarouselSlidesParams {
10
- children:
11
- | ReactElement<CarouselItemProps>
12
- | ReactElement<CarouselItemProps>[]
13
- | ((index: number) => ReactElement<CarouselItemProps>)
14
- | undefined;
15
- total: number;
16
- virtualRange: {
17
- start: number;
18
- end: number;
19
- isVirtual: boolean;
20
- } | null;
21
- loopEnabled: boolean;
22
- clonesBefore: number;
23
- slideWrapperStyle: ViewStyle;
24
- spacerStyles: {
25
- leading: ViewStyle;
26
- trailing: ViewStyle;
27
- leadingSize: number;
28
- trailingSize: number;
29
- } | null;
30
- slideStyles: {
31
- slide: ViewStyle;
32
- };
33
- }
34
-
35
- /**
36
- * 轮播图滑块渲染 Hook
37
- *
38
- * 负责渲染轮播图的滑块内容,支持静态子组件和 render prop 两种方式。
39
- * 实现虚拟渲染优化,仅渲染可见范围内的滑块,并处理循环播放时的克隆逻辑。
40
- * 为虚拟渲染添加前后占位空间,确保滚动位置正确。
41
- *
42
- * @param params - Hook 参数配置
43
- * @param params.children - 轮播项内容(静态子组件或 render prop 函数)
44
- * @param params.total - 轮播项总数
45
- * @param params.virtualRange - 虚拟渲染范围(start、end、isVirtual)
46
- * @param params.loopEnabled - 是否启用循环播放
47
- * @param params.clonesBefore - 循环播放时前置克隆节点数量
48
- * @param params.slideWrapperStyle - 滑块包装器样式
49
- * @param params.spacerStyles - 虚拟渲染占位空间样式
50
- * @param params.slideStyles - 滑块样式对象
51
- *
52
- * @returns Hook 返回值
53
- * @returns staticSlides - 静态滑块数组(仅在非 render prop 模式下有值)
54
- * @returns renderSlides - 渲染滑块的方法,返回 ReactNode 或 null
55
- */
56
- export const useCarouselSlides = (params: UseCarouselSlidesParams) => {
57
- const {
58
- children,
59
- total,
60
- virtualRange,
61
- loopEnabled,
62
- clonesBefore,
63
- slideWrapperStyle,
64
- spacerStyles,
65
- slideStyles,
66
- } = params;
67
-
68
- const staticSlides = useMemo(() => {
69
- if (isRenderPropChildren(children)) return [];
70
- return normalizeChildren(children, total);
71
- }, [children, total]);
72
-
73
- const getIndexFromExtIndex = useMemoizedFn((extIndex: number) => {
74
- if (!loopEnabled) return clamp(extIndex, 0, total - 1);
75
- if (extIndex < clonesBefore) {
76
- return (((extIndex - clonesBefore) % total) + total) % total;
77
- }
78
- if (extIndex >= clonesBefore + total) {
79
- return (extIndex - clonesBefore - total) % total;
80
- }
81
- return extIndex - clonesBefore;
82
- });
83
-
84
- const renderSlides = useMemoizedFn(() => {
85
- if (!virtualRange) return null;
86
-
87
- const { start, end, isVirtual } = virtualRange;
88
-
89
- const getElementForExtIndex = (extIndex: number) => {
90
- const logicalIndex = loopEnabled
91
- ? getIndexFromExtIndex(extIndex)
92
- : clamp(extIndex, 0, total - 1);
93
-
94
- if (isRenderPropChildren(children)) return children(logicalIndex);
95
- return staticSlides[logicalIndex];
96
- };
97
-
98
- const slideElements: ReactElement[] = [];
99
- for (let extIndex = start; extIndex <= end; extIndex += 1) {
100
- const element = getElementForExtIndex(extIndex);
101
- if (!element) continue;
102
- slideElements.push(
103
- <View key={extIndex} style={[slideStyles.slide, slideWrapperStyle]}>
104
- {element}
105
- </View>,
106
- );
107
- }
108
-
109
- const leadSpacer =
110
- isVirtual && spacerStyles && spacerStyles.leadingSize > 0 ? (
111
- <View style={spacerStyles.leading} />
112
- ) : null;
113
- const trailSpacer =
114
- isVirtual && spacerStyles && spacerStyles.trailingSize > 0 ? (
115
- <View style={spacerStyles.trailing} />
116
- ) : null;
117
-
118
- return (
119
- <>
120
- {leadSpacer}
121
- {slideElements}
122
- {trailSpacer}
123
- </>
124
- );
125
- });
126
-
127
- return {
128
- staticSlides,
129
- renderSlides,
130
- };
131
- };
@@ -1,55 +0,0 @@
1
- import { Children, type ReactElement } from 'react';
2
-
3
- import type { CarouselItemProps, CarouselProps } from './types';
4
-
5
- export const isRenderPropChildren = (
6
- children: CarouselProps['children'],
7
- ): children is (index: number) => ReactElement<CarouselItemProps> => {
8
- return typeof children === 'function';
9
- };
10
-
11
- export const normalizeChildren = (
12
- children: CarouselProps['children'],
13
- total: number,
14
- ): ReactElement[] => {
15
- if (!children) return [];
16
- if (isRenderPropChildren(children)) {
17
- return Array.from({ length: total }, (_, i) => children(i));
18
- }
19
- return Children.toArray(children) as ReactElement[];
20
- };
21
-
22
- export const getDefaultTotal = (children: CarouselProps['children']) => {
23
- if (!children) return 0;
24
- if (isRenderPropChildren(children)) return 0;
25
- return Array.isArray(children) ? children.length : 1;
26
- };
27
-
28
- /**
29
- * 计算轮播边界索引范围
30
- *
31
- * @param params - 参数配置
32
- * @param params.total - 轮播项总数
33
- * @param params.slideSize - 单个滑块所占百分比 (0-100)
34
- * @param params.trackOffset - 轨道偏移百分比 (0-100)
35
- * @param params.stuckAtBoundary - 是否在边界处卡住
36
- * @returns 边界索引范围 { min, max }
37
- */
38
- export const getBoundaryIndexRange = (params: {
39
- total: number;
40
- slideSize: number;
41
- trackOffset: number;
42
- stuckAtBoundary: boolean;
43
- }) => {
44
- const { total, slideSize, trackOffset, stuckAtBoundary } = params;
45
-
46
- if (total <= 0) return { min: 0, max: 0 };
47
- if (!stuckAtBoundary) return { min: 0, max: total - 1 };
48
-
49
- const slideRatio = slideSize / 100;
50
- const offsetRatio = trackOffset / 100;
51
-
52
- const min = 0 + offsetRatio / (slideRatio || 1);
53
- const max = total - 1 - (1 - slideRatio - offsetRatio) / (slideRatio || 1);
54
- return { min, max };
55
- };