@wavemaker/app-rn-runtime 12.0.0-next.45032 → 12.0.0-next.45503
Sign up to get free protection for your applications and to get access to all the features.
- app-rn-runtime/components/advanced/carousel/carousel.component.js +18 -3
- app-rn-runtime/components/advanced/carousel/carousel.component.js.map +1 -1
- app-rn-runtime/components/advanced/webview/webview.component.js.map +1 -1
- app-rn-runtime/components/basic/anchor/anchor.component.js +2 -2
- app-rn-runtime/components/basic/anchor/anchor.component.js.map +1 -1
- app-rn-runtime/components/basic/animatedview.component.js +6 -2
- app-rn-runtime/components/basic/animatedview.component.js.map +1 -1
- app-rn-runtime/components/basic/audio/audio.component.js.map +1 -1
- app-rn-runtime/components/basic/button/button.component.js +5 -4
- app-rn-runtime/components/basic/button/button.component.js.map +1 -1
- app-rn-runtime/components/basic/icon/icon.component.js +4 -4
- app-rn-runtime/components/basic/icon/icon.component.js.map +1 -1
- app-rn-runtime/components/basic/label/label.component.js.map +1 -1
- app-rn-runtime/components/basic/label/label.styles.js.map +1 -1
- app-rn-runtime/components/basic/message/message.component.js.map +1 -1
- app-rn-runtime/components/basic/picture/picture.component.js +1 -2
- app-rn-runtime/components/basic/picture/picture.component.js.map +1 -1
- app-rn-runtime/components/basic/progress-bar/progress-bar.component.js +2 -2
- app-rn-runtime/components/basic/progress-bar/progress-bar.component.js.map +1 -1
- app-rn-runtime/components/basic/progress-circle/progress-circle.component.js +5 -5
- app-rn-runtime/components/basic/progress-circle/progress-circle.component.js.map +1 -1
- app-rn-runtime/components/basic/search/search.component.js.map +1 -1
- app-rn-runtime/components/basic/spinner/spinner.component.js +2 -3
- app-rn-runtime/components/basic/spinner/spinner.component.js.map +1 -1
- app-rn-runtime/components/basic/spinner/spinner.styles.js +3 -2
- app-rn-runtime/components/basic/spinner/spinner.styles.js.map +1 -1
- app-rn-runtime/components/basic/video/video.component.js.map +1 -1
- app-rn-runtime/components/basic/video/video.styles.js +4 -1
- app-rn-runtime/components/basic/video/video.styles.js.map +1 -1
- app-rn-runtime/components/chart/area-chart/area-chart.component.js.map +1 -1
- app-rn-runtime/components/chart/basechart.component.js +31 -2
- app-rn-runtime/components/chart/basechart.component.js.map +1 -1
- app-rn-runtime/components/chart/basechart.props.js +1 -0
- app-rn-runtime/components/chart/basechart.props.js.map +1 -1
- app-rn-runtime/components/chart/basechart.styles.js +4 -0
- app-rn-runtime/components/chart/basechart.styles.js.map +1 -1
- app-rn-runtime/components/chart/bubble-chart/bubble-chart.component.js +15 -3
- app-rn-runtime/components/chart/bubble-chart/bubble-chart.component.js.map +1 -1
- app-rn-runtime/components/chart/pie-chart/pie-chart.component.js +4 -1
- app-rn-runtime/components/chart/pie-chart/pie-chart.component.js.map +1 -1
- app-rn-runtime/components/chart/stack-chart/stack-chart.component.js +37 -11
- app-rn-runtime/components/chart/stack-chart/stack-chart.component.js.map +1 -1
- app-rn-runtime/components/container/accordion/accordion.component.js +3 -1
- app-rn-runtime/components/container/accordion/accordion.component.js.map +1 -1
- app-rn-runtime/components/container/accordion/accordion.styles.js +1 -0
- app-rn-runtime/components/container/accordion/accordion.styles.js.map +1 -1
- app-rn-runtime/components/container/layoutgrid/gridcolumn/gridcolumn.component.js.map +1 -1
- app-rn-runtime/components/container/panel/panel.component.js +4 -2
- app-rn-runtime/components/container/panel/panel.component.js.map +1 -1
- app-rn-runtime/components/container/tabs/tabheader/tabheader.component.js +2 -3
- app-rn-runtime/components/container/tabs/tabheader/tabheader.component.js.map +1 -1
- app-rn-runtime/components/container/tabs/tabs.component.js.map +1 -1
- app-rn-runtime/components/container/wizard/wizard.component.js +27 -11
- app-rn-runtime/components/container/wizard/wizard.component.js.map +1 -1
- app-rn-runtime/components/data/form/form-field/form-field.component.js.map +1 -1
- app-rn-runtime/components/data/list/list.component.js.map +1 -1
- app-rn-runtime/components/dialogs/dialog/dialog.component.js +5 -3
- app-rn-runtime/components/dialogs/dialog/dialog.component.js.map +1 -1
- app-rn-runtime/components/input/basedataset/basedataset.component.js.map +1 -1
- app-rn-runtime/components/input/baseinput/baseinput.component.js +11 -4
- app-rn-runtime/components/input/baseinput/baseinput.component.js.map +1 -1
- app-rn-runtime/components/input/baseinput/baseinput.props.js +1 -0
- app-rn-runtime/components/input/baseinput/baseinput.props.js.map +1 -1
- app-rn-runtime/components/input/basenumber/basenumber.component.js +25 -12
- app-rn-runtime/components/input/basenumber/basenumber.component.js.map +1 -1
- app-rn-runtime/components/input/basenumber/basenumber.props.js +2 -0
- app-rn-runtime/components/input/basenumber/basenumber.props.js.map +1 -1
- app-rn-runtime/components/input/checkbox/checkbox.component.js +5 -6
- app-rn-runtime/components/input/checkbox/checkbox.component.js.map +1 -1
- app-rn-runtime/components/input/checkboxset/checkboxset.component.js +3 -2
- app-rn-runtime/components/input/checkboxset/checkboxset.component.js.map +1 -1
- app-rn-runtime/components/input/chips/chips.component.js +3 -2
- app-rn-runtime/components/input/chips/chips.component.js.map +1 -1
- app-rn-runtime/components/input/currency/currency.component.js +16 -1
- app-rn-runtime/components/input/currency/currency.component.js.map +1 -1
- app-rn-runtime/components/input/epoch/base-datetime.component.js +22 -5
- app-rn-runtime/components/input/epoch/base-datetime.component.js.map +1 -1
- app-rn-runtime/components/input/epoch/wheel-date-picker.component.js +123 -12
- app-rn-runtime/components/input/epoch/wheel-date-picker.component.js.map +1 -1
- app-rn-runtime/components/input/epoch/wheelpicker/wheelpicker.component.js.map +1 -1
- app-rn-runtime/components/input/epoch/wheelpickermodal/date/date-picker-modal.component.js +4 -0
- app-rn-runtime/components/input/epoch/wheelpickermodal/date/date-picker-modal.component.js.map +1 -1
- app-rn-runtime/components/input/epoch/wheelpickermodal/date/date-picker-modal.props.js +2 -0
- app-rn-runtime/components/input/epoch/wheelpickermodal/date/date-picker-modal.props.js.map +1 -1
- app-rn-runtime/components/input/number/number.component.js +6 -3
- app-rn-runtime/components/input/number/number.component.js.map +1 -1
- app-rn-runtime/components/input/radioset/radioset.component.js +6 -6
- app-rn-runtime/components/input/radioset/radioset.component.js.map +1 -1
- app-rn-runtime/components/input/select/select.component.js +23 -9
- app-rn-runtime/components/input/select/select.component.js.map +1 -1
- app-rn-runtime/components/input/switch/switch.component.js +2 -2
- app-rn-runtime/components/input/switch/switch.component.js.map +1 -1
- app-rn-runtime/components/input/toggle/toggle.component.js +2 -4
- app-rn-runtime/components/input/toggle/toggle.component.js.map +1 -1
- app-rn-runtime/components/navigation/appnavbar/appnavbar.component.js +2 -2
- app-rn-runtime/components/navigation/appnavbar/appnavbar.component.js.map +1 -1
- app-rn-runtime/components/navigation/basenav/basenav.component.js.map +1 -1
- app-rn-runtime/components/navigation/navitem/navitem.component.js +2 -3
- app-rn-runtime/components/navigation/navitem/navitem.component.js.map +1 -1
- app-rn-runtime/components/navigation/popover/popover.component.js.map +1 -1
- app-rn-runtime/components/page/tabbar/curve.js.map +1 -1
- app-rn-runtime/components/page/tabbar/tabbar.component.js.map +1 -1
- app-rn-runtime/core/base.component.js +2 -1
- app-rn-runtime/core/base.component.js.map +1 -1
- app-rn-runtime/core/components/textinput.component.js +4 -3
- app-rn-runtime/core/components/textinput.component.js.map +1 -1
- app-rn-runtime/core/formatters.js.map +1 -1
- app-rn-runtime/core/key.extractor.js.map +1 -1
- app-rn-runtime/core/props.provider.js +3 -0
- app-rn-runtime/core/props.provider.js.map +1 -1
- app-rn-runtime/core/storage.service.js.map +1 -1
- app-rn-runtime/core/tappable.component.js +26 -25
- app-rn-runtime/core/tappable.component.js.map +1 -1
- app-rn-runtime/core/ui-preferences.context.js +7 -0
- app-rn-runtime/core/ui-preferences.context.js.map +1 -0
- app-rn-runtime/core/utils.js +66 -4
- app-rn-runtime/core/utils.js.map +1 -1
- app-rn-runtime/package.json +28 -7
- app-rn-runtime/runtime/App.js +2 -1
- app-rn-runtime/runtime/App.js.map +1 -1
- app-rn-runtime/runtime/App.navigator.js.map +1 -1
- app-rn-runtime/runtime/base-fragment.component.js +15 -0
- app-rn-runtime/runtime/base-fragment.component.js.map +1 -1
- app-rn-runtime/runtime/base-page.component.js.map +1 -1
- app-rn-runtime/runtime/base-prefab.component.js.map +1 -1
- app-rn-runtime/runtime/navigator/stack.navigator.js.map +1 -1
- app-rn-runtime/runtime/services/app-i18n.service.js +10 -0
- app-rn-runtime/runtime/services/app-i18n.service.js.map +1 -1
- app-rn-runtime/runtime/services/app-security.service.js.map +1 -1
- app-rn-runtime/runtime/services/app-spinner.service.js +1 -1
- app-rn-runtime/runtime/services/app-spinner.service.js.map +1 -1
- app-rn-runtime/runtime/services/webprocess.service.js.map +1 -1
- app-rn-runtime/runtime/watcher.js.map +1 -1
- app-rn-runtime/styles/background.component.js +1 -0
- app-rn-runtime/styles/background.component.js.map +1 -1
- app-rn-runtime/styles/style-prop.validator.js.map +1 -1
- app-rn-runtime/styles/theme.js.map +1 -1
- app-rn-runtime/variables/base-variable.js.map +1 -1
- app-rn-runtime/variables/device/file/upload-file.operation.js.map +1 -1
- app-rn-runtime/variables/device-variable.js.map +1 -1
- app-rn-runtime/variables/service-variable.js.map +1 -1
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["React","Animated","Easing","Text","Image","View","FontAwesome","BaseComponent","BaseComponentState","isFullPathUrl","AccessibilityWidgetType","getAccessibilityProps","WmIconProps","DEFAULT_CLASS","WavIcon","StreamlineLightIcon","StreamlineRegularIcon","Tappable","Animatedview","createSkeleton","ICON_SIZES","Map","ICON_ROTATTION","WmIconState","constructor","args","_defineProperty","WmIcon","props","Value","getIconDef","iconClass","iconDef","rotate","splits","split","isFontAwesome","find","v","isStreamlineLightIcon","isStreamlineRegularIcon","_splits$find","type","startsWith","substring","_splits$find2","_splits$find3","_splits$find4","isWavIcon","indexOf","animation","size","map","get","spin","stopAnimation","spinValue","setValue","timing","toValue","duration","easing","linear","useNativeDriver","start","componentDidMount","componentWillUnmount","onPropertyChange","name","$new","$old","updateState","getCustomIcon","style","_this$theme$getStyle","customIcon","theme","mergeStyle","getStyle","iconclass","icon","styles","customIconContent","content","createElement","fontFamily","decodeURIComponent","renderSkeleton","skeleton","root","width","skeletonwidth","iconsize","height","skeletonheight","getElementToShow","iconSrc","iconmargin","iconheight","iconwidth","elementToshow","source","uri","testID","getTestId","margin","loadIcon","iconImage","loadAsset","iconImageSrc","renderIcon","iconJsx","_iconSource","iconurl","state","text","color","transform","iconSize","fontSize","show","_this$styles$icon","WMCustomIcon","interpolate","inputRange","outputRange","opacity","renderWidget","iterationCount","iterationcount","parseInt","undefined","_extends","target","rippleColor","getTestPropsForAction","accessibilityProps","ICON","entryanimation","delay","animationdelay","_background","iconposition","caption","getTestPropsForLabel","accessibilityRole","accessibilityrole"],"sources":["icon.component.tsx"],"sourcesContent":["import React from 'react';\nimport { Animated, DimensionValue, Easing, Text, Image, View } from 'react-native';\nimport { FontAwesome } from '@expo/vector-icons';\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\nimport { isFullPathUrl } from '@wavemaker/app-rn-runtime/core/utils';\nimport { AccessibilityWidgetType, getAccessibilityProps } from '@wavemaker/app-rn-runtime/core/accessibility';\n\nimport WmIconProps from './icon.props';\nimport { DEFAULT_CLASS, WmIconStyles } from './icon.styles';\nimport WavIcon from './wavicon/wavicon.component';\nimport StreamlineLightIcon from './streamline-light-icon/streamline-light-icon.component';\nimport StreamlineRegularIcon from './streamline-regular-icon/streamline-regular-icon.component';\nimport { Tappable } from '@wavemaker/app-rn-runtime/core/tappable.component';\nimport { Animatedview } from '@wavemaker/app-rn-runtime/components/basic/animatedview.component';\nimport WmSkeleton, { createSkeleton } from '../skeleton/skeleton.component';\n\ninterface IconDef {\n isFontAwesome: boolean;\n isWavIcon: boolean;\n isStreamlineLightIcon: boolean;\n isStreamlineRegularIcon: boolean;\n type: string;\n rotate: string;\n size: number;\n animation: string;\n}\n\nconst ICON_SIZES = new Map([\n ['fa-lg', 24],\n ['fa-2x', 36],\n ['fa-3x', 48],\n ['fa-4x', 60],\n ['fa-5x', 72]\n]);\n\nconst ICON_ROTATTION = new Map([\n ['fa-rotate-90', '90deg'],\n ['fa-rotate-180', '180deg'],\n ['fa-rotate-270', '270deg']\n]);\n\nexport class WmIconState extends BaseComponentState<WmIconProps> {\n public iconDef = {} as IconDef;\n}\n\nexport default class WmIcon extends BaseComponent<WmIconProps, WmIconState, WmIconStyles> {\n spinValue = new Animated.Value(0);\n pulseValue = new Animated.Value(0);\n public stopAnimation = true;\n private _iconSource = null as any;\n\n constructor(props: WmIconProps) {\n super(props, DEFAULT_CLASS, new WmIconProps());\n }\n\n getIconDef(iconClass: string): IconDef {\n const iconDef = {\n rotate: '0'\n } as IconDef;\n const splits = iconClass.split(' ');\n iconDef.isFontAwesome = !!splits.find(v => v === 'fa');\n iconDef.isStreamlineLightIcon = !!splits.find(v => v === 'wm-sl-l');\n iconDef.isStreamlineRegularIcon = !!splits.find(v => v === 'wm-sl-r');\n if (iconDef.isFontAwesome) {\n iconDef.type = splits.find(v => v.startsWith('fa-'))?.substring(3) || '';\n } else if (iconDef.isStreamlineLightIcon) {\n iconDef.type = splits.find(v => v.startsWith('sl-'))?.substring(3) || '';\n } else if (iconDef.isStreamlineRegularIcon) {\n iconDef.type = splits.find(v => v.startsWith('sl-'))?.substring(3) || '';\n } else {\n iconDef.isWavIcon = !iconDef.isFontAwesome && !!splits.find(v => v === 'wi');\n iconDef.type = (iconDef.isWavIcon && splits.find(v => v.startsWith('wi-'))?.substring(3)) || '';\n }\n if (iconClass.indexOf('fa-spin') >= 0) {\n iconDef.animation = 'spin';\n } else if (iconClass.indexOf('fa-pulse') >= 0) {\n iconDef.animation = 'pulse';\n }\n iconDef.size = splits.map(v => ICON_SIZES.get(v)).find(v => !!v) || 12;\n iconDef.rotate = splits.map(v => ICON_ROTATTION.get(v)).find(v => !!v) || '0deg';\n return iconDef;\n }\n\n private spin () {\n if (this.stopAnimation) {\n return;\n }\n this.spinValue.setValue(0);\n Animated.timing(\n this.spinValue,\n {\n toValue: 1,\n duration: 1000,\n easing: Easing.linear,\n useNativeDriver: true\n }\n ).start(() => this.spin());\n }\n\n componentDidMount() {\n super.componentDidMount();\n this.spin();\n }\n\n componentWillUnmount(): void {\n super.componentWillUnmount();\n this.stopAnimation = true;\n }\n\n onPropertyChange(name: string, $new: any, $old: any) {\n super.onPropertyChange(name, $new, $old);\n switch(name) {\n case 'iconclass':\n $new && this.updateState({iconDef: this.getIconDef($new)} as WmIconState);\n break;\n }\n }\n\n private getCustomIcon(props: WmIconProps, style: any) {\n const customIcon = this.theme.mergeStyle({}, this.theme.getStyle(props?.iconclass || '')?.icon || this.styles.icon);\n const customIconContent = customIcon?.content;\n if (customIconContent) {\n delete customIcon.content;\n return (<Text\n style={[style, customIcon.fontFamily ? {fontFamily: customIcon.fontFamily}: null]}>\n {decodeURIComponent(customIconContent)}\n </Text>);\n }\n return null;\n }\n\n public renderSkeleton(props: WmIconProps) {\n return createSkeleton(this.theme, this.styles.skeleton, {\n ...this.styles.root,\n width: (this.props.skeletonwidth || this.props.iconsize || this.styles.root.width) as DimensionValue,\n height: (this.props.skeletonheight || this.props.iconsize || this.styles.root.height) as DimensionValue\n });\n }\n\n getElementToShow(props: WmIconProps, iconSrc: any) {\n\n const { iconmargin, iconheight, iconwidth } = props;\n let width, height;\n let elementToshow, source;\n\n if (iconwidth) width = iconwidth;\n else if (iconheight) width = iconheight;\n else width = 12;\n if (iconheight) height = iconheight;\n else if (iconwidth) height = iconwidth;\n else height = 12;\n\n if (isFullPathUrl(iconSrc)) {\n source = {\n uri: iconSrc\n };\n } else {\n source = iconSrc;\n }\n elementToshow = <Image testID={this.getTestId('icon')}\n style={{\n margin: iconmargin ?? 0,\n height: height,\n width: width\n }}\n source={source}/>;\n return elementToshow;\n }\n\n loadIcon(iconImage: string | undefined) {\n if (!iconImage || !this.loadAsset) {\n return null;\n }\n const iconImageSrc = this.loadAsset(iconImage);\n if (iconImageSrc && typeof iconImageSrc !== 'function') {\n return iconImageSrc;\n }\n return null;\n }\n\n renderIcon(props: WmIconProps) {\n let iconJsx = null;\n this._iconSource = this._iconSource || this.loadIcon(props.iconurl);\n const iconSrc: any = this._iconSource\n if (iconSrc) {\n return this.getElementToShow(props, iconSrc);\n }\n const iconDef = this.state.iconDef;\n if (!iconDef) {\n return null;\n }\n const { root, text, icon } = this.styles;\n const style = [{ color: root.color || text.color },\n icon,\n { transform: [{ rotate: iconDef.rotate }] }];\n\n const customIcon = this.getCustomIcon(props, style);\n const iconSize = props.iconsize || this.styles.root.fontSize || this.styles.text.fontSize || iconDef.size;\n if (props.show && iconDef && iconDef.isFontAwesome) {\n //@ts-ignore type information is not matching\n iconJsx = (<FontAwesome name={customIcon ? '' : iconDef.type}\n style={style}\n size={iconSize}>\n {customIcon}\n </FontAwesome>);\n } else if (props.show && iconDef) {\n let WMCustomIcon = WavIcon as unknown;\n if (iconDef.isStreamlineLightIcon) {\n WMCustomIcon = StreamlineLightIcon;\n } else if (iconDef.isStreamlineRegularIcon) {\n WMCustomIcon = StreamlineRegularIcon;\n } else if (!iconDef.isWavIcon && !customIcon && !this.styles.icon?.fontFamily) {\n return null;\n }\n //@ts-ignore type information is not matching\n iconJsx = WMCustomIcon ? (<WMCustomIcon name={customIcon ? '' : iconDef.type}\n style={style}\n size={iconSize}>\n {customIcon}\n </WMCustomIcon>) : null;\n }\n if (iconJsx && iconDef.animation === 'spin') {\n const rotate = this.spinValue.interpolate({ inputRange: [0, 1], outputRange: ['0deg', '360deg']});\n const animation = { transform: [{ rotate }] };\n this.stopAnimation = false;\n return (<Animated.View style={animation}>{iconJsx}</Animated.View>);\n } else if (iconJsx && iconDef.animation === 'pulse') {\n const opacity = this.spinValue.interpolate({ inputRange: [0, 1], outputRange: [0, 1]});\n const animation = { opacity: opacity };\n this.stopAnimation = false;\n return (<Animated.View style={animation}>{iconJsx}</Animated.View>);\n } else {\n this.stopAnimation = true;\n }\n return (\n <View\n // {...getAccessibilityProps(AccessibilityWidgetType.ICON, this.props)}\n >\n {iconJsx}\n </View>\n );\n }\n\n renderWidget(props: WmIconProps) {\n let icon = this.renderIcon(props);\n let iterationCount: any = props.iterationcount ? (props.iterationcount != 'infinite' ? parseInt(props.iterationcount): 'infinite') : undefined;\n return (\n <Tappable target={this} rippleColor = {this.styles.root.rippleColor} {...this.getTestPropsForAction()} accessibilityProps={{...getAccessibilityProps(AccessibilityWidgetType.ICON, props)}}>\n <Animatedview entryanimation={props.animation} delay={props.animationdelay} style={this.styles.root} iterationCount={iterationCount}>\n {this._background}\n {(props.iconposition === 'left' && icon) || null}\n {(props.caption && (<Text {...this.getTestPropsForLabel('caption')}style={this.styles.text} accessibilityRole={props?.accessibilityrole ? props?.accessibilityrole : 'text'}>{props.caption}</Text>)) || null}\n {(props.iconposition === 'right' && icon) || null}\n </Animatedview>\n </Tappable>\n );\n }\n}\n"],"mappings":";;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,QAAQ,EAAkBC,MAAM,EAAEC,IAAI,EAAEC,KAAK,EAAEC,IAAI,QAAQ,cAAc;AAClF,SAASC,WAAW,QAAQ,oBAAoB;AAChD,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,+CAA+C;AACjG,SAASC,aAAa,QAAQ,sCAAsC;AACpE,SAASC,uBAAuB,EAAEC,qBAAqB,QAAQ,8CAA8C;AAE7G,OAAOC,WAAW,MAAM,cAAc;AACtC,SAASC,aAAa,QAAsB,eAAe;AAC3D,OAAOC,OAAO,MAAM,6BAA6B;AACjD,OAAOC,mBAAmB,MAAM,yDAAyD;AACzF,OAAOC,qBAAqB,MAAM,6DAA6D;AAC/F,SAASC,QAAQ,QAAQ,mDAAmD;AAC5E,SAASC,YAAY,QAAQ,mEAAmE;AAChG,SAAqBC,cAAc,QAAQ,gCAAgC;AAa3E,MAAMC,UAAU,GAAG,IAAIC,GAAG,CAAC,CACzB,CAAC,OAAO,EAAE,EAAE,CAAC,EACb,CAAC,OAAO,EAAE,EAAE,CAAC,EACb,CAAC,OAAO,EAAE,EAAE,CAAC,EACb,CAAC,OAAO,EAAE,EAAE,CAAC,EACb,CAAC,OAAO,EAAE,EAAE,CAAC,CACd,CAAC;AAEF,MAAMC,cAAc,GAAG,IAAID,G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,IAAI,EAAE7G,KAAK;MAAC;IAAE,iBACzL5B,KAAA,CAAAoF,aAAA,CAAClE,YAAY;MAACwH,cAAc,EAAE9G,KAAK,CAACsB,SAAU;MAACyF,KAAK,EAAE/G,KAAK,CAACgH,cAAe;MAACnE,KAAK,EAAE,IAAI,CAACQ,MAAM,CAACQ,IAAK;MAACuC,cAAc,EAAEA;IAAe,GACjI,IAAI,CAACa,WAAW,EACfjH,KAAK,CAACkH,YAAY,KAAK,MAAM,IAAI9D,IAAI,IAAK,IAAI,EAC9CpD,KAAK,CAACmH,OAAO,iBAAK/I,KAAA,CAAAoF,aAAA,CAACjF,IAAI,EAAAiI,QAAA,KAAK,IAAI,CAACY,oBAAoB,CAAC,SAAS,CAAC;MAACvE,KAAK,EAAE,IAAI,CAACQ,MAAM,CAACkC,IAAK;MAAC8B,iBAAiB,EAAErH,KAAK,aAALA,KAAK,eAALA,KAAK,CAAEsH,iBAAiB,GAAGtH,KAAK,aAALA,KAAK,uBAALA,KAAK,CAAEsH,iBAAiB,GAAG;IAAO,IAAEtH,KAAK,CAACmH,OAAc,CAAE,IAAK,IAAI,EAC3MnH,KAAK,CAACkH,YAAY,KAAK,OAAO,IAAI9D,IAAI,IAAK,IACjC,CACN,CAAC;EAEf;AACF","ignoreList":[]}
|
1
|
+
{"version":3,"names":["React","Animated","Easing","Text","Image","View","FontAwesome","BaseComponent","BaseComponentState","isFullPathUrl","AccessibilityWidgetType","getAccessibilityProps","WmIconProps","DEFAULT_CLASS","WavIcon","StreamlineLightIcon","StreamlineRegularIcon","Tappable","Animatedview","createSkeleton","ICON_SIZES","Map","ICON_ROTATTION","WmIconState","constructor","args","_defineProperty","WmIcon","props","Value","getIconDef","iconClass","iconDef","rotate","splits","split","isFontAwesome","find","v","isStreamlineLightIcon","isStreamlineRegularIcon","_splits$find","type","startsWith","substring","_splits$find2","_splits$find3","_splits$find4","isWavIcon","indexOf","animation","size","map","get","spin","stopAnimation","spinValue","setValue","timing","toValue","duration","easing","linear","useNativeDriver","start","componentDidMount","componentWillUnmount","onPropertyChange","name","$new","$old","updateState","getCustomIcon","style","_this$theme$getStyle","customIcon","theme","mergeStyle","getStyle","iconclass","icon","styles","customIconContent","content","createElement","fontFamily","decodeURIComponent","renderSkeleton","skeleton","root","width","skeletonwidth","iconsize","height","skeletonheight","getElementToShow","iconSrc","iconmargin","iconheight","iconwidth","elementToshow","source","uri","testID","getTestId","margin","loadIcon","iconImage","loadAsset","iconImageSrc","renderIcon","iconJsx","_iconSource","iconurl","state","text","color","transform","iconSize","fontSize","show","_extends","getTestProps","_this$styles$icon","WMCustomIcon","interpolate","inputRange","outputRange","opacity","renderWidget","iterationCount","iterationcount","parseInt","undefined","target","rippleColor","getTestPropsForAction","accessibilityProps","ICON","entryanimation","delay","animationdelay","_background","iconposition","caption","getTestPropsForLabel","accessibilityRole","accessibilityrole"],"sources":["icon.component.tsx"],"sourcesContent":["import React from 'react';\nimport { Animated, DimensionValue, Easing, Text, Image, View } from 'react-native';\nimport { FontAwesome } from '@expo/vector-icons';\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\nimport { isFullPathUrl } from '@wavemaker/app-rn-runtime/core/utils';\nimport { AccessibilityWidgetType, getAccessibilityProps } from '@wavemaker/app-rn-runtime/core/accessibility';\n\nimport WmIconProps from './icon.props';\nimport { DEFAULT_CLASS, WmIconStyles } from './icon.styles';\nimport WavIcon from './wavicon/wavicon.component';\nimport StreamlineLightIcon from './streamline-light-icon/streamline-light-icon.component';\nimport StreamlineRegularIcon from './streamline-regular-icon/streamline-regular-icon.component';\nimport { Tappable } from '@wavemaker/app-rn-runtime/core/tappable.component';\nimport { Animatedview } from '@wavemaker/app-rn-runtime/components/basic/animatedview.component';\nimport WmSkeleton, { createSkeleton } from '../skeleton/skeleton.component';\n\ninterface IconDef {\n isFontAwesome: boolean;\n isWavIcon: boolean;\n isStreamlineLightIcon: boolean;\n isStreamlineRegularIcon: boolean;\n type: string;\n rotate: string;\n size: number;\n animation: string;\n}\n\nconst ICON_SIZES = new Map([\n ['fa-lg', 24],\n ['fa-2x', 36],\n ['fa-3x', 48],\n ['fa-4x', 60],\n ['fa-5x', 72]\n]);\n\nconst ICON_ROTATTION = new Map([\n ['fa-rotate-90', '90deg'],\n ['fa-rotate-180', '180deg'],\n ['fa-rotate-270', '270deg']\n]);\n\nexport class WmIconState extends BaseComponentState<WmIconProps> {\n public iconDef = {} as IconDef;\n}\n\nexport default class WmIcon extends BaseComponent<WmIconProps, WmIconState, WmIconStyles> {\n spinValue = new Animated.Value(0);\n pulseValue = new Animated.Value(0);\n public stopAnimation = true;\n private _iconSource = null as any;\n\n constructor(props: WmIconProps) {\n super(props, DEFAULT_CLASS, new WmIconProps());\n }\n\n getIconDef(iconClass: string): IconDef {\n const iconDef = {\n rotate: '0'\n } as IconDef;\n const splits = iconClass.split(' ');\n iconDef.isFontAwesome = !!splits.find(v => v === 'fa');\n iconDef.isStreamlineLightIcon = !!splits.find(v => v === 'wm-sl-l');\n iconDef.isStreamlineRegularIcon = !!splits.find(v => v === 'wm-sl-r');\n if (iconDef.isFontAwesome) {\n iconDef.type = splits.find(v => v.startsWith('fa-'))?.substring(3) || '';\n } else if (iconDef.isStreamlineLightIcon) {\n iconDef.type = splits.find(v => v.startsWith('sl-'))?.substring(3) || '';\n } else if (iconDef.isStreamlineRegularIcon) {\n iconDef.type = splits.find(v => v.startsWith('sl-'))?.substring(3) || '';\n } else {\n iconDef.isWavIcon = !iconDef.isFontAwesome && !!splits.find(v => v === 'wi');\n iconDef.type = (iconDef.isWavIcon && splits.find(v => v.startsWith('wi-'))?.substring(3)) || '';\n }\n if (iconClass.indexOf('fa-spin') >= 0) {\n iconDef.animation = 'spin';\n } else if (iconClass.indexOf('fa-pulse') >= 0) {\n iconDef.animation = 'pulse';\n }\n iconDef.size = splits.map(v => ICON_SIZES.get(v)).find(v => !!v) || 12;\n iconDef.rotate = splits.map(v => ICON_ROTATTION.get(v)).find(v => !!v) || '0deg';\n return iconDef;\n }\n\n private spin () {\n if (this.stopAnimation) {\n return;\n }\n this.spinValue.setValue(0);\n Animated.timing(\n this.spinValue,\n {\n toValue: 1,\n duration: 1000,\n easing: Easing.linear,\n useNativeDriver: true\n }\n ).start(() => this.spin());\n }\n\n componentDidMount() {\n super.componentDidMount();\n this.spin();\n }\n\n componentWillUnmount(): void {\n super.componentWillUnmount();\n this.stopAnimation = true;\n }\n\n onPropertyChange(name: string, $new: any, $old: any) {\n super.onPropertyChange(name, $new, $old);\n switch(name) {\n case 'iconclass':\n $new && this.updateState({iconDef: this.getIconDef($new)} as WmIconState);\n break;\n }\n }\n\n private getCustomIcon(props: WmIconProps, style: any) {\n const customIcon = this.theme.mergeStyle({}, this.theme.getStyle(props?.iconclass || '')?.icon || this.styles.icon);\n const customIconContent = customIcon?.content;\n if (customIconContent) {\n delete customIcon.content;\n return (<Text\n style={[style, customIcon.fontFamily ? {fontFamily: customIcon.fontFamily}: null]}>\n {decodeURIComponent(customIconContent)}\n </Text>);\n }\n return null;\n }\n\n public renderSkeleton(props: WmIconProps) {\n return createSkeleton(this.theme, this.styles.skeleton, {\n ...this.styles.root,\n width: (this.props.skeletonwidth || this.props.iconsize || this.styles.root.width) as DimensionValue,\n height: (this.props.skeletonheight || this.props.iconsize || this.styles.root.height) as DimensionValue\n });\n }\n\n getElementToShow(props: WmIconProps, iconSrc: any) {\n\n const { iconmargin, iconheight, iconwidth } = props;\n let width, height;\n let elementToshow, source;\n\n if (iconwidth) width = iconwidth;\n else if (iconheight) width = iconheight;\n else width = 12;\n if (iconheight) height = iconheight;\n else if (iconwidth) height = iconwidth;\n else height = 12;\n\n if (isFullPathUrl(iconSrc)) {\n source = {\n uri: iconSrc\n };\n } else {\n source = iconSrc;\n }\n elementToshow = <Image testID={this.getTestId('icon')}\n style={{\n margin: iconmargin ?? 0,\n height: height,\n width: width\n }}\n source={source}/>;\n return elementToshow;\n }\n\n loadIcon(iconImage: string | undefined) {\n if (!iconImage || !this.loadAsset) {\n return null;\n }\n const iconImageSrc = this.loadAsset(iconImage);\n if (iconImageSrc && typeof iconImageSrc !== 'function') {\n return iconImageSrc;\n }\n return null;\n }\n\n renderIcon(props: WmIconProps) {\n let iconJsx = null;\n this._iconSource = this._iconSource || this.loadIcon(props.iconurl);\n const iconSrc: any = this._iconSource\n if (iconSrc) {\n return this.getElementToShow(props, iconSrc);\n }\n const iconDef = this.state.iconDef;\n if (!iconDef) {\n return null;\n }\n const { root, text, icon } = this.styles;\n const style = [{ color: root.color || text.color },\n icon,\n { transform: [{ rotate: iconDef.rotate }] }];\n\n const customIcon = this.getCustomIcon(props, style);\n const iconSize = props.iconsize || this.styles.root.fontSize || this.styles.text.fontSize || iconDef.size;\n if (props.show && iconDef && iconDef.isFontAwesome) {\n //@ts-ignore type information is not matching\n iconJsx = (<FontAwesome name={customIcon ? '' : iconDef.type}\n style={style}\n size={iconSize}\n {...this.getTestProps('icon')}>\n {customIcon}\n </FontAwesome>);\n } else if (props.show && iconDef) {\n let WMCustomIcon = WavIcon as unknown;\n if (iconDef.isStreamlineLightIcon) {\n WMCustomIcon = StreamlineLightIcon;\n } else if (iconDef.isStreamlineRegularIcon) {\n WMCustomIcon = StreamlineRegularIcon;\n } else if (!iconDef.isWavIcon && !customIcon && !this.styles.icon?.fontFamily) {\n return null;\n }\n //@ts-ignore type information is not matching\n iconJsx = WMCustomIcon ? (<WMCustomIcon name={customIcon ? '' : iconDef.type}\n style={style}\n size={iconSize}\n {...this.getTestProps('icon')}>\n {customIcon}\n </WMCustomIcon>) : null;\n }\n if (iconJsx && iconDef.animation === 'spin') {\n const rotate = this.spinValue.interpolate({ inputRange: [0, 1], outputRange: ['0deg', '360deg']});\n const animation = { transform: [{ rotate }] };\n this.stopAnimation = false;\n return (<Animated.View style={animation}>{iconJsx}</Animated.View>);\n } else if (iconJsx && iconDef.animation === 'pulse') {\n const opacity = this.spinValue.interpolate({ inputRange: [0, 1], outputRange: [0, 1]});\n const animation = { opacity: opacity };\n this.stopAnimation = false;\n return (<Animated.View style={animation}>{iconJsx}</Animated.View>);\n } else {\n this.stopAnimation = true;\n }\n return (\n <View\n // {...getAccessibilityProps(AccessibilityWidgetType.ICON, this.props)}\n >\n {iconJsx}\n </View>\n );\n }\n\n renderWidget(props: WmIconProps) {\n let icon = this.renderIcon(props);\n let iterationCount: any = props.iterationcount ? (props.iterationcount != 'infinite' ? parseInt(props.iterationcount): 'infinite') : undefined;\n return (\n <Tappable target={this} rippleColor = {this.styles.root.rippleColor} {...this.getTestPropsForAction()} accessibilityProps={{...getAccessibilityProps(AccessibilityWidgetType.ICON, props)}}>\n <Animatedview entryanimation={props.animation} delay={props.animationdelay} style={this.styles.root} iterationCount={iterationCount}>\n {this._background}\n {(props.iconposition === 'left' && icon) || null}\n {(props.caption && (<Text {...this.getTestPropsForLabel('caption')}style={this.styles.text} accessibilityRole={props?.accessibilityrole ? props?.accessibilityrole : 'text'}>{props.caption}</Text>)) || null}\n {(props.iconposition === 'right' && icon) || null}\n </Animatedview>\n </Tappable>\n );\n }\n}\n"],"mappings":";;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,QAAQ,EAAkBC,MAAM,EAAEC,IAAI,EAAEC,KAAK,EAAEC,IAAI,QAAQ,cAAc;AAClF,SAASC,WAAW,QAAQ,oBAAoB;AAChD,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,+CAA+C;AACjG,SAASC,aAAa,QAAQ,sCAAsC;AACpE,SAASC,uBAAuB,EAAEC,qBAAqB,QAAQ,8CAA8C;AAE7G,OAAOC,WAAW,MAAM,cAAc;AACtC,SAASC,aAAa,QAAsB,eAAe;AAC3D,OAAOC,OAAO,MAAM,6BAA6B;AACjD,OAAOC,mBAAmB,MAAM,yDAAyD;AACzF,OAAOC,qBAAqB,MAAM,6DAA6D;AAC/F,SAASC,QAAQ,QAAQ,mDAAmD;AAC5E,SAASC,YAAY,QAAQ,mEAAmE;AAChG,SAAqBC,cAAc,QAAQ,gCAAgC;AAa3E,MAAMC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able","NavigationServiceConsumer","AccessibilityWidgetType","getAccessibilityProps","WmLabelProps","DEFAULT_CLASS","isNil","toString","Animatedview","createSkeleton","WmLabelState","constructor","args","_defineProperty","WmLabel","props","getAsterisk","createElement","style","styles","asterisk","onPropertyChange","name","$new","$old","updateState","parts","parseCaption","String","getMultilineSkeleton","width","height","borderRadius","marginBottom","theme","skeleton","caption","replace","pattern","linkRegex","captionSplit","split","i","length","isLink","test","part","isNextTextALink","_captionSplit","text","link","push","renderSkeleton","_this$styles$root","_this$styles$root2","skeletonWidth","skeletonwidth","root","skeletonHeight","skeletonheight","fontSize","multilineskeleton","renderWidget","linkStyles","mergeStyle","entryanimation","animation","delay","animationdelay","_background","navigationService","_this$state$parts","_this$state$parts2","target","_extends","state","flexWrap","textAlign","getTestPropsForLabel","LABEL","numberOfLines","nooflines","ellipsizeMode","map","index","key","isValid","color","selectable","userSelect","onPress","startsWith","openUrl","eventName","substring","invokeEventCallback","proxy","required"],"sources":["label.component.tsx"],"sourcesContent":["import React from 'react';\nimport { DimensionValue, Text, View } from 'react-native';\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\nimport { Tappable } from '@wavemaker/app-rn-runtime/core/tappable.component';\nimport NavigationService, { NavigationServiceConsumer } from '@wavemaker/app-rn-runtime/core/navigation.service';\nimport { AccessibilityWidgetType, getAccessibilityProps } from '@wavemaker/app-rn-runtime/core/accessibility';\n\nimport WmLabelProps from './label.props';\nimport { DEFAULT_CLASS, WmLabelStyles } from './label.styles';\nimport { isNil, toString } from 'lodash-es';\nimport { Animatedview } from '@wavemaker/app-rn-runtime/components/basic/animatedview.component';\nimport WmSkeleton, { createSkeleton } from '../skeleton/skeleton.component';\n\ntype PartType = {\n text?: string,\n link?: string,\n};\n\nexport class WmLabelState extends BaseComponentState<WmLabelProps> {\n parts: PartType[] = []\n}\n\nexport default class WmLabel extends BaseComponent<WmLabelProps, WmLabelState, WmLabelStyles> {\n\n constructor(props: WmLabelProps) {\n super(props, DEFAULT_CLASS, new WmLabelProps(), new WmLabelState());\n }\n\n private getAsterisk () {\n return <Text style={this.styles.asterisk}>*</Text>;\n }\n\n public onPropertyChange(name: string, $new: any, $old: any): void {\n super.onPropertyChange(name, $new, $old);\n\n switch(name) {\n case \"caption\":\n this.updateState({\n parts: this.parseCaption(String($new))\n } as WmLabelState);\n break;\n }\n }\n private getMultilineSkeleton(width: any, height: any) {\n const styles = {\n borderRadius:4,\n marginBottom: 10,\n height: height\n };\n return createSkeleton(this.theme, this.styles.skeleton, {\n ...styles,\n width: width,\n height: height\n });\n }\n\n parseCaption(caption: string) {\n if (!caption) {\n return [];\n }\n caption += '';\n caption = caption.replace(/\\s*\\(\\s*\\$event,\\s*\\$widget\\s*\\)\\s*/, '');\n caption = caption.replace(/\\(\\s*\\)/, '(#/__EMPTY__)');\n const pattern = /\\[([^\\]]+)\\]\\(([^)]*)\\)/g;\n const linkRegex = /^(((http|https):\\/\\/)|javascript:|#).+$/;\n const captionSplit = caption.split(pattern);\n\n let parts = [];\n\n for (let i = 0; i < captionSplit.length; i++) {\n const isLink = linkRegex.test(captionSplit[i]);\n let part: PartType = {};\n\n const isNextTextALink = linkRegex.test(captionSplit[i + 1]);\n if (isLink) {\n part.text = captionSplit[i - 1] ?? '';\n part.link = captionSplit[i] === '#/__EMPTY__' ? '' : captionSplit[i];\n } else {\n part.text = isNextTextALink ? \"\" : captionSplit[i];\n };\n\n if (part.text) {\n parts.push(part);\n }\n }\n\n return parts;\n }\n\n public renderSkeleton(props: WmLabelProps){\n const skeletonWidth = this.props.skeletonwidth || this.styles.root?.width;\n const skeletonHeight = this.props.skeletonheight || this.styles.root?.height || this.styles.text.fontSize;\n if(this.props.multilineskeleton) {\n return (<View style={{\n width: skeletonWidth as DimensionValue\n }}>\n {this.getMultilineSkeleton('100%', skeletonHeight)}\n {this.getMultilineSkeleton('70%', skeletonHeight)}\n {this.getMultilineSkeleton('40%', skeletonHeight)}\n </View>)\n }\n else{\n return createSkeleton(this.theme, this.styles.skeleton, {\n ...this.styles.root,\n width: skeletonWidth as DimensionValue,\n height: skeletonHeight as DimensionValue\n });\n }\n }\n\n renderWidget(props: WmLabelProps) {\n const linkStyles = this.theme.mergeStyle({text: this.styles.text}, this.styles.link);\n return !isNil(props.caption) ? (\n <Animatedview entryanimation={props.animation} delay={props.animationdelay} style={this.styles.root}>\n {this._background}\n <NavigationServiceConsumer>\n {(navigationService: NavigationService) => {\n return (<Tappable target={this}>\n <Text style={ this.state.parts.length <= 1 ? this.styles.text : {flexWrap: \"wrap\", textAlign: this.styles.text.textAlign}}\n {...this.state.parts.length <= 1 ? this.getTestPropsForLabel('caption') : {}}\n {...getAccessibilityProps(AccessibilityWidgetType.LABEL, props)}\n numberOfLines={props.nooflines} ellipsizeMode=\"tail\">\n {this.state.parts?.length === 1 ? toString(this.state.props.caption) : this.state.parts?.map((part, index) => {\n const isLink = !isNil(part.link);\n return (\n <Text\n key={`part_${index}`}\n style={[\n this.styles.text,\n isLink ? this.styles.link.text : null,\n props.isValid ? null : { color: 'red'}\n ]}\n {...this.getTestPropsForLabel(isLink ? `link_${index}` : `caption_${index}`)}\n selectable={this.styles.text.userSelect === 'text'}\n onPress={() => {\n if (part.link) {\n if (part.link.startsWith('http:')\n || part.link.startsWith('https:')\n || part.link.startsWith('#')) {\n navigationService.openUrl(part.link, '_blank');\n } else if (part.link.startsWith('javascript:')) {\n const eventName = part.link.substring(11);\n this.invokeEventCallback(eventName, [null, this.proxy]);\n }\n }\n this.invokeEventCallback('onTap', [null, this.proxy]);\n }}\n // {...getAccessibilityProps(AccessibilityWidgetType.LABEL, props)}\n >\n {toString(part.text)}\n </Text>\n );\n })}\n {props.required && this.getAsterisk()}\n </Text>\n </Tappable>)}}\n </NavigationServiceConsumer>\n </Animatedview>\n ) : null;\n }\n}\n"],"mappings":";;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAAyBC,IAAI,EAAEC,IAAI,QAAQ,cAAc;AACzD,SAASC,aAAa,EA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ACyC,UAAU,CAAC,aAAa,CAAC,EAAE;gBAC9C,MAAME,SAAS,GAAG/C,IAAI,CAACI,IAAI,CAAC4C,SAAS,CAAC,EAAE,CAAC;gBACzC,IAAI,CAACC,mBAAmB,CAACF,SAAS,EAAE,CAAC,IAAI,EAAE,IAAI,CAACG,KAAK,CAAC,CAAC;cACzD;YACF;YACA,IAAI,CAACD,mBAAmB,CAAC,OAAO,EAAE,CAAC,IAAI,EAAE,IAAI,CAACC,KAAK,CAAC,CAAC;UACvD;UACA;QAAA,IAECzF,QAAQ,CAACuC,IAAI,CAACG,IAAI,CACf,CAAC;MAEX,CAAC,CAAC,EACAlC,KAAK,CAACkF,QAAQ,IAAI,IAAI,CAACjF,WAAW,CAAC,CACjC,CACE,CAAC;IAAC,CACa,CACf,CAAC,GACb,IAAI;EACV;AACF","ignoreList":[]}
|
1
|
+
{"version":3,"names":["React","Text","View","BaseComponent","BaseComponentState","Tappable","NavigationServiceConsumer","AccessibilityWidgetType","getAccessibilityProps","WmLabelProps","DEFAULT_CLASS","isNil","toString","Animatedview","createSkeleton","WmLabelState","constructor","args","_defineProperty","WmLabel","props","getAsterisk","createElement","style","styles","asterisk","onPropertyChange","name","$new","$old","updateState","parts","parseCaption","String","getMultilineSkeleton","width","height","borderRadius","marginBottom","theme","skeleton","caption","replace","pattern","linkRegex","captionSplit","split","i","length","isLink","test","part","isNextTextALink","_captionSplit","text","link","push","renderSkeleton","_this$styles$root","_this$styles$root2","skeletonWidth","skeletonwidth","root","skeletonHeight","skeletonheight","fontSize","multilineskeleton","renderWidget","linkStyles","mergeStyle","entryanimation","animation","delay","animationdelay","_background","navigationService","_this$state$parts","_this$state$parts2","target","_extends","state","flexWrap","textAlign","getTestPropsForLabel","LABEL","numberOfLines","nooflines","ellipsizeMode","map","index","key","isValid","color","selectable","userSelect","onPress","startsWith","openUrl","eventName","substring","invokeEventCallback","proxy","required"],"sources":["label.component.tsx"],"sourcesContent":["import React from 'react';\nimport { DimensionValue, Text, View } from 'react-native';\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\nimport { Tappable } from '@wavemaker/app-rn-runtime/core/tappable.component';\nimport NavigationService, { NavigationServiceConsumer } from '@wavemaker/app-rn-runtime/core/navigation.service';\nimport { AccessibilityWidgetType, getAccessibilityProps } from '@wavemaker/app-rn-runtime/core/accessibility';\n\nimport WmLabelProps from './label.props';\nimport { DEFAULT_CLASS, WmLabelStyles } from './label.styles';\nimport { isNil, toString } from 'lodash-es';\nimport { Animatedview } from '@wavemaker/app-rn-runtime/components/basic/animatedview.component';\nimport WmSkeleton, { createSkeleton } from '../skeleton/skeleton.component';\n\ntype PartType = {\n text?: string,\n link?: string,\n};\n\nexport class WmLabelState extends BaseComponentState<WmLabelProps> {\n parts: PartType[] = []\n}\n\nexport default class WmLabel extends BaseComponent<WmLabelProps, WmLabelState, WmLabelStyles> {\n\n constructor(props: WmLabelProps) {\n super(props, DEFAULT_CLASS, new WmLabelProps(), new WmLabelState());\n }\n\n private getAsterisk () {\n return <Text style={this.styles.asterisk}>*</Text>;\n }\n\n public onPropertyChange(name: string, $new: any, $old: any): void {\n super.onPropertyChange(name, $new, $old);\n\n switch(name) {\n case \"caption\":\n this.updateState({\n parts: this.parseCaption(String($new))\n } as WmLabelState);\n break;\n }\n }\n private getMultilineSkeleton(width: any, height: any) {\n const styles = {\n borderRadius:4,\n marginBottom: 10,\n height: height\n };\n return createSkeleton(this.theme, this.styles.skeleton, {\n ...styles,\n width: width,\n height: height\n });\n }\n\n parseCaption(caption: string) {\n if (!caption) {\n return [];\n }\n caption += '';\n caption = caption.replace(/\\s*\\(\\s*\\$event,\\s*\\$widget\\s*\\)\\s*/, '');\n caption = caption.replace(/\\(\\s*\\)/, '(#/__EMPTY__)');\n const pattern = /\\[([^\\]]+)\\]\\(([^)]*)\\)/g;\n const linkRegex = /^(((http|https):\\/\\/)|javascript:|#).+$/;\n const captionSplit = caption.split(pattern);\n\n let parts = [];\n\n for (let i = 0; i < captionSplit.length; i++) {\n const isLink = linkRegex.test(captionSplit[i]);\n let part: PartType = {};\n\n const isNextTextALink = linkRegex.test(captionSplit[i + 1]);\n if (isLink) {\n part.text = captionSplit[i - 1] ?? '';\n part.link = captionSplit[i] === '#/__EMPTY__' ? '' : captionSplit[i];\n } else {\n part.text = isNextTextALink ? \"\" : captionSplit[i];\n };\n\n if (part.text) {\n parts.push(part);\n }\n }\n\n return parts;\n }\n\n public renderSkeleton(props: WmLabelProps){\n const skeletonWidth = this.props.skeletonwidth || this.styles.root?.width;\n const skeletonHeight = this.props.skeletonheight || this.styles.root?.height || this.styles.text.fontSize;\n if(this.props.multilineskeleton) {\n return (<View style={{\n width: skeletonWidth as DimensionValue\n }}>\n {this.getMultilineSkeleton('100%', skeletonHeight)}\n {this.getMultilineSkeleton('70%', skeletonHeight)}\n {this.getMultilineSkeleton('40%', skeletonHeight)}\n </View>)\n }\n else{\n return createSkeleton(this.theme, this.styles.skeleton, {\n ...this.styles.root,\n width: skeletonWidth as DimensionValue,\n height: skeletonHeight as DimensionValue\n });\n }\n }\n\n renderWidget(props: WmLabelProps) {\n const linkStyles = this.theme.mergeStyle({text: this.styles.text}, this.styles.link);\n return !isNil(props.caption) ? (\n <Animatedview entryanimation={props.animation} delay={props.animationdelay} style={this.styles.root}>\n {this._background}\n <NavigationServiceConsumer>\n {(navigationService: NavigationService) => {\n return (<Tappable target={this}>\n <Text style={ this.state.parts.length <= 1 ? this.styles.text : {flexWrap: \"wrap\", textAlign: this.styles.text.textAlign}}\n {...this.state.parts.length <= 1 ? this.getTestPropsForLabel('caption') : {}}\n {...getAccessibilityProps(AccessibilityWidgetType.LABEL, props)}\n numberOfLines={props.nooflines} ellipsizeMode=\"tail\">\n {this.state.parts?.length === 1 ? toString(this.state.props.caption) : this.state.parts?.map((part, index) => {\n const isLink = !isNil(part.link);\n return (\n <Text\n key={`part_${index}`}\n style={[\n this.styles.text,\n isLink ? this.styles.link.text : null,\n props.isValid ? null : { color: 'red'}\n ]}\n {...this.getTestPropsForLabel(isLink ? `link_${index}` : `caption_${index}`)}\n selectable={this.styles.text.userSelect === 'text'}\n onPress={() => {\n if (part.link) {\n if (part.link.startsWith('http:')\n || part.link.startsWith('https:')\n || part.link.startsWith('#')) {\n navigationService.openUrl(part.link, '_blank');\n } else if (part.link.startsWith('javascript:')) {\n const eventName = part.link.substring(11);\n this.invokeEventCallback(eventName, [null, this.proxy]);\n }\n }\n this.invokeEventCallback('onTap', [null, this.proxy]);\n }}\n // {...getAccessibilityProps(AccessibilityWidgetType.LABEL, props)}\n >\n {toString(part.text)}\n </Text>\n );\n })}\n {props.required && this.getAsterisk()}\n </Text>\n </Tappable>)}}\n </NavigationServiceConsumer>\n </Animatedview>\n ) : null;\n }\n}\n"],"mappings":";;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAAyBC,IAAI,EAAEC,IAAI,QAAQ,cAAc;AACzD,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,+CAA+C;AACjG,SAASC,QAAQ,QAAQ,mDAAmD;AAC5E,SAA4BC,yBAAyB,QAAQ,mDAAmD;AAChH,SAASC,uBAAuB,EAAEC,qBAAqB,QAAQ,8CAA8C;AAE7G,OAAOC,YAAY,MAAM,eAAe;AACxC,SAASC,aAAa,QAAuB,gBAAgB;AAC7D,SAASC,KAAK,EAAEC,QAAQ,QAAQ,WAAW;AAC3C,SAASC,YAAY,QAAQ,mEAAmE;AAChG,SAAqBC,cAAc,QAAQ,gCAAgC;AAO3E,OAAO,MAAMC,YAAY,SAASX,kBAAkB,CAAe;EAAAY,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAC,eAAA,gBAC7C,EAAE;EAAA;AACxB;AAEA,eAAe,MAAMC,OAAO,SAAShB,aAAa,CAA4C;EAE5Fa,WAAWA,CAACI,KAAmB,EAAE;IAC/B,KAAK,CAACA,KAAK,EAAEV,aAAa,EAAE,IAAID,YAAY,CAAC,CAAC,EAAE,IAAIM,YAAY,CAAC,CAAC,C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;UAAK,CAAC;QACtC,GACE,IAAI,CAACT,oBAAoB,CAAClC,MAAM,GAAG,QAAQwC,KAAK,EAAE,GAAG,WAAWA,KAAK,EAAE,CAAC;UAC5EI,UAAU,EAAE,IAAI,CAACrE,MAAM,CAAC8B,IAAI,CAACwC,UAAU,KAAK,MAAO;UACnDC,OAAO,EAAEA,CAAA,KAAM;YACb,IAAI5C,IAAI,CAACI,IAAI,EAAE;cACb,IAAIJ,IAAI,CAACI,IAAI,CAACyC,UAAU,CAAC,OAAO,CAAC,IAC5B7C,IAAI,CAACI,IAAI,CAACyC,UAAU,CAAC,QAAQ,CAAC,IAC9B7C,IAAI,CAACI,IAAI,CAACyC,UAAU,CAAC,GAAG,CAAC,EAAE;gBAC9BrB,iBAAiB,CAACsB,OAAO,CAAC9C,IAAI,CAACI,IAAI,EAAE,QAAQ,CAAC;cAChD,CAAC,MAAM,IAAIJ,IAAI,CAACI,IAAI,CAACyC,UAAU,CAAC,aAAa,CAAC,EAAE;gBAC9C,MAAME,SAAS,GAAG/C,IAAI,CAACI,IAAI,CAAC4C,SAAS,CAAC,EAAE,CAAC;gBACzC,IAAI,CAACC,mBAAmB,CAACF,SAAS,EAAE,CAAC,IAAI,EAAE,IAAI,CAACG,KAAK,CAAC,CAAC;cACzD;YACF;YACA,IAAI,CAACD,mBAAmB,CAAC,OAAO,EAAE,CAAC,IAAI,EAAE,IAAI,CAACC,KAAK,CAAC,CAAC;UACvD;UACA;QAAA,IAECzF,QAAQ,CAACuC,IAAI,CAACG,IAAI,CACf,CAAC;MAEX,CAAC,CAAC,EACAlC,KAAK,CAACkF,QAAQ,IAAI,IAAI,CAACjF,WAAW,CAAC,CACjC,CACE,CAAC;IAAC,CACa,CACf,CAAC,GACb,IAAI;EACV;AACF","ignoreList":[]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["BASE_THEME","deepCopy","defineStyles","DEFAULT_CLASS","registerStyle","themeVariables","addStyle","defaultStyles","root","alignSelf","text","fontSize","color","labelDefaultColor","asterisk","labelAsteriskColor","marginLeft","skeleton","width","height","borderRadius","link","textDecorationLine","flexDirection","textAlign","getLabelStyles","textColor","backgroundColor","paddingLeft","paddingTop","paddingRight","paddingBottom","fontWeight","labelDangerColor","labelDangerContrastColor","labelDefaultContrastColor","labelInfoColor","labelInfoContrastColor","labelPrimaryColor","labelPrimaryContrastColor","labelSuccessColor","labelSuccessContrastColor","labelWarningColor","labelWarningContrastColor","getTextStyles","labelTextDangerColor","labelTextInfoColor","labelTextPrimaryColor","labelTextSuccessColor","labelTextWarningColor","getHeadingStyles","overrides","margin","labelHeaderColor","heading1FontSize","heading2FontSize","heading3FontSize","heading4FontSize","heading5FontSize","heading6FontSize","labelTextMutedColor"],"sources":["label.styles.ts"],"sourcesContent":["import BASE_THEME, { AllStyle } from '@wavemaker/app-rn-runtime/styles/theme';\nimport { deepCopy } from '@wavemaker/app-rn-runtime/core/utils';\nimport { BaseStyles, defineStyles } from '@wavemaker/app-rn-runtime/core/base.component';\nimport { WmSkeletonStyles } from '../skeleton/skeleton.styles';\nimport { WmAnchorStyles } from '../anchor/anchor.styles';\n\nexport type WmLabelStyles = BaseStyles & {\n asterisk: AllStyle,\n skeleton: WmSkeletonStyles \n link: WmAnchorStyles\n};\n\nexport const DEFAULT_CLASS = 'app-label';\nBASE_THEME.registerStyle((themeVariables, addStyle) => {\n const defaultStyles: WmLabelStyles = defineStyles({\n
|
1
|
+
{"version":3,"names":["BASE_THEME","deepCopy","defineStyles","DEFAULT_CLASS","registerStyle","themeVariables","addStyle","defaultStyles","root","alignSelf","text","fontSize","color","labelDefaultColor","asterisk","labelAsteriskColor","marginLeft","skeleton","width","height","borderRadius","link","textDecorationLine","flexDirection","textAlign","getLabelStyles","textColor","backgroundColor","paddingLeft","paddingTop","paddingRight","paddingBottom","fontWeight","labelDangerColor","labelDangerContrastColor","labelDefaultContrastColor","labelInfoColor","labelInfoContrastColor","labelPrimaryColor","labelPrimaryContrastColor","labelSuccessColor","labelSuccessContrastColor","labelWarningColor","labelWarningContrastColor","getTextStyles","labelTextDangerColor","labelTextInfoColor","labelTextPrimaryColor","labelTextSuccessColor","labelTextWarningColor","getHeadingStyles","overrides","margin","labelHeaderColor","heading1FontSize","heading2FontSize","heading3FontSize","heading4FontSize","heading5FontSize","heading6FontSize","labelTextMutedColor"],"sources":["label.styles.ts"],"sourcesContent":["import BASE_THEME, { AllStyle } from '@wavemaker/app-rn-runtime/styles/theme';\nimport { deepCopy } from '@wavemaker/app-rn-runtime/core/utils';\nimport { BaseStyles, defineStyles } from '@wavemaker/app-rn-runtime/core/base.component';\nimport { WmSkeletonStyles } from '../skeleton/skeleton.styles';\nimport { WmAnchorStyles } from '../anchor/anchor.styles';\n\nexport type WmLabelStyles = BaseStyles & {\n asterisk: AllStyle,\n skeleton: WmSkeletonStyles \n link: WmAnchorStyles\n};\n\nexport const DEFAULT_CLASS = 'app-label';\nBASE_THEME.registerStyle((themeVariables, addStyle) => {\n const defaultStyles: WmLabelStyles = defineStyles({\n root: {\n alignSelf: 'flex-start',\n },\n text: {\n fontSize: 16,\n color: themeVariables.labelDefaultColor\n },\n asterisk: {\n color: themeVariables.labelAsteriskColor,\n marginLeft: 2\n },\n skeleton: {\n root:{\n width: '100%',\n height: 16,\n borderRadius: 4\n }\n } as any as WmSkeletonStyles,\n link: {\n text: {\n textDecorationLine: 'underline'\n }\n } as WmAnchorStyles\n });\n\n addStyle(DEFAULT_CLASS, '', defaultStyles);\n addStyle(DEFAULT_CLASS + '-rtl', '', {\n root : {\n flexDirection: 'row',\n textAlign: 'right'\n }\n });\n const getLabelStyles = (color: string, textColor: string): WmLabelStyles => {\n return {\n root: {\n backgroundColor: color,\n paddingLeft: 32,\n paddingTop: 16,\n paddingRight: 32,\n paddingBottom: 16,\n borderRadius: 6\n },\n text: {\n color: textColor,\n fontWeight: 'bold'\n }\n } as WmLabelStyles;\n };\n\n addStyle('label-danger', '', getLabelStyles(themeVariables.labelDangerColor, themeVariables.labelDangerContrastColor));\n addStyle('label-default', '', getLabelStyles(themeVariables.labelDefaultColor, themeVariables.labelDefaultContrastColor));\n addStyle('label-info', '', getLabelStyles(themeVariables.labelInfoColor, themeVariables.labelInfoContrastColor));\n addStyle('label-primary', '', getLabelStyles(themeVariables.labelPrimaryColor, themeVariables.labelPrimaryContrastColor));\n addStyle('label-success', '', getLabelStyles(themeVariables.labelSuccessColor, themeVariables.labelSuccessContrastColor));\n addStyle('label-warning', '', getLabelStyles(themeVariables.labelWarningColor, themeVariables.labelWarningContrastColor));\n addStyle('label-test', '', getLabelStyles('yellow', 'red'));\n addStyle('label-test1', '', getLabelStyles('blue', 'orange'));\n\n const getTextStyles = (color: string) => {\n return {\n text: {\n color: color\n }\n } as WmLabelStyles;\n };\n\n addStyle('text-danger', '', getTextStyles(themeVariables.labelTextDangerColor));\n addStyle('text-info', '', getTextStyles(themeVariables.labelTextInfoColor));\n addStyle('text-primary', '', getTextStyles(themeVariables.labelTextPrimaryColor));\n addStyle('text-success', '', getTextStyles(themeVariables.labelTextSuccessColor));\n addStyle('text-warning', '', getTextStyles(themeVariables.labelTextWarningColor));\n addStyle('text-center', '', {\n root: {\n textAlign: 'center'\n }\n } as WmLabelStyles);\n addStyle('text-left', '', {\n root: {\n textAlign: 'left'\n }\n } as WmLabelStyles);\n addStyle('text-right', '', {\n root: {\n textAlign: 'right'\n }\n } as WmLabelStyles);\n\n\n const getHeadingStyles = (fontSize: number, overrides?: WmLabelStyles) => {\n return deepCopy({\n text: {\n fontWeight: '400',\n fontSize: fontSize,\n margin: 4,\n color: themeVariables.labelHeaderColor\n }\n } as WmLabelStyles, overrides);\n };\n addStyle('h1', '', getHeadingStyles(themeVariables.heading1FontSize, {text: {fontWeight: 'bold'}} as WmLabelStyles));\n addStyle('h2', '', getHeadingStyles(themeVariables.heading2FontSize, {text: {fontWeight: '500'}} as WmLabelStyles));\n addStyle('h3', '', getHeadingStyles(themeVariables.heading3FontSize));\n addStyle('h4', '', getHeadingStyles(themeVariables.heading4FontSize));\n addStyle('h5', '', getHeadingStyles(themeVariables.heading5FontSize));\n addStyle('h6', '', getHeadingStyles(themeVariables.heading6FontSize));\n addStyle('media-heading', '', {\n text : {\n fontSize: 16\n }\n } as WmLabelStyles);\n addStyle('text-muted', '', {\n text : {\n color: themeVariables.labelTextMutedColor\n }\n } as WmLabelStyles);\n addStyle('p', '', {\n text : {\n fontSize: 12\n }\n } as WmLabelStyles);\n});\n"],"mappings":"AAAA,OAAOA,UAAU,MAAqB,wCAAwC;AAC9E,SAASC,QAAQ,QAAQ,sCAAsC;AAC/D,SAAqBC,YAAY,QAAQ,+CAA+C;AAUxF,OAAO,MAAMC,aAAa,GAAG,WAAW;AACxCH,UAAU,CAACI,aAAa,CAAC,CAACC,cAAc,EAAEC,QAAQ,KAAK;EACrD,MAAMC,aAA4B,GAAGL,YAAY,CAAC;IAChDM,IAAI,EAAE;MACJC,SAAS,EAAE;IACb,CAAC;IACDC,IAAI,EAAE;MACFC,QAAQ,EAAE,EAAE;MACZC,KAAK,EAAEP,cAAc,CAACQ;IACxB,CAAC;IACDC,QAAQ,EAAE;MACRF,KAAK,EAAEP,cAAc,CAACU,kBAAkB;MACxCC,UAAU,EAAE;IACd,CAAC;IACDC,QAAQ,EAAE;MACRT,IAAI,EAAC;QACHU,KAAK,EAAE,MAAM;QACbC,MAAM,EAAE,EAAE;QACVC,YAAY,EAAE;MAChB;IACF,CAA4B;IAC5BC,IAAI,EAAE;MACJX,IAAI,EAAE;QACJY,kBAAkB,EAAE;MACtB;IACF;EACJ,CAAC,CAAC;EAEFhB,QAAQ,CAACH,aAAa,EAAE,EAAE,EAAEI,aAAa,CAAC;EAC1CD,QAAQ,CAACH,aAAa,GAAG,MAAM,EAAE,EAAE,EAAE;IACnCK,IAAI,EAAG;MACLe,aAAa,EAAE,KAAK;MACpBC,SAAS,EAAE;IACb;EACF,CAAC,CAAC;EACF,MAAMC,cAAc,GAAGA,CAACb,KAAa,EAAEc,SAAiB,KAAoB;IAC1E,OAAO;MACL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ACiD,gBAAgB,EAAE;IAAC5C,IAAI,EAAE;MAACsB,UAAU,EAAE;IAAM;EAAC,CAAkB,CAAC,CAAC;EACpH1B,QAAQ,CAAC,IAAI,EAAE,EAAE,EAAE4C,gBAAgB,CAAC7C,cAAc,CAACkD,gBAAgB,EAAE;IAAC7C,IAAI,EAAE;MAACsB,UAAU,EAAE;IAAK;EAAC,CAAkB,CAAC,CAAC;EACnH1B,QAAQ,CAAC,IAAI,EAAE,EAAE,EAAE4C,gBAAgB,CAAC7C,cAAc,CAACmD,gBAAgB,CAAC,CAAC;EACrElD,QAAQ,CAAC,IAAI,EAAE,EAAE,EAAE4C,gBAAgB,CAAC7C,cAAc,CAACoD,gBAAgB,CAAC,CAAC;EACrEnD,QAAQ,CAAC,IAAI,EAAE,EAAE,EAAE4C,gBAAgB,CAAC7C,cAAc,CAACqD,gBAAgB,CAAC,CAAC;EACrEpD,QAAQ,CAAC,IAAI,EAAE,EAAE,EAAE4C,gBAAgB,CAAC7C,cAAc,CAACsD,gBAAgB,CAAC,CAAC;EACrErD,QAAQ,CAAC,eAAe,EAAE,EAAE,EAAE;IAC5BI,IAAI,EAAG;MACLC,QAAQ,EAAE;IACZ;EACF,CAAkB,CAAC;EACnBL,QAAQ,CAAC,YAAY,EAAE,EAAE,EAAE;IACzBI,IAAI,EAAG;MACLE,KAAK,EAAEP,cAAc,CAACuD;IACxB;EACF,CAAkB,CAAC;EACnBtD,QAAQ,CAAC,GAAG,EAAE,EAAE,EAAE;IAChBI,IAAI,EAAG;MACLC,QAAQ,EAAE;IACZ;EACF,CAAkB,CAAC;AACrB,CAAC,CAAC","ignoreList":[]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["React","View","Text","BaseComponent","BaseComponentState","WmMessageProps","DEFAULT_CLASS","WmIcon","WmButton","Animatedview","AccessibilityWidgetType","getAccessibilityProps","WmMessageState","MESSAGE_ICONS","DEFAULT_TITLE","WmMessage","constructor","props","_defineProperty","updateState","show","invokeEventCallback","showMessage","hideMessage","renderWidget","styles","theme","mergeStyle","getStyle","type","variant","createElement","entryanimation","animation","delay","animationdelay","style","root","_background","id","getTestId","iconclass","icon","message","_extends","getTestPropsForLabel","title","MESSAGE","text","caption","hideclose","closeBtn","onTap","close"],"sources":["message.component.tsx"],"sourcesContent":["import React from 'react';\nimport { View, Text } from 'react-native';\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\n\nimport WmMessageProps from './message.props';\nimport { DEFAULT_CLASS, WmMessageStyles } from './message.styles';\nimport WmIcon from '../icon/icon.component';\nimport WmButton from '../button/button.component';\nimport { Animatedview } from '@wavemaker/app-rn-runtime/components/basic/animatedview.component';\nimport { AccessibilityWidgetType, getAccessibilityProps } from '@wavemaker/app-rn-runtime/core/accessibility';\n\nexport class WmMessageState extends BaseComponentState<WmMessageProps> {}\n\nconst MESSAGE_ICONS = {\n 'success': 'wm-sl-l sl-check',\n 'warning': 'wm-sl-l sl-alarm-bell',\n 'error': 'fa fa-times-circle',\n 'info': 'wi wi-info',\n 'loading': 'fa fa-spinner fa-spin'\n};\n\nconst DEFAULT_TITLE = {\n 'success': 'Success',\n 'warning': 'Warning',\n 'error': 'Error',\n 'info': 'Info',\n 'loading': 'Processing'\n} as any;\n\nexport default class WmMessage extends BaseComponent<WmMessageProps, WmMessageState, WmMessageStyles> {\n\n constructor(props: WmMessageProps) {\n super(props, DEFAULT_CLASS, new WmMessageProps());\n }\n\n showMessage() {\n this.updateState({\n props: {\n show: true\n }\n } as WmMessageState);\n }\n\n hideMessage() {\n this.updateState({\n props: {\n show: false\n }\n } as WmMessageState);\n }\n\n close = () => {\n this.updateState({props: {\n show : false\n }}, () => this.invokeEventCallback('onClose', [null, this]));\n }\n\n renderWidget(props: WmMessageProps) {\n const styles = this.theme.mergeStyle(this.theme.getStyle(`${props.type}-${props.variant}-message`), this.styles);\n return (<Animatedview entryanimation={props.animation} delay={props.animationdelay} style={styles.root}>\n {this._background}\n <WmIcon\n id={this.getTestId('icon')}\n iconclass={props.type && MESSAGE_ICONS[props.type]}\n styles={styles.icon}></WmIcon>\n <View style={styles.message}>\n <Text {...this.getTestPropsForLabel('title')} style={styles.title} {...getAccessibilityProps(AccessibilityWidgetType.MESSAGE, props)}>{props.title || DEFAULT_TITLE[props.type || '']}</Text>\n <Text {...this.getTestPropsForLabel('caption')} style={styles.text} {...getAccessibilityProps(AccessibilityWidgetType.MESSAGE, props)}>{props.caption}</Text>\n </View>\n {props.hideclose ? null : (\n <WmButton\n id={this.getTestId('close')}\n iconclass=\"wi wi-close\"\n styles={styles.closeBtn}\n onTap={this.close}></WmButton>\n )}\n </Animatedview>);\n }\n}\n"],"mappings":";;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,EAAEC,IAAI,QAAQ,cAAc;AACzC,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,+CAA+C;AAEjG,OAAOC,cAAc,MAAM,iBAAiB;AAC5C,SAASC,aAAa,QAAyB,kBAAkB;AACjE,OAAOC,MAAM,MAAM,wBAAwB;AAC3C,OAAOC,QAAQ,MAAM,4BAA4B;AACjD,SAASC,YAAY,QAAQ,mEAAmE;AAChG,SAASC,uBAAuB,EAAEC,qBAAqB,QAAQ,8CAA8C;AAE7G,OAAO,MAAMC,cAAc,SAASR,kBAAkB,CAAiB;AAEvE,MAAMS,aAAa,GAAG;EACpB,SAAS,EAAE,kBAAkB;EAC7B,SAAS,EAAE,uBAAuB;EAClC,OAAO,EAAE,oBAAoB;EAC7B,MAAM,EAAE,YAAY;EACpB,SAAS,EAAE;AACb,CAAC;AAED,MAAMC,aAAa,GAAG;EACpB,SAAS,EAAE,SAAS;EACpB,SAAS,EAAE,SAAS;EACpB,OAAO,EAAE,OAAO;EAChB,MAAM,EAAE,MAAM;EACd,SAAS,EAAE;AACb,CAAQ;AAER,eAAe,MAAMC,SAAS,SAASZ,aAAa,CAAkD;EAEpGa,WAAWA,CAACC,KAAqB,EAAE;IACjC,KAAK,CAACA,KAAK,EAAEX,aAAa,EAAE,IAAID,cAAc,CAAC,CAAC,CAAC;IAACa,eAAA,gBAmB5C,MAAM;MACZ,IAAI,CAACC,WAAW,CAAC;QAACF,KAAK,EAAE;UACvBG,IAAI,EAAG;QACT;MAAC,CAAC,EAAE,MAAM,IAAI,CAACC,mBAAmB,CAAC,SAAS,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC;IAC9D,CAAC;EAtBD;EAEAC,WAAWA,CAAA,EAAG;IACZ,IAAI,CAACH,WAAW,CAAC;MACfF,KAAK,EAAE;QACLG,IAAI,EAAE;MACR;IACF,CAAmB,CAAC;EACtB;EAEAG,WAAWA,CAAA,EAAG;IACZ,IAAI,CAACJ,WAAW,CAAC;MACfF,KAAK,EAAE;QACLG,IAAI,EAAE;MACR;IACF,CAAmB,CAAC;EACtB;EAQAI,YAAYA,CAACP,KAAqB,EAAE;IAClC,MAAMQ,MAAM,GAAG,IAAI,CAACC,KAAK,CAACC,UAAU,CAAC,IAAI,CAACD,KAAK,CAACE,QAAQ,
|
1
|
+
{"version":3,"names":["React","View","Text","BaseComponent","BaseComponentState","WmMessageProps","DEFAULT_CLASS","WmIcon","WmButton","Animatedview","AccessibilityWidgetType","getAccessibilityProps","WmMessageState","MESSAGE_ICONS","DEFAULT_TITLE","WmMessage","constructor","props","_defineProperty","updateState","show","invokeEventCallback","showMessage","hideMessage","renderWidget","styles","theme","mergeStyle","getStyle","type","variant","createElement","entryanimation","animation","delay","animationdelay","style","root","_background","id","getTestId","iconclass","icon","message","_extends","getTestPropsForLabel","title","MESSAGE","text","caption","hideclose","closeBtn","onTap","close"],"sources":["message.component.tsx"],"sourcesContent":["import React from 'react';\nimport { View, Text } from 'react-native';\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\n\nimport WmMessageProps from './message.props';\nimport { DEFAULT_CLASS, WmMessageStyles } from './message.styles';\nimport WmIcon from '../icon/icon.component';\nimport WmButton from '../button/button.component';\nimport { Animatedview } from '@wavemaker/app-rn-runtime/components/basic/animatedview.component';\nimport { AccessibilityWidgetType, getAccessibilityProps } from '@wavemaker/app-rn-runtime/core/accessibility';\n\nexport class WmMessageState extends BaseComponentState<WmMessageProps> {}\n\nconst MESSAGE_ICONS = {\n 'success': 'wm-sl-l sl-check',\n 'warning': 'wm-sl-l sl-alarm-bell',\n 'error': 'fa fa-times-circle',\n 'info': 'wi wi-info',\n 'loading': 'fa fa-spinner fa-spin'\n};\n\nconst DEFAULT_TITLE = {\n 'success': 'Success',\n 'warning': 'Warning',\n 'error': 'Error',\n 'info': 'Info',\n 'loading': 'Processing'\n} as any;\n\nexport default class WmMessage extends BaseComponent<WmMessageProps, WmMessageState, WmMessageStyles> {\n\n constructor(props: WmMessageProps) {\n super(props, DEFAULT_CLASS, new WmMessageProps());\n }\n\n showMessage() {\n this.updateState({\n props: {\n show: true\n }\n } as WmMessageState);\n }\n\n hideMessage() {\n this.updateState({\n props: {\n show: false\n }\n } as WmMessageState);\n }\n\n close = () => {\n this.updateState({props: {\n show : false\n }}, () => this.invokeEventCallback('onClose', [null, this]));\n }\n\n renderWidget(props: WmMessageProps) {\n const styles = this.theme.mergeStyle(this.theme.getStyle(`${props.type}-${props.variant}-message`), this.styles);\n return (<Animatedview entryanimation={props.animation} delay={props.animationdelay} style={styles.root}>\n {this._background}\n <WmIcon\n id={this.getTestId('icon')}\n iconclass={props.type && MESSAGE_ICONS[props.type]}\n styles={styles.icon}></WmIcon>\n <View style={styles.message}>\n <Text {...this.getTestPropsForLabel('title')} style={styles.title} {...getAccessibilityProps(AccessibilityWidgetType.MESSAGE, props)}>{props.title || DEFAULT_TITLE[props.type || '']}</Text>\n <Text {...this.getTestPropsForLabel('caption')} style={styles.text} {...getAccessibilityProps(AccessibilityWidgetType.MESSAGE, props)}>{props.caption}</Text>\n </View>\n {props.hideclose ? null : (\n <WmButton\n id={this.getTestId('close')}\n iconclass=\"wi wi-close\"\n styles={styles.closeBtn}\n onTap={this.close}></Wm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AAA,KAAK,IAAI,CAACC,oBAAoB,CAAC,SAAS,CAAC;MAAET,KAAK,EAAEX,MAAM,CAACuB;IAAK,GAAKrC,qBAAqB,CAACD,uBAAuB,CAACqC,OAAO,EAAE9B,KAAK,CAAC,GAAGA,KAAK,CAACgC,OAAc,CACxJ,CAAC,EACNhC,KAAK,CAACiC,SAAS,GAAG,IAAI,gBACrBlD,KAAA,CAAA+B,aAAA,CAACvB,QAAQ;MACP+B,EAAE,EAAE,IAAI,CAACC,SAAS,CAAC,OAAO,CAAE;MAC5BC,SAAS,EAAC,aAAa;MACvBhB,MAAM,EAAEA,MAAM,CAAC0B,QAAS;MACxBC,KAAK,EAAE,IAAI,CAACC;IAAM,CAAW,CAErB,CAAC;EACjB;AACF","ignoreList":[]}
|
@@ -124,8 +124,7 @@ export default class WmPicture extends BaseComponent {
|
|
124
124
|
source = imgSrc;
|
125
125
|
}
|
126
126
|
if (this.state.naturalImageWidth) {
|
127
|
-
elementToshow = /*#__PURE__*/React.createElement(Image, _extends({
|
128
|
-
testID: this.getTestId('picture'),
|
127
|
+
elementToshow = /*#__PURE__*/React.createElement(Image, _extends({}, this.getTestProps('picture'), {
|
129
128
|
style: [this.styles.picture, shapeStyles.picture],
|
130
129
|
resizeMode: props.resizemode,
|
131
130
|
source: source
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["React","Image","View","isNumber","Tappable","BaseComponent","BaseComponentState","ImageSizeEstimator","isFullPathUrl","AccessibilityWidgetType","getAccessibilityProps","WmPictureProps","DEFAULT_CLASS","Animatedview","createSkeleton","WmPictureState","constructor","args","_defineProperty","WmPicture","props","e","imageWidth","nativeEvent","layout","width","imageHeight","height","styles","root","includes","state","naturalImageHeight","naturalImageWidth","updateState","loadImage","image","loadAsset","imageSrc","default","resolveAssetSource","cancel","getSize","cleanup","splice","indexOf","push","onPropertyChange","name","$new","$old","_pictureSource","_picturePlaceHolder","createShape","shape","picture","borderRadius","theme","getStyle","getElementToShow","imgSrc","shapeStyles","elementToshow","source","imgStyle","resizemode","createElement","uri","_extends","testID","getTestId","style","resizeMode","PICTURE","renderSkeleton","_this$styles$root","_shapeStyles$root","_shapeStyles$picture","_this$styles$root2","_shapeStyles$root2","_shapeStyles$picture2","_this$styles$root3","_shapeStyles$picture3","_shapeStyles$root3","_this$styles$root4","skeletonWidth","skeletonwidth","skeletonHeight","skeletonheight","skeleton","renderWidget","_shapeStyles$picture4","picturesource","pictureplaceholder","isSvg","_background","overflow","onLayout","onViewLayoutChange","getTestPropsForAction","rippleColor","target","entryanimation","animation","delay","animationdelay"],"sources":["picture.component.tsx"],"sourcesContent":["import React from 'react';\nimport { DimensionValue, Image, LayoutChangeEvent, View } from 'react-native';\n// import { NumberProp, SvgUri } from 'react-native-svg';\nimport { isNumber, isString } from 'lodash-es';\nimport { Tappable } from '@wavemaker/app-rn-runtime/core/tappable.component';\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\nimport ImageSizeEstimator from '@wavemaker/app-rn-runtime/core/imageSizeEstimator';\nimport { isFullPathUrl } from '@wavemaker/app-rn-runtime/core/utils';\nimport { AccessibilityWidgetType, getAccessibilityProps } from '@wavemaker/app-rn-runtime/core/accessibility';\n\nimport WmPictureProps from './picture.props';\nimport { DEFAULT_CLASS, WmPictureStyles } from './picture.styles';\nimport { Animatedview } from '@wavemaker/app-rn-runtime/components/basic/animatedview.component';\nimport WmSkeleton, { createSkeleton } from '../skeleton/skeleton.component';\n\nexport class WmPictureState extends BaseComponentState<WmPictureProps> {\n naturalImageWidth: number = 0;\n naturalImageHeight: number = 0;\n imageWidth: number = 0;\n imageHeight: number = 0;\n}\n\nexport default class WmPicture extends BaseComponent<WmPictureProps, WmPictureState, WmPictureStyles> {\n\n private _pictureSource = null as any;\n private _picturePlaceHolder = null as any;\n\n constructor(props: WmPictureProps) {\n super(props, DEFAULT_CLASS, new WmPictureProps());\n }\n\n loadImage(image: string | undefined) {\n if (!image || !this.loadAsset) {\n return null;\n }\n const imageSrc = this.loadAsset(image) as any;\n if (imageSrc && typeof imageSrc === 'object' && typeof imageSrc.default === 'function') {\n return null;\n }\n if (isNumber(imageSrc)) {\n const {width, height} = Image.resolveAssetSource(imageSrc);\n this.updateState({\n naturalImageWidth: width,\n naturalImageHeight: height\n } as WmPictureState);\n } else if (imageSrc !== null) {\n const cancel = ImageSizeEstimator.getSize(imageSrc, (width: number, height: number) => {\n this.updateState({\n naturalImageWidth: width,\n naturalImageHeight: height\n } as WmPictureState);\n this.cleanup.splice(this.cleanup.indexOf(cancel), 1);\n });\n this.cleanup.push(cancel);\n }\n return imageSrc;\n }\n\n onPropertyChange(name: string, $new: any, $old: any) {\n switch(name) {\n case 'picturesource':\n this._pictureSource = null;\n case 'pictureplaceholder':\n this._picturePlaceHolder = null;\n break;\n }\n }\n\n onViewLayoutChange = (e: LayoutChangeEvent) => {\n let imageWidth = e.nativeEvent.layout.width;\n let imageHeight = e.nativeEvent.layout.height;\n if (!imageWidth && !imageHeight) {\n return;\n }\n if (!this.styles.root.height\n || (typeof this.styles.root.height === 'string'\n && !this.styles.root.height.includes('%'))) {\n imageHeight = 0;\n }\n if (imageWidth && !imageHeight) {\n imageHeight = imageWidth * this.state.naturalImageHeight / this.state.naturalImageWidth;\n } else if (imageHeight && !imageWidth) {\n imageWidth = imageHeight * this.state.naturalImageWidth / this.state.naturalImageHeight;\n }\n this.updateState({\n imageWidth: imageWidth,\n imageHeight: imageHeight\n } as WmPictureState);\n };\n\n createShape(shape: string | undefined, imageWidth?: number | string): WmPictureStyles {\n if (shape) {\n switch(shape) {\n case 'circle':\n return {\n picture: {\n borderRadius: isNumber(imageWidth) ? imageWidth / 2 : 4\n }\n } as WmPictureStyles;\n case 'rounded' :\n return (this.theme.getStyle('rounded-image') as WmPictureStyles);\n case 'thumbnail' :\n return (this.theme.getStyle('thumbnail-image') as WmPictureStyles);\n }\n }\n return {} as WmPictureStyles;\n }\n\n getElementToShow(props: WmPictureProps, imgSrc: any, shapeStyles: WmPictureStyles) {\n let elementToshow, source;\n if (imgSrc && typeof imgSrc === 'object' && typeof imgSrc?.default === 'function') {\n let imgStyle : any = {};\n if (props.resizemode === 'contain') {\n imgStyle['width'] = '100%';\n imgStyle['height'] = '100%';\n }\n elementToshow = React.createElement(imgSrc?.default, imgStyle);\n //} else if (!isWebPreviewMode() && props.isSvg) {\n // svg from uri\n // elementToshow = <SvgUri testID={this.getTestId('picture')} width={this.styles.root.width as NumberProp} height={this.styles.root.height as NumberProp} uri={imgSrc}/>;\n } else if (isFullPathUrl(imgSrc)) {\n source = {\n uri: imgSrc\n };\n } else {\n source = imgSrc;\n }\n if (this.state.naturalImageWidth) {\n elementToshow = (\n <Image\n testID={this.getTestId('picture')}\n style={[this.styles.picture, shapeStyles.picture]}\n resizeMode={props.resizemode}\n source={source}\n {...getAccessibilityProps(AccessibilityWidgetType.PICTURE, props)}\n />\n );\n }\n return elementToshow;\n }\n\n public renderSkeleton(props: WmPictureProps){\n const imageWidth = this.state.imageWidth;\n const imageHeight = this.state.imageHeight;\n const shapeStyles = this.createShape(this.props.shape, imageWidth);\n const skeletonWidth = this.props.skeletonwidth || this.styles.root?.width || shapeStyles.root?.width || shapeStyles.picture?.width || imageWidth;\n const skeletonHeight = this.props.skeletonheight || this.styles.root?.height || shapeStyles.root?.height || shapeStyles.picture?.height || imageHeight;\n return createSkeleton(this.theme, this.styles.skeleton, {\n ...this.styles.root,\n borderRadius: this.props.shape == 'circle' && this.styles.root?.width ? 25 : shapeStyles.picture?.borderRadius || shapeStyles.root?.borderRadius || this.styles.root?.borderRadius || 4,\n width: skeletonWidth as DimensionValue,\n height: skeletonHeight as DimensionValue\n });\n }\n\n renderWidget(props: WmPictureProps) {\n const imageWidth = this.state.imageWidth;\n const imageHeight = this.state.imageHeight;\n const shapeStyles = this.createShape(props.shape, imageWidth);\n this._pictureSource = this._pictureSource || this.loadImage(props.picturesource);\n this._picturePlaceHolder = this._picturePlaceHolder || this.loadImage(props.pictureplaceholder);\n const imgSrc: any = this._pictureSource || this._picturePlaceHolder;\n let elementToshow;\n if (imgSrc) {\n elementToshow = this.getElementToShow(props, imgSrc, shapeStyles);\n }\n return imgSrc && (this.state.naturalImageWidth || props.isSvg) ? (\n <View style={[{\n width: imageWidth,\n height: imageHeight\n }, this.styles.root, shapeStyles.root, shapeStyles.picture]}>\n {this._background}\n <View style={[{overflow: 'hidden', width: '100%',\n height: '100%'}]} onLayout={this.onViewLayoutChange}>\n <Tappable\n {...this.getTestPropsForAction()}\n rippleColor={this.styles.root.rippleColor}\n target={this} styles={{width: imageWidth ? null : '100%', height: imageHeight ? null : '100%'}}>\n <Animatedview entryanimation={props.animation} delay={props.animationdelay} style={[{\n height: imageHeight,\n width: imageWidth,\n borderRadius: shapeStyles.picture?.borderRadius\n }]}>\n {this.state.imageWidth ? elementToshow : null}\n </Animatedview>\n </Tappable>\n </View>\n </View>\n ): null;\n }\n}\n"],"mappings":";;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAAyBC,KAAK,EAAqBC,IAAI,QAAQ,cAAc;AAC7E;AACA,SAASC,QAAQ,QAAkB,WAAW;AAC9C,SAASC,QAAQ,QAAQ,mDAAmD;AAC5E,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,+CAA+C;AACjG,OAAOC,kBAAkB,MAAM,mDAAmD;AAClF,SAASC,aAAa,QAAQ,sCAAsC;AACpE,SAASC,uBAAuB,EAAEC,qBAAqB,QAAQ,8CAA8C;AAE7G,OAAOC,cAAc,MAAM,iBAAiB;AAC5C,SAASC,aAAa,QAAyB,kBAAkB;AACjE,SAASC,YAAY,QAAQ,mEAAmE;AAChG,SAAqBC,cAAc,QAAQ,gCAAgC;AAE3E,OAAO,MAAMC,cAAc,SAAST,kBAAkB,CAAiB;EAAAU,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAC,eAAA,4BACzC,CAAC;IAAAA,eAAA,6BACA,CAAC;IAAAA,eAAA,qBACT,CAAC;IAAAA,eAAA,sBACA,CAAC;E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F,KAAK,CAACqF,cAAe;MAAClC,KAAK,EAAE,CAAC;QAC9E5C,MAAM,EAAED,WAAW;QACnBD,KAAK,EAAEH,UAAU;QACjBkC,YAAY,GAAAmC,qBAAA,GAAE9B,WAAW,CAACN,OAAO,cAAAoC,qBAAA,uBAAnBA,qBAAA,CAAqBnC;MACrC,CAAC;IAAE,GACF,IAAI,CAACzB,KAAK,CAACT,UAAU,GAAGwC,aAAa,GAAG,IAC7B,CACN,CACN,CACF,CAAC,GACN,IAAI;EACT;AACF","ignoreList":[]}
|
1
|
+
{"version":3,"names":["React","Image","View","isNumber","Tappable","BaseComponent","BaseComponentState","ImageSizeEstimator","isFullPathUrl","AccessibilityWidgetType","getAccessibilityProps","WmPictureProps","DEFAULT_CLASS","Animatedview","createSkeleton","WmPictureState","constructor","args","_defineProperty","WmPicture","props","e","imageWidth","nativeEvent","layout","width","imageHeight","height","styles","root","includes","state","naturalImageHeight","naturalImageWidth","updateState","loadImage","image","loadAsset","imageSrc","default","resolveAssetSource","cancel","getSize","cleanup","splice","indexOf","push","onPropertyChange","name","$new","$old","_pictureSource","_picturePlaceHolder","createShape","shape","picture","borderRadius","theme","getStyle","getElementToShow","imgSrc","shapeStyles","elementToshow","source","imgStyle","resizemode","createElement","uri","_extends","getTestProps","style","resizeMode","PICTURE","renderSkeleton","_this$styles$root","_shapeStyles$root","_shapeStyles$picture","_this$styles$root2","_shapeStyles$root2","_shapeStyles$picture2","_this$styles$root3","_shapeStyles$picture3","_shapeStyles$root3","_this$styles$root4","skeletonWidth","skeletonwidth","skeletonHeight","skeletonheight","skeleton","renderWidget","_shapeStyles$picture4","picturesource","pictureplaceholder","isSvg","_background","overflow","onLayout","onViewLayoutChange","getTestPropsForAction","rippleColor","target","entryanimation","animation","delay","animationdelay"],"sources":["picture.component.tsx"],"sourcesContent":["import React from 'react';\nimport { DimensionValue, Image, LayoutChangeEvent, View } from 'react-native';\n// import { NumberProp, SvgUri } from 'react-native-svg';\nimport { isNumber, isString } from 'lodash-es';\nimport { Tappable } from '@wavemaker/app-rn-runtime/core/tappable.component';\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\nimport ImageSizeEstimator from '@wavemaker/app-rn-runtime/core/imageSizeEstimator';\nimport { isFullPathUrl } from '@wavemaker/app-rn-runtime/core/utils';\nimport { AccessibilityWidgetType, getAccessibilityProps } from '@wavemaker/app-rn-runtime/core/accessibility';\n\nimport WmPictureProps from './picture.props';\nimport { DEFAULT_CLASS, WmPictureStyles } from './picture.styles';\nimport { Animatedview } from '@wavemaker/app-rn-runtime/components/basic/animatedview.component';\nimport WmSkeleton, { createSkeleton } from '../skeleton/skeleton.component';\n\nexport class WmPictureState extends BaseComponentState<WmPictureProps> {\n naturalImageWidth: number = 0;\n naturalImageHeight: number = 0;\n imageWidth: number = 0;\n imageHeight: number = 0;\n}\n\nexport default class WmPicture extends BaseComponent<WmPictureProps, WmPictureState, WmPictureStyles> {\n\n private _pictureSource = null as any;\n private _picturePlaceHolder = null as any;\n\n constructor(props: WmPictureProps) {\n super(props, DEFAULT_CLASS, new WmPictureProps());\n }\n\n loadImage(image: string | undefined) {\n if (!image || !this.loadAsset) {\n return null;\n }\n const imageSrc = this.loadAsset(image) as any;\n if (imageSrc && typeof imageSrc === 'object' && typeof imageSrc.default === 'function') {\n return null;\n }\n if (isNumber(imageSrc)) {\n const {width, height} = Image.resolveAssetSource(imageSrc);\n this.updateState({\n naturalImageWidth: width,\n naturalImageHeight: height\n } as WmPictureState);\n } else if (imageSrc !== null) {\n const cancel = ImageSizeEstimator.getSize(imageSrc, (width: number, height: number) => {\n this.updateState({\n naturalImageWidth: width,\n naturalImageHeight: height\n } as WmPictureState);\n this.cleanup.splice(this.cleanup.indexOf(cancel), 1);\n });\n this.cleanup.push(cancel);\n }\n return imageSrc;\n }\n\n onPropertyChange(name: string, $new: any, $old: any) {\n switch(name) {\n case 'picturesource':\n this._pictureSource = null;\n case 'pictureplaceholder':\n this._picturePlaceHolder = null;\n break;\n }\n }\n\n onViewLayoutChange = (e: LayoutChangeEvent) => {\n let imageWidth = e.nativeEvent.layout.width;\n let imageHeight = e.nativeEvent.layout.height;\n if (!imageWidth && !imageHeight) {\n return;\n }\n if (!this.styles.root.height\n || (typeof this.styles.root.height === 'string'\n && !this.styles.root.height.includes('%'))) {\n imageHeight = 0;\n }\n if (imageWidth && !imageHeight) {\n imageHeight = imageWidth * this.state.naturalImageHeight / this.state.naturalImageWidth;\n } else if (imageHeight && !imageWidth) {\n imageWidth = imageHeight * this.state.naturalImageWidth / this.state.naturalImageHeight;\n }\n this.updateState({\n imageWidth: imageWidth,\n imageHeight: imageHeight\n } as WmPictureState);\n };\n\n createShape(shape: string | undefined, imageWidth?: number | string): WmPictureStyles {\n if (shape) {\n switch(shape) {\n case 'circle':\n return {\n picture: {\n borderRadius: isNumber(imageWidth) ? imageWidth / 2 : 4\n }\n } as WmPictureStyles;\n case 'rounded' :\n return (this.theme.getStyle('rounded-image') as WmPictureStyles);\n case 'thumbnail' :\n return (this.theme.getStyle('thumbnail-image') as WmPictureStyles);\n }\n }\n return {} as WmPictureStyles;\n }\n\n getElementToShow(props: WmPictureProps, imgSrc: any, shapeStyles: WmPictureStyles) {\n let elementToshow, source;\n if (imgSrc && typeof imgSrc === 'object' && typeof imgSrc?.default === 'function') {\n let imgStyle : any = {};\n if (props.resizemode === 'contain') {\n imgStyle['width'] = '100%';\n imgStyle['height'] = '100%';\n }\n elementToshow = React.createElement(imgSrc?.default, imgStyle);\n //} else if (!isWebPreviewMode() && props.isSvg) {\n // svg from uri\n // elementToshow = <SvgUri testID={this.getTestId('picture')} width={this.styles.root.width as NumberProp} height={this.styles.root.height as NumberProp} uri={imgSrc}/>;\n } else if (isFullPathUrl(imgSrc)) {\n source = {\n uri: imgSrc\n };\n } else {\n source = imgSrc;\n }\n if (this.state.naturalImageWidth) {\n elementToshow = (\n <Image\n {...this.getTestProps('picture')}\n style={[this.styles.picture, shapeStyles.picture]}\n resizeMode={props.resizemode}\n source={source}\n {...getAccessibilityProps(AccessibilityWidgetType.PICTURE, props)}\n />\n );\n }\n return elementToshow;\n }\n\n public renderSkeleton(props: WmPictureProps){\n const imageWidth = this.state.imageWidth;\n const imageHeight = this.state.imageHeight;\n const shapeStyles = this.createShape(this.props.shape, imageWidth);\n const skeletonWidth = this.props.skeletonwidth || this.styles.root?.width || shapeStyles.root?.width || shapeStyles.picture?.width || imageWidth;\n const skeletonHeight = this.props.skeletonheight || this.styles.root?.height || shapeStyles.root?.height || shapeStyles.picture?.height || imageHeight;\n return createSkeleton(this.theme, this.styles.skeleton, {\n ...this.styles.root,\n borderRadius: this.props.shape == 'circle' && this.styles.root?.width ? 25 : shapeStyles.picture?.borderRadius || shapeStyles.root?.borderRadius || this.styles.root?.borderRadius || 4,\n width: skeletonWidth as DimensionValue,\n height: skeletonHeight as DimensionValue\n });\n }\n\n renderWidget(props: WmPictureProps) {\n const imageWidth = this.state.imageWidth;\n const imageHeight = this.state.imageHeight;\n const shapeStyles = this.createShape(props.shape, imageWidth);\n this._pictureSource = this._pictureSource || this.loadImage(props.picturesource);\n this._picturePlaceHolder = this._picturePlaceHolder || this.loadImage(props.pictureplaceholder);\n const imgSrc: any = this._pictureSource || this._picturePlaceHolder;\n let elementToshow;\n if (imgSrc) {\n elementToshow = this.getElementToShow(props, imgSrc, shapeStyles);\n }\n return imgSrc && (this.state.naturalImageWidth || props.isSvg) ? (\n <View style={[{\n width: imageWidth,\n height: imageHeight\n }, this.styles.root, shapeStyles.root, shapeStyles.picture]}>\n {this._background}\n <View style={[{overflow: 'hidden', width: '100%',\n height: '100%'}]} onLayout={this.onViewLayoutChange}>\n <Tappable\n {...this.getTestPropsForAction()}\n rippleColor={this.styles.root.rippleColor}\n target={this} styles={{width: imageWidth ? null : '100%', height: imageHeight ? null : '100%'}}>\n <Animatedview entryanimation={props.animation} delay={props.animationdelay} style={[{\n height: imageHeight,\n width: imageWidth,\n borderRadius: shapeStyles.picture?.borderRadius\n }]}>\n {this.state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,IAAI,CAACE,MAAM,CAACC,IAAI,EAAEgC,WAAW,CAAChC,IAAI,EAAEgC,WAAW,CAACN,OAAO;IAAE,GACzD,IAAI,CAACuC,WAAW,eACnB9F,KAAA,CAAAkE,aAAA,CAAChE,IAAI;MAACoE,KAAK,EAAE,CAAC;QAACyB,QAAQ,EAAE,QAAQ;QAAEtE,KAAK,EAAE,MAAM;QAC9CE,MAAM,EAAE;MAAM,CAAC,CAAE;MAACqE,QAAQ,EAAE,IAAI,CAACC;IAAmB,gBACpDjG,KAAA,CAAAkE,aAAA,CAAC9D,QAAQ,EAAAgE,QAAA,KACH,IAAI,CAAC8B,qBAAqB,CAAC,CAAC;MAChCC,WAAW,EAAE,IAAI,CAACvE,MAAM,CAACC,IAAI,CAACsE,WAAY;MAC1CC,MAAM,EAAE,IAAK;MAACxE,MAAM,EAAE;QAACH,KAAK,EAAEH,UAAU,GAAG,IAAI,GAAG,MAAM;QAAEK,MAAM,EAAED,WAAW,GAAG,IAAI,GAAG;MAAM;IAAE,iBAC/F1B,KAAA,CAAAkE,aAAA,CAACrD,YAAY;MAACwF,cAAc,EAAEjF,KAAK,CAACkF,SAAU;MAACC,KAAK,EAAEnF,KAAK,CAACoF,cAAe;MAAClC,KAAK,EAAE,CAAC;QAC9E3C,MAAM,EAAED,WAAW;QACnBD,KAAK,EAAEH,UAAU;QACjBkC,YAAY,GAAAkC,qBAAA,GAAE7B,WAAW,CAACN,OAAO,cAAAmC,qBAAA,uBAAnBA,qBAAA,CAAqBlC;MACrC,CAAC;IAAE,GACF,IAAI,CAACzB,KAAK,CAACT,UAAU,GAAGwC,aAAa,GAAG,IAC7B,CACN,CACN,CACF,CAAC,GACN,IAAI;EACT;AACF","ignoreList":[]}
|
@@ -29,7 +29,7 @@ export default class WmProgressBar extends BaseComponent {
|
|
29
29
|
const valuePercent = `${Math.round(value * 100)}%`;
|
30
30
|
return /*#__PURE__*/React.createElement(View, {
|
31
31
|
style: styles.root
|
32
|
-
}, this._background, /*#__PURE__*/React.createElement(Tappable,
|
32
|
+
}, this._background, /*#__PURE__*/React.createElement(Tappable, {
|
33
33
|
target: this,
|
34
34
|
styles: {
|
35
35
|
root: {
|
@@ -37,7 +37,7 @@ export default class WmProgressBar extends BaseComponent {
|
|
37
37
|
height: '100%'
|
38
38
|
}
|
39
39
|
}
|
40
|
-
}
|
40
|
+
}, /*#__PURE__*/React.createElement(ProgressBar, _extends({}, this.getTestPropsForAction('progressbar'), getAccessibilityProps(AccessibilityWidgetType.PROGRESSBAR, props), {
|
41
41
|
progress: value,
|
42
42
|
color: styles.progressValue.color,
|
43
43
|
style: [styles.progressBar, {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["React","View","ProgressBar","LinearGradient","ExpoLinearGradient","Tappable","BaseComponent","BaseComponentState","AccessibilityWidgetType","getAccessibilityProps","WmProgressBarProps","DEFAULT_CLASS","parseLinearGradient","WmProgressBarState","WmProgressBar","constructor","props","renderWidget","_styles$root","_styles$progressBar","value","datavalue","minvalue","maxvalue","styles","theme","mergeStyle","getStyle","type","hasLinearGradient","color1","color2","start","end","root","progressBar","backgroundColor","gradientColors","valuePercent","Math","round","createElement","style","_background","
|
1
|
+
{"version":3,"names":["React","View","ProgressBar","LinearGradient","ExpoLinearGradient","Tappable","BaseComponent","BaseComponentState","AccessibilityWidgetType","getAccessibilityProps","WmProgressBarProps","DEFAULT_CLASS","parseLinearGradient","WmProgressBarState","WmProgressBar","constructor","props","renderWidget","_styles$root","_styles$progressBar","value","datavalue","minvalue","maxvalue","styles","theme","mergeStyle","getStyle","type","hasLinearGradient","color1","color2","start","end","root","progressBar","backgroundColor","gradientColors","valuePercent","Math","round","createElement","style","_background","target","width","height","_extends","getTestPropsForAction","PROGRESSBAR","progress","color","progressValue","colors","position","borderRadius","Fragment"],"sources":["progress-bar.component.tsx"],"sourcesContent":["import React from 'react';\nimport { View } from 'react-native';\nimport { ProgressBar } from 'react-native-paper';\nimport { LinearGradient as ExpoLinearGradient } from 'expo-linear-gradient';\nimport { Tappable } from '@wavemaker/app-rn-runtime/core/tappable.component';\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\nimport { AccessibilityWidgetType, getAccessibilityProps } from '@wavemaker/app-rn-runtime/core/accessibility';\n\nimport WmProgressBarProps from './progress-bar.props';\nimport { DEFAULT_CLASS, WmProgressBarStyles } from './progress-bar.styles';\nimport { parseLinearGradient } from '@wavemaker/app-rn-runtime/core/utils';\n\nexport class WmProgressBarState extends BaseComponentState<WmProgressBarProps> {}\n\nexport default class WmProgressBar extends BaseComponent<WmProgressBarProps, WmProgressBarState, WmProgressBarStyles> {\n\n constructor(props: WmProgressBarProps) {\n super(props, DEFAULT_CLASS, new WmProgressBarProps());\n }\n\n renderWidget(props: WmProgressBarProps) {\n let value = (props.datavalue - props.minvalue) / (props.maxvalue - props.minvalue);\n const styles = this.theme.mergeStyle(this.theme.getStyle(`app-${props.type}-progress-bar`), this.styles);\n const {hasLinearGradient, color1, color2, start, end} = parseLinearGradient(styles?.root?.progressBar?.backgroundColor as string);\n const gradientColors = [color1, color2];\n const valuePercent = `${Math.round(value * 100)}%`;\n\n return (\n <View style={styles.root}>\n {this._background}\n <Tappable target={this} styles={{root:{width: '100%', height: '100%'}}}>\n <ProgressBar\n {...this.getTestPropsForAction('progressbar')}\n {...getAccessibilityProps(AccessibilityWidgetType.PROGRESSBAR, props)}\n progress={value}\n color={styles.progressValue.color}\n style={[styles.progressBar, {height: styles.root.height || styles.progressBar.height}]}></ProgressBar>\n {hasLinearGradient ? (\n <ExpoLinearGradient\n colors={gradientColors}\n start={start}\n end={end}\n style={[\n {\n width: valuePercent as any,\n height: styles.root.height || styles.progressBar.height,\n position: 'absolute',\n borderRadius: styles?.progressBar?.borderRadius || 0,\n },\n ]}\n />\n ) : (\n <></>\n )}\n </Tappable>\n </View>); \n }\n\n}\n"],"mappings":";AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,QAAQ,cAAc;AACnC,SA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;MACrD,CAAC;IACD,CACH,CAAC,gBAEFvD,KAAA,CAAAyC,aAAA,CAAAzC,KAAA,CAAAwD,QAAA,MAAI,CAEA,CACN,CAAC;EACT;AAEF","ignoreList":[]}
|
@@ -46,7 +46,7 @@ export default class WmProgressCircle extends BaseComponent {
|
|
46
46
|
return /*#__PURE__*/React.createElement(View, _extends({
|
47
47
|
style: styles.root,
|
48
48
|
onLayout: this.onLayout.bind(this)
|
49
|
-
}, getAccessibilityProps(AccessibilityWidgetType.PROGRESSCIRCLE, props)), this._background, /*#__PURE__*/React.createElement(Tappable,
|
49
|
+
}, getAccessibilityProps(AccessibilityWidgetType.PROGRESSCIRCLE, props), this.getTestPropsForAction('progresscircle')), this._background, /*#__PURE__*/React.createElement(Tappable, {
|
50
50
|
target: this,
|
51
51
|
styles: {
|
52
52
|
root: {
|
@@ -54,7 +54,7 @@ export default class WmProgressCircle extends BaseComponent {
|
|
54
54
|
height: '100%'
|
55
55
|
}
|
56
56
|
}
|
57
|
-
}
|
57
|
+
}, /*#__PURE__*/React.createElement(AnimatedCircularProgress, {
|
58
58
|
fill: value,
|
59
59
|
width: styles.progressValue.height,
|
60
60
|
backgroundWidth: styles.progressValue.height,
|
@@ -67,11 +67,11 @@ export default class WmProgressCircle extends BaseComponent {
|
|
67
67
|
style: {
|
68
68
|
alignItems: 'center'
|
69
69
|
}
|
70
|
-
}, /*#__PURE__*/React.createElement(Text, {
|
70
|
+
}, /*#__PURE__*/React.createElement(Text, _extends({
|
71
71
|
style: styles.text
|
72
|
-
}, showText ? props.title || value : ''), showText && props.subtitle ? /*#__PURE__*/React.createElement(Text, {
|
72
|
+
}, this.getTestPropsForLabel('title')), showText ? props.title || value : ''), showText && props.subtitle ? /*#__PURE__*/React.createElement(Text, _extends({
|
73
73
|
style: styles.subTitle
|
74
|
-
}, props.subtitle) : null))));
|
74
|
+
}, this.getTestPropsForLabel('subtitle')), props.subtitle) : null))));
|
75
75
|
}
|
76
76
|
}
|
77
77
|
//# sourceMappingURL=progress-circle.component.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["React","View","Text","isNumber","AnimatedCircularProgress","Tappable","BaseComponent","BaseComponentState","AccessibilityWidgetType","getAccessibilityProps","WmProgressCircleProps","DEFAULT_CLASS","WmProgressCircleState","constructor","args","_defineProperty","WmProgressCircle","props","onLayout","e","width","nativeEvent","layout","height","radius","state","Math","min","updateState","renderWidget","value","datavalue","minvalue","maxvalue","styles","theme","mergeStyle","getStyle","type","showText","captionplacement","createElement","_extends","style","root","bind","PROGRESSCIRCLE","
|
1
|
+
{"version":3,"names":["React","View","Text","isNumber","AnimatedCircularProgress","Tappable","BaseComponent","BaseComponentState","AccessibilityWidgetType","getAccessibilityProps","WmProgressCircleProps","DEFAULT_CLASS","WmProgressCircleState","constructor","args","_defineProperty","WmProgressCircle","props","onLayout","e","width","nativeEvent","layout","height","radius","state","Math","min","updateState","renderWidget","value","datavalue","minvalue","maxvalue","styles","theme","mergeStyle","getStyle","type","showText","captionplacement","createElement","_extends","style","root","bind","PROGRESSCIRCLE","getTestPropsForAction","_background","target","fill","progressValue","backgroundWidth","rotation","tintColor","backgroundColor","lineCap","buttStyle","progressCircle","size","alignItems","text","getTestPropsForLabel","title","subtitle","subTitle"],"sources":["progress-circle.component.tsx"],"sourcesContent":["import React from 'react';\nimport { LayoutChangeEvent, View, Text } from 'react-native';\nimport { isNumber } from 'lodash';\nimport { AnimatedCircularProgress } from 'react-native-circular-progress';\nimport { Tappable } from '@wavemaker/app-rn-runtime/core/tappable.component';\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\nimport { AccessibilityWidgetType, getAccessibilityProps } from '@wavemaker/app-rn-runtime/core/accessibility';\n\nimport WmProgressCircleProps from './progress-circle.props';\nimport { DEFAULT_CLASS, WmProgressCircleStyles } from './progress-circle.styles';\n\n\nexport class WmProgressCircleState extends BaseComponentState<WmProgressCircleProps> {\n radius = 10;\n}\n\nexport default class WmProgressCircle extends BaseComponent<WmProgressCircleProps, WmProgressCircleState, WmProgressCircleStyles> {\n\n constructor(props: WmProgressCircleProps) {\n super(props, DEFAULT_CLASS, new WmProgressCircleProps(), new WmProgressCircleState());\n }\n\n onLayout(e: LayoutChangeEvent) {\n const width = e.nativeEvent.layout.width;\n const height = e.nativeEvent.layout.height;\n let radius = this.state.radius;\n if (!width) {\n radius = height;\n } else if (!height) {\n radius = width;\n } else {\n radius = Math.min(width, height);\n }\n this.updateState({\n radius: radius\n } as WmProgressCircleState);\n }\n\n renderWidget(props: WmProgressCircleProps) {\n let value = 0;\n if (isNumber(props.datavalue) && isNumber(props.minvalue) && isNumber(props.maxvalue)) {\n value = (+props.datavalue - (+props.minvalue)) / (+props.maxvalue - (+props.minvalue)) * 100;\n }\n const styles = this.theme.mergeStyle(this.theme.getStyle(`app-${props.type}-progress-circle`), this.styles);\n const showText = props.captionplacement !== 'hidden';\n return (\n <View style={styles.root} onLayout={this.onLayout.bind(this)} {...getAccessibilityProps(AccessibilityWidgetType.PROGRESSCIRCLE, props)} {...this.getTestPropsForAction('progresscircle')}>\n {this._background}\n <Tappable target={this} styles={{root:{width: '100%', height: '100%'}}}>\n <AnimatedCircularProgress\n fill={value}\n width={styles.progressValue.height}\n backgroundWidth={styles.progressValue.height}\n rotation={0}\n tintColor={styles.progressValue.backgroundColor}\n lineCap={styles.progressValue.buttStyle || \"butt\"}\n backgroundColor={styles.progressCircle.backgroundColor}\n size={this.state.radius}>\n {(fill) => (<View style={{alignItems: 'center'}}>\n <Text style={styles.text} {...this.getTestPropsForLabel('title')}>{ showText ? props.title || value : '' }</Text>\n {showText && props.subtitle ? (<Text style={styles.subTitle} {...this.getTestPropsForLabel('subtitle')}>{ props.subtitle }</Text>) : null}\n </View>)} \n </AnimatedCircularProgress>\n </Tappable>\n </View>); \n }\n}\n"],"mappings":";;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAA4BC,IAAI,EAAEC,IAAI,QAAQ,cAAc;AAC5D,SAASC,Q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