react-native-system-ui 1.0.7 → 1.0.8

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 (80) hide show
  1. package/README.md +13 -13
  2. package/dist/cjs/components/calendar/Calendar.js +1 -1
  3. package/dist/cjs/components/cascader/Cascader.js +1 -1
  4. package/dist/cjs/components/cascader/useCascaderExtend.js +1 -1
  5. package/dist/cjs/components/dialog/Dialog.js +1 -1
  6. package/dist/cjs/components/dialog/imperative.js +1 -1
  7. package/dist/cjs/components/field/Field.js +1 -1
  8. package/dist/cjs/components/form/Form.js +1 -1
  9. package/dist/cjs/components/number-keyboard/NumberKeyboard.js +1 -1
  10. package/dist/cjs/components/overlay/Overlay.js +1 -1
  11. package/dist/cjs/components/picker/Picker.js +1 -1
  12. package/dist/cjs/components/popup/Popup.js +1 -1
  13. package/dist/cjs/components/portal/PortalHost.js +1 -1
  14. package/dist/cjs/components/selector/Selector.js +1 -1
  15. package/dist/cjs/components/slider/Slider.js +1 -1
  16. package/dist/cjs/components/stepper/Stepper.js +1 -1
  17. package/dist/cjs/components/swiper/Swiper.js +1 -1
  18. package/dist/cjs/components/tabs/Tabs.js +1 -1
  19. package/dist/cjs/hooks/calendar/utils.js +1 -0
  20. package/dist/cjs/hooks/cascader/utils.js +1 -0
  21. package/dist/cjs/hooks/dialog/ActionButton.js +1 -0
  22. package/dist/cjs/hooks/field/renderers.js +1 -0
  23. package/dist/cjs/hooks/form/utils.js +1 -0
  24. package/dist/cjs/hooks/number-keyboard/utils.js +1 -0
  25. package/dist/cjs/hooks/picker/normalize.js +1 -0
  26. package/dist/cjs/hooks/picker/value.js +1 -0
  27. package/dist/cjs/hooks/popup/utils.js +1 -0
  28. package/dist/cjs/hooks/slider/utils.js +1 -0
  29. package/dist/cjs/hooks/swiper/utils.js +1 -0
  30. package/dist/cjs/hooks/tabs/TabBarItem.js +1 -0
  31. package/dist/cjs/hooks/tabs/useTabsInternals.js +1 -0
  32. package/dist/cjs/utils/compare.js +1 -1
  33. package/dist/es/components/calendar/Calendar.js +1 -1
  34. package/dist/es/components/cascader/Cascader.js +1 -1
  35. package/dist/es/components/cascader/useCascaderExtend.js +1 -1
  36. package/dist/es/components/dialog/Dialog.js +1 -1
  37. package/dist/es/components/dialog/imperative.js +1 -1
  38. package/dist/es/components/field/Field.js +1 -1
  39. package/dist/es/components/form/Form.js +1 -1
  40. package/dist/es/components/number-keyboard/NumberKeyboard.js +1 -1
  41. package/dist/es/components/overlay/Overlay.js +1 -1
  42. package/dist/es/components/picker/Picker.js +1 -1
  43. package/dist/es/components/popup/Popup.js +1 -1
  44. package/dist/es/components/portal/PortalHost.js +1 -1
  45. package/dist/es/components/selector/Selector.js +1 -1
  46. package/dist/es/components/slider/Slider.js +1 -1
  47. package/dist/es/components/stepper/Stepper.js +1 -1
  48. package/dist/es/components/swiper/Swiper.js +1 -1
  49. package/dist/es/components/tabs/Tabs.js +1 -1
  50. package/dist/es/hooks/calendar/utils.js +1 -0
  51. package/dist/es/hooks/cascader/utils.js +1 -0
  52. package/dist/es/hooks/dialog/ActionButton.js +1 -0
  53. package/dist/es/hooks/field/renderers.js +1 -0
  54. package/dist/es/hooks/form/utils.js +1 -0
  55. package/dist/es/hooks/number-keyboard/utils.js +1 -0
  56. package/dist/es/hooks/picker/normalize.js +1 -0
  57. package/dist/es/hooks/picker/value.js +1 -0
  58. package/dist/es/hooks/popup/utils.js +1 -0
  59. package/dist/es/hooks/slider/utils.js +1 -0
  60. package/dist/es/hooks/swiper/utils.js +1 -0
  61. package/dist/es/hooks/tabs/TabBarItem.js +1 -0
  62. package/dist/es/hooks/tabs/useTabsInternals.js +1 -0
  63. package/dist/es/utils/compare.js +1 -1
  64. package/dist/types/components/form/Form.d.ts +1 -1
  65. package/dist/types/components/picker/Picker.d.ts +1 -1
  66. package/dist/types/hooks/calendar/utils.d.ts +1 -0
  67. package/dist/types/hooks/cascader/utils.d.ts +1 -0
  68. package/dist/types/hooks/dialog/ActionButton.d.ts +1 -0
  69. package/dist/types/hooks/field/renderers.d.ts +1 -0
  70. package/dist/types/hooks/form/utils.d.ts +1 -0
  71. package/dist/types/hooks/number-keyboard/utils.d.ts +1 -0
  72. package/dist/types/hooks/picker/normalize.d.ts +1 -0
  73. package/dist/types/hooks/picker/value.d.ts +1 -0
  74. package/dist/types/hooks/popup/utils.d.ts +1 -0
  75. package/dist/types/hooks/slider/utils.d.ts +1 -0
  76. package/dist/types/hooks/swiper/utils.d.ts +1 -0
  77. package/dist/types/hooks/tabs/TabBarItem.d.ts +1 -0
  78. package/dist/types/hooks/tabs/useTabsInternals.d.ts +1 -0
  79. package/dist/types/utils/compare.d.ts +1 -1
  80. package/package.json +109 -109
