@wavemaker/app-rn-runtime 11.10.5-rc.6100 → 11.11.0-rc.209

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.
Files changed (79) hide show
  1. package/actions/notification-action.js +3 -1
  2. package/actions/notification-action.js.map +1 -1
  3. package/components/basic/animatedview.component.js +3 -2
  4. package/components/basic/animatedview.component.js.map +1 -1
  5. package/components/basic/audio/audio.component.js.map +1 -1
  6. package/components/basic/label/label.component.js +78 -33
  7. package/components/basic/label/label.component.js.map +1 -1
  8. package/components/basic/message/message.component.js +1 -1
  9. package/components/basic/message/message.component.js.map +1 -1
  10. package/components/basic/message/message.props.js +1 -0
  11. package/components/basic/message/message.props.js.map +1 -1
  12. package/components/basic/picture/picture.component.js +20 -13
  13. package/components/basic/picture/picture.component.js.map +1 -1
  14. package/components/basic/picture/picture.styles.js.map +1 -1
  15. package/components/basic/search/search.component.js +49 -28
  16. package/components/basic/search/search.component.js.map +1 -1
  17. package/components/basic/search/search.props.js +1 -0
  18. package/components/basic/search/search.props.js.map +1 -1
  19. package/components/basic/skeleton/skeleton.component.js.map +1 -1
  20. package/components/basic/skeleton/skeleton.styles.js.map +1 -1
  21. package/components/chart/bar-chart/bar-chart.component.js +4 -2
  22. package/components/chart/bar-chart/bar-chart.component.js.map +1 -1
  23. package/components/chart/bar-chart/bar-chart.props.js +1 -0
  24. package/components/chart/bar-chart/bar-chart.props.js.map +1 -1
  25. package/components/chart/basechart.component.js +9 -2
  26. package/components/chart/basechart.component.js.map +1 -1
  27. package/components/chart/basechart.props.js +3 -1
  28. package/components/chart/basechart.props.js.map +1 -1
  29. package/components/container/container.component.js +10 -2
  30. package/components/container/container.component.js.map +1 -1
  31. package/components/container/container.props.js +1 -0
  32. package/components/container/container.props.js.map +1 -1
  33. package/components/container/container.styles.js +3 -0
  34. package/components/container/container.styles.js.map +1 -1
  35. package/components/data/list/list.component.js +58 -15
  36. package/components/data/list/list.component.js.map +1 -1
  37. package/components/data/list/list.props.js +3 -0
  38. package/components/data/list/list.props.js.map +1 -1
  39. package/components/input/calendar/views/month-view.js.map +1 -1
  40. package/components/input/epoch/datetime/datetime.styles.js.map +1 -1
  41. package/components/navigation/appnavbar/appnavbar.component.js +123 -38
  42. package/components/navigation/appnavbar/appnavbar.component.js.map +1 -1
  43. package/components/navigation/appnavbar/appnavbar.props.js +1 -0
  44. package/components/navigation/appnavbar/appnavbar.props.js.map +1 -1
  45. package/components/navigation/appnavbar/appnavbar.styles.js.map +1 -1
  46. package/components/page/left-panel/left-panel.component.js +3 -2
  47. package/components/page/left-panel/left-panel.component.js.map +1 -1
  48. package/components/page/page-content/page-content.component.js +13 -25
  49. package/components/page/page-content/page-content.component.js.map +1 -1
  50. package/components/page/page.component.js +51 -4
  51. package/components/page/page.component.js.map +1 -1
  52. package/components/page/page.props.js +11 -1
  53. package/components/page/page.props.js.map +1 -1
  54. package/components/page/tabbar/tabbar.component.js +140 -40
  55. package/components/page/tabbar/tabbar.component.js.map +1 -1
  56. package/components/page/tabbar/tabbar.props.js +1 -0
  57. package/components/page/tabbar/tabbar.props.js.map +1 -1
  58. package/core/AppConfig.js.map +1 -1
  59. package/core/base.component.js +38 -5
  60. package/core/base.component.js.map +1 -1
  61. package/core/components/floatinglabel.component.js.map +1 -1
  62. package/core/components/textinput.component.js +18 -2
  63. package/core/components/textinput.component.js.map +1 -1
  64. package/core/fixed-view.component.js +5 -3
  65. package/core/fixed-view.component.js.map +1 -1
  66. package/core/sticky-container.component.js +175 -0
  67. package/core/sticky-container.component.js.map +1 -0
  68. package/core/toast.service.js.map +1 -1
  69. package/core/utils.js +51 -5
  70. package/core/utils.js.map +1 -1
  71. package/npm-shrinkwrap.json +145 -128
  72. package/package-lock.json +145 -128
  73. package/package.json +6 -3
  74. package/runtime/App.js +61 -10
  75. package/runtime/App.js.map +1 -1
  76. package/runtime/base-fragment.component.js +2 -1
  77. package/runtime/base-fragment.component.js.map +1 -1
  78. package/runtime/services/app-toast.service.js +4 -0
  79. package/runtime/services/app-toast.service.js.map +1 -1
@@ -1,2 +1,12 @@
1
-
1
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
2
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
3
+ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
4
+ import { BaseProps } from '@wavemaker/app-rn-runtime/core/base.component';
5
+ export default class WmPageProps extends BaseProps {
6
+ constructor(...args) {
7
+ super(...args);
8
+ _defineProperty(this, "children", []);
9
+ _defineProperty(this, "scrollable", false);
10
+ }
11
+ }
2
12
  //# sourceMappingURL=page.props.js.map
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["page.props.ts"],"sourcesContent":["import { BaseProps } from '@wavemaker/app-rn-runtime/core/base.component';\nimport { SkeletonAnimationProps } from '@wavemaker/app-rn-runtime/runtime/base-fragment.component';\n\nexport default interface WmPageProps extends BaseProps {\n children: any[]\n}"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"names":["BaseProps","WmPageProps","constructor","args","_defineProperty"],"sources":["page.props.ts"],"sourcesContent":["import { BaseProps } from '@wavemaker/app-rn-runtime/core/base.component';\nexport default class WmPageProps extends BaseProps{\n children: any[] = [];\n scrollable: boolean = false;\n}"],"mappings":";;;AAAA,SAASA,SAAS,QAAQ,+CAA+C;AACzE,eAAe,MAAMC,WAAW,SAASD,SAAS;EAAAE,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAC,eAAA,mBAC9B,EAAE;IAAAA,eAAA,qBACE,KAAK;EAAA;AAC7B","ignoreList":[]}
@@ -3,7 +3,7 @@ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object
3
3
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
4
4
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
5
5
  import React from 'react';
