@wavemaker/app-rn-runtime 12.0.0-next.140535 → 12.0.0-next.141130
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 +5 -32
- app-rn-runtime/components/advanced/carousel/carousel.component.js.map +1 -1
- app-rn-runtime/components/advanced/carousel/carousel.props.js +0 -1
- app-rn-runtime/components/advanced/carousel/carousel.props.js.map +1 -1
- app-rn-runtime/components/advanced/carousel/carousel.styles.js +0 -15
- 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 +5 -15
- app-rn-runtime/components/basic/anchor/anchor.component.js.map +1 -1
- app-rn-runtime/components/basic/anchor/anchor.styles.js +0 -3
- app-rn-runtime/components/basic/anchor/anchor.styles.js.map +1 -1
- app-rn-runtime/components/basic/animatedview.component.js +2 -6
- 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 +6 -20
- app-rn-runtime/components/basic/button/button.component.js.map +1 -1
- app-rn-runtime/components/basic/icon/icon.component.js +6 -14
- app-rn-runtime/components/basic/icon/icon.component.js.map +1 -1
- app-rn-runtime/components/basic/label/label.component.js +3 -13
- 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 +2 -1
- 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 +0 -12
- app-rn-runtime/components/basic/search/search.component.js.map +1 -1
- app-rn-runtime/components/basic/search/search.props.js +0 -2
- app-rn-runtime/components/basic/search/search.props.js.map +1 -1
- app-rn-runtime/components/basic/search/search.styles.js +0 -6
- app-rn-runtime/components/basic/search/search.styles.js.map +1 -1
- app-rn-runtime/components/basic/skeleton/skeleton.component.js +3 -4
- app-rn-runtime/components/basic/skeleton/skeleton.component.js.map +1 -1
- app-rn-runtime/components/basic/skeleton/skeleton.props.js +1 -9
- app-rn-runtime/components/basic/skeleton/skeleton.props.js.map +1 -1
- app-rn-runtime/components/basic/spinner/spinner.component.js +3 -2
- app-rn-runtime/components/basic/spinner/spinner.component.js.map +1 -1
- app-rn-runtime/components/basic/spinner/spinner.styles.js +2 -3
- 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 +1 -4
- app-rn-runtime/components/basic/video/video.styles.js.map +1 -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 +1 -7
- 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 +1 -7
- app-rn-runtime/components/chart/bar-chart/bar-chart.styles.js.map +1 -1
- app-rn-runtime/components/chart/basechart.component.js +2 -54
- app-rn-runtime/components/chart/basechart.component.js.map +1 -1
- app-rn-runtime/components/chart/basechart.props.js +2 -3
- app-rn-runtime/components/chart/basechart.props.js.map +1 -1
- app-rn-runtime/components/chart/basechart.styles.js +0 -4
- app-rn-runtime/components/chart/basechart.styles.js.map +1 -1
- app-rn-runtime/components/chart/bubble-chart/bubble-chart.component.js +3 -15
- 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 +1 -7
- 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 +1 -7
- 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 +1 -7
- 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 +0 -2
- 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 +1 -7
- 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 +1 -4
- 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 +1 -7
- 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 +11 -37
- app-rn-runtime/components/chart/stack-chart/stack-chart.component.js.map +1 -1
- app-rn-runtime/components/container/accordion/accordion.component.js +5 -47
- 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 +0 -5
- app-rn-runtime/components/container/accordion/accordion.styles.js.map +1 -1
- app-rn-runtime/components/container/accordion/accordionpane/accordionpane.component.js +1 -4
- app-rn-runtime/components/container/accordion/accordionpane/accordionpane.component.js.map +1 -1
- app-rn-runtime/components/container/container.component.js +2 -36
- app-rn-runtime/components/container/container.component.js.map +1 -1
- app-rn-runtime/components/container/container.styles.js +0 -7
- 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 +1 -5
- app-rn-runtime/components/container/layoutgrid/gridrow/gridrow.component.js.map +1 -1
- app-rn-runtime/components/container/layoutgrid/gridrow/gridrow.styles.js +1 -6
- app-rn-runtime/components/container/layoutgrid/gridrow/gridrow.styles.js.map +1 -1
- app-rn-runtime/components/container/layoutgrid/layoutgrid.component.js +2 -27
- 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 +1 -4
- app-rn-runtime/components/container/layoutgrid/layoutgrid.styles.js.map +1 -1
- app-rn-runtime/components/container/linearlayout/linearlayout.component.js +5 -31
- 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 +1 -4
- app-rn-runtime/components/container/linearlayout/linearlayout.styles.js.map +1 -1
- app-rn-runtime/components/container/panel/panel.component.js +6 -46
- 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 +0 -3
- 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 +4 -3
- 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 +1 -4
- 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 +3 -31
- 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 +1 -4
- app-rn-runtime/components/container/tabs/tabs.styles.js.map +1 -1
- app-rn-runtime/components/container/tile/tile.component.js +1 -23
- 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 +1 -6
- app-rn-runtime/components/container/tile/tile.styles.js.map +1 -1
- app-rn-runtime/components/container/wizard/wizard.component.js +13 -54
- 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 +0 -3
- app-rn-runtime/components/container/wizard/wizard.styles.js.map +1 -1
- app-rn-runtime/components/container/wizard/wizardstep/wizardstep.component.js +1 -4
- 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 +2 -6
- 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 +1 -4
- app-rn-runtime/components/data/card/card-content/card-content.styles.js.map +1 -1
- app-rn-runtime/components/data/card/card.component.js +0 -18
- app-rn-runtime/components/data/card/card.component.js.map +1 -1
- app-rn-runtime/components/data/card/card.styles.js +0 -3
- 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 +0 -1
- app-rn-runtime/components/data/form/form.props.js.map +1 -1
- app-rn-runtime/components/data/list/list-template/list-template.component.js +1 -15
- 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 +0 -1
- 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 +1 -11
- app-rn-runtime/components/data/list/list-template/list-template.styles.js.map +1 -1
- app-rn-runtime/components/data/list/list.component.js +33 -54
- app-rn-runtime/components/data/list/list.component.js.map +1 -1
- app-rn-runtime/components/data/list/list.props.js +0 -1
- app-rn-runtime/components/data/list/list.props.js.map +1 -1
- app-rn-runtime/components/data/list/list.styles.js +0 -9
- app-rn-runtime/components/data/list/list.styles.js.map +1 -1
- app-rn-runtime/components/dialogs/dialog/dialog.component.js +3 -5
- 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 +4 -11
- app-rn-runtime/components/input/baseinput/baseinput.component.js.map +1 -1
- app-rn-runtime/components/input/baseinput/baseinput.props.js +0 -1
- app-rn-runtime/components/input/baseinput/baseinput.props.js.map +1 -1
- app-rn-runtime/components/input/basenumber/basenumber.component.js +12 -25
- app-rn-runtime/components/input/basenumber/basenumber.component.js.map +1 -1
- app-rn-runtime/components/input/basenumber/basenumber.props.js +0 -2
- app-rn-runtime/components/input/basenumber/basenumber.props.js.map +1 -1
- app-rn-runtime/components/input/checkbox/checkbox.component.js +6 -5
- 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 +2 -23
- app-rn-runtime/components/input/checkboxset/checkboxset.component.js.map +1 -1
- app-rn-runtime/components/input/checkboxset/checkboxset.props.js +0 -1
- app-rn-runtime/components/input/checkboxset/checkboxset.props.js.map +1 -1
- app-rn-runtime/components/input/checkboxset/checkboxset.styles.js.map +1 -1
- app-rn-runtime/components/input/chips/chips.component.js +2 -3
- app-rn-runtime/components/input/chips/chips.component.js.map +1 -1
- app-rn-runtime/components/input/currency/currency.component.js +1 -16
- app-rn-runtime/components/input/currency/currency.component.js.map +1 -1
- app-rn-runtime/components/input/epoch/base-datetime.component.js +5 -22
- app-rn-runtime/components/input/epoch/base-datetime.component.js.map +1 -1
- app-rn-runtime/components/input/epoch/wheel-date-picker.component.js +12 -123
- 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 +0 -4
- 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 +0 -2
- 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 +2 -4
- app-rn-runtime/components/input/fileupload/fileupload.component.js.map +1 -1
- app-rn-runtime/components/input/fileupload/fileupload.props.js +0 -1
- app-rn-runtime/components/input/fileupload/fileupload.props.js.map +1 -1
- app-rn-runtime/components/input/number/number.component.js +3 -6
- app-rn-runtime/components/input/number/number.component.js.map +1 -1
- app-rn-runtime/components/input/radioset/radioset.component.js +6 -26
- app-rn-runtime/components/input/radioset/radioset.component.js.map +1 -1
- app-rn-runtime/components/input/radioset/radioset.props.js +0 -1
- app-rn-runtime/components/input/radioset/radioset.props.js.map +1 -1
- app-rn-runtime/components/input/radioset/radioset.styles.js.map +1 -1
- app-rn-runtime/components/input/select/select.component.js +9 -23
- 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 +0 -21
- app-rn-runtime/components/input/text/text.component.js.map +1 -1
- app-rn-runtime/components/input/text/text.props.js +0 -2
- 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 +0 -21
- app-rn-runtime/components/input/textarea/textarea.component.js.map +1 -1
- app-rn-runtime/components/input/textarea/textarea.props.js +0 -2
- app-rn-runtime/components/input/textarea/textarea.props.js.map +1 -1
- app-rn-runtime/components/input/toggle/toggle.component.js +4 -2
- 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 +3 -2
- 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/page-content/page-content.component.js +2 -27
- 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 +1 -6
- 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 +1 -7
- app-rn-runtime/components/page/page.styles.js.map +1 -1
- app-rn-runtime/components/page/partial/partial.component.js +0 -21
- 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 +1 -6
- 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 +0 -1
- app-rn-runtime/components/page/tabbar/tabbar.props.js.map +1 -1
- app-rn-runtime/components/prefab/prefab-container.component.js +0 -22
- 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 +1 -6
- app-rn-runtime/components/prefab/prefab-container.styles.js.map +1 -1
- app-rn-runtime/core/base.component.js +3 -5
- app-rn-runtime/core/base.component.js.map +1 -1
- app-rn-runtime/core/components/textinput.component.js +3 -4
- 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 +0 -4
- 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 +25 -26
- app-rn-runtime/core/tappable.component.js.map +1 -1
- app-rn-runtime/core/utils.js +4 -87
- app-rn-runtime/core/utils.js.map +1 -1
- app-rn-runtime/package.json +7 -30
- app-rn-runtime/runtime/App.js +1 -2
- 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 +13 -43
- 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 +0 -10
- app-rn-runtime/runtime/services/app-i18n.service.js.map +1 -1
- app-rn-runtime/runtime/services/app-security.service.js +1 -25
- 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 +0 -1
- 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.map +1 -1
- app-rn-runtime/styles/theme.variables.js +0 -1
- 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
- app-rn-runtime/core/ui-preferences.context.js +0 -7
- app-rn-runtime/core/ui-preferences.context.js.map +0 -1
@@ -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"
|
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;AAaxF,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;EACJ,CAAC,CAAC;EAEFH,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,SAAS,CAAC,CAAC;IAClD;EACF;EAEAC,iBAAiBA,CAAA,EAAG;IAAA,IAAAC,UAAA,EAAAC,WAAA,EAAAC,WAAA;IAClB,KAAK,CAACH,iBAAiB,CAAC,CAAC;IACzB,IAAI,CAACI,UAAU,GAAI,IAAI,CAACP,KA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AAE,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,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,SAASh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,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
|
358
|
+
this.parentFormRef && 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 { 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,EAA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AI,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 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 { 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,OAAO,QAAQ,QAAQ;AAErF,OAAOC,OAAO,MAAM,kEAAkE;AACtF,OAAOC,MAAM,MAAM,gEAAgE;AAEnF,OAAOC,SAAS,MAAM,sEAAsE;AAC5F,SAASC,aAAa,QAAsB,8CAA8C;AAE1F,OAAOC,WAAW,MA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E,EAAE,IAAI,CAAC0E,SAAS,CAAC,MAAM,CAAE;QAAClB,MAAM,EAAE,IAAI,CAACA,MAAM,CAACmB,QAAS;QAACP,SAAS,EAAEzI,KAAK,CAACyI;MAAU,CAAS,CAAC,eACxGlK,KAAA,CAAA6J,aAAA,CAAC5J,IAAI,qBACHD,KAAA,CAAA6J,aAAA,CAAChJ,OAAO;QAACiF,EAAE,EAAE,IAAI,CAAC0E,SAAS,CAAC,OAAO,CAAE;QAAClB,MAAM,EAAE,IAAI,CAACA,MAAM,CAACa,KAAM;QAACO,OAAO,EAAEjJ,KAAK,CAAC0I,KAAM;QAACQ,iBAAiB,EAAC;MAAQ,CAAU,CAAC,eAC5H3K,KAAA,CAAA6J,aAAA,CAAChJ,OAAO;QAACiF,EAAE,EAAE,IAAI,CAAC0E,SAAS,CAAC,aAAa,CAAE;QAAClB,MAAM,EAAE,IAAI,CAACA,MAAM,CAACc,UAAW;QAACM,OAAO,EAAEjJ,KAAK,CAAC2I;MAAW,CAAU,CAC5G,CACF,CACF,CAAC,GACL,IAAI,EACP,IAAI,CAAC7H,KAAK,CAAC2G,aAAa,gBAAGlJ,KAAA,CAAA6J,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":[]}
|
@@ -25,7 +25,6 @@ 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);
|
29
28
|
}
|
30
29
|
}
|
31
30
|
//# 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
|
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;AACpD","ignoreList":[]}
|
@@ -4,7 +4,6 @@ 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';
|
8
7
|
export class WmListTemplateState extends BaseComponentState {}
|
9
8
|
export default class WmListTemplate extends BaseComponent {
|
10
9
|
constructor(props) {
|
@@ -12,15 +11,6 @@ export default class WmListTemplate extends BaseComponent {
|
|
12
11
|
}
|
13
12
|
renderWidget(props) {
|
14
13
|
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
|
-
}
|
24
14
|
const list = this.parent;
|
25
15
|
const listProps = list.state.props;
|
26
16
|
const isHorizontalList = listProps.direction === 'horizontal';
|
@@ -33,12 +23,8 @@ export default class WmListTemplate extends BaseComponent {
|
|
33
23
|
}
|
34
24
|
}, style);
|
35
25
|
}
|
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
|
-
}
|
40
26
|
return /*#__PURE__*/React.createElement(View, {
|
41
|
-
style: styles
|
27
|
+
style: [this.styles.root, (_style = style) === null || _style === void 0 ? void 0 : _style.root]
|
42
28
|
}, this._background, props.children);
|
43
29
|
}
|
44
30
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["React","View","isNil","BaseComponent","BaseComponentState","WmListTemplateProps","DEFAULT_CLASS","
|
1
|
+
{"version":3,"names":["React","View","isNil","BaseComponent","BaseComponentState","WmListTemplateProps","DEFAULT_CLASS","WmListTemplateState","WmListTemplate","constructor","props","renderWidget","_style","list","parent","listProps","state","isHorizontalList","direction","noOfCols","getNoOfColumns","style","theme","getStyle","mergeStyle","root","flex","createElement","styles","_background","children"],"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';\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 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 return (\n <View style={[this.styles.root, style?.root]}>{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;AAG5E,OAAO,MAAMC,mBAAmB,SAASH,kBAAkB,CAAsB;AAIjF,eAAe,MAAMI,cAAc,SAASL,aAAa,CAAiE;EAExHM,WAAWA,CAACC,KAA0B,EAAE;IACtC,KAAK,CAACA,KAAK,EAAEJ,aAAa,EAAE,IAAID,mBAAmB,CAAC,CAAC,CAAC;EACxD;EAEAM,YAAYA,CAACD,KAA0B,EAAE;IAAA,IAAAE,MAAA;IACvC,MAAMC,IAAI,GAAI,IAAI,CAACC,MAAiB;IACpC,MAAMC,SAAS,GAAGF,IAAI,CAACG,KAAK,CAACN,KAAK;IAClC,MAAMO,gBAAgB,GAAGF,SAAS,CAACG,SAAS,KAAK,YAAY;IAC7D,MAAMC,QAAQ,GAAGN,IAAI,CAACO,cAAc,CAAC,CAAC;IACtC,IAAIC,KAAK,GAAG,IAAI,CAACC,KAAK,CAACC,QAAQ,CAAEN,gBAAgB,GAAG,0BAA0B,GAAG,wBAAwB,CAAC;IAC1G,IAAIf,KAAK,CAACmB,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,CAACJ,gBAAgB,IAAIE,QAAQ,KAAK,CAAC,EAAE;MAC7DE,KAAK,GAAG,IAAI,CAACC,KAAK,CAACE,UAAU,CAAC;QAACC,IAAI,EAAE;UAACC,IAAI,EAAE;QAAC;MAAC,CAAC,EAAEL,KAAK,CAAC;IAC3D;IACA,oBACErB,KAAA,CAAA2B,aAAA,CAAC1B,IAAI;MAACoB,KAAK,EAAE,CAAC,IAAI,CAACO,MAAM,CAACH,IAAI,GAAAb,MAAA,GAAES,KAAK,cAAAT,MAAA,uBAALA,MAAA,CAAOa,IAAI;IAAE,GAAE,IAAI,CAACI,WAAW,EAAEnB,KAAK,CAACoB,QAAe,CAAC;EAE3F;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
|
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;AAE3D","ignoreList":[]}
|
@@ -6,17 +6,7 @@ BASE_THEME.registerStyle((themeVariables, addStyle) => {
|
|
6
6
|
root: {
|
7
7
|
backgroundColor: themeVariables.listHeaderBgColor
|
8
8
|
},
|
9
|
-
text: {}
|
10
|
-
skeleton: {
|
11
|
-
root: {
|
12
|
-
backgroundColor: themeVariables.skeletonBackgroundColor,
|
13
|
-
paddingLeft: 10,
|
14
|
-
paddingRight: 10,
|
15
|
-
paddingTop: 16,
|
16
|
-
paddingBottom: 16,
|
17
|
-
flex: 1
|
18
|
-
}
|
19
|
-
}
|
9
|
+
text: {}
|
20
10
|
});
|
21
11
|
addStyle(DEFAULT_CLASS, '', defaultStyles);
|
22
12
|
addStyle('list-card-template', '', {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["BASE_THEME","defineStyles","DEFAULT_CLASS","registerStyle","themeVariables","addStyle","defaultStyles","root","backgroundColor","listHeaderBgColor","text","
|
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;AAIxF,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;EACX,CAAC,CAAC;EAEFL,QAAQ,CAACH,aAAa,EAAE,EAAE,EAAEI,aAAa,CAAC;EAC1CD,QAAQ,CAAC,oBAAoB,EAAE,EAAE,EAAE;IAC/BE,IAAI,EAAG;MACHI,iBAAiB,EAAE;MACnB;IACJ;EACJ,CAAyB,CAAC;EAC1BN,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":[]}
|
@@ -6,7 +6,7 @@ import React from 'react';
|
|
6
6
|
import { ActivityIndicator, SectionList, Text, View, FlatList } from 'react-native';
|
7
7
|
import { isArray, isEmpty, isNil, isNumber, round } from 'lodash-es';
|
8
8
|
import { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';
|
9
|
-
import { getGroupedData,
|
9
|
+
import { getGroupedData, isDefined } from "@wavemaker/app-rn-runtime/core/utils";
|
10
10
|
import { Tappable } from '@wavemaker/app-rn-runtime/core/tappable.component';
|
11
11
|
import { DefaultKeyExtractor } from '@wavemaker/app-rn-runtime/core/key.extractor';
|
12
12
|
import WmLabel from '@wavemaker/app-rn-runtime/components/basic/label/label.component';
|
@@ -227,28 +227,15 @@ export default class WmList extends BaseComponent {
|
|
227
227
|
});
|
228
228
|
}
|
229
229
|
const data = isArray($new) ? $new : !isEmpty($new) && isDefined($new) ? [$new] : [];
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
(_this$keyExtractor2 = this.keyExtractor) === null || _this$keyExtractor2 === void 0 || _this$keyExtractor2.clear();
|
240
|
-
});
|
241
|
-
} else {
|
242
|
-
this.updateState({
|
243
|
-
groupedData: data[0] || props.direction === 'horizontal' ? [{
|
244
|
-
key: 'key',
|
245
|
-
data: data
|
246
|
-
}] : []
|
247
|
-
}, () => {
|
248
|
-
var _this$keyExtractor3;
|
249
|
-
(_this$keyExtractor3 = this.keyExtractor) === null || _this$keyExtractor3 === void 0 || _this$keyExtractor3.clear();
|
250
|
-
});
|
251
|
-
}
|
230
|
+
this.updateState({
|
231
|
+
groupedData: data[0] || props.direction === 'horizontal' ? [{
|
232
|
+
key: 'key',
|
233
|
+
data: data
|
234
|
+
}] : []
|
235
|
+
}, () => {
|
236
|
+
var _this$keyExtractor2;
|
237
|
+
(_this$keyExtractor2 = this.keyExtractor) === null || _this$keyExtractor2 === void 0 || _this$keyExtractor2.clear();
|
238
|
+
});
|
252
239
|
}
|
253
240
|
this.itemWidgets = [];
|
254
241
|
if (props.selectfirstitem) {
|
@@ -316,10 +303,6 @@ export default class WmList extends BaseComponent {
|
|
316
303
|
renderItem(item, index, props) {
|
317
304
|
const cols = this.getNoOfColumns();
|
318
305
|
const isHorizontal = props.direction === 'horizontal';
|
319
|
-
const styles = this._showSkeleton ? {
|
320
|
-
...this.styles.item,
|
321
|
-
...this.styles.skeleton.root
|
322
|
-
} : this.styles.item;
|
323
306
|
return index < this.state.maxRecordsToShow || isHorizontal ? /*#__PURE__*/React.createElement(Swipeable, {
|
324
307
|
renderLeftActions: () => this.renderLeftActions(),
|
325
308
|
renderRightActions: () => this.renderRightActions(),
|
@@ -328,7 +311,7 @@ export default class WmList extends BaseComponent {
|
|
328
311
|
flex: null
|
329
312
|
} : {}
|
330
313
|
}, /*#__PURE__*/React.createElement(View, {
|
331
|
-
style: [styles, props.itemclass ? this.theme.getStyle(props.itemclass(item, index)) : null, this.isSelected(item) ? this.styles.selectedItem : {}]
|
314
|
+
style: [this.styles.item, props.itemclass ? this.theme.getStyle(props.itemclass(item, index)) : null, this.isSelected(item) ? this.styles.selectedItem : {}]
|
332
315
|
}, /*#__PURE__*/React.createElement(Tappable, _extends({}, this.getTestPropsForAction(`item${index}`), {
|
333
316
|
onTap: $event => this.onSelect(item, index, $event),
|
334
317
|
onLongTap: () => this.invokeEventCallback('onLongtap', [null, this.proxy]),
|
@@ -408,35 +391,31 @@ export default class WmList extends BaseComponent {
|
|
408
391
|
return /*#__PURE__*/React.createElement(View, {
|
409
392
|
style: this.styles.root,
|
410
393
|
onLayout: e => this.onLayoutChange(e)
|
411
|
-
}, !isEmpty(this.state.groupedData) ? this.state.groupedData.map((v, i) => {
|
412
|
-
|
413
|
-
|
414
|
-
|
415
|
-
|
416
|
-
|
417
|
-
|
418
|
-
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
|
428
|
-
|
429
|
-
|
430
|
-
onTap: () => this.loadData()
|
431
|
-
}) : null);
|
432
|
-
}) : this.renderEmptyMessage(isHorizontal, null, null, props));
|
394
|
+
}, !isEmpty(this.state.groupedData) ? this.state.groupedData.map((v, i) => /*#__PURE__*/React.createElement(View, {
|
395
|
+
style: this.styles.group,
|
396
|
+
key: v.key || this.keyExtractor.getKey(v, true)
|
397
|
+
}, this.renderHeader(props, v.key), /*#__PURE__*/React.createElement(FlatList, _extends({
|
398
|
+
key: props.name + '_' + (isHorizontal ? 'H' : 'V') + props.itemsperrow.xs,
|
399
|
+
keyExtractor: (item, i) => this.generateItemKey(item, i, props),
|
400
|
+
scrollEnabled: isHorizontal,
|
401
|
+
horizontal: isHorizontal,
|
402
|
+
data: isEmpty(v.data[0]) ? [] : v.data,
|
403
|
+
ListEmptyComponent: itemInfo => this.renderEmptyMessage(isHorizontal, itemInfo.item, itemInfo.index, props),
|
404
|
+
renderItem: itemInfo => this.renderItem(itemInfo.item, itemInfo.index, props)
|
405
|
+
}, isHorizontal ? {} : {
|
406
|
+
numColumns: this.getNoOfColumns()
|
407
|
+
})), this.loadDataOnDemand || v.data.length > this.state.maxRecordsToShow ? this.loadingData ? this.renderLoadingIcon(props) : /*#__PURE__*/React.createElement(WmLabel, {
|
408
|
+
id: this.getTestId('ondemandmessage'),
|
409
|
+
styles: this.styles.onDemandMessage,
|
410
|
+
caption: this.hasMoreData && !isHorizontal ? props.ondemandmessage : props.nodatamessage,
|
411
|
+
onTap: () => this.loadData()
|
412
|
+
}) : null)) : this.renderEmptyMessage(isHorizontal, null, null, props));
|
433
413
|
}
|
434
|
-
getSectionListData(
|
414
|
+
getSectionListData() {
|
435
415
|
if (this._showSkeleton) {
|
436
|
-
var _ref2;
|
437
416
|
return [{
|
438
417
|
key: '',
|
439
|
-
data: [
|
418
|
+
data: [{}, {}, {}]
|
440
419
|
}];
|
441
420
|
} else if (this.state.groupedData && this.state.groupedData[0] && this.state.groupedData[0]['data'].length) {
|
442
421
|
return this.state.groupedData;
|
@@ -448,7 +427,7 @@ export default class WmList extends BaseComponent {
|
|
448
427
|
keyExtractor: (item, i) => this.generateItemKey(item, i, props),
|
449
428
|
horizontal: isHorizontal,
|
450
429
|
contentContainerStyle: this.styles.root,
|
451
|
-
sections: this.getSectionListData(
|
430
|
+
sections: this.getSectionListData(),
|
452
431
|
renderSectionHeader: ({
|
453
432
|
section: {
|
454
433
|
key,
|