@@ -1 +1 @@
1
- function _extends(){return _extends=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},_extends.apply(null,arguments)}import React,{useRef,useState,useCallback,useEffect,useImperativeHandle,forwardRef,memo,useMemo,Children,isValidElement}from"react";import{FlatList,View,StyleSheet,Platform}from"react-native";import{clamp}from"../../utils/number";import SwiperPagIndicator from"./SwiperPagIndicator";import{useSwiperTokens}from"./tokens";const SwiperItemImpl=(e,t)=>React.createElement(View,{ref:t,style:[S.item,e.style],testID:e.testID},e.children),SwiperItemFR=forwardRef(SwiperItemImpl);SwiperItemFR.displayName="SwiperItem";export const SwiperItem=memo(SwiperItemFR);const LOOP_THRESHOLD=10,SwiperImpl=(e,t)=>{const{data:r,renderItem:n,children:l,initialSwipe:a=0,touchable:c=!0,loop:u=!0,autoplay:i=!1,vertical:o=!1,onChange:s,indicator:m=!0,indicatorProps:f,style:d,testID:p}=e,h=useSwiperTokens(),w=useRef(null),v=useRef(null),b=useRef(!1),y=useRef(!1),I=useRef(null),E=useRef(!1),R=useRef(null),g=useRef(null),x=useRef(0),C="web"===Platform.OS,[k,T]=useState({width:0,height:0}),M=useCallback(e=>{const{width:t,height:r}=e.nativeEvent.layout;T(e=>e.width===t&&e.height===r?e:{width:t,height:r})},[]),P=useMemo(()=>l?Children.toArray(l).filter(e=>isValidElement(e)):[],[l]),O=Array.isArray(r),V=O?r:P,D=V.length,L=u&&D>1,F=useMemo(()=>L?[V[D-1],...V,V[0]]:V,[V,L,D]),z=F.length,_=L&&z<=10,H=useCallback(e=>L?0===e?D-1:e===z-1?0:e-1:clamp(e,0,D-1),[L,D,z]),j=useCallback(e=>L?clamp(e,0,D-1)+1:clamp(e,0,D-1),[L,D]),A=clamp(a,0,Math.max(0,D-1)),B=j(A),N=useRef(A),[$,X]=useState(A),Y=k.width>0&&k.height>0,U=o?k.height:k.width,q=o?k.width:k.height,G=useMemo(()=>({width:o?q:U,height:o?U:q}),[o,U,q]),J=useCallback(()=>{v.current&&(clearTimeout(v.current),v.current=null)},[]),K=useRef(s);K.current=s;const Q=useCallback(e=>{const t=clamp(e,0,Math.max(0,D-1));N.current!==t&&(N.current=t,X(t),K.current?.(t))},[D]),W=useCallback((e,t)=>{try{w.current?.scrollToIndex({index:e,animated:t})}catch{}},[]),Z=useCallback((e,t=!0)=>{if(0===D)return;if(t&&y.current)return void(I.current=e);const r=clamp(e,0,D-1);let n=j(r);if(L&&t){const e=j(N.current);e===D&&0===r?n=z-1:1===e&&r===D-1&&(n=0)}const l=N.current,a=j(l);if(r!==l||n!==a){if(t&&(y.current=!0),W(n,t),!t&&(Q(r),null!=I.current)){const e=I.current;I.current=null,Z(e,!0)}}else if(null!=I.current){const e=I.current;I.current=null,Z(e,!0)}},[D,j,W,L,z,Q]),ee=useCallback(()=>{const e="number"==typeof i?Math.max(0,i):i?h.defaults.autoplayInterval:0;!e||D<=1||b.current&&!C||(J(),v.current=setTimeout(()=>{b.current&&!C||Z(L?(N.current+1)%D:clamp(N.current+1,0,D-1),!0)},e))},[i,D,J,L,Z,C,h.defaults.autoplayInterval]),te=useCallback(()=>{0!==D&&Z(L?(N.current+1)%D:clamp(N.current+1,0,D-1),!0)},[D,L,Z]),re=useCallback(()=>{0!==D&&Z(L?(N.current-1+D)%D:clamp(N.current-1,0,D-1),!0)},[D,L,Z]);useImperativeHandle(t,()=>({swipeTo:Z,swipeNext:te,swipePrev:re,getCurrentIndex:()=>N.current}),[Z,te,re]),useEffect(()=>{Y&&0!==D&&W(B,!1)},[Y,D,B,W]),useEffect(()=>(ee(),J),[ee,J,$]),useEffect(()=>()=>{g.current&&clearTimeout(g.current)},[]);const ne=useCallback(()=>{y.current=!1,b.current=!1,E.current=!1,ee(),(()=>{if(null==I.current)return;const e=I.current;I.current=null,Z(e,!0)})()},[ee]),le=useCallback(e=>{if(D<=1)return;const t=o?e.nativeEvent.contentOffset.y:e.nativeEvent.contentOffset.x,r=Math.round(t/U),n=clamp(r,0,L?z-1:D-1);if(Q(H(n)),C){g.current&&(clearTimeout(g.current),g.current=null),x.current=t;const e=r*U;Math.abs(t-e)<.5?(L&&(r<=0||r>=z-1)&&W(r<=0?D:1,!1),ne()):g.current=setTimeout(()=>{g.current=null;const e=x.current,t=Math.round(e/U);L&&(t<=0||t>=z-1)&&W(t<=0?D:1,!1),ne()},150)}},[D,o,U,L,z,Q,H,W,ne,C]),ae=useCallback(e=>{if(C||0===D)return;const t=o?e.nativeEvent.contentOffset.y:e.nativeEvent.contentOffset.x,r=Math.round(t/U);let n=r;L&&(0===r&&(n=D),r===z-1&&(n=1)),n!==r&&W(n,!1),Q(H(n)),ne()},[o,D,U,L,z,W,Q,H,ne,C]),ce=useCallback(()=>{b.current=!0,J(),g.current&&(clearTimeout(g.current),g.current=null)},[J]),ue=useCallback(e=>{E.current||ae(e)},[ae]),ie=useCallback(()=>{E.current=!0},[]),oe=useCallback(e=>{W(e.index,!1),Q(H(e.index)),ne()},[W,Q,H,ne]),se=useRef(n);se.current=n;const me=useCallback(e=>{const t=O?se.current?.(e)??null:e.item;return t?React.createElement(View,{style:[S.slide,G]},t):null},[O,G]),fe=useCallback((e,t)=>({length:U,offset:U*t,index:t}),[U]),de=useCallback((e,t)=>`s-${t}`,[]);if(0===D)return null;const pe=!1===m||D<=1?null:"function"==typeof m?m(D,$):React.createElement(SwiperPagIndicator,_extends({},f,{total:D,current:$,vertical:o})),he=C&&c&&D>1?{onPointerDown:e=>{"mouse"===e.nativeEvent.pointerType&&0===e.nativeEvent.button&&(R.current=o?e.nativeEvent.pageY:e.nativeEvent.pageX,b.current=!0,J())},onPointerUp:e=>{const t=R.current;if(R.current=null,null==t||"mouse"!==e.nativeEvent.pointerType)return;const r=(o?e.nativeEvent.pageY:e.nativeEvent.pageX)-t;Math.abs(r)>=.15*U&&(r<0?te():re()),b.current=!1,ee()},onPointerLeave:()=>{null!=R.current&&(R.current=null,b.current=!1,ee())}}:void 0;return Y?React.createElement(View,_extends({accessibilityRole:"adjustable",accessibilityLabel:`swiper, ${$+1} of ${D}`,accessibilityValue:{min:0,max:D-1,now:$},style:[S.ctr,he&&S.web,d],onLayout:M,testID:p},he),React.createElement(FlatList,{ref:w,data:F,renderItem:me,keyExtractor:de,horizontal:!o,getItemLayout:fe,initialScrollIndex:B,scrollEnabled:c&&D>1,removeClippedSubviews:!L||!_,disableVirtualization:L&&_,initialNumToRender:L&&_?z:3,maxToRenderPerBatch:L&&_?z:3,windowSize:L?_?z:7:5,pagingEnabled:!0,snapToInterval:U,decelerationRate:"fast",showsHorizontalScrollIndicator:!1,showsVerticalScrollIndicator:!1,onScrollBeginDrag:ce,onScroll:le,scrollEventThrottle:h.defaults.scrollEventThrottle,onScrollEndDrag:ue,onMomentumScrollBegin:ie,onMomentumScrollEnd:ae,onScrollToIndexFailed:oe}),React.createElement(View,{pointerEvents:"none",style:[S.ind,{zIndex:h.layer.zIndex,elevation:h.layer.elevation}]},pe)):React.createElement(View,{style:[S.ctr,d],onLayout:M,testID:p})},SwiperFR=forwardRef(SwiperImpl),Swiper=memo(SwiperFR),S=StyleSheet.create({ctr:{position:"relative",overflow:"hidden"},web:{cursor:"grab",userSelect:"none"},slide:{flex:1},item:{flex:1},ind:{position:"absolute",left:0,right:0,top:0,bottom:0}});export default Swiper;
1
+ function _extends(){return _extends=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},_extends.apply(null,arguments)}import React,{useRef,useState,useCallback,useEffect,useImperativeHandle,forwardRef,memo,useMemo,Children,isValidElement}from"react";import{FlatList,View,StyleSheet,Platform}from"react-native";import{clamp}from"../../utils/number";import SwiperPagIndicator from"./SwiperPagIndicator";import{useSwiperTokens}from"./tokens";import{createWebMouseHandlers,LOOP_THRESHOLD}from"../../hooks/swiper/utils";const SwiperItemImpl=(e,t)=>React.createElement(View,{ref:t,style:[S.item,e.style],testID:e.testID},e.children),SwiperItemFR=forwardRef(SwiperItemImpl);SwiperItemFR.displayName="SwiperItem";export const SwiperItem=memo(SwiperItemFR);const SwiperImpl=(e,t)=>{const{data:r,renderItem:n,children:l,initialSwipe:a=0,touchable:c=!0,loop:u=!0,autoplay:i=!1,vertical:o=!1,onChange:s,indicator:m=!0,indicatorProps:d,style:f,testID:p}=e,h=useSwiperTokens(),w=useRef(null),b=useRef(null),R=useRef(!1),I=useRef(!1),v=useRef(null),y=useRef(!1),g=useRef(null),x=useRef(null),E=useRef(0),k="web"===Platform.OS,[C,T]=useState({width:0,height:0}),M=useCallback(e=>{const{width:t,height:r}=e.nativeEvent.layout;T(e=>e.width===t&&e.height===r?e:{width:t,height:r})},[]),O=useMemo(()=>l?Children.toArray(l).filter(e=>isValidElement(e)):[],[l]),P=Array.isArray(r),V=P?r:O,L=V.length,D=u&&L>1,H=useMemo(()=>D?[V[L-1],...V,V[0]]:V,[V,D,L]),F=H.length,z=D&&F<=LOOP_THRESHOLD,_=useCallback(e=>D?0===e?L-1:e===F-1?0:e-1:clamp(e,0,L-1),[D,L,F]),A=useCallback(e=>D?clamp(e,0,L-1)+1:clamp(e,0,L-1),[D,L]),j=clamp(a,0,Math.max(0,L-1)),B=A(j),N=useRef(j),[$,W]=useState(j),q=C.width>0&&C.height>0,G=o?C.height:C.width,J=o?C.width:C.height,K=useMemo(()=>({width:o?J:G,height:o?G:J}),[o,G,J]),Q=useCallback(()=>{b.current&&(clearTimeout(b.current),b.current=null)},[]),U=useRef(s);U.current=s;const X=useCallback(e=>{const t=clamp(e,0,Math.max(0,L-1));N.current!==t&&(N.current=t,W(t),U.current?.(t))},[L]),Y=useCallback((e,t)=>{try{w.current?.scrollToIndex({index:e,animated:t})}catch{}},[]),Z=useCallback((e,t=!0)=>{if(0===L)return;if(t&&I.current)return void(v.current=e);const r=clamp(e,0,L-1);let n=A(r);if(D&&t){const e=A(N.current);e===L&&0===r?n=F-1:1===e&&r===L-1&&(n=0)}const l=N.current,a=A(l);if(r!==l||n!==a){if(t&&(I.current=!0),Y(n,t),!t&&(X(r),null!=v.current)){const e=v.current;v.current=null,Z(e,!0)}}else if(null!=v.current){const e=v.current;v.current=null,Z(e,!0)}},[L,A,Y,D,F,X]),ee=useCallback(()=>{const e="number"==typeof i?Math.max(0,i):i?h.defaults.autoplayInterval:0;!e||L<=1||R.current&&!k||(Q(),b.current=setTimeout(()=>{R.current&&!k||Z(D?(N.current+1)%L:clamp(N.current+1,0,L-1),!0)},e))},[i,L,Q,D,Z,k,h.defaults.autoplayInterval]),te=useCallback(()=>{0!==L&&Z(D?(N.current+1)%L:clamp(N.current+1,0,L-1),!0)},[L,D,Z]),re=useCallback(()=>{0!==L&&Z(D?(N.current-1+L)%L:clamp(N.current-1,0,L-1),!0)},[L,D,Z]);useImperativeHandle(t,()=>({swipeTo:Z,swipeNext:te,swipePrev:re,getCurrentIndex:()=>N.current}),[Z,te,re]),useEffect(()=>{q&&0!==L&&Y(B,!1)},[q,L,B,Y]),useEffect(()=>(ee(),Q),[ee,Q,$]),useEffect(()=>()=>{x.current&&clearTimeout(x.current)},[]);const ne=useCallback(()=>{I.current=!1,R.current=!1,y.current=!1,ee(),(()=>{if(null==v.current)return;const e=v.current;v.current=null,Z(e,!0)})()},[ee]),le=useCallback(e=>{if(L<=1)return;const t=o?e.nativeEvent.contentOffset.y:e.nativeEvent.contentOffset.x,r=Math.round(t/G),n=clamp(r,0,D?F-1:L-1);if(X(_(n)),k){x.current&&(clearTimeout(x.current),x.current=null),E.current=t;const e=r*G;Math.abs(t-e)<.5?(D&&(r<=0||r>=F-1)&&Y(r<=0?L:1,!1),ne()):x.current=setTimeout(()=>{x.current=null;const e=E.current,t=Math.round(e/G);D&&(t<=0||t>=F-1)&&Y(t<=0?L:1,!1),ne()},150)}},[L,o,G,D,F,X,_,Y,ne,k]),ae=useCallback(e=>{if(k||0===L)return;const t=o?e.nativeEvent.contentOffset.y:e.nativeEvent.contentOffset.x,r=Math.round(t/G);let n=r;D&&(0===r&&(n=L),r===F-1&&(n=1)),n!==r&&Y(n,!1),X(_(n)),ne()},[o,L,G,D,F,Y,X,_,ne,k]),ce=useCallback(()=>{R.current=!0,Q(),x.current&&(clearTimeout(x.current),x.current=null)},[Q]),ue=useCallback(e=>{y.current||ae(e)},[ae]),ie=useCallback(()=>{y.current=!0},[]),oe=useCallback(e=>{const t=clamp(e.index,0,D?F-1:L-1);Y(t,!1),X(_(t)),ne()},[L,F,_,ne,Y,D,X]),se=useRef(n);se.current=n;const me=useCallback(e=>{const t=P?se.current?.(e)??null:e.item;return t?React.createElement(View,{style:[S.slide,K]},t):null},[P,K]),de=useCallback((e,t)=>({length:G,offset:G*t,index:t}),[G]),fe=useCallback((e,t)=>`s-${t}`,[]);if(0===L)return null;const pe=!1===m||L<=1?null:"function"==typeof m?m(L,$):React.createElement(SwiperPagIndicator,_extends({},d,{total:L,current:$,vertical:o})),he=useMemo(()=>createWebMouseHandlers({enabled:k&&c&&L>1,vertical:o,mainSize:G,clearAuto:Q,next:te,prev:re,schedule:ee,dragRef:g,interRef:R}),[k,c,L,o,G,Q,te,re,ee]);return q?React.createElement(View,_extends({accessibilityRole:"adjustable",accessibilityLabel:`swiper, ${$+1} of ${L}`,accessibilityValue:{min:0,max:L-1,now:$},style:[S.ctr,he&&S.web,f],onLayout:M,testID:p},he),React.createElement(FlatList,{ref:w,data:H,renderItem:me,keyExtractor:fe,horizontal:!o,getItemLayout:de,initialScrollIndex:B,scrollEnabled:c&&L>1,removeClippedSubviews:!D||!z,disableVirtualization:D&&z,initialNumToRender:D&&z?F:3,maxToRenderPerBatch:D&&z?F:3,windowSize:D?z?F:7:5,pagingEnabled:!0,snapToInterval:G,decelerationRate:"fast",showsHorizontalScrollIndicator:!1,showsVerticalScrollIndicator:!1,onScrollBeginDrag:ce,onScroll:le,scrollEventThrottle:h.defaults.scrollEventThrottle,onScrollEndDrag:ue,onMomentumScrollBegin:ie,onMomentumScrollEnd:ae,onScrollToIndexFailed:oe}),React.createElement(View,{pointerEvents:"none",style:[S.ind,{zIndex:h.layer.zIndex,elevation:h.layer.elevation}]},pe)):React.createElement(View,{style:[S.ctr,f],onLayout:M,testID:p})},SwiperFR=forwardRef(SwiperImpl),Swiper=memo(SwiperFR),S=StyleSheet.create({ctr:{position:"relative",overflow:"hidden"},web:{cursor:"grab",userSelect:"none"},slide:{flex:1},item:{flex:1},ind:{position:"absolute",left:0,right:0,top:0,bottom:0}});export default Swiper;
@@ -1 +1 @@
1
- function _extends(){return _extends=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},_extends.apply(null,arguments)}import React,{memo,useCallback,useEffect,useImperativeHandle,useRef,useState,useMemo,Children,isValidElement}from"react";import{Animated,Pressable,StyleSheet,Text,ScrollView,View,Platform}from"react-native";import{useAriaPress,useControllableValue}from"../../hooks";import{useReducedMotion}from"../../hooks/animation";import{createHairlineView}from"../../utils/hairline";import{parseNumberLike}from"../../utils/number";import{isBoolean,isFunction,isObject,isRenderable,isText}from"../../utils/validate";import{useTabsTokens}from"./tokens";const TabPane=()=>null;TabPane.displayName="Tabs.TabPane";const hasRaf="function"==typeof requestAnimationFrame&&"function"==typeof cancelAnimationFrame,requestFrame=hasRaf?requestAnimationFrame:e=>setTimeout(e,16),cancelFrame=e=>{null!=e&&(hasRaf?cancelAnimationFrame:clearTimeout)(e)},isTabPaneElement=e=>!!React.isValidElement(e)&&(e.type===TabPane||"Tabs.TabPane"===e.type.displayName),useTabsAnimation=({type:e,animated:t,scrollable:n,align:r,panes:a,nameIndexMap:i,resolvedLineWidth:l,resolvedDuration:o,currentName:c,layoutMap:s,navContainerWidthRef:u})=>{const d=useRef(new Animated.Value(0)).current,m=useRef(new Animated.Value(0)).current,f=useRef(!1),p=useRef(null),g=useCallback((c,f)=>{if(null==c||"line"!==e)return!1;const g=!n&&"start"!==r&&u.current>0&&a.length>0,b=i.get(c)??-1,h=g?u.current/a.length:0,y=g?{x:Math.max(b,0)*h,width:h}:s.current.get(c);if(!y||b<0)return!1;p.current?.stop();const v=(e,n)=>Animated.timing(e,{toValue:n,duration:f||!t?0:o,useNativeDriver:!1,isInteraction:!1}),R=l??y.width,S=l?y.x+(y.width-R)/2:y.x,x=Animated.parallel([v(d,S),v(m,R)]);return p.current=x,x.start(({finished:e})=>{e&&(p.current=null)}),!0},[r,t,m,d,i,a.length,o,l,n,e,s,u]);return useEffect(()=>{if(null==c)return;const e=f.current;g(c,!e)&&!f.current&&(f.current=!0)},[g,c]),useEffect(()=>()=>{p.current?.stop(),p.current=null},[]),{indicatorX:d,indicatorWidth:m,indicatorInitializedRef:f,animateIndicator:g}},useTabsScroll=({scrollable:e,animated:t,currentName:n,resolvedDuration:r,layoutMap:a,navContainerWidthRef:i,navContentWidthRef:l})=>{const o=useRef(null),c=useRef(new Animated.Value(0)).current,s=useRef(null),u=useRef(!1),d=useRef(0),m=useRef(null),f=useCallback(o=>{if(!e||null==n)return;const f=a.current.get(n),p=i.current;if(!f||!p)return;const g=l.current,b=f.x-(p-f.width)/2,h=Math.max(g-p,0),y=Math.max(0,Math.min(b,h));if(!(h<=0||Math.abs(y-d.current)<1)){if(s.current?.stop(),s.current=null,cancelFrame(m.current),m.current=null,o||!t)return u.current=!0,c.setValue(y),void(m.current=requestFrame(()=>{m.current=null,u.current=!1}));c.setValue(d.current),u.current=!0,s.current=Animated.timing(c,{toValue:y,duration:r,useNativeDriver:!1,isInteraction:!1}),s.current.start(({finished:e})=>{s.current=null,u.current=!1,e&&(d.current=y)})}},[t,n,c,r,e,a,i,l]);useEffect(()=>{if(!e)return;const t=c.addListener(({value:e})=>{const t=d.current;d.current=e,Math.abs(e-t)>=.5&&o.current?.scrollTo({x:e,y:0,animated:!1})});return()=>c.removeListener(t)},[c,e]),useEffect(()=>()=>{cancelFrame(m.current),m.current=null},[]);const p=useCallback(e=>{u.current=!1,s.current?.stop(),s.current=null,d.current=e.nativeEvent.contentOffset.x},[]),g=useCallback(e=>{u.current||(d.current=e.nativeEvent.contentOffset.x)},[]);return{navScrollRef:o,navScrollX:c,scrollIntoView:f,handleNavScrollBeginDrag:p,handleNavScroll:g}},TabBarItemInner=({pane:e,isActive:t,align:n,scrollable:r,type:a,ellipsis:i,tokens:l,color:o,titleActiveColor:c,titleInactiveColor:s,tabStyle:u,titleStyle:d,descriptionStyle:m,onSelect:f,onLayout:p,isLast:g})=>{const b=!!e.disabled,h=useAriaPress({onPress:t=>f(e,e.index,t),extraProps:{accessibilityRole:"tab",accessibilityState:{selected:t,disabled:b},testID:`rv-tabs-item-${e.name}`}}),y="capsule"===a,v="jumbo"===a,R="card"===a,x=isFunction(e.title)?e.title(t):e.title??e.name,w=isFunction(e.description)?e.description(t):e.description,T=c??(R?l.colors.cardActiveText:y?l.colors.capsuleActiveText:o??l.colors.textActive),E=s??(R?o??l.colors.cardBorder:y?l.colors.capsuleText:l.colors.text),k=e.disabled?l.colors.textDisabled:t?T:E,C=b?l.colors.textDisabled:v?t?l.colors.jumboDescriptionActive:l.colors.jumboDescription:t?l.colors.descriptionActive:l.colors.description,V=!r&&("start"!==n||R),I=R||v||y,H=I?0:l.tabList.paddingHorizontal,P=I?0:l.tabList.paddingVertical,A=[S.lblW,v&&S.lblWJ,R&&S.cardLbl,R&&{paddingHorizontal:l.card.paddingHorizontal,paddingVertical:l.card.paddingVertical},y&&{flex:1,alignSelf:"stretch",paddingHorizontal:l.capsule.paddingHorizontal,paddingVertical:l.capsule.paddingVertical},v&&{paddingHorizontal:l.jumbo.paddingHorizontal,paddingVertical:l.jumbo.paddingVertical,alignItems:"center"}].filter(Boolean),z=y?[{flex:1,alignSelf:"stretch",justifyContent:"center",alignItems:"center",borderRadius:l.capsule.radius,backgroundColor:t?o??l.colors.capsuleActiveBackground:l.colors.capsuleBackground}]:null,M=[S.title,{color:k,fontFamily:l.typography.fontFamily,fontSize:v?l.typography.jumboTitleSize:l.typography.titleSize,fontWeight:t?l.typography.titleActiveWeight:l.typography.titleWeight,lineHeight:v?l.typography.jumboLineHeight:void 0,textAlign:"center"},i&&!v?S.ellipsis:null,d],L=v?l.spacing.jumboDescriptionMarginTop:l.spacing.descriptionMarginTop,B=v?{backgroundColor:t?l.colors.jumboDescriptionActiveBackground:l.colors.jumboDescriptionBackground,paddingHorizontal:l.jumbo.descriptionPaddingHorizontal,paddingVertical:l.jumbo.descriptionPaddingVertical,borderRadius:l.jumbo.descriptionRadius}:null,D=useCallback(t=>p(e.name,t),[p,e.name]);return React.createElement(Pressable,_extends({},h.interactionProps,{onLayout:D,style:[S.tabI,V?S.flexI:null,{paddingHorizontal:H,paddingVertical:P},R?{backgroundColor:t?o??l.colors.cardActiveBackground:l.colors.cardBackground}:null,u]}),React.createElement(View,{style:A},z?React.createElement(View,{style:z},React.createElement(Text,{style:M,numberOfLines:i&&!v?1:void 0},x)):React.createElement(Text,{style:M,numberOfLines:i&&!v?1:void 0},x),isRenderable(w)&&(isText(w)?React.createElement(Text,{style:[S.descTxt,{color:C,fontFamily:l.typography.fontFamily,fontSize:l.typography.descriptionSize,marginTop:L,textAlign:"center"},B,m]},w):React.createElement(View,{style:[{marginTop:L,alignItems:"center"},B]},w)),isRenderable(e.badge)&&React.createElement(View,{style:{marginTop:l.spacing.badgeMarginTop}},isText(e.badge)?React.createElement(Text,{style:{color:l.colors.badgeText,fontFamily:l.typography.fontFamily,fontSize:l.typography.badgeTextSize}},e.badge):e.badge)),R&&!g&&React.createElement(View,{style:createHairlineView({position:"right",color:o??l.colors.cardBorder,top:0,bottom:0})}))},TabBarItem=memo(TabBarItemInner),TabsBaseInner=(e,t)=>{const{tokensOverride:n,children:r,type:a,align:i,ellipsis:l,swipeThreshold:o,animated:c,duration:s,lazyRender:u,lazyRenderPlaceholder:d,scrollable:m,swipeable:f,color:p,background:g,border:b,navLeft:h,navRight:y,navBottom:v,tabBarStyle:R,tabStyle:x,titleStyle:w,descriptionStyle:T,contentStyle:E,lineWidth:k,lineHeight:C,titleActiveColor:V,titleInactiveColor:I,beforeChange:H,onClickTab:P,onChange:A,style:z,...M}=e,L=useTabsTokens(n),B=useReducedMotion(),D=a??L.defaults.type,j=i??L.defaults.align,F=l??L.defaults.ellipsis,W=o??L.defaults.swipeThreshold,N=c??L.defaults.animated,O=s??L.defaults.duration,q=u??L.defaults.lazyRender,_=g??L.tabList.background,X=parseNumberLike(k??L.indicator.width),J=null!=X&&X<0?void 0:X,$=Math.max(0,parseNumberLike(C)??L.indicator.height),G=B?0:Math.max(0,parseNumberLike(O)??L.defaults.duration),K=Math.max(0,parseNumberLike(W)??L.defaults.swipeThreshold),Q=f?isObject(f)?{autoHeight:f.autoHeight??!0,preventScroll:f.preventScroll??!0}:{autoHeight:!0,preventScroll:!0}:void 0,U=!!Q,Y=useMemo(()=>{const e=[];let t=0;const n=r=>{Children.forEach(r,r=>{if(!isValidElement(r))return;const a=r;if(a.type===React.Fragment)return void n(a.props.children);if(!isTabPaneElement(a))return;const i=a.props,l=i.name??t;e.push({...i,key:a.key??l,name:l,index:t}),t+=1})};return n(r),e},[r]),Z=Y[0]?.name,[ee,te]=useControllableValue(e,{defaultValue:Z,valuePropName:"active",defaultValuePropName:"defaultActive",trigger:"onChange"}),ne=null==ee?Z:Y.some(e=>e.name===ee)?ee:Z,re=useRef(ne);useEffect(()=>{re.current=ne},[ne]);const ae=useMemo(()=>{const e=new Map;return Y.forEach(t=>{e.set(t.name,t.index)}),e},[Y]),ie=null==ne?-1:ae.get(ne)??-1,le=useRef(new Set),oe=useRef(new Map),ce=useRef(0),se=useRef(0),ue=useRef(null),de=useRef(new Map),me=useRef(null),fe=useRef(!1),[pe,ge]=useState(0),[be,he]=useState(void 0);useEffect(()=>{null!=ne&&le.current.add(ne)},[ne]),useEffect(()=>{const e=new Set(Y.map(e=>e.name));Array.from(de.current.keys()).forEach(t=>{e.has(t)||de.current.delete(t)}),Array.from(oe.current.keys()).forEach(t=>{e.has(t)||oe.current.delete(t)})},[Y]);const ye=U&&Q?.autoHeight;useEffect(()=>{ye||de.current.clear()},[ye]),useEffect(()=>{if(!U||!Q?.autoHeight)return void he(void 0);const e=null!=ne?de.current.get(ne):void 0;he(e?e.height:void 0)},[ne,U,Q?.autoHeight]),useEffect(()=>()=>{cancelFrame(ue.current),ue.current=null},[]);const ve=isBoolean(m)?m:Y.length>K||!1===F,Re=p??L.colors.indicator,Se=$?$/2:L.indicator.radius,{indicatorX:xe,indicatorWidth:we,indicatorInitializedRef:Te,animateIndicator:Ee}=useTabsAnimation({type:D,animated:N,scrollable:ve,align:j,panes:Y,nameIndexMap:ae,resolvedLineWidth:J,resolvedLineHeight:$,resolvedDuration:G,currentName:ne,layoutMap:oe,navContainerWidthRef:ce}),{navScrollRef:ke,scrollIntoView:Ce,handleNavScrollBeginDrag:Ve,handleNavScroll:Ie}=useTabsScroll({scrollable:ve,animated:N,currentName:ne,resolvedDuration:G,layoutMap:oe,navContainerWidthRef:ce,navContentWidthRef:se}),He=useCallback((e,t)=>{const{x:n,width:r}=t.nativeEvent.layout;if(oe.current.set(e,{x:n,width:r}),e===re.current){const t=Te.current;Ee(e,!t)&&!Te.current&&(Te.current=!0)}},[Ee,Te]),Pe=useCallback(e=>{const{width:t}=e.nativeEvent.layout;if(ce.current=t,!ve&&"start"!==j&&"line"===D&&null!=ne){const e=Te.current;Ee(ne,!e)&&!Te.current&&(Te.current=!0)}},[j,Ee,ne,ve,D,Te]),Ae=useCallback(e=>{const t=e.nativeEvent.layout.width;ge(e=>e===t?e:t)},[]),ze=useRef(H);ze.current=H;const Me=useCallback(e=>{if(!ze.current)return Promise.resolve(!0);try{return Promise.resolve(ze.current(e)).then(e=>!1!==e).catch(()=>!1)}catch{return Promise.resolve(!1)}},[]),Le=useRef(0),Be=useCallback((e,t)=>{Le.current+=1;const n=Le.current;Me(e).then(r=>{r&&Le.current===n&&te(e,t)})},[Me,te]),De=useCallback((e,t)=>{if(U&&Q?.autoHeight){const{height:n}=t.nativeEvent.layout;de.current.set(e,{height:n}),e===ne&&he(n)}},[ne,U,Q?.autoHeight]),je=useRef(null);useEffect(()=>{je.current=null},[ne]);const Fe=useCallback(e=>{if(!U||pe<=0)return;const t=Math.round(e/pe);if(je.current===t)return;je.current=t;const n=Y[t];n&&n.name!==re.current&&(fe.current=!0,Be(n.name,n.index))},[pe,U,Y,Be]),We=useCallback(e=>{Fe(e.nativeEvent.contentOffset.x)},[Fe]),Ne=useCallback(e=>{Fe(e.nativeEvent.contentOffset.x)},[Fe]);useEffect(()=>{if(!U||!me.current||pe<=0)return;if(fe.current)return void(fe.current=!1);if(ie<0)return;const e=me.current?.getNode?.()??me.current;e?.scrollTo&&e.scrollTo({x:pe*ie,y:0,animated:!0})},[ie,pe,U]);const Oe=useRef(P);Oe.current=P;const qe=useCallback((e,t,n)=>{const r={name:e.name,index:t,disabled:!!e.disabled,event:n};Oe.current?.(r),e.disabled||e.name===re.current||Be(e.name,t)},[Be]),_e=useCallback((e,t)=>{const n=Y.find(t=>t.name===e&&!t.disabled);n&&te(n.name,n.index)},[Y,te]);useImperativeHandle(t,()=>({scrollTo:_e}),[_e]);const Xe=useRef(!0);useEffect(()=>{Xe.current&&(Xe.current=!1,Ce(!0))},[Ce]),useEffect(()=>{Xe.current||Ce()},[ne,Ce]);const Je=b??!1,$e="line"===D,Ge="jumbo"===D?L.jumbo.height:"card"===D?L.card.height:L.tabList.height,Ke="web"===Platform.OS&&"line"!==D&&"card"!==D?L.tabList.paddingBottom:0,Qe=$e?"line"===D?0:L.indicator.offset:0;if(0===Y.length)return null;const Ue=$e?React.createElement(Animated.View,{testID:"rv-tabs-indicator",style:[S.ind,{height:$,borderRadius:Se,backgroundColor:Re,width:we,bottom:Qe,transform:[{translateX:xe}]}]}):null,Ye=useMemo(()=>Y.map(e=>React.createElement(TabBarItem,{key:e.key,pane:e,isActive:e.name===ne,align:j,scrollable:ve,type:D,ellipsis:F,tokens:L,color:p,titleActiveColor:V,titleInactiveColor:I,tabStyle:x,titleStyle:w,descriptionStyle:T,onSelect:qe,onLayout:He,isLast:e.index===Y.length-1})),[j,p,ne,T,F,qe,He,Y,ve,x,V,I,w,L,D]),Ze=useCallback(e=>{const t=se.current;se.current=e,0===t||Xe.current?Ce(!0):Math.abs(e-t)>1&&(cancelFrame(ue.current),ue.current=requestFrame(()=>{ue.current=null,Ce()}))},[Ce]),et=ve?React.createElement(ScrollView,{horizontal:!0,ref:ke,accessibilityRole:"tablist",showsHorizontalScrollIndicator:!1,scrollEventThrottle:16,onScrollBeginDrag:Ve,onScroll:Ie,onContentSizeChange:Ze,contentContainerStyle:S.navC},Ye,Ue):React.createElement(View,{accessibilityRole:"tablist",style:[S.navC,S.navCSta]},Ye,Ue),tt=React.createElement(View,{style:[S.wrap,{backgroundColor:_},R]},h&&React.createElement(View,{style:{paddingHorizontal:L.spacing.navSidePaddingHorizontal}},h),React.createElement(View,{style:[S.nav,{minHeight:Ge+Ke,paddingBottom:Ke},"card"===D?{borderRadius:L.card.radius,marginHorizontal:L.card.marginHorizontal,overflow:"hidden"}:null],onLayout:Pe},et,"card"===D&&React.createElement(View,{style:createHairlineView({position:"all",color:p??L.colors.cardBorder,borderRadius:L.card.radius})})),y&&React.createElement(View,{style:{paddingHorizontal:L.spacing.navSidePaddingHorizontal}},y),Je&&"line"===D&&React.createElement(View,{style:createHairlineView({position:"bottom",color:L.colors.border,left:0,right:0})})),nt=useMemo(()=>Y.map(e=>{const t=e.name===ne,n=!q||t||le.current.has(e.name);if(!n&&!U)return null;const r=U&&Q?.autoHeight?t=>De(e.name,t):void 0,a=[S.pane,U?S.swipePane:null,U&&pe>0&&{width:pe},U||t?null:S.hidPane],i=n?e.children:d||null;return React.createElement(View,{key:e.key,testID:`rv-tabs-pane-${e.name}`,onLayout:r,style:a},i)}),[pe,ne,De,U,q,d,Y,Q?.autoHeight]),rt=[S.content,E],at=[S.content,E,Q?.autoHeight&&void 0!==be&&{height:be}],it=U?React.createElement(View,{style:at},React.createElement(Animated.ScrollView,{ref:me,horizontal:!0,pagingEnabled:!0,scrollEventThrottle:16,showsHorizontalScrollIndicator:!1,onMomentumScrollEnd:We,onScrollEndDrag:Ne,nestedScrollEnabled:!1===Q?.preventScroll,directionalLockEnabled:!1!==Q?.preventScroll},nt)):React.createElement(View,{style:rt},nt);return React.createElement(View,_extends({},M,{style:[S.ctr,z],onLayout:Ae}),tt,v&&React.createElement(View,{style:{marginTop:L.spacing.navBottomMarginTop}},v),it)},S=StyleSheet.create({ctr:{width:"100%"},wrap:{flexDirection:"row",alignItems:"center",position:"relative"},nav:{flex:1,position:"relative",alignSelf:"stretch"},navC:{flexDirection:"row",alignItems:"center",height:"100%",position:"relative"},navCSta:{flex:1},lblW:{justifyContent:"center",alignItems:"center",flexDirection:"column"},lblWJ:{alignItems:"center"},cardLbl:{flexDirection:"row",justifyContent:"center",alignItems:"center"},tabI:{flexShrink:0,height:"100%",alignSelf:"stretch",alignItems:"center",justifyContent:"center",flexDirection:"row"},flexI:{flexGrow:1},title:{includeFontPadding:!1},descTxt:{includeFontPadding:!1},ellipsis:{maxWidth:"100%",flexShrink:1},ind:{position:"absolute",bottom:0,left:0},content:{width:"100%"},pane:{width:"100%"},swipePane:{flexShrink:0},hidPane:{display:"none"}}),TabsBaseRef=React.forwardRef(TabsBaseInner),TabsWithPane=Object.assign(React.memo(TabsBaseRef),{TabPane:TabPane});export{TabPane};export default TabsWithPane;
1
+ function _extends(){return _extends=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)({}).hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},_extends.apply(null,arguments)}import React,{useCallback,useEffect,useImperativeHandle,useRef,useState,useMemo,Children,isValidElement}from"react";import{Animated,StyleSheet,ScrollView,View,Platform}from"react-native";import{useControllableValue}from"../../hooks";import{useReducedMotion}from"../../hooks/animation";import{createHairlineView}from"../../utils/hairline";import{parseNumberLike}from"../../utils/number";import{isBoolean,isObject}from"../../utils/validate";import{useTabsTokens}from"./tokens";import{cancelTabsFrame,requestTabsFrame,useTabsAnimation,useTabsScroll}from"../../hooks/tabs/useTabsInternals";import{isTabPaneElement,TabBarItem}from"../../hooks/tabs/TabBarItem";const TabPane=()=>null;TabPane.displayName="Tabs.TabPane";const TabsBaseInner=(e,t)=>{const{tokensOverride:n,children:a,type:r,align:l,ellipsis:o,swipeThreshold:i,animated:s,duration:c,lazyRender:u,lazyRenderPlaceholder:d,scrollable:m,swipeable:f,color:h,background:b,border:p,navLeft:v,navRight:g,navBottom:y,tabBarStyle:R,tabStyle:w,titleStyle:E,descriptionStyle:T,contentStyle:k,lineWidth:C,lineHeight:V,titleActiveColor:x,titleInactiveColor:H,beforeChange:P,onClickTab:I,onChange:M,style:B,...L}=e,z=useTabsTokens(n),N=useReducedMotion(),A=r??z.defaults.type,O=l??z.defaults.align,D=o??z.defaults.ellipsis,W=i??z.defaults.swipeThreshold,j=s??z.defaults.animated,F=c??z.defaults.duration,_=u??z.defaults.lazyRender,q=b??z.tabList.background,X=parseNumberLike(C??z.indicator.width),$=null!=X&&X<0?void 0:X,G=Math.max(0,parseNumberLike(V)??z.indicator.height),J=N?0:Math.max(0,parseNumberLike(F)??z.defaults.duration),K=Math.max(0,parseNumberLike(W)??z.defaults.swipeThreshold),Q=f?isObject(f)?{autoHeight:f.autoHeight??!0,preventScroll:f.preventScroll??!0}:{autoHeight:!0,preventScroll:!0}:void 0,U=!!Q,Y=useMemo(()=>{const e=[];let t=0;const n=a=>{Children.forEach(a,a=>{if(!isValidElement(a))return;const r=a;if(r.type===React.Fragment)return void n(r.props.children);if(!isTabPaneElement(r,TabPane))return;const l=r.props,o=l.name??t;e.push({...l,key:r.key??o,name:o,index:t}),t+=1})};return n(a),e},[a]),Z=Y[0]?.name,[ee,te]=useControllableValue(e,{defaultValue:Z,valuePropName:"active",defaultValuePropName:"defaultActive",trigger:"onChange"}),ne=null==ee?Z:Y.some(e=>e.name===ee)?ee:Z,ae=useRef(ne);useEffect(()=>{ae.current=ne},[ne]);const re=useMemo(()=>{const e=new Map;return Y.forEach(t=>{e.set(t.name,t.index)}),e},[Y]),le=null==ne?-1:re.get(ne)??-1,oe=useRef(new Set),ie=useRef(new Map),se=useRef(0),ce=useRef(0),ue=useRef(null),de=useRef(new Map),me=useRef(null),fe=useRef(!1),[he,be]=useState(0),[pe,ve]=useState(void 0);useEffect(()=>{null!=ne&&oe.current.add(ne)},[ne]),useEffect(()=>{const e=new Set(Y.map(e=>e.name));Array.from(de.current.keys()).forEach(t=>{e.has(t)||de.current.delete(t)}),Array.from(ie.current.keys()).forEach(t=>{e.has(t)||ie.current.delete(t)})},[Y]);const ge=U&&Q?.autoHeight;useEffect(()=>{ge||de.current.clear()},[ge]),useEffect(()=>{if(!U||!Q?.autoHeight)return void ve(void 0);const e=null!=ne?de.current.get(ne):void 0;ve(e?e.height:void 0)},[ne,U,Q?.autoHeight]),useEffect(()=>()=>{cancelTabsFrame(ue.current),ue.current=null},[]);const ye=isBoolean(m)?m:Y.length>K||!1===D,Se=h??z.colors.indicator,Re=G?G/2:z.indicator.radius,{indicatorX:we,indicatorWidth:Ee,indicatorInitializedRef:Te,animateIndicator:ke}=useTabsAnimation({type:A,animated:j,scrollable:ye,align:O,panes:Y,nameIndexMap:re,resolvedLineWidth:$,resolvedDuration:J,currentName:ne,layoutMap:ie,navContainerWidthRef:se}),{navScrollRef:Ce,scrollIntoView:Ve,handleNavScrollBeginDrag:xe,handleNavScroll:He}=useTabsScroll({scrollable:ye,animated:j,currentName:ne,resolvedDuration:J,layoutMap:ie,navContainerWidthRef:se,navContentWidthRef:ce}),Pe=useCallback((e,t)=>{const{x:n,width:a}=t.nativeEvent.layout;if(ie.current.set(e,{x:n,width:a}),e===ae.current){const t=Te.current;ke(e,!t)&&!Te.current&&(Te.current=!0)}},[ke,Te]),Ie=useCallback(e=>{const{width:t}=e.nativeEvent.layout;if(se.current=t,!ye&&"start"!==O&&"line"===A&&null!=ne){const e=Te.current;ke(ne,!e)&&!Te.current&&(Te.current=!0)}},[O,ke,ne,ye,A,Te]),Me=useCallback(e=>{const t=e.nativeEvent.layout.width;be(e=>e===t?e:t)},[]),Be=useRef(P);Be.current=P;const Le=useCallback(e=>{if(!Be.current)return Promise.resolve(!0);try{return Promise.resolve(Be.current(e)).then(e=>!1!==e).catch(()=>!1)}catch{return Promise.resolve(!1)}},[]),ze=useRef(0),Ne=useCallback((e,t)=>{ze.current+=1;const n=ze.current;Le(e).then(a=>{a&&ze.current===n&&te(e,t)})},[Le,te]),Ae=useCallback((e,t)=>{if(U&&Q?.autoHeight){const{height:n}=t.nativeEvent.layout;de.current.set(e,{height:n}),e===ne&&ve(n)}},[ne,U,Q?.autoHeight]),Oe=useRef(null);useEffect(()=>{Oe.current=null},[ne]);const De=useCallback(e=>{if(!U||he<=0)return;const t=Math.round(e/he);if(Oe.current===t)return;Oe.current=t;const n=Y[t];n&&n.name!==ae.current&&(fe.current=!0,Ne(n.name,n.index))},[he,U,Y,Ne]),We=useCallback(e=>{De(e.nativeEvent.contentOffset.x)},[De]),je=useCallback(e=>{De(e.nativeEvent.contentOffset.x)},[De]);useEffect(()=>{if(!U||!me.current||he<=0)return;if(fe.current)return void(fe.current=!1);if(le<0)return;const e=me.current?.getNode?.()??me.current;e?.scrollTo&&e.scrollTo({x:he*le,y:0,animated:!0})},[le,he,U]);const Fe=useRef(I);Fe.current=I;const _e=useCallback((e,t,n)=>{const a={name:e.name,index:t,disabled:!!e.disabled,event:n};Fe.current?.(a),e.disabled||e.name===ae.current||Ne(e.name,t)},[Ne]),qe=useCallback((e,t)=>{const n=Y.find(t=>t.name===e&&!t.disabled);n&&te(n.name,n.index)},[Y,te]);useImperativeHandle(t,()=>({scrollTo:qe}),[qe]);const Xe=useRef(!0);useEffect(()=>{Xe.current&&(Xe.current=!1,Ve(!0))},[Ve]),useEffect(()=>{Xe.current||Ve()},[ne,Ve]);const $e=p??!1,Ge="line"===A,Je="jumbo"===A?z.jumbo.height:"card"===A?z.card.height:z.tabList.height,Ke="web"===Platform.OS&&"line"!==A&&"card"!==A?z.tabList.paddingBottom:0,Qe=Ge?"line"===A?0:z.indicator.offset:0;if(0===Y.length)return null;const Ue=Ge?React.createElement(Animated.View,{testID:"rv-tabs-indicator",style:[S.ind,{height:G,borderRadius:Re,backgroundColor:Se,width:Ee,bottom:Qe,transform:[{translateX:we}]}]}):null,Ye=useMemo(()=>Y.map(e=>React.createElement(TabBarItem,{key:e.key,pane:e,isActive:e.name===ne,align:O,scrollable:ye,type:A,ellipsis:D,tokens:z,color:h,titleActiveColor:x,titleInactiveColor:H,tabStyle:w,titleStyle:E,descriptionStyle:T,onSelect:_e,onLayout:Pe,isLast:e.index===Y.length-1})),[O,h,ne,T,D,_e,Pe,Y,ye,w,x,H,E,z,A]),Ze=useCallback(e=>{const t=ce.current;ce.current=e,0===t||Xe.current?Ve(!0):Math.abs(e-t)>1&&(cancelTabsFrame(ue.current),ue.current=requestTabsFrame(()=>{ue.current=null,Ve()}))},[Ve]),et=ye?React.createElement(ScrollView,{horizontal:!0,ref:Ce,accessibilityRole:"tablist",showsHorizontalScrollIndicator:!1,scrollEventThrottle:16,onScrollBeginDrag:xe,onScroll:He,onContentSizeChange:Ze,contentContainerStyle:S.navC},Ye,Ue):React.createElement(View,{accessibilityRole:"tablist",style:[S.navC,S.navCSta]},Ye,Ue),tt=React.createElement(View,{style:[S.wrap,{backgroundColor:q},R]},v&&React.createElement(View,{style:{paddingHorizontal:z.spacing.navSidePaddingHorizontal}},v),React.createElement(View,{style:[S.nav,{minHeight:Je+Ke,paddingBottom:Ke},"card"===A?{borderRadius:z.card.radius,marginHorizontal:z.card.marginHorizontal,overflow:"hidden"}:null],onLayout:Ie},et,"card"===A&&React.createElement(View,{style:createHairlineView({position:"all",color:h??z.colors.cardBorder,borderRadius:z.card.radius})})),g&&React.createElement(View,{style:{paddingHorizontal:z.spacing.navSidePaddingHorizontal}},g),$e&&"line"===A&&React.createElement(View,{style:createHairlineView({position:"bottom",color:z.colors.border,left:0,right:0})})),nt=useMemo(()=>Y.map(e=>{const t=e.name===ne,n=!_||t||oe.current.has(e.name);if(!n&&!U)return null;const a=U&&Q?.autoHeight?t=>Ae(e.name,t):void 0,r=[S.pane,U?S.swipePane:null,U&&he>0&&{width:he},U||t?null:S.hidPane],l=n?e.children:d||null;return React.createElement(View,{key:e.key,testID:`rv-tabs-pane-${e.name}`,onLayout:a,style:r},l)}),[he,ne,Ae,U,_,d,Y,Q?.autoHeight]),at=[S.content,k],rt=[S.content,k,Q?.autoHeight&&void 0!==pe&&{height:pe}],lt=U?React.createElement(View,{style:rt},React.createElement(Animated.ScrollView,{ref:me,horizontal:!0,pagingEnabled:!0,scrollEventThrottle:16,showsHorizontalScrollIndicator:!1,onMomentumScrollEnd:We,onScrollEndDrag:je,nestedScrollEnabled:!1===Q?.preventScroll,directionalLockEnabled:!1!==Q?.preventScroll},nt)):React.createElement(View,{style:at},nt);return React.createElement(View,_extends({},L,{style:[S.ctr,B],onLayout:Me}),tt,y&&React.createElement(View,{style:{marginTop:z.spacing.navBottomMarginTop}},y),lt)},S=StyleSheet.create({ctr:{width:"100%"},wrap:{flexDirection:"row",alignItems:"center",position:"relative"},nav:{flex:1,position:"relative",alignSelf:"stretch"},navC:{flexDirection:"row",alignItems:"center",height:"100%",position:"relative"},navCSta:{flex:1},ind:{position:"absolute",bottom:0,left:0},content:{width:"100%"},pane:{width:"100%"},swipePane:{flexShrink:0},hidPane:{display:"none"}}),TabsBaseRef=React.forwardRef(TabsBaseInner),TabsWithPane=Object.assign(React.memo(TabsBaseRef),{TabPane:TabPane});export{TabPane};export default TabsWithPane;
@@ -0,0 +1 @@
1
+ export const DAY_MS=864e5;export const DEFAULT_MIN=new Date((new Date).getFullYear()-10,0,1);export const DEFAULT_MAX=new Date((new Date).getFullYear()+10,11,31);export const isSameDay=(t,e)=>t.getFullYear()===e.getFullYear()&&t.getMonth()===e.getMonth()&&t.getDate()===e.getDate();export const startOfDay=t=>{const e=new Date(t);return e.setHours(0,0,0,0),e};export const daysBetween=(t,e)=>Math.round(Math.abs(startOfDay(t).getTime()-startOfDay(e).getTime())/DAY_MS);export const toArrayValue=t=>t?Array.isArray(t)?t.filter(Boolean).map(t=>new Date(t)):[new Date(t)]:[];export function mapValue(t,e){return"single"===e?t[0]??new Date:("range"===e&&t.length,t)}export function normalizeValue(t,e){return"single"===e?t.slice(0,1):"range"===e?t.slice(0,2).sort((t,e)=>t.getTime()-e.getTime()):t}export function formatMonth(t){return`${t.getFullYear()}/${t.getMonth()+1}`}export function reorderWeekdays(t,e,n){const r=(e%7+7)%7,a=7===t.length?[...t]:n;return[...a.slice(r),...a.slice(0,r)]}export function buildMonth(t,e){const n=(e%7+7)%7,r=(startOfMonth(t).getDay()-n+7)%7,a=new Date(t.getFullYear(),t.getMonth()+1,0).getDate(),o=[];for(let t=0;t<r;t+=1)o.push(null);for(let e=1;e<=a;e+=1)o.push(new Date(t.getFullYear(),t.getMonth(),e));for(;o.length<42;)o.push(null);return o}export function getCalendarDayTestId(t){return`calendar-day-${t.getFullYear()}-${`${t.getMonth()+1}`.padStart(2,"0")}-${`${t.getDate()}`.padStart(2,"0")}`}export function startOfMonth(t){return new Date(t.getFullYear(),t.getMonth(),1)}export function clampMonth(t,e,n){const r=startOfMonth(t),a=startOfMonth(e),o=startOfMonth(n);return r.getTime()<a.getTime()?a:r.getTime()>o.getTime()?n:r}export function isSameMonth(t,e){return t.getFullYear()===e.getFullYear()&&t.getMonth()===e.getMonth()}
@@ -0,0 +1 @@
1
+ export const getFieldKeys=e=>({textKey:e?.text??"text",valueKey:e?.value??"value",childrenKey:e?.children??"children"});export const resolveRows=(e=[],t,l)=>{const n=[];let r=e;return l.forEach(e=>{if(!r?.length)return;const l=r.find(l=>l[t.valueKey]===e);l&&(n.push(l),r=l[t.childrenKey]??[])}),n};
@@ -0,0 +1 @@
1
+ import React from"react";import{ActivityIndicator,Pressable,StyleSheet,View}from"react-native";import{createHairlineView}from"../../utils/hairline";import{renderTextOrNode}from"../../utils";export const ActionButton=e=>{const{text:t,color:o,tokens:i,dividerPosition:n="none",loading:r,disabled:a,onPress:s}=e,c=o??i.colors.confirm,l="none"===n?null:[S.btnDiv,{width:0},createHairlineView({position:n,color:i.colors.divider,top:0,bottom:0,[n]:0})];return React.createElement(Pressable,{accessibilityRole:"button",disabled:a||r,style:({pressed:e})=>[S.btn,{height:i.sizes.actionHeight,opacity:!e||a||r?1:.8}],onPress:a||r?void 0:s},l&&React.createElement(View,{style:l,pointerEvents:"none"}),r?React.createElement(ActivityIndicator,{size:"small",color:c}):renderTextOrNode(t??"",{color:c,fontFamily:i.typography.fontFamily,fontSize:i.typography.actionSize,fontWeight:i.typography.actionWeight}))};const S=StyleSheet.create({btn:{flex:1,alignItems:"center",justifyContent:"center"},btnDiv:{position:"absolute",pointerEvents:"none"}});
@@ -0,0 +1 @@
1
+ function _extends(){return _extends=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var n in o)({}).hasOwnProperty.call(o,n)&&(e[n]=o[n])}return e},_extends.apply(null,arguments)}import React from"react";import{Platform,Pressable,TextInput,View}from"react-native";import{Clear}from"react-native-system-icon";import{isText}from"../../utils/validate";export const alignMap={left:"flex-start",center:"center",right:"flex-end"};export const mapKeyboardType=e=>{switch(e){case"number":return"decimal-pad";case"digit":return"number-pad";case"tel":return"phone-pad";default:return}};export const FieldSlot=({onPress:e,style:t,children:o,accessibilityRole:n="button"})=>o?e?React.createElement(Pressable,{onPress:e,accessibilityRole:n,style:t},o):React.createElement(View,{style:t},o):null;export const FieldClearButton=({show:e,tokens:t,clearIcon:o,onPressIn:n,onPressOut:r,onPress:l})=>{if(!e)return null;const i="web"===Platform.OS?{onMouseDown:e=>{e.preventDefault?.(),e.stopPropagation?.()}}:void 0;return React.createElement(Pressable,_extends({style:[t.layout.clearIcon,{paddingHorizontal:t.spacing.rightIconGap}]},i,{onPressIn:n,onPressOut:r,onPress:l,accessibilityRole:"button"}),React.isValidElement(o)?o:React.createElement(Clear,{size:t.sizes.clearIcon,fill:t.colors.clear,color:t.colors.clear}))};export const FieldInput=({inputRef:e,tokens:t,isTextarea:o,disabled:n,error:r,finalTextAlign:l,lineHeight:i,textareaHeight:s,minHeight:a,inputStyle:c,value:u,onChangeText:d,onFocus:p,onBlur:y,onPressIn:g,rows:m,placeholderTextColor:x,keyboardType:f,onContentSizeChange:h,describedBy:b,secureTextEntry:P,editable:T,restInputProps:R})=>{const v=[o?t.layout.textarea:t.layout.input,{color:n?t.colors.disabled:r?t.colors.error:t.colors.input,fontSize:t.typography.inputSize,textAlign:l,...o?{lineHeight:i,height:s,minHeight:a}:{minHeight:t.sizes.controlMinHeight}},c];return React.createElement(TextInput,_extends({ref:e,style:v,value:u,onChangeText:d,onFocus:p,onBlur:y,onPressIn:g,editable:T,secureTextEntry:P,multiline:o,numberOfLines:o?m:void 0,keyboardType:f,placeholderTextColor:x,onContentSizeChange:o?h:void 0},b?{accessibilityDescribedBy:b}:null,{clearButtonMode:"never"},R))};export const FieldControlRow=({tokens:e,prefixNode:t,leftIconNode:o,controlNode:n,clearNode:r,rightIconNode:l,suffixNode:i})=>React.createElement(View,{style:e.layout.body},t,o,React.createElement(View,{style:[e.layout.controlWrapper,{minHeight:e.sizes.controlMinHeight}]},n,r),l,i);export const resolveTooltipDialog=(e,t)=>{if(!React.isValidElement(e)&&!isText(e)){const{icon:o,...n}=e;return{icon:o??t,dialogProps:n}}return{icon:t,dialogProps:{message:e}}};
@@ -0,0 +1 @@
1
+ import{isPromiseLike}from"../../utils/promise";import{isNumber,isString}from"../../utils/validate";export const normalizeTrigger=r=>r?Array.isArray(r)?r:[r]:[];export const toNamePath=r=>null==r?[]:Array.isArray(r)?r:isNumber(r)?[r]:isString(r)?r.split("."):[String(r)];export const serializeNamePath=r=>toNamePath(r).join(".");export const getValueByName=(r,i)=>toNamePath(i).reduce((r,i)=>{if(null==r)return r;const t=String(i);if(Array.isArray(r)){const i=Number(t);return Number.isFinite(i)?r[i]:r[t]}return"object"==typeof r?r[t]:void 0},r);export const setValueByName=(r,i,t)=>{const e=toNamePath(i);if(!e.length)return r;const n=Array.isArray(r)?[...r]:"object"==typeof r&&null!==r?{...r}:{};let a=n;return e.forEach((r,i)=>{const n=String(r),o=Number(n);if(i===e.length-1)return void(Array.isArray(a)&&Number.isFinite(o)?a[o]=t:a[n]=t);const s=Array.isArray(a)&&Number.isFinite(o)?a[o]:a[n],u=null==s?isNumber(e[i+1])?[]:{}:Array.isArray(s)?[...s]:"object"==typeof s?{...s}:{};Array.isArray(a)&&Number.isFinite(o)?a[o]=u:a[n]=u,a=u}),n};export const runRuleValidation=(r,i,t,e)=>{const n=r.message??e??"Validation failed",a=null==i||""===i||Array.isArray(i)&&0===i.length;if(r.required&&(a||r.whitespace&&isString(i)&&0===i.trim().length))return n;if(a)return null;if(r.pattern&&isString(i)&&!r.pattern.test(i))return n;if(void 0!==r.len||void 0!==r.min||void 0!==r.max){const t=isNumber(i)?i:isString(i)||Array.isArray(i)?i.length:0;if(void 0!==r.len&&t!==r.len)return n;if(void 0!==r.min&&t<r.min)return n;if(void 0!==r.max&&t>r.max)return n}if(!r.validator)return null;const o=r=>isString(r)?r:!1===r?n:null,s=r.validator(i,t);return isPromiseLike(s)?s.then(o):o(s)};
@@ -0,0 +1 @@
1
+ export const NUM_KEYS=["1","2","3","4","5","6","7","8","9"];export const ZERO="0";export const RE_NUM_LIKE=/^\d+$|^\.$|^x$/i;export const shuffle=t=>{const e=[...t];for(let t=e.length-1;t>0;t--){const r=Math.floor(Math.random()*(t+1));[e[t],e[r]]=[e[r],e[t]]}return e};export const buildKeyboardKeys=({randomKeyOrder:t,visible:e,isCustom:r,extraKey:o,showDeleteKey:s})=>{const x=(t&&e?shuffle(NUM_KEYS):NUM_KEYS).map(t=>({text:t,type:""}));if(r){const t=Array.isArray(o)?o:o?[o]:[];return 1===t.length?x.push({text:"0",type:"",wider:!0},{text:t[0],type:"extra"}):t.length>=2?x.push({text:t[0],type:"extra"},{text:"0",type:""},{text:t[1],type:"extra"}):x.push({text:"0",type:""}),x}const p=Array.isArray(o)?o[0]??"":o??"";return x.push({text:p,type:"extra"},{text:"0",type:""},{type:s?"delete":"",text:s?void 0:""}),x};
@@ -0,0 +1 @@
1
+ import{isObject}from"../../utils";export const toArrayValue=e=>Array.isArray(e)?e.filter(e=>null!=e):null==e?[]:[e];const isColumnWithOptions=e=>!!e&&isObject(e)&&"options"in e&&Array.isArray(e.options),hasChildren=e=>!!e&&isObject(e)&&Array.isArray(e.children)&&e.children.length>0;export const findEnabledIndex=(e,n)=>{if(!e.length)return-1;const t=Math.min(Math.max(n,0),e.length-1);if(!e[t]?.disabled)return t;for(let n=t+1;n<e.length;n+=1)if(!e[n]?.disabled)return n;for(let n=t-1;n>=0;n-=1)if(!e[n]?.disabled)return n;return-1};const normalizeMultiple=(e,n,t)=>{const r=[],s=[];return e.forEach((e,i)=>{const a=t[i],o=void 0!==n[i]?e.findIndex(e=>e.value===n[i]):-1,l=e.findIndex(e=>e.value===a),u=findEnabledIndex(e,l>=0?l:o>=0?o:0),d=u>=0?e[u]:void 0,c=l>=0&&!e[l]?.disabled;r[i]=c?a:d?.value??n[i]??e[0]?.value,s[i]=d}),{columns:e,values:r,options:s}},normalizeCascade=(e,n)=>{const t=[],r=[],s=[];let i=e,a=0;const o=new Set;for(;i&&i.length&&!o.has(i);){o.add(i),t.push(i);const e=n[a],l=i.findIndex(n=>n.value===e||String(n.value)===String(e)),u=findEnabledIndex(i,l>=0?l:0),d=u>=0?i[u]:i[0];if(r[a]=d?.value,s[a]=d,!d||!hasChildren(d))break;i=d.children,a+=1}return{columns:t,values:r,options:s}};export const prepareColumns=(e=[])=>{if(!Array.isArray(e)||0===e.length)return{type:"single",columnsList:[],defaults:[],cascadeRoot:[]};const n=e.every(e=>!Array.isArray(e)&&!isColumnWithOptions(e)),t=n&&e.some(e=>hasChildren(e));if(t)return{type:"cascade",columnsList:[],defaults:[],cascadeRoot:e};const r=e,s=[],i=[];return n&&!t?(s.push(e),i.push(void 0)):r.forEach(e=>{if(Array.isArray(e))s.push(e),i.push(void 0);else if(isColumnWithOptions(e)){const n=e;s.push(n.options??[]),i.push(n.defaultValue)}}),{type:"multiple",columnsList:s,defaults:i}};export const normalizePicker=(e,n=[])=>{const t=Array.isArray(n)?n:[];return"cascade"===e.type&&e.cascadeRoot?.length?normalizeCascade(e.cascadeRoot,t):normalizeMultiple(e.columnsList,e.defaults,t)};
@@ -0,0 +1 @@
1
+ import React,{useCallback,useEffect,useMemo,useRef,useState}from"react";import{Platform,View}from"react-native";import{withAlpha}from"../../utils/color";import{isFiniteNumber}from"../../utils/validate";import{shallowEqualArray}from"../../utils";import{normalizePicker,prepareColumns,toArrayValue}from"./normalize";const GRADIENT_OVERLAY_ALPHA=.25,GRADIENT_STEPS=[.95,.75,.55,.35],GRADIENT_STEPS_REVERSED=[.35,.55,.75,.95];export function usePickerValue({columns:e,valueProp:t,defaultValue:r,emitConfirmOnAutoSelect:o=!0,onChange:a,onConfirm:n}){const l=useMemo(()=>prepareColumns(e),[e]),u=void 0!==t,s=useRef(a),i=useRef(n);s.current=a,i.current=n;const[c,m]=useState(()=>normalizePicker(l,toArrayValue(t??r)).values),p=useRef(c);p.current=c;const E=useCallback(e=>{p.current=e,m(e)},[]);useEffect(()=>{if(!u)return;const e=toArrayValue(t);shallowEqualArray(p.current,e)||E(e)},[E,u,t]);const f=useMemo(()=>normalizePicker(l,c),[l,c]);useEffect(()=>{u||shallowEqualArray(c,f.values)||(E(f.values),s.current?.(f.values,f.options),o&&i.current?.(f.values,f.options))},[E,o,c,u,f]);const h=useCallback((e,t)=>{const r=[...p.current];r[t]=e.value,"cascade"===l.type&&(r.length=t+1);const o=normalizePicker(l,r);shallowEqualArray(p.current,o.values)||(E(o.values),s.current?.(o.values,o.options))},[E,l]),A=useCallback(()=>{i.current?.(f.values,f.options)},[f]);return{preparedColumns:l,normalized:f,handleSelect:h,handleConfirm:A}}export const getVisibleCount=e=>{const t=isFiniteNumber(e)?Math.max(3,Math.floor(e)):5;return t%2==0?t+1:t};export const GradientMask=({height:e,color:t,position:r,maskType:o})=>{const a=[{position:"absolute",left:0,right:0,zIndex:2},{height:e},"top"===r?{top:0}:{bottom:0}],n=withAlpha(t,.25);if("solid"===o)return React.createElement(View,{pointerEvents:"none",style:[...a,{backgroundColor:withAlpha(t,.9)}]});if("web"===Platform.OS){const e="top"===r?"180deg":"0deg";return React.createElement(View,{pointerEvents:"none",style:[...a,{backgroundColor:n,backgroundImage:`linear-gradient(${e}, ${withAlpha(t,.98)}, ${withAlpha(t,.4)})`}]})}return React.createElement(View,{pointerEvents:"none",style:[...a,{backgroundColor:n}]},("top"===r?GRADIENT_STEPS:GRADIENT_STEPS_REVERSED).map((e,r)=>React.createElement(View,{key:r,style:{flex:1,backgroundColor:withAlpha(t,e)}})))};
@@ -0,0 +1 @@
1
+ import{Easing}from"react-native";export const EASE_OUT=Easing.bezier(.075,.82,.165,1);export const EASE_IN=Easing.bezier(.55,.055,.675,.19);export const CAPTURE=()=>!0;export const hiddenStyle={opacity:0,shadowOpacity:0,shadowRadius:0,elevation:0};export const placementConfig={top:{container:{justifyContent:"flex-start",alignItems:"center"},axis:"y"},bottom:{container:{justifyContent:"flex-end",alignItems:"center"},axis:"y"},left:{container:{justifyContent:"center",alignItems:"flex-start"},axis:"x"},right:{container:{justifyContent:"center",alignItems:"flex-end"},axis:"x"},center:{container:{justifyContent:"center",alignItems:"center"},axis:"y"}};export const CONTENT_SELF={top:{alignSelf:"stretch"},bottom:{alignSelf:"stretch"},left:{alignSelf:"flex-start"},right:{alignSelf:"flex-end"},center:{alignSelf:"center"}};export const buildRadius=(t,e,o)=>t?"top"===e?{borderBottomLeftRadius:o,borderBottomRightRadius:o}:"bottom"===e?{borderTopLeftRadius:o,borderTopRightRadius:o}:"left"===e?{borderTopRightRadius:o,borderBottomRightRadius:o}:"right"===e?{borderTopLeftRadius:o,borderBottomLeftRadius:o}:{borderRadius:o}:void 0;
@@ -0,0 +1 @@
1
+ import{useCallback,useEffect,useRef,useState}from"react";import{Platform}from"react-native";import{clamp}from"../../utils";import{isFiniteNumber,isFunction}from"../../utils/validate";export const START_KEYS=["onResponderGrant","onPanResponderGrant"];export const MOVE_KEYS=["onResponderMove","onPanResponderMove"];export const END_KEYS=["onResponderRelease","onResponderTerminate","onPanResponderRelease","onPanResponderTerminate"];const isSameLayout=(e,t)=>e.width===t.width&&e.height===t.height&&e.x===t.x&&e.y===t.y;export const normalizeValue=(e,t,n,r)=>t?(()=>{const t=Array.isArray(e)?e:isFiniteNumber(e)?[n,e]:[n,n],i=isFiniteNumber(t[0])?clamp(t[0],n,r):n,a=isFiniteNumber(t[1]??t[0])?clamp(t[1]??t[0],n,r):n;return i<=a?[i,a]:[a,i]})():(()=>{const t=Array.isArray(e)?e[0]:e;return[isFiniteNumber(t)?clamp(t,n,r):n]})();export const toSliderValue=(e,t,n)=>t?[e[0]??n,e[1]??e[0]??n]:e[0]??n;export const createAccessibilityProps=e=>e?(()=>{const{role:t,"aria-value":n,accessibilityActions:r,onAccessibilityAction:i,disabled:a}=e;return{accessible:!0,accessibilityRole:t??"adjustable",accessibilityValue:n,accessibilityActions:r,onAccessibilityAction:i,accessibilityState:{disabled:a}}})():{};export const defaultNumberFormatter="undefined"!=typeof Intl&&isFunction(Intl.NumberFormat)?new Intl.NumberFormat:{format:e=>String(e)};export const mapSliderTouchDirection=e=>e.vertical?e.reverse:e.reverse||!1;export const useTrackLayout=()=>{const e=useRef(null),t=useRef(null),[n,r]=useState({width:0,height:0,x:0,y:0}),i=useCallback(n=>{const{layout:i}=n.nativeEvent,a={width:Math.max(i.width,1),height:Math.max(i.height,1),x:i.x??0,y:i.y??0};r(e=>isSameLayout(e,a)?e:a),"web"===Platform.OS&&"undefined"!=typeof requestAnimationFrame&&null==t.current&&(t.current=requestAnimationFrame(()=>{t.current=null;const n=e.current;n?.measureInWindow&&n.measureInWindow((e,t,n,i)=>{const a={width:Math.max(n,1),height:Math.max(i,1),x:e,y:t};r(e=>isSameLayout(e,a)?e:a)})}))},[]);return useEffect(()=>()=>{null!=t.current&&"function"==typeof cancelAnimationFrame&&cancelAnimationFrame(t.current),t.current=null},[]),{trackRef:e,trackLayout:n,handleTrackLayout:i}};
@@ -0,0 +1 @@
1
+ export const LOOP_THRESHOLD=10;export const createWebMouseHandlers=({enabled:e,vertical:n,mainSize:t,clearAuto:r,next:a,prev:o,schedule:u,dragRef:i,interRef:v})=>{if(e)return{onPointerDown:e=>{"mouse"===e.nativeEvent.pointerType&&0===e.nativeEvent.button&&(i.current=n?e.nativeEvent.pageY:e.nativeEvent.pageX,v.current=!0,r())},onPointerUp:e=>{const r=i.current;if(i.current=null,null==r||"mouse"!==e.nativeEvent.pointerType)return;const c=(n?e.nativeEvent.pageY:e.nativeEvent.pageX)-r;Math.abs(c)>=.15*t&&(c<0?a():o()),v.current=!1,u()},onPointerLeave:()=>{null!=i.current&&(i.current=null,v.current=!1,u())}}};
@@ -0,0 +1 @@
1
+ function _extends(){return _extends=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var a in i)({}).hasOwnProperty.call(i,a)&&(e[a]=i[a])}return e},_extends.apply(null,arguments)}import React,{memo,useCallback}from"react";import{Pressable,Text,View}from"react-native";import{useAriaPress}from"../../hooks";import{createHairlineView}from"../../utils/hairline";import{isFunction,isRenderable,isText}from"../../utils/validate";export const isTabPaneElement=(e,t)=>!!React.isValidElement(e)&&(e.type===t||"Tabs.TabPane"===e.type.displayName);const S={lblW:{justifyContent:"center",alignItems:"center",flexDirection:"column"},lblWJ:{alignItems:"center"},cardLbl:{flexDirection:"row",justifyContent:"center",alignItems:"center"},tabI:{flexShrink:0,height:"100%",alignSelf:"stretch",alignItems:"center",justifyContent:"center",flexDirection:"row"},flexI:{flexGrow:1},title:{includeFontPadding:!1},descTxt:{includeFontPadding:!1},ellipsis:{maxWidth:"100%",flexShrink:1}},TabBarItemInner=({pane:e,isActive:t,align:i,scrollable:a,type:o,ellipsis:r,tokens:n,color:l,titleActiveColor:c,titleInactiveColor:s,tabStyle:d,titleStyle:p,descriptionStyle:g,onSelect:m,onLayout:b,isLast:u})=>{const y=!!e.disabled,x=useAriaPress({onPress:t=>m(e,e.index,t),extraProps:{accessibilityRole:"tab",accessibilityState:{selected:t,disabled:y},testID:`rv-tabs-item-${e.name}`}}),f="capsule"===o,h="jumbo"===o,T="card"===o,v=isFunction(e.title)?e.title(t):e.title??e.name,j=isFunction(e.description)?e.description(t):e.description,R=c??(T?n.colors.cardActiveText:f?n.colors.capsuleActiveText:l??n.colors.textActive),V=s??(T?l??n.colors.cardBorder:f?n.colors.capsuleText:n.colors.text),I=e.disabled?n.colors.textDisabled:t?R:V,z=y?n.colors.textDisabled:h?t?n.colors.jumboDescriptionActive:n.colors.jumboDescription:t?n.colors.descriptionActive:n.colors.description,k=!a&&("start"!==i||T),A=T||h||f,H=A?0:n.tabList.paddingHorizontal,P=A?0:n.tabList.paddingVertical,w=[S.lblW,h&&S.lblWJ,T&&S.cardLbl,T&&{paddingHorizontal:n.card.paddingHorizontal,paddingVertical:n.card.paddingVertical},f&&{flex:1,alignSelf:"stretch",paddingHorizontal:n.capsule.paddingHorizontal,paddingVertical:n.capsule.paddingVertical},h&&{paddingHorizontal:n.jumbo.paddingHorizontal,paddingVertical:n.jumbo.paddingVertical,alignItems:"center"}].filter(Boolean),B=f?[{flex:1,alignSelf:"stretch",justifyContent:"center",alignItems:"center",borderRadius:n.capsule.radius,backgroundColor:t?l??n.colors.capsuleActiveBackground:n.colors.capsuleBackground}]:null,E=[S.title,{color:I,fontFamily:n.typography.fontFamily,fontSize:h?n.typography.jumboTitleSize:n.typography.titleSize,fontWeight:t?n.typography.titleActiveWeight:n.typography.titleWeight,lineHeight:h?n.typography.jumboLineHeight:void 0,textAlign:"center"},r&&!h?S.ellipsis:null,p],C=h?n.spacing.jumboDescriptionMarginTop:n.spacing.descriptionMarginTop,D=h?{backgroundColor:t?n.colors.jumboDescriptionActiveBackground:n.colors.jumboDescriptionBackground,paddingHorizontal:n.jumbo.descriptionPaddingHorizontal,paddingVertical:n.jumbo.descriptionPaddingVertical,borderRadius:n.jumbo.descriptionRadius}:null,F=useCallback(t=>b(e.name,t),[b,e.name]);return React.createElement(Pressable,_extends({},x.interactionProps,{onLayout:F,style:[S.tabI,k?S.flexI:null,{paddingHorizontal:H,paddingVertical:P},T?{backgroundColor:t?l??n.colors.cardActiveBackground:n.colors.cardBackground}:null,d]}),React.createElement(View,{style:w},B?React.createElement(View,{style:B},React.createElement(Text,{style:E,numberOfLines:r&&!h?1:void 0},v)):React.createElement(Text,{style:E,numberOfLines:r&&!h?1:void 0},v),isRenderable(j)&&(isText(j)?React.createElement(Text,{style:[S.descTxt,{color:z,fontFamily:n.typography.fontFamily,fontSize:n.typography.descriptionSize,marginTop:C,textAlign:"center"},D,g]},j):React.createElement(View,{style:[{marginTop:C,alignItems:"center"},D]},j)),isRenderable(e.badge)&&React.createElement(View,{style:{marginTop:n.spacing.badgeMarginTop}},isText(e.badge)?React.createElement(Text,{style:{color:n.colors.badgeText,fontFamily:n.typography.fontFamily,fontSize:n.typography.badgeTextSize}},e.badge):e.badge)),T&&!u&&React.createElement(View,{style:createHairlineView({position:"right",color:l??n.colors.cardBorder,top:0,bottom:0})}))};export const TabBarItem=memo(TabBarItemInner);
@@ -0,0 +1 @@
1
+ import{useCallback,useEffect,useRef}from"react";import{Animated}from"react-native";const hasRaf="function"==typeof requestAnimationFrame&&"function"==typeof cancelAnimationFrame;export const requestTabsFrame=hasRaf?requestAnimationFrame:e=>setTimeout(e,16);export const cancelTabsFrame=e=>{null!=e&&(hasRaf?cancelAnimationFrame:clearTimeout)(e)};export const useTabsAnimation=({type:e,animated:t,scrollable:n,align:r,panes:a,nameIndexMap:u,resolvedLineWidth:c,resolvedDuration:l,currentName:i,layoutMap:s,navContainerWidthRef:o})=>{const f=useRef(new Animated.Value(0)).current,m=useRef(new Animated.Value(0)).current,d=useRef(!1),h=useRef(null),v=useCallback((i,d)=>{if(null==i||"line"!==e)return!1;const v=!n&&"start"!==r&&o.current>0&&a.length>0,R=u.get(i)??-1,p=v?o.current/a.length:0,b=v?{x:Math.max(R,0)*p,width:p}:s.current.get(i);if(!b||R<0)return!1;h.current?.stop();const x=(e,n)=>Animated.timing(e,{toValue:n,duration:d||!t?0:l,useNativeDriver:!1,isInteraction:!1}),A=c??b.width,g=c?b.x+(b.width-A)/2:b.x,T=Animated.parallel([x(f,g),x(m,A)]);return h.current=T,T.start(({finished:e})=>{e&&(h.current=null)}),!0},[r,t,m,f,u,a.length,l,c,n,e,s,o]);return useEffect(()=>{if(null==i)return;const e=d.current;v(i,!e)&&!d.current&&(d.current=!0)},[v,i]),useEffect(()=>()=>{h.current?.stop(),h.current=null},[]),{indicatorX:f,indicatorWidth:m,indicatorInitializedRef:d,animateIndicator:v}};export const useTabsScroll=({scrollable:e,animated:t,currentName:n,resolvedDuration:r,layoutMap:a,navContainerWidthRef:u,navContentWidthRef:c})=>{const l=useRef(null),i=useRef(new Animated.Value(0)).current,s=useRef(null),o=useRef(!1),f=useRef(0),m=useRef(null),d=useCallback(l=>{if(!e||null==n)return;const d=a.current.get(n),h=u.current;if(!d||!h)return;const v=c.current,R=d.x-(h-d.width)/2,p=Math.max(v-h,0),b=Math.max(0,Math.min(R,p));if(!(p<=0||Math.abs(b-f.current)<1)){if(s.current?.stop(),s.current=null,cancelTabsFrame(m.current),m.current=null,l||!t)return o.current=!0,i.setValue(b),void(m.current=requestTabsFrame(()=>{m.current=null,o.current=!1}));i.setValue(f.current),o.current=!0,s.current=Animated.timing(i,{toValue:b,duration:r,useNativeDriver:!1,isInteraction:!1}),s.current.start(({finished:e})=>{s.current=null,o.current=!1,e&&(f.current=b)})}},[t,n,i,r,e,a,u,c]);useEffect(()=>{if(!e)return;const t=i.addListener(({value:e})=>{const t=f.current;f.current=e,Math.abs(e-t)>=.5&&l.current?.scrollTo({x:e,y:0,animated:!1})});return()=>i.removeListener(t)},[i,e]),useEffect(()=>()=>{cancelTabsFrame(m.current),m.current=null},[]);const h=useCallback(e=>{o.current=!1,s.current?.stop(),s.current=null,f.current=e.nativeEvent.contentOffset.x},[]),v=useCallback(e=>{o.current||(f.current=e.nativeEvent.contentOffset.x)},[]);return{navScrollRef:l,scrollIntoView:d,handleNavScrollBeginDrag:h,handleNavScroll:v}};
@@ -1 +1 @@
1
- export const shallowEqualArray=(t=[],r=[])=>{if(t.length!==r.length)return!1;for(let e=0;e<t.length;e++)if(t[e]!==r[e])return!1;return!0};export const shallowEqualObject=(t,r)=>{if(t===r)return!0;if(!t||!r)return!1;const e=Object.keys(t);if(e.length!==Object.keys(r).length)return!1;for(const n of e)if(t[n]!==r[n])return!1;return!0};
1
+ export const shallowEqualArray=(e=[],t=[])=>{if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0};export const shallowEqualObject=(e,t)=>{if(e===t)return!0;if(!e||!t)return!1;const r=Object.keys(e);if(r.length!==Object.keys(t).length)return!1;for(const n of r)if(e[n]!==t[n])return!1;return!0};const isPlainObject=e=>"[object Object]"===Object.prototype.toString.call(e);export const deepEqualObject=(e,t)=>{if(e===t)return!0;if(null==e||null==t)return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(!deepEqualObject(e[r],t[r]))return!1;return!0}if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();if(!isPlainObject(e)||!isPlainObject(t))return!1;const r=Object.keys(e);if(r.length!==Object.keys(t).length)return!1;for(const n of r)if(!deepEqualObject(e[n],t[n]))return!1;return!0};
@@ -1 +1 @@
1
- import React from'react';import type{FormInstance,FormProps,FormSubscribeProps,NamePath,RegisteredFieldOptions}from'./types';export declare const normalizeTrigger:(trigger?:string|string[])=>string[];export declare const FORM_ALL_FIELDS_KEY="__form_all__";export declare const toNamePath:(name?:NamePath)=>(string|number)[];export declare const serializeNamePath:(name?:NamePath)=>string;export declare const getValueByName:(source:unknown,name:NamePath)=>unknown;export declare const setValueByName:(source:Record<string,unknown>,name:NamePath,value:unknown)=>Record<string,unknown>;export interface FormContextValue{getFieldValue:(name:NamePath)=>unknown;setFieldValue:(name:NamePath,value:unknown,trigger?:string)=>void;registerField:(name:NamePath,options:RegisteredFieldOptions)=>()=>void;getFieldError:(name:NamePath)=>string[]|undefined;validateField:(name:NamePath,trigger?:string)=>Promise<boolean>;getFieldsValue:()=>Record<string,unknown>;subscribe:(listener:(changedValues:Record<string,unknown>,allValues:Record<string,unknown>)=>void)=>()=>void;form?:FormInstance;colon?:boolean;labelWidth?:number;showValidateMessage?:boolean;}export declare const FormContext:React.Context<FormContextValue|null>;declare const InternalForm:React.NamedExoticComponent<FormProps&React.RefAttributes<FormInstance>>;export declare const useWatch:(name?:NamePath|NamePath[],formRef?:React.MutableRefObject<FormInstance|null>)=>unknown;export declare const FormSubscribe:React.FC<FormSubscribeProps>;export default InternalForm;
1
+ import React from'react';import type{FormInstance,FormProps,FormSubscribeProps,NamePath,RegisteredFieldOptions}from'./types';export{getValueByName,normalizeTrigger,serializeNamePath,setValueByName,toNamePath}from'../../hooks/form/utils';export declare const FORM_ALL_FIELDS_KEY="__form_all__";export interface FormContextValue{getFieldValue:(name:NamePath)=>unknown;setFieldValue:(name:NamePath,value:unknown,trigger?:string)=>void;registerField:(name:NamePath,options:RegisteredFieldOptions)=>()=>void;getFieldError:(name:NamePath)=>string[]|undefined;validateField:(name:NamePath,trigger?:string)=>Promise<boolean>;getFieldsValue:()=>Record<string,unknown>;subscribe:(listener:(changedValues:Record<string,unknown>,allValues:Record<string,unknown>)=>void)=>()=>void;form?:FormInstance;colon?:boolean;labelWidth?:number;showValidateMessage?:boolean;}export declare const FormContext:React.Context<FormContextValue|null>;declare const InternalForm:React.NamedExoticComponent<FormProps&React.RefAttributes<FormInstance>>;export declare const useWatch:(name?:NamePath|NamePath[],formRef?:React.MutableRefObject<FormInstance|null>)=>unknown;export declare const FormSubscribe:React.FC<FormSubscribeProps>;export default InternalForm;
@@ -1 +1 @@
1
- import React from'react';import type{PickerColumns,PickerOption,PickerProps,PickerValue}from'./types';export interface NormalizedPickerResult{columns:PickerOption[][];values:PickerValue[];options:(PickerOption|undefined)[];}export interface PreparedPickerColumns{type:'single'|'multiple'|'cascade';columnsList:PickerOption[][];defaults:(PickerValue|undefined)[];cascadeRoot?:PickerOption[];}export declare const toArrayValue:(value?:PickerValue[]|PickerValue|null)=>PickerValue[];export declare const findEnabledIndex:(options:PickerOption[],startIdx:number)=>number;export declare const prepareColumns:(input?:PickerColumns)=>PreparedPickerColumns;export declare const normalizePicker:(prep:PreparedPickerColumns,raw?:PickerValue[])=>NormalizedPickerResult;export declare function usePickerValue({columns,valueProp,defaultValue,emitConfirmOnAutoSelect,onChange,onConfirm}:{columns?:PickerColumns;valueProp?:PickerProps['value'];defaultValue?:PickerProps['defaultValue'];emitConfirmOnAutoSelect?:boolean;onChange?:PickerProps['onChange'];onConfirm?:PickerProps['onConfirm'];}):{preparedColumns:PreparedPickerColumns;normalized:NormalizedPickerResult;handleSelect:(option:PickerOption,colIdx:number)=>void;handleConfirm:()=>void;};declare const Picker:React.NamedExoticComponent<PickerProps>;export default Picker;
1
+ import React from'react';import type{PickerProps}from'./types';export type{NormalizedPickerResult,PreparedPickerColumns}from'../../hooks/picker/normalize';export{toArrayValue,findEnabledIndex,prepareColumns,normalizePicker}from'../../hooks/picker/normalize';export{usePickerValue}from'../../hooks/picker/value';declare const Picker:React.NamedExoticComponent<PickerProps>;export default Picker;
@@ -0,0 +1 @@
1
+ import type React from'react';import type{CalendarType}from'../../components/calendar/types';export declare const DAY_MS:number;export declare const DEFAULT_MIN:Date;export declare const DEFAULT_MAX:Date;export declare const isSameDay:(a:Date,b:Date)=>boolean;export declare const startOfDay:(date:Date)=>Date;export declare const daysBetween:(a:Date,b:Date)=>number;export declare const toArrayValue:(value?:Date|Date[]|null)=>Date[];export declare function mapValue(value:Date[],type:CalendarType):Date|Date[];export declare function normalizeValue(value:Date[],type:CalendarType):Date[];export declare function formatMonth(date:Date):string;export declare function reorderWeekdays(labels:React.ReactNode[],start:number,fallback:React.ReactNode[]):React.ReactNode[];export declare function buildMonth(month:Date,weekStartsOn:number):(Date|null)[];export declare function getCalendarDayTestId(date:Date):string;export declare function startOfMonth(date:Date):Date;export declare function clampMonth(date:Date,min:Date,max:Date):Date;export declare function isSameMonth(a:Date,b:Date):boolean;
@@ -0,0 +1 @@
1
+ import type{CascaderFieldNames,CascaderOption,CascaderValue}from'../../components/cascader/types';export type FieldKeys={textKey:string;valueKey:string;childrenKey:string;};export declare const getFieldKeys:(fn?:CascaderFieldNames)=>{textKey:string;valueKey:string;childrenKey:string;};export declare const resolveRows:(opts:CascaderOption[]|undefined,k:FieldKeys,vals:CascaderValue[])=>CascaderOption[];
@@ -0,0 +1 @@
1
+ import React from'react';import type{DialogTokens}from'../../components/dialog/tokens';interface ActionButtonProps{text:React.ReactNode;color?:string;tokens:DialogTokens;dividerPosition?:'left'|'right'|'none';loading?:boolean;disabled?:boolean;onPress?:()=>void;}export declare const ActionButton:(props:ActionButtonProps)=>React.JSX.Element;export{};
@@ -0,0 +1 @@
1
+ import React from'react';import{Pressable,TextInput,View}from'react-native';import type{TextInputProps}from'react-native';import type{FieldProps,FieldTooltipProps}from'../../components/field/types';import type{FieldTokens}from'../../components/field/tokens';import type{DialogShowOptions}from'../../components/dialog';export declare const alignMap:Record<'left'|'center'|'right','flex-start'|'center'|'flex-end'>;export declare const mapKeyboardType:(type:FieldProps["type"])=>TextInputProps["keyboardType"];type FieldSlotProps={onPress?:()=>void;style?:React.ComponentProps<typeof View>['style'];children?:React.ReactNode;accessibilityRole?:React.ComponentProps<typeof Pressable>['accessibilityRole'];};export declare const FieldSlot:({onPress,style,children,accessibilityRole}:FieldSlotProps)=>React.JSX.Element|null;type FieldClearButtonProps={show:boolean;tokens:FieldTokens;clearIcon?:React.ReactNode;onPressIn?:()=>void;onPressOut?:()=>void;onPress?:()=>void;};export declare const FieldClearButton:({show,tokens,clearIcon,onPressIn,onPressOut,onPress}:FieldClearButtonProps)=>React.JSX.Element|null;type FieldInputProps={inputRef:React.RefObject<TextInput|null>;tokens:FieldTokens;isTextarea:boolean;disabled:boolean;error:boolean;finalTextAlign:'left'|'center'|'right';lineHeight:number;textareaHeight?:number;minHeight?:number;inputStyle?:React.ComponentProps<typeof TextInput>['style'];value:string;onChangeText:(text:string)=>void;onFocus:(event:Parameters<NonNullable<TextInputProps['onFocus']>>[0])=>void;onBlur:(event:Parameters<NonNullable<TextInputProps['onBlur']>>[0])=>void;onPressIn:(event:Parameters<NonNullable<TextInputProps['onPressIn']>>[0])=>void;rows:number;placeholderTextColor?:TextInputProps['placeholderTextColor'];keyboardType?:TextInputProps['keyboardType'];onContentSizeChange?:(event:{nativeEvent:{contentSize:{height:number;};};})=>void;describedBy?:string[];secureTextEntry?:boolean;editable:boolean;restInputProps:TextInputProps;};export declare const FieldInput:({inputRef,tokens,isTextarea,disabled,error,finalTextAlign,lineHeight,textareaHeight,minHeight,inputStyle,value,onChangeText,onFocus,onBlur,onPressIn,rows,placeholderTextColor,keyboardType,onContentSizeChange,describedBy,secureTextEntry,editable,restInputProps}:FieldInputProps)=>React.JSX.Element;type FieldControlRowProps={tokens:FieldTokens;prefixNode?:React.ReactNode;leftIconNode?:React.ReactNode;controlNode:React.ReactNode;clearNode?:React.ReactNode;rightIconNode?:React.ReactNode;suffixNode?:React.ReactNode;};export declare const FieldControlRow:({tokens,prefixNode,leftIconNode,controlNode,clearNode,rightIconNode,suffixNode}:FieldControlRowProps)=>React.JSX.Element;export declare const resolveTooltipDialog:(tooltip:React.ReactNode|FieldTooltipProps,defaultIcon:React.ReactNode)=>{icon:React.ReactNode;dialogProps:DialogShowOptions;};export{};
@@ -0,0 +1 @@
1
+ import type{FormItemRule,NamePath}from'../../components/form/types';export declare const normalizeTrigger:(trigger?:string|string[])=>string[];export declare const toNamePath:(name?:NamePath)=>(string|number)[];export declare const serializeNamePath:(name?:NamePath)=>string;export declare const getValueByName:(source:unknown,name:NamePath)=>unknown;export declare const setValueByName:(source:Record<string,unknown>,name:NamePath,value:unknown)=>Record<string,unknown>;export declare const runRuleValidation:(rule:FormItemRule,value:unknown,values:Record<string,unknown>,fallbackMsg?:string)=>string|null|Promise<string|null>;
@@ -0,0 +1 @@
1
+ import type{NumberKeyboardKeyType}from'../../components/number-keyboard/types';export declare const NUM_KEYS:string[];export declare const ZERO="0";export declare const RE_NUM_LIKE:RegExp;export interface NumberKeyboardKey{text?:string;type:NumberKeyboardKeyType;wider?:boolean;}export declare const shuffle:<T>(list:T[])=>T[];export declare const buildKeyboardKeys:({randomKeyOrder,visible,isCustom,extraKey,showDeleteKey}:{randomKeyOrder?:boolean;visible?:boolean;isCustom:boolean;extraKey?:string|string[];showDeleteKey:boolean;})=>NumberKeyboardKey[];
@@ -0,0 +1 @@
1
+ import type{PickerColumns,PickerOption,PickerValue}from'../../components/picker/types';export interface NormalizedPickerResult{columns:PickerOption[][];values:PickerValue[];options:(PickerOption|undefined)[];}export interface PreparedPickerColumns{type:'single'|'multiple'|'cascade';columnsList:PickerOption[][];defaults:(PickerValue|undefined)[];cascadeRoot?:PickerOption[];}export declare const toArrayValue:(value?:PickerValue[]|PickerValue|null)=>PickerValue[];export declare const findEnabledIndex:(options:PickerOption[],startIdx:number)=>number;export declare const prepareColumns:(input?:PickerColumns)=>PreparedPickerColumns;export declare const normalizePicker:(prep:PreparedPickerColumns,raw?:PickerValue[])=>NormalizedPickerResult;
@@ -0,0 +1 @@
1
+ import React from'react';import type{PickerOption,PickerProps,PickerColumns}from'../../components/picker/types';export declare function usePickerValue({columns,valueProp,defaultValue,emitConfirmOnAutoSelect,onChange,onConfirm}:{columns?:PickerColumns;valueProp?:PickerProps['value'];defaultValue?:PickerProps['defaultValue'];emitConfirmOnAutoSelect?:boolean;onChange?:PickerProps['onChange'];onConfirm?:PickerProps['onConfirm'];}):{preparedColumns:import("./normalize").PreparedPickerColumns;normalized:import("./normalize").NormalizedPickerResult;handleSelect:(option:PickerOption,colIdx:number)=>void;handleConfirm:()=>void;};export declare const getVisibleCount:(count:number)=>number;export declare const GradientMask:React.FC<{height:number;color:string;position:'top'|'bottom';maskType:NonNullable<PickerProps['maskType']>;}>;
@@ -0,0 +1 @@
1
+ import{type ViewStyle}from'react-native';import type{PopupPlacement}from'../../components/popup/types';export declare const EASE_OUT:import("react-native").EasingFunction;export declare const EASE_IN:import("react-native").EasingFunction;export declare const CAPTURE:()=>boolean;export declare const hiddenStyle:ViewStyle;export declare const placementConfig:Record<PopupPlacement,{container:ViewStyle;axis:'x'|'y';}>;export declare const CONTENT_SELF:Record<PopupPlacement,ViewStyle>;export declare const buildRadius:(round:boolean|undefined,p:PopupPlacement,r:number)=>ViewStyle|undefined;
@@ -0,0 +1 @@
1
+ import React from'react';import type{GestureResponderEvent,LayoutChangeEvent}from'react-native';import{View}from'react-native';import type{SliderProps,SliderValue}from'../../components/slider/types';export type TrackLayout={width:number;height:number;x:number;y:number;};export type PressableLikeEvent=GestureResponderEvent&{preventDefault?:()=>void;};export type HandlerBag=Record<string,unknown>&Partial<React.ComponentProps<typeof View>>;export declare const START_KEYS:readonly["onResponderGrant","onPanResponderGrant"];export declare const MOVE_KEYS:readonly["onResponderMove","onPanResponderMove"];export declare const END_KEYS:readonly["onResponderRelease","onResponderTerminate","onPanResponderRelease","onPanResponderTerminate"];export declare const normalizeValue:(value:SliderValue|undefined,range:boolean,min:number,max:number)=>number[];export declare const toSliderValue:(values:readonly number[],range:boolean,fallback:number)=>SliderValue;export declare const createAccessibilityProps:(inputProps?:{role?:string;["aria-value"]?:unknown;accessibilityActions?:unknown;onAccessibilityAction?:unknown;disabled?:boolean;}|null)=>{};export declare const defaultNumberFormatter:Intl.NumberFormat;export declare const mapSliderTouchDirection:(props:Pick<SliderProps,"vertical"|"reverse">)=>boolean|undefined;export declare const useTrackLayout:()=>{trackRef:React.RefObject<View|null>;trackLayout:TrackLayout;handleTrackLayout:(event:LayoutChangeEvent)=>void;};
@@ -0,0 +1 @@
1
+ import type React from'react';export declare const LOOP_THRESHOLD=10;export declare const createWebMouseHandlers:({enabled,vertical,mainSize,clearAuto,next,prev,schedule,dragRef,interRef}:{enabled:boolean;vertical:boolean;mainSize:number;clearAuto:()=>void;next:()=>void;prev:()=>void;schedule:()=>void;dragRef:React.MutableRefObject<number|null>;interRef:React.MutableRefObject<boolean>;})=>Record<string,any>|undefined;
@@ -0,0 +1 @@
1
+ import React from'react';import{type LayoutChangeEvent}from'react-native';import type{TabPaneProps,TabsProps,TabsValue}from'../../components/tabs/types';import{useTabsTokens}from'../../components/tabs/tokens';export interface ParsedPane extends TabPaneProps{key:React.Key;name:TabsValue;index:number;}export declare const isTabPaneElement:(child:React.ReactNode,TabPane:React.FC<TabPaneProps>)=>child is React.ReactElement<TabPaneProps>;interface TabItemProps{pane:ParsedPane;isActive:boolean;align:TabsProps['align'];scrollable:boolean;type:TabsProps['type'];ellipsis:boolean;tokens:ReturnType<typeof useTabsTokens>;color?:string;titleActiveColor?:string;titleInactiveColor?:string;tabStyle?:TabsProps['tabStyle'];titleStyle?:TabsProps['titleStyle'];descriptionStyle?:TabsProps['descriptionStyle'];onSelect:(pane:ParsedPane,index:number,event?:unknown)=>void;onLayout:(name:TabsValue,event:LayoutChangeEvent)=>void;isLast:boolean;}export declare const TabBarItem:React.NamedExoticComponent<TabItemProps>;export{};
@@ -0,0 +1 @@
1
+ import React from'react';import{Animated,type NativeScrollEvent,type NativeSyntheticEvent}from'react-native';import type{TabsValue}from'../../components/tabs/types';export declare const requestTabsFrame:(cb:(time?:number)=>void)=>number;export declare const cancelTabsFrame:(id:number|null)=>void;interface UseTabsAnimationParams{type:'line'|'card'|'jumbo'|'capsule';animated:boolean;scrollable:boolean;align:'start'|'center'|'end';panes:Array<{name:TabsValue;index:number;}>;nameIndexMap:Map<TabsValue,number>;resolvedLineWidth?:number;resolvedLineHeight?:number;resolvedDuration:number;currentName?:TabsValue|null;layoutMap:React.MutableRefObject<Map<TabsValue,{x:number;width:number;}>>;navContainerWidthRef:React.MutableRefObject<number>;}export declare const useTabsAnimation:({type,animated,scrollable,align,panes,nameIndexMap,resolvedLineWidth,resolvedDuration,currentName,layoutMap,navContainerWidthRef}:UseTabsAnimationParams)=>{indicatorX:Animated.Value;indicatorWidth:Animated.Value;indicatorInitializedRef:React.RefObject<boolean>;animateIndicator:(name?:TabsValue,immediate?:boolean)=>boolean;};interface UseTabsScrollParams{scrollable:boolean;animated:boolean;currentName?:TabsValue|null;resolvedDuration:number;layoutMap:React.MutableRefObject<Map<TabsValue,{x:number;width:number;}>>;navContainerWidthRef:React.MutableRefObject<number>;navContentWidthRef:React.MutableRefObject<number>;}export declare const useTabsScroll:({scrollable,animated,currentName,resolvedDuration,layoutMap,navContainerWidthRef,navContentWidthRef}:UseTabsScrollParams)=>{navScrollRef:React.RefObject<any>;scrollIntoView:(immediate?:boolean)=>void;handleNavScrollBeginDrag:(e:NativeSyntheticEvent<NativeScrollEvent>)=>void;handleNavScroll:(e:NativeSyntheticEvent<NativeScrollEvent>)=>void;};export{};
@@ -1 +1 @@
1
- export declare const shallowEqualArray:<T>(a?:T[],b?:T[])=>boolean;export declare const shallowEqualObject:(a?:Record<string,unknown>|null,b?:Record<string,unknown>|null)=>boolean;
1
+ export declare const shallowEqualArray:<T>(a?:T[],b?:T[])=>boolean;export declare const shallowEqualObject:(a?:Record<string,unknown>|null,b?:Record<string,unknown>|null)=>boolean;export declare const deepEqualObject:(a:unknown,b:unknown)=>boolean;