@wavemaker/app-rn-runtime 12.0.0-next.45503 → 12.0.0-next.45752
Sign up to get free protection for your applications and to get access to all the features.
- app-rn-runtime/components/container/tabs/tabheader/tabheader.component.js +2 -2
- app-rn-runtime/components/container/tabs/tabheader/tabheader.component.js.map +1 -1
- app-rn-runtime/components/container/tabs/tabheader/tabheader.props.js.map +1 -1
- app-rn-runtime/components/container/tabs/tabpane/tabpane.props.js.map +1 -1
- app-rn-runtime/components/container/tabs/tabs.component.js +3 -0
- app-rn-runtime/components/container/tabs/tabs.component.js.map +1 -1
- app-rn-runtime/components/container/tabs/tabs.props.js.map +1 -1
- app-rn-runtime/components/data/list/list.component.js +22 -9
- app-rn-runtime/components/data/list/list.component.js.map +1 -1
- app-rn-runtime/components/input/fileupload/fileupload.component.js +4 -2
- app-rn-runtime/components/input/fileupload/fileupload.component.js.map +1 -1
- app-rn-runtime/components/input/fileupload/fileupload.props.js +1 -0
- app-rn-runtime/components/input/fileupload/fileupload.props.js.map +1 -1
- app-rn-runtime/components/page/tabbar/tabbar.props.js +1 -0
- app-rn-runtime/components/page/tabbar/tabbar.props.js.map +1 -1
- app-rn-runtime/core/props.provider.js +1 -0
- app-rn-runtime/core/props.provider.js.map +1 -1
- app-rn-runtime/core/utils.js +16 -0
- app-rn-runtime/core/utils.js.map +1 -1
- app-rn-runtime/package.json +6 -4
- app-rn-runtime/runtime/services/app-security.service.js +25 -1
- app-rn-runtime/runtime/services/app-security.service.js.map +1 -1
@@ -42,8 +42,8 @@ export default class WmTabheader extends BaseComponent {
|
|
42
42
|
}
|
43
43
|
}
|
44
44
|
setPosition() {
|
45
|
-
var _this$headersLayout$s, _this$headerPanelLayo, _this$headerPanelLayo2;
|
46
|
-
const selectedTabIndex = this.state.props.selectedTabIndex;
|
45
|
+
var _this$state$props$sel, _this$headersLayout$s, _this$headerPanelLayo, _this$headerPanelLayo2;
|
46
|
+
const selectedTabIndex = (_this$state$props$sel = this.state.props.selectedTabIndex) !== null && _this$state$props$sel !== void 0 ? _this$state$props$sel : 0;
|
47
47
|
let toIndicatorPosition = 0;
|
48
48
|
let toIndicatorWidth = ((_this$headersLayout$s = this.headersLayout[selectedTabIndex]) === null || _this$headersLayout$s === void 0 ? void 0 : _this$headersLayout$s.width) || 0;
|
49
49
|
let toHeaderScrollPosition = this.headerScrollPositionValue;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["React","Animated","Easing","Text","View","BaseComponent","BaseComponentState","WmTabheaderProps","DEFAULT_CLASS","Tappable","createSkeleton","BackgroundComponent","WmIcon","WmTabheaderState","WmTabheader","constructor","props","_defineProperty","Value","headerScrollPosition","addListener","value","headerScrollPositionValue","setHeaderPanelPositon","nativeEvent","headerPanelLayout","layout","forceUpdate","setHeaderPositon","index","headersLayout","selectedTabIndex","onTabSelection","state","onIndexChange","setPosition","_this$headersLayout$s","_this$headerPanelLayo","_this$headerPanelLayo2","toIndicatorPosition","toIndicatorWidth","width","toHeaderScrollPosition","totalWidth","data","length","forEach","p","i","minScrollPosition","maxScrollPosition","Math","max","min","positionIndicator","position","isRTL","parallel","timing","useNativeDriver","toValue","duration","easing","linear","indicatorWidth","reverseIndicatorWidth","indicatorPosition","start","renderSkeleton","createElement","style","transform","translateX","onLayout","bind","styles","root","map","header","_this$styles$root","_this$styles$root2","_this$styles$activeHe","isSelected","onTap","key","flex","activeHeader","theme","borderRadius","height","activeHeaderText","fontSize","activeIndicator","scaleX","renderWidget","arrowIndicator","overflow","zIndex","_background","_extends","getTestPropsForAction","flexGrow","undefined","id","getTestId","mergeStyle","headerIcon","activeHeaderIcon","iconclass","icon","numberOfLines","headerText","getTestPropsForLabel","title","backgroundImage","image","backgroundPosition","size","backgroundSize","repeat","backgroundRepeat","resizeMode","backgroundResizeMode","arrowIndicatorDot"],"sources":["tabheader.component.tsx"],"sourcesContent":["import React from 'react';\nimport { Animated, Easing, LayoutChangeEvent, LayoutRectangle, Text, View } from 'react-native';\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\n\nimport WmTabheaderProps from './tabheader.props';\nimport { DEFAULT_CLASS, WmTabheaderStyles } from './tabheader.styles';\nimport { Tappable } from '@wavemaker/app-rn-runtime/core/tappable.component';\nimport WmSkeleton, { createSkeleton } from '@wavemaker/app-rn-runtime/components/basic/skeleton/skeleton.component';\nimport { WmSkeletonStyles } from '@wavemaker/app-rn-runtime/components/basic/skeleton/skeleton.styles';\nimport { BackgroundComponent } from '@wavemaker/app-rn-runtime/styles/background.component';\nimport WmIcon from \"@wavemaker/app-rn-runtime/components/basic/icon/icon.component\";\n\nexport class WmTabheaderState extends BaseComponentState<WmTabheaderProps> {\n}\n\nexport default class WmTabheader extends BaseComponent<WmTabheaderProps, WmTabheaderState, WmTabheaderStyles> {\n\n private headerPanelLayout: LayoutRectangle = null as any;\n private headersLayout: LayoutRectangle[] = [];\n private headerScrollPosition = new Animated.Value(0);\n private headerScrollPositionValue = 0;\n private indicatorPosition = new Animated.Value(0);\n private reverseIndicatorWidth = new Animated.Value(0);\n private indicatorWidth = new Animated.Value(0);\n\n constructor(props: WmTabheaderProps) {\n super(props, DEFAULT_CLASS, new WmTabheaderProps(), new WmTabheaderState());\n this.headerScrollPosition.addListener(({value}) => this.headerScrollPositionValue = value);\n }\n\n setHeaderPanelPositon(nativeEvent: LayoutChangeEvent) {\n this.headerPanelLayout = nativeEvent.nativeEvent.layout;\n this.forceUpdate();\n }\n\n setHeaderPositon(index: number, nativeEvent: LayoutChangeEvent) {\n this.headersLayout[index] = nativeEvent.nativeEvent.layout;\n if (index === this.props.selectedTabIndex) {\n this.forceUpdate();\n }\n }\n\n onTabSelection(index: number) {\n if (this.state.props.selectedTabIndex != index) {\n this.state.props.onIndexChange && this.state.props.onIndexChange(index);\n }\n }\n\n setPosition() {\n const selectedTabIndex = this.state.props.selectedTabIndex;\n let toIndicatorPosition = 0;\n let toIndicatorWidth = this.headersLayout[selectedTabIndex]?.width || 0;\n let toHeaderScrollPosition = this.headerScrollPositionValue;\n let totalWidth = 0;\n if (this.state.props.data.length !== this.headersLayout.length) {\n return;\n }\n this.headersLayout.forEach((p, i) => {\n if (i < selectedTabIndex) {\n toIndicatorPosition += p.width;\n }\n totalWidth += p.width;\n });\n toHeaderScrollPosition = -1 * (toIndicatorPosition - (this.headerPanelLayout?.width || 0) / 2 + toIndicatorWidth/ 2) ;\n const minScrollPosition = -1 * (totalWidth - (this.headerPanelLayout?.width || 0));\n const maxScrollPosition = 0;\n toHeaderScrollPosition = Math.max(minScrollPosition, toHeaderScrollPosition);\n toHeaderScrollPosition = Math.min(maxScrollPosition, toHeaderScrollPosition);\n let positionIndicator = (toIndicatorPosition - (100 - toIndicatorWidth) / 2);\n let position = this.isRTL?-positionIndicator:positionIndicator;\n Animated.parallel([\n Animated.timing(this.headerScrollPosition, {\n useNativeDriver: true,\n toValue: toHeaderScrollPosition,\n duration: 200,\n easing: Easing.linear\n }),\n Animated.timing(this.indicatorWidth, {\n useNativeDriver: true,\n toValue: toIndicatorWidth / 100,\n duration: 200,\n easing: Easing.linear\n }),\n Animated.timing(this.reverseIndicatorWidth, {\n useNativeDriver: true,\n toValue: toIndicatorWidth ? 100 / toIndicatorWidth : 0,\n duration: 200,\n easing: Easing.linear\n }),\n Animated.timing(this.indicatorPosition, {\n useNativeDriver: true,\n toValue: position,\n duration: 200,\n easing: Easing.linear\n })\n ]).start();\n }\n\n public renderSkeleton(props: WmTabheaderProps){\n return(\n <Animated.View style={{\n transform: [{\n translateX: this.headerScrollPosition\n }]\n }}\n onLayout={this.setHeaderPanelPositon.bind(this)}>\n <View style={this.styles.root}>\n {this.props.data.map((header ,i) => {\n const isSelected = i === this.props.selectedTabIndex;\n return (\n <Tappable onTap={this.onTabSelection.bind(this, i)} key={header.key} styles={{flex: 1}}>\n <View onLayout={this.setHeaderPositon.bind(this, i)} style={[\n this.styles.header,\n isSelected ? this.styles.activeHeader : null]}>\n {\n createSkeleton(this.theme, { root: { borderRadius: 4 }} as WmSkeletonStyles, {\n ...this.styles.root,\n width: this.styles.root?.width || \"80%\",\n height: this.styles.root?.height || this.styles.activeHeaderText?.fontSize || 16\n })\n }\n </View>\n </Tappable>\n );\n })}\n </View>\n <Animated.View style={[this.styles.activeIndicator, {\n transform: [{\n translateX: this.indicatorPosition\n }, {\n scaleX: this.indicatorWidth\n }]\n }]}></Animated.View>\n </Animated.View>\n\n )\n }\n\n renderWidget(props: WmTabheaderProps) {\n this.setPosition();\n const arrowIndicator = this.styles.arrowIndicator as any;\n return (\n <View style={{overflow: 'hidden', zIndex: 16}}>\n <Animated.View style={{\n transform: [{\n translateX: this.headerScrollPosition\n }]\n }}\n onLayout={this.setHeaderPanelPositon.bind(this)}>\n <View style={this.styles.root}>\n {this._background}\n {props.data.map((header ,i) => {\n const isSelected = i === props.selectedTabIndex ;\n return (\n <Tappable onTap={this.onTabSelection.bind(this, i)}\n {...this.getTestPropsForAction(i +'')}\n key={header.key}\n styles={this.styles.header.flexGrow ? {flexGrow: this.styles.header.flexGrow} : null}>\n <View onLayout={this.setHeaderPositon.bind(this, i)}>\n <View style={[\n this.styles.header,\n {flexGrow: undefined},\n isSelected ? this.styles.activeHeader : null]}>\n <WmIcon\n id={this.getTestId(i + 'icon')}\n styles={this.theme.mergeStyle({}, this.styles.headerIcon, isSelected ? this.styles.activeHeaderIcon : null)}\n iconclass={header.icon}></WmIcon>\n <Text numberOfLines={1} style={[\n this.styles.headerText,\n isSelected ? this.styles.activeHeaderText : null]}\n {...this.getTestPropsForLabel(i + '_title')}\n >{header.title}</Text>\n </View>\n </View>\n </Tappable>\n );\n })}\n </View>\n <Animated.View style={[this.styles.activeIndicator, {\n transform: [{\n translateX: this.indicatorPosition\n }, {\n scaleX: this.indicatorWidth\n }]\n }]}>\n <Animated.View style={[{\n transform: [{\n scaleX: this.reverseIndicatorWidth\n }]\n },\n this.styles.arrowIndicator\n ]}>\n {arrowIndicator.backgroundImage ? (<BackgroundComponent\n image={arrowIndicator.backgroundImage}\n position={arrowIndicator.backgroundPosition}\n size={arrowIndicator.backgroundSize}\n repeat={arrowIndicator.backgroundRepeat}\n resizeMode={arrowIndicator.backgroundResizeMode}\n style={{borderRadius: this.styles.root.borderRadius}}\n ></BackgroundComponent>) : null }\n <View style={this.styles.arrowIndicatorDot}></View>\n </Animated.View>\n </Animated.View>\n </Animated.View>\n </View>\n );\n }\n}\n"],"mappings":";;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,QAAQ,EAAEC,MAAM,EAAsCC,IAAI,EAAEC,IAAI,QAAQ,cAAc;AAC/F,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,+CAA+C;AAEjG,OAAOC,gBAAgB,MAAM,mBAAmB;AAChD,SAASC,aAAa,QAA2B,oBAAoB;AACrE,SAASC,QAAQ,QAAQ,mDAAmD;AAC5E,SAAqBC,cAAc,QAAQ,wEAAwE;AAEnH,SAASC,mBAAmB,QAAQ,uDAAuD;AAC3F,OAAOC,MAAM,MAAM,gEAAgE;AAEnF,OAAO,MAAMC,gBAAgB,SAASP,kBAAkB,CAAmB;AAG3E,eAAe,MAAMQ,WAAW,SAAST,aAAa,CAAwD;EAU5GU,WAAWA,CAACC,KAAuB,EAAE;IACnC,KAAK,CAACA,KAAK,EAAER,aAAa,EAAE,IAAID,gBAAgB,CAAC,CAAC,EAAE,IAAIM,gBAAgB,CAAC,CAAC,CAAC;IAACI,eAAA,4BATjC,IAAI;IAAAA,eAAA,wBACN,EAAE;IAAAA,eAAA,+BACd,IAAIhB,QAAQ,CAACiB,KAAK,CAAC,CAAC,CAAC;IAAAD,eAAA,oCAChB,CAAC;IAAAA,eAAA,4BACT,IAAIhB,QAAQ,CAACiB,KAAK,CAAC,CAAC,CAAC;IAAAD,eAAA,gCACjB,IAAIhB,QAAQ,CAACiB,KAAK,CAAC,CAAC,CAAC;IAAAD,eAAA,yBAC5B,IAAIhB,QAAQ,CAACiB,KAAK,CAAC,CAAC,CAAC;IAI5C,IAAI,CAACC,oBAAoB,CAACC,WAAW,CAAC,CAAC;MAACC;IAAK,C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ACH,CAAC;IAAE,gBACDhE,KAAA,CAAAqE,aAAA,CAACpE,QAAQ,CAACG,IAAI;MAACkE,KAAK,EAAE,CAAC;QACnBC,SAAS,EAAE,CAAC;UACVsB,MAAM,EAAE,IAAI,CAAC5B;QACf,CAAC;MACH,CAAC,EACD,IAAI,CAACU,MAAM,CAACoB,cAAc;IAC1B,GACCA,cAAc,CAACmB,eAAe,gBAAIlH,KAAA,CAAAqE,aAAA,CAAC1D,mBAAmB;MACvDwG,KAAK,EAAEpB,cAAc,CAACmB,eAAgB;MACtC3D,QAAQ,EAAEwC,cAAc,CAACqB,kBAAmB;MAC5CC,IAAI,EAAEtB,cAAc,CAACuB,cAAe;MACpCC,MAAM,EAAExB,cAAc,CAACyB,gBAAiB;MACxCC,UAAU,EAAE1B,cAAc,CAAC2B,oBAAqB;MAChDpD,KAAK,EAAE;QAACkB,YAAY,EAAE,IAAI,CAACb,MAAM,CAACC,IAAI,CAACY;MAAY;IAAE,CACjC,CAAC,GAAI,IAAI,eAC7BxF,KAAA,CAAAqE,aAAA,CAACjE,IAAI;MAACkE,KAAK,EAAE,IAAI,CAACK,MAAM,CAACgD;IAAkB,CAAO,CACrC,CACF,CACF,CACT,CAAC;EAEX;AACF","ignoreList":[]}
|
1
|
+
{"version":3,"names":["React","Animated","Easing","Text","View","BaseComponent","BaseComponentState","WmTabheaderProps","DEFAULT_CLASS","Tappable","createSkeleton","BackgroundComponent","WmIcon","WmTabheaderState","WmTabheader","constructor","props","_defineProperty","Value","headerScrollPosition","addListener","value","headerScrollPositionValue","setHeaderPanelPositon","nativeEvent","headerPanelLayout","layout","forceUpdate","setHeaderPositon","index","headersLayout","selectedTabIndex","onTabSelection","state","onIndexChange","setPosition","_this$state$props$sel","_this$headersLayout$s","_this$headerPanelLayo","_this$headerPanelLayo2","toIndicatorPosition","toIndicatorWidth","width","toHeaderScrollPosition","totalWidth","data","length","forEach","p","i","minScrollPosition","maxScrollPosition","Math","max","min","positionIndicator","position","isRTL","parallel","timing","useNativeDriver","toValue","duration","easing","linear","indicatorWidth","reverseIndicatorWidth","indicatorPosition","start","renderSkeleton","createElement","style","transform","translateX","onLayout","bind","styles","root","map","header","_this$styles$root","_this$styles$root2","_this$styles$activeHe","isSelected","onTap","key","flex","activeHeader","theme","borderRadius","height","activeHeaderText","fontSize","activeIndicator","scaleX","renderWidget","arrowIndicator","overflow","zIndex","_background","_extends","getTestPropsForAction","flexGrow","undefined","id","getTestId","mergeStyle","headerIcon","activeHeaderIcon","iconclass","icon","numberOfLines","headerText","getTestPropsForLabel","title","backgroundImage","image","backgroundPosition","size","backgroundSize","repeat","backgroundRepeat","resizeMode","backgroundResizeMode","arrowIndicatorDot"],"sources":["tabheader.component.tsx"],"sourcesContent":["import React from 'react';\nimport { Animated, Easing, LayoutChangeEvent, LayoutRectangle, Text, View } from 'react-native';\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\n\nimport WmTabheaderProps from './tabheader.props';\nimport { DEFAULT_CLASS, WmTabheaderStyles } from './tabheader.styles';\nimport { Tappable } from '@wavemaker/app-rn-runtime/core/tappable.component';\nimport WmSkeleton, { createSkeleton } from '@wavemaker/app-rn-runtime/components/basic/skeleton/skeleton.component';\nimport { WmSkeletonStyles } from '@wavemaker/app-rn-runtime/components/basic/skeleton/skeleton.styles';\nimport { BackgroundComponent } from '@wavemaker/app-rn-runtime/styles/background.component';\nimport WmIcon from \"@wavemaker/app-rn-runtime/components/basic/icon/icon.component\";\n\nexport class WmTabheaderState extends BaseComponentState<WmTabheaderProps> {\n}\n\nexport default class WmTabheader extends BaseComponent<WmTabheaderProps, WmTabheaderState, WmTabheaderStyles> {\n\n private headerPanelLayout: LayoutRectangle = null as any;\n private headersLayout: LayoutRectangle[] = [];\n private headerScrollPosition = new Animated.Value(0);\n private headerScrollPositionValue = 0;\n private indicatorPosition = new Animated.Value(0);\n private reverseIndicatorWidth = new Animated.Value(0);\n private indicatorWidth = new Animated.Value(0);\n\n constructor(props: WmTabheaderProps) {\n super(props, DEFAULT_CLASS, new WmTabheaderProps(), new WmTabheaderState());\n this.headerScrollPosition.addListener(({value}) => this.headerScrollPositionValue = value);\n }\n\n setHeaderPanelPositon(nativeEvent: LayoutChangeEvent) {\n this.headerPanelLayout = nativeEvent.nativeEvent.layout;\n this.forceUpdate();\n }\n\n setHeaderPositon(index: number, nativeEvent: LayoutChangeEvent) {\n this.headersLayout[index] = nativeEvent.nativeEvent.layout;\n if (index === this.props.selectedTabIndex) {\n this.forceUpdate();\n }\n }\n\n onTabSelection(index: number) {\n if (this.state.props.selectedTabIndex != index) {\n this.state.props.onIndexChange && this.state.props.onIndexChange(index);\n }\n }\n\n setPosition() {\n const selectedTabIndex = this.state.props.selectedTabIndex ?? 0;\n let toIndicatorPosition = 0;\n let toIndicatorWidth = this.headersLayout[selectedTabIndex]?.width || 0;\n let toHeaderScrollPosition = this.headerScrollPositionValue;\n let totalWidth = 0;\n if (this.state.props.data.length !== this.headersLayout.length) {\n return;\n }\n this.headersLayout.forEach((p, i) => {\n if (i < selectedTabIndex) {\n toIndicatorPosition += p.width;\n }\n totalWidth += p.width;\n });\n toHeaderScrollPosition = -1 * (toIndicatorPosition - (this.headerPanelLayout?.width || 0) / 2 + toIndicatorWidth/ 2) ;\n const minScrollPosition = -1 * (totalWidth - (this.headerPanelLayout?.width || 0));\n const maxScrollPosition = 0;\n toHeaderScrollPosition = Math.max(minScrollPosition, toHeaderScrollPosition);\n toHeaderScrollPosition = Math.min(maxScrollPosition, toHeaderScrollPosition);\n let positionIndicator = (toIndicatorPosition - (100 - toIndicatorWidth) / 2);\n let position = this.isRTL?-positionIndicator:positionIndicator;\n Animated.parallel([\n Animated.timing(this.headerScrollPosition, {\n useNativeDriver: true,\n toValue: toHeaderScrollPosition,\n duration: 200,\n easing: Easing.linear\n }),\n Animated.timing(this.indicatorWidth, {\n useNativeDriver: true,\n toValue: toIndicatorWidth / 100,\n duration: 200,\n easing: Easing.linear\n }),\n Animated.timing(this.reverseIndicatorWidth, {\n useNativeDriver: true,\n toValue: toIndicatorWidth ? 100 / toIndicatorWidth : 0,\n duration: 200,\n easing: Easing.linear\n }),\n Animated.timing(this.indicatorPosition, {\n useNativeDriver: true,\n toValue: position,\n duration: 200,\n easing: Easing.linear\n })\n ]).start();\n }\n\n public renderSkeleton(props: WmTabheaderProps){\n return(\n <Animated.View style={{\n transform: [{\n translateX: this.headerScrollPosition\n }]\n }}\n onLayout={this.setHeaderPanelPositon.bind(this)}>\n <View style={this.styles.root}>\n {this.props.data.map((header ,i) => {\n const isSelected = i === this.props.selectedTabIndex;\n return (\n <Tappable onTap={this.onTabSelection.bind(this, i)} key={header.key} styles={{flex: 1}}>\n <View onLayout={this.setHeaderPositon.bind(this, i)} style={[\n this.styles.header,\n isSelected ? this.styles.activeHeader : null]}>\n {\n createSkeleton(this.theme, { root: { borderRadius: 4 }} as WmSkeletonStyles, {\n ...this.styles.root,\n width: this.styles.root?.width || \"80%\",\n height: this.styles.root?.height || this.styles.activeHeaderText?.fontSize || 16\n })\n }\n </View>\n </Tappable>\n );\n })}\n </View>\n <Animated.View style={[this.styles.activeIndicator, {\n transform: [{\n translateX: this.indicatorPosition\n }, {\n scaleX: this.indicatorWidth\n }]\n }]}></Animated.View>\n </Animated.View>\n\n )\n }\n\n renderWidget(props: WmTabheaderProps) {\n this.setPosition();\n const arrowIndicator = this.styles.arrowIndicator as any;\n return (\n <View style={{overflow: 'hidden', zIndex: 16}}>\n <Animated.View style={{\n transform: [{\n translateX: this.headerScrollPosition\n }]\n }}\n onLayout={this.setHeaderPanelPositon.bind(this)}>\n <View style={this.styles.root}>\n {this._background}\n {props.data.map((header ,i) => {\n const isSelected = i === props.selectedTabIndex ;\n return (\n <Tappable onTap={this.onTabSelection.bind(this, i)}\n {...this.getTestPropsForAction(i +'')}\n key={header.key}\n styles={this.styles.header.flexGrow ? {flexGrow: this.styles.header.flexGrow} : null}>\n <View onLayout={this.setHeaderPositon.bind(this, i)}>\n <View style={[\n this.styles.header,\n {flexGrow: undefined},\n isSelected ? this.styles.activeHeader : null]}>\n <WmIcon\n id={this.getTestId(i + 'icon')}\n styles={this.theme.mergeStyle({}, this.styles.headerIcon, isSelected ? this.styles.activeHeaderIcon : null)}\n iconclass={header.icon}></WmIcon>\n <Text numberOfLines={1} style={[\n this.styles.headerText,\n isSelected ? this.styles.activeHeaderText : null]}\n {...this.getTestPropsForLabel(i + '_title')}\n >{header.title}</Text>\n </View>\n </View>\n </Tappable>\n );\n })}\n </View>\n <Animated.View style={[this.styles.activeIndicator, {\n transform: [{\n translateX: this.indicatorPosition\n }, {\n scaleX: this.indicatorWidth\n }]\n }]}>\n <Animated.View style={[{\n transform: [{\n scaleX: this.reverseIndicatorWidth\n }]\n },\n this.styles.arrowIndicator\n ]}>\n {arrowIndicator.backgroundImage ? (<BackgroundComponent\n image={arrowIndicator.backgroundImage}\n position={arrowIndicator.backgroundPosition}\n size={arrowIndicator.backgroundSize}\n repeat={arrowIndicator.backgroundRepeat}\n resizeMode={arrowIndicator.backgroundResizeMode}\n style={{borderRadius: this.styles.root.borderRadius}}\n ></BackgroundComponent>) : null }\n <View style={this.styles.arrowIndicatorDot}></View>\n </Animated.View>\n </Animated.View>\n </Animated.View>\n </View>\n );\n }\n}\n"],"mappings":";;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,QAAQ,EAAEC,MAAM,EAAsCC,IAAI,EAAEC,IAAI,QAAQ,cAAc;AAC/F,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,+CAA+C;AAEjG,OAAOC,gBAAgB,MAAM,mBAAmB;AAChD,SAASC,aAAa,QAA2B,oBAAoB;AACrE,SAASC,QAAQ,QAAQ,mDAAmD;AAC5E,SAAqBC,cAAc,QAAQ,wEAAwE;AAEnH,SAASC,mBAAmB,QAAQ,uDAAuD;AAC3F,OAAOC,MAAM,MAAM,gEAAgE;AAEnF,OAAO,MAAMC,gBAAgB,SAASP,kBAAkB,CAAmB;AAG3E,eAAe,MAAMQ,WAA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Y;MAAY;IAAE,CACjC,CAAC,GAAI,IAAI,eAC7BzF,KAAA,CAAAsE,aAAA,CAAClE,IAAI;MAACmE,KAAK,EAAE,IAAI,CAACK,MAAM,CAACgD;IAAkB,CAAO,CACrC,CACF,CACF,CACT,CAAC;EAEX;AACF","ignoreList":[]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["BaseProps","WmTabheaderProps","constructor","args","_defineProperty"],"sources":["tabheader.props.ts"],"sourcesContent":["import { BaseProps } from '@wavemaker/app-rn-runtime/core/base.component';\n\nexport default class WmTabheaderProps extends BaseProps {\n data: {icon: string, key: string, title: string}[] = [] as any;\n selectedTabIndex = 0;\n onIndexChange?: (index: number) => any = null as any;\n}"],"mappings":";;;AAAA,SAASA,SAAS,QAAQ,+CAA+C;AAEzE,eAAe,MAAMC,gBAAgB,SAASD,SAAS,CAAC;EAAAE,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAC,eAAA,eACD,EAAE;IAAAA,eAAA,
|
1
|
+
{"version":3,"names":["BaseProps","WmTabheaderProps","constructor","args","_defineProperty"],"sources":["tabheader.props.ts"],"sourcesContent":["import { BaseProps } from '@wavemaker/app-rn-runtime/core/base.component';\n\nexport default class WmTabheaderProps extends BaseProps {\n data: {icon: string, key: string, title: string}[] = [] as any;\n selectedTabIndex? = 0;\n onIndexChange?: (index: number) => any = null as any;\n}"],"mappings":";;;AAAA,SAASA,SAAS,QAAQ,+CAA+C;AAEzE,eAAe,MAAMC,gBAAgB,SAASD,SAAS,CAAC;EAAAE,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAC,eAAA,eACD,EAAE;IAAAA,eAAA,2BACnC,CAAC;IAAAA,eAAA,wBACoB,IAAI;EAAA;AAC/C","ignoreList":[]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["BaseProps","WmTabpaneProps","constructor","args","_defineProperty"],"sources":["tabpane.props.ts"],"sourcesContent":["import { BaseProps } from '@wavemaker/app-rn-runtime/core/base.component';\n\nexport default class WmTabpaneProps extends BaseProps {\n children
|
1
|
+
{"version":3,"names":["BaseProps","WmTabpaneProps","constructor","args","_defineProperty"],"sources":["tabpane.props.ts"],"sourcesContent":["import { BaseProps } from '@wavemaker/app-rn-runtime/core/base.component';\n\nexport default class WmTabpaneProps extends BaseProps {\n children?: any;\n paneicon?: string = null as any;\n title: string = 'Tab Title';\n renderPartial?: Function;\n isPartialLoaded? = false;\n}\n"],"mappings":";;;AAAA,SAASA,SAAS,QAAQ,+CAA+C;AAEzE,eAAe,MAAMC,cAAc,SAASD,SAAS,CAAC;EAAAE,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAC,eAAA;IAAAA,eAAA,mBAEhC,IAAI;IAAAA,eAAA,gBACR,WAAW;IAAAA,eAAA;IAAAA,eAAA,0BAER,KAAK;EAAA;AAC1B","ignoreList":[]}
|
@@ -86,6 +86,9 @@ export default class WmTabs extends BaseComponent {
|
|
86
86
|
}
|
87
87
|
goToTab(index = this.state.selectedTabIndex) {
|
88
88
|
var _this$tabLayout2;
|
89
|
+
if (index < 0 || index >= this.tabPanes.length) {
|
90
|
+
return;
|
91
|
+
}
|
89
92
|
const position = -1 * index * (((_this$tabLayout2 = this.tabLayout) === null || _this$tabLayout2 === void 0 ? void 0 : _this$tabLayout2.width) || 0);
|
90
93
|
if (this.animationView) {
|
91
94
|
this.animationView.setPosition(position).then(() => this.onChange(index));
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["React","View","BaseComponent","BaseComponentState","SwipeAnimation","isWebPreviewMode","WmTabsProps","DEFAULT_CLASS","WmTabheader","WmTabsState","constructor","args","_defineProperty","WmTabs","props","bounds","e","_this$tabLayout","activeTabIndex","state","selectedTabIndex","w","tabLayout","width","noOfTabs","tabPanes","length","lower","center","upper","onLower","onChange","onUpper","setTabLayout","event","nativeEvent","layout","forceUpdate","goToTab","setTabPaneHeights","index","_nativeEvent$nativeEv","tabPaneHeights","height","setTabShown","tabIndex","callback","tabsShown","setTimeout","updateState","addTabPane","tabPane","i","findIndex","t","name","newIndex","selectTabPane","indexOf","selectedTabPane","_this$tabLayout2","position","animationView","setPosition","then","prev","_this$animationView","goToLower","next","_this$animationView2","oldIndex","deselectedTab","_onDeselect","selectedTab","_onSelect","invokeEventCallback","proxy","renderSkeleton","Children","toArray","children","filter","item","show","headerData","map","p","title","icon","key","createElement","style","styles","root","borderBottomWidth","onLayout","bind","tabHeader","data","showskeleton","overflow","flexDirection","flexWrap","alignSelf","onPropertyChange","$new","$old","selectedIndex","renderWidget","paneicon","_background","id","getTestId","onIndexChange","flex","maxHeight","tabContent","enableGestures","enablegestures","alignItems","direction","ref","r","handlers","animationHandlers","undefined"],"sources":["tabs.component.tsx"],"sourcesContent":["import React from 'react';\nimport { LayoutChangeEvent, LayoutRectangle, View } from 'react-native';\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\nimport * as SwipeAnimation from '@wavemaker/app-rn-runtime/gestures/swipe.animation';\nimport { isWebPreviewMode } from '@wavemaker/app-rn-runtime/core/utils';\n\nimport WmTabsProps from './tabs.props';\nimport { DEFAULT_CLASS, WmTabsStyles } from './tabs.styles';\nimport WmTabpane from './tabpane/tabpane.component';\nimport WmTabheader from './tabheader/tabheader.component';\n\nexport class WmTabsState extends BaseComponentState<WmTabsProps> {\n tabsShown: boolean[] = [];\n selectedTabIndex: number = 0;\n}\n\nexport default class WmTabs extends BaseComponent<WmTabsProps, WmTabsState, WmTabsStyles> {\n public tabPanes = [] as WmTabpane[];\n private newIndex = 0;\n private tabLayout: LayoutRectangle = null as any;\n private tabPaneHeights: number[] = [];\n private animationView: SwipeAnimation.View | null = null as any;\n private animationHandlers = {\n bounds: (e) => {\n const activeTabIndex = this.state.selectedTabIndex,\n w = this.tabLayout?.width || 0,\n noOfTabs = this.tabPanes.length;\n return {\n lower: -1 * (activeTabIndex - (activeTabIndex === 0 ? 0 : 1)) * w,\n center: -1 * activeTabIndex * w,\n upper: -1 * (activeTabIndex + (activeTabIndex === noOfTabs - 1 ? 0 : 1)) * w\n };\n },\n onLower: (e) => {\n this.onChange(this.state.selectedTabIndex - 1);\n },\n onUpper: (e) => {\n this.onChange(this.state.selectedTabIndex + 1);\n }\n } as SwipeAnimation.Handlers;\n\n constructor(props: WmTabsProps) {\n super(props, DEFAULT_CLASS, new WmTabsProps(), new WmTabsState());\n }\n\n setTabLayout(event: LayoutChangeEvent) {\n this.tabLayout = event.nativeEvent.layout;\n this.forceUpdate(() => {\n this.goToTab();\n });\n }\n\n setTabPaneHeights(index: number, nativeEvent: LayoutChangeEvent) {\n this.tabPaneHeights[index] = nativeEvent.nativeEvent.layout?.height;\n if (index === this.state.selectedTabIndex) {\n this.forceUpdate();\n }\n }\n\n setTabShown(tabIndex: number, callback: () => any) {\n if (!this.state.tabsShown[tabIndex]) {\n const tabsShown = [...this.state.tabsShown];\n tabsShown[tabIndex] = true;\n setTimeout(() => {\n this.updateState({\n tabsShown: tabsShown\n } as WmTabsState, callback);\n }, 300);\n } else {\n callback && callback();\n }\n }\n\n addTabPane(tabPane: WmTabpane) {\n const i = this.tabPanes.findIndex(t => t.props.name === tabPane.props.name);\n if (i >= 0) {\n this.tabPanes[i] = tabPane;\n } else {\n this.tabPanes[this.newIndex++] = tabPane;\n }\n }\n\n selectTabPane(tabPane: WmTabpane) {\n this.goToTab(this.tabPanes.indexOf(tabPane));\n }\n\n get selectedTabPane() {\n return this.tabPanes[this.state.selectedTabIndex];\n }\n\n goToTab(index = this.state.selectedTabIndex) {\n const position = -1 * index * (this.tabLayout?.width || 0);\n if(this.animationView) {\n this.animationView.setPosition(position)\n .then(() => this.onChange(index));\n } else {\n this.onChange(index);\n }\n }\n\n prev() {\n this.animationView?.goToLower();\n }\n\n next() {\n this.animationView?.goToLower();\n }\n\n onChange(newIndex: number) {\n if (newIndex < 0 || newIndex >= this.tabPanes.length) {\n return;\n }\n const oldIndex = this.state.selectedTabIndex;\n const deselectedTab = this.tabPanes[this.state.selectedTabIndex];\n this.newIndex = newIndex;\n deselectedTab?._onDeselect();\n this.updateState({\n selectedTabIndex: newIndex\n } as WmTabsState, () => {\n this.setTabShown(newIndex, () => {\n const selectedTab = this.tabPanes[newIndex];\n selectedTab?._onSelect();\n this.invokeEventCallback('onChange', [{}, this.proxy, newIndex, oldIndex]);\n });\n });\n }\n\n public renderSkeleton(props: WmTabsProps){\n const tabPanes = React.Children.toArray(this.props.children)\n .filter((item: any, index: number) => item.props.show != false);\n const headerData = tabPanes.map((p: any, i: number) =>\n ({title: p.props.title || 'Tab Title', icon: '', key: `tab-${p.props.title}-${i}`}));\n return(\n <View style={[this.styles.root, { borderBottomWidth: 0}]}>\n <View onLayout={this.setTabLayout.bind(this)} style={{width: '100%'}}></View>\n <WmTabheader\n styles={this.styles.tabHeader}\n data={headerData}\n showskeleton={this.props.showskeleton}\n selectedTabIndex={this.state.selectedTabIndex}\n ></WmTabheader>\n <View\n //{...this.panResponder.panHandlers}\n style={{\n width: '100%',\n //height: this.tabPaneHeights[this.state.selectedTabIndex],\n overflow: 'hidden'\n }} >\n <View style={{\n flexDirection: 'row',\n flexWrap: 'nowrap'\n }}>\n {tabPanes.map((p: any, i) => {\n return (\n <View\n key={`tab-${p.props.title}-${i}`}\n style={{width: '100%', alignSelf: 'flex-start'}}\n onLayout={this.setTabPaneHeights.bind(this, i)}>\n {/* {this.state.tabsShown[i] ? p : null} */}\n {p}\n </View>);\n })}\n </View>\n </View>\n </View>\n\n )\n }\n\n public onPropertyChange(name: string, $new: any, $old: any): void {\n super.onPropertyChange(name, $new, $old);\n switch(name) {\n case \"defaultpaneindex\":\n const selectedIndex = $new || 0;\n const tabsShown: boolean[] = [];\n tabsShown[selectedIndex] = true;\n this.updateState({\n selectedTabIndex: selectedIndex,\n tabsShown: tabsShown\n } as WmTabsState);\n }\n }\n\n renderWidget(props: WmTabsProps) {\n const tabPanes = React.Children.toArray(props.children)\n .filter((item: any, index: number) => item.props.show != false);\n const headerData = tabPanes.map((p: any, i: number) =>\n ({title: p.props.title || 'Tab Title', icon: p.props.paneicon || '', key: `tab-${p.props.title}-${i}`}));\n return (\n <View style={this.styles.root}>\n {this._background}\n <View onLayout={this.setTabLayout.bind(this)} style={{width: '100%'}}></View>\n <WmTabheader\n id={this.getTestId('headers')}\n styles={this.styles.tabHeader}\n data={headerData}\n selectedTabIndex={this.state.selectedTabIndex}\n onIndexChange={this.goToTab.bind(this)}\n ></WmTabheader>\n <View\n style={[{\n width: '100%',\n flex: 1\n }, this.styles.root.height ?\n (isWebPreviewMode() ? {'overflowX': 'hidden','overflowY': 'auto'} as any : {overflow: 'scroll'})\n : {\n overflow: 'hidden',\n maxHeight: this.tabPaneHeights[this.state.selectedTabIndex],\n }, this.styles.tabContent]} >\n <SwipeAnimation.View\n enableGestures={props.enablegestures}\n style={{\n flexDirection: 'row',\n flexWrap: 'nowrap',\n alignItems: 'flex-start'\n }}\n direction='horizontal'\n ref={(r) => {this.animationView = r}}\n handlers = {this.animationHandlers}\n >\n {tabPanes.map((p: any, i) => {\n return (\n <View\n key={`tab-${p.props.title}-${i}`}\n style={{\n width: '100%',\n height: this.styles.root.height ? undefined : 1000000,\n alignSelf: 'flex-start'}}>\n <View\n style={{width: '100%', alignSelf: 'flex-start'}}\n onLayout={this.setTabPaneHeights.bind(this, i)}>\n {/* {this.state.tabsShown[i] ? p : null} */}\n {p}\n </View>\n </View>);\n })}\n </SwipeAnimation.View>\n </View>\n </View>\n );\n }\n}\n"],"mappings":";;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAA6CC,IAAI,QAAQ,cAAc;AACvE,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,+CAA+C;AACjG,OAAO,KAAKC,cAAc,MAAM,oDAAoD;AACpF,SAASC,gBAAgB,QAAQ,sCAAsC;AAEvE,OAAOC,WAAW,MAAM,cAAc;AACtC,SAASC,aAAa,QAAsB,eAAe;AAE3D,OAAOC,WAAW,MAAM,iCAAiC;AAEzD,OAAO,MAAMC,WAAW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ACFC,SAAS,EAAC,YAAY;MACtBC,GAAG,EAAGC,CAAC,IAAK;QAAC,IAAI,CAAC5D,aAAa,GAAG4D,CAAC;MAAA,CAAE;MACrCC,QAAQ,EAAI,IAAI,CAACC;IAAkB,GAElCnG,QAAQ,CAAC4D,GAAG,CAAC,CAACC,CAAM,EAAElC,CAAC,KAAK;MAC3B,oBACApD,KAAA,CAAA0F,aAAA,CAACzF,IAAI;QACHwF,GAAG,EAAE,OAAOH,CAAC,CAACxE,KAAK,CAACyE,KAAK,IAAInC,CAAC,EAAG;QACjCuC,KAAK,EAAE;UACLpE,KAAK,EAAE,MAAM;UACboB,MAAM,EAAE,IAAI,CAACiD,MAAM,CAACC,IAAI,CAAClD,MAAM,GAAIkF,SAAS,GAAG,OAAO;UACtDtB,SAAS,EAAE;QAAY;MAAE,gBAC3BvG,KAAA,CAAA0F,aAAA,CAACzF,IAAI;QACH0F,KAAK,EAAE;UAACpE,KAAK,EAAE,MAAM;UAAEgF,SAAS,EAAE;QAAY,CAAE;QAChDR,QAAQ,EAAE,IAAI,CAACxD,iBAAiB,CAACyD,IAAI,CAAC,IAAI,EAAE5C,CAAC;MAAE,GAE9CkC,CACG,CACF,CAAC;IACT,CAAC,CACkB,CACjB,CACF,CAAC;EAEX;AACF","ignoreList":[]}
|
1
|
+
{"version":3,"names":["React","View","BaseComponent","BaseComponentState","SwipeAnimation","isWebPreviewMode","WmTabsProps","DEFAULT_CLASS","WmTabheader","WmTabsState","constructor","args","_defineProperty","WmTabs","props","bounds","e","_this$tabLayout","activeTabIndex","state","selectedTabIndex","w","tabLayout","width","noOfTabs","tabPanes","length","lower","center","upper","onLower","onChange","onUpper","setTabLayout","event","nativeEvent","layout","forceUpdate","goToTab","setTabPaneHeights","index","_nativeEvent$nativeEv","tabPaneHeights","height","setTabShown","tabIndex","callback","tabsShown","setTimeout","updateState","addTabPane","tabPane","i","findIndex","t","name","newIndex","selectTabPane","indexOf","selectedTabPane","_this$tabLayout2","position","animationView","setPosition","then","prev","_this$animationView","goToLower","next","_this$animationView2","oldIndex","deselectedTab","_onDeselect","selectedTab","_onSelect","invokeEventCallback","proxy","renderSkeleton","Children","toArray","children","filter","item","show","headerData","map","p","title","icon","key","createElement","style","styles","root","borderBottomWidth","onLayout","bind","tabHeader","data","showskeleton","overflow","flexDirection","flexWrap","alignSelf","onPropertyChange","$new","$old","selectedIndex","renderWidget","paneicon","_background","id","getTestId","onIndexChange","flex","maxHeight","tabContent","enableGestures","enablegestures","alignItems","direction","ref","r","handlers","animationHandlers","undefined"],"sources":["tabs.component.tsx"],"sourcesContent":["import React from 'react';\nimport { LayoutChangeEvent, LayoutRectangle, View } from 'react-native';\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\nimport * as SwipeAnimation from '@wavemaker/app-rn-runtime/gestures/swipe.animation';\nimport { isWebPreviewMode } from '@wavemaker/app-rn-runtime/core/utils';\n\nimport WmTabsProps from './tabs.props';\nimport { DEFAULT_CLASS, WmTabsStyles } from './tabs.styles';\nimport WmTabpane from './tabpane/tabpane.component';\nimport WmTabheader from './tabheader/tabheader.component';\n\nexport class WmTabsState extends BaseComponentState<WmTabsProps> {\n tabsShown: boolean[] = [];\n selectedTabIndex: number = 0;\n}\n\nexport default class WmTabs extends BaseComponent<WmTabsProps, WmTabsState, WmTabsStyles> {\n public tabPanes = [] as WmTabpane[];\n private newIndex = 0;\n private tabLayout: LayoutRectangle = null as any;\n private tabPaneHeights: number[] = [];\n private animationView: SwipeAnimation.View | null = null as any;\n private animationHandlers = {\n bounds: (e) => {\n const activeTabIndex = this.state.selectedTabIndex,\n w = this.tabLayout?.width || 0,\n noOfTabs = this.tabPanes.length;\n return {\n lower: -1 * (activeTabIndex - (activeTabIndex === 0 ? 0 : 1)) * w,\n center: -1 * activeTabIndex * w,\n upper: -1 * (activeTabIndex + (activeTabIndex === noOfTabs - 1 ? 0 : 1)) * w\n };\n },\n onLower: (e) => {\n this.onChange(this.state.selectedTabIndex - 1);\n },\n onUpper: (e) => {\n this.onChange(this.state.selectedTabIndex + 1);\n }\n } as SwipeAnimation.Handlers;\n\n constructor(props: WmTabsProps) {\n super(props, DEFAULT_CLASS, new WmTabsProps(), new WmTabsState());\n }\n\n setTabLayout(event: LayoutChangeEvent) {\n this.tabLayout = event.nativeEvent.layout;\n this.forceUpdate(() => {\n this.goToTab();\n });\n }\n\n setTabPaneHeights(index: number, nativeEvent: LayoutChangeEvent) {\n this.tabPaneHeights[index] = nativeEvent.nativeEvent.layout?.height;\n if (index === this.state.selectedTabIndex) {\n this.forceUpdate();\n }\n }\n\n setTabShown(tabIndex: number, callback: () => any) {\n if (!this.state.tabsShown[tabIndex]) {\n const tabsShown = [...this.state.tabsShown];\n tabsShown[tabIndex] = true;\n setTimeout(() => {\n this.updateState({\n tabsShown: tabsShown\n } as WmTabsState, callback);\n }, 300);\n } else {\n callback && callback();\n }\n }\n\n addTabPane(tabPane: WmTabpane) {\n const i = this.tabPanes.findIndex(t => t.props.name === tabPane.props.name);\n if (i >= 0) {\n this.tabPanes[i] = tabPane;\n } else {\n this.tabPanes[this.newIndex++] = tabPane;\n }\n }\n\n selectTabPane(tabPane: WmTabpane) {\n this.goToTab(this.tabPanes.indexOf(tabPane));\n }\n\n get selectedTabPane() {\n return this.tabPanes[this.state.selectedTabIndex];\n }\n\n goToTab(index = this.state.selectedTabIndex) {\n if (index < 0 || index >= this.tabPanes.length) {\n return;\n }\n const position = -1 * index * (this.tabLayout?.width || 0);\n if(this.animationView) {\n this.animationView.setPosition(position)\n .then(() => this.onChange(index));\n } else {\n this.onChange(index);\n }\n }\n\n prev() {\n this.animationView?.goToLower();\n }\n\n next() {\n this.animationView?.goToLower();\n }\n\n onChange(newIndex: number) {\n if (newIndex < 0 || newIndex >= this.tabPanes.length) {\n return;\n }\n const oldIndex = this.state.selectedTabIndex;\n const deselectedTab = this.tabPanes[this.state.selectedTabIndex];\n this.newIndex = newIndex;\n deselectedTab?._onDeselect();\n this.updateState({\n selectedTabIndex: newIndex\n } as WmTabsState, () => {\n this.setTabShown(newIndex, () => {\n const selectedTab = this.tabPanes[newIndex];\n selectedTab?._onSelect();\n this.invokeEventCallback('onChange', [{}, this.proxy, newIndex, oldIndex]);\n });\n });\n }\n\n public renderSkeleton(props: WmTabsProps){\n const tabPanes = React.Children.toArray(this.props.children)\n .filter((item: any, index: number) => item.props.show != false);\n const headerData = tabPanes.map((p: any, i: number) =>\n ({title: p.props.title || 'Tab Title', icon: '', key: `tab-${p.props.title}-${i}`}));\n return(\n <View style={[this.styles.root, { borderBottomWidth: 0}]}>\n <View onLayout={this.setTabLayout.bind(this)} style={{width: '100%'}}></View>\n <WmTabheader\n styles={this.styles.tabHeader}\n data={headerData}\n showskeleton={this.props.showskeleton}\n selectedTabIndex={this.state.selectedTabIndex}\n ></WmTabheader>\n <View\n //{...this.panResponder.panHandlers}\n style={{\n width: '100%',\n //height: this.tabPaneHeights[this.state.selectedTabIndex],\n overflow: 'hidden'\n }} >\n <View style={{\n flexDirection: 'row',\n flexWrap: 'nowrap'\n }}>\n {tabPanes.map((p: any, i) => {\n return (\n <View\n key={`tab-${p.props.title}-${i}`}\n style={{width: '100%', alignSelf: 'flex-start'}}\n onLayout={this.setTabPaneHeights.bind(this, i)}>\n {/* {this.state.tabsShown[i] ? p : null} */}\n {p}\n </View>);\n })}\n </View>\n </View>\n </View>\n\n )\n }\n\n public onPropertyChange(name: string, $new: any, $old: any): void {\n super.onPropertyChange(name, $new, $old);\n switch(name) {\n case \"defaultpaneindex\":\n const selectedIndex = $new || 0;\n const tabsShown: boolean[] = [];\n tabsShown[selectedIndex] = true;\n this.updateState({\n selectedTabIndex: selectedIndex,\n tabsShown: tabsShown\n } as WmTabsState);\n }\n }\n\n renderWidget(props: WmTabsProps) {\n const tabPanes = React.Children.toArray(props.children)\n .filter((item: any, index: number) => item.props.show != false);\n const headerData = tabPanes.map((p: any, i: number) =>\n ({title: p.props.title || 'Tab Title', icon: p.props.paneicon || '', key: `tab-${p.props.title}-${i}`}));\n return (\n <View style={this.styles.root}>\n {this._background}\n <View onLayout={this.setTabLayout.bind(this)} style={{width: '100%'}}></View>\n <WmTabheader\n id={this.getTestId('headers')}\n styles={this.styles.tabHeader}\n data={headerData}\n selectedTabIndex={this.state.selectedTabIndex}\n onIndexChange={this.goToTab.bind(this)}\n ></WmTabheader>\n <View\n style={[{\n width: '100%',\n flex: 1\n }, this.styles.root.height ?\n (isWebPreviewMode() ? {'overflowX': 'hidden','overflowY': 'auto'} as any : {overflow: 'scroll'})\n : {\n overflow: 'hidden',\n maxHeight: this.tabPaneHeights[this.state.selectedTabIndex],\n }, this.styles.tabContent]} >\n <SwipeAnimation.View\n enableGestures={props.enablegestures}\n style={{\n flexDirection: 'row',\n flexWrap: 'nowrap',\n alignItems: 'flex-start'\n }}\n direction='horizontal'\n ref={(r) => {this.animationView = r}}\n handlers = {this.animationHandlers}\n >\n {tabPanes.map((p: any, i) => {\n return (\n <View\n key={`tab-${p.props.title}-${i}`}\n style={{\n width: '100%',\n height: this.styles.root.height ? undefined : 1000000,\n alignSelf: 'flex-start'}}>\n <View\n style={{width: '100%', alignSelf: 'flex-start'}}\n onLayout={this.setTabPaneHeights.bind(this, i)}>\n {/* {this.state.tabsShown[i] ? p : null} */}\n {p}\n </View>\n </View>);\n })}\n </SwipeAnimation.View>\n </View>\n </View>\n );\n }\n}\n"],"mappings":";;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAA6CC,IAAI,QAAQ,cAAc;AACvE,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,+CAA+C;AACjG,OAAO,KAAKC,cAAc,MAAM,oDAAoD;AACpF,SAASC,gBAAgB,QAAQ,sCAAsC;AAEvE,OAAOC,WAAW,MAAM,cAAc;AACtC,SAASC,aAAa,QAAsB,eAAe;AAE3D,OAAOC,WAAW,MAAM,iCAAiC;AAEzD,OAAO,MAAMC,WAAW,SAASN,kBAAkB,CAAc;EAAAO,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;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;QAClBiB,UAAU,EAAE;MACd,CAAE;MACFC,SAAS,EAAC,YAAY;MACtBC,GAAG,EAAGC,CAAC,IAAK;QAAC,IAAI,CAAC5D,aAAa,GAAG4D,CAAC;MAAA,CAAE;MACrCC,QAAQ,EAAI,IAAI,CAACC;IAAkB,GAElCnG,QAAQ,CAAC4D,GAAG,CAAC,CAACC,CAAM,EAAElC,CAAC,KAAK;MAC3B,oBACApD,KAAA,CAAA0F,aAAA,CAACzF,IAAI;QACHwF,GAAG,EAAE,OAAOH,CAAC,CAACxE,KAAK,CAACyE,KAAK,IAAInC,CAAC,EAAG;QACjCuC,KAAK,EAAE;UACLpE,KAAK,EAAE,MAAM;UACboB,MAAM,EAAE,IAAI,CAACiD,MAAM,CAACC,IAAI,CAAClD,MAAM,GAAIkF,SAAS,GAAG,OAAO;UACtDtB,SAAS,EAAE;QAAY;MAAE,gBAC3BvG,KAAA,CAAA0F,aAAA,CAACzF,IAAI;QACH0F,KAAK,EAAE;UAACpE,KAAK,EAAE,MAAM;UAAEgF,SAAS,EAAE;QAAY,CAAE;QAChDR,QAAQ,EAAE,IAAI,CAACxD,iBAAiB,CAACyD,IAAI,CAAC,IAAI,EAAE5C,CAAC;MAAE,GAE9CkC,CACG,CACF,CAAC;IACT,CAAC,CACkB,CACjB,CACF,CAAC;EAEX;AACF","ignoreList":[]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["BaseProps","WmTabsProps","constructor","args","_defineProperty"],"sources":["tabs.props.ts"],"sourcesContent":["import { BaseProps } from '@wavemaker/app-rn-runtime/core/base.component';\n\nexport default class WmTabsProps extends BaseProps {\n children
|
1
|
+
{"version":3,"names":["BaseProps","WmTabsProps","constructor","args","_defineProperty"],"sources":["tabs.props.ts"],"sourcesContent":["import { BaseProps } from '@wavemaker/app-rn-runtime/core/base.component';\n\nexport default class WmTabsProps extends BaseProps {\n children?: any;\n defaultpaneindex?: number = 0;\n enablegestures? = true;\n}\n"],"mappings":";;;AAAA,SAASA,SAAS,QAAQ,+CAA+C;AAEzE,eAAe,MAAMC,WAAW,SAASD,SAAS,CAAC;EAAAE,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAC,eAAA;IAAAA,eAAA,2BAErB,CAAC;IAAAA,eAAA,yBACX,IAAI;EAAA;AACxB","ignoreList":[]}
|
@@ -227,15 +227,28 @@ export default class WmList extends BaseComponent {
|
|
227
227
|
});
|
228
228
|
}
|
229
229
|
const data = isArray($new) ? $new : !isEmpty($new) && isDefined($new) ? [$new] : [];
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
(
|
238
|
-
|
230
|
+
if (props.orderby) {
|
231
|
+
const orderbyData = data && getGroupedData(data, props.groupby, props.match, props.orderby, props.dateformat, this);
|
232
|
+
this.updateState({
|
233
|
+
groupedData: orderbyData[0] ? [{
|
234
|
+
key: 'key',
|
235
|
+
data: orderbyData[0].data
|
236
|
+
}] : []
|
237
|
+
}, () => {
|
238
|
+
var _this$keyExtractor2;
|
239
|
+
(_this$keyExtractor2 = this.keyExtractor) === null || _this$keyExtractor2 === void 0 || _this$keyExtractor2.clear();
|
240
|
+
});
|
241
|
+
} else {
|
242
|
+
this.updateState({
|
243
|
+
groupedData: data[0] || props.direction === 'horizontal' ? [{
|
244
|
+
key: 'key',
|
245
|
+
data: data
|
246
|
+
}] : []
|
247
|
+
}, () => {
|
248
|
+
var _this$keyExtractor3;
|
249
|
+
(_this$keyExtractor3 = this.keyExtractor) === null || _this$keyExtractor3 === void 0 || _this$keyExtractor3.clear();
|
250
|
+
});
|
251
|
+
}
|
239
252
|
}
|
240
253
|
this.itemWidgets = [];
|
241
254
|
if (props.selectfirstitem) {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["React","ActivityIndicator","SectionList","Text","View","FlatList","isArray","isEmpty","isNil","isNumber","round","BaseComponent","BaseComponentState","getGroupedData","isDefined","Tappable","DefaultKeyExtractor","WmLabel","WmIcon","Swipeable","WmListProps","DEFAULT_CLASS","WmListState","constructor","args","_defineProperty","WmList","props","leftActionTemplate","createElement","Fragment","getTemplate","rightActionTemplate","updateState","maxRecordsToShow","state","pagesize","isSelected","$item","selectedItem","selecteditem","indexOf","onSelect","$index","$event","eventName","disableitem","multiselect","index","selectionlimit","length","push","invokeEventCallback","splice","proxy","selectedItemWidgets","itemWidgets","Promise","resolve","selectedindex","loadDataOnDemand","navigation","loadData","loadingData","dataset","setTimeout","$list","loadingdata","getNextPageData","currentPage","then","data","hasMoreData","catch","err","console","error","selectFirstItem","initialized","groupby","clear","groupedData","selectItem","item","getItem","deselect","selectedItemIndex","getWidgets","widgetname","map","filter","widget","undefined","deselectAll","setGroupData","items","dataItems","match","orderby","dateformat","_this$keyExtractor","keyExtractor","onPropertyChange","name","$new","$old","direction","key","_this$keyExtractor2","selectfirstitem","pop","componentDidMount","_props$dataset","subscribe","event","scrollPosition","nativeEvent","contentOffset","y","layoutMeasurement","height","endThreshold","componentDidUpdate","prevProps","prevState","snapshot","getDefaultStyles","isHorizontal","theme","getStyle","defaultClass","getIndex","generateItemKey","itemkey","_showSkeleton","getKey","renderItem","cols","getNoOfColumns","renderLeftActions","renderRightActions","containerStyle","width","flex","style","styles","itemclass","_extends","getTestPropsForAction","onTap","onLongTap","onDoubleTap","display","flexDirection","paddingRight","marginRight","margin","id","getTestId","iconclass","selectedIcon","renderHeader","title","groupHeading","accessibilityRole","subheading","heading","listIcon","caption","accessibilityrole","renderEmptyMessage","emptyMessage","nodatamessage","renderLoadingIcon","loadingicon","loadingIcon","loadingdatamsg","color","text","itemsperrow","xs","onLayoutChange","e","l","layout","renderWithFlatList","root","onLayout","v","i","group","scrollEnabled","horizontal","ListEmptyComponent","itemInfo","numColumns","onDemandMessage","ondemandmessage","getSectionListData","renderWithSectionList","contentContainerStyle","sections","renderSectionHeader","section","renderSectionFooter","renderWidget","_background"],"sources":["list.component.tsx"],"sourcesContent":["import React from 'react';\nimport { ActivityIndicator, SectionList, Text, View, FlatList, LayoutChangeEvent, TouchableOpacity} from 'react-native';\nimport { isArray, isEmpty, isNil, isNumber, round } from 'lodash-es';\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\nimport {getGroupedData, isDefined} from \"@wavemaker/app-rn-runtime/core/utils\";\nimport { Tappable } from '@wavemaker/app-rn-runtime/core/tappable.component';\nimport { DefaultKeyExtractor } from '@wavemaker/app-rn-runtime/core/key.extractor';\nimport WmLabel from '@wavemaker/app-rn-runtime/components/basic/label/label.component';\nimport WmIcon from '@wavemaker/app-rn-runtime/components/basic/icon/icon.component';\nimport { Swipeable } from 'react-native-gesture-handler';\nimport WmListActionTemplate from './list-action-template/list-action-template.component';\n\nimport WmListProps from './list.props';\nimport { DEFAULT_CLASS, WmListStyles } from './list.styles';\n\n\nexport class WmListState extends BaseComponentState<WmListProps> {\n public selectedindex: any;\n groupedData: Array<any> = [];\n currentPage = 1;\n maxRecordsToShow = 20;\n}\n\nexport default class WmList extends BaseComponent<WmListProps, WmListState, WmListStyles> {\n\n private itemWidgets = [] as any[];\n private selectedItemWidgets = {} as any;\n private keyExtractor = new DefaultKeyExtractor();\n private endThreshold = -1;\n private loadingData = false;\n private hasMoreData = true;\n public leftActionTemplate?: WmListActionTemplate;\n public rightActionTemplate?: WmListActionTemplate;\n\n constructor(props: WmListProps) {\n super(props, DEFAULT_CLASS, new WmListProps(), new WmListState());\n this.updateState({\n maxRecordsToShow: this.state.props.pagesize\n } as WmListState);\n }\n\n private isSelected($item: any) {\n const selectedItem = this.state.props.selecteditem;\n if (isArray(selectedItem)) {\n return selectedItem.indexOf($item) >= 0;\n }\n return selectedItem === $item;\n }\n\n private async onSelect($item: any, $index: number | string, $event?: any) {\n const props = this.state.props;\n let selectedItem = null as any;\n let eventName = 'onSelect';\n if (props.disableitem !== true\n && (typeof props.disableitem !== 'function' || !props.disableitem($item, $index))) {\n if (props.multiselect) {\n selectedItem = [...(props.selecteditem || [])];\n const index = selectedItem.indexOf($item);\n if (index < 0) {\n if ((!props.selectionlimit)\n || props.selectionlimit < 0\n || selectedItem.length < props.selectionlimit) {\n selectedItem.push($item);\n } else {\n this.invokeEventCallback('onSelectionlimitexceed', [null, this]);\n }\n } else {\n selectedItem.splice(index, 1);\n eventName = 'onDeselect';\n }\n } else {\n this.state.props.selecteditem && this.invokeEventCallback('onDeselect', [this.proxy, this.state.props.selecteditem]);\n selectedItem = $item;\n }\n this.selectedItemWidgets = this.itemWidgets[$index as number];\n return new Promise(resolve => {\n this.updateState({\n props: { selecteditem: selectedItem },\n selectedindex: $index\n } as WmListState, () => {\n this.invokeEventCallback(eventName, [this.proxy, $item]);\n $event && this.invokeEventCallback('onTap', [$event, this.proxy]);\n resolve(null);\n });\n });\n } else {\n return Promise.resolve(null);\n }\n }\n\n private get loadDataOnDemand() {\n const navigation = this.state.props.navigation;\n return navigation === 'Scroll' || navigation === 'On-Demand';\n }\n\n renderLeftActions = () => {\n return this.leftActionTemplate ? (\n <>\n {this.leftActionTemplate.getTemplate()}\n </>\n ) : null;\n };\n\n renderRightActions = () => {\n return this.rightActionTemplate ? (\n <>\n {this.rightActionTemplate.getTemplate()}\n </>\n ) : null;\n };\n\n private loadData() {\n if (this.loadingData) {\n return;\n }\n if (isArray(this.state.props.dataset)\n && this.state.props.dataset.length > this.state.maxRecordsToShow) {\n this.loadingData = true;\n this.updateState({\n maxRecordsToShow: this.state.maxRecordsToShow + this.state.props.pagesize\n } as WmListState);\n setTimeout(() => {\n this.loadingData = false;\n }, 100);\n } else if (this.loadDataOnDemand) {\n const $list = this.proxy as any;\n $list.loadingdata = true;\n this.loadingData = true;\n this.props.getNextPageData && this.props.getNextPageData(null, this.proxy, this.state.currentPage + 1).then((data) => {\n if (isArray(data) && data.length > 0\n && isArray(this.state.props.dataset)) {\n $list.dataset = [...this.state.props.dataset, ...data];\n this.updateState({\n currentPage : this.state.currentPage + 1,\n maxRecordsToShow: this.state.maxRecordsToShow + this.state.props.pagesize\n } as WmListState);\n this.hasMoreData = true;\n } else {\n this.hasMoreData = false;\n }\n }).catch((err) => {\n console.error(err);\n }).then(() => {\n setTimeout(() => {\n $list.loadingdata = false;\n }, 1000);\n });\n }\n }\n\n private selectFirstItem() {\n const props = this.state.props;\n if (this.initialized\n && props.dataset\n && props.dataset.length) {\n const index = props.groupby ? '00': 0;\n this.onSelect(props.dataset[0], index);\n }\n }\n\n clear(){\n this.updateState({\n groupedData: {},\n } as WmListState);\n }\n\n selectItem(item: any){\n const dataset = this.state.props.dataset;\n if(isNumber(item)){\n this.onSelect(dataset[item], item);\n }\n else{\n let index = dataset.indexOf(item);\n this.onSelect(dataset[index], index);\n }\n }\n\n getItem(index: number){\n const props = this.state.props;\n return this.props.dataset[index]\n }\n\n deselect(item: any){\n const props = this.state.props;\n let selectedItem = null as any;\n let index = isNumber(item)?item:props.dataset.indexOf(item);\n if(props.multiselect && index >= 0){\n selectedItem = [...(props.selecteditem || [])];\n let selectedItemIndex = selectedItem.indexOf(props.dataset[index])\n if(selectedItemIndex >= 0){\n selectedItem.splice(selectedItemIndex, 1);\n }\n }\n else{\n if (props.selecteditem === props.dataset[index]) {\n selectedItem = null;\n }\n }\n this.updateState({\n props: { selecteditem: selectedItem },\n\n } as WmListState, () => {\n this.invokeEventCallback('onDeselect', [this.proxy, item]);\n });\n }\n\n getWidgets(widgetname: string, index: number){\n if(index >= 0 && index < this.itemWidgets.length){\n return this.itemWidgets[index][widgetname]\n }\n else{\n return this.itemWidgets.map(item => item[widgetname]).filter(widget => widget !== undefined);\n }\n }\n\n private deselectAll() {\n this.updateState({\n props: { selecteditem: null },\n selectedindex: -1\n } as WmListState);\n }\n\n setGroupData(items: any) {\n const dataItems = items;\n const props = this.state.props;\n if (props.groupby) {\n const groupedData = dataItems && getGroupedData(dataItems, props.groupby, props.match, props.orderby, props.dateformat, this);\n this.updateState({\n groupedData: groupedData\n } as WmListState, () => {\n this.keyExtractor?.clear();\n });\n }\n }\n\n public onPropertyChange(name: string, $new: any, $old: any) {\n super.onPropertyChange(name, $new, $old);\n const props = this.state.props;\n switch(name) {\n case 'selectfirstitem':\n if ($new) {\n this.selectFirstItem();\n }\n break;\n case 'dataset':\n if (this.state.props.groupby) {\n this.setGroupData($new);\n } else {\n if (!($old && $old.length)\n && $new && $new.length\n && this.loadDataOnDemand) {\n this.updateState({\n props: {\n dataset: [...$new]\n }\n } as WmListState);\n }\n const data = isArray($new) ? $new : (!isEmpty($new) && isDefined($new) ? [$new] : []);\n this.updateState({\n groupedData: (data[0] || props.direction === 'horizontal' ? [{\n key: 'key',\n data: data\n }] : [])\n } as WmListState, () => {\n this.keyExtractor?.clear();\n });\n }\n this.itemWidgets = [];\n if (props.selectfirstitem) {\n this.selectFirstItem();\n } else {\n this.deselectAll();\n }\n break;\n case 'groupby':\n case 'match':\n this.setGroupData(this.state.props.dataset);\n break;\n case 'multiselect':\n if ($new) {\n if (!isArray(this.state.props.selecteditem)) {\n this.state.props.selecteditem = this.state.props.selecteditem ?\n [this.state.props.selecteditem] : [];\n }\n } else if (isArray(this.state.props.selecteditem)) {\n this.state.props.selecteditem = this.state.props.selecteditem.pop();\n }\n break;\n case 'loadingdata':\n this.loadingData = $new && this.loadingData;\n break;\n case 'selecteditem':\n if($new != $old && isNumber($new)) {\n this.selectItem(this.state.props.dataset[$new])\n }\n break;\n }\n }\n\n componentDidMount() {\n const props = this.state.props;\n if (this.state.props.selectfirstitem && props.dataset?.length) {\n setTimeout(() => {\n this.onSelect(props.dataset[0], 0);\n });\n }\n this.subscribe('scroll', (event: any) => {\n const scrollPosition = event.nativeEvent.contentOffset.y + event.nativeEvent.layoutMeasurement.height;\n if (scrollPosition > this.endThreshold && this.state.props.direction === 'vertical') {\n this.loadData();\n }\n });\n super.componentDidMount();\n }\n\n componentDidUpdate(prevProps: WmListProps, prevState: WmListState, snapshot?: any) {\n super.componentDidUpdate && super.componentDidUpdate(prevProps, prevState, snapshot);\n this.invokeEventCallback('onRender', [this, this.state.props.dataset]);\n }\n\n getDefaultStyles() {\n const isHorizontal = this.state.props.direction === 'horizontal';\n return this.theme.getStyle(`${this.defaultClass} ${isHorizontal ? 'app-horizontal-list' : 'app-vertical-list'}`);\n }\n\n getIndex(item: any) {\n return this.state.props.dataset.indexOf(item);\n }\n\n private generateItemKey(item: any, index: number, props: WmListProps) {\n if (props.itemkey && item && !this._showSkeleton) {\n return props.itemkey(item, index);\n }\n return 'list_item_' + this.keyExtractor.getKey(item, true);\n }\n\n private renderItem(item: any, index: number, props: WmListProps) {\n const cols = this. getNoOfColumns();\n const isHorizontal = (props.direction === 'horizontal');\n return (index < this.state.maxRecordsToShow || isHorizontal) ? (\n <Swipeable\n renderLeftActions={() => this.renderLeftActions()}\n renderRightActions={() => this.renderRightActions()} containerStyle={ cols ? { width: round(100/cols) + \"%\" , flex: null } as any :{}}>\n <View style={[\n this.styles.item,\n props.itemclass ? this.theme.getStyle(props.itemclass(item, index)) : null,\n this.isSelected(item) ? this.styles.selectedItem : {}]}>\n <Tappable\n {...this.getTestPropsForAction(`item${index}`)}\n onTap={($event) => this.onSelect(item, index, $event)}\n onLongTap={() => this.invokeEventCallback('onLongtap', [null, this.proxy])}\n onDoubleTap={() => this.invokeEventCallback('onDoubletap', [null, this.proxy])}\n styles={\n [{display: 'flex', flexDirection : 'row'},\n cols ? {\n width: '100%'\n } : null,\n (cols && cols > 1) || isHorizontal ? {\n paddingRight: (isNil(this.styles.item.marginRight)\n ? this.styles.item.margin : this.styles.item.marginRight) || 4\n } : null\n ]\n }>\n {props.renderItem(item, index, this)}\n {this.isSelected(item) ? (\n <WmIcon id={this.getTestId('icon' + index)} iconclass='wi wi-check-circle' styles={this.styles.selectedIcon} />\n ) : null}\n </Tappable>\n </View>\n </Swipeable>\n ) : null;\n }\n\n private renderHeader(props: WmListProps, title: string) {\n return props.groupby ? (\n <Text style={this.styles.groupHeading} accessibilityRole='header'>{title}</Text>\n ) : (props.iconclass || props.title || props.subheading) ? (\n <View style={this.styles.heading}>\n <View style={{flex: 1, flexDirection: 'row'}}>\n <WmIcon id={this.getTestId('icon')} styles={this.styles.listIcon} iconclass={props.iconclass}></WmIcon>\n <View>\n <WmLabel id={this.getTestId('title')} styles={this.styles.title} caption={props.title} accessibilityrole='header'></WmLabel>\n <WmLabel id={this.getTestId('subheading')} styles={this.styles.subheading} caption={props.subheading}></WmLabel>\n </View>\n </View>\n </View>) : null;\n }\n\n private renderEmptyMessage(isHorizontal: boolean, item: any, index: any, props: WmListProps) {\n return (<WmLabel id={this.getTestId('emptymsg')} styles={this.styles.emptyMessage} caption={props.nodatamessage}></WmLabel>);\n }\n\n private renderLoadingIcon(props: WmListProps) {\n return props.loadingicon ? (<WmIcon\n id={this.getTestId('loadingicon')}\n styles={this.styles.loadingIcon}\n iconclass={props.loadingicon}\n caption={props.loadingdatamsg}></WmIcon>)\n : (\n <ActivityIndicator color={this.styles.loadingIcon.text.color}></ActivityIndicator>\n );\n }\n\n public getNoOfColumns() {\n const props = this.state.props;\n if(props.direction === 'vertical') {\n return props.itemsperrow.xs;\n }\n return 0;\n }\n\n private onLayoutChange(e: LayoutChangeEvent) {\n const l = e.nativeEvent.layout;\n this.endThreshold = l.height + l.y - 100;\n if (!this.endThreshold) {\n this.endThreshold = -1;\n }\n }\n\n private renderWithFlatList(props: WmListProps, isHorizontal = false) {\n return (\n <View style={this.styles.root} onLayout={e => this.onLayoutChange(e)}>\n {!isEmpty(this.state.groupedData) ? this.state.groupedData.map((v: any, i) => ((\n <View style={this.styles.group} key={v.key || this.keyExtractor.getKey(v, true)}>\n {this.renderHeader(props, v.key)}\n <FlatList\n key={props.name + '_' + (isHorizontal ? 'H' : 'V') + props.itemsperrow.xs}\n keyExtractor={(item, i) => this.generateItemKey(item, i, props)}\n scrollEnabled={isHorizontal}\n horizontal = {isHorizontal}\n data={isEmpty(v.data[0]) ? []: v.data}\n ListEmptyComponent = {(itemInfo) => this.renderEmptyMessage(isHorizontal, itemInfo.item, itemInfo.index, props)}\n renderItem={(itemInfo) => this.renderItem(itemInfo.item, itemInfo.index, props)}\n {...(isHorizontal ? {} : {numColumns : this.getNoOfColumns()})}>\n </FlatList>\n {this.loadDataOnDemand || (v.data.length > this.state.maxRecordsToShow) ?\n (this.loadingData ?\n this.renderLoadingIcon(props) :\n (<WmLabel id={this.getTestId('ondemandmessage')}\n styles={this.styles.onDemandMessage}\n caption={this.hasMoreData && !isHorizontal ? props.ondemandmessage : props.nodatamessage}\n onTap={() => this.loadData()}></WmLabel>))\n : null}\n </View>\n ))) : this.renderEmptyMessage(isHorizontal, null, null,props)\n }\n </View>);\n }\n\n private getSectionListData() {\n if (this._showSkeleton) {\n return [{\n key: '',\n data: [{}, {}, {}]\n }];\n } else if (this.state.groupedData\n && this.state.groupedData[0]\n && this.state.groupedData[0]['data'].length) {\n return this.state.groupedData;\n }\n return [];\n }\n\n private renderWithSectionList(props: WmListProps, isHorizontal = false) {\n return (\n <SectionList\n keyExtractor={(item, i) => this.generateItemKey(item, i, props)}\n horizontal = {isHorizontal}\n contentContainerStyle={this.styles.root}\n sections={this.getSectionListData()}\n renderSectionHeader={({ section: {key, data}}) => {\n return this.renderHeader(props, key);\n }}\n renderSectionFooter={() => props.loadingdata ? this.renderLoadingIcon(props) : null}\n ListEmptyComponent = {(itemInfo) => this.renderEmptyMessage(isHorizontal, itemInfo.item, itemInfo.index, props)}\n renderItem={(itemInfo) => this.renderItem(itemInfo.item, itemInfo.index, props)}>\n </SectionList>\n );\n }\n\n renderWidget(props: WmListProps) {\n this.invokeEventCallback('onBeforedatarender', [this, this.state.props.dataset]);\n const isHorizontal = (props.direction === 'horizontal');\n return (\n <View style={isHorizontal ? null : { width: '100%' }}>\n {this._background}\n {(isHorizontal || !props.groupby) ?\n this.renderWithFlatList(props, isHorizontal)\n : this.renderWithSectionList(props, isHorizontal)}\n </View>);\n }\n}\n"],"mappings":";;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,iBAAiB,EAAEC,WAAW,EAAEC,IAAI,EAAEC,IAAI,EAAEC,QAAQ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/G,IAAI,EAAE+G,QAAQ,CAAClJ,KAAK,EAAErB,KAAK,CAAE;MAChH6G,UAAU,EAAG0D,QAAQ,IAAK,IAAI,CAAC1D,UAAU,CAAC0D,QAAQ,CAAC/G,IAAI,EAAE+G,QAAQ,CAAClJ,KAAK,EAAErB,KAAK;IAAE,CACrE,CAAC;EAElB;EAEAkL,YAAYA,CAAClL,KAAkB,EAAE;IAC/B,IAAI,CAACyB,mBAAmB,CAAC,oBAAoB,EAAE,CAAC,IAAI,EAAE,IAAI,CAACjB,KAAK,CAACR,KAAK,CAACqC,OAAO,CAAC,CAAC;IAChF,MAAM+D,YAAY,GAAIpG,KAAK,CAAC+E,SAAS,KAAK,YAAa;IACvD,oBACI1G,KAAA,CAAA6B,aAAA,CAACzB,IAAI;MAAC4I,KAAK,EAAEjB,YAAY,GAAG,IAAI,GAAG;QAAEe,KAAK,EAAE;MAAO;IAAE,GAClD,IAAI,CAACgE,WAAW,EACf/E,YAAY,IAAI,CAACpG,KAAK,CAACoD,OAAO,GAC9B,IAAI,CAAC0G,kBAAkB,CAAC9J,KAAK,EAAEoG,YAAY,CAAC,GAC5C,IAAI,CAACwE,qBAAqB,CAAC5K,KAAK,EAAEoG,YAAY,CAC9C,CAAC;EACX;AACF","ignoreList":[]}
|
1
|
+
{"version":3,"names":["React","ActivityIndicator","SectionList","Text","View","FlatList","isArray","isEmpty","isNil","isNumber","round","BaseComponent","BaseComponentState","getGroupedData","isDefined","Tappable","DefaultKeyExtractor","WmLabel","WmIcon","Swipeable","WmListProps","DEFAULT_CLASS","WmListState","constructor","args","_defineProperty","WmList","props","leftActionTemplate","createElement","Fragment","getTemplate","rightActionTemplate","updateState","maxRecordsToShow","state","pagesize","isSelected","$item","selectedItem","selecteditem","indexOf","onSelect","$index","$event","eventName","disableitem","multiselect","index","selectionlimit","length","push","invokeEventCallback","splice","proxy","selectedItemWidgets","itemWidgets","Promise","resolve","selectedindex","loadDataOnDemand","navigation","loadData","loadingData","dataset","setTimeout","$list","loadingdata","getNextPageData","currentPage","then","data","hasMoreData","catch","err","console","error","selectFirstItem","initialized","groupby","clear","groupedData","selectItem","item","getItem","deselect","selectedItemIndex","getWidgets","widgetname","map","filter","widget","undefined","deselectAll","setGroupData","items","dataItems","match","orderby","dateformat","_this$keyExtractor","keyExtractor","onPropertyChange","name","$new","$old","orderbyData","key","_this$keyExtractor2","direction","_this$keyExtractor3","selectfirstitem","pop","componentDidMount","_props$dataset","subscribe","event","scrollPosition","nativeEvent","contentOffset","y","layoutMeasurement","height","endThreshold","componentDidUpdate","prevProps","prevState","snapshot","getDefaultStyles","isHorizontal","theme","getStyle","defaultClass","getIndex","generateItemKey","itemkey","_showSkeleton","getKey","renderItem","cols","getNoOfColumns","renderLeftActions","renderRightActions","containerStyle","width","flex","style","styles","itemclass","_extends","getTestPropsForAction","onTap","onLongTap","onDoubleTap","display","flexDirection","paddingRight","marginRight","margin","id","getTestId","iconclass","selectedIcon","renderHeader","title","groupHeading","accessibilityRole","subheading","heading","listIcon","caption","accessibilityrole","renderEmptyMessage","emptyMessage","nodatamessage","renderLoadingIcon","loadingicon","loadingIcon","loadingdatamsg","color","text","itemsperrow","xs","onLayoutChange","e","l","layout","renderWithFlatList","root","onLayout","v","i","group","scrollEnabled","horizontal","ListEmptyComponent","itemInfo","numColumns","onDemandMessage","ondemandmessage","getSectionListData","renderWithSectionList","contentContainerStyle","sections","renderSectionHeader","section","renderSectionFooter","renderWidget","_background"],"sources":["list.component.tsx"],"sourcesContent":["import React from 'react';\nimport { ActivityIndicator, SectionList, Text, View, FlatList, LayoutChangeEvent, TouchableOpacity} from 'react-native';\nimport { isArray, isEmpty, isNil, isNumber, round } from 'lodash-es';\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\nimport {getGroupedData, isDefined} from \"@wavemaker/app-rn-runtime/core/utils\";\nimport { Tappable } from '@wavemaker/app-rn-runtime/core/tappable.component';\nimport { DefaultKeyExtractor } from '@wavemaker/app-rn-runtime/core/key.extractor';\nimport WmLabel from '@wavemaker/app-rn-runtime/components/basic/label/label.component';\nimport WmIcon from '@wavemaker/app-rn-runtime/components/basic/icon/icon.component';\nimport { Swipeable } from 'react-native-gesture-handler';\nimport WmListActionTemplate from './list-action-template/list-action-template.component';\n\nimport WmListProps from './list.props';\nimport { DEFAULT_CLASS, WmListStyles } from './list.styles';\n\n\nexport class WmListState extends BaseComponentState<WmListProps> {\n public selectedindex: any;\n groupedData: Array<any> = [];\n currentPage = 1;\n maxRecordsToShow = 20;\n}\n\nexport default class WmList extends BaseComponent<WmListProps, WmListState, WmListStyles> {\n\n private itemWidgets = [] as any[];\n private selectedItemWidgets = {} as any;\n private keyExtractor = new DefaultKeyExtractor();\n private endThreshold = -1;\n private loadingData = false;\n private hasMoreData = true;\n public leftActionTemplate?: WmListActionTemplate;\n public rightActionTemplate?: WmListActionTemplate;\n\n constructor(props: WmListProps) {\n super(props, DEFAULT_CLASS, new WmListProps(), new WmListState());\n this.updateState({\n maxRecordsToShow: this.state.props.pagesize\n } as WmListState);\n }\n\n private isSelected($item: any) {\n const selectedItem = this.state.props.selecteditem;\n if (isArray(selectedItem)) {\n return selectedItem.indexOf($item) >= 0;\n }\n return selectedItem === $item;\n }\n\n private async onSelect($item: any, $index: number | string, $event?: any) {\n const props = this.state.props;\n let selectedItem = null as any;\n let eventName = 'onSelect';\n if (props.disableitem !== true\n && (typeof props.disableitem !== 'function' || !props.disableitem($item, $index))) {\n if (props.multiselect) {\n selectedItem = [...(props.selecteditem || [])];\n const index = selectedItem.indexOf($item);\n if (index < 0) {\n if ((!props.selectionlimit)\n || props.selectionlimit < 0\n || selectedItem.length < props.selectionlimit) {\n selectedItem.push($item);\n } else {\n this.invokeEventCallback('onSelectionlimitexceed', [null, this]);\n }\n } else {\n selectedItem.splice(index, 1);\n eventName = 'onDeselect';\n }\n } else {\n this.state.props.selecteditem && this.invokeEventCallback('onDeselect', [this.proxy, this.state.props.selecteditem]);\n selectedItem = $item;\n }\n this.selectedItemWidgets = this.itemWidgets[$index as number];\n return new Promise(resolve => {\n this.updateState({\n props: { selecteditem: selectedItem },\n selectedindex: $index\n } as WmListState, () => {\n this.invokeEventCallback(eventName, [this.proxy, $item]);\n $event && this.invokeEventCallback('onTap', [$event, this.proxy]);\n resolve(null);\n });\n });\n } else {\n return Promise.resolve(null);\n }\n }\n\n private get loadDataOnDemand() {\n const navigation = this.state.props.navigation;\n return navigation === 'Scroll' || navigation === 'On-Demand';\n }\n\n renderLeftActions = () => {\n return this.leftActionTemplate ? (\n <>\n {this.leftActionTemplate.getTemplate()}\n </>\n ) : null;\n };\n\n renderRightActions = () => {\n return this.rightActionTemplate ? (\n <>\n {this.rightActionTemplate.getTemplate()}\n </>\n ) : null;\n };\n\n private loadData() {\n if (this.loadingData) {\n return;\n }\n if (isArray(this.state.props.dataset)\n && this.state.props.dataset.length > this.state.maxRecordsToShow) {\n this.loadingData = true;\n this.updateState({\n maxRecordsToShow: this.state.maxRecordsToShow + this.state.props.pagesize\n } as WmListState);\n setTimeout(() => {\n this.loadingData = false;\n }, 100);\n } else if (this.loadDataOnDemand) {\n const $list = this.proxy as any;\n $list.loadingdata = true;\n this.loadingData = true;\n this.props.getNextPageData && this.props.getNextPageData(null, this.proxy, this.state.currentPage + 1).then((data) => {\n if (isArray(data) && data.length > 0\n && isArray(this.state.props.dataset)) {\n $list.dataset = [...this.state.props.dataset, ...data];\n this.updateState({\n currentPage : this.state.currentPage + 1,\n maxRecordsToShow: this.state.maxRecordsToShow + this.state.props.pagesize\n } as WmListState);\n this.hasMoreData = true;\n } else {\n this.hasMoreData = false;\n }\n }).catch((err) => {\n console.error(err);\n }).then(() => {\n setTimeout(() => {\n $list.loadingdata = false;\n }, 1000);\n });\n }\n }\n\n private selectFirstItem() {\n const props = this.state.props;\n if (this.initialized\n && props.dataset\n && props.dataset.length) {\n const index = props.groupby ? '00': 0;\n this.onSelect(props.dataset[0], index);\n }\n }\n\n clear(){\n this.updateState({\n groupedData: {},\n } as WmListState);\n }\n\n selectItem(item: any){\n const dataset = this.state.props.dataset;\n if(isNumber(item)){\n this.onSelect(dataset[item], item);\n }\n else{\n let index = dataset.indexOf(item);\n this.onSelect(dataset[index], index);\n }\n }\n\n getItem(index: number){\n const props = this.state.props;\n return this.props.dataset[index]\n }\n\n deselect(item: any){\n const props = this.state.props;\n let selectedItem = null as any;\n let index = isNumber(item)?item:props.dataset.indexOf(item);\n if(props.multiselect && index >= 0){\n selectedItem = [...(props.selecteditem || [])];\n let selectedItemIndex = selectedItem.indexOf(props.dataset[index])\n if(selectedItemIndex >= 0){\n selectedItem.splice(selectedItemIndex, 1);\n }\n }\n else{\n if (props.selecteditem === props.dataset[index]) {\n selectedItem = null;\n }\n }\n this.updateState({\n props: { selecteditem: selectedItem },\n\n } as WmListState, () => {\n this.invokeEventCallback('onDeselect', [this.proxy, item]);\n });\n }\n\n getWidgets(widgetname: string, index: number){\n if(index >= 0 && index < this.itemWidgets.length){\n return this.itemWidgets[index][widgetname]\n }\n else{\n return this.itemWidgets.map(item => item[widgetname]).filter(widget => widget !== undefined);\n }\n }\n\n private deselectAll() {\n this.updateState({\n props: { selecteditem: null },\n selectedindex: -1\n } as WmListState);\n }\n\n setGroupData(items: any) {\n const dataItems = items;\n const props = this.state.props;\n if (props.groupby) {\n const groupedData = dataItems && getGroupedData(dataItems, props.groupby, props.match, props.orderby, props.dateformat, this);\n this.updateState({\n groupedData: groupedData\n } as WmListState, () => {\n this.keyExtractor?.clear();\n });\n }\n }\n\n public onPropertyChange(name: string, $new: any, $old: any) {\n super.onPropertyChange(name, $new, $old);\n const props = this.state.props;\n switch(name) {\n case 'selectfirstitem':\n if ($new) {\n this.selectFirstItem();\n }\n break;\n case 'dataset':\n if (this.state.props.groupby) {\n this.setGroupData($new);\n } else {\n if (!($old && $old.length)\n && $new && $new.length\n && this.loadDataOnDemand) {\n this.updateState({\n props: {\n dataset: [...$new]\n }\n } as WmListState);\n }\n const data = isArray($new) ? $new : (!isEmpty($new) && isDefined($new) ? [$new] : []);\n if(props.orderby) {\n const orderbyData = data && getGroupedData(data, props.groupby, props.match, props.orderby, props.dateformat, this);\n this.updateState({\n groupedData: (orderbyData[0] ? [{\n key: 'key',\n data: orderbyData[0].data\n }] : [])\n } as WmListState, () => {\n this.keyExtractor?.clear();\n });\n } else {\n this.updateState({\n groupedData: (data[0] || props.direction === 'horizontal' ? [{\n key: 'key',\n data: data\n }] : [])\n } as WmListState, () => {\n this.keyExtractor?.clear();\n });\n }\n }\n this.itemWidgets = [];\n if (props.selectfirstitem) {\n this.selectFirstItem();\n } else {\n this.deselectAll();\n }\n break;\n case 'groupby':\n case 'match':\n this.setGroupData(this.state.props.dataset);\n break;\n case 'multiselect':\n if ($new) {\n if (!isArray(this.state.props.selecteditem)) {\n this.state.props.selecteditem = this.state.props.selecteditem ?\n [this.state.props.selecteditem] : [];\n }\n } else if (isArray(this.state.props.selecteditem)) {\n this.state.props.selecteditem = this.state.props.selecteditem.pop();\n }\n break;\n case 'loadingdata':\n this.loadingData = $new && this.loadingData;\n break;\n case 'selecteditem':\n if($new != $old && isNumber($new)) {\n this.selectItem(this.state.props.dataset[$new])\n }\n break;\n }\n }\n\n componentDidMount() {\n const props = this.state.props;\n if (this.state.props.selectfirstitem && props.dataset?.length) {\n setTimeout(() => {\n this.onSelect(props.dataset[0], 0);\n });\n }\n this.subscribe('scroll', (event: any) => {\n const scrollPosition = event.nativeEvent.contentOffset.y + event.nativeEvent.layoutMeasurement.height;\n if (scrollPosition > this.endThreshold && this.state.props.direction === 'vertical') {\n this.loadData();\n }\n });\n super.componentDidMount();\n }\n\n componentDidUpdate(prevProps: WmListProps, prevState: WmListState, snapshot?: any) {\n super.componentDidUpdate && super.componentDidUpdate(prevProps, prevState, snapshot);\n this.invokeEventCallback('onRender', [this, this.state.props.dataset]);\n }\n\n getDefaultStyles() {\n const isHorizontal = this.state.props.direction === 'horizontal';\n return this.theme.getStyle(`${this.defaultClass} ${isHorizontal ? 'app-horizontal-list' : 'app-vertical-list'}`);\n }\n\n getIndex(item: any) {\n return this.state.props.dataset.indexOf(item);\n }\n\n private generateItemKey(item: any, index: number, props: WmListProps) {\n if (props.itemkey && item && !this._showSkeleton) {\n return props.itemkey(item, index);\n }\n return 'list_item_' + this.keyExtractor.getKey(item, true);\n }\n\n private renderItem(item: any, index: number, props: WmListProps) {\n const cols = this. getNoOfColumns();\n const isHorizontal = (props.direction === 'horizontal');\n return (index < this.state.maxRecordsToShow || isHorizontal) ? (\n <Swipeable\n renderLeftActions={() => this.renderLeftActions()}\n renderRightActions={() => this.renderRightActions()} containerStyle={ cols ? { width: round(100/cols) + \"%\" , flex: null } as any :{}}>\n <View style={[\n this.styles.item,\n props.itemclass ? this.theme.getStyle(props.itemclass(item, index)) : null,\n this.isSelected(item) ? this.styles.selectedItem : {}]}>\n <Tappable\n {...this.getTestPropsForAction(`item${index}`)}\n onTap={($event) => this.onSelect(item, index, $event)}\n onLongTap={() => this.invokeEventCallback('onLongtap', [null, this.proxy])}\n onDoubleTap={() => this.invokeEventCallback('onDoubletap', [null, this.proxy])}\n styles={\n [{display: 'flex', flexDirection : 'row'},\n cols ? {\n width: '100%'\n } : null,\n (cols && cols > 1) || isHorizontal ? {\n paddingRight: (isNil(this.styles.item.marginRight)\n ? this.styles.item.margin : this.styles.item.marginRight) || 4\n } : null\n ]\n }>\n {props.renderItem(item, index, this)}\n {this.isSelected(item) ? (\n <WmIcon id={this.getTestId('icon' + index)} iconclass='wi wi-check-circle' styles={this.styles.selectedIcon} />\n ) : null}\n </Tappable>\n </View>\n </Swipeable>\n ) : null;\n }\n\n private renderHeader(props: WmListProps, title: string) {\n return props.groupby ? (\n <Text style={this.styles.groupHeading} accessibilityRole='header'>{title}</Text>\n ) : (props.iconclass || props.title || props.subheading) ? (\n <View style={this.styles.heading}>\n <View style={{flex: 1, flexDirection: 'row'}}>\n <WmIcon id={this.getTestId('icon')} styles={this.styles.listIcon} iconclass={props.iconclass}></WmIcon>\n <View>\n <WmLabel id={this.getTestId('title')} styles={this.styles.title} caption={props.title} accessibilityrole='header'></WmLabel>\n <WmLabel id={this.getTestId('subheading')} styles={this.styles.subheading} caption={props.subheading}></WmLabel>\n </View>\n </View>\n </View>) : null;\n }\n\n private renderEmptyMessage(isHorizontal: boolean, item: any, index: any, props: WmListProps) {\n return (<WmLabel id={this.getTestId('emptymsg')} styles={this.styles.emptyMessage} caption={props.nodatamessage}></WmLabel>);\n }\n\n private renderLoadingIcon(props: WmListProps) {\n return props.loadingicon ? (<WmIcon\n id={this.getTestId('loadingicon')}\n styles={this.styles.loadingIcon}\n iconclass={props.loadingicon}\n caption={props.loadingdatamsg}></WmIcon>)\n : (\n <ActivityIndicator color={this.styles.loadingIcon.text.color}></ActivityIndicator>\n );\n }\n\n public getNoOfColumns() {\n const props = this.state.props;\n if(props.direction === 'vertical') {\n return props.itemsperrow.xs;\n }\n return 0;\n }\n\n private onLayoutChange(e: LayoutChangeEvent) {\n const l = e.nativeEvent.layout;\n this.endThreshold = l.height + l.y - 100;\n if (!this.endThreshold) {\n this.endThreshold = -1;\n }\n }\n\n private renderWithFlatList(props: WmListProps, isHorizontal = false) {\n return (\n <View style={this.styles.root} onLayout={e => this.onLayoutChange(e)}>\n {!isEmpty(this.state.groupedData) ? this.state.groupedData.map((v: any, i) => ((\n <View style={this.styles.group} key={v.key || this.keyExtractor.getKey(v, true)}>\n {this.renderHeader(props, v.key)}\n <FlatList\n key={props.name + '_' + (isHorizontal ? 'H' : 'V') + props.itemsperrow.xs}\n keyExtractor={(item, i) => this.generateItemKey(item, i, props)}\n scrollEnabled={isHorizontal}\n horizontal = {isHorizontal}\n data={isEmpty(v.data[0]) ? []: v.data}\n ListEmptyComponent = {(itemInfo) => this.renderEmptyMessage(isHorizontal, itemInfo.item, itemInfo.index, props)}\n renderItem={(itemInfo) => this.renderItem(itemInfo.item, itemInfo.index, props)}\n {...(isHorizontal ? {} : {numColumns : this.getNoOfColumns()})}>\n </FlatList>\n {this.loadDataOnDemand || (v.data.length > this.state.maxRecordsToShow) ?\n (this.loadingData ?\n this.renderLoadingIcon(props) :\n (<WmLabel id={this.getTestId('ondemandmessage')}\n styles={this.styles.onDemandMessage}\n caption={this.hasMoreData && !isHorizontal ? props.ondemandmessage : props.nodatamessage}\n onTap={() => this.loadData()}></WmLabel>))\n : null}\n </View>\n ))) : this.renderEmptyMessage(isHorizontal, null, null,props)\n }\n </View>);\n }\n\n private getSectionListData() {\n if (this._showSkeleton) {\n return [{\n key: '',\n data: [{}, {}, {}]\n }];\n } else if (this.state.groupedData\n && this.state.groupedData[0]\n && this.state.groupedData[0]['data'].length) {\n return this.state.groupedData;\n }\n return [];\n }\n\n private renderWithSectionList(props: WmListProps, isHorizontal = false) {\n return (\n <SectionList\n keyExtractor={(item, i) => this.generateItemKey(item, i, props)}\n horizontal = {isHorizontal}\n contentContainerStyle={this.styles.root}\n sections={this.getSectionListData()}\n renderSectionHeader={({ section: {key, data}}) => {\n return this.renderHeader(props, key);\n }}\n renderSectionFooter={() => props.loadingdata ? this.renderLoadingIcon(props) : null}\n ListEmptyComponent = {(itemInfo) => this.renderEmptyMessage(isHorizontal, itemInfo.item, itemInfo.index, props)}\n renderItem={(itemInfo) => this.renderItem(itemInfo.item, itemInfo.index, props)}>\n </SectionList>\n );\n }\n\n renderWidget(props: WmListProps) {\n this.invokeEventCallback('onBeforedatarender', [this, this.state.props.dataset]);\n const isHorizontal = (props.direction === 'horizontal');\n return (\n <View style={isHorizontal ? null : { width: '100%' }}>\n {this._background}\n {(isHorizontal || !props.groupby) ?\n this.renderWithFlatList(props, isHorizontal)\n : this.renderWithSectionList(props, isHorizontal)}\n </View>);\n }\n}\n"],"mappings":";;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,iBAAiB,EAAEC,WAAW,EAAEC,IAAI,EAAEC,IAAI,EAAEC,QAAQ,QAA4C,cAAc;AACvH,SAASC,OAAO,EAAEC,OAAO,EAAEC,KAAK,EAAEC,QAAQ,EAAEC,KAAK,QAAQ,WA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EAAEsG,YAAY,CAC9C,CAAC;EACX;AACF","ignoreList":[]}
|
@@ -8,6 +8,7 @@ import { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/cor
|
|
8
8
|
import WmFileuploadProps from './fileupload.props';
|
9
9
|
import { DEFAULT_CLASS } from './fileupload.styles';
|
10
10
|
import WmButton from '@wavemaker/app-rn-runtime/components/basic/button/button.component';
|
11
|
+
import { getMimeType } from '@wavemaker/app-rn-runtime/core/utils';
|
11
12
|
export class WmFileuploadState extends BaseComponentState {
|
12
13
|
constructor(...args) {
|
13
14
|
super(...args);
|
@@ -23,7 +24,8 @@ export default class WmFileupload extends BaseComponent {
|
|
23
24
|
constructor(props) {
|
24
25
|
super(props, DEFAULT_CLASS, new WmFileuploadProps());
|
25
26
|
}
|
26
|
-
onTap() {
|
27
|
+
onTap(props) {
|
28
|
+
namedParameters.type = getMimeType(props.contenttype);
|
27
29
|
DocumentPicker.getDocumentAsync(namedParameters).then(response => {
|
28
30
|
let selectedFile;
|
29
31
|
if (Platform.OS !== 'web') {
|
@@ -51,7 +53,7 @@ export default class WmFileupload extends BaseComponent {
|
|
51
53
|
caption: props.caption,
|
52
54
|
styles: this.styles.button,
|
53
55
|
iconsize: props.iconsize,
|
54
|
-
onTap: this.onTap.bind(this)
|
56
|
+
onTap: () => this.onTap.bind(this)(props)
|
55
57
|
}));
|
56
58
|
}
|
57
59
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["React","Platform","View","DocumentPicker","BaseComponent","BaseComponentState","WmFileuploadProps","DEFAULT_CLASS","WmButton","WmFileuploadState","constructor","args","_defineProperty","namedParameters","copyToCacheDirectory","multiple","type","WmFileupload","props","onTap","getDocumentAsync","then","response","selectedFile","OS","assets","mimeType","file","invokeEventCallback","proxy","updateState","selectedFiles","bind","renderWidget","createElement","style","styles","root","_background","accessibilitylabel","caption","hint","id","getTestId","iconclass","button","iconsize"],"sources":["fileupload.component.tsx"],"sourcesContent":["import React from 'react';\nimport { Platform, View } from 'react-native';\nimport * as DocumentPicker from 'expo-document-picker';\n\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\n\nimport WmFileuploadProps from './fileupload.props';\nimport { DEFAULT_CLASS, WmFileuploadStyles } from './fileupload.styles';\nimport WmButton from '@wavemaker/app-rn-runtime/components/basic/button/button.component';\n\nexport interface SelectFileOutput {\n mimeType: string;\n name: string;\n size: number;\n type: 'cancel' | 'success';\n uri: string;\n}\n\nexport class WmFileuploadState extends BaseComponentState<WmFileuploadProps> {\n selectedFiles: any;\n}\n\nconst namedParameters = {\n copyToCacheDirectory: false,\n multiple: false,\n type: '*/*'\n};\n\nexport default class WmFileupload extends BaseComponent<WmFileuploadProps, WmFileuploadState, WmFileuploadStyles> {\n\n constructor(props: WmFileuploadProps) {\n super(props, DEFAULT_CLASS, new WmFileuploadProps());\n }\n\n onTap() {\n DocumentPicker.getDocumentAsync(namedParameters).then((response: any) => {\n let selectedFile;\n if (Platform.OS !== 'web') {\n selectedFile = response.assets[0];\n selectedFile.type = selectedFile.mimeType;\n } else {\n selectedFile = [response.assets[0].file];\n }\n this.invokeEventCallback('onBeforeselect', [null, this.proxy, selectedFile]);\n\n this.updateState({\n props: {\n selectedFiles: selectedFile\n }\n } as WmFileuploadState, this.invokeEventCallback.bind(this, 'onSelect', [null, this.proxy, selectedFile]));\n });\n }\n\n renderWidget(props: WmFileuploadProps) {\n return <View style={this.styles.root}>\n {this._background}\n <WmButton accessibilitylabel={props.accessibilitylabel || props.caption} hint = {props.hint} id={this.getTestId()} iconclass={props.iconclass} caption={props.caption} styles={this.styles.button} iconsize={props.iconsize} onTap={this.onTap.bind(this)}></WmButton>\n </View>\n }\n}\n"],"mappings":";;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,QAAQ,EAAEC,IAAI,QAAQ,cAAc;AAC7C,OAAO,KAAKC,cAAc,MAAM,sBAAsB;AAEtD,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,+CAA+C;AAEjG,OAAOC,iBAAiB,MAAM,oBAAoB;AAClD,SAASC,aAAa,QAA4B,qBAAqB;AACvE,OAAOC,QAAQ,MAAM,oEAAoE;
|
1
|
+
{"version":3,"names":["React","Platform","View","DocumentPicker","BaseComponent","BaseComponentState","WmFileuploadProps","DEFAULT_CLASS","WmButton","getMimeType","WmFileuploadState","constructor","args","_defineProperty","namedParameters","copyToCacheDirectory","multiple","type","WmFileupload","props","onTap","contenttype","getDocumentAsync","then","response","selectedFile","OS","assets","mimeType","file","invokeEventCallback","proxy","updateState","selectedFiles","bind","renderWidget","createElement","style","styles","root","_background","accessibilitylabel","caption","hint","id","getTestId","iconclass","button","iconsize"],"sources":["fileupload.component.tsx"],"sourcesContent":["import React from 'react';\nimport { Platform, View } from 'react-native';\nimport * as DocumentPicker from 'expo-document-picker';\n\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\n\nimport WmFileuploadProps from './fileupload.props';\nimport { DEFAULT_CLASS, WmFileuploadStyles } from './fileupload.styles';\nimport WmButton from '@wavemaker/app-rn-runtime/components/basic/button/button.component';\nimport { getMimeType } from '@wavemaker/app-rn-runtime/core/utils';\n\nexport interface SelectFileOutput {\n mimeType: string;\n name: string;\n size: number;\n type: 'cancel' | 'success';\n uri: string;\n}\n\nexport class WmFileuploadState extends BaseComponentState<WmFileuploadProps> {\n selectedFiles: any;\n}\n\ntype NamedParametersType = {\n copyToCacheDirectory: boolean,\n multiple: boolean,\n type: string | string[]\n};\n\nconst namedParameters: NamedParametersType = {\n copyToCacheDirectory: false,\n multiple: false,\n type: '*/*'\n};\n\nexport default class WmFileupload extends BaseComponent<WmFileuploadProps, WmFileuploadState, WmFileuploadStyles> {\n\n constructor(props: WmFileuploadProps) {\n super(props, DEFAULT_CLASS, new WmFileuploadProps());\n }\n\n onTap(props: WmFileuploadProps) {\n namedParameters.type = getMimeType(props.contenttype);\n DocumentPicker.getDocumentAsync(namedParameters).then((response: any) => {\n let selectedFile;\n if (Platform.OS !== 'web') {\n selectedFile = response.assets[0];\n selectedFile.type = selectedFile.mimeType;\n } else {\n selectedFile = [response.assets[0].file];\n }\n this.invokeEventCallback('onBeforeselect', [null, this.proxy, selectedFile]);\n\n this.updateState({\n props: {\n selectedFiles: selectedFile\n }\n } as WmFileuploadState, this.invokeEventCallback.bind(this, 'onSelect', [null, this.proxy, selectedFile]));\n });\n }\n\n renderWidget(props: WmFileuploadProps) {\n return <View style={this.styles.root}>\n {this._background}\n <WmButton accessibilitylabel={props.accessibilitylabel || props.caption} hint = {props.hint} id={this.getTestId()} iconclass={props.iconclass} caption={props.caption} styles={this.styles.button} iconsize={props.iconsize} onTap={() => this.onTap.bind(this)(props)}></WmButton>\n </View>\n }\n}\n"],"mappings":";;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,QAAQ,EAAEC,IAAI,QAAQ,cAAc;AAC7C,OAAO,KAAKC,cAAc,MAAM,sBAAsB;AAEtD,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,+CAA+C;AAEjG,OAAOC,iBAAiB,MAAM,oBAAoB;AAClD,SAASC,aAAa,QAA4B,qBAAqB;AACvE,OAAOC,QAAQ,MAAM,oEAAoE;AACzF,SAASC,WAAW,QAAQ,sCAAsC;AAUlE,OAAO,MAAMC,iBAAiB,SAASL,kBAAkB,CAAoB;EAAAM,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAC,eAAA;EAAA;AAE7E;AAQA,MAAMC,eAAoC,GAAG;EAC3CC,oBAAoB,EAAE,KAAK;EAC3BC,QAAQ,EAAE,KAAK;EACfC,IAAI,EAAE;AACR,CAAC;AAED,eAAe,MAAMC,YAAY,SAASd,aAAa,CAA2D;EAEhHO,WAAWA,CAACQ,KAAwB,EAAE;IACpC,KAAK,CAACA,KAAK,EAAEZ,aAAa,EAAE,IAAID,iBAAiB,CAAC,CAAC,CAAC;EACtD;EAEAc,KAAKA,CAACD,KAAwB,EAAE;IAC9BL,eAAe,CAACG,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AAE,IAAI,CAACA,MAAM,CAACS,MAAO;MAACC,QAAQ,EAAE7B,KAAK,CAAC6B,QAAS;MAAC5B,KAAK,EAAEA,CAAA,KAAM,IAAI,CAACA,KAAK,CAACc,IAAI,CAAC,IAAI,CAAC,CAACf,KAAK;IAAE,CAAW,CAC9Q,CAAC;EACT;AACF","ignoreList":[]}
|
@@ -9,6 +9,7 @@ export default class WmFileuploadProps extends BaseProps {
|
|
9
9
|
_defineProperty(this, "iconsize", 16);
|
10
10
|
_defineProperty(this, "caption", 'Upload');
|
11
11
|
_defineProperty(this, "selectedFiles", void 0);
|
12
|
+
_defineProperty(this, "contenttype", void 0);
|
12
13
|
_defineProperty(this, "accessibilitylabel", undefined);
|
13
14
|
_defineProperty(this, "hint", undefined);
|
14
15
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["BaseProps","WmFileuploadProps","constructor","args","_defineProperty","undefined"],"sources":["fileupload.props.ts"],"sourcesContent":["import { BaseProps } from '@wavemaker/app-rn-runtime/core/base.component';\nimport {AccessibilityRole} from 'react-native';\n\nexport default class WmFileuploadProps extends BaseProps {\n iconclass: string = 'wm-sl-l sl-cloud-upload';\n iconsize: number = 16;\n caption: string = 'Upload';\n selectedFiles?: any;\n accessibilitylabel?: string = undefined;\n hint?: string = undefined;\n}\n"],"mappings":";;;AAAA,SAASA,SAAS,QAAQ,+CAA+C;AAGzE,eAAe,MAAMC,iBAAiB,SAASD,SAAS,CAAC;EAAAE,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAC,eAAA,oBACnC,yBAAyB;IAAAA,eAAA,mBAC1B,EAAE;IAAAA,eAAA,kBACH,QAAQ;IAAAA,eAAA;IAAAA,eAAA,
|
1
|
+
{"version":3,"names":["BaseProps","WmFileuploadProps","constructor","args","_defineProperty","undefined"],"sources":["fileupload.props.ts"],"sourcesContent":["import { BaseProps } from '@wavemaker/app-rn-runtime/core/base.component';\nimport {AccessibilityRole} from 'react-native';\n\nexport default class WmFileuploadProps extends BaseProps {\n iconclass: string = 'wm-sl-l sl-cloud-upload';\n iconsize: number = 16;\n caption: string = 'Upload';\n selectedFiles?: any;\n contenttype?: string;\n accessibilitylabel?: string = undefined;\n hint?: string = undefined;\n}\n"],"mappings":";;;AAAA,SAASA,SAAS,QAAQ,+CAA+C;AAGzE,eAAe,MAAMC,iBAAiB,SAASD,SAAS,CAAC;EAAAE,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAC,eAAA,oBACnC,yBAAyB;IAAAA,eAAA,mBAC1B,EAAE;IAAAA,eAAA,kBACH,QAAQ;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA,6BAGIC,SAAS;IAAAD,eAAA,eACvBC,SAAS;EAAA;AAC3B","ignoreList":[]}
|
@@ -9,6 +9,7 @@ export default class WmTabbarProps extends BaseNavProps {
|
|
9
9
|
_defineProperty(this, "morebuttonlabel", 'more');
|
10
10
|
_defineProperty(this, "itemchildren", 'children');
|
11
11
|
_defineProperty(this, "isActive", item => false);
|
12
|
+
_defineProperty(this, "onSelect", void 0);
|
12
13
|
_defineProperty(this, "dataset", [{
|
13
14
|
'label': 'Home',
|
14
15
|
'icon': 'wm-sl-r sl-home'
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["BaseNavProps","WmTabbarProps","constructor","args","_defineProperty","item"],"sources":["tabbar.props.ts"],"sourcesContent":["import { BaseNavProps } from '../../navigation/basenav/basenav.props';\n\nexport default class WmTabbarProps extends BaseNavProps {\n morebuttoniconclass = 'wi wi-more-horiz';\n morebuttonlabel = 'more';\n itemchildren?: string = 'children';\n isActive = (item: any) => false;\n dataset?: any = [{\n 'label' : 'Home',\n 'icon' : 'wm-sl-r sl-home'\n },{\n 'label' : 'Analytics',\n 'icon' : 'wm-sl-r sl-graph-ascend'\n },{\n 'label' : 'Alerts',\n 'icon' : 'wm-sl-r sl-alarm-bell'\n },{\n 'label' : 'Settings',\n 'icon' : 'wm-sl-r sl-settings'\n }]\n}\n"],"mappings":";;;AAAA,SAASA,YAAY,QAAQ,wCAAwC;
|
1
|
+
{"version":3,"names":["BaseNavProps","WmTabbarProps","constructor","args","_defineProperty","item"],"sources":["tabbar.props.ts"],"sourcesContent":["import { BaseNavProps } from '../../navigation/basenav/basenav.props';\nimport WmTabbar from './tabbar.component';\n\nexport default class WmTabbarProps extends BaseNavProps {\n morebuttoniconclass? = 'wi wi-more-horiz';\n morebuttonlabel? = 'more';\n itemchildren?: string = 'children';\n isActive? = (item: any) => false;\n onSelect? : (event: any, widget: WmTabbar) => any;\n dataset?: any = [{\n 'label' : 'Home',\n 'icon' : 'wm-sl-r sl-home'\n },{\n 'label' : 'Analytics',\n 'icon' : 'wm-sl-r sl-graph-ascend'\n },{\n 'label' : 'Alerts',\n 'icon' : 'wm-sl-r sl-alarm-bell'\n },{\n 'label' : 'Settings',\n 'icon' : 'wm-sl-r sl-settings'\n }]\n}\n"],"mappings":";;;AAAA,SAASA,YAAY,QAAQ,wCAAwC;AAGrE,eAAe,MAAMC,aAAa,SAASD,YAAY,CAAC;EAAAE,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAC,eAAA,8BAC/B,kBAAkB;IAAAA,eAAA,0BACtB,MAAM;IAAAA,eAAA,uBACD,UAAU;IAAAA,eAAA,mBACrBC,IAAS,IAAK,KAAK;IAAAD,eAAA;IAAAA,eAAA,kBAEhB,CAAC;MACb,OAAO,EAAG,MAAM;MAChB,MAAM,EAAI;IACZ,CAAC,EAAC;MACA,OAAO,EAAG,WAAW;MACrB,MAAM,EAAI;IACZ,CAAC,EAAC;MACA,OAAO,EAAG,QAAQ;MAClB,MAAM,EAAI;IACZ,CAAC,EAAC;MACA,OAAO,EAAG,UAAU;MACpB,MAAM,EAAI;IACZ,CAAC,CAAC;EAAA;AACN","ignoreList":[]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["assign","isNil","PropsProvider","constructor","defaultProps","initprops","onChange","name","$new","$old","_defineProperty","Object","keys","forEach","k","propertyNames","propsProxy","Proxy","get","target","prop","receiver","propName","toString","value","overriddenProps","hasOwnProperty","oldProps","set","has","isDirty","oldValue","setDefault","overrideProp","check","nextProps","result","reduce","b","flag"],"sources":["props.provider.ts"],"sourcesContent":["import { assign, isNil } from \"lodash-es\";\nimport { BaseProps } from \"./base.component\";\n\nexport class PropsProvider<T extends BaseProps> {\n private oldProps: any = {};\n private overriddenProps: any = {};\n private propsProxy: T;\n private isDirty = false;\n private propertyNames = {} as any;\n\n constructor(private defaultProps: T, private initprops: T, private onChange = (name: string, $new: any, $old: any) => {}) {\n this.initprops = this.initprops || {};\n Object.keys(defaultProps).forEach(k => this.propertyNames[k] = true);\n Object.keys(initprops).forEach(k => this.propertyNames[k] = true);\n //@ts-ignore\n this.propsProxy = (new Proxy({}, {\n get: (target, prop, receiver): any => {\n const propName = prop.toString();\n let value = (this.defaultProps as any)[propName];\n if (this.overriddenProps.hasOwnProperty(propName)) {\n value = this.overriddenProps[propName];\n } else if (this.oldProps.hasOwnProperty(propName)) {\n value = this.oldProps[propName];\n }\n return value;\n },\n set: (target: any, prop, value: any): any => {\n const propName = prop.toString();\n if (!this.has(propName)) {\n return true;\n }\n this.isDirty = this.isDirty || this.overriddenProps[propName] !== value;\n this.overriddenProps[propName] = value;\n if (this.oldProps[propName] !== value) {\n const oldValue = this.oldProps[propName];\n this.onChange(propName, value, oldValue);\n this.oldProps[propName] = value;\n }\n return true;\n }\n }));\n }\n\n setDefault(propName: string, value: any) {\n (this.defaultProps as any)[propName] = value;\n }\n overrideProp(propName: string, value: any) {\n (this.overriddenProps as any)[propName] = value;\n }\n\n check(nextProps?: T) {\n if (!nextProps) {\n nextProps = assign({}, this.defaultProps, this.initprops);\n }\n const result = Object.keys(nextProps).reduce((b, k) => {\n let flag = false;\n //@ts-ignore\n const value = nextProps[k];\n const oldValue = this.oldProps[k];\n if (isNil(this.overriddenProps[k])\n && (!this.oldProps.hasOwnProperty(k)\n || this.oldProps[k] !== value)) {\n this.oldProps[k] = value;\n this.onChange(k, value, oldValue);\n flag = true;\n }\n return b || flag;\n }, false) || this.isDirty;\n\n this.isDirty = false;\n return result;\n }\n\n // sets the property. But, value gets overriden when the original prop changes.\n set(name: string, value: any) {\n this.oldProps[name] = value;\n const oldValue = this.oldProps[name];\n if(oldValue !== value) {\n this.oldProps[name] = value;\n this.onChange(name, value, oldValue);\n }\n }\n\n has(propName: string) {\n return !!this.propertyNames[propName];\n }\n\n get() {\n return this.propsProxy;\n }\n}\n"],"mappings":";;;AAAA,SAASA,MAAM,EAAEC,KAAK,QAAQ,WAAW;AAGzC,OAAO,MAAMC,aAAa,CAAsB;EAO5CC,WAAWA,CAASC,YAAe,EAAUC,SAAY,EAAUC,QAAQ,GAAGA,CAACC,IAAY,EAAEC,IAAS,EAAEC,IAAS,KAAK,CAAC,CAAC,EAAE;IAAA,KAAtGL,YAAe,GAAfA,YAAe;IAAA,KAAUC,SAAY,GAAZA,SAAY;IAAA,KAAUC,QAAQ,GAARA,QAAQ;IAAAI,eAAA,mBANnD,CAAC,CAAC;IAAAA,eAAA,0BACK,CAAC,CAAC;IAAAA,eAAA;IAAAA,eAAA,kBAEf,KAAK;IAAAA,eAAA,wBACC,CAAC,CAAC;IAGtB,IAAI,CAACL,SAAS,GAAG,IAAI,CAACA,SAAS,IAAI,CAAC,CAAC;IACrCM,MAAM,CAACC,IAAI,CAACR,YAAY,CAAC,CAACS,OAAO,CAACC,CAAC,IAAI,IAAI,CAACC,aAAa,CAACD,CAAC,CAAC,GAAG,IAAI,CAAC;IACpEH,MAAM,CAACC,IAAI,CAACP,SAAS,CAAC,CAACQ,OAAO,CAACC,CAAC,IAAI,IAAI,CAACC,aAAa,CAACD,CAAC,CAAC,GAAG,IAAI,CAAC;IACjE;IACA,IAAI,CAACE,UAAU,GAAI,IAAIC,KAAK,CAAC,CAAC,CAAC,EAAE;MAC7BC,GAAG,EAAEA,CAACC,MAAM,EAAEC,IAAI,EAAEC,QAAQ,KAAU;QAClC,MAAMC,QAAQ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AAgB,EAAEE,KAAU,EAAE;IACtC,IAAI,CAACC,eAAe,CAASH,QAAQ,CAAC,GAAGE,KAAK;
|
1
|
+
{"version":3,"names":["assign","isNil","PropsProvider","constructor","defaultProps","initprops","onChange","name","$new","$old","_defineProperty","Object","keys","forEach","k","propertyNames","propsProxy","Proxy","get","target","prop","receiver","propName","toString","value","overriddenProps","hasOwnProperty","oldProps","set","has","isDirty","oldValue","setDefault","overrideProp","check","nextProps","result","reduce","b","flag"],"sources":["props.provider.ts"],"sourcesContent":["import { assign, isNil } from \"lodash-es\";\nimport { BaseProps } from \"./base.component\";\n\nexport class PropsProvider<T extends BaseProps> {\n private oldProps: any = {};\n private overriddenProps: any = {};\n private propsProxy: T;\n private isDirty = false;\n private propertyNames = {} as any;\n\n constructor(private defaultProps: T, private initprops: T, private onChange = (name: string, $new: any, $old: any) => {}) {\n this.initprops = this.initprops || {};\n Object.keys(defaultProps).forEach(k => this.propertyNames[k] = true);\n Object.keys(initprops).forEach(k => this.propertyNames[k] = true);\n //@ts-ignore\n this.propsProxy = (new Proxy({}, {\n get: (target, prop, receiver): any => {\n const propName = prop.toString();\n let value = (this.defaultProps as any)[propName];\n if (this.overriddenProps.hasOwnProperty(propName)) {\n value = this.overriddenProps[propName];\n } else if (this.oldProps.hasOwnProperty(propName)) {\n value = this.oldProps[propName];\n }\n return value;\n },\n set: (target: any, prop, value: any): any => {\n const propName = prop.toString();\n if (!this.has(propName)) {\n return true;\n }\n this.isDirty = this.isDirty || this.overriddenProps[propName] !== value;\n this.overriddenProps[propName] = value;\n if (this.oldProps[propName] !== value) {\n const oldValue = this.oldProps[propName];\n this.onChange(propName, value, oldValue);\n this.oldProps[propName] = value;\n }\n return true;\n }\n }));\n }\n\n setDefault(propName: string, value: any) {\n (this.defaultProps as any)[propName] = value;\n }\n overrideProp(propName: string, value: any) {\n (this.overriddenProps as any)[propName] = value;\n this.isDirty = true;\n }\n\n check(nextProps?: T) {\n if (!nextProps) {\n nextProps = assign({}, this.defaultProps, this.initprops);\n }\n const result = Object.keys(nextProps).reduce((b, k) => {\n let flag = false;\n //@ts-ignore\n const value = nextProps[k];\n const oldValue = this.oldProps[k];\n if (isNil(this.overriddenProps[k])\n && (!this.oldProps.hasOwnProperty(k)\n || this.oldProps[k] !== value)) {\n this.oldProps[k] = value;\n this.onChange(k, value, oldValue);\n flag = true;\n }\n return b || flag;\n }, false) || this.isDirty;\n\n this.isDirty = false;\n return result;\n }\n\n // sets the property. But, value gets overriden when the original prop changes.\n set(name: string, value: any) {\n this.oldProps[name] = value;\n const oldValue = this.oldProps[name];\n if(oldValue !== value) {\n this.oldProps[name] = value;\n this.onChange(name, value, oldValue);\n }\n }\n\n has(propName: string) {\n return !!this.propertyNames[propName];\n }\n\n get() {\n return this.propsProxy;\n }\n}\n"],"mappings":";;;AAAA,SAASA,MAAM,EAAEC,KAAK,QAAQ,WAAW;AAGzC,OAAO,MAAMC,aAAa,CAAsB;EAO5CC,WAAWA,CAASC,YAAe,EAAUC,SAAY,EAAUC,QAAQ,GAAGA,CAACC,IAAY,EAAEC,IAAS,EAAEC,IAAS,KAAK,CAAC,CAAC,EAAE;IAAA,KAAtGL,YAAe,GAAfA,YAAe;IAAA,KAAUC,SAAY,GAAZA,SAAY;IAAA,KAAUC,QAAQ,GAARA,QAAQ;IAAAI,eAAA,mBANnD,CAAC,CAAC;IAAAA,eAAA,0BACK,CAAC,CAAC;IAAAA,eAAA;IAAAA,eAAA,kBAEf,KAAK;IAAAA,eAAA,wBACC,CAAC,CAAC;IAGtB,IAAI,CAACL,SAAS,GAAG,IAAI,CAACA,SAAS,IAAI,CAAC,CAAC;IACrCM,MAAM,CAACC,IAAI,CAACR,YAAY,CAAC,CAACS,OAAO,CAACC,CAAC,IAAI,IAAI,CAACC,aAAa,CAACD,CAAC,CAAC,GAAG,IAAI,CAAC;IACpEH,MAAM,CAACC,IAAI,CAACP,SAAS,CAAC,CAACQ,OAAO,CAACC,CAAC,IAAI,IAAI,CAACC,aAAa,CAACD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,KAAK;IACpB,OAAOM,MAAM;EACf;;EAEA;EACAR,GAAGA,CAACrB,IAAY,EAAEiB,KAAU,EAAE;IAC1B,IAAI,CAACG,QAAQ,CAACpB,IAAI,CAAC,GAAGiB,KAAK;IAC3B,MAAMO,QAAQ,GAAG,IAAI,CAACJ,QAAQ,CAACpB,IAAI,CAAC;IACpC,IAAGwB,QAAQ,KAAKP,KAAK,EAAE;MACnB,IAAI,CAACG,QAAQ,CAACpB,IAAI,CAAC,GAAGiB,KAAK;MAC3B,IAAI,CAAClB,QAAQ,CAACC,IAAI,EAAEiB,KAAK,EAAEO,QAAQ,CAAC;IACxC;EACJ;EAEAF,GAAGA,CAACP,QAAgB,EAAE;IAClB,OAAO,CAAC,CAAC,IAAI,CAACP,aAAa,CAACO,QAAQ,CAAC;EACzC;EAEAJ,GAAGA,CAAA,EAAG;IACF,OAAO,IAAI,CAACF,UAAU;EAC1B;AACJ","ignoreList":[]}
|
app-rn-runtime/core/utils.js
CHANGED
@@ -2,6 +2,7 @@ import { Platform } from 'react-native';
|
|
2
2
|
import moment from "moment";
|
3
3
|
import * as FileSystem from "expo-file-system";
|
4
4
|
import { isFunction, includes, isUndefined, isNull, orderBy, groupBy, toLower, get, forEach, sortBy, cloneDeep, keys, values, isArray, isString, isNumber } from 'lodash';
|
5
|
+
import * as mime from 'react-native-mime-types';
|
5
6
|
import ThemeVariables from '../styles/theme.variables';
|
6
7
|
const GROUP_BY_OPTIONS = {
|
7
8
|
ALPHABET: 'alphabet',
|
@@ -505,4 +506,19 @@ export const isDateFormatAsPerPattern = (datePattern, dateString) => {
|
|
505
506
|
return false;
|
506
507
|
}
|
507
508
|
};
|
509
|
+
export const getMimeType = extensions => {
|
510
|
+
if (!extensions) return '*/*';
|
511
|
+
let hasInvalidExtension = false;
|
512
|
+
let wildCards = ['image/*', 'audio/*', 'video/*'];
|
513
|
+
let extensionList = extensions.split(' ');
|
514
|
+
let mimeType = extensionList.map(extension => {
|
515
|
+
let type = mime.lookup(extension);
|
516
|
+
let isWildCardExtension = wildCards.includes(extension);
|
517
|
+
// * invalid extension, also not in wildcards
|
518
|
+
hasInvalidExtension = !type && !isWildCardExtension;
|
519
|
+
return type ? type : isWildCardExtension ? extension : '';
|
520
|
+
}).filter(type => type);
|
521
|
+
if (hasInvalidExtension) return '*/*';
|
522
|
+
return mimeType;
|
523
|
+
};
|
508
524
|
//# sourceMappingURL=utils.js.map
|
app-rn-runtime/core/utils.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["Platform","moment","FileSystem","isFunction","includes","isUndefined","isNull","orderBy","groupBy","toLower","get","forEach","sortBy","cloneDeep","keys","values","isArray","isString","isNumber","ThemeVariables","GROUP_BY_OPTIONS","ALPHABET","WORD","OTHERS","TIME_ROLLUP_OPTIONS","HOUR","DAY","WEEK","MONTH","YEAR","_deepCopy","o1","o2","o","Object","k","v","deepCopy","objects","toBoolean","val","undefined","toNumber","parseFloat","e","encodeUrl","url","splits","split","hash","params","length","map","p","encodeURIComponent","join","encodeURI","isWebPreviewMode","OS","isDevMode","__DEV__","widgetsWithUndefinedValue","isAndroid","test","window","navigator","userAgent","isIos","getGroupKey","fieldDef","groupby","widgetScope","innerItem","apply","proxy","getGroupedData","fieldDefs","match","orderby","dateFormat","groupKey","groupedLiData","concatStr","toString","trim","substr","replace","format","getSortedGroupedData","getOrderedDataset","dataSet","items","fields","directions","obj","item","push","_groupedData","groupkey","index","liData","key","data","_groupIndex","isDefined","unStringify","defaultVal","number","parseInt","isNaN","retryIfFails","fn","interval","maxRetries","onBeforeRetry","Promise","resolve","retryCount","tryFn","reject","errorFn","errArgs","arguments","setTimeout","then","retry","getAbortableDefer","_defer","promise","onAbort","isAborted","abort","validateField","props","value","requiredCheck","regexCheck","required","errorType","isValid","regexp","condition","RegExp","maxchars","mindate","Date","datavalue","startOf","toDate","maxdate","endOf","countDecimalDigits","numberString","decimalMatch","decimalDigits","formatCompactNumber","isNegative","formattedNumber","toFixed","toBase64","path","readAsStringAsync","encoding","DATASET_WIDGETS","Set","isDataSetWidget","widget","has","isFullPathUrl","startsWith","removeUndefinedKeys","getDaysInMonth","month","year","getDate","getDates","startDate","endDate","getFullYear","daysInMonth","dates","Array","from","i","datesInRange","filter","date","monthNames","getMonths","startMonth","endMonth","months","name","substring","monthRange","_","getMonthIndex","monthName","shortName","monthNumber","findIndex","getYearRange","startYear","endYear","years","getDateObject","getHours","hours","hour","paddedHour","String","padStart","get24Hours","getMinutes","minutes","minute","paddedMinute","getTimeIndicators","getDateTimeObject","getGradientStartEnd","angle","angleLowerCase","toLowerCase","start","x","y","end","parseLinearGradient","gradient","color1","color2","linearGradientRegex","hasLinearGradient","matches","INSTANCE","primaryColor","validateInputOnDevice","type","_value$match","isCurrencyField","isValidText","validText","Number","isDateFormatAsPerPattern","datePattern","dateString","_date$format","toUpperCase","error"],"sources":["utils.ts"],"sourcesContent":["import { Platform } from 'react-native';\nimport moment from \"moment\";\nimport * as FileSystem from \"expo-file-system\";\nimport { isFunction, includes, isUndefined, isNull, orderBy, groupBy, toLower, get, forEach, sortBy, cloneDeep, keys, values, isArray, isString, isNumber} from 'lodash';\nimport ThemeVariables from '../styles/theme.variables';\n\ndeclare const window: any;\nconst GROUP_BY_OPTIONS = {\n ALPHABET: 'alphabet',\n WORD: 'word',\n OTHERS: 'Others'\n};\nconst TIME_ROLLUP_OPTIONS = {\n HOUR: 'hour',\n DAY: 'day',\n WEEK: 'week',\n MONTH: 'month',\n YEAR: 'year'\n};\n\nconst _deepCopy = (o1: any, ...o2: any) => {\n o2.forEach((o: any) => {\n if (o) {\n Object.keys(o).forEach(k => {\n const v = o[k];\n if (v && !isString(v) && !isArray(v) && typeof v === 'object') {\n o1[k] = _deepCopy(o1[k] || {}, o[k]);\n } else {\n o1[k] = _deepCopy(v);\n }\n });\n }\n });\n return o1;\n};\n\nexport const deepCopy = (...objects: any) => _deepCopy({}, ...objects);\n\nexport const toBoolean = (val: any) => {\n return val === true\n || val === 'true'\n || !(val === false\n || val === null\n || val === undefined\n || val === '');\n};\n\nexport const toNumber = (val: any) => {\n try {\n return parseFloat(val) || 0;\n } catch(e) {\n return 0;\n }\n};\n\n/**\n * this method encodes the url and returns the encoded string\n */\n export const encodeUrl = (url: string): string => {\n let splits = url.split('#');\n const hash = splits[1];\n splits = splits[0].split('?');\n let params = '';\n if (splits.length > 1) {\n params = splits[1].split('&')\n .map(p => p.split('='))\n .map(p => p[0] +'=' + encodeURIComponent(p[1]))\n .join('&');\n }\n return encodeURI(splits[0]) + (params ? '?' + params: '') + (hash ? '#'+ hash : '');\n};\n\nexport const isWebPreviewMode = () => Platform.OS === 'web';\n\nexport const isDevMode = () => isWebPreviewMode() || __DEV__;\n\nexport const widgetsWithUndefinedValue = ['checkbox', 'toggle'];\n\nexport const isAndroid = () => (Platform.OS === 'android' || (Platform.OS === 'web' && /android/i.test(window.navigator.userAgent)));\n\nexport const isIos = () => (Platform.OS === 'ios' || (Platform.OS === 'web' && /iPhone|iPad/i.test(window.navigator.userAgent)));\n\nconst getGroupKey = (fieldDef: any, groupby: string, widgetScope: any, innerItem?: any) => isFunction(groupby) ? groupby.apply(widgetScope.proxy, [innerItem ? fieldDef[innerItem] : fieldDef]) : get(innerItem ? fieldDef[innerItem] : fieldDef, groupby);\n\n/**\n * This method prepares the grouped data.\n *\n * @param fieldDefs array of objects i.e. dataset\n * @param groupby string groupby\n * @param match string match\n * @param orderby string orderby\n * @param dateFormat string date format\n */\nexport const getGroupedData = (fieldDefs: any, groupby: string, match: string, orderby: string, dateFormat: string, widgetScope: any, innerItem?: any) => {\n\n // handling case-in-sensitive scenario\n // ordering the data based on groupby field. If there is innerItem then apply orderby using the innerItem's containing the groupby field.\n fieldDefs = orderBy(fieldDefs, fieldDef => {\n const groupKey = getGroupKey(fieldDef, groupby, widgetScope, innerItem);\n if (groupKey) {\n return toLower(groupKey);\n }\n return '';\n });\n\n // extract the grouped data based on the field obtained from 'groupDataByField'.\n const groupedLiData = groupBy(fieldDefs, function (fieldDef) {\n let concatStr = getGroupKey(fieldDef, groupby, widgetScope, innerItem);\n // by default set the undefined groupKey as 'others'\n if (isUndefined(concatStr) || isNull(concatStr) || concatStr.toString().trim() === '') {\n return GROUP_BY_OPTIONS.OTHERS;\n }\n // if match prop is alphabetic ,get the starting alphabet of the word as key.\n if (match === GROUP_BY_OPTIONS.ALPHABET) {\n concatStr = concatStr.substr(0, 1);\n }\n\n // if match contains the time options then get the concatStr using 'getTimeRolledUpString'\n if (includes(values(TIME_ROLLUP_OPTIONS), match)) {\n dateFormat = dateFormat && dateFormat.replace(/d/g, 'D');\n dateFormat = dateFormat && dateFormat.replace(/y/g, 'Y');\n concatStr = moment(concatStr).format(dateFormat);\n }\n\n return concatStr;\n });\n\n return getSortedGroupedData(groupedLiData, groupby, orderby, innerItem);\n};\n\n/**\n * function to get the ordered dataset based on the given orderby\n */\nexport const getOrderedDataset = (dataSet: any, orderby: string, innerItem?: any) => {\n if (!orderBy) {\n return cloneDeep(dataSet);\n }\n\n // The order by only works when the dataset contains list of objects.\n const items = orderby && orderby.split(','),\n fields: any = [],\n directions: any = [];\n items && items.forEach( obj => {\n const item = obj.split(':');\n fields.push(innerItem ? innerItem + '.' + item[0] : item[0]);\n directions.push(item[1]);\n });\n return orderBy(dataSet, fields, directions);\n};\n\n\n/**\n * This method returns sorted data based to groupkey.\n * Returns a array of objects, each object containing key which is groupKey and data is the sorted data which is sorted by groupby field in the data.\n *\n * @param groupedLiData, grouped data object with key as the groupKey and its value as the array of objects grouped under the groupKey.\n * @param groupBy, string groupby property\n * @returns {any[]}\n */\nexport const getSortedGroupedData = (groupedLiData: any, groupBy: string, orderby: string, innerItem?: any) => {\n const _groupedData: any = [];\n forEach(keys(groupedLiData), (groupkey, index) => {\n const liData = getOrderedDataset(groupedLiData[groupkey], orderby, innerItem);\n _groupedData.push({\n key: groupkey,\n data: sortBy(liData, data => {\n data._groupIndex = index;\n return get(data, groupBy) || get(data[innerItem], groupBy);\n })\n });\n });\n return _groupedData;\n};\n\nexport const isDefined = (v: any) => typeof v !== 'undefined';\n\n// try to convert the chekedvalue and unchecked values to boolean/number\nexport const unStringify = (val: any, defaultVal?: boolean) => {\n if (val === null) {\n return defaultVal;\n }\n\n if (val === true || val === 'true') {\n return true;\n }\n\n if (val === false || val === 'false') {\n return false;\n }\n\n const number = parseInt(val, 10);\n if (!isNaN(number)) {\n return number;\n }\n return val;\n};\n\n/**\n * This function invokes the given the function (fn) until the function successfully executes or the maximum number\n * of retries is reached or onBeforeRetry returns false.\n *\n * @param fn - a function that is needs to be invoked. The function can also return a promise as well.\n * @param interval - minimum time gap between successive retries. This argument should be greater or equal to 0.\n * @param maxRetries - maximum number of retries. This argument should be greater than 0. For all other values,\n * maxRetries is infinity.\n * @param onBeforeRetry - a callback function that will be invoked before re-invoking again. This function can\n * return false or a promise that is resolved to false to stop further retry attempts.\n * @returns {*} a promise that is resolved when fn is success (or) maximum retry attempts reached\n * (or) onBeforeRetry returned false.\n */\nexport const retryIfFails = (fn: Function, interval: number, maxRetries: number, onBeforeRetry = () => Promise.resolve(false)) => {\n let retryCount = 0;\n const tryFn = () => {\n retryCount++;\n if (isFunction(fn)) {\n return fn();\n }\n };\n maxRetries = (isNumber(maxRetries) && maxRetries > 0 ? maxRetries : 0);\n interval = (isNumber(interval) && interval > 0 ? interval : 0);\n return new Promise((resolve, reject) => {\n const errorFn = function () {\n const errArgs = arguments;\n setTimeout(() => {\n Promise.resolve().then(() => onBeforeRetry()).then(function (retry) {\n if (retry !== false && (!maxRetries || retryCount <= maxRetries)) {\n Promise.resolve().then(() => tryFn()).then(resolve, errorFn);\n } else {\n reject(errArgs);\n }\n }, () => reject(errArgs));\n }, interval);\n };\n Promise.resolve().then(() => tryFn()).then(resolve, errorFn);\n });\n};\n\n/**\n * Promise of a defer created using this function, has abort function that will reject the defer when called.\n * @returns {*} angular defer object\n */\nexport const getAbortableDefer = () => {\n const _defer: any = {\n promise: null,\n reject: null,\n resolve: null,\n onAbort: () => { },\n isAborted: false\n };\n _defer.promise = new Promise((resolve, reject) => {\n _defer.resolve = resolve;\n _defer.reject = reject;\n });\n _defer.promise.abort = () => {\n _defer.onAbort && _defer.onAbort();\n _defer.reject('aborted');\n _defer.isAborted = true;\n };\n return _defer;\n};\n\nexport const validateField = (props: any, value: any) => {\n let requiredCheck = true, regexCheck = true;\n if (props.required) {\n if (isArray(value)) {\n requiredCheck = value.length === 0 ? false : true\n } else {\n requiredCheck = !value ? false : true\n }\n if (!requiredCheck) {\n return {\n errorType : 'required',\n isValid: false\n }\n }\n }\n if (value && props.regexp) {\n const condition = new RegExp(\"^\" + props.regexp + \"$\", 'g');\n regexCheck = condition.test(value);\n if (!regexCheck) {\n return {\n errorType : 'regexp',\n isValid: false\n }\n }\n }\n if (value && props.maxchars && value.length > props.maxchars) {\n return {\n errorType : 'maxchars',\n isValid: false\n }\n\n }\n if (value && props.mindate && new Date(props.datavalue) < moment(props.mindate).startOf('day').toDate()) {\n return {\n errorType : 'mindate',\n isValid: false\n }\n }\n if (value && props.maxdate && new Date(props.datavalue) > moment(props.maxdate).endOf('day').toDate()) {\n return {\n errorType : 'maxdate',\n isValid: false\n }\n }\n\n return {\n isValid: true\n }\n};\n\nexport const countDecimalDigits = (number: number | string) => {\n if (!number) return 0;\n\n // * convert the number to a string\n const numberString = number.toString();\n \n // * regular expression to match and count the decimal digits\n const decimalMatch = numberString.match(/\\.(\\d+)/);\n\n if (decimalMatch) {\n const decimalDigits = decimalMatch[1];\n return decimalDigits.length;\n } else {\n return 0; // * no decimal digits found\n }\n}\n\nexport const formatCompactNumber = (number: number) => {\n const isNegative = number < 0;\n number = isNegative ? number * -1 : number;\n let formattedNumber = number + '';\n if (number >= 1000 && number < 1_000_000) {\n formattedNumber = (number / 1000).toFixed(1).replace(/\\.0$/, \"\") + \"K\";\n } else if (number >= 1_000_000 && number < 1_000_000_000) {\n formattedNumber = (number / 1_000_000).toFixed(1).replace(/\\.0$/, \"\") + \"M\";\n } else if (number >= 1_000_000_000 && number < 1_000_000_000_000) {\n formattedNumber = (number / 1_000_000_000).toFixed(1).replace(/\\.0$/, \"\") + \"B\";\n } else if (number >= 1_000_000_000_000 && number < 1_000_000_000_000_000) {\n formattedNumber = (number / 1_000_000_000_000).toFixed(1).replace(/\\.0$/, \"\") + \"T\";\n }\n return (isNegative ? '-' : '') + formattedNumber;\n}\n\nexport const toBase64 = function(path: string) {\n return FileSystem.readAsStringAsync(path, { encoding: 'base64' });\n};\n\nconst DATASET_WIDGETS = new Set([ 'select', 'checkboxset', 'radioset', 'switch', 'autocomplete', 'chips', 'typeahead', 'rating']);\nexport const isDataSetWidget = (widget: any) => {\n return DATASET_WIDGETS.has(widget);\n};\nexport const isFullPathUrl = (url: string) => {\n return isString(url) &&\n (url.startsWith('data:') \n || url.startsWith('http:') \n || url.startsWith('https:') \n || url.startsWith('file:'));\n};\n\nexport function removeUndefinedKeys(obj: any) {\n for (const key in obj) {\n if (obj[key] === undefined) {\n delete obj[key];\n } else if (typeof obj[key] === 'object') {\n // * if the value is an object, recursively call the function\n removeUndefinedKeys(obj[key]);\n }\n }\n\n return obj;\n}\n// * get total number of days in a month of a year\nfunction getDaysInMonth(month: number, year: number) {\n return new Date(year, month, 0).getDate();\n}\n\nexport const getDates = (\n startDate: number,\n endDate: number,\n month = 0, // zero-based\n year = new Date().getFullYear(),\n) => {\n const daysInMonth = getDaysInMonth(month, year);\n const dates = Array.from({length: daysInMonth}, (v, i) => i + 1);\n\n const datesInRange = dates.filter(date => date >= startDate);\n\n return datesInRange;\n};\n\nexport const monthNames = [\n 'January',\n 'February',\n 'March',\n 'April',\n 'May',\n 'June',\n 'July',\n 'August',\n 'September',\n 'October',\n 'November',\n 'December',\n];\n\nexport const getMonths = (startMonth: number, endMonth: number) => {\n const months = monthNames.map(name => name.substring(0, 3));\n const monthRange = months.filter((_, index) => index >= startMonth)\n\n return monthRange;\n};\n\nexport const getMonthIndex = (monthName: string, shortName: boolean = true) => {\n const months = shortName ? monthNames.map(name => name.substring(0, 3)) : monthNames;\n const monthNumber = months.findIndex((name) => name === monthName);\n\n return monthNumber;\n}\n\nexport const getYearRange = (\n startYear: number = 1950,\n endYear: number = 2060,\n) => {\n const years = [];\n for (let year = startYear; year <= endYear; ++year) {\n years.push(year);\n }\n\n return years;\n};\n\nexport const getDateObject = (date: number, month: number, year: number) => {\n // * month is zero-based\n return new Date(year, month, date);\n};\n\nexport const getHours = () => {\n const hours = [];\n for (let hour = 1; hour <= 12; ++hour) {\n const paddedHour = String(hour).padStart(2, '0');\n hours.push(paddedHour);\n }\n\n return hours;\n}\n\nexport const get24Hours = () => {\n const hours = [];\n for (let hour = 0; hour <= 23; ++hour) {\n const paddedHour = String(hour).padStart(2, '0');\n hours.push(paddedHour);\n }\n\n return hours;\n}\n\nexport const getMinutes = () => {\n const minutes = [];\n for (let minute = 0; minute <= 59; ++minute) {\n const paddedMinute = String(minute).padStart(2, '0');\n minutes.push(paddedMinute);\n }\n\n return minutes;\n}\n\nexport const getTimeIndicators = () => {\n return ['AM', 'PM'];\n}\n\nexport const getDateTimeObject = (date: number, month: number, year: number, hour: number, minute: number) => {\n // * month is zero-based\n return new Date(year, month, date, hour, minute);\n};\n\nexport const getGradientStartEnd = (angle: string) => {\n const angleLowerCase = angle?.toLowerCase();\n let start = { x: 0, y: 1 };\n let end = { x: 1, y: 1 };\n\n if (angle === '0deg' || angleLowerCase === 'to top') {\n end.x = 0;\n end.y = 0;\n } else if (angle === '90deg' || angleLowerCase === 'to right') {\n start.x = 0;\n } else if (angle === '180deg' || angleLowerCase === 'to bottom') {\n start.y = 0;\n end.x = 0;\n end.y = 1;\n } else if (angle === '270deg' || angleLowerCase === 'to left') {\n start.x = 1;\n end.x = 0;\n } else {\n // other angle\n }\n\n return {start, end}\n}\n\nexport const parseLinearGradient = (gradient: string) => {\n let angle = '', color1 = '', color2 = '';\n const linearGradientRegex = /linear-gradient\\(([^,]+),\\s*([^,]+),\\s*([^)]+)\\)/;\n const hasLinearGradient = linearGradientRegex.test(gradient);\n\n const matches = gradient?.match(linearGradientRegex);\n angle = matches?.[1] || '90deg';\n const {start, end} = getGradientStartEnd(angle)\n color1 = matches?.[2] || ThemeVariables.INSTANCE.primaryColor;\n color2 = matches?.[3] || ThemeVariables.INSTANCE.primaryColor;\n\n return {hasLinearGradient, color1, color2, start, end};\n}\n\nexport const validateInputOnDevice = (value: string, type: 'number' | 'currency') => {\n const isCurrencyField = type === 'currency';\n let isValidText = true;\n let validText = value;\n \n // * no alphabets except E, may contain E only once\n if (/[a-df-zA-DF-Z]/.test(value) || !/^[^eE]*[eE]?[^eE]*$/.test(value)) {\n isValidText = false;\n validText = validText.replace(/[a-df-zA-DF-Z]/g, '');\n validText = validText.replace(/([eE])\\1+/g, 'e');\n }\n\n // * currency only: check for negative number\n if (isCurrencyField && (Number(value) < 0 || /-/g.test(value))) {\n isValidText = false;\n validText = validText.replace(/-/g, '');\n }\n\n // * number only: not more than one minus and doesn't end with minus (-)\n if (!isCurrencyField && (Number(value.match(/-/g)?.length) > 1) || /\\w-/.test(value)) {\n isValidText = false;\n validText = validText.replace(/-/g, '');\n validText = validText.replace(/\\w-/g, '');\n }\n\n // * check for more than one decimal point\n if (/^\\d*\\.\\d*\\..*$/.test(value)) {\n isValidText = false;\n validText = validText.replace(/\\.(?=\\.*\\.)/g, '');\n }\n\n // * check for spaces and comma\n if (/[\\s,]/.test(value)) {\n isValidText = false;\n validText = validText.replace(/[\\s,]/, '');\n }\n\n return {isValidText, validText};\n}\n\nexport const isDateFormatAsPerPattern = (\n datePattern?: string,\n dateString?: string | Date\n) => {\n try {\n // * format dateString as per datePattern\n const date = moment(dateString, datePattern, true);\n\n // * check date is valid and matches the format\n return date.isValid() && typeof dateString === 'string' && dateString?.toUpperCase() === date.format(datePattern)?.toUpperCase();\n } catch (error) {\n // * if not able to parse date string\n return false;\n }\n};\n"],"mappings":"AAAA,SAASA,QAAQ,QAAQ,cAAc;AACvC,OAAOC,MAAM,MAAM,QAAQ;AAC3B,OAAO,KAAKC,UAA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G,KAAK;IACnBC,SAAS,GAAGA,SAAS,CAAC3J,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC;EAC5C;EAEA,OAAO;IAAC0J,WAAW;IAAEC;EAAS,CAAC;AACjC,CAAC;AAED,OAAO,MAAME,wBAAwB,GAAGA,CACtCC,WAAoB,EACpBC,UAA0B,KACvB;EACH,IAAI;IAAA,IAAAC,YAAA;IACF;IACA,MAAM5D,IAAI,GAAGzL,MAAM,CAACoP,UAAU,EAAED,WAAW,EAAE,IAAI,CAAC;;IAElD;IACA,OAAO1D,IAAI,CAAC/C,OAAO,CAAC,CAAC,IAAI,OAAO0G,UAAU,KAAK,QAAQ,IAAI,CAAAA,UAAU,aAAVA,UAAU,uBAAVA,UAAU,CAAEE,WAAW,CAAC,CAAC,QAAAD,YAAA,GAAK5D,IAAI,CAACnG,MAAM,CAAC6J,WAAW,CAAC,cAAAE,YAAA,uBAAxBA,YAAA,CAA0BC,WAAW,CAAC,CAAC;EAClI,CAAC,CAAC,OAAOC,KAAK,EAAE;IACd;IACA,OAAO,KAAK;EACd;AACF,CAAC","ignoreList":[]}
|
1
|
+
{"version":3,"names":["Platform","moment","FileSystem","isFunction","includes","isUndefined","isNull","orderBy","groupBy","toLower","get","forEach","sortBy","cloneDeep","keys","values","isArray","isString","isNumber","mime","ThemeVariables","GROUP_BY_OPTIONS","ALPHABET","WORD","OTHERS","TIME_ROLLUP_OPTIONS","HOUR","DAY","WEEK","MONTH","YEAR","_deepCopy","o1","o2","o","Object","k","v","deepCopy","objects","toBoolean","val","undefined","toNumber","parseFloat","e","encodeUrl","url","splits","split","hash","params","length","map","p","encodeURIComponent","join","encodeURI","isWebPreviewMode","OS","isDevMode","__DEV__","widgetsWithUndefinedValue","isAndroid","test","window","navigator","userAgent","isIos","getGroupKey","fieldDef","groupby","widgetScope","innerItem","apply","proxy","getGroupedData","fieldDefs","match","orderby","dateFormat","groupKey","groupedLiData","concatStr","toString","trim","substr","replace","format","getSortedGroupedData","getOrderedDataset","dataSet","items","fields","directions","obj","item","push","_groupedData","groupkey","index","liData","key","data","_groupIndex","isDefined","unStringify","defaultVal","number","parseInt","isNaN","retryIfFails","fn","interval","maxRetries","onBeforeRetry","Promise","resolve","retryCount","tryFn","reject","errorFn","errArgs","arguments","setTimeout","then","retry","getAbortableDefer","_defer","promise","onAbort","isAborted","abort","validateField","props","value","requiredCheck","regexCheck","required","errorType","isValid","regexp","condition","RegExp","maxchars","mindate","Date","datavalue","startOf","toDate","maxdate","endOf","countDecimalDigits","numberString","decimalMatch","decimalDigits","formatCompactNumber","isNegative","formattedNumber","toFixed","toBase64","path","readAsStringAsync","encoding","DATASET_WIDGETS","Set","isDataSetWidget","widget","has","isFullPathUrl","startsWith","removeUndefinedKeys","getDaysInMonth","month","year","getDate","getDates","startDate","endDate","getFullYear","daysInMonth","dates","Array","from","i","datesInRange","filter","date","monthNames","getMonths","startMonth","endMonth","months","name","substring","monthRange","_","getMonthIndex","monthName","shortName","monthNumber","findIndex","getYearRange","startYear","endYear","years","getDateObject","getHours","hours","hour","paddedHour","String","padStart","get24Hours","getMinutes","minutes","minute","paddedMinute","getTimeIndicators","getDateTimeObject","getGradientStartEnd","angle","angleLowerCase","toLowerCase","start","x","y","end","parseLinearGradient","gradient","color1","color2","linearGradientRegex","hasLinearGradient","matches","INSTANCE","primaryColor","validateInputOnDevice","type","_value$match","isCurrencyField","isValidText","validText","Number","isDateFormatAsPerPattern","datePattern","dateString","_date$format","toUpperCase","error","getMimeType","extensions","hasInvalidExtension","wildCards","extensionList","mimeType","extension","lookup","isWildCardExtension"],"sources":["utils.ts"],"sourcesContent":["import { Platform } from 'react-native';\nimport moment from \"moment\";\nimport * as FileSystem from \"expo-file-system\";\nimport { isFunction, includes, isUndefined, isNull, orderBy, groupBy, toLower, get, forEach, sortBy, cloneDeep, keys, values, isArray, isString, isNumber} from 'lodash';\nimport * as mime from 'react-native-mime-types';\nimport ThemeVariables from '../styles/theme.variables';\n\ndeclare const window: any;\nconst GROUP_BY_OPTIONS = {\n ALPHABET: 'alphabet',\n WORD: 'word',\n OTHERS: 'Others'\n};\nconst TIME_ROLLUP_OPTIONS = {\n HOUR: 'hour',\n DAY: 'day',\n WEEK: 'week',\n MONTH: 'month',\n YEAR: 'year'\n};\n\nconst _deepCopy = (o1: any, ...o2: any) => {\n o2.forEach((o: any) => {\n if (o) {\n Object.keys(o).forEach(k => {\n const v = o[k];\n if (v && !isString(v) && !isArray(v) && typeof v === 'object') {\n o1[k] = _deepCopy(o1[k] || {}, o[k]);\n } else {\n o1[k] = _deepCopy(v);\n }\n });\n }\n });\n return o1;\n};\n\nexport const deepCopy = (...objects: any) => _deepCopy({}, ...objects);\n\nexport const toBoolean = (val: any) => {\n return val === true\n || val === 'true'\n || !(val === false\n || val === null\n || val === undefined\n || val === '');\n};\n\nexport const toNumber = (val: any) => {\n try {\n return parseFloat(val) || 0;\n } catch(e) {\n return 0;\n }\n};\n\n/**\n * this method encodes the url and returns the encoded string\n */\n export const encodeUrl = (url: string): string => {\n let splits = url.split('#');\n const hash = splits[1];\n splits = splits[0].split('?');\n let params = '';\n if (splits.length > 1) {\n params = splits[1].split('&')\n .map(p => p.split('='))\n .map(p => p[0] +'=' + encodeURIComponent(p[1]))\n .join('&');\n }\n return encodeURI(splits[0]) + (params ? '?' + params: '') + (hash ? '#'+ hash : '');\n};\n\nexport const isWebPreviewMode = () => Platform.OS === 'web';\n\nexport const isDevMode = () => isWebPreviewMode() || __DEV__;\n\nexport const widgetsWithUndefinedValue = ['checkbox', 'toggle'];\n\nexport const isAndroid = () => (Platform.OS === 'android' || (Platform.OS === 'web' && /android/i.test(window.navigator.userAgent)));\n\nexport const isIos = () => (Platform.OS === 'ios' || (Platform.OS === 'web' && /iPhone|iPad/i.test(window.navigator.userAgent)));\n\nconst getGroupKey = (fieldDef: any, groupby: string, widgetScope: any, innerItem?: any) => isFunction(groupby) ? groupby.apply(widgetScope.proxy, [innerItem ? fieldDef[innerItem] : fieldDef]) : get(innerItem ? fieldDef[innerItem] : fieldDef, groupby);\n\n/**\n * This method prepares the grouped data.\n *\n * @param fieldDefs array of objects i.e. dataset\n * @param groupby string groupby\n * @param match string match\n * @param orderby string orderby\n * @param dateFormat string date format\n */\nexport const getGroupedData = (fieldDefs: any, groupby: string, match: string, orderby: string, dateFormat: string, widgetScope: any, innerItem?: any) => {\n\n // handling case-in-sensitive scenario\n // ordering the data based on groupby field. If there is innerItem then apply orderby using the innerItem's containing the groupby field.\n fieldDefs = orderBy(fieldDefs, fieldDef => {\n const groupKey = getGroupKey(fieldDef, groupby, widgetScope, innerItem);\n if (groupKey) {\n return toLower(groupKey);\n }\n return '';\n });\n\n // extract the grouped data based on the field obtained from 'groupDataByField'.\n const groupedLiData = groupBy(fieldDefs, function (fieldDef) {\n let concatStr = getGroupKey(fieldDef, groupby, widgetScope, innerItem);\n // by default set the undefined groupKey as 'others'\n if (isUndefined(concatStr) || isNull(concatStr) || concatStr.toString().trim() === '') {\n return GROUP_BY_OPTIONS.OTHERS;\n }\n // if match prop is alphabetic ,get the starting alphabet of the word as key.\n if (match === GROUP_BY_OPTIONS.ALPHABET) {\n concatStr = concatStr.substr(0, 1);\n }\n\n // if match contains the time options then get the concatStr using 'getTimeRolledUpString'\n if (includes(values(TIME_ROLLUP_OPTIONS), match)) {\n dateFormat = dateFormat && dateFormat.replace(/d/g, 'D');\n dateFormat = dateFormat && dateFormat.replace(/y/g, 'Y');\n concatStr = moment(concatStr).format(dateFormat);\n }\n\n return concatStr;\n });\n\n return getSortedGroupedData(groupedLiData, groupby, orderby, innerItem);\n};\n\n/**\n * function to get the ordered dataset based on the given orderby\n */\nexport const getOrderedDataset = (dataSet: any, orderby: string, innerItem?: any) => {\n if (!orderBy) {\n return cloneDeep(dataSet);\n }\n\n // The order by only works when the dataset contains list of objects.\n const items = orderby && orderby.split(','),\n fields: any = [],\n directions: any = [];\n items && items.forEach( obj => {\n const item = obj.split(':');\n fields.push(innerItem ? innerItem + '.' + item[0] : item[0]);\n directions.push(item[1]);\n });\n return orderBy(dataSet, fields, directions);\n};\n\n\n/**\n * This method returns sorted data based to groupkey.\n * Returns a array of objects, each object containing key which is groupKey and data is the sorted data which is sorted by groupby field in the data.\n *\n * @param groupedLiData, grouped data object with key as the groupKey and its value as the array of objects grouped under the groupKey.\n * @param groupBy, string groupby property\n * @returns {any[]}\n */\nexport const getSortedGroupedData = (groupedLiData: any, groupBy: string, orderby: string, innerItem?: any) => {\n const _groupedData: any = [];\n forEach(keys(groupedLiData), (groupkey, index) => {\n const liData = getOrderedDataset(groupedLiData[groupkey], orderby, innerItem);\n _groupedData.push({\n key: groupkey,\n data: sortBy(liData, data => {\n data._groupIndex = index;\n return get(data, groupBy) || get(data[innerItem], groupBy);\n })\n });\n });\n return _groupedData;\n};\n\nexport const isDefined = (v: any) => typeof v !== 'undefined';\n\n// try to convert the chekedvalue and unchecked values to boolean/number\nexport const unStringify = (val: any, defaultVal?: boolean) => {\n if (val === null) {\n return defaultVal;\n }\n\n if (val === true || val === 'true') {\n return true;\n }\n\n if (val === false || val === 'false') {\n return false;\n }\n\n const number = parseInt(val, 10);\n if (!isNaN(number)) {\n return number;\n }\n return val;\n};\n\n/**\n * This function invokes the given the function (fn) until the function successfully executes or the maximum number\n * of retries is reached or onBeforeRetry returns false.\n *\n * @param fn - a function that is needs to be invoked. The function can also return a promise as well.\n * @param interval - minimum time gap between successive retries. This argument should be greater or equal to 0.\n * @param maxRetries - maximum number of retries. This argument should be greater than 0. For all other values,\n * maxRetries is infinity.\n * @param onBeforeRetry - a callback function that will be invoked before re-invoking again. This function can\n * return false or a promise that is resolved to false to stop further retry attempts.\n * @returns {*} a promise that is resolved when fn is success (or) maximum retry attempts reached\n * (or) onBeforeRetry returned false.\n */\nexport const retryIfFails = (fn: Function, interval: number, maxRetries: number, onBeforeRetry = () => Promise.resolve(false)) => {\n let retryCount = 0;\n const tryFn = () => {\n retryCount++;\n if (isFunction(fn)) {\n return fn();\n }\n };\n maxRetries = (isNumber(maxRetries) && maxRetries > 0 ? maxRetries : 0);\n interval = (isNumber(interval) && interval > 0 ? interval : 0);\n return new Promise((resolve, reject) => {\n const errorFn = function () {\n const errArgs = arguments;\n setTimeout(() => {\n Promise.resolve().then(() => onBeforeRetry()).then(function (retry) {\n if (retry !== false && (!maxRetries || retryCount <= maxRetries)) {\n Promise.resolve().then(() => tryFn()).then(resolve, errorFn);\n } else {\n reject(errArgs);\n }\n }, () => reject(errArgs));\n }, interval);\n };\n Promise.resolve().then(() => tryFn()).then(resolve, errorFn);\n });\n};\n\n/**\n * Promise of a defer created using this function, has abort function that will reject the defer when called.\n * @returns {*} angular defer object\n */\nexport const getAbortableDefer = () => {\n const _defer: any = {\n promise: null,\n reject: null,\n resolve: null,\n onAbort: () => { },\n isAborted: false\n };\n _defer.promise = new Promise((resolve, reject) => {\n _defer.resolve = resolve;\n _defer.reject = reject;\n });\n _defer.promise.abort = () => {\n _defer.onAbort && _defer.onAbort();\n _defer.reject('aborted');\n _defer.isAborted = true;\n };\n return _defer;\n};\n\nexport const validateField = (props: any, value: any) => {\n let requiredCheck = true, regexCheck = true;\n if (props.required) {\n if (isArray(value)) {\n requiredCheck = value.length === 0 ? false : true\n } else {\n requiredCheck = !value ? false : true\n }\n if (!requiredCheck) {\n return {\n errorType : 'required',\n isValid: false\n }\n }\n }\n if (value && props.regexp) {\n const condition = new RegExp(\"^\" + props.regexp + \"$\", 'g');\n regexCheck = condition.test(value);\n if (!regexCheck) {\n return {\n errorType : 'regexp',\n isValid: false\n }\n }\n }\n if (value && props.maxchars && value.length > props.maxchars) {\n return {\n errorType : 'maxchars',\n isValid: false\n }\n\n }\n if (value && props.mindate && new Date(props.datavalue) < moment(props.mindate).startOf('day').toDate()) {\n return {\n errorType : 'mindate',\n isValid: false\n }\n }\n if (value && props.maxdate && new Date(props.datavalue) > moment(props.maxdate).endOf('day').toDate()) {\n return {\n errorType : 'maxdate',\n isValid: false\n }\n }\n\n return {\n isValid: true\n }\n};\n\nexport const countDecimalDigits = (number: number | string) => {\n if (!number) return 0;\n\n // * convert the number to a string\n const numberString = number.toString();\n \n // * regular expression to match and count the decimal digits\n const decimalMatch = numberString.match(/\\.(\\d+)/);\n\n if (decimalMatch) {\n const decimalDigits = decimalMatch[1];\n return decimalDigits.length;\n } else {\n return 0; // * no decimal digits found\n }\n}\n\nexport const formatCompactNumber = (number: number) => {\n const isNegative = number < 0;\n number = isNegative ? number * -1 : number;\n let formattedNumber = number + '';\n if (number >= 1000 && number < 1_000_000) {\n formattedNumber = (number / 1000).toFixed(1).replace(/\\.0$/, \"\") + \"K\";\n } else if (number >= 1_000_000 && number < 1_000_000_000) {\n formattedNumber = (number / 1_000_000).toFixed(1).replace(/\\.0$/, \"\") + \"M\";\n } else if (number >= 1_000_000_000 && number < 1_000_000_000_000) {\n formattedNumber = (number / 1_000_000_000).toFixed(1).replace(/\\.0$/, \"\") + \"B\";\n } else if (number >= 1_000_000_000_000 && number < 1_000_000_000_000_000) {\n formattedNumber = (number / 1_000_000_000_000).toFixed(1).replace(/\\.0$/, \"\") + \"T\";\n }\n return (isNegative ? '-' : '') + formattedNumber;\n}\n\nexport const toBase64 = function(path: string) {\n return FileSystem.readAsStringAsync(path, { encoding: 'base64' });\n};\n\nconst DATASET_WIDGETS = new Set([ 'select', 'checkboxset', 'radioset', 'switch', 'autocomplete', 'chips', 'typeahead', 'rating']);\nexport const isDataSetWidget = (widget: any) => {\n return DATASET_WIDGETS.has(widget);\n};\nexport const isFullPathUrl = (url: string) => {\n return isString(url) &&\n (url.startsWith('data:') \n || url.startsWith('http:') \n || url.startsWith('https:') \n || url.startsWith('file:'));\n};\n\nexport function removeUndefinedKeys(obj: any) {\n for (const key in obj) {\n if (obj[key] === undefined) {\n delete obj[key];\n } else if (typeof obj[key] === 'object') {\n // * if the value is an object, recursively call the function\n removeUndefinedKeys(obj[key]);\n }\n }\n\n return obj;\n}\n// * get total number of days in a month of a year\nfunction getDaysInMonth(month: number, year: number) {\n return new Date(year, month, 0).getDate();\n}\n\nexport const getDates = (\n startDate: number,\n endDate: number,\n month = 0, // zero-based\n year = new Date().getFullYear(),\n) => {\n const daysInMonth = getDaysInMonth(month, year);\n const dates = Array.from({length: daysInMonth}, (v, i) => i + 1);\n\n const datesInRange = dates.filter(date => date >= startDate);\n\n return datesInRange;\n};\n\nexport const monthNames = [\n 'January',\n 'February',\n 'March',\n 'April',\n 'May',\n 'June',\n 'July',\n 'August',\n 'September',\n 'October',\n 'November',\n 'December',\n];\n\nexport const getMonths = (startMonth: number, endMonth: number) => {\n const months = monthNames.map(name => name.substring(0, 3));\n const monthRange = months.filter((_, index) => index >= startMonth)\n\n return monthRange;\n};\n\nexport const getMonthIndex = (monthName: string, shortName: boolean = true) => {\n const months = shortName ? monthNames.map(name => name.substring(0, 3)) : monthNames;\n const monthNumber = months.findIndex((name) => name === monthName);\n\n return monthNumber;\n}\n\nexport const getYearRange = (\n startYear: number = 1950,\n endYear: number = 2060,\n) => {\n const years = [];\n for (let year = startYear; year <= endYear; ++year) {\n years.push(year);\n }\n\n return years;\n};\n\nexport const getDateObject = (date: number, month: number, year: number) => {\n // * month is zero-based\n return new Date(year, month, date);\n};\n\nexport const getHours = () => {\n const hours = [];\n for (let hour = 1; hour <= 12; ++hour) {\n const paddedHour = String(hour).padStart(2, '0');\n hours.push(paddedHour);\n }\n\n return hours;\n}\n\nexport const get24Hours = () => {\n const hours = [];\n for (let hour = 0; hour <= 23; ++hour) {\n const paddedHour = String(hour).padStart(2, '0');\n hours.push(paddedHour);\n }\n\n return hours;\n}\n\nexport const getMinutes = () => {\n const minutes = [];\n for (let minute = 0; minute <= 59; ++minute) {\n const paddedMinute = String(minute).padStart(2, '0');\n minutes.push(paddedMinute);\n }\n\n return minutes;\n}\n\nexport const getTimeIndicators = () => {\n return ['AM', 'PM'];\n}\n\nexport const getDateTimeObject = (date: number, month: number, year: number, hour: number, minute: number) => {\n // * month is zero-based\n return new Date(year, month, date, hour, minute);\n};\n\nexport const getGradientStartEnd = (angle: string) => {\n const angleLowerCase = angle?.toLowerCase();\n let start = { x: 0, y: 1 };\n let end = { x: 1, y: 1 };\n\n if (angle === '0deg' || angleLowerCase === 'to top') {\n end.x = 0;\n end.y = 0;\n } else if (angle === '90deg' || angleLowerCase === 'to right') {\n start.x = 0;\n } else if (angle === '180deg' || angleLowerCase === 'to bottom') {\n start.y = 0;\n end.x = 0;\n end.y = 1;\n } else if (angle === '270deg' || angleLowerCase === 'to left') {\n start.x = 1;\n end.x = 0;\n } else {\n // other angle\n }\n\n return {start, end}\n}\n\nexport const parseLinearGradient = (gradient: string) => {\n let angle = '', color1 = '', color2 = '';\n const linearGradientRegex = /linear-gradient\\(([^,]+),\\s*([^,]+),\\s*([^)]+)\\)/;\n const hasLinearGradient = linearGradientRegex.test(gradient);\n\n const matches = gradient?.match(linearGradientRegex);\n angle = matches?.[1] || '90deg';\n const {start, end} = getGradientStartEnd(angle)\n color1 = matches?.[2] || ThemeVariables.INSTANCE.primaryColor;\n color2 = matches?.[3] || ThemeVariables.INSTANCE.primaryColor;\n\n return {hasLinearGradient, color1, color2, start, end};\n}\n\nexport const validateInputOnDevice = (value: string, type: 'number' | 'currency') => {\n const isCurrencyField = type === 'currency';\n let isValidText = true;\n let validText = value;\n \n // * no alphabets except E, may contain E only once\n if (/[a-df-zA-DF-Z]/.test(value) || !/^[^eE]*[eE]?[^eE]*$/.test(value)) {\n isValidText = false;\n validText = validText.replace(/[a-df-zA-DF-Z]/g, '');\n validText = validText.replace(/([eE])\\1+/g, 'e');\n }\n\n // * currency only: check for negative number\n if (isCurrencyField && (Number(value) < 0 || /-/g.test(value))) {\n isValidText = false;\n validText = validText.replace(/-/g, '');\n }\n\n // * number only: not more than one minus and doesn't end with minus (-)\n if (!isCurrencyField && (Number(value.match(/-/g)?.length) > 1) || /\\w-/.test(value)) {\n isValidText = false;\n validText = validText.replace(/-/g, '');\n validText = validText.replace(/\\w-/g, '');\n }\n\n // * check for more than one decimal point\n if (/^\\d*\\.\\d*\\..*$/.test(value)) {\n isValidText = false;\n validText = validText.replace(/\\.(?=\\.*\\.)/g, '');\n }\n\n // * check for spaces and comma\n if (/[\\s,]/.test(value)) {\n isValidText = false;\n validText = validText.replace(/[\\s,]/, '');\n }\n\n return {isValidText, validText};\n}\n\nexport const isDateFormatAsPerPattern = (\n datePattern?: string,\n dateString?: string | Date\n) => {\n try {\n // * format dateString as per datePattern\n const date = moment(dateString, datePattern, true);\n\n // * check date is valid and matches the format\n return date.isValid() && typeof dateString === 'string' && dateString?.toUpperCase() === date.format(datePattern)?.toUpperCase();\n } catch (error) {\n // * if not able to parse date string\n return false;\n }\n};\n\nexport const getMimeType = (extensions?: string) => {\n if (!extensions) return '*/*';\n let hasInvalidExtension = false;\n let wildCards = ['image/*', 'audio/*', 'video/*'];\n let extensionList = extensions.split(' ');\n let mimeType = extensionList\n .map((extension: string) => {\n let type = mime.lookup(extension);\n let isWildCardExtension = wildCards.includes(extension);\n // * invalid extension, also not in wildcards\n hasInvalidExtension = !type && !isWildCardExtension;\n return type ? type : isWildCardExtension ? extension : '';\n })\n .filter((type) => type);\n\n if (hasInvalidExtension) return '*/*';\n return mimeType;\n};\n"],"mappings":"AAAA,SAASA,QAAQ,QAAQ,cAAc;AACvC,OAAOC,MAAM,MAAM,QAAQ;AAC3B,OAAO,KAAKC,UAAU,MAAM,kBAAkB;AAC9C,SAASC,UAAU,EAAEC,QAAQ,EAAEC,WAAW,EAAEC,MAAM,EAAEC,OAAO,EAAEC,OAAO,EAAEC,OAAO,EAAEC,GAAG,EAAEC,OAAO,EAAEC,MAAM,EAAEC,SAAS,EAAEC,IAAI,EAAEC,MAAM,EAAEC,OAAO,EAAEC,QAAQ,EAAEC,QAAQ,QAAO,QAAQ;AACxK,OAAO,KAAKC,IAAI,MAAM,yBAAyB;AAC/C,OAAOC,cAAc,MAAM,2BAA2B;AAGtD,MAAMC,gBAAgB,GAAG;EACvBC,QAAQ,EAAE,UAAU;EACpBC,IAAI,EAAE,MAAM;EACZC,MAAM,EAAE;AACV,CAAC;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KAAK,QAAQ,IAAI,CAAAA,UAAU,aAAVA,UAAU,uBAAVA,UAAU,CAAEE,WAAW,CAAC,CAAC,QAAAD,YAAA,GAAK5D,IAAI,CAACnG,MAAM,CAAC6J,WAAW,CAAC,cAAAE,YAAA,uBAAxBA,YAAA,CAA0BC,WAAW,CAAC,CAAC;EAClI,CAAC,CAAC,OAAOC,KAAK,EAAE;IACd;IACA,OAAO,KAAK;EACd;AACF,CAAC;AAED,OAAO,MAAMC,WAAW,GAAIC,UAAmB,IAAK;EAClD,IAAI,CAACA,UAAU,EAAE,OAAO,KAAK;EAC7B,IAAIC,mBAAmB,GAAG,KAAK;EAC/B,IAAIC,SAAS,GAAG,CAAC,SAAS,EAAE,SAAS,EAAE,SAAS,CAAC;EACjD,IAAIC,aAAa,GAAGH,UAAU,CAAC1M,KAAK,CAAC,GAAG,CAAC;EACzC,IAAI8M,QAAQ,GAAGD,aAAa,CACzBzM,GAAG,CAAE2M,SAAiB,IAAK;IAC1B,IAAIlB,IAAI,GAAG3N,IAAI,CAAC8O,MAAM,CAACD,SAAS,CAAC;IACjC,IAAIE,mBAAmB,GAAGL,SAAS,CAACzP,QAAQ,CAAC4P,SAAS,CAAC;IACvD;IACAJ,mBAAmB,GAAG,CAACd,IAAI,IAAI,CAACoB,mBAAmB;IACnD,OAAOpB,IAAI,GAAGA,IAAI,GAAGoB,mBAAmB,GAAGF,SAAS,GAAG,EAAE;EAC3D,CAAC,CAAC,CACDtE,MAAM,CAAEoD,IAAI,IAAKA,IAAI,CAAC;EAEzB,IAAIc,mBAAmB,EAAE,OAAO,KAAK;EACrC,OAAOG,QAAQ;AACjB,CAAC","ignoreList":[]}
|
app-rn-runtime/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@wavemaker/app-rn-runtime",
|
3
|
-
"version": "12.0.0-next.
|
3
|
+
"version": "12.0.0-next.45752",
|
4
4
|
"description": "''",
|
5
5
|
"main": "index",
|
6
6
|
"module": "index",
|
@@ -17,6 +17,7 @@
|
|
17
17
|
"copy-resources": "mkdir -p ./dist && cp -r ./lib/module ./dist && cp ./package.json ./dist/module",
|
18
18
|
"lint": "eslint \"**/*.{js,ts,tsx}\"",
|
19
19
|
"build": "bob build && node ./scripts/build.js post-build",
|
20
|
+
"build:test": "cd ./test && tsc",
|
20
21
|
"release": "release-it",
|
21
22
|
"example": "yarn --cwd example",
|
22
23
|
"pods": "cd example && pod-install --quiet",
|
@@ -49,7 +50,7 @@
|
|
49
50
|
"@react-navigation/drawer": "6.6.3",
|
50
51
|
"@react-navigation/native": "6.1.7",
|
51
52
|
"@react-navigation/stack": "6.3.29",
|
52
|
-
"@wavemaker/variables": "12.0.0-next.
|
53
|
+
"@wavemaker/variables": "12.0.0-next.45752",
|
53
54
|
"axios": "1.6.8",
|
54
55
|
"color": "4.2.3",
|
55
56
|
"cross-env": "7.0.3",
|
@@ -68,6 +69,7 @@
|
|
68
69
|
"react-native-animatable": "1.4.0",
|
69
70
|
"react-native-circular-progress": "1.4.0",
|
70
71
|
"react-native-logs": "5.1.0",
|
72
|
+
"react-native-mime-types": "2.5.0",
|
71
73
|
"react-native-paper": "5.12.3",
|
72
74
|
"react-native-paper-dates": "0.22.7",
|
73
75
|
"react-native-reanimated": "3.6.2",
|
@@ -139,7 +141,7 @@
|
|
139
141
|
"typescript": "5.1.3",
|
140
142
|
"victory-native": "36.6.11",
|
141
143
|
"yargs": "16.2.0",
|
142
|
-
"@wavemaker/variables": "12.0.0-next.
|
144
|
+
"@wavemaker/variables": "12.0.0-next.45752"
|
143
145
|
},
|
144
146
|
"jest": {
|
145
147
|
"preset": "jest-expo",
|
@@ -164,7 +166,7 @@
|
|
164
166
|
"^.+\\.(js|jsx|mjs)$": "<rootDir>/node_modules/babel-jest"
|
165
167
|
},
|
166
168
|
"transformIgnorePatterns": [
|
167
|
-
"node_modules/(?!((jest-)?react-native|@react-native(-community)?)|expo(nent)?|@expo(nent)?/.*|@expo-google-fonts/.*|react-navigation|@react-navigation/.*|@unimodules/.*|unimodules|sentry-expo|native-base|react-native-svg|@wavemaker|@wavemaker/app-rn-runtime/components/basic/modal/modal.component|expo-linear-gradient|react-native-gesture-handler|@react-native-community|@react-native-community/datetimepicker|react-native-reanimated|d3-
|
169
|
+
"node_modules/(?!((jest-)?react-native|@react-native(-community)?)|expo(nent)?|@expo(nent)?/.*|@expo-google-fonts/.*|react-navigation|@react-navigation/.*|@unimodules/.*|unimodules|sentry-expo|native-base|react-native-svg|@wavemaker|@wavemaker/app-rn-runtime/components/basic/modal/modal.component|expo-linear-gradient|react-native-gesture-handler|@react-native-community|@react-native-community/datetimepicker|react-native-reanimated|d3*|victory-native|victory-.*)"
|
168
170
|
],
|
169
171
|
"moduleNameMapper": {
|
170
172
|
"^lodash-es$": "lodash",
|
@@ -8,6 +8,7 @@ import networkService from '@wavemaker/app-rn-runtime/core/network.service';
|
|
8
8
|
import injector from '@wavemaker/app-rn-runtime/core/injector';
|
9
9
|
import StorageService from '@wavemaker/app-rn-runtime/core/storage.service';
|
10
10
|
import WebProcessService from './webprocess.service';
|
11
|
+
import { isWebPreviewMode } from '@wavemaker/app-rn-runtime/core/utils';
|
11
12
|
var USER_ROLE = /*#__PURE__*/function (USER_ROLE) {
|
12
13
|
USER_ROLE["EVERYONE"] = "Everyone";
|
13
14
|
USER_ROLE["ANONYMOUS"] = "Anonymous";
|
@@ -27,6 +28,19 @@ class AppSecurityService {
|
|
27
28
|
_defineProperty(this, "baseUrl", '');
|
28
29
|
_defineProperty(this, "defaultSecurityConfig", void 0);
|
29
30
|
_defineProperty(this, "landingPage", '');
|
31
|
+
_defineProperty(this, "getRegex", str => {
|
32
|
+
const wm_xsrf_token_index = str.indexOf('wm_xsrf_token') + 13; // 13 is the length of 'wm_xsrf_token' string
|
33
|
+
let index = wm_xsrf_token_index;
|
34
|
+
while (str[index] !== ':') {
|
35
|
+
index++;
|
36
|
+
}
|
37
|
+
const regExp = str.substring(wm_xsrf_token_index, index);
|
38
|
+
return new RegExp(regExp, "g");
|
39
|
+
});
|
40
|
+
_defineProperty(this, "formateData", data => {
|
41
|
+
const regex = this.getRegex(data);
|
42
|
+
return JSON.parse(data.replace(regex, "\""));
|
43
|
+
});
|
30
44
|
axios.interceptors.request.use(config => this.onBeforeServiceCall(config));
|
31
45
|
}
|
32
46
|
onBeforeServiceCall(config) {
|
@@ -90,6 +104,14 @@ class AppSecurityService {
|
|
90
104
|
});
|
91
105
|
}
|
92
106
|
load(baseURL) {
|
107
|
+
if (isWebPreviewMode()) {
|
108
|
+
var _document;
|
109
|
+
const token = (_document = document) === null || _document === void 0 || (_document = _document.cookie) === null || _document === void 0 ? void 0 : _document.split(';').filter(item => item.includes('wm_xsrf_token'));
|
110
|
+
if (token && token.length > 0) {
|
111
|
+
const wm_xsrf_token = token[0].split('=')[1];
|
112
|
+
wm_xsrf_token && StorageService.setItem(XSRF_COOKIE_NAME, wm_xsrf_token);
|
113
|
+
}
|
114
|
+
}
|
93
115
|
return Promise.resolve().then(() => {
|
94
116
|
if (networkService.isConnected()) {
|
95
117
|
return axios.get(baseURL + '/services/security/info').then(response => response.data);
|
@@ -142,7 +164,9 @@ class AppSecurityService {
|
|
142
164
|
setTimeout(() => {
|
143
165
|
WebProcessService.execute('LOGIN', '/services/security/ssologin', false, true).then(output => {
|
144
166
|
if (output) {
|
145
|
-
|
167
|
+
if (output.data) {
|
168
|
+
return this.formateData(`${output.data}`);
|
169
|
+
}
|
146
170
|
}
|
147
171
|
return Promise.reject();
|
148
172
|
}).then(output => {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["Platform","axios","each","includes","networkService","injector","StorageService","WebProcessService","USER_ROLE","authCookieStr","XSRF_COOKIE_NAME","xsrf_header_name","AppSecurityService","constructor","_defineProperty","interceptors","request","use","config","onBeforeServiceCall","appConfig","getAppConfig","baseUrl","url","getXsrfToken","then","token","_config$url","startsWith","headers","Promise","resolve","getItem","xsrf_token","get","navigateToLandingPage","_this$appConfig$curre","_this$appConfig$logge","currentPage","goToPage","loggedInUser","landingPage","setTimeout","_this$appConfig$curre2","openUrl","appLogin","options","payload","formData","value","name","encodeURIComponent","defaults","withCredentials","post","baseURL","response","xsrfCookieValue","data","setItem","isLoggedIn","load","userData","getLoggedInUserDetails","useDefaultSuccessHandler","app","triggerStartUpVariables","isConnected","getServiceDefinitions","defaultSecurityConfig","details","securityConfig","isSecurityEnabled","securityEnabled","authenticated","_appConfig$appPropert","isAuthenticated","roles","userInfo","userRoles","userName","id","userId","tenantId","userAttributes","dataSet","appProperties","homePage","redirectToLogin","redirectTo","_this$securityConfig","loginConfig","type","authUrl","OS","window","parent","location","href","execute","output","JSON","parse","replace","reject","refresh","_this$securityConfig$","_this$appConfig$curre3","loginPage","pageName","appLogout","catch","canUserAccessPage","_this$securityConfig2","res","status","matchRoles","widgetRoles","some","item","hasAccessToWidget","_this$loggedInUser$da","_this$loggedInUser$da2","_this$loggedInUser$da3","_this$loggedInUser$da4","widgetRolesArr","split","EVERYONE","ANONYMOUS","AUTHENTICATED","appSecurityService"],"sources":["app-security.service.tsx"],"sourcesContent":["import { Platform } from 'react-native';\nimport axios, { InternalAxiosRequestConfig, AxiosResponse } from 'axios';\nimport { each, includes } from 'lodash';\n\nimport networkService from '@wavemaker/app-rn-runtime/core/network.service';\nimport injector from '@wavemaker/app-rn-runtime/core/injector';\nimport AppConfig from '@wavemaker/app-rn-runtime/core/AppConfig';\nimport StorageService from '@wavemaker/app-rn-runtime/core/storage.service';\nimport { SecurityService } from '@wavemaker/app-rn-runtime/core/security.service';\n\nimport WebProcessService from './webprocess.service';\n\ndeclare const window: any;\n\ninterface LoggedInUserConfig {\n isAuthenticated: Boolean;\n isSecurityEnabled: Boolean;\n roles: Array<string>;\n name: String;\n id: String;\n tenantId: String;\n userAttributes: any;\n landingPage: string;\n}\n\nenum USER_ROLE {\n EVERYONE = 'Everyone',\n ANONYMOUS = 'Anonymous',\n AUTHENTICATED = 'Authenticated'\n}\n\nconst authCookieStr = 'AUTH_COOKIE';\nconst XSRF_COOKIE_NAME = 'wm_xsrf_token';\nconst xsrf_header_name = 'X-WM-XSRF-TOKEN';\n\nclass AppSecurityService implements SecurityService {\n\n securityConfig: any;\n isLoggedIn = false;\n loggedInUser: any = {};\n token: any;\n appConfig: any;\n baseUrl: string = '';\n defaultSecurityConfig: any;\n landingPage = '';\n\n constructor() {\n axios.interceptors.request.use((config: InternalAxiosRequestConfig) => this.onBeforeServiceCall(config));\n }\n\n onBeforeServiceCall(config: InternalAxiosRequestConfig) {\n if (!this.appConfig) {\n this.appConfig = this.getAppConfig();\n this.baseUrl = this.appConfig.url;\n }\n return this.getXsrfToken().then((token: string) => {\n if (config.url?.startsWith(this.baseUrl) && token) {\n if(config.headers) config.headers[xsrf_header_name] = token;\n }\n return config\n });\n }\n\n private getXsrfToken(): Promise<string> {\n if (this.token) {\n return Promise.resolve(this.token);\n }\n return StorageService.getItem(XSRF_COOKIE_NAME).then(xsrf_token => {\n this.token = xsrf_token;\n return this.token;\n });\n }\n\n private getAppConfig() {\n return injector.get<AppConfig>('APP_CONFIG');\n }\n\n public navigateToLandingPage() {\n this.appConfig.currentPage?.goToPage(\n this.appConfig.loggedInUser?.landingPage \n || this.appConfig.landingPage \n || 'Main', null, true);\n if (this.landingPage) {\n const landingPage = this.landingPage;\n this.landingPage = '';\n setTimeout(() => {\n this.appConfig.currentPage?.openUrl(landingPage);\n }, 100);\n }\n }\n\n public appLogin(options: any) {\n // encode all parameters\n let payload = '';\n each(options.formData, function (value, name) {\n payload += (payload ? '&' : '') + encodeURIComponent(name) + '=' + encodeURIComponent(value);\n });\n axios.defaults.withCredentials = true;\n return axios.post(options.baseURL + '/j_spring_security_check', payload, {\n withCredentials: true,\n headers: {\n 'Content-Type': 'application/x-www-form-urlencoded'\n }}).then((response: AxiosResponse) => {\n const xsrfCookieValue = response.data ? response.data[XSRF_COOKIE_NAME] : '';\n this.token = xsrfCookieValue;\n StorageService.setItem(XSRF_COOKIE_NAME, xsrfCookieValue);\n this.isLoggedIn = true;\n }).then(() => this.load(options.baseURL))\n .then(async () => {\n const userData = await this.getLoggedInUserDetails(options.baseURL, options.useDefaultSuccessHandler);\n await this.appConfig.app.triggerStartUpVariables();\n return userData;\n });\n }\n\n public load(baseURL: string) {\n return Promise.resolve().then(() => {\n if (networkService.isConnected()) {\n return axios.get(baseURL + '/services/security/info')\n .then((response: AxiosResponse) => response.data);\n }\n return this.appConfig.getServiceDefinitions(this.appConfig.url)\n .then(() => Promise.resolve(this.defaultSecurityConfig));\n }).then((details: any) => {\n const loggedInUser = {} as LoggedInUserConfig;\n this.securityConfig = details || {};\n this.securityConfig.isSecurityEnabled = !!details?.securityEnabled;\n const appConfig = this.appConfig;\n if (typeof details !== 'string' && (!details.securityEnabled || details.authenticated)) {\n if (details.authenticated) {\n loggedInUser.isAuthenticated = details.authenticated;\n loggedInUser.isSecurityEnabled = details.authenticated;\n loggedInUser.roles = details.userInfo.userRoles;\n loggedInUser.name = details.userInfo.userName;\n loggedInUser.id = details.userInfo.userId;\n loggedInUser.tenantId = details.userInfo.tenantId;\n loggedInUser.userAttributes = details.userInfo.userAttributes;\n loggedInUser.landingPage = details.userInfo.landingPage;\n appConfig.loggedInUser = loggedInUser;\n this.loggedInUser.dataSet = loggedInUser;\n appConfig.landingPage = appConfig.appProperties?.homePage;\n }\n return appConfig.getServiceDefinitions(appConfig.url)\n .then(() => {\n return details;\n });\n } else {\n return appConfig.getServiceDefinitions(appConfig.url)\n .then(() => {\n this.redirectToLogin();\n });\n }\n });\n }\n\n private getLoggedInUserDetails(baseURL: string, useDefaultSuccessHandler: boolean = true) {\n if (!baseURL) {\n this.loggedInUser = {};\n return Promise.resolve({});\n }\n return this.load(baseURL);\n }\n\n \n public redirectToLogin(redirectTo?: string) {\n if (this.securityConfig?.loginConfig?.type === 'SSO') {\n const authUrl = this.appConfig.url + '/services/security/ssologin';\n if (Platform.OS === 'web') {\n (window.parent || window).location.href = authUrl;\n } else {\n setTimeout(() => {\n WebProcessService.execute('LOGIN', '/services/security/ssologin', false, true)\n .then((output: any) => {\n if (output) {\n return JSON.parse(output.data && output.data.replace(/"/g, \"\\\"\"));\n }\n return Promise.reject();\n }).then((output: any) => {\n if (output[XSRF_COOKIE_NAME]) {\n this.token = output[XSRF_COOKIE_NAME];\n StorageService.setItem(XSRF_COOKIE_NAME, output[XSRF_COOKIE_NAME]);\n }\n }).then(() => {\n this.appConfig.refresh(true);\n }).then(() => this.load(this.baseUrl)).then(() => {\n return this.getLoggedInUserDetails(this.baseUrl);\n });\n }, 1000);\n }\n } else {\n const loginPage = this.securityConfig.loginConfig?.pageName || 'Login';\n if (redirectTo && !redirectTo.startsWith('#/'+ loginPage)) {\n this.landingPage = redirectTo;\n }\n injector.get<AppConfig>('APP_CONFIG').landingPage = loginPage;\n this.appConfig.currentPage?.goToPage(loginPage, null, true);\n }\n this.appConfig.refresh();\n }\n\n public appLogout(options: any) {\n return axios.post(options.baseURL + '/j_spring_security_logout', null, {\n withCredentials: true\n }).catch(() => {}).then(() => {\n this.isLoggedIn = false;\n this.redirectToLogin();\n });\n }\n\n public canUserAccessPage(pageName: string) {\n if (this.baseUrl && this.securityConfig?.isSecurityEnabled) {\n return axios.get(this.baseUrl + `/pages/${pageName}/${pageName}.html`)\n .catch((res) => res)\n .then((res) => res.status === 200 || res.status === 304); \n } else {\n return Promise.resolve(true);\n }\n }\n\n private matchRoles(widgetRoles: Array<String>, userRoles: Array<String>) {\n return widgetRoles.some(function (item) {\n return includes(userRoles, item);\n });\n }\n\n public hasAccessToWidget(widgetRoles: String) {\n const widgetRolesArr = widgetRoles.split(',');\n // access the widget when 'Everyone' is chosen\n if (includes(widgetRolesArr, USER_ROLE.EVERYONE)) {\n return true;\n }\n\n // access the widget when 'Anonymous' is chosen and user is not authenticated\n if (includes(widgetRolesArr, USER_ROLE.ANONYMOUS) && !this.loggedInUser.dataSet?.isAuthenticated) {\n return true;\n }\n\n // access the widget when 'Only Authenticated Users' is chosen and user is authenticated\n if (includes(widgetRolesArr, USER_ROLE.AUTHENTICATED) && this.loggedInUser.dataSet?.isAuthenticated) {\n return true;\n }\n\n // access the widget when widget role and logged in user role matches\n return this.loggedInUser.dataSet?.isAuthenticated && this.matchRoles(widgetRolesArr, this.loggedInUser.dataSet?.roles);\n }\n}\n\nconst appSecurityService = new AppSecurityService();\n\nexport default appSecurityService;\n"],"mappings":";;;AAAA,SAASA,QAAQ,QAAQ,cAAc;AACvC,OAAOC,KAAK,MAAqD,OAAO;AACxE,SAASC,IAAI,EAAEC,QAAQ,QAAQ,QAAQ;AAEvC,OAAOC,cAAc,MAAM,gDAAgD;AAC3E,OAAOC,QAAQ,MAAM,yCAAyC;AAE9D,OAAOC,cAAc,MAAM,gDAAgD;AAG3E,OAAOC,iBAAiB,MAAM,sBAAsB;AAAC,IAehDC,SAAS,0BAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAAA,OAATA,SAAS;AAAA,EAATA,SAAS;AAMd,MAAMC,aAAa,GAAG,aAAa;AACnC,MAAMC,gBAAgB,GAAG,eAAe;AACxC,MAAMC,gBAAgB,GAAG,iBAAiB;AAE1C,MAAMC,kBAAkB,CAA4B;EAWhDC,WAAWA,CAAA,EAAG;IAAAC,eAAA;IAAAA,eAAA,qBARD,KAAK;IAAAA,eAAA,uBACE,CAAC,CAAC;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA,kBAGJ,EAAE;IAAAA,eAAA;IAAAA,eAAA,sBAEN,EAAE;IAGdb,KAAK,CAACc,YAAY,CAACC,OAAO,CAACC,GAAG,CAAEC,MAAkC,IAAK,IAAI,CAACC,mBAAmB,CAACD,MAAM,CAAC,CAAC;EAC1G;EAEAC,mBAAmBA,CAACD,MAAkC,EAAE;IACtD,IAAI,CAAC,IAAI,CAACE,SAAS,EAAE;MACnB,IAAI,CAACA,SAAS,GAAG,IAAI,CAACC,YAAY,CAAC,CAAC;MACpC,IAAI,CAACC,OAAO,GAAG,IAAI,CAACF,SAAS,CAACG,GAAG;IACn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OAAI,CAACnF,YAAY,CAAC6C,OAAO,cAAAsC,sBAAA,uBAAzBA,sBAAA,CAA2B/C,eAAe,KAAI,IAAI,CAACwC,UAAU,CAACS,cAAc,GAAAD,sBAAA,GAAE,IAAI,CAACpF,YAAY,CAAC6C,OAAO,cAAAuC,sBAAA,uBAAzBA,sBAAA,CAA2B/C,KAAK,CAAC;EAC1H;AACJ;AAEA,MAAMqD,kBAAkB,GAAG,IAAItH,kBAAkB,CAAC,CAAC;AAEnD,eAAesH,kBAAkB","ignoreList":[]}
|
1
|
+
{"version":3,"names":["Platform","axios","each","includes","networkService","injector","StorageService","WebProcessService","isWebPreviewMode","USER_ROLE","authCookieStr","XSRF_COOKIE_NAME","xsrf_header_name","AppSecurityService","constructor","_defineProperty","str","wm_xsrf_token_index","indexOf","index","regExp","substring","RegExp","data","regex","getRegex","JSON","parse","replace","interceptors","request","use","config","onBeforeServiceCall","appConfig","getAppConfig","baseUrl","url","getXsrfToken","then","token","_config$url","startsWith","headers","Promise","resolve","getItem","xsrf_token","get","navigateToLandingPage","_this$appConfig$curre","_this$appConfig$logge","currentPage","goToPage","loggedInUser","landingPage","setTimeout","_this$appConfig$curre2","openUrl","appLogin","options","payload","formData","value","name","encodeURIComponent","defaults","withCredentials","post","baseURL","response","xsrfCookieValue","setItem","isLoggedIn","load","userData","getLoggedInUserDetails","useDefaultSuccessHandler","app","triggerStartUpVariables","_document","document","cookie","split","filter","item","length","wm_xsrf_token","isConnected","getServiceDefinitions","defaultSecurityConfig","details","securityConfig","isSecurityEnabled","securityEnabled","authenticated","_appConfig$appPropert","isAuthenticated","roles","userInfo","userRoles","userName","id","userId","tenantId","userAttributes","dataSet","appProperties","homePage","redirectToLogin","redirectTo","_this$securityConfig","loginConfig","type","authUrl","OS","window","parent","location","href","execute","output","formateData","reject","refresh","_this$securityConfig$","_this$appConfig$curre3","loginPage","pageName","appLogout","catch","canUserAccessPage","_this$securityConfig2","res","status","matchRoles","widgetRoles","some","hasAccessToWidget","_this$loggedInUser$da","_this$loggedInUser$da2","_this$loggedInUser$da3","_this$loggedInUser$da4","widgetRolesArr","EVERYONE","ANONYMOUS","AUTHENTICATED","appSecurityService"],"sources":["app-security.service.tsx"],"sourcesContent":["import { Platform } from 'react-native';\nimport axios, { InternalAxiosRequestConfig, AxiosResponse } from 'axios';\nimport { each, includes } from 'lodash';\n\nimport networkService from '@wavemaker/app-rn-runtime/core/network.service';\nimport injector from '@wavemaker/app-rn-runtime/core/injector';\nimport AppConfig from '@wavemaker/app-rn-runtime/core/AppConfig';\nimport StorageService from '@wavemaker/app-rn-runtime/core/storage.service';\nimport { SecurityService } from '@wavemaker/app-rn-runtime/core/security.service';\n\nimport WebProcessService from './webprocess.service';\nimport { isWebPreviewMode } from '@wavemaker/app-rn-runtime/core/utils';\n\ndeclare const window: any;\n\ninterface LoggedInUserConfig {\n isAuthenticated: Boolean;\n isSecurityEnabled: Boolean;\n roles: Array<string>;\n name: String;\n id: String;\n tenantId: String;\n userAttributes: any;\n landingPage: string;\n}\n\nenum USER_ROLE {\n EVERYONE = 'Everyone',\n ANONYMOUS = 'Anonymous',\n AUTHENTICATED = 'Authenticated'\n}\n\nconst authCookieStr = 'AUTH_COOKIE';\nconst XSRF_COOKIE_NAME = 'wm_xsrf_token';\nconst xsrf_header_name = 'X-WM-XSRF-TOKEN';\n\nclass AppSecurityService implements SecurityService {\n\n securityConfig: any;\n isLoggedIn = false;\n loggedInUser: any = {};\n token: any;\n appConfig: any;\n baseUrl: string = '';\n defaultSecurityConfig: any;\n landingPage = '';\n\n constructor() {\n axios.interceptors.request.use((config: InternalAxiosRequestConfig) => this.onBeforeServiceCall(config));\n }\n\n getRegex = (str: string) =>{\n const wm_xsrf_token_index = str.indexOf('wm_xsrf_token') + 13; // 13 is the length of 'wm_xsrf_token' string\n let index = wm_xsrf_token_index;\n\n while(str[index] !== ':'){\n index++;\n }\n \n const regExp = str.substring(wm_xsrf_token_index, index);\n return new RegExp(regExp, \"g\");\n }\n \n formateData = (data: string) => {\n const regex = this.getRegex(data)\n return JSON.parse(data.replace(regex, \"\\\"\"));\n }\n\n onBeforeServiceCall(config: InternalAxiosRequestConfig) {\n if (!this.appConfig) {\n this.appConfig = this.getAppConfig();\n this.baseUrl = this.appConfig.url;\n }\n return this.getXsrfToken().then((token: string) => {\n if (config.url?.startsWith(this.baseUrl) && token) {\n if(config.headers) config.headers[xsrf_header_name] = token;\n }\n return config\n });\n }\n\n private getXsrfToken(): Promise<string> {\n if (this.token) {\n return Promise.resolve(this.token);\n }\n return StorageService.getItem(XSRF_COOKIE_NAME).then(xsrf_token => {\n this.token = xsrf_token;\n return this.token;\n });\n }\n\n private getAppConfig() {\n return injector.get<AppConfig>('APP_CONFIG');\n }\n\n public navigateToLandingPage() {\n this.appConfig.currentPage?.goToPage(\n this.appConfig.loggedInUser?.landingPage \n || this.appConfig.landingPage \n || 'Main', null, true);\n if (this.landingPage) {\n const landingPage = this.landingPage;\n this.landingPage = '';\n setTimeout(() => {\n this.appConfig.currentPage?.openUrl(landingPage);\n }, 100);\n }\n }\n\n public appLogin(options: any) {\n // encode all parameters\n let payload = '';\n each(options.formData, function (value, name) {\n payload += (payload ? '&' : '') + encodeURIComponent(name) + '=' + encodeURIComponent(value);\n });\n axios.defaults.withCredentials = true;\n return axios.post(options.baseURL + '/j_spring_security_check', payload, {\n withCredentials: true,\n headers: {\n 'Content-Type': 'application/x-www-form-urlencoded'\n }}).then((response: AxiosResponse) => {\n const xsrfCookieValue = response.data ? response.data[XSRF_COOKIE_NAME] : '';\n this.token = xsrfCookieValue;\n StorageService.setItem(XSRF_COOKIE_NAME, xsrfCookieValue);\n this.isLoggedIn = true;\n }).then(() => this.load(options.baseURL))\n .then(async () => {\n const userData = await this.getLoggedInUserDetails(options.baseURL, options.useDefaultSuccessHandler);\n await this.appConfig.app.triggerStartUpVariables();\n return userData;\n });\n }\n\n public load(baseURL: string) {\n if (isWebPreviewMode()) {\n const token = document?.cookie?.split(';').filter(item => item.includes('wm_xsrf_token'))\n if (token && token.length > 0) {\n const wm_xsrf_token = token[0].split('=')[1];\n wm_xsrf_token && StorageService.setItem(XSRF_COOKIE_NAME, wm_xsrf_token);\n }\n }\n\n return Promise.resolve().then(() => {\n if (networkService.isConnected()) {\n return axios.get(baseURL + '/services/security/info')\n .then((response: AxiosResponse) => response.data);\n }\n return this.appConfig.getServiceDefinitions(this.appConfig.url)\n .then(() => Promise.resolve(this.defaultSecurityConfig));\n }).then((details: any) => {\n const loggedInUser = {} as LoggedInUserConfig;\n this.securityConfig = details || {};\n this.securityConfig.isSecurityEnabled = !!details?.securityEnabled;\n const appConfig = this.appConfig;\n if (typeof details !== 'string' && (!details.securityEnabled || details.authenticated)) {\n if (details.authenticated) {\n loggedInUser.isAuthenticated = details.authenticated;\n loggedInUser.isSecurityEnabled = details.authenticated;\n loggedInUser.roles = details.userInfo.userRoles;\n loggedInUser.name = details.userInfo.userName;\n loggedInUser.id = details.userInfo.userId;\n loggedInUser.tenantId = details.userInfo.tenantId;\n loggedInUser.userAttributes = details.userInfo.userAttributes;\n loggedInUser.landingPage = details.userInfo.landingPage;\n appConfig.loggedInUser = loggedInUser;\n this.loggedInUser.dataSet = loggedInUser;\n appConfig.landingPage = appConfig.appProperties?.homePage;\n }\n return appConfig.getServiceDefinitions(appConfig.url)\n .then(() => {\n return details;\n });\n } else {\n return appConfig.getServiceDefinitions(appConfig.url)\n .then(() => {\n this.redirectToLogin();\n });\n }\n });\n }\n\n private getLoggedInUserDetails(baseURL: string, useDefaultSuccessHandler: boolean = true) {\n if (!baseURL) {\n this.loggedInUser = {};\n return Promise.resolve({});\n }\n return this.load(baseURL);\n }\n\n \n public redirectToLogin(redirectTo?: string) {\n if (this.securityConfig?.loginConfig?.type === 'SSO') {\n const authUrl = this.appConfig.url + '/services/security/ssologin';\n if (Platform.OS === 'web') {\n (window.parent || window).location.href = authUrl;\n } else {\n setTimeout(() => {\n WebProcessService.execute('LOGIN', '/services/security/ssologin', false, true)\n .then((output: any) => {\n if (output) {\n if(output.data){\n return this.formateData(`${output.data}`);\n }\n }\n return Promise.reject();\n }).then((output: any) => {\n if (output[XSRF_COOKIE_NAME]) {\n this.token = output[XSRF_COOKIE_NAME];\n StorageService.setItem(XSRF_COOKIE_NAME, output[XSRF_COOKIE_NAME]);\n }\n }).then(() => {\n this.appConfig.refresh(true);\n }).then(() => this.load(this.baseUrl)).then(() => {\n return this.getLoggedInUserDetails(this.baseUrl);\n });\n }, 1000);\n }\n } else {\n const loginPage = this.securityConfig.loginConfig?.pageName || 'Login';\n if (redirectTo && !redirectTo.startsWith('#/'+ loginPage)) {\n this.landingPage = redirectTo;\n }\n injector.get<AppConfig>('APP_CONFIG').landingPage = loginPage;\n this.appConfig.currentPage?.goToPage(loginPage, null, true);\n }\n this.appConfig.refresh();\n }\n\n public appLogout(options: any) {\n return axios.post(options.baseURL + '/j_spring_security_logout', null, {\n withCredentials: true\n }).catch(() => {}).then(() => {\n this.isLoggedIn = false;\n this.redirectToLogin();\n });\n }\n\n public canUserAccessPage(pageName: string) {\n if (this.baseUrl && this.securityConfig?.isSecurityEnabled) {\n return axios.get(this.baseUrl + `/pages/${pageName}/${pageName}.html`)\n .catch((res) => res)\n .then((res) => res.status === 200 || res.status === 304); \n } else {\n return Promise.resolve(true);\n }\n }\n\n private matchRoles(widgetRoles: Array<String>, userRoles: Array<String>) {\n return widgetRoles.some(function (item) {\n return includes(userRoles, item);\n });\n }\n\n public hasAccessToWidget(widgetRoles: String) {\n const widgetRolesArr = widgetRoles.split(',');\n // access the widget when 'Everyone' is chosen\n if (includes(widgetRolesArr, USER_ROLE.EVERYONE)) {\n return true;\n }\n\n // access the widget when 'Anonymous' is chosen and user is not authenticated\n if (includes(widgetRolesArr, USER_ROLE.ANONYMOUS) && !this.loggedInUser.dataSet?.isAuthenticated) {\n return true;\n }\n\n // access the widget when 'Only Authenticated Users' is chosen and user is authenticated\n if (includes(widgetRolesArr, USER_ROLE.AUTHENTICATED) && this.loggedInUser.dataSet?.isAuthenticated) {\n return true;\n }\n\n // access the widget when widget role and logged in user role matches\n return this.loggedInUser.dataSet?.isAuthenticated && this.matchRoles(widgetRolesArr, this.loggedInUser.dataSet?.roles);\n }\n}\n\nconst appSecurityService = new AppSecurityService();\n\nexport default appSecurityService;\n"],"mappings":";;;AAAA,SAASA,QAAQ,QAAQ,cAAc;AACvC,OAAOC,KAAK,MAAqD,OAAO;AACxE,SAASC,IAAI,EAAEC,QAAQ,QAAQ,QAAQ;AAEvC,OAAOC,cAAc,MAAM,gDAAgD;AAC3E,OAAOC,QAAQ,MAAM,yCAAyC;AAE9D,OAAOC,cAAc,MAAM,gDAAgD;AAG3E,OAAOC,iBAAiB,MAAM,sBAAsB;AACpD,SAASC,gBAAgB,QAAQ,sCAAsC;AAAC,IAenEC,SAAS,0BAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAAA,OAATA,SAAS;AAAA,EAATA,SAAS;AAMd,MAAMC,aAAa,GAAG,aAAa;AACnC,MAAMC,gBAAgB,GAAG,eAAe;AACxC,MAAMC,gBAAgB,GAAG,iBAAiB;AAE1C,MAAMC,kBAAkB,CAA4B;EAWhDC,WAAWA,CAAA,EAAG;IAAAC,eAAA;IAAAA,eAAA,qBARD,KAAK;IAAAA,eAAA,uBACE,CAAC,CAAC;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA,kBAGJ,EAAE;IAAAA,eAAA;IAAAA,eAAA,sBAEN,EAAE;IAAAA,eAAA,mBAMJC,GAAW,IAAI;MACzB,MAAMC,mBAAmB,GAAGD,GAAG,CAACE,OAAO,CAAC,eAAe,CAAC,GAAG,EAAE,CAAC,CAAE;MAChE,IAAIC,KAAK,GAAGF,mBAAmB;MAE/B,OAAMD,GAAG,CAACG,KAAK,CAAC,KAAK,GAAG,EAAC;QACvBA,KAAK,EAAE;MACT;MAEA,MAAMC,MAAM,GAAGJ,GAAG,CAACK,SAAS,CAACJ,mBAAmB,EAAEE,KAAK,CAAC;MACxD,OAAO,IAAIG,M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