6
- import { Text, View, TouchableOpacity, Dimensions, Keyboard } from 'react-native';
6
+ import { Text, View, TouchableOpacity, Dimensions, Keyboard, Animated, Easing } from 'react-native';
7
7
  import { ThemeProvider } from '@wavemaker/app-rn-runtime/styles/theme';
8
8
  import { ModalConsumer } from '@wavemaker/app-rn-runtime/core/modal.service';
9
9
  import WmIcon from '@wavemaker/app-rn-runtime/components/basic/icon/icon.component';
@@ -15,6 +15,9 @@ import Svg, { Path } from 'react-native-svg';
15
15
  import { getPathDown } from './curve';
16
16
  // import { scale } from 'react-native-size-scaling';
17
17
  import ThemeVariables from '@wavemaker/app-rn-runtime/styles/theme.variables';
18
+ import { FixedView } from '@wavemaker/app-rn-runtime/core/fixed-view.component';
19
+ import { SafeAreaInsetsContext } from 'react-native-safe-area-context';
20
+ import injector from '@wavemaker/app-rn-runtime/core/injector';
18
21
  const scale = n => n;
19
22
  class WmTabbarState extends BaseNavState {
20
23
  constructor(...args) {
@@ -29,6 +32,11 @@ export default class WmTabbar extends BaseNavComponent {
29
32
  super(props, DEFAULT_CLASS, new WmTabbarProps(), new WmTabbarState());
30
33
  _defineProperty(this, "tabbarHeight", 0);
31
34
  _defineProperty(this, "keyBoardShown", false);
35
+ _defineProperty(this, "destroyScrollListner", null);
36
+ _defineProperty(this, "translateY", new Animated.Value(0));
37
+ _defineProperty(this, "insets", null);
38
+ _defineProperty(this, "appConfig", injector.get('APP_CONFIG'));
39
+ _defineProperty(this, "tabbarHeightWithInsets", 0);
32
40
  _defineProperty(this, "maxWidth", Dimensions.get("window").width);
33
41
  _defineProperty(this, "returnpathDown", void 0);
34
42
  this.cleanup.push(Keyboard.addListener('keyboardWillShow', () => {
@@ -40,6 +48,17 @@ export default class WmTabbar extends BaseNavComponent {
40
48
  this.forceUpdate();
41
49
  }).remove);
42
50
  }
51
+ onPropertyChange(name, $new, $old) {
52
+ super.onPropertyChange(name, $new, $old);
53
+ switch (name) {
54
+ case 'hideonscroll':
55
+ this.destroyScrollListner && this.destroyScrollListner();
56
+ if ($new) {
57
+ this.subscribeToPageScroll();
58
+ }
59
+ break;
60
+ }
61
+ }
43
62
  renderTabItem(item, testId, props, onSelect, floating = false) {
44
63
  const isActive = props.isActive && props.isActive(item);
45
64
  const getDisplayLabel = this.props.getDisplayExpression || (label => label);
@@ -78,7 +97,45 @@ export default class WmTabbar extends BaseNavComponent {
78
97
  isVisible() {
79
98
  return super.isVisible() && !this.keyBoardShown;
80
99
  }
81
- renderWidget(props) {
100
+ animateWithTiming(value, duratiion) {
101
+ Animated.timing(this.translateY, {
102
+ toValue: value,
103
+ easing: Easing.linear,
104
+ duration: duratiion,
105
+ useNativeDriver: false
106
+ }).start();
107
+ }
108
+ subscribeToPageScroll() {
109
+ this.tabbarHeightWithInsets = 0;
110
+ this.destroyScrollListner = this.subscribe('scroll', event => {
111
+ var _this$getLayout, _this$insets;
112
+ const {
113
+ contentOffset,
114
+ layoutMeasurement,
115
+ contentSize
116
+ } = event.nativeEvent;
117
+ const scrollPosition = contentOffset.y;
118
+ this.tabbarHeightWithInsets = this.tabbarHeightWithInsets ? this.tabbarHeightWithInsets : (_this$getLayout = this.getLayout()) === null || _this$getLayout === void 0 ? void 0 : _this$getLayout.height;
119
+ const visibleContentHeight = layoutMeasurement.height;
120
+ const endReached = scrollPosition + visibleContentHeight + this.tabbarHeightWithInsets >= contentSize.height;
121
+ const bottomInsets = ((_this$insets = this.insets) === null || _this$insets === void 0 ? void 0 : _this$insets.bottom) || 0;
122
+ const e = event;
123
+ if (e.scrollDelta >= 2) {
124
+ if (e.scrollDirection < 0) {
125
+ this.animateWithTiming(0, 100);
126
+ } else if (e.scrollDirection > 0) {
127
+ this.animateWithTiming(this.tabbarHeightWithInsets + bottomInsets, 100);
128
+ }
129
+ }
130
+ if (endReached) {
131
+ this.animateWithTiming(0, 0);
132
+ }
133
+ });
134
+ }
135
+ componentWillUnmount() {
136
+ this.destroyScrollListner && this.destroyScrollListner();
137
+ }
138
+ renderContent(props) {
82
139
  let max = 5;
83
140
  const tabItems = this.state.dataItems;
84
141
  const tabItemsLength = tabItems.length;
@@ -104,46 +161,89 @@ export default class WmTabbar extends BaseNavComponent {
104
161
  }
105
162
  max = max - 1;
106
163
  }
107
- return /*#__PURE__*/React.createElement(NavigationServiceConsumer, null, navigationService => /*#__PURE__*/React.createElement(View, {
108
- style: this.styles.root
109
- }, isClippedTabbar ? /*#__PURE__*/React.createElement(Svg, {
110
- width: this.maxWidth,
111
- height: scale(this.styles.root.height),
164
+ return /*#__PURE__*/React.createElement(SafeAreaInsetsContext.Consumer, null, (insets = {
165
+ top: 0,
166
+ bottom: 0,
167
+ left: 0,
168
+ right: 0
169
+ }) => {
170
+ var _this$appConfig;
171
+ this.insets = insets;
172
+ const paddingBottomVal = this.styles.root.paddingBottom || this.styles.root.padding;
173
+ const statusBarCustomisation = (_this$appConfig = this.appConfig) === null || _this$appConfig === void 0 || (_this$appConfig = _this$appConfig.preferences) === null || _this$appConfig === void 0 ? void 0 : _this$appConfig.statusbarStyles;
174
+ const isFullScreenMode = !!(statusBarCustomisation !== null && statusBarCustomisation !== void 0 && statusBarCustomisation.translucent);
175
+ const stylesWithFs = isFullScreenMode ? {
176
+ height: this.styles.root.height + ((insets === null || insets === void 0 ? void 0 : insets.bottom) || 0),
177
+ paddingBottom: (paddingBottomVal || 0) + ((insets === null || insets === void 0 ? void 0 : insets.bottom) || 0)
178
+ } : {};
179
+ return /*#__PURE__*/React.createElement(NavigationServiceConsumer, null, navigationService => /*#__PURE__*/React.createElement(View, {
180
+ style: [this.styles.root, stylesWithFs],
181
+ ref: ref => {
182
+ this.baseView = ref;
183
+ },
184
+ onLayout: event => this.handleLayout(event)
185
+ }, isClippedTabbar ? /*#__PURE__*/React.createElement(Svg, {
186
+ width: this.maxWidth,
187
+ height: scale(this.styles.root.height),
188
+ style: {
189
+ zIndex: -1,
190
+ position: 'absolute',
191
+ backgroundColor: ThemeVariables.INSTANCE.transparent
192
+ }
193
+ }, /*#__PURE__*/React.createElement(Path, {
194
+ fill: ThemeVariables.INSTANCE.tabbarBackgroundColor,
195
+ d: this.returnpathDown
196
+ })) : /*#__PURE__*/React.createElement(React.Fragment, null), /*#__PURE__*/React.createElement(ModalConsumer, null, modalService => {
197
+ if (this.state.showMore) {
198
+ modalService.showModal(this.prepareModalOptions(/*#__PURE__*/React.createElement(ThemeProvider, {
199
+ value: this.theme
200
+ }, /*#__PURE__*/React.createElement(View, {
201
+ style: this.styles.moreMenu
202
+ }, moreItems.map((a, i) => /*#__PURE__*/React.createElement(View, {
203
+ key: i,
204
+ style: this.styles.moreMenuRow
205
+ }, a.map((item, index) => this.renderTabItem(item, i + '', props, () => this.onItemSelect(item, navigationService)))))))));
206
+ } else {
207
+ modalService.hideModal(this.state.modalOptions);
208
+ }
209
+ return null;
210
+ }), /*#__PURE__*/React.createElement(View, {
211
+ style: this.styles.menu,
212
+ onLayout: e => {
213
+ this.tabbarHeight = e.nativeEvent.layout.height;
214
+ }
215
+ }, tabItems.filter((item, i) => i < max).map((item, i) => this.renderTabItem(item, i + '', props, () => this.onItemSelect(item, navigationService), item.floating)), tabItems.length > max && this.renderTabItem({
216
+ label: props.morebuttonlabel,
217
+ icon: props.morebuttoniconclass
218
+ }, 6666 + '', props, () => {
219
+ this.updateState({
220
+ showMore: !this.state.showMore
221
+ });
222
+ }))));
223
+ });
224
+ }
225
+ renderWidget(props) {
226
+ this.isFixed = true;
227
+ const animateStyle = props.hideonscroll ? {
228
+ transform: [{
229
+ translateY: this.translateY
230
+ }]
231
+ } : {};
232
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(FixedView, {
112
233
  style: {
113
- zIndex: -1,
114
- position: 'absolute',
115
- backgroundColor: ThemeVariables.INSTANCE.transparent
116
- }
117
- }, /*#__PURE__*/React.createElement(Path, {
118
- fill: ThemeVariables.INSTANCE.tabbarBackgroundColor,
119
- d: this.returnpathDown
120
- })) : /*#__PURE__*/React.createElement(React.Fragment, null), /*#__PURE__*/React.createElement(ModalConsumer, null, modalService => {
121
- if (this.state.showMore) {
122
- modalService.showModal(this.prepareModalOptions(/*#__PURE__*/React.createElement(ThemeProvider, {
123
- value: this.theme
124
- }, /*#__PURE__*/React.createElement(View, {
125
- style: this.styles.moreMenu
126
- }, moreItems.map((a, i) => /*#__PURE__*/React.createElement(View, {
127
- key: i,
128
- style: this.styles.moreMenuRow
129
- }, a.map((item, index) => this.renderTabItem(item, i + '', props, () => this.onItemSelect(item, navigationService)))))))));
130
- } else {
131
- modalService.hideModal(this.state.modalOptions);
132
- }
133
- return null;
134
- }), /*#__PURE__*/React.createElement(View, {
135
- style: this.styles.menu,
136
- onLayout: e => {
137
- this.tabbarHeight = e.nativeEvent.layout.height;
234
+ ...{
235
+ bottom: 0,
236
+ width: '100%'
237
+ },
238
+ ...animateStyle
239
+ },
240
+ theme: this.theme,
241
+ animated: props.hideonscroll || false
242
+ }, this.renderContent(props)), /*#__PURE__*/React.createElement(View, {
243
+ style: {
244
+ opacity: 0
138
245
  }
139
- }, tabItems.filter((item, i) => i < max).map((item, i) => this.renderTabItem(item, i + '', props, () => this.onItemSelect(item, navigationService), item.floating)), tabItems.length > max && this.renderTabItem({
140
- label: props.morebuttonlabel,
141
- icon: props.morebuttoniconclass
142
- }, 6666 + '', props, () => {
143
- this.updateState({
144
- showMore: !this.state.showMore
145
- });
146
- }))));
246
+ }, this.renderContent(props)));
147
247
  }
148
248
  }
149
249
  //# sourceMappingURL=tabbar.component.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["React","Text","View","TouchableOpacity","Dimensions","Keyboard","ThemeProvider","ModalConsumer","WmIcon","NavigationServiceConsumer","BaseNavComponent","BaseNavState","WmTabbarProps","DEFAULT_CLASS","Svg","Path","getPathDown","ThemeVariables","scale","n","WmTabbarState","constructor","args","_defineProperty","WmTabbar","props","get","width","cleanup","push","addListener","keyBoardShown","forceUpdate","remove","renderTabItem","item","testId","onSelect","floating","isActive","getDisplayLabel","getDisplayExpression","label","increasedGap","Number","indexBeforeMid","state","dataItems","length","classname","indexOf","styles","tabItem","paddingRight","createElement","_extends","getTestPropsForAction","style","centerHubItem","key","onPress","activeTabItem","theme","mergeStyle","tabIcon","centerHubIcon","activeTabIcon","iconclass","icon","tabLabel","centerHubLabel","activeTabLabel","numberOfLines","onItemSelect","navigationService","link","openUrl","invokeEventCallback","proxy","prepareModalOptions","content","o","modalOptions","modalStyle","bottom","tabbarHeight","contentStyle","modalContent","isVisible","renderWidget","max","tabItems","tabItemsLength","isClippedTabbar","middleIndex","Math","floor","returnpathDown","maxWidth","root","height","moreItems","moreItemsCount","ceil","j","i","row","zIndex","position","backgroundColor","INSTANCE","transparent","fill","tabbarBackgroundColor","d","Fragment","modalService","showMore","showModal","value","moreMenu","map","a","moreMenuRow","index","hideModal","menu","onLayout","e","nativeEvent","layout","filter","morebuttonlabel","morebuttoniconclass","updateState"],"sources":["tabbar.component.tsx"],"sourcesContent":["import React, { ReactNode } from 'react';\nimport { Text, View, TouchableOpacity, Dimensions, Keyboard } 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';\nimport Svg, { Path } from 'react-native-svg';\nimport { getPathDown } from './curve';\n// import { scale } from 'react-native-size-scaling';\nimport ThemeVariables from '@wavemaker/app-rn-runtime/styles/theme.variables';\n\ninterface TabDataItem extends NavigationDataItem {\n floating: boolean;\n indexBeforeMid: number;\n}\n\nconst scale = (n: number) => n;\n\nclass WmTabbarState<T extends BaseNavProps> extends BaseNavState<T> {\n showMore = false;\n modalOptions = {} as ModalOptions;\n dataItems: TabDataItem[] = [];\n}\n\nexport default class WmTabbar extends BaseNavComponent<WmTabbarProps, WmTabbarState<WmTabbarProps>, WmTabbarStyles> {\n\n private tabbarHeight = 0;\n private keyBoardShown = false;\n\n constructor(props: WmTabbarProps) {\n super(props, DEFAULT_CLASS, new WmTabbarProps(), new WmTabbarState());\n this.cleanup.push(Keyboard.addListener('keyboardWillShow', () => {\n this.keyBoardShown = true;\n this.forceUpdate();\n }).remove);\n this.cleanup.push(Keyboard.addListener('keyboardWillHide', () => {\n this.keyBoardShown = false;\n this.forceUpdate();\n }).remove);\n }\n\n private maxWidth = Dimensions.get(\"window\").width; \n private returnpathDown: any;\n\n renderTabItem(item: TabDataItem, testId: string, props: WmTabbarProps, onSelect: Function, floating = false) {\n\n const isActive = props.isActive && props.isActive(item);\n const getDisplayLabel = this.props.getDisplayExpression || ((label: string) => label);\n let increasedGap = Number(testId) === item?.indexBeforeMid && (this.state.dataItems.length % 2!=0) && ((props.classname || '').indexOf('clipped-tabbar') >= 0)\n ? [this.styles.tabItem, { paddingRight: 70 }]\n : [this.styles.tabItem];\n \n return (\n <TouchableOpacity \n {...this.getTestPropsForAction('item' + testId)}\n style={[increasedGap, floating? this.styles.centerHubItem: {}]}\n key={`${item.label}_${testId}`}\n onPress={() => onSelect && onSelect()}>\n <View key={item.key}>\n <View style={[isActive && !floating ? this.styles.activeTabItem : {}]}>\n <WmIcon\n styles={this.theme.mergeStyle({}, this.styles.tabIcon, floating? this.styles.centerHubIcon: {}, isActive ? this.styles.activeTabIcon : {})}\n iconclass={item.icon}\n ></WmIcon>\n </View>\n </View>\n <Text style={[this.styles.tabLabel, floating? this.styles.centerHubLabel: {}, isActive ? this.styles.activeTabLabel : {}]} numberOfLines={1}>\n {getDisplayLabel(item.label)}\n </Text>\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 isVisible(): boolean {\n return super.isVisible() && !this.keyBoardShown;\n }\n\n renderWidget(props: WmTabbarProps) {\n let max = 5;\n const tabItems = this.state.dataItems;\n const tabItemsLength = tabItems.length;\n const isClippedTabbar = ((props.classname || '').indexOf('clipped-tabbar') >= 0) && (tabItemsLength % 2 !== 0);\n if (isClippedTabbar && tabItemsLength % 2 !== 0) {\n const middleIndex = Math.floor(tabItemsLength / 2);\n tabItems[middleIndex]['floating'] = true;\n tabItems[middleIndex - 1]['indexBeforeMid'] = middleIndex-1;\n }\n this.returnpathDown = getPathDown(this.maxWidth, 65 ,60,this.styles.root.height as number);\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 TabDataItem;\n }\n moreItems.push(row);\n }\n max = max - 1;\n }\n return (\n <NavigationServiceConsumer>\n {(navigationService) =>\n (<View style={this.styles.root}>\n {isClippedTabbar ? (\n <Svg width={this.maxWidth} height={scale(this.styles.root.height as number)} style={{zIndex: -1,position: 'absolute',backgroundColor: ThemeVariables.INSTANCE.transparent}}>\n <Path fill={ThemeVariables.INSTANCE.tabbarBackgroundColor} {...{ d: this.returnpathDown }}/>\n </Svg>\n ): <></>} \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, index) => this.renderTabItem(item, i + '', 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, i + '', props, () => this.onItemSelect(item, navigationService), item.floating))}\n {tabItems.length > max && (\n this.renderTabItem({\n label: props.morebuttonlabel,\n icon: props.morebuttoniconclass\n } as TabDataItem, 6666 +'', 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,EAAEC,UAAU,EAAEC,QAAQ,QAAQ,cAAc;AAEjF,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;AAC/D,OAAOC,GAAG,IAAIC,IAAI,QAAQ,kBAAkB;AAC5C,SAASC,WA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G,eAAe;MAC5BhE,IAAI,EAAE3C,KAAK,CAAC4G;IACd,CAAC,EAAiB,IAAI,GAAE,EAAE,EAAE5G,KAAK,EAAG,MAAM;MACxC,IAAI,CAAC6G,WAAW,CAAC;QAACjB,QAAQ,EAAE,CAAC,IAAI,CAACvE,KAAK,CAACuE;MAAQ,CAAiC,CAAC;IACpF,CAAC,CAEC,CACF,CACmB,CAAC;EAEhC;AACF","ignoreList":[]}
1
+ {"version":3,"names":["React","Text","View","TouchableOpacity","Dimensions","Keyboard","Animated","Easing","ThemeProvider","ModalConsumer","WmIcon","NavigationServiceConsumer","BaseNavComponent","BaseNavState","WmTabbarProps","DEFAULT_CLASS","Svg","Path","getPathDown","ThemeVariables","FixedView","SafeAreaInsetsContext","injector","scale","n","WmTabbarState","constructor","args","_defineProperty","WmTabbar","props","Value","get","width","cleanup","push","addListener","keyBoardShown","forceUpdate","remove","onPropertyChange","name","$new","$old","destroyScrollListner","subscribeToPageScroll","renderTabItem","item","testId","onSelect","floating","isActive","getDisplayLabel","getDisplayExpression","label","increasedGap","Number","indexBeforeMid","state","dataItems","length","classname","indexOf","styles","tabItem","paddingRight","createElement","_extends","getTestPropsForAction","style","centerHubItem","key","onPress","activeTabItem","theme","mergeStyle","tabIcon","centerHubIcon","activeTabIcon","iconclass","icon","tabLabel","centerHubLabel","activeTabLabel","numberOfLines","onItemSelect","navigationService","link","openUrl","invokeEventCallback","proxy","prepareModalOptions","content","o","modalOptions","modalStyle","bottom","tabbarHeight","contentStyle","modalContent","isVisible","animateWithTiming","value","duratiion","timing","translateY","toValue","easing","linear","duration","useNativeDriver","start","tabbarHeightWithInsets","subscribe","event","_this$getLayout","_this$insets","contentOffset","layoutMeasurement","contentSize","nativeEvent","scrollPosition","y","getLayout","height","visibleContentHeight","endReached","bottomInsets","insets","e","scrollDelta","scrollDirection","componentWillUnmount","renderContent","max","tabItems","tabItemsLength","isClippedTabbar","middleIndex","Math","floor","returnpathDown","maxWidth","root","moreItems","moreItemsCount","ceil","j","i","row","Consumer","top","left","right","_this$appConfig","paddingBottomVal","paddingBottom","padding","statusBarCustomisation","appConfig","preferences","statusbarStyles","isFullScreenMode","translucent","stylesWithFs","ref","baseView","onLayout","handleLayout","zIndex","position","backgroundColor","INSTANCE","transparent","fill","tabbarBackgroundColor","d","Fragment","modalService","showMore","showModal","moreMenu","map","a","moreMenuRow","index","hideModal","menu","layout","filter","morebuttonlabel","morebuttoniconclass","updateState","renderWidget","isFixed","animateStyle","hideonscroll","transform","animated","opacity"],"sources":["tabbar.component.tsx"],"sourcesContent":["import React, { ReactNode } from 'react';\nimport { Text, View, TouchableOpacity, Dimensions, Keyboard, Animated, Easing, LayoutChangeEvent, \n NativeSyntheticEvent, NativeScrollEvent\n} from 'react-native';\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';\nimport Svg, { Path } from 'react-native-svg';\nimport { getPathDown } from './curve';\n// import { scale } from 'react-native-size-scaling';\nimport ThemeVariables from '@wavemaker/app-rn-runtime/styles/theme.variables';\nimport { FixedView } from '@wavemaker/app-rn-runtime/core/fixed-view.component';\nimport { EdgeInsets, SafeAreaInsetsContext } from 'react-native-safe-area-context';\nimport injector from '@wavemaker/app-rn-runtime/core/injector';\nimport AppConfig from '@wavemaker/app-rn-runtime/core/AppConfig';\n\ninterface TabDataItem extends NavigationDataItem {\n floating: boolean;\n indexBeforeMid: number;\n}\n\ninterface CustomScrollEvent {\n scrollDirection: number;\n scrollDelta: number;\n}\n\nconst scale = (n: number) => n;\n\nclass WmTabbarState<T extends BaseNavProps> extends BaseNavState<T> {\n showMore = false;\n modalOptions = {} as ModalOptions;\n dataItems: TabDataItem[] = [];\n}\n\nexport default class WmTabbar extends BaseNavComponent<WmTabbarProps, WmTabbarState<WmTabbarProps>, WmTabbarStyles> {\n\n private tabbarHeight = 0;\n private keyBoardShown = false;\n private destroyScrollListner: Function = null as any;\n private translateY = new Animated.Value(0);\n private insets: EdgeInsets | null = null;\n private appConfig = injector.get<AppConfig>('APP_CONFIG');\n private tabbarHeightWithInsets: number = 0;\n\n constructor(props: WmTabbarProps) {\n super(props, DEFAULT_CLASS, new WmTabbarProps(), new WmTabbarState());\n this.cleanup.push(Keyboard.addListener('keyboardWillShow', () => {\n this.keyBoardShown = true;\n this.forceUpdate();\n }).remove);\n this.cleanup.push(Keyboard.addListener('keyboardWillHide', () => {\n this.keyBoardShown = false;\n this.forceUpdate();\n }).remove);\n }\n\n private maxWidth = Dimensions.get(\"window\").width; \n private returnpathDown: any;\n\n onPropertyChange(name: string, $new: any, $old: any): void {\n super.onPropertyChange(name, $new, $old);\n switch(name){\n case 'hideonscroll':\n this.destroyScrollListner && this.destroyScrollListner();\n if($new) {\n this.subscribeToPageScroll();\n }\n break;\n }\n }\n\n renderTabItem(item: TabDataItem, testId: string, props: WmTabbarProps, onSelect: Function, floating = false) {\n\n const isActive = props.isActive && props.isActive(item);\n const getDisplayLabel = this.props.getDisplayExpression || ((label: string) => label);\n let increasedGap = Number(testId) === item?.indexBeforeMid && (this.state.dataItems.length % 2!=0) && ((props.classname || '').indexOf('clipped-tabbar') >= 0)\n ? [this.styles.tabItem, { paddingRight: 70 }]\n : [this.styles.tabItem];\n \n return (\n <TouchableOpacity \n {...this.getTestPropsForAction('item' + testId)}\n style={[increasedGap, floating? this.styles.centerHubItem: {}]}\n key={`${item.label}_${testId}`}\n onPress={() => onSelect && onSelect()}>\n <View key={item.key}>\n <View style={[isActive && !floating ? this.styles.activeTabItem : {}]}>\n <WmIcon\n styles={this.theme.mergeStyle({}, this.styles.tabIcon, floating? this.styles.centerHubIcon: {}, isActive ? this.styles.activeTabIcon : {})}\n iconclass={item.icon}\n ></WmIcon>\n </View>\n </View>\n <Text style={[this.styles.tabLabel, floating? this.styles.centerHubLabel: {}, isActive ? this.styles.activeTabLabel : {}]} numberOfLines={1}>\n {getDisplayLabel(item.label)}\n </Text>\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 isVisible(): boolean {\n return super.isVisible() && !this.keyBoardShown;\n }\n\n animateWithTiming(value: number, duratiion: number): void {\n Animated.timing(this.translateY, {\n toValue: value, \n easing: Easing.linear,\n duration: duratiion, \n useNativeDriver: false\n }).start()\n }\n\n subscribeToPageScroll(){\n this.tabbarHeightWithInsets = 0;\n this.destroyScrollListner = this.subscribe('scroll', (event: NativeSyntheticEvent<NativeScrollEvent>)=>{\n const { contentOffset, layoutMeasurement, contentSize } = event.nativeEvent ;\n const scrollPosition = contentOffset.y ;\n this.tabbarHeightWithInsets = this.tabbarHeightWithInsets ? this.tabbarHeightWithInsets : this.getLayout()?.height ;\n const visibleContentHeight = layoutMeasurement.height ;\n const endReached = (scrollPosition + visibleContentHeight + this.tabbarHeightWithInsets) >= contentSize.height ;\n const bottomInsets = this.insets?.bottom || 0\n const e = event as unknown as CustomScrollEvent;\n if(e.scrollDelta >= 2){\n if(e.scrollDirection < 0){\n this.animateWithTiming(0, 100)\n }else if(e.scrollDirection > 0) {\n this.animateWithTiming(this.tabbarHeightWithInsets + bottomInsets, 100)\n }\n }\n if(endReached){\n this.animateWithTiming(0, 0)\n }\n })\n }\n\n componentWillUnmount(): void {\n this.destroyScrollListner && this.destroyScrollListner();\n }\n\n renderContent(props: WmTabbarProps){\n let max = 5;\n const tabItems = this.state.dataItems;\n const tabItemsLength = tabItems.length;\n const isClippedTabbar = ((props.classname || '').indexOf('clipped-tabbar') >= 0) && (tabItemsLength % 2 !== 0);\n if (isClippedTabbar && tabItemsLength % 2 !== 0) {\n const middleIndex = Math.floor(tabItemsLength / 2);\n tabItems[middleIndex]['floating'] = true;\n tabItems[middleIndex - 1]['indexBeforeMid'] = middleIndex-1;\n }\n this.returnpathDown = getPathDown(this.maxWidth, 65 ,60,this.styles.root.height as number);\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 TabDataItem;\n }\n moreItems.push(row);\n }\n max = max - 1;\n }\n return (\n <SafeAreaInsetsContext.Consumer>\n {(insets = { top: 0, bottom: 0, left: 0, right: 0 }) => {\n this.insets = insets;\n const paddingBottomVal = this.styles.root.paddingBottom || this.styles.root.padding;\n const statusBarCustomisation = this.appConfig?.preferences?.statusbarStyles;\n const isFullScreenMode = !!statusBarCustomisation?.translucent;\n const stylesWithFs = isFullScreenMode ? {height: this.styles.root.height as number + (insets?.bottom || 0) as number, \n paddingBottom: (paddingBottomVal || 0) as number + (insets?.bottom || 0) as number} : {}\n return (\n <NavigationServiceConsumer>\n {(navigationService) =>(\n <View style={[this.styles.root, stylesWithFs]} \n ref={(ref)=> {this.baseView = ref as any}}\n onLayout={(event: LayoutChangeEvent) => this.handleLayout(event)} \n >\n {isClippedTabbar ? (\n <Svg width={this.maxWidth} height={scale(this.styles.root.height as number)} style={{zIndex: -1,position: 'absolute',backgroundColor: ThemeVariables.INSTANCE.transparent}}>\n <Path fill={ThemeVariables.INSTANCE.tabbarBackgroundColor} {...{ d: this.returnpathDown }}/>\n </Svg>\n ): <></>} \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, index) => this.renderTabItem(item, i + '', 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, i + '', props, () => this.onItemSelect(item, navigationService), item.floating))}\n {tabItems.length > max && (\n this.renderTabItem({\n label: props.morebuttonlabel,\n icon: props.morebuttoniconclass\n } as TabDataItem, 6666 +'', props, () => {\n this.updateState({showMore: !this.state.showMore} as WmTabbarState<WmTabbarProps>);\n })\n )}\n </View>\n </View>)}\n </NavigationServiceConsumer>\n )}}\n </SafeAreaInsetsContext.Consumer>\n )\n }\n\n renderWidget(props: WmTabbarProps) {\n this.isFixed = true;\n const animateStyle = props.hideonscroll ? {transform: [{translateY: this.translateY}]} : {};\n return <>\n <FixedView \n style={{...{bottom: 0, width:'100%'}, ...animateStyle}} \n theme={this.theme}\n animated={props.hideonscroll || false}>\n {this.renderContent(props)}\n </FixedView>\n <View style={{ opacity: 0}}>\n {this.renderContent(props)}\n </View>\n </>\n }\n}\n"],"mappings":";;;;AAAA,OAAOA,KAAK,MAAqB,OAAO;AACxC,SAASC,IAAI,EAAEC,IAAI,EAAEC,gBAAgB,EAAEC,UAAU,EAAEC,QAAQ,EAAEC,QAAQ,EAAEC,MAAM,QAEtE,cAAc;AACrB,SAASC,aAAa,QAAQ,wCAAwC;AACtE,SAASC,aAAa,QAAoC,8CAA8C;AACxG,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Ae;QAC5B9G,IAAI,EAAElD,KAAK,CAACiK;MACd,CAAC,EAAiB,IAAI,GAAE,EAAE,EAAEjK,KAAK,EAAG,MAAM;QACxC,IAAI,CAACkK,WAAW,CAAC;UAACb,QAAQ,EAAE,CAAC,IAAI,CAACzH,KAAK,CAACyH;QAAQ,CAAiC,CAAC;MACpF,CAAC,CAEC,CACF,CACmB,CAAC;IAC3B,CAC6B,CAAC;EAEnC;EAEAc,YAAYA,CAACnK,KAAoB,EAAE;IACjC,IAAI,CAACoK,OAAO,GAAG,IAAI;IACnB,MAAMC,YAAY,GAAGrK,KAAK,CAACsK,YAAY,GAAG;MAACC,SAAS,EAAE,CAAC;QAAC5F,UAAU,EAAE,IAAI,CAACA;MAAU,CAAC;IAAC,CAAC,GAAG,CAAC,CAAC;IAC3F,oBAAOzG,KAAA,CAAAkE,aAAA,CAAAlE,KAAA,CAAAiL,QAAA,qBACHjL,KAAA,CAAAkE,aAAA,CAAC9C,SAAS;MACRiD,KAAK,EAAE;QAAC,GAAG;UAAC2B,MAAM,EAAE,CAAC;UAAE/D,KAAK,EAAC;QAAM,CAAC;QAAE,GAAGkK;MAAY,CAAE;MACvDzH,KAAK,EAAE,IAAI,CAACA,KAAM;MAClB4H,QAAQ,EAAExK,KAAK,CAACsK,YAAY,IAAI;IAAM,GACrC,IAAI,CAAC/D,aAAa,CAACvG,KAAK,CAChB,CAAC,eACZ9B,KAAA,CAAAkE,aAAA,CAAChE,IAAI;MAACmE,KAAK,EAAE;QAAEkI,OAAO,EAAE;MAAC;IAAE,GACxB,IAAI,CAAClE,aAAa,CAACvG,KAAK,CACrB,CACR,CAAC;EACL;AACF","ignoreList":[]}
@@ -23,6 +23,7 @@ export default class WmTabbarProps extends BaseNavProps {
23
23
  'label': 'Settings',
24
24
  'icon': 'wm-sl-r sl-settings'
25
25
  }]);
26
+ _defineProperty(this, "hideonscroll", false);
26
27
  }
