@wavemaker/app-rn-runtime 12.0.0-next.45032 → 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","Keyboard","Platform","Text","TextInput","View","ScrollView","find","isNull","WmSearchProps","DEFAULT_CLASS","ModalConsumer","DataProvider","AccessibilityWidgetType","getAccessibilityProps","BaseDatasetComponent","BaseDatasetState","WmAnchor","WmPicture","Tappable","WmButton","get","isArray","isEmpty","isObject","AssetProvider","WmSearchState","constructor","args","_defineProperty","top","left","WmSearch","props","Promise","resolve","position","view","measure","x","y","width","height","px","py","updateState","computePosition","then","isOpened","dataProvider","datavalue","query","clearSearch","invokeEventCallback","hide","dataItems","state","map","item","selected","type","updateFilteredData","queryText","_filteredData","filterOptions","entries","filteredData","minchars","length","_this$dataProvider","searchkey","updateRequired","undefined","init","invokeVariable","response","dataSet","setDataItems","filter","result","dataObject","data","isFocused","showPopover","focus","_this$widgetRef","widgetRef","onChange","value","isDefaultQuery","prevQuery","searchon","validate","setTimeout","invokeEvent","proxy","invokeChange","e","OS","cursor","target","selectionStart","onFocus","disabled","_this$state$props$que","onBlur","triggerValidation","prepareModalOptions","content","styles","modalService","o","modalOptions","modalContentSTyles","searchInputWidth","modalContent","borderWidth","modalStyle","modal","contentStyle","isModal","onClose","dismiss","setState","hideModal","searchIconPress","onItemSelect","displayexp","displayfield","datafield","updateDatavalue","prevDatavalue","queryModel","renderSearchBar","_this$state$dataItems","opts","valueExpr","createElement","style","root","ref","onLayout","searchInputWrapper","_extends","text","isValid","invalid","focusedText","selectionEnd","getTestPropsForInput","SEARCH","placeholderTextColor","placeholderText","color","placeholder","autoFocus","autofocus","editable","readonly","onChangeText","bind","nativeEvent","layout","showclear","onTap","id","getTestId","clearButton","iconclass","showSearchIcon","searchButton","reset","renderSearchItem","index","imageStyles","imagewidth","getTestProps","searchItem","template","renderitempartial","Fragment","name","picturesource","imgSrc","getTestPropsForLabel","searchItemText","updateDefaultQueryModel","selectedItem","onDataItemsUpdate","componentDidMount","onPropertyChange","$new","$old","dataset","setTemplate","partialName","renderWidget","showModal","maxHeight","contentContainerStyle","dropDownContent","loadAsset","key","limit","caption","datacompletemsg","dataCompleteItem"],"sources":["search.component.tsx"],"sourcesContent":["import React from 'react';\nimport { Keyboard, Platform, Text, TextInput, View } from 'react-native';\nimport { ScrollView } from 'react-native-gesture-handler';\nimport { find, isNull } from 'lodash';\n\nimport WmSearchProps from './search.props';\nimport { DEFAULT_CLASS, WmSearchStyles } from './search.styles';\nimport { ModalConsumer, ModalOptions, ModalService} from \"@wavemaker/app-rn-runtime/core/modal.service\";\nimport { DataProvider } from '@wavemaker/app-rn-runtime/components/basic/search/local-data-provider';\nimport { AccessibilityWidgetType, getAccessibilityProps } from '@wavemaker/app-rn-runtime/core/accessibility'; \n\nimport {\n BaseDatasetComponent,\n BaseDatasetState\n} from '@wavemaker/app-rn-runtime/components/input/basedataset/basedataset.component';\nimport WmAnchor from '@wavemaker/app-rn-runtime/components/basic/anchor/anchor.component';\nimport WmPicture from '@wavemaker/app-rn-runtime/components/basic/picture/picture.component';\nimport { Tappable } from '@wavemaker/app-rn-runtime/core/tappable.component';\nimport WmButton from '@wavemaker/app-rn-runtime/components/basic/button/button.component';\nimport { get, isArray, isEmpty, isObject } from \"lodash-es\";\nimport { AssetProvider } from '@wavemaker/app-rn-runtime/core/asset.provider';\n\nexport class WmSearchState extends BaseDatasetState<WmSearchProps> {\n isOpened: boolean = false;\n modalOptions = {} as ModalOptions;\n template: string = \"\";\n position = {\n top: 0,\n left: 0\n } as DropdownPosition;\n data: any = [];\n}\n\nexport interface DropdownPosition {\n top?: number;\n bottom?: number;\n left?: number;\n right?: number;\n}\n\nexport default class WmSearch extends BaseDatasetComponent<WmSearchProps, WmSearchState, WmSearchStyles> {\n view: View = null as any;\n private prevDatavalue: any;\n private queryModel: any;\n private searchInputWidth: any;\n private isDefaultQuery: boolean = true;\n private dataProvider: DataProvider;\n public widgetRef: TextInput | null = null;\n private cursor: any = 0;\n private isFocused: boolean = false;\n private updateRequired: any;\n\n constructor(props: WmSearchProps) {\n super(props, DEFAULT_CLASS, new WmSearchProps(), new WmSearchState());\n this.dataProvider = new DataProvider();\n if (this.props.datavalue) {\n this.updateState({\n props: {\n query: this.props.datavalue\n }\n } as WmSearchState);\n }\n }\n\n computePosition = () => {\n return new Promise<void>((resolve) => {\n const position = {} as DropdownPosition;\n this.view.measure((x = 0, y = 0, width = 0, height = 0, px = 0, py = 0) => {\n position.left = px;\n position.top = py + height;\n this.updateState({ position: position } as WmSearchState, resolve);\n });\n });\n }\n\n clearSearch() {\n this.invokeEventCallback('onClear', [null, this]);\n this.hide();\n this.updateState({\n props: {\n query: ''\n },\n dataItems: this.state.dataItems ? this.state.dataItems.map((item: any) => {\n item.selected = false;\n return item;\n }) : []\n } as WmSearchState, () => {\n if (this.state.props.type === 'autocomplete') {\n this.updateFilteredData('');\n }\n });\n }\n\n updateFilteredData(queryText: string = '') {\n const props = this.state.props;\n const filterOptions = {\n query: queryText,\n props: props,\n entries: this.state.dataItems\n };\n let filteredData: Array<any> = [];\n if (props.minchars && queryText.length < props.minchars) {\n filteredData = [];\n } else if (props.type === 'search' && !queryText) {\n filteredData = [];\n } else {\n if (this.props.searchkey && this.updateRequired === undefined) {\n this.updateRequired = this.dataProvider.init(this);\n }\n // for service variables invoke the variable with params.\n if (this.props.searchkey && this.updateRequired && this.state.props.query !== queryText) {\n this.dataProvider.invokeVariable(this, queryText).then((response: any) => {\n if (response) {\n response = response.dataSet;\n if (isEmpty(response)) {\n filteredData = [];\n } else {\n if (isObject(response) && !isArray(response)) {\n response = [response];\n }\n this.setDataItems(response);\n }\n }\n }, () => {});\n return;\n }\n filteredData = this.dataProvider?.filter(filterOptions);\n }\n this.updateState({\n props: { result: filteredData?.map( (item: any) => item.dataObject), query: queryText },\n data: filteredData,\n } as WmSearchState);\n if (!this.state.isOpened && this.isFocused) {\n this.showPopover && this.showPopover();\n }\n }\n\n focus() {\n this?.widgetRef?.focus();\n }\n\n onChange(value: any) {\n this.isDefaultQuery = false;\n const prevQuery = this.state.props.query;\n if (this.state.props.searchon === 'onsearchiconclick') {\n this.updateState({\n props: {result: [], query: value},\n data: []\n } as WmSearchState);\n } else {\n this.updateFilteredData(value);\n }\n if (value === '') {\n this.validate(value);\n this.updateState({\n props: {\n datavalue: '',\n },\n } as WmSearchState);\n if (value === prevQuery) {\n return;\n }\n }\n setTimeout(() => {\n if (this.props.invokeEvent) {\n this.props.invokeEvent('onChange', [undefined, this.proxy, value, prevQuery]);\n }\n this.invokeEventCallback('onChange', [ undefined, this.proxy, value, prevQuery ]);\n }, 300);\n }\n\n invokeChange(e: any) {\n if (Platform.OS === 'web') {\n this.cursor = e.target.selectionStart;\n this.updateState({ props: { query: e.target.value } } as WmSearchState);\n }\n }\n\n onFocus() {\n this.isFocused = true;\n if (!this.state.props.disabled && this.state.props.type === 'autocomplete') {\n this.cursor = this.state.props.query?.length || 0;\n this.updateFilteredData(this.state.props.query || '');\n }\n this.invokeEventCallback('onFocus', [null, this]);\n }\n\n onBlur() {\n this.isFocused = false;\n this.validate(this.state.props.datavalue);\n if (!this.state.props.datavalue) {\n setTimeout(() => {\n this.props.triggerValidation && this.props.triggerValidation();\n })\n }\n this.invokeEventCallback('onBlur', [null, this]);\n }\n\n public showPopover = () => {\n this.computePosition().then(() => {\n this.updateState({ isOpened: true } as WmSearchState);\n });\n };\n\n public hide = () => {};\n\n prepareModalOptions(content: React.ReactNode, styles: WmSearchStyles, modalService: ModalService) {\n const o = this.state.modalOptions;\n const modalContentSTyles = {\n width: this.searchInputWidth - 2 * (styles.modalContent.borderWidth || 0),\n left: (this.state.position.left || 0) + 2 * (styles.modalContent.borderWidth || 0) };\n o.modalStyle = {...styles.modal};\n o.contentStyle = {...styles.modalContent, ...this.state.position, ...modalContentSTyles};\n o.content = content;\n o.isModal = true;\n o.onClose = () => {\n this.hide = () => {};\n Keyboard.dismiss();\n if (this.state.isOpened) {\n this.setState({isOpened: false, modalOptions: {} as ModalOptions} as WmSearchState);\n }\n };\n this.hide = () => {\n modalService.hideModal(this.state.modalOptions);\n if (this.state.isOpened) {\n this.setState({ isOpened: false, modalOptions: {} as ModalOptions } as WmSearchState);\n }\n }\n return o;\n }\n\n searchIconPress() {\n this.isFocused = false;\n if (this.state.props.searchon === 'onsearchiconclick') {\n this.updateFilteredData(this.state.props.query);\n } else {\n this.onItemSelect(this.state.data[0]);\n }\n }\n\n onItemSelect(item: any) {\n this.isFocused = false;\n this.updateState({ props: {\n query: item.displayexp || item.displayfield\n }\n } as WmSearchState);\n this.validate(item.datafield);\n this.updateDatavalue(item.datafield);\n this.prevDatavalue = item.datafield;\n this.queryModel = item;\n if (get(this.props, 'formfield')) {\n // @ts-ignore\n this.props.invokeEvent('onSelect', [null, this, item.datafield]);\n // @ts-ignore\n this.props.invokeEvent('onSubmit', [null, this]);\n } else {\n this.invokeEventCallback('onSelect', [null, this, item.datafield]);\n this.invokeEventCallback('onSubmit', [null, this]);\n }\n this.hide();\n }\n\n renderSearchBar() {\n const props = this.state.props;\n let opts: any = {};\n const valueExpr = Platform.OS === 'web' ? 'value' : 'defaultValue';\n opts[valueExpr] = this.state.props.query || '';\n return(\n /*\n * onLayout function is required.\n * https://github.com/naoufal/react-native-accordion/pull/19/files\n */\n <View style={this.styles.root} ref={ref => {this.view = ref as View}} onLayout={() => {}}>\n <View style={this.styles.searchInputWrapper}>\n <TextInput style={[this.styles.text, this.state.isValid ? {} : this.styles.invalid, this.state.isOpened && this.state.dataItems?.length > 0? this.styles.focusedText : null]}\n ref={ref => {this.widgetRef = ref;\n // @ts-ignore\n if (ref && !isNull(ref.selectionStart) && !isNull(ref.selectionEnd)) {\n // @ts-ignore\n ref.selectionStart = ref.selectionEnd = this.cursor;\n }}}\n {...this.getTestPropsForInput()}\n {...getAccessibilityProps(AccessibilityWidgetType.SEARCH, props)}\n placeholderTextColor={this.styles.placeholderText.color as any}\n placeholder={props.placeholder || 'Search'}\n autoFocus={props.autofocus}\n editable={props.disabled || props.readonly ? false : true}\n onChangeText={this.onChange.bind(this)}\n onChange={this.invokeChange.bind(this)}\n onFocus={this.onFocus.bind(this)}\n onLayout={e => {this.searchInputWidth = e.nativeEvent.layout.width}}\n onBlur={this.onBlur.bind(this)}\n {...opts}>\n </TextInput>\n {props.showclear && this.state.props.query ? <WmButton onTap={this.clearSearch.bind(this)}\n id={this.getTestId('clear')}\n styles={this.styles.clearButton} iconclass={'wi wi-clear'}></WmButton> : null}\n </View>\n {props.showSearchIcon && props.type === 'search' ? <WmButton styles={this.styles.searchButton}\n id={this.getTestId('search')}\n iconclass={'wm-sl-l sl-search'} onTap={this.searchIconPress.bind(this)}></WmButton> : null}\n </View>\n );\n }\n\n reset() {\n if (this.state.props.query) {\n this.updateState({\n props: {\n query: ''\n }\n } as WmSearchState);\n }\n }\n\n renderSearchItem(item: any, index: number) {\n const props = this.state.props;\n const imageStyles = { root: {height:props.imagewidth, width:props.imagewidth}}\n return (\n <Tappable onTap={this.onItemSelect.bind(this, item)} {...this.getTestProps(`action${index}`)}>\n <View style={this.styles.searchItem}>\n {!isEmpty(this.state.template) && this.props.renderitempartial ?\n this.props.renderitempartial(item.dataObject, index, this.state.template) : (<>\n <WmPicture id={this.getTestId(`picture${index}`)} styles={imageStyles} name={props.name + '_image'} picturesource={item.imgSrc}></WmPicture>\n <Text {...this.getTestPropsForLabel(index + '')} style={this.styles.searchItemText}>{item.displayexp || item.displayfield}</Text>\n </>)}\n </View>\n </Tappable>\n );\n }\n\n updateDefaultQueryModel() {\n if (this.state.dataItems && this.state.dataItems.length && this.isDefaultQuery) {\n const selectedItem = find(this.state.dataItems, (item) => item.selected);\n this.updateState({ props: {\n query: selectedItem ? (selectedItem.displayexp || selectedItem.displayfield) : ''\n }\n } as WmSearchState);\n }\n }\n\n onDataItemsUpdate() {\n super.onDataItemsUpdate();\n this.isFocused && this.state.dataItems.length && this.updateFilteredData(this.state.props.query);\n this.updateDefaultQueryModel();\n }\n\n componentDidMount(): void {\n super.componentDidMount();\n this.updateDefaultQueryModel();\n }\n\n onPropertyChange(name: string, $new: any, $old: any) {\n switch (name) {\n case 'dataset':\n if (!isEmpty($new) && isObject($new) && !isArray($new)) {\n $new = [$new];\n this.updateState({\n props: {\n dataset: $new\n }\n } as WmSearchState);\n }\n break;\n }\n super.onPropertyChange(name, $new, $old);\n }\n\n setTemplate(partialName: any) {\n this.updateState({ template: partialName} as WmSearchState);\n }\n\n renderWidget(props: WmSearchProps) {\n const result = this.state.data;\n return (\n <View>\n {this.renderSearchBar()}\n {this.state.isOpened ? (\n <ModalConsumer>\n {(modalService: ModalService) => {\n modalService.showModal(this.prepareModalOptions((\n <ScrollView style={{width: '100%', maxHeight: 200}} contentContainerStyle={this.styles.dropDownContent}>\n <AssetProvider value={this.loadAsset}>\n {result && result.map((item: any, index: any) => (\n <View key={item.key}>\n {\n (!props.limit) || (props.limit && index+1 <= props.limit) ?\n this.renderSearchItem(item, index)\n : null\n }\n {\n index === result.length - 1 ?\n <WmAnchor caption={props.datacompletemsg} styles={this.styles.dataCompleteItem}></WmAnchor> : null\n }\n </View>\n ))}\n </AssetProvider>\n </ScrollView>\n ), this.styles, modalService));\n return null;\n }}\n </ModalConsumer>) : null}\n </View>\n\n );\n }\n}\n"],"mappings":";;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,QAAQ,EAAEC,QAAQ,EAAEC,IAAI,EAAEC,SAAS,EAAEC,IAAI,QAAQ,cAAc;AACxE,SAASC,UAAU,QAAQ,8BAA8B;AACzD,SAASC,IAAI,EAAEC,MAAM,QAAQ,QAAQ;AAErC,OAAOC,aAAa,MAAM,gBAAgB;AAC1C,SAASC,aAAa,QAAwB,iBAAiB;AAC/D,SAASC,aAAa,QAAmC,8CAA8C;AACvG,SAASC,YAAY,QAAQ,uEAAuE;AACpG,SAASC,uBAAuB,EAAEC,qBAAqB,QAAQ,8CAA8C;AAE7G,SACEC,oBAAoB,EACpBC,gBAAgB,QACX,8EAA8E;AACrF,OAAOC,QAAQ,MAAM,oEAAoE;AACzF,OAAOC,SAAS,MAAM,sEAAsE;AAC5F,SAASC,QAAQ,QAAQ,mDAAmD;AAC5E,OAAOC,QAAQ,MAAM,oEAAoE;AACzF,SAASC,GAAG,EAAEC,OAAO,EAAEC,OAAO,EAAEC,QAAQ,QAAQ,WAAW;AAC3D,SAASC,aAAa,QAAQ,+CAA+C;AAE7E,OAAO,MAAMC,aAAa,SAASV,gBAAgB,CAAgB;EAAAW,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAC,eAAA,mBAC7C,KAAK;IAAAA,eAAA,uBACV,CAAC,C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GRA,KAAK,KAAK9F,MAAM,CAACX,MAAM,GAAG,CAAC,gBAC3BpE,KAAA,CAAAyI,aAAA,CAACxH,QAAQ;QAAC2L,OAAO,EAAE3K,KAAK,CAAC4K,eAAgB;QAAChG,MAAM,EAAE,IAAI,CAACA,MAAM,CAACiG;MAAiB,CAAW,CAAC,GAAG,IAE5F,CACP,CACc,CACP,CAAC,EACZ,IAAI,CAACjG,MAAM,EAAEC,YAAY,CAAC,CAAC;MAC9B,OAAO,IAAI;IACb,CACa,CAAC,GAAI,IAClB,CAAC;EAGX;AACF","ignoreList":[]}
1
+ {"version":3,"names":["React","Keyboard","Platform","Text","TextInput","View","ScrollView","find","isNull","WmSearchProps","DEFAULT_CLASS","ModalConsumer","DataProvider","AccessibilityWidgetType","getAccessibilityProps","BaseDatasetComponent","BaseDatasetState","WmAnchor","WmPicture","Tappable","WmButton","get","isArray","isEmpty","isObject","AssetProvider","WmSearchState","constructor","args","_defineProperty","top","left","WmSearch","props","Promise","resolve","position","view","measure","x","y","width","height","px","py","updateState","computePosition","then","isOpened","dataProvider","datavalue","query","clearSearch","invokeEventCallback","hide","dataItems","state","map","item","selected","type","updateFilteredData","queryText","_filteredData","filterOptions","entries","filteredData","minchars","length","_this$dataProvider","searchkey","updateRequired","undefined","init","invokeVariable","response","dataSet","setDataItems","filter","result","dataObject","data","isFocused","showPopover","focus","_this$widgetRef","widgetRef","onChange","value","isDefaultQuery","prevQuery","searchon","validate","setTimeout","invokeEvent","proxy","invokeChange","e","OS","cursor","target","selectionStart","onFocus","disabled","_this$state$props$que","onBlur","triggerValidation","prepareModalOptions","content","styles","modalService","o","modalOptions","modalContentSTyles","searchInputWidth","modalContent","borderWidth","modalStyle","modal","contentStyle","isModal","onClose","dismiss","setState","hideModal","searchIconPress","onItemSelect","displayexp","displayfield","datafield","updateDatavalue","prevDatavalue","queryModel","renderSearchBar","_this$state$dataItems","opts","valueExpr","createElement","style","root","ref","onLayout","searchInputWrapper","_extends","text","isValid","invalid","focusedText","selectionEnd","getTestPropsForInput","SEARCH","placeholderTextColor","placeholderText","color","placeholder","autoFocus","autofocus","editable","readonly","onChangeText","bind","nativeEvent","layout","showclear","onTap","id","getTestId","clearButton","iconclass","showSearchIcon","searchButton","reset","renderSearchItem","index","imageStyles","imagewidth","getTestProps","searchItem","template","renderitempartial","Fragment","name","picturesource","imgSrc","getTestPropsForLabel","searchItemText","updateDefaultQueryModel","selectedItem","onDataItemsUpdate","componentDidMount","onPropertyChange","$new","$old","dataset","setTemplate","partialName","renderWidget","showModal","maxHeight","contentContainerStyle","dropDownContent","loadAsset","key","limit","caption","datacompletemsg","dataCompleteItem"],"sources":["search.component.tsx"],"sourcesContent":["import React from 'react';\nimport { Keyboard, Platform, Text, TextInput, View } from 'react-native';\nimport { ScrollView } from 'react-native-gesture-handler';\nimport { find, isNull } from 'lodash';\n\nimport WmSearchProps from './search.props';\nimport { DEFAULT_CLASS, WmSearchStyles } from './search.styles';\nimport { ModalConsumer, ModalOptions, ModalService} from \"@wavemaker/app-rn-runtime/core/modal.service\";\nimport { DataProvider } from '@wavemaker/app-rn-runtime/components/basic/search/local-data-provider';\nimport { AccessibilityWidgetType, getAccessibilityProps } from '@wavemaker/app-rn-runtime/core/accessibility'; \n\nimport {\n BaseDatasetComponent,\n BaseDatasetState\n} from '@wavemaker/app-rn-runtime/components/input/basedataset/basedataset.component';\nimport WmAnchor from '@wavemaker/app-rn-runtime/components/basic/anchor/anchor.component';\nimport WmPicture from '@wavemaker/app-rn-runtime/components/basic/picture/picture.component';\nimport { Tappable } from '@wavemaker/app-rn-runtime/core/tappable.component';\nimport WmButton from '@wavemaker/app-rn-runtime/components/basic/button/button.component';\nimport { get, isArray, isEmpty, isObject } from \"lodash-es\";\nimport { AssetProvider } from '@wavemaker/app-rn-runtime/core/asset.provider';\n\nexport class WmSearchState extends BaseDatasetState<WmSearchProps> {\n isOpened: boolean = false;\n modalOptions = {} as ModalOptions;\n template: string = \"\";\n position = {\n top: 0,\n left: 0\n } as DropdownPosition;\n data: any = [];\n}\n\nexport interface DropdownPosition {\n top?: number;\n bottom?: number;\n left?: number;\n right?: number;\n}\n\nexport default class WmSearch extends BaseDatasetComponent<WmSearchProps, WmSearchState, WmSearchStyles> {\n view: View = null as any;\n private prevDatavalue: any;\n private queryModel: any;\n private searchInputWidth: any;\n private isDefaultQuery: boolean = true;\n private dataProvider: DataProvider;\n public widgetRef: TextInput | null = null;\n private cursor: any = 0;\n private isFocused: boolean = false;\n private updateRequired: any;\n\n constructor(props: WmSearchProps) {\n super(props, DEFAULT_CLASS, new WmSearchProps(), new WmSearchState());\n this.dataProvider = new DataProvider();\n if (this.props.datavalue) {\n this.updateState({\n props: {\n query: this.props.datavalue\n }\n } as WmSearchState);\n }\n }\n\n computePosition = () => {\n return new Promise<void>((resolve) => {\n const position = {} as DropdownPosition;\n this.view.measure((x = 0, y = 0, width = 0, height = 0, px = 0, py = 0) => {\n position.left = px;\n position.top = py + height;\n this.updateState({ position: position } as WmSearchState, resolve);\n });\n });\n }\n\n clearSearch() {\n this.invokeEventCallback('onClear', [null, this]);\n this.hide();\n this.updateState({\n props: {\n query: ''\n },\n dataItems: this.state.dataItems ? this.state.dataItems.map((item: any) => {\n item.selected = false;\n return item;\n }) : []\n } as WmSearchState, () => {\n if (this.state.props.type === 'autocomplete') {\n this.updateFilteredData('');\n }\n });\n }\n\n updateFilteredData(queryText: string = '') {\n const props = this.state.props;\n const filterOptions = {\n query: queryText,\n props: props,\n entries: this.state.dataItems\n };\n let filteredData: Array<any> = [];\n if (props.minchars && queryText.length < props.minchars) {\n filteredData = [];\n } else if (props.type === 'search' && !queryText) {\n filteredData = [];\n } else {\n if (this.props.searchkey && this.updateRequired === undefined) {\n this.updateRequired = this.dataProvider.init(this);\n }\n // for service variables invoke the variable with params.\n if (this.props.searchkey && this.updateRequired && this.state.props.query !== queryText) {\n this.dataProvider.invokeVariable(this, queryText).then((response: any) => {\n if (response) {\n response = response.dataSet;\n if (isEmpty(response)) {\n filteredData = [];\n } else {\n if (isObject(response) && !isArray(response)) {\n response = [response];\n }\n this.setDataItems(response);\n }\n }\n }, () => {});\n return;\n }\n filteredData = this.dataProvider?.filter(filterOptions);\n }\n this.updateState({\n props: { result: filteredData?.map( (item: any) => item.dataObject), query: queryText },\n data: filteredData,\n } as WmSearchState);\n if (!this.state.isOpened && this.isFocused) {\n this.showPopover && this.showPopover();\n }\n }\n\n focus() {\n this?.widgetRef?.focus();\n }\n\n onChange(value: any) {\n this.isDefaultQuery = false;\n const prevQuery = this.state.props.query;\n if (this.state.props.searchon === 'onsearchiconclick') {\n this.updateState({\n props: {result: [], query: value},\n data: []\n } as WmSearchState);\n } else {\n this.updateFilteredData(value);\n }\n if (value === '') {\n this.validate(value);\n this.updateState({\n props: {\n datavalue: '',\n },\n } as WmSearchState);\n if (value === prevQuery) {\n return;\n }\n }\n setTimeout(() => {\n if (this.props.invokeEvent) {\n this.props.invokeEvent('onChange', [undefined, this.proxy, value, prevQuery]);\n }\n this.invokeEventCallback('onChange', [ undefined, this.proxy, value, prevQuery ]);\n }, 300);\n }\n\n invokeChange(e: any) {\n if (Platform.OS === 'web') {\n this.cursor = e.target.selectionStart;\n this.updateState({ props: { query: e.target.value } } as WmSearchState);\n }\n }\n\n onFocus() {\n this.isFocused = true;\n if (!this.state.props.disabled && this.state.props.type === 'autocomplete') {\n this.cursor = this.state.props.query?.length || 0;\n this.updateFilteredData(this.state.props.query || '');\n }\n this.invokeEventCallback('onFocus', [null, this]);\n }\n\n onBlur() {\n this.isFocused = false;\n this.validate(this.state.props.datavalue);\n if (!this.state.props.datavalue) {\n setTimeout(() => {\n this.props.triggerValidation && this.props.triggerValidation();\n })\n }\n this.invokeEventCallback('onBlur', [null, this]);\n }\n\n public showPopover = () => {\n this.computePosition().then(() => {\n this.updateState({ isOpened: true } as WmSearchState);\n });\n };\n\n public hide = () => {};\n\n prepareModalOptions(content: React.ReactNode, styles: WmSearchStyles, modalService: ModalService) {\n const o = this.state.modalOptions;\n const modalContentSTyles = {\n width: this.searchInputWidth - 2 * (styles.modalContent.borderWidth || 0),\n left: (this.state.position.left || 0) + 2 * (styles.modalContent.borderWidth || 0) };\n o.modalStyle = {...styles.modal};\n o.contentStyle = {...styles.modalContent, ...this.state.position, ...modalContentSTyles};\n o.content = content;\n o.isModal = true;\n o.onClose = () => {\n this.hide = () => {};\n Keyboard.dismiss();\n if (this.state.isOpened) {\n this.setState({isOpened: false, modalOptions: {} as ModalOptions} as WmSearchState);\n }\n };\n this.hide = () => {\n modalService.hideModal(this.state.modalOptions);\n if (this.state.isOpened) {\n this.setState({ isOpened: false, modalOptions: {} as ModalOptions } as WmSearchState);\n }\n }\n return o;\n }\n\n searchIconPress() {\n this.isFocused = false;\n if (this.state.props.searchon === 'onsearchiconclick') {\n this.updateFilteredData(this.state.props.query);\n } else {\n this.onItemSelect(this.state.data[0]);\n }\n }\n\n onItemSelect(item: any) {\n this.isFocused = false;\n this.updateState({ props: {\n query: item.displayexp || item.displayfield\n }\n } as WmSearchState);\n this.validate(item.datafield);\n this.updateDatavalue(item.datafield);\n this.prevDatavalue = item.datafield;\n this.queryModel = item;\n if (get(this.props, 'formfield')) {\n // @ts-ignore\n this.props.invokeEvent('onSelect', [null, this, item.datafield]);\n // @ts-ignore\n this.props.invokeEvent('onSubmit', [null, this]);\n } else {\n this.invokeEventCallback('onSelect', [null, this, item.datafield]);\n this.invokeEventCallback('onSubmit', [null, this]);\n }\n this.hide();\n }\n\n renderSearchBar() {\n const props = this.state.props;\n let opts: any = {};\n const valueExpr = Platform.OS === 'web' ? 'value' : 'defaultValue';\n opts[valueExpr] = this.state.props.query || '';\n return(\n /*\n * onLayout function is required.\n * https://github.com/naoufal/react-native-accordion/pull/19/files\n */\n <View style={this.styles.root} ref={ref => {this.view = ref as View}} onLayout={() => {}}>\n <View style={this.styles.searchInputWrapper}>\n <TextInput style={[this.styles.text, this.state.isValid ? {} : this.styles.invalid, this.state.isOpened && this.state.dataItems?.length > 0? this.styles.focusedText : null]}\n ref={ref => {this.widgetRef = ref;\n // @ts-ignore\n if (ref && !isNull(ref.selectionStart) && !isNull(ref.selectionEnd)) {\n // @ts-ignore\n ref.selectionStart = ref.selectionEnd = this.cursor;\n }}}\n {...this.getTestPropsForInput()}\n {...getAccessibilityProps(AccessibilityWidgetType.SEARCH, props)}\n placeholderTextColor={this.styles.placeholderText.color as any}\n placeholder={props.placeholder || 'Search'}\n autoFocus={props.autofocus}\n editable={props.disabled || props.readonly ? false : true}\n onChangeText={this.onChange.bind(this)}\n onChange={this.invokeChange.bind(this)}\n onFocus={this.onFocus.bind(this)}\n onLayout={e => {this.searchInputWidth = e.nativeEvent.layout.width}}\n onBlur={this.onBlur.bind(this)}\n {...opts}>\n </TextInput>\n {props.showclear && this.state.props.query ? <WmButton onTap={this.clearSearch.bind(this)}\n id={this.getTestId('clear')}\n styles={this.styles.clearButton} iconclass={'wi wi-clear'}></WmButton> : null}\n </View>\n {props.showSearchIcon && props.type === 'search' ? <WmButton styles={this.styles.searchButton}\n id={this.getTestId('search')}\n iconclass={'wm-sl-l sl-search'} onTap={this.searchIconPress.bind(this)}></WmButton> : null}\n </View>\n );\n }\n\n reset() {\n if (this.state.props.query) {\n this.updateState({\n props: {\n query: ''\n }\n } as WmSearchState);\n }\n }\n\n renderSearchItem(item: any, index: number) {\n const props = this.state.props;\n const imageStyles = { root: {height:props.imagewidth, width:props.imagewidth}}\n return (\n <Tappable onTap={this.onItemSelect.bind(this, item)} {...this.getTestProps(`action${index}`)}>\n <View style={this.styles.searchItem}>\n {!isEmpty(this.state.template) && this.props.renderitempartial ?\n this.props.renderitempartial(item.dataObject, index, this.state.template) : (<>\n <WmPicture id={this.getTestId(`picture${index}`)} styles={imageStyles} name={props.name + '_image'} picturesource={item.imgSrc}></WmPicture>\n <Text {...this.getTestPropsForLabel(index + '')} style={this.styles.searchItemText}>{item.displayexp || item.displayfield}</Text>\n </>)}\n </View>\n </Tappable>\n );\n }\n\n updateDefaultQueryModel() {\n if (this.state.dataItems && this.state.dataItems.length && this.isDefaultQuery) {\n const selectedItem = find(this.state.dataItems, (item) => item.selected);\n this.updateState({ props: {\n query: selectedItem ? (selectedItem.displayexp || selectedItem.displayfield) : ''\n }\n } as WmSearchState);\n }\n }\n\n onDataItemsUpdate() {\n super.onDataItemsUpdate();\n this.isFocused && this.state.dataItems.length && this.updateFilteredData(this.state.props.query);\n this.updateDefaultQueryModel();\n }\n\n componentDidMount(): void {\n super.componentDidMount();\n this.updateDefaultQueryModel();\n }\n\n onPropertyChange(name: string, $new: any, $old: any) {\n switch (name) {\n case 'dataset':\n if (!isEmpty($new) && isObject($new) && !isArray($new)) {\n $new = [$new];\n this.updateState({\n props: {\n dataset: $new\n }\n } as WmSearchState);\n }\n break;\n }\n super.onPropertyChange(name, $new, $old);\n }\n\n setTemplate(partialName: any) {\n this.updateState({ template: partialName} as WmSearchState);\n }\n\n renderWidget(props: WmSearchProps) {\n const result = this.state.data;\n return (\n <View>\n {this.renderSearchBar()}\n {this.state.isOpened ? (\n <ModalConsumer>\n {(modalService: ModalService) => {\n modalService.showModal(this.prepareModalOptions((\n <ScrollView style={{width: '100%', maxHeight: 200}} contentContainerStyle={this.styles.dropDownContent}>\n <AssetProvider value={this.loadAsset}>\n {result && result.map((item: any, index: any) => (\n <View key={item.key}>\n {\n (!props.limit) || (props.limit && index+1 <= props.limit) ?\n this.renderSearchItem(item, index)\n : null\n }\n {\n index === result.length - 1 ?\n <WmAnchor caption={props.datacompletemsg} styles={this.styles.dataCompleteItem}></WmAnchor> : null\n }\n </View>\n ))}\n </AssetProvider>\n </ScrollView>\n ), this.styles, modalService));\n return null;\n }}\n </ModalConsumer>) : null}\n </View>\n\n );\n }\n}\n"],"mappings":";;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,QAAQ,EAAEC,QAAQ,EAAEC,IAAI,EAAEC,SAAS,EAAEC,IAAI,QAAQ,cAAc;AACxE,SAASC,UAAU,QAAQ,8BAA8B;AACzD,SAASC,IAAI,EAAEC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AACuF,SAAS,CAAC,IAAI,CAAC1F,mBAAmB,eAC7C3G,KAAA,CAAAyI,aAAA,CAACnI,UAAU;QAACoI,KAAK,EAAE;UAACjG,KAAK,EAAE,MAAM;UAAE6J,SAAS,EAAE;QAAG,CAAE;QAACC,qBAAqB,EAAE,IAAI,CAAC1F,MAAM,CAAC2F;MAAgB,gBACnGxM,KAAA,CAAAyI,aAAA,CAAChH,aAAa;QAAC+D,KAAK,EAAE,IAAI,CAACiH;MAAU,GACpC1H,MAAM,IAAIA,MAAM,CAACtB,GAAG,CAAC,CAACC,IAAS,EAAEmH,KAAU,kBAC1C7K,KAAA,CAAAyI,aAAA,CAACpI,IAAI;QAACqM,GAAG,EAAEhJ,IAAI,CAACgJ;MAAI,GAEf,CAACzK,KAAK,CAAC0K,KAAK,IAAM1K,KAAK,CAAC0K,KAAK,IAAI9B,KAAK,GAAC,CAAC,IAAI5I,KAAK,CAAC0K,KAAM,GACvD,IAAI,CAAC/B,gBAAgB,CAAClH,IAAI,EAAEmH,KAAK,CAAC,GAChC,IAAI,EAGRA,KAAK,KAAK9F,MAAM,CAACX,MAAM,GAAG,CAAC,gBAC3BpE,KAAA,CAAAyI,aAAA,CAACxH,QAAQ;QAAC2L,OAAO,EAAE3K,KAAK,CAAC4K,eAAgB;QAAChG,MAAM,EAAE,IAAI,CAACA,MAAM,CAACiG;MAAiB,CAAW,CAAC,GAAG,IAE5F,CACP,CACc,CACP,CAAC,EACZ,IAAI,CAACjG,MAAM,EAAEC,YAAY,CAAC,CAAC;MAC9B,OAAO,IAAI;IACb,CACa,CAAC,GAAI,IAClB,CAAC;EAGX;AACF","ignoreList":[]}
@@ -71,14 +71,13 @@ export default class WmSpinner extends BaseComponent {
71
71
  loop: true,
72
72
  play: true,
73
73
  style: this.styles.lottie
74
- }) : /*#__PURE__*/React.createElement(LottieView, {
75
- testID: this.getTestId('lottie'),
74
+ }) : /*#__PURE__*/React.createElement(LottieView, _extends({}, this.getTestProps('loader'), {
76
75
  source: this.addClasstoLottie(props.lottie),
77
76
  resizeMode: "contain",
78
77
  autoPlay: true,
79
78
  loop: true,
80
79
  style: this.styles.lottie
81
- });
80
+ }));
82
81
  }
