@wavemaker/app-rn-runtime 11.4.0-next.25501 → 11.4.0-next.27501
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- app-rn-runtime/actions/notification-action.js +5 -4
- app-rn-runtime/actions/notification-action.js.map +1 -1
- app-rn-runtime/components/advanced/carousel/carousel-content/carousel-content.component.js +1 -1
- app-rn-runtime/components/advanced/carousel/carousel-content/carousel-content.component.js.map +1 -1
- app-rn-runtime/components/advanced/carousel/carousel-template/carousel-template.component.js +1 -1
- app-rn-runtime/components/advanced/carousel/carousel-template/carousel-template.component.js.map +1 -1
- app-rn-runtime/components/advanced/carousel/carousel.component.js +1 -1
- app-rn-runtime/components/advanced/carousel/carousel.component.js.map +1 -1
- app-rn-runtime/components/advanced/login/login.component.js +1 -1
- app-rn-runtime/components/advanced/login/login.component.js.map +1 -1
- app-rn-runtime/components/advanced/network-info-toaster/network-info-toaster.component.js +5 -5
- app-rn-runtime/components/advanced/network-info-toaster/network-info-toaster.component.js.map +1 -1
- app-rn-runtime/components/advanced/webview/webview.component.js +1 -1
- app-rn-runtime/components/advanced/webview/webview.component.js.map +1 -1
- app-rn-runtime/components/basic/anchor/anchor.component.js +1 -1
- app-rn-runtime/components/basic/anchor/anchor.component.js.map +1 -1
- app-rn-runtime/components/basic/button/button.component.js +1 -1
- app-rn-runtime/components/basic/button/button.component.js.map +1 -1
- app-rn-runtime/components/basic/buttongroup/buttongroup.component.js +1 -1
- app-rn-runtime/components/basic/buttongroup/buttongroup.component.js.map +1 -1
- app-rn-runtime/components/basic/custom/custom.component.js +25 -0
- app-rn-runtime/components/basic/custom/custom.component.js.map +1 -0
- app-rn-runtime/components/basic/custom/custom.props.js +16 -0
- app-rn-runtime/components/basic/custom/custom.props.js.map +1 -0
- app-rn-runtime/components/basic/custom/custom.styles.js +18 -0
- app-rn-runtime/components/basic/custom/custom.styles.js.map +1 -0
- app-rn-runtime/components/basic/icon/icon.component.js +1 -1
- app-rn-runtime/components/basic/icon/icon.component.js.map +1 -1
- app-rn-runtime/components/basic/label/label.component.js +1 -1
- app-rn-runtime/components/basic/label/label.component.js.map +1 -1
- app-rn-runtime/components/basic/lottie/lottie.component.js +137 -0
- app-rn-runtime/components/basic/lottie/lottie.component.js.map +1 -0
- app-rn-runtime/components/basic/lottie/lottie.props.js +14 -0
- app-rn-runtime/components/basic/lottie/lottie.props.js.map +1 -0
- app-rn-runtime/components/basic/lottie/lottie.styles.js +11 -0
- app-rn-runtime/components/basic/lottie/lottie.styles.js.map +1 -0
- app-rn-runtime/components/basic/message/message.component.js +1 -1
- app-rn-runtime/components/basic/message/message.component.js.map +1 -1
- app-rn-runtime/components/basic/picture/picture.component.js +37 -26
- app-rn-runtime/components/basic/picture/picture.component.js.map +1 -1
- app-rn-runtime/components/basic/progress-bar/progress-bar.component.js +3 -2
- app-rn-runtime/components/basic/progress-bar/progress-bar.component.js.map +1 -1
- app-rn-runtime/components/basic/progress-circle/progress-circle.component.js +1 -1
- app-rn-runtime/components/basic/progress-circle/progress-circle.component.js.map +1 -1
- app-rn-runtime/components/basic/search/search.component.js +4 -1
- app-rn-runtime/components/basic/search/search.component.js.map +1 -1
- app-rn-runtime/components/basic/spinner/spinner.component.js +10 -10
- app-rn-runtime/components/basic/spinner/spinner.component.js.map +1 -1
- app-rn-runtime/components/basic/video/video.component.js +56 -0
- app-rn-runtime/components/basic/video/video.component.js.map +1 -0
- app-rn-runtime/components/basic/video/video.props.js +22 -0
- app-rn-runtime/components/basic/video/video.props.js.map +1 -0
- app-rn-runtime/components/basic/video/video.styles.js +11 -0
- app-rn-runtime/components/basic/video/video.styles.js.map +1 -0
- app-rn-runtime/components/container/accordion/accordion.component.js +1 -1
- app-rn-runtime/components/container/accordion/accordion.component.js.map +1 -1
- app-rn-runtime/components/container/accordion/accordionpane/accordionpane.component.js +1 -1
- app-rn-runtime/components/container/accordion/accordionpane/accordionpane.component.js.map +1 -1
- app-rn-runtime/components/container/container.component.js +1 -1
- app-rn-runtime/components/container/container.component.js.map +1 -1
- app-rn-runtime/components/container/layoutgrid/gridcolumn/gridcolumn.component.js +1 -1
- app-rn-runtime/components/container/layoutgrid/gridcolumn/gridcolumn.component.js.map +1 -1
- app-rn-runtime/components/container/layoutgrid/gridrow/gridrow.component.js +1 -1
- app-rn-runtime/components/container/layoutgrid/gridrow/gridrow.component.js.map +1 -1
- app-rn-runtime/components/container/layoutgrid/layoutgrid.component.js +1 -1
- app-rn-runtime/components/container/layoutgrid/layoutgrid.component.js.map +1 -1
- app-rn-runtime/components/container/linearlayout/linearlayout.component.js +1 -1
- app-rn-runtime/components/container/linearlayout/linearlayout.component.js.map +1 -1
- app-rn-runtime/components/container/linearlayout/linearlayoutitem/linearlayoutitem.component.js +1 -1
- app-rn-runtime/components/container/linearlayout/linearlayoutitem/linearlayoutitem.component.js.map +1 -1
- app-rn-runtime/components/container/panel/panel-content/panel-content.component.js +1 -1
- app-rn-runtime/components/container/panel/panel-content/panel-content.component.js.map +1 -1
- app-rn-runtime/components/container/panel/panel-footer/panel-footer.component.js +1 -1
- app-rn-runtime/components/container/panel/panel-footer/panel-footer.component.js.map +1 -1
- app-rn-runtime/components/container/panel/panel.component.js +1 -1
- app-rn-runtime/components/container/panel/panel.component.js.map +1 -1
- app-rn-runtime/components/container/tabs/tabheader/tabheader.component.js +12 -4
- app-rn-runtime/components/container/tabs/tabheader/tabheader.component.js.map +1 -1
- app-rn-runtime/components/container/tabs/tabheader/tabheader.styles.js +2 -1
- app-rn-runtime/components/container/tabs/tabheader/tabheader.styles.js.map +1 -1
- app-rn-runtime/components/container/tabs/tabpane/tabpane.component.js +5 -2
- app-rn-runtime/components/container/tabs/tabpane/tabpane.component.js.map +1 -1
- app-rn-runtime/components/container/tabs/tabs.component.js +80 -64
- app-rn-runtime/components/container/tabs/tabs.component.js.map +1 -1
- app-rn-runtime/components/container/tabs/tabs.props.js +1 -0
- app-rn-runtime/components/container/tabs/tabs.props.js.map +1 -1
- app-rn-runtime/components/container/tabs/tabs.styles.js +1 -1
- app-rn-runtime/components/container/tabs/tabs.styles.js.map +1 -1
- app-rn-runtime/components/container/tile/tile.component.js +1 -1
- app-rn-runtime/components/container/tile/tile.component.js.map +1 -1
- app-rn-runtime/components/container/wizard/wizard.component.js +1 -1
- app-rn-runtime/components/container/wizard/wizard.component.js.map +1 -1
- app-rn-runtime/components/container/wizard/wizardstep/wizardstep.component.js +1 -1
- app-rn-runtime/components/container/wizard/wizardstep/wizardstep.component.js.map +1 -1
- app-rn-runtime/components/data/card/card-content/card-content.component.js +1 -1
- app-rn-runtime/components/data/card/card-content/card-content.component.js.map +1 -1
- app-rn-runtime/components/data/card/card-footer/card-footer.component.js +1 -1
- app-rn-runtime/components/data/card/card-footer/card-footer.component.js.map +1 -1
- app-rn-runtime/components/data/card/card.component.js +1 -1
- app-rn-runtime/components/data/card/card.component.js.map +1 -1
- app-rn-runtime/components/data/form/form-action/form-action.component.js +0 -6
- app-rn-runtime/components/data/form/form-action/form-action.component.js.map +1 -1
- app-rn-runtime/components/data/form/form-body/form-body.component.js +1 -1
- app-rn-runtime/components/data/form/form-body/form-body.component.js.map +1 -1
- app-rn-runtime/components/data/form/form-field/form-field.component.js +1 -1
- app-rn-runtime/components/data/form/form-field/form-field.component.js.map +1 -1
- app-rn-runtime/components/data/form/form-footer/form-footer.component.js +1 -1
- app-rn-runtime/components/data/form/form-footer/form-footer.component.js.map +1 -1
- app-rn-runtime/components/data/form/form.component.js +2 -31
- app-rn-runtime/components/data/form/form.component.js.map +1 -1
- app-rn-runtime/components/data/list/list-template/list-template.component.js +1 -1
- app-rn-runtime/components/data/list/list-template/list-template.component.js.map +1 -1
- app-rn-runtime/components/data/list/list.component.js +17 -8
- app-rn-runtime/components/data/list/list.component.js.map +1 -1
- app-rn-runtime/components/device/barcodescanner/barcodescanner.component.js +3 -2
- app-rn-runtime/components/device/barcodescanner/barcodescanner.component.js.map +1 -1
- app-rn-runtime/components/device/camera/camera.component.js +9 -4
- app-rn-runtime/components/device/camera/camera.component.js.map +1 -1
- app-rn-runtime/components/device/camera/camera.props.js +0 -1
- app-rn-runtime/components/device/camera/camera.props.js.map +1 -1
- app-rn-runtime/components/dialogs/dialog/dialog.component.js +1 -1
- app-rn-runtime/components/dialogs/dialog/dialog.component.js.map +1 -1
- app-rn-runtime/components/dialogs/dialogactions/dialogactions.component.js +1 -1
- app-rn-runtime/components/dialogs/dialogactions/dialogactions.component.js.map +1 -1
- app-rn-runtime/components/dialogs/dialogcontent/dialogcontent.component.js +1 -1
- app-rn-runtime/components/dialogs/dialogcontent/dialogcontent.component.js.map +1 -1
- app-rn-runtime/components/input/baseinput/baseinput.component.js +7 -0
- app-rn-runtime/components/input/baseinput/baseinput.component.js.map +1 -1
- app-rn-runtime/components/input/calendar/calendar.component.js +1 -1
- app-rn-runtime/components/input/calendar/calendar.component.js.map +1 -1
- app-rn-runtime/components/input/checkbox/checkbox.component.js +1 -16
- app-rn-runtime/components/input/checkbox/checkbox.component.js.map +1 -1
- app-rn-runtime/components/input/checkboxset/checkboxset.component.js +0 -38
- app-rn-runtime/components/input/checkboxset/checkboxset.component.js.map +1 -1
- app-rn-runtime/components/input/composite/composite.component.js +1 -1
- app-rn-runtime/components/input/composite/composite.component.js.map +1 -1
- app-rn-runtime/components/input/epoch/base-datetime.component.js +1 -1
- app-rn-runtime/components/input/epoch/base-datetime.component.js.map +1 -1
- app-rn-runtime/components/input/fileupload/fileupload.component.js +1 -1
- app-rn-runtime/components/input/fileupload/fileupload.component.js.map +1 -1
- app-rn-runtime/components/input/number/number.component.js +0 -9
- app-rn-runtime/components/input/number/number.component.js.map +1 -1
- app-rn-runtime/components/input/radioset/radioset.component.js +0 -40
- app-rn-runtime/components/input/radioset/radioset.component.js.map +1 -1
- app-rn-runtime/components/input/rating/rating.component.js +1 -1
- app-rn-runtime/components/input/rating/rating.component.js.map +1 -1
- app-rn-runtime/components/input/slider/slider.component.js +1 -1
- app-rn-runtime/components/input/slider/slider.component.js.map +1 -1
- app-rn-runtime/components/input/switch/switch.component.js +19 -22
- app-rn-runtime/components/input/switch/switch.component.js.map +1 -1
- app-rn-runtime/components/input/switch/switch.styles.js +7 -7
- app-rn-runtime/components/input/switch/switch.styles.js.map +1 -1
- app-rn-runtime/components/input/text/text.component.js +1 -10
- app-rn-runtime/components/input/text/text.component.js.map +1 -1
- app-rn-runtime/components/input/textarea/textarea.component.js +0 -10
- app-rn-runtime/components/input/textarea/textarea.component.js.map +1 -1
- app-rn-runtime/components/input/toggle/toggle.component.js +1 -1
- app-rn-runtime/components/input/toggle/toggle.component.js.map +1 -1
- app-rn-runtime/components/navigation/appnavbar/appnavbar.component.js +1 -1
- app-rn-runtime/components/navigation/appnavbar/appnavbar.component.js.map +1 -1
- app-rn-runtime/components/navigation/basenav/basenav.props.js +1 -0
- app-rn-runtime/components/navigation/basenav/basenav.props.js.map +1 -1
- app-rn-runtime/components/navigation/menu/menu.component.js +2 -1
- app-rn-runtime/components/navigation/menu/menu.component.js.map +1 -1
- app-rn-runtime/components/navigation/navbar/navbar.component.js +2 -0
- app-rn-runtime/components/navigation/navbar/navbar.component.js.map +1 -1
- app-rn-runtime/components/navigation/navitem/navitem.component.js +4 -3
- app-rn-runtime/components/navigation/navitem/navitem.component.js.map +1 -1
- app-rn-runtime/components/navigation/navitem/navitem.props.js +1 -0
- app-rn-runtime/components/navigation/navitem/navitem.props.js.map +1 -1
- app-rn-runtime/components/navigation/popover/popover.component.js +1 -1
- app-rn-runtime/components/navigation/popover/popover.component.js.map +1 -1
- app-rn-runtime/components/page/content/content.component.js +1 -1
- app-rn-runtime/components/page/content/content.component.js.map +1 -1
- app-rn-runtime/components/page/left-panel/left-panel.component.js +1 -1
- app-rn-runtime/components/page/left-panel/left-panel.component.js.map +1 -1
- app-rn-runtime/components/page/page-content/page-content.component.js +2 -2
- app-rn-runtime/components/page/page-content/page-content.component.js.map +1 -1
- app-rn-runtime/components/page/page.component.js +1 -1
- app-rn-runtime/components/page/page.component.js.map +1 -1
- app-rn-runtime/components/page/partial/partial.component.js +1 -1
- app-rn-runtime/components/page/partial/partial.component.js.map +1 -1
- app-rn-runtime/components/page/partial-container/partial-container.component.js +1 -1
- app-rn-runtime/components/page/partial-container/partial-container.component.js.map +1 -1
- app-rn-runtime/components/page/partial-container/partial-container.styles.js +2 -1
- app-rn-runtime/components/page/partial-container/partial-container.styles.js.map +1 -1
- app-rn-runtime/components/page/tabbar/tabbar.component.js +2 -1
- app-rn-runtime/components/page/tabbar/tabbar.component.js.map +1 -1
- app-rn-runtime/components/prefab/prefab-container.component.js +1 -1
- app-rn-runtime/components/prefab/prefab-container.component.js.map +1 -1
- app-rn-runtime/core/asset.provider.js +5 -0
- app-rn-runtime/core/asset.provider.js.map +1 -0
- app-rn-runtime/core/base.component.js +113 -41
- app-rn-runtime/core/base.component.js.map +1 -1
- app-rn-runtime/core/imageSizeEstimator.js +1 -0
- app-rn-runtime/core/imageSizeEstimator.js.map +1 -1
- app-rn-runtime/core/injector.js +15 -1
- app-rn-runtime/core/injector.js.map +1 -1
- app-rn-runtime/core/tappable.component.js +9 -2
- app-rn-runtime/core/tappable.component.js.map +1 -1
- app-rn-runtime/core/utils.js +6 -0
- app-rn-runtime/core/utils.js.map +1 -1
- app-rn-runtime/gestures/swipe.animation.js +105 -0
- app-rn-runtime/gestures/swipe.animation.js.map +1 -0
- app-rn-runtime/package.json +6 -5
- app-rn-runtime/runtime/App.js +24 -16
- app-rn-runtime/runtime/App.js.map +1 -1
- app-rn-runtime/runtime/App.navigator.js +2 -12
- app-rn-runtime/runtime/App.navigator.js.map +1 -1
- app-rn-runtime/runtime/base-fragment.component.js +6 -4
- app-rn-runtime/runtime/base-fragment.component.js.map +1 -1
- app-rn-runtime/runtime/navigator/drawer.navigator.js +4 -0
- app-rn-runtime/runtime/navigator/drawer.navigator.js.map +1 -1
- app-rn-runtime/runtime/navigator/stack.navigator.js +5 -1
- app-rn-runtime/runtime/navigator/stack.navigator.js.map +1 -1
- app-rn-runtime/runtime/services/app-spinner.service.js +5 -1
- app-rn-runtime/runtime/services/app-spinner.service.js.map +1 -1
- app-rn-runtime/runtime/services/app-toast.service.js +1 -1
- app-rn-runtime/runtime/services/app-toast.service.js.map +1 -1
- app-rn-runtime/runtime/services/device/camera-service.js +28 -6
- app-rn-runtime/runtime/services/device/camera-service.js.map +1 -1
- app-rn-runtime/runtime/services/device/scan-service.js +15 -14
- app-rn-runtime/runtime/services/device/scan-service.js.map +1 -1
- app-rn-runtime/styles/background.component.js +259 -0
- app-rn-runtime/styles/background.component.js.map +1 -0
- app-rn-runtime/styles/style-prop.validator.js +38 -8
- app-rn-runtime/styles/style-prop.validator.js.map +1 -1
- app-rn-runtime/styles/style-props.js +93 -0
- app-rn-runtime/styles/style-props.js.map +1 -0
- app-rn-runtime/styles/theme.js +6 -37
- app-rn-runtime/styles/theme.js.map +1 -1
- app-rn-runtime/variables/device/camera/capture-image.operation.js.map +1 -1
- app-rn-runtime/variables/device/camera/capture-video.operation.js.map +1 -1
- app-rn-runtime/variables/device/file/upload-file.operation.js +43 -21
- app-rn-runtime/variables/device/file/upload-file.operation.js.map +1 -1
- app-rn-runtime/variables/http.service.js +3 -12
- app-rn-runtime/variables/http.service.js.map +1 -1
- app-rn-runtime/variables/service-variable.js +19 -8
- app-rn-runtime/variables/service-variable.js.map +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","View","BaseComponent","BaseComponentState","DEFAULT_CLASS","WmPageState","WmPage","constructor","props","renderWidget","styles","root","children"],"sources":["page.component.tsx"],"sourcesContent":["import React from 'react';\nimport { View } from 'react-native';\n\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\n\nimport WmPageProps from './page.props';\nimport { DEFAULT_CLASS, WmPageStyles } from './page.styles';\n\nexport class WmPageState extends BaseComponentState<WmPageProps> {}\n\nexport default class WmPage extends BaseComponent<WmPageProps, WmPageState, WmPageStyles> {\n\n constructor(props: WmPageProps) {\n super(props, DEFAULT_CLASS, );\n }\n\n renderWidget(props: WmPageProps) {\n return (\n <View style={this.styles.root}>\n {props.children}\n </View>\n ); \n }\n}\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,QAAQ,cAAc;AAEnC,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,+CAA+C;AAGjG,SAASC,aAAa,QAAsB,eAAe;AAE3D,OAAO,MAAMC,WAAW,SAASF,kBAAkB,CAAc;AAEjE,eAAe,MAAMG,MAAM,SAASJ,aAAa,CAAyC;EAExFK,WAAW,CAACC,KAAkB,EAAE;IAC9B,KAAK,CAACA,KAAK,EAAEJ,aAAa,CAAG;EAC/B;EAEAK,YAAY,CAACD,KAAkB,EAAE;IAC/B,oBACE,oBAAC,IAAI;MAAC,KAAK,EAAE,IAAI,CAACE,MAAM,CAACC;IAAK,
|
|
1
|
+
{"version":3,"names":["React","View","BaseComponent","BaseComponentState","DEFAULT_CLASS","WmPageState","WmPage","constructor","props","renderWidget","styles","root","_background","children"],"sources":["page.component.tsx"],"sourcesContent":["import React from 'react';\nimport { View } from 'react-native';\n\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\n\nimport WmPageProps from './page.props';\nimport { DEFAULT_CLASS, WmPageStyles } from './page.styles';\n\nexport class WmPageState extends BaseComponentState<WmPageProps> {}\n\nexport default class WmPage extends BaseComponent<WmPageProps, WmPageState, WmPageStyles> {\n\n constructor(props: WmPageProps) {\n super(props, DEFAULT_CLASS, );\n }\n\n renderWidget(props: WmPageProps) {\n return (\n <View style={this.styles.root}>\n {this._background}\n {props.children}\n </View>\n ); \n }\n}\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,QAAQ,cAAc;AAEnC,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,+CAA+C;AAGjG,SAASC,aAAa,QAAsB,eAAe;AAE3D,OAAO,MAAMC,WAAW,SAASF,kBAAkB,CAAc;AAEjE,eAAe,MAAMG,MAAM,SAASJ,aAAa,CAAyC;EAExFK,WAAW,CAACC,KAAkB,EAAE;IAC9B,KAAK,CAACA,KAAK,EAAEJ,aAAa,CAAG;EAC/B;EAEAK,YAAY,CAACD,KAAkB,EAAE;IAC/B,oBACE,oBAAC,IAAI;MAAC,KAAK,EAAE,IAAI,CAACE,MAAM,CAACC;IAAK,GAC3B,IAAI,CAACC,WAAW,EAChBJ,KAAK,CAACK,QAAQ,CACV;EAEX;AACF"}
|
|
@@ -10,7 +10,7 @@ export default class WmPartial extends BaseComponent {
|
|
|
10
10
|
renderWidget(props) {
|
|
11
11
|
return /*#__PURE__*/React.createElement(View, {
|
|
12
12
|
style: this.styles.root
|
|
13
|
-
}, props.children);
|
|
13
|
+
}, this._background, props.children);
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
16
|
//# sourceMappingURL=partial.component.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","View","BaseComponent","BaseComponentState","DEFAULT_CLASS","WmPartialState","WmPartial","constructor","props","renderWidget","styles","root","children"],"sources":["partial.component.tsx"],"sourcesContent":["import React from 'react';\nimport { View } from 'react-native';\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\n\nimport WmPartialProps from './partial.props';\nimport { DEFAULT_CLASS, WmPartialStyles } from './partial.styles';\n\nexport class WmPartialState extends BaseComponentState<WmPartialProps> {\n\n}\n\nexport default class WmPartial extends BaseComponent<WmPartialProps, WmPartialState, WmPartialStyles> {\n\n constructor(props: WmPartialProps) {\n super(props, DEFAULT_CLASS, );\n }\n\n renderWidget(props: WmPartialProps) {\n return (\n <View style={this.styles.root}>\n {props.children}\n </View>\n ); \n }\n}\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,QAAQ,cAAc;AACnC,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,+CAA+C;AAGjG,SAASC,aAAa,QAAyB,kBAAkB;AAEjE,OAAO,MAAMC,cAAc,SAASF,kBAAkB,CAAiB;AAIvE,eAAe,MAAMG,SAAS,SAASJ,aAAa,CAAkD;EAEpGK,WAAW,CAACC,KAAqB,EAAE;IACjC,KAAK,CAACA,KAAK,EAAEJ,aAAa,CAAG;EAC/B;EAEAK,YAAY,CAACD,KAAqB,EAAE;IAClC,oBACE,oBAAC,IAAI;MAAC,KAAK,EAAE,IAAI,CAACE,MAAM,CAACC;IAAK,
|
|
1
|
+
{"version":3,"names":["React","View","BaseComponent","BaseComponentState","DEFAULT_CLASS","WmPartialState","WmPartial","constructor","props","renderWidget","styles","root","_background","children"],"sources":["partial.component.tsx"],"sourcesContent":["import React from 'react';\nimport { View } from 'react-native';\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\n\nimport WmPartialProps from './partial.props';\nimport { DEFAULT_CLASS, WmPartialStyles } from './partial.styles';\n\nexport class WmPartialState extends BaseComponentState<WmPartialProps> {\n\n}\n\nexport default class WmPartial extends BaseComponent<WmPartialProps, WmPartialState, WmPartialStyles> {\n\n constructor(props: WmPartialProps) {\n super(props, DEFAULT_CLASS, );\n }\n\n renderWidget(props: WmPartialProps) {\n return (\n <View style={this.styles.root}>\n {this._background}\n {props.children}\n </View>\n ); \n }\n}\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,QAAQ,cAAc;AACnC,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,+CAA+C;AAGjG,SAASC,aAAa,QAAyB,kBAAkB;AAEjE,OAAO,MAAMC,cAAc,SAASF,kBAAkB,CAAiB;AAIvE,eAAe,MAAMG,SAAS,SAASJ,aAAa,CAAkD;EAEpGK,WAAW,CAACC,KAAqB,EAAE;IACjC,KAAK,CAACA,KAAK,EAAEJ,aAAa,CAAG;EAC/B;EAEAK,YAAY,CAACD,KAAqB,EAAE;IAClC,oBACE,oBAAC,IAAI;MAAC,KAAK,EAAE,IAAI,CAACE,MAAM,CAACC;IAAK,GAC3B,IAAI,CAACC,WAAW,EAChBJ,KAAK,CAACK,QAAQ,CACV;EAEX;AACF"}
|
|
@@ -22,7 +22,7 @@ export default class WmPartialContainer extends BaseComponent {
|
|
|
22
22
|
delete params['partial_name'];
|
|
23
23
|
return /*#__PURE__*/React.createElement(View, {
|
|
24
24
|
style: this.styles.root
|
|
25
|
-
}, /*#__PURE__*/React.createElement(PartialConsumer, null, partialService => {
|
|
25
|
+
}, this._background, /*#__PURE__*/React.createElement(PartialConsumer, null, partialService => {
|
|
26
26
|
const partial = partialService.get(props.content);
|
|
27
27
|
return partial ? /*#__PURE__*/React.createElement(partial, params) : null;
|
|
28
28
|
}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","View","BaseComponent","BaseComponentState","WmPartialContainerProps","DEFAULT_CLASS","HideMode","PartialConsumer","WmPartialContainerState","WmPartialContainer","constructor","props","hideMode","DONOT_ADD_TO_DOM","renderWidget","params","Object","keys","forEach","k","parent","styles","root","partialService","partial","get","content","createElement"],"sources":["partial-container.component.tsx"],"sourcesContent":["import React from 'react';\nimport { View } from 'react-native';\n\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\n\nimport WmPartialContainerProps from './partial-container.props';\nimport { DEFAULT_CLASS, WmPartialContainerStyles } from './partial-container.styles';\nimport { HideMode } from '@wavemaker/app-rn-runtime/core/if.component';\nimport PartialService, { PartialConsumer } from '@wavemaker/app-rn-runtime/core/partial.service';\n\nexport class WmPartialContainerState extends BaseComponentState<WmPartialContainerProps> {}\n\nexport default class WmPartialContainer extends BaseComponent<WmPartialContainerProps, WmPartialContainerState, WmPartialContainerStyles> {\n\n constructor(props: WmPartialContainerProps) {\n super(props, DEFAULT_CLASS, new WmPartialContainerProps());\n this.hideMode = HideMode.DONOT_ADD_TO_DOM;\n }\n\n renderWidget(props: WmPartialContainerProps) {\n const params = {} as any;\n Object.keys(this.props).forEach((k: string) => {\n //@ts-ignore\n params[k] = props[k];\n });\n params.parent = this.parent;\n params['name'] = params['partial_name'];\n delete params['partial_name'];\n return (\n <View style={this.styles.root}>\n <PartialConsumer>\n {(partialService: PartialService) => {\n const partial = partialService.get(props.content);\n return partial ? React.createElement(partial, params) : null;\n }}\n </PartialConsumer>\n </View>\n ); \n }\n}\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,QAAQ,cAAc;AAEnC,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,+CAA+C;AAEjG,OAAOC,uBAAuB,MAAM,2BAA2B;AAC/D,SAASC,aAAa,QAAkC,4BAA4B;AACpF,SAASC,QAAQ,QAAQ,6CAA6C;AACtE,SAAyBC,eAAe,QAAQ,gDAAgD;AAEhG,OAAO,MAAMC,uBAAuB,SAASL,kBAAkB,CAA0B;AAEzF,eAAe,MAAMM,kBAAkB,SAASP,aAAa,CAA6E;EAExIQ,WAAW,CAACC,KAA8B,EAAE;IAC1C,KAAK,CAACA,KAAK,EAAEN,aAAa,EAAE,IAAID,uBAAuB,EAAE,CAAC;IAC1D,IAAI,CAACQ,QAAQ,GAAGN,QAAQ,CAACO,gBAAgB;EAC3C;EAEAC,YAAY,CAACH,KAA8B,EAAE;IAC3C,MAAMI,MAAM,GAAG,CAAC,CAAQ;IACxBC,MAAM,CAACC,IAAI,CAAC,IAAI,CAACN,KAAK,CAAC,CAACO,OAAO,CAAEC,CAAS,IAAK;MAC7C;MACAJ,MAAM,CAACI,CAAC,CAAC,GAAGR,KAAK,CAACQ,CAAC,CAAC;IACtB,CAAC,CAAC;IACFJ,MAAM,CAACK,MAAM,GAAG,IAAI,CAACA,MAAM;IAC3BL,MAAM,CAAC,MAAM,CAAC,GAAGA,MAAM,CAAC,cAAc,CAAC;IACvC,OAAOA,MAAM,CAAC,cAAc,CAAC;IAC7B,oBACE,oBAAC,IAAI;MAAC,KAAK,EAAE,IAAI,CAACM,MAAM,CAACC;IAAK,
|
|
1
|
+
{"version":3,"names":["React","View","BaseComponent","BaseComponentState","WmPartialContainerProps","DEFAULT_CLASS","HideMode","PartialConsumer","WmPartialContainerState","WmPartialContainer","constructor","props","hideMode","DONOT_ADD_TO_DOM","renderWidget","params","Object","keys","forEach","k","parent","styles","root","_background","partialService","partial","get","content","createElement"],"sources":["partial-container.component.tsx"],"sourcesContent":["import React from 'react';\nimport { View } from 'react-native';\n\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\n\nimport WmPartialContainerProps from './partial-container.props';\nimport { DEFAULT_CLASS, WmPartialContainerStyles } from './partial-container.styles';\nimport { HideMode } from '@wavemaker/app-rn-runtime/core/if.component';\nimport PartialService, { PartialConsumer } from '@wavemaker/app-rn-runtime/core/partial.service';\n\nexport class WmPartialContainerState extends BaseComponentState<WmPartialContainerProps> {}\n\nexport default class WmPartialContainer extends BaseComponent<WmPartialContainerProps, WmPartialContainerState, WmPartialContainerStyles> {\n\n constructor(props: WmPartialContainerProps) {\n super(props, DEFAULT_CLASS, new WmPartialContainerProps());\n this.hideMode = HideMode.DONOT_ADD_TO_DOM;\n }\n\n renderWidget(props: WmPartialContainerProps) {\n const params = {} as any;\n Object.keys(this.props).forEach((k: string) => {\n //@ts-ignore\n params[k] = props[k];\n });\n params.parent = this.parent;\n params['name'] = params['partial_name'];\n delete params['partial_name'];\n return (\n <View style={this.styles.root}>\n {this._background}\n <PartialConsumer>\n {(partialService: PartialService) => {\n const partial = partialService.get(props.content);\n return partial ? React.createElement(partial, params) : null;\n }}\n </PartialConsumer>\n </View>\n ); \n }\n}\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,QAAQ,cAAc;AAEnC,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,+CAA+C;AAEjG,OAAOC,uBAAuB,MAAM,2BAA2B;AAC/D,SAASC,aAAa,QAAkC,4BAA4B;AACpF,SAASC,QAAQ,QAAQ,6CAA6C;AACtE,SAAyBC,eAAe,QAAQ,gDAAgD;AAEhG,OAAO,MAAMC,uBAAuB,SAASL,kBAAkB,CAA0B;AAEzF,eAAe,MAAMM,kBAAkB,SAASP,aAAa,CAA6E;EAExIQ,WAAW,CAACC,KAA8B,EAAE;IAC1C,KAAK,CAACA,KAAK,EAAEN,aAAa,EAAE,IAAID,uBAAuB,EAAE,CAAC;IAC1D,IAAI,CAACQ,QAAQ,GAAGN,QAAQ,CAACO,gBAAgB;EAC3C;EAEAC,YAAY,CAACH,KAA8B,EAAE;IAC3C,MAAMI,MAAM,GAAG,CAAC,CAAQ;IACxBC,MAAM,CAACC,IAAI,CAAC,IAAI,CAACN,KAAK,CAAC,CAACO,OAAO,CAAEC,CAAS,IAAK;MAC7C;MACAJ,MAAM,CAACI,CAAC,CAAC,GAAGR,KAAK,CAACQ,CAAC,CAAC;IACtB,CAAC,CAAC;IACFJ,MAAM,CAACK,MAAM,GAAG,IAAI,CAACA,MAAM;IAC3BL,MAAM,CAAC,MAAM,CAAC,GAAGA,MAAM,CAAC,cAAc,CAAC;IACvC,OAAOA,MAAM,CAAC,cAAc,CAAC;IAC7B,oBACE,oBAAC,IAAI;MAAC,KAAK,EAAE,IAAI,CAACM,MAAM,CAACC;IAAK,GAC3B,IAAI,CAACC,WAAW,eACjB,oBAAC,eAAe,QACZC,cAA8B,IAAK;MACnC,MAAMC,OAAO,GAAGD,cAAc,CAACE,GAAG,CAACf,KAAK,CAACgB,OAAO,CAAC;MACjD,OAAOF,OAAO,gBAAGzB,KAAK,CAAC4B,aAAa,CAACH,OAAO,EAAEV,MAAM,CAAC,GAAG,IAAI;IAC9D,CAAC,CACe,CACb;EAEX;AACF"}
|
|
@@ -4,7 +4,8 @@ export const DEFAULT_CLASS = 'app-partial-container';
|
|
|
4
4
|
BASE_THEME.registerStyle((themeVariables, addStyle) => {
|
|
5
5
|
const defaultStyles = defineStyles({
|
|
6
6
|
root: {
|
|
7
|
-
width: '100%'
|
|
7
|
+
width: '100%',
|
|
8
|
+
backgroundColor: themeVariables.pageContentBgColor
|
|
8
9
|
},
|
|
9
10
|
text: {}
|
|
10
11
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["BASE_THEME","defineStyles","DEFAULT_CLASS","registerStyle","themeVariables","addStyle","defaultStyles","root","width","text"],"sources":["partial-container.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 WmPartialContainerStyles = BaseStyles & {};\n\nexport const DEFAULT_CLASS = 'app-partial-container';\nBASE_THEME.registerStyle((themeVariables, addStyle) => {\n const defaultStyles: WmPartialContainerStyles = defineStyles({\n root: {\n width: '100%'\n },\n text: {}\n });\n\n addStyle(DEFAULT_CLASS, '', defaultStyles);\n});"],"mappings":"AAAA,OAAOA,UAAU,MAAM,wCAAwC;AAC/D,SAAqBC,YAAY,QAAQ,+CAA+C;AAIxF,OAAO,MAAMC,aAAa,GAAG,uBAAuB;AACpDF,UAAU,CAACG,aAAa,CAAC,CAACC,cAAc,EAAEC,QAAQ,KAAK;EACnD,MAAMC,aAAuC,GAAGL,YAAY,CAAC;IACzDM,IAAI,EAAE;MACFC,KAAK,EAAE;
|
|
1
|
+
{"version":3,"names":["BASE_THEME","defineStyles","DEFAULT_CLASS","registerStyle","themeVariables","addStyle","defaultStyles","root","width","backgroundColor","pageContentBgColor","text"],"sources":["partial-container.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 WmPartialContainerStyles = BaseStyles & {};\n\nexport const DEFAULT_CLASS = 'app-partial-container';\nBASE_THEME.registerStyle((themeVariables, addStyle) => {\n const defaultStyles: WmPartialContainerStyles = defineStyles({\n root: {\n width: '100%',\n backgroundColor: themeVariables.pageContentBgColor\n },\n text: {}\n });\n\n addStyle(DEFAULT_CLASS, '', defaultStyles);\n});"],"mappings":"AAAA,OAAOA,UAAU,MAAM,wCAAwC;AAC/D,SAAqBC,YAAY,QAAQ,+CAA+C;AAIxF,OAAO,MAAMC,aAAa,GAAG,uBAAuB;AACpDF,UAAU,CAACG,aAAa,CAAC,CAACC,cAAc,EAAEC,QAAQ,KAAK;EACnD,MAAMC,aAAuC,GAAGL,YAAY,CAAC;IACzDM,IAAI,EAAE;MACFC,KAAK,EAAE,MAAM;MACbC,eAAe,EAAEL,cAAc,CAACM;IACpC,CAAC;IACDC,IAAI,EAAE,CAAC;EACX,CAAC,CAAC;EAEFN,QAAQ,CAACH,aAAa,EAAE,EAAE,EAAEI,aAAa,CAAC;AAC9C,CAAC,CAAC"}
|
|
@@ -24,6 +24,7 @@ export default class WmTabbar extends BaseNavComponent {
|
|
|
24
24
|
}
|
|
25
25
|
renderTabItem(item, props, onSelect) {
|
|
26
26
|
const isActive = props.isActive && props.isActive(item);
|
|
27
|
+
const getDisplayLabel = this.props.getDisplayExpression || (label => label);
|
|
27
28
|
return /*#__PURE__*/React.createElement(TouchableOpacity, {
|
|
28
29
|
onPress: () => onSelect && onSelect(),
|
|
29
30
|
key: item.key
|
|
@@ -34,7 +35,7 @@ export default class WmTabbar extends BaseNavComponent {
|
|
|
34
35
|
iconclass: item.icon
|
|
35
36
|
}), /*#__PURE__*/React.createElement(Text, {
|
|
36
37
|
style: [this.styles.tabLabel, isActive ? this.styles.activeTabLabel : {}]
|
|
37
|
-
}, item.label)));
|
|
38
|
+
}, getDisplayLabel(item.label))));
|
|
38
39
|
}
|
|
39
40
|
onItemSelect(item, navigationService) {
|
|
40
41
|
item.link && navigationService.openUrl(item.link);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","Text","View","TouchableOpacity","ThemeProvider","ModalConsumer","WmIcon","NavigationServiceConsumer","BaseNavComponent","BaseNavState","WmTabbarProps","DEFAULT_CLASS","WmTabbarState","WmTabbar","constructor","props","renderTabItem","item","onSelect","isActive","key","styles","tabItem","activeTabItem","theme","mergeStyle","tabIcon","activeTabIcon","icon","tabLabel","activeTabLabel","
|
|
1
|
+
{"version":3,"names":["React","Text","View","TouchableOpacity","ThemeProvider","ModalConsumer","WmIcon","NavigationServiceConsumer","BaseNavComponent","BaseNavState","WmTabbarProps","DEFAULT_CLASS","WmTabbarState","WmTabbar","constructor","props","renderTabItem","item","onSelect","isActive","getDisplayLabel","getDisplayExpression","label","key","styles","tabItem","activeTabItem","theme","mergeStyle","tabIcon","activeTabIcon","icon","tabLabel","activeTabLabel","onItemSelect","navigationService","link","openUrl","invokeEventCallback","proxy","prepareModalOptions","content","o","state","modalOptions","modalStyle","bottom","tabbarHeight","contentStyle","modalContent","renderWidget","max","tabItems","dataItems","moreItems","length","moreItemsCount","Math","ceil","j","i","row","push","root","modalService","showMore","showModal","moreMenu","map","a","moreMenuRow","hideModal","menu","e","nativeEvent","layout","height","filter","morebuttonlabel","morebuttoniconclass","updateState"],"sources":["tabbar.component.tsx"],"sourcesContent":["import React, { ReactNode } from 'react';\nimport { Text, View, TouchableOpacity } from 'react-native';\n\nimport { ThemeProvider } from '@wavemaker/app-rn-runtime/styles/theme';\nimport { ModalConsumer, ModalOptions, ModalService } from '@wavemaker/app-rn-runtime/core/modal.service';\nimport WmIcon from '@wavemaker/app-rn-runtime/components/basic/icon/icon.component';\nimport NavigationService, { NavigationServiceConsumer } from '@wavemaker/app-rn-runtime/core/navigation.service';\nimport { BaseNavProps } from '@wavemaker/app-rn-runtime/components/navigation/basenav/basenav.props';\nimport { BaseNavComponent, BaseNavState, NavigationDataItem } from '@wavemaker/app-rn-runtime/components/navigation/basenav/basenav.component';\n\nimport WmTabbarProps from './tabbar.props';\nimport { DEFAULT_CLASS, WmTabbarStyles } from './tabbar.styles';\n\nclass WmTabbarState<T extends BaseNavProps> extends BaseNavState<T>{\n showMore = false;\n modalOptions = {} as ModalOptions;\n}\n\nexport default class WmTabbar extends BaseNavComponent<WmTabbarProps, WmTabbarState<WmTabbarProps>, WmTabbarStyles> {\n\n private tabbarHeight = 0;\n\n constructor(props: WmTabbarProps) {\n super(props, DEFAULT_CLASS, new WmTabbarProps(), new WmTabbarState());\n }\n\n renderTabItem(item: NavigationDataItem, props: WmTabbarProps, onSelect: Function) {\n const isActive = props.isActive && props.isActive(item);\n const getDisplayLabel = this.props.getDisplayExpression || ((label: string) => label);\n return (\n <TouchableOpacity onPress={() => onSelect && onSelect()} key={item.key}>\n <View style={[this.styles.tabItem, isActive ? this.styles.activeTabItem: {}]}>\n <WmIcon styles={this.theme.mergeStyle({}, this.styles.tabIcon, isActive ? this.styles.activeTabIcon: {})} iconclass={item.icon}></WmIcon>\n <Text style={[this.styles.tabLabel, isActive ? this.styles.activeTabLabel: {}]}>{getDisplayLabel(item.label)}</Text>\n </View>\n </TouchableOpacity>\n );\n }\n\n onItemSelect(item: NavigationDataItem, navigationService: NavigationService) {\n item.link && navigationService.openUrl(item.link);\n this.invokeEventCallback('onSelect', [null, this.proxy, item]);\n }\n\n prepareModalOptions(content: ReactNode) {\n const o = this.state.modalOptions;\n o.content = content;\n o.modalStyle = {\n bottom: this.tabbarHeight\n };\n o.contentStyle = this.styles.modalContent; \n return o;\n }\n\n renderWidget(props: WmTabbarProps) {\n let max = 5;\n const tabItems = this.state.dataItems;\n const moreItems = [] as any[][];\n if (tabItems.length > max) {\n const moreItemsCount = Math.ceil((tabItems.length + 1 - max)/ max) * max;\n let j = 0;\n for (let i = max-1; i < moreItemsCount;) {\n const row = [];\n for (let j = 0; j < max; j++) {\n row[j] = tabItems[i++] || {key: 'tabItem' + i} as NavigationDataItem;\n }\n moreItems.push(row);\n }\n max = max - 1;\n }\n return (\n <NavigationServiceConsumer>\n {(navigationService) =>\n (<View style={this.styles.root}>\n <ModalConsumer>\n {(modalService: ModalService) => {\n if (this.state.showMore) {\n modalService.showModal(this.prepareModalOptions((\n <ThemeProvider value={this.theme} >\n <View style={this.styles.moreMenu}>\n {moreItems.map((a, i) =>\n (<View key={i} style={this.styles.moreMenuRow}>\n {a.map(item => this.renderTabItem(item, props, () => this.onItemSelect(item, navigationService)))}\n </View>)\n )}\n </View>\n </ThemeProvider>)));\n } else {\n modalService.hideModal(this.state.modalOptions);\n }\n return null;\n }}\n </ModalConsumer>\n <View style={this.styles.menu}\n onLayout={e => { this.tabbarHeight = e.nativeEvent.layout.height}}>\n {tabItems.filter((item, i) => i < max)\n .map((item, i) => this.renderTabItem(item, props, () => this.onItemSelect(item, navigationService)))}\n {tabItems.length > max && (\n this.renderTabItem({\n label: props.morebuttonlabel,\n icon: props.morebuttoniconclass\n } as NavigationDataItem, props, () => {\n this.updateState({showMore: !this.state.showMore} as WmTabbarState<WmTabbarProps>);\n })\n )}\n </View>\n </View>)}\n </NavigationServiceConsumer>\n );\n }\n}\n"],"mappings":";;;AAAA,OAAOA,KAAK,MAAqB,OAAO;AACxC,SAASC,IAAI,EAAEC,IAAI,EAAEC,gBAAgB,QAAQ,cAAc;AAE3D,SAASC,aAAa,QAAQ,wCAAwC;AACtE,SAASC,aAAa,QAAoC,8CAA8C;AACxG,OAAOC,MAAM,MAAM,gEAAgE;AACnF,SAA4BC,yBAAyB,QAAQ,mDAAmD;AAEhH,SAASC,gBAAgB,EAAEC,YAAY,QAA4B,2EAA2E;AAE9I,OAAOC,aAAa,MAAM,gBAAgB;AAC1C,SAASC,aAAa,QAAwB,iBAAiB;AAE/D,MAAMC,aAAa,SAAiCH,YAAY,CAAG;EAAA;IAAA;IAAA,kCACtD,KAAK;IAAA,sCACD,CAAC,CAAC;EAAA;AACnB;AAEA,eAAe,MAAMI,QAAQ,SAASL,gBAAgB,CAA8D;EAIlHM,WAAW,CAACC,KAAoB,EAAE;IAChC,KAAK,CAACA,KAAK,EAAEJ,aAAa,EAAE,IAAID,aAAa,EAAE,EAAE,IAAIE,aAAa,EAAE,CAAC;IAAC,sCAHjD,CAAC;EAIxB;EAEAI,aAAa,CAACC,IAAwB,EAAEF,KAAoB,EAAEG,QAAkB,EAAE;IAChF,MAAMC,QAAQ,GAAGJ,KAAK,CAACI,QAAQ,IAAIJ,KAAK,CAAC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E,KAAK,EAAG,MAAM;MACrC,IAAI,CAACiE,WAAW,CAAC;QAACf,QAAQ,EAAE,CAAC,IAAI,CAACtB,KAAK,CAACsB;MAAQ,CAAC,CAAiC;IACpF,CAAC,CACF,CACI,CACD,CACkB;EAEhC;AACF"}
|
|
@@ -10,7 +10,7 @@ export default class WmPrefabContainer extends BaseComponent {
|
|
|
10
10
|
renderWidget(props) {
|
|
11
11
|
return /*#__PURE__*/React.createElement(View, {
|
|
12
12
|
style: this.styles.root
|
|
13
|
-
}, props.children);
|
|
13
|
+
}, this._background, props.children);
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
16
|
//# sourceMappingURL=prefab-container.component.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","View","BaseComponent","BaseComponentState","DEFAULT_CLASS","WmPrefabContainerState","WmPrefabContainer","constructor","props","renderWidget","styles","root","children"],"sources":["prefab-container.component.tsx"],"sourcesContent":["import React from 'react';\nimport { View } from 'react-native';\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\n\nimport WmPrefabContainerProps from './prefab-container.props';\nimport { DEFAULT_CLASS, WmPrefabContainerStyles } from './prefab-container.styles';\n\nexport class WmPrefabContainerState extends BaseComponentState<WmPrefabContainerProps> {\n\n}\n\nexport default class WmPrefabContainer extends BaseComponent<WmPrefabContainerProps, WmPrefabContainerState, WmPrefabContainerStyles> {\n\n constructor(props: WmPrefabContainerProps) {\n super(props, DEFAULT_CLASS, );\n }\n\n renderWidget(props: WmPrefabContainerProps) {\n return (\n <View style={this.styles.root}>\n {props.children}\n </View>\n ); \n }\n}\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,QAAQ,cAAc;AACnC,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,+CAA+C;AAGjG,SAASC,aAAa,QAAiC,2BAA2B;AAElF,OAAO,MAAMC,sBAAsB,SAASF,kBAAkB,CAAyB;AAIvF,eAAe,MAAMG,iBAAiB,SAASJ,aAAa,CAA0E;EAEpIK,WAAW,CAACC,KAA6B,EAAE;IACzC,KAAK,CAACA,KAAK,EAAEJ,aAAa,CAAG;EAC/B;EAEAK,YAAY,CAACD,KAA6B,EAAE;IAC1C,oBACE,oBAAC,IAAI;MAAC,KAAK,EAAE,IAAI,CAACE,MAAM,CAACC;IAAK,
|
|
1
|
+
{"version":3,"names":["React","View","BaseComponent","BaseComponentState","DEFAULT_CLASS","WmPrefabContainerState","WmPrefabContainer","constructor","props","renderWidget","styles","root","_background","children"],"sources":["prefab-container.component.tsx"],"sourcesContent":["import React from 'react';\nimport { View } from 'react-native';\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\n\nimport WmPrefabContainerProps from './prefab-container.props';\nimport { DEFAULT_CLASS, WmPrefabContainerStyles } from './prefab-container.styles';\n\nexport class WmPrefabContainerState extends BaseComponentState<WmPrefabContainerProps> {\n\n}\n\nexport default class WmPrefabContainer extends BaseComponent<WmPrefabContainerProps, WmPrefabContainerState, WmPrefabContainerStyles> {\n\n constructor(props: WmPrefabContainerProps) {\n super(props, DEFAULT_CLASS, );\n }\n\n renderWidget(props: WmPrefabContainerProps) {\n return (\n <View style={this.styles.root}>\n {this._background}\n {props.children}\n </View>\n ); \n }\n}\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,QAAQ,cAAc;AACnC,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,+CAA+C;AAGjG,SAASC,aAAa,QAAiC,2BAA2B;AAElF,OAAO,MAAMC,sBAAsB,SAASF,kBAAkB,CAAyB;AAIvF,eAAe,MAAMG,iBAAiB,SAASJ,aAAa,CAA0E;EAEpIK,WAAW,CAACC,KAA6B,EAAE;IACzC,KAAK,CAACA,KAAK,EAAEJ,aAAa,CAAG;EAC/B;EAEAK,YAAY,CAACD,KAA6B,EAAE;IAC1C,oBACE,oBAAC,IAAI;MAAC,KAAK,EAAE,IAAI,CAACE,MAAM,CAACC;IAAK,GAC3B,IAAI,CAACC,WAAW,EAChBJ,KAAK,CAACK,QAAQ,CACV;EAEX;AACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","AssetContext","createContext","AssetProvider","Provider","AssetConsumer","Consumer"],"sources":["asset.provider.ts"],"sourcesContent":["import React from 'react';\n\nconst AssetContext = React.createContext<(path: string) => number | string>(null as any);\n\nexport const AssetProvider = AssetContext.Provider;\nexport const AssetConsumer = AssetContext.Consumer;"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AAEzB,MAAMC,YAAY,gBAAGD,KAAK,CAACE,aAAa,CAAoC,IAAI,CAAQ;AAExF,OAAO,MAAMC,aAAa,GAAGF,YAAY,CAACG,QAAQ;AAClD,OAAO,MAAMC,aAAa,GAAGJ,YAAY,CAACK,QAAQ"}
|
|
@@ -1,20 +1,28 @@
|
|
|
1
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
1
2
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
2
3
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
3
4
|
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
4
5
|
import { assign, isUndefined } from 'lodash';
|
|
5
6
|
import React from 'react';
|
|
7
|
+
import * as Animatable from 'react-native-animatable';
|
|
6
8
|
import ThemeVariables from '@wavemaker/app-rn-runtime/styles/theme.variables';
|
|
9
|
+
import { StyleProps, getStyleName } from '@wavemaker/app-rn-runtime/styles/style-props';
|
|
10
|
+
import { BackgroundComponent } from '@wavemaker/app-rn-runtime/styles/background.component';
|
|
7
11
|
import { ROOT_LOGGER } from '@wavemaker/app-rn-runtime/core/logger';
|
|
8
12
|
import { deepCopy } from '@wavemaker/app-rn-runtime/core/utils';
|
|
9
|
-
import BASE_THEME, { ThemeConsumer,
|
|
13
|
+
import BASE_THEME, { ThemeConsumer, ThemeEvent } from '../styles/theme';
|
|
14
|
+
import EventNotifier from './event-notifier';
|
|
10
15
|
import { PropsProvider } from './props.provider';
|
|
11
16
|
import { assignIn } from 'lodash-es';
|
|
12
17
|
import { HideMode } from './if.component';
|
|
18
|
+
import { AssetConsumer } from './asset.provider';
|
|
13
19
|
import { FixedView } from './fixed-view.component';
|
|
14
20
|
export const WIDGET_LOGGER = ROOT_LOGGER.extend('widget');
|
|
15
21
|
export const ParentContext = /*#__PURE__*/React.createContext(null);
|
|
16
22
|
export class BaseComponentState {
|
|
17
23
|
constructor() {
|
|
24
|
+
_defineProperty(this, "animationId", 0);
|
|
25
|
+
_defineProperty(this, "animatableProps", undefined);
|
|
18
26
|
_defineProperty(this, "props", {});
|
|
19
27
|
_defineProperty(this, "hide", false);
|
|
20
28
|
}
|
|
@@ -26,8 +34,9 @@ export function defineStyles(styles) {
|
|
|
26
34
|
}
|
|
27
35
|
}, styles);
|
|
28
36
|
}
|
|
29
|
-
export class BaseProps {
|
|
37
|
+
export class BaseProps extends StyleProps {
|
|
30
38
|
constructor() {
|
|
39
|
+
super(...arguments);
|
|
31
40
|
_defineProperty(this, "id", null);
|
|
32
41
|
_defineProperty(this, "name", null);
|
|
33
42
|
_defineProperty(this, "key", null);
|
|
@@ -56,9 +65,24 @@ export class BaseComponent extends React.Component {
|
|
|
56
65
|
_defineProperty(this, "destroyed", false);
|
|
57
66
|
_defineProperty(this, "_showSkeleton", false);
|
|
58
67
|
_defineProperty(this, "isFixed", false);
|
|
68
|
+
_defineProperty(this, "notifier", new EventNotifier());
|
|
69
|
+
_defineProperty(this, "parentListenerDestroyers", []);
|
|
70
|
+
_defineProperty(this, "_background", /*#__PURE__*/React.createElement(React.Fragment, null));
|
|
71
|
+
_defineProperty(this, "styleOverrides", {});
|
|
72
|
+
_defineProperty(this, "loadAsset", null);
|
|
59
73
|
this.state = defaultState || {};
|
|
60
74
|
this.propertyProvider = new PropsProvider(assign({}, defaultProps), assign({}, markupProps), (name, $new, $old) => {
|
|
61
75
|
WIDGET_LOGGER.debug(() => `${this.props.name ?? this.constructor.name}: ${name} changed from ${$old} to ${$new}`);
|
|
76
|
+
if (this.initialized) {
|
|
77
|
+
const styleName = getStyleName(name);
|
|
78
|
+
if (styleName) {
|
|
79
|
+
if ($new === undefined) {
|
|
80
|
+
delete this.styleOverrides[styleName];
|
|
81
|
+
} else {
|
|
82
|
+
this.styleOverrides[styleName] = $new;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
62
86
|
this.onPropertyChange(name, $new, $old);
|
|
63
87
|
});
|
|
64
88
|
//@ts-ignore
|
|
@@ -95,6 +119,18 @@ export class BaseComponent extends React.Component {
|
|
|
95
119
|
this.cleanup.push(this.theme.subscribe(ThemeEvent.CHANGE, () => {
|
|
96
120
|
this.forceUpdate();
|
|
97
121
|
}));
|
|
122
|
+
this.cleanup.push(() => {
|
|
123
|
+
this.destroyParentListeners();
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
subscribe(event, fn) {
|
|
127
|
+
return this.notifier.subscribe(event, fn);
|
|
128
|
+
}
|
|
129
|
+
animate(props) {
|
|
130
|
+
this.setState({
|
|
131
|
+
animationId: Date.now(),
|
|
132
|
+
animatableProps: props
|
|
133
|
+
});
|
|
98
134
|
}
|
|
99
135
|
setProp(propName, value) {
|
|
100
136
|
this.propertyProvider.set(propName, value);
|
|
@@ -193,6 +229,7 @@ export class BaseComponent extends React.Component {
|
|
|
193
229
|
this.props.listener.onComponentDestroy(this.proxy);
|
|
194
230
|
}
|
|
195
231
|
this.cleanup.forEach(f => f && f());
|
|
232
|
+
this.notifier.notify('destroy', []);
|
|
196
233
|
}
|
|
197
234
|
invokeEventCallback(eventName, args) {
|
|
198
235
|
//@ts-ignore
|
|
@@ -214,19 +251,24 @@ export class BaseComponent extends React.Component {
|
|
|
214
251
|
this.forceUpdate();
|
|
215
252
|
}
|
|
216
253
|
cleanRefresh() {
|
|
217
|
-
this.
|
|
218
|
-
hide: true
|
|
219
|
-
}, () => {
|
|
220
|
-
setTimeout(() => {
|
|
221
|
-
this.setState({
|
|
222
|
-
hide: false
|
|
223
|
-
});
|
|
224
|
-
}, 100);
|
|
225
|
-
});
|
|
254
|
+
this.forceUpdate(() => this.notifier.notify('forceUpdate', []));
|
|
226
255
|
}
|
|
227
256
|
renderSkeleton(props) {
|
|
228
257
|
return null;
|
|
229
258
|
}
|
|
259
|
+
destroyParentListeners() {
|
|
260
|
+
this.parentListenerDestroyers.map(fn => fn());
|
|
261
|
+
}
|
|
262
|
+
setParent(parent) {
|
|
263
|
+
if (parent && this.parent !== parent) {
|
|
264
|
+
this.parent = parent;
|
|
265
|
+
this.parentListenerDestroyers = [this.parent.subscribe('forceUpdate', () => {
|
|
266
|
+
this.cleanRefresh();
|
|
267
|
+
}), this.parent.subscribe('destroy', () => {
|
|
268
|
+
this.destroyParentListeners();
|
|
269
|
+
})];
|
|
270
|
+
}
|
|
271
|
+
}
|
|
230
272
|
copyStyles(property, from, to) {
|
|
231
273
|
if (!isUndefined(from[property])) {
|
|
232
274
|
to[property] = from[property];
|
|
@@ -254,7 +296,33 @@ export class BaseComponent extends React.Component {
|
|
|
254
296
|
return /*#__PURE__*/React.createElement(FixedView, {
|
|
255
297
|
style: style,
|
|
256
298
|
theme: this.theme
|
|
257
|
-
}, this.renderWidget(props));
|
|
299
|
+
}, this.addAnimation(this.renderWidget(props)));
|
|
300
|
+
}
|
|
301
|
+
addAnimation(n) {
|
|
302
|
+
if (!this.state.animatableProps) {
|
|
303
|
+
return n;
|
|
304
|
+
}
|
|
305
|
+
return /*#__PURE__*/React.createElement(Animatable.View, _extends({
|
|
306
|
+
key: this.state.animationId
|
|
307
|
+
}, this.state.animatableProps), n);
|
|
308
|
+
}
|
|
309
|
+
setBackground() {
|
|
310
|
+
const bgStyle = this.styles.root;
|
|
311
|
+
this._background = /*#__PURE__*/React.createElement(BackgroundComponent, {
|
|
312
|
+
image: bgStyle.backgroundImage,
|
|
313
|
+
position: bgStyle.backgroundPosition,
|
|
314
|
+
size: bgStyle.backgroundSize,
|
|
315
|
+
repeat: bgStyle.backgroundRepeat,
|
|
316
|
+
resizeMode: bgStyle.backgroundResizeMode,
|
|
317
|
+
style: {
|
|
318
|
+
borderRadius: this.styles.root.borderRadius
|
|
319
|
+
}
|
|
320
|
+
});
|
|
321
|
+
delete this.styles.root['backgroundImage'];
|
|
322
|
+
delete this.styles.root['backgroundPosition'];
|
|
323
|
+
delete this.styles.root['backgroundResizeMode'];
|
|
324
|
+
delete this.styles.root['backgroundSize'];
|
|
325
|
+
delete this.styles.root['backgroundRepeat'];
|
|
258
326
|
}
|
|
259
327
|
render() {
|
|
260
328
|
WIDGET_LOGGER.info(() => `${this.props.name ?? this.constructor.name} is rendering.`);
|
|
@@ -263,35 +331,39 @@ export class BaseComponent extends React.Component {
|
|
|
263
331
|
return null;
|
|
264
332
|
}
|
|
265
333
|
this.isFixed = false;
|
|
266
|
-
return /*#__PURE__*/React.createElement(
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
334
|
+
return /*#__PURE__*/React.createElement(AssetConsumer, null, loadAsset => {
|
|
335
|
+
this.loadAsset = loadAsset;
|
|
336
|
+
return /*#__PURE__*/React.createElement(ParentContext.Consumer, null, parent => {
|
|
337
|
+
var _this$parent;
|
|
338
|
+
this.setParent(parent);
|
|
339
|
+
this._showSkeleton = ((_this$parent = this.parent) === null || _this$parent === void 0 ? void 0 : _this$parent._showSkeleton) || !!this.state.props.showskeleton;
|
|
340
|
+
return /*#__PURE__*/React.createElement(ParentContext.Provider, {
|
|
341
|
+
value: this
|
|
342
|
+
}, /*#__PURE__*/React.createElement(ThemeConsumer, null, theme => {
|
|
343
|
+
this.theme = theme || BASE_THEME;
|
|
344
|
+
this.styles = this.theme.mergeStyle(this.getDefaultStyles(), props.disabled ? this.theme.getStyle(this.defaultClass + '-disabled') : null, props.classname && this.theme.getStyle(props.classname), props.showindevice && this.theme.getStyle('d-all-none ' + props.showindevice.map(d => `d-${d}-flex`).join(' ')), this.props.styles, {
|
|
345
|
+
root: this.styleOverrides,
|
|
346
|
+
text: this.styleOverrides
|
|
347
|
+
});
|
|
348
|
+
if (this.styles.root.hasOwnProperty('_background')) {
|
|
349
|
+
delete this.styles.root.backgroundColor;
|
|
350
|
+
}
|
|
351
|
+
if (!this.isVisible()) {
|
|
352
|
+
assign(this.styles, this.theme.getStyle('hidden'));
|
|
353
|
+
}
|
|
354
|
+
let eleToRender = this._showSkeleton && this.renderSkeleton(props);
|
|
355
|
+
if (eleToRender) {
|
|
356
|
+
return eleToRender;
|
|
357
|
+
}
|
|
358
|
+
this.setBackground();
|
|
359
|
+
this.isFixed = this.styles.root.position === 'fixed';
|
|
360
|
+
if (this.isFixed) {
|
|
361
|
+
this.styles.root.position = undefined;
|
|
362
|
+
return this.renderFixedContainer(props);
|
|
363
|
+
}
|
|
364
|
+
return this.addAnimation(this.renderWidget(this.state.props));
|
|
365
|
+
}));
|
|
366
|
+
});
|
|
295
367
|
});
|
|
296
368
|
}
|
|
297
369
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["assign","isUndefined","React","ThemeVariables","ROOT_LOGGER","deepCopy","BASE_THEME","ThemeConsumer","attachBackground","ThemeEvent","PropsProvider","assignIn","HideMode","FixedView","WIDGET_LOGGER","extend","ParentContext","createContext","BaseComponentState","defineStyles","styles","text","fontFamily","INSTANCE","baseFont","BaseProps","BaseComponent","Component","constructor","markupProps","defaultClass","defaultProps","defaultState","ADD_TO_DOM","state","propertyProvider","name","$new","$old","debug","props","onPropertyChange","get","check","proxy","Proxy","target","prop","receiver","propName","toString","has","Reflect","set","value","updateState","cleanup","push","updateStateTimeouts","forEach","v","clearTimeout","theme","subscribe","CHANGE","forceUpdate","setProp","setPropDefault","setDefault","initialized","cleanRefresh","getDefaultStyles","getStyle","reset","newPartialState","callback","destroyed","stateFn","oldState","oldProps","newState","Object","keys","k","onUpdateState","listener","onComponentChange","timeoutId","setTimeout","setState","splice","indexOf","shouldComponentUpdate","nextProps","nextState","nextContext","key","componentDidMount","onComponentInit","componentWillAttach","isFixed","hide","componentWillDetach","componentWillUnmount","onComponentDestroy","f","invokeEventCallback","eventName","args","callBack","map","a","apply","e","console","error","isVisible","show","refresh","renderSkeleton","copyStyles","property","from","to","renderFixedContainer","style","rootStyle","left","top","bottom","right","width","height","root","mergeStyle","renderWidget","render","info","hideMode","DONOT_ADD_TO_DOM","parent","_showSkeleton","showskeleton","disabled","classname","showindevice","d","join","hasOwnProperty","backgroundColor","eleToRender","widgetElement","position","undefined"],"sources":["base.component.tsx"],"sourcesContent":["import { assign, isEqual, isUndefined } from 'lodash';\nimport React, { ReactNode } from 'react';\nimport { TextStyle, ViewStyle } from 'react-native';\nimport ThemeVariables from '@wavemaker/app-rn-runtime/styles/theme.variables';\nimport { ROOT_LOGGER } from '@wavemaker/app-rn-runtime/core/logger';\nimport { deepCopy } from '@wavemaker/app-rn-runtime/core/utils';\nimport BASE_THEME, { NamedStyles, AllStyle, ThemeConsumer, attachBackground, ThemeEvent } from '../styles/theme';\nimport { PropsProvider } from './props.provider';\nimport { assignIn } from 'lodash-es';\nimport { HideMode } from './if.component';\nimport { FixedView } from './fixed-view.component';\n\nexport const WIDGET_LOGGER = ROOT_LOGGER.extend('widget');\n\nexport const ParentContext = React.createContext(null as any);\n\nexport class BaseComponentState<T extends BaseProps> {\n public props = {} as T;\n public hide? = false;\n}\n\nexport type BaseStyles = NamedStyles<any> & {\n root: AllStyle,\n text: TextStyle\n}\n\nexport function defineStyles<T>(styles: T): T {\n return deepCopy({\n text: {\n fontFamily: ThemeVariables.INSTANCE.baseFont\n }\n }, styles);\n}\n\nexport interface LifecycleListener {\n onComponentChange?: (c: BaseComponent<any, any, any>) => void;\n onComponentInit?: (c: BaseComponent<any, any, any>) => void;\n onComponentDestroy?: (c: BaseComponent<any, any, any>) => void;\n}\n\nexport class BaseProps {\n id?: string = null as any;\n name?: string = null as any;\n key?: any = null as any;\n disabled? = false;\n show? = true as Boolean | String | Number;\n styles?: any = null;\n classname?: string = null as any;\n listener?: LifecycleListener = null as any;\n showindevice?: ('xs'|'sm'|'md'|'lg'|'xl'|'xxl')[] = null as any;\n showskeleton?: boolean = false;\n}\n\nexport abstract class BaseComponent<T extends BaseProps, S extends BaseComponentState<T>, L extends BaseStyles> extends React.Component<T, S> {\n public styles: L = null as any;\n public hideMode = HideMode.ADD_TO_DOM;\n private propertyProvider: PropsProvider<T>;\n public proxy: BaseComponent<T, S, L>;\n public initialized = false;\n public cleanup = [] as Function[];\n public theme = BASE_THEME;\n public updateStateTimeouts= [] as NodeJS.Timeout[];\n public parent: BaseComponent<any, any, any> = null as any;\n public destroyed = false;\n public _showSkeleton = false;\n public isFixed = false;\n\n constructor(markupProps: T, public defaultClass: string, defaultProps?: T, defaultState?: S) {\n super(markupProps);\n this.state = (defaultState || {} as S);\n this.propertyProvider = new PropsProvider<T>(\n assign({}, defaultProps),\n assign({}, markupProps),\n (name: string, $new: any, $old: any) => {\n WIDGET_LOGGER.debug(() => `${this.props.name ?? this.constructor.name}: ${name} changed from ${$old} to ${$new}`);\n this.onPropertyChange(name, $new, $old);\n });\n //@ts-ignore\n this.state.props =this.propertyProvider.get();\n this.propertyProvider.check();\n //@ts-ignore\n this.proxy = (new Proxy(this, {\n get: (target, prop, receiver): any => {\n const propName = prop.toString();\n if (this.propertyProvider.has(propName)) {\n //@ts-ignore\n return this.state.props[propName];\n }\n return Reflect.get(target, prop, receiver);\n },\n set: (target: any, prop, value: any): any => {\n const propName = prop.toString();\n if (this.propertyProvider.has(propName)) {\n // @ts-ignore\n const props = {} as any;\n props[propName] = value;\n this.updateState({\n props: props\n } as S);\n return true;\n } else {\n return Reflect.set(target, prop, value);\n }\n }\n }));\n this.cleanup.push(() => {\n this.updateStateTimeouts.forEach(v => clearTimeout(v));\n });\n this.cleanup.push(this.theme.subscribe(ThemeEvent.CHANGE, () => {\n this.forceUpdate();\n }));\n }\n\n setProp(propName: string, value: any) {\n this.propertyProvider.set(propName, value);\n this.updateState({props:{}} as S);\n }\n\n setPropDefault(propName: string, value: any) {\n this.propertyProvider.setDefault(propName, value);\n }\n\n onPropertyChange(name: string, $new: any, $old: any) {\n switch(name) {\n case 'showskeleton': {\n if (this.initialized) {\n this.cleanRefresh();\n }\n }\n }\n }\n\n getDefaultStyles() {\n return this.theme.getStyle(this.defaultClass);\n }\n\n reset() {\n\n }\n\n updateState(newPartialState: S, callback?: ()=>void) {\n if (this.destroyed) {\n return;\n }\n const stateFn = (oldState: S) => {\n const oldProps = oldState.props;\n const newState = this.initialized ? assignIn({}, oldState, newPartialState) : assignIn(oldState, newPartialState);\n if (newPartialState.props) {\n Object.keys(newPartialState.props).forEach((k) => {\n //@ts-ignore\n oldProps[k] = newState.props[k];\n });\n newState.props = oldProps;\n }\n return newState;\n };\n const onUpdateState = () => {\n callback && callback();\n this.props.listener?.onComponentChange\n && this.props.listener?.onComponentChange(this);\n }\n if (!this.initialized) {\n this.state = stateFn(this.state);\n onUpdateState();\n } else {\n const timeoutId = setTimeout(() => {\n this.setState(stateFn, onUpdateState);\n this.updateStateTimeouts.splice(this.updateStateTimeouts.indexOf(timeoutId), 1);\n });\n this.updateStateTimeouts.push(timeoutId);\n }\n }\n\n shouldComponentUpdate(nextProps: T, nextState: S, nextContext: any) {\n if (this.propertyProvider.check(nextProps)) {\n return true;\n }\n for(let key in nextState) {\n if(key !== 'props' && (!(key in this.state) || nextState[key] !== this.state[key])) {\n return true;\n }\n }\n\n for(let key in this.state) {\n if(key !== 'props' && (!(key in nextState) || this.state[key] !== nextState[key])) {\n return true;\n }\n }\n return false;\n }\n\n componentDidMount() {\n if (this.props.listener && this.props.listener.onComponentInit) {\n this.props.listener.onComponentInit(this.proxy);\n }\n this.initialized = true;\n }\n\n componentWillAttach() {\n if (this.isFixed) {\n this.setState({hide: false});\n }\n }\n\n componentWillDetach() {\n if (this.isFixed) {\n this.setState({hide: true});\n }\n }\n\n componentWillUnmount() {\n this.destroyed = true;\n if (this.props.listener && this.props.listener.onComponentDestroy) {\n this.props.listener.onComponentDestroy(this.proxy);\n }\n this.cleanup.forEach(f => f && f());\n }\n\n invokeEventCallback(eventName: string, args: any[]) {\n //@ts-ignore\n const callBack: Function = this.props[eventName];\n args = args && args.map(a => (a === this) ? this.proxy : a)\n if (callBack) {\n try {\n return callBack.apply(this.proxy, args);\n } catch(e) {\n console.error(e);\n }\n }\n }\n\n isVisible() {\n const show = this.state.props.show;\n return show !== false && show !== 'false' && show !== '0' && show !== null;\n }\n\n protected abstract renderWidget(props: T): ReactNode;\n\n public refresh() {\n this.forceUpdate();\n }\n\n public cleanRefresh() {\n this.setState({\n hide: true\n }, () => {\n setTimeout(() => {\n this.setState({\n hide: false\n });\n }, 100);\n })\n }\n \n public renderSkeleton (props: T): ReactNode {\n return null;\n }\n\n\n\n copyStyles(property: string, from: any, to: any) {\n if (!isUndefined(from[property])) {\n to[property] = from[property];\n }\n }\n\n renderFixedContainer(props: T) {\n const style = {} as ViewStyle;\n const rootStyle = {\n left: 0,\n top: 0,\n bottom: 0,\n right: 0,\n width: \"100%\",\n height: \"100%\"\n } as ViewStyle;\n this.copyStyles('left', this.styles.root, style);\n this.copyStyles('top', this.styles.root, style);\n this.copyStyles('right', this.styles.root, style);\n this.copyStyles('bottom', this.styles.root, style);\n this.copyStyles('width', this.styles.root, style);\n this.copyStyles('height', this.styles.root, style);\n this.styles = this.theme.mergeStyle(this.styles, {root: rootStyle});\n return (<FixedView style={style} theme={this.theme}>{this.renderWidget(props)}</FixedView>);\n }\n \n public render(): ReactNode {\n WIDGET_LOGGER.info(() => `${this.props.name ?? this.constructor.name} is rendering.`);\n const props = this.state.props;\n if (this.state.hide || (!this.isVisible() && this.hideMode === HideMode.DONOT_ADD_TO_DOM)) {\n return null;\n }\n this.isFixed = false;\n return (<ParentContext.Consumer>\n {(parent) => {\n this.parent = parent;\n this._showSkeleton = this.parent?._showSkeleton || !!this.state.props.showskeleton;\n return (\n <ParentContext.Provider value={this}>\n <ThemeConsumer>\n {(theme) => {\n this.theme = theme || BASE_THEME;\n this.styles = this.theme.mergeStyle(\n this.getDefaultStyles(),\n props.disabled ? this.theme.getStyle(this.defaultClass + '-disabled') : null,\n props.classname && this.theme.getStyle(props.classname),\n props.showindevice && this.theme.getStyle('d-all-none ' + props.showindevice.map(d => `d-${d}-flex`).join(' ')),\n this.props.styles);\n if (this.styles.root.hasOwnProperty('_background')) {\n delete this.styles.root.backgroundColor;\n }\n if (!this.isVisible()) {\n assign(this.styles, this.theme.getStyle('hidden'))\n }\n let eleToRender = (this._showSkeleton && this.renderSkeleton(props));\n if (eleToRender) {\n return eleToRender;\n }\n let widgetElement = null;\n this.isFixed = (this.styles.root.position as any) === 'fixed';\n if (this.isFixed) {\n this.styles.root.position = undefined;\n widgetElement = this.renderFixedContainer(props);\n } else {\n widgetElement = this.renderWidget(this.state.props);\n }\n return attachBackground(widgetElement, this.styles.root);\n }}\n </ThemeConsumer>\n </ParentContext.Provider>);\n }}\n </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;UACb,OAAOA,WAAW;QACtB;QACA,IAAIC,aAAa,GAAG,IAAI;QACxB,IAAI,CAACnD,OAAO,GAAI,IAAI,CAAChF,MAAM,CAACiH,IAAI,CAACmB,QAAQ,KAAa,OAAO;QAC7D,IAAI,IAAI,CAACpD,OAAO,EAAE;UACd,IAAI,CAAChF,MAAM,CAACiH,IAAI,CAACmB,QAAQ,GAAIC,SAAS;UACtCF,aAAa,GAAG,IAAI,CAAC3B,oBAAoB,CAACpF,KAAK,CAAC;QACpD,CAAC,MAAM;UACH+G,aAAa,GAAG,IAAI,CAAChB,YAAY,CAAC,IAAI,CAACrG,KAAK,CAACM,KAAK,CAAC;QACvD;QACA,OAAOhC,gBAAgB,CAAC+I,aAAa,EAAE,IAAI,CAACnI,MAAM,CAACiH,IAAI,CAAC;MAC5D,CAAC,CACW,CACK;IAC7B,CAAC,CACoB;EACjC;AACJ"}
|
|
1
|
+
{"version":3,"names":["assign","isUndefined","React","Animatable","ThemeVariables","StyleProps","getStyleName","BackgroundComponent","ROOT_LOGGER","deepCopy","BASE_THEME","ThemeConsumer","ThemeEvent","EventNotifier","PropsProvider","assignIn","HideMode","AssetConsumer","FixedView","WIDGET_LOGGER","extend","ParentContext","createContext","BaseComponentState","undefined","defineStyles","styles","text","fontFamily","INSTANCE","baseFont","BaseProps","BaseComponent","Component","constructor","markupProps","defaultClass","defaultProps","defaultState","ADD_TO_DOM","state","propertyProvider","name","$new","$old","debug","props","initialized","styleName","styleOverrides","onPropertyChange","get","check","proxy","Proxy","target","prop","receiver","propName","toString","has","Reflect","set","value","updateState","cleanup","push","updateStateTimeouts","forEach","v","clearTimeout","theme","subscribe","CHANGE","forceUpdate","destroyParentListeners","event","fn","notifier","animate","setState","animationId","Date","now","animatableProps","setProp","setPropDefault","setDefault","cleanRefresh","getDefaultStyles","getStyle","reset","newPartialState","callback","destroyed","stateFn","oldState","oldProps","newState","Object","keys","k","onUpdateState","listener","onComponentChange","timeoutId","setTimeout","splice","indexOf","shouldComponentUpdate","nextProps","nextState","nextContext","key","componentDidMount","onComponentInit","componentWillAttach","isFixed","hide","componentWillDetach","componentWillUnmount","onComponentDestroy","f","notify","invokeEventCallback","eventName","args","callBack","map","a","apply","e","console","error","isVisible","show","refresh","renderSkeleton","parentListenerDestroyers","setParent","parent","copyStyles","property","from","to","renderFixedContainer","style","rootStyle","left","top","bottom","right","width","height","root","mergeStyle","addAnimation","renderWidget","n","setBackground","bgStyle","_background","backgroundImage","backgroundPosition","backgroundSize","backgroundRepeat","backgroundResizeMode","borderRadius","render","info","hideMode","DONOT_ADD_TO_DOM","loadAsset","_showSkeleton","showskeleton","disabled","classname","showindevice","d","join","hasOwnProperty","backgroundColor","eleToRender","position"],"sources":["base.component.tsx"],"sourcesContent":["import { assign, isEqual, isUndefined } from 'lodash';\nimport React, { ReactNode } from 'react';\nimport { TextStyle, ViewStyle } from 'react-native';\nimport { AnimatableProperties } from 'react-native-animatable';\nimport * as Animatable from 'react-native-animatable';\nimport ThemeVariables from '@wavemaker/app-rn-runtime/styles/theme.variables';\nimport { StyleProps, getStyleName } from '@wavemaker/app-rn-runtime/styles/style-props';\nimport { BackgroundComponent } from '@wavemaker/app-rn-runtime/styles/background.component';\nimport { ROOT_LOGGER } from '@wavemaker/app-rn-runtime/core/logger';\nimport { deepCopy } from '@wavemaker/app-rn-runtime/core/utils';\nimport BASE_THEME, { NamedStyles, AllStyle, ThemeConsumer, ThemeEvent } from '../styles/theme';\nimport EventNotifier from './event-notifier';\nimport { PropsProvider } from './props.provider';\nimport { assignIn } from 'lodash-es';\nimport { HideMode } from './if.component';\nimport { AssetConsumer } from './asset.provider';\nimport { FixedView } from './fixed-view.component';\n\nexport const WIDGET_LOGGER = ROOT_LOGGER.extend('widget');\n\nexport const ParentContext = React.createContext(null as any);\n\nexport class BaseComponentState<T extends BaseProps> {\n public animationId?: number = 0;\n public animatableProps?: AnimatableProperties<ViewStyle> = undefined;\n public props = {} as T;\n public hide? = false;\n}\n\nexport type BaseStyles = NamedStyles<any> & {\n root: AllStyle,\n text: TextStyle\n}\n\nexport function defineStyles<T>(styles: T): T {\n return deepCopy({\n text: {\n fontFamily: ThemeVariables.INSTANCE.baseFont\n }\n }, styles);\n}\n\nexport interface LifecycleListener {\n onComponentChange?: (c: BaseComponent<any, any, any>) => void;\n onComponentInit?: (c: BaseComponent<any, any, any>) => void;\n onComponentDestroy?: (c: BaseComponent<any, any, any>) => void;\n}\n\nexport class BaseProps extends StyleProps {\n id?: string = null as any;\n name?: string = null as any;\n key?: any = null as any;\n disabled? = false;\n show? = true as Boolean | String | Number;\n styles?: any = null;\n classname?: string = null as any;\n listener?: LifecycleListener = null as any;\n showindevice?: ('xs'|'sm'|'md'|'lg'|'xl'|'xxl')[] = null as any;\n showskeleton?: boolean = false;\n}\n\nexport abstract class BaseComponent<T extends BaseProps, S extends BaseComponentState<T>, L extends BaseStyles> extends React.Component<T, S> {\n public styles: L = null as any;\n public hideMode = HideMode.ADD_TO_DOM;\n private propertyProvider: PropsProvider<T>;\n public proxy: BaseComponent<T, S, L>;\n public initialized = false;\n public cleanup = [] as Function[];\n public theme = BASE_THEME;\n public updateStateTimeouts= [] as NodeJS.Timeout[];\n public parent: BaseComponent<any, any, any> = null as any;\n public destroyed = false;\n public _showSkeleton = false;\n public isFixed = false;\n private notifier = new EventNotifier();\n private parentListenerDestroyers = [] as Function[];\n public _background = <></>;\n private styleOverrides = {} as any;\n public loadAsset: (path: string) => number | string = null as any;\n\n constructor(markupProps: T, public defaultClass: string, defaultProps?: T, defaultState?: S) {\n super(markupProps);\n this.state = (defaultState || {} as S);\n this.propertyProvider = new PropsProvider<T>(\n assign({}, defaultProps),\n assign({}, markupProps),\n (name: string, $new: any, $old: any) => {\n WIDGET_LOGGER.debug(() => `${this.props.name ?? this.constructor.name}: ${name} changed from ${$old} to ${$new}`);\n if (this.initialized) {\n const styleName = getStyleName(name);\n if (styleName) {\n if ($new === undefined) {\n delete this.styleOverrides[styleName];\n } else {\n this.styleOverrides[styleName] = $new;\n }\n }\n }\n this.onPropertyChange(name, $new, $old);\n });\n //@ts-ignore\n this.state.props =this.propertyProvider.get();\n this.propertyProvider.check();\n //@ts-ignore\n this.proxy = (new Proxy(this, {\n get: (target, prop, receiver): any => {\n const propName = prop.toString();\n if (this.propertyProvider.has(propName)) {\n //@ts-ignore\n return this.state.props[propName];\n }\n return Reflect.get(target, prop, receiver);\n },\n set: (target: any, prop, value: any): any => {\n const propName = prop.toString();\n if (this.propertyProvider.has(propName)) {\n // @ts-ignore\n const props = {} as any;\n props[propName] = value;\n this.updateState({\n props: props\n } as S);\n return true;\n } else {\n return Reflect.set(target, prop, value);\n }\n }\n }));\n this.cleanup.push(() => {\n this.updateStateTimeouts.forEach(v => clearTimeout(v));\n });\n this.cleanup.push(this.theme.subscribe(ThemeEvent.CHANGE, () => {\n this.forceUpdate();\n }));\n this.cleanup.push(() => {\n this.destroyParentListeners();\n });\n }\n\n public subscribe(event: string, fn: Function) {\n return this.notifier.subscribe(event, fn);\n }\n\n public animate(props: AnimatableProperties<ViewStyle>) {\n this.setState({\n animationId: Date.now(),\n animatableProps: props\n });\n }\n\n setProp(propName: string, value: any) {\n this.propertyProvider.set(propName, value);\n this.updateState({props:{}} as S);\n }\n\n setPropDefault(propName: string, value: any) {\n this.propertyProvider.setDefault(propName, value);\n }\n\n onPropertyChange(name: string, $new: any, $old: any) {\n switch(name) {\n case 'showskeleton': {\n if (this.initialized) {\n this.cleanRefresh();\n }\n }\n }\n }\n\n getDefaultStyles() {\n return this.theme.getStyle(this.defaultClass);\n }\n\n reset() {\n\n }\n\n updateState(newPartialState: S, callback?: ()=>void) {\n if (this.destroyed) {\n return;\n }\n const stateFn = (oldState: S) => {\n const oldProps = oldState.props;\n const newState = this.initialized ? assignIn({}, oldState, newPartialState) : assignIn(oldState, newPartialState);\n if (newPartialState.props) {\n Object.keys(newPartialState.props).forEach((k) => {\n //@ts-ignore\n oldProps[k] = newState.props[k];\n });\n newState.props = oldProps;\n }\n return newState;\n };\n const onUpdateState = () => {\n callback && callback();\n this.props.listener?.onComponentChange\n && this.props.listener?.onComponentChange(this);\n }\n if (!this.initialized) {\n this.state = stateFn(this.state);\n onUpdateState();\n } else {\n const timeoutId = setTimeout(() => {\n this.setState(stateFn, onUpdateState);\n this.updateStateTimeouts.splice(this.updateStateTimeouts.indexOf(timeoutId), 1);\n });\n this.updateStateTimeouts.push(timeoutId);\n }\n }\n\n shouldComponentUpdate(nextProps: T, nextState: S, nextContext: any) {\n if (this.propertyProvider.check(nextProps)) {\n return true;\n }\n for(let key in nextState) {\n if(key !== 'props' && (!(key in this.state) || nextState[key] !== this.state[key])) {\n return true;\n }\n }\n\n for(let key in this.state) {\n if(key !== 'props' && (!(key in nextState) || this.state[key] !== nextState[key])) {\n return true;\n }\n }\n return false;\n }\n\n componentDidMount() {\n if (this.props.listener && this.props.listener.onComponentInit) {\n this.props.listener.onComponentInit(this.proxy);\n }\n this.initialized = true;\n }\n\n componentWillAttach() {\n if (this.isFixed) {\n this.setState({hide: false});\n }\n }\n\n componentWillDetach() {\n if (this.isFixed) {\n this.setState({hide: true});\n }\n }\n\n componentWillUnmount() {\n this.destroyed = true;\n if (this.props.listener && this.props.listener.onComponentDestroy) {\n this.props.listener.onComponentDestroy(this.proxy);\n }\n this.cleanup.forEach(f => f && f());\n this.notifier.notify('destroy', []);\n }\n\n invokeEventCallback(eventName: string, args: any[]) {\n //@ts-ignore\n const callBack: Function = this.props[eventName];\n args = args && args.map(a => (a === this) ? this.proxy : a)\n if (callBack) {\n try {\n return callBack.apply(this.proxy, args);\n } catch(e) {\n console.error(e);\n }\n }\n }\n\n isVisible() {\n const show = this.state.props.show;\n return show !== false && show !== 'false' && show !== '0' && show !== null;\n }\n\n protected abstract renderWidget(props: T): ReactNode;\n\n public refresh() {\n this.forceUpdate();\n }\n\n public cleanRefresh() {\n this.forceUpdate(() => this.notifier.notify('forceUpdate', []));\n }\n \n public renderSkeleton (props: T): ReactNode {\n return null;\n }\n\n public destroyParentListeners() {\n this.parentListenerDestroyers.map(fn => fn());\n }\n\n private setParent(parent: BaseComponent<any, any, any>) {\n if (parent && this.parent !== parent) {\n this.parent = parent;\n this.parentListenerDestroyers = [\n this.parent.subscribe('forceUpdate', () => {\n this.cleanRefresh();\n }),\n this.parent.subscribe('destroy', () => {\n this.destroyParentListeners();\n })\n ];\n }\n }\n\n copyStyles(property: string, from: any, to: any) {\n if (!isUndefined(from[property])) {\n to[property] = from[property];\n }\n }\n\n renderFixedContainer(props: T) {\n const style = {} as ViewStyle;\n const rootStyle = {\n left: 0,\n top: 0,\n bottom: 0,\n right: 0,\n width: \"100%\",\n height: \"100%\"\n } as ViewStyle;\n this.copyStyles('left', this.styles.root, style);\n this.copyStyles('top', this.styles.root, style);\n this.copyStyles('right', this.styles.root, style);\n this.copyStyles('bottom', this.styles.root, style);\n this.copyStyles('width', this.styles.root, style);\n this.copyStyles('height', this.styles.root, style);\n this.styles = this.theme.mergeStyle(this.styles, {root: rootStyle});\n return (<FixedView style={style} theme={this.theme}>{this.addAnimation(this.renderWidget(props))}</FixedView>);\n }\n\n private addAnimation(n: ReactNode) {\n if (!this.state.animatableProps) {\n return n;\n }\n return (<Animatable.View key={this.state.animationId} {...this.state.animatableProps}>{n}</Animatable.View>);\n }\n \n private setBackground() {\n const bgStyle = this.styles.root as any;\n this._background = (\n <BackgroundComponent \n image={bgStyle.backgroundImage}\n position={bgStyle.backgroundPosition}\n size={bgStyle.backgroundSize}\n repeat={bgStyle.backgroundRepeat}\n resizeMode={bgStyle.backgroundResizeMode}\n style={{borderRadius: this.styles.root.borderRadius}}>\n </BackgroundComponent>\n );\n delete (this.styles.root as any)['backgroundImage'];\n delete (this.styles.root as any)['backgroundPosition'];\n delete (this.styles.root as any)['backgroundResizeMode'];\n delete (this.styles.root as any)['backgroundSize'];\n delete (this.styles.root as any)['backgroundRepeat'];\n }\n \n public render(): ReactNode {\n WIDGET_LOGGER.info(() => `${this.props.name ?? this.constructor.name} is rendering.`);\n const props = this.state.props;\n if (this.state.hide || (!this.isVisible() && this.hideMode === HideMode.DONOT_ADD_TO_DOM)) {\n return null;\n }\n this.isFixed = false;\n return (<AssetConsumer>\n {(loadAsset) => {\n this.loadAsset = loadAsset;\n return (<ParentContext.Consumer>\n {(parent) => {\n this.setParent(parent);\n this._showSkeleton = this.parent?._showSkeleton || !!this.state.props.showskeleton;\n return (\n <ParentContext.Provider value={this}>\n <ThemeConsumer>\n {(theme) => {\n this.theme = theme || BASE_THEME;\n this.styles = this.theme.mergeStyle(\n this.getDefaultStyles(),\n props.disabled ? this.theme.getStyle(this.defaultClass + '-disabled') : null,\n props.classname && this.theme.getStyle(props.classname),\n props.showindevice && this.theme.getStyle('d-all-none ' + props.showindevice.map(d => `d-${d}-flex`).join(' ')),\n this.props.styles,\n {\n root: this.styleOverrides,\n text: this.styleOverrides\n });\n if (this.styles.root.hasOwnProperty('_background')) {\n delete this.styles.root.backgroundColor;\n }\n if (!this.isVisible()) {\n assign(this.styles, this.theme.getStyle('hidden'))\n }\n let eleToRender = (this._showSkeleton && this.renderSkeleton(props));\n if (eleToRender) {\n return eleToRender;\n }\n this.setBackground();\n this.isFixed = (this.styles.root.position as any) === 'fixed';\n if (this.isFixed) {\n this.styles.root.position = undefined;\n return this.renderFixedContainer(props);\n }\n return this.addAnimation(this.renderWidget(this.state.props));\n }}\n </ThemeConsumer>\n </ParentContext.Provider>);\n }}\n </ParentContext.Consumer>);\n }}\n </AssetConsumer>);\n }\n}\n"],"mappings":";;;;AAAA,SAASA,MAAM,EAAWC,WAAW,QAAQ,QAAQ;AACrD,OAAOC,KAAK,MAAqB,OAAO;AAGxC,OAAO,KAAKC,UAAU,MAAM,yBAAyB;AACrD,OAAOC,cAAc,MAAM,kDAAkD;AAC7E,SAASC,UAAU,EAAEC,YAAY,QAAQ,8CAA8C;AACvF,SAASC,mBAAmB,QAAQ,uDAAuD;AAC3F,SAASC,WAAW,QAAQ,uCAAuC;AACnE,SAASC,QAAQ,QAAQ,sCAAsC;AAC/D,O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I,CAACvB,aAAa,EAAE;UACpB,IAAI,CAAC1C,OAAO,GAAI,IAAI,CAAC3F,MAAM,CAACgI,IAAI,CAAC6B,QAAQ,KAAa,OAAO;UAC7D,IAAI,IAAI,CAAClE,OAAO,EAAE;YACd,IAAI,CAAC3F,MAAM,CAACgI,IAAI,CAAC6B,QAAQ,GAAI/J,SAAS;YACtC,OAAO,IAAI,CAACyH,oBAAoB,CAACnG,KAAK,CAAC;UAC3C;UACA,OAAO,IAAI,CAAC8G,YAAY,CAAC,IAAI,CAACC,YAAY,CAAC,IAAI,CAACrH,KAAK,CAACM,KAAK,CAAC,CAAC;QACjE,CAAC,CACW,CACK;MAC7B,CAAC,CACoB;IAC7B,CAAC,CACe;EACpB;AACJ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["remove","Image","ImageSizeEstimator","Map","createRequest","requestId","onComplete","request","cancel","requests","has","get","getImageSize","imgSrc","getSize","width","height","reqs","map","req","delete","push","reqQueue","set"],"sources":["imageSizeEstimator.ts"],"sourcesContent":["import { remove } from \"lodash-es\";\nimport { Image } from \"react-native\";\n\ninterface Request {\n onComplete: (width: number, height: number) => void\n cancel : () => void\n}\n\nclass ImageSizeEstimator {\n requestId = 1;\n \n requests: Map<String, Request[]> = new Map<string, Request[]>();\n\n private createRequest(requestId: string, onComplete: (width: number, height: number) => void) {\n const request = {} as Request;\n request.onComplete = onComplete,\n request.cancel = () => {\n if (this.requests.has(requestId)) {\n remove(this.requests.get(requestId) || [], request);\n }\n };\n return request;\n }\n\n private getImageSize(imgSrc: string) {\n Image.getSize(imgSrc, (width: number, height: number) => {\n const reqs = this.requests.get(imgSrc);\n if (reqs) {\n reqs.map(req => {\n req.onComplete && req.onComplete(width, height);\n });\n this.requests.delete(imgSrc);\n }\n }, () => this.requests.delete(imgSrc));\n }\n \n getSize(imgSrc: string, onComplete: (width: number, height: number) => void) {\n const requestId = imgSrc;\n const request = this.createRequest(requestId, onComplete);\n if (this.requests.has(requestId)) {\n this.requests.get(requestId)?.push(request);\n } else {\n const reqQueue = [] as Request[];\n this.requests.set(requestId, reqQueue);\n this.getImageSize(requestId);\n }\n return request.cancel;\n }\n }\n \nexport default new ImageSizeEstimator();"],"mappings":";;;AAAA,SAASA,MAAM,QAAQ,WAAW;AAClC,SAASC,KAAK,QAAQ,cAAc;AAOpC,MAAMC,kBAAkB,CAAC;EAAA;IAAA,mCACT,CAAC;IAAA,kCAEsB,IAAIC,GAAG,EAAqB;EAAA;EAEvDC,aAAa,CAACC,SAAiB,EAAEC,UAAmD,EAAE;IAC5F,MAAMC,OAAO,GAAG,CAAC,CAAY;IAC7BA,OAAO,CAACD,UAAU,GAAGA,UAAU,EAC/BC,OAAO,CAACC,MAAM,GAAG,MAAM;MACnB,IAAI,IAAI,CAACC,QAAQ,CAACC,GAAG,CAACL,SAAS,CAAC,EAAE;QAChCL,MAAM,CAAC,IAAI,CAACS,QAAQ,CAACE,GAAG,CAACN,SAAS,CAAC,IAAI,EAAE,EAAEE,OAAO,CAAC;MACrD;IACJ,CAAC;IACD,OAAOA,OAAO;EAChB;EAEQK,YAAY,CAACC,MAAc,EAAE;IACnCZ,KAAK,CAACa,OAAO,CAACD,MAAM,EAAE,CAACE,KAAa,EAAEC,MAAc,KAAK;MACvD,MAAMC,IAAI,GAAG,IAAI,CAACR,QAAQ,CAACE,GAAG,CAACE,MAAM,CAAC;MACtC,IAAII,IAAI,EAAE;QACRA,IAAI,CAACC,GAAG,CAACC,GAAG,IAAI;UACdA,GAAG,CAACb,UAAU,IAAIa,GAAG,CAACb,UAAU,CAACS,KAAK,EAAEC,MAAM,CAAC;QACjD,CAAC,CAAC;QACF,IAAI,CAACP,QAAQ,CAACW,MAAM,CAACP,MAAM,CAAC;MAC9B;IACF,CAAC,EAAE,MAAM,IAAI,CAACJ,QAAQ,CAACW,MAAM,CAACP,MAAM,CAAC,CAAC;EACxC;EAEAC,OAAO,CAACD,MAAc,EAAEP,UAAmD,EAAE;IAC3E,MAAMD,SAAS,GAAGQ,MAAM;IACxB,MAAMN,OAAO,GAAG,IAAI,CAACH,aAAa,CAACC,SAAS,EAAEC,UAAU,CAAC;IACzD,IAAI,IAAI,CAACG,QAAQ,CAACC,GAAG,CAACL,SAAS,CAAC,EAAE;MAAA;MAChC,0BAAI,CAACI,QAAQ,CAACE,GAAG,CAACN,SAAS,CAAC,uDAA5B,mBAA8BgB,IAAI,CAACd,OAAO,CAAC;IAC7C,CAAC,MAAM;MACL,MAAMe,QAAQ,GAAG,EAAe;MAChC,IAAI,CAACb,QAAQ,CAACc,GAAG,CAAClB,SAAS,EAAEiB,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"names":["remove","Image","ImageSizeEstimator","Map","createRequest","requestId","onComplete","request","cancel","requests","has","get","getImageSize","imgSrc","getSize","width","height","reqs","map","req","delete","push","reqQueue","set"],"sources":["imageSizeEstimator.ts"],"sourcesContent":["import { remove } from \"lodash-es\";\nimport { Image } from \"react-native\";\n\ninterface Request {\n onComplete: (width: number, height: number) => void\n cancel : () => void\n}\n\nclass ImageSizeEstimator {\n requestId = 1;\n \n requests: Map<String, Request[]> = new Map<string, Request[]>();\n\n private createRequest(requestId: string, onComplete: (width: number, height: number) => void) {\n const request = {} as Request;\n request.onComplete = onComplete,\n request.cancel = () => {\n if (this.requests.has(requestId)) {\n remove(this.requests.get(requestId) || [], request);\n }\n };\n return request;\n }\n\n private getImageSize(imgSrc: string) {\n Image.getSize(imgSrc, (width: number, height: number) => {\n const reqs = this.requests.get(imgSrc);\n if (reqs) {\n reqs.map(req => {\n req.onComplete && req.onComplete(width, height);\n });\n this.requests.delete(imgSrc);\n }\n }, () => this.requests.delete(imgSrc));\n }\n \n getSize(imgSrc: string, onComplete: (width: number, height: number) => void) {\n const requestId = imgSrc;\n const request = this.createRequest(requestId, onComplete);\n if (this.requests.has(requestId)) {\n this.requests.get(requestId)?.push(request);\n } else {\n const reqQueue = [] as Request[];\n this.requests.set(requestId, reqQueue);\n reqQueue.push(request)\n this.getImageSize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AU,CAAC;IACzD,IAAI,IAAI,CAACG,QAAQ,CAACC,GAAG,CAACL,SAAS,CAAC,EAAE;MAAA;MAChC,0BAAI,CAACI,QAAQ,CAACE,GAAG,CAACN,SAAS,CAAC,uDAA5B,mBAA8BgB,IAAI,CAACd,OAAO,CAAC;IAC7C,CAAC,MAAM;MACL,MAAMe,QAAQ,GAAG,EAAe;MAChC,IAAI,CAACb,QAAQ,CAACc,GAAG,CAAClB,SAAS,EAAEiB,QAAQ,CAAC;MACtCA,QAAQ,CAACD,IAAI,CAACd,OAAO,CAAC;MACtB,IAAI,CAACK,YAAY,CAACP,SAAS,CAAC;IAC9B;IACA,OAAOE,OAAO,CAACC,MAAM;EACvB;AACF;AAEF,eAAe,IAAIN,kBAAkB,EAAE"}
|
app-rn-runtime/core/injector.js
CHANGED
|
@@ -5,8 +5,22 @@ const get = t => {
|
|
|
5
5
|
const set = (t, o) => {
|
|
6
6
|
map.set(t, o);
|
|
7
7
|
};
|
|
8
|
+
const remove = t => {
|
|
9
|
+
const v = map.get(t);
|
|
10
|
+
v && map.delete(t);
|
|
11
|
+
return v;
|
|
12
|
+
};
|
|
13
|
+
const getInstance = key => {
|
|
14
|
+
return {
|
|
15
|
+
set: o => set(key, o),
|
|
16
|
+
get: () => get(key),
|
|
17
|
+
remove: () => remove(key)
|
|
18
|
+
};
|
|
19
|
+
};
|
|
8
20
|
export default {
|
|
9
21
|
set: set,
|
|
10
|
-
get: get
|
|
22
|
+
get: get,
|
|
23
|
+
remove: remove,
|
|
24
|
+
FOCUSED_ELEMENT: getInstance('FOCUSED_ELEMENT')
|
|
11
25
|
};
|
|
12
26
|
//# sourceMappingURL=injector.js.map
|