27
28
  }
28
29
  //# sourceMappingURL=tabbar.props.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["BaseNavProps","WmTabbarProps","constructor","args","_defineProperty","item"],"sources":["tabbar.props.ts"],"sourcesContent":["import { BaseNavProps } from '../../navigation/basenav/basenav.props';\nimport WmTabbar from './tabbar.component';\n\nexport default class WmTabbarProps extends BaseNavProps {\n morebuttoniconclass? = 'wi wi-more-horiz';\n morebuttonlabel? = 'more';\n itemchildren?: string = 'children';\n isActive? = (item: any) => false;\n onSelect? : (event: any, widget: WmTabbar) => any;\n dataset?: any = [{\n 'label' : 'Home',\n 'icon' : 'wm-sl-r sl-home'\n },{\n 'label' : 'Analytics',\n 'icon' : 'wm-sl-r sl-graph-ascend'\n },{\n 'label' : 'Alerts',\n 'icon' : 'wm-sl-r sl-alarm-bell'\n },{\n 'label' : 'Settings',\n 'icon' : 'wm-sl-r sl-settings'\n }]\n}\n"],"mappings":";;;AAAA,SAASA,YAAY,QAAQ,wCAAwC;AAGrE,eAAe,MAAMC,aAAa,SAASD,YAAY,CAAC;EAAAE,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAC,eAAA,8BAC/B,kBAAkB;IAAAA,eAAA,0BACtB,MAAM;IAAAA,eAAA,uBACD,UAAU;IAAAA,eAAA,mBACrBC,IAAS,IAAK,KAAK;IAAAD,eAAA;IAAAA,eAAA,kBAEhB,CAAC;MACb,OAAO,EAAG,MAAM;MAChB,MAAM,EAAI;IACZ,CAAC,EAAC;MACA,OAAO,EAAG,WAAW;MACrB,MAAM,EAAI;IACZ,CAAC,EAAC;MACA,OAAO,EAAG,QAAQ;MAClB,MAAM,EAAI;IACZ,CAAC,EAAC;MACA,OAAO,EAAG,UAAU;MACpB,MAAM,EAAI;IACZ,CAAC,CAAC;EAAA;AACN","ignoreList":[]}