83
82
  renderWidget(props) {
84
83
  return /*#__PURE__*/React.createElement(View, {
@@ -1 +1 @@
1
- {"version":3,"names":["React","Text","View","Platform","Color","BaseComponent","BaseComponentState","WmSpinnerProps","DEFAULT_CLASS","WmIcon","WmPicture","LottieView","ThemeVariables","WmSpinnerState","WmSpinner","constructor","props","_defineProperty","obj","colors","Object","keys","forEach","key","value","ind","Math","floor","random","length","toLowerCase","includes","shape","recursiveSearch","prepareIcon","createElement","id","getTestId","styles","icon","iconclass","iconsize","prepareImage","image","picturesource","toRgbArray","color","red","green","blue","addClasstoLottie","lottiePath","primaryColor","INSTANCE","darken","json","loader","prepareLottie","_Lottie","Lottie","OS","require","default","animationData","lottie","loop","play","style","testID","source","resizeMode","autoPlay","renderWidget","root","_background","caption","_extends","getTestPropsForLabel","text"],"sources":["spinner.component.tsx"],"sourcesContent":["import React from 'react';\nimport { Text, View, Platform } from 'react-native';\nimport Color from \"color\";\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\n\nimport WmSpinnerProps from './spinner.props';\nimport { DEFAULT_CLASS, WmSpinnerStyles } from './spinner.styles';\nimport WmIcon from '@wavemaker/app-rn-runtime/components/basic/icon/icon.component';\nimport WmPicture from '@wavemaker/app-rn-runtime/components/basic/picture/picture.component';\nimport LottieView from 'lottie-react-native';\nimport ThemeVariables from '@wavemaker/app-rn-runtime/styles/theme.variables';\n\nexport class WmSpinnerState extends BaseComponentState<WmSpinnerProps> {\n\n}\n\nexport default class WmSpinner extends BaseComponent<WmSpinnerProps, WmSpinnerState, WmSpinnerStyles> {\n\n constructor(props: WmSpinnerProps) {\n super(props, DEFAULT_CLASS, new WmSpinnerProps());\n }\n\n private prepareIcon(props: any) {\n return (<WmIcon\n id={this.getTestId('icon')}\n styles={this.styles.icon}\n iconclass={props.iconclass + ' fa-spin'} iconsize={props.iconsize}></WmIcon>);\n }\n\n private prepareImage(props: any) {\n return (<WmPicture\n id={this.getTestId('picture')}\n styles={this.styles.image}\n picturesource={props.image}></WmPicture>);\n }\n\n private recursiveSearch = (obj: any, colors: any) => {\n obj && Object.keys(obj).forEach(key => {\n let value = obj[key];\n let ind = Math.floor(Math.random() * (0 - colors.length ) + colors.length);\n if (key == \"nm\" && (value.toLowerCase().includes('fill ') || value.toLowerCase().includes('stroke '))) {\n if (obj[\"c\"] && obj[\"c\"][\"k\"] \n && (obj[\"c\"][\"k\"].length == 4\n || (obj[\"c\"][\"k\"].length ==3 \n && typeof obj[\"c\"][\"k\"][0] == 'number'))) {\n obj[\"c\"][\"k\"] = colors[ind];\n }\n else {\n if (obj[\"c\"] && obj[\"c\"][\"k\"]){\n for (let shape in obj[\"c\"][\"k\"]) {\n if(obj[\"c\"][\"k\"][shape] && obj[\"c\"][\"k\"][shape][\"s\"]){\n obj[\"c\"][\"k\"][shape][\"s\"] = colors[ind];\n }\n }\n }\n }\n } else if (typeof value === 'object') {\n this.recursiveSearch(value, colors);\n }\n });\n return obj;\n };\n\n private toRgbArray(color: Color) {\n return [\n color.red()/255,\n color.green()/255,\n color.blue()/255,\n 1\n ]\n }\n\n private addClasstoLottie(lottiePath: any) {\n let primaryColor = Color(ThemeVariables.INSTANCE.primaryColor);\n let colors = [this.toRgbArray(primaryColor), \n this.toRgbArray(primaryColor.darken(0.2)), \n this.toRgbArray(primaryColor.darken(0.4)), \n this.toRgbArray(primaryColor.darken(0.6)), \n this.toRgbArray(primaryColor.darken(0.8))];\n return this.recursiveSearch(lottiePath.json, lottiePath.loader == 'circleSpinner' ? [colors[0]] : colors);\n }\n\n private prepareLottie(props: any) {\n let Lottie = Platform.OS == 'web' ? require('react-lottie-player') : null;\n Lottie = Lottie?.default || Lottie;\n return (\n Platform.OS == 'web' ? <Lottie animationData={this.addClasstoLottie(props.lottie)} loop={true} play={true} style={this.styles.lottie} /> : <LottieView\n testID={this.getTestId('lottie')}\n source={this.addClasstoLottie(props.lottie)}\n resizeMode='contain'\n autoPlay={true}\n loop={true}\n style={this.styles.lottie}\n />\n )\n }\n\n renderWidget(props: WmSpinnerProps) {\n return (\n <View style={this.styles.root}>\n {this._background}\n {props.lottie ? this.prepareLottie(props) : props.image ? this.prepareImage(props) : this.prepareIcon(props)}\n {props.caption ? <Text {...this.getTestPropsForLabel()} style={this.styles.text}>{props.caption}</Text> : null}\n </View>\n );\n }\n}\n"],"mappings":";;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,EAAEC,IAAI,EAAEC,QAAQ,QAAQ,cAAc;AACnD,OAAOC,KAAK,MAAM,OAAO;AACzB,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,+CAA+C;AAEjG,OAAOC,cAAc,MAAM,iBAAiB;AAC5C,SAASC,aAAa,QAAyB,kBAAkB;AACjE,OAAOC,MAAM,MAAM,gEAAgE;AACnF,OAAOC,SAAS,MAAM,sEAAsE;AAC5F,OAAOC,UAAU,MAAM,qBAAqB;AAC5C,OAAOC,cAAc,MAAM,kDAAkD;AAE7E,OAAO,MAAMC,cAAc,SAASP,kBAAkB,CAAiB;AAIvE,eAAe,MAAMQ,SAAS,SAAST,aAAa,CAAkD;EAEpGU,WAAWA,CAACC,KAAqB,EAAE;IACjC,KAAK,CAACA,KAAK,EAAER,aAAa,EAAE,IAAID,cAAc,CAAC,CAAC,CAAC;IAACU,eAAA,0BAiB1B,CAACC,GAAQ,EAAEC,MAAW,KAAK;MACnDD,GAAG,IAAIE,MAAM,CAACC,IAAI,CAACH,GAAG,CAAC,CAACI,OAAO,CAACC,GAAG,IAAI;QACnC,IAAIC,KAAK,GAAGN,GAAG,CAACK,GAAG,CAAC;QACpB,IAAIE,GAAG,GAAGC,IAAI,CAACC,KAAK,CAACD,IAAI,CAACE,MAAM,CAAC,CAAC,IAAI,CAAC,GAAGT,MAAM,CAACU,MAAM,CAAE,GAAGV,MAAM,CA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C3B,IAAI,CAACC,WAAW,EAChB1D,KAAK,CAACgD,MAAM,GAAG,IAAI,CAACP,aAAa,CAACzC,KAAK,CAAC,GAAGA,KAAK,CAAC2B,KAAK,GAAG,IAAI,CAACD,YAAY,CAAC1B,KAAK,CAAC,GAAG,IAAI,CAACkB,WAAW,CAAClB,KAAK,CAAC,EAC3GA,KAAK,CAAC2D,OAAO,gBAAG3E,KAAA,CAAAmC,aAAA,CAAClC,IAAI,EAAA2E,QAAA,KAAK,IAAI,CAACC,oBAAoB,CAAC,CAAC;MAAEV,KAAK,EAAE,IAAI,CAAC7B,MAAM,CAACwC;IAAK,IAAE9D,KAAK,CAAC2D,OAAc,CAAC,GAAG,IACtG,CAAC;EAEX;AACF","ignoreList":[]}
1
+ {"version":3,"names":["React","Text","View","Platform","Color","BaseComponent","BaseComponentState","WmSpinnerProps","DEFAULT_CLASS","WmIcon","WmPicture","LottieView","ThemeVariables","WmSpinnerState","WmSpinner","constructor","props","_defineProperty","obj","colors","Object","keys","forEach","key","value","ind","Math","floor","random","length","toLowerCase","includes","shape","recursiveSearch","prepareIcon","createElement","id","getTestId","styles","icon","iconclass","iconsize","prepareImage","image","picturesource","toRgbArray","color","red","green","blue","addClasstoLottie","lottiePath","primaryColor","INSTANCE","darken","json","loader","prepareLottie","_Lottie","Lottie","OS","require","default","animationData","lottie","loop","play","style","_extends","getTestProps","source","resizeMode","autoPlay","renderWidget","root","_background","caption","getTestPropsForLabel","text"],"sources":["spinner.component.tsx"],"sourcesContent":["import React from 'react';\nimport { Text, View, Platform } from 'react-native';\nimport Color from \"color\";\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\n\nimport WmSpinnerProps from './spinner.props';\nimport { DEFAULT_CLASS, WmSpinnerStyles } from './spinner.styles';\nimport WmIcon from '@wavemaker/app-rn-runtime/components/basic/icon/icon.component';\nimport WmPicture from '@wavemaker/app-rn-runtime/components/basic/picture/picture.component';\nimport LottieView from 'lottie-react-native';\nimport ThemeVariables from '@wavemaker/app-rn-runtime/styles/theme.variables';\n\nexport class WmSpinnerState extends BaseComponentState<WmSpinnerProps> {\n\n}\n\nexport default class WmSpinner extends BaseComponent<WmSpinnerProps, WmSpinnerState, WmSpinnerStyles> {\n\n constructor(props: WmSpinnerProps) {\n super(props, DEFAULT_CLASS, new WmSpinnerProps());\n }\n\n private prepareIcon(props: any) {\n return (<WmIcon\n id={this.getTestId('icon')}\n styles={this.styles.icon}\n iconclass={props.iconclass + ' fa-spin'} iconsize={props.iconsize}></WmIcon>);\n }\n\n private prepareImage(props: any) {\n return (<WmPicture\n id={this.getTestId('picture')}\n styles={this.styles.image}\n picturesource={props.image}></WmPicture>);\n }\n\n private recursiveSearch = (obj: any, colors: any) => {\n obj && Object.keys(obj).forEach(key => {\n let value = obj[key];\n let ind = Math.floor(Math.random() * (0 - colors.length ) + colors.length);\n if (key == \"nm\" && (value.toLowerCase().includes('fill ') || value.toLowerCase().includes('stroke '))) {\n if (obj[\"c\"] && obj[\"c\"][\"k\"] \n && (obj[\"c\"][\"k\"].length == 4\n || (obj[\"c\"][\"k\"].length ==3 \n && typeof obj[\"c\"][\"k\"][0] == 'number'))) {\n obj[\"c\"][\"k\"] = colors[ind];\n }\n else {\n if (obj[\"c\"] && obj[\"c\"][\"k\"]){\n for (let shape in obj[\"c\"][\"k\"]) {\n if(obj[\"c\"][\"k\"][shape] && obj[\"c\"][\"k\"][shape][\"s\"]){\n obj[\"c\"][\"k\"][shape][\"s\"] = colors[ind];\n }\n }\n }\n }\n } else if (typeof value === 'object') {\n this.recursiveSearch(value, colors);\n }\n });\n return obj;\n };\n\n private toRgbArray(color: Color) {\n return [\n color.red()/255,\n color.green()/255,\n color.blue()/255,\n 1\n ]\n }\n\n private addClasstoLottie(lottiePath: any) {\n let primaryColor = Color(ThemeVariables.INSTANCE.primaryColor);\n let colors = [this.toRgbArray(primaryColor), \n this.toRgbArray(primaryColor.darken(0.2)), \n this.toRgbArray(primaryColor.darken(0.4)), \n this.toRgbArray(primaryColor.darken(0.6)), \n this.toRgbArray(primaryColor.darken(0.8))];\n return this.recursiveSearch(lottiePath.json, lottiePath.loader == 'circleSpinner' ? [colors[0]] : colors);\n }\n\n private prepareLottie(props: any) {\n let Lottie = Platform.OS == 'web' ? require('react-lottie-player') : null;\n Lottie = Lottie?.default || Lottie;\n return (\n Platform.OS == 'web' ? <Lottie animationData={this.addClasstoLottie(props.lottie)} loop={true} play={true} style={this.styles.lottie} /> : <LottieView\n {...this.getTestProps('loader')}\n source={this.addClasstoLottie(props.lottie)}\n resizeMode='contain'\n autoPlay={true}\n loop={true}\n style={this.styles.lottie}\n />\n )\n }\n\n renderWidget(props: WmSpinnerProps) {\n return (\n <View style={this.styles.root}>\n {this._background}\n {props.lottie ? this.prepareLottie(props) : props.image ? this.prepareImage(props) : this.prepareIcon(props)}\n {props.caption ? <Text {...this.getTestPropsForLabel()} style={this.styles.text}>{props.caption}</Text> : null}\n </View>\n );\n }\n}\n"],"mappings":";;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,EAAEC,IAAI,EAAEC,QAAQ,QAAQ,cAAc;AACnD,OAAOC,KAAK,MAAM,OAAO;AACzB,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,+CAA+C;AAEjG,OAAOC,cAAc,MAAM,iBAAiB;AAC5C,SAASC,aAAa,QAAyB,kBAAkB;AACjE,OAAOC,MAAM,MAAM,gEAAgE;AACnF,OAAOC,SAAS,MAAM,sEAAsE;AAC5F,OAAOC,UAAU,MAAM,qBAAqB;AAC5C,OAAOC,cAAc,MAAM,kDAAkD;AAE7E,OAAO,MAAMC,cAAc,SAASP,kBAAkB,CAAiB;AAIvE,eAAe,MAAMQ,SAAS,SAAST,aAAa,CAAkD;EAEpGU,WAAWA,CAACC,KAAqB,EAAE;IACjC,KAAK,CAACA,KAAK,EAAER,aAAa,EAAE,IAAID,cAAc,CAAC,CAAC,CAAC;IAACU,eAAA,0BAiB1B,CAACC,GAAQ,EAA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E;MAC5CO,UAAU,EAAC,SAAS;MACpBC,QAAQ,EAAE,IAAK;MACfP,IAAI,EAAE,IAAK;MACXE,KAAK,EAAE,IAAI,CAAC7B,MAAM,CAAC0B;IAAO,EAC3B,CAAC;EAEN;EAEAS,YAAYA,CAACzD,KAAqB,EAAE;IAClC,oBACEhB,KAAA,CAAAmC,aAAA,CAACjC,IAAI;MAACiE,KAAK,EAAE,IAAI,CAAC7B,MAAM,CAACoC;IAAK,GAC3B,IAAI,CAACC,WAAW,EAChB3D,KAAK,CAACgD,MAAM,GAAG,IAAI,CAACP,aAAa,CAACzC,KAAK,CAAC,GAAGA,KAAK,CAAC2B,KAAK,GAAG,IAAI,CAACD,YAAY,CAAC1B,KAAK,CAAC,GAAG,IAAI,CAACkB,WAAW,CAAClB,KAAK,CAAC,EAC3GA,KAAK,CAAC4D,OAAO,gBAAG5E,KAAA,CAAAmC,aAAA,CAAClC,IAAI,EAAAmE,QAAA,KAAK,IAAI,CAACS,oBAAoB,CAAC,CAAC;MAAEV,KAAK,EAAE,IAAI,CAAC7B,MAAM,CAACwC;IAAK,IAAE9D,KAAK,CAAC4D,OAAc,CAAC,GAAG,IACtG,CAAC;EAEX;AACF","ignoreList":[]}
@@ -21,8 +21,9 @@ BASE_THEME.registerStyle((themeVariables, addStyle) => {
21
21
  },
22
22
  image: {},
23
23
  lottie: {
24
- width: 100,
25
- height: 100,
24
+ position: 'absolute',
25
+ width: 150,
26
+ height: 150,
26
27
  alignSelf: 'center',
27
28
  justifyContent: 'center'
28
29
  }
@@ -1 +1 @@
1
- {"version":3,"names":["defineStyles","BASE_THEME","DEFAULT_CLASS","registerStyle","themeVariables","addStyle","defaultStyles","root","flexDirection","justifyContent","alignItems","text","fontSize","paddingLeft","icon","width","color","spinnerIconColor","image","lottie","height","alignSelf","textAlign","paddingRight"],"sources":["spinner.styles.ts"],"sourcesContent":["import { BaseStyles, defineStyles } from '@wavemaker/app-rn-runtime/core/base.component';\nimport BASE_THEME, { NamedStyles, AllStyle } from '@wavemaker/app-rn-runtime/styles/theme';\nimport { WmIconStyles } from '@wavemaker/app-rn-runtime/components/basic/icon/icon.styles';\nimport { WmPictureStyles } from '@wavemaker/app-rn-runtime/components/basic/picture/picture.styles';\n\nexport type WmSpinnerStyles = BaseStyles & {\n icon: WmIconStyles\n image: WmPictureStyles\n lottie: AllStyle\n};\n\nexport const DEFAULT_CLASS = 'app-spinner';\nBASE_THEME.registerStyle((themeVariables, addStyle) => {\n const defaultStyles: WmSpinnerStyles = defineStyles({\n root: {\n flexDirection: 'row',\n justifyContent: 'center',\n alignItems: 'center'\n },\n text: {\n fontSize: 16,\n paddingLeft: 8\n },\n icon: {\n text: {\n fontSize: 48,\n width: 4,\n color: themeVariables.spinnerIconColor\n }\n } as WmIconStyles,\n image: {} as WmPictureStyles,\n lottie: {\n width: 100,\n height: 100,\n alignSelf: 'center',\n justifyContent: 'center'\n }\n });\n\n addStyle(DEFAULT_CLASS, '', defaultStyles);\n addStyle(DEFAULT_CLASS + '-rtl', '', {\n root : {\n textAlign: 'right'\n },\n text: {\n paddingRight: 8\n }\n });\n});\n"],"mappings":"AAAA,SAAqBA,YAAY,QAAQ,+CAA+C;AACxF,OAAOC,UAAU,MAAiC,wCAAwC;AAU1F,OAAO,MAAMC,aAAa,GAAG,aAAa;AAC1CD,UAAU,CAACE,aAAa,CAAC,CAACC,cAAc,EAAEC,QAAQ,KAAK;EACrD,MAAMC,aAA8B,GAAGN,YAAY,CAAC;IAClDO,IAAI,EAAE;MACJC,aAAa,EAAE,KAAK;MACpBC,cAAc,EAAE,QAAQ;MACxBC,UAAU,EAAE;IACd,CAAC;IACDC,IAAI,EAAE;MACJC,QAAQ,EAAE,EAAE;MACZC,WAAW,EAAE;IACf,CAAC;IACDC,IAAI,EAAE;MACJH,IAAI,EAAE;QACJC,QAAQ,EAAE,EAAE;QACZG,KAAK,EAAE,CAAC;QACRC,KAAK,EAAEZ,cAAc,CAACa;MACxB;IACF,CAAiB;IACjBC,KAAK,EAAE,CAAC,CAAoB;IAC5BC,MAAM,EAAE;MACNJ,KAAK,EAAE,GAAG;MACVK,MAAM,EAAE,GAAG;MACXC,SAAS,EAAE,QAAQ;MACnBZ,cAAc,EAAE;IAClB;EACF,CAAC,CAAC;EAEFJ,QAAQ,CAACH,aAAa,EAAE,EAAE,EAAEI,aAAa,CAAC;EAC1CD,QAAQ,CAACH,aAAa,GAAG,MAAM,EAAE,EAAE,EAAE;IACnCK,IAAI,EAAG;MACLe,SAAS,EAAE;IACb,CAAC;IACDX,IAAI,EAAE;MACJY,YAAY,EAAE;IAChB;EACF,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["defineStyles","BASE_THEME","DEFAULT_CLASS","registerStyle","themeVariables","addStyle","defaultStyles","root","flexDirection","justifyContent","alignItems","text","fontSize","paddingLeft","icon","width","color","spinnerIconColor","image","lottie","position","height","alignSelf","textAlign","paddingRight"],"sources":["spinner.styles.ts"],"sourcesContent":["import { BaseStyles, defineStyles } from '@wavemaker/app-rn-runtime/core/base.component';\nimport BASE_THEME, { NamedStyles, AllStyle } from '@wavemaker/app-rn-runtime/styles/theme';\nimport { WmIconStyles } from '@wavemaker/app-rn-runtime/components/basic/icon/icon.styles';\nimport { WmPictureStyles } from '@wavemaker/app-rn-runtime/components/basic/picture/picture.styles';\n\nexport type WmSpinnerStyles = BaseStyles & {\n icon: WmIconStyles\n image: WmPictureStyles\n lottie: AllStyle\n};\n\nexport const DEFAULT_CLASS = 'app-spinner';\nBASE_THEME.registerStyle((themeVariables, addStyle) => {\n const defaultStyles: WmSpinnerStyles = defineStyles({\n root: {\n flexDirection: 'row',\n justifyContent: 'center',\n alignItems: 'center'\n },\n text: {\n fontSize: 16,\n paddingLeft: 8\n },\n icon: {\n text: {\n fontSize: 48,\n width: 4,\n color: themeVariables.spinnerIconColor\n }\n } as WmIconStyles,\n image: {} as WmPictureStyles,\n lottie: {\n position: 'absolute',\n width: 150,\n height: 150,\n alignSelf: 'center',\n justifyContent: 'center'\n }\n });\n\n addStyle(DEFAULT_CLASS, '', defaultStyles);\n addStyle(DEFAULT_CLASS + '-rtl', '', {\n root : {\n textAlign: 'right'\n },\n text: {\n paddingRight: 8\n }\n });\n});\n"],"mappings":"AAAA,SAAqBA,YAAY,QAAQ,+CAA+C;AACxF,OAAOC,UAAU,MAAiC,wCAAwC;AAU1F,OAAO,MAAMC,aAAa,GAAG,aAAa;AAC1CD,UAAU,CAACE,aAAa,CAAC,CAACC,cAAc,EAAEC,QAAQ,KAAK;EACrD,MAAMC,aAA8B,GAAGN,YAAY,CAAC;IAClDO,IAAI,EAAE;MACJC,aAAa,EAAE,KAAK;MACpBC,cAAc,EAAE,QAAQ;MACxBC,UAAU,EAAE;IACd,CAAC;IACDC,IAAI,EAAE;MACJC,QAAQ,EAAE,EAAE;MACZC,WAAW,EAAE;IACf,CAAC;IACDC,IAAI,EAAE;MACJH,IAAI,EAAE;QACJC,QAAQ,EAAE,EAAE;QACZG,KAAK,EAAE,CAAC;QACRC,KAAK,EAAEZ,cAAc,CAACa;MACxB;IACF,CAAiB;IACjBC,KAAK,EAAE,CAAC,CAAoB;IAC5BC,MAAM,EAAE;MACNC,QAAQ,EAAE,UAAU;MACpBL,KAAK,EAAE,GAAG;MACVM,MAAM,EAAE,GAAG;MACXC,SAAS,EAAE,QAAQ;MACnBb,cAAc,EAAE;IAClB;EACF,CAAC,CAAC;EAEFJ,QAAQ,CAACH,aAAa,EAAE,EAAE,EAAEI,aAAa,CAAC;EAC1CD,QAAQ,CAACH,aAAa,GAAG,MAAM,EAAE,EAAE,EAAE;IACnCK,IAAI,EAAG;MACLgB,SAAS,EAAE;IACb,CAAC;IACDZ,IAAI,EAAE;MACJa,YAAY,EAAE;IAChB;EACF,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["React","View","ResizeMode","Video","BaseComponent","BaseComponentState","WmVideoProps","DEFAULT_CLASS","AccessibilityWidgetType","getAccessibilityProps","isFullPathUrl","WmVideoState","WmVideo","constructor","props","_defineProperty","status","console","log","isPlaying","error","getSource","path","resource","loadAsset","uri","renderWidget","createElement","style","styles","root","_background","_extends","VIDEO","ref","video","width","height","flex","shouldPlay","autoplay","onPlaybackStatusUpdate","handlePlaybackStatus","source","mp4format","webmformat","posterSource","videoposter","useNativeControls","controls","resizeMode","CONTAIN","isLooping","loop","isMuted","muted","testID","getTestId"],"sources":["video.component.tsx"],"sourcesContent":["import React from 'react';\nimport { Text, View } from 'react-native';\nimport { ResizeMode, Video, AVPlaybackStatus } from 'expo-av';\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\n\nimport WmVideoProps from './video.props';\nimport { DEFAULT_CLASS, WmVideoStyles } from './video.styles';\nimport { isString } from 'lodash-es';\nimport { AccessibilityWidgetType, getAccessibilityProps } from '@wavemaker/app-rn-runtime/core/accessibility'; \nimport { isFullPathUrl } from '@wavemaker/app-rn-runtime/core/utils';\n\nexport class WmVideoState extends BaseComponentState<WmVideoProps> {}\n\nexport default class WmVideo extends BaseComponent<WmVideoProps, WmVideoState, WmVideoStyles> {\n\n private video: Video | null = null as any;\n\n constructor(props: WmVideoProps) {\n super(props, DEFAULT_CLASS, new WmVideoProps(), new WmVideoState());\n }\n\n getSource(path: string) {\n if (!path) {\n return null;\n }\n const resource = this.loadAsset(path);\n if (isFullPathUrl(resource as string)) {\n return {\n uri: resource\n };\n }\n return resource;\n }\n\n handlePlaybackStatus = (status: AVPlaybackStatus) => {\n if ('isPlaying' in status && typeof status === 'object') {\n console.log(status.isPlaying? 'Playing' : 'Paused');\n } else if ('error' in status) {\n console.error(`Encountered a fatal error during playback: ${status.error}`);\n }\n };\n\n renderWidget(props: WmVideoProps) {\n return (\n <View style={this.styles.root}>\n {this._background}\n <Video\n {...getAccessibilityProps(AccessibilityWidgetType.VIDEO, props)}\n ref={(video) => { this.video = video; }}\n style={{ width: '100%', height: '100%', flex: 1 }}\n shouldPlay={props.autoplay}\n onPlaybackStatusUpdate={this.handlePlaybackStatus}\n source={this.getSource(\n props.mp4format\n || props.webmformat) as any}\n posterSource={ this.getSource(props.videoposter) as any }\n useNativeControls={props.controls}\n resizeMode={ResizeMode.CONTAIN}\n isLooping={props.loop}\n isMuted={props.muted}\n testID={this.getTestId('video')}\n />\n </View>); \n }\n}\n"],"mappings":";;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAAeC,IAAI,QAAQ,cAAc;AACzC,SAASC,UAAU,EAAEC,KAAK,QAA0B,SAAS;AAC7D,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,+CAA+C;AAEjG,OAAOC,YAAY,MAAM,eAAe;AACxC,SAASC,aAAa,QAAuB,gBAAgB;AAE7D,SAASC,uBAAuB,EAAEC,qBAAqB,QAAQ,8CAA8C;AAC7G,SAASC,aAAa,QAAQ,sCAAsC;AAEpE,OAAO,MAAMC,YAAY,SAASN,kBAAkB,CAAe;AAEnE,eAAe,MAAMO,OAAO,SAASR,aAAa,CAA4C;EAI5FS,WAAWA,CAACC,KAAmB,EAAE;IAC/B,KAAK,CAACA,KAAK,EAAEP,aAAa,EAAE,IAAID,YAAY,CAAC,CAAC,EAAE,IAAIK,YAAY,CAAC,CAAC,CAAC;IAACI,eAAA,gBAHxC,IAAI;IAAAA,eAAA,+BAmBTC,MAAwB,IAAK;MACpD,IAAI,WAAW,IAAIA,MAAM,IAAI,OAAOA,MAAM,KAAK,QAAQ,EAAE;QACvDC,OAAO,CAACC,GAAG,CAACF,MAAM,CAACG,SAAS,GAAE,SAAS,GAAG,QAAQ,CAAC;MACrD,CAAC,MAAM,IAAI,OAAO,IAAIH,MAAM,EAAE;QAC5BC,OAAO,CAACG,KAAK,CAAE,8CAA6CJ,MAAM,CAACI,KAAM,EAAC,CAAC;MAC7E;IACF,CAAC;EArBD;EAEAC,SAASA,CAACC,IAAY,EAAE;IACtB,IAAI,CAACA,IAAI,EAAE;MACT,OAAO,IAAI;IACb;IACA,MAAMC,QAAQ,GAAG,IAAI,CAACC,SAAS,CAACF,IAAI,CAAC;IACrC,IAAIZ,aAAa,CAACa,QAAkB,CAAC,EAAE;MACrC,OAAO;QACLE,GAAG,EAAEF;MACP,CAAC;IACH;IACA,OAAOA,QAAQ;EACjB;EAUAG,YAAYA,CAACZ,KAAmB,EAAE;IAChC,oBACEd,KAAA,CAAA2B,aAAA,CAAC1B,IAAI;MAAC2B,KAAK,EAAE,IAAI,CAACC,MAAM,CAACC;IAAK,GAC3B,IAAI,CAACC,WAAW,eACjB/B,KAAA,CAAA2B,aAAA,CAACxB,KAAK,EAAA6B,QAAA,KACAvB,qBAAqB,CAACD,uBAAuB,CAACyB,KAAK,EAAEnB,KAAK,CAAC;MAC/DoB,GAAG,EAAGC,KAAK,IAAK;QAAE,IAAI,CAACA,KAAK,GAAGA,KAAK;MAAE,CAAE;MACxCP,KAAK,EAAE;QAAEQ,KAAK,EAAE,MAAM;QAAEC,MAAM,EAAE,MAAM;QAAEC,IAAI,EAAE;MAAE,CAAE;MAClDC,UAAU,EAAEzB,KAAK,CAAC0B,QAAS;MAC3BC,sBAAsB,EAAE,IAAI,CAACC,oBAAqB;MAClDC,MAAM,EAAE,IAAI,CAACtB,SAAS,CACpBP,KAAK,CAAC8B,SAAS,IACZ9B,KAAK,CAAC+B,UAAU,CAAS;MAC9BC,YAAY,EAAG,IAAI,CAACzB,SAAS,CAACP,KAAK,CAACiC,WAAW,CAAU;MACzDC,iBAAiB,EAAElC,KAAK,CAACmC,QAAS;MAClCC,UAAU,EAAEhD,UAAU,CAACiD,OAAQ;MAC/BC,SAAS,EAAEtC,KAAK,CAACuC,IAAK;MACtBC,OAAO,EAAExC,KAAK,CAACyC,KAAM;MACrBC,MAAM,EAAE,IAAI,CAACC,SAAS,CAAC,OAAO;IAAE,EACjC,CACG,CAAC;EACX;AACF","ignoreList":[]}
1
+ {"version":3,"names":["React","View","ResizeMode","Video","BaseComponent","BaseComponentState","WmVideoProps","DEFAULT_CLASS","AccessibilityWidgetType","getAccessibilityProps","isFullPathUrl","WmVideoState","WmVideo","constructor","props","_defineProperty","status","console","log","isPlaying","error","getSource","path","resource","loadAsset","uri","renderWidget","createElement","style","styles","root","_background","_extends","VIDEO","ref","video","width","height","flex","shouldPlay","autoplay","onPlaybackStatusUpdate","handlePlaybackStatus","source","mp4format","webmformat","posterSource","videoposter","useNativeControls","controls","resizeMode","CONTAIN","isLooping","loop","isMuted","muted","testID","getTestId"],"sources":["video.component.tsx"],"sourcesContent":["import React from 'react';\nimport { Text, View } from 'react-native';\nimport { ResizeMode, Video, AVPlaybackStatus } from 'expo-av';\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\n\nimport WmVideoProps from './video.props';\nimport { DEFAULT_CLASS, WmVideoStyles } from './video.styles';\nimport { isString } from 'lodash-es';\nimport { AccessibilityWidgetType, getAccessibilityProps } from '@wavemaker/app-rn-runtime/core/accessibility'; \nimport { isFullPathUrl } from '@wavemaker/app-rn-runtime/core/utils';\n\nexport class WmVideoState extends BaseComponentState<WmVideoProps> {}\n\nexport default class WmVideo extends BaseComponent<WmVideoProps, WmVideoState, WmVideoStyles> {\n\n private video: Video | null = null as any;\n\n constructor(props: WmVideoProps) {\n super(props, DEFAULT_CLASS, new WmVideoProps(), new WmVideoState());\n }\n\n getSource(path: string) {\n if (!path) {\n return null;\n }\n const resource = this.loadAsset(path);\n if (isFullPathUrl(resource as string)) {\n return {\n uri: resource\n };\n }\n return resource;\n }\n\n handlePlaybackStatus = (status: AVPlaybackStatus) => {\n if ('isPlaying' in status && typeof status === 'object') {\n console.log(status.isPlaying? 'Playing' : 'Paused');\n } else if ('error' in status) {\n console.error(`Encountered a fatal error during playback: ${status.error}`);\n }\n };\n\n renderWidget(props: WmVideoProps) {\n return (\n <View style={this.styles.root}>\n {this._background}\n <Video\n {...getAccessibilityProps(AccessibilityWidgetType.VIDEO, props)}\n ref={(video) => { this.video = video; }}\n style={{ width: '100%', height: '100%', flex: 1 }}\n shouldPlay={props.autoplay}\n onPlaybackStatusUpdate={this.handlePlaybackStatus}\n source={this.getSource(\n props.mp4format\n || props.webmformat) as any}\n posterSource={ this.getSource(props.videoposter) as any }\n useNativeControls={props.controls}\n resizeMode={ResizeMode.CONTAIN}\n isLooping={props.loop}\n isMuted={props.muted}\n testID={this.getTestId('video')}\n />\n </View>); \n }\n}\n"],"mappings":";;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAAeC,IAAI,QAAQ,cAAc;AACzC,SAASC,UAAU,EAAEC,KAAK,QAA0B,SAAS;AAC7D,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,+CAA+C;AAEjG,OAAOC,YAAY,MAAM,eAAe;AACxC,SAASC,aAAa,QAAuB,gBAAgB;AAE7D,SAASC,uBAAuB,EAAEC,qBAAqB,QAAQ,8CAA8C;AAC7G,SAASC,aAAa,QAAQ,sCAAsC;AAEpE,OAAO,MAAMC,YAAY,SAASN,kBAAkB,CAAe;AAEnE,eAAe,MAAMO,OAAO,SAASR,aAAa,CAA4C;EAI5FS,WAAWA,CAACC,KAAmB,EAAE;IAC/B,KAAK,CAACA,KAAK,EAAEP,aAAa,EAAE,IAAID,YAAY,CAAC,CAAC,EAAE,IAAIK,YAAY,CAAC,CAAC,CAAC;IAACI,eAAA,gBAHxC,IAAI;IAAAA,eAAA,+BAmBTC,MAAwB,IAAK;MACpD,IAAI,WAAW,IAAIA,MAAM,IAAI,OAAOA,MAAM,KAAK,QAAQ,EAAE;QACvDC,OAAO,CAACC,GAAG,CAACF,MAAM,CAACG,SAAS,GAAE,SAAS,GAAG,QAAQ,CAAC;MACrD,CAAC,MAAM,IAAI,OAAO,IAAIH,MAAM,EAAE;QAC5BC,OAAO,CAACG,KAAK,CAAC,8CAA8CJ,MAAM,CAACI,KAAK,EAAE,CAAC;MAC7E;IACF,CAAC;EArBD;EAEAC,SAASA,CAACC,IAAY,EAAE;IACtB,IAAI,CAACA,IAAI,EAAE;MACT,OAAO,IAAI;IACb;IACA,MAAMC,QAAQ,GAAG,IAAI,CAACC,SAAS,CAACF,IAAI,CAAC;IACrC,IAAIZ,aAAa,CAACa,QAAkB,CAAC,EAAE;MACrC,OAAO;QACLE,GAAG,EAAEF;MACP,CAAC;IACH;IACA,OAAOA,QAAQ;EACjB;EAUAG,YAAYA,CAACZ,KAAmB,EAAE;IAChC,oBACEd,KAAA,CAAA2B,aAAA,CAAC1B,IAAI;MAAC2B,KAAK,EAAE,IAAI,CAACC,MAAM,CAACC;IAAK,GAC3B,IAAI,CAACC,WAAW,eACjB/B,KAAA,CAAA2B,aAAA,CAACxB,KAAK,EAAA6B,QAAA,KACAvB,qBAAqB,CAACD,uBAAuB,CAACyB,KAAK,EAAEnB,KAAK,CAAC;MAC/DoB,GAAG,EAAGC,KAAK,IAAK;QAAE,IAAI,CAACA,KAAK,GAAGA,KAAK;MAAE,CAAE;MACxCP,KAAK,EAAE;QAAEQ,KAAK,EAAE,MAAM;QAAEC,MAAM,EAAE,MAAM;QAAEC,IAAI,EAAE;MAAE,CAAE;MAClDC,UAAU,EAAEzB,KAAK,CAAC0B,QAAS;MAC3BC,sBAAsB,EAAE,IAAI,CAACC,oBAAqB;MAClDC,MAAM,EAAE,IAAI,CAACtB,SAAS,CACpBP,KAAK,CAAC8B,SAAS,IACZ9B,KAAK,CAAC+B,UAAU,CAAS;MAC9BC,YAAY,EAAG,IAAI,CAACzB,SAAS,CAACP,KAAK,CAACiC,WAAW,CAAU;MACzDC,iBAAiB,EAAElC,KAAK,CAACmC,QAAS;MAClCC,UAAU,EAAEhD,UAAU,CAACiD,OAAQ;MAC/BC,SAAS,EAAEtC,KAAK,CAACuC,IAAK;MACtBC,OAAO,EAAExC,KAAK,CAACyC,KAAM;MACrBC,MAAM,EAAE,IAAI,CAACC,SAAS,CAAC,OAAO;IAAE,EACjC,CACG,CAAC;EACX;AACF","ignoreList":[]}
@@ -3,7 +3,10 @@ import { defineStyles } from '@wavemaker/app-rn-runtime/core/base.component';
3
3
  export const DEFAULT_CLASS = 'app-video';
4
4
  BASE_THEME.registerStyle((themeVariables, addStyle) => {
5
5
  const defaultStyles = defineStyles({
6
- root: {},
6
+ root: {
7
+ height: 300,
8
+ width: "100%"
9
+ },
7
10
  text: {}
8
11
  });
9
12
  addStyle(DEFAULT_CLASS, '', defaultStyles);
@@ -1 +1 @@
1
- {"version":3,"names":["BASE_THEME","defineStyles","DEFAULT_CLASS","registerStyle","themeVariables","addStyle","defaultStyles","root","text"],"sources":["video.styles.ts"],"sourcesContent":["import BASE_THEME from '@wavemaker/app-rn-runtime/styles/theme';\nimport { BaseStyles, defineStyles } from '@wavemaker/app-rn-runtime/core/base.component';\n\nexport type WmVideoStyles = BaseStyles & {};\n\nexport const DEFAULT_CLASS = 'app-video';\nBASE_THEME.registerStyle((themeVariables, addStyle) => {\n const defaultStyles = defineStyles<WmVideoStyles>({\n root: {},\n text: {}\n });\n addStyle(DEFAULT_CLASS, '', defaultStyles);\n});"],"mappings":"AAAA,OAAOA,UAAU,MAAM,wCAAwC;AAC/D,SAAqBC,YAAY,QAAQ,+CAA+C;AAIxF,OAAO,MAAMC,aAAa,GAAG,WAAW;AACxCF,UAAU,CAACG,aAAa,CAAC,CAACC,cAAc,EAAEC,QAAQ,KAAK;EACnD,MAAMC,aAAa,GAAGL,YAAY,CAAgB;IAC9CM,IAAI,EAAE,CAAC,CAAC;IACRC,IAAI,EAAE,CAAC;EACX,CAAC,CAAC;EACFH,QAAQ,CAACH,aAAa,EAAE,EAAE,EAAEI,aAAa,CAAC;AAC9C,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["BASE_THEME","defineStyles","DEFAULT_CLASS","registerStyle","themeVariables","addStyle","defaultStyles","root","height","width","text"],"sources":["video.styles.ts"],"sourcesContent":["import BASE_THEME from '@wavemaker/app-rn-runtime/styles/theme';\nimport { BaseStyles, defineStyles } from '@wavemaker/app-rn-runtime/core/base.component';\n\nexport type WmVideoStyles = BaseStyles & {};\n\nexport const DEFAULT_CLASS = 'app-video';\nBASE_THEME.registerStyle((themeVariables, addStyle) => {\n const defaultStyles = defineStyles<WmVideoStyles>({\n root: {\n height: 300,\n width : \"100%\"\n },\n text: {}\n });\n addStyle(DEFAULT_CLASS, '', defaultStyles);\n});"],"mappings":"AAAA,OAAOA,UAAU,MAAM,wCAAwC;AAC/D,SAAqBC,YAAY,QAAQ,+CAA+C;AAIxF,OAAO,MAAMC,aAAa,GAAG,WAAW;AACxCF,UAAU,CAACG,aAAa,CAAC,CAACC,cAAc,EAAEC,QAAQ,KAAK;EACnD,MAAMC,aAAa,GAAGL,YAAY,CAAgB;IAC9CM,IAAI,EAAE;MACFC,MAAM,EAAE,GAAG;MACXC,KAAK,EAAG;IACZ,CAAC;IACDC,IAAI,EAAE,CAAC;EACX,CAAC,CAAC;EACFL,QAAQ,CAACH,aAAa,EAAE,EAAE,EAAEI,aAAa,CAAC;AAC9C,CAAC,CAAC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["React","Color","View","Text","Platform","Defs","LinearGradient","Stop","VictoryArea","VictoryChart","VictoryStack","VictoryScatter","VictoryGroup","WmAreaChartProps","DEFAULT_CLASS","BaseChartComponent","BaseChartComponentState","WmIcon","isNumber","AccessibilityWidgetType","getAccessibilityProps","WmAreaChartState","constructor","args","_defineProperty","WmAreaChart","props","e","viewWidth","nativeEvent","layout","width","updateState","chartWidth","onSelect","event","data","value","index","y","label","state","xaxisDatakeyArr","datum","x","selectedItem","dataset","setTooltipPosition","selectedChartItem","series","_dataObj","tooltipXaxis","tooltipYaxis","isTooltipOpen","invokeEventCallback","proxy","renderWidget","_this$state$data","_this$props$name","length","mindomain","xdomain","chartMinX","undefined","ydomain","chartMinY","chartName","name","gradientStop","chartMaxY","createElement","_extends","LINECHART","style","styles","root","onLayout","onViewLayoutChange","bind","getTooltip","flexDirection","alignItems","iconclass","icon","title","subHeading","subheading","theme","height","padding","top","offsettop","bottom","offsetbottom","left","offsetleft","right","offsetright","minDomain","getLegendView","getXaxis","getYAxis","map","d","i","key","id","x1","y1","x2","y2","offset","stopColor","colors","lighten","rgb","toString","interpolation","fill","stroke","strokeWidth","linethickness","isRTL","toReversed","size","highlightpoints","opacity","events","target","eventHandlers","OS","onClick","onPress"],"sources":["area-chart.component.tsx"],"sourcesContent":["import React from 'react';\nimport Color from \"color\";\nimport { LayoutChangeEvent, View, Text, Platform } from 'react-native';\nimport { Defs, LinearGradient, Stop, Svg } from 'react-native-svg';\nimport { VictoryArea, VictoryLine, VictoryChart, VictoryLegend, VictoryStack, VictoryScatter, VictoryGroup } from \"victory-native\";\nimport { InterpolationPropType } from 'victory-core';\nimport WmAreaChartProps from './area-chart.props';\nimport { DEFAULT_CLASS, WmAreaChartStyles } from './area-chart.styles';\nimport {\n BaseChartComponent,\n BaseChartComponentState\n} from \"@wavemaker/app-rn-runtime/components/chart/basechart.component\";\nimport WmIcon from \"@wavemaker/app-rn-runtime/components/basic/icon/icon.component\";\n\nimport ThemeVariables from '@wavemaker/app-rn-runtime/styles/theme.variables';\nimport { isNil, isNumber } from 'lodash-es';\nimport { AccessibilityWidgetType, getAccessibilityProps } from '@wavemaker/app-rn-runtime/core/accessibility'; \n\nexport class WmAreaChartState extends BaseChartComponentState<WmAreaChartProps> {\n chartWidth = 0;\n}\n\nexport default class WmAreaChart extends BaseChartComponent<WmAreaChartProps, WmAreaChartState, WmAreaChartStyles> {\n\n constructor(props: WmAreaChartProps) {\n super(props, DEFAULT_CLASS, new WmAreaChartProps(), new WmAreaChartState());\n }\n\n onViewLayoutChange = (e: LayoutChangeEvent) => {\n let viewWidth = e.nativeEvent.layout.width;\n this.updateState({\n chartWidth: viewWidth\n } as WmAreaChartState)\n }\n\n onSelect(event: any, data: any){\n let value = data.data[data.index].y;\n let label = this.state.xaxisDatakeyArr[data.datum.x];\n let selectedItem = this.props.dataset[data.index];\n const nativeEvent = event.nativeEvent;\n this.setTooltipPosition(nativeEvent);\n let selectedChartItem = [{series: 0, x: data.index, y: value,_dataObj: selectedItem},data.index];\n this.updateState({\n tooltipXaxis: label,\n tooltipYaxis: value,\n isTooltipOpen: true,\n selectedItem: {...selectedItem, index: data.index},\n } as WmAreaChartState)\n this.invokeEventCallback('onSelect', [event.nativeEvent, this.proxy, selectedItem, selectedChartItem ]);\n }\n\n renderWidget(props: WmAreaChartProps) {\n this.invokeEventCallback('onBeforerender', [this.proxy, null]);\n if (!this.state.data?.length) {\n return null;\n }\n let mindomain={\n x: props.xdomain === 'Min' ? this.state.chartMinX: undefined,\n y: props.ydomain === 'Min' ? this.state.chartMinY: undefined\n };\n const chartName = this.props.name ?? 'nonameAreachart';\n let gradientStop = '100%';\n if (isNumber(this.state.chartMaxY) && isNumber(this.state.chartMinY) && this.state.chartMaxY > 0) {\n gradientStop = (this.state.chartMaxY - this.state.chartMinY) * 100 / this.state.chartMaxY + '%';\n }\n return (\n <View\n {...getAccessibilityProps(AccessibilityWidgetType.LINECHART, props)}\n style={this.styles.root}\n onLayout={this.onViewLayoutChange.bind(this)}\n >\n {this.getTooltip()}\n <View>\n <View style={{flexDirection: 'row', alignItems: 'center'}}>\n {props.iconclass ? (<WmIcon iconclass={props.iconclass} styles={this.styles.icon}></WmIcon>) : null }\n <Text style={this.styles.title}>{props.title}</Text>\n </View>\n <Text style={this.styles.subHeading}>{props.subheading}</Text>\n </View>\n {this.state.chartWidth ? \n (\n <VictoryChart\n theme={this.state.theme}\n height={this.styles.root.height as number}\n width={this.state.chartWidth || 120}\n padding={{ top: props.offsettop, bottom: props.offsetbottom, left: props.offsetleft, right: props.offsetright }}\n minDomain={mindomain}\n > \n {this.getLegendView()}\n {this.getXaxis()}\n {this.getYAxis()}\n <VictoryStack>\n {\n this.state.data.map((d: any, i: number) => {\n return <VictoryGroup key={props.name + '_area_group_' + i}>\n <Defs>\n <LinearGradient id={`${chartName}Gradient${i}`} x1=\"0%\" y1=\"0%\" x2=\"0%\" y2=\"100%\">\n <Stop offset=\"0%\" stopColor={Color(this.state.colors[i]).lighten(0.2).rgb().toString()}/>\n <Stop offset={gradientStop} stopColor={Color(this.state.colors[i]).lighten(0.6).rgb().toString()}/>\n </LinearGradient>\n </Defs>\n <VictoryArea\n interpolation={props.interpolation as InterpolationPropType}\n key={props.name + '_' + i}\n name={props.name + '_' + i}\n style={{\n data: {\n fill: `url(#${chartName}Gradient${i})`,\n stroke: this.state.colors[i],\n strokeWidth: props.linethickness,\n }\n }}\n data={this.isRTL?d.toReversed():d}\n />\n <VictoryScatter\n size={5}\n key={props.name + '_scatter' + i}\n style={{\n data: props.highlightpoints ? {fill: this.state.colors[i], opacity: 0.8}:{opacity: 0}\n }} \n data={this.isRTL?d.toReversed():d}\n events={[{\n target: 'data',\n eventHandlers: Platform.OS == \"web\" ? {\n onClick: this.onSelect.bind(this)\n }:{\n onPress: this.onSelect.bind(this)\n }\n }]}\n />\n </VictoryGroup>\n })\n }\n </VictoryStack>\n </VictoryChart>\n )\n : null}\n </View>);\n }\n}\n"],"mappings":";;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,KAAK,MAAM,OAAO;AACzB,SAA4BC,IAAI,EAAEC,IAAI,EAAEC,QAAQ,QAAQ,cAAc;AACtE,SAASC,IAAI,EAAEC,cAAc,EAAEC,IAAI,QAAa,kBAAkB;AAClE,SAASC,WAAW,EAAeC,YAAY,EAAiBC,YAAY,EAAEC,cAAc,EAAEC,YAAY,QAAQ,gBAAgB;AAElI,OAAOC,gBAAgB,MAAM,oBAAoB;AACjD,SAASC,aAAa,QAA2B,qBAAqB;AACtE,SACEC,kBAAkB,EAClBC,uBAAuB,QAClB,gEAAgE;AACvE,OAAOC,MAAM,MAAM,gEAAgE;AAGnF,SAAgBC,QAAQ,QAAQ,WAAW;AAC3C,SAASC,uBAAuB,EAAEC,qBAAqB,QAAQ,8CAA8C;AAE7G,OAAO,MAAMC,gBAAgB,SAASL,uBAAuB,CAAmB;EAAAM,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAC,eAAA,qBACjE,CAAC;EAAA;AAChB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EW,CACF,CAAC,GAEjB,IACE,CAAC;EACT;AACF","ignoreList":[]}
1
+ {"version":3,"names":["React","Color","View","Text","Platform","Defs","LinearGradient","Stop","VictoryArea","VictoryChart","VictoryStack","VictoryScatter","VictoryGroup","WmAreaChartProps","DEFAULT_CLASS","BaseChartComponent","BaseChartComponentState","WmIcon","isNumber","AccessibilityWidgetType","getAccessibilityProps","WmAreaChartState","constructor","args","_defineProperty","WmAreaChart","props","e","viewWidth","nativeEvent","layout","width","updateState","chartWidth","onSelect","event","data","value","index","y","label","state","xaxisDatakeyArr","datum","x","selectedItem","dataset","setTooltipPosition","selectedChartItem","series","_dataObj","tooltipXaxis","tooltipYaxis","isTooltipOpen","invokeEventCallback","proxy","renderWidget","_this$state$data","_this$props$name","length","mindomain","xdomain","chartMinX","undefined","ydomain","chartMinY","chartName","name","gradientStop","chartMaxY","createElement","_extends","LINECHART","style","styles","root","onLayout","onViewLayoutChange","bind","getTooltip","flexDirection","alignItems","iconclass","icon","title","subHeading","subheading","theme","height","padding","top","offsettop","bottom","offsetbottom","left","offsetleft","right","offsetright","minDomain","getLegendView","getXaxis","getYAxis","map","d","i","key","id","x1","y1","x2","y2","offset","stopColor","colors","lighten","rgb","toString","interpolation","fill","stroke","strokeWidth","linethickness","isRTL","toReversed","size","highlightpoints","opacity","events","target","eventHandlers","OS","onClick","onPress"],"sources":["area-chart.component.tsx"],"sourcesContent":["import React from 'react';\nimport Color from \"color\";\nimport { LayoutChangeEvent, View, Text, Platform } from 'react-native';\nimport { Defs, LinearGradient, Stop, Svg } from 'react-native-svg';\nimport { VictoryArea, VictoryLine, VictoryChart, VictoryLegend, VictoryStack, VictoryScatter, VictoryGroup } from \"victory-native\";\nimport { InterpolationPropType } from 'victory-core';\nimport WmAreaChartProps from './area-chart.props';\nimport { DEFAULT_CLASS, WmAreaChartStyles } from './area-chart.styles';\nimport {\n BaseChartComponent,\n BaseChartComponentState\n} from \"@wavemaker/app-rn-runtime/components/chart/basechart.component\";\nimport WmIcon from \"@wavemaker/app-rn-runtime/components/basic/icon/icon.component\";\n\nimport ThemeVariables from '@wavemaker/app-rn-runtime/styles/theme.variables';\nimport { isNil, isNumber } from 'lodash-es';\nimport { AccessibilityWidgetType, getAccessibilityProps } from '@wavemaker/app-rn-runtime/core/accessibility'; \n\nexport class WmAreaChartState extends BaseChartComponentState<WmAreaChartProps> {\n chartWidth = 0;\n}\n\nexport default class WmAreaChart extends BaseChartComponent<WmAreaChartProps, WmAreaChartState, WmAreaChartStyles> {\n\n constructor(props: WmAreaChartProps) {\n super(props, DEFAULT_CLASS, new WmAreaChartProps(), new WmAreaChartState());\n }\n\n onViewLayoutChange = (e: LayoutChangeEvent) => {\n let viewWidth = e.nativeEvent.layout.width;\n this.updateState({\n chartWidth: viewWidth\n } as WmAreaChartState)\n }\n\n onSelect(event: any, data: any){\n let value = data.data[data.index].y;\n let label = this.state.xaxisDatakeyArr[data.datum.x];\n let selectedItem = this.props.dataset[data.index];\n const nativeEvent = event.nativeEvent;\n this.setTooltipPosition(nativeEvent);\n let selectedChartItem = [{series: 0, x: data.index, y: value,_dataObj: selectedItem},data.index];\n this.updateState({\n tooltipXaxis: label,\n tooltipYaxis: value,\n isTooltipOpen: true,\n selectedItem: {...selectedItem, index: data.index},\n } as WmAreaChartState)\n this.invokeEventCallback('onSelect', [event.nativeEvent, this.proxy, selectedItem, selectedChartItem ]);\n }\n\n renderWidget(props: WmAreaChartProps) {\n this.invokeEventCallback('onBeforerender', [this.proxy, null]);\n if (!this.state.data?.length) {\n return null;\n }\n let mindomain={\n x: props.xdomain === 'Min' ? this.state.chartMinX: undefined,\n y: props.ydomain === 'Min' ? this.state.chartMinY: undefined\n };\n const chartName = this.props.name ?? 'nonameAreachart';\n let gradientStop = '100%';\n if (isNumber(this.state.chartMaxY) && isNumber(this.state.chartMinY) && this.state.chartMaxY > 0) {\n gradientStop = (this.state.chartMaxY - this.state.chartMinY) * 100 / this.state.chartMaxY + '%';\n }\n return (\n <View\n {...getAccessibilityProps(AccessibilityWidgetType.LINECHART, props)}\n style={this.styles.root}\n onLayout={this.onViewLayoutChange.bind(this)}\n >\n {this.getTooltip()}\n <View>\n <View style={{flexDirection: 'row', alignItems: 'center'}}>\n {props.iconclass ? (<WmIcon iconclass={props.iconclass} styles={this.styles.icon}></WmIcon>) : null }\n <Text style={this.styles.title}>{props.title}</Text>\n </View>\n <Text style={this.styles.subHeading}>{props.subheading}</Text>\n </View>\n {this.state.chartWidth ? \n (\n <VictoryChart\n theme={this.state.theme}\n height={this.styles.root.height as number}\n width={this.state.chartWidth || 120}\n padding={{ top: props.offsettop, bottom: props.offsetbottom, left: props.offsetleft, right: props.offsetright }}\n minDomain={mindomain}\n > \n {this.getLegendView()}\n {this.getXaxis()}\n {this.getYAxis()}\n <VictoryStack>\n {\n this.state.data.map((d: any, i: number) => {\n return <VictoryGroup key={props.name + '_area_group_' + i}>\n <Defs>\n <LinearGradient id={`${chartName}Gradient${i}`} x1=\"0%\" y1=\"0%\" x2=\"0%\" y2=\"100%\">\n <Stop offset=\"0%\" stopColor={Color(this.state.colors[i]).lighten(0.2).rgb().toString()}/>\n <Stop offset={gradientStop} stopColor={Color(this.state.colors[i]).lighten(0.6).rgb().toString()}/>\n </LinearGradient>\n </Defs>\n <VictoryArea\n interpolation={props.interpolation as InterpolationPropType}\n key={props.name + '_' + i}\n name={props.name + '_' + i}\n style={{\n data: {\n fill: `url(#${chartName}Gradient${i})`,\n stroke: this.state.colors[i],\n strokeWidth: props.linethickness,\n }\n }}\n data={this.isRTL?d.toReversed():d}\n />\n <VictoryScatter\n size={5}\n key={props.name + '_scatter' + i}\n style={{\n data: props.highlightpoints ? {fill: this.state.colors[i], opacity: 0.8}:{opacity: 0}\n }} \n data={this.isRTL?d.toReversed():d}\n events={[{\n target: 'data',\n eventHandlers: Platform.OS == \"web\" ? {\n onClick: this.onSelect.bind(this)\n }:{\n onPress: this.onSelect.bind(this)\n }\n }]}\n />\n </VictoryGroup>\n })\n }\n </VictoryStack>\n </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I,EAAE,CAAE;QACRnB,GAAG,EAAE/E,KAAK,CAACyC,IAAI,GAAG,UAAU,GAAGqC,CAAE;QACjC/B,KAAK,EAAE;UACLrC,IAAI,EAAEV,KAAK,CAACmG,eAAe,GAAG;YAACP,IAAI,EAAE,IAAI,CAAC7E,KAAK,CAACwE,MAAM,CAACT,CAAC,CAAC;YAAEsB,OAAO,EAAE;UAAG,CAAC,GAAC;YAACA,OAAO,EAAE;UAAC;QACtF,CAAE;QACF1F,IAAI,EAAE,IAAI,CAACsF,KAAK,GAACnB,CAAC,CAACoB,UAAU,CAAC,CAAC,GAACpB,CAAE;QAClCwB,MAAM,EAAE,CAAC;UACPC,MAAM,EAAE,MAAM;UACdC,aAAa,EAAE7H,QAAQ,CAAC8H,EAAE,IAAI,KAAK,GAAG;YACpCC,OAAO,EAAE,IAAI,CAACjG,QAAQ,CAAC4C,IAAI,CAAC,IAAI;UAClC,CAAC,GAAC;YACAsD,OAAO,EAAE,IAAI,CAAClG,QAAQ,CAAC4C,IAAI,CAAC,IAAI;UAClC;QACF,CAAC;MAAE,CACF,CACO,CAAC;IACjB,CAAC,CAEW,CACF,CAAC,GAEjB,IACE,CAAC;EACT;AACF","ignoreList":[]}
@@ -78,7 +78,7 @@ export class BaseChartComponent extends BaseComponent {
78
78
  onViewLayoutChange(e) {
79
79
  let viewWidth = e.nativeEvent.layout.width;
80
80
  let viewHeight = e.nativeEvent.layout.height;
81
- if (viewWidth !== this.state.chartWidth) {
81
+ if (this !== null && this !== void 0 && this.state && viewWidth !== this.state.chartWidth) {
82
82
  this.updateState({
83
83
  chartWidth: Number(viewWidth),
84
84
  totalHeight: Number(viewHeight)
@@ -136,6 +136,28 @@ export class BaseChartComponent extends BaseComponent {
136
136
  const _min = Math.floor(value);
137
137
  return Math.abs(value) - _min > 0 ? value - .1 : _min - 1;
138
138
  }
139
+ setYAxisFormat(yVal, ynumberformat) {
140
+ const matchFixed = ynumberformat.match(/\.([0-9])f/);
141
+ const matchExponential = ynumberformat.match(/\.([0-9])g/);
142
+ if (matchFixed) {
143
+ return yVal.toFixed(parseInt(matchFixed[1], 10));
144
+ } else if (matchExponential) {
145
+ return yVal.toExponential(parseInt(matchExponential[1], 10));
146
+ }
147
+ switch (ynumberformat) {
148
+ case '%':
149
+ return (yVal * 100).toFixed(0) + '%';
150
+ case 'Billion':
151
+ return (yVal / 1e9).toFixed(1) + 'B';
152
+ case 'Million':
153
+ return (yVal / 1e6).toFixed(1) + 'M';
154
+ case 'Thousand':
155
+ return (yVal / 1e3).toFixed(1) + 'K';
156
+ case ',r':
157
+ return yVal.toLocaleString();
158
+ }
159
+ }
160
+
139
161
  // x axis with vertical lines having grid stroke colors
140
162
  getXaxis() {
141
163
  const minIndex = 0;
@@ -190,6 +212,7 @@ export class BaseChartComponent extends BaseComponent {
190
212
  return null;
191
213
  }
192
214
  const getTickValueLabel = props.ytickexpr;
215
+ const ynumberformat = props.ynumberformat;
193
216
  let xaxislabeldistance = props.xaxislabeldistance ? props.xaxislabeldistance : 20;
194
217
  return /*#__PURE__*/React.createElement(VictoryAxis, {
195
218
  crossAxis: false,
@@ -217,6 +240,9 @@ export class BaseChartComponent extends BaseComponent {
217
240
  if (getTickValueLabel) {
218
241
  return getTickValueLabel(d, i, (ticks || []).length);
219
242
  }
243
+ if (ynumberformat) {
244
+ return this.setYAxisFormat(d, ynumberformat);
245
+ }
220
246
  return this.abbreviateNumber(d);
221
247
  },
222
248
  orientation: this.isRTL ? "right" : "left",
@@ -255,6 +281,8 @@ export class BaseChartComponent extends BaseComponent {
255
281
  });
256
282
  }
257
283
  getTooltip() {
284
+ const ynumberformat = this.state.props.ynumberformat;
285
+ let yAxisData = ynumberformat ? this.setYAxisFormat(this.state.tooltipYaxis, ynumberformat) : this.state.tooltipYaxis;
258
286
  return this.state.isTooltipOpen ? !isEmpty(this.state.template) && this.props.renderitempartial ? /*#__PURE__*/React.createElement(View, {
259
287
  onLayout: this.setTooltipPartialLayout.bind(this),
260
288
  style: {
@@ -276,7 +304,7 @@ export class BaseChartComponent extends BaseComponent {
276
304
  }, this.styles.tooltipXText]
277
305
  }, this.state.tooltipXaxis), /*#__PURE__*/React.createElement(Text, {
278
306
  style: this.styles.tooltipXText
279
- }, this.state.tooltipYaxis), this.renderPointer()) : null;
307
+ }, yAxisData), this.renderPointer()) : null;
280
308
  }
281
309
 
282
310
  // X/Y Domain properties are supported only for Column and Area charts
@@ -554,6 +582,7 @@ export class BaseChartComponent extends BaseComponent {
554
582
  renderLoadingIcon() {
555
583
  const props = this.state.props;
556
584
  return /*#__PURE__*/React.createElement(WmIcon, {
585
+ id: this.getTestId('loadericon'),
557
586
  styles: this.styles.loadingIcon,
558
587
  iconclass: props.loadingicon,
559
588
  caption: props.loadingdatamsg