@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.
Files changed (141) hide show
  1. app-rn-runtime/components/advanced/carousel/carousel.component.js +18 -3
  2. app-rn-runtime/components/advanced/carousel/carousel.component.js.map +1 -1
  3. app-rn-runtime/components/advanced/webview/webview.component.js.map +1 -1
  4. app-rn-runtime/components/basic/anchor/anchor.component.js +2 -2
  5. app-rn-runtime/components/basic/anchor/anchor.component.js.map +1 -1
  6. app-rn-runtime/components/basic/animatedview.component.js +6 -2
  7. app-rn-runtime/components/basic/animatedview.component.js.map +1 -1
  8. app-rn-runtime/components/basic/audio/audio.component.js.map +1 -1
  9. app-rn-runtime/components/basic/button/button.component.js +5 -4
  10. app-rn-runtime/components/basic/button/button.component.js.map +1 -1
  11. app-rn-runtime/components/basic/icon/icon.component.js +4 -4
  12. app-rn-runtime/components/basic/icon/icon.component.js.map +1 -1
  13. app-rn-runtime/components/basic/label/label.component.js.map +1 -1
  14. app-rn-runtime/components/basic/label/label.styles.js.map +1 -1
  15. app-rn-runtime/components/basic/message/message.component.js.map +1 -1
  16. app-rn-runtime/components/basic/picture/picture.component.js +1 -2
  17. app-rn-runtime/components/basic/picture/picture.component.js.map +1 -1
  18. app-rn-runtime/components/basic/progress-bar/progress-bar.component.js +2 -2
  19. app-rn-runtime/components/basic/progress-bar/progress-bar.component.js.map +1 -1
  20. app-rn-runtime/components/basic/progress-circle/progress-circle.component.js +5 -5
  21. app-rn-runtime/components/basic/progress-circle/progress-circle.component.js.map +1 -1
  22. app-rn-runtime/components/basic/search/search.component.js.map +1 -1
  23. app-rn-runtime/components/basic/spinner/spinner.component.js +2 -3
  24. app-rn-runtime/components/basic/spinner/spinner.component.js.map +1 -1
  25. app-rn-runtime/components/basic/spinner/spinner.styles.js +3 -2
  26. app-rn-runtime/components/basic/spinner/spinner.styles.js.map +1 -1
  27. app-rn-runtime/components/basic/video/video.component.js.map +1 -1
  28. app-rn-runtime/components/basic/video/video.styles.js +4 -1
  29. app-rn-runtime/components/basic/video/video.styles.js.map +1 -1
  30. app-rn-runtime/components/chart/area-chart/area-chart.component.js.map +1 -1
  31. app-rn-runtime/components/chart/basechart.component.js +31 -2
  32. app-rn-runtime/components/chart/basechart.component.js.map +1 -1
  33. app-rn-runtime/components/chart/basechart.props.js +1 -0
  34. app-rn-runtime/components/chart/basechart.props.js.map +1 -1
  35. app-rn-runtime/components/chart/basechart.styles.js +4 -0
  36. app-rn-runtime/components/chart/basechart.styles.js.map +1 -1
  37. app-rn-runtime/components/chart/bubble-chart/bubble-chart.component.js +15 -3
  38. app-rn-runtime/components/chart/bubble-chart/bubble-chart.component.js.map +1 -1
  39. app-rn-runtime/components/chart/pie-chart/pie-chart.component.js +4 -1
  40. app-rn-runtime/components/chart/pie-chart/pie-chart.component.js.map +1 -1
  41. app-rn-runtime/components/chart/stack-chart/stack-chart.component.js +37 -11
  42. app-rn-runtime/components/chart/stack-chart/stack-chart.component.js.map +1 -1
  43. app-rn-runtime/components/container/accordion/accordion.component.js +3 -1
  44. app-rn-runtime/components/container/accordion/accordion.component.js.map +1 -1
  45. app-rn-runtime/components/container/accordion/accordion.styles.js +1 -0
  46. app-rn-runtime/components/container/accordion/accordion.styles.js.map +1 -1
  47. app-rn-runtime/components/container/layoutgrid/gridcolumn/gridcolumn.component.js.map +1 -1
  48. app-rn-runtime/components/container/panel/panel.component.js +4 -2
  49. app-rn-runtime/components/container/panel/panel.component.js.map +1 -1
  50. app-rn-runtime/components/container/tabs/tabheader/tabheader.component.js +2 -3
  51. app-rn-runtime/components/container/tabs/tabheader/tabheader.component.js.map +1 -1
  52. app-rn-runtime/components/container/tabs/tabs.component.js.map +1 -1
  53. app-rn-runtime/components/container/wizard/wizard.component.js +27 -11
  54. app-rn-runtime/components/container/wizard/wizard.component.js.map +1 -1
  55. app-rn-runtime/components/data/form/form-field/form-field.component.js.map +1 -1
  56. app-rn-runtime/components/data/list/list.component.js.map +1 -1
  57. app-rn-runtime/components/dialogs/dialog/dialog.component.js +5 -3
  58. app-rn-runtime/components/dialogs/dialog/dialog.component.js.map +1 -1
  59. app-rn-runtime/components/input/basedataset/basedataset.component.js.map +1 -1
  60. app-rn-runtime/components/input/baseinput/baseinput.component.js +11 -4
  61. app-rn-runtime/components/input/baseinput/baseinput.component.js.map +1 -1
  62. app-rn-runtime/components/input/baseinput/baseinput.props.js +1 -0
  63. app-rn-runtime/components/input/baseinput/baseinput.props.js.map +1 -1
  64. app-rn-runtime/components/input/basenumber/basenumber.component.js +25 -12
  65. app-rn-runtime/components/input/basenumber/basenumber.component.js.map +1 -1
  66. app-rn-runtime/components/input/basenumber/basenumber.props.js +2 -0
  67. app-rn-runtime/components/input/basenumber/basenumber.props.js.map +1 -1
  68. app-rn-runtime/components/input/checkbox/checkbox.component.js +5 -6
  69. app-rn-runtime/components/input/checkbox/checkbox.component.js.map +1 -1
  70. app-rn-runtime/components/input/checkboxset/checkboxset.component.js +3 -2
  71. app-rn-runtime/components/input/checkboxset/checkboxset.component.js.map +1 -1
  72. app-rn-runtime/components/input/chips/chips.component.js +3 -2
  73. app-rn-runtime/components/input/chips/chips.component.js.map +1 -1
  74. app-rn-runtime/components/input/currency/currency.component.js +16 -1
  75. app-rn-runtime/components/input/currency/currency.component.js.map +1 -1
  76. app-rn-runtime/components/input/epoch/base-datetime.component.js +22 -5
  77. app-rn-runtime/components/input/epoch/base-datetime.component.js.map +1 -1
  78. app-rn-runtime/components/input/epoch/wheel-date-picker.component.js +123 -12
  79. app-rn-runtime/components/input/epoch/wheel-date-picker.component.js.map +1 -1
  80. app-rn-runtime/components/input/epoch/wheelpicker/wheelpicker.component.js.map +1 -1
  81. app-rn-runtime/components/input/epoch/wheelpickermodal/date/date-picker-modal.component.js +4 -0
  82. app-rn-runtime/components/input/epoch/wheelpickermodal/date/date-picker-modal.component.js.map +1 -1
  83. app-rn-runtime/components/input/epoch/wheelpickermodal/date/date-picker-modal.props.js +2 -0
  84. app-rn-runtime/components/input/epoch/wheelpickermodal/date/date-picker-modal.props.js.map +1 -1
  85. app-rn-runtime/components/input/number/number.component.js +6 -3
  86. app-rn-runtime/components/input/number/number.component.js.map +1 -1
  87. app-rn-runtime/components/input/radioset/radioset.component.js +6 -6
  88. app-rn-runtime/components/input/radioset/radioset.component.js.map +1 -1
  89. app-rn-runtime/components/input/select/select.component.js +23 -9
  90. app-rn-runtime/components/input/select/select.component.js.map +1 -1
  91. app-rn-runtime/components/input/switch/switch.component.js +2 -2
  92. app-rn-runtime/components/input/switch/switch.component.js.map +1 -1
  93. app-rn-runtime/components/input/toggle/toggle.component.js +2 -4
  94. app-rn-runtime/components/input/toggle/toggle.component.js.map +1 -1
  95. app-rn-runtime/components/navigation/appnavbar/appnavbar.component.js +2 -2
  96. app-rn-runtime/components/navigation/appnavbar/appnavbar.component.js.map +1 -1
  97. app-rn-runtime/components/navigation/basenav/basenav.component.js.map +1 -1
  98. app-rn-runtime/components/navigation/navitem/navitem.component.js +2 -3
  99. app-rn-runtime/components/navigation/navitem/navitem.component.js.map +1 -1
  100. app-rn-runtime/components/navigation/popover/popover.component.js.map +1 -1
  101. app-rn-runtime/components/page/tabbar/curve.js.map +1 -1
  102. app-rn-runtime/components/page/tabbar/tabbar.component.js.map +1 -1
  103. app-rn-runtime/core/base.component.js +2 -1
  104. app-rn-runtime/core/base.component.js.map +1 -1
  105. app-rn-runtime/core/components/textinput.component.js +4 -3
  106. app-rn-runtime/core/components/textinput.component.js.map +1 -1
  107. app-rn-runtime/core/formatters.js.map +1 -1
  108. app-rn-runtime/core/key.extractor.js.map +1 -1
  109. app-rn-runtime/core/props.provider.js +3 -0
  110. app-rn-runtime/core/props.provider.js.map +1 -1
  111. app-rn-runtime/core/storage.service.js.map +1 -1
  112. app-rn-runtime/core/tappable.component.js +26 -25
  113. app-rn-runtime/core/tappable.component.js.map +1 -1
  114. app-rn-runtime/core/ui-preferences.context.js +7 -0
  115. app-rn-runtime/core/ui-preferences.context.js.map +1 -0
  116. app-rn-runtime/core/utils.js +66 -4
  117. app-rn-runtime/core/utils.js.map +1 -1
  118. app-rn-runtime/package.json +28 -7
  119. app-rn-runtime/runtime/App.js +2 -1
  120. app-rn-runtime/runtime/App.js.map +1 -1
  121. app-rn-runtime/runtime/App.navigator.js.map +1 -1
  122. app-rn-runtime/runtime/base-fragment.component.js +15 -0
  123. app-rn-runtime/runtime/base-fragment.component.js.map +1 -1
  124. app-rn-runtime/runtime/base-page.component.js.map +1 -1
  125. app-rn-runtime/runtime/base-prefab.component.js.map +1 -1
  126. app-rn-runtime/runtime/navigator/stack.navigator.js.map +1 -1
  127. app-rn-runtime/runtime/services/app-i18n.service.js +10 -0
  128. app-rn-runtime/runtime/services/app-i18n.service.js.map +1 -1
  129. app-rn-runtime/runtime/services/app-security.service.js.map +1 -1
  130. app-rn-runtime/runtime/services/app-spinner.service.js +1 -1
  131. app-rn-runtime/runtime/services/app-spinner.service.js.map +1 -1
  132. app-rn-runtime/runtime/services/webprocess.service.js.map +1 -1
  133. app-rn-runtime/runtime/watcher.js.map +1 -1
  134. app-rn-runtime/styles/background.component.js +1 -0
  135. app-rn-runtime/styles/background.component.js.map +1 -1
  136. app-rn-runtime/styles/style-prop.validator.js.map +1 -1
  137. app-rn-runtime/styles/theme.js.map +1 -1
  138. app-rn-runtime/variables/base-variable.js.map +1 -1
  139. app-rn-runtime/variables/device/file/upload-file.operation.js.map +1 -1
  140. app-rn-runtime/variables/device-variable.js.map +1 -1
  141. app-rn-runtime/variables/service-variable.js.map +1 -1
