@wavemaker/app-rn-runtime 12.0.0-next.141131 → 12.0.0-next.141134
Sign up to get free protection for your applications and to get access to all the features.
- app-rn-runtime/components/advanced/carousel/carousel.component.js +31 -5
- app-rn-runtime/components/advanced/carousel/carousel.component.js.map +1 -1
- app-rn-runtime/components/advanced/carousel/carousel.props.js +1 -0
- app-rn-runtime/components/advanced/carousel/carousel.props.js.map +1 -1
- app-rn-runtime/components/advanced/carousel/carousel.styles.js +15 -0
- app-rn-runtime/components/advanced/carousel/carousel.styles.js.map +1 -1
- app-rn-runtime/components/advanced/webview/webview.component.js.map +1 -1
- app-rn-runtime/components/basic/anchor/anchor.component.js +15 -5
- app-rn-runtime/components/basic/anchor/anchor.component.js.map +1 -1
- app-rn-runtime/components/basic/anchor/anchor.styles.js +3 -0
- app-rn-runtime/components/basic/anchor/anchor.styles.js.map +1 -1
- app-rn-runtime/components/basic/animatedview.component.js +6 -2
- app-rn-runtime/components/basic/animatedview.component.js.map +1 -1
- app-rn-runtime/components/basic/audio/audio.component.js.map +1 -1
- app-rn-runtime/components/basic/button/button.component.js +20 -6
- app-rn-runtime/components/basic/button/button.component.js.map +1 -1
- app-rn-runtime/components/basic/icon/icon.component.js +14 -6
- app-rn-runtime/components/basic/icon/icon.component.js.map +1 -1
- app-rn-runtime/components/basic/label/label.component.js +13 -3
- app-rn-runtime/components/basic/label/label.component.js.map +1 -1
- app-rn-runtime/components/basic/label/label.styles.js.map +1 -1
- app-rn-runtime/components/basic/message/message.component.js.map +1 -1
- app-rn-runtime/components/basic/picture/picture.component.js +1 -2
- app-rn-runtime/components/basic/picture/picture.component.js.map +1 -1
- app-rn-runtime/components/basic/progress-bar/progress-bar.component.js +2 -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 +5 -5
- app-rn-runtime/components/basic/progress-circle/progress-circle.component.js.map +1 -1
- app-rn-runtime/components/basic/search/search.component.js +9 -0
- app-rn-runtime/components/basic/search/search.component.js.map +1 -1
- app-rn-runtime/components/basic/search/search.props.js +2 -0
- app-rn-runtime/components/basic/search/search.props.js.map +1 -1
- app-rn-runtime/components/basic/search/search.styles.js +5 -0
- app-rn-runtime/components/basic/search/search.styles.js.map +1 -1
- app-rn-runtime/components/basic/skeleton/skeleton.component.js +4 -3
- app-rn-runtime/components/basic/skeleton/skeleton.component.js.map +1 -1
- app-rn-runtime/components/basic/skeleton/skeleton.props.js +9 -1
- app-rn-runtime/components/basic/skeleton/skeleton.props.js.map +1 -1
- app-rn-runtime/components/basic/spinner/spinner.component.js +2 -3
- app-rn-runtime/components/basic/spinner/spinner.component.js.map +1 -1
- app-rn-runtime/components/basic/spinner/spinner.styles.js +3 -2
- app-rn-runtime/components/basic/spinner/spinner.styles.js.map +1 -1
- app-rn-runtime/components/basic/video/video.component.js.map +1 -1
- app-rn-runtime/components/basic/video/video.styles.js +4 -1
- app-rn-runtime/components/basic/video/video.styles.js.map +1 -1
- app-rn-runtime/components/chart/area-chart/area-chart.component.js +2 -1
- app-rn-runtime/components/chart/area-chart/area-chart.component.js.map +1 -1
- app-rn-runtime/components/chart/area-chart/area-chart.styles.js +7 -1
- app-rn-runtime/components/chart/area-chart/area-chart.styles.js.map +1 -1
- app-rn-runtime/components/chart/bar-chart/bar-chart.styles.js +7 -1
- app-rn-runtime/components/chart/bar-chart/bar-chart.styles.js.map +1 -1
- app-rn-runtime/components/chart/basechart.component.js +54 -2
- app-rn-runtime/components/chart/basechart.component.js.map +1 -1
- app-rn-runtime/components/chart/basechart.props.js +3 -2
- app-rn-runtime/components/chart/basechart.props.js.map +1 -1
- app-rn-runtime/components/chart/basechart.styles.js +4 -0
- app-rn-runtime/components/chart/basechart.styles.js.map +1 -1
- app-rn-runtime/components/chart/bubble-chart/bubble-chart.component.js +15 -3
- app-rn-runtime/components/chart/bubble-chart/bubble-chart.component.js.map +1 -1
- app-rn-runtime/components/chart/bubble-chart/bubble-chart.styles.js +7 -1
- app-rn-runtime/components/chart/bubble-chart/bubble-chart.styles.js.map +1 -1
- app-rn-runtime/components/chart/column-chart/column-chart.styles.js +7 -1
- app-rn-runtime/components/chart/column-chart/column-chart.styles.js.map +1 -1
- app-rn-runtime/components/chart/donut-chart/donut-chart.styles.js +7 -1
- app-rn-runtime/components/chart/donut-chart/donut-chart.styles.js.map +1 -1
- app-rn-runtime/components/chart/line-chart/line-chart.props.js +2 -0
- app-rn-runtime/components/chart/line-chart/line-chart.props.js.map +1 -1
- app-rn-runtime/components/chart/line-chart/line-chart.styles.js +7 -1
- app-rn-runtime/components/chart/line-chart/line-chart.styles.js.map +1 -1
- app-rn-runtime/components/chart/pie-chart/pie-chart.component.js +6 -2
- app-rn-runtime/components/chart/pie-chart/pie-chart.component.js.map +1 -1
- app-rn-runtime/components/chart/pie-chart/pie-chart.styles.js +7 -1
- app-rn-runtime/components/chart/pie-chart/pie-chart.styles.js.map +1 -1
- app-rn-runtime/components/chart/stack-chart/stack-chart.component.js +37 -11
- app-rn-runtime/components/chart/stack-chart/stack-chart.component.js.map +1 -1
- app-rn-runtime/components/container/accordion/accordion.component.js +61 -12
- app-rn-runtime/components/container/accordion/accordion.component.js.map +1 -1
- app-rn-runtime/components/container/accordion/accordion.props.js.map +1 -1
- app-rn-runtime/components/container/accordion/accordion.styles.js +5 -0
- app-rn-runtime/components/container/accordion/accordion.styles.js.map +1 -1
- app-rn-runtime/components/container/accordion/accordionpane/accordionpane.component.js +11 -1
- app-rn-runtime/components/container/accordion/accordionpane/accordionpane.component.js.map +1 -1
- app-rn-runtime/components/container/container.component.js +36 -2
- app-rn-runtime/components/container/container.component.js.map +1 -1
- app-rn-runtime/components/container/container.styles.js +7 -0
- app-rn-runtime/components/container/container.styles.js.map +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 +5 -1
- app-rn-runtime/components/container/layoutgrid/gridrow/gridrow.component.js.map +1 -1
- app-rn-runtime/components/container/layoutgrid/gridrow/gridrow.styles.js +6 -1
- app-rn-runtime/components/container/layoutgrid/gridrow/gridrow.styles.js.map +1 -1
- app-rn-runtime/components/container/layoutgrid/layoutgrid.component.js +28 -2
- app-rn-runtime/components/container/layoutgrid/layoutgrid.component.js.map +1 -1
- app-rn-runtime/components/container/layoutgrid/layoutgrid.props.js.map +1 -1
- app-rn-runtime/components/container/layoutgrid/layoutgrid.styles.js +4 -1
- app-rn-runtime/components/container/layoutgrid/layoutgrid.styles.js.map +1 -1
- app-rn-runtime/components/container/linearlayout/linearlayout.component.js +31 -5
- app-rn-runtime/components/container/linearlayout/linearlayout.component.js.map +1 -1
- app-rn-runtime/components/container/linearlayout/linearlayout.props.js.map +1 -1
- app-rn-runtime/components/container/linearlayout/linearlayout.styles.js +4 -1
- app-rn-runtime/components/container/linearlayout/linearlayout.styles.js.map +1 -1
- app-rn-runtime/components/container/panel/panel.component.js +47 -6
- app-rn-runtime/components/container/panel/panel.component.js.map +1 -1
- app-rn-runtime/components/container/panel/panel.props.js.map +1 -1
- app-rn-runtime/components/container/panel/panel.styles.js +3 -0
- app-rn-runtime/components/container/panel/panel.styles.js.map +1 -1
- app-rn-runtime/components/container/partial-host.component.js.map +1 -1
- app-rn-runtime/components/container/tabs/tabheader/tabheader.component.js +3 -4
- app-rn-runtime/components/container/tabs/tabheader/tabheader.component.js.map +1 -1
- app-rn-runtime/components/container/tabs/tabheader/tabheader.props.js.map +1 -1
- app-rn-runtime/components/container/tabs/tabpane/tabpane.component.js +11 -1
- app-rn-runtime/components/container/tabs/tabpane/tabpane.component.js.map +1 -1
- app-rn-runtime/components/container/tabs/tabpane/tabpane.props.js.map +1 -1
- app-rn-runtime/components/container/tabs/tabs.component.js +41 -5
- app-rn-runtime/components/container/tabs/tabs.component.js.map +1 -1
- app-rn-runtime/components/container/tabs/tabs.props.js.map +1 -1
- app-rn-runtime/components/container/tabs/tabs.styles.js +4 -1
- app-rn-runtime/components/container/tabs/tabs.styles.js.map +1 -1
- app-rn-runtime/components/container/tile/tile.component.js +28 -2
- app-rn-runtime/components/container/tile/tile.component.js.map +1 -1
- app-rn-runtime/components/container/tile/tile.props.js.map +1 -1
- app-rn-runtime/components/container/tile/tile.styles.js +6 -1
- app-rn-runtime/components/container/tile/tile.styles.js.map +1 -1
- app-rn-runtime/components/container/wizard/wizard.component.js +62 -13
- app-rn-runtime/components/container/wizard/wizard.component.js.map +1 -1
- app-rn-runtime/components/container/wizard/wizard.props.js.map +1 -1
- app-rn-runtime/components/container/wizard/wizard.styles.js +3 -0
- app-rn-runtime/components/container/wizard/wizard.styles.js.map +1 -1
- app-rn-runtime/components/container/wizard/wizardstep/wizardstep.component.js +4 -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 +6 -2
- app-rn-runtime/components/data/card/card-content/card-content.component.js.map +1 -1
- app-rn-runtime/components/data/card/card-content/card-content.styles.js +4 -1
- app-rn-runtime/components/data/card/card-content/card-content.styles.js.map +1 -1
- app-rn-runtime/components/data/card/card.component.js +18 -0
- app-rn-runtime/components/data/card/card.component.js.map +1 -1
- app-rn-runtime/components/data/card/card.styles.js +3 -0
- app-rn-runtime/components/data/card/card.styles.js.map +1 -1
- app-rn-runtime/components/data/form/form-field/form-field.component.js.map +1 -1
- app-rn-runtime/components/data/form/form.component.js +1 -1
- app-rn-runtime/components/data/form/form.component.js.map +1 -1
- app-rn-runtime/components/data/form/form.props.js +1 -0
- app-rn-runtime/components/data/form/form.props.js.map +1 -1
- app-rn-runtime/components/data/list/list-template/list-template.component.js +15 -1
- app-rn-runtime/components/data/list/list-template/list-template.component.js.map +1 -1
- app-rn-runtime/components/data/list/list-template/list-template.props.js +1 -0
- app-rn-runtime/components/data/list/list-template/list-template.props.js.map +1 -1
- app-rn-runtime/components/data/list/list-template/list-template.styles.js +11 -1
- app-rn-runtime/components/data/list/list-template/list-template.styles.js.map +1 -1
- app-rn-runtime/components/data/list/list.component.js +54 -33
- app-rn-runtime/components/data/list/list.component.js.map +1 -1
- app-rn-runtime/components/data/list/list.props.js +1 -0
- app-rn-runtime/components/data/list/list.props.js.map +1 -1
- app-rn-runtime/components/data/list/list.styles.js +9 -0
- app-rn-runtime/components/data/list/list.styles.js.map +1 -1
- app-rn-runtime/components/dialogs/dialog/dialog.component.js +5 -3
- app-rn-runtime/components/dialogs/dialog/dialog.component.js.map +1 -1
- app-rn-runtime/components/dialogs/dialog/dialog.styles.js.map +1 -1
- app-rn-runtime/components/input/basedataset/basedataset.component.js.map +1 -1
- app-rn-runtime/components/input/baseinput/baseinput.component.js +11 -4
- app-rn-runtime/components/input/baseinput/baseinput.component.js.map +1 -1
- app-rn-runtime/components/input/baseinput/baseinput.props.js +1 -0
- app-rn-runtime/components/input/baseinput/baseinput.props.js.map +1 -1
- app-rn-runtime/components/input/basenumber/basenumber.component.js +25 -12
- app-rn-runtime/components/input/basenumber/basenumber.component.js.map +1 -1
- app-rn-runtime/components/input/basenumber/basenumber.props.js +2 -0
- app-rn-runtime/components/input/basenumber/basenumber.props.js.map +1 -1
- app-rn-runtime/components/input/checkbox/checkbox.component.js +5 -6
- app-rn-runtime/components/input/checkbox/checkbox.component.js.map +1 -1
- app-rn-runtime/components/input/checkbox/checkbox.styles.js.map +1 -1
- app-rn-runtime/components/input/checkboxset/checkboxset.component.js +24 -3
- app-rn-runtime/components/input/checkboxset/checkboxset.component.js.map +1 -1
- app-rn-runtime/components/input/checkboxset/checkboxset.props.js +1 -0
- app-rn-runtime/components/input/checkboxset/checkboxset.props.js.map +1 -1
- app-rn-runtime/components/input/checkboxset/checkboxset.styles.js +1 -0
- app-rn-runtime/components/input/checkboxset/checkboxset.styles.js.map +1 -1
- app-rn-runtime/components/input/chips/chips.component.js +3 -2
- app-rn-runtime/components/input/chips/chips.component.js.map +1 -1
- app-rn-runtime/components/input/currency/currency.component.js +16 -1
- app-rn-runtime/components/input/currency/currency.component.js.map +1 -1
- app-rn-runtime/components/input/epoch/base-datetime.component.js +22 -5
- app-rn-runtime/components/input/epoch/base-datetime.component.js.map +1 -1
- app-rn-runtime/components/input/epoch/wheel-date-picker.component.js +123 -12
- app-rn-runtime/components/input/epoch/wheel-date-picker.component.js.map +1 -1
- app-rn-runtime/components/input/epoch/wheelpicker/wheelpicker.component.js.map +1 -1
- app-rn-runtime/components/input/epoch/wheelpickermodal/date/date-picker-modal.component.js +4 -0
- app-rn-runtime/components/input/epoch/wheelpickermodal/date/date-picker-modal.component.js.map +1 -1
- app-rn-runtime/components/input/epoch/wheelpickermodal/date/date-picker-modal.props.js +2 -0
- app-rn-runtime/components/input/epoch/wheelpickermodal/date/date-picker-modal.props.js.map +1 -1
- app-rn-runtime/components/input/fileupload/fileupload.component.js +4 -2
- app-rn-runtime/components/input/fileupload/fileupload.component.js.map +1 -1
- app-rn-runtime/components/input/fileupload/fileupload.props.js +1 -0
- app-rn-runtime/components/input/fileupload/fileupload.props.js.map +1 -1
- app-rn-runtime/components/input/number/number.component.js +6 -3
- app-rn-runtime/components/input/number/number.component.js.map +1 -1
- app-rn-runtime/components/input/radioset/radioset.component.js +27 -7
- app-rn-runtime/components/input/radioset/radioset.component.js.map +1 -1
- app-rn-runtime/components/input/radioset/radioset.props.js +1 -0
- app-rn-runtime/components/input/radioset/radioset.props.js.map +1 -1
- app-rn-runtime/components/input/radioset/radioset.styles.js +1 -0
- app-rn-runtime/components/input/radioset/radioset.styles.js.map +1 -1
- app-rn-runtime/components/input/select/select.component.js +23 -9
- app-rn-runtime/components/input/select/select.component.js.map +1 -1
- app-rn-runtime/components/input/switch/switch.component.js +2 -2
- app-rn-runtime/components/input/switch/switch.component.js.map +1 -1
- app-rn-runtime/components/input/text/text.component.js +21 -0
- app-rn-runtime/components/input/text/text.component.js.map +1 -1
- app-rn-runtime/components/input/text/text.props.js +2 -0
- app-rn-runtime/components/input/text/text.props.js.map +1 -1
- app-rn-runtime/components/input/text/text.styles.js.map +1 -1
- app-rn-runtime/components/input/textarea/textarea.component.js +21 -0
- app-rn-runtime/components/input/textarea/textarea.component.js.map +1 -1
- app-rn-runtime/components/input/textarea/textarea.props.js +2 -0
- app-rn-runtime/components/input/textarea/textarea.props.js.map +1 -1
- app-rn-runtime/components/input/toggle/toggle.component.js +2 -4
- app-rn-runtime/components/input/toggle/toggle.component.js.map +1 -1
- app-rn-runtime/components/navigation/appnavbar/appnavbar.component.js +2 -2
- app-rn-runtime/components/navigation/appnavbar/appnavbar.component.js.map +1 -1
- app-rn-runtime/components/navigation/basenav/basenav.component.js.map +1 -1
- app-rn-runtime/components/navigation/navitem/navitem.component.js +2 -3
- app-rn-runtime/components/navigation/navitem/navitem.component.js.map +1 -1
- app-rn-runtime/components/navigation/popover/popover.component.js.map +1 -1
- app-rn-runtime/components/page/content/content.component.js +19 -4
- app-rn-runtime/components/page/content/content.component.js.map +1 -1
- app-rn-runtime/components/page/page-content/page-content.component.js +27 -2
- app-rn-runtime/components/page/page-content/page-content.component.js.map +1 -1
- app-rn-runtime/components/page/page-content/page-content.props.js +2 -2
- app-rn-runtime/components/page/page-content/page-content.props.js.map +1 -1
- app-rn-runtime/components/page/page-content/page-content.styles.js +6 -1
- app-rn-runtime/components/page/page-content/page-content.styles.js.map +1 -1
- app-rn-runtime/components/page/page.component.js.map +1 -1
- app-rn-runtime/components/page/page.props.js.map +1 -1
- app-rn-runtime/components/page/page.styles.js +7 -1
- app-rn-runtime/components/page/page.styles.js.map +1 -1
- app-rn-runtime/components/page/partial/partial.component.js +27 -1
- app-rn-runtime/components/page/partial/partial.component.js.map +1 -1
- app-rn-runtime/components/page/partial/partial.props.js.map +1 -1
- app-rn-runtime/components/page/partial/partial.styles.js +6 -1
- app-rn-runtime/components/page/partial/partial.styles.js.map +1 -1
- app-rn-runtime/components/page/tabbar/curve.js.map +1 -1
- app-rn-runtime/components/page/tabbar/tabbar.component.js.map +1 -1
- app-rn-runtime/components/page/tabbar/tabbar.props.js +1 -0
- app-rn-runtime/components/page/tabbar/tabbar.props.js.map +1 -1
- app-rn-runtime/components/prefab/prefab-container.component.js +27 -1
- app-rn-runtime/components/prefab/prefab-container.component.js.map +1 -1
- app-rn-runtime/components/prefab/prefab-container.props.js.map +1 -1
- app-rn-runtime/components/prefab/prefab-container.styles.js +6 -1
- app-rn-runtime/components/prefab/prefab-container.styles.js.map +1 -1
- app-rn-runtime/core/base.component.js +5 -3
- app-rn-runtime/core/base.component.js.map +1 -1
- app-rn-runtime/core/components/textinput.component.js +4 -3
- app-rn-runtime/core/components/textinput.component.js.map +1 -1
- app-rn-runtime/core/formatters.js.map +1 -1
- app-rn-runtime/core/key.extractor.js.map +1 -1
- app-rn-runtime/core/props.provider.js +4 -1
- app-rn-runtime/core/props.provider.js.map +1 -1
- app-rn-runtime/core/storage.service.js.map +1 -1
- app-rn-runtime/core/tappable.component.js +34 -27
- app-rn-runtime/core/tappable.component.js.map +1 -1
- app-rn-runtime/core/ui-preferences.context.js +7 -0
- app-rn-runtime/core/ui-preferences.context.js.map +1 -0
- app-rn-runtime/core/utils.js +87 -4
- app-rn-runtime/core/utils.js.map +1 -1
- app-rn-runtime/package.json +30 -7
- app-rn-runtime/runtime/App.js +4 -8
- app-rn-runtime/runtime/App.js.map +1 -1
- app-rn-runtime/runtime/App.navigator.js.map +1 -1
- app-rn-runtime/runtime/base-fragment.component.js +43 -13
- app-rn-runtime/runtime/base-fragment.component.js.map +1 -1
- app-rn-runtime/runtime/base-page.component.js.map +1 -1
- app-rn-runtime/runtime/base-partial.component.js.map +1 -1
- app-rn-runtime/runtime/base-prefab.component.js.map +1 -1
- app-rn-runtime/runtime/navigator/stack.navigator.js.map +1 -1
- app-rn-runtime/runtime/services/app-i18n.service.js +10 -0
- app-rn-runtime/runtime/services/app-i18n.service.js.map +1 -1
- app-rn-runtime/runtime/services/app-security.service.js +42 -2
- app-rn-runtime/runtime/services/app-security.service.js.map +1 -1
- app-rn-runtime/runtime/services/app-spinner.service.js +1 -1
- app-rn-runtime/runtime/services/app-spinner.service.js.map +1 -1
- app-rn-runtime/runtime/services/webprocess.service.js.map +1 -1
- app-rn-runtime/runtime/watcher.js.map +1 -1
- app-rn-runtime/styles/background.component.js +1 -0
- app-rn-runtime/styles/background.component.js.map +1 -1
- app-rn-runtime/styles/style-prop.validator.js.map +1 -1
- app-rn-runtime/styles/theme.js +5 -0
- app-rn-runtime/styles/theme.js.map +1 -1
- app-rn-runtime/styles/theme.variables.js +1 -0
- app-rn-runtime/styles/theme.variables.js.map +1 -1
- app-rn-runtime/variables/base-variable.js.map +1 -1
- app-rn-runtime/variables/device/file/upload-file.operation.js.map +1 -1
- app-rn-runtime/variables/device-variable.js.map +1 -1
- app-rn-runtime/variables/service-variable.js.map +1 -1
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["React","View","BaseComponent","BaseComponentState","WmCardContentProps","DEFAULT_CLASS","WmCardContentState","constructor","args","_defineProperty","WmCardContent","props","onPartialLoad","invokeEventCallback","renderContent","renderPartial","state","isPartialLoaded","setTimeout","updateState","bind","children","renderWidget","
|
1
|
+
{"version":3,"names":["React","View","BaseComponent","BaseComponentState","WmCardContentProps","DEFAULT_CLASS","WmCardContentState","constructor","args","_defineProperty","WmCardContent","props","onPartialLoad","invokeEventCallback","renderContent","renderPartial","state","isPartialLoaded","setTimeout","updateState","bind","children","renderWidget","styles","_showSkeleton","root","skeleton","createElement","style","_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(props, this.onPartialLoad.bind(this));\n }\n return props.children;\n }\n\n renderWidget(props: WmCardContentProps) {\n const styles = this._showSkeleton ? {\n ...this.styles.root,\n ...this.styles.skeleton.root\n } : this.styles.root\n\n return (<View style={styles}>{!this._showSkeleton ? this._background : null}{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;EAAAI,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAC,eAAA,0BAC3D,KAAK;EAAA;AACzB;AAEA,eAAe,MAAMC,aAAa,SAASR,aAAa,CAA8D;EAEpHK,WAAWA,CAACI,KAAyB,EAAE;IACrC,KAAK,CAACA,KAAK,EAAEN,aAAa,EAAE,IAAID,kBAAkB,CAAC,CAAC,CAAC;EACvD;EAEAQ,aAAaA,CAAA,EAAG;IACd,IAAI,CAACC,mBAAmB,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;EAClD;EAEAC,aAAaA,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,CAAuB,CAAC;QAC1B,CAAC,CAAC;MACJ;MACA,OAAON,KAAK,CAACI,aAAa,CAACJ,KAAK,EAAE,IAAI,CAACC,aAAa,CAACQ,IAAI,CAAC,IAAI,CAAC,CAAC;IAClE;IACA,OAAOT,KAAK,CAACU,QAAQ;EACvB;EAEAC,YAAYA,CAACX,KAAyB,EAAE;IACtC,MAAMY,MAAM,GAAG,IAAI,CAACC,aAAa,GAAG;MAClC,GAAG,IAAI,CAACD,MAAM,CAACE,IAAI;MACnB,GAAG,IAAI,CAACF,MAAM,CAACG,QAAQ,CAACD;IAC1B,CAAC,GAAG,IAAI,CAACF,MAAM,CAACE,IAAI;IAEpB,oBAAQzB,KAAA,CAAA2B,aAAA,CAAC1B,IAAI;MAAC2B,KAAK,EAAEL;IAAO,GAAE,CAAC,IAAI,CAACC,aAAa,GAAG,IAAI,CAACK,WAAW,GAAG,IAAI,EAAE,IAAI,CAACf,aAAa,CAACH,KAAK,CAAQ,CAAC;EAChH;AACF","ignoreList":[]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["BASE_THEME","defineStyles","DEFAULT_CLASS","registerStyle","themeVariables","addStyle","defaultStyles","root","backgroundColor","cardContentBgColor","padding","text"],"sources":["card-content.styles.ts"],"sourcesContent":["import BASE_THEME from '@wavemaker/app-rn-runtime/styles/theme';\nimport { BaseStyles, defineStyles } from '@wavemaker/app-rn-runtime/core/base.component';\n\nexport type WmCardContentStyles = BaseStyles & {};\n\nexport const DEFAULT_CLASS = 'app-card-content';\nBASE_THEME.registerStyle((themeVariables, addStyle) => {\n const defaultStyles: WmCardContentStyles = defineStyles({\n root: {\n backgroundColor: themeVariables.cardContentBgColor,\n padding: 8\n },\n text: {}\n });\n
|
1
|
+
{"version":3,"names":["BASE_THEME","defineStyles","DEFAULT_CLASS","registerStyle","themeVariables","addStyle","defaultStyles","root","backgroundColor","cardContentBgColor","padding","text","skeleton"],"sources":["card-content.styles.ts"],"sourcesContent":["import BASE_THEME from '@wavemaker/app-rn-runtime/styles/theme';\nimport { BaseStyles, defineStyles } from '@wavemaker/app-rn-runtime/core/base.component';\nimport { WmSkeletonStyles } from '@wavemaker/app-rn-runtime/components/basic/skeleton/skeleton.styles';\n\nexport type WmCardContentStyles = BaseStyles & {\n skeleton: WmSkeletonStyles\n};\n\nexport const DEFAULT_CLASS = 'app-card-content';\nBASE_THEME.registerStyle((themeVariables, addStyle) => {\n const defaultStyles: WmCardContentStyles = defineStyles({\n root: {\n backgroundColor: themeVariables.cardContentBgColor,\n padding: 8\n },\n text: {},\n skeleton: {\n root: {\n }\n } as any as WmSkeletonStyles\n });\n addStyle(DEFAULT_CLASS, '', defaultStyles);\n});"],"mappings":"AAAA,OAAOA,UAAU,MAAM,wCAAwC;AAC/D,SAAqBC,YAAY,QAAQ,+CAA+C;AAOxF,OAAO,MAAMC,aAAa,GAAG,kBAAkB;AAC/CF,UAAU,CAACG,aAAa,CAAC,CAACC,cAAc,EAAEC,QAAQ,KAAK;EACnD,MAAMC,aAAkC,GAAGL,YAAY,CAAC;IACpDM,IAAI,EAAE;MACFC,eAAe,EAAEJ,cAAc,CAACK,kBAAkB;MAClDC,OAAO,EAAE;IACb,CAAC;IACDC,IAAI,EAAE,CAAC,CAAC;IACRC,QAAQ,EAAE;MACNL,IAAI,EAAE,CACN;IACJ;EACJ,CAAC,CAAC;EACFF,QAAQ,CAACH,aAAa,EAAE,EAAE,EAAEI,aAAa,CAAC;AAC9C,CAAC,CAAC","ignoreList":[]}
|
@@ -9,6 +9,7 @@ import { Tappable } from '@wavemaker/app-rn-runtime/core/tappable.component';
|
|
9
9
|
import WmPicture from '@wavemaker/app-rn-runtime/components/basic/picture/picture.component';
|
10
10
|
import WmCardProps from './card.props';
|
11
11
|
import { DEFAULT_CLASS } from './card.styles';
|
12
|
+
import { createSkeleton } from '@wavemaker/app-rn-runtime/components/basic/skeleton/skeleton.component';
|
12
13
|
export class WmCardState extends BaseComponentState {}
|
13
14
|
export default class WmCard extends BaseComponent {
|
14
15
|
constructor(props) {
|
@@ -57,6 +58,23 @@ export default class WmCard extends BaseComponent {
|
|
57
58
|
}, this.styles.picture)
|
58
59
|
}));
|
59
60
|
}
|
61
|
+
renderSkeleton(props) {
|
62
|
+
if (!props.showskeletonchildren) {
|
63
|
+
var _this$props;
|
64
|
+
const skeletonStyles = ((_this$props = this.props) === null || _this$props === void 0 || (_this$props = _this$props.styles) === null || _this$props === void 0 ? void 0 : _this$props.skeleton) || {
|
65
|
+
root: {},
|
66
|
+
text: {}
|
67
|
+
};
|
68
|
+
return createSkeleton(this.theme, skeletonStyles, {
|
69
|
+
...this.styles.root
|
70
|
+
}, /*#__PURE__*/React.createElement(View, {
|
71
|
+
style: [this.styles.root, {
|
72
|
+
opacity: 0
|
73
|
+
}]
|
74
|
+
}, props.children));
|
75
|
+
}
|
76
|
+
return null;
|
77
|
+
}
|
60
78
|
renderWidget(props) {
|
61
79
|
return /*#__PURE__*/React.createElement(View, {
|
62
80
|
style: this.styles.root
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["React","View","BaseComponent","BaseComponentState","WmLabel","WmMenu","WmIcon","Tappable","WmPicture","WmCardProps","DEFAULT_CLASS","WmCardState","WmCard","constructor","props","renderHeader","createElement","style","flexDirection","iconclass","title","subheading","actions","styles","heading","iconurl","cardIcon","iconheight","iconmargin","iconwidth","flex","caption","dataset","itemlabel","itemlink","itemicon","itembadge","isactive","itemchildren","picturesource","theme","mergeStyle","root","height","imageheight","picture","renderWidget","_background","_extends","getTestPropsForAction","target","width"
|
1
|
+
{"version":3,"names":["React","View","BaseComponent","BaseComponentState","WmLabel","WmMenu","WmIcon","Tappable","WmPicture","WmCardProps","DEFAULT_CLASS","createSkeleton","WmCardState","WmCard","constructor","props","renderHeader","createElement","style","flexDirection","iconclass","title","subheading","actions","styles","heading","iconurl","cardIcon","iconheight","iconmargin","iconwidth","flex","caption","dataset","itemlabel","itemlink","itemicon","itembadge","isactive","itemchildren","picturesource","theme","mergeStyle","root","height","imageheight","picture","renderSkeleton","showskeletonchildren","_this$props","skeletonStyles","skeleton","text","opacity","children","renderWidget","_background","_extends","getTestPropsForAction","target","width"],"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';\nimport { WmSkeletonStyles } from '@wavemaker/app-rn-runtime/components/basic/skeleton/skeleton.styles';\nimport { createSkeleton } from '@wavemaker/app-rn-runtime/components/basic/skeleton/skeleton.component';\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 {props.iconclass || props.iconurl ? \n <WmIcon styles={this.styles.cardIcon}\n iconclass={props.iconclass}\n iconurl={props.iconurl}\n iconheight={props.iconheight}\n iconmargin={props.iconmargin}\n iconwidth={props.iconwidth}\n /> : null} \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 public renderSkeleton(props: WmCardProps): React.ReactNode {\n if(!props.showskeletonchildren) {\n const skeletonStyles: WmSkeletonStyles = this.props?.styles?.skeleton || { root: {}, text: {} } as WmSkeletonStyles\n return createSkeleton(this.theme, skeletonStyles, {\n ...this.styles.root\n }, (<View style={[this.styles.root, { opacity: 0 }]}>\n {props.children}\n </View>))\n }\n return null;\n }\n\n renderWidget(props: WmCardProps) {\n return (\n <View style={this.styles.root}>\n {this._background}\n <Tappable {...this.getTestPropsForAction()} 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,SAASC,cAAc,QAAQ,wEAAwE;AAEvG,OAAO,MAAMC,WAAW,SAAST,kBAAkB,CAAc;AAEjE,eAAe,MAAMU,MAAM,SAASX,aAAa,CAAyC;EAExFY,WAAWA,CAACC,KAAkB,EAAE;IAC9B,KAAK,CAACA,KAAK,EAAEL,aAAa,EAAE,IAAID,WAAW,CAAC,CAAC,CAAC;EAChD;EAEAO,YAAYA,CAACD,KAAkB,EAAE;IAC/B,oBACEf,KAAA,CAAAiB,aAAA,CAAChB,IAAI;MAACiB,KAAK,EAAE;QAACC,aAAa,EAAE;MAAK;IA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IAAI,CAACa,WAAW,eACjBxD,KAAA,CAAAiB,aAAA,CAACV,QAAQ,EAAAkD,QAAA,KAAK,IAAI,CAACC,qBAAqB,CAAC,CAAC;MAAEC,MAAM,EAAE,IAAK;MAACnC,MAAM,EAAE;QAACoC,KAAK,EAAE,MAAM;QAAEhB,MAAM,EAAE,IAAI,CAACpB,MAAM,CAACmB,IAAI,CAACC,MAAM,GAAG,MAAM,GAAG;MAAI;IAAE,IAC9H,IAAI,CAAC5B,YAAY,CAACD,KAAK,CAAC,EACxBA,KAAK,CAACuC,QACD,CACN,CAAC;EACX;AACF","ignoreList":[]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["BASE_THEME","defineStyles","DEFAULT_CLASS","registerStyle","themeVariables","addStyle","defaultStyles","root","width","text","cardIcon","marginTop","marginRight","heading","paddingTop","paddingBottom","paddingLeft","paddingRight","backgroundColor","cardHeaderBgColor","flexDirection","alignContent","title","fontSize","lineHeight","color","cardTitleColor","subheading","cardSubTitleColor","picture"],"sources":["card.styles.ts"],"sourcesContent":["import BASE_THEME, { AllStyle } from '@wavemaker/app-rn-runtime/styles/theme';\nimport { BaseStyles, defineStyles } from '@wavemaker/app-rn-runtime/core/base.component';\nimport { WmPictureStyles } from '@wavemaker/app-rn-runtime/components/basic/picture/picture.styles';\nimport { WmIconStyles } from '@wavemaker/app-rn-runtime/components/basic/icon/icon.styles';\nimport { WmLabelStyles } from '@wavemaker/app-rn-runtime/components/basic/label/label.styles';\n\nexport type WmCardStyles = BaseStyles & {\n heading: AllStyle,\n cardIcon: WmIconStyles,\n title: WmLabelStyles,\n subheading: WmLabelStyles,\n picture: WmPictureStyles\n};\n\nexport const DEFAULT_CLASS = 'app-card';\nBASE_THEME.registerStyle((themeVariables, addStyle) => {\n const defaultStyles: WmCardStyles = defineStyles({\n root: {\n width: '100%',\n },\n text: {},\n cardIcon: {\n root: {\n marginTop: 4,\n marginRight: 8\n }\n } as WmIconStyles,\n heading : {\n paddingTop: 8,\n paddingBottom: 8,\n paddingLeft: 8,\n paddingRight: 8,\n backgroundColor: themeVariables.cardHeaderBgColor,\n flexDirection: 'row',\n alignContent: 'center',\n width: '100%'\n },\n title: {\n text: {\n fontSize: 16,\n lineHeight: 24,\n color: themeVariables.cardTitleColor\n }\n } as WmLabelStyles,\n subheading: {\n text: {\n fontSize: 12,\n lineHeight: 18,\n color: themeVariables.cardSubTitleColor\n }\n } as WmLabelStyles,\n picture: {\n root : {\n width: '100%'\n }\n } as any as WmPictureStyles\n });\n\n addStyle(DEFAULT_CLASS, '', defaultStyles);\n});"],"mappings":"AAAA,OAAOA,UAAU,MAAoB,wCAAwC;AAC7E,SAAqBC,YAAY,QAAQ,+CAA+C;
|
1
|
+
{"version":3,"names":["BASE_THEME","defineStyles","DEFAULT_CLASS","registerStyle","themeVariables","addStyle","defaultStyles","root","width","text","cardIcon","marginTop","marginRight","heading","paddingTop","paddingBottom","paddingLeft","paddingRight","backgroundColor","cardHeaderBgColor","flexDirection","alignContent","title","fontSize","lineHeight","color","cardTitleColor","subheading","cardSubTitleColor","picture","skeleton"],"sources":["card.styles.ts"],"sourcesContent":["import BASE_THEME, { AllStyle } from '@wavemaker/app-rn-runtime/styles/theme';\nimport { BaseStyles, defineStyles } from '@wavemaker/app-rn-runtime/core/base.component';\nimport { WmPictureStyles } from '@wavemaker/app-rn-runtime/components/basic/picture/picture.styles';\nimport { WmIconStyles } from '@wavemaker/app-rn-runtime/components/basic/icon/icon.styles';\nimport { WmLabelStyles } from '@wavemaker/app-rn-runtime/components/basic/label/label.styles';\nimport { WmSkeletonStyles } from '@wavemaker/app-rn-runtime/components/basic/skeleton/skeleton.styles';\n\nexport type WmCardStyles = BaseStyles & {\n heading: AllStyle,\n cardIcon: WmIconStyles,\n title: WmLabelStyles,\n subheading: WmLabelStyles,\n picture: WmPictureStyles,\n skeleton: WmSkeletonStyles\n};\n\nexport const DEFAULT_CLASS = 'app-card';\nBASE_THEME.registerStyle((themeVariables, addStyle) => {\n const defaultStyles: WmCardStyles = defineStyles({\n root: {\n width: '100%',\n },\n text: {},\n cardIcon: {\n root: {\n marginTop: 4,\n marginRight: 8\n }\n } as WmIconStyles,\n heading : {\n paddingTop: 8,\n paddingBottom: 8,\n paddingLeft: 8,\n paddingRight: 8,\n backgroundColor: themeVariables.cardHeaderBgColor,\n flexDirection: 'row',\n alignContent: 'center',\n width: '100%'\n },\n title: {\n text: {\n fontSize: 16,\n lineHeight: 24,\n color: themeVariables.cardTitleColor\n }\n } as WmLabelStyles,\n subheading: {\n text: {\n fontSize: 12,\n lineHeight: 18,\n color: themeVariables.cardSubTitleColor\n }\n } as WmLabelStyles,\n picture: {\n root : {\n width: '100%'\n }\n } as any as WmPictureStyles,\n skeleton: {\n root: {\n }\n } as any as WmSkeletonStyles\n });\n\n addStyle(DEFAULT_CLASS, '', defaultStyles);\n});"],"mappings":"AAAA,OAAOA,UAAU,MAAoB,wCAAwC;AAC7E,SAAqBC,YAAY,QAAQ,+CAA+C;AAexF,OAAO,MAAMC,aAAa,GAAG,UAAU;AACvCF,UAAU,CAACG,aAAa,CAAC,CAACC,cAAc,EAAEC,QAAQ,KAAK;EACnD,MAAMC,aAA2B,GAAGL,YAAY,CAAC;IAC7CM,IAAI,EAAE;MACFC,KAAK,EAAE;IACX,CAAC;IACDC,IAAI,EAAE,CAAC,CAAC;IACRC,QAAQ,EAAE;MACNH,IAAI,EAAE;QACFI,SAAS,EAAE,CAAC;QACZC,WAAW,EAAE;MACjB;IACJ,CAAiB;IACjBC,OAAO,EAAG;MACNC,UAAU,EAAE,CAAC;MACbC,aAAa,EAAE,CAAC;MAChBC,WAAW,EAAE,CAAC;MACdC,YAAY,EAAE,CAAC;MACfC,eAAe,EAAEd,cAAc,CAACe,iBAAiB;MACjDC,aAAa,EAAE,KAAK;MACpBC,YAAY,EAAE,QAAQ;MACtBb,KAAK,EAAE;IACX,CAAC;IACDc,KAAK,EAAE;MACHb,IAAI,EAAE;QACFc,QAAQ,EAAE,EAAE;QACZC,UAAU,EAAE,EAAE;QACdC,KAAK,EAAErB,cAAc,CAACsB;MAC1B;IACJ,CAAkB;IAClBC,UAAU,EAAE;MACRlB,IAAI,EAAE;QACFc,QAAQ,EAAE,EAAE;QACZC,UAAU,EAAE,EAAE;QACdC,KAAK,EAAErB,cAAc,CAACwB;MAC1B;IACJ,CAAkB;IAClBC,OAAO,EAAE;MACLtB,IAAI,EAAG;QACHC,KAAK,EAAE;MACX;IACJ,CAA2B;IAC3BsB,QAAQ,EAAE;MACNvB,IAAI,EAAE,CACN;IACJ;EACJ,CAAC,CAAC;EAEFF,QAAQ,CAACH,aAAa,EAAE,EAAE,EAAEI,aAAa,CAAC;AAC9C,CAAC,CAAC","ignoreList":[]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["React","Text","View","BaseComponent","BaseComponentState","isEqual","isNil","get","find","cloneDeep","forEach","keys","WmFormFieldProps","DEFAULT_CLASS","PERFORMANCE_LOGGER","WmFormFieldState","constructor","args","_defineProperty","WmFormField","props","form","formScope","componentDidMount","_this$form","_this$form2","_this$form3","formwidget","formKey","formWidgets","name","registerFormFields","formFields","onFieldChangeEvt","$new","$old","isDefault","notifyChanges","updateState","datavalue","invokeEventCallback","undefined","validateFormField","updateDataOutput","call","observeOn","fields","field","formfield","f","proxy","notifyForFields","push","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","updateFormWidgetDataset","res","displayField","dataset","data","datafield","displayfield","state","msg","isValid","validationmessage","onPropertyChange","debug","applyDefaultValue","setPrimaryKey","setReadOnlyState","updateMode","_this$formwidget","readonly","_this$formwidget2","_this$_syncValidators","_this$formwidget3","errorType","errormsg","errorMessage","renderWidget","childrenWithProps","Children","map","renderFormFields","children","child","cloneElement","maskchar","displayformat","invokeEvent","triggerValidation","onFieldChange","formRef","placeholder","createElement","style","styles","root","_background","_extends","getTestPropsForLabel","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, isNil, 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 if (!this.form) {\n this.form = props.formScope && props.formScope();\n }\n }\n\n componentDidMount() {\n super.componentDidMount();\n this.formwidget = (this.props.formKey && this.form?.formWidgets[this.props.formKey])\n || (this.props.name && this.form?.formWidgets[this.props.name]);\n this.form?.registerFormFields(this.form.formFields, this.form.formWidgets);\n }\n\n onFieldChangeEvt(name: string, $new: any, $old: any, isDefault: boolean) {\n this.notifyChanges();\n if (!isEqual($old, $new)) {\n this.updateState({ props: { datavalue: $new }} as WmFormFieldState, () => {\n !isDefault && this.invokeEventCallback('onChange', [undefined, this, $new, $old]);\n this.validateFormField();\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 updateFormWidgetDataset(res: any, displayField: string) {\n this.formwidget.updateState({\n props: {\n dataset: res.data,\n datafield: 'All Fields',\n displayfield: this.formwidget.state.props.displayfield || displayField,\n }\n } as WmFormFieldState);\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 case 'primary-key':\n if ($new) {\n this.form.setPrimaryKey(this.props.name);\n }\n break;\n }\n }\n\n setReadOnlyState(updateMode: any) {\n this.formwidget?.updateState({\n props: {\n readonly: !updateMode,\n }\n } as WmFormFieldState);\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 get value(){\n return this.state.props.datavalue;\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 value: this.value,\n isValid: this.state.isValid,\n maskchar: props.maskchar,\n displayformat: props.displayformat,\n invokeEvent: this.invokeEventCallback.bind(this),\n triggerValidation: this.validateFormField.bind(this),\n onFieldChange: this.onFieldChangeEvt.bind(this),\n formRef: props.formRef,\n ...(!isNil(props?.placeholder) ? { placeholder: props.placeholder } : {})\n });\n });\n return (\n <View style={this.styles.root}>{this._background}{childrenWithProps}\n {this.state.isValid === false && <Text {...this.getTestPropsForLabel('error_msg')} 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,KAAK,EAAEC,GAAG,EAAEC,IAAI,EAAEC,SAAS,EAAEC,OAAO,EAAEC,IAAI,QAAQ,QAAQ;AAE5E,OAAOC,gBAAgB,MAAM,oBAAoB;AACjD,SAASC,aAAa,QAA2B,qBAAqB;AACtE,SAAQC,kBAAkB,QAAO,uCAAuC;AAExE,OAAO,MAAMC,gBAAgB,SAASX,kBAAkB,CAAmB;EAAAY,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAC,eAAA,kBAC/D,IAAI;EAAA;AAChB;AAEA,eAAe,MAAMC,WAAW,SAAShB,aAAa,CAAwD;EAO5Ga,WAAWA,CAACI,KAAuB,EAAE;IACnC,KAAK,CAACA,KAAK,EAAEP,aAAa,EAAE,IAAID,gBAAgB,CAAC,CAAC,EAAE,IAAIG,gBAAgB,CAAC,CAAC,CAAC;IAACG,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA,mCAJvC,EAAE;IAAAA,eAAA,0BACV,EAAE;IAAAA,eAAA;IAI/B,IAAI,CAAC,IAAI,CAACG,IAAI,EAAE;MACd,IAAI,CAACA,IAAI,GAAGD,KAAK,CAACE,SAAS,IAAIF,KAAK,CAACE,SAA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,KAAK,EAAE,IAAI,CAACA,KAAK;QACjBW,OAAO,EAAE,IAAI,CAACF,KAAK,CAACE,OAAO;QAC3BwB,QAAQ,EAAE/F,KAAK,CAAC+F,QAAQ;QACxBC,aAAa,EAAEhG,KAAK,CAACgG,aAAa;QAClCC,WAAW,EAAE,IAAI,CAAC7E,mBAAmB,CAACqB,IAAI,CAAC,IAAI,CAAC;QAChDyD,iBAAiB,EAAE,IAAI,CAAC5E,iBAAiB,CAACmB,IAAI,CAAC,IAAI,CAAC;QACpD0D,aAAa,EAAE,IAAI,CAACtF,gBAAgB,CAAC4B,IAAI,CAAC,IAAI,CAAC;QAC/C2D,OAAO,EAAEpG,KAAK,CAACoG,OAAO;QACtB,IAAI,CAAClH,KAAK,CAACc,KAAK,aAALA,KAAK,uBAALA,KAAK,CAAEqG,WAAW,CAAC,GAAG;UAAEA,WAAW,EAAErG,KAAK,CAACqG;QAAY,CAAC,GAAG,CAAC,CAAC;MACzE,CAAC,CAAC;IACP,CAAC,CAAC;IACF,oBACEzH,KAAA,CAAA0H,aAAA,CAACxH,IAAI;MAACyH,KAAK,EAAE,IAAI,CAACC,MAAM,CAACC;IAAK,GAAE,IAAI,CAACC,WAAW,EAAElB,iBAAiB,EAChE,IAAI,CAACnB,KAAK,CAACE,OAAO,KAAK,KAAK,iBAAI3F,KAAA,CAAA0H,aAAA,CAACzH,IAAI,EAAA8H,QAAA,KAAK,IAAI,CAACC,oBAAoB,CAAC,WAAW,CAAC;MAAEL,KAAK,EAAE,IAAI,CAACC,MAAM,CAACK;IAAS,IAAE7G,KAAK,CAACwE,iBAAwB,CAC3I,CAAC;EAEX;AACF","ignoreList":[]}
|
1
|
+
{"version":3,"names":["React","Text","View","BaseComponent","BaseComponentState","isEqual","isNil","get","find","cloneDeep","forEach","keys","WmFormFieldProps","DEFAULT_CLASS","PERFORMANCE_LOGGER","WmFormFieldState","constructor","args","_defineProperty","WmFormField","props","form","formScope","componentDidMount","_this$form","_this$form2","_this$form3","formwidget","formKey","formWidgets","name","registerFormFields","formFields","onFieldChangeEvt","$new","$old","isDefault","notifyChanges","updateState","datavalue","invokeEventCallback","undefined","validateFormField","updateDataOutput","call","observeOn","fields","field","formfield","f","proxy","notifyForFields","push","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","updateFormWidgetDataset","res","displayField","dataset","data","datafield","displayfield","state","msg","isValid","validationmessage","onPropertyChange","debug","applyDefaultValue","setPrimaryKey","setReadOnlyState","updateMode","_this$formwidget","readonly","_this$formwidget2","_this$_syncValidators","_this$formwidget3","errorType","errormsg","errorMessage","renderWidget","childrenWithProps","Children","map","renderFormFields","children","child","cloneElement","maskchar","displayformat","invokeEvent","triggerValidation","onFieldChange","formRef","placeholder","createElement","style","styles","root","_background","_extends","getTestPropsForLabel","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, isNil, 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 if (!this.form) {\n this.form = props.formScope && props.formScope();\n }\n }\n\n componentDidMount() {\n super.componentDidMount();\n this.formwidget = (this.props.formKey && this.form?.formWidgets[this.props.formKey])\n || (this.props.name && this.form?.formWidgets[this.props.name]);\n this.form?.registerFormFields(this.form.formFields, this.form.formWidgets);\n }\n\n onFieldChangeEvt(name: string, $new: any, $old: any, isDefault: boolean) {\n this.notifyChanges();\n if (!isEqual($old, $new)) {\n this.updateState({ props: { datavalue: $new }} as WmFormFieldState, () => {\n !isDefault && this.invokeEventCallback('onChange', [undefined, this, $new, $old]);\n this.validateFormField();\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 updateFormWidgetDataset(res: any, displayField: string) {\n this.formwidget.updateState({\n props: {\n dataset: res.data,\n datafield: 'All Fields',\n displayfield: this.formwidget.state.props.displayfield || displayField,\n }\n } as WmFormFieldState);\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 case 'primary-key':\n if ($new) {\n this.form.setPrimaryKey(this.props.name);\n }\n break;\n }\n }\n\n setReadOnlyState(updateMode: any) {\n this.formwidget?.updateState({\n props: {\n readonly: !updateMode,\n }\n } as WmFormFieldState);\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 get value(){\n return this.state.props.datavalue;\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 value: this.value,\n isValid: this.state.isValid,\n maskchar: props.maskchar,\n displayformat: props.displayformat,\n invokeEvent: this.invokeEventCallback.bind(this),\n triggerValidation: this.validateFormField.bind(this),\n onFieldChange: this.onFieldChangeEvt.bind(this),\n formRef: props.formRef,\n ...(!isNil(props?.placeholder) ? { placeholder: props.placeholder } : {})\n });\n });\n return (\n <View style={this.styles.root}>{this._background}{childrenWithProps}\n {this.state.isValid === false && <Text {...this.getTestPropsForLabel('error_msg')} 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,KAAK,EAAEC,GAAG,EAAEC,IAAI,EAAEC,SAAS,EAAEC,OAAO,EAAEC,IAAI,QAAQ,QAAQ;AAE5E,OAAOC,gBAAgB,MAAM,oBAAoB;AACjD,SAASC,aAAa,QAA2B,qBAAqB;AACtE,SAAQC,kBAA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I;MAACyH,KAAK,EAAE,IAAI,CAACC,MAAM,CAACC;IAAK,GAAE,IAAI,CAACC,WAAW,EAAElB,iBAAiB,EAChE,IAAI,CAACnB,KAAK,CAACE,OAAO,KAAK,KAAK,iBAAI3F,KAAA,CAAA0H,aAAA,CAACzH,IAAI,EAAA8H,QAAA,KAAK,IAAI,CAACC,oBAAoB,CAAC,WAAW,CAAC;MAAEL,KAAK,EAAE,IAAI,CAACC,MAAM,CAACK;IAAS,IAAE7G,KAAK,CAACwE,iBAAwB,CAC3I,CAAC;EAEX;AACF","ignoreList":[]}
|
@@ -355,7 +355,7 @@ export default class WmForm extends BaseComponent {
|
|
355
355
|
dataoutput: current
|
356
356
|
}
|
357
357
|
});
|
358
|
-
this.parentFormRef && this.parentFormRef.updateDataOutput(undefined, this.formdataoutput);
|
358
|
+
this.parentFormRef && this.parentFormRef.updateDataOutput && this.parentFormRef.updateDataOutput(undefined, this.formdataoutput);
|
359
359
|
this.updateState({
|
360
360
|
props: {
|
361
361
|
dataoutput: this.formdataoutput
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["React","View","BaseComponent","BaseComponentState","isDefined","debounce","find","forEach","isNil","get","set","cloneDeep","isEmpty","WmLabel","WmIcon","WmMessage","ToastConsumer","WmFormProps","DEFAULT_CLASS","isDataSetWidget","WmFormState","constructor","args","_defineProperty","WmForm","props","handleSubmit","componentDidMount","getParentFormRef","parentForm","pformName","current","parent","parentFormRef","setReadonlyFields","_this$formFields","formFields","field","setReadOnlyState","state","isUpdateMode","setReadonlyState","updateMode","updateState","setTimeout","showActions","edit","new","cancel","delete","registerFormFields","formWidgets","w","form","formwidget","formKey","name","f","formfields","applyFormData","applyDefaultValue","formdataoutput","datavalue","dataoutput","_this$buttonArray","buttonArray","action","show","registerFormActions","formActions","_updateFieldOnDataSourceChange","isDataSetBound","widget","isRelated","relatedData","_this$parentFormRef","formData","formdata","formField","_formField$props","fw","key","setState","isDefault","updateFormFieldDefaultValue","dv","defaultvalue","_formField$props2","invokeEventCallback","bind","undefined","formreset","ff","defaultValue","id","_widget","isValid","reset","submit","_debouncedSubmitForm","generateFormFields","userFields","fields","metadata","data","onBeforerender","proxy","dynamicForm","generateComponent","onPropertyChange","$new","$old","_this$formFields2","setPrimaryKey","fieldName","primaryKey","indexOf","push","validateFieldsOnSubmit","val","onValidate","required","generator","msg","defaultValidatorMessages","validationmessage","validate","event","preventDefault","onBeforesubmit","formSubmit","onResultCb","error","response","status","onSuccess","postmessage","toggleMessage","onError","errormessage","updateDataOutput","Object","assign","type","message","messagelayout","showInlineMsg","toaster","showToast","placement","styles","bottom","text","hideOnClick","duration","onMsgClose","renderWidget","createElement","toastService","style","root","_background","iconclass","title","subheading","heading","flex","flexDirection","getTestId","listIcon","caption","accessibilityrole","hideclose","onClose","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, isNil, get, set, cloneDeep, isEmpty } 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';\nimport { isDataSetWidget } from '@wavemaker/app-rn-runtime/core/utils';\nimport WmFormAction, {\n WmFormActionState\n} from '@wavemaker/app-rn-runtime/components/data/form/form-action/form-action.component';\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 isUpdateMode: boolean = true;\n dynamicForm: any;\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 public formdataoutput: any;\n private toaster: any;\n public formActions: Array<WmFormAction> = [];\n primaryKey = [];\n buttonArray: Array<WmFormAction> = [];\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(), new WmFormState());\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 setReadonlyFields() {\n this.formFields?.forEach((field: any) => {\n field.setReadOnlyState(this.state.isUpdateMode);\n });\n }\n\n setReadonlyState(updateMode: any) {\n this.updateState({\n isUpdateMode: updateMode,\n } as WmFormState);\n setTimeout(() => {\n this.showActions();\n this.setReadonlyFields();\n }, 100);\n }\n\n edit() {\n this.setReadonlyState(true);\n }\n\n new() {\n this.setReadonlyState(true);\n }\n\n cancel() {\n this.setReadonlyState(false);\n }\n\n delete() { }\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.setReadonlyFields();\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 this.updateState({\n props: {\n dataoutput: this.formdataoutput\n }\n } as WmFormState);\n }\n }\n\n showActions () {\n this.buttonArray?.forEach((action: any) => {\n action.updateState({\n props: {\n show: action.updateMode === this.state.isUpdateMode\n }} as WmFormActionState);\n });\n }\n\n registerFormActions(formActions: Array<WmFormAction>) {\n this.buttonArray = formActions;\n this.showActions();\n }\n\n private _updateFieldOnDataSourceChange(field: WmFormField, formFields: Array<WmFormField>) {\n if (!field.state.props.isDataSetBound && isDataSetWidget(field.props.widget)) {\n if (field.state.props.isRelated) {\n field.updateState({\n props: {\n isDataSetBound: true\n }} as WmFormFieldState);\n this.props.relatedData && this.props.relatedData(field);\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 get dataoutput() {\n return this.formdataoutput;\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 this.formdataoutput = {};\n forEach(this.formFields, (ff: WmFormField) => {\n const defaultValue = isNil(ff.state.props.defaultvalue) ? '' : ff.state.props.defaultvalue;\n ff.updateState({\n props : {\n datavalue: defaultValue\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: defaultValue\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 // Function to generate and compile the form fields from the metadata\n generateFormFields() {\n let userFields;\n let fields = this.state.props.metadata ? this.state.props.metadata.data || this.state.props.metadata : [];\n\n if (isEmpty(fields)) {\n return;\n }\n\n if (this.props.onBeforerender) {\n userFields = this.invokeEventCallback('onBeforerender', [fields, this.proxy]);\n if (userFields) {\n fields = userFields;\n }\n }\n\n this.updateState({\n dynamicForm: this.props.generateComponent(fields, this.props.name)\n } as WmFormState);\n\n }\n\n onPropertyChange(name: string, $new: any, $old: any) {\n switch (name) {\n case 'formdata':\n if ($new) {\n this.applyFormData();\n }\n break;\n case 'defaultmode':\n this.updateState({\n isUpdateMode: $new && $new === 'Edit' ? true : false,\n } as WmFormState);\n break;\n case 'dataset':\n this.formFields?.forEach((w: WmFormField) => {\n this._updateFieldOnDataSourceChange(w, this.formFields);\n });\n break;\n case 'metadata':\n this.generateFormFields();\n break;\n }\n }\n setPrimaryKey(fieldName: string) {\n /*Store the primary key of data*/\n this.primaryKey = this.primaryKey || [];\n // @ts-ignore\n if (this.primaryKey.indexOf(fieldName) === -1) {\n // @ts-ignore\n this.primaryKey.push(fieldName);\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 && ((field?.props.primaryKey && field?.props.generator === 'assigned') || !field?.props.primaryKey)) {\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 = cloneDeep(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 this.updateState({\n props: {\n dataoutput: this.formdataoutput\n }\n } as WmFormState);\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 duration: 5000\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 id={this.getTestId('icon')} styles={this.styles.listIcon} iconclass={props.iconclass}></WmIcon>\n <View>\n <WmLabel id={this.getTestId('title')} styles={this.styles.title} caption={props.title} accessibilityrole='header'></WmLabel>\n <WmLabel id={this.getTestId('description')} 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 {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A6J,aAAA,CAAC9I,SAAS;QAACgI,IAAI,EAAE,IAAI,CAACxG,KAAK,CAACwG,IAAK;QAAC2B,OAAO,EAAE,IAAI,CAACnI,KAAK,CAACyG,OAAQ;QAAC4B,SAAS,EAAE,KAAM;QAACC,OAAO,EAAE,IAAI,CAAClB,UAAU,CAAClE,IAAI,CAAC,IAAI;MAAE,CAAY,CAAC,GAAG,IAAI,EAEnKhE,KAAK,CAAC8E,QAAQ,IAAI,IAAI,CAAChE,KAAK,CAACoE,WAAW,EACxClF,KAAK,CAACqJ,QACJ,CAAC;IACT,CAEa,CAAC;EAEpB;AACF","ignoreList":[]}
|
1
|
+
{"version":3,"names":["React","View","BaseComponent","BaseComponentState","isDefined","debounce","find","forEach","isNil","get","set","cloneDeep","isEmpty","WmLabel","WmIcon","WmMessage","ToastConsumer","WmFormProps","DEFAULT_CLASS","isDataSetWidget","WmFormState","constructor","args","_defineProperty","WmForm","props","handleSubmit","componentDidMount","getParentFormRef","parentForm","pformName","current","parent","parentFormRef","setReadonlyFields","_this$formFields","formFields","field","setReadOnlyState","state","isUpdateMode","setReadonlyState","updateMode","updateState","setTimeout","showActions","edit","new","cancel","delete","registerFormFields","formWidgets","w","form","formwidget","formKey","name","f","formfields","applyFormData","applyDefaultValue","formdataoutput","datavalue","dataoutput","_this$buttonArray","buttonArray","action","show","registerFormActions","formActions","_updateFieldOnDataSourceChange","isDataSetBound","widget","isRelated","relatedData","_this$parentFormRef","formData","formdata","formField","_formField$props","fw","key","setState","isDefault","updateFormFieldDefaultValue","dv","defaultvalue","_formField$props2","invokeEventCallback","bind","undefined","formreset","ff","defaultValue","id","_widget","isValid","reset","submit","_debouncedSubmitForm","generateFormFields","userFields","fields","metadata","data","onBeforerender","proxy","dynamicForm","generateComponent","onPropertyChange","$new","$old","_this$formFields2","setPrimaryKey","fieldName","primaryKey","indexOf","push","validateFieldsOnSubmit","val","onValidate","required","generator","msg","defaultValidatorMessages","validationmessage","validate","event","preventDefault","onBeforesubmit","formSubmit","onResultCb","error","response","status","onSuccess","postmessage","toggleMessage","onError","errormessage","updateDataOutput","Object","assign","type","message","messagelayout","showInlineMsg","toaster","showToast","placement","styles","bottom","text","hideOnClick","duration","onMsgClose","renderWidget","createElement","toastService","style","root","_background","iconclass","title","subheading","heading","flex","flexDirection","getTestId","listIcon","caption","accessibilityrole","hideclose","onClose","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, isNil, get, set, cloneDeep, isEmpty } 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 { isDataSetWidget } from '@wavemaker/app-rn-runtime/core/utils';\nimport WmFormAction, {\n WmFormActionState\n} from '@wavemaker/app-rn-runtime/components/data/form/form-action/form-action.component';\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 isUpdateMode: boolean = true;\n dynamicForm: any;\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 public formdataoutput: any;\n private toaster: any;\n public formActions: Array<WmFormAction> = [];\n primaryKey = [];\n buttonArray: Array<WmFormAction> = [];\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(), new WmFormState());\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 setReadonlyFields() {\n this.formFields?.forEach((field: any) => {\n field.setReadOnlyState(this.state.isUpdateMode);\n });\n }\n\n setReadonlyState(updateMode: any) {\n this.updateState({\n isUpdateMode: updateMode,\n } as WmFormState);\n setTimeout(() => {\n this.showActions();\n this.setReadonlyFields();\n }, 100);\n }\n\n edit() {\n this.setReadonlyState(true);\n }\n\n new() {\n this.setReadonlyState(true);\n }\n\n cancel() {\n this.setReadonlyState(false);\n }\n\n delete() { }\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.setReadonlyFields();\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 this.updateState({\n props: {\n dataoutput: this.formdataoutput\n }\n } as WmFormState);\n }\n }\n\n showActions () {\n this.buttonArray?.forEach((action: any) => {\n action.updateState({\n props: {\n show: action.updateMode === this.state.isUpdateMode\n }} as WmFormActionState);\n });\n }\n\n registerFormActions(formActions: Array<WmFormAction>) {\n this.buttonArray = formActions;\n this.showActions();\n }\n\n private _updateFieldOnDataSourceChange(field: WmFormField, formFields: Array<WmFormField>) {\n if (!field.state.props.isDataSetBound && isDataSetWidget(field.props.widget)) {\n if (field.state.props.isRelated) {\n field.updateState({\n props: {\n isDataSetBound: true\n }} as WmFormFieldState);\n this.props.relatedData && this.props.relatedData(field);\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 get dataoutput() {\n return this.formdataoutput;\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 this.formdataoutput = {};\n forEach(this.formFields, (ff: WmFormField) => {\n const defaultValue = isNil(ff.state.props.defaultvalue) ? '' : ff.state.props.defaultvalue;\n ff.updateState({\n props : {\n datavalue: defaultValue\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: defaultValue\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 // Function to generate and compile the form fields from the metadata\n generateFormFields() {\n let userFields;\n let fields = this.state.props.metadata ? this.state.props.metadata.data || this.state.props.metadata : [];\n\n if (isEmpty(fields)) {\n return;\n }\n\n if (this.props.onBeforerender) {\n userFields = this.invokeEventCallback('onBeforerender', [fields, this.proxy]);\n if (userFields) {\n fields = userFields;\n }\n }\n\n this.updateState({\n dynamicForm: this.props.generateComponent(fields, this.props.name)\n } as WmFormState);\n\n }\n\n onPropertyChange(name: string, $new: any, $old: any) {\n switch (name) {\n case 'formdata':\n if ($new) {\n this.applyFormData();\n }\n break;\n case 'defaultmode':\n this.updateState({\n isUpdateMode: $new && $new === 'Edit' ? true : false,\n } as WmFormState);\n break;\n case 'dataset':\n this.formFields?.forEach((w: WmFormField) => {\n this._updateFieldOnDataSourceChange(w, this.formFields);\n });\n break;\n case 'metadata':\n this.generateFormFields();\n break;\n }\n }\n setPrimaryKey(fieldName: string) {\n /*Store the primary key of data*/\n this.primaryKey = this.primaryKey || [];\n // @ts-ignore\n if (this.primaryKey.indexOf(fieldName) === -1) {\n // @ts-ignore\n this.primaryKey.push(fieldName);\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 && ((field?.props.primaryKey && field?.props.generator === 'assigned') || !field?.props.primaryKey)) {\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 = cloneDeep(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 && this.parentFormRef.updateDataOutput(undefined, this.formdataoutput);\n this.updateState({\n props: {\n dataoutput: this.formdataoutput\n }\n } as WmFormState);\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 duration: 5000\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 id={this.getTestId('icon')} styles={this.styles.listIcon} iconclass={props.iconclass}></WmIcon>\n <View>\n <WmLabel id={this.getTestId('title')} styles={this.styles.title} caption={props.title} accessibilityrole='header'></WmLabel>\n <WmLabel id={this.getTestId('description')} 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.metadata && this.state.dynamicForm }\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,KAAK,EAAEC,GAAG,EAAEC,GAAG,EAAEC,SAAS,EAAEC,OAA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CAAChE,KAAK,CAACoE,WAAW,EACxClF,KAAK,CAACqJ,QACJ,CAAC;IACT,CAEa,CAAC;EAEpB;AACF","ignoreList":[]}
|
@@ -25,6 +25,7 @@ export default class WmFormProps extends BaseProps {
|
|
25
25
|
_defineProperty(this, "onError", () => {});
|
26
26
|
_defineProperty(this, "onBeforerender", () => {});
|
27
27
|
_defineProperty(this, "generateComponent", metadata => {});
|
28
|
+
_defineProperty(this, "showinfoskeleton", false);
|
28
29
|
}
|
29
30
|
}
|
30
31
|
//# sourceMappingURL=form.props.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["BaseProps","WmFormProps","constructor","args","_defineProperty","metadata"],"sources":["form.props.ts"],"sourcesContent":["import { BaseProps } from '@wavemaker/app-rn-runtime/core/base.component';\n\nexport default class WmFormProps extends BaseProps {\n children: any;\n dataoutput: any;\n onBeforeservicecall: any;\n onBeforesubmit: any;\n formdata: any;\n parentForm: string = '';\n metadata: any;\n title: any;\n subheading: any;\n iconclass: any;\n postmessage: string = 'Data posted successfully';\n errormessage: string = 'An error occured. Please try again!';\n messagelayout: string = 'Inline';\n formSubmit: Function = () => {};\n formSuccess: Function = () => {};\n relatedData: Function = () => {};\n onSuccess: Function = () => {};\n onError: Function = () => {};\n onBeforerender: Function = () => {};\n generateComponent: Function = (metadata:any) => {};\n}\n"],"mappings":";;;AAAA,SAASA,SAAS,QAAQ,+CAA+C;AAEzE,eAAe,MAAMC,WAAW,SAASD,SAAS,CAAC;EAAAE,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAC,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA,qBAM5B,EAAE;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA,sBAKD,0BAA0B;IAAAA,eAAA,uBACzB,qCAAqC;IAAAA,eAAA,wBACpC,QAAQ;IAAAA,eAAA,qBACT,MAAM,CAAC,CAAC;IAAAA,eAAA,sBACP,MAAM,CAAC,CAAC;IAAAA,eAAA,sBACR,MAAM,CAAC,CAAC;IAAAA,eAAA,oBACV,MAAM,CAAC,CAAC;IAAAA,eAAA,kBACV,MAAM,CAAC,CAAC;IAAAA,eAAA,yBACD,MAAM,CAAC,CAAC;IAAAA,eAAA,4BACJC,QAAY,IAAK,CAAC,CAAC;EAAA;
|
1
|
+
{"version":3,"names":["BaseProps","WmFormProps","constructor","args","_defineProperty","metadata"],"sources":["form.props.ts"],"sourcesContent":["import { BaseProps } from '@wavemaker/app-rn-runtime/core/base.component';\n\nexport default class WmFormProps extends BaseProps {\n children: any;\n dataoutput: any;\n onBeforeservicecall: any;\n onBeforesubmit: any;\n formdata: any;\n parentForm: string = '';\n metadata: any;\n title: any;\n subheading: any;\n iconclass: any;\n postmessage: string = 'Data posted successfully';\n errormessage: string = 'An error occured. Please try again!';\n messagelayout: string = 'Inline';\n formSubmit: Function = () => {};\n formSuccess: Function = () => {};\n relatedData: Function = () => {};\n onSuccess: Function = () => {};\n onError: Function = () => {};\n onBeforerender: Function = () => {};\n generateComponent: Function = (metadata:any) => {};\n showinfoskeleton: boolean = false;\n}\n"],"mappings":";;;AAAA,SAASA,SAAS,QAAQ,+CAA+C;AAEzE,eAAe,MAAMC,WAAW,SAASD,SAAS,CAAC;EAAAE,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAC,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA,qBAM5B,EAAE;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA,sBAKD,0BAA0B;IAAAA,eAAA,uBACzB,qCAAqC;IAAAA,eAAA,wBACpC,QAAQ;IAAAA,eAAA,qBACT,MAAM,CAAC,CAAC;IAAAA,eAAA,sBACP,MAAM,CAAC,CAAC;IAAAA,eAAA,sBACR,MAAM,CAAC,CAAC;IAAAA,eAAA,oBACV,MAAM,CAAC,CAAC;IAAAA,eAAA,kBACV,MAAM,CAAC,CAAC;IAAAA,eAAA,yBACD,MAAM,CAAC,CAAC;IAAAA,eAAA,4BACJC,QAAY,IAAK,CAAC,CAAC;IAAAD,eAAA,2BACtB,KAAK;EAAA;AACnC","ignoreList":[]}
|
@@ -4,6 +4,7 @@ import { isNil } from 'lodash';
|
|
4
4
|
import { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';
|
5
5
|
import WmListTemplateProps from './list-template.props';
|
6
6
|
import { DEFAULT_CLASS } from './list-template.styles';
|
7
|
+
import { createSkeleton } from '@wavemaker/app-rn-runtime/components/basic/skeleton/skeleton.component';
|
7
8
|
export class WmListTemplateState extends BaseComponentState {}
|
8
9
|
export default class WmListTemplate extends BaseComponent {
|
9
10
|
constructor(props) {
|
@@ -11,6 +12,15 @@ export default class WmListTemplate extends BaseComponent {
|
|
11
12
|
}
|
12
13
|
renderWidget(props) {
|
13
14
|
var _style;
|
15
|
+
if (this._showSkeleton && !props.showskeletonchildren) {
|
16
|
+
return createSkeleton(this.theme, this.styles.skeleton, {
|
17
|
+
...this.styles.root
|
18
|
+
}, /*#__PURE__*/React.createElement(View, {
|
19
|
+
style: [this.styles.root, {
|
20
|
+
opacity: 0
|
21
|
+
}]
|
22
|
+
}, props.children));
|
23
|
+
}
|
14
24
|
const list = this.parent;
|
15
25
|
const listProps = list.state.props;
|
16
26
|
const isHorizontalList = listProps.direction === 'horizontal';
|
@@ -23,8 +33,12 @@ export default class WmListTemplate extends BaseComponent {
|
|
23
33
|
}
|
24
34
|
}, style);
|
25
35
|
}
|
36
|
+
const styles = [this.styles.root, (_style = style) === null || _style === void 0 ? void 0 : _style.root];
|
37
|
+
if (this._showSkeleton) {
|
38
|
+
styles.push(this.styles.skeleton.root);
|
39
|
+
}
|
26
40
|
return /*#__PURE__*/React.createElement(View, {
|
27
|
-
style:
|
41
|
+
style: styles
|
28
42
|
}, this._background, props.children);
|
29
43
|
}
|
30
44
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["React","View","isNil","BaseComponent","BaseComponentState","WmListTemplateProps","DEFAULT_CLASS","WmListTemplateState","WmListTemplate","constructor","props","renderWidget","_style","
|
1
|
+
{"version":3,"names":["React","View","isNil","BaseComponent","BaseComponentState","WmListTemplateProps","DEFAULT_CLASS","createSkeleton","WmListTemplateState","WmListTemplate","constructor","props","renderWidget","_style","_showSkeleton","showskeletonchildren","theme","styles","skeleton","root","createElement","style","opacity","children","list","parent","listProps","state","isHorizontalList","direction","noOfCols","getNoOfColumns","getStyle","mergeStyle","flex","push","_background"],"sources":["list-template.component.tsx"],"sourcesContent":["import React from 'react';\nimport { View } from 'react-native';\nimport { isNil } from 'lodash';\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';\nimport WmList from '../list.component';\nimport { createSkeleton } from '@wavemaker/app-rn-runtime/components/basic/skeleton/skeleton.component';\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\n if(this._showSkeleton && !props.showskeletonchildren) { \n return createSkeleton(this.theme, this.styles.skeleton, {\n ...this.styles.root,\n }, (<View style={[this.styles.root, {opacity: 0}]}>\n {props.children}\n </View>))\n }\n \n const list = (this.parent as WmList);\n const listProps = list.state.props;\n const isHorizontalList = listProps.direction === 'horizontal';\n const noOfCols = list.getNoOfColumns();\n let style = this.theme.getStyle( isHorizontalList ? 'horizontal-list-template' : 'vertical-list-template');\n if (isNil(style['flex']) && !isHorizontalList && noOfCols === 1) {\n style = this.theme.mergeStyle({root: {flex: 1}}, style);\n }\n const styles = [this.styles.root, style?.root];\n if(this._showSkeleton) {\n styles.push(this.styles.skeleton.root)\n }\n return (\n <View style={styles}>{this._background}{props.children}</View>\n ); \n }\n}\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,QAAQ,cAAc;AACnC,SAASC,KAAK,QAAQ,QAAQ;AAC9B,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,+CAA+C;AAEjG,OAAOC,mBAAmB,MAAM,uBAAuB;AACvD,SAASC,aAAa,QAA8B,wBAAwB;AAE5E,SAASC,cAAc,QAAQ,wEAAwE;AAEvG,OAAO,MAAMC,mBAAmB,SAASJ,kBAAkB,CAAsB;AAIjF,eAAe,MAAMK,cAAc,SAASN,aAAa,CAAiE;EAExHO,WAAWA,CAACC,KAA0B,EAAE;IACtC,KAAK,CAACA,KAAK,EAAEL,aAAa,EAAE,IAAID,mBAAmB,CAAC,CAAC,CAAC;EACxD;EAEAO,YAAYA,CAACD,KAA0B,EAAE;IAAA,IAAAE,MAAA;IAEvC,IAAG,IAAI,CAACC,aAAa,IAAI,CAACH,KAAK,CAACI,oBAAoB,EAAE;MACpD,OAAOR,cAAc,CAAC,IAAI,CAACS,KAAK,EAAE,IAAI,CAACC,MAAM,CAACC,QAAQ,EAAE;QACtD,GAAG,IAAI,CAACD,MAAM,CAACE;MAChB,CAAC,eAAGnB,KAAA,CAAAoB,aAAA,CAACnB,IAAI;QAACoB,KAAK,EAAE,CAAC,IAAI,CAACJ,MAAM,CAACE,IAAI,EAAE;UAACG,OAAO,EAAE;QAAC,CAAC;MAAE,GAChDX,KAAK,CAACY,QACH,CAAE,CAAC;IACX;IAEA,MAAMC,IAAI,GAAI,IAAI,CAACC,MAAiB;IACpC,MAAMC,SAAS,GAAGF,IAAI,CAACG,KAAK,CAAChB,KAAK;IAClC,MAAMiB,gBAAgB,GAAGF,SAAS,CAACG,SAAS,KAAK,YAAY;IAC7D,MAAMC,QAAQ,GAAGN,IAAI,CAACO,cAAc,CAAC,CAAC;IACtC,IAAIV,KAAK,GAAG,IAAI,CAACL,KAAK,CAACgB,QAAQ,CAAEJ,gBAAgB,GAAG,0BAA0B,GAAG,wBAAwB,CAAC;IAC1G,IAAI1B,KAAK,CAACmB,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,CAACO,gBAAgB,IAAIE,QAAQ,KAAK,CAAC,EAAE;MAC7DT,KAAK,GAAG,IAAI,CAACL,KAAK,CAACiB,UAAU,CAAC;QAACd,IAAI,EAAE;UAACe,IAAI,EAAE;QAAC;MAAC,CAAC,EAAEb,KAAK,CAAC;IAC3D;IACA,MAAMJ,MAAM,GAAG,CAAC,IAAI,CAACA,MAAM,CAACE,IAAI,GAAAN,MAAA,GAAEQ,KAAK,cAAAR,MAAA,uBAALA,MAAA,CAAOM,IAAI,CAAC;IAC9C,IAAG,IAAI,CAACL,aAAa,EAAE;MACrBG,MAAM,CAACkB,IAAI,CAAC,IAAI,CAAClB,MAAM,CAACC,QAAQ,CAACC,IAAI,CAAC;IACxC;IACA,oBACEnB,KAAA,CAAAoB,aAAA,CAACnB,IAAI;MAACoB,KAAK,EAAEJ;IAAO,GAAE,IAAI,CAACmB,WAAW,EAAEzB,KAAK,CAACY,QAAe,CAAC;EAElE;AACF","ignoreList":[]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["BaseProps","WmListTemplateProps","constructor","args","_defineProperty"],"sources":["list-template.props.ts"],"sourcesContent":["import { BaseProps } from '@wavemaker/app-rn-runtime/core/base.component';\n\nexport default class WmListTemplateProps extends BaseProps {\n children: any;\n}"],"mappings":";;;AAAA,SAASA,SAAS,QAAQ,+CAA+C;AAEzE,eAAe,MAAMC,mBAAmB,SAASD,SAAS,CAAC;EAAAE,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAC,eAAA;EAAA;
|
1
|
+
{"version":3,"names":["BaseProps","WmListTemplateProps","constructor","args","_defineProperty"],"sources":["list-template.props.ts"],"sourcesContent":["import { BaseProps } from '@wavemaker/app-rn-runtime/core/base.component';\n\nexport default class WmListTemplateProps extends BaseProps {\n children: any;\n showskeletonchildren = true;\n}"],"mappings":";;;AAAA,SAASA,SAAS,QAAQ,+CAA+C;AAEzE,eAAe,MAAMC,mBAAmB,SAASD,SAAS,CAAC;EAAAE,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAC,eAAA;IAAAA,eAAA,+BAElC,IAAI;EAAA;AAC7B","ignoreList":[]}
|
@@ -6,7 +6,17 @@ BASE_THEME.registerStyle((themeVariables, addStyle) => {
|
|
6
6
|
root: {
|
7
7
|
backgroundColor: themeVariables.listHeaderBgColor
|
8
8
|
},
|
9
|
-
text: {}
|
9
|
+
text: {},
|
10
|
+
skeleton: {
|
11
|
+
root: {
|
12
|
+
backgroundColor: themeVariables.skeletonBgColor,
|
13
|
+
paddingLeft: 10,
|
14
|
+
paddingRight: 10,
|
15
|
+
paddingTop: 16,
|
16
|
+
paddingBottom: 16,
|
17
|
+
flex: 1
|
18
|
+
}
|
19
|
+
}
|
10
20
|
});
|
11
21
|
addStyle(DEFAULT_CLASS, '', defaultStyles);
|
12
22
|
addStyle('list-card-template', '', {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["BASE_THEME","defineStyles","DEFAULT_CLASS","registerStyle","themeVariables","addStyle","defaultStyles","root","backgroundColor","listHeaderBgColor","text","borderBottomWidth"],"sources":["list-template.styles.ts"],"sourcesContent":["import BASE_THEME from '@wavemaker/app-rn-runtime/styles/theme';\nimport { BaseStyles, defineStyles } from '@wavemaker/app-rn-runtime/core/base.component';\n\nexport type WmListTemplateStyles = BaseStyles & {};\n\nexport const DEFAULT_CLASS = 'app-list-template';\nBASE_THEME.registerStyle((themeVariables, addStyle) => {\n const defaultStyles: WmListTemplateStyles = defineStyles<WmListTemplateStyles>({\n root: {\n backgroundColor: themeVariables.listHeaderBgColor,\n },\n text: {}\n });\n\n addStyle(DEFAULT_CLASS, '', defaultStyles);\n addStyle('list-card-template', '', {\n root : {\n borderBottomWidth: 0,\n // marginLeft: 35,\n }\n } as WmListTemplateStyles);\n addStyle('horizontal-list-template', '', {\n root : {}\n } as WmListTemplateStyles);\n addStyle('vertical-list-template', '', {\n root : {\n }\n } as WmListTemplateStyles);\n});"],"mappings":"AAAA,OAAOA,UAAU,MAAM,wCAAwC;AAC/D,SAAqBC,YAAY,QAAQ,+CAA+C;
|
1
|
+
{"version":3,"names":["BASE_THEME","defineStyles","DEFAULT_CLASS","registerStyle","themeVariables","addStyle","defaultStyles","root","backgroundColor","listHeaderBgColor","text","skeleton","skeletonBgColor","paddingLeft","paddingRight","paddingTop","paddingBottom","flex","borderBottomWidth"],"sources":["list-template.styles.ts"],"sourcesContent":["import BASE_THEME from '@wavemaker/app-rn-runtime/styles/theme';\nimport { BaseStyles, defineStyles } from '@wavemaker/app-rn-runtime/core/base.component';\nimport { WmSkeletonStyles } from '@wavemaker/app-rn-runtime/components/basic/skeleton/skeleton.styles';\n\nexport type WmListTemplateStyles = BaseStyles & {\n skeleton: WmSkeletonStyles\n};\n\nexport const DEFAULT_CLASS = 'app-list-template';\nBASE_THEME.registerStyle((themeVariables, addStyle) => {\n const defaultStyles: WmListTemplateStyles = defineStyles<WmListTemplateStyles>({\n root: {\n backgroundColor: themeVariables.listHeaderBgColor,\n },\n text: {},\n skeleton: {\n root: {\n backgroundColor: themeVariables.skeletonBgColor,\n paddingLeft: 10,\n paddingRight: 10,\n paddingTop: 16,\n paddingBottom: 16,\n flex: 1\n }\n } as any as WmSkeletonStyles\n });\n\n addStyle(DEFAULT_CLASS, '', defaultStyles);\n addStyle('list-card-template', '', {\n root : {\n borderBottomWidth: 0,\n // marginLeft: 35,\n }\n } as WmListTemplateStyles);\n addStyle('horizontal-list-template', '', {\n root : {}\n } as WmListTemplateStyles);\n addStyle('vertical-list-template', '', {\n root : {\n }\n } as WmListTemplateStyles);\n});"],"mappings":"AAAA,OAAOA,UAAU,MAAM,wCAAwC;AAC/D,SAAqBC,YAAY,QAAQ,+CAA+C;AAOxF,OAAO,MAAMC,aAAa,GAAG,mBAAmB;AAChDF,UAAU,CAACG,aAAa,CAAC,CAACC,cAAc,EAAEC,QAAQ,KAAK;EACnD,MAAMC,aAAmC,GAAGL,YAAY,CAAuB;IAC3EM,IAAI,EAAE;MACFC,eAAe,EAAEJ,cAAc,CAACK;IACpC,CAAC;IACDC,IAAI,EAAE,CAAC,CAAC;IACRC,QAAQ,EAAE;MACNJ,IAAI,EAAE;QACFC,eAAe,EAAEJ,cAAc,CAACQ,eAAe;QAC/CC,WAAW,EAAE,EAAE;QACfC,YAAY,EAAE,EAAE;QAChBC,UAAU,EAAE,EAAE;QACdC,aAAa,EAAE,EAAE;QACjBC,IAAI,EAAE;MACV;IACJ;EACJ,CAAC,CAAC;EAEFZ,QAAQ,CAACH,aAAa,EAAE,EAAE,EAAEI,aAAa,CAAC;EAC1CD,QAAQ,CAAC,oBAAoB,EAAE,EAAE,EAAE;IAC/BE,IAAI,EAAG;MACHW,iBAAiB,EAAE;MACnB;IACJ;EACJ,CAAyB,CAAC;EAC1Bb,QAAQ,CAAC,0BAA0B,EAAE,EAAE,EAAE;IACrCE,IAAI,EAAG,CAAC;EACZ,CAAyB,CAAC;EAC1BF,QAAQ,CAAC,wBAAwB,EAAE,EAAE,EAAE;IACnCE,IAAI,EAAG,CACP;EACJ,CAAyB,CAAC;AAC9B,CAAC,CAAC","ignoreList":[]}
|