@wavemaker/app-rn-runtime 11.4.0-next.1417013 → 11.4.0-next.1417016
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/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/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 +1 -1
- 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 +5 -5
- app-rn-runtime/runtime/App.js +20 -15
- 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/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 +11 -6
- 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 +5 -36
- 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 +3 -12
- app-rn-runtime/variables/http.service.js.map +1 -1
- app-rn-runtime/variables/service-variable.js +19 -8
- app-rn-runtime/variables/service-variable.js.map +1 -1
|
@@ -46,7 +46,7 @@ export default class WmWizardstep extends BaseComponent {
|
|
|
46
46
|
renderWidget(props) {
|
|
47
47
|
return /*#__PURE__*/React.createElement(View, {
|
|
48
48
|
style: this.styles.root
|
|
49
|
-
}, props.children);
|
|
49
|
+
}, this._background, props.children);
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
52
|
//# sourceMappingURL=wizardstep.component.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","View","BaseComponent","BaseComponentState","WmWizardstepProps","DEFAULT_CLASS","WmWizardstepState","WmWizardstep","constructor","props","componentDidMount","wizard","parent","addWizardStep","setActive","updateState","active","setInActive","isVisible","state","invokeNextCB","index","invokeEventCallback","proxy","invokePrevCB","invokeSkipCB","renderWidget","styles","root","children"],"sources":["wizardstep.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 WmWizardstepProps from './wizardstep.props';\nimport { DEFAULT_CLASS, WmWizardstepStyles } from './wizardstep.styles';\nimport WmWizard from '../wizard.component';\n\nexport class WmWizardstepState extends BaseComponentState<WmWizardstepProps> {\n active = false;\n}\n\nexport default class WmWizardstep extends BaseComponent<WmWizardstepProps, WmWizardstepState, WmWizardstepStyles> {\n\n constructor(props: WmWizardstepProps) {\n super(props, DEFAULT_CLASS, new WmWizardstepProps(), new WmWizardstepState());\n }\n\n componentDidMount() {\n const wizard = (this.parent) as WmWizard;\n wizard.addWizardStep(this);\n super.componentDidMount();\n }\n\n setActive() {\n this.updateState({\n active: true\n } as WmWizardstepState);\n }\n\n setInActive() {\n this.updateState({\n active: false\n } as WmWizardstepState);\n }\n\n isVisible() {\n return super.isVisible() && this.state.active;\n }\n\n invokeNextCB(index: number) {\n this.invokeEventCallback('onNext', [this.proxy, this, index]);\n }\n\n invokePrevCB(index: number) {\n this.invokeEventCallback('onPrev', [this.proxy, this, index]);\n }\n\n invokeSkipCB(index: number) {\n this.invokeEventCallback('onSkip', [this.proxy, this, index]);\n }\n\n renderWidget(props: WmWizardstepProps) {\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,iBAAiB,MAAM,oBAAoB;AAClD,SAASC,aAAa,QAA4B,qBAAqB;AAGvE,OAAO,MAAMC,iBAAiB,SAASH,kBAAkB,CAAoB;EAAA;IAAA;IAAA,gCAClE,KAAK;EAAA;AAChB;AAEA,eAAe,MAAMI,YAAY,SAASL,aAAa,CAA2D;EAEhHM,WAAW,CAACC,KAAwB,EAAE;IACpC,KAAK,CAACA,KAAK,EAAEJ,aAAa,EAAE,IAAID,iBAAiB,EAAE,EAAE,IAAIE,iBAAiB,EAAE,CAAC;EAC/E;EAEAI,iBAAiB,GAAG;IAClB,MAAMC,MAAM,GAAI,IAAI,CAACC,MAAmB;IACxCD,MAAM,CAACE,aAAa,CAAC,IAAI,CAAC;IAC1B,KAAK,CAACH,iBAAiB,EAAE;EAC3B;EAEAI,SAAS,GAAG;IACV,IAAI,CAACC,WAAW,CAAC;MACfC,MAAM,EAAE;IACV,CAAC,CAAsB;EACzB;EAEAC,WAAW,GAAG;IACZ,IAAI,CAACF,WAAW,CAAC;MACfC,MAAM,EAAE;IACV,CAAC,CAAsB;EACzB;EAEAE,SAAS,GAAG;IACV,OAAO,KAAK,CAACA,SAAS,EAAE,IAAI,IAAI,CAACC,KAAK,CAACH,MAAM;EAC/C;EAEAI,YAAY,CAACC,KAAa,EAAE;IAC1B,IAAI,CAACC,mBAAmB,CAAC,QAAQ,EAAE,CAAC,IAAI,CAACC,KAAK,EAAE,IAAI,EAAEF,KAAK,CAAC,CAAC;EAC/D;EAEAG,YAAY,CAACH,KAAa,EAAE;IAC1B,IAAI,CAACC,mBAAmB,CAAC,QAAQ,EAAE,CAAC,IAAI,CAACC,KAAK,EAAE,IAAI,EAAEF,KAAK,CAAC,CAAC;EAC/D;EAEAI,YAAY,CAACJ,KAAa,EAAE;IAC1B,IAAI,CAACC,mBAAmB,CAAC,QAAQ,EAAE,CAAC,IAAI,CAACC,KAAK,EAAE,IAAI,EAAEF,KAAK,CAAC,CAAC;EAC/D;EAEAK,YAAY,CAACjB,KAAwB,EAAE;IACrC,oBAAQ,oBAAC,IAAI;MAAC,KAAK,EAAE,IAAI,CAACkB,MAAM,CAACC;IAAK,
|
|
1
|
+
{"version":3,"names":["React","View","BaseComponent","BaseComponentState","WmWizardstepProps","DEFAULT_CLASS","WmWizardstepState","WmWizardstep","constructor","props","componentDidMount","wizard","parent","addWizardStep","setActive","updateState","active","setInActive","isVisible","state","invokeNextCB","index","invokeEventCallback","proxy","invokePrevCB","invokeSkipCB","renderWidget","styles","root","_background","children"],"sources":["wizardstep.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 WmWizardstepProps from './wizardstep.props';\nimport { DEFAULT_CLASS, WmWizardstepStyles } from './wizardstep.styles';\nimport WmWizard from '../wizard.component';\n\nexport class WmWizardstepState extends BaseComponentState<WmWizardstepProps> {\n active = false;\n}\n\nexport default class WmWizardstep extends BaseComponent<WmWizardstepProps, WmWizardstepState, WmWizardstepStyles> {\n\n constructor(props: WmWizardstepProps) {\n super(props, DEFAULT_CLASS, new WmWizardstepProps(), new WmWizardstepState());\n }\n\n componentDidMount() {\n const wizard = (this.parent) as WmWizard;\n wizard.addWizardStep(this);\n super.componentDidMount();\n }\n\n setActive() {\n this.updateState({\n active: true\n } as WmWizardstepState);\n }\n\n setInActive() {\n this.updateState({\n active: false\n } as WmWizardstepState);\n }\n\n isVisible() {\n return super.isVisible() && this.state.active;\n }\n\n invokeNextCB(index: number) {\n this.invokeEventCallback('onNext', [this.proxy, this, index]);\n }\n\n invokePrevCB(index: number) {\n this.invokeEventCallback('onPrev', [this.proxy, this, index]);\n }\n\n invokeSkipCB(index: number) {\n this.invokeEventCallback('onSkip', [this.proxy, this, index]);\n }\n\n renderWidget(props: WmWizardstepProps) {\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,iBAAiB,MAAM,oBAAoB;AAClD,SAASC,aAAa,QAA4B,qBAAqB;AAGvE,OAAO,MAAMC,iBAAiB,SAASH,kBAAkB,CAAoB;EAAA;IAAA;IAAA,gCAClE,KAAK;EAAA;AAChB;AAEA,eAAe,MAAMI,YAAY,SAASL,aAAa,CAA2D;EAEhHM,WAAW,CAACC,KAAwB,EAAE;IACpC,KAAK,CAACA,KAAK,EAAEJ,aAAa,EAAE,IAAID,iBAAiB,EAAE,EAAE,IAAIE,iBAAiB,EAAE,CAAC;EAC/E;EAEAI,iBAAiB,GAAG;IAClB,MAAMC,MAAM,GAAI,IAAI,CAACC,MAAmB;IACxCD,MAAM,CAACE,aAAa,CAAC,IAAI,CAAC;IAC1B,KAAK,CAACH,iBAAiB,EAAE;EAC3B;EAEAI,SAAS,GAAG;IACV,IAAI,CAACC,WAAW,CAAC;MACfC,MAAM,EAAE;IACV,CAAC,CAAsB;EACzB;EAEAC,WAAW,GAAG;IACZ,IAAI,CAACF,WAAW,CAAC;MACfC,MAAM,EAAE;IACV,CAAC,CAAsB;EACzB;EAEAE,SAAS,GAAG;IACV,OAAO,KAAK,CAACA,SAAS,EAAE,IAAI,IAAI,CAACC,KAAK,CAACH,MAAM;EAC/C;EAEAI,YAAY,CAACC,KAAa,EAAE;IAC1B,IAAI,CAACC,mBAAmB,CAAC,QAAQ,EAAE,CAAC,IAAI,CAACC,KAAK,EAAE,IAAI,EAAEF,KAAK,CAAC,CAAC;EAC/D;EAEAG,YAAY,CAACH,KAAa,EAAE;IAC1B,IAAI,CAACC,mBAAmB,CAAC,QAAQ,EAAE,CAAC,IAAI,CAACC,KAAK,EAAE,IAAI,EAAEF,KAAK,CAAC,CAAC;EAC/D;EAEAI,YAAY,CAACJ,KAAa,EAAE;IAC1B,IAAI,CAACC,mBAAmB,CAAC,QAAQ,EAAE,CAAC,IAAI,CAACC,KAAK,EAAE,IAAI,EAAEF,KAAK,CAAC,CAAC;EAC/D;EAEAK,YAAY,CAACjB,KAAwB,EAAE;IACrC,oBAAQ,oBAAC,IAAI;MAAC,KAAK,EAAE,IAAI,CAACkB,MAAM,CAACC;IAAK,GAAE,IAAI,CAACC,WAAW,EAAEpB,KAAK,CAACqB,QAAQ,CAAQ;EAClF;AACF"}
|
|
@@ -35,7 +35,7 @@ export default class WmCardContent extends BaseComponent {
|
|
|
35
35
|
renderWidget(props) {
|
|
36
36
|
return /*#__PURE__*/React.createElement(View, {
|
|
37
37
|
style: this.styles.root
|
|
38
|
-
}, this.renderContent(props));
|
|
38
|
+
}, this._background, this.renderContent(props));
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
41
|
//# sourceMappingURL=card-content.component.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","View","BaseComponent","BaseComponentState","WmCardContentProps","DEFAULT_CLASS","WmCardContentState","WmCardContent","constructor","props","onPartialLoad","invokeEventCallback","renderContent","renderPartial","state","isPartialLoaded","setTimeout","updateState","bind","children","renderWidget","styles","root"],"sources":["card-content.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 WmCardContentProps from './card-content.props';\nimport { DEFAULT_CLASS, WmCardContentStyles } from './card-content.styles';\n\nexport class WmCardContentState extends BaseComponentState<WmCardContentProps> {\n isPartialLoaded = false;\n}\n\nexport default class WmCardContent extends BaseComponent<WmCardContentProps, WmCardContentState, WmCardContentStyles> {\n\n constructor(props: WmCardContentProps) {\n super(props, DEFAULT_CLASS, new WmCardContentProps());\n }\n\n onPartialLoad() {\n this.invokeEventCallback('onLoad', [null, this]);\n }\n\n renderContent(props: WmCardContentProps) {\n if (props.renderPartial) {\n if (!this.state.isPartialLoaded) {\n setTimeout(() => {\n this.updateState({\n isPartialLoaded: true\n } as WmCardContentState);\n });\n }\n return props.renderPartial(this.onPartialLoad.bind(this));\n }\n return props.children;\n }\n\n renderWidget(props: WmCardContentProps) {\n return (<View style={this.styles.root}>{this.renderContent(props)}</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,kBAAkB,MAAM,sBAAsB;AACrD,SAASC,aAAa,QAA6B,uBAAuB;AAE1E,OAAO,MAAMC,kBAAkB,SAASH,kBAAkB,CAAqB;EAAA;IAAA;IAAA,yCAC3D,KAAK;EAAA;AACzB;AAEA,eAAe,MAAMI,aAAa,SAASL,aAAa,CAA8D;EAEpHM,WAAW,CAACC,KAAyB,EAAE;IACrC,KAAK,CAACA,KAAK,EAAEJ,aAAa,EAAE,IAAID,kBAAkB,EAAE,CAAC;EACvD;EAEAM,aAAa,GAAG;IACd,IAAI,CAACC,mBAAmB,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;EAClD;EAEAC,aAAa,CAACH,KAAyB,EAAE;IACvC,IAAIA,KAAK,CAACI,aAAa,EAAE;MACvB,IAAI,CAAC,IAAI,CAACC,KAAK,CAACC,eAAe,EAAE;QAC/BC,UAAU,CAAC,MAAM;UACf,IAAI,CAACC,WAAW,CAAC;YACfF,eAAe,EAAE;UACnB,CAAC,CAAuB;QAC1B,CAAC,CAAC;MACJ;MACA,OAAON,KAAK,CAACI,aAAa,CAAC,IAAI,CAACH,aAAa,CAACQ,IAAI,CAAC,IAAI,CAAC,CAAC;IAC3D;IACA,OAAOT,KAAK,CAACU,QAAQ;EACvB;EAEAC,YAAY,CAACX,KAAyB,EAAE;IACtC,oBAAQ,oBAAC,IAAI;MAAC,KAAK,EAAE,IAAI,CAACY,MAAM,CAACC;IAAK,GAAE,IAAI,
|
|
1
|
+
{"version":3,"names":["React","View","BaseComponent","BaseComponentState","WmCardContentProps","DEFAULT_CLASS","WmCardContentState","WmCardContent","constructor","props","onPartialLoad","invokeEventCallback","renderContent","renderPartial","state","isPartialLoaded","setTimeout","updateState","bind","children","renderWidget","styles","root","_background"],"sources":["card-content.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 WmCardContentProps from './card-content.props';\nimport { DEFAULT_CLASS, WmCardContentStyles } from './card-content.styles';\n\nexport class WmCardContentState extends BaseComponentState<WmCardContentProps> {\n isPartialLoaded = false;\n}\n\nexport default class WmCardContent extends BaseComponent<WmCardContentProps, WmCardContentState, WmCardContentStyles> {\n\n constructor(props: WmCardContentProps) {\n super(props, DEFAULT_CLASS, new WmCardContentProps());\n }\n\n onPartialLoad() {\n this.invokeEventCallback('onLoad', [null, this]);\n }\n\n renderContent(props: WmCardContentProps) {\n if (props.renderPartial) {\n if (!this.state.isPartialLoaded) {\n setTimeout(() => {\n this.updateState({\n isPartialLoaded: true\n } as WmCardContentState);\n });\n }\n return props.renderPartial(this.onPartialLoad.bind(this));\n }\n return props.children;\n }\n\n renderWidget(props: WmCardContentProps) {\n return (<View style={this.styles.root}>{this._background}{this.renderContent(props)}</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,kBAAkB,MAAM,sBAAsB;AACrD,SAASC,aAAa,QAA6B,uBAAuB;AAE1E,OAAO,MAAMC,kBAAkB,SAASH,kBAAkB,CAAqB;EAAA;IAAA;IAAA,yCAC3D,KAAK;EAAA;AACzB;AAEA,eAAe,MAAMI,aAAa,SAASL,aAAa,CAA8D;EAEpHM,WAAW,CAACC,KAAyB,EAAE;IACrC,KAAK,CAACA,KAAK,EAAEJ,aAAa,EAAE,IAAID,kBAAkB,EAAE,CAAC;EACvD;EAEAM,aAAa,GAAG;IACd,IAAI,CAACC,mBAAmB,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;EAClD;EAEAC,aAAa,CAACH,KAAyB,EAAE;IACvC,IAAIA,KAAK,CAACI,aAAa,EAAE;MACvB,IAAI,CAAC,IAAI,CAACC,KAAK,CAACC,eAAe,EAAE;QAC/BC,UAAU,CAAC,MAAM;UACf,IAAI,CAACC,WAAW,CAAC;YACfF,eAAe,EAAE;UACnB,CAAC,CAAuB;QAC1B,CAAC,CAAC;MACJ;MACA,OAAON,KAAK,CAACI,aAAa,CAAC,IAAI,CAACH,aAAa,CAACQ,IAAI,CAAC,IAAI,CAAC,CAAC;IAC3D;IACA,OAAOT,KAAK,CAACU,QAAQ;EACvB;EAEAC,YAAY,CAACX,KAAyB,EAAE;IACtC,oBAAQ,oBAAC,IAAI;MAAC,KAAK,EAAE,IAAI,CAACY,MAAM,CAACC;IAAK,GAAE,IAAI,CAACC,WAAW,EAAE,IAAI,CAACX,aAAa,CAACH,KAAK,CAAC,CAAQ;EAC7F;AACF"}
|
|
@@ -11,7 +11,7 @@ export default class WmCardFooter 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=card-footer.component.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","View","BaseComponent","BaseComponentState","WmCardFooterProps","DEFAULT_CLASS","WmCardFooterState","WmCardFooter","constructor","props","renderWidget","styles","root","children"],"sources":["card-footer.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 WmCardFooterProps from './card-footer.props';\nimport { DEFAULT_CLASS, WmCardFooterStyles } from './card-footer.styles';\n\nexport class WmCardFooterState extends BaseComponentState<WmCardFooterProps> {}\n\nexport default class WmCardFooter extends BaseComponent<WmCardFooterProps, WmCardFooterState, WmCardFooterStyles> {\n\n constructor(props: WmCardFooterProps) {\n super(props, DEFAULT_CLASS, new WmCardFooterProps());\n }\n\n renderWidget(props: WmCardFooterProps) {\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,iBAAiB,MAAM,qBAAqB;AACnD,SAASC,aAAa,QAA4B,sBAAsB;AAExE,OAAO,MAAMC,iBAAiB,SAASH,kBAAkB,CAAoB;AAE7E,eAAe,MAAMI,YAAY,SAASL,aAAa,CAA2D;EAEhHM,WAAW,CAACC,KAAwB,EAAE;IACpC,KAAK,CAACA,KAAK,EAAEJ,aAAa,EAAE,IAAID,iBAAiB,EAAE,CAAC;EACtD;EAEAM,YAAY,CAACD,KAAwB,EAAE;IACrC,oBAAQ,oBAAC,IAAI;MAAC,KAAK,EAAE,IAAI,CAACE,MAAM,CAACC;IAAK,
|
|
1
|
+
{"version":3,"names":["React","View","BaseComponent","BaseComponentState","WmCardFooterProps","DEFAULT_CLASS","WmCardFooterState","WmCardFooter","constructor","props","renderWidget","styles","root","_background","children"],"sources":["card-footer.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 WmCardFooterProps from './card-footer.props';\nimport { DEFAULT_CLASS, WmCardFooterStyles } from './card-footer.styles';\n\nexport class WmCardFooterState extends BaseComponentState<WmCardFooterProps> {}\n\nexport default class WmCardFooter extends BaseComponent<WmCardFooterProps, WmCardFooterState, WmCardFooterStyles> {\n\n constructor(props: WmCardFooterProps) {\n super(props, DEFAULT_CLASS, new WmCardFooterProps());\n }\n\n renderWidget(props: WmCardFooterProps) {\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,iBAAiB,MAAM,qBAAqB;AACnD,SAASC,aAAa,QAA4B,sBAAsB;AAExE,OAAO,MAAMC,iBAAiB,SAASH,kBAAkB,CAAoB;AAE7E,eAAe,MAAMI,YAAY,SAASL,aAAa,CAA2D;EAEhHM,WAAW,CAACC,KAAwB,EAAE;IACpC,KAAK,CAACA,KAAK,EAAEJ,aAAa,EAAE,IAAID,iBAAiB,EAAE,CAAC;EACtD;EAEAM,YAAY,CAACD,KAAwB,EAAE;IACrC,oBAAQ,oBAAC,IAAI;MAAC,KAAK,EAAE,IAAI,CAACE,MAAM,CAACC;IAAK,GAAE,IAAI,CAACC,WAAW,EAAEJ,KAAK,CAACK,QAAQ,CAAQ;EAClF;AACF"}
|
|
@@ -55,7 +55,7 @@ export default class WmCard extends BaseComponent {
|
|
|
55
55
|
renderWidget(props) {
|
|
56
56
|
return /*#__PURE__*/React.createElement(View, {
|
|
57
57
|
style: this.styles.root
|
|
58
|
-
}, /*#__PURE__*/React.createElement(Tappable, {
|
|
58
|
+
}, this._background, /*#__PURE__*/React.createElement(Tappable, {
|
|
59
59
|
target: this,
|
|
60
60
|
styles: {
|
|
61
61
|
width: '100%',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","View","BaseComponent","BaseComponentState","WmLabel","WmMenu","WmIcon","Tappable","WmPicture","WmCardProps","DEFAULT_CLASS","WmCardState","WmCard","constructor","props","renderHeader","flexDirection","iconclass","title","subheading","actions","styles","heading","cardIcon","flex","itemlabel","itemlink","itemicon","itembadge","isactive","itemchildren","picturesource","theme","mergeStyle","root","height","imageheight","picture","renderWidget","width","children"],"sources":["card.component.tsx"],"sourcesContent":["import React from 'react';\nimport { View } from 'react-native';\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\nimport WmLabel from '@wavemaker/app-rn-runtime/components/basic/label/label.component';\nimport WmMenu from '@wavemaker/app-rn-runtime/components/navigation/menu/menu.component';\nimport WmIcon from '@wavemaker/app-rn-runtime/components/basic/icon/icon.component';\nimport { Tappable } from '@wavemaker/app-rn-runtime/core/tappable.component';\nimport WmPicture from '@wavemaker/app-rn-runtime/components/basic/picture/picture.component';\n\n\nimport WmCardProps from './card.props';\nimport { DEFAULT_CLASS, WmCardStyles } from './card.styles';\n\nexport class WmCardState extends BaseComponentState<WmCardProps> {}\n\nexport default class WmCard extends BaseComponent<WmCardProps, WmCardState, WmCardStyles> {\n\n constructor(props: WmCardProps) {\n super(props, DEFAULT_CLASS, new WmCardProps());\n }\n\n renderHeader(props: WmCardProps) {\n return (\n <View style={{flexDirection: 'row'}}>\n {(props.iconclass || props.title || props.subheading || props.actions) ?\n (<View style={this.styles.heading}>\n <WmIcon styles={this.styles.cardIcon} iconclass={props.iconclass}></WmIcon>\n <View style={{flex: 1}}>\n <WmLabel styles={this.styles.title} caption={props.title}></WmLabel>\n <WmLabel styles={this.styles.subheading} caption={props.subheading}></WmLabel>\n </View>\n <WmMenu\n caption=\"\"\n iconclass=\"wm-sl-l sl-more-menu-vertical\"\n dataset={props.actions}\n itemlabel={props.itemlabel}\n itemlink={props.itemlink}\n itemicon={props.itemicon}\n itembadge={props.itembadge}\n isactive={props.isactive}\n itemchildren={props.itemchildren}></WmMenu>\n </View>) : null}\n {props.picturesource &&\n (<WmPicture\n picturesource={props.picturesource}\n styles={this.theme.mergeStyle({root : {height: props.imageheight}}, this.styles.picture)}></WmPicture>\n )}\n </View>);\n }\n\n renderWidget(props: WmCardProps) {\n return (\n <View style={this.styles.root}>\n <Tappable target={this} styles={{width: '100%', height: this.styles.root.height ? '100%' : null}}>\n {this.renderHeader(props)}\n {props.children}\n </Tappable>\n </View>);\n }\n}\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,QAAQ,cAAc;AACnC,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,+CAA+C;AACjG,OAAOC,OAAO,MAAM,kEAAkE;AACtF,OAAOC,MAAM,MAAM,qEAAqE;AACxF,OAAOC,MAAM,MAAM,gEAAgE;AACnF,SAASC,QAAQ,QAAQ,mDAAmD;AAC5E,OAAOC,SAAS,MAAM,sEAAsE;AAG5F,OAAOC,WAAW,MAAM,cAAc;AACtC,SAASC,aAAa,QAAsB,eAAe;AAE3D,OAAO,MAAMC,WAAW,SAASR,kBAAkB,CAAc;AAEjE,eAAe,MAAMS,MAAM,SAASV,aAAa,CAAyC;EAExFW,WAAW,CAACC,KAAkB,EAAE;IAC9B,KAAK,CAACA,KAAK,EAAEJ,aAAa,EAAE,IAAID,WAAW,EAAE,CAAC;EAChD;EAEAM,YAAY,CAACD,KAAkB,EAAE;IAC/B,oBACE,oBAAC,IAAI;MAAC,KAAK,EAAE;QAACE,aAAa,EAAE;MAAK;IAAE,GAChCF,KAAK,CAACG,SAAS,IAAIH,KAAK,CAACI,KAAK,IAAIJ,KAAK,CAACK,UAAU,IAAIL,KAAK,CAACM,OAAO,gBACpE,oBAAC,IAAI;M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","BaseComponentState","WmLabel","WmMenu","WmIcon","Tappable","WmPicture","WmCardProps","DEFAULT_CLASS","WmCardState","WmCard","constructor","props","renderHeader","flexDirection","iconclass","title","subheading","actions","styles","heading","cardIcon","flex","itemlabel","itemlink","itemicon","itembadge","isactive","itemchildren","picturesource","theme","mergeStyle","root","height","imageheight","picture","renderWidget","_background","width","children"],"sources":["card.component.tsx"],"sourcesContent":["import React from 'react';\nimport { View } from 'react-native';\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\nimport WmLabel from '@wavemaker/app-rn-runtime/components/basic/label/label.component';\nimport WmMenu from '@wavemaker/app-rn-runtime/components/navigation/menu/menu.component';\nimport WmIcon from '@wavemaker/app-rn-runtime/components/basic/icon/icon.component';\nimport { Tappable } from '@wavemaker/app-rn-runtime/core/tappable.component';\nimport WmPicture from '@wavemaker/app-rn-runtime/components/basic/picture/picture.component';\n\n\nimport WmCardProps from './card.props';\nimport { DEFAULT_CLASS, WmCardStyles } from './card.styles';\n\nexport class WmCardState extends BaseComponentState<WmCardProps> {}\n\nexport default class WmCard extends BaseComponent<WmCardProps, WmCardState, WmCardStyles> {\n\n constructor(props: WmCardProps) {\n super(props, DEFAULT_CLASS, new WmCardProps());\n }\n\n renderHeader(props: WmCardProps) {\n return (\n <View style={{flexDirection: 'row'}}>\n {(props.iconclass || props.title || props.subheading || props.actions) ?\n (<View style={this.styles.heading}>\n <WmIcon styles={this.styles.cardIcon} iconclass={props.iconclass}></WmIcon>\n <View style={{flex: 1}}>\n <WmLabel styles={this.styles.title} caption={props.title}></WmLabel>\n <WmLabel styles={this.styles.subheading} caption={props.subheading}></WmLabel>\n </View>\n <WmMenu\n caption=\"\"\n iconclass=\"wm-sl-l sl-more-menu-vertical\"\n dataset={props.actions}\n itemlabel={props.itemlabel}\n itemlink={props.itemlink}\n itemicon={props.itemicon}\n itembadge={props.itembadge}\n isactive={props.isactive}\n itemchildren={props.itemchildren}></WmMenu>\n </View>) : null}\n {props.picturesource &&\n (<WmPicture\n picturesource={props.picturesource}\n styles={this.theme.mergeStyle({root : {height: props.imageheight}}, this.styles.picture)}></WmPicture>\n )}\n </View>);\n }\n\n renderWidget(props: WmCardProps) {\n return (\n <View style={this.styles.root}>\n {this._background}\n <Tappable target={this} styles={{width: '100%', height: this.styles.root.height ? '100%' : null}}>\n {this.renderHeader(props)}\n {props.children}\n </Tappable>\n </View>);\n }\n}\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,QAAQ,cAAc;AACnC,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,+CAA+C;AACjG,OAAOC,OAAO,MAAM,kEAAkE;AACtF,OAAOC,MAAM,MAAM,qEAAqE;AACxF,OAAOC,MAAM,MAAM,gEAAgE;AACnF,SAASC,QAAQ,QAAQ,mDAAmD;AAC5E,OAAOC,SAAS,MAAM,sEAAsE;AAG5F,OAAOC,WAAW,MAAM,cAAc;AACtC,SAASC,aAAa,QAAsB,eAAe;AAE3D,OAAO,MAAMC,WAAW,SAASR,kBAAkB,CAAc;AAEjE,eAAe,MAAMS,MAAM,SAASV,aAAa,CAAyC;EAExFW,WAAW,CAACC,KAAkB,EAAE;IAC9B,KAAK,CAACA,KAAK,EAAEJ,aAAa,EAAE,IAAID,WAAW,EAAE,CAAC;EAChD;EAEAM,YAAY,CAACD,KAAkB,EAAE;IAC/B,oBACE,oBAAC,IAAI;MAAC,KAAK,EAAE;QAACE,aAAa,EAAE;MAAK;IAAE,GAChCF,KAAK,CAACG,SAAS,IAAIH,KAAK,CAACI,KAAK,IAAIJ,KAAK,CAACK,UAAU,IAAIL,KAAK,CAACM,OAAO,gBACpE,oBAAC,IAAI;MAAC,KAAK,EAAE,IAAI,CAACC,MAAM,CAACC;IAAQ,gBAChC,oBAAC,MAAM;MAAC,MAAM,EAAE,IAAI,CAACD,MAAM,CAACE,QAAS;MAAC,SAAS,EAAET,KAAK,CAACG;IAAU,EAAU,eAC3E,oBAAC,IAAI;M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AACpB,YAAY,CAACD,KAAK,CAAC,EACxBA,KAAK,CAAC2B,QAAQ,CACR,CACN;EACX;AACF"}
|
|
@@ -7,7 +7,6 @@ import WmButton from '@wavemaker/app-rn-runtime/components/basic/button/button.c
|
|
|
7
7
|
import WmFormActionProps from './form-action.props';
|
|
8
8
|
import { DEFAULT_CLASS } from './form-action.styles';
|
|
9
9
|
import { debounce } from "lodash";
|
|
10
|
-
import { createSkeleton } from '@wavemaker/app-rn-runtime/components/basic/skeleton/skeleton.component';
|
|
11
10
|
export class WmFormActionState extends BaseComponentState {}
|
|
12
11
|
export default class WmFormAction extends BaseComponent {
|
|
13
12
|
constructor(props) {
|
|
@@ -17,11 +16,6 @@ export default class WmFormAction extends BaseComponent {
|
|
|
17
16
|
onClick($event, cb) {
|
|
18
17
|
cb && cb($event);
|
|
19
18
|
}
|
|
20
|
-
renderSkeleton(props) {
|
|
21
|
-
return createSkeleton(this.theme, this.styles.skeleton, {
|
|
22
|
-
...this.styles.root
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
19
|
renderWidget(props) {
|
|
26
20
|
return /*#__PURE__*/React.createElement(WmButton, {
|
|
27
21
|
disabled: props.disabled,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","BaseComponent","BaseComponentState","WmButton","WmFormActionProps","DEFAULT_CLASS","debounce","
|
|
1
|
+
{"version":3,"names":["React","BaseComponent","BaseComponentState","WmButton","WmFormActionProps","DEFAULT_CLASS","debounce","WmFormActionState","WmFormAction","constructor","props","onClick","$event","cb","renderWidget","disabled","displayName","styles","name","iconclass","_debouncedFormAction","formAction"],"sources":["form-action.component.tsx"],"sourcesContent":["import React from 'react';\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\nimport WmButton from '@wavemaker/app-rn-runtime/components/basic/button/button.component';\nimport { TapEvent } from '@wavemaker/app-rn-runtime/core/tappable.component';\n\nimport WmFormActionProps from './form-action.props';\nimport { DEFAULT_CLASS, WmFormActionStyles } from './form-action.styles';\nimport {debounce} from \"lodash\";\nimport WmSkeleton, { createSkeleton } from '@wavemaker/app-rn-runtime/components/basic/skeleton/skeleton.component';\nimport { ThemeConsumer } from '@wavemaker/app-rn-runtime/styles/theme';\n\nexport class WmFormActionState extends BaseComponentState<WmFormActionProps> {}\n\nexport default class WmFormAction extends BaseComponent<WmFormActionProps, WmFormActionState, WmFormActionStyles> {\n\n constructor(props: WmFormActionProps) {\n super(props, DEFAULT_CLASS, new WmFormActionProps());\n }\n\n private _debouncedFormAction = debounce(this.onClick, 250);\n\n onClick($event: TapEvent, cb: Function | undefined) {\n cb && cb($event);\n }\n\n renderWidget(props: WmFormActionProps) {\n return (\n <WmButton\n disabled={props.disabled}\n caption={props.displayName}\n styles={this.styles}\n name={props.name}\n iconclass={props.iconclass}\n onTap={($event: any) => {\n this._debouncedFormAction($event, props.formAction);\n }}\n />\n );\n }\n}\n"],"mappings":";;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,+CAA+C;AACjG,OAAOC,QAAQ,MAAM,oEAAoE;AAGzF,OAAOC,iBAAiB,MAAM,qBAAqB;AACnD,SAASC,aAAa,QAA4B,sBAAsB;AACxE,SAAQC,QAAQ,QAAO,QAAQ;AAI/B,OAAO,MAAMC,iBAAiB,SAASL,kBAAkB,CAAoB;AAE7E,eAAe,MAAMM,YAAY,SAASP,aAAa,CAA2D;EAEhHQ,WAAW,CAACC,KAAwB,EAAE;IACpC,KAAK,CAACA,KAAK,EAAEL,aAAa,EAAE,IAAID,iBAAiB,EAAE,CAAC;IAAC,8CAGxBE,QAAQ,CAAC,IAAI,CAACK,OAAO,EAAE,GAAG,CAAC;EAF1D;EAIAA,OAAO,CAACC,MAAgB,EAAEC,EAAwB,EAAE;IAClDA,EAAE,IAAIA,EAAE,CAACD,MAAM,CAAC;EAClB;EAEAE,YAAY,CAACJ,KAAwB,EAAE;IACrC,oBACE,oBAAC,QAAQ;MACP,QAAQ,EAAEA,KAAK,CAACK,QAAS;MACzB,OAAO,EAAEL,KAAK,CAACM,WAAY;MAC3B,MAAM,EAAE,IAAI,CAACC,MAAO;MACpB,IAAI,EAAEP,KAAK,CAACQ,IAAK;MACjB,SAAS,EAAER,KAAK,CAACS,SAAU;MAC3B,KAAK,EAAGP,MAAW,IAAK;QACtB,IAAI,CAACQ,oBAAoB,CAACR,MAAM,EAAEF,KAAK,CAACW,UAAU,CAAC;MACrD;IAAE,EACF;EAEN;AACF"}
|
|
@@ -11,7 +11,7 @@ export default class WmFormBody 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=form-body.component.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","View","BaseComponent","BaseComponentState","WmFormBodyProps","DEFAULT_CLASS","WmFormBodyState","WmFormBody","constructor","props","renderWidget","styles","root","children"],"sources":["form-body.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 WmFormBodyProps from './form-body.props';\nimport { DEFAULT_CLASS, WmFormBodyStyles } from './form-body.styles';\n\nexport class WmFormBodyState extends BaseComponentState<WmFormBodyProps> {}\n\nexport default class WmFormBody extends BaseComponent<WmFormBodyProps, WmFormBodyState, WmFormBodyStyles> {\n\n constructor(props: WmFormBodyProps) {\n super(props, DEFAULT_CLASS, new WmFormBodyProps());\n }\n\n renderWidget(props: WmFormBodyProps) {\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,eAAe,MAAM,mBAAmB;AAC/C,SAASC,aAAa,QAA0B,oBAAoB;AAEpE,OAAO,MAAMC,eAAe,SAASH,kBAAkB,CAAkB;AAEzE,eAAe,MAAMI,UAAU,SAASL,aAAa,CAAqD;EAExGM,WAAW,CAACC,KAAsB,EAAE;IAClC,KAAK,CAACA,KAAK,EAAEJ,aAAa,EAAE,IAAID,eAAe,EAAE,CAAC;EACpD;EAEAM,YAAY,CAACD,KAAsB,EAAE;IACnC,oBAAQ,oBAAC,IAAI;MAAC,KAAK,EAAE,IAAI,CAACE,MAAM,CAACC;IAAK,
|
|
1
|
+
{"version":3,"names":["React","View","BaseComponent","BaseComponentState","WmFormBodyProps","DEFAULT_CLASS","WmFormBodyState","WmFormBody","constructor","props","renderWidget","styles","root","_background","children"],"sources":["form-body.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 WmFormBodyProps from './form-body.props';\nimport { DEFAULT_CLASS, WmFormBodyStyles } from './form-body.styles';\n\nexport class WmFormBodyState extends BaseComponentState<WmFormBodyProps> {}\n\nexport default class WmFormBody extends BaseComponent<WmFormBodyProps, WmFormBodyState, WmFormBodyStyles> {\n\n constructor(props: WmFormBodyProps) {\n super(props, DEFAULT_CLASS, new WmFormBodyProps());\n }\n\n renderWidget(props: WmFormBodyProps) {\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,eAAe,MAAM,mBAAmB;AAC/C,SAASC,aAAa,QAA0B,oBAAoB;AAEpE,OAAO,MAAMC,eAAe,SAASH,kBAAkB,CAAkB;AAEzE,eAAe,MAAMI,UAAU,SAASL,aAAa,CAAqD;EAExGM,WAAW,CAACC,KAAsB,EAAE;IAClC,KAAK,CAACA,KAAK,EAAEJ,aAAa,EAAE,IAAID,eAAe,EAAE,CAAC;EACpD;EAEAM,YAAY,CAACD,KAAsB,EAAE;IACnC,oBAAQ,oBAAC,IAAI;MAAC,KAAK,EAAE,IAAI,CAACE,MAAM,CAACC;IAAK,GAAE,IAAI,CAACC,WAAW,EAAEJ,KAAK,CAACK,QAAQ,CAAQ;EAClF;AACF"}
|
|
@@ -196,7 +196,7 @@ export default class WmFormField extends BaseComponent {
|
|
|
196
196
|
});
|
|
197
197
|
return /*#__PURE__*/React.createElement(View, {
|
|
198
198
|
style: this.styles.root
|
|
199
|
-
}, childrenWithProps, this.state.isValid === false && /*#__PURE__*/React.createElement(Text, {
|
|
199
|
+
}, this._background, childrenWithProps, this.state.isValid === false && /*#__PURE__*/React.createElement(Text, {
|
|
200
200
|
style: this.styles.errorMsg
|
|
201
201
|
}, props.validationmessage));
|
|
202
202
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","Text","View","BaseComponent","BaseComponentState","isEqual","get","find","cloneDeep","forEach","keys","WmFormFieldProps","DEFAULT_CLASS","PERFORMANCE_LOGGER","WmFormFieldState","WmFormField","constructor","props","onFieldChangeEvt","name","$new","$old","isDefault","notifyChanges","validateFormField","updateState","datavalue","invokeEventCallback","undefined","form","updateDataOutput","call","observeOn","fields","field","formfield","formFields","f","proxy","notifyForFields","push","formwidget","validate","setTimeout","getPromiseList","validators","arr","fn","promise","Function","bind","Promise","setAsyncValidators","_asyncValidatorFn","all","then","err","validationMsg","hasOwnProperty","messageKeys","toString","setInvalidState","setValidators","_cloneValidators","_syncValidators","obj","index","key","defaultValidatorMessages","value","propsObj","msg","isValid","validationmessage","onPropertyChange","debug","applyDefaultValue","state","errorType","errormsg","errorMessage","renderWidget","childrenWithProps","Children","map","renderFormFields","children","child","cloneElement","invokeEvent","triggerValidation","onFieldChange","formRef","styles","root","errorMsg"],"sources":["form-field.component.tsx"],"sourcesContent":["import React from 'react';\nimport {Text, View} from 'react-native';\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\nimport { widgetsWithUndefinedValue } from '@wavemaker/app-rn-runtime/core/utils';\nimport { isEqual, get, find, cloneDeep, forEach, keys } from 'lodash';\n\nimport WmFormFieldProps from './form-field.props';\nimport { DEFAULT_CLASS, WmFormFieldStyles } from './form-field.styles';\nimport {PERFORMANCE_LOGGER} from \"@wavemaker/app-rn-runtime/core/logger\";\n\nexport class WmFormFieldState extends BaseComponentState<WmFormFieldProps> {\n isValid = true;\n}\n\nexport default class WmFormField extends BaseComponent<WmFormFieldProps, WmFormFieldState, WmFormFieldStyles> {\n public form: any;\n public formwidget: any;\n public _syncValidators: any;\n public defaultValidatorMessages: any = [];\n private notifyForFields: any = [];\n private _asyncValidatorFn: any;\n constructor(props: WmFormFieldProps) {\n super(props, DEFAULT_CLASS, new WmFormFieldProps(), new WmFormFieldState());\n }\n\n onFieldChangeEvt(name: string, $new: any, $old: any, isDefault: boolean) {\n this.notifyChanges();\n this.validateFormField();\n if (!isEqual($old, $new)) {\n this.updateState({ props: { datavalue: $new }} as WmFormFieldState, () => {\n !isDefault && this.invokeEventCallback('onChange', [undefined, this, $new, $old]);\n });\n if (this.form) {\n this.form.updateDataOutput.call(this.form, get(this.props, 'formKey', this.props.name), $new);\n }\n }\n }\n\n // Registers observer of validation fields\n observeOn(fields: any) {\n forEach(fields, (field) => {\n const formfield = find(this.form.formFields, (f) => f.proxy.name === field);\n if (formfield) {\n formfield.notifyForFields.push(this);\n }\n });\n }\n\n // Notifies changes to observing validation fields\n notifyChanges() {\n forEach(this.notifyForFields, (field) => {\n field.formwidget.validate(field.formwidget.datavalue);\n setTimeout(() => field.validateFormField());\n });\n }\n\n getPromiseList(validators: any) {\n const arr: any = [];\n forEach(validators, (fn) => {\n let promise = fn;\n if (fn instanceof Function && fn.bind) {\n promise = fn(this.formwidget.proxy, this.form);\n }\n if (promise instanceof Promise) {\n arr.push(promise);\n }\n });\n return arr;\n }\n\n // this method sets the asyncValidation on the form field. Assigns validationmessages from the returned response\n setAsyncValidators(validators: any) {\n this._asyncValidatorFn = () => {\n return Promise.all(this.getPromiseList(validators)).then(() => {\n return null;\n }, err => {\n let validationMsg: string;\n // if err obj has validationMessage key, then set validationMessage using this value\n // else return the value of the first key in the err object as validation message.\n if (err.hasOwnProperty('errorMessage')) {\n validationMsg = get(err, 'errorMessage');\n } else {\n const messageKeys = keys(err);\n validationMsg = (err[messageKeys[0]]).toString();\n }\n this.setInvalidState(validationMsg);\n return err;\n })\n };\n }\n\n // sets the default validation on the form field\n setValidators(validators: any) {\n let _cloneValidators = cloneDeep(validators);\n this._syncValidators = [];\n forEach(_cloneValidators, (obj, index) => {\n // custom validation is bound to function.\n if (obj && obj instanceof Function) {\n // passing formwidget and form as arguments to the obj (i.e. validator function)\n _cloneValidators[index] = obj.bind(undefined, this.formwidget.proxy, this.form);\n this._syncValidators.push(_cloneValidators[index]);\n } else {\n // checks for default validator like required, maxchars etc.\n const key = get(obj, 'type');\n this.defaultValidatorMessages[key] = get(obj, 'errorMessage');\n const value = get(obj, 'validator');\n let propsObj: any = {\n props: {}\n };\n propsObj.props[key] = value;\n key === 'required' && this.updateState(propsObj as WmFormFieldState);\n this.formwidget.updateState(propsObj as WmFormFieldState);\n }\n });\n }\n\n setInvalidState(msg: string) {\n this.updateState({\n isValid: false,\n props: {\n validationmessage: msg\n }\n } as WmFormFieldState)\n this.formwidget.updateState({\n isValid: false,\n props: {\n validationmessage: msg\n }\n } as WmFormFieldState);\n }\n\n onPropertyChange(name: string, $new: any, $old: any) {\n switch (name) {\n case 'datavalue':\n if (!isEqual($old, $new)) {\n PERFORMANCE_LOGGER.debug(`form field ${this.props.name} changed from ${$old} to ${$new}`);\n }\n break;\n case 'defaultvalue':\n if (!isEqual($old, $new)) {\n get(this, 'form') && this.form.applyDefaultValue(this);\n }\n break;\n }\n }\n\n validateFormField() {\n if (this.formwidget?.state.isValid === false) {\n const errorType = this.formwidget?.state?.errorType;\n let validationMsg = get(this.defaultValidatorMessages, errorType);\n if (validationMsg) {\n if (validationMsg instanceof Function) {\n // passing formwidget and form as arguments to the errorMessage function.\n validationMsg = validationMsg(this.formwidget.proxy, this.form);\n }\n this.updateState({ props: {\n validationmessage: validationMsg\n }} as WmFormFieldState);\n }\n this.updateState({ isValid: false} as WmFormFieldState);\n } else {\n this.updateState({ isValid: true } as WmFormFieldState);\n }\n\n this._syncValidators?.forEach((fn: any) => {\n const errormsg = fn();\n let validationMsg = errormsg?.errorMessage;\n if (validationMsg) {\n if (validationMsg instanceof Function) {\n // passing formwidget and form as arguments to the errorMessage function.\n validationMsg = validationMsg(this.formwidget.proxy, this.form);\n }\n this.setInvalidState(validationMsg);\n }\n })\n\n this._asyncValidatorFn && this._asyncValidatorFn();\n\n }\n\n renderWidget(props: WmFormFieldProps) {\n var childrenWithProps = React.Children.map(props.renderFormFields(this.proxy).props.children, (child) => {\n return React.cloneElement(child, {\n datavalue: props.datavalue,\n isValid: this.state.isValid,\n invokeEvent: this.invokeEventCallback.bind(this),\n triggerValidation: this.validateFormField.bind(this),\n onFieldChange: this.onFieldChangeEvt.bind(this),\n formRef: props.formRef });\n });\n return (\n <View style={this.styles.root}>{childrenWithProps}\n {this.state.isValid === false && <Text style={this.styles.errorMsg}>{props.validationmessage}</Text>}\n </View>\n );\n }\n}\n"],"mappings":";;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAAQC,IAAI,EAAEC,IAAI,QAAO,cAAc;AACvC,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,+CAA+C;AAEjG,SAASC,OAAO,EAAEC,GAAG,EAAEC,IAAI,EAAEC,SAAS,EAAEC,OAAO,EAAEC,IAAI,QAAQ,QAAQ;AAErE,OAAOC,gBAAgB,MAAM,oBAAoB;AACjD,SAASC,aAAa,QAA2B,qBAAqB;AACtE,SAAQC,kBAAkB,QAAO,uCAAuC;AAExE,OAAO,MAAMC,gBAA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,CAAClE,iBAAiB,CAAC0B,IAAI,CAAC,IAAI,CAAC;QACpDyC,aAAa,EAAE,IAAI,CAACzE,gBAAgB,CAACgC,IAAI,CAAC,IAAI,CAAC;QAC/C0C,OAAO,EAAE3E,KAAK,CAAC2E;MAAQ,CAAC,CAAC;IAC/B,CAAC,CAAC;IACF,oBACE,oBAAC,IAAI;MAAC,KAAK,EAAE,IAAI,CAACC,MAAM,CAACC;IAAK,GAAEZ,iBAAiB,EAC9C,IAAI,CAACL,KAAK,CAACL,OAAO,KAAK,KAAK,iBAAI,oBAAC,IAAI;MAAC,KAAK,EAAE,IAAI,CAACqB,MAAM,CAACE;IAAS,GAAE9E,KAAK,CAACwD,iBAAiB,CAAQ,CAC/F;EAEX;AACF"}
|
|
1
|
+
{"version":3,"names":["React","Text","View","BaseComponent","BaseComponentState","isEqual","get","find","cloneDeep","forEach","keys","WmFormFieldProps","DEFAULT_CLASS","PERFORMANCE_LOGGER","WmFormFieldState","WmFormField","constructor","props","onFieldChangeEvt","name","$new","$old","isDefault","notifyChanges","validateFormField","updateState","datavalue","invokeEventCallback","undefined","form","updateDataOutput","call","observeOn","fields","field","formfield","formFields","f","proxy","notifyForFields","push","formwidget","validate","setTimeout","getPromiseList","validators","arr","fn","promise","Function","bind","Promise","setAsyncValidators","_asyncValidatorFn","all","then","err","validationMsg","hasOwnProperty","messageKeys","toString","setInvalidState","setValidators","_cloneValidators","_syncValidators","obj","index","key","defaultValidatorMessages","value","propsObj","msg","isValid","validationmessage","onPropertyChange","debug","applyDefaultValue","state","errorType","errormsg","errorMessage","renderWidget","childrenWithProps","Children","map","renderFormFields","children","child","cloneElement","invokeEvent","triggerValidation","onFieldChange","formRef","styles","root","_background","errorMsg"],"sources":["form-field.component.tsx"],"sourcesContent":["import React from 'react';\nimport {Text, View} from 'react-native';\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\nimport { widgetsWithUndefinedValue } from '@wavemaker/app-rn-runtime/core/utils';\nimport { isEqual, get, find, cloneDeep, forEach, keys } from 'lodash';\n\nimport WmFormFieldProps from './form-field.props';\nimport { DEFAULT_CLASS, WmFormFieldStyles } from './form-field.styles';\nimport {PERFORMANCE_LOGGER} from \"@wavemaker/app-rn-runtime/core/logger\";\n\nexport class WmFormFieldState extends BaseComponentState<WmFormFieldProps> {\n isValid = true;\n}\n\nexport default class WmFormField extends BaseComponent<WmFormFieldProps, WmFormFieldState, WmFormFieldStyles> {\n public form: any;\n public formwidget: any;\n public _syncValidators: any;\n public defaultValidatorMessages: any = [];\n private notifyForFields: any = [];\n private _asyncValidatorFn: any;\n constructor(props: WmFormFieldProps) {\n super(props, DEFAULT_CLASS, new WmFormFieldProps(), new WmFormFieldState());\n }\n\n onFieldChangeEvt(name: string, $new: any, $old: any, isDefault: boolean) {\n this.notifyChanges();\n this.validateFormField();\n if (!isEqual($old, $new)) {\n this.updateState({ props: { datavalue: $new }} as WmFormFieldState, () => {\n !isDefault && this.invokeEventCallback('onChange', [undefined, this, $new, $old]);\n });\n if (this.form) {\n this.form.updateDataOutput.call(this.form, get(this.props, 'formKey', this.props.name), $new);\n }\n }\n }\n\n // Registers observer of validation fields\n observeOn(fields: any) {\n forEach(fields, (field) => {\n const formfield = find(this.form.formFields, (f) => f.proxy.name === field);\n if (formfield) {\n formfield.notifyForFields.push(this);\n }\n });\n }\n\n // Notifies changes to observing validation fields\n notifyChanges() {\n forEach(this.notifyForFields, (field) => {\n field.formwidget.validate(field.formwidget.datavalue);\n setTimeout(() => field.validateFormField());\n });\n }\n\n getPromiseList(validators: any) {\n const arr: any = [];\n forEach(validators, (fn) => {\n let promise = fn;\n if (fn instanceof Function && fn.bind) {\n promise = fn(this.formwidget.proxy, this.form);\n }\n if (promise instanceof Promise) {\n arr.push(promise);\n }\n });\n return arr;\n }\n\n // this method sets the asyncValidation on the form field. Assigns validationmessages from the returned response\n setAsyncValidators(validators: any) {\n this._asyncValidatorFn = () => {\n return Promise.all(this.getPromiseList(validators)).then(() => {\n return null;\n }, err => {\n let validationMsg: string;\n // if err obj has validationMessage key, then set validationMessage using this value\n // else return the value of the first key in the err object as validation message.\n if (err.hasOwnProperty('errorMessage')) {\n validationMsg = get(err, 'errorMessage');\n } else {\n const messageKeys = keys(err);\n validationMsg = (err[messageKeys[0]]).toString();\n }\n this.setInvalidState(validationMsg);\n return err;\n })\n };\n }\n\n // sets the default validation on the form field\n setValidators(validators: any) {\n let _cloneValidators = cloneDeep(validators);\n this._syncValidators = [];\n forEach(_cloneValidators, (obj, index) => {\n // custom validation is bound to function.\n if (obj && obj instanceof Function) {\n // passing formwidget and form as arguments to the obj (i.e. validator function)\n _cloneValidators[index] = obj.bind(undefined, this.formwidget.proxy, this.form);\n this._syncValidators.push(_cloneValidators[index]);\n } else {\n // checks for default validator like required, maxchars etc.\n const key = get(obj, 'type');\n this.defaultValidatorMessages[key] = get(obj, 'errorMessage');\n const value = get(obj, 'validator');\n let propsObj: any = {\n props: {}\n };\n propsObj.props[key] = value;\n key === 'required' && this.updateState(propsObj as WmFormFieldState);\n this.formwidget.updateState(propsObj as WmFormFieldState);\n }\n });\n }\n\n setInvalidState(msg: string) {\n this.updateState({\n isValid: false,\n props: {\n validationmessage: msg\n }\n } as WmFormFieldState)\n this.formwidget.updateState({\n isValid: false,\n props: {\n validationmessage: msg\n }\n } as WmFormFieldState);\n }\n\n onPropertyChange(name: string, $new: any, $old: any) {\n switch (name) {\n case 'datavalue':\n if (!isEqual($old, $new)) {\n PERFORMANCE_LOGGER.debug(`form field ${this.props.name} changed from ${$old} to ${$new}`);\n }\n break;\n case 'defaultvalue':\n if (!isEqual($old, $new)) {\n get(this, 'form') && this.form.applyDefaultValue(this);\n }\n break;\n }\n }\n\n validateFormField() {\n if (this.formwidget?.state.isValid === false) {\n const errorType = this.formwidget?.state?.errorType;\n let validationMsg = get(this.defaultValidatorMessages, errorType);\n if (validationMsg) {\n if (validationMsg instanceof Function) {\n // passing formwidget and form as arguments to the errorMessage function.\n validationMsg = validationMsg(this.formwidget.proxy, this.form);\n }\n this.updateState({ props: {\n validationmessage: validationMsg\n }} as WmFormFieldState);\n }\n this.updateState({ isValid: false} as WmFormFieldState);\n } else {\n this.updateState({ isValid: true } as WmFormFieldState);\n }\n\n this._syncValidators?.forEach((fn: any) => {\n const errormsg = fn();\n let validationMsg = errormsg?.errorMessage;\n if (validationMsg) {\n if (validationMsg instanceof Function) {\n // passing formwidget and form as arguments to the errorMessage function.\n validationMsg = validationMsg(this.formwidget.proxy, this.form);\n }\n this.setInvalidState(validationMsg);\n }\n })\n\n this._asyncValidatorFn && this._asyncValidatorFn();\n\n }\n\n renderWidget(props: WmFormFieldProps) {\n var childrenWithProps = React.Children.map(props.renderFormFields(this.proxy).props.children, (child) => {\n return React.cloneElement(child, {\n datavalue: props.datavalue,\n isValid: this.state.isValid,\n invokeEvent: this.invokeEventCallback.bind(this),\n triggerValidation: this.validateFormField.bind(this),\n onFieldChange: this.onFieldChangeEvt.bind(this),\n formRef: props.formRef });\n });\n return (\n <View style={this.styles.root}>{this._background}{childrenWithProps}\n {this.state.isValid === false && <Text style={this.styles.errorMsg}>{props.validationmessage}</Text>}\n </View>\n );\n }\n}\n"],"mappings":";;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAAQC,IAAI,EAAEC,IAAI,QAAO,cAAc;AACvC,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,+CAA+C;AAEjG,SAASC,OAAO,EAAEC,GAAG,EAAEC,IAAI,EAAEC,SAAS,EAAEC,OAAO,EAAEC,IAAI,QAAQ,QAAQ;AAErE,OAAOC,gBAAgB,MAAM,oBAAoB;AACjD,SAASC,aAAa,QAA2B,qBAAqB;AACtE,SAAQC,kBAAkB,QAAO,uCAAuC;AAExE,OAAO,MAAMC,gBAAgB,SAASV,kBAAkB,CAAmB;EAAA;IAAA;IAAA,iCAC/D,IAAI;EAAA;AAChB;AAEA,eAAe,MAAMW,WAAW,SAASZ,aAAa,CAAwD;EAO5Ga,WAAW,CAACC,KAAuB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3E,KAAK,CAAC2E;MAAQ,CAAC,CAAC;IAC/B,CAAC,CAAC;IACF,oBACE,oBAAC,IAAI;MAAC,KAAK,EAAE,IAAI,CAACC,MAAM,CAACC;IAAK,GAAE,IAAI,CAACC,WAAW,EAAEb,iBAAiB,EAChE,IAAI,CAACL,KAAK,CAACL,OAAO,KAAK,KAAK,iBAAI,oBAAC,IAAI;MAAC,KAAK,EAAE,IAAI,CAACqB,MAAM,CAACG;IAAS,GAAE/E,KAAK,CAACwD,iBAAiB,CAAQ,CAC/F;EAEX;AACF"}
|
|
@@ -11,7 +11,7 @@ export default class WmFormFooter 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=form-footer.component.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","View","BaseComponent","BaseComponentState","WmFormFooterProps","DEFAULT_CLASS","WmFormFooterState","WmFormFooter","constructor","props","renderWidget","styles","root","children"],"sources":["form-footer.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 WmFormFooterProps from './form-footer.props';\nimport { DEFAULT_CLASS, WmFormFooterStyles } from './form-footer.styles';\n\nexport class WmFormFooterState extends BaseComponentState<WmFormFooterProps> {}\n\nexport default class WmFormFooter extends BaseComponent<WmFormFooterProps, WmFormFooterState, WmFormFooterStyles> {\n\n constructor(props: WmFormFooterProps) {\n super(props, DEFAULT_CLASS, new WmFormFooterProps());\n }\n\n renderWidget(props: WmFormFooterProps) {\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,iBAAiB,MAAM,qBAAqB;AACnD,SAASC,aAAa,QAA4B,sBAAsB;AAExE,OAAO,MAAMC,iBAAiB,SAASH,kBAAkB,CAAoB;AAE7E,eAAe,MAAMI,YAAY,SAASL,aAAa,CAA2D;EAEhHM,WAAW,CAACC,KAAwB,EAAE;IACpC,KAAK,CAACA,KAAK,EAAEJ,aAAa,EAAE,IAAID,iBAAiB,EAAE,CAAC;EACtD;EAEAM,YAAY,CAACD,KAAwB,EAAE;IACrC,oBAAQ,oBAAC,IAAI;MAAC,KAAK,EAAE,IAAI,CAACE,MAAM,CAACC;IAAK,
|
|
1
|
+
{"version":3,"names":["React","View","BaseComponent","BaseComponentState","WmFormFooterProps","DEFAULT_CLASS","WmFormFooterState","WmFormFooter","constructor","props","renderWidget","styles","root","_background","children"],"sources":["form-footer.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 WmFormFooterProps from './form-footer.props';\nimport { DEFAULT_CLASS, WmFormFooterStyles } from './form-footer.styles';\n\nexport class WmFormFooterState extends BaseComponentState<WmFormFooterProps> {}\n\nexport default class WmFormFooter extends BaseComponent<WmFormFooterProps, WmFormFooterState, WmFormFooterStyles> {\n\n constructor(props: WmFormFooterProps) {\n super(props, DEFAULT_CLASS, new WmFormFooterProps());\n }\n\n renderWidget(props: WmFormFooterProps) {\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,iBAAiB,MAAM,qBAAqB;AACnD,SAASC,aAAa,QAA4B,sBAAsB;AAExE,OAAO,MAAMC,iBAAiB,SAASH,kBAAkB,CAAoB;AAE7E,eAAe,MAAMI,YAAY,SAASL,aAAa,CAA2D;EAEhHM,WAAW,CAACC,KAAwB,EAAE;IACpC,KAAK,CAACA,KAAK,EAAEJ,aAAa,EAAE,IAAID,iBAAiB,EAAE,CAAC;EACtD;EAEAM,YAAY,CAACD,KAAwB,EAAE;IACrC,oBAAQ,oBAAC,IAAI;MAAC,KAAK,EAAE,IAAI,CAACE,MAAM,CAACC;IAAK,GAAE,IAAI,CAACC,WAAW,EAAEJ,KAAK,CAACK,QAAQ,CAAQ;EAClF;AACF"}
|
|
@@ -12,7 +12,6 @@ import WmMessage from '@wavemaker/app-rn-runtime/components/basic/message/messag
|
|
|
12
12
|
import { ToastConsumer } from '@wavemaker/app-rn-runtime/core/toast.service';
|
|
13
13
|
import WmFormProps from './form.props';
|
|
14
14
|
import { DEFAULT_CLASS } from './form.styles';
|
|
15
|
-
import { createSkeleton } from '../../basic/skeleton/skeleton.component';
|
|
16
15
|
export class WmFormState extends BaseComponentState {
|
|
17
16
|
constructor() {
|
|
18
17
|
super(...arguments);
|
|
@@ -54,7 +53,7 @@ export default class WmForm extends BaseComponent {
|
|
|
54
53
|
forEach(formFields, w => {
|
|
55
54
|
if (!w.form) {
|
|
56
55
|
w.form = this;
|
|
57
|
-
w.formwidget = w.props.name && formWidgets[w.props.name];
|
|
56
|
+
w.formwidget = w.props.formKey && formWidgets[w.props.formKey] || w.props.name && formWidgets[w.props.name];
|
|
58
57
|
}
|
|
59
58
|
});
|
|
60
59
|
this.formFields = formFields;
|
|
@@ -274,40 +273,12 @@ export default class WmForm extends BaseComponent {
|
|
|
274
273
|
showInlineMsg: false
|
|
275
274
|
});
|
|
276
275
|
}
|
|
277
|
-
renderSkeleton(props) {
|
|
278
|
-
return /*#__PURE__*/React.createElement(View, {
|
|
279
|
-
style: this.styles.root
|
|
280
|
-
}, this.props.iconclass || this.props.title || this.props.subheading ? /*#__PURE__*/React.createElement(View, {
|
|
281
|
-
style: this.styles.heading
|
|
282
|
-
}, /*#__PURE__*/React.createElement(View, {
|
|
283
|
-
style: {
|
|
284
|
-
flex: 1,
|
|
285
|
-
flexDirection: 'row'
|
|
286
|
-
}
|
|
287
|
-
}, /*#__PURE__*/React.createElement(WmIcon, {
|
|
288
|
-
styles: this.styles.listIcon,
|
|
289
|
-
iconclass: this.props.iconclass
|
|
290
|
-
}), /*#__PURE__*/React.createElement(View, null, createSkeleton(this.theme, {}, {
|
|
291
|
-
...this.styles.title.root,
|
|
292
|
-
width: 96,
|
|
293
|
-
height: this.styles.title.text.fontSize
|
|
294
|
-
}), createSkeleton(this.theme, {}, {
|
|
295
|
-
...this.styles.subheading.root,
|
|
296
|
-
width: 160,
|
|
297
|
-
height: this.styles.subheading.text.fontSize
|
|
298
|
-
})))) : null, this.state.showInlineMsg ? /*#__PURE__*/React.createElement(WmMessage, {
|
|
299
|
-
type: this.state.type,
|
|
300
|
-
caption: this.state.message,
|
|
301
|
-
hideclose: false,
|
|
302
|
-
onClose: this.onMsgClose.bind(this)
|
|
303
|
-
}) : null, this.props.children);
|
|
304
|
-
}
|
|
305
276
|
renderWidget(props) {
|
|
306
277
|
return /*#__PURE__*/React.createElement(ToastConsumer, null, toastService => {
|
|
307
278
|
this.toaster = toastService;
|
|
308
279
|
return /*#__PURE__*/React.createElement(View, {
|
|
309
280
|
style: this.styles.root
|
|
310
|
-
}, props.iconclass || props.title || props.subheading ? /*#__PURE__*/React.createElement(View, {
|
|
281
|
+
}, this._background, props.iconclass || props.title || props.subheading ? /*#__PURE__*/React.createElement(View, {
|
|
311
282
|
style: this.styles.heading
|
|
312
283
|
}, /*#__PURE__*/React.createElement(View, {
|
|
313
284
|
style: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","View","BaseComponent","BaseComponentState","isDefined","debounce","find","forEach","get","set","WmLabel","WmIcon","WmMessage","ToastConsumer","WmFormProps","DEFAULT_CLASS","createSkeleton","WmFormState","WmForm","constructor","props","handleSubmit","componentDidMount","getParentFormRef","parentForm","pformName","current","parent","parentFormRef","registerFormFields","formFields","formWidgets","w","form","formwidget","name","f","formfields","applyFormData","applyDefaultValue","formdataoutput","datavalue","formData","state","formdata","formField","fw","key","setState","isDefault","updateState","updateFormFieldDefaultValue","dv","defaultvalue","field","invokeEventCallback","bind","undefined","formreset","ff","id","formKey","widget","isValid","reset","submit","_debouncedSubmitForm","onPropertyChange","$new","$old","validateFieldsOnSubmit","val","onValidate","required","msg","defaultValidatorMessages","validationmessage","validate","event","preventDefault","dataoutput","onBeforesubmit","proxy","formSubmit","data","onResultCb","error","response","status","onSuccess","postmessage","toggleMessage","onError","errormessage","updateDataOutput","Object","assign","type","message","messagelayout","showInlineMsg","toaster","showToast","placement","styles","bottom","text","hideOnClick","onMsgClose","renderSkeleton","root","iconclass","title","subheading","heading","flex","flexDirection","listIcon","theme","width","height","fontSize","children","renderWidget","toastService"],"sources":["form.component.tsx"],"sourcesContent":["import React from 'react';\nimport { View } from 'react-native';\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\nimport { isDefined, widgetsWithUndefinedValue } from '@wavemaker/app-rn-runtime/core/utils';\nimport { debounce, find, forEach, get, set } from 'lodash';\n\nimport WmLabel from '@wavemaker/app-rn-runtime/components/basic/label/label.component';\nimport WmIcon from '@wavemaker/app-rn-runtime/components/basic/icon/icon.component';\nimport WmFormField, { WmFormFieldState } from '@wavemaker/app-rn-runtime/components/data/form/form-field/form-field.component';\nimport WmMessage from '@wavemaker/app-rn-runtime/components/basic/message/message.component';\nimport { ToastConsumer, ToastService } from '@wavemaker/app-rn-runtime/core/toast.service';\n\nimport WmFormProps from './form.props';\nimport { DEFAULT_CLASS, WmFormStyles } from './form.styles';\nimport WmSkeleton, { createSkeleton } from '../../basic/skeleton/skeleton.component';\nimport { WmSkeletonStyles } from '../../basic/skeleton/skeleton.styles';\n\nexport class WmFormState extends BaseComponentState<WmFormProps> {\n isValid = false;\n type: 'success' | 'warning' | 'error' | 'info' | 'loading' | undefined = 'success';\n message: string = '';\n showInlineMsg: boolean = false;\n}\nexport default class WmForm extends BaseComponent<WmFormProps, WmFormState, WmFormStyles> {\n public formFields: Array<WmFormField> = []; // contains array of direct widget elements [WmText, WmNumber, WmCurrent]\n public parentFormRef: any;\n public formfields: {[key: string]: WmFormField} = {};\n private formdataoutput: any;\n private toaster: any;\n formWidgets: { [key: string]: BaseComponent<any, any, any> } = {}; // object containing key as name of formField and value as WmFormField proxy.\n constructor(props: WmFormProps) {\n super(props, DEFAULT_CLASS, new WmFormProps());\n }\n\n private _debouncedSubmitForm = debounce(this.handleSubmit, 250);\n\n componentDidMount() {\n super.componentDidMount();\n this.getParentFormRef(this.props.parentForm);\n }\n\n getParentFormRef(pformName: string) {\n let current = this.parent;\n while (current) {\n if (get(current, 'props.name') === pformName) {\n this.parentFormRef = current;\n break;\n }\n current = current.parent;\n }\n }\n\n registerFormFields(\n formFields: Array<WmFormField>,\n formWidgets: { [key: string]: BaseComponent<any, any, any> }\n ) {\n forEach(formFields, (w: WmFormField) => {\n if (!w.form) {\n w.form = this;\n w.formwidget = w.props.name && formWidgets[w.props.name];\n }\n });\n\n this.formFields = formFields;\n this.formWidgets = formWidgets;\n\n formFields.forEach((f: WmFormField) => {\n if (f.props.name) {\n set(this.formfields, f.props.name, f);\n }\n })\n\n this.applyFormData();\n this.applyDefaultValue();\n\n // setting default form dataoutput.\n if (!this.formdataoutput) {\n this.formdataoutput = {};\n formFields.forEach((w: WmFormField) => {\n const name = get(w.props, 'formKey') || w.props.name;\n if (name) {\n set(this.formdataoutput, name, w.props.datavalue);\n }\n });\n }\n }\n\n applyFormData() {\n let formData = this.state.props.formdata || this.parentFormRef?.state.props.formdata;\n if (!formData || (this.parentFormRef && this.state.props.formdata)) {\n return;\n }\n forEach(this.formFields, (formField: WmFormField) => {\n let fw = formField.props?.name && this.formWidgets[formField.props.name];\n if (!fw) {\n fw = find(this.formWidgets, (fw: BaseComponent<any, any, any>) => {\n return get(fw, 'formfieldname') === formField.props.name\n });\n }\n let key = get(formField, 'formKey') || get(fw, 'props.name');\n fw && fw.setState({ isDefault: true });\n formField.updateState({\n props: {\n datavalue: get(formData, key)\n }\n } as WmFormFieldState);\n });\n }\n\n updateFormFieldDefaultValue(formField: WmFormField) {\n if (formField) {\n const dv = formField.state.props.defaultvalue;\n if (isDefined(dv) && dv !== null && this.formFields) {\n let field = formField.props?.name && this.formWidgets[formField.props.name];\n if (!field) {\n field = find(this.formWidgets, (fw: BaseComponent<any, any, any>) => {\n return get(fw, 'formfieldname') === formField.props.name\n });\n }\n if (field) {\n field.setState({ isDefault: true });\n field.updateState({\n props: {\n datavalue: dv\n }\n }, this.invokeEventCallback.bind(formField, 'onFieldChange', [undefined, formField, dv]));\n }\n }\n }\n }\n\n applyDefaultValue(formField?: WmFormField) {\n if (formField) {\n this.updateFormFieldDefaultValue(formField);\n return;\n }\n forEach(this.formFields, (w: WmFormField) => {\n this.updateFormFieldDefaultValue(w);\n });\n }\n\n formreset() {\n forEach(this.formFields, (ff: WmFormField) => {\n ff.updateState({\n props : {\n datavalue: ''\n }\n } as WmFormFieldState, () => {\n const id = ff.props.formKey || ff.props.name;\n if (id) {\n let widget: BaseComponent<any, any, any> | undefined | any = this.formWidgets[id];\n if (!widget) {\n widget = find(this.formWidgets, (fw: BaseComponent<any, any, any>) => {\n return get(fw, 'formfieldname') === ff.props.name\n });\n }\n widget.updateState({\n isValid: true,\n props : {\n datavalue: ''\n }\n }, () => ff.updateState({\n isValid: true\n } as WmFormFieldState));\n widget?.reset();\n }\n }\n );\n });\n }\n\n submit() {\n this._debouncedSubmitForm();\n }\n\n onPropertyChange(name: string, $new: any, $old: any) {\n switch (name) {\n case 'formdata':\n if ($new) {\n this.applyFormData();\n }\n }\n }\n // Disable the form submit if form is in invalid state. Highlight all the invalid fields if validation type is default\n validateFieldsOnSubmit() {\n let isValid = true;\n forEach(this.formFields, (field) => {\n const val = field?.state.props.datavalue;\n\n const onValidate = get(field, 'props.onValidate');\n onValidate && onValidate(field);\n if (!val && field?.state.props.required) {\n isValid = false;\n const msg = get(field.defaultValidatorMessages, 'required') || field.state.props.validationmessage;\n field.updateState({ isValid: isValid, props: {\n validationmessage: msg\n }} as WmFormFieldState);\n field.formwidget.validate && field.formwidget.validate(val);\n }\n // check for isvalid state of formwidget\n if (field.formwidget.state.isValid === false) {\n isValid = false;\n }\n });\n return isValid;\n }\n\n // @ts-ignore\n handleSubmit(event?: any) {\n event?.preventDefault();\n const formData = this.state.props.dataoutput || this.formdataoutput;\n\n if (!this.validateFieldsOnSubmit()) {\n return false;\n }\n if (this.props.onBeforesubmit) {\n this.invokeEventCallback('onBeforesubmit', [ null, this.proxy, formData ]);\n }\n if (this.props.formSubmit) {\n this.props.formSubmit(formData, ((data: any) => {\n this.invokeEventCallback('onSubmit', [ null, this.proxy, formData ]);\n this.onResultCb(get(data, 'params'), 'success');\n }), ((error: any) => {\n this.invokeEventCallback('onSubmit', [ null, this.proxy, formData ]);\n this.onResultCb(error, '');\n }));\n } else {\n this.invokeEventCallback('onSubmit', [ null, this.proxy, formData ]);\n }\n }\n\n onResultCb(response: any, status: string, event?: any) {\n this.invokeEventCallback('onResult', [ null, this.proxy, response ]);\n if (status) {\n this.invokeEventCallback('onSuccess', [ null, this.proxy, response ]);\n !this.props.onSuccess && this.state.props.postmessage && this.toggleMessage('success', this.state.props.postmessage);\n } else {\n this.invokeEventCallback('onError', [ null, this.proxy, response ]);\n !this.props.onError && this.toggleMessage('error', this.state.props.errormessage || get(response, 'message'));\n }\n }\n\n updateDataOutput(key: string, val: any) {\n const current = this.formdataoutput || {};\n if (key) {\n set(current, key, val);\n } else {\n Object.assign(current, val)\n }\n this.formdataoutput = current;\n this.updateState({ props: { dataoutput: current }} as WmFormState);\n this.parentFormRef && this.parentFormRef.updateDataOutput(undefined, this.formdataoutput);\n }\n\n toggleMessage(\n type: 'success' | 'warning' | 'error' | 'info' | 'loading' | undefined,\n message: string\n ) {\n if (this.state.props.messagelayout === 'Inline') {\n this.setState({\n type: type,\n message: message,\n showInlineMsg: true\n } as WmFormState)\n return;\n }\n this.toaster.showToast({\n name: this, placement: \"\", styles: {bottom: 0},\n text: message,\n type: type,\n hideOnClick: true\n });\n }\n\n onMsgClose() {\n this.setState({\n showInlineMsg: false\n } as WmFormState)\n }\n\n public renderSkeleton(props: WmFormProps){\n return(\n <View style={this.styles.root}>\n {this.props.iconclass || this.props.title || this.props.subheading ? (\n <View style={this.styles.heading}>\n <View style={{flex: 1, flexDirection: 'row'}}>\n <WmIcon styles={this.styles.listIcon} iconclass={this.props.iconclass}></WmIcon>\n <View>\n {\n createSkeleton(this.theme, {} as WmSkeletonStyles, {\n ...this.styles.title.root,\n width: 96,\n height: this.styles.title.text.fontSize\n })\n }\n {\n createSkeleton(this.theme, {} as WmSkeletonStyles, {\n ...this.styles.subheading.root,\n width: 160,\n height: this.styles.subheading.text.fontSize\n })\n }\n </View>\n </View>\n </View>\n ) : null}\n {this.state.showInlineMsg ? <WmMessage type={this.state.type} caption={this.state.message} hideclose={false} onClose={this.onMsgClose.bind(this)}></WmMessage> : null\n }\n {this.props.children}\n </View>\n )\n }\n\n renderWidget(props: WmFormProps) {\n return (\n <ToastConsumer>\n {(toastService: ToastService) => {\n this.toaster = toastService;\n return <View style={this.styles.root}>\n {props.iconclass || props.title || props.subheading ? (\n <View style={this.styles.heading}>\n <View style={{flex: 1, flexDirection: 'row'}}>\n <WmIcon styles={this.styles.listIcon} iconclass={props.iconclass}></WmIcon>\n <View>\n <WmLabel styles={this.styles.title} caption={props.title}></WmLabel>\n <WmLabel styles={this.styles.subheading} caption={props.subheading}></WmLabel>\n </View>\n </View>\n </View>\n ) : null}\n {this.state.showInlineMsg ? <WmMessage type={this.state.type} caption={this.state.message} hideclose={false} onClose={this.onMsgClose.bind(this)}></WmMessage> : null\n }\n {props.children}\n </View>\n }\n }\n </ToastConsumer>\n );\n }\n}\n"],"mappings":";;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,QAAQ,cAAc;AACnC,S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,CAAC,CAEa;EAEpB;AACF"}
|
|
1
|
+
{"version":3,"names":["React","View","BaseComponent","BaseComponentState","isDefined","debounce","find","forEach","get","set","WmLabel","WmIcon","WmMessage","ToastConsumer","WmFormProps","DEFAULT_CLASS","WmFormState","WmForm","constructor","props","handleSubmit","componentDidMount","getParentFormRef","parentForm","pformName","current","parent","parentFormRef","registerFormFields","formFields","formWidgets","w","form","formwidget","formKey","name","f","formfields","applyFormData","applyDefaultValue","formdataoutput","datavalue","formData","state","formdata","formField","fw","key","setState","isDefault","updateState","updateFormFieldDefaultValue","dv","defaultvalue","field","invokeEventCallback","bind","undefined","formreset","ff","id","widget","isValid","reset","submit","_debouncedSubmitForm","onPropertyChange","$new","$old","validateFieldsOnSubmit","val","onValidate","required","msg","defaultValidatorMessages","validationmessage","validate","event","preventDefault","dataoutput","onBeforesubmit","proxy","formSubmit","data","onResultCb","error","response","status","onSuccess","postmessage","toggleMessage","onError","errormessage","updateDataOutput","Object","assign","type","message","messagelayout","showInlineMsg","toaster","showToast","placement","styles","bottom","text","hideOnClick","onMsgClose","renderWidget","toastService","root","_background","iconclass","title","subheading","heading","flex","flexDirection","listIcon","children"],"sources":["form.component.tsx"],"sourcesContent":["import React from 'react';\nimport { View } from 'react-native';\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\nimport { isDefined, widgetsWithUndefinedValue } from '@wavemaker/app-rn-runtime/core/utils';\nimport { debounce, find, forEach, get, set } from 'lodash';\n\nimport WmLabel from '@wavemaker/app-rn-runtime/components/basic/label/label.component';\nimport WmIcon from '@wavemaker/app-rn-runtime/components/basic/icon/icon.component';\nimport WmFormField, { WmFormFieldState } from '@wavemaker/app-rn-runtime/components/data/form/form-field/form-field.component';\nimport WmMessage from '@wavemaker/app-rn-runtime/components/basic/message/message.component';\nimport { ToastConsumer, ToastService } from '@wavemaker/app-rn-runtime/core/toast.service';\n\nimport WmFormProps from './form.props';\nimport { DEFAULT_CLASS, WmFormStyles } from './form.styles';\nimport WmSkeleton, { createSkeleton } from '../../basic/skeleton/skeleton.component';\nimport { WmSkeletonStyles } from '../../basic/skeleton/skeleton.styles';\n\nexport class WmFormState extends BaseComponentState<WmFormProps> {\n isValid = false;\n type: 'success' | 'warning' | 'error' | 'info' | 'loading' | undefined = 'success';\n message: string = '';\n showInlineMsg: boolean = false;\n}\nexport default class WmForm extends BaseComponent<WmFormProps, WmFormState, WmFormStyles> {\n public formFields: Array<WmFormField> = []; // contains array of direct widget elements [WmText, WmNumber, WmCurrent]\n public parentFormRef: any;\n public formfields: {[key: string]: WmFormField} = {};\n private formdataoutput: any;\n private toaster: any;\n formWidgets: { [key: string]: BaseComponent<any, any, any> } = {}; // object containing key as name of formField and value as WmFormField proxy.\n constructor(props: WmFormProps) {\n super(props, DEFAULT_CLASS, new WmFormProps());\n }\n\n private _debouncedSubmitForm = debounce(this.handleSubmit, 250);\n\n componentDidMount() {\n super.componentDidMount();\n this.getParentFormRef(this.props.parentForm);\n }\n\n getParentFormRef(pformName: string) {\n let current = this.parent;\n while (current) {\n if (get(current, 'props.name') === pformName) {\n this.parentFormRef = current;\n break;\n }\n current = current.parent;\n }\n }\n\n registerFormFields(\n formFields: Array<WmFormField>,\n formWidgets: { [key: string]: BaseComponent<any, any, any> }\n ) {\n forEach(formFields, (w: WmFormField) => {\n if (!w.form) {\n w.form = this;\n w.formwidget = (w.props.formKey && formWidgets[w.props.formKey]) \n || (w.props.name && formWidgets[w.props.name]);\n }\n });\n\n this.formFields = formFields;\n this.formWidgets = formWidgets;\n\n formFields.forEach((f: WmFormField) => {\n if (f.props.name) {\n set(this.formfields, f.props.name, f);\n }\n })\n\n this.applyFormData();\n this.applyDefaultValue();\n\n // setting default form dataoutput.\n if (!this.formdataoutput) {\n this.formdataoutput = {};\n formFields.forEach((w: WmFormField) => {\n const name = get(w.props, 'formKey') || w.props.name;\n if (name) {\n set(this.formdataoutput, name, w.props.datavalue);\n }\n });\n }\n }\n\n applyFormData() {\n let formData = this.state.props.formdata || this.parentFormRef?.state.props.formdata;\n if (!formData || (this.parentFormRef && this.state.props.formdata)) {\n return;\n }\n forEach(this.formFields, (formField: WmFormField) => {\n let fw = formField.props?.name && this.formWidgets[formField.props.name];\n if (!fw) {\n fw = find(this.formWidgets, (fw: BaseComponent<any, any, any>) => {\n return get(fw, 'formfieldname') === formField.props.name\n });\n }\n let key = get(formField, 'formKey') || get(fw, 'props.name');\n fw && fw.setState({ isDefault: true });\n formField.updateState({\n props: {\n datavalue: get(formData, key)\n }\n } as WmFormFieldState);\n });\n }\n\n updateFormFieldDefaultValue(formField: WmFormField) {\n if (formField) {\n const dv = formField.state.props.defaultvalue;\n if (isDefined(dv) && dv !== null && this.formFields) {\n let field = formField.props?.name && this.formWidgets[formField.props.name];\n if (!field) {\n field = find(this.formWidgets, (fw: BaseComponent<any, any, any>) => {\n return get(fw, 'formfieldname') === formField.props.name\n });\n }\n if (field) {\n field.setState({ isDefault: true });\n field.updateState({\n props: {\n datavalue: dv\n }\n }, this.invokeEventCallback.bind(formField, 'onFieldChange', [undefined, formField, dv]));\n }\n }\n }\n }\n\n applyDefaultValue(formField?: WmFormField) {\n if (formField) {\n this.updateFormFieldDefaultValue(formField);\n return;\n }\n forEach(this.formFields, (w: WmFormField) => {\n this.updateFormFieldDefaultValue(w);\n });\n }\n\n formreset() {\n forEach(this.formFields, (ff: WmFormField) => {\n ff.updateState({\n props : {\n datavalue: ''\n }\n } as WmFormFieldState, () => {\n const id = ff.props.formKey || ff.props.name;\n if (id) {\n let widget: BaseComponent<any, any, any> | undefined | any = this.formWidgets[id];\n if (!widget) {\n widget = find(this.formWidgets, (fw: BaseComponent<any, any, any>) => {\n return get(fw, 'formfieldname') === ff.props.name\n });\n }\n widget.updateState({\n isValid: true,\n props : {\n datavalue: ''\n }\n }, () => ff.updateState({\n isValid: true\n } as WmFormFieldState));\n widget?.reset();\n }\n }\n );\n });\n }\n\n submit() {\n this._debouncedSubmitForm();\n }\n\n onPropertyChange(name: string, $new: any, $old: any) {\n switch (name) {\n case 'formdata':\n if ($new) {\n this.applyFormData();\n }\n }\n }\n // Disable the form submit if form is in invalid state. Highlight all the invalid fields if validation type is default\n validateFieldsOnSubmit() {\n let isValid = true;\n forEach(this.formFields, (field) => {\n const val = field?.state.props.datavalue;\n\n const onValidate = get(field, 'props.onValidate');\n onValidate && onValidate(field);\n if (!val && field?.state.props.required) {\n isValid = false;\n const msg = get(field.defaultValidatorMessages, 'required') || field.state.props.validationmessage;\n field.updateState({ isValid: isValid, props: {\n validationmessage: msg\n }} as WmFormFieldState);\n field.formwidget.validate && field.formwidget.validate(val);\n }\n // check for isvalid state of formwidget\n if (field.formwidget.state.isValid === false) {\n isValid = false;\n }\n });\n return isValid;\n }\n\n // @ts-ignore\n handleSubmit(event?: any) {\n event?.preventDefault();\n const formData = this.state.props.dataoutput || this.formdataoutput;\n\n if (!this.validateFieldsOnSubmit()) {\n return false;\n }\n if (this.props.onBeforesubmit) {\n this.invokeEventCallback('onBeforesubmit', [ null, this.proxy, formData ]);\n }\n if (this.props.formSubmit) {\n this.props.formSubmit(formData, ((data: any) => {\n this.invokeEventCallback('onSubmit', [ null, this.proxy, formData ]);\n this.onResultCb(get(data, 'params'), 'success');\n }), ((error: any) => {\n this.invokeEventCallback('onSubmit', [ null, this.proxy, formData ]);\n this.onResultCb(error, '');\n }));\n } else {\n this.invokeEventCallback('onSubmit', [ null, this.proxy, formData ]);\n }\n }\n\n onResultCb(response: any, status: string, event?: any) {\n this.invokeEventCallback('onResult', [ null, this.proxy, response ]);\n if (status) {\n this.invokeEventCallback('onSuccess', [ null, this.proxy, response ]);\n !this.props.onSuccess && this.state.props.postmessage && this.toggleMessage('success', this.state.props.postmessage);\n } else {\n this.invokeEventCallback('onError', [ null, this.proxy, response ]);\n !this.props.onError && this.toggleMessage('error', this.state.props.errormessage || get(response, 'message'));\n }\n }\n\n updateDataOutput(key: string, val: any) {\n const current = this.formdataoutput || {};\n if (key) {\n set(current, key, val);\n } else {\n Object.assign(current, val)\n }\n this.formdataoutput = current;\n this.updateState({ props: { dataoutput: current }} as WmFormState);\n this.parentFormRef && this.parentFormRef.updateDataOutput(undefined, this.formdataoutput);\n }\n\n toggleMessage(\n type: 'success' | 'warning' | 'error' | 'info' | 'loading' | undefined,\n message: string\n ) {\n if (this.state.props.messagelayout === 'Inline') {\n this.setState({\n type: type,\n message: message,\n showInlineMsg: true\n } as WmFormState)\n return;\n }\n this.toaster.showToast({\n name: this, placement: \"\", styles: {bottom: 0},\n text: message,\n type: type,\n hideOnClick: true\n });\n }\n\n onMsgClose() {\n this.setState({\n showInlineMsg: false\n } as WmFormState)\n }\n\n renderWidget(props: WmFormProps) {\n return (\n <ToastConsumer>\n {(toastService: ToastService) => {\n this.toaster = toastService;\n return <View style={this.styles.root}>\n {this._background}\n {props.iconclass || props.title || props.subheading ? (\n <View style={this.styles.heading}>\n <View style={{flex: 1, flexDirection: 'row'}}>\n <WmIcon styles={this.styles.listIcon} iconclass={props.iconclass}></WmIcon>\n <View>\n <WmLabel styles={this.styles.title} caption={props.title}></WmLabel>\n <WmLabel styles={this.styles.subheading} caption={props.subheading}></WmLabel>\n </View>\n </View>\n </View>\n ) : null}\n {this.state.showInlineMsg ? <WmMessage type={this.state.type} caption={this.state.message} hideclose={false} onClose={this.onMsgClose.bind(this)}></WmMessage> : null\n }\n {props.children}\n </View>\n }\n }\n </ToastConsumer>\n );\n }\n}\n"],"mappings":";;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,QAAQ,cAAc;AACnC,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,+CAA+C;AACjG,SAASC,SAAS,QAAmC,sCAAsC;AAC3F,SAASC,QAAQ,EAAEC,IAAI,EAAEC,OAAO,EAAEC,GAAG,EAAEC,GAAG,QAAQ,QAAQ;AAE1D,OAAOC,OAAO,MAAM,kEAAkE;AACtF,OAAOC,MAAM,MAAM,gEAAgE;AAEnF,OAAOC,SAAS,MAAM,sEAAsE;AAC5F,SAASC,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AAC6F,SAAS,IAAI7F,KAAK,CAAC8F,KAAK,IAAI9F,KAAK,CAAC+F,UAAU,gBACjD,oBAAC,IAAI;QAAC,KAAK,EAAE,IAAI,CAACX,MAAM,CAACY;MAAQ,gBAC/B,oBAAC,IAAI;QAAC,KAAK,EAAE;UAACC,IAAI,EAAE,CAAC;UAAEC,aAAa,EAAE;QAAK;MAAE,gBAC3C,oBAAC,MAAM;QAAC,MAAM,EAAE,IAAI,CAACd,MAAM,CAACe,QAAS;QAAC,SAAS,EAAEnG,KAAK,CAAC6F;MAAU,EAAU,eAC3E,oBAAC,IAAI,qBACH,oBAAC,OAAO;QAAC,MAAM,EAAE,IAAI,CAACT,MAAM,CAACU,KAAM;QAAC,OAAO,EAAE9F,KAAK,CAAC8F;MAAM,EAAW,eACpE,oBAAC,OAAO;QAAC,MAAM,EAAE,IAAI,CAACV,MAAM,CAACW,UAAW;QAAC,OAAO,EAAE/F,KAAK,CAAC+F;MAAW,EAAW,CACzE,CACF,CACF,GACL,IAAI,EACP,IAAI,CAACvE,KAAK,CAACwD,aAAa,gBAAG,oBAAC,SAAS;QAAC,IAAI,EAAE,IAAI,CAACxD,KAAK,CAACqD,IAAK;QAAC,OAAO,EAAE,IAAI,CAACrD,KAAK,CAACsD,OAAQ;QAAC,SAAS,EAAE,KAAM;QAAC,OAAO,EAAE,IAAI,CAACU,UAAU,CAACnD,IAAI,CAAC,IAAI;MAAE,EAAa,GAAG,IAAI,EAEpKrC,KAAK,CAACoG,QAAQ,CACV;IACT,CAAC,CAEa;EAEpB;AACF"}
|
|
@@ -11,7 +11,7 @@ export default class WmListTemplate 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=list-template.component.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","View","BaseComponent","BaseComponentState","WmListTemplateProps","DEFAULT_CLASS","WmListTemplateState","WmListTemplate","constructor","props","renderWidget","styles","root","children"],"sources":["list-template.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 WmListTemplateProps from './list-template.props';\nimport { DEFAULT_CLASS, WmListTemplateStyles } from './list-template.styles';\n\nexport class WmListTemplateState extends BaseComponentState<WmListTemplateProps> {\n\n}\n\nexport default class WmListTemplate extends BaseComponent<WmListTemplateProps, WmListTemplateState, WmListTemplateStyles> {\n\n constructor(props: WmListTemplateProps) {\n super(props, DEFAULT_CLASS, new WmListTemplateProps());\n }\n\n renderWidget(props: WmListTemplateProps) {\n return (\n <View style={this.styles.root}>{props.children}</View>\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,mBAAmB,MAAM,uBAAuB;AACvD,SAASC,aAAa,QAA8B,wBAAwB;AAE5E,OAAO,MAAMC,mBAAmB,SAASH,kBAAkB,CAAsB;AAIjF,eAAe,MAAMI,cAAc,SAASL,aAAa,CAAiE;EAExHM,WAAW,CAACC,KAA0B,EAAE;IACtC,KAAK,CAACA,KAAK,EAAEJ,aAAa,EAAE,IAAID,mBAAmB,EAAE,CAAC;EACxD;EAEAM,YAAY,CAACD,KAA0B,EAAE;IACvC,oBACE,oBAAC,IAAI;MAAC,KAAK,EAAE,IAAI,CAACE,MAAM,CAACC;IAAK,
|
|
1
|
+
{"version":3,"names":["React","View","BaseComponent","BaseComponentState","WmListTemplateProps","DEFAULT_CLASS","WmListTemplateState","WmListTemplate","constructor","props","renderWidget","styles","root","_background","children"],"sources":["list-template.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 WmListTemplateProps from './list-template.props';\nimport { DEFAULT_CLASS, WmListTemplateStyles } from './list-template.styles';\n\nexport class WmListTemplateState extends BaseComponentState<WmListTemplateProps> {\n\n}\n\nexport default class WmListTemplate extends BaseComponent<WmListTemplateProps, WmListTemplateState, WmListTemplateStyles> {\n\n constructor(props: WmListTemplateProps) {\n super(props, DEFAULT_CLASS, new WmListTemplateProps());\n }\n\n renderWidget(props: WmListTemplateProps) {\n return (\n <View style={this.styles.root}>{this._background}{props.children}</View>\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,mBAAmB,MAAM,uBAAuB;AACvD,SAASC,aAAa,QAA8B,wBAAwB;AAE5E,OAAO,MAAMC,mBAAmB,SAASH,kBAAkB,CAAsB;AAIjF,eAAe,MAAMI,cAAc,SAASL,aAAa,CAAiE;EAExHM,WAAW,CAACC,KAA0B,EAAE;IACtC,KAAK,CAACA,KAAK,EAAEJ,aAAa,EAAE,IAAID,mBAAmB,EAAE,CAAC;EACxD;EAEAM,YAAY,CAACD,KAA0B,EAAE;IACvC,oBACE,oBAAC,IAAI;MAAC,KAAK,EAAE,IAAI,CAACE,MAAM,CAACC;IAAK,GAAE,IAAI,CAACC,WAAW,EAAEJ,KAAK,CAACK,QAAQ,CAAQ;EAE5E;AACF"}
|
|
@@ -76,17 +76,15 @@ export default class WmList extends BaseComponent {
|
|
|
76
76
|
}
|
|
77
77
|
break;
|
|
78
78
|
case 'dataset':
|
|
79
|
-
if (this._showSkeleton) {
|
|
80
|
-
$new = [{}, {}, {}];
|
|
81
|
-
}
|
|
82
79
|
if (this.state.props.groupby) {
|
|
83
80
|
this.setGroupData($new);
|
|
84
81
|
} else {
|
|
82
|
+
const data = isArray($new) ? $new : isDefined($new) ? [$new] : [];
|
|
85
83
|
this.updateState({
|
|
86
|
-
groupedData: [{
|
|
84
|
+
groupedData: data[0] || props.direction === 'horizontal' ? [{
|
|
87
85
|
key: '',
|
|
88
|
-
data:
|
|
89
|
-
}]
|
|
86
|
+
data: data
|
|
87
|
+
}] : []
|
|
90
88
|
}, () => {
|
|
91
89
|
this.key += $new && $new.length || 0;
|
|
92
90
|
});
|
|
@@ -192,6 +190,17 @@ export default class WmList extends BaseComponent {
|
|
|
192
190
|
renderItem: itemInfo => this.renderItem(itemInfo.item, itemInfo.index, props)
|
|
193
191
|
}))) : null);
|
|
194
192
|
}
|
|
193
|
+
getSectionListData() {
|
|
194
|
+
if (this._showSkeleton) {
|
|
195
|
+
return [{
|
|
196
|
+
key: '',
|
|
197
|
+
data: [{}, {}, {}]
|
|
198
|
+
}];
|
|
199
|
+
} else if (this.state.groupedData[0] && this.state.groupedData[0]['data'].length) {
|
|
200
|
+
return this.state.groupedData;
|
|
201
|
+
}
|
|
202
|
+
return [];
|
|
203
|
+
}
|
|
195
204
|
renderWithSectionList(props) {
|
|
196
205
|
let isHorizontal = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
197
206
|
return /*#__PURE__*/React.createElement(SectionList, {
|
|
@@ -208,7 +217,7 @@ export default class WmList extends BaseComponent {
|
|
|
208
217
|
},
|
|
209
218
|
contentContainerStyle: this.styles.root,
|
|
210
219
|
onEndReachedThreshold: 0.3,
|
|
211
|
-
sections: this.
|
|
220
|
+
sections: this.getSectionListData(),
|
|
212
221
|
renderSectionHeader: _ref2 => {
|
|
213
222
|
let {
|
|
214
223
|
section: {
|
|
@@ -226,7 +235,7 @@ export default class WmList extends BaseComponent {
|
|
|
226
235
|
renderWidget(props) {
|
|
227
236
|
this.invokeEventCallback('onBeforedatarender', [this, this.state.props.dataset]);
|
|
228
237
|
const isHorizontal = props.direction === 'horizontal';
|
|
229
|
-
return /*#__PURE__*/React.createElement(View, null, isHorizontal ? this.renderWithFlatList(props, isHorizontal) : this.renderWithSectionList(props, isHorizontal));
|
|
238
|
+
return /*#__PURE__*/React.createElement(View, null, this._background, isHorizontal ? this.renderWithFlatList(props, isHorizontal) : this.renderWithSectionList(props, isHorizontal));
|
|
230
239
|
}
|
|
231
240
|
}
|
|
232
241
|
//# sourceMappingURL=list.component.js.map
|