@@ -1 +1 @@
1
- {"version":3,"names":["React","ActivityIndicator","SectionList","Text","View","FlatList","isArray","isEmpty","isNil","isNumber","round","BaseComponent","BaseComponentState","getGroupedData","isDefined","Tappable","DefaultKeyExtractor","WmLabel","WmIcon","Swipeable","WmListProps","DEFAULT_CLASS","WmListState","constructor","args","_defineProperty","WmList","props","leftActionTemplate","createElement","Fragment","getTemplate","rightActionTemplate","updateState","maxRecordsToShow","state","pagesize","isSelected","$item","selectedItem","selecteditem","indexOf","onSelect","$index","$event","eventName","disableitem","multiselect","index","selectionlimit","length","push","invokeEventCallback","splice","proxy","selectedItemWidgets","itemWidgets","Promise","resolve","selectedindex","loadDataOnDemand","navigation","loadData","loadingData","dataset","setTimeout","$list","loadingdata","getNextPageData","currentPage","then","data","hasMoreData","catch","err","console","error","selectFirstItem","initialized","groupby","clear","groupedData","selectItem","item","getItem","deselect","selectedItemIndex","getWidgets","widgetname","map","filter","widget","undefined","deselectAll","setGroupData","items","dataItems","match","orderby","dateformat","_this$keyExtractor","keyExtractor","onPropertyChange","name","$new","$old","direction","key","_this$keyExtractor2","selectfirstitem","pop","componentDidMount","_props$dataset","subscribe","event","scrollPosition","nativeEvent","contentOffset","y","layoutMeasurement","height","endThreshold","componentDidUpdate","prevProps","prevState","snapshot","getDefaultStyles","isHorizontal","theme","getStyle","defaultClass","getIndex","generateItemKey","itemkey","_showSkeleton","getKey","renderItem","cols","getNoOfColumns","renderLeftActions","renderRightActions","containerStyle","width","flex","style","styles","itemclass","_extends","getTestPropsForAction","onTap","onLongTap","onDoubleTap","display","flexDirection","paddingRight","marginRight","margin","id","getTestId","iconclass","selectedIcon","renderHeader","title","groupHeading","accessibilityRole","subheading","heading","listIcon","caption","accessibilityrole","renderEmptyMessage","emptyMessage","nodatamessage","renderLoadingIcon","loadingicon","loadingIcon","loadingdatamsg","color","text","itemsperrow","xs","onLayoutChange","e","l","layout","renderWithFlatList","root","onLayout","v","i","group","scrollEnabled","horizontal","ListEmptyComponent","itemInfo","numColumns","onDemandMessage","ondemandmessage","getSectionListData","renderWithSectionList","contentContainerStyle","sections","renderSectionHeader","section","renderSectionFooter","renderWidget","_background"],"sources":["list.component.tsx"],"sourcesContent":["import React from 'react';\nimport { ActivityIndicator, SectionList, Text, View, FlatList, LayoutChangeEvent, TouchableOpacity} from 'react-native';\nimport { isArray, isEmpty, isNil, isNumber, round } from 'lodash-es';\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\nimport {getGroupedData, isDefined} from \"@wavemaker/app-rn-runtime/core/utils\";\nimport { Tappable } from '@wavemaker/app-rn-runtime/core/tappable.component';\nimport { DefaultKeyExtractor } from '@wavemaker/app-rn-runtime/core/key.extractor';\nimport WmLabel from '@wavemaker/app-rn-runtime/components/basic/label/label.component';\nimport WmIcon from '@wavemaker/app-rn-runtime/components/basic/icon/icon.component';\nimport { Swipeable } from 'react-native-gesture-handler';\nimport WmListActionTemplate from './list-action-template/list-action-template.component';\n\nimport WmListProps from './list.props';\nimport { DEFAULT_CLASS, WmListStyles } from './list.styles';\n\n\nexport class WmListState extends BaseComponentState<WmListProps> {\n public selectedindex: any;\n groupedData: Array<any> = [];\n currentPage = 1;\n maxRecordsToShow = 20;\n}\n\nexport default class WmList extends BaseComponent<WmListProps, WmListState, WmListStyles> {\n\n private itemWidgets = [] as any[];\n private selectedItemWidgets = {} as any;\n private keyExtractor = new DefaultKeyExtractor();\n private endThreshold = -1;\n private loadingData = false;\n private hasMoreData = true;\n public leftActionTemplate?: WmListActionTemplate;\n public rightActionTemplate?: WmListActionTemplate;\n\n constructor(props: WmListProps) {\n super(props, DEFAULT_CLASS, new WmListProps(), new WmListState());\n this.updateState({\n maxRecordsToShow: this.state.props.pagesize\n } as WmListState);\n }\n\n private isSelected($item: any) {\n const selectedItem = this.state.props.selecteditem;\n if (isArray(selectedItem)) {\n return selectedItem.indexOf($item) >= 0;\n }\n return selectedItem === $item;\n }\n\n private async onSelect($item: any, $index: number | string, $event?: any) {\n const props = this.state.props;\n let selectedItem = null as any;\n let eventName = 'onSelect';\n if (props.disableitem !== true\n && (typeof props.disableitem !== 'function' || !props.disableitem($item, $index))) {\n if (props.multiselect) {\n selectedItem = [...(props.selecteditem || [])];\n const index = selectedItem.indexOf($item);\n if (index < 0) {\n if ((!props.selectionlimit)\n || props.selectionlimit < 0\n || selectedItem.length < props.selectionlimit) {\n selectedItem.push($item);\n } else {\n this.invokeEventCallback('onSelectionlimitexceed', [null, this]);\n }\n } else {\n selectedItem.splice(index, 1);\n eventName = 'onDeselect';\n }\n } else {\n this.state.props.selecteditem && this.invokeEventCallback('onDeselect', [this.proxy, this.state.props.selecteditem]);\n selectedItem = $item;\n }\n this.selectedItemWidgets = this.itemWidgets[$index as number];\n return new Promise(resolve => {\n this.updateState({\n props: { selecteditem: selectedItem },\n selectedindex: $index\n } as WmListState, () => {\n this.invokeEventCallback(eventName, [this.proxy, $item]);\n $event && this.invokeEventCallback('onTap', [$event, this.proxy]);\n resolve(null);\n });\n });\n } else {\n return Promise.resolve(null);\n }\n }\n\n private get loadDataOnDemand() {\n const navigation = this.state.props.navigation;\n return navigation === 'Scroll' || navigation === 'On-Demand';\n }\n\n renderLeftActions = () => {\n return this.leftActionTemplate ? (\n <>\n {this.leftActionTemplate.getTemplate()}\n </>\n ) : null;\n };\n\n renderRightActions = () => {\n return this.rightActionTemplate ? (\n <>\n {this.rightActionTemplate.getTemplate()}\n </>\n ) : null;\n };\n\n private loadData() {\n if (this.loadingData) {\n return;\n }\n if (isArray(this.state.props.dataset)\n && this.state.props.dataset.length > this.state.maxRecordsToShow) {\n this.loadingData = true;\n this.updateState({\n maxRecordsToShow: this.state.maxRecordsToShow + this.state.props.pagesize\n } as WmListState);\n setTimeout(() => {\n this.loadingData = false;\n }, 100);\n } else if (this.loadDataOnDemand) {\n const $list = this.proxy as any;\n $list.loadingdata = true;\n this.loadingData = true;\n this.props.getNextPageData && this.props.getNextPageData(null, this.proxy, this.state.currentPage + 1).then((data) => {\n if (isArray(data) && data.length > 0\n && isArray(this.state.props.dataset)) {\n $list.dataset = [...this.state.props.dataset, ...data];\n this.updateState({\n currentPage : this.state.currentPage + 1,\n maxRecordsToShow: this.state.maxRecordsToShow + this.state.props.pagesize\n } as WmListState);\n this.hasMoreData = true;\n } else {\n this.hasMoreData = false;\n }\n }).catch((err) => {\n console.error(err);\n }).then(() => {\n setTimeout(() => {\n $list.loadingdata = false;\n }, 1000);\n });\n }\n }\n\n private selectFirstItem() {\n const props = this.state.props;\n if (this.initialized\n && props.dataset\n && props.dataset.length) {\n const index = props.groupby ? '00': 0;\n this.onSelect(props.dataset[0], index);\n }\n }\n\n clear(){\n this.updateState({\n groupedData: {},\n } as WmListState);\n }\n\n selectItem(item: any){\n const dataset = this.state.props.dataset;\n if(isNumber(item)){\n this.onSelect(dataset[item], item);\n }\n else{\n let index = dataset.indexOf(item);\n this.onSelect(dataset[index], index);\n }\n }\n\n getItem(index: number){\n const props = this.state.props;\n return this.props.dataset[index]\n }\n\n deselect(item: any){\n const props = this.state.props;\n let selectedItem = null as any;\n let index = isNumber(item)?item:props.dataset.indexOf(item);\n if(props.multiselect && index >= 0){\n selectedItem = [...(props.selecteditem || [])];\n let selectedItemIndex = selectedItem.indexOf(props.dataset[index])\n if(selectedItemIndex >= 0){\n selectedItem.splice(selectedItemIndex, 1);\n }\n }\n else{\n if (props.selecteditem === props.dataset[index]) {\n selectedItem = null;\n }\n }\n this.updateState({\n props: { selecteditem: selectedItem },\n\n } as WmListState, () => {\n this.invokeEventCallback('onDeselect', [this.proxy, item]);\n });\n }\n\n getWidgets(widgetname: string, index: number){\n if(index >= 0 && index < this.itemWidgets.length){\n return this.itemWidgets[index][widgetname]\n }\n else{\n return this.itemWidgets.map(item => item[widgetname]).filter(widget => widget !== undefined);\n }\n }\n\n private deselectAll() {\n this.updateState({\n props: { selecteditem: null },\n selectedindex: -1\n } as WmListState);\n }\n\n setGroupData(items: any) {\n const dataItems = items;\n const props = this.state.props;\n if (props.groupby) {\n const groupedData = dataItems && getGroupedData(dataItems, props.groupby, props.match, props.orderby, props.dateformat, this);\n this.updateState({\n groupedData: groupedData\n } as WmListState, () => {\n this.keyExtractor?.clear();\n });\n }\n }\n\n public onPropertyChange(name: string, $new: any, $old: any) {\n super.onPropertyChange(name, $new, $old);\n const props = this.state.props;\n switch(name) {\n case 'selectfirstitem':\n if ($new) {\n this.selectFirstItem();\n }\n break;\n case 'dataset':\n if (this.state.props.groupby) {\n this.setGroupData($new);\n } else {\n if (!($old && $old.length)\n && $new && $new.length\n && this.loadDataOnDemand) {\n this.updateState({\n props: {\n dataset: [...$new]\n }\n } as WmListState);\n }\n const data = isArray($new) ? $new : (!isEmpty($new) && isDefined($new) ? [$new] : []);\n this.updateState({\n groupedData: (data[0] || props.direction === 'horizontal' ? [{\n key: 'key',\n data: data\n }] : [])\n } as WmListState, () => {\n this.keyExtractor?.clear();\n });\n }\n this.itemWidgets = [];\n if (props.selectfirstitem) {\n this.selectFirstItem();\n } else {\n this.deselectAll();\n }\n break;\n case 'groupby':\n case 'match':\n this.setGroupData(this.state.props.dataset);\n break;\n case 'multiselect':\n if ($new) {\n if (!isArray(this.state.props.selecteditem)) {\n this.state.props.selecteditem = this.state.props.selecteditem ?\n [this.state.props.selecteditem] : [];\n }\n } else if (isArray(this.state.props.selecteditem)) {\n this.state.props.selecteditem = this.state.props.selecteditem.pop();\n }\n break;\n case 'loadingdata':\n this.loadingData = $new && this.loadingData;\n break;\n case 'selecteditem':\n if($new != $old && isNumber($new)) {\n this.selectItem(this.state.props.dataset[$new])\n }\n break;\n }\n }\n\n componentDidMount() {\n const props = this.state.props;\n if (this.state.props.selectfirstitem && props.dataset?.length) {\n setTimeout(() => {\n this.onSelect(props.dataset[0], 0);\n });\n }\n this.subscribe('scroll', (event: any) => {\n const scrollPosition = event.nativeEvent.contentOffset.y + event.nativeEvent.layoutMeasurement.height;\n if (scrollPosition > this.endThreshold && this.state.props.direction === 'vertical') {\n this.loadData();\n }\n });\n super.componentDidMount();\n }\n\n componentDidUpdate(prevProps: WmListProps, prevState: WmListState, snapshot?: any) {\n super.componentDidUpdate && super.componentDidUpdate(prevProps, prevState, snapshot);\n this.invokeEventCallback('onRender', [this, this.state.props.dataset]);\n }\n\n getDefaultStyles() {\n const isHorizontal = this.state.props.direction === 'horizontal';\n return this.theme.getStyle(`${this.defaultClass} ${isHorizontal ? 'app-horizontal-list' : 'app-vertical-list'}`);\n }\n\n getIndex(item: any) {\n return this.state.props.dataset.indexOf(item);\n }\n\n private generateItemKey(item: any, index: number, props: WmListProps) {\n if (props.itemkey && item && !this._showSkeleton) {\n return props.itemkey(item, index);\n }\n return 'list_item_' + this.keyExtractor.getKey(item, true);\n }\n\n private renderItem(item: any, index: number, props: WmListProps) {\n const cols = this. getNoOfColumns();\n const isHorizontal = (props.direction === 'horizontal');\n return (index < this.state.maxRecordsToShow || isHorizontal) ? (\n <Swipeable\n renderLeftActions={() => this.renderLeftActions()}\n renderRightActions={() => this.renderRightActions()} containerStyle={ cols ? { width: round(100/cols) + \"%\" , flex: null } as any :{}}>\n <View style={[\n this.styles.item,\n props.itemclass ? this.theme.getStyle(props.itemclass(item, index)) : null,\n this.isSelected(item) ? this.styles.selectedItem : {}]}>\n <Tappable\n {...this.getTestPropsForAction(`item${index}`)}\n onTap={($event) => this.onSelect(item, index, $event)}\n onLongTap={() => this.invokeEventCallback('onLongtap', [null, this.proxy])}\n onDoubleTap={() => this.invokeEventCallback('onDoubletap', [null, this.proxy])}\n styles={\n [{display: 'flex', flexDirection : 'row'},\n cols ? {\n width: '100%'\n } : null,\n (cols && cols > 1) || isHorizontal ? {\n paddingRight: (isNil(this.styles.item.marginRight)\n ? this.styles.item.margin : this.styles.item.marginRight) || 4\n } : null\n ]\n }>\n {props.renderItem(item, index, this)}\n {this.isSelected(item) ? (\n <WmIcon id={this.getTestId('icon' + index)} iconclass='wi wi-check-circle' styles={this.styles.selectedIcon} />\n ) : null}\n </Tappable>\n </View>\n </Swipeable>\n ) : null;\n }\n\n private renderHeader(props: WmListProps, title: string) {\n return props.groupby ? (\n <Text style={this.styles.groupHeading} accessibilityRole='header'>{title}</Text>\n ) : (props.iconclass || props.title || props.subheading) ? (\n <View style={this.styles.heading}>\n <View style={{flex: 1, flexDirection: 'row'}}>\n <WmIcon id={this.getTestId('icon')} styles={this.styles.listIcon} iconclass={props.iconclass}></WmIcon>\n <View>\n <WmLabel id={this.getTestId('title')} styles={this.styles.title} caption={props.title} accessibilityrole='header'></WmLabel>\n <WmLabel id={this.getTestId('subheading')} styles={this.styles.subheading} caption={props.subheading}></WmLabel>\n </View>\n </View>\n </View>) : null;\n }\n\n private renderEmptyMessage(isHorizontal: boolean, item: any, index: any, props: WmListProps) {\n return (<WmLabel id={this.getTestId('emptymsg')} styles={this.styles.emptyMessage} caption={props.nodatamessage}></WmLabel>);\n }\n\n private renderLoadingIcon(props: WmListProps) {\n return props.loadingicon ? (<WmIcon\n id={this.getTestId('loadingicon')}\n styles={this.styles.loadingIcon}\n iconclass={props.loadingicon}\n caption={props.loadingdatamsg}></WmIcon>)\n : (\n <ActivityIndicator color={this.styles.loadingIcon.text.color}></ActivityIndicator>\n );\n }\n\n public getNoOfColumns() {\n const props = this.state.props;\n if(props.direction === 'vertical') {\n return props.itemsperrow.xs;\n }\n return 0;\n }\n\n private onLayoutChange(e: LayoutChangeEvent) {\n const l = e.nativeEvent.layout;\n this.endThreshold = l.height + l.y - 100;\n if (!this.endThreshold) {\n this.endThreshold = -1;\n }\n }\n\n private renderWithFlatList(props: WmListProps, isHorizontal = false) {\n return (\n <View style={this.styles.root} onLayout={e => this.onLayoutChange(e)}>\n {!isEmpty(this.state.groupedData) ? this.state.groupedData.map((v: any, i) => ((\n <View style={this.styles.group} key={v.key || this.keyExtractor.getKey(v, true)}>\n {this.renderHeader(props, v.key)}\n <FlatList\n key={props.name + '_' + (isHorizontal ? 'H' : 'V') + props.itemsperrow.xs}\n keyExtractor={(item, i) => this.generateItemKey(item, i, props)}\n scrollEnabled={isHorizontal}\n horizontal = {isHorizontal}\n data={isEmpty(v.data[0]) ? []: v.data}\n ListEmptyComponent = {(itemInfo) => this.renderEmptyMessage(isHorizontal, itemInfo.item, itemInfo.index, props)}\n renderItem={(itemInfo) => this.renderItem(itemInfo.item, itemInfo.index, props)}\n {...(isHorizontal ? {} : {numColumns : this.getNoOfColumns()})}>\n </FlatList>\n {this.loadDataOnDemand || (v.data.length > this.state.maxRecordsToShow) ?\n (this.loadingData ?\n this.renderLoadingIcon(props) :\n (<WmLabel id={this.getTestId('ondemandmessage')}\n styles={this.styles.onDemandMessage}\n caption={this.hasMoreData && !isHorizontal ? props.ondemandmessage : props.nodatamessage}\n onTap={() => this.loadData()}></WmLabel>))\n : null}\n </View>\n ))) : this.renderEmptyMessage(isHorizontal, null, null,props)\n }\n </View>);\n }\n\n private getSectionListData() {\n if (this._showSkeleton) {\n return [{\n key: '',\n data: [{}, {}, {}]\n }];\n } else if (this.state.groupedData\n && this.state.groupedData[0]\n && this.state.groupedData[0]['data'].length) {\n return this.state.groupedData;\n }\n return [];\n }\n\n private renderWithSectionList(props: WmListProps, isHorizontal = false) {\n return (\n <SectionList\n keyExtractor={(item, i) => this.generateItemKey(item, i, props)}\n horizontal = {isHorizontal}\n contentContainerStyle={this.styles.root}\n sections={this.getSectionListData()}\n renderSectionHeader={({ section: {key, data}}) => {\n return this.renderHeader(props, key);\n }}\n renderSectionFooter={() => props.loadingdata ? this.renderLoadingIcon(props) : null}\n ListEmptyComponent = {(itemInfo) => this.renderEmptyMessage(isHorizontal, itemInfo.item, itemInfo.index, props)}\n renderItem={(itemInfo) => this.renderItem(itemInfo.item, itemInfo.index, props)}>\n </SectionList>\n );\n }\n\n renderWidget(props: WmListProps) {\n this.invokeEventCallback('onBeforedatarender', [this, this.state.props.dataset]);\n const isHorizontal = (props.direction === 'horizontal');\n return (\n <View style={isHorizontal ? null : { width: '100%' }}>\n {this._background}\n {(isHorizontal || !props.groupby) ?\n this.renderWithFlatList(props, isHorizontal)\n : this.renderWithSectionList(props, isHorizontal)}\n </View>);\n }\n}\n"],"mappings":";;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,iBAAiB,EAAEC,WAAW,EAAEC,IAAI,EAAEC,IAAI,EAAEC,QAAQ,QAA4C,cAAc;AACvH,SAASC,OAAO,EAAEC,OAAO,EAAEC,KAAK,EAAEC,QAAQ,EAAEC,KAAK,QAAQ,WAAW;AACpE,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,+CAA+C;AACj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QAAQ,CAAClJ,KAAK,EAAErB,KAAK;IAAE,CACrE,CAAC;EAElB;EAEAkL,YAAYA,CAAClL,KAAkB,EAAE;IAC/B,IAAI,CAACyB,mBAAmB,CAAC,oBAAoB,EAAE,CAAC,IAAI,EAAE,IAAI,CAACjB,KAAK,CAACR,KAAK,CAACqC,OAAO,CAAC,CAAC;IAChF,MAAM+D,YAAY,GAAIpG,KAAK,CAAC+E,SAAS,KAAK,YAAa;IACvD,oBACI1G,KAAA,CAAA6B,aAAA,CAACzB,IAAI;MAAC4I,KAAK,EAAEjB,YAAY,GAAG,IAAI,GAAG;QAAEe,KAAK,EAAE;MAAO;IAAE,GAClD,IAAI,CAACgE,WAAW,EACf/E,YAAY,IAAI,CAACpG,KAAK,CAACoD,OAAO,GAC9B,IAAI,CAAC0G,kBAAkB,CAAC9J,KAAK,EAAEoG,YAAY,CAAC,GAC5C,IAAI,CAACwE,qBAAqB,CAAC5K,KAAK,EAAEoG,YAAY,CAC9C,CAAC;EACX;AACF","ignoreList":[]}
1
+ {"version":3,"names":["React","ActivityIndicator","SectionList","Text","View","FlatList","isArray","isEmpty","isNil","isNumber","round","BaseComponent","BaseComponentState","getGroupedData","isDefined","Tappable","DefaultKeyExtractor","WmLabel","WmIcon","Swipeable","WmListProps","DEFAULT_CLASS","WmListState","constructor","args","_defineProperty","WmList","props","leftActionTemplate","createElement","Fragment","getTemplate","rightActionTemplate","updateState","maxRecordsToShow","state","pagesize","isSelected","$item","selectedItem","selecteditem","indexOf","onSelect","$index","$event","eventName","disableitem","multiselect","index","selectionlimit","length","push","invokeEventCallback","splice","proxy","selectedItemWidgets","itemWidgets","Promise","resolve","selectedindex","loadDataOnDemand","navigation","loadData","loadingData","dataset","setTimeout","$list","loadingdata","getNextPageData","currentPage","then","data","hasMoreData","catch","err","console","error","selectFirstItem","initialized","groupby","clear","groupedData","selectItem","item","getItem","deselect","selectedItemIndex","getWidgets","widgetname","map","filter","widget","undefined","deselectAll","setGroupData","items","dataItems","match","orderby","dateformat","_this$keyExtractor","keyExtractor","onPropertyChange","name","$new","$old","direction","key","_this$keyExtractor2","selectfirstitem","pop","componentDidMount","_props$dataset","subscribe","event","scrollPosition","nativeEvent","contentOffset","y","layoutMeasurement","height","endThreshold","componentDidUpdate","prevProps","prevState","snapshot","getDefaultStyles","isHorizontal","theme","getStyle","defaultClass","getIndex","generateItemKey","itemkey","_showSkeleton","getKey","renderItem","cols","getNoOfColumns","renderLeftActions","renderRightActions","containerStyle","width","flex","style","styles","itemclass","_extends","getTestPropsForAction","onTap","onLongTap","onDoubleTap","display","flexDirection","paddingRight","marginRight","margin","id","getTestId","iconclass","selectedIcon","renderHeader","title","groupHeading","accessibilityRole","subheading","heading","listIcon","caption","accessibilityrole","renderEmptyMessage","emptyMessage","nodatamessage","renderLoadingIcon","loadingicon","loadingIcon","loadingdatamsg","color","text","itemsperrow","xs","onLayoutChange","e","l","layout","renderWithFlatList","root","onLayout","v","i","group","scrollEnabled","horizontal","ListEmptyComponent","itemInfo","numColumns","onDemandMessage","ondemandmessage","getSectionListData","renderWithSectionList","contentContainerStyle","sections","renderSectionHeader","section","renderSectionFooter","renderWidget","_background"],"sources":["list.component.tsx"],"sourcesContent":["import React from 'react';\nimport { ActivityIndicator, SectionList, Text, View, FlatList, LayoutChangeEvent, TouchableOpacity} from 'react-native';\nimport { isArray, isEmpty, isNil, isNumber, round } from 'lodash-es';\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\nimport {getGroupedData, isDefined} from \"@wavemaker/app-rn-runtime/core/utils\";\nimport { Tappable } from '@wavemaker/app-rn-runtime/core/tappable.component';\nimport { DefaultKeyExtractor } from '@wavemaker/app-rn-runtime/core/key.extractor';\nimport WmLabel from '@wavemaker/app-rn-runtime/components/basic/label/label.component';\nimport WmIcon from '@wavemaker/app-rn-runtime/components/basic/icon/icon.component';\nimport { Swipeable } from 'react-native-gesture-handler';\nimport WmListActionTemplate from './list-action-template/list-action-template.component';\n\nimport WmListProps from './list.props';\nimport { DEFAULT_CLASS, WmListStyles } from './list.styles';\n\n\nexport class WmListState extends BaseComponentState<WmListProps> {\n public selectedindex: any;\n groupedData: Array<any> = [];\n currentPage = 1;\n maxRecordsToShow = 20;\n}\n\nexport default class WmList extends BaseComponent<WmListProps, WmListState, WmListStyles> {\n\n private itemWidgets = [] as any[];\n private selectedItemWidgets = {} as any;\n private keyExtractor = new DefaultKeyExtractor();\n private endThreshold = -1;\n private loadingData = false;\n private hasMoreData = true;\n public leftActionTemplate?: WmListActionTemplate;\n public rightActionTemplate?: WmListActionTemplate;\n\n constructor(props: WmListProps) {\n super(props, DEFAULT_CLASS, new WmListProps(), new WmListState());\n this.updateState({\n maxRecordsToShow: this.state.props.pagesize\n } as WmListState);\n }\n\n private isSelected($item: any) {\n const selectedItem = this.state.props.selecteditem;\n if (isArray(selectedItem)) {\n return selectedItem.indexOf($item) >= 0;\n }\n return selectedItem === $item;\n }\n\n private async onSelect($item: any, $index: number | string, $event?: any) {\n const props = this.state.props;\n let selectedItem = null as any;\n let eventName = 'onSelect';\n if (props.disableitem !== true\n && (typeof props.disableitem !== 'function' || !props.disableitem($item, $index))) {\n if (props.multiselect) {\n selectedItem = [...(props.selecteditem || [])];\n const index = selectedItem.indexOf($item);\n if (index < 0) {\n if ((!props.selectionlimit)\n || props.selectionlimit < 0\n || selectedItem.length < props.selectionlimit) {\n selectedItem.push($item);\n } else {\n this.invokeEventCallback('onSelectionlimitexceed', [null, this]);\n }\n } else {\n selectedItem.splice(index, 1);\n eventName = 'onDeselect';\n }\n } else {\n this.state.props.selecteditem && this.invokeEventCallback('onDeselect', [this.proxy, this.state.props.selecteditem]);\n selectedItem = $item;\n }\n this.selectedItemWidgets = this.itemWidgets[$index as number];\n return new Promise(resolve => {\n this.updateState({\n props: { selecteditem: selectedItem },\n selectedindex: $index\n } as WmListState, () => {\n this.invokeEventCallback(eventName, [this.proxy, $item]);\n $event && this.invokeEventCallback('onTap', [$event, this.proxy]);\n resolve(null);\n });\n });\n } else {\n return Promise.resolve(null);\n }\n }\n\n private get loadDataOnDemand() {\n const navigation = this.state.props.navigation;\n return navigation === 'Scroll' || navigation === 'On-Demand';\n }\n\n renderLeftActions = () => {\n return this.leftActionTemplate ? (\n <>\n {this.leftActionTemplate.getTemplate()}\n </>\n ) : null;\n };\n\n renderRightActions = () => {\n return this.rightActionTemplate ? (\n <>\n {this.rightActionTemplate.getTemplate()}\n </>\n ) : null;\n };\n\n private loadData() {\n if (this.loadingData) {\n return;\n }\n if (isArray(this.state.props.dataset)\n && this.state.props.dataset.length > this.state.maxRecordsToShow) {\n this.loadingData = true;\n this.updateState({\n maxRecordsToShow: this.state.maxRecordsToShow + this.state.props.pagesize\n } as WmListState);\n setTimeout(() => {\n this.loadingData = false;\n }, 100);\n } else if (this.loadDataOnDemand) {\n const $list = this.proxy as any;\n $list.loadingdata = true;\n this.loadingData = true;\n this.props.getNextPageData && this.props.getNextPageData(null, this.proxy, this.state.currentPage + 1).then((data) => {\n if (isArray(data) && data.length > 0\n && isArray(this.state.props.dataset)) {\n $list.dataset = [...this.state.props.dataset, ...data];\n this.updateState({\n currentPage : this.state.currentPage + 1,\n maxRecordsToShow: this.state.maxRecordsToShow + this.state.props.pagesize\n } as WmListState);\n this.hasMoreData = true;\n } else {\n this.hasMoreData = false;\n }\n }).catch((err) => {\n console.error(err);\n }).then(() => {\n setTimeout(() => {\n $list.loadingdata = false;\n }, 1000);\n });\n }\n }\n\n private selectFirstItem() {\n const props = this.state.props;\n if (this.initialized\n && props.dataset\n && props.dataset.length) {\n const index = props.groupby ? '00': 0;\n this.onSelect(props.dataset[0], index);\n }\n }\n\n clear(){\n this.updateState({\n groupedData: {},\n } as WmListState);\n }\n\n selectItem(item: any){\n const dataset = this.state.props.dataset;\n if(isNumber(item)){\n this.onSelect(dataset[item], item);\n }\n else{\n let index = dataset.indexOf(item);\n this.onSelect(dataset[index], index);\n }\n }\n\n getItem(index: number){\n const props = this.state.props;\n return this.props.dataset[index]\n }\n\n deselect(item: any){\n const props = this.state.props;\n let selectedItem = null as any;\n let index = isNumber(item)?item:props.dataset.indexOf(item);\n if(props.multiselect && index >= 0){\n selectedItem = [...(props.selecteditem || [])];\n let selectedItemIndex = selectedItem.indexOf(props.dataset[index])\n if(selectedItemIndex >= 0){\n selectedItem.splice(selectedItemIndex, 1);\n }\n }\n else{\n if (props.selecteditem === props.dataset[index]) {\n selectedItem = null;\n }\n }\n this.updateState({\n props: { selecteditem: selectedItem },\n\n } as WmListState, () => {\n this.invokeEventCallback('onDeselect', [this.proxy, item]);\n });\n }\n\n getWidgets(widgetname: string, index: number){\n if(index >= 0 && index < this.itemWidgets.length){\n return this.itemWidgets[index][widgetname]\n }\n else{\n return this.itemWidgets.map(item => item[widgetname]).filter(widget => widget !== undefined);\n }\n }\n\n private deselectAll() {\n this.updateState({\n props: { selecteditem: null },\n selectedindex: -1\n } as WmListState);\n }\n\n setGroupData(items: any) {\n const dataItems = items;\n const props = this.state.props;\n if (props.groupby) {\n const groupedData = dataItems && getGroupedData(dataItems, props.groupby, props.match, props.orderby, props.dateformat, this);\n this.updateState({\n groupedData: groupedData\n } as WmListState, () => {\n this.keyExtractor?.clear();\n });\n }\n }\n\n public onPropertyChange(name: string, $new: any, $old: any) {\n super.onPropertyChange(name, $new, $old);\n const props = this.state.props;\n switch(name) {\n case 'selectfirstitem':\n if ($new) {\n this.selectFirstItem();\n }\n break;\n case 'dataset':\n if (this.state.props.groupby) {\n this.setGroupData($new);\n } else {\n if (!($old && $old.length)\n && $new && $new.length\n && this.loadDataOnDemand) {\n this.updateState({\n props: {\n dataset: [...$new]\n }\n } as WmListState);\n }\n const data = isArray($new) ? $new : (!isEmpty($new) && isDefined($new) ? [$new] : []);\n this.updateState({\n groupedData: (data[0] || props.direction === 'horizontal' ? [{\n key: 'key',\n data: data\n }] : [])\n } as WmListState, () => {\n this.keyExtractor?.clear();\n });\n }\n this.itemWidgets = [];\n if (props.selectfirstitem) {\n this.selectFirstItem();\n } else {\n this.deselectAll();\n }\n break;\n case 'groupby':\n case 'match':\n this.setGroupData(this.state.props.dataset);\n break;\n case 'multiselect':\n if ($new) {\n if (!isArray(this.state.props.selecteditem)) {\n this.state.props.selecteditem = this.state.props.selecteditem ?\n [this.state.props.selecteditem] : [];\n }\n } else if (isArray(this.state.props.selecteditem)) {\n this.state.props.selecteditem = this.state.props.selecteditem.pop();\n }\n break;\n case 'loadingdata':\n this.loadingData = $new && this.loadingData;\n break;\n case 'selecteditem':\n if($new != $old && isNumber($new)) {\n this.selectItem(this.state.props.dataset[$new])\n }\n break;\n }\n }\n\n componentDidMount() {\n const props = this.state.props;\n if (this.state.props.selectfirstitem && props.dataset?.length) {\n setTimeout(() => {\n this.onSelect(props.dataset[0], 0);\n });\n }\n this.subscribe('scroll', (event: any) => {\n const scrollPosition = event.nativeEvent.contentOffset.y + event.nativeEvent.layoutMeasurement.height;\n if (scrollPosition > this.endThreshold && this.state.props.direction === 'vertical') {\n this.loadData();\n }\n });\n super.componentDidMount();\n }\n\n componentDidUpdate(prevProps: WmListProps, prevState: WmListState, snapshot?: any) {\n super.componentDidUpdate && super.componentDidUpdate(prevProps, prevState, snapshot);\n this.invokeEventCallback('onRender', [this, this.state.props.dataset]);\n }\n\n getDefaultStyles() {\n const isHorizontal = this.state.props.direction === 'horizontal';\n return this.theme.getStyle(`${this.defaultClass} ${isHorizontal ? 'app-horizontal-list' : 'app-vertical-list'}`);\n }\n\n getIndex(item: any) {\n return this.state.props.dataset.indexOf(item);\n }\n\n private generateItemKey(item: any, index: number, props: WmListProps) {\n if (props.itemkey && item && !this._showSkeleton) {\n return props.itemkey(item, index);\n }\n return 'list_item_' + this.keyExtractor.getKey(item, true);\n }\n\n private renderItem(item: any, index: number, props: WmListProps) {\n const cols = this. getNoOfColumns();\n const isHorizontal = (props.direction === 'horizontal');\n return (index < this.state.maxRecordsToShow || isHorizontal) ? (\n <Swipeable\n renderLeftActions={() => this.renderLeftActions()}\n renderRightActions={() => this.renderRightActions()} containerStyle={ cols ? { width: round(100/cols) + \"%\" , flex: null } as any :{}}>\n <View style={[\n this.styles.item,\n props.itemclass ? this.theme.getStyle(props.itemclass(item, index)) : null,\n this.isSelected(item) ? this.styles.selectedItem : {}]}>\n <Tappable\n {...this.getTestPropsForAction(`item${index}`)}\n onTap={($event) => this.onSelect(item, index, $event)}\n onLongTap={() => this.invokeEventCallback('onLongtap', [null, this.proxy])}\n onDoubleTap={() => this.invokeEventCallback('onDoubletap', [null, this.proxy])}\n styles={\n [{display: 'flex', flexDirection : 'row'},\n cols ? {\n width: '100%'\n } : null,\n (cols && cols > 1) || isHorizontal ? {\n paddingRight: (isNil(this.styles.item.marginRight)\n ? this.styles.item.margin : this.styles.item.marginRight) || 4\n } : null\n ]\n }>\n {props.renderItem(item, index, this)}\n {this.isSelected(item) ? (\n <WmIcon id={this.getTestId('icon' + index)} iconclass='wi wi-check-circle' styles={this.styles.selectedIcon} />\n ) : null}\n </Tappable>\n </View>\n </Swipeable>\n ) : null;\n }\n\n private renderHeader(props: WmListProps, title: string) {\n return props.groupby ? (\n <Text style={this.styles.groupHeading} accessibilityRole='header'>{title}</Text>\n ) : (props.iconclass || props.title || props.subheading) ? (\n <View style={this.styles.heading}>\n <View style={{flex: 1, flexDirection: 'row'}}>\n <WmIcon id={this.getTestId('icon')} styles={this.styles.listIcon} iconclass={props.iconclass}></WmIcon>\n <View>\n <WmLabel id={this.getTestId('title')} styles={this.styles.title} caption={props.title} accessibilityrole='header'></WmLabel>\n <WmLabel id={this.getTestId('subheading')} styles={this.styles.subheading} caption={props.subheading}></WmLabel>\n </View>\n </View>\n </View>) : null;\n }\n\n private renderEmptyMessage(isHorizontal: boolean, item: any, index: any, props: WmListProps) {\n return (<WmLabel id={this.getTestId('emptymsg')} styles={this.styles.emptyMessage} caption={props.nodatamessage}></WmLabel>);\n }\n\n private renderLoadingIcon(props: WmListProps) {\n return props.loadingicon ? (<WmIcon\n id={this.getTestId('loadingicon')}\n styles={this.styles.loadingIcon}\n iconclass={props.loadingicon}\n caption={props.loadingdatamsg}></WmIcon>)\n : (\n <ActivityIndicator color={this.styles.loadingIcon.text.color}></ActivityIndicator>\n );\n }\n\n public getNoOfColumns() {\n const props = this.state.props;\n if(props.direction === 'vertical') {\n return props.itemsperrow.xs;\n }\n return 0;\n }\n\n private onLayoutChange(e: LayoutChangeEvent) {\n const l = e.nativeEvent.layout;\n this.endThreshold = l.height + l.y - 100;\n if (!this.endThreshold) {\n this.endThreshold = -1;\n }\n }\n\n private renderWithFlatList(props: WmListProps, isHorizontal = false) {\n return (\n <View style={this.styles.root} onLayout={e => this.onLayoutChange(e)}>\n {!isEmpty(this.state.groupedData) ? this.state.groupedData.map((v: any, i) => ((\n <View style={this.styles.group} key={v.key || this.keyExtractor.getKey(v, true)}>\n {this.renderHeader(props, v.key)}\n <FlatList\n key={props.name + '_' + (isHorizontal ? 'H' : 'V') + props.itemsperrow.xs}\n keyExtractor={(item, i) => this.generateItemKey(item, i, props)}\n scrollEnabled={isHorizontal}\n horizontal = {isHorizontal}\n data={isEmpty(v.data[0]) ? []: v.data}\n ListEmptyComponent = {(itemInfo) => this.renderEmptyMessage(isHorizontal, itemInfo.item, itemInfo.index, props)}\n renderItem={(itemInfo) => this.renderItem(itemInfo.item, itemInfo.index, props)}\n {...(isHorizontal ? {} : {numColumns : this.getNoOfColumns()})}>\n </FlatList>\n {this.loadDataOnDemand || (v.data.length > this.state.maxRecordsToShow) ?\n (this.loadingData ?\n this.renderLoadingIcon(props) :\n (<WmLabel id={this.getTestId('ondemandmessage')}\n styles={this.styles.onDemandMessage}\n caption={this.hasMoreData && !isHorizontal ? props.ondemandmessage : props.nodatamessage}\n onTap={() => this.loadData()}></WmLabel>))\n : null}\n </View>\n ))) : this.renderEmptyMessage(isHorizontal, null, null,props)\n }\n </View>);\n }\n\n private getSectionListData() {\n if (this._showSkeleton) {\n return [{\n key: '',\n data: [{}, {}, {}]\n }];\n } else if (this.state.groupedData\n && this.state.groupedData[0]\n && this.state.groupedData[0]['data'].length) {\n return this.state.groupedData;\n }\n return [];\n }\n\n private renderWithSectionList(props: WmListProps, isHorizontal = false) {\n return (\n <SectionList\n keyExtractor={(item, i) => this.generateItemKey(item, i, props)}\n horizontal = {isHorizontal}\n contentContainerStyle={this.styles.root}\n sections={this.getSectionListData()}\n renderSectionHeader={({ section: {key, data}}) => {\n return this.renderHeader(props, key);\n }}\n renderSectionFooter={() => props.loadingdata ? this.renderLoadingIcon(props) : null}\n ListEmptyComponent = {(itemInfo) => this.renderEmptyMessage(isHorizontal, itemInfo.item, itemInfo.index, props)}\n renderItem={(itemInfo) => this.renderItem(itemInfo.item, itemInfo.index, props)}>\n </SectionList>\n );\n }\n\n renderWidget(props: WmListProps) {\n this.invokeEventCallback('onBeforedatarender', [this, this.state.props.dataset]);\n const isHorizontal = (props.direction === 'horizontal');\n return (\n <View style={isHorizontal ? null : { width: '100%' }}>\n {this._background}\n {(isHorizontal || !props.groupby) ?\n this.renderWithFlatList(props, isHorizontal)\n : this.renderWithSectionList(props, isHorizontal)}\n </View>);\n }\n}\n"],"mappings":";;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,iBAAiB,EAAEC,WAAW,EAAEC,IAAI,EAAEC,IAAI,EAAEC,QAAQ,QAA4C,cAAc;AACvH,SAASC,OAAO,EAAEC,OAAO,EAAEC,KAAK,EAAEC,QAAQ,EAAEC,KAAK,QAAQ,WAAW;AACpE,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,+CAA+C;AACjG,SAAQC,cAAc,EAAEC,SAAS,QAAO,sCAAsC;AAC9E,SAASC,QAAQ,QAAQ,mDAAmD;AAC5E,SAASC,mBAAmB,QAAQ,8CAA8C;AAClF,OAAOC,OAAO,MAAM,kEAAkE;AACtF,OAAOC,MAAM,MAAM,gEAAgE;AACnF,SAASC,SAAS,QAAQ,8BAA8B;AAGxD,OAAOC,WAAW,MAAM,cAAc;AACtC,SAASC,aAAa,QAAsB,eAAe;AAG3D,OAAO,MAAMC,W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AA6B,aAAA,CAACzB,IAAI;MAAC4I,KAAK,EAAEjB,YAAY,GAAG,IAAI,GAAG;QAAEe,KAAK,EAAE;MAAO;IAAE,GAClD,IAAI,CAACgE,WAAW,EACf/E,YAAY,IAAI,CAACpG,KAAK,CAACoD,OAAO,GAC9B,IAAI,CAAC0G,kBAAkB,CAAC9J,KAAK,EAAEoG,YAAY,CAAC,GAC5C,IAAI,CAACwE,qBAAqB,CAAC5K,KAAK,EAAEoG,YAAY,CAC9C,CAAC;EACX;AACF","ignoreList":[]}
@@ -71,12 +71,14 @@ export default class WmDialog extends BaseComponent {
71
71
  }, /*#__PURE__*/React.createElement(ThemeProvider, {
72
72
  value: this.theme
73
73
  }, /*#__PURE__*/React.createElement(View, {
74
- style: this.styles.root
74
+ style: this.styles.root,
75
+ testID: "wm-dialog"
75
76
  }, this._background, props.showheader ? /*#__PURE__*/React.createElement(View, {
76
- style: this.styles.header
77
+ style: this.styles.header,
78
+ testID: "wm-dialog-header"
77
79
  }, /*#__PURE__*/React.createElement(View, {
78
80
  style: this.styles.headerLabel
79
- }, props.iconclass || props.iconurl ? /*#__PURE__*/React.createElement(WmIcon, {
81
+ }, props.iconclass || props.iconurl || props.title ? /*#__PURE__*/React.createElement(WmIcon, {
80
82
  id: this.getTestId('icon'),
81
83
  caption: props.title,
82
84
  accessibilityrole: "header",
@@ -1 +1 @@
1
- {"version":3,"names":["React","View","ModalConsumer","AssetProvider","HideMode","ThemeProvider","BaseComponent","BaseComponentState","WmIcon","WmButton","WmDialogProps","DEFAULT_CLASS","WmDialogState","constructor","args","_defineProperty","WmDialog","props","hideMode","DONOT_ADD_TO_DOM","state","modalOptions","onClose","Promise","res","updateState","show","invokeEventCallback","onOpen","open","close","_close","prepareModalOptions","content","modalService","o","name","modalStyle","styles","modal","contentStyle","isModal","centered","animation","animationdelay","hideModal","renderWidget","createElement","showModal","value","loadAsset","theme","style","root","_background","showheader","header","headerLabel","iconclass","iconurl","id","getTestId","caption","title","accessibilityrole","icon","iconheight","iconmargin","iconwidth","closable","onTap","closeBtn","children"],"sources":["dialog.component.tsx"],"sourcesContent":["import React from 'react';\nimport { Text, View } from 'react-native';\n\nimport { ModalConsumer, ModalOptions, ModalService } from '@wavemaker/app-rn-runtime/core/modal.service';\nimport { AssetProvider } from '@wavemaker/app-rn-runtime/core/asset.provider';\nimport { HideMode } from '@wavemaker/app-rn-runtime/core/if.component';\nimport { ThemeProvider } from '@wavemaker/app-rn-runtime/styles/theme';\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\nimport WmIcon from '@wavemaker/app-rn-runtime/components/basic/icon/icon.component';\nimport WmButton from '@wavemaker/app-rn-runtime/components/basic/button/button.component';\n\nimport WmDialogProps from './dialog.props';\nimport { DEFAULT_CLASS, WmDialogStyles } from './dialog.styles';\n\nexport class WmDialogState extends BaseComponentState<WmDialogProps> {\n modalOptions = {} as ModalOptions;\n}\n\nexport default class WmDialog extends BaseComponent<WmDialogProps, WmDialogState, WmDialogStyles> {\n\n private _close: Function = () => {};\n\n constructor(props: WmDialogProps) {\n super(props, DEFAULT_CLASS, new WmDialogProps(), new WmDialogState());\n this.hideMode = HideMode.DONOT_ADD_TO_DOM;\n this.state.modalOptions.onClose = () => {\n return new Promise<void>((res) => {\n this.updateState({\n props: {show: false}\n } as WmDialogState, () => {\n this.invokeEventCallback('onClose', [null, this]);\n res();\n });\n });\n };\n this.state.modalOptions.onOpen = () => {\n this.invokeEventCallback('onOpened', [null, this]);\n };\n }\n\n open() {\n if (!this.state.props.show) {\n this.updateState({\n props:{show: true}\n } as WmDialogState);\n }\n }\n\n close() {\n this._close();\n }\n\n prepareModalOptions(content: React.ReactNode, modalService: ModalService) {\n const o = this.state.modalOptions;\n o.name = this.state.props.name;\n o.modalStyle = this.styles.modal;\n o.content = content;\n o.contentStyle = this.styles.content;\n o.isModal = !!this.state.props.modal;\n o.centered = true;\n o.animation = this.state.props.animation;\n o.animationdelay = this.state.props.animationdelay || 0;\n this._close = () => modalService.hideModal(this.state.modalOptions);\n return o;\n }\n\n renderWidget(props: WmDialogProps) {\n return (<ModalConsumer>\n {(modalService: ModalService) => {\n modalService.showModal(this.prepareModalOptions((\n <AssetProvider value={this.loadAsset}>\n <ThemeProvider value={this.theme}>\n <View style={this.styles.root}>\n {this._background}\n {props.showheader ? (<View style={this.styles.header}>\n <View style={this.styles.headerLabel}>\n {props.iconclass || props.iconurl ?\n <WmIcon id={this.getTestId('icon')}\n caption={props.title}\n accessibilityrole='header'\n iconclass={props.iconclass}\n styles={this.styles.icon}\n iconurl={props.iconurl}\n iconheight={props.iconheight}\n iconmargin={props.iconmargin}\n iconwidth={props.iconwidth}\n /> : null}\n </View>\n {props.closable && <WmButton id={this.getTestId('closebtn')} show={props.closable} iconclass=\"wm-sl-l sl-close\" onTap={() => this.close()} styles={this.styles.closeBtn}></WmButton>}\n </View>) : null}\n {props.children}\n </View>\n </ThemeProvider>\n </AssetProvider>\n ), modalService));\n return null;\n }}\n </ModalConsumer>);\n }\n}\n"],"mappings":";;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAAeC,IAAI,QAAQ,cAAc;AAEzC,SAASC,aAAa,QAAoC,8CAA8C;AACxG,SAASC,aAAa,QAAQ,+CAA+C;AAC7E,SAASC,QAAQ,QAAQ,6CAA6C;AACtE,SAASC,aAAa,QAAQ,wCAAwC;AACtE,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,+CAA+C;AACjG,OAAOC,MAAM,MAAM,gEAAgE;AACnF,OAAOC,QAAQ,MAAM,oEAAoE;AAEzF,OAAOC,aAAa,MAAM,gBAAgB;AAC1C,SAASC,aAAa,QAAwB,iBAAiB;AAE/D,OAAO,MAAMC,aAAa,SAASL,kBAAkB,CAAgB;EAAAM,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAC,eAAA,uBACpD,CAAC,CAAC;EAAA;AACnB;AAEA,eAAe,MAAMC,QAAQ,SAASV,aAAa,CAA+C;EAIhGO,WAAWA,C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0C,OAAO,gBAC/B3D,KAAA,CAAA+C,aAAA,CAACvC,MAAM;QAACoD,EAAE,EAAE,IAAI,CAACC,SAAS,CAAC,MAAM,CAAE;QAClCC,OAAO,EAAE7C,KAAK,CAAC8C,KAAM;QACrBC,iBAAiB,EAAC,QAAQ;QAC1BN,SAAS,EAAEzC,KAAK,CAACyC,SAAU;QAC3BpB,MAAM,EAAE,IAAI,CAACA,MAAM,CAAC2B,IAAK;QACzBN,OAAO,EAAE1C,KAAK,CAAC0C,OAAQ;QACvBO,UAAU,EAAEjD,KAAK,CAACiD,UAAW;QAC7BC,UAAU,EAAElD,KAAK,CAACkD,UAAW;QAC7BC,SAAS,EAAEnD,KAAK,CAACmD;MAAU,CAC1B,CAAC,GAAG,IACF,CAAC,EACNnD,KAAK,CAACoD,QAAQ,iBAAIrE,KAAA,CAAA+C,aAAA,CAACtC,QAAQ;QAACmD,EAAE,EAAE,IAAI,CAACC,SAAS,CAAC,UAAU,CAAE;QAACnC,IAAI,EAAET,KAAK,CAACoD,QAAS;QAACX,SAAS,EAAC,kBAAkB;QAACY,KAAK,EAAEA,CAAA,KAAM,IAAI,CAACxC,KAAK,CAAC,CAAE;QAACQ,MAAM,EAAE,IAAI,CAACA,MAAM,CAACiC;MAAS,CAAW,CAC/K,CAAC,GAAI,IAAI,EACdtD,KAAK,CAACuD,QACH,CACO,CACF,CAAC,EACftC,YAAY,CAAC,CAAC;MACjB,OAAO,IAAI;IACb,CACa,CAAC;EAClB;AACF","ignoreList":[]}
1
+ {"version":3,"names":["React","View","ModalConsumer","AssetProvider","HideMode","ThemeProvider","BaseComponent","BaseComponentState","WmIcon","WmButton","WmDialogProps","DEFAULT_CLASS","WmDialogState","constructor","args","_defineProperty","WmDialog","props","hideMode","DONOT_ADD_TO_DOM","state","modalOptions","onClose","Promise","res","updateState","show","invokeEventCallback","onOpen","open","close","_close","prepareModalOptions","content","modalService","o","name","modalStyle","styles","modal","contentStyle","isModal","centered","animation","animationdelay","hideModal","renderWidget","createElement","showModal","value","loadAsset","theme","style","root","testID","_background","showheader","header","headerLabel","iconclass","iconurl","title","id","getTestId","caption","accessibilityrole","icon","iconheight","iconmargin","iconwidth","closable","onTap","closeBtn","children"],"sources":["dialog.component.tsx"],"sourcesContent":["import React from 'react';\nimport { Text, View } from 'react-native';\n\nimport { ModalConsumer, ModalOptions, ModalService } from '@wavemaker/app-rn-runtime/core/modal.service';\nimport { AssetProvider } from '@wavemaker/app-rn-runtime/core/asset.provider';\nimport { HideMode } from '@wavemaker/app-rn-runtime/core/if.component';\nimport { ThemeProvider } from '@wavemaker/app-rn-runtime/styles/theme';\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\nimport WmIcon from '@wavemaker/app-rn-runtime/components/basic/icon/icon.component';\nimport WmButton from '@wavemaker/app-rn-runtime/components/basic/button/button.component';\n\nimport WmDialogProps from './dialog.props';\nimport { DEFAULT_CLASS, WmDialogStyles } from './dialog.styles';\n\nexport class WmDialogState extends BaseComponentState<WmDialogProps> {\n modalOptions = {} as ModalOptions;\n}\n\nexport default class WmDialog extends BaseComponent<WmDialogProps, WmDialogState, WmDialogStyles> {\n\n private _close: Function = () => {};\n\n constructor(props: WmDialogProps) {\n super(props, DEFAULT_CLASS, new WmDialogProps(), new WmDialogState());\n this.hideMode = HideMode.DONOT_ADD_TO_DOM;\n this.state.modalOptions.onClose = () => {\n return new Promise<void>((res) => {\n this.updateState({\n props: {show: false}\n } as WmDialogState, () => {\n this.invokeEventCallback('onClose', [null, this]);\n res();\n });\n });\n };\n this.state.modalOptions.onOpen = () => {\n this.invokeEventCallback('onOpened', [null, this]);\n };\n }\n\n open() {\n if (!this.state.props.show) {\n this.updateState({\n props:{show: true}\n } as WmDialogState);\n }\n }\n\n close() {\n this._close();\n }\n\n prepareModalOptions(content: React.ReactNode, modalService: ModalService) {\n const o = this.state.modalOptions;\n o.name = this.state.props.name;\n o.modalStyle = this.styles.modal;\n o.content = content;\n o.contentStyle = this.styles.content;\n o.isModal = !!this.state.props.modal;\n o.centered = true;\n o.animation = this.state.props.animation;\n o.animationdelay = this.state.props.animationdelay || 0;\n this._close = () => modalService.hideModal(this.state.modalOptions);\n return o;\n }\n\n renderWidget(props: WmDialogProps) {\n return (<ModalConsumer>\n {(modalService: ModalService) => {\n modalService.showModal(this.prepareModalOptions((\n <AssetProvider value={this.loadAsset}>\n <ThemeProvider value={this.theme}>\n <View style={this.styles.root} testID=\"wm-dialog\">\n {this._background}\n {props.showheader ? (<View style={this.styles.header} testID=\"wm-dialog-header\">\n <View style={this.styles.headerLabel}>\n {props.iconclass || props.iconurl || props.title ?\n <WmIcon id={this.getTestId('icon')}\n caption={props.title}\n accessibilityrole='header'\n iconclass={props.iconclass}\n styles={this.styles.icon}\n iconurl={props.iconurl}\n iconheight={props.iconheight}\n iconmargin={props.iconmargin}\n iconwidth={props.iconwidth}\n /> : null}\n </View>\n {props.closable && <WmButton id={this.getTestId('closebtn')} show={props.closable} iconclass=\"wm-sl-l sl-close\" onTap={() => this.close()} styles={this.styles.closeBtn}></WmButton>}\n </View>) : null}\n {props.children}\n </View>\n </ThemeProvider>\n </AssetProvider>\n ), modalService));\n return null;\n }}\n </ModalConsumer>);\n }\n}\n"],"mappings":";;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAAeC,IAAI,QAAQ,cAAc;AAEzC,SAASC,aAAa,QAAoC,8CAA8C;AACxG,SAASC,aAAa,QAAQ,+CAA+C;AAC7E,SAASC,QAAQ,QAAQ,6CAA6C;AACtE,SAASC,aAAa,QAAQ,wCAAwC;AACtE,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,+CAA+C;AACjG,OAAOC,MAAM,MAAM,gEAAgE;AACnF,OAAOC,QAAQ,MAAM,oEAAoE;AAEzF,OAAOC,aAAa,MAAM,gBAAgB;AAC1C,SAASC,aAAa,QAAwB,iBAAiB;AAE/D,OAAO,MAAMC,aAAa,SAASL,kBAAkB,CAAgB;EAAAM,YAAA,GAAAC,IAAA;I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MAAO;QAACH,MAAM,EAAC;MAAkB,gBAC7EtD,KAAA,CAAA+C,aAAA,CAAC9C,IAAI;QAACmD,KAAK,EAAE,IAAI,CAACd,MAAM,CAACoB;MAAY,GACpCzC,KAAK,CAAC0C,SAAS,IAAI1C,KAAK,CAAC2C,OAAO,IAAI3C,KAAK,CAAC4C,KAAK,gBAC9C7D,KAAA,CAAA+C,aAAA,CAACvC,MAAM;QAACsD,EAAE,EAAE,IAAI,CAACC,SAAS,CAAC,MAAM,CAAE;QAClCC,OAAO,EAAE/C,KAAK,CAAC4C,KAAM;QACrBI,iBAAiB,EAAC,QAAQ;QAC1BN,SAAS,EAAE1C,KAAK,CAAC0C,SAAU;QAC3BrB,MAAM,EAAE,IAAI,CAACA,MAAM,CAAC4B,IAAK;QACzBN,OAAO,EAAE3C,KAAK,CAAC2C,OAAQ;QACvBO,UAAU,EAAElD,KAAK,CAACkD,UAAW;QAC7BC,UAAU,EAAEnD,KAAK,CAACmD,UAAW;QAC7BC,SAAS,EAAEpD,KAAK,CAACoD;MAAU,CAC1B,CAAC,GAAG,IACF,CAAC,EACNpD,KAAK,CAACqD,QAAQ,iBAAItE,KAAA,CAAA+C,aAAA,CAACtC,QAAQ;QAACqD,EAAE,EAAE,IAAI,CAACC,SAAS,CAAC,UAAU,CAAE;QAACrC,IAAI,EAAET,KAAK,CAACqD,QAAS;QAACX,SAAS,EAAC,kBAAkB;QAACY,KAAK,EAAEA,CAAA,KAAM,IAAI,CAACzC,KAAK,CAAC,CAAE;QAACQ,MAAM,EAAE,IAAI,CAACA,MAAM,CAACkC;MAAS,CAAW,CAC/K,CAAC,GAAI,IAAI,EACdvD,KAAK,CAACwD,QACH,CACO,CACF,CAAC,EACfvC,YAAY,CAAC,CAAC;MACjB,OAAO,IAAI;IACb,CACa,CAAC;EAClB;AACF","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["BaseComponent","BaseComponentState","find","isString","isEqual","isFunction","includes","get","forEach","isObject","isArray","filter","trim","uniqBy","uniqWith","getGroupedData","getOrderedDataset","isDefined","validateField","DEFAULT_CLASS","BaseDatasetState","constructor","args","_defineProperty","BaseDatasetComponent","props","defaultClass","defaultProps","defaultState","onPropertyChange","name","$new","$old","state","setDataItems","dataset","setGroupData","dataItems","dataValue","isDefault","updateState","onFieldChange","bind","items","groupby","groupedData","match","orderby","dateformat","onDataItemsUpdate","validate","value","validationObj","setState","isValid","errorType","updateDatavalue","Promise","resolve","datavalue","computeDisplayValue","onValueChange","datafield","selectedItem","item","key","dataObject","onChange","getItemKey","oldValue","then","invokeEventCallback","undefined","proxy","displayValue","selected","map","displayexp","displayfield","getUniqObjsByDataField","data","allowEmptyFields","uniqData","isAllFields","obj","propsObj","allowEmpty","datavalueItems","split","s","i","toString","push","isSelected","length","df","d","datafieldValue","_get","_get2","displaylabel","getDisplayExpression","imgSrc","displayimagesrc","icon","iconclass","isUpdated"],"sources":["basedataset.component.ts"],"sourcesContent":["import { BaseComponent, BaseComponentState } from \"@wavemaker/app-rn-runtime/core/base.component\";\nimport BaseDatasetProps from '@wavemaker/app-rn-runtime/components/input/basedataset/basedataset.props';\nimport { find, isString, isEqual,isEmpty, isFunction, includes, get, forEach, isObject, isArray, filter, trim, uniqBy, uniqWith } from 'lodash';\nimport { getGroupedData, getOrderedDataset, isDefined, validateField } from \"@wavemaker/app-rn-runtime/core/utils\";\nimport { DEFAULT_CLASS, BaseDatasetStyles } from \"@wavemaker/app-rn-runtime/components/input/basedataset/basedataset.styles\";\n\nexport class BaseDatasetState <T extends BaseDatasetProps> extends BaseComponentState<T> {\n dataItems: any;\n groupedData: any;\n isDefault = false;\n isValid = true;\n errorType = '';\n}\n\nexport abstract class BaseDatasetComponent< T extends BaseDatasetProps, S extends BaseDatasetState<T>, L extends BaseDatasetStyles> extends BaseComponent<T, S, L> {\n\n constructor(props: T, public defaultClass: string = DEFAULT_CLASS, defaultProps?: T, defaultState?: S) {\n super(props, defaultClass, defaultProps, defaultState);\n\n }\n\n onPropertyChange(name: string, $new: any, $old: any) {\n const props = this.state.props;\n switch (name) {\n case 'dataset':\n this.setDataItems($new);\n break;\n case 'getDisplayExpression':\n case 'displayfield':\n case 'displaylabel':\n case 'displayimagesrc':\n case 'datafield':\n case 'orderby':\n this.setDataItems(this.state.props.dataset);\n break;\n case 'groupby':\n case 'match':\n this.setGroupData(this.state.dataItems);\n case 'datavalue':\n this.setDataItems(this.state.props.dataset, { dataValue: $new });\n const isDefault = this.state.isDefault;\n if (isDefault) {\n this.updateState({ isDefault: false } as S, this.props.onFieldChange && this.props.onFieldChange.bind(this, 'datavalue', $new, $old, isDefault));\n } else {\n this.props.onFieldChange && this.props.onFieldChange('datavalue', $new, $old, isDefault);\n }\n }\n }\n\n setGroupData(items: any) {\n const dataItems = items;\n const props = this.state.props;\n if (props.groupby) {\n const groupedData = dataItems && getGroupedData(dataItems, props.groupby, props.match, props.orderby, props.dateformat, this, 'dataObject');\n this.updateState({ groupedData: groupedData } as S, () => this.onDataItemsUpdate());\n }\n }\n\n validate(value: any) {\n const validationObj = validateField(this.state.props, value);\n this.setState({\n isValid: validationObj.isValid,\n errorType: validationObj.errorType\n } as S);\n }\n\n updateDatavalue(value: any) {\n return new Promise<void>((resolve) => {\n this.updateState({\n props: { datavalue: value }\n } as S,\n () => {\n this.computeDisplayValue();\n resolve();\n });\n });\n }\n\n onValueChange(value: any) {\n if (this.state.props.datafield === 'All Fields') {\n const selectedItem = find(this.state.dataItems, (item) => isEqual(item.key, value));\n value = selectedItem && selectedItem.dataObject;\n }\n this.onChange(value);\n }\n\n getItemKey(value: any) {\n const selectedItem = find(this.state.dataItems, (item) => isEqual(item.dataObject, value));\n return selectedItem && selectedItem.key;\n }\n\n onChange(value: any) {\n const oldValue = this.state.props.datavalue;\n this.validate(value);\n this.updateDatavalue(value)\n .then(() => {\n if (value !== oldValue) {\n if (this.props.onFieldChange) {\n this.props.onFieldChange('datavalue', value, oldValue);\n } else {\n this.invokeEventCallback('onChange', [\n undefined,\n this.proxy,\n value,\n oldValue,\n ]);\n }\n }\n });\n }\n\n computeDisplayValue() {\n this.updateState({\n props: {\n displayValue: ((this.state.dataItems || [] as any)\n .filter((item: any) => item.selected)\n .map((item: any) => item.displayexp || item.displayfield))[0] || ''\n }\n } as S);\n }\n\n onDataItemsUpdate() {\n this.computeDisplayValue();\n }\n\n getUniqObjsByDataField(\n data: any,\n allowEmptyFields: boolean = true\n ) {\n let uniqData;\n const isAllFields = this.state.props.datafield === 'All Fields';\n\n uniqData = isAllFields ? uniqWith(data, isEqual) : uniqBy(data, 'datafield');\n\n if (!this.state.props.displayfield || allowEmptyFields) {\n return uniqData;\n }\n\n // return objects having non empty datafield and display field values.\n return filter(uniqData, (obj) => {\n if (isAllFields) {\n return trim(obj.displayfield);\n }\n return trim(obj.datafield) && trim(obj.displayfield);\n });\n }\n\n setDataItems(dataset: any, propsObj?: { [key: string]: any }, allowEmpty: boolean = true) {\n const name = this.props.name;\n const props = this.state.props;\n const datavalue = propsObj ? propsObj['dataValue'] : props.datavalue;\n let dataItems: any = [];\n let datavalueItems: any = [];\n if (typeof datavalue === 'string') {\n datavalueItems = datavalue.split(',');\n datavalueItems = allowEmpty ? datavalueItems : datavalueItems.map((item: any) => item.trim());\n } else if (isArray(datavalue)) {\n datavalueItems = datavalue;\n } else {\n if (isDefined(datavalue)) {\n datavalueItems = [datavalue];\n }\n }\n if (typeof dataset === 'string') {\n dataset = dataset.split(',');\n }\n if (isArray(dataset) && !isObject(dataset[0])) {\n dataItems = dataset.map((s, i) => {\n s = isString(s) ? s.trim() : s;\n return {\n key: `${name}_item${i}`,\n dataObject: s,\n displayfield: s.toString(),\n datafield: s,\n selected: includes(datavalueItems, s) || includes(datavalueItems, s.toString()) || datavalue === s ? true : false,\n };\n });\n } else if (dataset) {\n if (isObject(dataset) && !isArray(dataset)) {\n forEach(dataset, (value, key) => {\n if (isDefined(key) && key !== null) {\n dataItems.push({key: `${name}_item${key}`, displayfield: value, datafield: key, dataObject: dataset});\n }\n });\n } else {\n const isSelected = (item: any) => {\n if (datavalueItems.length) {\n let datafield = this.state.props.datafield;\n if (!datafield) {\n datafield = 'All Fields';\n }\n if (datafield === 'All Fields') {\n return includes(datavalueItems, item);\n }\n let df = get(item, datafield);\n if (isDefined(df) && df !== null) {\n return (includes(datavalueItems, df) || includes(datavalueItems, df.toString()));\n }\n }\n return false;\n };\n forEach(dataset as any[], (d, i) => {\n let datafieldValue = this.state.props.datafield === 'All Fields' ? d : get(d, this.state.props.datafield);\n if (isDefined(datafieldValue) && datafieldValue !== null) {\n dataItems.push({\n key: `${name}_item${i}`,\n dataObject: d,\n displayfield: (get(d, this.state.props.displayfield))?.toString() || (get(d, this.state.props.displaylabel))?.toString(),\n datafield: datafieldValue,\n displayexp: this.state.props.getDisplayExpression ? this.state.props.getDisplayExpression(d) : get(d, this.state.props.displayfield),\n selected: isSelected(d),\n imgSrc: isFunction(this.state.props.displayimagesrc) ? this.state.props.displayimagesrc(d) : get(d, this.state.props.displayimagesrc),\n icon: d[this.props.iconclass]\n });\n }\n });\n }\n }\n if (dataItems.length) {\n dataItems = this.getUniqObjsByDataField(dataItems, allowEmpty);\n }\n const isUpdated = !isEqual(dataItems, this.state.dataItems);\n if (props.groupby) {\n this.setGroupData(dataItems);\n this.updateState({ dataItems: dataItems } as S, () => isUpdated && this.onDataItemsUpdate());\n } else if (props.orderby) {\n this.updateState({ dataItems: getOrderedDataset(dataItems, props.orderby, 'dataObject')} as S, () => isUpdated && this.onDataItemsUpdate());\n } else {\n this.updateState({ dataItems: dataItems } as S, () => isUpdated && this.onDataItemsUpdate());\n }\n }\n}\n"],"mappings":";;;AAAA,SAASA,aAAa,EAAEC,kBAAkB,QAAQ,+CAA+C;AAEjG,SAASC,IAAI,EAAEC,QAAQ,EAAEC,OAAO,EAAUC,UAAU,EAAEC,QAAQ,EAAEC,GAAG,EAAEC,OAAO,EAAEC,QAAQ,EAAEC,OAAO,EAAEC,MAAM,EAAEC,IAAI,EAAEC,MAAM,EAAEC,QAAQ,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EH,SAAS,EAAEA;MAAU,CAAC,EAAO,MAAMqE,SAAS,IAAI,IAAI,CAACzD,iBAAiB,CAAC,CAAC,CAAC;IAC9F;EACF;AACF","ignoreList":[]}
1
+ {"version":3,"names":["BaseComponent","BaseComponentState","find","isString","isEqual","isFunction","includes","get","forEach","isObject","isArray","filter","trim","uniqBy","uniqWith","getGroupedData","getOrderedDataset","isDefined","validateField","DEFAULT_CLASS","BaseDatasetState","constructor","args","_defineProperty","BaseDatasetComponent","props","defaultClass","defaultProps","defaultState","onPropertyChange","name","$new","$old","state","setDataItems","dataset","setGroupData","dataItems","dataValue","isDefault","updateState","onFieldChange","bind","items","groupby","groupedData","match","orderby","dateformat","onDataItemsUpdate","validate","value","validationObj","setState","isValid","errorType","updateDatavalue","Promise","resolve","datavalue","computeDisplayValue","onValueChange","datafield","selectedItem","item","key","dataObject","onChange","getItemKey","oldValue","then","invokeEventCallback","undefined","proxy","displayValue","selected","map","displayexp","displayfield","getUniqObjsByDataField","data","allowEmptyFields","uniqData","isAllFields","obj","propsObj","allowEmpty","datavalueItems","split","s","i","toString","push","isSelected","length","df","d","datafieldValue","_get","_get2","displaylabel","getDisplayExpression","imgSrc","displayimagesrc","icon","iconclass","isUpdated"],"sources":["basedataset.component.ts"],"sourcesContent":["import { BaseComponent, BaseComponentState } from \"@wavemaker/app-rn-runtime/core/base.component\";\nimport BaseDatasetProps from '@wavemaker/app-rn-runtime/components/input/basedataset/basedataset.props';\nimport { find, isString, isEqual,isEmpty, isFunction, includes, get, forEach, isObject, isArray, filter, trim, uniqBy, uniqWith } from 'lodash';\nimport { getGroupedData, getOrderedDataset, isDefined, validateField } from \"@wavemaker/app-rn-runtime/core/utils\";\nimport { DEFAULT_CLASS, BaseDatasetStyles } from \"@wavemaker/app-rn-runtime/components/input/basedataset/basedataset.styles\";\n\nexport class BaseDatasetState <T extends BaseDatasetProps> extends BaseComponentState<T> {\n dataItems: any;\n groupedData: any;\n isDefault = false;\n isValid = true;\n errorType = '';\n}\n\nexport abstract class BaseDatasetComponent< T extends BaseDatasetProps, S extends BaseDatasetState<T>, L extends BaseDatasetStyles> extends BaseComponent<T, S, L> {\n\n constructor(props: T, public defaultClass: string = DEFAULT_CLASS, defaultProps?: T, defaultState?: S) {\n super(props, defaultClass, defaultProps, defaultState);\n\n }\n\n onPropertyChange(name: string, $new: any, $old: any) {\n const props = this.state.props;\n switch (name) {\n case 'dataset':\n this.setDataItems($new);\n break;\n case 'getDisplayExpression':\n case 'displayfield':\n case 'displaylabel':\n case 'displayimagesrc':\n case 'datafield':\n case 'orderby':\n this.setDataItems(this.state.props.dataset);\n break;\n case 'groupby':\n case 'match':\n this.setGroupData(this.state.dataItems);\n case 'datavalue':\n this.setDataItems(this.state.props.dataset, { dataValue: $new });\n const isDefault = this.state.isDefault;\n if (isDefault) {\n this.updateState({ isDefault: false } as S, this.props.onFieldChange && this.props.onFieldChange.bind(this, 'datavalue', $new, $old, isDefault));\n } else {\n this.props.onFieldChange && this.props.onFieldChange('datavalue', $new, $old, isDefault);\n }\n }\n }\n\n setGroupData(items: any) {\n const dataItems = items;\n const props = this.state.props;\n if (props.groupby) {\n const groupedData = dataItems && getGroupedData(dataItems, props.groupby, props.match, props.orderby, props.dateformat, this, 'dataObject');\n this.updateState({ groupedData: groupedData } as S, () => this.onDataItemsUpdate());\n }\n }\n\n validate(value: any) {\n const validationObj = validateField(this.state.props, value);\n this.setState({\n isValid: validationObj.isValid,\n errorType: validationObj.errorType\n } as S);\n }\n\n updateDatavalue(value: any) {\n return new Promise<void>((resolve) => {\n this.updateState({\n props: { datavalue: value }\n } as S,\n () => {\n this.computeDisplayValue();\n resolve();\n });\n });\n }\n\n onValueChange(value: any) {\n if (this.state.props.datafield === 'All Fields') {\n const selectedItem = find(this.state.dataItems, (item) => isEqual(item.key, value));\n value = selectedItem && selectedItem.dataObject;\n }\n this.onChange(value);\n }\n\n getItemKey(value: any) {\n const selectedItem = find(this.state.dataItems, (item) => isEqual(item.dataObject, value));\n return selectedItem && selectedItem.key;\n }\n\n onChange(value: any) {\n const oldValue = this.state.props.datavalue;\n this.validate(value);\n this.updateDatavalue(value)\n .then(() => {\n if (value !== oldValue) {\n if (this.props.onFieldChange) {\n this.props.onFieldChange('datavalue', value, oldValue);\n } else {\n this.invokeEventCallback('onChange', [\n undefined,\n this.proxy,\n value,\n oldValue,\n ]);\n }\n }\n });\n }\n\n computeDisplayValue() {\n this.updateState({\n props: {\n displayValue: ((this.state.dataItems || [] as any)\n .filter((item: any) => item.selected)\n .map((item: any) => item.displayexp || item.displayfield))[0] || ''\n }\n } as S);\n }\n\n onDataItemsUpdate() {\n this.computeDisplayValue();\n }\n\n getUniqObjsByDataField(\n data: any,\n allowEmptyFields: boolean = true\n ) {\n let uniqData;\n const isAllFields = this.state.props.datafield === 'All Fields';\n\n uniqData = isAllFields ? uniqWith(data, isEqual) : uniqBy(data, 'datafield');\n\n if (!this.state.props.displayfield || allowEmptyFields) {\n return uniqData;\n }\n\n // return objects having non empty datafield and display field values.\n return filter(uniqData, (obj) => {\n if (isAllFields) {\n return trim(obj.displayfield);\n }\n return trim(obj.datafield) && trim(obj.displayfield);\n });\n }\n\n setDataItems(dataset: any, propsObj?: { [key: string]: any }, allowEmpty: boolean = true) {\n const name = this.props.name;\n const props = this.state.props;\n const datavalue = propsObj ? propsObj['dataValue'] : props.datavalue;\n let dataItems: any = [];\n let datavalueItems: any = [];\n if (typeof datavalue === 'string') {\n datavalueItems = datavalue.split(',');\n datavalueItems = allowEmpty ? datavalueItems : datavalueItems.map((item: any) => item.trim());\n } else if (isArray(datavalue)) {\n datavalueItems = datavalue;\n } else {\n if (isDefined(datavalue)) {\n datavalueItems = [datavalue];\n }\n }\n if (typeof dataset === 'string') {\n dataset = dataset.split(',');\n }\n if (isArray(dataset) && !isObject(dataset[0])) {\n dataItems = dataset.map((s, i) => {\n s = isString(s) ? s.trim() : s;\n return {\n key: `${name}_item${i}`,\n dataObject: s,\n displayfield: s.toString(),\n datafield: s,\n selected: includes(datavalueItems, s) || includes(datavalueItems, s.toString()) || datavalue === s ? true : false,\n };\n });\n } else if (dataset) {\n if (isObject(dataset) && !isArray(dataset)) {\n forEach(dataset, (value, key) => {\n if (isDefined(key) && key !== null) {\n dataItems.push({key: `${name}_item${key}`, displayfield: value, datafield: key, dataObject: dataset});\n }\n });\n } else {\n const isSelected = (item: any) => {\n if (datavalueItems.length) {\n let datafield = this.state.props.datafield;\n if (!datafield) {\n datafield = 'All Fields';\n }\n if (datafield === 'All Fields') {\n return includes(datavalueItems, item);\n }\n let df = get(item, datafield);\n if (isDefined(df) && df !== null) {\n return (includes(datavalueItems, df) || includes(datavalueItems, df.toString()));\n }\n }\n return false;\n };\n forEach(dataset as any[], (d, i) => {\n let datafieldValue = this.state.props.datafield === 'All Fields' ? d : get(d, this.state.props.datafield);\n if (isDefined(datafieldValue) && datafieldValue !== null) {\n dataItems.push({\n key: `${name}_item${i}`,\n dataObject: d,\n displayfield: (get(d, this.state.props.displayfield))?.toString() || (get(d, this.state.props.displaylabel))?.toString(),\n datafield: datafieldValue,\n displayexp: this.state.props.getDisplayExpression ? this.state.props.getDisplayExpression(d) : get(d, this.state.props.displayfield),\n selected: isSelected(d),\n imgSrc: isFunction(this.state.props.displayimagesrc) ? this.state.props.displayimagesrc(d) : get(d, this.state.props.displayimagesrc),\n icon: d[this.props.iconclass]\n });\n }\n });\n }\n }\n if (dataItems.length) {\n dataItems = this.getUniqObjsByDataField(dataItems, allowEmpty);\n }\n const isUpdated = !isEqual(dataItems, this.state.dataItems);\n if (props.groupby) {\n this.setGroupData(dataItems);\n this.updateState({ dataItems: dataItems } as S, () => isUpdated && this.onDataItemsUpdate());\n } else if (props.orderby) {\n this.updateState({ dataItems: getOrderedDataset(dataItems, props.orderby, 'dataObject')} as S, () => isUpdated && this.onDataItemsUpdate());\n } else {\n this.updateState({ dataItems: dataItems } as S, () => isUpdated && this.onDataItemsUpdate());\n }\n }\n}\n"],"mappings":";;;AAAA,SAASA,aAAa,EAAEC,kB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H,SAAS,EAAErB,iBAAiB,CAACqB,SAAS,EAAEZ,KAAK,CAACsB,OAAO,EAAE,YAAY;MAAC,CAAC,EAAO,MAAM2D,SAAS,IAAI,IAAI,CAACzD,iBAAiB,CAAC,CAAC,CAAC;IAC7I,CAAC,MAAM;MACL,IAAI,CAACT,WAAW,CAAC;QAAEH,SAAS,EAAEA;MAAU,CAAC,EAAO,MAAMqE,SAAS,IAAI,IAAI,CAACzD,iBAAiB,CAAC,CAAC,CAAC;IAC9F;EACF;AACF","ignoreList":[]}
@@ -96,11 +96,18 @@ export class BaseInputComponent extends BaseComponent {
96
96
  if (props.autotrim && props.datavalue && isString(props.datavalue)) {
97
97
  value = value.trim();
98
98
  }
99
- this.updateState({
100
- props: {
101
- datavalue: value
99
+ new Promise(resolve => {
100
+ if (props.hastwowaybinding) {
101
+ this.setProp("datavalue", value);
102
+ resolve(true);
103
+ } else {
104
+ this.updateState({
105
+ props: {
106
+ datavalue: value
107
+ }
108
+ }, () => resolve(true));
102
109
  }
103
- }, () => {
110
+ }).then(() => {
104
111
  !this.props.onFieldChange && value !== oldValue && this.invokeEventCallback('onChange', [event, this.proxy, value, oldValue]);
105
112
  if (source === 'blur') {
106
113
  this.invokeEventCallback('onBlur', [event, this.proxy]);
@@ -1 +1 @@
1
- {"version":3,"names":["DEFAULT_CLASS","BaseComponent","BaseComponentState","isString","Platform","validateField","Injector","BaseInputState","constructor","args","_defineProperty","BaseInputComponent","props","defaultClass","defaultProps","defaultState","focus","_this$widgetRef","widgetRef","blur","_this$widgetRef2","_this$widgetRef3","onPropertyChange","name","$new","$old","keyboardType","type","updateState","textValue","isDefault","state","onFieldChange","bind","onChange","event","updateon","updateDatavalue","target","value","onChangeText","validate","invokeChange","e","OS","cursor","selectionStart","setState","source","oldValue","datavalue","autotrim","trim","invokeEventCallback","proxy","onBlur","FOCUSED_ELEMENT","remove","isTouched","newVal","oldVal","undefined","setTimeout","triggerValidation","validationObj","isValid","errorType","onFocus","_this$closestTappable","set","closestTappable","triggerTap","onKeyPress"],"sources":["baseinput.component.ts"],"sourcesContent":["import { DEFAULT_CLASS } from '@wavemaker/app-rn-runtime/components/navigation/basenav/basenav.styles';\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\nimport BaseInputProps from './baseinput.props';\nimport { isString } from 'lodash';\nimport { BaseInputStyles } from './baseinput.styles';\nimport { Platform, TextInput } from 'react-native';\nimport { validateField } from '@wavemaker/app-rn-runtime/core/utils';\nimport Injector from '@wavemaker/app-rn-runtime/core/injector';\n\nexport class BaseInputState <T extends BaseInputProps> extends BaseComponentState<T> {\n keyboardType: any = 'default';\n isValid: boolean = true;\n textValue: string = '';\n isDefault = false;\n errorType: string = '';\n}\nexport abstract class BaseInputComponent< T extends BaseInputProps, S extends BaseInputState<T>, L extends BaseInputStyles> extends BaseComponent<T, S, L> {\n public widgetRef: TextInput | null = null;\n isTouched: boolean = false;\n private cursor: any = 0;\n constructor(props: T, public defaultClass: string = DEFAULT_CLASS, defaultProps?: T, defaultState?: S) {\n super(props, defaultClass, defaultProps, defaultState);\n }\n\n focus() {\n this?.widgetRef?.focus();\n }\n\n blur() {\n this?.widgetRef?.blur && this?.widgetRef?.blur();\n }\n\n onPropertyChange(name: string, $new: any, $old: any) {\n switch (name) {\n case 'type':\n let keyboardType;\n if (this.props.type === 'number') {\n keyboardType = 'numeric';\n } else if (this.props.type === 'tel') {\n keyboardType = 'phone-pad';\n } else if (this.props.type === 'email') {\n keyboardType = 'email-address';\n }\n this.updateState({\n keyboardType: keyboardType,\n } as S);\n break;\n case 'datavalue':\n this.updateState({\n textValue: $new\n } as S\n );\n const isDefault = this.state.isDefault;\n if (isDefault) {\n this.updateState({ isDefault: false } as S, this.props.onFieldChange && this.props.onFieldChange.bind(this, 'datavalue', $new, $old, isDefault));\n } else {\n this.props.onFieldChange && this.props.onFieldChange('datavalue', $new, $old, isDefault);\n }\n }\n }\n\n onChange(event: any) {\n if (this.state.props.updateon === 'default') {\n this.updateDatavalue(event.target.value, event);\n }\n }\n\n onChangeText(value: any) {\n this.updateState({\n textValue: value\n } as S, () => {\n if (this.state.props.updateon === 'default') {\n this.validate(value);\n this.updateDatavalue(value, null);\n }\n }\n );\n }\n\n invokeChange(e: any) {\n if (Platform.OS === 'web') {\n this.cursor = e.target.selectionStart;\n this.setState({ textValue: e.target.value });\n }\n }\n\n updateDatavalue(value: any, event?: any, source?: any) {\n const props = this.state.props;\n const oldValue = props.datavalue;\n if (value === oldValue) {\n return;\n }\n\n // autotrim\n if (props.autotrim && props.datavalue && isString(props.datavalue)) {\n value = value.trim();\n }\n\n this.updateState({\n props: {\n datavalue: value\n }\n } as S, () => {\n !this.props.onFieldChange && value !== oldValue && this.invokeEventCallback('onChange', [event, this.proxy, value, oldValue]);\n if (source === 'blur') {\n this.invokeEventCallback('onBlur', [ event, this.proxy]);\n }\n })\n\n }\n\n onBlur(event: any) {\n Injector.FOCUSED_ELEMENT.remove();\n this.isTouched = true;\n let newVal = this.state.textValue;\n let oldVal = this.state.props.datavalue || '';\n this.validate(newVal);\n if (newVal === '' || newVal == undefined) {\n setTimeout(() => {\n this.props.triggerValidation && this.props.triggerValidation();\n },10)\n }\n if (this.state.props.updateon === 'blur') {\n if (oldVal !== newVal) {\n this.updateDatavalue(newVal, event, 'blur');\n } else {\n this.invokeEventCallback('onBlur', [event, this.proxy]);\n }\n }\n }\n\n validate(value: any) {\n const validationObj = validateField(this.state.props, value);\n this.setState({\n isValid: validationObj.isValid,\n errorType: validationObj.errorType\n } as S);\n }\n\n onFocus(event: any) {\n // When input widgets are inside list widget and try to focus the field, list is selecting but unable to enter values in input fields\n // because on tap event of list is triggering after 200ms timeout So added 250ms timeout here\n setTimeout(() => {\n Injector.FOCUSED_ELEMENT.set(this);\n this.invokeEventCallback('onFocus', [ event, this.proxy]);\n this.closestTappable?.triggerTap();\n }, 250);\n\n }\n\n onKeyPress(event: any) {\n this.invokeEventCallback('onKeypress', [ event, this.proxy]);\n }\n}\n"],"mappings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AAO,EAAED,aAAa,CAACC,OAAO;MAC9BC,SAAS,EAAEF,aAAa,CAACE;IAC3B,CAAM,CAAC;EACT;EAEAC,OAAOA,CAAChC,KAAU,EAAE;IAClB;IACA;IACA2B,UAAU,CAAC,MAAM;MAAA,IAAAM,qBAAA;MACf9D,QAAQ,CAACkD,eAAe,CAACa,GAAG,CAAC,IAAI,CAAC;MAClC,IAAI,CAAChB,mBAAmB,CAAC,SAAS,EAAE,CAAElB,KAAK,EAAE,IAAI,CAACmB,KAAK,CAAC,CAAC;MACzD,CAAAc,qBAAA,OAAI,CAACE,eAAe,cAAAF,qBAAA,eAApBA,qBAAA,CAAsBG,UAAU,CAAC,CAAC;IACpC,CAAC,EAAE,GAAG,CAAC;EAET;EAEAC,UAAUA,CAACrC,KAAU,EAAE;IACrB,IAAI,CAACkB,mBAAmB,CAAC,YAAY,EAAE,CAAElB,KAAK,EAAE,IAAI,CAACmB,KAAK,CAAC,CAAC;EAC9D;AACF","ignoreList":[]}
1
+ {"version":3,"names":["DEFAULT_CLASS","BaseComponent","BaseComponentState","isString","Platform","validateField","Injector","BaseInputState","constructor","args","_defineProperty","BaseInputComponent","props","defaultClass","defaultProps","defaultState","focus","_this$widgetRef","widgetRef","blur","_this$widgetRef2","_this$widgetRef3","onPropertyChange","name","$new","$old","keyboardType","type","updateState","textValue","isDefault","state","onFieldChange","bind","onChange","event","updateon","updateDatavalue","target","value","onChangeText","validate","invokeChange","e","OS","cursor","selectionStart","setState","source","oldValue","datavalue","autotrim","trim","Promise","resolve","hastwowaybinding","setProp","then","invokeEventCallback","proxy","onBlur","FOCUSED_ELEMENT","remove","isTouched","newVal","oldVal","undefined","setTimeout","triggerValidation","validationObj","isValid","errorType","onFocus","_this$closestTappable","set","closestTappable","triggerTap","onKeyPress"],"sources":["baseinput.component.ts"],"sourcesContent":["import { DEFAULT_CLASS } from '@wavemaker/app-rn-runtime/components/navigation/basenav/basenav.styles';\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\nimport BaseInputProps from './baseinput.props';\nimport { isString } from 'lodash';\nimport { BaseInputStyles } from './baseinput.styles';\nimport { Platform, TextInput } from 'react-native';\nimport { validateField } from '@wavemaker/app-rn-runtime/core/utils';\nimport Injector from '@wavemaker/app-rn-runtime/core/injector';\n\nexport class BaseInputState <T extends BaseInputProps> extends BaseComponentState<T> {\n keyboardType: any = 'default';\n isValid: boolean = true;\n textValue: string = '';\n isDefault = false;\n errorType: string = '';\n}\nexport abstract class BaseInputComponent< T extends BaseInputProps, S extends BaseInputState<T>, L extends BaseInputStyles> extends BaseComponent<T, S, L> {\n public widgetRef: TextInput | null = null;\n isTouched: boolean = false;\n private cursor: any = 0;\n constructor(props: T, public defaultClass: string = DEFAULT_CLASS, defaultProps?: T, defaultState?: S) {\n super(props, defaultClass, defaultProps, defaultState);\n }\n\n focus() {\n this?.widgetRef?.focus();\n }\n\n blur() {\n this?.widgetRef?.blur && this?.widgetRef?.blur();\n }\n\n onPropertyChange(name: string, $new: any, $old: any) {\n switch (name) {\n case 'type':\n let keyboardType;\n if (this.props.type === 'number') {\n keyboardType = 'numeric';\n } else if (this.props.type === 'tel') {\n keyboardType = 'phone-pad';\n } else if (this.props.type === 'email') {\n keyboardType = 'email-address';\n }\n this.updateState({\n keyboardType: keyboardType,\n } as S);\n break;\n case 'datavalue':\n this.updateState({\n textValue: $new\n } as S\n );\n const isDefault = this.state.isDefault;\n if (isDefault) {\n this.updateState({ isDefault: false } as S, this.props.onFieldChange && this.props.onFieldChange.bind(this, 'datavalue', $new, $old, isDefault));\n } else {\n this.props.onFieldChange && this.props.onFieldChange('datavalue', $new, $old, isDefault);\n }\n }\n }\n\n onChange(event: any) {\n if (this.state.props.updateon === 'default') {\n this.updateDatavalue(event.target.value, event);\n }\n }\n\n onChangeText(value: any) {\n this.updateState({\n textValue: value\n } as S, () => {\n if (this.state.props.updateon === 'default') {\n this.validate(value);\n this.updateDatavalue(value, null);\n }\n }\n );\n }\n\n invokeChange(e: any) {\n if (Platform.OS === 'web') {\n this.cursor = e.target.selectionStart;\n this.setState({ textValue: e.target.value });\n }\n }\n\n updateDatavalue(value: any, event?: any, source?: any) {\n const props = this.state.props;\n const oldValue = props.datavalue;\n if (value === oldValue) {\n return;\n }\n\n // autotrim\n if (props.autotrim && props.datavalue && isString(props.datavalue)) {\n value = value.trim();\n }\n new Promise((resolve) => {\n if (props.hastwowaybinding) {\n this.setProp(\"datavalue\", value);\n resolve(true);\n } else {\n this.updateState({\n props: {\n datavalue: value\n }\n } as S, () => resolve(true));\n }\n }).then(() => {\n !this.props.onFieldChange && value !== oldValue && this.invokeEventCallback('onChange', [event, this.proxy, value, oldValue]);\n if (source === 'blur') {\n this.invokeEventCallback('onBlur', [ event, this.proxy]);\n }\n })\n }\n\n onBlur(event: any) {\n Injector.FOCUSED_ELEMENT.remove();\n this.isTouched = true;\n let newVal = this.state.textValue;\n let oldVal = this.state.props.datavalue || '';\n this.validate(newVal);\n if (newVal === '' || newVal == undefined) {\n setTimeout(() => {\n this.props.triggerValidation && this.props.triggerValidation();\n },10)\n }\n if (this.state.props.updateon === 'blur') {\n if (oldVal !== newVal) {\n this.updateDatavalue(newVal, event, 'blur');\n } else {\n this.invokeEventCallback('onBlur', [event, this.proxy]);\n }\n }\n }\n\n validate(value: any) {\n const validationObj = validateField(this.state.props, value);\n this.setState({\n isValid: validationObj.isValid,\n errorType: validationObj.errorType\n } as S);\n }\n\n onFocus(event: any) {\n // When input widgets are inside list widget and try to focus the field, list is selecting but unable to enter values in input fields\n // because on tap event of list is triggering after 200ms timeout So added 250ms timeout here\n setTimeout(() => {\n Injector.FOCUSED_ELEMENT.set(this);\n this.invokeEventCallback('onFocus', [ event, this.proxy]);\n this.closestTappable?.triggerTap();\n }, 250);\n\n }\n\n onKeyPress(event: any) {\n this.invokeEventCallback('onKeypress', [ event, this.proxy]);\n }\n}\n"],"mappings":";;;AAAA,SAASA,aAAa,QAAQ,wEAAwE;AACtG,SAASC,aAAa,EAAEC,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,KAAK,CAAC,CAAC;MACzD;IACF;EACF;EAEAlB,QAAQA,CAACF,KAAU,EAAE;IACnB,MAAM8B,aAAa,GAAGhE,aAAa,CAAC,IAAI,CAAC0B,KAAK,CAACnB,KAAK,EAAE2B,KAAK,CAAC;IAC5D,IAAI,CAACQ,QAAQ,CAAC;MACZuB,OAAO,EAAED,aAAa,CAACC,OAAO;MAC9BC,SAAS,EAAEF,aAAa,CAACE;IAC3B,CAAM,CAAC;EACT;EAEAC,OAAOA,CAACrC,KAAU,EAAE;IAClB;IACA;IACAgC,UAAU,CAAC,MAAM;MAAA,IAAAM,qBAAA;MACfnE,QAAQ,CAACuD,eAAe,CAACa,GAAG,CAAC,IAAI,CAAC;MAClC,IAAI,CAAChB,mBAAmB,CAAC,SAAS,EAAE,CAAEvB,KAAK,EAAE,IAAI,CAACwB,KAAK,CAAC,CAAC;MACzD,CAAAc,qBAAA,OAAI,CAACE,eAAe,cAAAF,qBAAA,eAApBA,qBAAA,CAAsBG,UAAU,CAAC,CAAC;IACpC,CAAC,EAAE,GAAG,CAAC;EAET;EAEAC,UAAUA,CAAC1C,KAAU,EAAE;IACrB,IAAI,CAACuB,mBAAmB,CAAC,YAAY,EAAE,CAAEvB,KAAK,EAAE,IAAI,CAACwB,KAAK,CAAC,CAAC;EAC9D;AACF","ignoreList":[]}
@@ -9,6 +9,7 @@ export default class BaseInputProps extends BaseProps {
9
9
  _defineProperty(this, "autocomplete", true);
10
10
  _defineProperty(this, "autotrim", true);
11
11
  _defineProperty(this, "datavalue", void 0);
12
+ _defineProperty(this, "hastwowaybinding", false);
12
13
  _defineProperty(this, "maxchars", null);
13
14
  _defineProperty(this, "readonly", null);
14
15
  _defineProperty(this, "regexp", null);
@@ -1 +1 @@
1
- {"version":3,"names":["BaseProps","BaseInputProps","constructor","args","_defineProperty","undefined"],"sources":["baseinput.props.ts"],"sourcesContent":["import {AccessibilityRole} from \"react-native\";\nimport { BaseProps } from '@wavemaker/app-rn-runtime/core/base.component';\n\nexport default class BaseInputProps extends BaseProps {\n autofocus: boolean = null as any;\n autocomplete: boolean = true;\n autotrim: boolean = true;\n datavalue: any;\n maxchars: number = null as any;\n readonly: boolean = null as any;\n regexp: string = null as any;\n type: string = 'text';\n updateon: string = 'blur' as any;\n required?: boolean = false as any;\n checkFormField?: any;\n onFieldChange?: any;\n triggerValidation?: any;\n accessibilitylabel?: string = undefined;\n hint?: string = undefined;\n accessibilityrole?: AccessibilityRole;\n accessibilitylabelledby?: string = undefined;\n maskchar: string = null as any;\n displayformat: string = null as any;\n}\n"],"mappings":";;;AACA,SAASA,SAAS,QAAQ,+CAA+C;AAEzE,eAAe,MAAMC,cAAc,SAASD,SAAS,CAAC;EAAAE,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAC,eAAA,oBAC/B,IAAI;IAAAA,eAAA,uBACD,IAAI;IAAAA,eAAA,mBACR,IAAI;IAAAA,eAAA;IAAAA,eAAA,mBAEL,IAAI;IAAAA,eAAA,mBACH,IAAI;IAAAA,eAAA,iBACP,IAAI;IAAAA,eAAA,eACN,MAAM;IAAAA,eAAA,mBACF,MAAM;IAAAA,eAAA,mBACJ,KAAK;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA,6BAIIC,SAAS;IAAAD,eAAA,eACvBC,SAAS;IAAAD,eAAA;IAAAA,eAAA,kCAEUC,SAAS;IAAAD,eAAA,mBACzB,IAAI;IAAAA,eAAA,wBACC,IAAI;EAAA;AAC9B","ignoreList":[]}
1
+ {"version":3,"names":["BaseProps","BaseInputProps","constructor","args","_defineProperty","undefined"],"sources":["baseinput.props.ts"],"sourcesContent":["import {AccessibilityRole} from \"react-native\";\nimport { BaseProps } from '@wavemaker/app-rn-runtime/core/base.component';\n\nexport default class BaseInputProps extends BaseProps {\n autofocus: boolean = null as any;\n autocomplete: boolean = true;\n autotrim: boolean = true;\n datavalue: any;\n hastwowaybinding = false;\n maxchars: number = null as any;\n readonly: boolean = null as any;\n regexp: string = null as any;\n type: string = 'text';\n updateon: string = 'blur' as any;\n required?: boolean = false as any;\n checkFormField?: any;\n onFieldChange?: any;\n triggerValidation?: any;\n accessibilitylabel?: string = undefined;\n hint?: string = undefined;\n accessibilityrole?: AccessibilityRole;\n accessibilitylabelledby?: string = undefined;\n maskchar: string = null as any;\n displayformat: string = null as any;\n}\n"],"mappings":";;;AACA,SAASA,SAAS,QAAQ,+CAA+C;AAEzE,eAAe,MAAMC,cAAc,SAASD,SAAS,CAAC;EAAAE,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAC,eAAA,oBAC/B,IAAI;IAAAA,eAAA,uBACD,IAAI;IAAAA,eAAA,mBACR,IAAI;IAAAA,eAAA;IAAAA,eAAA,2BAEL,KAAK;IAAAA,eAAA,mBACL,IAAI;IAAAA,eAAA,mBACH,IAAI;IAAAA,eAAA,iBACP,IAAI;IAAAA,eAAA,eACN,MAAM;IAAAA,eAAA,mBACF,MAAM;IAAAA,eAAA,mBACJ,KAAK;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA,6BAIIC,SAAS;IAAAD,eAAA,eACvBC,SAAS;IAAAD,eAAA;IAAAA,eAAA,kCAEUC,SAAS;IAAAD,eAAA,mBACzB,IAAI;IAAAA,eAAA,wBACC,IAAI;EAAA;AAC9B","ignoreList":[]}
@@ -66,21 +66,22 @@ export class BaseNumberComponent extends BaseComponent {
66
66
  }
67
67
  return isValidText;
68
68
  }
69
- onChangeText(value, type) {
70
- const isValidTextOnDevice = this.validateOnDevice(value, type);
69
+ onChangeText(value, type, shouldFormateToNumber) {
70
+ const newValue = shouldFormateToNumber ? `${this.parseNumber(value.replace(/[^0-9.]/g, ''))}` : value;
71
+ const isValidTextOnDevice = this.validateOnDevice(newValue, type);
71
72
  if (!isValidTextOnDevice) {
72
73
  return;
73
74
  }
74
- const decimalPlacesInNumber = countDecimalDigits(value);
75
+ const decimalPlacesInNumber = countDecimalDigits(newValue);
75
76
  if (this.props.decimalPlaces < decimalPlacesInNumber) {
76
77
  return;
77
78
  }
78
79
  this.updateState({
79
- textValue: value
80
+ textValue: newValue
80
81
  }, () => {
81
82
  if (this.state.props.updateon === 'default') {
82
- this.validate(value);
83
- this.updateDatavalue(value, null);
83
+ this.validate(newValue);
84
+ this.updateDatavalue(newValue, null);
84
85
  }
85
86
  });
86
87
  }
@@ -155,19 +156,26 @@ export class BaseNumberComponent extends BaseComponent {
155
156
  this.invokeEventCallback('onError', [event, this.proxy, value, oldValue]);
156
157
  return;
157
158
  }
158
- this.updateState({
159
- props: {
160
- datavalue: model || Number(value)
159
+ new Promise(resolve => {
160
+ if (props.hastwowaybinding) {
161
+ this.setProp("datavalue", value);
162
+ resolve(true);
163
+ } else {
164
+ this.updateState({
165
+ props: {
166
+ datavalue: model || Number(value)
167
+ }
168
+ }, () => resolve(true));
161
169
  }
162
- }, () => {
170
+ }).then(() => {
163
171
  !this.props.onFieldChange && value !== oldValue && this.invokeEventCallback('onChange', [event, this.proxy, model, oldValue]);
164
172
  if (source === 'blur') {
165
173
  this.invokeEventCallback('onBlur', [event, this.proxy]);
166
174
  }
167
175
  });
168
176
  }
169
- onBlur(event) {
170
- let newVal = event.target.value || this.state.textValue;
177
+ onBlur(event, isDisplayValuePresent) {
178
+ let newVal = isDisplayValuePresent ? this.state.textValue : event.target.value || this.state.textValue;
171
179
  this.validate(newVal);
172
180
  if (newVal === '' || newVal == undefined) {
173
181
  setTimeout(() => {
@@ -308,6 +316,11 @@ export class BaseNumberComponent extends BaseComponent {
308
316
  } else {
309
317
  this.props.onFieldChange && this.props.onFieldChange('datavalue', $new, $old, isDefault);
310
318
  }
319
+ break;
320
+ case 'displayValue':
321
+ this.updateState({
322
+ displayValue: $new
323
+ });
311
324
  }
312
325
  }
313
326
  }