@wavemaker/app-rn-runtime 11.7.0-next.24863 → 11.7.0-next.26328
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- app-rn-runtime/components/advanced/carousel/carousel.component.js +6 -3
- app-rn-runtime/components/advanced/carousel/carousel.component.js.map +1 -1
- app-rn-runtime/components/advanced/carousel/carousel.styles.js +6 -3
- app-rn-runtime/components/advanced/carousel/carousel.styles.js.map +1 -1
- app-rn-runtime/components/advanced/webview/webview.component.js +6 -3
- app-rn-runtime/components/advanced/webview/webview.component.js.map +1 -1
- app-rn-runtime/components/advanced/webview/webview.props.js +3 -0
- app-rn-runtime/components/advanced/webview/webview.props.js.map +1 -1
- app-rn-runtime/components/basic/anchor/anchor.component.js +23 -7
- app-rn-runtime/components/basic/anchor/anchor.component.js.map +1 -1
- app-rn-runtime/components/basic/anchor/anchor.props.js +8 -0
- app-rn-runtime/components/basic/anchor/anchor.props.js.map +1 -1
- app-rn-runtime/components/basic/anchor/anchor.styles.js +3 -1
- app-rn-runtime/components/basic/anchor/anchor.styles.js.map +1 -1
- app-rn-runtime/components/basic/animatedview.component.js +5 -3
- app-rn-runtime/components/basic/animatedview.component.js.map +1 -1
- app-rn-runtime/components/basic/button/button.component.js +32 -9
- app-rn-runtime/components/basic/button/button.component.js.map +1 -1
- app-rn-runtime/components/basic/button/button.props.js +7 -0
- app-rn-runtime/components/basic/button/button.props.js.map +1 -1
- app-rn-runtime/components/basic/button/button.styles.js +9 -9
- app-rn-runtime/components/basic/button/button.styles.js.map +1 -1
- app-rn-runtime/components/basic/buttongroup/buttongroup.styles.js +8 -5
- app-rn-runtime/components/basic/buttongroup/buttongroup.styles.js.map +1 -1
- app-rn-runtime/components/basic/icon/icon.component.js +64 -12
- app-rn-runtime/components/basic/icon/icon.component.js.map +1 -1
- app-rn-runtime/components/basic/icon/icon.props.js +7 -0
- app-rn-runtime/components/basic/icon/icon.props.js.map +1 -1
- app-rn-runtime/components/basic/label/label.component.js +21 -11
- app-rn-runtime/components/basic/label/label.component.js.map +1 -1
- app-rn-runtime/components/basic/label/label.props.js +4 -0
- app-rn-runtime/components/basic/label/label.props.js.map +1 -1
- app-rn-runtime/components/basic/label/label.styles.js +3 -1
- app-rn-runtime/components/basic/label/label.styles.js.map +1 -1
- app-rn-runtime/components/basic/message/message.component.js +3 -2
- app-rn-runtime/components/basic/message/message.component.js.map +1 -1
- app-rn-runtime/components/basic/message/message.props.js +3 -0
- app-rn-runtime/components/basic/message/message.props.js.map +1 -1
- app-rn-runtime/components/basic/message/message.styles.js +3 -1
- app-rn-runtime/components/basic/message/message.styles.js.map +1 -1
- app-rn-runtime/components/basic/picture/picture.component.js +4 -2
- app-rn-runtime/components/basic/picture/picture.component.js.map +1 -1
- app-rn-runtime/components/basic/picture/picture.props.js +3 -0
- app-rn-runtime/components/basic/picture/picture.props.js.map +1 -1
- app-rn-runtime/components/basic/picture/picture.styles.js +3 -1
- app-rn-runtime/components/basic/picture/picture.styles.js.map +1 -1
- app-rn-runtime/components/basic/progress-bar/progress-bar.component.js +3 -3
- app-rn-runtime/components/basic/progress-bar/progress-bar.component.js.map +1 -1
- app-rn-runtime/components/basic/progress-bar/progress-bar.props.js +2 -0
- app-rn-runtime/components/basic/progress-bar/progress-bar.props.js.map +1 -1
- app-rn-runtime/components/basic/progress-circle/progress-circle.component.js +3 -2
- app-rn-runtime/components/basic/progress-circle/progress-circle.component.js.map +1 -1
- app-rn-runtime/components/basic/progress-circle/progress-circle.props.js +2 -0
- app-rn-runtime/components/basic/progress-circle/progress-circle.props.js.map +1 -1
- app-rn-runtime/components/basic/search/search.component.js +10 -3
- app-rn-runtime/components/basic/search/search.component.js.map +1 -1
- app-rn-runtime/components/basic/search/search.props.js +4 -0
- app-rn-runtime/components/basic/search/search.props.js.map +1 -1
- app-rn-runtime/components/basic/search/search.styles.js +6 -5
- app-rn-runtime/components/basic/search/search.styles.js.map +1 -1
- app-rn-runtime/components/basic/skeleton/skeleton.component.js +0 -1
- app-rn-runtime/components/basic/skeleton/skeleton.component.js.map +1 -1
- app-rn-runtime/components/basic/video/video.component.js +4 -2
- app-rn-runtime/components/basic/video/video.component.js.map +1 -1
- app-rn-runtime/components/basic/video/video.props.js +3 -0
- app-rn-runtime/components/basic/video/video.props.js.map +1 -1
- app-rn-runtime/components/chart/area-chart/area-chart.component.js +32 -22
- app-rn-runtime/components/chart/area-chart/area-chart.component.js.map +1 -1
- app-rn-runtime/components/chart/bar-chart/bar-chart.component.js +22 -15
- app-rn-runtime/components/chart/bar-chart/bar-chart.component.js.map +1 -1
- app-rn-runtime/components/chart/basechart.component.js +15 -1
- app-rn-runtime/components/chart/basechart.component.js.map +1 -1
- app-rn-runtime/components/chart/basechart.props.js +3 -0
- app-rn-runtime/components/chart/basechart.props.js.map +1 -1
- app-rn-runtime/components/chart/basechart.styles.js +2 -1
- app-rn-runtime/components/chart/basechart.styles.js.map +1 -1
- app-rn-runtime/components/chart/bubble-chart/bubble-chart.component.js +4 -2
- app-rn-runtime/components/chart/bubble-chart/bubble-chart.component.js.map +1 -1
- app-rn-runtime/components/chart/line-chart/line-chart.component.js +25 -18
- app-rn-runtime/components/chart/line-chart/line-chart.component.js.map +1 -1
- app-rn-runtime/components/chart/line-chart/line-chart.props.js.map +1 -1
- app-rn-runtime/components/chart/pie-chart/pie-chart.component.js +6 -3
- app-rn-runtime/components/chart/pie-chart/pie-chart.component.js.map +1 -1
- app-rn-runtime/components/chart/stack-chart/stack-chart.component.js +21 -12
- app-rn-runtime/components/chart/stack-chart/stack-chart.component.js.map +1 -1
- app-rn-runtime/components/chart/staticdata.js +215 -0
- app-rn-runtime/components/chart/staticdata.js.map +1 -0
- app-rn-runtime/components/container/container.component.js +1 -10
- app-rn-runtime/components/container/container.component.js.map +1 -1
- app-rn-runtime/components/container/container.props.js +0 -1
- app-rn-runtime/components/container/container.props.js.map +1 -1
- app-rn-runtime/components/container/panel/panel.component.js +6 -2
- app-rn-runtime/components/container/panel/panel.component.js.map +1 -1
- app-rn-runtime/components/container/panel/panel.props.js +4 -0
- app-rn-runtime/components/container/panel/panel.props.js.map +1 -1
- app-rn-runtime/components/container/tabs/tabheader/tabheader.component.js +1 -1
- app-rn-runtime/components/container/tabs/tabheader/tabheader.component.js.map +1 -1
- app-rn-runtime/components/container/tabs/tabheader/tabheader.styles.js +1 -1
- app-rn-runtime/components/container/tabs/tabheader/tabheader.styles.js.map +1 -1
- app-rn-runtime/components/container/tabs/tabpane/tabpane.component.js +14 -1
- app-rn-runtime/components/container/tabs/tabpane/tabpane.component.js.map +1 -1
- app-rn-runtime/components/container/tabs/tabs.component.js +3 -0
- app-rn-runtime/components/container/tabs/tabs.component.js.map +1 -1
- app-rn-runtime/components/container/wizard/wizard.component.js +6 -6
- app-rn-runtime/components/container/wizard/wizard.component.js.map +1 -1
- app-rn-runtime/components/container/wizard/wizard.styles.js +19 -3
- app-rn-runtime/components/container/wizard/wizard.styles.js.map +1 -1
- app-rn-runtime/components/container/wizard/wizardstep/wizardstep.component.js +17 -11
- app-rn-runtime/components/container/wizard/wizardstep/wizardstep.component.js.map +1 -1
- app-rn-runtime/components/container/wizard/wizardstep/wizardstep.props.js +3 -0
- app-rn-runtime/components/container/wizard/wizardstep/wizardstep.props.js.map +1 -1
- app-rn-runtime/components/data/card/card.component.js +7 -3
- app-rn-runtime/components/data/card/card.component.js.map +1 -1
- app-rn-runtime/components/data/card/card.props.js +4 -0
- app-rn-runtime/components/data/card/card.props.js.map +1 -1
- app-rn-runtime/components/data/form/form-action/form-action.component.js +1 -0
- app-rn-runtime/components/data/form/form-action/form-action.component.js.map +1 -1
- app-rn-runtime/components/data/form/form-action/form-action.props.js +1 -0
- app-rn-runtime/components/data/form/form-action/form-action.props.js.map +1 -1
- app-rn-runtime/components/data/form/form-action/form-action.styles.js +2 -1
- app-rn-runtime/components/data/form/form-action/form-action.styles.js.map +1 -1
- app-rn-runtime/components/data/form/form-field/form-field.component.js +16 -1
- app-rn-runtime/components/data/form/form-field/form-field.component.js.map +1 -1
- app-rn-runtime/components/data/form/form-field/form-field.props.js +3 -0
- app-rn-runtime/components/data/form/form-field/form-field.props.js.map +1 -1
- app-rn-runtime/components/data/form/form.component.js +26 -4
- app-rn-runtime/components/data/form/form.component.js.map +1 -1
- app-rn-runtime/components/data/form/form.props.js +3 -0
- app-rn-runtime/components/data/form/form.props.js.map +1 -1
- app-rn-runtime/components/data/list/list.component.js +91 -28
- app-rn-runtime/components/data/list/list.component.js.map +1 -1
- app-rn-runtime/components/data/list/list.props.js +6 -1
- app-rn-runtime/components/data/list/list.props.js.map +1 -1
- app-rn-runtime/components/data/list/list.styles.js +13 -0
- app-rn-runtime/components/data/list/list.styles.js.map +1 -1
- app-rn-runtime/components/device/barcodescanner/barcodescanner.component.js +4 -1
- app-rn-runtime/components/device/barcodescanner/barcodescanner.component.js.map +1 -1
- app-rn-runtime/components/device/barcodescanner/barcodescanner.props.js +3 -0
- app-rn-runtime/components/device/barcodescanner/barcodescanner.props.js.map +1 -1
- app-rn-runtime/components/device/barcodescanner/barcodescanner.styles.js +13 -6
- app-rn-runtime/components/device/barcodescanner/barcodescanner.styles.js.map +1 -1
- app-rn-runtime/components/device/camera/camera.component.js +4 -1
- app-rn-runtime/components/device/camera/camera.component.js.map +1 -1
- app-rn-runtime/components/device/camera/camera.props.js +3 -0
- app-rn-runtime/components/device/camera/camera.props.js.map +1 -1
- app-rn-runtime/components/device/camera/camera.styles.js +12 -4
- app-rn-runtime/components/device/camera/camera.styles.js.map +1 -1
- app-rn-runtime/components/dialogs/alertdialog/alertdialog.component.js +4 -0
- app-rn-runtime/components/dialogs/alertdialog/alertdialog.component.js.map +1 -1
- app-rn-runtime/components/dialogs/alertdialog/alertdialog.props.js +4 -0
- app-rn-runtime/components/dialogs/alertdialog/alertdialog.props.js.map +1 -1
- app-rn-runtime/components/dialogs/alertdialog/alertdialog.styles.js +2 -1
- app-rn-runtime/components/dialogs/alertdialog/alertdialog.styles.js.map +1 -1
- app-rn-runtime/components/dialogs/confirmdialog/confirmdialog.component.js +4 -0
- app-rn-runtime/components/dialogs/confirmdialog/confirmdialog.component.js.map +1 -1
- app-rn-runtime/components/dialogs/confirmdialog/confirmdialog.props.js +4 -0
- app-rn-runtime/components/dialogs/confirmdialog/confirmdialog.props.js.map +1 -1
- app-rn-runtime/components/dialogs/dialog/dialog.component.js +7 -3
- app-rn-runtime/components/dialogs/dialog/dialog.component.js.map +1 -1
- app-rn-runtime/components/dialogs/dialog/dialog.props.js +4 -0
- app-rn-runtime/components/dialogs/dialog/dialog.props.js.map +1 -1
- app-rn-runtime/components/dialogs/dialog/dialog.styles.js +2 -1
- app-rn-runtime/components/dialogs/dialog/dialog.styles.js.map +1 -1
- app-rn-runtime/components/dialogs/dialogcontent/dialogcontent.component.js +4 -0
- app-rn-runtime/components/dialogs/dialogcontent/dialogcontent.component.js.map +1 -1
- app-rn-runtime/components/input/basedataset/basedataset.props.js +4 -0
- app-rn-runtime/components/input/basedataset/basedataset.props.js.map +1 -1
- app-rn-runtime/components/input/baseinput/baseinput.component.js +3 -3
- app-rn-runtime/components/input/baseinput/baseinput.component.js.map +1 -1
- app-rn-runtime/components/input/baseinput/baseinput.props.js +6 -0
- app-rn-runtime/components/input/baseinput/baseinput.props.js.map +1 -1
- app-rn-runtime/components/input/basenumber/basenumber.component.js +6 -6
- app-rn-runtime/components/input/basenumber/basenumber.component.js.map +1 -1
- app-rn-runtime/components/input/basenumber/basenumber.props.js +4 -0
- app-rn-runtime/components/input/basenumber/basenumber.props.js.map +1 -1
- app-rn-runtime/components/input/checkbox/checkbox.component.js +12 -5
- app-rn-runtime/components/input/checkbox/checkbox.component.js.map +1 -1
- app-rn-runtime/components/input/checkbox/checkbox.styles.js +35 -5
- app-rn-runtime/components/input/checkbox/checkbox.styles.js.map +1 -1
- app-rn-runtime/components/input/checkboxset/checkboxset.component.js +26 -10
- app-rn-runtime/components/input/checkboxset/checkboxset.component.js.map +1 -1
- app-rn-runtime/components/input/checkboxset/checkboxset.props.js +1 -0
- app-rn-runtime/components/input/checkboxset/checkboxset.props.js.map +1 -1
- app-rn-runtime/components/input/checkboxset/checkboxset.styles.js +39 -10
- app-rn-runtime/components/input/checkboxset/checkboxset.styles.js.map +1 -1
- app-rn-runtime/components/input/chips/chips.component.js +5 -1
- app-rn-runtime/components/input/chips/chips.component.js.map +1 -1
- app-rn-runtime/components/input/currency/currency.component.js +2 -2
- app-rn-runtime/components/input/currency/currency.component.js.map +1 -1
- app-rn-runtime/components/input/epoch/base-datetime.component.js +64 -6
- app-rn-runtime/components/input/epoch/base-datetime.component.js.map +1 -1
- app-rn-runtime/components/input/epoch/datetime/datetime.props.js +4 -0
- app-rn-runtime/components/input/epoch/datetime/datetime.props.js.map +1 -1
- app-rn-runtime/components/input/epoch/datetime/datetime.styles.js +28 -0
- app-rn-runtime/components/input/epoch/datetime/datetime.styles.js.map +1 -1
- app-rn-runtime/components/input/fileupload/fileupload.component.js +2 -0
- app-rn-runtime/components/input/fileupload/fileupload.component.js.map +1 -1
- app-rn-runtime/components/input/fileupload/fileupload.props.js +2 -0
- app-rn-runtime/components/input/fileupload/fileupload.props.js.map +1 -1
- app-rn-runtime/components/input/fileupload/fileupload.styles.js +1 -1
- app-rn-runtime/components/input/fileupload/fileupload.styles.js.map +1 -1
- app-rn-runtime/components/input/number/number.component.js +2 -2
- app-rn-runtime/components/input/number/number.component.js.map +1 -1
- app-rn-runtime/components/input/radioset/radioset.component.js +52 -21
- app-rn-runtime/components/input/radioset/radioset.component.js.map +1 -1
- app-rn-runtime/components/input/radioset/radioset.props.js +1 -0
- app-rn-runtime/components/input/radioset/radioset.props.js.map +1 -1
- app-rn-runtime/components/input/radioset/radioset.styles.js +35 -2
- app-rn-runtime/components/input/radioset/radioset.styles.js.map +1 -1
- app-rn-runtime/components/input/select/select.component.js +7 -3
- app-rn-runtime/components/input/select/select.component.js.map +1 -1
- app-rn-runtime/components/input/select/select.styles.js +5 -1
- app-rn-runtime/components/input/select/select.styles.js.map +1 -1
- app-rn-runtime/components/input/slider/slider.component.js +3 -2
- app-rn-runtime/components/input/slider/slider.component.js.map +1 -1
- app-rn-runtime/components/input/switch/switch.component.js +5 -1
- app-rn-runtime/components/input/switch/switch.component.js.map +1 -1
- app-rn-runtime/components/input/switch/switch.styles.js +2 -0
- app-rn-runtime/components/input/switch/switch.styles.js.map +1 -1
- app-rn-runtime/components/input/text/text.component.js +6 -3
- app-rn-runtime/components/input/text/text.component.js.map +1 -1
- app-rn-runtime/components/input/textarea/textarea.component.js +2 -1
- app-rn-runtime/components/input/textarea/textarea.component.js.map +1 -1
- app-rn-runtime/components/input/toggle/toggle.component.js +11 -5
- app-rn-runtime/components/input/toggle/toggle.component.js.map +1 -1
- app-rn-runtime/components/input/toggle/toggle.props.js +4 -0
- app-rn-runtime/components/input/toggle/toggle.props.js.map +1 -1
- app-rn-runtime/components/navigation/appnavbar/appnavbar.component.js +6 -1
- app-rn-runtime/components/navigation/appnavbar/appnavbar.component.js.map +1 -1
- app-rn-runtime/components/navigation/appnavbar/appnavbar.props.js +1 -0
- app-rn-runtime/components/navigation/appnavbar/appnavbar.props.js.map +1 -1
- app-rn-runtime/components/navigation/appnavbar/appnavbar.styles.js +11 -2
- app-rn-runtime/components/navigation/appnavbar/appnavbar.styles.js.map +1 -1
- app-rn-runtime/components/navigation/basenav/basenav.component.js +1 -2
- app-rn-runtime/components/navigation/basenav/basenav.component.js.map +1 -1
- app-rn-runtime/components/navigation/menu/menu.styles.js +8 -5
- app-rn-runtime/components/navigation/menu/menu.styles.js.map +1 -1
- app-rn-runtime/components/navigation/navitem/navitem.component.js +8 -5
- app-rn-runtime/components/navigation/navitem/navitem.component.js.map +1 -1
- app-rn-runtime/components/navigation/navitem/navitem.props.js +3 -0
- app-rn-runtime/components/navigation/navitem/navitem.props.js.map +1 -1
- app-rn-runtime/components/navigation/popover/popover.component.js +14 -3
- app-rn-runtime/components/navigation/popover/popover.component.js.map +1 -1
- app-rn-runtime/components/navigation/popover/popover.props.js +7 -0
- app-rn-runtime/components/navigation/popover/popover.props.js.map +1 -1
- app-rn-runtime/components/navigation/popover/popover.styles.js +8 -2
- app-rn-runtime/components/navigation/popover/popover.styles.js.map +1 -1
- app-rn-runtime/components/page/left-panel/left-panel.component.js +4 -0
- app-rn-runtime/components/page/left-panel/left-panel.component.js.map +1 -1
- app-rn-runtime/components/page/page-content/page-content.component.js +7 -1
- app-rn-runtime/components/page/page-content/page-content.component.js.map +1 -1
- app-rn-runtime/components/page/tabbar/tabbar.component.js +4 -4
- app-rn-runtime/components/page/tabbar/tabbar.component.js.map +1 -1
- app-rn-runtime/components/page/tabbar/tabbar.styles.js +30 -16
- app-rn-runtime/components/page/tabbar/tabbar.styles.js.map +1 -1
- app-rn-runtime/core/accessibility.js +149 -0
- app-rn-runtime/core/accessibility.js.map +1 -0
- app-rn-runtime/core/base.component.js +28 -5
- app-rn-runtime/core/base.component.js.map +1 -1
- app-rn-runtime/core/components/textinput.component.js +147 -14
- app-rn-runtime/core/components/textinput.component.js.map +1 -1
- app-rn-runtime/core/event-notifier.js +37 -2
- app-rn-runtime/core/event-notifier.js.map +1 -1
- app-rn-runtime/core/formatters.js +14 -1
- app-rn-runtime/core/formatters.js.map +1 -1
- app-rn-runtime/core/tappable.component.js +2 -2
- app-rn-runtime/core/tappable.component.js.map +1 -1
- app-rn-runtime/core/utils.js +11 -0
- app-rn-runtime/core/utils.js.map +1 -1
- app-rn-runtime/gestures/swipe.animation.js +34 -1
- app-rn-runtime/gestures/swipe.animation.js.map +1 -1
- app-rn-runtime/package.json +4 -3
- app-rn-runtime/runtime/App.js +17 -10
- app-rn-runtime/runtime/App.js.map +1 -1
- app-rn-runtime/runtime/base-fragment.component.js +5 -1
- app-rn-runtime/runtime/base-fragment.component.js.map +1 -1
- app-rn-runtime/runtime/base-page.component.js +1 -1
- app-rn-runtime/runtime/base-page.component.js.map +1 -1
- app-rn-runtime/runtime/services/app-security.service.js +2 -1
- app-rn-runtime/runtime/services/app-security.service.js.map +1 -1
- app-rn-runtime/styles/background.component.js +16 -5
- app-rn-runtime/styles/background.component.js.map +1 -1
- app-rn-runtime/styles/theme.js +12 -5
- app-rn-runtime/styles/theme.js.map +1 -1
- app-rn-runtime/styles/theme.variables.js +28 -11
- app-rn-runtime/styles/theme.variables.js.map +1 -1
- app-rn-runtime/variables/service-variable.js +14 -6
- app-rn-runtime/variables/service-variable.js.map +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","Text","View","TouchableOpacity","Dimensions","ThemeProvider","ModalConsumer","WmIcon","NavigationServiceConsumer","BaseNavComponent","BaseNavState","WmTabbarProps","DEFAULT_CLASS","Svg","Path","getPathDown","ThemeVariables","scale","n","WmTabbarState","constructor","arguments","_defineProperty","WmTabbar","props","get","width","renderTabItem","item","testId","onSelect","floating","length","undefined","isActive","getDisplayLabel","getDisplayExpression","label","increasedGap","Number","indexBeforeMid","state","dataItems","classname","indexOf","styles","tabItem","paddingRight","createElement","style","centerHubItem","key","_extends","getTestPropsForAction","onPress","activeTabItem","theme","mergeStyle","tabIcon","centerHubIcon","activeTabIcon","iconclass","icon","tabLabel","centerHubLabel","activeTabLabel","onItemSelect","navigationService","link","openUrl","invokeEventCallback","proxy","prepareModalOptions","content","o","modalOptions","modalStyle","bottom","tabbarHeight","contentStyle","modalContent","renderWidget","max","tabItems","tabItemsLength","isClippedTabbar","middleIndex","Math","floor","returnpathDown","maxWidth","root","height","moreItems","moreItemsCount","ceil","j","i","row","push","zIndex","position","backgroundColor","INSTANCE","transparent","fill","tabbarBackgroundColor","d","Fragment","modalService","showMore","showModal","value","moreMenu","map","a","moreMenuRow","index","hideModal","menu","onLayout","e","nativeEvent","layout","filter","morebuttonlabel","morebuttoniconclass","updateState"],"sources":["tabbar.component.tsx"],"sourcesContent":["import React, { ReactNode } from 'react';\nimport { Text, View, TouchableOpacity, Dimensions } from 'react-native';\n\nimport { ThemeProvider } from '@wavemaker/app-rn-runtime/styles/theme';\nimport { ModalConsumer, ModalOptions, ModalService } from '@wavemaker/app-rn-runtime/core/modal.service';\nimport WmIcon from '@wavemaker/app-rn-runtime/components/basic/icon/icon.component';\nimport NavigationService, { NavigationServiceConsumer } from '@wavemaker/app-rn-runtime/core/navigation.service';\nimport { BaseNavProps } from '@wavemaker/app-rn-runtime/components/navigation/basenav/basenav.props';\nimport { BaseNavComponent, BaseNavState, NavigationDataItem } from '@wavemaker/app-rn-runtime/components/navigation/basenav/basenav.component';\n\nimport WmTabbarProps from './tabbar.props';\nimport { DEFAULT_CLASS, WmTabbarStyles } from './tabbar.styles';\nimport Svg, { Path } from 'react-native-svg';\nimport { getPathDown } from './curve';\n// import { scale } from 'react-native-size-scaling';\nimport ThemeVariables from '@wavemaker/app-rn-runtime/styles/theme.variables';\n\ninterface TabDataItem extends NavigationDataItem {\n floating: boolean;\n indexBeforeMid: number;\n}\n\nconst scale = (n: number) => n;\n\nclass WmTabbarState<T extends BaseNavProps> extends BaseNavState<T> {\n showMore = false;\n modalOptions = {} as ModalOptions;\n dataItems: TabDataItem[] = [];\n}\n\nexport default class WmTabbar extends BaseNavComponent<WmTabbarProps, WmTabbarState<WmTabbarProps>, WmTabbarStyles> {\n\n private tabbarHeight = 0;\n\n constructor(props: WmTabbarProps) {\n super(props, DEFAULT_CLASS, new WmTabbarProps(), new WmTabbarState());\n }\n\n private maxWidth = Dimensions.get(\"window\").width; \n private returnpathDown: any;\n\n renderTabItem(item: TabDataItem, testId: string, props: WmTabbarProps, onSelect: Function, floating = false) {\n\n const isActive = props.isActive && props.isActive(item);\n const getDisplayLabel = this.props.getDisplayExpression || ((label: string) => label);\n let increasedGap = Number(testId) === item?.indexBeforeMid && (this.state.dataItems.length % 2!=0) && ((props.classname || '').indexOf('clipped-tabbar') >= 0)\n ? [this.styles.tabItem, { paddingRight: 70 }]\n : [this.styles.tabItem];\n \n return (\n <View style={[increasedGap, floating? this.styles.centerHubItem: {}]} key={`${item.label}_${testId}`}>\n <TouchableOpacity {...this.getTestPropsForAction('item' + testId)} onPress={() => onSelect && onSelect()} key={item.key}>\n <View style={[isActive && !floating ? this.styles.activeTabItem : {}]}>\n <WmIcon styles={this.theme.mergeStyle({}, this.styles.tabIcon ,floating? this.styles.centerHubIcon: {}, isActive && !floating ? this.styles.activeTabIcon : {})}\n iconclass={item.icon}></WmIcon>\n <Text style={[this.styles.tabLabel,floating? this.styles.centerHubLabel: {}, isActive && !floating ? this.styles.activeTabLabel: {}]}>{getDisplayLabel(item.label)}</Text>\n </View>\n </TouchableOpacity>\n </View>\n );\n}\n\n onItemSelect(item: TabDataItem, navigationService: NavigationService) {\n item.link && navigationService.openUrl(item.link);\n this.invokeEventCallback('onSelect', [null, this.proxy, item]);\n }\n\n prepareModalOptions(content: ReactNode) {\n const o = this.state.modalOptions;\n o.content = content;\n o.modalStyle = {\n bottom: this.tabbarHeight\n };\n o.contentStyle = this.styles.modalContent; \n return o;\n }\n\n renderWidget(props: WmTabbarProps) {\n let max = 5;\n const tabItems = this.state.dataItems;\n const tabItemsLength = tabItems.length;\n const isClippedTabbar = ((props.classname || '').indexOf('clipped-tabbar') >= 0) && (tabItemsLength % 2 !== 0);\n if (tabItemsLength % 2 !== 0) {\n const middleIndex = Math.floor(tabItemsLength / 2);\n tabItems[middleIndex]['floating'] = true;\n tabItems[middleIndex - 1]['indexBeforeMid'] = middleIndex-1;\n }\n this.returnpathDown = getPathDown(this.maxWidth, 65 ,60,this.styles.root.height as number);\n const moreItems = [] as any[][];\n if (tabItems.length > max) {\n const moreItemsCount = Math.ceil((tabItems.length + 1 - max)/ max) * max;\n let j = 0;\n for (let i = max-1; i < moreItemsCount;) {\n const row = [];\n for (let j = 0; j < max; j++) {\n row[j] = tabItems[i++] || {key: 'tabItem' + i} as TabDataItem;\n }\n moreItems.push(row);\n }\n max = max - 1;\n }\n return (\n <NavigationServiceConsumer>\n {(navigationService) =>\n (<View style={this.styles.root}>\n {isClippedTabbar ? (\n <Svg width={this.maxWidth} height={scale(this.styles.root.height as number)} style={{zIndex: -1,position: 'absolute',backgroundColor: ThemeVariables.INSTANCE.transparent}}>\n <Path fill={ThemeVariables.INSTANCE.tabbarBackgroundColor} {...{ d: this.returnpathDown }}/>\n </Svg>\n ): <></>} \n <ModalConsumer>\n {(modalService: ModalService) => {\n if (this.state.showMore) {\n modalService.showModal(this.prepareModalOptions((\n <ThemeProvider value={this.theme} >\n <View style={this.styles.moreMenu}>\n {moreItems.map((a, i) =>\n (<View key={i} style={this.styles.moreMenuRow}>\n {a.map((item, index) => this.renderTabItem(item, i + '', props, () => this.onItemSelect(item, navigationService)))}\n </View>)\n )}\n </View>\n </ThemeProvider>)));\n } else {\n modalService.hideModal(this.state.modalOptions);\n }\n return null;\n }}\n </ModalConsumer>\n <View style={this.styles.menu}\n onLayout={e => { this.tabbarHeight = e.nativeEvent.layout.height}}> \n {tabItems.filter((item, i) => i < max)\n .map((item, i) => this.renderTabItem(item, i + '', props, () => this.onItemSelect(item, navigationService), item.floating))}\n {tabItems.length > max && (\n this.renderTabItem({\n label: props.morebuttonlabel,\n icon: props.morebuttoniconclass\n } as TabDataItem, 6666 +'', props, () => {\n this.updateState({showMore: !this.state.showMore} as WmTabbarState<WmTabbarProps>);\n })\n )}\n </View>\n </View>)}\n </NavigationServiceConsumer>\n );\n }\n}\n"],"mappings":";;;;AAAA,OAAOA,KAAK,MAAqB,OAAO;AACxC,SAASC,IAAI,EAAEC,IAAI,EAAEC,gBAAgB,EAAEC,UAAU,QAAQ,cAAc;AAEvE,SAASC,aAAa,QAAQ,wCAAwC;AACtE,SAASC,aAAa,QAAoC,8CAA8C;AACxG,OAAOC,MAAM,MAAM,gEAAgE;AACnF,SAA4BC,yBAAyB,QAAQ,mDAAmD;AAEhH,SAASC,gBAAgB,EAAEC,YAAY,QAA4B,2EAA2E;AAE9I,OAAOC,aAAa,MAAM,gBAAgB;AAC1C,SAASC,aAAa,QAAwB,iBAAiB;AAC/D,OAAOC,GAAG,IAAIC,IAAI,QAAQ,kBAAkB;AAC5C,SAASC,WAAW,QAAQ,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QACL0C,YAAY,CAACS,SAAS,CAAC,IAAI,CAAC7E,KAAK,CAACkC,YAAY,CAAC;MACjD;MACA,OAAO,IAAI;IACb,CACa,CAAC,eAChB3E,KAAA,CAAAgD,aAAA,CAAC9C,IAAI;MAAC+C,KAAK,EAAE,IAAI,CAACJ,MAAM,CAAC0E,IAAK;MAC5BC,QAAQ,EAAEC,CAAC,IAAI;QAAE,IAAI,CAAC3C,YAAY,GAAG2C,CAAC,CAACC,WAAW,CAACC,MAAM,CAAC/B,MAAM;MAAA;IAAE,GACjET,QAAQ,CAACyC,MAAM,CAAC,CAAChG,IAAI,EAAEqE,CAAC,KAAKA,CAAC,GAAGf,GAAG,CAAC,CACnCgC,GAAG,CAAC,CAACtF,IAAI,EAAEqE,CAAC,KAAK,IAAI,CAACtE,aAAa,CAACC,IAAI,EAAEqE,CAAC,GAAG,EAAE,EAAEzE,KAAK,EAAE,MAAM,IAAI,CAAC0C,YAAY,CAACtC,IAAI,EAAEuC,iBAAiB,CAAC,EAAEvC,IAAI,CAACG,QAAQ,CAAC,CAAC,EAC5HoD,QAAQ,CAACnD,MAAM,GAAGkD,GAAG,IACpB,IAAI,CAACvD,aAAa,CAAC;MACjBU,KAAK,EAAEb,KAAK,CAACqG,eAAe;MAC5B/D,IAAI,EAAEtC,KAAK,CAACsG;IACd,CAAC,EAAiB,IAAI,GAAE,EAAE,EAAEtG,KAAK,EAAG,MAAM;MACxC,IAAI,CAACuG,WAAW,CAAC;QAACjB,QAAQ,EAAE,CAAC,IAAI,CAACrE,KAAK,CAACqE;MAAQ,CAAiC,CAAC;IACpF,CAAC,CAEC,CACF,CACmB,CAAC;EAEhC;AACF"}
|
|
1
|
+
{"version":3,"names":["React","Text","View","TouchableOpacity","Dimensions","ThemeProvider","ModalConsumer","WmIcon","NavigationServiceConsumer","BaseNavComponent","BaseNavState","WmTabbarProps","DEFAULT_CLASS","Svg","Path","getPathDown","ThemeVariables","scale","n","WmTabbarState","constructor","arguments","_defineProperty","WmTabbar","props","get","width","renderTabItem","item","testId","onSelect","floating","length","undefined","isActive","getDisplayLabel","getDisplayExpression","label","increasedGap","Number","indexBeforeMid","state","dataItems","classname","indexOf","styles","tabItem","paddingRight","createElement","style","centerHubItem","key","_extends","getTestPropsForAction","onPress","activeTabItem","theme","mergeStyle","tabIcon","centerHubIcon","activeTabIcon","iconclass","icon","tabLabel","centerHubLabel","activeTabLabel","onItemSelect","navigationService","link","openUrl","invokeEventCallback","proxy","prepareModalOptions","content","o","modalOptions","modalStyle","bottom","tabbarHeight","contentStyle","modalContent","renderWidget","max","tabItems","tabItemsLength","isClippedTabbar","middleIndex","Math","floor","returnpathDown","maxWidth","root","height","moreItems","moreItemsCount","ceil","j","i","row","push","zIndex","position","backgroundColor","INSTANCE","transparent","fill","tabbarBackgroundColor","d","Fragment","modalService","showMore","showModal","value","moreMenu","map","a","moreMenuRow","index","hideModal","menu","onLayout","e","nativeEvent","layout","filter","morebuttonlabel","morebuttoniconclass","updateState"],"sources":["tabbar.component.tsx"],"sourcesContent":["import React, { ReactNode } from 'react';\nimport { Text, View, TouchableOpacity, Dimensions } from 'react-native';\n\nimport { ThemeProvider } from '@wavemaker/app-rn-runtime/styles/theme';\nimport { ModalConsumer, ModalOptions, ModalService } from '@wavemaker/app-rn-runtime/core/modal.service';\nimport WmIcon from '@wavemaker/app-rn-runtime/components/basic/icon/icon.component';\nimport NavigationService, { NavigationServiceConsumer } from '@wavemaker/app-rn-runtime/core/navigation.service';\nimport { BaseNavProps } from '@wavemaker/app-rn-runtime/components/navigation/basenav/basenav.props';\nimport { BaseNavComponent, BaseNavState, NavigationDataItem } from '@wavemaker/app-rn-runtime/components/navigation/basenav/basenav.component';\n\nimport WmTabbarProps from './tabbar.props';\nimport { DEFAULT_CLASS, WmTabbarStyles } from './tabbar.styles';\nimport Svg, { Path } from 'react-native-svg';\nimport { getPathDown } from './curve';\n// import { scale } from 'react-native-size-scaling';\nimport ThemeVariables from '@wavemaker/app-rn-runtime/styles/theme.variables';\n\ninterface TabDataItem extends NavigationDataItem {\n floating: boolean;\n indexBeforeMid: number;\n}\n\nconst scale = (n: number) => n;\n\nclass WmTabbarState<T extends BaseNavProps> extends BaseNavState<T> {\n showMore = false;\n modalOptions = {} as ModalOptions;\n dataItems: TabDataItem[] = [];\n}\n\nexport default class WmTabbar extends BaseNavComponent<WmTabbarProps, WmTabbarState<WmTabbarProps>, WmTabbarStyles> {\n\n private tabbarHeight = 0;\n\n constructor(props: WmTabbarProps) {\n super(props, DEFAULT_CLASS, new WmTabbarProps(), new WmTabbarState());\n }\n\n private maxWidth = Dimensions.get(\"window\").width; \n private returnpathDown: any;\n\n renderTabItem(item: TabDataItem, testId: string, props: WmTabbarProps, onSelect: Function, floating = false) {\n\n const isActive = props.isActive && props.isActive(item);\n const getDisplayLabel = this.props.getDisplayExpression || ((label: string) => label);\n let increasedGap = Number(testId) === item?.indexBeforeMid && (this.state.dataItems.length % 2!=0) && ((props.classname || '').indexOf('clipped-tabbar') >= 0)\n ? [this.styles.tabItem, { paddingRight: 70 }]\n : [this.styles.tabItem];\n \n return (\n <View style={[increasedGap, floating? this.styles.centerHubItem: {}]} key={`${item.label}_${testId}`}>\n <TouchableOpacity\n {...this.getTestPropsForAction('item' + testId)}\n onPress={() => onSelect && onSelect()}\n key={item.key}\n >\n <View style={[isActive && !floating ? this.styles.activeTabItem : {}]}>\n <WmIcon\n styles={this.theme.mergeStyle({}, this.styles.tabIcon, floating? this.styles.centerHubIcon: {}, isActive ? this.styles.activeTabIcon : {})}\n iconclass={item.icon}\n ></WmIcon>\n </View>\n </TouchableOpacity>\n <Text style={[this.styles.tabLabel, floating? this.styles.centerHubLabel: {}, isActive ? this.styles.activeTabLabel : {}]}>\n {getDisplayLabel(item.label)}\n </Text>\n </View>\n );\n }\n \n onItemSelect(item: NavigationDataItem, navigationService: NavigationService) {\n item.link && navigationService.openUrl(item.link);\n this.invokeEventCallback('onSelect', [null, this.proxy, item]);\n }\n\n prepareModalOptions(content: ReactNode) {\n const o = this.state.modalOptions;\n o.content = content;\n o.modalStyle = {\n bottom: this.tabbarHeight\n };\n o.contentStyle = this.styles.modalContent; \n return o;\n }\n\n renderWidget(props: WmTabbarProps) {\n let max = 5;\n const tabItems = this.state.dataItems;\n const tabItemsLength = tabItems.length;\n const isClippedTabbar = ((props.classname || '').indexOf('clipped-tabbar') >= 0) && (tabItemsLength % 2 !== 0);\n if (tabItemsLength % 2 !== 0) {\n const middleIndex = Math.floor(tabItemsLength / 2);\n tabItems[middleIndex]['floating'] = true;\n tabItems[middleIndex - 1]['indexBeforeMid'] = middleIndex-1;\n }\n this.returnpathDown = getPathDown(this.maxWidth, 65 ,60,this.styles.root.height as number);\n const moreItems = [] as any[][];\n if (tabItems.length > max) {\n const moreItemsCount = Math.ceil((tabItems.length + 1 - max)/ max) * max;\n let j = 0;\n for (let i = max-1; i < moreItemsCount;) {\n const row = [];\n for (let j = 0; j < max; j++) {\n row[j] = tabItems[i++] || {key: 'tabItem' + i} as TabDataItem;\n }\n moreItems.push(row);\n }\n max = max - 1;\n }\n return (\n <NavigationServiceConsumer>\n {(navigationService) =>\n (<View style={this.styles.root}>\n {isClippedTabbar ? (\n <Svg width={this.maxWidth} height={scale(this.styles.root.height as number)} style={{zIndex: -1,position: 'absolute',backgroundColor: ThemeVariables.INSTANCE.transparent}}>\n <Path fill={ThemeVariables.INSTANCE.tabbarBackgroundColor} {...{ d: this.returnpathDown }}/>\n </Svg>\n ): <></>} \n <ModalConsumer>\n {(modalService: ModalService) => {\n if (this.state.showMore) {\n modalService.showModal(this.prepareModalOptions((\n <ThemeProvider value={this.theme} >\n <View style={this.styles.moreMenu}>\n {moreItems.map((a, i) =>\n (<View key={i} style={this.styles.moreMenuRow}>\n {a.map((item, index) => this.renderTabItem(item, i + '', props, () => this.onItemSelect(item, navigationService)))}\n </View>)\n )}\n </View>\n </ThemeProvider>)));\n } else {\n modalService.hideModal(this.state.modalOptions);\n }\n return null;\n }}\n </ModalConsumer>\n <View style={this.styles.menu}\n onLayout={e => { this.tabbarHeight = e.nativeEvent.layout.height}}> \n {tabItems.filter((item, i) => i < max)\n .map((item, i) => this.renderTabItem(item, i + '', props, () => this.onItemSelect(item, navigationService), item.floating))}\n {tabItems.length > max && (\n this.renderTabItem({\n label: props.morebuttonlabel,\n icon: props.morebuttoniconclass\n } as TabDataItem, 6666 +'', props, () => {\n this.updateState({showMore: !this.state.showMore} as WmTabbarState<WmTabbarProps>);\n })\n )}\n </View>\n </View>)}\n </NavigationServiceConsumer>\n );\n }\n}\n"],"mappings":";;;;AAAA,OAAOA,KAAK,MAAqB,OAAO;AACxC,SAASC,IAAI,EAAEC,IAAI,EAAEC,gBAAgB,EAAEC,UAAU,QAAQ,cAAc;AAEvE,SAASC,aAAa,QAAQ,wCAAwC;AACtE,SAASC,aAAa,QAAoC,8CAA8C;AACxG,OAAOC,MAAM,MAAM,gEAAgE;AACnF,SAA4BC,yBAAyB,QAAQ,mDAAmD;AAEhH,SAASC,gBAAgB,EAAEC,YAAY,QAA4B,2EAA2E;AAE9I,OAAOC,aAAa,MAAM,gBAAgB;AAC1C,SAASC,aAAa,QAAwB,iBAAiB;AAC/D,OAAOC,GAAG,IAAIC,IAAI,QAAQ,kBAAkB;AAC5C,SAASC,WAAW,QAAQ,SAAS;AACrC;AACA,OAAOC,cAAc,MAAM,kDAAkD;AAO7E,MAAMC,KAAK,GAAIC,CAAS,IAAKA,CAAC;AAE9B,MAAMC,aAAa,SAAiCT,YAAY,CAAI;EAAAU,YAAA;IAAA,SAAAC,SAAA;IAAAC,eAAA,mBACvD,KAAK;IAAAA,eAAA,uBACD,CAAC,CAAC;IAAAA,eAAA,oBACU,EAAE;EAAA;AAC/B;AAEA,eAAe,MAAMC,QAAQ,SAASd,gBAAgB,CAA8D;EAIlHW,WAAWA,CAACI,KAAoB,EAAE;IAChC,KAAK,CAACA,KAAK,EAAEZ,aAAa,EAAE,IAAID,aAAa,CAAC,CAAC,EAAE,IAAIQ,aAAa,CAAC,CAAC,CAAC;I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aAAa,CAACC,IAAI,EAAEqE,CAAC,GAAG,EAAE,EAAEzE,KAAK,EAAE,MAAM,IAAI,CAAC0C,YAAY,CAACtC,IAAI,EAAEuC,iBAAiB,CAAC,EAAEvC,IAAI,CAACG,QAAQ,CAAC,CAAC,EAC5HoD,QAAQ,CAACnD,MAAM,GAAGkD,GAAG,IACpB,IAAI,CAACvD,aAAa,CAAC;MACjBU,KAAK,EAAEb,KAAK,CAACqG,eAAe;MAC5B/D,IAAI,EAAEtC,KAAK,CAACsG;IACd,CAAC,EAAiB,IAAI,GAAE,EAAE,EAAEtG,KAAK,EAAG,MAAM;MACxC,IAAI,CAACuG,WAAW,CAAC;QAACjB,QAAQ,EAAE,CAAC,IAAI,CAACrE,KAAK,CAACqE;MAAQ,CAAiC,CAAC;IACpF,CAAC,CAEC,CACF,CACmB,CAAC;EAEhC;AACF"}
|
|
@@ -4,7 +4,9 @@ export const DEFAULT_CLASS = 'app-tabbar';
|
|
|
4
4
|
BASE_THEME.registerStyle((themeVariables, addStyle) => {
|
|
5
5
|
const defaultStyles = defineStyles({
|
|
6
6
|
root: {
|
|
7
|
-
height:
|
|
7
|
+
height: 80,
|
|
8
|
+
elevation: 3,
|
|
9
|
+
shadowColor: themeVariables.tabShadowColor
|
|
8
10
|
},
|
|
9
11
|
text: {},
|
|
10
12
|
menu: {
|
|
@@ -39,39 +41,51 @@ BASE_THEME.registerStyle((themeVariables, addStyle) => {
|
|
|
39
41
|
flexDirection: 'column',
|
|
40
42
|
justifyContent: 'center',
|
|
41
43
|
alignItems: 'center',
|
|
42
|
-
|
|
43
|
-
|
|
44
|
+
minHeight: 32,
|
|
45
|
+
minWidth: 64,
|
|
46
|
+
opacity: 1,
|
|
47
|
+
marginBottom: 16
|
|
44
48
|
},
|
|
45
49
|
activeTabItem: {
|
|
46
|
-
opacity: 1
|
|
50
|
+
opacity: 1,
|
|
51
|
+
height: 32,
|
|
52
|
+
width: 64,
|
|
53
|
+
borderRadius: 50,
|
|
54
|
+
marginBottom: -2,
|
|
55
|
+
backgroundColor: themeVariables.tabActiveBackgroundColor
|
|
47
56
|
},
|
|
48
57
|
tabIcon: {
|
|
49
58
|
root: {
|
|
50
59
|
alignSelf: 'center',
|
|
51
|
-
paddingBottom: 32,
|
|
52
60
|
borderBottomColor: themeVariables.transparent,
|
|
53
|
-
|
|
61
|
+
paddingBottom: 4
|
|
54
62
|
},
|
|
55
63
|
icon: {
|
|
56
|
-
fontSize:
|
|
64
|
+
fontSize: 24,
|
|
65
|
+
paddingRight: 0,
|
|
57
66
|
color: themeVariables.tabbarIconColor
|
|
58
67
|
}
|
|
59
68
|
},
|
|
60
69
|
activeTabIcon: {
|
|
61
|
-
root: {
|
|
62
|
-
|
|
70
|
+
root: {},
|
|
71
|
+
icon: {
|
|
72
|
+
color: themeVariables.tabActiveIconColor
|
|
63
73
|
}
|
|
64
74
|
},
|
|
65
75
|
tabLabel: {
|
|
66
|
-
fontSize:
|
|
76
|
+
fontSize: 12,
|
|
77
|
+
marginTop: 4,
|
|
67
78
|
fontWeight: '500',
|
|
68
|
-
color: themeVariables.tabbarIconColor,
|
|
69
|
-
textAlign: 'center',
|
|
70
79
|
fontFamily: themeVariables.baseFont,
|
|
71
|
-
|
|
72
|
-
|
|
80
|
+
color: themeVariables.tabbarTextColor,
|
|
81
|
+
textAlign: 'center'
|
|
82
|
+
},
|
|
83
|
+
activeTabLabel: {
|
|
84
|
+
fontWeight: '700',
|
|
85
|
+
fontSize: 12,
|
|
86
|
+
fontFamily: themeVariables.baseFont,
|
|
87
|
+
color: themeVariables.tabLabelTextColor
|
|
73
88
|
},
|
|
74
|
-
activeTabLabel: {},
|
|
75
89
|
centerHubItem: {},
|
|
76
90
|
centerHubIcon: {},
|
|
77
91
|
centerHubLabel: {}
|
|
@@ -125,7 +139,7 @@ BASE_THEME.registerStyle((themeVariables, addStyle) => {
|
|
|
125
139
|
shadowRadius: 2,
|
|
126
140
|
borderRadius: 35,
|
|
127
141
|
position: 'absolute',
|
|
128
|
-
bottom:
|
|
142
|
+
bottom: 28,
|
|
129
143
|
alignItems: 'center',
|
|
130
144
|
justifyContent: 'center',
|
|
131
145
|
backgroundColor: themeVariables.centerHubItemColor,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["BASE_THEME","defineStyles","DEFAULT_CLASS","registerStyle","themeVariables","addStyle","defaultStyles","root","height","text","menu","flexDirection","backgroundColor","tabbarBackgroundColor","justifyContent","alignItems","modalContent","moreMenu","width","getStyle","shadowOffset","shadowOpacity","shadowRadius","moreMenuRow","paddingTop","paddingBottom","tabItem","minWidth","opacity","activeTabItem","tabIcon","alignSelf","borderBottomColor","transparent","borderBottomWidth","icon","fontSize","color","tabbarIconColor","activeTabIcon","tabLabel","fontWeight","textAlign","fontFamily","baseFont","marginTop","activeTabLabel","centerHubItem","centerHubIcon","centerHubLabel","undefined","borderTopWidth","borderTopColor","shadowColor","borderRadius","position","bottom","centerHubItemColor","left","maxWidth","centerHubIconColor","centerHubLabelColor"],"sources":["tabbar.styles.ts"],"sourcesContent":["import BASE_THEME, { AllStyle } from '@wavemaker/app-rn-runtime/styles/theme';\nimport { BaseStyles, defineStyles } from '@wavemaker/app-rn-runtime/core/base.component';\nimport { WmIconStyles } from '../../basic/icon/icon.styles';\n\nexport type WmTabbarStyles = BaseStyles & {\n menu: AllStyle,\n modalContent: AllStyle,\n moreMenu: AllStyle,\n moreMenuRow: AllStyle,\n tabItem: AllStyle,\n activeTabItem: AllStyle,\n tabIcon: WmIconStyles,\n activeTabIcon: WmIconStyles,\n tabLabel: AllStyle,\n activeTabLabel: AllStyle,\n centerHubItem: AllStyle,\n centerHubIcon: WmIconStyles,\n centerHubLabel: AllStyle\n};\n\nexport const DEFAULT_CLASS = 'app-tabbar';\n BASE_THEME.registerStyle((themeVariables, addStyle) => {\n const defaultStyles: WmTabbarStyles = defineStyles<WmTabbarStyles>({\n root: {\n height: 88\n },\n text: {},\n menu: {\n height: '100%',\n flexDirection: 'row',\n backgroundColor: themeVariables.tabbarBackgroundColor,\n justifyContent: 'space-around',\n alignItems: 'flex-end',\n },\n modalContent: {},\n moreMenu: {\n width: '100%',\n flexDirection: 'column-reverse',\n justifyContent: 'flex-end',\n backgroundColor: themeVariables.tabbarBackgroundColor,\n ...BASE_THEME.getStyle('elevate1').root,\n shadowOffset: {\n width: 0,\n height: -6\n },\n shadowOpacity: 0.3,\n shadowRadius: 6\n },\n moreMenuRow: {\n flexDirection: 'row-reverse',\n justifyContent: 'space-around',\n width: '100%',\n paddingTop: 4,\n paddingBottom: 4\n },\n tabItem: {\n flexDirection: 'column',\n justifyContent: 'center',\n alignItems: 'center',\n minWidth: 60,\n opacity: 0.4\n },\n activeTabItem: {\n opacity: 1\n },\n tabIcon: {\n root: {\n alignSelf: 'center',\n paddingBottom: 32,\n borderBottomColor: themeVariables.transparent,\n borderBottomWidth: 4\n },\n icon: {\n fontSize: 36,\n color: themeVariables.tabbarIconColor\n }\n } as WmIconStyles,\n activeTabIcon: {\n root: {\n borderBottomColor: themeVariables.tabbarIconColor,\n }\n } as WmIconStyles,\n tabLabel: {\n fontSize: 14,\n fontWeight: '500',\n color: themeVariables.tabbarIconColor,\n textAlign: 'center',\n fontFamily: themeVariables.baseFont,\n marginTop: -32,\n paddingBottom: 14\n },\n activeTabLabel: {},\n centerHubItem: {},\n centerHubIcon: {} as WmIconStyles, \n centerHubLabel:{}\n });\n\n addStyle(DEFAULT_CLASS, '', defaultStyles);\n addStyle('tabbar-spacer', '', {\n root: {\n height: 96\n }\n });\n addStyle(DEFAULT_CLASS+ '-1', '', {\n root: {\n height: undefined\n },\n tabItem: {\n justifyContent: 'space-between' \n },\n activeTabItem: {\n borderTopWidth: 4,\n borderTopColor: themeVariables.tabbarIconColor\n },\n tabIcon: {\n root: {\n paddingTop: 8,\n paddingBottom: 8,\n borderBottomWidth: 0\n }\n },\n tabLabel: {\n marginTop: 0\n }\n } as WmTabbarStyles);\n addStyle('clipped-tabbar', '', {\n root:{\n backgroundColor: themeVariables.transparent,\n marginTop: -88\n },\n menu: {\n backgroundColor: themeVariables.transparent\n },\n centerHubItem: {\n width: 70,\n height: 70,\n shadowColor: 'grey',\n shadowOpacity: 0.1,\n opacity: 1,\n shadowOffset: { width: 2, height: 0 },\n shadowRadius: 2,\n borderRadius: 35,\n position: 'absolute',\n bottom: 53,\n alignItems: 'center',\n justifyContent: 'center',\n backgroundColor: themeVariables.centerHubItemColor,\n left: (themeVariables.maxWidth/2) - 35\n },\n centerHubIcon: {\n root: {\n alignSelf: 'center',\n paddingBottom: 0,\n borderBottomColor: themeVariables.transparent,\n borderBottomWidth: 0 \n },\n icon: {\n fontSize: 24,\n color: themeVariables.centerHubIconColor\n }\n } as WmIconStyles, \n centerHubLabel:{\n color: themeVariables.centerHubLabelColor,\n marginTop: 0,\n paddingBottom: 4\n }\n })\n});"],"mappings":"AAAA,OAAOA,UAAU,MAAoB,wCAAwC;AAC7E,SAAqBC,YAAY,QAAQ,+CAA+C;AAmBxF,OAAO,MAAMC,aAAa,GAAG,YAAY;AACrCF,UAAU,CAACG,aAAa,CAAC,CAACC,cAAc,EAAEC,QAAQ,KAAK;EACvD,MAAMC,aAA6B,GAAGL,YAAY,CAAiB;IAC/DM,IAAI,EAAE;MACFC,MAAM,EAAE;IACZ,CAAC;IACDC,IAAI,EAAE,CAAC,CAAC;IACRC,IAAI,EAAE;MACFF,MAAM,EAAE,MAAM;MACdG,aAAa,EAAE,KAAK;MACpBC,eAAe,EAAER,cAAc,CAACS,qBAAqB;MACrDC,cAAc,EAAE,cAAc;MAC9BC,UAAU,EAAE;IAChB,CAAC;IACDC,YAAY,EAAE,CAAC,CAAC;IAChBC,QAAQ,EAAE;MACNC,KAAK,EAAE,MAAM;MACbP,aAAa,EAAE,gBAAgB;MAC/BG,cAAc,EAAE,UAAU;MAC1BF,eAAe,EAAER,cAAc,CAACS,qBAAqB;MACrD,GAAGb,UAAU,CAACmB,QAAQ,CAAC,UAAU,CAAC,CAACZ,IAAI;MACvCa,YAAY,EAA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,CAACuD,QAAQ,GAAC,CAAC,GAAI;IACxC,CAAC;IACDX,aAAa,EAAE;MACXzC,IAAI,EAAE;QACFwB,SAAS,EAAE,QAAQ;QACnBN,aAAa,EAAE,CAAC;QAChBO,iBAAiB,EAAE5B,cAAc,CAAC6B,WAAW;QAC7CC,iBAAiB,EAAE;MACvB,CAAC;MACDC,IAAI,EAAE;QACFC,QAAQ,EAAE,EAAE;QACZC,KAAK,EAAGjC,cAAc,CAACwD;MAC3B;IACJ,CAAiB;IACjBX,cAAc,EAAC;MACXZ,KAAK,EAAGjC,cAAc,CAACyD,mBAAmB;MAC1ChB,SAAS,EAAE,CAAC;MACZpB,aAAa,EAAE;IACnB;EACJ,CAAC,CAAC;AACN,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"names":["BASE_THEME","defineStyles","DEFAULT_CLASS","registerStyle","themeVariables","addStyle","defaultStyles","root","height","elevation","shadowColor","tabShadowColor","text","menu","flexDirection","backgroundColor","tabbarBackgroundColor","justifyContent","alignItems","modalContent","moreMenu","width","getStyle","shadowOffset","shadowOpacity","shadowRadius","moreMenuRow","paddingTop","paddingBottom","tabItem","minHeight","minWidth","opacity","marginBottom","activeTabItem","borderRadius","tabActiveBackgroundColor","tabIcon","alignSelf","borderBottomColor","transparent","icon","fontSize","paddingRight","color","tabbarIconColor","activeTabIcon","tabActiveIconColor","tabLabel","marginTop","fontWeight","fontFamily","baseFont","tabbarTextColor","textAlign","activeTabLabel","tabLabelTextColor","centerHubItem","centerHubIcon","centerHubLabel","undefined","borderTopWidth","borderTopColor","borderBottomWidth","position","bottom","centerHubItemColor","left","maxWidth","centerHubIconColor","centerHubLabelColor"],"sources":["tabbar.styles.ts"],"sourcesContent":["import BASE_THEME, { AllStyle } from '@wavemaker/app-rn-runtime/styles/theme';\nimport { BaseStyles, defineStyles } from '@wavemaker/app-rn-runtime/core/base.component';\nimport { WmIconStyles } from '../../basic/icon/icon.styles';\n\nexport type WmTabbarStyles = BaseStyles & {\n menu: AllStyle,\n modalContent: AllStyle,\n moreMenu: AllStyle,\n moreMenuRow: AllStyle,\n tabItem: AllStyle,\n activeTabItem: AllStyle,\n tabIcon: WmIconStyles,\n activeTabIcon: WmIconStyles,\n tabLabel: AllStyle,\n activeTabLabel: AllStyle,\n centerHubItem: AllStyle,\n centerHubIcon: WmIconStyles,\n centerHubLabel: AllStyle\n};\n\nexport const DEFAULT_CLASS = 'app-tabbar';\n BASE_THEME.registerStyle((themeVariables, addStyle) => {\n const defaultStyles: WmTabbarStyles = defineStyles<WmTabbarStyles>({\n root: {\n height: 80,\n elevation: 3,\n shadowColor : themeVariables.tabShadowColor\n },\n text: {},\n menu: {\n height: '100%',\n flexDirection: 'row',\n backgroundColor: themeVariables.tabbarBackgroundColor,\n justifyContent: 'space-around',\n alignItems: 'flex-end',\n },\n modalContent: {},\n moreMenu: {\n width: '100%',\n flexDirection: 'column-reverse',\n justifyContent: 'flex-end',\n backgroundColor: themeVariables.tabbarBackgroundColor,\n ...BASE_THEME.getStyle('elevate1').root,\n shadowOffset: {\n width: 0,\n height: -6\n },\n shadowOpacity: 0.3,\n shadowRadius: 6\n },\n moreMenuRow: {\n flexDirection: 'row-reverse',\n justifyContent: 'space-around',\n width: '100%',\n paddingTop: 4,\n paddingBottom: 4\n },\n tabItem: {\n flexDirection: 'column',\n justifyContent: 'center',\n alignItems: 'center',\n minHeight: 32,\n minWidth: 64,\n opacity: 1,\n marginBottom: 16\n },\n activeTabItem: {\n opacity: 1,\n height: 32,\n width: 64,\n borderRadius: 50,\n marginBottom: -2,\n backgroundColor: themeVariables.tabActiveBackgroundColor\n },\n tabIcon: {\n root: {\n alignSelf: 'center',\n borderBottomColor: themeVariables.transparent,\n paddingBottom: 4\n },\n icon: {\n fontSize: 24,\n paddingRight: 0,\n color: themeVariables.tabbarIconColor\n }\n } as WmIconStyles,\n activeTabIcon: {\n root: {\n },\n icon:{\n color: themeVariables.tabActiveIconColor,\n }\n } as WmIconStyles,\n tabLabel: {\n fontSize: 12,\n marginTop: 4,\n fontWeight: '500',\n fontFamily: themeVariables.baseFont,\n color: themeVariables.tabbarTextColor,\n textAlign: 'center',\n },\n activeTabLabel: {\n fontWeight: '700',\n fontSize: 12,\n fontFamily: themeVariables.baseFont,\n color: themeVariables.tabLabelTextColor,\n },\n centerHubItem: {},\n centerHubIcon: {} as WmIconStyles, \n centerHubLabel:{}\n });\n\n addStyle(DEFAULT_CLASS, '', defaultStyles);\n addStyle('tabbar-spacer', '', {\n root: {\n height: 96\n }\n });\n addStyle(DEFAULT_CLASS+ '-1', '', {\n root: {\n height: undefined\n },\n tabItem: {\n justifyContent: 'space-between' \n },\n activeTabItem: {\n borderTopWidth: 4,\n borderTopColor: themeVariables.tabbarIconColor\n },\n tabIcon: {\n root: {\n paddingTop: 8,\n paddingBottom: 8,\n borderBottomWidth: 0\n }\n },\n tabLabel: {\n marginTop: 0\n }\n } as WmTabbarStyles);\n addStyle('clipped-tabbar', '', {\n root:{\n backgroundColor: themeVariables.transparent,\n marginTop: -88\n },\n menu: {\n backgroundColor: themeVariables.transparent\n },\n centerHubItem: {\n width: 70,\n height: 70,\n shadowColor: 'grey',\n shadowOpacity: 0.1,\n opacity: 1,\n shadowOffset: { width: 2, height: 0 },\n shadowRadius: 2,\n borderRadius: 35,\n position: 'absolute',\n bottom: 28,\n alignItems: 'center',\n justifyContent: 'center',\n backgroundColor: themeVariables.centerHubItemColor,\n left: (themeVariables.maxWidth/2) - 35\n },\n centerHubIcon: {\n root: {\n alignSelf: 'center',\n paddingBottom: 0,\n borderBottomColor: themeVariables.transparent,\n borderBottomWidth: 0 \n },\n icon: {\n fontSize: 24,\n color: themeVariables.centerHubIconColor\n }\n } as WmIconStyles, \n centerHubLabel:{\n color: themeVariables.centerHubLabelColor,\n marginTop: 0,\n paddingBottom: 4\n }\n })\n});"],"mappings":"AAAA,OAAOA,UAAU,MAAoB,wCAAwC;AAC7E,SAAqBC,YAAY,QAAQ,+CAA+C;AAmBxF,OAAO,MAAMC,aAAa,GAA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Q,EAAE,EAAE;QACZE,KAAK,EAAGxC,cAAc,CAACiE;MAC3B;IACJ,CAAiB;IACjBV,cAAc,EAAC;MACXf,KAAK,EAAGxC,cAAc,CAACkE,mBAAmB;MAC1CrB,SAAS,EAAE,CAAC;MACZrB,aAAa,EAAE;IACnB;EACJ,CAAC,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import { AccessibilityInfo } from 'react-native';
|
|
2
|
+
import { isAndroid, isWebPreviewMode, removeUndefinedKeys } from './utils';
|
|
3
|
+
let _isScreenReaderEnabled = false;
|
|
4
|
+
AccessibilityInfo.addEventListener('screenReaderChanged', flag => {
|
|
5
|
+
_isScreenReaderEnabled = flag;
|
|
6
|
+
});
|
|
7
|
+
export const isScreenReaderEnabled = () => _isScreenReaderEnabled;
|
|
8
|
+
async function getScreenReaderStatus() {
|
|
9
|
+
_isScreenReaderEnabled = !isWebPreviewMode() && (await AccessibilityInfo.isScreenReaderEnabled());
|
|
10
|
+
}
|
|
11
|
+
getScreenReaderStatus();
|
|
12
|
+
export let AccessibilityWidgetType = /*#__PURE__*/function (AccessibilityWidgetType) {
|
|
13
|
+
AccessibilityWidgetType["BUTTON"] = "button";
|
|
14
|
+
AccessibilityWidgetType["PICTURE"] = "picture";
|
|
15
|
+
AccessibilityWidgetType["TEXT"] = "text";
|
|
16
|
+
AccessibilityWidgetType["NUMBER"] = "number";
|
|
17
|
+
AccessibilityWidgetType["TEXTAREA"] = "textarea";
|
|
18
|
+
AccessibilityWidgetType["SELECT"] = "select";
|
|
19
|
+
AccessibilityWidgetType["CHIPS"] = "chips";
|
|
20
|
+
AccessibilityWidgetType["CURRENCY"] = "currency";
|
|
21
|
+
AccessibilityWidgetType["RADIOSET"] = "radioset";
|
|
22
|
+
AccessibilityWidgetType["CHECKBOX"] = "checkbox";
|
|
23
|
+
AccessibilityWidgetType["TOGGLE"] = "toggle";
|
|
24
|
+
AccessibilityWidgetType["SWITCH"] = "switch";
|
|
25
|
+
AccessibilityWidgetType["DATE"] = "date";
|
|
26
|
+
AccessibilityWidgetType["VIDEO"] = "video";
|
|
27
|
+
AccessibilityWidgetType["PROGRESSBAR"] = "progressbar";
|
|
28
|
+
AccessibilityWidgetType["PROGRESSCIRCLE"] = "progresscircle";
|
|
29
|
+
AccessibilityWidgetType["LABEL"] = "label";
|
|
30
|
+
AccessibilityWidgetType["ANCHOR"] = "anchor";
|
|
31
|
+
AccessibilityWidgetType["MESSAGE"] = "message";
|
|
32
|
+
AccessibilityWidgetType["SEARCH"] = "search";
|
|
33
|
+
AccessibilityWidgetType["ICON"] = "icon";
|
|
34
|
+
AccessibilityWidgetType["NAV"] = "nav";
|
|
35
|
+
AccessibilityWidgetType["POVOVER"] = "popover";
|
|
36
|
+
AccessibilityWidgetType["WEBVIEW"] = "webview";
|
|
37
|
+
AccessibilityWidgetType["LINECHART"] = "linechart";
|
|
38
|
+
return AccessibilityWidgetType;
|
|
39
|
+
}({});
|
|
40
|
+
;
|
|
41
|
+
export const getAccessibilityProps = (widgetType, accessibilityProps) => {
|
|
42
|
+
let props = {
|
|
43
|
+
accessible: true
|
|
44
|
+
};
|
|
45
|
+
if (!_isScreenReaderEnabled) {
|
|
46
|
+
return {};
|
|
47
|
+
}
|
|
48
|
+
switch (widgetType) {
|
|
49
|
+
case AccessibilityWidgetType.BUTTON:
|
|
50
|
+
case AccessibilityWidgetType.TEXT:
|
|
51
|
+
case AccessibilityWidgetType.NUMBER:
|
|
52
|
+
case AccessibilityWidgetType.TEXTAREA:
|
|
53
|
+
case AccessibilityWidgetType.SELECT:
|
|
54
|
+
case AccessibilityWidgetType.CURRENCY:
|
|
55
|
+
case AccessibilityWidgetType.TOGGLE:
|
|
56
|
+
case AccessibilityWidgetType.DATE:
|
|
57
|
+
case AccessibilityWidgetType.LABEL:
|
|
58
|
+
case AccessibilityWidgetType.ANCHOR:
|
|
59
|
+
case AccessibilityWidgetType.MESSAGE:
|
|
60
|
+
case AccessibilityWidgetType.SEARCH:
|
|
61
|
+
case AccessibilityWidgetType.PICTURE:
|
|
62
|
+
case AccessibilityWidgetType.ICON:
|
|
63
|
+
case AccessibilityWidgetType.NAV:
|
|
64
|
+
case AccessibilityWidgetType.POVOVER:
|
|
65
|
+
case AccessibilityWidgetType.WEBVIEW:
|
|
66
|
+
case AccessibilityWidgetType.LINECHART:
|
|
67
|
+
case AccessibilityWidgetType.VIDEO:
|
|
68
|
+
{
|
|
69
|
+
props.accessibilityLabel = accessibilityProps.accessibilitylabel || accessibilityProps.caption;
|
|
70
|
+
props.accessibilityHint = accessibilityProps.hint;
|
|
71
|
+
props.accessibilityRole = accessibilityProps.accessibilityrole;
|
|
72
|
+
if (widgetType === AccessibilityWidgetType.BUTTON || widgetType === AccessibilityWidgetType.TEXT || widgetType === AccessibilityWidgetType.NUMBER || widgetType === AccessibilityWidgetType.TEXTAREA || widgetType === AccessibilityWidgetType.SELECT || widgetType === AccessibilityWidgetType.TOGGLE || widgetType === AccessibilityWidgetType.DATE) {
|
|
73
|
+
props.accessibilityState = {
|
|
74
|
+
disabled: accessibilityProps.disabled
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
if ((widgetType === AccessibilityWidgetType.TEXT || widgetType === AccessibilityWidgetType.NUMBER || widgetType === AccessibilityWidgetType.TEXTAREA || widgetType === AccessibilityWidgetType.SELECT || widgetType === AccessibilityWidgetType.CURRENCY || widgetType === AccessibilityWidgetType.TOGGLE) && isAndroid()) {
|
|
78
|
+
props.accessibilityLabelledBy = accessibilityProps.accessibilitylabelledby;
|
|
79
|
+
}
|
|
80
|
+
if (widgetType === AccessibilityWidgetType.NUMBER || widgetType === AccessibilityWidgetType.CURRENCY) {
|
|
81
|
+
props.accessibilityValue = {
|
|
82
|
+
min: accessibilityProps.minvalue,
|
|
83
|
+
max: accessibilityProps.maxvalue
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
if (widgetType === AccessibilityWidgetType.SELECT) {
|
|
87
|
+
props.accessibilityState = {
|
|
88
|
+
...props.accessibilityState,
|
|
89
|
+
expanded: accessibilityProps.expanded
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
if (widgetType === AccessibilityWidgetType.TOGGLE) {
|
|
93
|
+
props.accessibilityState = {
|
|
94
|
+
...props.accessibilityState,
|
|
95
|
+
selected: accessibilityProps.selected
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
break;
|
|
99
|
+
}
|
|
100
|
+
case AccessibilityWidgetType.CHIPS:
|
|
101
|
+
{
|
|
102
|
+
props.accessibilityLabel = accessibilityProps.accessibilitylabel || accessibilityProps.caption;
|
|
103
|
+
props.accessibilityHint = accessibilityProps.hint;
|
|
104
|
+
props.accessibilityState = {
|
|
105
|
+
disabled: accessibilityProps.disabled,
|
|
106
|
+
selected: accessibilityProps.selected
|
|
107
|
+
};
|
|
108
|
+
break;
|
|
109
|
+
}
|
|
110
|
+
case AccessibilityWidgetType.RADIOSET:
|
|
111
|
+
{
|
|
112
|
+
props.accessibilityState = {
|
|
113
|
+
disabled: accessibilityProps.readonly || accessibilityProps.disabled,
|
|
114
|
+
selected: accessibilityProps.selected
|
|
115
|
+
};
|
|
116
|
+
break;
|
|
117
|
+
}
|
|
118
|
+
case AccessibilityWidgetType.CHECKBOX:
|
|
119
|
+
{
|
|
120
|
+
props.accessibilityState = {
|
|
121
|
+
disabled: accessibilityProps.readonly || accessibilityProps.disabled,
|
|
122
|
+
checked: accessibilityProps.checked
|
|
123
|
+
};
|
|
124
|
+
break;
|
|
125
|
+
}
|
|
126
|
+
case AccessibilityWidgetType.SWITCH:
|
|
127
|
+
{
|
|
128
|
+
props.accessibilityState = {
|
|
129
|
+
disabled: accessibilityProps.disabled,
|
|
130
|
+
selected: accessibilityProps.selected
|
|
131
|
+
};
|
|
132
|
+
break;
|
|
133
|
+
}
|
|
134
|
+
case AccessibilityWidgetType.PROGRESSBAR:
|
|
135
|
+
case AccessibilityWidgetType.PROGRESSCIRCLE:
|
|
136
|
+
{
|
|
137
|
+
props.accessibilityLabel = accessibilityProps.accessibilitylabel || accessibilityProps.caption;
|
|
138
|
+
props.accessibilityRole = accessibilityProps.accessibilityrole;
|
|
139
|
+
break;
|
|
140
|
+
}
|
|
141
|
+
default:
|
|
142
|
+
break;
|
|
143
|
+
}
|
|
144
|
+
const finalProps = removeUndefinedKeys(props);
|
|
145
|
+
// console.log('finalProps', finalProps)
|
|
146
|
+
|
|
147
|
+
return finalProps;
|
|
148
|
+
};
|
|
149
|
+
//# sourceMappingURL=accessibility.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["AccessibilityInfo","isAndroid","isWebPreviewMode","removeUndefinedKeys","_isScreenReaderEnabled","addEventListener","flag","isScreenReaderEnabled","getScreenReaderStatus","AccessibilityWidgetType","getAccessibilityProps","widgetType","accessibilityProps","props","accessible","BUTTON","TEXT","NUMBER","TEXTAREA","SELECT","CURRENCY","TOGGLE","DATE","LABEL","ANCHOR","MESSAGE","SEARCH","PICTURE","ICON","NAV","POVOVER","WEBVIEW","LINECHART","VIDEO","accessibilityLabel","accessibilitylabel","caption","accessibilityHint","hint","accessibilityRole","accessibilityrole","accessibilityState","disabled","accessibilityLabelledBy","accessibilitylabelledby","accessibilityValue","min","minvalue","max","maxvalue","expanded","selected","CHIPS","RADIOSET","readonly","CHECKBOX","checked","SWITCH","PROGRESSBAR","PROGRESSCIRCLE","finalProps"],"sources":["accessibility.ts"],"sourcesContent":["import { AccessibilityInfo } from 'react-native';\nimport { isAndroid, isWebPreviewMode, removeUndefinedKeys } from './utils';\n\nlet _isScreenReaderEnabled = false;\n\nAccessibilityInfo.addEventListener(\n 'screenReaderChanged',\n flag => {\n _isScreenReaderEnabled = flag;\n },\n);\n\nexport const isScreenReaderEnabled = () => _isScreenReaderEnabled;\n\nasync function getScreenReaderStatus() {\n _isScreenReaderEnabled = (!isWebPreviewMode() && await AccessibilityInfo.isScreenReaderEnabled());\n}\n\ngetScreenReaderStatus();\n\nexport enum AccessibilityWidgetType {\n BUTTON = 'button',\n PICTURE = 'picture',\n TEXT = 'text',\n NUMBER = 'number',\n TEXTAREA = 'textarea',\n SELECT = 'select',\n CHIPS = 'chips',\n CURRENCY = 'currency',\n RADIOSET = 'radioset',\n CHECKBOX = 'checkbox',\n TOGGLE = 'toggle',\n SWITCH = 'switch',\n DATE = 'date',\n VIDEO = 'video',\n PROGRESSBAR = 'progressbar',\n PROGRESSCIRCLE = 'progresscircle',\n LABEL = 'label',\n ANCHOR = 'anchor',\n MESSAGE = 'message',\n SEARCH = 'search',\n ICON = 'icon',\n NAV = 'nav',\n POVOVER = 'popover',\n WEBVIEW = 'webview',\n LINECHART = 'linechart',\n};\n\n \nexport type AccessibilityPropsType = {\n accessible?: boolean;\n accessibilityLabel?: string;\n accessibilityLabelledBy?: string;\n accessibilityHint?: string;\n accessibilityRole?: 'button' | 'link' | 'header' | 'search' | 'image' | 'imagebutton' | 'none' | 'summary' | 'text' | 'progressbar' | 'grid' | 'alert';\n accessibilityState?: {\n disabled?: boolean;\n selected?: boolean;\n checked?: boolean;\n expanded?: boolean;\n };\n accessibilityValue?: {\n min?: number;\n max?: number;\n now?: number;\n text?: string;\n };\n accessibilityActions?: Array<{\n name: string;\n label?: string;\n }>;\n accessibilityLiveRegion?: 'none' | 'polite' | 'assertive';\n accessibilityLanguage?: any;\n accessibilityElementsHidden?: boolean;\n accessibilityViewIsModal?: boolean;\n};\n \n\nexport const getAccessibilityProps = (widgetType: AccessibilityWidgetType, accessibilityProps: AccessibilityPropsType | any) => {\n let props: AccessibilityPropsType = {accessible: true};\n if (!_isScreenReaderEnabled) {\n return {};\n }\n switch (widgetType) {\n case AccessibilityWidgetType.BUTTON:\n case AccessibilityWidgetType.TEXT:\n case AccessibilityWidgetType.NUMBER:\n case AccessibilityWidgetType.TEXTAREA:\n case AccessibilityWidgetType.SELECT:\n case AccessibilityWidgetType.CURRENCY:\n case AccessibilityWidgetType.TOGGLE:\n case AccessibilityWidgetType.DATE:\n case AccessibilityWidgetType.LABEL:\n case AccessibilityWidgetType.ANCHOR:\n case AccessibilityWidgetType.MESSAGE: \n case AccessibilityWidgetType.SEARCH: \n case AccessibilityWidgetType.PICTURE: \n case AccessibilityWidgetType.ICON:\n case AccessibilityWidgetType.NAV:\n case AccessibilityWidgetType.POVOVER:\n case AccessibilityWidgetType.WEBVIEW:\n case AccessibilityWidgetType.LINECHART: \n case AccessibilityWidgetType.VIDEO: {\n props.accessibilityLabel = accessibilityProps.accessibilitylabel || accessibilityProps.caption;\n props.accessibilityHint = accessibilityProps.hint;\n props.accessibilityRole = accessibilityProps.accessibilityrole;\n\n if (\n widgetType === AccessibilityWidgetType.BUTTON ||\n widgetType === AccessibilityWidgetType.TEXT ||\n widgetType === AccessibilityWidgetType.NUMBER ||\n widgetType === AccessibilityWidgetType.TEXTAREA ||\n widgetType === AccessibilityWidgetType.SELECT ||\n widgetType === AccessibilityWidgetType.TOGGLE ||\n widgetType === AccessibilityWidgetType.DATE\n ) {\n props.accessibilityState = { disabled: accessibilityProps.disabled };\n }\n if (\n (widgetType === AccessibilityWidgetType.TEXT ||\n widgetType === AccessibilityWidgetType.NUMBER ||\n widgetType === AccessibilityWidgetType.TEXTAREA ||\n widgetType === AccessibilityWidgetType.SELECT ||\n widgetType === AccessibilityWidgetType.CURRENCY ||\n widgetType === AccessibilityWidgetType.TOGGLE) &&\n isAndroid()\n ) {\n props.accessibilityLabelledBy =\n accessibilityProps.accessibilitylabelledby;\n }\n if (\n widgetType === AccessibilityWidgetType.NUMBER ||\n widgetType === AccessibilityWidgetType.CURRENCY\n ) {\n props.accessibilityValue = {\n min: accessibilityProps.minvalue,\n max: accessibilityProps.maxvalue,\n };\n }\n if (widgetType === AccessibilityWidgetType.SELECT) {\n props.accessibilityState = {\n ...props.accessibilityState,\n expanded: accessibilityProps.expanded,\n };\n }\n if (widgetType === AccessibilityWidgetType.TOGGLE) {\n props.accessibilityState = {\n ...props.accessibilityState,\n selected: accessibilityProps.selected,\n };\n }\n break;\n }\n\n case AccessibilityWidgetType.CHIPS: {\n props.accessibilityLabel = accessibilityProps.accessibilitylabel || accessibilityProps.caption;\n props.accessibilityHint = accessibilityProps.hint;\n props.accessibilityState = {\n disabled: accessibilityProps.disabled,\n selected: accessibilityProps.selected,\n };\n break;\n }\n\n case AccessibilityWidgetType.RADIOSET: {\n props.accessibilityState = {\n disabled: accessibilityProps.readonly || accessibilityProps.disabled,\n selected: accessibilityProps.selected,\n };\n break;\n }\n\n case AccessibilityWidgetType.CHECKBOX: {\n props.accessibilityState = {\n disabled: accessibilityProps.readonly || accessibilityProps.disabled,\n checked: accessibilityProps.checked,\n };\n break;\n }\n\n case AccessibilityWidgetType.SWITCH: {\n props.accessibilityState = {\n disabled: accessibilityProps.disabled,\n selected: accessibilityProps.selected,\n };\n break;\n }\n case AccessibilityWidgetType.PROGRESSBAR:\n case AccessibilityWidgetType.PROGRESSCIRCLE: {\n props.accessibilityLabel = accessibilityProps.accessibilitylabel || accessibilityProps.caption;\n props.accessibilityRole = accessibilityProps.accessibilityrole;\n break;\n }\n default:\n break;\n }\n\n const finalProps = removeUndefinedKeys(props);\n // console.log('finalProps', finalProps)\n\n return finalProps;\n}\n "],"mappings":"AAAA,SAASA,iBAAiB,QAAQ,cAAc;AAChD,SAASC,SAAS,EAAEC,gBAAgB,EAAEC,mBAAmB,QAAQ,SAAS;AAE1E,IAAIC,sBAAsB,GAAG,KAAK;AAElCJ,iBAAiB,CAACK,gBAAgB,CAChC,qBAAqB,EACrBC,IAAI,IAAI;EACNF,sBAAsB,GAAGE,IAAI;AAC/B,CACF,CAAC;AAED,OAAO,MAAMC,qBAAqB,GAAGA,CAAA,KAAMH,sBAAsB;AAEjE,eAAeI,qBAAqBA,CAAA,EAAG;EACrCJ,sBAAsB,GAAI,CAACF,gBAAgB,CAAC,CAAC,KAAI,MAAMF,iBAAiB,CAACO,qBAAqB,CAAC,CAAC,CAAC;AACnG;AAEAC,qBAAqB,CAAC,CAAC;AAEvB,WAAYC,uBAAuB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,EAAE5C,kBAAkB,CAAC4C;QAC9B,CAAC;QACD;MACF;IAEA,KAAK/C,uBAAuB,CAACgD,MAAM;MAAE;QACnC5C,KAAK,CAAC4B,kBAAkB,GAAG;UACzBC,QAAQ,EAAE9B,kBAAkB,CAAC8B,QAAQ;UACrCS,QAAQ,EAAEvC,kBAAkB,CAACuC;QAC/B,CAAC;QACD;MACF;IACA,KAAK1C,uBAAuB,CAACiD,WAAW;IACxC,KAAKjD,uBAAuB,CAACkD,cAAc;MAAE;QAC3C9C,KAAK,CAACqB,kBAAkB,GAAGtB,kBAAkB,CAACuB,kBAAkB,IAAIvB,kBAAkB,CAACwB,OAAO;QAC9FvB,KAAK,CAAC0B,iBAAiB,GAAG3B,kBAAkB,CAAC4B,iBAAiB;QAC9D;MACF;IACA;MACE;EACJ;EAEA,MAAMoB,UAAU,GAAGzD,mBAAmB,CAACU,KAAK,CAAC;EAC7C;;EAEA,OAAO+C,UAAU;AACnB,CAAC"}
|
|
@@ -4,7 +4,7 @@ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typ
|
|
|
4
4
|
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
5
5
|
import { assign, isUndefined, isNil } from 'lodash';
|
|
6
6
|
import React from 'react';
|
|
7
|
-
import { Platform } from 'react-native';
|
|
7
|
+
import { AccessibilityInfo, Platform } from 'react-native';
|
|
8
8
|
import * as Animatable from 'react-native-animatable';
|
|
9
9
|
import ThemeVariables from '@wavemaker/app-rn-runtime/styles/theme.variables';
|
|
10
10
|
import { StyleProps, getStyleName } from '@wavemaker/app-rn-runtime/styles/style-props';
|
|
@@ -20,6 +20,7 @@ import { HideMode } from './if.component';
|
|
|
20
20
|
import { AssetConsumer } from './asset.provider';
|
|
21
21
|
import { FixedView } from './fixed-view.component';
|
|
22
22
|
import { TextIdPrefixConsumer } from './testid.provider';
|
|
23
|
+
import { isScreenReaderEnabled } from './accessibility';
|
|
23
24
|
export const WIDGET_LOGGER = ROOT_LOGGER.extend('widget');
|
|
24
25
|
export const ParentContext = /*#__PURE__*/React.createContext(null);
|
|
25
26
|
export class BaseComponentState {
|
|
@@ -51,6 +52,7 @@ export class BaseProps extends StyleProps {
|
|
|
51
52
|
_defineProperty(this, "listener", null);
|
|
52
53
|
_defineProperty(this, "showindevice", null);
|
|
53
54
|
_defineProperty(this, "showskeleton", false);
|
|
55
|
+
_defineProperty(this, "deferload", false);
|
|
54
56
|
}
|
|
55
57
|
}
|
|
56
58
|
export class BaseComponent extends React.Component {
|
|
@@ -76,7 +78,9 @@ export class BaseComponent extends React.Component {
|
|
|
76
78
|
_defineProperty(this, "loadAsset", null);
|
|
77
79
|
_defineProperty(this, "i18nService", injector.I18nService.get());
|
|
78
80
|
_defineProperty(this, "testIdPrefix", '');
|
|
81
|
+
_defineProperty(this, "_showView", true);
|
|
79
82
|
this.state = defaultState || {};
|
|
83
|
+
this.notifier.name = this.props.name || '';
|
|
80
84
|
this.propertyProvider = new PropsProvider(assign({
|
|
81
85
|
show: true
|
|
82
86
|
}, defaultProps), assign({}, markupProps), (name, $new, $old) => {
|
|
@@ -92,12 +96,14 @@ export class BaseComponent extends React.Component {
|
|
|
92
96
|
}
|
|
93
97
|
}
|
|
94
98
|
if (name === 'showskeleton' && this.initialized) {
|
|
95
|
-
this.cleanRefresh();
|
|
99
|
+
setTimeout(() => this.cleanRefresh(), 100);
|
|
96
100
|
}
|
|
97
101
|
this.onPropertyChange(name, $new, $old);
|
|
98
102
|
});
|
|
99
103
|
//@ts-ignore
|
|
100
104
|
this.state.props = this.propertyProvider.get();
|
|
105
|
+
//@ts-ignore
|
|
106
|
+
this._showView = !this.props.deferload;
|
|
101
107
|
this.propertyProvider.check();
|
|
102
108
|
//@ts-ignore
|
|
103
109
|
this.proxy = new Proxy(this, {
|
|
@@ -130,6 +136,11 @@ export class BaseComponent extends React.Component {
|
|
|
130
136
|
this.cleanup.push(this.theme.subscribe(ThemeEvent.CHANGE, () => {
|
|
131
137
|
this.forceUpdate();
|
|
132
138
|
}));
|
|
139
|
+
this.cleanup.push(AccessibilityInfo.addEventListener('screenReaderChanged', () => {
|
|
140
|
+
setTimeout(() => {
|
|
141
|
+
this.forceUpdate();
|
|
142
|
+
}, 100);
|
|
143
|
+
}).remove);
|
|
133
144
|
this.cleanup.push(() => {
|
|
134
145
|
this.destroyParentListeners();
|
|
135
146
|
});
|
|
@@ -137,6 +148,9 @@ export class BaseComponent extends React.Component {
|
|
|
137
148
|
subscribe(event, fn) {
|
|
138
149
|
return this.notifier.subscribe(event, fn);
|
|
139
150
|
}
|
|
151
|
+
notify(event, args) {
|
|
152
|
+
return this.notifier.notify(event, args);
|
|
153
|
+
}
|
|
140
154
|
get isRTL() {
|
|
141
155
|
return this.i18nService.isRTLLocale();
|
|
142
156
|
}
|
|
@@ -234,6 +248,7 @@ export class BaseComponent extends React.Component {
|
|
|
234
248
|
this.props.listener.onComponentDestroy(this.proxy);
|
|
235
249
|
}
|
|
236
250
|
this.cleanup.forEach(f => f && f());
|
|
251
|
+
this.notifier.destroy();
|
|
237
252
|
this.notifier.notify('destroy', []);
|
|
238
253
|
}
|
|
239
254
|
componentDidUpdate(prevProps, prevState, snapshot) {
|
|
@@ -253,6 +268,9 @@ export class BaseComponent extends React.Component {
|
|
|
253
268
|
}
|
|
254
269
|
}
|
|
255
270
|
}
|
|
271
|
+
showView() {
|
|
272
|
+
return this.isVisible();
|
|
273
|
+
}
|
|
256
274
|
isVisible() {
|
|
257
275
|
const show = this.state.props.show;
|
|
258
276
|
return show !== false && show !== 'false' && show !== '0' && !isNil(show);
|
|
@@ -272,6 +290,7 @@ export class BaseComponent extends React.Component {
|
|
|
272
290
|
setParent(parent) {
|
|
273
291
|
if (parent && this.parent !== parent) {
|
|
274
292
|
this.parent = parent;
|
|
293
|
+
this.notifier.setParent(parent.notifier);
|
|
275
294
|
this.parentListenerDestroyers = [this.parent.subscribe('forceUpdate', () => {
|
|
276
295
|
this.cleanRefresh();
|
|
277
296
|
}), this.parent.subscribe('destroy', () => {
|
|
@@ -346,6 +365,9 @@ export class BaseComponent extends React.Component {
|
|
|
346
365
|
}
|
|
347
366
|
getTestProps(suffix) {
|
|
348
367
|
let id = this.getTestId(suffix);
|
|
368
|
+
if (isScreenReaderEnabled()) {
|
|
369
|
+
return {};
|
|
370
|
+
}
|
|
349
371
|
if (Platform.OS === 'android' || Platform.OS === 'web') {
|
|
350
372
|
return {
|
|
351
373
|
accessibilityLabel: id,
|
|
@@ -390,13 +412,14 @@ export class BaseComponent extends React.Component {
|
|
|
390
412
|
}
|
|
391
413
|
render() {
|
|
392
414
|
const props = this.state.props;
|
|
393
|
-
if (this.state.hide || !this.isVisible() && this.hideMode === HideMode.DONOT_ADD_TO_DOM) {
|
|
394
|
-
return null;
|
|
395
|
-
}
|
|
396
415
|
this.isFixed = false;
|
|
397
416
|
const selectedLocale = this.i18nService.getSelectedLocale();
|
|
398
417
|
return this.getDependenciesFromContext(() => {
|
|
399
418
|
WIDGET_LOGGER.info(() => `${this.props.name || this.constructor.name} is rendering.`);
|
|
419
|
+
this._showView = this._showView || this.showView();
|
|
420
|
+
if (this.state.hide || !this.isVisible() && this.hideMode === HideMode.DONOT_ADD_TO_DOM || !this._showView) {
|
|
421
|
+
return null;
|
|
422
|
+
}
|
|
400
423
|
const classname = this.getStyleClassName();
|
|
401
424
|
this.styles = this.theme.mergeStyle(this.getDefaultStyles(), {
|
|
402
425
|
text: this.theme.getStyle('app-' + selectedLocale)
|