@wavemaker/app-rn-runtime 12.0.0-next.45031 → 12.0.0-next.45501
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","View","TouchableOpacity","BaseComponent","BaseComponentState","WmAnchor","WmIcon","WmNavItemProps","DEFAULT_CLASS","AccessibilityWidgetType","getAccessibilityProps","WmNavItemState","constructor","args","_defineProperty","WmNavItem","props","onSelectItem","cb","$item","$event","data","renderWidget","getDisplayLabel","getDisplayExpression","label","child","children","view","createElement","_extends","id","getTestId","NAV","styles","navAnchorItem","caption","item","hyperlink","link","badgevalue","badge","iconclass","icon","onTap","bind","onSelect","Fragment","onPress","updateState","collapsed","state","style","dropdownNav","caretIcon","root","_background"],"sources":["navitem.component.tsx"],"sourcesContent":["import React from 'react';\nimport { View, TouchableOpacity } from 'react-native';\n\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\nimport WmAnchor from '@wavemaker/app-rn-runtime/components/basic/anchor/anchor.component';\nimport WmIcon from '@wavemaker/app-rn-runtime/components/basic/icon/icon.component';\n\nimport WmNavItemProps from './navitem.props';\nimport { DEFAULT_CLASS, WmNavItemStyles } from './navitem.styles';\nimport { NavigationDataItem } from \"@wavemaker/app-rn-runtime/components/navigation/basenav/basenav.component\";\nimport { SyntheticEvent } from \"@wavemaker/app-rn-runtime/core/tappable.component\";\nimport { AccessibilityWidgetType, getAccessibilityProps } from '@wavemaker/app-rn-runtime/core/accessibility'; \n\nexport class WmNavItemState extends BaseComponentState<WmNavItemProps> {\n collapsed = true;\n}\n\nexport default class WmNavItem extends BaseComponent<WmNavItemProps, WmNavItemState, WmNavItemStyles> {\n\n constructor(props: WmNavItemProps) {\n super(props, DEFAULT_CLASS, new WmNavItemProps(), new WmNavItemState());\n }\n\n onSelectItem(cb: any, $item: NavigationDataItem, $event: SyntheticEvent) {\n cb && cb($event, this, $item?.data);\n }\n\n renderWidget(props: WmNavItemProps) {\n const getDisplayLabel = this.props.getDisplayExpression || ((label: string) => label);\n let child = props.children;\n if (props.view === 'anchor') {\n child = (\n <WmAnchor\n id={this.getTestId('navlink')}\n {...getAccessibilityProps(AccessibilityWidgetType.NAV, props)}\n styles={this.styles.navAnchorItem}\n caption={getDisplayLabel(props.item.label)}\n hyperlink={props.item.link}\n badgevalue={props.item.badge}\n iconclass={props.item.icon}\n onTap={this.onSelectItem.bind(this, props.onSelect, props.item)}\n ></WmAnchor>\n );\n }\n if (props.view === 'dropdown') {\n child = (\n <>\n <TouchableOpacity \n
|
1
|
+
{"version":3,"names":["React","View","TouchableOpacity","BaseComponent","BaseComponentState","WmAnchor","WmIcon","WmNavItemProps","DEFAULT_CLASS","AccessibilityWidgetType","getAccessibilityProps","WmNavItemState","constructor","args","_defineProperty","WmNavItem","props","onSelectItem","cb","$item","$event","data","renderWidget","getDisplayLabel","getDisplayExpression","label","child","children","view","createElement","_extends","id","getTestId","NAV","styles","navAnchorItem","caption","item","hyperlink","link","badgevalue","badge","iconclass","icon","onTap","bind","onSelect","Fragment","getTestPropsForAction","onPress","updateState","collapsed","state","style","dropdownNav","caretIcon","root","_background"],"sources":["navitem.component.tsx"],"sourcesContent":["import React from 'react';\nimport { View, TouchableOpacity } from 'react-native';\n\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\nimport WmAnchor from '@wavemaker/app-rn-runtime/components/basic/anchor/anchor.component';\nimport WmIcon from '@wavemaker/app-rn-runtime/components/basic/icon/icon.component';\n\nimport WmNavItemProps from './navitem.props';\nimport { DEFAULT_CLASS, WmNavItemStyles } from './navitem.styles';\nimport { NavigationDataItem } from \"@wavemaker/app-rn-runtime/components/navigation/basenav/basenav.component\";\nimport { SyntheticEvent } from \"@wavemaker/app-rn-runtime/core/tappable.component\";\nimport { AccessibilityWidgetType, getAccessibilityProps } from '@wavemaker/app-rn-runtime/core/accessibility'; \n\nexport class WmNavItemState extends BaseComponentState<WmNavItemProps> {\n collapsed = true;\n}\n\nexport default class WmNavItem extends BaseComponent<WmNavItemProps, WmNavItemState, WmNavItemStyles> {\n\n constructor(props: WmNavItemProps) {\n super(props, DEFAULT_CLASS, new WmNavItemProps(), new WmNavItemState());\n }\n\n onSelectItem(cb: any, $item: NavigationDataItem, $event: SyntheticEvent) {\n cb && cb($event, this, $item?.data);\n }\n\n renderWidget(props: WmNavItemProps) {\n const getDisplayLabel = this.props.getDisplayExpression || ((label: string) => label);\n let child = props.children;\n if (props.view === 'anchor') {\n child = (\n <WmAnchor\n id={this.getTestId('navlink')}\n {...getAccessibilityProps(AccessibilityWidgetType.NAV, props)}\n styles={this.styles.navAnchorItem}\n caption={getDisplayLabel(props.item.label)}\n hyperlink={props.item.link}\n badgevalue={props.item.badge}\n iconclass={props.item.icon}\n onTap={this.onSelectItem.bind(this, props.onSelect, props.item)}\n ></WmAnchor>\n );\n }\n if (props.view === 'dropdown') {\n child = (\n <>\n <TouchableOpacity \n {...this.getTestPropsForAction('navitem')}\n onPress={() => {\n this.updateState({collapsed: !this.state.collapsed} as WmNavItemState);\n }}>\n <View style={this.styles.dropdownNav}>\n <WmAnchor id={this.getTestId('navlink')} styles={this.styles.navAnchorItem} caption={getDisplayLabel(props.item.label)} iconclass={props.item.icon} onTap={this.onSelectItem.bind(this, props.onSelect, props.item)} {...getAccessibilityProps(AccessibilityWidgetType.NAV, props)}></WmAnchor>\n <WmIcon id={this.getTestId('icon')} styles={this.styles.caretIcon} iconclass={this.state.collapsed ? 'fa fa-sort-down' : 'fa fa-sort-up'}></WmIcon>\n </View>\n </TouchableOpacity>\n {!this.state.collapsed && props.children}\n </>\n );\n }\n return (\n <View style={this.styles.root}>{this._background}{child}</View>\n );\n }\n}\n"],"mappings":";;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,EAAEC,gBAAgB,QAAQ,cAAc;AAErD,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,+CAA+C;AACjG,OAAOC,QAAQ,MAAM,oEAAoE;AACzF,OAAOC,MAAM,MAAM,gEAAgE;AAEnF,OAAOC,cAAc,MAAM,iBAAiB;AAC5C,SAASC,aAAa,QAAyB,kBAAkB;AAGjE,SAASC,uBAAuB,EAAEC,qBAAqB,QAAQ,8CAA8C;AAE7G,OAAO,MAAMC,cAAc,SAASP,kBAAkB,CAAiB;EAAAQ,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAC,eAAA,oBACzD,IAAI;EAAA;AAClB;AAEA,eAAe,MAAMC,SAAS,SAASZ,aAAa,CAAkD;EAEpGS,WAAWA,CAACI,KAAqB,EAAE;IACjC,KAAK,CAACA,KAAK,EAAER,aAAa,EAAE,IAAID,cAAc,CAAC,CAAC,EAAE,IAAII,cAAc,CAAC,CAAC,CAAC;EACzE;EAEAM,YAAYA,CAACC,EAAO,EAAEC,KAAyB,EAAEC,MAAsB,EAAE;IACvEF,EAAE,IAAIA,EAAE,CAACE,MAAM,EAAE,IAAI,EAAED,KAAK,aAALA,KAAK,uBAALA,KAAK,CAAEE,IAAI,CAAC;EACrC;EAEAC,YAAYA,CAACN,KAAqB,EAAE;IAClC,MAAMO,eAAe,GAAG,IAAI,CAACP,KAAK,CAACQ,oBAAoB,KAAMC,KAAa,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A,CAACxB,QAAQ,EAAAyB,QAAA;QAACC,EAAE,EAAE,IAAI,CAACC,SAAS,CAAC,SAAS,CAAE;QAACE,MAAM,EAAE,IAAI,CAACA,MAAM,CAACC,aAAc;QAACC,OAAO,EAAEb,eAAe,CAACP,KAAK,CAACqB,IAAI,CAACZ,KAAK,CAAE;QAACiB,SAAS,EAAE1B,KAAK,CAACqB,IAAI,CAACM,IAAK;QAACC,KAAK,EAAE,IAAI,CAAC3B,YAAY,CAAC4B,IAAI,CAAC,IAAI,EAAE7B,KAAK,CAAC8B,QAAQ,EAAE9B,KAAK,CAACqB,IAAI;MAAE,GAAK3B,qBAAqB,CAACD,uBAAuB,CAACwB,GAAG,EAAEjB,KAAK,CAAC,CAAY,CAAC,eAC/RhB,KAAA,CAAA6B,aAAA,CAACvB,MAAM;QAACyB,EAAE,EAAE,IAAI,CAACC,SAAS,CAAC,MAAM,CAAE;QAACE,MAAM,EAAE,IAAI,CAACA,MAAM,CAACqB,SAAU;QAACb,SAAS,EAAE,IAAI,CAACU,KAAK,CAACD,SAAS,GAAG,iBAAiB,GAAG;MAAgB,CAAS,CAC9I,CACU,CAAC,EAClB,CAAC,IAAI,CAACC,KAAK,CAACD,SAAS,IAAInC,KAAK,CAACW,QAC9B,CACH;IACH;IACA,oBACE3B,KAAA,CAAA6B,aAAA,CAAC5B,IAAI;MAACoD,KAAK,EAAE,IAAI,CAACnB,MAAM,CAACsB;IAAK,GAAE,IAAI,CAACC,WAAW,EAAE/B,KAAY,CAAC;EAEnE;AACF","ignoreList":[]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["React","isString","TouchableOpacity","Text","View","Dimensions","Animated","PanResponder","BaseComponent","BaseComponentState","ModalConsumer","WmAnchor","WmPopoverProps","DEFAULT_CLASS","WmContainer","AccessibilityWidgetType","getAccessibilityProps","ScrollView","GestureHandlerRootView","WmPopoverState","constructor","args","_defineProperty","WmPopover","props","Value","create","onStartShouldSetPanResponder","onMoveShouldSetPanResponder","onPanResponderMove","_","gestureState","dy","Number","styles","popover","minHeight","dragY","setValue","onPanResponderRelease","timing","toValue","maxHeight","duration","useNativeDriver","start","e","position","state","type","windowDimensions","get","view","measure","x","y","width","height","px","py","popoverwidth","parseInt","left","top","updateState","isOpened","invokeEventCallback","stopPropagation","autoopen","showPopover","getDefaultStyles","isActionSheet","theme","getStyle","defaultClass","renderPopoverContent","dimensions","createElement","style","mergeStyle","onScroll","event","notify","scrollEventThrottle","accessible","accessibilityViewIsModal","title","_extends","getTestPropsForAction","activeOpacity","onPress","autoclose","hide","popoverContent","root","onLoad","renderPartial","p","children","onPropertyChange","name","$new","$old","prepareModalOptions","content","modalService","o","modalOptions","modalStyle","modal","contentStyle","modalContent","isModal","centered","animation","contentanimation","onClose","setState","isPartialLoaded","hideModal","renderWidget","popoverheight","onLayout","computePosition","ref","POVOVER","_background","id","getTestId","caption","badgevalue","iconclass","iconposition","iconheight","iconwidth","iconmargin","iconurl","link","onTap","showModal","panResponder","panHandlers"],"sources":["popover.component.tsx"],"sourcesContent":["import React from 'react';\nimport { isString } from 'lodash-es';\nimport { LayoutChangeEvent, TouchableOpacity, Text, View, Dimensions, Animated, PanResponder } from 'react-native';\nimport { BaseComponent, BaseComponentState, BaseProps } from '@wavemaker/app-rn-runtime/core/base.component';\n\nimport { SyntheticEvent } from '@wavemaker/app-rn-runtime/core/tappable.component';\nimport { ModalConsumer, ModalOptions, ModalService } from '@wavemaker/app-rn-runtime/core/modal.service';\nimport WmAnchor from '@wavemaker/app-rn-runtime/components/basic/anchor/anchor.component';\n\nimport WmPopoverProps from './popover.props';\nimport { DEFAULT_CLASS, WmPopoverStyles } from './popover.styles';\nimport WmContainer from '../../container/container.component';\nimport { AccessibilityWidgetType, getAccessibilityProps } from '@wavemaker/app-rn-runtime/core/accessibility'; \nimport { ScrollView, GestureHandlerRootView } from 'react-native-gesture-handler';\n\nexport class WmPopoverState extends BaseComponentState<WmPopoverProps> {\n isOpened: boolean = false;\n modalOptions = {} as ModalOptions;\n position = {} as PopoverPosition;\n isPartialLoaded = false;\n}\n\nexport interface PopoverPosition {\n top?: number;\n bottom?: number;\n left?: number;\n right?: number;\n}\n\nexport default class WmPopover extends BaseComponent<WmPopoverProps, WmPopoverState, WmPopoverStyles> {\n\n view: View = null as any;\n dragY = new Animated.Value(0);\n\n constructor(props: WmPopoverProps) {\n super(props, DEFAULT_CLASS, new WmPopoverProps(), new WmPopoverState());\n\n if (this.state.props.autoopen) {\n this.showPopover(); \n }\n }\n\n public panResponder = PanResponder.create({\n onStartShouldSetPanResponder: () => true,\n onMoveShouldSetPanResponder: () => true,\n onPanResponderMove: (_, gestureState) => {\n if (gestureState.dy > 0 && gestureState.dy < Number(this.styles.popover.minHeight)) {\n this.dragY.setValue(Number(this.styles.popover.minHeight) - gestureState.dy);\n }\n },\n onPanResponderRelease: (_, gestureState) => {\n if (gestureState.dy < -50) {\n Animated.timing(this.dragY, {\n toValue: Number(this.styles.popover.maxHeight),\n duration: 500,\n useNativeDriver: false,\n }).start();\n } else {\n Animated.timing(this.dragY, {\n toValue: Number(this.styles.popover.minHeight),\n duration: 500,\n useNativeDriver: false,\n }).start();\n }\n },\n });\n \n getDefaultStyles() {\n const isActionSheet = this.state.props.type === 'action-sheet';\n return this.theme.getStyle(`${this.defaultClass} ${isActionSheet ? 'app-popover-action-sheet' : ''}`);\n }\n\n private computePosition = (e: LayoutChangeEvent) => {\n const position = {} as PopoverPosition;\n if (this.state.props.type === 'dropdown') {\n const windowDimensions = Dimensions.get('window');\n this.view.measure((x, y, width, height, px, py) => {\n let popoverwidth = this.state.props.popoverwidth as any;\n if (popoverwidth && isString(popoverwidth)) {\n popoverwidth = parseInt(popoverwidth);\n }\n position.left = px;\n if (px + popoverwidth > windowDimensions.width) {\n position.left = px + width - popoverwidth;\n }\n position.top = py + height;\n this.updateState({position: position} as WmPopoverState);\n });\n }\n };\n\n public renderPopoverContent (props : WmPopoverProps , styles : WmPopoverStyles, dimensions: any) {\n return (\n <ScrollView style={props.type === \"action-sheet\" ? {dimensions} : this.theme.mergeStyle(styles.popover, dimensions)} \n onScroll={(event) => {this.notify('scroll', [event])}}\n scrollEventThrottle={48}\n accessible={props.type !== \"dropdown\"} accessibilityViewIsModal>\n {props.title ? (<Text style={styles.title}>{props.title}</Text>): null}\n <TouchableOpacity \n {...this.getTestPropsForAction('outercontent')}\n activeOpacity={1} onPress={() => {\n props.autoclose === 'always' && this.hide()\n }} style={styles.popoverContent.root}>\n <WmContainer\n styles={styles.popoverContent}\n onLoad={() => this.invokeEventCallback('onLoad', [this])}\n {... props.renderPartial ? {\n renderPartial : (p: any, onLoad: Function) => {\n return props.renderPartial && props.renderPartial(props, onLoad);\n }\n } : {}}>\n {props.renderPartial ? null : props.children}\n </WmContainer>\n </TouchableOpacity>\n </ScrollView>\n )}\n\n public showPopover = (e?: SyntheticEvent) => {\n this.updateState({ isOpened: true } as WmPopoverState);\n this.invokeEventCallback('onShow', [e, this]);\n e?.stopPropagation();\n };\n\n public onPropertyChange(name: string, $new: any, $old: any): void {\n super.onPropertyChange(name, $new, $old);\n switch(name) {\n case \"autoopen\":\n if($new){\n this.showPopover && this.showPopover()\n }\n else{\n this.hide && this.hide()\n }\n }\n }\n\n\n public hide = () => {};\n\n prepareModalOptions(content: React.ReactNode, styles: WmPopoverStyles, modalService: ModalService) {\n const o = this.state.modalOptions;\n o.modalStyle = styles.modal;\n o.contentStyle = {...styles.modalContent, ...this.state.position};\n o.content = content;\n o.isModal = this.state.props.autoclose !== 'disabled';\n o.centered = true;\n o.animation = this.state.props.contentanimation || 'slideInUp';\n o.onClose = () => {\n this.hide = () => {};\n this.setState({ isOpened: false, isPartialLoaded: false, modalOptions: {} as ModalOptions });\n this.invokeEventCallback('onHide', [null, this]);\n };\n this.hide = () => modalService.hideModal(this.state.modalOptions);\n return o;\n }\n\n renderWidget(props: WmPopoverProps) {\n let dimensions = {} as any;\n const styles = this.theme.mergeStyle(this.theme.getStyle('popover-' + props.type), this.styles);\n if (props.type === 'dropdown') {\n if (props.popoverwidth) {\n dimensions.width = props.popoverwidth;\n styles.modalContent.width = props.popoverwidth;\n }\n if (props.popoverheight) {\n dimensions.height = props.popoverheight;\n }\n }\n return (\n <View style={styles.root} onLayout={this.computePosition} ref={ref => {this.view = ref as View}} {...getAccessibilityProps(AccessibilityWidgetType.POVOVER, props)}>\n {this._background}\n <WmAnchor\n id={this.getTestId('trigger')}\n animation={props.animation}\n caption={props.caption}\n badgevalue={props.badgevalue}\n iconclass={props.iconclass}\n iconposition={props.iconposition}\n iconheight={props.iconheight}\n iconwidth={props.iconwidth}\n iconmargin={props.iconmargin}\n iconurl={props.iconurl}\n styles={styles.link}\n onTap={this.showPopover}/>\n {this.state.isOpened ? (\n <ModalConsumer>\n {(modalService: ModalService) => {\n modalService.showModal(this.prepareModalOptions(props.type === 'action-sheet' ? (\n <Animated.View style= {[styles.popover,{ height: this.dragY }]} {...this.panResponder.panHandlers}>\n <GestureHandlerRootView>\n {this.renderPopoverContent(props, styles, dimensions)}\n </GestureHandlerRootView>\n </Animated.View>\n ): (this.renderPopoverContent(props, styles, dimensions)), styles, modalService));\n return null;\n }}\n </ModalConsumer>) : null}\n </View>);\n }\n}\n"],"mappings":";;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,QAAQ,QAAQ,WAAW;AACpC,SAA4BC,gBAAgB,EAAEC,IAAI,EAAEC,IAAI,EAAEC,UAAU,EAAEC,QAAQ,EAAEC,YAAY,QAAQ,cAAc;AAClH,SAASC,aAAa,EAAEC,kBAAkB,QAAmB,+CAA+C;AAG5G,SAASC,aAAa,QAAoC,8CAA8C;AACxG,OAAOC,QAAQ,MAAM,oEAAoE;AAEzF,OAAOC,cAAc,MAAM,iBAAiB;AAC5C,SAASC,aAAa,QAAyB,kBAAkB;AACjE,OAAOC,WAAW,MAAM,qCAAqC;AAC7D,SAASC,uBAAuB,EAAEC,qBAAqB,QAAQ,8CAA8C;AAC7G,SAASC,UAAU,EAAEC,sBAAsB,QAAQ,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MACpBC,KAAK,EAAE,IAAI,CAACrE;IAAY,CAAC,CAAC,EAC3B,IAAI,CAACrB,KAAK,CAACiB,QAAQ,gBAClBjE,KAAA,CAAA6E,aAAA,CAACnE,aAAa,QACV+F,YAA0B,IAAK;MAC/BA,YAAY,CAACkC,SAAS,CAAC,IAAI,CAACpC,mBAAmB,CAAC/E,KAAK,CAACyB,IAAI,KAAK,cAAc,gBAC3EjD,KAAA,CAAA6E,aAAA,CAACvE,QAAQ,CAACF,IAAI,EAAAmF,QAAA;QAACT,KAAK,EAAG,CAAC5C,MAAM,CAACC,OAAO,EAAC;UAAEsB,MAAM,EAAE,IAAI,CAACpB;QAAM,CAAC;MAAE,GAAK,IAAI,CAACuG,YAAY,CAACC,WAAW,gBAC/F7I,KAAA,CAAA6E,aAAA,CAAC3D,sBAAsB,QACvB,IAAI,CAACyD,oBAAoB,CAACnD,KAAK,EAAEU,MAAM,EAAE0C,UAAU,CAC5B,CACR,CAAC,GAChB,IAAI,CAACD,oBAAoB,CAACnD,KAAK,EAAEU,MAAM,EAAE0C,UAAU,CAAE,EAAE1C,MAAM,EAAEuE,YAAY,CAAC,CAAC;MACjF,OAAO,IAAI;IACb,CACa,CAAC,GAAI,IAClB,CAAC;EACX;AACF","ignoreList":[]}
|
1
|
+
{"version":3,"names":["React","isString","TouchableOpacity","Text","View","Dimensions","Animated","PanResponder","BaseComponent","BaseComponentState","ModalConsumer","WmAnchor","WmPopoverProps","DEFAULT_CLASS","WmContainer","AccessibilityWidgetType","getAccessibilityProps","ScrollView","GestureHandlerRootView","WmPopoverState","constructor","args","_defineProperty","WmPopover","props","Value","create","onStartShouldSetPanResponder","onMoveShouldSetPanResponder","onPanResponderMove","_","gestureState","dy","Number","styles","popover","minHeight","dragY","setValue","onPanResponderRelease","timing","toValue","maxHeight","duration","useNativeDriver","start","e","position","state","type","windowDimensions","get","view","measure","x","y","width","height","px","py","popoverwidth","parseInt","left","top","updateState","isOpened","invokeEventCallback","stopPropagation","autoopen","showPopover","getDefaultStyles","isActionSheet","theme","getStyle","defaultClass","renderPopoverContent","dimensions","createElement","style","mergeStyle","onScroll","event","notify","scrollEventThrottle","accessible","accessibilityViewIsModal","title","_extends","getTestPropsForAction","activeOpacity","onPress","autoclose","hide","popoverContent","root","onLoad","renderPartial","p","children","onPropertyChange","name","$new","$old","prepareModalOptions","content","modalService","o","modalOptions","modalStyle","modal","contentStyle","modalContent","isModal","centered","animation","contentanimation","onClose","setState","isPartialLoaded","hideModal","renderWidget","popoverheight","onLayout","computePosition","ref","POVOVER","_background","id","getTestId","caption","badgevalue","iconclass","iconposition","iconheight","iconwidth","iconmargin","iconurl","link","onTap","showModal","panResponder","panHandlers"],"sources":["popover.component.tsx"],"sourcesContent":["import React from 'react';\nimport { isString } from 'lodash-es';\nimport { LayoutChangeEvent, TouchableOpacity, Text, View, Dimensions, Animated, PanResponder } from 'react-native';\nimport { BaseComponent, BaseComponentState, BaseProps } from '@wavemaker/app-rn-runtime/core/base.component';\n\nimport { SyntheticEvent } from '@wavemaker/app-rn-runtime/core/tappable.component';\nimport { ModalConsumer, ModalOptions, ModalService } from '@wavemaker/app-rn-runtime/core/modal.service';\nimport WmAnchor from '@wavemaker/app-rn-runtime/components/basic/anchor/anchor.component';\n\nimport WmPopoverProps from './popover.props';\nimport { DEFAULT_CLASS, WmPopoverStyles } from './popover.styles';\nimport WmContainer from '../../container/container.component';\nimport { AccessibilityWidgetType, getAccessibilityProps } from '@wavemaker/app-rn-runtime/core/accessibility'; \nimport { ScrollView, GestureHandlerRootView } from 'react-native-gesture-handler';\n\nexport class WmPopoverState extends BaseComponentState<WmPopoverProps> {\n isOpened: boolean = false;\n modalOptions = {} as ModalOptions;\n position = {} as PopoverPosition;\n isPartialLoaded = false;\n}\n\nexport interface PopoverPosition {\n top?: number;\n bottom?: number;\n left?: number;\n right?: number;\n}\n\nexport default class WmPopover extends BaseComponent<WmPopoverProps, WmPopoverState, WmPopoverStyles> {\n\n view: View = null as any;\n dragY = new Animated.Value(0);\n\n constructor(props: WmPopoverProps) {\n super(props, DEFAULT_CLASS, new WmPopoverProps(), new WmPopoverState());\n\n if (this.state.props.autoopen) {\n this.showPopover(); \n }\n }\n\n public panResponder = PanResponder.create({\n onStartShouldSetPanResponder: () => true,\n onMoveShouldSetPanResponder: () => true,\n onPanResponderMove: (_, gestureState) => {\n if (gestureState.dy > 0 && gestureState.dy < Number(this.styles.popover.minHeight)) {\n this.dragY.setValue(Number(this.styles.popover.minHeight) - gestureState.dy);\n }\n },\n onPanResponderRelease: (_, gestureState) => {\n if (gestureState.dy < -50) {\n Animated.timing(this.dragY, {\n toValue: Number(this.styles.popover.maxHeight),\n duration: 500,\n useNativeDriver: false,\n }).start();\n } else {\n Animated.timing(this.dragY, {\n toValue: Number(this.styles.popover.minHeight),\n duration: 500,\n useNativeDriver: false,\n }).start();\n }\n },\n });\n \n getDefaultStyles() {\n const isActionSheet = this.state.props.type === 'action-sheet';\n return this.theme.getStyle(`${this.defaultClass} ${isActionSheet ? 'app-popover-action-sheet' : ''}`);\n }\n\n private computePosition = (e: LayoutChangeEvent) => {\n const position = {} as PopoverPosition;\n if (this.state.props.type === 'dropdown') {\n const windowDimensions = Dimensions.get('window');\n this.view.measure((x, y, width, height, px, py) => {\n let popoverwidth = this.state.props.popoverwidth as any;\n if (popoverwidth && isString(popoverwidth)) {\n popoverwidth = parseInt(popoverwidth);\n }\n position.left = px;\n if (px + popoverwidth > windowDimensions.width) {\n position.left = px + width - popoverwidth;\n }\n position.top = py + height;\n this.updateState({position: position} as WmPopoverState);\n });\n }\n };\n\n public renderPopoverContent (props : WmPopoverProps , styles : WmPopoverStyles, dimensions: any) {\n return (\n <ScrollView style={props.type === \"action-sheet\" ? {dimensions} : this.theme.mergeStyle(styles.popover, dimensions)} \n onScroll={(event) => {this.notify('scroll', [event])}}\n scrollEventThrottle={48}\n accessible={props.type !== \"dropdown\"} accessibilityViewIsModal>\n {props.title ? (<Text style={styles.title}>{props.title}</Text>): null}\n <TouchableOpacity \n {...this.getTestPropsForAction('outercontent')}\n activeOpacity={1} onPress={() => {\n props.autoclose === 'always' && this.hide()\n }} style={styles.popoverContent.root}>\n <WmContainer\n styles={styles.popoverContent}\n onLoad={() => this.invokeEventCallback('onLoad', [this])}\n {... props.renderPartial ? {\n renderPartial : (p: any, onLoad: Function) => {\n return props.renderPartial && props.renderPartial(props, onLoad);\n }\n } : {}}>\n {props.renderPartial ? null : props.children}\n </WmContainer>\n </TouchableOpacity>\n </ScrollView>\n )}\n\n public showPopover = (e?: SyntheticEvent) => {\n this.updateState({ isOpened: true } as WmPopoverState);\n this.invokeEventCallback('onShow', [e, this]);\n e?.stopPropagation();\n };\n\n public onPropertyChange(name: string, $new: any, $old: any): void {\n super.onPropertyChange(name, $new, $old);\n switch(name) {\n case \"autoopen\":\n if($new){\n this.showPopover && this.showPopover()\n }\n else{\n this.hide && this.hide()\n }\n }\n }\n\n\n public hide = () => {};\n\n prepareModalOptions(content: React.ReactNode, styles: WmPopoverStyles, modalService: ModalService) {\n const o = this.state.modalOptions;\n o.modalStyle = styles.modal;\n o.contentStyle = {...styles.modalContent, ...this.state.position};\n o.content = content;\n o.isModal = this.state.props.autoclose !== 'disabled';\n o.centered = true;\n o.animation = this.state.props.contentanimation || 'slideInUp';\n o.onClose = () => {\n this.hide = () => {};\n this.setState({ isOpened: false, isPartialLoaded: false, modalOptions: {} as ModalOptions });\n this.invokeEventCallback('onHide', [null, this]);\n };\n this.hide = () => modalService.hideModal(this.state.modalOptions);\n return o;\n }\n\n renderWidget(props: WmPopoverProps) {\n let dimensions = {} as any;\n const styles = this.theme.mergeStyle(this.theme.getStyle('popover-' + props.type), this.styles);\n if (props.type === 'dropdown') {\n if (props.popoverwidth) {\n dimensions.width = props.popoverwidth;\n styles.modalContent.width = props.popoverwidth;\n }\n if (props.popoverheight) {\n dimensions.height = props.popoverheight;\n }\n }\n return (\n <View style={styles.root} onLayout={this.computePosition} ref={ref => {this.view = ref as View}} {...getAccessibilityProps(AccessibilityWidgetType.POVOVER, props)}>\n {this._background}\n <WmAnchor\n id={this.getTestId('trigger')}\n animation={props.animation}\n caption={props.caption}\n badgevalue={props.badgevalue}\n iconclass={props.iconclass}\n iconposition={props.iconposition}\n iconheight={props.iconheight}\n iconwidth={props.iconwidth}\n iconmargin={props.iconmargin}\n iconurl={props.iconurl}\n styles={styles.link}\n onTap={this.showPopover}/>\n {this.state.isOpened ? (\n <ModalConsumer>\n {(modalService: ModalService) => {\n modalService.showModal(this.prepareModalOptions(props.type === 'action-sheet' ? (\n <Animated.View style= {[styles.popover,{ height: this.dragY }]} {...this.panResponder.panHandlers}>\n <GestureHandlerRootView>\n {this.renderPopoverContent(props, styles, dimensions)}\n </GestureHandlerRootView>\n </Animated.View>\n ): (this.renderPopoverContent(props, styles, dimensions)), styles, modalService));\n return null;\n }}\n </ModalConsumer>) : null}\n </View>);\n }\n}\n"],"mappings":";;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,QAAQ,QAAQ,WAAW;AACpC,SAA4BC,gBAAgB,EAAEC,IAAI,EAAEC,IAAI,EAAEC,UAAU,EAAEC,QAAQ,EAAEC,YAAY,QAAQ,cAAc;AAClH,SAASC,aAAa,EAAEC,kBAAkB,QAAmB,+CAA+C;AAG5G,SAASC,aAAa,QAAoC,8CAA8C;AACxG,OAAOC,QAAQ,MAAM,oEAAoE;AAEzF,OAAOC,cAAc,MAAM,iBAAiB;AAC5C,SAASC,aAAa,QAAyB,kBAAkB;AACjE,OAAOC,WAAW,MAAM,qCAAqC;AAC7D,SAASC,uBAAuB,EAAEC,qBAAqB,QAAQ,8CAA8C;AAC7G,SAASC,UAAU,EAAEC,sBAAsB,QAAQ,8BAA8B;AAEjF,OAAO,MAAMC,cAAc,SAASV,kBAAkB,CAAiB;EAAAW,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAC,eAAA,mBACjD,KAAK;IAAAA,eAAA,uBACV,CAAC,CAAC;IAAAA,eAAA,mBACN,CAAC,CAAC;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AI,CAACpC,mBAAmB,CAAC/E,KAAK,CAACyB,IAAI,KAAK,cAAc,gBAC3EjD,KAAA,CAAA6E,aAAA,CAACvE,QAAQ,CAACF,IAAI,EAAAmF,QAAA;QAACT,KAAK,EAAG,CAAC5C,MAAM,CAACC,OAAO,EAAC;UAAEsB,MAAM,EAAE,IAAI,CAACpB;QAAM,CAAC;MAAE,GAAK,IAAI,CAACuG,YAAY,CAACC,WAAW,gBAC/F7I,KAAA,CAAA6E,aAAA,CAAC3D,sBAAsB,QACvB,IAAI,CAACyD,oBAAoB,CAACnD,KAAK,EAAEU,MAAM,EAAE0C,UAAU,CAC5B,CACR,CAAC,GAChB,IAAI,CAACD,oBAAoB,CAACnD,KAAK,EAAEU,MAAM,EAAE0C,UAAU,CAAE,EAAE1C,MAAM,EAAEuE,YAAY,CAAC,CAAC;MACjF,OAAO,IAAI;IACb,CACa,CAAC,GAAI,IAClB,CAAC;EACX;AACF","ignoreList":[]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["d3Shape","scale","n","line","width","height","path","x","d","y","lineCurvedDown","iPosition","circle","position","circleWidth","trim","curved","curve","curveBasis","getPathDown","iHeight","centerWidth","clippedTabbarHeight"],"sources":["curve.tsx"],"sourcesContent":["import * as d3Shape from \"d3-shape\";\n// import { scale } from \"react-native-size-scaling\";\nconst scale = (n: number) => n;\n\ninterface LineDatum {\n x: number;\n y: number;\n missing?: boolean;\n}\n\n//** Path Line */\nconst line = (width : number, height: number) => {\n const path: any = d3Shape\n .line<LineDatum>()\n .x((d) => d.x)\n .y((d) => d.y)([\n { x: width / 2, y: 0 },\n { x: width, y: 0 },\n { x: width, y: height },\n { x: 0, y: height},\n { x: 0, y: 0 },\n { x: width / 2, y: 0 },\n ]);\n \nreturn path;\n};\n\n//** Path Curved*/\nconst lineCurvedDown = (iPosition: number, height: number, circle: number) => {\n const position = iPosition;\n const circleWidth = circle + position;\n const trim = (position + circleWidth) / 2;\n \n const curved: any = d3Shape\n .line<LineDatum>()\n .x((d) => d.x)\n .y((d) => d.y)\n .curve(d3Shape.curveBasis)([\n { x: position - scale(20), y: 0 }, // border center left\n { x: position - scale(10), y: scale(2) },\n { x: position - scale(2), y: scale(10) },\n { x: position, y: scale(17) },\n \n { x: trim - scale(25), y: height / 2 + scale(2) },\n { x: trim - scale(10), y: height / 2 + scale(10) },\n { x: trim, y: height / 2 + scale(10) },\n { x: trim + scale(10), y: height / 2 + scale(10) },\n { x: trim + scale(25), y: height / 2 + scale(2) },\n \n { x: circleWidth, y: scale(17) }, // border center right\n { x: circleWidth + scale(2), y: scale(10) },\n { x: circleWidth + scale(10), y: 0 },\n { x: circleWidth + scale(20), y: 0 },\n ]);\n return curved;\n};\n\nexport const getPathDown = (width: number, iHeight: number, centerWidth: number, clippedTabbarHeight: number) => {\n const height = scale(iHeight);\n const circleWidth = scale(centerWidth) + scale(16);\n return `${line(width, clippedTabbarHeight)} ${lineCurvedDown(\n width / 2 - circleWidth / 2,\n height,\n circleWidth\n )}`;\n};\n"],"mappings":"AAAA,OAAO,KAAKA,OAAO,MAAM,UAAU;AACnC;AACA,MAAMC,KAAK,GAAIC,CAAS,IAAKA,CAAC;AAQ9B;AACA,MAAMC,IAAI,GAAGA,CAACC,KAAc,EAAEC,MAAc,KAAK;EAC/C,MAAMC,IAAS,GAAGN,OAAO,CACxBG,IAAI,CAAY,CAAC,CACjBI,CAAC,CAAEC,CAAC,IAAKA,CAAC,CAACD,CAAC,CAAC,CACbE,CAAC,CAAED,CAAC,IAAKA,CAAC,CAACC,CAAC,CAAC,CAAC,CACb;IAAEF,CAAC,EAAEH,KAAK,GAAG,CAAC;IAAEK,CAAC,EAAE;EAAE,CAAC,EACtB;IAAEF,CAAC,EAAEH,KAAK;IAAEK,CAAC,EAAE;EAAE,CAAC,EAClB;IAAEF,CAAC,EAAEH,KAAK;IAAEK,CAAC,EAAEJ;EAAO,CAAC,EACvB;IAAEE,CAAC,EAAE,CAAC;IAAEE,CAAC,EAAEJ;EAAM,CA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height","path","x","d","y","lineCurvedDown","iPosition","circle","position","circleWidth","trim","curved","curve","curveBasis","getPathDown","iHeight","centerWidth","clippedTabbarHeight"],"sources":["curve.tsx"],"sourcesContent":["import * as d3Shape from \"d3-shape\";\n// import { scale } from \"react-native-size-scaling\";\nconst scale = (n: number) => n;\n\ninterface LineDatum {\n x: number;\n y: number;\n missing?: boolean;\n}\n\n//** Path Line */\nconst line = (width : number, height: number) => {\n const path: any = d3Shape\n .line<LineDatum>()\n .x((d) => d.x)\n .y((d) => d.y)([\n { x: width / 2, y: 0 },\n { x: width, y: 0 },\n { x: width, y: height },\n { x: 0, y: height},\n { x: 0, y: 0 },\n { x: width / 2, y: 0 },\n ]);\n \nreturn path;\n};\n\n//** Path Curved*/\nconst lineCurvedDown = (iPosition: number, height: number, circle: number) => {\n const position = iPosition;\n const circleWidth = circle + position;\n const trim = (position + circleWidth) / 2;\n \n const curved: any = d3Shape\n .line<LineDatum>()\n .x((d) => d.x)\n .y((d) => d.y)\n .curve(d3Shape.curveBasis)([\n { x: position - scale(20), y: 0 }, // border center left\n { x: position - scale(10), y: scale(2) },\n { x: position - scale(2), y: scale(10) },\n { x: position, y: scale(17) },\n \n { x: trim - scale(25), y: height / 2 + scale(2) },\n { x: trim - scale(10), y: height / 2 + scale(10) },\n { x: trim, y: height / 2 + scale(10) },\n { x: trim + scale(10), y: height / 2 + scale(10) },\n { x: trim + scale(25), y: height / 2 + scale(2) },\n \n { x: circleWidth, y: scale(17) }, // border center right\n { x: circleWidth + scale(2), y: scale(10) },\n { x: circleWidth + scale(10), y: 0 },\n { x: circleWidth + scale(20), y: 0 },\n ]);\n return curved;\n};\n\nexport const getPathDown = (width: number, iHeight: number, centerWidth: number, clippedTabbarHeight: number) => {\n const height = scale(iHeight);\n const circleWidth = scale(centerWidth) + scale(16);\n return `${line(width, clippedTabbarHeight)} ${lineCurvedDown(\n width / 2 - circleWidth / 2,\n height,\n circleWidth\n )}`;\n};\n"],"mappings":"AAAA,OAAO,KAAK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CAAC,CAAC;IAAEQ,CAAC,EAAER,KAAK,CAAC,EAAE;EAAE,CAAC,EAC3C;IAAEM,CAAC,EAAEO,WAAW,GAAGb,KAAK,CAAC,EAAE,CAAC;IAAEQ,CAAC,EAAE;EAAE,CAAC,EACpC;IAAEF,CAAC,EAAEO,WAAW,GAAGb,KAAK,CAAC,EAAE,CAAC;IAAEQ,CAAC,EAAE;EAAE,CAAC,CACrC,CAAC;EACJ,OAAOO,MAAM;AACf,CAAC;AAED,OAAO,MAAMG,WAAW,GAAGA,CAACf,KAAa,EAAEgB,OAAe,EAAEC,WAAmB,EAAEC,mBAA2B,KAAK;EAC/G,MAAMjB,MAAM,GAAGJ,KAAK,CAACmB,OAAO,CAAC;EAC7B,MAAMN,WAAW,GAAGb,KAAK,CAACoB,WAAW,CAAC,GAAGpB,KAAK,CAAC,EAAE,CAAC;EAClD,OAAO,GAAGE,IAAI,CAACC,KAAK,EAAEkB,mBAAmB,CAAC,IAAIZ,cAAc,CAC1DN,KAAK,GAAG,CAAC,GAAGU,WAAW,GAAG,CAAC,EAC3BT,MAAM,EACNS,WACF,CAAC,EAAE;AACL,CAAC","ignoreList":[]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["React","Text","View","TouchableOpacity","Dimensions","Keyboard","ThemeProvider","ModalConsumer","WmIcon","NavigationServiceConsumer","BaseNavComponent","BaseNavState","WmTabbarProps","DEFAULT_CLASS","Svg","Path","getPathDown","ThemeVariables","scale","n","WmTabbarState","constructor","args","_defineProperty","WmTabbar","props","get","width","cleanup","push","addListener","keyBoardShown","forceUpdate","remove","renderTabItem","item","testId","onSelect","floating","isActive","getDisplayLabel","getDisplayExpression","label","increasedGap","Number","indexBeforeMid","state","dataItems","length","classname","indexOf","styles","tabItem","paddingRight","createElement","_extends","getTestPropsForAction","style","centerHubItem","key","onPress","activeTabItem","theme","mergeStyle","tabIcon","centerHubIcon","activeTabIcon","iconclass","icon","tabLabel","centerHubLabel","activeTabLabel","numberOfLines","onItemSelect","navigationService","link","openUrl","invokeEventCallback","proxy","prepareModalOptions","content","o","modalOptions","modalStyle","bottom","tabbarHeight","contentStyle","modalContent","isVisible","renderWidget","max","tabItems","tabItemsLength","isClippedTabbar","middleIndex","Math","floor","returnpathDown","maxWidth","root","height","moreItems","moreItemsCount","ceil","j","i","row","zIndex","position","backgroundColor","INSTANCE","transparent","fill","tabbarBackgroundColor","d","Fragment","modalService","showMore","showModal","value","moreMenu","map","a","moreMenuRow","index","hideModal","menu","onLayout","e","nativeEvent","layout","filter","morebuttonlabel","morebuttoniconclass","updateState"],"sources":["tabbar.component.tsx"],"sourcesContent":["import React, { ReactNode } from 'react';\nimport { Text, View, TouchableOpacity, Dimensions, Keyboard } from 'react-native';\n\nimport { ThemeProvider } from '@wavemaker/app-rn-runtime/styles/theme';\nimport { ModalConsumer, ModalOptions, ModalService } from '@wavemaker/app-rn-runtime/core/modal.service';\nimport WmIcon from '@wavemaker/app-rn-runtime/components/basic/icon/icon.component';\nimport NavigationService, { NavigationServiceConsumer } from '@wavemaker/app-rn-runtime/core/navigation.service';\nimport { BaseNavProps } from '@wavemaker/app-rn-runtime/components/navigation/basenav/basenav.props';\nimport { BaseNavComponent, BaseNavState, NavigationDataItem } from '@wavemaker/app-rn-runtime/components/navigation/basenav/basenav.component';\n\nimport WmTabbarProps from './tabbar.props';\nimport { DEFAULT_CLASS, WmTabbarStyles } from './tabbar.styles';\nimport Svg, { Path } from 'react-native-svg';\nimport { getPathDown } from './curve';\n// import { scale } from 'react-native-size-scaling';\nimport ThemeVariables from '@wavemaker/app-rn-runtime/styles/theme.variables';\n\ninterface TabDataItem extends NavigationDataItem {\n floating: boolean;\n indexBeforeMid: number;\n}\n\nconst scale = (n: number) => n;\n\nclass WmTabbarState<T extends BaseNavProps> extends BaseNavState<T> {\n showMore = false;\n modalOptions = {} as ModalOptions;\n dataItems: TabDataItem[] = [];\n}\n\nexport default class WmTabbar extends BaseNavComponent<WmTabbarProps, WmTabbarState<WmTabbarProps>, WmTabbarStyles> {\n\n private tabbarHeight = 0;\n private keyBoardShown = false;\n\n constructor(props: WmTabbarProps) {\n super(props, DEFAULT_CLASS, new WmTabbarProps(), new WmTabbarState());\n this.cleanup.push(Keyboard.addListener('keyboardWillShow', () => {\n this.keyBoardShown = true;\n this.forceUpdate();\n }).remove);\n this.cleanup.push(Keyboard.addListener('keyboardWillHide', () => {\n this.keyBoardShown = false;\n this.forceUpdate();\n }).remove);\n }\n\n private maxWidth = Dimensions.get(\"window\").width; \n private returnpathDown: any;\n\n renderTabItem(item: TabDataItem, testId: string, props: WmTabbarProps, onSelect: Function, floating = false) {\n\n const isActive = props.isActive && props.isActive(item);\n const getDisplayLabel = this.props.getDisplayExpression || ((label: string) => label);\n let increasedGap = Number(testId) === item?.indexBeforeMid && (this.state.dataItems.length % 2!=0) && ((props.classname || '').indexOf('clipped-tabbar') >= 0)\n ? [this.styles.tabItem, { paddingRight: 70 }]\n : [this.styles.tabItem];\n \n return (\n <TouchableOpacity \n {...this.getTestPropsForAction('item' + testId)}\n style={[increasedGap, floating? this.styles.centerHubItem: {}]}\n key={`${item.label}_${testId}`}\n onPress={() => onSelect && onSelect()}>\n <View key={item.key}>\n <View style={[isActive && !floating ? this.styles.activeTabItem : {}]}>\n <WmIcon\n styles={this.theme.mergeStyle({}, this.styles.tabIcon, floating? this.styles.centerHubIcon: {}, isActive ? this.styles.activeTabIcon : {})}\n iconclass={item.icon}\n ></WmIcon>\n </View>\n </View>\n <Text style={[this.styles.tabLabel, floating? this.styles.centerHubLabel: {}, isActive ? this.styles.activeTabLabel : {}]} numberOfLines={1}>\n {getDisplayLabel(item.label)}\n </Text>\n </TouchableOpacity>\n );\n }\n \n onItemSelect(item: NavigationDataItem, navigationService: NavigationService) {\n item.link && navigationService.openUrl(item.link);\n this.invokeEventCallback('onSelect', [null, this.proxy, item]);\n }\n\n prepareModalOptions(content: ReactNode) {\n const o = this.state.modalOptions;\n o.content = content;\n o.modalStyle = {\n bottom: this.tabbarHeight\n };\n o.contentStyle = this.styles.modalContent; \n return o;\n }\n\n isVisible(): boolean {\n return super.isVisible() && !this.keyBoardShown;\n }\n\n renderWidget(props: WmTabbarProps) {\n let max = 5;\n const tabItems = this.state.dataItems;\n const tabItemsLength = tabItems.length;\n const isClippedTabbar = ((props.classname || '').indexOf('clipped-tabbar') >= 0) && (tabItemsLength % 2 !== 0);\n if (isClippedTabbar && tabItemsLength % 2 !== 0) {\n const middleIndex = Math.floor(tabItemsLength / 2);\n tabItems[middleIndex]['floating'] = true;\n tabItems[middleIndex - 1]['indexBeforeMid'] = middleIndex-1;\n }\n this.returnpathDown = getPathDown(this.maxWidth, 65 ,60,this.styles.root.height as number);\n const moreItems = [] as any[][];\n if (tabItems.length > max) {\n const moreItemsCount = Math.ceil((tabItems.length + 1 - max)/ max) * max;\n let j = 0;\n for (let i = max-1; i < moreItemsCount;) {\n const row = [];\n for (let j = 0; j < max; j++) {\n row[j] = tabItems[i++] || {key: 'tabItem' + i} as TabDataItem;\n }\n moreItems.push(row);\n }\n max = max - 1;\n }\n return (\n <NavigationServiceConsumer>\n {(navigationService) =>\n (<View style={this.styles.root}>\n {isClippedTabbar ? (\n <Svg width={this.maxWidth} height={scale(this.styles.root.height as number)} style={{zIndex: -1,position: 'absolute',backgroundColor: ThemeVariables.INSTANCE.transparent}}>\n <Path fill={ThemeVariables.INSTANCE.tabbarBackgroundColor} {...{ d: this.returnpathDown }}/>\n </Svg>\n ): <></>} \n <ModalConsumer>\n {(modalService: ModalService) => {\n if (this.state.showMore) {\n modalService.showModal(this.prepareModalOptions((\n <ThemeProvider value={this.theme} >\n <View style={this.styles.moreMenu}>\n {moreItems.map((a, i) =>\n (<View key={i} style={this.styles.moreMenuRow}>\n {a.map((item, index) => this.renderTabItem(item, i + '', props, () => this.onItemSelect(item, navigationService)))}\n </View>)\n )}\n </View>\n </ThemeProvider>)));\n } else {\n modalService.hideModal(this.state.modalOptions);\n }\n return null;\n }}\n </ModalConsumer>\n <View style={this.styles.menu}\n onLayout={e => { this.tabbarHeight = e.nativeEvent.layout.height}}> \n {tabItems.filter((item, i) => i < max)\n .map((item, i) => this.renderTabItem(item, i + '', props, () => this.onItemSelect(item, navigationService), item.floating))}\n {tabItems.length > max && (\n this.renderTabItem({\n label: props.morebuttonlabel,\n icon: props.morebuttoniconclass\n } as TabDataItem, 6666 +'', props, () => {\n this.updateState({showMore: !this.state.showMore} as WmTabbarState<WmTabbarProps>);\n })\n )}\n </View>\n </View>)}\n </NavigationServiceConsumer>\n );\n }\n}\n"],"mappings":";;;;AAAA,OAAOA,KAAK,MAAqB,OAAO;AACxC,SAASC,IAAI,EAAEC,IAAI,EAAEC,gBAAgB,EAAEC,UAAU,EAAEC,QAAQ,QAAQ,cAAc;AAEjF,SAASC,aAAa,QAAQ,wCAAwC;AACtE,SAASC,aAAa,QAAoC,8CAA8C;AACxG,OAAOC,MAAM,MAAM,gEAAgE;AACnF,SAA4BC,yBAAyB,QAAQ,mDAAmD;AAEhH,SAASC,gBAAgB,EAAEC,YAAY,QAA4B,2EAA2E;AAE9I,OAAOC,aAAa,MAAM,gBAAgB;AAC1C,SAASC,aAAa,QAAwB,iBAAiB;AAC/D,OAAOC,GAAG,IAAIC,IAAI,QAAQ,kBAAkB;AAC5C,SAASC,WAAW,QAAQ,SAAS;AACrC;AACA,OAAOC,cAAc,MAAM,kDAAkD;AAO7E,MAAMC,KAAK,GAAIC,CAAS,IAAKA,CAAC;AAE9B,MAAMC,aAAa,SAAiCT,YAAY,CAAI;EAAAU,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAC,eAAA,mBACvD,KAAK;IAAAA,eAAA,uBACD,CAAC,CAAC;IAAAA,eAAA,oBACU,EAAE;EAAA;AAC/B;AAEA,eAAe,MAAMC,QAAQ,SAASd,gBAAgB,CAA8D;EAKlHW,WAAWA,CAACI,KAAoB,EAAE;IAChC,KAAK,CAACA,KAAK,EAAEZ,aAAa,EAAE,IAAID,aAAa,CAAC,CAAC,EAAE,IAAI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rB,CAAC,MAAM;QACL0C,YAAY,CAACS,SAAS,CAAC,IAAI,CAAC/E,KAAK,CAACoC,YAAY,CAAC;MACjD;MACA,OAAO,IAAI;IACb,CACa,CAAC,eAChBlF,KAAA,CAAAsD,aAAA,CAACpD,IAAI;MAACuD,KAAK,EAAE,IAAI,CAACN,MAAM,CAAC2E,IAAK;MAC5BC,QAAQ,EAAEC,CAAC,IAAI;QAAE,IAAI,CAAC3C,YAAY,GAAG2C,CAAC,CAACC,WAAW,CAACC,MAAM,CAAC9B,MAAM;MAAA;IAAE,GACjET,QAAQ,CAACwC,MAAM,CAAC,CAAChG,IAAI,EAAEsE,CAAC,KAAKA,CAAC,GAAGf,GAAG,CAAC,CACnC+B,GAAG,CAAC,CAACtF,IAAI,EAAEsE,CAAC,KAAK,IAAI,CAACvE,aAAa,CAACC,IAAI,EAAEsE,CAAC,GAAG,EAAE,EAAEhF,KAAK,EAAE,MAAM,IAAI,CAACgD,YAAY,CAACtC,IAAI,EAAEuC,iBAAiB,CAAC,EAAEvC,IAAI,CAACG,QAAQ,CAAC,CAAC,EAC5HqD,QAAQ,CAAC3C,MAAM,GAAG0C,GAAG,IACpB,IAAI,CAACxD,aAAa,CAAC;MACjBQ,KAAK,EAAEjB,KAAK,CAAC2G,eAAe;MAC5BhE,IAAI,EAAE3C,KAAK,CAAC4G;IACd,CAAC,EAAiB,IAAI,GAAE,EAAE,EAAE5G,KAAK,EAAG,MAAM;MACxC,IAAI,CAAC6G,WAAW,CAAC;QAACjB,QAAQ,EAAE,CAAC,IAAI,CAACvE,KAAK,CAACuE;MAAQ,CAAiC,CAAC;IACpF,CAAC,CAEC,CACF,CACmB,CAAC;EAEhC;AACF","ignoreList":[]}
|
1
|
+
{"version":3,"names":["React","Text","View","TouchableOpacity","Dimensions","Keyboard","ThemeProvider","ModalConsumer","WmIcon","NavigationServiceConsumer","BaseNavComponent","BaseNavState","WmTabbarProps","DEFAULT_CLASS","Svg","Path","getPathDown","ThemeVariables","scale","n","WmTabbarState","constructor","args","_defineProperty","WmTabbar","props","get","width","cleanup","push","addListener","keyBoardShown","forceUpdate","remove","renderTabItem","item","testId","onSelect","floating","isActive","getDisplayLabel","getDisplayExpression","label","increasedGap","Number","indexBeforeMid","state","dataItems","length","classname","indexOf","styles","tabItem","paddingRight","createElement","_extends","getTestPropsForAction","style","centerHubItem","key","onPress","activeTabItem","theme","mergeStyle","tabIcon","centerHubIcon","activeTabIcon","iconclass","icon","tabLabel","centerHubLabel","activeTabLabel","numberOfLines","onItemSelect","navigationService","link","openUrl","invokeEventCallback","proxy","prepareModalOptions","content","o","modalOptions","modalStyle","bottom","tabbarHeight","contentStyle","modalContent","isVisible","renderWidget","max","tabItems","tabItemsLength","isClippedTabbar","middleIndex","Math","floor","returnpathDown","maxWidth","root","height","moreItems","moreItemsCount","ceil","j","i","row","zIndex","position","backgroundColor","INSTANCE","transparent","fill","tabbarBackgroundColor","d","Fragment","modalService","showMore","showModal","value","moreMenu","map","a","moreMenuRow","index","hideModal","menu","onLayout","e","nativeEvent","layout","filter","morebuttonlabel","morebuttoniconclass","updateState"],"sources":["tabbar.component.tsx"],"sourcesContent":["import React, { ReactNode } from 'react';\nimport { Text, View, TouchableOpacity, Dimensions, Keyboard } from 'react-native';\n\nimport { ThemeProvider } from '@wavemaker/app-rn-runtime/styles/theme';\nimport { ModalConsumer, ModalOptions, ModalService } from '@wavemaker/app-rn-runtime/core/modal.service';\nimport WmIcon from '@wavemaker/app-rn-runtime/components/basic/icon/icon.component';\nimport NavigationService, { NavigationServiceConsumer } from '@wavemaker/app-rn-runtime/core/navigation.service';\nimport { BaseNavProps } from '@wavemaker/app-rn-runtime/components/navigation/basenav/basenav.props';\nimport { BaseNavComponent, BaseNavState, NavigationDataItem } from '@wavemaker/app-rn-runtime/components/navigation/basenav/basenav.component';\n\nimport WmTabbarProps from './tabbar.props';\nimport { DEFAULT_CLASS, WmTabbarStyles } from './tabbar.styles';\nimport Svg, { Path } from 'react-native-svg';\nimport { getPathDown } from './curve';\n// import { scale } from 'react-native-size-scaling';\nimport ThemeVariables from '@wavemaker/app-rn-runtime/styles/theme.variables';\n\ninterface TabDataItem extends NavigationDataItem {\n floating: boolean;\n indexBeforeMid: number;\n}\n\nconst scale = (n: number) => n;\n\nclass WmTabbarState<T extends BaseNavProps> extends BaseNavState<T> {\n showMore = false;\n modalOptions = {} as ModalOptions;\n dataItems: TabDataItem[] = [];\n}\n\nexport default class WmTabbar extends BaseNavComponent<WmTabbarProps, WmTabbarState<WmTabbarProps>, WmTabbarStyles> {\n\n private tabbarHeight = 0;\n private keyBoardShown = false;\n\n constructor(props: WmTabbarProps) {\n super(props, DEFAULT_CLASS, new WmTabbarProps(), new WmTabbarState());\n this.cleanup.push(Keyboard.addListener('keyboardWillShow', () => {\n this.keyBoardShown = true;\n this.forceUpdate();\n }).remove);\n this.cleanup.push(Keyboard.addListener('keyboardWillHide', () => {\n this.keyBoardShown = false;\n this.forceUpdate();\n }).remove);\n }\n\n private maxWidth = Dimensions.get(\"window\").width; \n private returnpathDown: any;\n\n renderTabItem(item: TabDataItem, testId: string, props: WmTabbarProps, onSelect: Function, floating = false) {\n\n const isActive = props.isActive && props.isActive(item);\n const getDisplayLabel = this.props.getDisplayExpression || ((label: string) => label);\n let increasedGap = Number(testId) === item?.indexBeforeMid && (this.state.dataItems.length % 2!=0) && ((props.classname || '').indexOf('clipped-tabbar') >= 0)\n ? [this.styles.tabItem, { paddingRight: 70 }]\n : [this.styles.tabItem];\n \n return (\n <TouchableOpacity \n {...this.getTestPropsForAction('item' + testId)}\n style={[increasedGap, floating? this.styles.centerHubItem: {}]}\n key={`${item.label}_${testId}`}\n onPress={() => onSelect && onSelect()}>\n <View key={item.key}>\n <View style={[isActive && !floating ? this.styles.activeTabItem : {}]}>\n <WmIcon\n styles={this.theme.mergeStyle({}, this.styles.tabIcon, floating? this.styles.centerHubIcon: {}, isActive ? this.styles.activeTabIcon : {})}\n iconclass={item.icon}\n ></WmIcon>\n </View>\n </View>\n <Text style={[this.styles.tabLabel, floating? this.styles.centerHubLabel: {}, isActive ? this.styles.activeTabLabel : {}]} numberOfLines={1}>\n {getDisplayLabel(item.label)}\n </Text>\n </TouchableOpacity>\n );\n }\n \n onItemSelect(item: NavigationDataItem, navigationService: NavigationService) {\n item.link && navigationService.openUrl(item.link);\n this.invokeEventCallback('onSelect', [null, this.proxy, item]);\n }\n\n prepareModalOptions(content: ReactNode) {\n const o = this.state.modalOptions;\n o.content = content;\n o.modalStyle = {\n bottom: this.tabbarHeight\n };\n o.contentStyle = this.styles.modalContent; \n return o;\n }\n\n isVisible(): boolean {\n return super.isVisible() && !this.keyBoardShown;\n }\n\n renderWidget(props: WmTabbarProps) {\n let max = 5;\n const tabItems = this.state.dataItems;\n const tabItemsLength = tabItems.length;\n const isClippedTabbar = ((props.classname || '').indexOf('clipped-tabbar') >= 0) && (tabItemsLength % 2 !== 0);\n if (isClippedTabbar && tabItemsLength % 2 !== 0) {\n const middleIndex = Math.floor(tabItemsLength / 2);\n tabItems[middleIndex]['floating'] = true;\n tabItems[middleIndex - 1]['indexBeforeMid'] = middleIndex-1;\n }\n this.returnpathDown = getPathDown(this.maxWidth, 65 ,60,this.styles.root.height as number);\n const moreItems = [] as any[][];\n if (tabItems.length > max) {\n const moreItemsCount = Math.ceil((tabItems.length + 1 - max)/ max) * max;\n let j = 0;\n for (let i = max-1; i < moreItemsCount;) {\n const row = [];\n for (let j = 0; j < max; j++) {\n row[j] = tabItems[i++] || {key: 'tabItem' + i} as TabDataItem;\n }\n moreItems.push(row);\n }\n max = max - 1;\n }\n return (\n <NavigationServiceConsumer>\n {(navigationService) =>\n (<View style={this.styles.root}>\n {isClippedTabbar ? (\n <Svg width={this.maxWidth} height={scale(this.styles.root.height as number)} style={{zIndex: -1,position: 'absolute',backgroundColor: ThemeVariables.INSTANCE.transparent}}>\n <Path fill={ThemeVariables.INSTANCE.tabbarBackgroundColor} {...{ d: this.returnpathDown }}/>\n </Svg>\n ): <></>} \n <ModalConsumer>\n {(modalService: ModalService) => {\n if (this.state.showMore) {\n modalService.showModal(this.prepareModalOptions((\n <ThemeProvider value={this.theme} >\n <View style={this.styles.moreMenu}>\n {moreItems.map((a, i) =>\n (<View key={i} style={this.styles.moreMenuRow}>\n {a.map((item, index) => this.renderTabItem(item, i + '', props, () => this.onItemSelect(item, navigationService)))}\n </View>)\n )}\n </View>\n </ThemeProvider>)));\n } else {\n modalService.hideModal(this.state.modalOptions);\n }\n return null;\n }}\n </ModalConsumer>\n <View style={this.styles.menu}\n onLayout={e => { this.tabbarHeight = e.nativeEvent.layout.height}}> \n {tabItems.filter((item, i) => i < max)\n .map((item, i) => this.renderTabItem(item, i + '', props, () => this.onItemSelect(item, navigationService), item.floating))}\n {tabItems.length > max && (\n this.renderTabItem({\n label: props.morebuttonlabel,\n icon: props.morebuttoniconclass\n } as TabDataItem, 6666 +'', props, () => {\n this.updateState({showMore: !this.state.showMore} as WmTabbarState<WmTabbarProps>);\n })\n )}\n </View>\n </View>)}\n </NavigationServiceConsumer>\n );\n }\n}\n"],"mappings":";;;;AAAA,OAAOA,KAAK,MAAqB,OAAO;AACxC,SAASC,IAAI,EAAEC,IAAI,EAAEC,gBAAgB,EAAEC,UAAU,EAAEC,QAAQ,QAAQ,cAAc;AAEjF,SAASC,aAAa,QAAQ,wCAAwC;AACtE,SAASC,aAAa,QAAoC,8CAA8C;AACxG,OAAOC,MAAM,MAAM,gEAAgE;AACnF,SAA4BC,yBAAyB,QAAQ,mDAAmD;AAEhH,SAASC,gBAAgB,EAAEC,YAAY,QAA4B,2EAA2E;AAE9I,OAAOC,aAAa,MAAM,gBAAgB;AAC1C,SAASC,aAAa,QAAwB,iBAAiB;AAC/D,OAAOC,GAAG,IAAIC,IAAI,QAAQ,kBAAkB;AAC5C,SAASC,WAAW,QAAQ,SAAS;AACrC;AACA,OAAOC,cAAc,MAAM,kDAAkD;AAO7E,MAAMC,KAAK,GAAIC,CAAS,IAAKA,CAAC;AAE9B,MAAMC,aAAa,SAAiC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,WAAW,CAAC;QAACjB,QAAQ,EAAE,CAAC,IAAI,CAACvE,KAAK,CAACuE;MAAQ,CAAiC,CAAC;IACpF,CAAC,CAEC,CACF,CACmB,CAAC;EAEhC;AACF","ignoreList":[]}
|
@@ -122,6 +122,7 @@ export class BaseComponent extends React.Component {
|
|
122
122
|
if (this.propertyProvider.has(propName)) {
|
123
123
|
// @ts-ignore
|
124
124
|
const props = {};
|
125
|
+
this.propertyProvider.overrideProp(propName, value);
|
125
126
|
props[propName] = value;
|
126
127
|
this.updateState({
|
127
128
|
props: props
|
@@ -275,7 +276,7 @@ export class BaseComponent extends React.Component {
|
|
275
276
|
}
|
276
277
|
isVisible() {
|
277
278
|
const show = this.state.props.show;
|
278
|
-
return show !== false && show !== 'false' && show !== '0' && !isNil(show);
|
279
|
+
return show !== false && show !== 'false' && show !== '0' && !isNil(show) && show !== "";
|
279
280
|
}
|
280
281
|
refresh() {
|
281
282
|
this.forceUpdate();
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["assign","isUndefined","isNil","React","AccessibilityInfo","Platform","Animatable","ThemeVariables","StyleProps","getStyleName","BackgroundComponent","injector","ROOT_LOGGER","deepCopy","BASE_THEME","ThemeConsumer","ThemeEvent","EventNotifier","PropsProvider","assignIn","HideMode","AssetConsumer","FixedView","TextIdPrefixConsumer","isScreenReaderEnabled","TappableContext","WIDGET_LOGGER","extend","ParentContext","createContext","BaseComponentState","constructor","_defineProperty","undefined","defineStyles","styles","text","fontFamily","INSTANCE","baseFont","userSelect","BaseProps","args","BaseComponent","Component","markupProps","defaultClass","defaultProps","defaultState","ADD_TO_DOM","createElement","Fragment","I18nService","get","state","notifier","name","props","propertyProvider","show","$new","$old","debug","initialized","styleName","styleOverrides","setTimeout","cleanRefresh","onPropertyChange","_showView","deferload","check","proxy","Proxy","target","prop","receiver","propName","toString","has","Reflect","set","value","updateState","cleanup","push","updateStateTimeouts","forEach","v","clearTimeout","theme","subscribe","CHANGE","forceUpdate","addEventListener","remove","destroyParentListeners","event","fn","notify","emitToParent","isRTL","i18nService","isRTLLocale","animate","setState","animationId","Date","now","animatableProps","setProp","setPropDefault","setDefault","getDefaultStyles","getStyle","reset","newPartialState","callback","destroyed","stateFn","oldState","oldProps","newState","Object","keys","k","onUpdateState","_this$props$listener","_this$props$listener2","listener","onComponentChange","timeoutId","splice","indexOf","shouldComponentUpdate","nextProps","nextState","nextContext","key","componentDidMount","onComponentInit","componentWillAttach","isFixed","hide","componentWillDetach","componentWillUnmount","onComponentDestroy","f","destroy","componentDidUpdate","prevProps","prevState","snapshot","invokeEventCallback","eventName","callBack","map","a","apply","e","console","error","showView","isVisible","refresh","renderSkeleton","parentListenerDestroyers","setParent","parent","copyStyles","property","from","to","renderFixedContainer","style","rootStyle","left","top","bottom","right","width","height","root","mergeStyle","addAnimation","renderWidget","n","View","_extends","setBackground","bgStyle","_background","image","backgroundImage","position","backgroundPosition","size","backgroundSize","repeat","backgroundRepeat","resizeMode","backgroundResizeMode","borderRadius","getTestId","suffix","id","testIdPrefix","getTestProps","OS","accessibilityLabel","testID","accessible","getStyleClassName","classname","getTestPropsForInput","getTestPropsForAction","getTestPropsForLabel","getDependenciesFromContext","Consumer","tappable","closestTappable","loadAsset","_this$parent","_showSkeleton","showskeleton","Provider","render","selectedLocale","getSelectedLocale","info","hideMode","DONOT_ADD_TO_DOM","disabled","showindevice","d","join","cleanseStyleProperties","hasOwnProperty","backgroundColor","eleToRender"],"sources":["base.component.tsx"],"sourcesContent":["import { assign, isUndefined, isNil } from 'lodash';\nimport React, { ReactNode } from 'react';\nimport { AccessibilityInfo, Platform, TextStyle, ViewStyle } from 'react-native';\nimport { AnimatableProps } from 'react-native-animatable';\nimport * as Animatable from 'react-native-animatable';\nimport ThemeVariables from '@wavemaker/app-rn-runtime/styles/theme.variables';\nimport { StyleProps, getStyleName } from '@wavemaker/app-rn-runtime/styles/style-props';\nimport { BackgroundComponent } from '@wavemaker/app-rn-runtime/styles/background.component';\nimport injector from '@wavemaker/app-rn-runtime/core/injector';\nimport { ROOT_LOGGER } from '@wavemaker/app-rn-runtime/core/logger';\nimport { deepCopy } from '@wavemaker/app-rn-runtime/core/utils';\nimport BASE_THEME, { NamedStyles, AllStyle, ThemeConsumer, ThemeEvent, Theme } from '../styles/theme';\nimport EventNotifier from './event-notifier';\nimport { PropsProvider } from './props.provider';\nimport { assignIn } from 'lodash-es';\nimport { HideMode } from './if.component';\nimport { AssetConsumer } from './asset.provider';\nimport { FixedView } from './fixed-view.component';\nimport { TextIdPrefixConsumer } from './testid.provider';\nimport { isScreenReaderEnabled } from './accessibility';\nimport { Tappable, TappableContext } from './tappable.component';\n\nexport const WIDGET_LOGGER = ROOT_LOGGER.extend('widget');\n\nexport const ParentContext = React.createContext(null as any);\n\nexport class BaseComponentState<T extends BaseProps> {\n public animationId?: number = 0;\n public animatableProps?: AnimatableProps<ViewStyle> = undefined;\n public props = {} as T;\n public hide? = false;\n}\n\nexport type BaseStyles = NamedStyles<any> & {\n root: AllStyle,\n text: TextStyle & {userSelect?: 'none'| 'text'}\n}\n\nexport function defineStyles<T>(styles: T): T {\n return deepCopy({\n text: {\n fontFamily: ThemeVariables.INSTANCE.baseFont,\n userSelect: 'text'\n }\n }, styles);\n}\n\nexport interface LifecycleListener {\n onComponentChange?: (c: BaseComponent<any, any, any>) => void;\n onComponentInit?: (c: BaseComponent<any, any, any>) => void;\n onComponentDestroy?: (c: BaseComponent<any, any, any>) => void;\n}\n\nexport class BaseProps extends StyleProps {\n id?: string = null as any;\n name?: string = null as any;\n key?: any = null as any;\n disabled? = false;\n show? = true as Boolean | String | Number;\n styles?: any = null;\n classname?: string = null as any;\n listener?: LifecycleListener = null as any;\n showindevice?: ('xs'|'sm'|'md'|'lg'|'xl'|'xxl')[] = null as any;\n showskeleton?: boolean = false;\n deferload?: boolean = false;\n}\n\nexport abstract class BaseComponent<T extends BaseProps, S extends BaseComponentState<T>, L extends BaseStyles> extends React.Component<T, S> {\n public styles: L = null as any;\n public hideMode = HideMode.ADD_TO_DOM;\n private propertyProvider: PropsProvider<T>;\n public proxy: BaseComponent<T, S, L>;\n public initialized = false;\n public cleanup = [] as Function[];\n public theme = BASE_THEME;\n public updateStateTimeouts= [] as NodeJS.Timeout[];\n public parent: BaseComponent<any, any, any> = null as any;\n public destroyed = false;\n public _showSkeleton = false;\n public isFixed = false;\n private notifier = new EventNotifier();\n private parentListenerDestroyers = [] as Function[];\n public _background = <></>;\n private styleOverrides = {} as any;\n public loadAsset: (path: string) => number | string = null as any;\n private i18nService = injector.I18nService.get();\n public testIdPrefix = '';\n private _showView = true;\n public closestTappable?: Tappable;\n\n constructor(markupProps: T, public defaultClass: string, defaultProps?: T, defaultState?: S) {\n super(markupProps);\n this.state = (defaultState || {} as S);\n this.notifier.name = this.props.name || '';\n this.propertyProvider = new PropsProvider<T>(\n assign({show: true}, defaultProps),\n assign({}, markupProps),\n (name: string, $new: any, $old: any) => {\n WIDGET_LOGGER.debug(() => `${this.props.name || this.constructor.name}: ${name} changed from ${$old} to ${$new}`);\n if (this.initialized) {\n const styleName = getStyleName(name);\n if (styleName) {\n if ($new === undefined) {\n delete this.styleOverrides[styleName];\n } else {\n this.styleOverrides[styleName] = $new;\n }\n }\n }\n if (name === 'showskeleton' && this.initialized) {\n setTimeout(() => this.cleanRefresh(), 100);\n }\n this.onPropertyChange(name, $new, $old);\n });\n //@ts-ignore\n this.state.props =this.propertyProvider.get();\n //@ts-ignore\n this._showView = !this.props.deferload;\n this.propertyProvider.check();\n //@ts-ignore\n this.proxy = (new Proxy(this, {\n get: (target, prop, receiver): any => {\n const propName = prop.toString();\n if (this.propertyProvider.has(propName)) {\n //@ts-ignore\n return this.state.props[propName];\n }\n return Reflect.get(target, prop, receiver);\n },\n set: (target: any, prop, value: any): any => {\n const propName = prop.toString();\n if (this.propertyProvider.has(propName)) {\n // @ts-ignore\n const props = {} as any;\n props[propName] = value;\n this.updateState({\n props: props\n } as S);\n return true;\n } else {\n return Reflect.set(target, prop, value);\n }\n }\n }));\n this.cleanup.push(() => {\n this.updateStateTimeouts.forEach(v => clearTimeout(v));\n });\n this.cleanup.push(this.theme.subscribe(ThemeEvent.CHANGE, () => {\n this.forceUpdate();\n }));\n this.cleanup.push(AccessibilityInfo.addEventListener('screenReaderChanged',\n () => {\n setTimeout(() => {\n this.forceUpdate();\n }, 100);\n },\n ).remove);\n this.cleanup.push(() => {\n this.destroyParentListeners();\n });\n }\n\n public subscribe(event: string, fn: Function) {\n return this.notifier.subscribe(event, fn);\n }\n\n public notify(event: string, args: any[], emitToParent = false) {\n return this.notifier.notify(event, args, emitToParent);\n }\n\n public get isRTL(){\n return this.i18nService.isRTLLocale();\n }\n\n public animate(props: AnimatableProps<ViewStyle>) {\n this.setState({\n animationId: Date.now(),\n animatableProps: props\n });\n }\n\n setProp(propName: string, value: any) {\n this.propertyProvider.set(propName, value);\n this.updateState({props:{}} as S);\n }\n\n setPropDefault(propName: string, value: any) {\n this.propertyProvider.setDefault(propName, value);\n }\n \n onPropertyChange(name: string, $new: any, $old: any) { \n }\n \n getDefaultStyles() {\n return this.theme.getStyle(this.defaultClass);\n }\n\n reset() {\n\n }\n\n updateState(newPartialState: S, callback?: ()=>void) {\n if (this.destroyed) {\n return;\n }\n const stateFn = (oldState: S) => {\n const oldProps = oldState.props;\n const newState = this.initialized ? assignIn({}, oldState, newPartialState) : assignIn(oldState, newPartialState);\n if (newPartialState.props) {\n Object.keys(newPartialState.props).forEach((k) => {\n //@ts-ignore\n oldProps[k] = newState.props[k];\n });\n newState.props = oldProps;\n }\n return newState;\n };\n const onUpdateState = () => {\n callback && callback();\n this.props.listener?.onComponentChange\n && this.props.listener?.onComponentChange(this);\n }\n if (!this.initialized) {\n this.state = stateFn(this.state);\n onUpdateState();\n } else {\n const timeoutId = setTimeout(() => {\n this.setState(stateFn, onUpdateState);\n this.updateStateTimeouts.splice(this.updateStateTimeouts.indexOf(timeoutId), 1);\n });\n this.updateStateTimeouts.push(timeoutId);\n }\n }\n\n shouldComponentUpdate(nextProps: T, nextState: S, nextContext: any) {\n if (this.propertyProvider.check(nextProps)) {\n return true;\n }\n for(let key in nextState) {\n if(key !== 'props' && (!(key in this.state) || nextState[key] !== this.state[key])) {\n return true;\n }\n }\n\n for(let key in this.state) {\n if(key !== 'props' && (!(key in nextState) || this.state[key] !== nextState[key])) {\n return true;\n }\n }\n return false;\n }\n\n componentDidMount() {\n if (this.props.listener && this.props.listener.onComponentInit) {\n this.props.listener.onComponentInit(this.proxy);\n }\n this.initialized = true;\n }\n\n componentWillAttach() {\n if (this.isFixed) {\n this.setState({hide: false});\n }\n }\n\n componentWillDetach() {\n if (this.isFixed) {\n this.setState({hide: true});\n }\n }\n\n componentWillUnmount() {\n this.destroyed = true;\n if (this.props.listener && this.props.listener.onComponentDestroy) {\n this.props.listener.onComponentDestroy(this.proxy);\n }\n this.cleanup.forEach(f => f && f());\n this.notifier.destroy();\n this.notifier.notify('destroy', []);\n }\n \n componentDidUpdate(prevProps: Readonly<T>, prevState: Readonly<S>, snapshot?: any): void {\n if (this.propertyProvider.check(this.props)) {\n this.forceUpdate();\n }\n }\n\n invokeEventCallback(eventName: string, args: any[]) {\n //@ts-ignore\n const callBack: Function = this.props[eventName];\n args = args && args.map(a => (a === this) ? this.proxy : a)\n if (callBack) {\n try {\n return callBack.apply(this.proxy, args);\n } catch(e) {\n console.error(e);\n }\n }\n }\n\n showView() {\n return this.isVisible();\n }\n\n isVisible() {\n const show = this.state.props.show;\n return show !== false && show !== 'false' && show !== '0' && !isNil(show);\n }\n\n protected abstract renderWidget(props: T): ReactNode;\n\n public refresh() {\n this.forceUpdate();\n }\n\n public cleanRefresh() {\n this.forceUpdate(() => this.notifier.notify('forceUpdate', []));\n }\n \n public renderSkeleton (props: T): ReactNode {\n return null;\n }\n\n public destroyParentListeners() {\n this.parentListenerDestroyers.map(fn => fn());\n }\n\n private setParent(parent: BaseComponent<any, any, any>) {\n if (parent && this.parent !== parent) {\n this.parent = parent;\n this.notifier.setParent(parent.notifier);\n this.parentListenerDestroyers = [\n this.parent.subscribe('forceUpdate', () => {\n this.cleanRefresh();\n }),\n this.parent.subscribe('destroy', () => {\n this.destroyParentListeners();\n })\n ];\n }\n }\n\n copyStyles(property: string, from: any, to: any) {\n if (!isUndefined(from[property])) {\n to[property] = from[property];\n }\n }\n\n renderFixedContainer(props: T) {\n const style = {} as ViewStyle;\n const rootStyle = {\n left: 0,\n top: 0,\n bottom: 0,\n right: 0,\n width: \"100%\",\n height: \"100%\"\n } as ViewStyle;\n this.copyStyles('left', this.styles.root, style);\n this.copyStyles('top', this.styles.root, style);\n this.copyStyles('right', this.styles.root, style);\n this.copyStyles('bottom', this.styles.root, style);\n this.copyStyles('width', this.styles.root, style);\n this.copyStyles('height', this.styles.root, style);\n this.styles = this.theme.mergeStyle(this.styles, {root: rootStyle});\n return (<FixedView style={style} theme={this.theme}>{this.addAnimation(this.renderWidget(props))}</FixedView>);\n }\n\n private addAnimation(n: ReactNode) {\n if (!this.state.animatableProps) {\n return n;\n }\n return (<Animatable.View key={this.state.animationId} {...this.state.animatableProps}>{n}</Animatable.View>);\n }\n \n private setBackground() {\n const bgStyle = this.styles.root as any;\n this._background = (\n <BackgroundComponent \n image={bgStyle.backgroundImage}\n position={bgStyle.backgroundPosition}\n size={bgStyle.backgroundSize}\n repeat={bgStyle.backgroundRepeat}\n resizeMode={bgStyle.backgroundResizeMode}\n style={{borderRadius: this.styles.root.borderRadius}}>\n </BackgroundComponent>\n );\n delete (this.styles.root as any)['backgroundImage'];\n delete (this.styles.root as any)['backgroundPosition'];\n delete (this.styles.root as any)['backgroundResizeMode'];\n delete (this.styles.root as any)['backgroundSize'];\n delete (this.styles.root as any)['backgroundRepeat'];\n }\n\n public getTestId(suffix?: string) {\n let id = this.props.id || this.props.name;\n if (this.testIdPrefix) {\n id = this.testIdPrefix + '_' + id;\n }\n if (suffix) {\n id = id + '_' + suffix;\n }\n return id;\n }\n\n public getTestProps(suffix?: string) {\n let id = this.getTestId(suffix);\n if (isScreenReaderEnabled()) {\n return {};\n }\n if (Platform.OS === 'android' || Platform.OS === 'web') {\n return {\n accessibilityLabel: id,\n testID: id\n };\n }\n return {\n accessible: false,\n testID: id\n };\n }\n\n public getStyleClassName() {\n return this.state.props.classname;\n }\n\n public getTestPropsForInput(suffix?: string) {\n return this.getTestProps(suffix || 'i');\n }\n\n public getTestPropsForAction(suffix?: string) {\n return this.getTestProps(suffix || 'a');\n }\n\n public getTestPropsForLabel(suffix?: string) {\n return this.getTestProps(suffix || 'l');\n }\n\n private getDependenciesFromContext(fn: () => ReactNode) {\n return (\n <TappableContext.Consumer>{(tappable) => {\n this.closestTappable = tappable;\n return (\n <TextIdPrefixConsumer>\n {(testIdPrefix) => {\n this.testIdPrefix = testIdPrefix || '';\n return (<AssetConsumer>\n {(loadAsset) => {\n this.loadAsset = loadAsset;\n return (<ParentContext.Consumer>\n {(parent) => {\n this.setParent(parent);\n this._showSkeleton = this.parent?._showSkeleton \n || !!this.state.props.showskeleton;\n return (\n <ParentContext.Provider value={this}>\n <ThemeConsumer>\n {(theme) => { \n this.theme = theme || BASE_THEME;\n return fn();\n }}\n </ThemeConsumer>\n </ParentContext.Provider>);\n }} \n </ParentContext.Consumer>);\n }}\n </AssetConsumer>);\n }}\n </TextIdPrefixConsumer>)}}\n </TappableContext.Consumer>); \n }\n \n public render(): ReactNode {\n const props = this.state.props;\n this.isFixed = false;\n const selectedLocale = this.i18nService.getSelectedLocale();\n return this.getDependenciesFromContext(() => {\n WIDGET_LOGGER.info(() => `${this.props.name || this.constructor.name} is rendering.`);\n this._showView = this._showView || this.showView();\n if (this.state.hide \n || (!this.isVisible() && this.hideMode === HideMode.DONOT_ADD_TO_DOM)\n || !this._showView) {\n return null;\n }\n const classname = this.getStyleClassName();\n this.styles = this.theme.mergeStyle(\n this.getDefaultStyles(),\n {text: this.theme.getStyle('app-' + selectedLocale)},\n {text: this.theme.getStyle(this.defaultClass + '-' + selectedLocale)},\n props.disabled ? this.theme.getStyle(this.defaultClass + '-disabled') : null,\n this.isRTL ? this.theme.getStyle(this.defaultClass + '-rtl') : null,\n classname && this.theme.getStyle(classname),\n props.showindevice && this.theme.getStyle('d-all-none ' + props.showindevice.map(d => `d-${d}-flex`).join(' ')),\n this.theme.cleanseStyleProperties(this.props.styles),\n this.theme.cleanseStyleProperties({\n root: this.styleOverrides,\n text: this.styleOverrides\n }));\n if (this.styles.root.hasOwnProperty('_background')) {\n delete this.styles.root.backgroundColor;\n }\n if (!this.isVisible()) {\n assign(this.styles, this.theme.getStyle('hidden'))\n }\n let eleToRender = (this._showSkeleton && this.renderSkeleton(props));\n if (eleToRender) {\n return eleToRender;\n }\n this.setBackground();\n this.isFixed = (this.styles.root.position as any) === 'fixed';\n if (this.isFixed) {\n this.styles.root.position = undefined;\n return this.renderFixedContainer(props);\n }\n return this.addAnimation(this.renderWidget(this.state.props)); \n });\n }\n}\n"],"mappings":";;;;AAAA,SAASA,MAAM,EAAEC,WAAW,EAAEC,KAAK,QAAQ,QAAQ;AACnD,OAAOC,KAAK,MAAqB,OAAO;AACxC,SAASC,iBAAiB,EAAEC,QAAQ,QAA8B,cAAc;AAEhF,OAAO,KAAKC,UAAU,MAAM,yBAAyB;AACrD,OAAOC,cAAc,MAAM,kDAAkD;AAC7E,SAASC,UAAU,EAAEC,YAAY,QAAQ,8CAA8C;AACvF,SAASC,mBAAmB,QAAQ,uDAAuD;AAC3F,OAAOC,QAAQ,MAAM,yCAAyC;AAC9D,SAASC,WAAW,QAAQ,uCAAuC;AACnE,SAASC,QAAQ,QAAQ,sCAAsC;AAC/D,OAAOC,UAAU,IAA2BC,aAAa,EAAEC,UAAU,QAAe,iBAAiB;AACrG,OAAOC,aAAa,MAAM,kBAAkB;AAC5C,SAASC,aAAa,QAAQ,kBAAkB;AAChD,SAASC,QAAQ,QAAQ,WAAW;AACpC,SAASC,QAAQ,QAAQ,gBAAgB;AACzC,SAASC,aAAa,QAAQ,kBAAkB;AAChD,SAASC,SAAS,QAAQ,wBAAwB;AAClD,SAASC,o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,sBAAsB,CAAC,IAAI,CAACnL,KAAK,CAACtB,MAAM,CAAC,EACpD,IAAI,CAACuD,KAAK,CAACkJ,sBAAsB,CAAC;QAC9BtD,IAAI,EAAE,IAAI,CAACrH,cAAc;QACzB7B,IAAI,EAAE,IAAI,CAAC6B;MACf,CAAC,CAAC,CAAC;MACP,IAAI,IAAI,CAAC9B,MAAM,CAACmJ,IAAI,CAACuD,cAAc,CAAC,aAAa,CAAC,EAAE;QAChD,OAAO,IAAI,CAAC1M,MAAM,CAACmJ,IAAI,CAACwD,eAAe;MAC3C;MACA,IAAI,CAAC,IAAI,CAAC3E,SAAS,CAAC,CAAC,EAAE;QACnBnK,MAAM,CAAC,IAAI,CAACmC,MAAM,EAAE,IAAI,CAACuD,KAAK,CAACwB,QAAQ,CAAC,QAAQ,CAAC,CAAC;MACtD;MACA,IAAI6H,WAAW,GAAI,IAAI,CAAChB,aAAa,IAAI,IAAI,CAAC1D,cAAc,CAAC5G,KAAK,CAAE;MACpE,IAAIsL,WAAW,EAAE;QACb,OAAOA,WAAW;MACtB;MACA,IAAI,CAAClD,aAAa,CAAC,CAAC;MACpB,IAAI,CAAC/C,OAAO,GAAI,IAAI,CAAC3G,MAAM,CAACmJ,IAAI,CAACY,QAAQ,KAAa,OAAO;MAC7D,IAAI,IAAI,CAACpD,OAAO,EAAE;QACd,IAAI,CAAC3G,MAAM,CAACmJ,IAAI,CAACY,QAAQ,GAAIjK,SAAS;QACtC,OAAO,IAAI,CAAC4I,oBAAoB,CAACpH,KAAK,CAAC;MAC3C;MACA,OAAO,IAAI,CAAC+H,YAAY,CAAC,IAAI,CAACC,YAAY,CAAC,IAAI,CAACnI,KAAK,CAACG,KAAK,CAAC,CAAC;IACjE,CAAC,CAAC;EACN;AACJ","ignoreList":[]}
|
1
|
+
{"version":3,"names":["assign","isUndefined","isNil","React","AccessibilityInfo","Platform","Animatable","ThemeVariables","StyleProps","getStyleName","BackgroundComponent","injector","ROOT_LOGGER","deepCopy","BASE_THEME","ThemeConsumer","ThemeEvent","EventNotifier","PropsProvider","assignIn","HideMode","AssetConsumer","FixedView","TextIdPrefixConsumer","isScreenReaderEnabled","TappableContext","WIDGET_LOGGER","extend","ParentContext","createContext","BaseComponentState","constructor","_defineProperty","undefined","defineStyles","styles","text","fontFamily","INSTANCE","baseFont","userSelect","BaseProps","args","BaseComponent","Component","markupProps","defaultClass","defaultProps","defaultState","ADD_TO_DOM","createElement","Fragment","I18nService","get","state","notifier","name","props","propertyProvider","show","$new","$old","debug","initialized","styleName","styleOverrides","setTimeout","cleanRefresh","onPropertyChange","_showView","deferload","check","proxy","Proxy","target","prop","receiver","propName","toString","has","Reflect","set","value","overrideProp","updateState","cleanup","push","updateStateTimeouts","forEach","v","clearTimeout","theme","subscribe","CHANGE","forceUpdate","addEventListener","remove","destroyParentListeners","event","fn","notify","emitToParent","isRTL","i18nService","isRTLLocale","animate","setState","animationId","Date","now","animatableProps","setProp","setPropDefault","setDefault","getDefaultStyles","getStyle","reset","newPartialState","callback","destroyed","stateFn","oldState","oldProps","newState","Object","keys","k","onUpdateState","_this$props$listener","_this$props$listener2","listener","onComponentChange","timeoutId","splice","indexOf","shouldComponentUpdate","nextProps","nextState","nextContext","key","componentDidMount","onComponentInit","componentWillAttach","isFixed","hide","componentWillDetach","componentWillUnmount","onComponentDestroy","f","destroy","componentDidUpdate","prevProps","prevState","snapshot","invokeEventCallback","eventName","callBack","map","a","apply","e","console","error","showView","isVisible","refresh","renderSkeleton","parentListenerDestroyers","setParent","parent","copyStyles","property","from","to","renderFixedContainer","style","rootStyle","left","top","bottom","right","width","height","root","mergeStyle","addAnimation","renderWidget","n","View","_extends","setBackground","bgStyle","_background","image","backgroundImage","position","backgroundPosition","size","backgroundSize","repeat","backgroundRepeat","resizeMode","backgroundResizeMode","borderRadius","getTestId","suffix","id","testIdPrefix","getTestProps","OS","accessibilityLabel","testID","accessible","getStyleClassName","classname","getTestPropsForInput","getTestPropsForAction","getTestPropsForLabel","getDependenciesFromContext","Consumer","tappable","closestTappable","loadAsset","_this$parent","_showSkeleton","showskeleton","Provider","render","selectedLocale","getSelectedLocale","info","hideMode","DONOT_ADD_TO_DOM","disabled","showindevice","d","join","cleanseStyleProperties","hasOwnProperty","backgroundColor","eleToRender"],"sources":["base.component.tsx"],"sourcesContent":["import { assign, isUndefined, isNil } from 'lodash';\nimport React, { ReactNode } from 'react';\nimport { AccessibilityInfo, Platform, TextStyle, ViewStyle } from 'react-native';\nimport { AnimatableProps } from 'react-native-animatable';\nimport * as Animatable from 'react-native-animatable';\nimport ThemeVariables from '@wavemaker/app-rn-runtime/styles/theme.variables';\nimport { StyleProps, getStyleName } from '@wavemaker/app-rn-runtime/styles/style-props';\nimport { BackgroundComponent } from '@wavemaker/app-rn-runtime/styles/background.component';\nimport injector from '@wavemaker/app-rn-runtime/core/injector';\nimport { ROOT_LOGGER } from '@wavemaker/app-rn-runtime/core/logger';\nimport { deepCopy } from '@wavemaker/app-rn-runtime/core/utils';\nimport BASE_THEME, { NamedStyles, AllStyle, ThemeConsumer, ThemeEvent, Theme } from '../styles/theme';\nimport EventNotifier from './event-notifier';\nimport { PropsProvider } from './props.provider';\nimport { assignIn } from 'lodash-es';\nimport { HideMode } from './if.component';\nimport { AssetConsumer } from './asset.provider';\nimport { FixedView } from './fixed-view.component';\nimport { TextIdPrefixConsumer } from './testid.provider';\nimport { isScreenReaderEnabled } from './accessibility';\nimport { Tappable, TappableContext } from './tappable.component';\n\nexport const WIDGET_LOGGER = ROOT_LOGGER.extend('widget');\n\nexport const ParentContext = React.createContext(null as any);\n\nexport class BaseComponentState<T extends BaseProps> {\n public animationId?: number = 0;\n public animatableProps?: AnimatableProps<ViewStyle> = undefined;\n public props = {} as T;\n public hide? = false;\n}\n\nexport type BaseStyles = NamedStyles<any> & {\n root: AllStyle,\n text: TextStyle & {userSelect?: 'none'| 'text'}\n}\n\nexport function defineStyles<T>(styles: T): T {\n return deepCopy({\n text: {\n fontFamily: ThemeVariables.INSTANCE.baseFont,\n userSelect: 'text'\n }\n }, styles);\n}\n\nexport interface LifecycleListener {\n onComponentChange?: (c: BaseComponent<any, any, any>) => void;\n onComponentInit?: (c: BaseComponent<any, any, any>) => void;\n onComponentDestroy?: (c: BaseComponent<any, any, any>) => void;\n}\n\nexport class BaseProps extends StyleProps {\n id?: string = null as any;\n name?: string = null as any;\n key?: any = null as any;\n disabled? = false;\n show? = true as Boolean | String | Number;\n styles?: any = null;\n classname?: string = null as any;\n listener?: LifecycleListener = null as any;\n showindevice?: ('xs'|'sm'|'md'|'lg'|'xl'|'xxl')[] = null as any;\n showskeleton?: boolean = false;\n deferload?: boolean = false;\n}\n\nexport abstract class BaseComponent<T extends BaseProps, S extends BaseComponentState<T>, L extends BaseStyles> extends React.Component<T, S> {\n public styles: L = null as any;\n public hideMode = HideMode.ADD_TO_DOM;\n private propertyProvider: PropsProvider<T>;\n public proxy: BaseComponent<T, S, L>;\n public initialized = false;\n public cleanup = [] as Function[];\n public theme = BASE_THEME;\n public updateStateTimeouts= [] as NodeJS.Timeout[];\n public parent: BaseComponent<any, any, any> = null as any;\n public destroyed = false;\n public _showSkeleton = false;\n public isFixed = false;\n private notifier = new EventNotifier();\n private parentListenerDestroyers = [] as Function[];\n public _background = <></>;\n private styleOverrides = {} as any;\n public loadAsset: (path: string) => number | string = null as any;\n private i18nService = injector.I18nService.get();\n public testIdPrefix = '';\n private _showView = true;\n public closestTappable?: Tappable;\n\n constructor(markupProps: T, public defaultClass: string, defaultProps?: T, defaultState?: S) {\n super(markupProps);\n this.state = (defaultState || {} as S);\n this.notifier.name = this.props.name || '';\n this.propertyProvider = new PropsProvider<T>(\n assign({show: true}, defaultProps),\n assign({}, markupProps),\n (name: string, $new: any, $old: any) => {\n WIDGET_LOGGER.debug(() => `${this.props.name || this.constructor.name}: ${name} changed from ${$old} to ${$new}`);\n if (this.initialized) {\n const styleName = getStyleName(name);\n if (styleName) {\n if ($new === undefined) {\n delete this.styleOverrides[styleName];\n } else {\n this.styleOverrides[styleName] = $new;\n }\n }\n }\n if (name === 'showskeleton' && this.initialized) {\n setTimeout(() => this.cleanRefresh(), 100);\n }\n this.onPropertyChange(name, $new, $old);\n });\n //@ts-ignore\n this.state.props =this.propertyProvider.get();\n //@ts-ignore\n this._showView = !this.props.deferload;\n this.propertyProvider.check();\n //@ts-ignore\n this.proxy = (new Proxy(this, {\n get: (target, prop, receiver): any => {\n const propName = prop.toString();\n if (this.propertyProvider.has(propName)) {\n //@ts-ignore\n return this.state.props[propName];\n }\n return Reflect.get(target, prop, receiver);\n },\n set: (target: any, prop, value: any): any => {\n const propName = prop.toString();\n if (this.propertyProvider.has(propName)) {\n // @ts-ignore\n const props = {} as any;\n this.propertyProvider.overrideProp(propName, value);\n props[propName] = value;\n this.updateState({\n props: props\n } as S);\n return true;\n } else {\n return Reflect.set(target, prop, value);\n }\n }\n }));\n this.cleanup.push(() => {\n this.updateStateTimeouts.forEach(v => clearTimeout(v));\n });\n this.cleanup.push(this.theme.subscribe(ThemeEvent.CHANGE, () => {\n this.forceUpdate();\n }));\n this.cleanup.push(AccessibilityInfo.addEventListener('screenReaderChanged',\n () => {\n setTimeout(() => {\n this.forceUpdate();\n }, 100);\n },\n ).remove);\n this.cleanup.push(() => {\n this.destroyParentListeners();\n });\n }\n\n public subscribe(event: string, fn: Function) {\n return this.notifier.subscribe(event, fn);\n }\n\n public notify(event: string, args: any[], emitToParent = false) {\n return this.notifier.notify(event, args, emitToParent);\n }\n\n public get isRTL(){\n return this.i18nService.isRTLLocale();\n }\n\n public animate(props: AnimatableProps<ViewStyle>) {\n this.setState({\n animationId: Date.now(),\n animatableProps: props\n });\n }\n\n setProp(propName: string, value: any) {\n this.propertyProvider.set(propName, value);\n this.updateState({props:{}} as S);\n }\n\n setPropDefault(propName: string, value: any) {\n this.propertyProvider.setDefault(propName, value);\n }\n \n onPropertyChange(name: string, $new: any, $old: any) { \n }\n \n getDefaultStyles() {\n return this.theme.getStyle(this.defaultClass);\n }\n\n reset() {\n\n }\n\n updateState(newPartialState: S, callback?: ()=>void) {\n if (this.destroyed) {\n return;\n }\n const stateFn = (oldState: S) => {\n const oldProps = oldState.props;\n const newState = this.initialized ? assignIn({}, oldState, newPartialState) : assignIn(oldState, newPartialState);\n if (newPartialState.props) {\n Object.keys(newPartialState.props).forEach((k) => {\n //@ts-ignore\n oldProps[k] = newState.props[k];\n });\n newState.props = oldProps;\n }\n return newState;\n };\n const onUpdateState = () => {\n callback && callback();\n this.props.listener?.onComponentChange\n && this.props.listener?.onComponentChange(this);\n }\n if (!this.initialized) {\n this.state = stateFn(this.state);\n onUpdateState();\n } else {\n const timeoutId = setTimeout(() => {\n this.setState(stateFn, onUpdateState);\n this.updateStateTimeouts.splice(this.updateStateTimeouts.indexOf(timeoutId), 1);\n });\n this.updateStateTimeouts.push(timeoutId);\n }\n }\n\n shouldComponentUpdate(nextProps: T, nextState: S, nextContext: any) {\n if (this.propertyProvider.check(nextProps)) {\n return true;\n }\n for(let key in nextState) {\n if(key !== 'props' && (!(key in this.state) || nextState[key] !== this.state[key])) {\n return true;\n }\n }\n\n for(let key in this.state) {\n if(key !== 'props' && (!(key in nextState) || this.state[key] !== nextState[key])) {\n return true;\n }\n }\n return false;\n }\n\n componentDidMount() {\n if (this.props.listener && this.props.listener.onComponentInit) {\n this.props.listener.onComponentInit(this.proxy);\n }\n this.initialized = true;\n }\n\n componentWillAttach() {\n if (this.isFixed) {\n this.setState({hide: false});\n }\n }\n\n componentWillDetach() {\n if (this.isFixed) {\n this.setState({hide: true});\n }\n }\n\n componentWillUnmount() {\n this.destroyed = true;\n if (this.props.listener && this.props.listener.onComponentDestroy) {\n this.props.listener.onComponentDestroy(this.proxy);\n }\n this.cleanup.forEach(f => f && f());\n this.notifier.destroy();\n this.notifier.notify('destroy', []);\n }\n \n componentDidUpdate(prevProps: Readonly<T>, prevState: Readonly<S>, snapshot?: any): void {\n if (this.propertyProvider.check(this.props)) {\n this.forceUpdate();\n }\n }\n\n invokeEventCallback(eventName: string, args: any[]) {\n //@ts-ignore\n const callBack: Function = this.props[eventName];\n args = args && args.map(a => (a === this) ? this.proxy : a)\n if (callBack) {\n try {\n return callBack.apply(this.proxy, args);\n } catch(e) {\n console.error(e);\n }\n }\n }\n\n showView() {\n return this.isVisible();\n }\n\n isVisible() {\n const show = this.state.props.show;\n return show !== false && show !== 'false' && show !== '0' && !isNil(show) && show !== \"\";\n }\n\n protected abstract renderWidget(props: T): ReactNode;\n\n public refresh() {\n this.forceUpdate();\n }\n\n public cleanRefresh() {\n this.forceUpdate(() => this.notifier.notify('forceUpdate', []));\n }\n \n public renderSkeleton (props: T): ReactNode {\n return null;\n }\n\n public destroyParentListeners() {\n this.parentListenerDestroyers.map(fn => fn());\n }\n\n private setParent(parent: BaseComponent<any, any, any>) {\n if (parent && this.parent !== parent) {\n this.parent = parent;\n this.notifier.setParent(parent.notifier);\n this.parentListenerDestroyers = [\n this.parent.subscribe('forceUpdate', () => {\n this.cleanRefresh();\n }),\n this.parent.subscribe('destroy', () => {\n this.destroyParentListeners();\n })\n ];\n }\n }\n\n copyStyles(property: string, from: any, to: any) {\n if (!isUndefined(from[property])) {\n to[property] = from[property];\n }\n }\n\n renderFixedContainer(props: T) {\n const style = {} as ViewStyle;\n const rootStyle = {\n left: 0,\n top: 0,\n bottom: 0,\n right: 0,\n width: \"100%\",\n height: \"100%\"\n } as ViewStyle;\n this.copyStyles('left', this.styles.root, style);\n this.copyStyles('top', this.styles.root, style);\n this.copyStyles('right', this.styles.root, style);\n this.copyStyles('bottom', this.styles.root, style);\n this.copyStyles('width', this.styles.root, style);\n this.copyStyles('height', this.styles.root, style);\n this.styles = this.theme.mergeStyle(this.styles, {root: rootStyle});\n return (<FixedView style={style} theme={this.theme}>{this.addAnimation(this.renderWidget(props))}</FixedView>);\n }\n\n private addAnimation(n: ReactNode) {\n if (!this.state.animatableProps) {\n return n;\n }\n return (<Animatable.View key={this.state.animationId} {...this.state.animatableProps}>{n}</Animatable.View>);\n }\n \n private setBackground() {\n const bgStyle = this.styles.root as any;\n this._background = (\n <BackgroundComponent \n image={bgStyle.backgroundImage}\n position={bgStyle.backgroundPosition}\n size={bgStyle.backgroundSize}\n repeat={bgStyle.backgroundRepeat}\n resizeMode={bgStyle.backgroundResizeMode}\n style={{borderRadius: this.styles.root.borderRadius}}>\n </BackgroundComponent>\n );\n delete (this.styles.root as any)['backgroundImage'];\n delete (this.styles.root as any)['backgroundPosition'];\n delete (this.styles.root as any)['backgroundResizeMode'];\n delete (this.styles.root as any)['backgroundSize'];\n delete (this.styles.root as any)['backgroundRepeat'];\n }\n\n public getTestId(suffix?: string) {\n let id = this.props.id || this.props.name;\n if (this.testIdPrefix) {\n id = this.testIdPrefix + '_' + id;\n }\n if (suffix) {\n id = id + '_' + suffix;\n }\n return id;\n }\n\n public getTestProps(suffix?: string) {\n let id = this.getTestId(suffix);\n if (isScreenReaderEnabled()) {\n return {};\n }\n if (Platform.OS === 'android' || Platform.OS === 'web') {\n return {\n accessibilityLabel: id,\n testID: id\n };\n }\n return {\n accessible: false,\n testID: id\n };\n }\n\n public getStyleClassName() {\n return this.state.props.classname;\n }\n\n public getTestPropsForInput(suffix?: string) {\n return this.getTestProps(suffix || 'i');\n }\n\n public getTestPropsForAction(suffix?: string) {\n return this.getTestProps(suffix || 'a');\n }\n\n public getTestPropsForLabel(suffix?: string) {\n return this.getTestProps(suffix || 'l');\n }\n\n private getDependenciesFromContext(fn: () => ReactNode) {\n return (\n <TappableContext.Consumer>{(tappable) => {\n this.closestTappable = tappable;\n return (\n <TextIdPrefixConsumer>\n {(testIdPrefix) => {\n this.testIdPrefix = testIdPrefix || '';\n return (<AssetConsumer>\n {(loadAsset) => {\n this.loadAsset = loadAsset;\n return (<ParentContext.Consumer>\n {(parent) => {\n this.setParent(parent);\n this._showSkeleton = this.parent?._showSkeleton \n || !!this.state.props.showskeleton;\n return (\n <ParentContext.Provider value={this}>\n <ThemeConsumer>\n {(theme) => { \n this.theme = theme || BASE_THEME;\n return fn();\n }}\n </ThemeConsumer>\n </ParentContext.Provider>);\n }} \n </ParentContext.Consumer>);\n }}\n </AssetConsumer>);\n }}\n </TextIdPrefixConsumer>)}}\n </TappableContext.Consumer>); \n }\n \n public render(): ReactNode {\n const props = this.state.props;\n this.isFixed = false;\n const selectedLocale = this.i18nService.getSelectedLocale();\n return this.getDependenciesFromContext(() => {\n WIDGET_LOGGER.info(() => `${this.props.name || this.constructor.name} is rendering.`);\n this._showView = this._showView || this.showView();\n if (this.state.hide \n || (!this.isVisible() && this.hideMode === HideMode.DONOT_ADD_TO_DOM)\n || !this._showView) {\n return null;\n }\n const classname = this.getStyleClassName();\n this.styles = this.theme.mergeStyle(\n this.getDefaultStyles(),\n {text: this.theme.getStyle('app-' + selectedLocale)},\n {text: this.theme.getStyle(this.defaultClass + '-' + selectedLocale)},\n props.disabled ? this.theme.getStyle(this.defaultClass + '-disabled') : null,\n this.isRTL ? this.theme.getStyle(this.defaultClass + '-rtl') : null,\n classname && this.theme.getStyle(classname),\n props.showindevice && this.theme.getStyle('d-all-none ' + props.showindevice.map(d => `d-${d}-flex`).join(' ')),\n this.theme.cleanseStyleProperties(this.props.styles),\n this.theme.cleanseStyleProperties({\n root: this.styleOverrides,\n text: this.styleOverrides\n }));\n if (this.styles.root.hasOwnProperty('_background')) {\n delete this.styles.root.backgroundColor;\n }\n if (!this.isVisible()) {\n assign(this.styles, this.theme.getStyle('hidden'))\n }\n let eleToRender = (this._showSkeleton && this.renderSkeleton(props));\n if (eleToRender) {\n return eleToRender;\n }\n this.setBackground();\n this.isFixed = (this.styles.root.position as any) === 'fixed';\n if (this.isFixed) {\n this.styles.root.position = undefined;\n return this.renderFixedContainer(props);\n }\n return this.addAnimation(this.renderWidget(this.state.props)); \n });\n }\n}\n"],"mappings":";;;;AAAA,SAASA,MAAM,EAAEC,WAAW,EAAEC,KAAK,QAAQ,QAAQ;AACnD,OAAOC,KAAK,MAAqB,OAAO;AACxC,SAASC,iBAAiB,EAAEC,QAAQ,QAA8B,cAAc;AAEhF,O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;MACpE,IAAIuL,WAAW,EAAE;QACb,OAAOA,WAAW;MACtB;MACA,IAAI,CAAClD,aAAa,CAAC,CAAC;MACpB,IAAI,CAAC/C,OAAO,GAAI,IAAI,CAAC5G,MAAM,CAACoJ,IAAI,CAACY,QAAQ,KAAa,OAAO;MAC7D,IAAI,IAAI,CAACpD,OAAO,EAAE;QACd,IAAI,CAAC5G,MAAM,CAACoJ,IAAI,CAACY,QAAQ,GAAIlK,SAAS;QACtC,OAAO,IAAI,CAAC6I,oBAAoB,CAACrH,KAAK,CAAC;MAC3C;MACA,OAAO,IAAI,CAACgI,YAAY,CAAC,IAAI,CAACC,YAAY,CAAC,IAAI,CAACpI,KAAK,CAACG,KAAK,CAAC,CAAC;IACjE,CAAC,CAAC;EACN;AACJ","ignoreList":[]}
|
@@ -23,6 +23,7 @@ const WmCursor = /*#__PURE__*/React.memo(props => {
|
|
23
23
|
runAnimation();
|
24
24
|
}, []);
|
25
25
|
return /*#__PURE__*/React.createElement(Animated.View, {
|
26
|
+
testID: "wm-custom-cursor",
|
26
27
|
style: {
|
27
28
|
backgroundColor: props.color,
|
28
29
|
width: 2,
|
@@ -33,7 +34,7 @@ const WmCursor = /*#__PURE__*/React.memo(props => {
|
|
33
34
|
});
|
34
35
|
});
|
35
36
|
export const WMTextInput = /*#__PURE__*/React.forwardRef((props, ref) => {
|
36
|
-
var _props$floatingLabel;
|
37
|
+
var _props$customDisplayV, _props$floatingLabel;
|
37
38
|
const [selectRange, setSelectRange] = useState(null);
|
38
39
|
const [isInputFocused, setIsInputFocused] = useState(false);
|
39
40
|
const [iMask, setIMask] = useState(null);
|
@@ -123,7 +124,7 @@ export const WMTextInput = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
123
124
|
}, [iMask, value, displayValue, props.onChangeText]);
|
124
125
|
const valueExpr = Platform.OS === 'web' ? 'value' : 'defaultValue';
|
125
126
|
const opts = {};
|
126
|
-
opts[valueExpr] = value.current;
|
127
|
+
opts[valueExpr] = (_props$customDisplayV = props.customDisplayValue) !== null && _props$customDisplayV !== void 0 ? _props$customDisplayV : value.current;
|
127
128
|
const textStyle = Object.assign({}, ...(isArray(props.style) ? props.style : [props.style]));
|
128
129
|
const hideInput = props.displayformat || props.maskchar;
|
129
130
|
return /*#__PURE__*/React.createElement(React.Fragment, null, props.floatingLabel ? /*#__PURE__*/React.createElement(FloatingLabel, {
|
@@ -133,7 +134,7 @@ export const WMTextInput = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
133
134
|
...(props.floatingLabelStyle || []),
|
134
135
|
...(isInputFocused ? props.activeFloatingLabelStyle || {} : {})
|
135
136
|
}
|
136
|
-
}) : null, /*#__PURE__*/React.createElement(TextInput, _extends({}, props, hideInput ? opts : {}, {
|
137
|
+
}) : null, /*#__PURE__*/React.createElement(TextInput, _extends({}, props, hideInput || props.customDisplayValue ? opts : {}, {
|
137
138
|
placeholder: props.floatingLabel || displayValue ? '' : props.placeholder,
|
138
139
|
style: [props.style, hideInput ? {
|
139
140
|
color: 'transparent',
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["React","useCallback","useEffect","useRef","useState","Animated","Platform","Text","TextInput","View","isArray","IMask","FloatingLabel","WmCursor","memo","props","opacityAnimation","Value","current","runAnimation","timing","toValue","duration","useNativeDriver","start","createElement","style","backgroundColor","color","width","marginHorizontal","height","opacity","WMTextInput","forwardRef","ref","_props$floatingLabel","selectRange","setSelectRange","isInputFocused","setIsInputFocused","iMask","setIMask","displayCursor","setDisplayCursor","value","x","forceUpdate","displayValue","setDisplayValue","element","displayformat","MaskedPattern","mask","skipInvalid","lazy","definitions","typedValue","defaultValue","onChangeText","setTimeout","OS","maskchar","_element$current","setSelectionRange","length","onSelectionChange","e","_e$nativeEvent","selection","nativeEvent","allowContentSelection","end","text","_value","substring","slice","formattedValue","replace","valueExpr","opts","textStyle","Object","assign","hideInput","Fragment","floatingLabel","moveUp","label","placeholder","floatingLabelStyle","activeFloatingLabelStyle","_extends","borderColor","zIndex","onFocus","_props$onFocus","call","target","onBlur","_props$onBlur","caretHidden","selectionColor","cursorColor","onChange","contextMenuHidden","display","flexDirection","alignItems","marginTop","minHeight","undefined","padding","fontFamily","fontSize","fontWeight"],"sources":["textinput.component.tsx"],"sourcesContent":["import React, { ForwardedRef, useCallback, useEffect, useRef, useState } from 'react';\nimport { Animated, Platform, Text, TextInput, TextInputProps, TextStyle, View } from 'react-native';\nimport { isArray } from 'lodash';\nimport IMask from 'imask';\nimport { FloatingLabel } from './floatinglabel.component';\n\ninterface SelectRange {\n start: number,\n end: number\n}\n\nconst WmCursor = React.memo((props: {\n color: string,\n height: number\n}) => {\n const opacityAnimation = useRef(new Animated.Value(0.5)).current;\n const runAnimation = useCallback(() => {\n Animated.timing(opacityAnimation, {\n toValue: 0.2,\n duration: 500,\n useNativeDriver: true\n }).start(() => {\n Animated.timing(opacityAnimation, {\n toValue: 0.6,\n duration: 500,\n useNativeDriver: true\n }).start(runAnimation);\n });\n }, []);\n useEffect(() => {\n runAnimation();\n }, []);\n return (\n <Animated.View style={{\n backgroundColor: props.color,\n width: 2,\n marginHorizontal: 1,\n height: props.height,\n opacity: opacityAnimation\n }}></Animated.View>\n );\n});\n\nexport const WMTextInput = React.forwardRef((props: (TextInputProps & \n {allowContentSelection: boolean,\n displayformat: string,\n maskchar: string,\n floatingLabel: string\n floatingLabelStyle: TextStyle,\n activeFloatingLabelStyle: TextStyle\n }), \n ref: ForwardedRef<TextInput>) => {\n const [selectRange, setSelectRange] = useState<SelectRange>(null as any);\n const [isInputFocused, setIsInputFocused] = useState(false);\n const [iMask, setIMask] = useState(null as any);\n const [displayCursor, setDisplayCursor] = useState(false);\n const value = useRef(props.value || '');\n const [x, forceUpdate] = useState(1);\n const [displayValue, setDisplayValue] = useState('');\n const element = useRef(null as any);\n // iMask initialization\n useEffect(() => {\n const iMask: any = props.displayformat ? new IMask.MaskedPattern({\n mask: props.displayformat,\n skipInvalid: true,\n lazy: false,\n definitions: {\n '9': /\\d/,\n 'A': /[a-zA-Z]/,\n 'a': /[a-z]/,\n '*': /\\w/\n }\n }) : null;\n if (iMask) {\n iMask.typedValue = value;\n setDisplayValue(iMask.displayValue)\n setIMask(iMask);\n }\n },[props.displayformat]);\n // set default value\n useEffect(() => {\n const defaultValue = props.defaultValue || props.value || '';\n if (defaultValue && !value.current) {\n value.current = defaultValue;\n onChangeText(defaultValue);\n }\n },[props.defaultValue, props.value]);\n // set cursor position in windows\n useEffect(() => {\n setTimeout(() => {\n if (Platform.OS === 'web' && (props.displayformat || props.maskchar)) {\n element?.current?.setSelectionRange(value.current.length, value.current.length);\n }\n }, 100);\n }, [value.current, props]);\n const onSelectionChange = useCallback((e: any) => {\n if (Platform.OS !== 'android') {\n return;\n }\n const selection = e?.nativeEvent?.selection;\n if (!props.allowContentSelection\n && selection\n && selection.end - selection.start > 0) {\n setSelectRange({\n start: value.current.length + 2,\n end: value.current.length + 2\n });\n } else if (selectRange && selectRange.end > 0){\n setSelectRange(null as any);\n }\n }, [props.allowContentSelection, value]);\n // when text changes\n const onChangeText = useCallback((text: string) => {\n if (!(iMask || props.maskchar)) {\n value.current = text;\n props.onChangeText && props.onChangeText(text);\n return;\n }\n let _value = value.current || '';\n if (value.current.length - text.length > 0) {\n _value = _value.substring(0, _value.length - (value.current.length - text.length));\n } else if (text.length - value.current.length > 0) {\n _value += text.slice(-1 * (text.length - value.current.length));\n }\n let formattedValue = _value;\n if(props.maskchar) {\n formattedValue = (_value.replace(/./g, props.maskchar));\n }\n if (iMask) {\n iMask.typedValue = _value;\n formattedValue = iMask.displayValue;\n }\n if (formattedValue !== displayValue) {\n value.current = _value;\n props.onChangeText && props.onChangeText(_value);\n }\n forceUpdate(x+ 1);\n setDisplayValue(formattedValue);\n }, [iMask, value, displayValue, props.onChangeText]);\n const valueExpr = Platform.OS === 'web' ? 'value' : 'defaultValue';\n const opts = {} as any;\n opts[valueExpr] = value.current;\n const textStyle = Object.assign({}, ...isArray(props.style) ? props.style: [props.style]);\n const hideInput = props.displayformat || props.maskchar;\n return (\n <>\n {props.floatingLabel ? (\n <FloatingLabel\n moveUp={!!(value.current || isInputFocused || displayValue)}\n label={props.floatingLabel ?? props.placeholder} \n style={{\n ...(props.floatingLabelStyle || []),\n ...(isInputFocused ? (props.activeFloatingLabelStyle || {}) : {})\n }}/>\n ) : null}\n <TextInput\n {...props}\n {...hideInput ? opts: {}}\n placeholder={props.floatingLabel || displayValue ? '' : props.placeholder }\n style={[props.style, hideInput ? {\n color: 'transparent', \n backgroundColor: 'transparent',\n borderColor: 'transparent',\n zIndex: 1\n } : {}]}\n onFocus={(e) => {\n props.onFocus?.(e);\n setIsInputFocused(true);\n setDisplayCursor(true);\n element.current = e.target;\n }}\n onBlur={(e) => {\n props?.onBlur?.(e);\n setIsInputFocused(false);\n setDisplayCursor(false);\n }}\n ref={ref}\n selection={selectRange}\n onSelectionChange={onSelectionChange}\n caretHidden={!!selectRange?.end}\n onChangeText={(text) => {\n onChangeText(text);\n }}\n {...hideInput ? {\n selectionColor: 'transparent',\n cursorColor: 'transparent',\n onChange : () => {}\n }: {}}\n contextMenuHidden={!props.allowContentSelection}\n ></TextInput>\n {\n hideInput ? (\n <View style={[props.style, {\n display: 'flex',\n flexDirection: 'row',\n alignItems: 'center',\n marginTop: -1 * (textStyle.height || textStyle.minHeight || 0)\n + (textStyle.marginTop || 0)}]}>\n <Text style={{ \n width: undefined,\n backgroundColor: 'transparent', \n borderColor: 'transparent',\n padding: 0,\n display: 'flex',\n color: textStyle.color,\n fontFamily: textStyle.fontFamily,\n fontSize: textStyle.fontSize,\n fontWeight: textStyle.fontWeight\n }}>\n {displayValue}\n </Text>\n {\n (displayCursor && !props.displayformat) ? React.createElement(WmCursor, {\n color: textStyle.color || '#000000',\n height: textStyle.fontSize || 14\n }) : null\n }\n </View>\n ) : null\n }\n </>\n );\n});"],"mappings":";AAAA,OAAOA,KAAK,IAAkBC,WAAW,EAAEC,SAAS,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,OAAO;AACrF,S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AI,CAAC5B,KAAK,CAACoC,aAAa,gBAAInD,KAAK,CAACyB,aAAa,CAACZ,QAAQ,EAAE;IACtEe,KAAK,EAAEqD,SAAS,CAACrD,KAAK,IAAI,SAAS;IACnCG,MAAM,EAAEkD,SAAS,CAACiC,QAAQ,IAAI;EAChC,CAAC,CAAC,GAAG,IAEH,CAAC,GACL,IAEN,CAAC;AAET,CAAC,CAAC","ignoreList":[]}
|
1
|
+
{"version":3,"names":["React","useCallback","useEffect","useRef","useState","Animated","Platform","Text","TextInput","View","isArray","IMask","FloatingLabel","WmCursor","memo","props","opacityAnimation","Value","current","runAnimation","timing","toValue","duration","useNativeDriver","start","createElement","testID","style","backgroundColor","color","width","marginHorizontal","height","opacity","WMTextInput","forwardRef","ref","_props$customDisplayV","_props$floatingLabel","selectRange","setSelectRange","isInputFocused","setIsInputFocused","iMask","setIMask","displayCursor","setDisplayCursor","value","x","forceUpdate","displayValue","setDisplayValue","element","displayformat","MaskedPattern","mask","skipInvalid","lazy","definitions","typedValue","defaultValue","onChangeText","setTimeout","OS","maskchar","_element$current","setSelectionRange","length","onSelectionChange","e","_e$nativeEvent","selection","nativeEvent","allowContentSelection","end","text","_value","substring","slice","formattedValue","replace","valueExpr","opts","customDisplayValue","textStyle","Object","assign","hideInput","Fragment","floatingLabel","moveUp","label","placeholder","floatingLabelStyle","activeFloatingLabelStyle","_extends","borderColor","zIndex","onFocus","_props$onFocus","call","target","onBlur","_props$onBlur","caretHidden","selectionColor","cursorColor","onChange","contextMenuHidden","display","flexDirection","alignItems","marginTop","minHeight","undefined","padding","fontFamily","fontSize","fontWeight"],"sources":["textinput.component.tsx"],"sourcesContent":["import React, { ForwardedRef, useCallback, useEffect, useRef, useState } from 'react';\nimport { Animated, Platform, Text, TextInput, TextInputProps, TextStyle, View } from 'react-native';\nimport { isArray } from 'lodash';\nimport IMask from 'imask';\nimport { FloatingLabel } from './floatinglabel.component';\n\ninterface SelectRange {\n start: number,\n end: number\n}\n\nconst WmCursor = React.memo((props: {\n color: string,\n height: number\n}) => {\n const opacityAnimation = useRef(new Animated.Value(0.5)).current;\n const runAnimation = useCallback(() => {\n Animated.timing(opacityAnimation, {\n toValue: 0.2,\n duration: 500,\n useNativeDriver: true\n }).start(() => {\n Animated.timing(opacityAnimation, {\n toValue: 0.6,\n duration: 500,\n useNativeDriver: true\n }).start(runAnimation);\n });\n }, []);\n useEffect(() => {\n runAnimation();\n }, []);\n return (\n <Animated.View \n testID=\"wm-custom-cursor\"\n style={{\n backgroundColor: props.color,\n width: 2,\n marginHorizontal: 1,\n height: props.height,\n opacity: opacityAnimation\n }}></Animated.View>\n );\n});\n\nexport const WMTextInput = React.forwardRef((props: (TextInputProps & \n {allowContentSelection: boolean,\n displayformat: string,\n maskchar: string,\n floatingLabel: string\n floatingLabelStyle: TextStyle,\n activeFloatingLabelStyle: TextStyle,\n customDisplayValue?: string\n }), \n ref: ForwardedRef<TextInput>) => {\n const [selectRange, setSelectRange] = useState<SelectRange>(null as any);\n const [isInputFocused, setIsInputFocused] = useState(false);\n const [iMask, setIMask] = useState(null as any);\n const [displayCursor, setDisplayCursor] = useState(false);\n const value = useRef(props.value || '');\n const [x, forceUpdate] = useState(1);\n const [displayValue, setDisplayValue] = useState('');\n const element = useRef(null as any);\n // iMask initialization\n useEffect(() => {\n const iMask: any = props.displayformat ? new IMask.MaskedPattern({\n mask: props.displayformat,\n skipInvalid: true,\n lazy: false,\n definitions: {\n '9': /\\d/,\n 'A': /[a-zA-Z]/,\n 'a': /[a-z]/,\n '*': /\\w/\n }\n }) : null;\n if (iMask) {\n iMask.typedValue = value;\n setDisplayValue(iMask.displayValue)\n setIMask(iMask);\n }\n },[props.displayformat]);\n // set default value\n useEffect(() => {\n const defaultValue = props.defaultValue || props.value || '';\n if (defaultValue && !value.current) {\n value.current = defaultValue;\n onChangeText(defaultValue);\n }\n },[props.defaultValue, props.value]);\n // set cursor position in windows\n useEffect(() => {\n setTimeout(() => {\n if (Platform.OS === 'web' && (props.displayformat || props.maskchar)) {\n element?.current?.setSelectionRange(value.current.length, value.current.length);\n }\n }, 100);\n }, [value.current, props]);\n const onSelectionChange = useCallback((e: any) => {\n if (Platform.OS !== 'android') {\n return;\n }\n const selection = e?.nativeEvent?.selection;\n if (!props.allowContentSelection\n && selection\n && selection.end - selection.start > 0) {\n setSelectRange({\n start: value.current.length + 2,\n end: value.current.length + 2\n });\n } else if (selectRange && selectRange.end > 0){\n setSelectRange(null as any);\n }\n }, [props.allowContentSelection, value]);\n // when text changes\n const onChangeText = useCallback((text: string) => {\n if (!(iMask || props.maskchar)) {\n value.current = text;\n props.onChangeText && props.onChangeText(text);\n return;\n }\n let _value = value.current || '';\n if (value.current.length - text.length > 0) {\n _value = _value.substring(0, _value.length - (value.current.length - text.length));\n } else if (text.length - value.current.length > 0) {\n _value += text.slice(-1 * (text.length - value.current.length));\n }\n let formattedValue = _value;\n if(props.maskchar) {\n formattedValue = (_value.replace(/./g, props.maskchar));\n }\n if (iMask) {\n iMask.typedValue = _value;\n formattedValue = iMask.displayValue;\n }\n if (formattedValue !== displayValue) {\n value.current = _value;\n props.onChangeText && props.onChangeText(_value);\n }\n forceUpdate(x+ 1);\n setDisplayValue(formattedValue);\n }, [iMask, value, displayValue, props.onChangeText]);\n const valueExpr = Platform.OS === 'web' ? 'value' : 'defaultValue';\n const opts = {} as any;\n opts[valueExpr] = props.customDisplayValue ?? value.current;\n const textStyle = Object.assign({}, ...isArray(props.style) ? props.style: [props.style]);\n const hideInput = props.displayformat || props.maskchar;\n return (\n <>\n {props.floatingLabel ? (\n <FloatingLabel\n moveUp={!!(value.current || isInputFocused || displayValue)}\n label={props.floatingLabel ?? props.placeholder} \n style={{\n ...(props.floatingLabelStyle || []),\n ...(isInputFocused ? (props.activeFloatingLabelStyle || {}) : {})\n }}/>\n ) : null}\n <TextInput\n {...props}\n {...hideInput || props.customDisplayValue ? opts: {}}\n placeholder={props.floatingLabel || displayValue ? '' : props.placeholder }\n style={[props.style, hideInput ? {\n color: 'transparent', \n backgroundColor: 'transparent',\n borderColor: 'transparent',\n zIndex: 1\n } : {}]}\n onFocus={(e) => {\n props.onFocus?.(e);\n setIsInputFocused(true);\n setDisplayCursor(true);\n element.current = e.target;\n }}\n onBlur={(e) => {\n props?.onBlur?.(e);\n setIsInputFocused(false);\n setDisplayCursor(false);\n }}\n ref={ref}\n selection={selectRange}\n onSelectionChange={onSelectionChange}\n caretHidden={!!selectRange?.end}\n onChangeText={(text) => {\n onChangeText(text);\n }}\n {...hideInput ? {\n selectionColor: 'transparent',\n cursorColor: 'transparent',\n onChange : () => {}\n }: {}}\n contextMenuHidden={!props.allowContentSelection}\n ></TextInput>\n {\n hideInput ? (\n <View style={[props.style, {\n display: 'flex',\n flexDirection: 'row',\n alignItems: 'center',\n marginTop: -1 * (textStyle.height || textStyle.minHeight || 0)\n + (textStyle.marginTop || 0)}]}>\n <Text style={{ \n width: undefined,\n backgroundColor: 'transparent', \n borderColor: 'transparent',\n padding: 0,\n display: 'flex',\n color: textStyle.color,\n fontFamily: textStyle.fontFamily,\n fontSize: textStyle.fontSize,\n fontWeight: textStyle.fontWeight\n }}>\n {displayValue}\n </Text>\n {\n (displayCursor && !props.displayformat) ? React.createElement(WmCursor, {\n color: textStyle.color || '#000000',\n height: textStyle.fontSize || 14\n }) : null\n }\n </View>\n ) : null\n }\n </>\n );\n});"],"mappings":";AAAA,OAAOA,KAAK,IAAkBC,WAAW,EAAEC,SAAS,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,OAAO;AACrF,SAASC,QAAQ,EAAEC,QAAQ,EAAEC,IAAI,EAAEC,SAAS,EAA6BC,IAAI,QAAQ,cAAc;AACnG,SAASC,OAAO,QAAQ,QAAQ;AAChC,OAAOC,KAAK,MAAM,OAAO;AACzB,SAASC,aAAa,QAAQ,2BAA2B;AAOzD,MAAMC,QAAQ,gBAAGb,KAAK,CAACc,IAAI,CAAEC,KAG5B,IAAK;EACJ,MAAMC,gBAAgB,GAAGb,MAAM,CAAC,IAAIE,QA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