@wavemaker/app-rn-runtime 11.4.0-next.141708 → 11.4.0-next.24560
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/actions/notification-action.js +5 -4
- app-rn-runtime/actions/notification-action.js.map +1 -1
- app-rn-runtime/components/advanced/carousel/carousel-content/carousel-content.component.js +1 -1
- app-rn-runtime/components/advanced/carousel/carousel-content/carousel-content.component.js.map +1 -1
- app-rn-runtime/components/advanced/carousel/carousel-template/carousel-template.component.js +1 -1
- app-rn-runtime/components/advanced/carousel/carousel-template/carousel-template.component.js.map +1 -1
- app-rn-runtime/components/advanced/carousel/carousel.component.js +1 -1
- app-rn-runtime/components/advanced/carousel/carousel.component.js.map +1 -1
- app-rn-runtime/components/advanced/login/login.component.js +1 -1
- app-rn-runtime/components/advanced/login/login.component.js.map +1 -1
- app-rn-runtime/components/advanced/network-info-toaster/network-info-toaster.component.js +5 -5
- app-rn-runtime/components/advanced/network-info-toaster/network-info-toaster.component.js.map +1 -1
- app-rn-runtime/components/advanced/webview/webview.component.js +1 -1
- app-rn-runtime/components/advanced/webview/webview.component.js.map +1 -1
- app-rn-runtime/components/basic/anchor/anchor.component.js +1 -1
- app-rn-runtime/components/basic/anchor/anchor.component.js.map +1 -1
- app-rn-runtime/components/basic/button/button.component.js +1 -1
- app-rn-runtime/components/basic/button/button.component.js.map +1 -1
- app-rn-runtime/components/basic/buttongroup/buttongroup.component.js +1 -1
- app-rn-runtime/components/basic/buttongroup/buttongroup.component.js.map +1 -1
- app-rn-runtime/components/basic/custom/custom.component.js +25 -0
- app-rn-runtime/components/basic/custom/custom.component.js.map +1 -0
- app-rn-runtime/components/basic/custom/custom.props.js +16 -0
- app-rn-runtime/components/basic/custom/custom.props.js.map +1 -0
- app-rn-runtime/components/basic/custom/custom.styles.js +18 -0
- app-rn-runtime/components/basic/custom/custom.styles.js.map +1 -0
- app-rn-runtime/components/basic/icon/icon.component.js +1 -1
- app-rn-runtime/components/basic/icon/icon.component.js.map +1 -1
- app-rn-runtime/components/basic/label/label.component.js +1 -1
- app-rn-runtime/components/basic/label/label.component.js.map +1 -1
- app-rn-runtime/components/basic/lottie/lottie.component.js +137 -0
- app-rn-runtime/components/basic/lottie/lottie.component.js.map +1 -0
- app-rn-runtime/components/basic/lottie/lottie.props.js +14 -0
- app-rn-runtime/components/basic/lottie/lottie.props.js.map +1 -0
- app-rn-runtime/components/basic/lottie/lottie.styles.js +11 -0
- app-rn-runtime/components/basic/lottie/lottie.styles.js.map +1 -0
- app-rn-runtime/components/basic/message/message.component.js +1 -1
- app-rn-runtime/components/basic/message/message.component.js.map +1 -1
- app-rn-runtime/components/basic/picture/picture.component.js +37 -26
- app-rn-runtime/components/basic/picture/picture.component.js.map +1 -1
- app-rn-runtime/components/basic/progress-bar/progress-bar.component.js +3 -2
- app-rn-runtime/components/basic/progress-bar/progress-bar.component.js.map +1 -1
- app-rn-runtime/components/basic/progress-circle/progress-circle.component.js +1 -1
- app-rn-runtime/components/basic/progress-circle/progress-circle.component.js.map +1 -1
- app-rn-runtime/components/basic/search/search.component.js +4 -1
- app-rn-runtime/components/basic/search/search.component.js.map +1 -1
- app-rn-runtime/components/basic/spinner/spinner.component.js +10 -10
- app-rn-runtime/components/basic/spinner/spinner.component.js.map +1 -1
- app-rn-runtime/components/basic/video/video.component.js +56 -0
- app-rn-runtime/components/basic/video/video.component.js.map +1 -0
- app-rn-runtime/components/basic/video/video.props.js +22 -0
- app-rn-runtime/components/basic/video/video.props.js.map +1 -0
- app-rn-runtime/components/basic/video/video.styles.js +11 -0
- app-rn-runtime/components/basic/video/video.styles.js.map +1 -0
- app-rn-runtime/components/container/accordion/accordion.component.js +1 -1
- app-rn-runtime/components/container/accordion/accordion.component.js.map +1 -1
- app-rn-runtime/components/container/accordion/accordionpane/accordionpane.component.js +1 -1
- app-rn-runtime/components/container/accordion/accordionpane/accordionpane.component.js.map +1 -1
- app-rn-runtime/components/container/container.component.js +1 -1
- app-rn-runtime/components/container/container.component.js.map +1 -1
- app-rn-runtime/components/container/layoutgrid/gridcolumn/gridcolumn.component.js +1 -1
- app-rn-runtime/components/container/layoutgrid/gridcolumn/gridcolumn.component.js.map +1 -1
- app-rn-runtime/components/container/layoutgrid/gridrow/gridrow.component.js +1 -1
- app-rn-runtime/components/container/layoutgrid/gridrow/gridrow.component.js.map +1 -1
- app-rn-runtime/components/container/layoutgrid/layoutgrid.component.js +1 -1
- app-rn-runtime/components/container/layoutgrid/layoutgrid.component.js.map +1 -1
- app-rn-runtime/components/container/linearlayout/linearlayout.component.js +1 -1
- app-rn-runtime/components/container/linearlayout/linearlayout.component.js.map +1 -1
- app-rn-runtime/components/container/linearlayout/linearlayoutitem/linearlayoutitem.component.js +1 -1
- app-rn-runtime/components/container/linearlayout/linearlayoutitem/linearlayoutitem.component.js.map +1 -1
- app-rn-runtime/components/container/panel/panel-content/panel-content.component.js +1 -1
- app-rn-runtime/components/container/panel/panel-content/panel-content.component.js.map +1 -1
- app-rn-runtime/components/container/panel/panel-footer/panel-footer.component.js +1 -1
- app-rn-runtime/components/container/panel/panel-footer/panel-footer.component.js.map +1 -1
- app-rn-runtime/components/container/panel/panel.component.js +1 -1
- app-rn-runtime/components/container/panel/panel.component.js.map +1 -1
- app-rn-runtime/components/container/tabs/tabheader/tabheader.component.js +12 -4
- app-rn-runtime/components/container/tabs/tabheader/tabheader.component.js.map +1 -1
- app-rn-runtime/components/container/tabs/tabheader/tabheader.styles.js +2 -1
- app-rn-runtime/components/container/tabs/tabheader/tabheader.styles.js.map +1 -1
- app-rn-runtime/components/container/tabs/tabpane/tabpane.component.js +5 -2
- app-rn-runtime/components/container/tabs/tabpane/tabpane.component.js.map +1 -1
- app-rn-runtime/components/container/tabs/tabs.component.js +80 -64
- app-rn-runtime/components/container/tabs/tabs.component.js.map +1 -1
- app-rn-runtime/components/container/tabs/tabs.props.js +1 -0
- app-rn-runtime/components/container/tabs/tabs.props.js.map +1 -1
- app-rn-runtime/components/container/tabs/tabs.styles.js +1 -1
- app-rn-runtime/components/container/tabs/tabs.styles.js.map +1 -1
- app-rn-runtime/components/container/tile/tile.component.js +1 -1
- app-rn-runtime/components/container/tile/tile.component.js.map +1 -1
- app-rn-runtime/components/container/wizard/wizard.component.js +1 -1
- app-rn-runtime/components/container/wizard/wizard.component.js.map +1 -1
- app-rn-runtime/components/container/wizard/wizardstep/wizardstep.component.js +1 -1
- app-rn-runtime/components/container/wizard/wizardstep/wizardstep.component.js.map +1 -1
- app-rn-runtime/components/data/card/card-content/card-content.component.js +1 -1
- app-rn-runtime/components/data/card/card-content/card-content.component.js.map +1 -1
- app-rn-runtime/components/data/card/card-footer/card-footer.component.js +1 -1
- app-rn-runtime/components/data/card/card-footer/card-footer.component.js.map +1 -1
- app-rn-runtime/components/data/card/card.component.js +1 -1
- app-rn-runtime/components/data/card/card.component.js.map +1 -1
- app-rn-runtime/components/data/form/form-action/form-action.component.js +0 -6
- app-rn-runtime/components/data/form/form-action/form-action.component.js.map +1 -1
- app-rn-runtime/components/data/form/form-body/form-body.component.js +1 -1
- app-rn-runtime/components/data/form/form-body/form-body.component.js.map +1 -1
- app-rn-runtime/components/data/form/form-field/form-field.component.js +1 -1
- app-rn-runtime/components/data/form/form-field/form-field.component.js.map +1 -1
- app-rn-runtime/components/data/form/form-footer/form-footer.component.js +1 -1
- app-rn-runtime/components/data/form/form-footer/form-footer.component.js.map +1 -1
- app-rn-runtime/components/data/form/form.component.js +2 -31
- app-rn-runtime/components/data/form/form.component.js.map +1 -1
- app-rn-runtime/components/data/list/list-template/list-template.component.js +1 -1
- app-rn-runtime/components/data/list/list-template/list-template.component.js.map +1 -1
- app-rn-runtime/components/data/list/list.component.js +17 -8
- app-rn-runtime/components/data/list/list.component.js.map +1 -1
- app-rn-runtime/components/device/barcodescanner/barcodescanner.component.js +3 -2
- app-rn-runtime/components/device/barcodescanner/barcodescanner.component.js.map +1 -1
- app-rn-runtime/components/device/camera/camera.component.js +9 -4
- app-rn-runtime/components/device/camera/camera.component.js.map +1 -1
- app-rn-runtime/components/device/camera/camera.props.js +0 -1
- app-rn-runtime/components/device/camera/camera.props.js.map +1 -1
- app-rn-runtime/components/dialogs/dialog/dialog.component.js +1 -1
- app-rn-runtime/components/dialogs/dialog/dialog.component.js.map +1 -1
- app-rn-runtime/components/dialogs/dialogactions/dialogactions.component.js +1 -1
- app-rn-runtime/components/dialogs/dialogactions/dialogactions.component.js.map +1 -1
- app-rn-runtime/components/dialogs/dialogcontent/dialogcontent.component.js +1 -1
- app-rn-runtime/components/dialogs/dialogcontent/dialogcontent.component.js.map +1 -1
- app-rn-runtime/components/input/baseinput/baseinput.component.js +7 -0
- app-rn-runtime/components/input/baseinput/baseinput.component.js.map +1 -1
- app-rn-runtime/components/input/calendar/calendar.component.js +1 -1
- app-rn-runtime/components/input/calendar/calendar.component.js.map +1 -1
- app-rn-runtime/components/input/checkbox/checkbox.component.js +1 -16
- app-rn-runtime/components/input/checkbox/checkbox.component.js.map +1 -1
- app-rn-runtime/components/input/checkboxset/checkboxset.component.js +0 -38
- app-rn-runtime/components/input/checkboxset/checkboxset.component.js.map +1 -1
- app-rn-runtime/components/input/composite/composite.component.js +1 -1
- app-rn-runtime/components/input/composite/composite.component.js.map +1 -1
- app-rn-runtime/components/input/epoch/base-datetime.component.js +1 -1
- app-rn-runtime/components/input/epoch/base-datetime.component.js.map +1 -1
- app-rn-runtime/components/input/fileupload/fileupload.component.js +1 -1
- app-rn-runtime/components/input/fileupload/fileupload.component.js.map +1 -1
- app-rn-runtime/components/input/number/number.component.js +0 -9
- app-rn-runtime/components/input/number/number.component.js.map +1 -1
- app-rn-runtime/components/input/radioset/radioset.component.js +0 -40
- app-rn-runtime/components/input/radioset/radioset.component.js.map +1 -1
- app-rn-runtime/components/input/rating/rating.component.js +1 -1
- app-rn-runtime/components/input/rating/rating.component.js.map +1 -1
- app-rn-runtime/components/input/slider/slider.component.js +1 -1
- app-rn-runtime/components/input/slider/slider.component.js.map +1 -1
- app-rn-runtime/components/input/switch/switch.component.js +19 -22
- app-rn-runtime/components/input/switch/switch.component.js.map +1 -1
- app-rn-runtime/components/input/switch/switch.styles.js +7 -7
- app-rn-runtime/components/input/switch/switch.styles.js.map +1 -1
- app-rn-runtime/components/input/text/text.component.js +1 -10
- app-rn-runtime/components/input/text/text.component.js.map +1 -1
- app-rn-runtime/components/input/textarea/textarea.component.js +0 -10
- app-rn-runtime/components/input/textarea/textarea.component.js.map +1 -1
- app-rn-runtime/components/input/toggle/toggle.component.js +1 -1
- app-rn-runtime/components/input/toggle/toggle.component.js.map +1 -1
- app-rn-runtime/components/navigation/appnavbar/appnavbar.component.js +1 -1
- app-rn-runtime/components/navigation/appnavbar/appnavbar.component.js.map +1 -1
- app-rn-runtime/components/navigation/basenav/basenav.props.js +1 -0
- app-rn-runtime/components/navigation/basenav/basenav.props.js.map +1 -1
- app-rn-runtime/components/navigation/menu/menu.component.js +2 -1
- app-rn-runtime/components/navigation/menu/menu.component.js.map +1 -1
- app-rn-runtime/components/navigation/navbar/navbar.component.js +2 -0
- app-rn-runtime/components/navigation/navbar/navbar.component.js.map +1 -1
- app-rn-runtime/components/navigation/navitem/navitem.component.js +4 -3
- app-rn-runtime/components/navigation/navitem/navitem.component.js.map +1 -1
- app-rn-runtime/components/navigation/navitem/navitem.props.js +1 -0
- app-rn-runtime/components/navigation/navitem/navitem.props.js.map +1 -1
- app-rn-runtime/components/navigation/popover/popover.component.js +1 -1
- app-rn-runtime/components/navigation/popover/popover.component.js.map +1 -1
- app-rn-runtime/components/page/content/content.component.js +1 -1
- app-rn-runtime/components/page/content/content.component.js.map +1 -1
- app-rn-runtime/components/page/left-panel/left-panel.component.js +1 -1
- 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 +2 -2
- app-rn-runtime/components/page/page-content/page-content.component.js.map +1 -1
- app-rn-runtime/components/page/page.component.js +1 -1
- app-rn-runtime/components/page/page.component.js.map +1 -1
- app-rn-runtime/components/page/partial/partial.component.js +1 -1
- app-rn-runtime/components/page/partial/partial.component.js.map +1 -1
- app-rn-runtime/components/page/partial-container/partial-container.component.js +1 -1
- app-rn-runtime/components/page/partial-container/partial-container.component.js.map +1 -1
- app-rn-runtime/components/page/partial-container/partial-container.styles.js +2 -1
- app-rn-runtime/components/page/partial-container/partial-container.styles.js.map +1 -1
- app-rn-runtime/components/page/tabbar/tabbar.component.js +2 -1
- app-rn-runtime/components/page/tabbar/tabbar.component.js.map +1 -1
- app-rn-runtime/components/prefab/prefab-container.component.js +1 -1
- app-rn-runtime/components/prefab/prefab-container.component.js.map +1 -1
- app-rn-runtime/core/asset.provider.js +5 -0
- app-rn-runtime/core/asset.provider.js.map +1 -0
- app-rn-runtime/core/base.component.js +113 -41
- app-rn-runtime/core/base.component.js.map +1 -1
- app-rn-runtime/core/imageSizeEstimator.js +1 -0
- app-rn-runtime/core/imageSizeEstimator.js.map +1 -1
- app-rn-runtime/core/injector.js +15 -1
- app-rn-runtime/core/injector.js.map +1 -1
- app-rn-runtime/core/tappable.component.js +9 -2
- app-rn-runtime/core/tappable.component.js.map +1 -1
- app-rn-runtime/core/utils.js +6 -0
- app-rn-runtime/core/utils.js.map +1 -1
- app-rn-runtime/gestures/swipe.animation.js +105 -0
- app-rn-runtime/gestures/swipe.animation.js.map +1 -0
- app-rn-runtime/package.json +33 -32
- app-rn-runtime/runtime/App.js +24 -16
- app-rn-runtime/runtime/App.js.map +1 -1
- app-rn-runtime/runtime/App.navigator.js +2 -12
- app-rn-runtime/runtime/App.navigator.js.map +1 -1
- app-rn-runtime/runtime/base-fragment.component.js +6 -4
- app-rn-runtime/runtime/base-fragment.component.js.map +1 -1
- app-rn-runtime/runtime/navigator/drawer.navigator.js +4 -0
- app-rn-runtime/runtime/navigator/drawer.navigator.js.map +1 -1
- app-rn-runtime/runtime/navigator/stack.navigator.js +5 -1
- app-rn-runtime/runtime/navigator/stack.navigator.js.map +1 -1
- app-rn-runtime/runtime/services/app-security.service.js.map +1 -1
- app-rn-runtime/runtime/services/app-spinner.service.js +5 -1
- app-rn-runtime/runtime/services/app-spinner.service.js.map +1 -1
- app-rn-runtime/runtime/services/app-toast.service.js +1 -1
- app-rn-runtime/runtime/services/app-toast.service.js.map +1 -1
- app-rn-runtime/runtime/services/device/camera-service.js +28 -6
- app-rn-runtime/runtime/services/device/camera-service.js.map +1 -1
- app-rn-runtime/runtime/services/device/scan-service.js +15 -14
- app-rn-runtime/runtime/services/device/scan-service.js.map +1 -1
- app-rn-runtime/styles/background.component.js +259 -0
- app-rn-runtime/styles/background.component.js.map +1 -0
- app-rn-runtime/styles/style-prop.validator.js +38 -8
- app-rn-runtime/styles/style-prop.validator.js.map +1 -1
- app-rn-runtime/styles/style-props.js +93 -0
- app-rn-runtime/styles/style-props.js.map +1 -0
- app-rn-runtime/styles/theme.js +6 -37
- app-rn-runtime/styles/theme.js.map +1 -1
- app-rn-runtime/variables/device/camera/capture-image.operation.js.map +1 -1
- app-rn-runtime/variables/device/camera/capture-video.operation.js.map +1 -1
- app-rn-runtime/variables/device/file/upload-file.operation.js +43 -21
- app-rn-runtime/variables/device/file/upload-file.operation.js.map +1 -1
- app-rn-runtime/variables/http.service.js +12 -14
- app-rn-runtime/variables/http.service.js.map +1 -1
- app-rn-runtime/variables/live-variable.js +96 -0
- app-rn-runtime/variables/live-variable.js.map +1 -0
- app-rn-runtime/variables/service-variable.js +19 -8
- app-rn-runtime/variables/service-variable.js.map +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","View","BaseComponent","BaseComponentState","WmCameraProps","DEFAULT_CLASS","WmButton","CameraConsumer","WmCameraState","WmCamera","constructor","props","onCameraTap","state","capturetype","params","allowImageEdit","allowedit","imageQuality","imagequality","imageEncodingType","imageencodingtype","imageTargetWidth","imagetargetwidth","imageTargetHeight","imagetargetheight","camera","captureImage","then","res","updateModel","imagePath","captureVideo","videoPath","$event","value","startsWith","updateState","datavalue","localFilePath","invokeEventCallback","bind","proxy","renderWidget","cameraService","styles","root","iconclass","button","iconsize"],"sources":["camera.component.tsx"],"sourcesContent":["import React from 'react';\nimport { View } from 'react-native';\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\n\nimport WmCameraProps from './camera.props';\nimport { DEFAULT_CLASS, WmCameraStyles } from './camera.styles';\nimport WmButton from '@wavemaker/app-rn-runtime/components/basic/button/button.component';\nimport { CaptureImageOutput } from '@wavemaker/app-rn-runtime/variables/device/camera/capture-image.operation';\nimport { CameraConsumer, CameraInput, CameraService } from \"@wavemaker/app-rn-runtime/core/device/camera-service\";\nimport { CaptureVideoOutput } from '@wavemaker/app-rn-runtime/variables/device/camera/capture-video.operation';\n\n\nexport class WmCameraState extends BaseComponentState<WmCameraProps> {}\n\nexport default class WmCamera extends BaseComponent<WmCameraProps, WmCameraState, WmCameraStyles> {\n private camera: CameraService = null as any;\n constructor(props: WmCameraProps) {\n super(props, DEFAULT_CLASS, new WmCameraProps());\n }\n\n onCameraTap() {\n const props = this.state.props;\n if (props.capturetype === 'IMAGE') {\n const params: CameraInput = {\n allowImageEdit: props.allowedit,\n imageQuality: props.imagequality,\n imageEncodingType: props.imageencodingtype,\n imageTargetWidth: props.imagetargetwidth,\n imageTargetHeight: props.imagetargetheight\n };\n\n this.camera.captureImage(params).then((res: CaptureImageOutput) => {\n this.updateModel(null, res.imagePath);\n });\n } else {\n this.camera.captureVideo().then((res: CaptureVideoOutput) => {\n this.updateModel(null, res.videoPath);\n });\n }\n\n }\n\n private updateModel($event: any, value: any) {\n value = (value.startsWith('file://') ? '' : 'file://') + value;\n this.updateState({\n props: {\n datavalue: value,\n localFilePath: value\n }\n } as WmCameraState, this.invokeEventCallback.bind(this, 'onSuccess', [null, this.proxy, value]));\n }\n\n renderWidget(props: WmCameraProps) {\n return (\n <CameraConsumer>\n {(cameraService: CameraService) => {\n this.camera = cameraService;\n return <View style={this.styles.root}>\n <WmButton iconclass={props.iconclass} styles={this.styles.button} iconsize={props.iconsize} onTap={this.onCameraTap.bind(this)}></WmButton>\n </View>\n }}\n </CameraConsumer>\n );\n }\n}\n"],"mappings":";;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,QAAQ,cAAc;AACnC,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,+CAA+C;AAEjG,OAAOC,aAAa,MAAM,gBAAgB;AAC1C,SAASC,aAAa,QAAwB,iBAAiB;AAC/D,OAAOC,QAAQ,MAAM,oEAAoE;AAEzF,SAASC,cAAc,QAAoC,sDAAsD;AAIjH,OAAO,MAAMC,aAAa,SAASL,kBAAkB,CAAgB;AAErE,eAAe,MAAMM,QAAQ,SAASP,aAAa,CAA+C;
|
|
1
|
+
{"version":3,"names":["React","View","BaseComponent","BaseComponentState","WmCameraProps","DEFAULT_CLASS","WmButton","CameraConsumer","WmCameraState","WmCamera","constructor","props","onCameraTap","state","capturetype","params","allowImageEdit","allowedit","imageQuality","imagequality","imageEncodingType","imageencodingtype","imageTargetWidth","imagetargetwidth","imageTargetHeight","imagetargetheight","camera","captureImage","then","res","updateModel","imagePath","content","captureVideo","videoPath","$event","value","startsWith","localFile","updateState","datavalue","localFilePath","invokeEventCallback","bind","proxy","renderWidget","cameraService","_background","styles","root","iconclass","button","iconsize"],"sources":["camera.component.tsx"],"sourcesContent":["import React from 'react';\nimport { View } from 'react-native';\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\n\nimport WmCameraProps from './camera.props';\nimport { DEFAULT_CLASS, WmCameraStyles } from './camera.styles';\nimport WmButton from '@wavemaker/app-rn-runtime/components/basic/button/button.component';\nimport { CaptureImageOutput } from '@wavemaker/app-rn-runtime/variables/device/camera/capture-image.operation';\nimport { CameraConsumer, CameraInput, CameraService } from \"@wavemaker/app-rn-runtime/core/device/camera-service\";\nimport { CaptureVideoOutput } from '@wavemaker/app-rn-runtime/variables/device/camera/capture-video.operation';\n\n\nexport class WmCameraState extends BaseComponentState<WmCameraProps> {}\n\nexport default class WmCamera extends BaseComponent<WmCameraProps, WmCameraState, WmCameraStyles> {\n private camera: CameraService = null as any;\n public localFile: string = '';\n constructor(props: WmCameraProps) {\n super(props, DEFAULT_CLASS, new WmCameraProps());\n }\n\n onCameraTap() {\n const props = this.state.props;\n if (props.capturetype === 'IMAGE') {\n const params: CameraInput = {\n allowImageEdit: props.allowedit,\n imageQuality: props.imagequality,\n imageEncodingType: props.imageencodingtype,\n imageTargetWidth: props.imagetargetwidth,\n imageTargetHeight: props.imagetargetheight\n };\n\n this.camera.captureImage(params).then((res: CaptureImageOutput) => {\n this.updateModel(null, res.imagePath, res.content);\n });\n } else {\n this.camera.captureVideo().then((res: CaptureVideoOutput) => {\n this.updateModel(null, res.videoPath, res.content);\n });\n }\n\n }\n\n private updateModel($event: any, value: any, content: string) {\n value = (value.startsWith('file://') ? '' : 'file://') + value;\n this.localFile = content;\n this.updateState({\n props: {\n datavalue: value,\n localFilePath: value\n }\n } as WmCameraState, this.invokeEventCallback.bind(this, 'onSuccess', [null, this.proxy, value, this.localFile]));\n }\n\n renderWidget(props: WmCameraProps) {\n return (\n <CameraConsumer>\n {(cameraService: CameraService) => {\n {this._background}\n this.camera = cameraService;\n return <View style={this.styles.root}>\n <WmButton iconclass={props.iconclass} styles={this.styles.button} iconsize={props.iconsize} onTap={this.onCameraTap.bind(this)}></WmButton>\n </View>\n }}\n </CameraConsumer>\n );\n }\n}\n"],"mappings":";;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,QAAQ,cAAc;AACnC,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,+CAA+C;AAEjG,OAAOC,aAAa,MAAM,gBAAgB;AAC1C,SAASC,aAAa,QAAwB,iBAAiB;AAC/D,OAAOC,QAAQ,MAAM,oEAAoE;AAEzF,SAASC,cAAc,QAAoC,sDAAsD;AAIjH,OAAO,MAAMC,aAAa,SAASL,kBAAkB,CAAgB;AAErE,eAAe,MAAMM,QAAQ,SAASP,aAAa,CAA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F,CAAC,EAAmB,IAAI,CAACM,mBAAmB,CAACC,IAAI,CAAC,IAAI,EAAE,WAAW,EAAE,CAAC,IAAI,EAAE,IAAI,CAACC,KAAK,EAAER,KAAK,EAAE,IAAI,CAACE,SAAS,CAAC,CAAC,CAAC;EAClH;EAEAO,YAAY,CAAClC,KAAoB,EAAE;IACjC,oBACM,oBAAC,cAAc,QACTmC,aAA4B,IAAK;MACnC;QAAC,IAAI,CAACC,WAAW;MAAA;MACjB,IAAI,CAACrB,MAAM,GAAGoB,aAAa;MAC3B,oBAAO,oBAAC,IAAI;QAAC,KAAK,EAAE,IAAI,CAACE,MAAM,CAACC;MAAK,gBACnC,oBAAC,QAAQ;QAAC,SAAS,EAAEtC,KAAK,CAACuC,SAAU;QAAC,MAAM,EAAE,IAAI,CAACF,MAAM,CAACG,MAAO;QAAC,QAAQ,EAAExC,KAAK,CAACyC,QAAS;QAAC,KAAK,EAAE,IAAI,CAACxC,WAAW,CAAC+B,IAAI,CAAC,IAAI;MAAE,EAAY,CACtI;IACT,CAAC,CACc;EAEzB;AACF"}
|
|
@@ -14,7 +14,6 @@ export default class WmCameraProps extends BaseProps {
|
|
|
14
14
|
_defineProperty(this, "imagetargetwidth", null);
|
|
15
15
|
_defineProperty(this, "imagetargetheight", null);
|
|
16
16
|
_defineProperty(this, "datavalue", void 0);
|
|
17
|
-
_defineProperty(this, "localFile", '');
|
|
18
17
|
_defineProperty(this, "localFilePath", '');
|
|
19
18
|
}
|
|
20
19
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["BaseProps","WmCameraProps"],"sources":["camera.props.ts"],"sourcesContent":["import { BaseProps } from '@wavemaker/app-rn-runtime/core/base.component';\n\nexport default class WmCameraProps extends BaseProps {\n allowedit: boolean = false;\n capturetype: string = 'IMAGE';\n iconclass: string = 'wm-sl-l sl-camera';\n iconsize: number = 16;\n imagequality: number = 80;\n imageencodingtype: string = 'JPEG';\n imagetargetwidth: number = null as any;\n imagetargetheight: number = null as any;\n datavalue: any;\n
|
|
1
|
+
{"version":3,"names":["BaseProps","WmCameraProps"],"sources":["camera.props.ts"],"sourcesContent":["import { BaseProps } from '@wavemaker/app-rn-runtime/core/base.component';\n\nexport default class WmCameraProps extends BaseProps {\n allowedit: boolean = false;\n capturetype: string = 'IMAGE';\n iconclass: string = 'wm-sl-l sl-camera';\n iconsize: number = 16;\n imagequality: number = 80;\n imageencodingtype: string = 'JPEG';\n imagetargetwidth: number = null as any;\n imagetargetheight: number = null as any;\n datavalue: any;\n localFilePath: string = '';\n}\n"],"mappings":";;;AAAA,SAASA,SAAS,QAAQ,+CAA+C;AAEzE,eAAe,MAAMC,aAAa,SAASD,SAAS,CAAC;EAAA;IAAA;IAAA,mCAC9B,KAAK;IAAA,qCACJ,OAAO;IAAA,mCACT,mBAAmB;IAAA,kCACpB,EAAE;IAAA,sCACE,EAAE;IAAA,2CACG,MAAM;IAAA,0CACP,IAAI;IAAA,2CACH,IAAI;IAAA;IAAA,uCAER,EAAE;EAAA;AAC5B"}
|
|
@@ -68,7 +68,7 @@ export default class WmDialog extends BaseComponent {
|
|
|
68
68
|
value: this.theme
|
|
69
69
|
}, /*#__PURE__*/React.createElement(View, {
|
|
70
70
|
style: this.styles.root
|
|
71
|
-
}, props.showheader ? /*#__PURE__*/React.createElement(View, {
|
|
71
|
+
}, this._background, props.showheader ? /*#__PURE__*/React.createElement(View, {
|
|
72
72
|
style: this.styles.header
|
|
73
73
|
}, /*#__PURE__*/React.createElement(View, {
|
|
74
74
|
style: this.styles.headerLabel
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","View","ModalConsumer","HideMode","ThemeProvider","BaseComponent","BaseComponentState","WmIcon","WmButton","WmDialogProps","DEFAULT_CLASS","WmDialogState","WmDialog","constructor","props","hideMode","DONOT_ADD_TO_DOM","state","modalOptions","onClose","Promise","res","updateState","show","invokeEventCallback","onOpen","open","close","_close","prepareModalOptions","content","modalService","o","name","modalStyle","styles","modal","contentStyle","isModal","centered","animation","hideModal","renderWidget","showModal","theme","root","showheader","header","headerLabel","title","iconclass","icon","closable","closeBtn","children"],"sources":["dialog.component.tsx"],"sourcesContent":["import React from 'react';\nimport { Text, View } from 'react-native';\n\nimport { ModalConsumer, ModalOptions, ModalService } from '@wavemaker/app-rn-runtime/core/modal.service';\nimport { HideMode } from '@wavemaker/app-rn-runtime/core/if.component';\nimport { ThemeProvider } from '@wavemaker/app-rn-runtime/styles/theme';\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\nimport WmIcon from '@wavemaker/app-rn-runtime/components/basic/icon/icon.component';\nimport WmButton from '@wavemaker/app-rn-runtime/components/basic/button/button.component';\n\nimport WmDialogProps from './dialog.props';\nimport { DEFAULT_CLASS, WmDialogStyles } from './dialog.styles';\n\nexport class WmDialogState extends BaseComponentState<WmDialogProps> {\n modalOptions = {} as ModalOptions;\n}\n\nexport default class WmDialog extends BaseComponent<WmDialogProps, WmDialogState, WmDialogStyles> {\n\n private _close: Function = () => {};\n\n constructor(props: WmDialogProps) {\n super(props, DEFAULT_CLASS, new WmDialogProps(), new WmDialogState());\n this.hideMode = HideMode.DONOT_ADD_TO_DOM;\n this.state.modalOptions.onClose = () => {\n return new Promise<void>((res) => {\n this.updateState({\n props: {show: false}\n } as WmDialogState, () => {\n this.invokeEventCallback('onClose', [null, this]);\n res();\n });\n });\n };\n this.state.modalOptions.onOpen = () => {\n this.invokeEventCallback('onOpened', [null, this]);\n };\n }\n\n open() {\n if (!this.state.props.show) {\n this.updateState({\n props:{show: true}\n } as WmDialogState);\n }\n }\n\n close() {\n this._close();\n }\n\n prepareModalOptions(content: React.ReactNode, modalService: ModalService) {\n const o = this.state.modalOptions;\n o.name = this.state.props.name;\n o.modalStyle = this.styles.modal;\n o.content = content;\n o.contentStyle = this.styles.content;\n o.isModal = !!this.state.props.modal;\n o.centered = true;\n o.animation = this.state.props.animation;\n this._close = () => modalService.hideModal(this.state.modalOptions);\n return o;\n }\n\n renderWidget(props: WmDialogProps) {\n return (<ModalConsumer>\n {(modalService: ModalService) => {\n modalService.showModal(this.prepareModalOptions((\n <ThemeProvider value={this.theme}>\n <View style={this.styles.root}>\n {props.showheader ? (<View style={this.styles.header}>\n <View style={this.styles.headerLabel}>\n <WmIcon caption={props.title} iconclass={props.iconclass} styles={this.styles.icon}></WmIcon>\n </View>\n {props.closable && <WmButton show={props.closable} iconclass=\"wm-sl-l sl-close\" onTap={() => this.close()} styles={this.styles.closeBtn}></WmButton>}\n </View>) : null}\n {props.children}\n </View>\n </ThemeProvider>\n ), modalService));\n return null;\n }}\n </ModalConsumer>);\n }\n}\n"],"mappings":";;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAAeC,IAAI,QAAQ,cAAc;AAEzC,SAASC,aAAa,QAAoC,8CAA8C;AACxG,SAASC,QAAQ,QAAQ,6CAA6C;AACtE,SAASC,aAAa,QAAQ,wCAAwC;AACtE,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,+CAA+C;AACjG,OAAOC,MAAM,MAAM,gEAAgE;AACnF,OAAOC,QAAQ,MAAM,oEAAoE;AAEzF,OAAOC,aAAa,MAAM,gBAAgB;AAC1C,SAASC,aAAa,QAAwB,iBAAiB;AAE/D,OAAO,MAAMC,aAAa,SAASL,kBAAkB,CAAgB;EAAA;IAAA;IAAA,sCACpD,CAAC,CAAC;EAAA;AACnB;AAEA,eAAe,MAAMM,QAAQ,SAASP,aAAa,CAA+C;EAIhGQ,WAAW,CAACC,KAAoB,EAAE;IAChC,KAAK,CAACA,KAAK,EAAEJ,aAAa,EAAE,IAAID,aAAa,EAAE,EAAE,IAAIE,aAAa,EAAE,CAAC;IAAC,gCAH7C,MAAM,CAAC,CAAC;IAIjC,IAAI,CAACI,QAAQ,GAAGZ,QAAQ,CAACa,gBAAgB;IACzC,IAAI,CAACC,KAAK,CAACC,YAAY,CAACC,OAAO,GAAG,MAAM;MACtC,OAAO,IAAIC,OAAO,CAAQC,GAAG,IAAK;QA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Y,CAACU,SAAS,CAAC,IAAI,CAACxB,KAAK,CAACC,YAAY,CAAC;IACnE,OAAOc,CAAC;EACV;EAEAU,YAAY,CAAC5B,KAAoB,EAAE;IACjC,oBAAQ,oBAAC,aAAa,QAClBiB,YAA0B,IAAK;MAC/BA,YAAY,CAACY,SAAS,CAAC,IAAI,CAACd,mBAAmB,eAC7C,oBAAC,aAAa;QAAC,KAAK,EAAE,IAAI,CAACe;MAAM,gBAC/B,oBAAC,IAAI;QAAC,KAAK,EAAE,IAAI,CAACT,MAAM,CAACU;MAAK,
|
|
1
|
+
{"version":3,"names":["React","View","ModalConsumer","HideMode","ThemeProvider","BaseComponent","BaseComponentState","WmIcon","WmButton","WmDialogProps","DEFAULT_CLASS","WmDialogState","WmDialog","constructor","props","hideMode","DONOT_ADD_TO_DOM","state","modalOptions","onClose","Promise","res","updateState","show","invokeEventCallback","onOpen","open","close","_close","prepareModalOptions","content","modalService","o","name","modalStyle","styles","modal","contentStyle","isModal","centered","animation","hideModal","renderWidget","showModal","theme","root","_background","showheader","header","headerLabel","title","iconclass","icon","closable","closeBtn","children"],"sources":["dialog.component.tsx"],"sourcesContent":["import React from 'react';\nimport { Text, View } from 'react-native';\n\nimport { ModalConsumer, ModalOptions, ModalService } from '@wavemaker/app-rn-runtime/core/modal.service';\nimport { HideMode } from '@wavemaker/app-rn-runtime/core/if.component';\nimport { ThemeProvider } from '@wavemaker/app-rn-runtime/styles/theme';\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\nimport WmIcon from '@wavemaker/app-rn-runtime/components/basic/icon/icon.component';\nimport WmButton from '@wavemaker/app-rn-runtime/components/basic/button/button.component';\n\nimport WmDialogProps from './dialog.props';\nimport { DEFAULT_CLASS, WmDialogStyles } from './dialog.styles';\n\nexport class WmDialogState extends BaseComponentState<WmDialogProps> {\n modalOptions = {} as ModalOptions;\n}\n\nexport default class WmDialog extends BaseComponent<WmDialogProps, WmDialogState, WmDialogStyles> {\n\n private _close: Function = () => {};\n\n constructor(props: WmDialogProps) {\n super(props, DEFAULT_CLASS, new WmDialogProps(), new WmDialogState());\n this.hideMode = HideMode.DONOT_ADD_TO_DOM;\n this.state.modalOptions.onClose = () => {\n return new Promise<void>((res) => {\n this.updateState({\n props: {show: false}\n } as WmDialogState, () => {\n this.invokeEventCallback('onClose', [null, this]);\n res();\n });\n });\n };\n this.state.modalOptions.onOpen = () => {\n this.invokeEventCallback('onOpened', [null, this]);\n };\n }\n\n open() {\n if (!this.state.props.show) {\n this.updateState({\n props:{show: true}\n } as WmDialogState);\n }\n }\n\n close() {\n this._close();\n }\n\n prepareModalOptions(content: React.ReactNode, modalService: ModalService) {\n const o = this.state.modalOptions;\n o.name = this.state.props.name;\n o.modalStyle = this.styles.modal;\n o.content = content;\n o.contentStyle = this.styles.content;\n o.isModal = !!this.state.props.modal;\n o.centered = true;\n o.animation = this.state.props.animation;\n this._close = () => modalService.hideModal(this.state.modalOptions);\n return o;\n }\n\n renderWidget(props: WmDialogProps) {\n return (<ModalConsumer>\n {(modalService: ModalService) => {\n modalService.showModal(this.prepareModalOptions((\n <ThemeProvider value={this.theme}>\n <View style={this.styles.root}>\n {this._background}\n {props.showheader ? (<View style={this.styles.header}>\n <View style={this.styles.headerLabel}>\n <WmIcon caption={props.title} iconclass={props.iconclass} styles={this.styles.icon}></WmIcon>\n </View>\n {props.closable && <WmButton show={props.closable} iconclass=\"wm-sl-l sl-close\" onTap={() => this.close()} styles={this.styles.closeBtn}></WmButton>}\n </View>) : null}\n {props.children}\n </View>\n </ThemeProvider>\n ), modalService));\n return null;\n }}\n </ModalConsumer>);\n }\n}\n"],"mappings":";;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAAeC,IAAI,QAAQ,cAAc;AAEzC,SAASC,aAAa,QAAoC,8CAA8C;AACxG,SAASC,QAAQ,QAAQ,6CAA6C;AACtE,SAASC,aAAa,QAAQ,wCAAwC;AACtE,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,+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AK,CAACqC,SAAU;QAAC,MAAM,EAAE,IAAI,CAAChB,MAAM,CAACiB;MAAK,EAAU,CACxF,EACNtC,KAAK,CAACuC,QAAQ,iBAAI,oBAAC,QAAQ;QAAC,IAAI,EAAEvC,KAAK,CAACuC,QAAS;QAAC,SAAS,EAAC,kBAAkB;QAAC,KAAK,EAAE,MAAM,IAAI,CAAC1B,KAAK,EAAG;QAAC,MAAM,EAAE,IAAI,CAACQ,MAAM,CAACmB;MAAS,EAAY,CAC/I,GAAI,IAAI,EACdxC,KAAK,CAACyC,QAAQ,CACV,CACO,EACfxB,YAAY,CAAC,CAAC;MACjB,OAAO,IAAI;IACb,CAAC,CACa;EAClB;AACF"}
|
|
@@ -15,7 +15,7 @@ export default class WmDialogactions extends BaseComponent {
|
|
|
15
15
|
renderWidget(props) {
|
|
16
16
|
return /*#__PURE__*/React.createElement(View, {
|
|
17
17
|
style: this.styles.root
|
|
18
|
-
}, props.children);
|
|
18
|
+
}, this._background, props.children);
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
21
|
//# sourceMappingURL=dialogactions.component.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","View","BaseComponent","BaseComponentState","WmDialogactionsProps","DEFAULT_CLASS","WmDialogactionsState","WmDialogactions","constructor","props","renderWidget","styles","root","children"],"sources":["dialogactions.component.tsx"],"sourcesContent":["import React from 'react';\nimport { View } from 'react-native';\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\n\nimport WmDialogactionsProps from './dialogactions.props';\nimport { DEFAULT_CLASS, WmDialogactionsStyles } from './dialogactions.styles';\n\nexport class WmDialogactionsState extends BaseComponentState<WmDialogactionsProps> {}\n\nexport default class WmDialogactions extends BaseComponent<WmDialogactionsProps, WmDialogactionsState, WmDialogactionsStyles> {\n __TYPE='WmDialogactions';\n\n constructor(props: WmDialogactionsProps) {\n super(props, DEFAULT_CLASS, new WmDialogactionsProps());\n }\n\n renderWidget(props: WmDialogactionsProps) {\n return (<View style={this.styles.root}>{props.children}</View>); \n }\n}\n"],"mappings":";;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,QAAQ,cAAc;AACnC,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,+CAA+C;AAEjG,OAAOC,oBAAoB,MAAM,uBAAuB;AACxD,SAASC,aAAa,QAA+B,wBAAwB;AAE7E,OAAO,MAAMC,oBAAoB,SAASH,kBAAkB,CAAuB;AAEnF,eAAe,MAAMI,eAAe,SAASL,aAAa,CAAoE;EAG5HM,WAAW,CAACC,KAA2B,EAAE;IACvC,KAAK,CAACA,KAAK,EAAEJ,aAAa,EAAE,IAAID,oBAAoB,EAAE,CAAC;IAAC,gCAHnD,iBAAiB;EAIxB;EAEAM,YAAY,CAACD,KAA2B,EAAE;IACxC,oBAAQ,oBAAC,IAAI;MAAC,KAAK,EAAE,IAAI,CAACE,MAAM,CAACC;IAAK,
|
|
1
|
+
{"version":3,"names":["React","View","BaseComponent","BaseComponentState","WmDialogactionsProps","DEFAULT_CLASS","WmDialogactionsState","WmDialogactions","constructor","props","renderWidget","styles","root","_background","children"],"sources":["dialogactions.component.tsx"],"sourcesContent":["import React from 'react';\nimport { View } from 'react-native';\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\n\nimport WmDialogactionsProps from './dialogactions.props';\nimport { DEFAULT_CLASS, WmDialogactionsStyles } from './dialogactions.styles';\n\nexport class WmDialogactionsState extends BaseComponentState<WmDialogactionsProps> {}\n\nexport default class WmDialogactions extends BaseComponent<WmDialogactionsProps, WmDialogactionsState, WmDialogactionsStyles> {\n __TYPE='WmDialogactions';\n\n constructor(props: WmDialogactionsProps) {\n super(props, DEFAULT_CLASS, new WmDialogactionsProps());\n }\n\n renderWidget(props: WmDialogactionsProps) {\n return (<View style={this.styles.root}>{this._background}{props.children}</View>); \n }\n}\n"],"mappings":";;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,QAAQ,cAAc;AACnC,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,+CAA+C;AAEjG,OAAOC,oBAAoB,MAAM,uBAAuB;AACxD,SAASC,aAAa,QAA+B,wBAAwB;AAE7E,OAAO,MAAMC,oBAAoB,SAASH,kBAAkB,CAAuB;AAEnF,eAAe,MAAMI,eAAe,SAASL,aAAa,CAAoE;EAG5HM,WAAW,CAACC,KAA2B,EAAE;IACvC,KAAK,CAACA,KAAK,EAAEJ,aAAa,EAAE,IAAID,oBAAoB,EAAE,CAAC;IAAC,gCAHnD,iBAAiB;EAIxB;EAEAM,YAAY,CAACD,KAA2B,EAAE;IACxC,oBAAQ,oBAAC,IAAI;MAAC,KAAK,EAAE,IAAI,CAACE,MAAM,CAACC;IAAK,GAAE,IAAI,CAACC,WAAW,EAAEJ,KAAK,CAACK,QAAQ,CAAQ;EAClF;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","ScrollView","BaseComponent","BaseComponentState","WmDialogcontentProps","DEFAULT_CLASS","WmDialogcontentState","WmDialogcontent","constructor","props","renderWidget","styles","root","maxHeight","children"],"sources":["dialogcontent.component.tsx"],"sourcesContent":["import React from 'react';\nimport { ScrollView } from 'react-native';\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\n\nimport WmDialogcontentProps from './dialogcontent.props';\nimport { DEFAULT_CLASS, WmDialogcontentStyles } from './dialogcontent.styles';\n\nexport class WmDialogcontentState extends BaseComponentState<WmDialogcontentProps> {}\n\nexport default class WmDialogcontent extends BaseComponent<WmDialogcontentProps, WmDialogcontentState, WmDialogcontentStyles> {\n\n constructor(props: WmDialogcontentProps) {\n super(props, DEFAULT_CLASS, new WmDialogcontentProps());\n }\n\n renderWidget(props: WmDialogcontentProps) {\n return (<ScrollView contentContainerStyle={this.styles.root} style={{maxHeight: '90%'}}>{props.children}</ScrollView>);\n }\n}\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,UAAU,QAAQ,cAAc;AACzC,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,+CAA+C;AAEjG,OAAOC,oBAAoB,MAAM,uBAAuB;AACxD,SAASC,aAAa,QAA+B,wBAAwB;AAE7E,OAAO,MAAMC,oBAAoB,SAASH,kBAAkB,CAAuB;AAEnF,eAAe,MAAMI,eAAe,SAASL,aAAa,CAAoE;EAE5HM,WAAW,CAACC,KAA2B,EAAE;IACvC,KAAK,CAACA,KAAK,EAAEJ,aAAa,EAAE,IAAID,oBAAoB,EAAE,CAAC;EACzD;EAEAM,YAAY,CAACD,KAA2B,EAAE;IACxC,oBAAQ,oBAAC,UAAU;MAAC,qBAAqB,EAAE,IAAI,CAACE,MAAM,CAACC,IAAK;MAAC,KAAK,EAAE;QAACC,SAAS,EAAE;MAAK;IAAE,
|
|
1
|
+
{"version":3,"names":["React","ScrollView","BaseComponent","BaseComponentState","WmDialogcontentProps","DEFAULT_CLASS","WmDialogcontentState","WmDialogcontent","constructor","props","renderWidget","styles","root","maxHeight","_background","children"],"sources":["dialogcontent.component.tsx"],"sourcesContent":["import React from 'react';\nimport { ScrollView } from 'react-native';\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\n\nimport WmDialogcontentProps from './dialogcontent.props';\nimport { DEFAULT_CLASS, WmDialogcontentStyles } from './dialogcontent.styles';\n\nexport class WmDialogcontentState extends BaseComponentState<WmDialogcontentProps> {}\n\nexport default class WmDialogcontent extends BaseComponent<WmDialogcontentProps, WmDialogcontentState, WmDialogcontentStyles> {\n\n constructor(props: WmDialogcontentProps) {\n super(props, DEFAULT_CLASS, new WmDialogcontentProps());\n }\n\n renderWidget(props: WmDialogcontentProps) {\n return (<ScrollView contentContainerStyle={this.styles.root} style={{maxHeight: '90%'}}>{this._background}{props.children}</ScrollView>);\n }\n}\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,UAAU,QAAQ,cAAc;AACzC,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,+CAA+C;AAEjG,OAAOC,oBAAoB,MAAM,uBAAuB;AACxD,SAASC,aAAa,QAA+B,wBAAwB;AAE7E,OAAO,MAAMC,oBAAoB,SAASH,kBAAkB,CAAuB;AAEnF,eAAe,MAAMI,eAAe,SAASL,aAAa,CAAoE;EAE5HM,WAAW,CAACC,KAA2B,EAAE;IACvC,KAAK,CAACA,KAAK,EAAEJ,aAAa,EAAE,IAAID,oBAAoB,EAAE,CAAC;EACzD;EAEAM,YAAY,CAACD,KAA2B,EAAE;IACxC,oBAAQ,oBAAC,UAAU;MAAC,qBAAqB,EAAE,IAAI,CAACE,MAAM,CAACC,IAAK;MAAC,KAAK,EAAE;QAACC,SAAS,EAAE;MAAK;IAAE,GAAE,IAAI,CAACC,WAAW,EAAEL,KAAK,CAACM,QAAQ,CAAc;EACzI;AACF"}
|
|
@@ -6,6 +6,7 @@ import { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/cor
|
|
|
6
6
|
import { isString } from 'lodash';
|
|
7
7
|
import { Platform } from 'react-native';
|
|
8
8
|
import { validateField } from '@wavemaker/app-rn-runtime/core/utils';
|
|
9
|
+
import Injector from '@wavemaker/app-rn-runtime/core/injector';
|
|
9
10
|
export class BaseInputState extends BaseComponentState {
|
|
10
11
|
constructor() {
|
|
11
12
|
super(...arguments);
|
|
@@ -31,6 +32,10 @@ export class BaseInputComponent extends BaseComponent {
|
|
|
31
32
|
var _this$widgetRef;
|
|
32
33
|
this === null || this === void 0 ? void 0 : (_this$widgetRef = this.widgetRef) === null || _this$widgetRef === void 0 ? void 0 : _this$widgetRef.focus();
|
|
33
34
|
}
|
|
35
|
+
blur() {
|
|
36
|
+
var _this$widgetRef2, _this$widgetRef3;
|
|
37
|
+
(this === null || this === void 0 ? void 0 : (_this$widgetRef2 = this.widgetRef) === null || _this$widgetRef2 === void 0 ? void 0 : _this$widgetRef2.blur) && (this === null || this === void 0 ? void 0 : (_this$widgetRef3 = this.widgetRef) === null || _this$widgetRef3 === void 0 ? void 0 : _this$widgetRef3.blur());
|
|
38
|
+
}
|
|
34
39
|
onPropertyChange(name, $new, $old) {
|
|
35
40
|
switch (name) {
|
|
36
41
|
case 'type':
|
|
@@ -106,6 +111,7 @@ export class BaseInputComponent extends BaseComponent {
|
|
|
106
111
|
});
|
|
107
112
|
}
|
|
108
113
|
onBlur(event) {
|
|
114
|
+
Injector.FOCUSED_ELEMENT.remove();
|
|
109
115
|
this.isTouched = true;
|
|
110
116
|
let newVal = event.target.value || this.state.textValue;
|
|
111
117
|
let oldVal = this.state.props.datavalue || '';
|
|
@@ -131,6 +137,7 @@ export class BaseInputComponent extends BaseComponent {
|
|
|
131
137
|
});
|
|
132
138
|
}
|
|
133
139
|
onFocus(event) {
|
|
140
|
+
Injector.FOCUSED_ELEMENT.set(this);
|
|
134
141
|
this.invokeEventCallback('onFocus', [event, this.proxy]);
|
|
135
142
|
}
|
|
136
143
|
onKeyPress(event) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["DEFAULT_CLASS","BaseComponent","BaseComponentState","isString","Platform","validateField","BaseInputState","BaseInputComponent","constructor","props","defaultClass","defaultProps","defaultState","focus","widgetRef","onPropertyChange","name","$new","$old","keyboardType","type","updateState","textValue","isDefault","state","onFieldChange","bind","onChange","event","updateon","updateDatavalue","target","value","onChangeText","validate","invokeChange","e","OS","cursor","selectionStart","setState","source","oldValue","datavalue","autotrim","trim","invokeEventCallback","proxy","onBlur","isTouched","newVal","oldVal","setTimeout","triggerValidation","validationObj","isValid","errorType","onFocus","onKeyPress"],"sources":["baseinput.component.ts"],"sourcesContent":["import { DEFAULT_CLASS } from \"@wavemaker/app-rn-runtime/components/navigation/basenav/basenav.styles\";\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\nimport BaseInputProps from './baseinput.props';\nimport { isString } from 'lodash';\nimport { BaseInputStyles } from './baseinput.styles';\nimport { Platform, TextInput } from 'react-native';\nimport { validateField } from '@wavemaker/app-rn-runtime/core/utils';\n\nexport class BaseInputState <T extends BaseInputProps> extends BaseComponentState<T> {\n keyboardType: any = 'default';\n isValid: boolean = true;\n textValue: string = '';\n isDefault = false;\n errorType: string = '';\n}\nexport abstract class BaseInputComponent< T extends BaseInputProps, S extends BaseInputState<T>, L extends BaseInputStyles> extends BaseComponent<T, S, L> {\n public widgetRef: TextInput | null = null;\n isTouched: boolean = false;\n private cursor: any = 0;\n constructor(props: T, public defaultClass: string = DEFAULT_CLASS, defaultProps?: T, defaultState?: S) {\n super(props, defaultClass, defaultProps, defaultState);\n }\n\n focus() {\n this?.widgetRef?.focus();\n }\n\n onPropertyChange(name: string, $new: any, $old: any) {\n switch (name) {\n case 'type':\n let keyboardType;\n if (this.props.type === 'number') {\n keyboardType = 'numeric';\n } else if (this.props.type === 'tel') {\n keyboardType = 'phone-pad';\n } else if (this.props.type === 'email') {\n keyboardType = 'email-address';\n }\n this.updateState({\n keyboardType: keyboardType,\n } as S);\n break;\n case 'datavalue':\n this.updateState({\n textValue: $new\n } as S\n );\n const isDefault = this.state.isDefault;\n if (isDefault) {\n this.updateState({ isDefault: false } as S, this.props.onFieldChange && this.props.onFieldChange.bind(this, 'datavalue', $new, $old, isDefault));\n } else {\n this.props.onFieldChange && this.props.onFieldChange('datavalue', $new, $old, isDefault);\n }\n }\n }\n\n onChange(event: any) {\n if (this.state.props.updateon === 'default') {\n this.updateDatavalue(event.target.value, event);\n }\n }\n\n onChangeText(value: any) {\n this.updateState({\n textValue: value\n } as S, () => {\n if (this.state.props.updateon === 'default') {\n this.validate(value);\n this.updateDatavalue(value, null);\n }\n }\n );\n }\n\n invokeChange(e: any) {\n if (Platform.OS === 'web') {\n this.cursor = e.target.selectionStart;\n this.setState({ textValue: e.target.value });\n }\n }\n\n updateDatavalue(value: any, event?: any, source?: any) {\n const props = this.state.props;\n const oldValue = props.datavalue;\n if (value === oldValue) {\n return;\n }\n\n // autotrim\n if (props.autotrim && props.datavalue && isString(props.datavalue)) {\n value = value.trim();\n }\n\n this.updateState({\n props: {\n datavalue: value\n }\n } as S, () => {\n !this.props.onFieldChange && value !== oldValue && this.invokeEventCallback('onChange', [event, this.proxy, value, oldValue]);\n if (source === 'blur') {\n this.invokeEventCallback('onBlur', [ event, this.proxy]);\n }\n })\n\n }\n\n onBlur(event: any) {\n this.isTouched = true;\n let newVal = event.target.value || this.state.textValue;\n let oldVal = this.state.props.datavalue || '';\n this.validate(newVal);\n if (newVal === '') {\n setTimeout(() => {\n this.props.triggerValidation && this.props.triggerValidation();\n })\n }\n if (this.state.props.updateon === 'blur') {\n if (oldVal !== newVal) {\n this.updateDatavalue(newVal, event, 'blur');\n } else {\n this.invokeEventCallback('onBlur', [event, this.proxy]);\n }\n }\n }\n\n validate(value: any) {\n const validationObj = validateField(this.state.props, value);\n this.updateState({\n isValid: validationObj.isValid,\n errorType: validationObj.errorType\n } as S);\n }\n\n onFocus(event: any) {\n this.invokeEventCallback('onFocus', [ event, this.proxy]);\n }\n\n onKeyPress(event: any) {\n this.invokeEventCallback('onKeypress', [ event, this.proxy]);\n }\n}\n"],"mappings":";;;AAAA,SAASA,aAAa,QAAQ,wEAAwE;AACtG,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,+CAA+C;AAEjG,SAASC,QAAQ,QAAQ,QAAQ;AAEjC,SAASC,QAAQ,QAAmB,cAAc;AAClD,SAASC,aAAa,QAAQ,sCAAsC;
|
|
1
|
+
{"version":3,"names":["DEFAULT_CLASS","BaseComponent","BaseComponentState","isString","Platform","validateField","Injector","BaseInputState","BaseInputComponent","constructor","props","defaultClass","defaultProps","defaultState","focus","widgetRef","blur","onPropertyChange","name","$new","$old","keyboardType","type","updateState","textValue","isDefault","state","onFieldChange","bind","onChange","event","updateon","updateDatavalue","target","value","onChangeText","validate","invokeChange","e","OS","cursor","selectionStart","setState","source","oldValue","datavalue","autotrim","trim","invokeEventCallback","proxy","onBlur","FOCUSED_ELEMENT","remove","isTouched","newVal","oldVal","setTimeout","triggerValidation","validationObj","isValid","errorType","onFocus","set","onKeyPress"],"sources":["baseinput.component.ts"],"sourcesContent":["import { DEFAULT_CLASS } from \"@wavemaker/app-rn-runtime/components/navigation/basenav/basenav.styles\";\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\nimport BaseInputProps from './baseinput.props';\nimport { isString } from 'lodash';\nimport { BaseInputStyles } from './baseinput.styles';\nimport { Platform, TextInput } from 'react-native';\nimport { validateField } from '@wavemaker/app-rn-runtime/core/utils';\nimport Injector from '@wavemaker/app-rn-runtime/core/injector';\n\nexport class BaseInputState <T extends BaseInputProps> extends BaseComponentState<T> {\n keyboardType: any = 'default';\n isValid: boolean = true;\n textValue: string = '';\n isDefault = false;\n errorType: string = '';\n}\nexport abstract class BaseInputComponent< T extends BaseInputProps, S extends BaseInputState<T>, L extends BaseInputStyles> extends BaseComponent<T, S, L> {\n public widgetRef: TextInput | null = null;\n isTouched: boolean = false;\n private cursor: any = 0;\n constructor(props: T, public defaultClass: string = DEFAULT_CLASS, defaultProps?: T, defaultState?: S) {\n super(props, defaultClass, defaultProps, defaultState);\n }\n\n focus() {\n this?.widgetRef?.focus();\n }\n\n blur() {\n this?.widgetRef?.blur && this?.widgetRef?.blur();\n }\n\n onPropertyChange(name: string, $new: any, $old: any) {\n switch (name) {\n case 'type':\n let keyboardType;\n if (this.props.type === 'number') {\n keyboardType = 'numeric';\n } else if (this.props.type === 'tel') {\n keyboardType = 'phone-pad';\n } else if (this.props.type === 'email') {\n keyboardType = 'email-address';\n }\n this.updateState({\n keyboardType: keyboardType,\n } as S);\n break;\n case 'datavalue':\n this.updateState({\n textValue: $new\n } as S\n );\n const isDefault = this.state.isDefault;\n if (isDefault) {\n this.updateState({ isDefault: false } as S, this.props.onFieldChange && this.props.onFieldChange.bind(this, 'datavalue', $new, $old, isDefault));\n } else {\n this.props.onFieldChange && this.props.onFieldChange('datavalue', $new, $old, isDefault);\n }\n }\n }\n\n onChange(event: any) {\n if (this.state.props.updateon === 'default') {\n this.updateDatavalue(event.target.value, event);\n }\n }\n\n onChangeText(value: any) {\n this.updateState({\n textValue: value\n } as S, () => {\n if (this.state.props.updateon === 'default') {\n this.validate(value);\n this.updateDatavalue(value, null);\n }\n }\n );\n }\n\n invokeChange(e: any) {\n if (Platform.OS === 'web') {\n this.cursor = e.target.selectionStart;\n this.setState({ textValue: e.target.value });\n }\n }\n\n updateDatavalue(value: any, event?: any, source?: any) {\n const props = this.state.props;\n const oldValue = props.datavalue;\n if (value === oldValue) {\n return;\n }\n\n // autotrim\n if (props.autotrim && props.datavalue && isString(props.datavalue)) {\n value = value.trim();\n }\n\n this.updateState({\n props: {\n datavalue: value\n }\n } as S, () => {\n !this.props.onFieldChange && value !== oldValue && this.invokeEventCallback('onChange', [event, this.proxy, value, oldValue]);\n if (source === 'blur') {\n this.invokeEventCallback('onBlur', [ event, this.proxy]);\n }\n })\n\n }\n\n onBlur(event: any) {\n Injector.FOCUSED_ELEMENT.remove();\n this.isTouched = true;\n let newVal = event.target.value || this.state.textValue;\n let oldVal = this.state.props.datavalue || '';\n this.validate(newVal);\n if (newVal === '') {\n setTimeout(() => {\n this.props.triggerValidation && this.props.triggerValidation();\n })\n }\n if (this.state.props.updateon === 'blur') {\n if (oldVal !== newVal) {\n this.updateDatavalue(newVal, event, 'blur');\n } else {\n this.invokeEventCallback('onBlur', [event, this.proxy]);\n }\n }\n }\n\n validate(value: any) {\n const validationObj = validateField(this.state.props, value);\n this.updateState({\n isValid: validationObj.isValid,\n errorType: validationObj.errorType\n } as S);\n }\n\n onFocus(event: any) {\n Injector.FOCUSED_ELEMENT.set(this);\n this.invokeEventCallback('onFocus', [ event, this.proxy]);\n }\n\n onKeyPress(event: any) {\n this.invokeEventCallback('onKeypress', [ event, this.proxy]);\n }\n}\n"],"mappings":";;;AAAA,SAASA,aAAa,QAAQ,wEAAwE;AACtG,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,+CAA+C;AAEjG,SAASC,QAA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,EAAE,IAAI,CAACmB,KAAK,CAAC,CAAC;EAC9D;AACF"}
|
|
@@ -95,7 +95,7 @@ export default class WmCalendar extends BaseComponent {
|
|
|
95
95
|
this.invokeEventCallback('onBeforerender', [null, this]);
|
|
96
96
|
return /*#__PURE__*/React.createElement(View, {
|
|
97
97
|
style: this.styles.root
|
|
98
|
-
}, /*#__PURE__*/React.createElement(MonthView, {
|
|
98
|
+
}, this._background, /*#__PURE__*/React.createElement(MonthView, {
|
|
99
99
|
date: this.state.selectedDate,
|
|
100
100
|
selectDate: this.onDateChange,
|
|
101
101
|
format: DEFAULT_DATE_FORMAT,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","View","isString","moment","BaseComponent","BaseComponentState","MonthView","WmCalendarProps","DEFAULT_CLASS","WmIcon","WmCalendarState","Map","DEFAULT_DATE_FORMAT","WmCalendar","constructor","props","date","d","format","dateWindow","state","calendar","get","updateState","datavalue","selectedDate","invokeEventCallback","events","root","marginTop","alignSelf","icon","styles","Math","min","length","prepareDataset","dataset","eventStartKey","eventstart","forEach","startDate","has","set","push","onPropertyChange","name","$new","$old","componentDidUpdate","prevProps","prevState","snapshot","renderWidget","onDateChange","renderDay","selectedDay","selectedDayText","weekDay","calendarHeader","weekDayText","dayWrapper","day","yearText","monthText","today","todayText","notDayOfCurrentMonth","prevYearBtn","prevMonthBtn","nextMonthBtn","nextYearBtn"],"sources":["calendar.component.tsx"],"sourcesContent":["import React from 'react';\nimport { View } from 'react-native';\nimport { isString } from 'lodash';\nimport moment, { Moment } from 'moment';\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\n\nimport { MonthView } from './views/month-view';\nimport WmCalendarProps from './calendar.props';\nimport { DEFAULT_CLASS, WmCalendarStyles } from './calendar.styles';\nimport WmIcon from '../../basic/icon/icon.component';\n\nexport class WmCalendarState extends BaseComponentState<WmCalendarProps> {\n selectedDate: Moment = moment();\n calendar: Map<String, { date: number, events: any []}> = new Map();\n}\n\nconst DEFAULT_DATE_FORMAT = 'DD-MM-YYYY';\n\nexport default class WmCalendar extends BaseComponent<WmCalendarProps, WmCalendarState, WmCalendarStyles> {\n\n constructor(props: WmCalendarProps) {\n super(props, DEFAULT_CLASS, new WmCalendarProps(), new WmCalendarState());\n }\n\n onDateChange = (date: Moment) => {\n const d = moment(date).format(DEFAULT_DATE_FORMAT);\n const dateWindow = this.state.calendar.get(d);\n this.updateState({\n props: {datavalue: d},\n selectedDate: date\n } as WmCalendarState);\n this.invokeEventCallback('onSelect', [d, d, this, dateWindow?.events]);\n }\n\n prepareDataset(dataset: any[]) {\n if (!dataset) {\n return;\n }\n const state = {\n calendar: new Map()\n } as WmCalendarState;\n const eventStartKey = this.state.props.eventstart;\n dataset.forEach(d => {\n let startDate = d[eventStartKey];\n if (!isString(startDate)) {\n startDate = moment(startDate).format(DEFAULT_DATE_FORMAT);\n }\n if (!state.calendar.has(startDate)) {\n state.calendar.set(startDate, {\n date: moment(startDate, DEFAULT_DATE_FORMAT).get('milliseconds'),\n events: []\n });\n }\n const dateWindow = state.calendar.get(startDate);\n dateWindow?.events.push(d);\n });\n this.updateState(state);\n }\n\n onPropertyChange(name: string, $new: any, $old: any) {\n switch(name) {\n case 'dataset':\n this.prepareDataset($new);\n break;\n case 'datavalue':\n if ($new) {\n this.updateState({\n selectedDate: isString($new) ? moment($new, DEFAULT_DATE_FORMAT) : moment($new)\n } as WmCalendarState)\n }\n }\n }\n\n renderDay = (date: Moment) => {\n const dateWindow = this.state.calendar.get(moment(date).format(DEFAULT_DATE_FORMAT));\n if (dateWindow) {\n return (\n <WmIcon\n iconclass=\"fa fa-circle\"\n iconsize={8}\n styles={{\n root: {marginTop: -8, alignSelf: 'flexStart'},\n icon: this.styles['eventDay' + Math.min(3, dateWindow.events.length)]}}></WmIcon>\n );\n }\n return (<></>);\n }\n\n componentDidUpdate(prevProps: WmCalendarProps, prevState: WmCalendarState, snapshot: any) {\n super.componentDidUpdate && super.componentDidUpdate(prevProps, prevState, snapshot);\n this.invokeEventCallback('onViewrender', [this, null]);\n }\n\n renderWidget(props: WmCalendarProps) {\n this.invokeEventCallback('onBeforerender', [null, this]);\n return (\n <View style={this.styles.root}>\n <MonthView\n date={this.state.selectedDate}\n selectDate={this.onDateChange}\n format={DEFAULT_DATE_FORMAT}\n renderChildDay={this.renderDay}\n containerStyle={this.styles.calendar}\n dateSelectedWarpDayStyle={this.styles.selectedDay}\n selectedDayTextStyle={this.styles.selectedDayText}\n warpRowWeekdays={this.styles.weekDay}\n warpRowControlMonthYear={this.styles.calendarHeader}\n weekdayStyle={this.styles.weekDayText}\n warpDayStyle={this.styles.dayWrapper}\n textDayStyle={this.styles.day}\n yearTextStyle={this.styles.yearText}\n monthTextStyle={this.styles.monthText}\n currentDayStyle={this.styles.today}\n currentDayTextStyle={this.styles.todayText}\n notDayOfCurrentMonthStyle={this.styles.notDayOfCurrentMonth}\n renderPrevYearButton={() =>\n (<WmIcon iconclass=\"wi wi-angle-double-left\" styles={this.styles.prevYearBtn}/>)}\n renderPrevMonthButton={() =>\n (<WmIcon iconclass=\"wi wi-chevron-left fa-2x\" styles={this.styles.prevMonthBtn}/>)}\n renderNextMonthButton={() =>\n (<WmIcon iconclass=\"wi wi-chevron-right fa-2x\" styles={this.styles.nextMonthBtn}/>)}\n renderNextYearButton={() =>\n (<WmIcon iconclass=\"wi wi-angle-double-right\" styles={this.styles.nextYearBtn}/>)}\n />\n </View>\n );\n }\n}\n"],"mappings":";;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,QAAQ,cAAc;AACnC,SAASC,QAAQ,QAAQ,QAAQ;AACjC,OAAOC,MAAM,MAAkB,QAAQ;AACvC,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,+CAA+C;AAEjG,SAASC,SAAS,QAAQ,oBAAoB;AAC9C,OAAOC,eAAe,MAAM,kBAAkB;AAC9C,SAASC,aAAa,QAA0B,mBAAmB;AACnE,OAAOC,MAAM,MAAM,iCAA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AAC6B,UAAW;MACrC,YAAY,EAAE,IAAI,CAAC7B,MAAM,CAAC8B,GAAI;MAC9B,aAAa,EAAE,IAAI,CAAC9B,MAAM,CAAC+B,QAAS;MACpC,cAAc,EAAE,IAAI,CAAC/B,MAAM,CAACgC,SAAU;MACtC,eAAe,EAAE,IAAI,CAAChC,MAAM,CAACiC,KAAM;MACnC,mBAAmB,EAAE,IAAI,CAACjC,MAAM,CAACkC,SAAU;MAC3C,yBAAyB,EAAE,IAAI,CAAClC,MAAM,CAACmC,oBAAqB;MAC5D,oBAAoB,EAAE,mBACnB,oBAAC,MAAM;QAAC,SAAS,EAAC,yBAAyB;QAAC,MAAM,EAAE,IAAI,CAACnC,MAAM,CAACoC;MAAY,EAAI;MACnF,qBAAqB,EAAE,mBACpB,oBAAC,MAAM;QAAC,SAAS,EAAC,0BAA0B;QAAC,MAAM,EAAE,IAAI,CAACpC,MAAM,CAACqC;MAAa,EAAI;MACrF,qBAAqB,EAAE,mBAClB,oBAAC,MAAM;QAAC,SAAS,EAAC,2BAA2B;QAAC,MAAM,EAAE,IAAI,CAACrC,MAAM,CAACsC;MAAa,EAAI;MACxF,oBAAoB,EAAE,mBACjB,oBAAC,MAAM;QAAC,SAAS,EAAC,0BAA0B;QAAC,MAAM,EAAE,IAAI,CAACtC,MAAM,CAACuC;MAAY;IAAI,EACtF,CACC;EAEX;AACF"}
|
|
1
|
+
{"version":3,"names":["React","View","isString","moment","BaseComponent","BaseComponentState","MonthView","WmCalendarProps","DEFAULT_CLASS","WmIcon","WmCalendarState","Map","DEFAULT_DATE_FORMAT","WmCalendar","constructor","props","date","d","format","dateWindow","state","calendar","get","updateState","datavalue","selectedDate","invokeEventCallback","events","root","marginTop","alignSelf","icon","styles","Math","min","length","prepareDataset","dataset","eventStartKey","eventstart","forEach","startDate","has","set","push","onPropertyChange","name","$new","$old","componentDidUpdate","prevProps","prevState","snapshot","renderWidget","_background","onDateChange","renderDay","selectedDay","selectedDayText","weekDay","calendarHeader","weekDayText","dayWrapper","day","yearText","monthText","today","todayText","notDayOfCurrentMonth","prevYearBtn","prevMonthBtn","nextMonthBtn","nextYearBtn"],"sources":["calendar.component.tsx"],"sourcesContent":["import React from 'react';\nimport { View } from 'react-native';\nimport { isString } from 'lodash';\nimport moment, { Moment } from 'moment';\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\n\nimport { MonthView } from './views/month-view';\nimport WmCalendarProps from './calendar.props';\nimport { DEFAULT_CLASS, WmCalendarStyles } from './calendar.styles';\nimport WmIcon from '../../basic/icon/icon.component';\n\nexport class WmCalendarState extends BaseComponentState<WmCalendarProps> {\n selectedDate: Moment = moment();\n calendar: Map<String, { date: number, events: any []}> = new Map();\n}\n\nconst DEFAULT_DATE_FORMAT = 'DD-MM-YYYY';\n\nexport default class WmCalendar extends BaseComponent<WmCalendarProps, WmCalendarState, WmCalendarStyles> {\n\n constructor(props: WmCalendarProps) {\n super(props, DEFAULT_CLASS, new WmCalendarProps(), new WmCalendarState());\n }\n\n onDateChange = (date: Moment) => {\n const d = moment(date).format(DEFAULT_DATE_FORMAT);\n const dateWindow = this.state.calendar.get(d);\n this.updateState({\n props: {datavalue: d},\n selectedDate: date\n } as WmCalendarState);\n this.invokeEventCallback('onSelect', [d, d, this, dateWindow?.events]);\n }\n\n prepareDataset(dataset: any[]) {\n if (!dataset) {\n return;\n }\n const state = {\n calendar: new Map()\n } as WmCalendarState;\n const eventStartKey = this.state.props.eventstart;\n dataset.forEach(d => {\n let startDate = d[eventStartKey];\n if (!isString(startDate)) {\n startDate = moment(startDate).format(DEFAULT_DATE_FORMAT);\n }\n if (!state.calendar.has(startDate)) {\n state.calendar.set(startDate, {\n date: moment(startDate, DEFAULT_DATE_FORMAT).get('milliseconds'),\n events: []\n });\n }\n const dateWindow = state.calendar.get(startDate);\n dateWindow?.events.push(d);\n });\n this.updateState(state);\n }\n\n onPropertyChange(name: string, $new: any, $old: any) {\n switch(name) {\n case 'dataset':\n this.prepareDataset($new);\n break;\n case 'datavalue':\n if ($new) {\n this.updateState({\n selectedDate: isString($new) ? moment($new, DEFAULT_DATE_FORMAT) : moment($new)\n } as WmCalendarState)\n }\n }\n }\n\n renderDay = (date: Moment) => {\n const dateWindow = this.state.calendar.get(moment(date).format(DEFAULT_DATE_FORMAT));\n if (dateWindow) {\n return (\n <WmIcon\n iconclass=\"fa fa-circle\"\n iconsize={8}\n styles={{\n root: {marginTop: -8, alignSelf: 'flexStart'},\n icon: this.styles['eventDay' + Math.min(3, dateWindow.events.length)]}}></WmIcon>\n );\n }\n return (<></>);\n }\n\n componentDidUpdate(prevProps: WmCalendarProps, prevState: WmCalendarState, snapshot: any) {\n super.componentDidUpdate && super.componentDidUpdate(prevProps, prevState, snapshot);\n this.invokeEventCallback('onViewrender', [this, null]);\n }\n\n renderWidget(props: WmCalendarProps) {\n this.invokeEventCallback('onBeforerender', [null, this]);\n return (\n <View style={this.styles.root}>\n {this._background}\n <MonthView\n date={this.state.selectedDate}\n selectDate={this.onDateChange}\n format={DEFAULT_DATE_FORMAT}\n renderChildDay={this.renderDay}\n containerStyle={this.styles.calendar}\n dateSelectedWarpDayStyle={this.styles.selectedDay}\n selectedDayTextStyle={this.styles.selectedDayText}\n warpRowWeekdays={this.styles.weekDay}\n warpRowControlMonthYear={this.styles.calendarHeader}\n weekdayStyle={this.styles.weekDayText}\n warpDayStyle={this.styles.dayWrapper}\n textDayStyle={this.styles.day}\n yearTextStyle={this.styles.yearText}\n monthTextStyle={this.styles.monthText}\n currentDayStyle={this.styles.today}\n currentDayTextStyle={this.styles.todayText}\n notDayOfCurrentMonthStyle={this.styles.notDayOfCurrentMonth}\n renderPrevYearButton={() =>\n (<WmIcon iconclass=\"wi wi-angle-double-left\" styles={this.styles.prevYearBtn}/>)}\n renderPrevMonthButton={() =>\n (<WmIcon iconclass=\"wi wi-chevron-left fa-2x\" styles={this.styles.prevMonthBtn}/>)}\n renderNextMonthButton={() =>\n (<WmIcon iconclass=\"wi wi-chevron-right fa-2x\" styles={this.styles.nextMonthBtn}/>)}\n renderNextYearButton={() =>\n (<WmIcon iconclass=\"wi wi-angle-double-right\" styles={this.styles.nextYearBtn}/>)}\n />\n </View>\n );\n }\n}\n"],"mappings":";;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,QAAQ,cAAc;AACnC,SAASC,QAAQ,QAAQ,QAAQ;AACjC,OAAOC,MAAM,MAAkB,QAAQ;AACvC,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,+CAA+C;AAEjG,SAASC,SAAS,QAAQ,oBAAoB;AAC9C,OAAOC,eAAe,MAAM,kBAAkB;AAC9C,SAASC,aAAa,QAA0B,mBAAmB;AACnE,OAAOC,MAAM,MAAM,iCAAiC;AAEpD,OAAO,MAAMC,eAAe,SAASL,kBAAkB,CAAkB;EAAA;IAAA;IAAA,sCAChDF,MAAM,EAAE;IAAA,kCAC0B,IAAIQ,GAAG,EAAE;EAAA;AACpE;AAEA,MAAMC,mBAAmB,GAAG,YAAY;AAExC,eAAe,MAAMC,UAAU,SAAST,aAAa,CAAqD;EAExGU,WAAW,CAACC,KAAsB,EAAE;IAClC,KAAK,CAACA,KAAK,EAAEP,aAAa,EAAE,IAAID,eAAe,EAAE,EAAE,IAAIG,eAAe,EAAE,CAAC;IAAC,sCAG5DM,IAAY,IAAK;MAC/B,MAAMC,CAAC,GAAGd,MAAM,CAACa,IAAI,CAAC,CAACE,MAAM,CAACN,mBAAmB,CAAC;MAClD,MAAMO,UAAU,GAAG,IAAI,CAACC,KAAK,CAACC,QAAQ,CAACC,GAAG,CAACL,CAAC,CAAC;MAC7C,IAAI,CAACM,WAAW,CAAC;QACfR,KAAK,EAAE;UAACS,SAAS,EAAEP;QAAC,CAAC;QACrBQ,YAAY,EAAET;MAChB,CAAC,CAAoB;MACrB,IAAI,CAACU,mBAAmB,CAAC,UAAU,EAAE,CAACT,CAAC,EAAEA,CAAC,EAAE,IAAI,EAAEE,UAAU,aAAVA,UAAU,uBAAVA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AC,SAAS,EAAC,0BAA0B;QAAC,MAAM,EAAE,IAAI,CAACvC,MAAM,CAACwC;MAAY;IAAI,EACtF,CACC;EAEX;AACF"}
|
|
@@ -9,7 +9,6 @@ import { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/cor
|
|
|
9
9
|
import { unStringify, validateField } from '@wavemaker/app-rn-runtime/core/utils';
|
|
10
10
|
import WmCheckboxProps from './checkbox.props';
|
|
11
11
|
import { DEFAULT_CLASS } from './checkbox.styles';
|
|
12
|
-
import { createSkeleton } from '../../basic/skeleton/skeleton.component';
|
|
13
12
|
export class WmCheckboxState extends BaseComponentState {
|
|
14
13
|
constructor() {
|
|
15
14
|
super(...arguments);
|
|
@@ -80,25 +79,11 @@ export default class WmCheckbox extends BaseComponent {
|
|
|
80
79
|
this.invokeEventCallback('onBlur', [null, this.proxy]);
|
|
81
80
|
});
|
|
82
81
|
}
|
|
83
|
-
renderSkeleton(props) {
|
|
84
|
-
return /*#__PURE__*/React.createElement(TouchableOpacity, {
|
|
85
|
-
style: this.styles.root,
|
|
86
|
-
onPress: this.onPress.bind(this)
|
|
87
|
-
}, /*#__PURE__*/React.createElement(Checkbox.Android, {
|
|
88
|
-
status: this.state.isChecked ? 'checked' : 'unchecked',
|
|
89
|
-
color: this.styles.text.color,
|
|
90
|
-
disabled: this.props.readonly || this.props.disabled
|
|
91
|
-
}), createSkeleton(this.theme, this.styles.skeleton, {
|
|
92
|
-
...this.styles.root,
|
|
93
|
-
width: this.styles.root.width,
|
|
94
|
-
height: this.styles.root.height
|
|
95
|
-
}));
|
|
96
|
-
}
|
|
97
82
|
renderWidget(props) {
|
|
98
83
|
return /*#__PURE__*/React.createElement(TouchableOpacity, {
|
|
99
84
|
style: this.styles.root,
|
|
100
85
|
onPress: this.onPress.bind(this)
|
|
101
|
-
}, /*#__PURE__*/React.createElement(Checkbox.Android, {
|
|
86
|
+
}, this._background, /*#__PURE__*/React.createElement(Checkbox.Android, {
|
|
102
87
|
status: this.state.isChecked ? 'checked' : 'unchecked',
|
|
103
88
|
color: this.styles.text.color,
|
|
104
89
|
disabled: props.readonly || props.disabled
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","Text","Checkbox","TouchableOpacity","BaseComponent","BaseComponentState","unStringify","validateField","WmCheckboxProps","DEFAULT_CLASS","
|
|
1
|
+
{"version":3,"names":["React","Text","Checkbox","TouchableOpacity","BaseComponent","BaseComponentState","unStringify","validateField","WmCheckboxProps","DEFAULT_CLASS","WmCheckboxState","WmCheckbox","constructor","props","setChecked","dataValue","checkedvalue","value","updateState","isChecked","onPropertyChange","name","$new","$old","state","datavalue","updateDatavalue","validate","validationObj","isValid","errorType","onPress","readonly","invokeEventCallback","proxy","disabled","oldValue","uncheckedvalue","onFieldChange","renderWidget","styles","root","bind","_background","text","color","checkboxLabel","caption"],"sources":["checkbox.component.tsx"],"sourcesContent":["import React from 'react';\nimport { Text } from 'react-native';\nimport { Checkbox } from 'react-native-paper';\nimport { TouchableOpacity } from 'react-native-gesture-handler';\n\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\nimport {unStringify, validateField} from '@wavemaker/app-rn-runtime/core/utils';\n\nimport WmCheckboxProps from './checkbox.props';\nimport { DEFAULT_CLASS, WmCheckboxStyles } from './checkbox.styles';\nimport WmSkeleton, { createSkeleton } from '../../basic/skeleton/skeleton.component';\n\nexport class WmCheckboxState extends BaseComponentState<WmCheckboxProps> {\n isChecked: boolean = false;\n isValid: boolean = true;\n errorType = '';\n}\n\nexport default class WmCheckbox extends BaseComponent<WmCheckboxProps, WmCheckboxState, WmCheckboxStyles> {\n\n constructor(props: WmCheckboxProps) {\n super(props, DEFAULT_CLASS, new WmCheckboxProps(), new WmCheckboxState());\n }\n\n setChecked(dataValue: any, checkedvalue: any) {\n const value = unStringify(dataValue) === unStringify(checkedvalue, true);\n this.updateState({ isChecked: value } as WmCheckboxState);\n }\n\n onPropertyChange(name: string, $new: any, $old: any) {\n switch (name) {\n case 'checkedvalue':\n this.setChecked(this.state.props.datavalue, $new);\n break;\n case 'datavalue':\n this.setChecked($new, this.state.props.checkedvalue);\n break;\n }\n }\n\n updateDatavalue(value: any) {\n this.updateState({ props: { datavalue: value }} as WmCheckboxState);\n }\n validate(value: any) {\n const validationObj = validateField(this.state.props, value);\n this.updateState({\n isValid: validationObj.isValid,\n errorType: validationObj.errorType\n } as WmCheckboxState);\n }\n\n onPress() {\n if (!this.state.props.readonly) {\n this.invokeEventCallback('onFocus', [null, this.proxy]);\n }\n this.invokeEventCallback('onTap', [null, this.proxy]);\n if (this.state.props.disabled) {\n return;\n }\n const oldValue = this.state.props.datavalue;\n const value = !this.state.isChecked;\n this.validate(value);\n this.updateState({ isChecked: value } as WmCheckboxState);\n const dataValue = value === true ? this.state.props.checkedvalue : this.state.props.uncheckedvalue;\n this.updateState({ props: { datavalue: dataValue } } as WmCheckboxState,\n () => {\n if (!this.props.onFieldChange) {\n this.invokeEventCallback('onChange', [null, this.proxy, dataValue, oldValue]);\n } else {\n this.props.onFieldChange && this.props.onFieldChange('datavalue', dataValue, oldValue);\n }\n this.invokeEventCallback('onBlur', [ null, this.proxy ]);\n });\n }\n\n renderWidget(props: WmCheckboxProps) {\n return (\n <TouchableOpacity style={this.styles.root} onPress={this.onPress.bind(this)}>\n {this._background}\n <Checkbox.Android status={this.state.isChecked ? 'checked' : 'unchecked'} color={this.styles.text.color as string} disabled={props.readonly || props.disabled}/>\n <Text style={this.styles.checkboxLabel}>{props.caption}</Text>\n </TouchableOpacity>\n );\n }\n}\n"],"mappings":";;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,QAAQ,cAAc;AACnC,SAASC,QAAQ,QAAQ,oBAAoB;AAC7C,SAASC,gBAAgB,QAAQ,8BAA8B;AAE/D,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,+CAA+C;AACjG,SAAQC,WAAW,EAAEC,aAAa,QAAO,sCAAsC;AAE/E,OAAOC,eAAe,MAA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mB,CAAC,QAAQ,EAAE,CAAE,IAAI,EAAE,IAAI,CAACC,KAAK,CAAE,CAAC;IAC1D,CAAC,CAAC;EACN;EAEAK,YAAY,CAAC1B,KAAsB,EAAE;IACnC,oBACE,oBAAC,gBAAgB;MAAC,KAAK,EAAE,IAAI,CAAC2B,MAAM,CAACC,IAAK;MAAC,OAAO,EAAE,IAAI,CAACV,OAAO,CAACW,IAAI,CAAC,IAAI;IAAE,GACvE,IAAI,CAACC,WAAW,eACjB,oBAAC,QAAQ,CAAC,OAAO;MAAC,MAAM,EAAE,IAAI,CAACnB,KAAK,CAACL,SAAS,GAAG,SAAS,GAAG,WAAY;MAAC,KAAK,EAAE,IAAI,CAACqB,MAAM,CAACI,IAAI,CAACC,KAAgB;MAAC,QAAQ,EAAEhC,KAAK,CAACmB,QAAQ,IAAInB,KAAK,CAACsB;IAAS,EAAE,eAChK,oBAAC,IAAI;MAAC,KAAK,EAAE,IAAI,CAACK,MAAM,CAACM;IAAc,GAAEjC,KAAK,CAACkC,OAAO,CAAQ,CAC/C;EAEvB;AACF"}
|
|
@@ -9,7 +9,6 @@ import { TouchableOpacity } from 'react-native-gesture-handler';
|
|
|
9
9
|
import WmCheckboxsetProps from './checkboxset.props';
|
|
10
10
|
import { DEFAULT_CLASS } from './checkboxset.styles';
|
|
11
11
|
import { BaseDatasetComponent, BaseDatasetState } from '@wavemaker/app-rn-runtime/components/input/basedataset/basedataset.component';
|
|
12
|
-
import { createSkeleton } from '../../basic/skeleton/skeleton.component';
|
|
13
12
|
export class WmCheckboxsetState extends BaseDatasetState {
|
|
14
13
|
constructor() {
|
|
15
14
|
super(...arguments);
|
|
@@ -82,43 +81,6 @@ export default class WmCheckboxset extends BaseDatasetComponent {
|
|
|
82
81
|
const props = this.state.props;
|
|
83
82
|
return /*#__PURE__*/React.createElement(View, null, items && items.length ? items.map((item, index) => this.renderChild(item, index)) : null);
|
|
84
83
|
}
|
|
85
|
-
renderSkeletonChild(item, index) {
|
|
86
|
-
const props = this.state.props;
|
|
87
|
-
const displayText = item.displayexp || item.displayfield;
|
|
88
|
-
return /*#__PURE__*/React.createElement(TouchableOpacity, {
|
|
89
|
-
style: this.styles.checkboxHead,
|
|
90
|
-
onPress: this.onPress.bind(this, item),
|
|
91
|
-
key: item.key
|
|
92
|
-
}, /*#__PURE__*/React.createElement(Checkbox.Android, {
|
|
93
|
-
status: item.selected ? 'checked' : 'unchecked',
|
|
94
|
-
color: this.styles.text.color,
|
|
95
|
-
disabled: props.readonly || props.disabled
|
|
96
|
-
}), createSkeleton(this.theme, this.styles.skeleton, {
|
|
97
|
-
...this.styles.root,
|
|
98
|
-
width: this.styles.root.width,
|
|
99
|
-
height: this.styles.root.height
|
|
100
|
-
}));
|
|
101
|
-
}
|
|
102
|
-
renderSkeletonGroupby() {
|
|
103
|
-
const groupedData = this.state.groupedData;
|
|
104
|
-
return /*#__PURE__*/React.createElement(View, null, groupedData && groupedData.length ? groupedData.map((groupObj, index) => {
|
|
105
|
-
return /*#__PURE__*/React.createElement(View, {
|
|
106
|
-
key: groupObj.key
|
|
107
|
-
}, /*#__PURE__*/React.createElement(Text, {
|
|
108
|
-
style: this.styles.groupHeaderTitle
|
|
109
|
-
}, groupObj.key), this.renderSkeletonCheckboxses(groupObj.data));
|
|
110
|
-
}) : null);
|
|
111
|
-
}
|
|
112
|
-
renderSkeletonCheckboxses(items) {
|
|
113
|
-
const props = this.state.props;
|
|
114
|
-
return /*#__PURE__*/React.createElement(View, null, items && items.length ? items.map((item, index) => this.renderChild(item, index)) : null);
|
|
115
|
-
}
|
|
116
|
-
renderSkeleton(props) {
|
|
117
|
-
const items = this.state.dataItems;
|
|
118
|
-
return /*#__PURE__*/React.createElement(View, {
|
|
119
|
-
style: this.styles.root
|
|
120
|
-
}, this.props.groupby && this.renderSkeletonGroupby(), !this.props.groupby && this.renderSkeletonCheckboxses(items));
|
|
121
|
-
}
|
|
122
84
|
renderWidget(props) {
|
|
123
85
|
const items = this.state.dataItems;
|
|
124
86
|
return /*#__PURE__*/React.createElement(View, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","Text","View","find","forEach","isEqual","Checkbox","TouchableOpacity","WmCheckboxsetProps","DEFAULT_CLASS","BaseDatasetComponent","BaseDatasetState","createSkeleton","WmCheckboxsetState","WmCheckboxset","constructor","props","onPress","item","invokeEventCallback","proxy","state","disabled","readonly","selected","selectedValue","selectedItem","dataItems","d","key","oldValue","datavalue","push","datafield","validate","updateState","computeDisplayValue","undefined","renderChild","index","displayText","displayexp","displayfield","styles","checkboxHead","bind","text","color","checkboxLabel","updateDatavalue","value","Promise","resolve","renderGroupby","groupedData","length","map","groupObj","groupHeaderTitle","renderCheckboxses","data","items","renderSkeletonChild","theme","skeleton","root","width","height","renderSkeletonGroupby","renderSkeletonCheckboxses","renderSkeleton","groupby","renderWidget"],"sources":["checkboxset.component.tsx"],"sourcesContent":["import React from 'react';\nimport { Text, View } from 'react-native';\nimport { find, forEach, isEqual } from 'lodash';\nimport { Checkbox } from 'react-native-paper';\nimport { TouchableOpacity } from 'react-native-gesture-handler';\n\nimport WmCheckboxsetProps from './checkboxset.props';\nimport {\n DEFAULT_CLASS,\n \n WmCheckboxsetStyles,\n} from './checkboxset.styles';\nimport {\n BaseDatasetComponent,\n BaseDatasetState,\n} from '@wavemaker/app-rn-runtime/components/input/basedataset/basedataset.component';\nimport WmSkeleton, { createSkeleton } from '../../basic/skeleton/skeleton.component';\n\nexport class WmCheckboxsetState extends BaseDatasetState<WmCheckboxsetProps> {\n isValid: boolean = true;\n}\n\nexport default class WmCheckboxset extends BaseDatasetComponent<WmCheckboxsetProps, WmCheckboxsetState, WmCheckboxsetStyles> {\n constructor(props: WmCheckboxsetProps) {\n super(props, DEFAULT_CLASS, new WmCheckboxsetProps());\n }\n\n onPress(item: any) {\n this.invokeEventCallback('onTap', [null, this.proxy]);\n if (this.state.props.disabled || this.state.props.readonly) {\n return;\n }\n item.selected = !item.selected;\n const selectedValue: any = [];\n const selectedItem = find(this.state.dataItems, d => isEqual(d.key, item.key));\n const oldValue = this.state.props.datavalue;\n selectedItem.selected = item.selected;\n forEach(this.state.dataItems, (item) => {\n if (item.selected) {\n selectedValue.push(item.datafield);\n }\n });\n this.validate(selectedValue);\n this.updateState({ props: { datavalue: selectedValue }} as WmCheckboxsetState,\n () => {\n this.computeDisplayValue();\n this.invokeEventCallback('onChange', [ undefined, this.proxy, selectedValue, oldValue ]);\n });\n }\n\n renderChild(item: any, index: any) {\n const props = this.state.props;\n const displayText = item.displayexp || item.displayfield;\n return (\n <TouchableOpacity style={this.styles.checkboxHead} onPress={this.onPress.bind(this, item)} key={item.key}>\n <Checkbox.Android status={item.selected ? 'checked' : 'unchecked'} color={this.styles.text.color as string} disabled={props.readonly || props.disabled}/>\n <Text style={this.styles.checkboxLabel}>{displayText}</Text>\n </TouchableOpacity>)\n }\n\n updateDatavalue(value: any) {\n this.updateState({ props: { datavalue: value }} as WmCheckboxsetState);\n return Promise.resolve();\n }\n\n renderGroupby() {\n const groupedData = this.state.groupedData;\n return (\n <View>\n {groupedData && groupedData.length\n ? groupedData.map((groupObj: any, index: any) => {\n return(\n <View key={groupObj.key}>\n <Text style={this.styles.groupHeaderTitle}>{groupObj.key}</Text>\n {this.renderCheckboxses(groupObj.data)}\n </View>)\n })\n : null}\n </View>\n );\n }\n\n renderCheckboxses(items: any) {\n const props = this.state.props;\n return(<View>\n {items && items.length\n ? items.map((item: any, index: any) => this.renderChild(item, index))\n : null}\n </View>)\n }\n\n public renderSkeletonChild(item: any, index: any) {\n const props = this.state.props;\n const displayText = item.displayexp || item.displayfield;\n return (\n <TouchableOpacity style={this.styles.checkboxHead} onPress={this.onPress.bind(this, item)} key={item.key}>\n <Checkbox.Android status={item.selected ? 'checked' : 'unchecked'} color={this.styles.text.color as string} disabled={props.readonly || props.disabled}/>\n {\n createSkeleton(this.theme, this.styles.skeleton, {\n ...this.styles.root,\n width: this.styles.root.width,\n height: this.styles.root.height\n })\n }\n </TouchableOpacity>)\n }\n\n public renderSkeletonGroupby() {\n const groupedData = this.state.groupedData;\n return (\n <View>\n {groupedData && groupedData.length\n ? groupedData.map((groupObj: any, index: any) => {\n return(\n <View key={groupObj.key}>\n <Text style={this.styles.groupHeaderTitle}>{groupObj.key}</Text>\n {this.renderSkeletonCheckboxses(groupObj.data)}\n </View>)\n })\n : null}\n </View>\n );\n }\n\n public renderSkeletonCheckboxses(items: any) {\n const props = this.state.props;\n return(<View>\n {items && items.length\n ? items.map((item: any, index: any) => this.renderChild(item, index))\n : null}\n </View>)\n }\n\n public renderSkeleton(props: WmCheckboxsetProps) {\n const items = this.state.dataItems;\n return (\n <View style={this.styles.root}>\n {this.props.groupby && this.renderSkeletonGroupby()}\n {!this.props.groupby && this.renderSkeletonCheckboxses(items)}\n </View>\n );\n }\n renderWidget(props: WmCheckboxsetProps) {\n const items = this.state.dataItems;\n return (\n <View style={this.styles.root}>\n {props.groupby && this.renderGroupby()}\n {!props.groupby && this.renderCheckboxses(items)}\n </View>\n );\n }\n}\n"],"mappings":";;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,EAAEC,IAAI,QAAQ,cAAc;AACzC,SAASC,IAAI,EAAEC,OAAO,EAAEC,OAAO,QAAQ,QAAQ;AAC/C,SAASC,QAAQ,QAAQ,oBAAoB;AAC7C,SAASC,gBAAgB,QAAQ,8BAA8B;AAE/D,OAAOC,kBAAkB,MAAM,qBAAqB;AACpD,SACEC,aAAa,QAGR,sBAAsB;AAC7B,SACEC,oBAAoB,EACpBC,gBAAgB,QACX,8EAA8E;AACrF,SAAqBC,cAAc,QAAQ,yCAAyC;AAEpF,OAAO,MAAMC,kBAAkB,SAASF,gBAAgB,CAAqB;EAAA;IAAA;IAAA,iCACxD,IAAI;EAAA;AACzB;AAEA,eAAe,MAAMG,aAAa,SAASJ,oBAAoB,CAA8D;EAC3HK,WAAW,CAACC,KAAyB,EAAE;IACrC,KAAK,CAACA,KAAK,EAAEP,aAAa,EAAE,IAAID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,IAAI,CAACxC,KAAK,CAACM,SAAS;IAClC,oBACE,oBAAC,IAAI;MAAC,KAAK,EAAE,IAAI,CAACgB,MAAM,CAACsB;IAAK,GAC3BjD,KAAK,CAACuD,OAAO,IAAI,IAAI,CAAClB,aAAa,EAAE,EACrC,CAACrC,KAAK,CAACuD,OAAO,IAAI,IAAI,CAACZ,iBAAiB,CAACE,KAAK,CAAC,CAC3C;EAEX;AACF"}
|
|
1
|
+
{"version":3,"names":["React","Text","View","find","forEach","isEqual","Checkbox","TouchableOpacity","WmCheckboxsetProps","DEFAULT_CLASS","BaseDatasetComponent","BaseDatasetState","WmCheckboxsetState","WmCheckboxset","constructor","props","onPress","item","invokeEventCallback","proxy","state","disabled","readonly","selected","selectedValue","selectedItem","dataItems","d","key","oldValue","datavalue","push","datafield","validate","updateState","computeDisplayValue","undefined","renderChild","index","displayText","displayexp","displayfield","styles","checkboxHead","bind","text","color","checkboxLabel","updateDatavalue","value","Promise","resolve","renderGroupby","groupedData","length","map","groupObj","groupHeaderTitle","renderCheckboxses","data","items","renderWidget","root","groupby"],"sources":["checkboxset.component.tsx"],"sourcesContent":["import React from 'react';\nimport { Text, View } from 'react-native';\nimport { find, forEach, isEqual } from 'lodash';\nimport { Checkbox } from 'react-native-paper';\nimport { TouchableOpacity } from 'react-native-gesture-handler';\n\nimport WmCheckboxsetProps from './checkboxset.props';\nimport {\n DEFAULT_CLASS,\n \n WmCheckboxsetStyles,\n} from './checkboxset.styles';\nimport {\n BaseDatasetComponent,\n BaseDatasetState,\n} from '@wavemaker/app-rn-runtime/components/input/basedataset/basedataset.component';\nimport WmSkeleton, { createSkeleton } from '../../basic/skeleton/skeleton.component';\n\nexport class WmCheckboxsetState extends BaseDatasetState<WmCheckboxsetProps> {\n isValid: boolean = true;\n}\n\nexport default class WmCheckboxset extends BaseDatasetComponent<WmCheckboxsetProps, WmCheckboxsetState, WmCheckboxsetStyles> {\n constructor(props: WmCheckboxsetProps) {\n super(props, DEFAULT_CLASS, new WmCheckboxsetProps());\n }\n\n onPress(item: any) {\n this.invokeEventCallback('onTap', [null, this.proxy]);\n if (this.state.props.disabled || this.state.props.readonly) {\n return;\n }\n item.selected = !item.selected;\n const selectedValue: any = [];\n const selectedItem = find(this.state.dataItems, d => isEqual(d.key, item.key));\n const oldValue = this.state.props.datavalue;\n selectedItem.selected = item.selected;\n forEach(this.state.dataItems, (item) => {\n if (item.selected) {\n selectedValue.push(item.datafield);\n }\n });\n this.validate(selectedValue);\n this.updateState({ props: { datavalue: selectedValue }} as WmCheckboxsetState,\n () => {\n this.computeDisplayValue();\n this.invokeEventCallback('onChange', [ undefined, this.proxy, selectedValue, oldValue ]);\n });\n }\n\n renderChild(item: any, index: any) {\n const props = this.state.props;\n const displayText = item.displayexp || item.displayfield;\n return (\n <TouchableOpacity style={this.styles.checkboxHead} onPress={this.onPress.bind(this, item)} key={item.key}>\n <Checkbox.Android status={item.selected ? 'checked' : 'unchecked'} color={this.styles.text.color as string} disabled={props.readonly || props.disabled}/>\n <Text style={this.styles.checkboxLabel}>{displayText}</Text>\n </TouchableOpacity>)\n }\n\n updateDatavalue(value: any) {\n this.updateState({ props: { datavalue: value }} as WmCheckboxsetState);\n return Promise.resolve();\n }\n\n renderGroupby() {\n const groupedData = this.state.groupedData;\n return (\n <View>\n {groupedData && groupedData.length\n ? groupedData.map((groupObj: any, index: any) => {\n return(\n <View key={groupObj.key}>\n <Text style={this.styles.groupHeaderTitle}>{groupObj.key}</Text>\n {this.renderCheckboxses(groupObj.data)}\n </View>)\n })\n : null}\n </View>\n );\n }\n\n renderCheckboxses(items: any) {\n const props = this.state.props;\n return(<View>\n {items && items.length\n ? items.map((item: any, index: any) => this.renderChild(item, index))\n : null}\n </View>)\n }\n renderWidget(props: WmCheckboxsetProps) {\n const items = this.state.dataItems;\n return (\n <View style={this.styles.root}>\n {props.groupby && this.renderGroupby()}\n {!props.groupby && this.renderCheckboxses(items)}\n </View>\n );\n }\n}\n"],"mappings":";;;AAAA,OAAOA,KA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}
|
|
@@ -11,7 +11,7 @@ export default class WmComposite extends BaseComponent {
|
|
|
11
11
|
renderWidget(props) {
|
|
12
12
|
return /*#__PURE__*/React.createElement(View, {
|
|
13
13
|
style: this.styles.root
|
|
14
|
-
}, props.children);
|
|
14
|
+
}, this._background, props.children);
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
17
|
//# sourceMappingURL=composite.component.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","View","BaseComponent","BaseComponentState","WmCompositeProps","DEFAULT_CLASS","WmCompositeState","WmComposite","constructor","props","renderWidget","styles","root","children"],"sources":["composite.component.tsx"],"sourcesContent":["import React from 'react';\nimport { View } from 'react-native';\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\n\nimport WmCompositeProps from './composite.props';\nimport { DEFAULT_CLASS, WmCompositeStyles } from './composite.styles';\n\nexport class WmCompositeState extends BaseComponentState<WmCompositeProps> {}\n\nexport default class WmComposite extends BaseComponent<WmCompositeProps, WmCompositeState, WmCompositeStyles> {\n\n constructor(props: WmCompositeProps) {\n super(props, DEFAULT_CLASS, new WmCompositeProps());\n }\n\n renderWidget(props: WmCompositeProps) {\n return (<View style={this.styles.root}>{props.children}</View>); \n }\n}\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,QAAQ,cAAc;AACnC,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,+CAA+C;AAEjG,OAAOC,gBAAgB,MAAM,mBAAmB;AAChD,SAASC,aAAa,QAA2B,oBAAoB;AAErE,OAAO,MAAMC,gBAAgB,SAASH,kBAAkB,CAAmB;AAE3E,eAAe,MAAMI,WAAW,SAASL,aAAa,CAAwD;EAE5GM,WAAW,CAACC,KAAuB,EAAE;IACnC,KAAK,CAACA,KAAK,EAAEJ,aAAa,EAAE,IAAID,gBAAgB,EAAE,CAAC;EACrD;EAEAM,YAAY,CAACD,KAAuB,EAAE;IACpC,oBAAQ,oBAAC,IAAI;MAAC,KAAK,EAAE,IAAI,CAACE,MAAM,CAACC;IAAK,
|
|
1
|
+
{"version":3,"names":["React","View","BaseComponent","BaseComponentState","WmCompositeProps","DEFAULT_CLASS","WmCompositeState","WmComposite","constructor","props","renderWidget","styles","root","_background","children"],"sources":["composite.component.tsx"],"sourcesContent":["import React from 'react';\nimport { View } from 'react-native';\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\n\nimport WmCompositeProps from './composite.props';\nimport { DEFAULT_CLASS, WmCompositeStyles } from './composite.styles';\n\nexport class WmCompositeState extends BaseComponentState<WmCompositeProps> {}\n\nexport default class WmComposite extends BaseComponent<WmCompositeProps, WmCompositeState, WmCompositeStyles> {\n\n constructor(props: WmCompositeProps) {\n super(props, DEFAULT_CLASS, new WmCompositeProps());\n }\n\n renderWidget(props: WmCompositeProps) {\n return (<View style={this.styles.root}>{this._background}{props.children}</View>); \n }\n}\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,QAAQ,cAAc;AACnC,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,+CAA+C;AAEjG,OAAOC,gBAAgB,MAAM,mBAAmB;AAChD,SAASC,aAAa,QAA2B,oBAAoB;AAErE,OAAO,MAAMC,gBAAgB,SAASH,kBAAkB,CAAmB;AAE3E,eAAe,MAAMI,WAAW,SAASL,aAAa,CAAwD;EAE5GM,WAAW,CAACC,KAAuB,EAAE;IACnC,KAAK,CAACA,KAAK,EAAEJ,aAAa,EAAE,IAAID,gBAAgB,EAAE,CAAC;EACrD;EAEAM,YAAY,CAACD,KAAuB,EAAE;IACpC,oBAAQ,oBAAC,IAAI;MAAC,KAAK,EAAE,IAAI,CAACE,MAAM,CAACC;IAAK,GAAE,IAAI,CAACC,WAAW,EAAEJ,KAAK,CAACK,QAAQ,CAAQ;EAClF;AACF"}
|
|
@@ -241,7 +241,7 @@ export default class BaseDatetime extends BaseComponent {
|
|
|
241
241
|
renderWidget(props) {
|
|
242
242
|
return this.addTouchableOpacity(props, /*#__PURE__*/React.createElement(View, {
|
|
243
243
|
style: [this.styles.root, this.state.isValid ? {} : this.styles.invalid, this.state.isFocused ? this.styles.focused : null]
|
|
244
|
-
}, /*#__PURE__*/React.createElement(View, {
|
|
244
|
+
}, this._background, /*#__PURE__*/React.createElement(View, {
|
|
245
245
|
style: this.styles.container
|
|
246
246
|
}, this.addTouchableOpacity(props, /*#__PURE__*/React.createElement(Text, {
|
|
247
247
|
style: [this.styles.text, this.state.displayValue ? {} : this.styles.placeholderText]
|