1
+ {"version":3,"names":["BaseNavProps","WmTabbarProps","constructor","args","_defineProperty","item"],"sources":["tabbar.props.ts"],"sourcesContent":["import { BaseNavProps } from '../../navigation/basenav/basenav.props';\nimport WmTabbar from './tabbar.component';\n\nexport default class WmTabbarProps extends BaseNavProps {\n morebuttoniconclass? = 'wi wi-more-horiz';\n morebuttonlabel? = 'more';\n itemchildren?: string = 'children';\n isActive? = (item: any) => false;\n onSelect? : (event: any, widget: WmTabbar) => any;\n dataset?: any = [{\n 'label' : 'Home',\n 'icon' : 'wm-sl-r sl-home'\n },{\n 'label' : 'Analytics',\n 'icon' : 'wm-sl-r sl-graph-ascend'\n },{\n 'label' : 'Alerts',\n 'icon' : 'wm-sl-r sl-alarm-bell'\n },{\n 'label' : 'Settings',\n 'icon' : 'wm-sl-r sl-settings'\n }];\n hideonscroll: boolean = false;\n}\n"],"mappings":";;;AAAA,SAASA,YAAY,QAAQ,wCAAwC;AAGrE,eAAe,MAAMC,aAAa,SAASD,YAAY,CAAC;EAAAE,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAC,eAAA,8BAC/B,kBAAkB;IAAAA,eAAA,0BACtB,MAAM;IAAAA,eAAA,uBACD,UAAU;IAAAA,eAAA,mBACrBC,IAAS,IAAK,KAAK;IAAAD,eAAA;IAAAA,eAAA,kBAEhB,CAAC;MACb,OAAO,EAAG,MAAM;MAChB,MAAM,EAAI;IACZ,CAAC,EAAC;MACA,OAAO,EAAG,WAAW;MACrB,MAAM,EAAI;IACZ,CAAC,EAAC;MACA,OAAO,EAAG,QAAQ;MAClB,MAAM,EAAI;IACZ,CAAC,EAAC;MACA,OAAO,EAAG,UAAU;MACpB,MAAM,EAAI;IACd,CAAC,CAAC;IAAAA,eAAA,uBACsB,KAAK;EAAA;AAC/B","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["AppConfig.ts"],"sourcesContent":["export interface Drawer {\n setContent: (c: React.ReactNode) => void;\n getContent: () => React.ReactNode;\n setAnimation: (animation: string) => void;\n getAnimation: () => string;\n}\n\nexport default interface AppConfig {\n appId: string;\n assets: any;\n appProperties: any;\n appLocale: any;\n url: string;\n leftNavWidth: any;\n loadApp: boolean;\n refresh: (complete?: boolean) => void,\n currentPage?: any;\n pages?: any[];\n landingPage: string;\n partials?: any[];\n drawer: Drawer;\n app: any;\n spinner: any;\n setDrawerContent: any;\n theme: any;\n drawerType: any;\n preferences:any;\n getServiceDefinitions: any;\n loggedInUser: any;\n selectedLocale: string;\n revertLayoutToExpo50: boolean,\n diagnostics: {\n appStartTime: number,\n appReadyTime: number,\n pageStartTime: number,\n pageReadyTime: number\n }\n}"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"names":[],"sources":["AppConfig.ts"],"sourcesContent":["export interface Drawer {\n setContent: (c: React.ReactNode) => void;\n getContent: () => React.ReactNode;\n setAnimation: (animation: string) => void;\n getAnimation: () => string;\n}\n\nexport default interface AppConfig {\n appId: string;\n assets: any;\n appProperties: any;\n appLocale: any;\n url: string;\n leftNavWidth: any;\n loadApp: boolean;\n refresh: (complete?: boolean) => void,\n currentPage?: any;\n pages?: any[];\n landingPage: string;\n partials?: any[];\n drawer: Drawer;\n app: any;\n spinner: any;\n setDrawerContent: any;\n theme: any;\n drawerType: any;\n preferences:any;\n getServiceDefinitions: any;\n loggedInUser: any;\n selectedLocale: string;\n revertLayoutToExpo50: boolean,\n diagnostics: {\n appStartTime: number,\n appReadyTime: number,\n pageStartTime: number,\n pageReadyTime: number\n }, \n pageScrollTopThreshold: number;\n}"],"mappings":"","ignoreList":[]}
@@ -4,7 +4,7 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
4
4
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
5
5
  import { assign, isUndefined, isNil } from 'lodash';
6
6
  import React from 'react';
7
- import { AccessibilityInfo, Platform, StyleSheet, View } from 'react-native';
7
+ import { AccessibilityInfo, Platform, StyleSheet, View, InteractionManager } from 'react-native';
8
8
  import * as Animatable from 'react-native-animatable';
9
9
  import ThemeVariables from '@wavemaker/app-rn-runtime/styles/theme.variables';
10
10
  import { StyleProps, getStyleName } from '@wavemaker/app-rn-runtime/styles/style-props';
@@ -77,6 +77,7 @@ export class BaseComponent extends React.Component {
77
77
  _defineProperty(this, "destroyed", false);
78
78
  _defineProperty(this, "_showSkeleton", false);
79
79
  _defineProperty(this, "isFixed", false);
80
+ _defineProperty(this, "isSticky", false);
80
81
  _defineProperty(this, "notifier", new EventNotifier());
81
82
  _defineProperty(this, "parentListenerDestroyers", []);
82
83
  _defineProperty(this, "_background", /*#__PURE__*/React.createElement(React.Fragment, null));
@@ -87,6 +88,15 @@ export class BaseComponent extends React.Component {
87
88
  _defineProperty(this, "_showView", true);
88
89
  _defineProperty(this, "closestTappable", void 0);
89
90
  _defineProperty(this, "componentNode", void 0);
91
+ _defineProperty(this, "layout", {
92
+ x: 0,
93
+ y: 0,
94
+ width: 0,
95
+ height: 0,
96
+ px: 0,
97
+ py: 0
98
+ });
99
+ _defineProperty(this, "baseView", View);
90
100
  _defineProperty(this, "hideSkeletonInPageContentWhenDisabledInPage", () => {
91
101
  var _this$parent$state;
92
102
  const isPageContentWidget = this.defaultClass && this.defaultClass === 'app-page-content';
@@ -252,14 +262,14 @@ export class BaseComponent extends React.Component {
252
262
  this.initialized = true;
253
263
  }
254
264
  componentWillAttach() {
255
- if (this.isFixed) {
265
+ if (this.isFixed || this.isSticky) {
256
266
  this.setState({
257
267
  hide: false
258
268
  });
259
269
  }
260
270
  }
261
271
  componentWillDetach() {
262
- if (this.isFixed) {
272
+ if (this.isFixed || this.isSticky) {
263
273
  this.setState({
264
274
  hide: true
265
275
  });
@@ -318,7 +328,7 @@ export class BaseComponent extends React.Component {
318
328
  this.parent.componentNode.add(this.componentNode);
319
329
  this.notifier.setParent(parent.notifier);
320
330
  this.parentListenerDestroyers = [this.parent.subscribe('forceUpdate', () => {
321
- this.cleanRefresh();
331
+ this.forceUpdate();
322
332
  }), this.parent.subscribe('destroy', () => {
323
333
  this.destroyParentListeners();
324
334
  })];
@@ -327,7 +337,7 @@ export class BaseComponent extends React.Component {
327
337
  getName() {
328
338
  return this.props.name;
329
339
  }
330
- handleLayout(event) {
340
+ handleLayout(event, ref = null) {
331
341
  const key = this.getName && this.getName();
332
342
  if (key) {
333
343
  const newLayoutPosition = {
@@ -337,6 +347,26 @@ export class BaseComponent extends React.Component {
337
347
  }
338
348
  };
339
349
  setPosition(newLayoutPosition);
350
+ const componentRef = ref !== null ? ref : this.baseView;
351
+ // Layout values by measure
352
+ if (componentRef !== null && componentRef !== void 0 && componentRef.measure) {
353
+ const updateLayout = () => {
354
+ componentRef.measure((x = 0, y = 0, width = 0, height = 0, px = 0, py = 0) => {
355
+ this.layout = {
356
+ x,
357
+ y,
358
+ width,
359
+ height,
360
+ px,
361
+ py
362
+ };
363
+ });
364
+ };
365
+ updateLayout();
366
+ InteractionManager.runAfterInteractions(() => {
367
+ requestAnimationFrame(updateLayout);
368
+ });
369
+ }
340
370
  }
341
371
  }
342
372
  copyStyles(property, from, to) {
@@ -450,6 +480,9 @@ export class BaseComponent extends React.Component {
450
480
  getLayoutOfWidget(name) {
451
481
  return getPosition(name);
452
482
  }
483
+ getLayout() {
484
+ return this.layout;
485
+ }
453
486
  scrollToTop() {
454
487
  this.notify('scrollToPosition', [{
455
488
  x: 0,