@wavemaker/app-rn-runtime 11.15.2-rc.64737 → 11.15.4-rc.250

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.
@@ -75,13 +75,13 @@ export default class WmButton extends BaseComponent {
75
75
  return this.styles.root[side];
76
76
  }
77
77
  renderWidget(props) {
78
- var _this$parent;
78
+ var _this$parent, _this$props2;
79
79
  const parentAlignment = (_this$parent = this.parent) === null || _this$parent === void 0 || (_this$parent = _this$parent.props) === null || _this$parent === void 0 ? void 0 : _this$parent.alignment;
80
80
  return /*#__PURE__*/React.createElement(Animatedview, {
81
81
  entryanimation: props.animation,
82
82
  delay: props.animationdelay,
83
83
  onLayout: event => this.handleLayout(event),
84
- style: [this.styles.root, {
84
+ style: [this.props.styles ? this.theme.mergeStyle(this.styles.root, (_this$props2 = this.props) === null || _this$props2 === void 0 || (_this$props2 = _this$props2.styles) === null || _this$props2 === void 0 ? void 0 : _this$props2.root) : this.styles.root, {
85
85
  paddingTop: 0,
86
86
  paddingBottom: 0,
87
87
  paddingLeft: 0,
@@ -1 +1 @@
1
- {"version":3,"names":["React","Text","View","BaseComponent","BaseComponentState","Tappable","Badge","WmButtonProps","DEFAULT_CLASS","WmIcon","Animatedview","createSkeleton","AccessibilityWidgetType","getAccessibilityProps","WmButtonState","WmButton","constructor","props","prepareIcon","iconclass","iconurl","hint","name","iconsize","iconheight","iconmargin","iconwidth","createElement","id","getTestId","styles","icon","accessible","prepareBadge","_extends","style","badge","pointerEvents","getTestProps","badgevalue","renderSkeleton","prop","skeletonWidth","skeletonHeight","skeletonwidth","_this$styles$root","root","width","skeletonheight","_this$styles$root2","height","theme","skeleton","tappableRootPadding","side","_this$props","fromProps","undefined","renderWidget","_this$parent","parentAlignment","parent","alignment","entryanimation","animation","delay","animationdelay","onLayout","event","handleLayout","paddingTop","paddingBottom","paddingLeft","paddingRight","overflow","flexDirection","alignSelf","flex","_background","disableTouchEffect","state","disabletoucheffect","justifyContent","rippleColor","target","getTestPropsForAction","accessibilityProps","BUTTON","content","iconposition","caption","text","getTestPropsForLabel","importantForAccessibility"],"sources":["button.component.tsx"],"sourcesContent":["import React from 'react';\nimport { DimensionValue, LayoutChangeEvent, Text, View } from 'react-native';\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\nimport { Tappable } from '@wavemaker/app-rn-runtime/core/tappable.component';\nimport { Badge } from 'react-native-paper';\n\nimport WmButtonProps from './button.props';\nimport { DEFAULT_CLASS, WmButtonStyles } from './button.styles';\nimport WmIcon from '@wavemaker/app-rn-runtime/components/basic/icon/icon.component';\nimport { Animatedview } from '@wavemaker/app-rn-runtime/components/basic/animatedview.component';\nimport { createSkeleton } from '../skeleton/skeleton.component';\nimport { AccessibilityWidgetType, getAccessibilityProps } from '@wavemaker/app-rn-runtime/core/accessibility';\nexport class WmButtonState extends BaseComponentState<WmButtonProps> {\n\n}\n\nexport default class WmButton extends BaseComponent<WmButtonProps, WmButtonState, WmButtonStyles> {\n\n constructor(props: WmButtonProps) {\n super(props, DEFAULT_CLASS, new WmButtonProps());\n }\n\n private prepareIcon({\n iconclass,\n iconurl,\n hint,\n name,\n iconsize,\n iconheight,\n iconmargin,\n iconwidth,\n }: any) {\n return iconclass || iconurl\n ? (<WmIcon\n id={this.getTestId('icon')}\n hint={hint}\n styles={this.styles.icon}\n name={`${name}_icon`}\n iconclass={iconclass}\n iconsize={iconsize}\n iconurl={iconurl}\n iconheight={iconheight}\n iconmargin={iconmargin}\n iconwidth={iconwidth}\n accessible={false}\n />): null;\n }\n\n private prepareBadge(props: any) {\n //@ts-ignore\n return (<Badge style={this.styles.badge} pointerEvents='none' {...this.getTestProps('badge')}>{props.badgevalue}</Badge>);\n }\n\n public renderSkeleton(prop: WmButtonProps) {\n let skeletonWidth, skeletonHeight;\n if(this.props.skeletonwidth == \"0\") {\n skeletonWidth = 0\n } else {\n skeletonWidth = this.props.skeletonwidth || this.styles.root?.width\n }\n\n if(this.props.skeletonheight == \"0\") {\n skeletonHeight = 0\n } else {\n skeletonHeight = this.props.skeletonheight || this.styles.root?.height;\n }\n\n return createSkeleton(this.theme, this.styles.skeleton, {\n ...this.styles.root,\n width: skeletonWidth as DimensionValue,\n height: skeletonHeight as DimensionValue\n });\n }\n \n private tappableRootPadding(side: 'paddingTop' | 'paddingBottom' | 'paddingLeft' | 'paddingRight') {\n const fromProps = this.props?.styles?.root?.[side];\n if (fromProps !== undefined && fromProps !== null && fromProps !== '') {\n return fromProps === 0 ? 0 : fromProps;\n }\n return this.styles.root[side];\n }\n\n renderWidget(props: WmButtonProps) {\n const parentAlignment = this.parent?.props?.alignment\n return (\n <Animatedview entryanimation={props.animation} delay={props.animationdelay}\n onLayout={(event: LayoutChangeEvent) => this.handleLayout(event)}\n style={[\n this.styles.root,\n {\n paddingTop: 0,\n paddingBottom: 0,\n paddingLeft: 0,\n paddingRight: 0,\n overflow: props.badgevalue ? 'visible' : 'hidden',\n flexDirection: 'column'\n },\n parentAlignment ? {} : { alignSelf: 'flex-start'},\n this.styles.root.height == \"100%\" ? {flex: 1}:{}\n ]}\n >\n {this._background}\n <Tappable\n disableTouchEffect={this.state.props.disabletoucheffect}\n styles={{\n paddingTop: this.tappableRootPadding('paddingTop'),\n paddingBottom: this.tappableRootPadding('paddingBottom'),\n paddingLeft: this.tappableRootPadding('paddingLeft'),\n paddingRight: this.tappableRootPadding('paddingRight'),\n width: '100%',\n height: this.styles.root.height ? '100%' : null,\n justifyContent: 'center',\n }}\n rippleColor = {this.styles.root.rippleColor}\n target={this}\n {...this.getTestPropsForAction()}\n accessibilityProps={{...getAccessibilityProps(\n AccessibilityWidgetType.BUTTON,\n props\n )}}>\n <View\n style={[\n this.styles.content,\n { flexDirection: props.iconposition === 'top' ? 'column' : 'row' }\n ]}>\n {props.iconposition === 'top' && this.prepareIcon(props)}\n {props.iconposition === 'left' && this.prepareIcon(props)}\n {props.caption ? (\n <Text\n style={this.styles.text}\n {...this.getTestPropsForLabel('caption')}\n importantForAccessibility={'no'}\n >\n {props.caption}\n </Text>\n ) : null}\n {props.iconposition === 'right' && this.prepareIcon(props)}\n </View>\n </Tappable>\n {props.badgevalue && this.prepareBadge(props)}\n </Animatedview>\n );\n }\n}\n"],"mappings":";AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAA4CC,IAAI,EAAEC,IAAI,QAAQ,cAAc;AAC5E,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,+CAA+C;AACjG,SAASC,QAAQ,QAAQ,mDAAmD;AAC5E,SAASC,KAAK,QAAQ,oBAAoB;AAE1C,OAAOC,aAAa,MAAM,gBAAgB;AAC1C,SAASC,aAAa,QAAwB,iBAAiB;AAC/D,OAAOC,MAAM,MAAM,gEAAgE;AACnF,SAASC,YAAY,QAAQ,mEAAmE;AAChG,SAASC,cAAc,QAAQ,gCAAgC;AAC/D,SAASC,uBAAuB,EAAEC,qBAAqB,QAAQ,8CAA8C;AAC7G,OAAO,MAAMC,aAAa,SAASV,kBAAkB,CAAgB;AAIrE,eAAe,MAAMW,QAAQ,SAASZ,aAAa,CAA+C;EAEhGa,WAAWA,CAACC,KAAoB,EAAE;IAChC,KAAK,CAACA,KAAK,EAAET,aAAa,EAAE,IAAID,aAAa,CAAC,CAAC,CAAC;EAClD;EAEQW,WAAWA,CAAC;IAClBC,SAAS;IACTC,OAAO;IACPC,IAAI;IACJC,IAAI;IACJC,QAAQ;IACRC,UAAU;IACVC,UAAU;IACVC;EACG,CAAC,EAAE;IACN,OAAOP,SAAS,IAAIC,OAAO,gBACtBpB,KAAA,CAAA2B,aAAA,CAAClB,MAAM;MACNmB,EAAE,EAAE,IAAI,CAACC,SAAS,CAAC,MAAM,CAAE;MAC3BR,IAAI,EAAEA,IAAK;MACXS,MAAM,EAAE,IAAI,CAACA,MAAM,CAACC,IAAK;MACzBT,IAAI,EAAE,GAAGA,IAAI,OAAQ;MACrBH,SAAS,EAAEA,SAAU;MACrBI,QAAQ,EAAEA,QAAS;MACnBH,OAAO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AACwE,YAAY,KAAK,MAAM,IAAI,IAAI,CAACvE,WAAW,CAACD,KAAK,CAAC,EACxDA,KAAK,CAACyE,OAAO,gBACZ1F,KAAA,CAAA2B,aAAA,CAAC1B,IAAI,EAAAiC,QAAA;MACHC,KAAK,EAAE,IAAI,CAACL,MAAM,CAAC6D;IAAK,GACpB,IAAI,CAACC,oBAAoB,CAAC,SAAS,CAAC;MACxCC,yBAAyB,EAAE;IAAK,IAE/B5E,KAAK,CAACyE,OACH,CAAC,GACL,IAAI,EACPzE,KAAK,CAACwE,YAAY,KAAK,OAAO,IAAI,IAAI,CAACvE,WAAW,CAACD,KAAK,CACrD,CACE,CAAC,EACVA,KAAK,CAACsB,UAAU,IAAI,IAAI,CAACN,YAAY,CAAChB,KAAK,CAChC,CAAC;EAEnB;AACF","ignoreList":[]}
1
+ {"version":3,"names":["React","Text","View","BaseComponent","BaseComponentState","Tappable","Badge","WmButtonProps","DEFAULT_CLASS","WmIcon","Animatedview","createSkeleton","AccessibilityWidgetType","getAccessibilityProps","WmButtonState","WmButton","constructor","props","prepareIcon","iconclass","iconurl","hint","name","iconsize","iconheight","iconmargin","iconwidth","createElement","id","getTestId","styles","icon","accessible","prepareBadge","_extends","style","badge","pointerEvents","getTestProps","badgevalue","renderSkeleton","prop","skeletonWidth","skeletonHeight","skeletonwidth","_this$styles$root","root","width","skeletonheight","_this$styles$root2","height","theme","skeleton","tappableRootPadding","side","_this$props","fromProps","undefined","renderWidget","_this$parent","_this$props2","parentAlignment","parent","alignment","entryanimation","animation","delay","animationdelay","onLayout","event","handleLayout","mergeStyle","paddingTop","paddingBottom","paddingLeft","paddingRight","overflow","flexDirection","alignSelf","flex","_background","disableTouchEffect","state","disabletoucheffect","justifyContent","rippleColor","target","getTestPropsForAction","accessibilityProps","BUTTON","content","iconposition","caption","text","getTestPropsForLabel","importantForAccessibility"],"sources":["button.component.tsx"],"sourcesContent":["import React from 'react';\nimport { DimensionValue, LayoutChangeEvent, Text, View } from 'react-native';\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\nimport { Tappable } from '@wavemaker/app-rn-runtime/core/tappable.component';\nimport { Badge } from 'react-native-paper';\n\nimport WmButtonProps from './button.props';\nimport { DEFAULT_CLASS, WmButtonStyles } from './button.styles';\nimport WmIcon from '@wavemaker/app-rn-runtime/components/basic/icon/icon.component';\nimport { Animatedview } from '@wavemaker/app-rn-runtime/components/basic/animatedview.component';\nimport { createSkeleton } from '../skeleton/skeleton.component';\nimport { AccessibilityWidgetType, getAccessibilityProps } from '@wavemaker/app-rn-runtime/core/accessibility';\nexport class WmButtonState extends BaseComponentState<WmButtonProps> {\n\n}\n\nexport default class WmButton extends BaseComponent<WmButtonProps, WmButtonState, WmButtonStyles> {\n\n constructor(props: WmButtonProps) {\n super(props, DEFAULT_CLASS, new WmButtonProps());\n }\n\n private prepareIcon({\n iconclass,\n iconurl,\n hint,\n name,\n iconsize,\n iconheight,\n iconmargin,\n iconwidth,\n }: any) {\n return iconclass || iconurl\n ? (<WmIcon\n id={this.getTestId('icon')}\n hint={hint}\n styles={this.styles.icon}\n name={`${name}_icon`}\n iconclass={iconclass}\n iconsize={iconsize}\n iconurl={iconurl}\n iconheight={iconheight}\n iconmargin={iconmargin}\n iconwidth={iconwidth}\n accessible={false}\n />): null;\n }\n\n private prepareBadge(props: any) {\n //@ts-ignore\n return (<Badge style={this.styles.badge} pointerEvents='none' {...this.getTestProps('badge')}>{props.badgevalue}</Badge>);\n }\n\n public renderSkeleton(prop: WmButtonProps) {\n let skeletonWidth, skeletonHeight;\n if(this.props.skeletonwidth == \"0\") {\n skeletonWidth = 0\n } else {\n skeletonWidth = this.props.skeletonwidth || this.styles.root?.width\n }\n\n if(this.props.skeletonheight == \"0\") {\n skeletonHeight = 0\n } else {\n skeletonHeight = this.props.skeletonheight || this.styles.root?.height;\n }\n\n return createSkeleton(this.theme, this.styles.skeleton, {\n ...this.styles.root,\n width: skeletonWidth as DimensionValue,\n height: skeletonHeight as DimensionValue\n });\n }\n \n private tappableRootPadding(side: 'paddingTop' | 'paddingBottom' | 'paddingLeft' | 'paddingRight') {\n const fromProps = this.props?.styles?.root?.[side];\n if (fromProps !== undefined && fromProps !== null && fromProps !== '') {\n return fromProps === 0 ? 0 : fromProps;\n }\n return this.styles.root[side];\n }\n\n renderWidget(props: WmButtonProps) {\n const parentAlignment = this.parent?.props?.alignment\n return (\n <Animatedview entryanimation={props.animation} delay={props.animationdelay}\n onLayout={(event: LayoutChangeEvent) => this.handleLayout(event)}\n style={[\n this.props.styles ? this.theme.mergeStyle(this.styles.root,this.props?.styles?.root) : this.styles.root,\n {\n paddingTop: 0,\n paddingBottom: 0,\n paddingLeft: 0,\n paddingRight: 0,\n overflow: props.badgevalue ? 'visible' : 'hidden',\n flexDirection: 'column'\n },\n parentAlignment ? {} : { alignSelf: 'flex-start'},\n this.styles.root.height == \"100%\" ? {flex: 1}:{}\n ]}\n >\n {this._background}\n <Tappable\n disableTouchEffect={this.state.props.disabletoucheffect}\n styles={{\n paddingTop: this.tappableRootPadding('paddingTop'),\n paddingBottom: this.tappableRootPadding('paddingBottom'),\n paddingLeft: this.tappableRootPadding('paddingLeft'),\n paddingRight: this.tappableRootPadding('paddingRight'),\n width: '100%',\n height: this.styles.root.height ? '100%' : null,\n justifyContent: 'center',\n }}\n rippleColor = {this.styles.root.rippleColor}\n target={this}\n {...this.getTestPropsForAction()}\n accessibilityProps={{...getAccessibilityProps(\n AccessibilityWidgetType.BUTTON,\n props\n )}}>\n <View\n style={[\n this.styles.content,\n { flexDirection: props.iconposition === 'top' ? 'column' : 'row' }\n ]}>\n {props.iconposition === 'top' && this.prepareIcon(props)}\n {props.iconposition === 'left' && this.prepareIcon(props)}\n {props.caption ? (\n <Text\n style={this.styles.text}\n {...this.getTestPropsForLabel('caption')}\n importantForAccessibility={'no'}\n >\n {props.caption}\n </Text>\n ) : null}\n {props.iconposition === 'right' && this.prepareIcon(props)}\n </View>\n </Tappable>\n {props.badgevalue && this.prep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AAC0E,YAAY,KAAK,KAAK,GAAG,QAAQ,GAAG;MAAM,CAAC;IAClE,GACD1E,KAAK,CAAC0E,YAAY,KAAK,KAAK,IAAI,IAAI,CAACzE,WAAW,CAACD,KAAK,CAAC,EACvDA,KAAK,CAAC0E,YAAY,KAAK,MAAM,IAAI,IAAI,CAACzE,WAAW,CAACD,KAAK,CAAC,EACxDA,KAAK,CAAC2E,OAAO,gBACZ5F,KAAA,CAAA2B,aAAA,CAAC1B,IAAI,EAAAiC,QAAA;MACHC,KAAK,EAAE,IAAI,CAACL,MAAM,CAAC+D;IAAK,GACpB,IAAI,CAACC,oBAAoB,CAAC,SAAS,CAAC;MACxCC,yBAAyB,EAAE;IAAK,IAE/B9E,KAAK,CAAC2E,OACH,CAAC,GACL,IAAI,EACP3E,KAAK,CAAC0E,YAAY,KAAK,OAAO,IAAI,IAAI,CAACzE,WAAW,CAACD,KAAK,CACrD,CACE,CAAC,EACVA,KAAK,CAACsB,UAAU,IAAI,IAAI,CAACN,YAAY,CAAChB,KAAK,CAChC,CAAC;EAEnB;AACF","ignoreList":[]}
@@ -16,6 +16,59 @@ import { SafeAreaInsetsContext } from 'react-native-safe-area-context';
16
16
  import { StickyContainer } from '@wavemaker/app-rn-runtime/core/components/sticky-container.component';
17
17
  import { getParentStyles } from '@wavemaker/app-rn-runtime/core/components/sticky-container.styles';
18
18
  import injector from '@wavemaker/app-rn-runtime/core/injector';
19
+ // Alignment matrix for flex properties
20
+ const alignmentMatrixFixed = {
21
+ 'top-left': {
22
+ justifyContent: 'flex-start',
23
+ alignItems: 'flex-start'
24
+ },
25
+ 'top-center': {
26
+ justifyContent: 'center',
27
+ alignItems: 'flex-start'
28
+ },
29
+ 'top-right': {
30
+ justifyContent: 'flex-end',
31
+ alignItems: 'flex-start'
32
+ },
33
+ 'middle-left': {
34
+ justifyContent: 'flex-start',
35
+ alignItems: 'center'
36
+ },
37
+ 'middle-center': {
38
+ justifyContent: 'center',
39
+ alignItems: 'center'
40
+ },
41
+ 'middle-right': {
42
+ justifyContent: 'flex-end',
43
+ alignItems: 'center'
44
+ },
45
+ 'bottom-left': {
46
+ justifyContent: 'flex-start',
47
+ alignItems: 'flex-end'
48
+ },
49
+ 'bottom-center': {
50
+ justifyContent: 'center',
51
+ alignItems: 'flex-end'
52
+ },
53
+ 'bottom-right': {
54
+ justifyContent: 'flex-end',
55
+ alignItems: 'flex-end'
56
+ }
57
+ };
58
+ const alignmentMatrixAuto = {
59
+ start: {
60
+ justifyContent: 'space-between',
61
+ alignItems: 'flex-start'
62
+ },
63
+ center: {
64
+ justifyContent: 'space-between',
65
+ alignItems: 'center'
66
+ },
67
+ end: {
68
+ justifyContent: 'space-between',
69
+ alignItems: 'flex-end'
70
+ }
71
+ };
19
72
  export class WmContainerState extends PartialHostState {
20
73
  constructor(...args) {
21
74
  super(...args);
@@ -48,14 +101,181 @@ export default class WmContainer extends PartialHost {
48
101
  getBackground() {
49
102
  return this._showSkeleton ? null : this._background;
50
103
  }
104
+ isAutoLayout() {
105
+ const {
106
+ direction,
107
+ wrap,
108
+ gap,
109
+ alignment,
110
+ columngap
111
+ } = this.props;
112
+
113
+ /* Check if any of the new layout props are provided. If not, return an empty
114
+ style object to maintain backward compatibility. */
115
+ const isAutoLayoutPresent = direction !== undefined || wrap !== undefined || gap !== undefined || alignment !== undefined || columngap !== undefined;
116
+ return isAutoLayoutPresent;
117
+ }
118
+ getDimensionStyle(direction, isInnerView = false) {
119
+ const baseStyle = this.styles.root || {};
120
+ const {
121
+ width,
122
+ height
123
+ } = baseStyle;
124
+ const dimensionStyle = {};
125
+ const isRow = direction === "row";
126
+ if (isInnerView) {
127
+ if (width && width !== 'hug') {
128
+ dimensionStyle.width = '100%';
129
+ }
130
+ if (height && height !== 'hug') {
131
+ dimensionStyle.height = '100%';
132
+ }
133
+ return dimensionStyle;
134
+ }
135
+ if (height === 'fill') {
136
+ var _this$props;
137
+ if (!((_this$props = this.props) !== null && _this$props !== void 0 && _this$props['parent-direction'])) {
138
+ dimensionStyle.height = '100%';
139
+ } else {
140
+ if (isRow) {
141
+ dimensionStyle.alignSelf = 'stretch';
142
+ } else {
143
+ dimensionStyle.flexGrow = 1;
144
+ }
145
+ dimensionStyle.height = undefined;
146
+ }
147
+ } else if (height === 'hug' || height === undefined) {
148
+ if (isRow) {
149
+ dimensionStyle.alignSelf = 'flex-start';
150
+ } else {
151
+ dimensionStyle.flexGrow = 0;
152
+ }
153
+ dimensionStyle.height = undefined;
154
+ } else if (height) {
155
+ const num = typeof height === 'string' && height.endsWith('%') ? height : parseFloat(height);
156
+ dimensionStyle.height = isNaN(num) ? height : num;
157
+ }
158
+ if (width === 'fill') {
159
+ if (isRow) {
160
+ dimensionStyle.flexGrow = 1;
161
+ dimensionStyle.flexShrink = 1;
162
+ dimensionStyle.minWidth = 0;
163
+ } else {
164
+ dimensionStyle.alignSelf = 'stretch';
165
+ }
166
+ dimensionStyle.width = undefined;
167
+ } else if (width === 'hug') {
168
+ if (isRow) {
169
+ dimensionStyle.flexGrow = 0;
170
+ } else {
171
+ dimensionStyle.alignSelf = 'flex-start';
172
+ }
173
+ dimensionStyle.width = undefined;
174
+ } else if (width === undefined) {
175
+ if (isRow) {
176
+ dimensionStyle.flexGrow = 0;
177
+ } else {
178
+ dimensionStyle.alignSelf = 'stretch';
179
+ }
180
+ dimensionStyle.width = undefined;
181
+ } else if (width) {
182
+ const num = typeof width === 'string' && width.endsWith('%') ? width : parseFloat(width);
183
+ dimensionStyle.width = isNaN(num) ? width : num;
184
+ }
185
+ return dimensionStyle;
186
+ }
187
+ getGapStyle() {
188
+ const {
189
+ direction,
190
+ wrap,
191
+ gap,
192
+ alignment,
193
+ columngap
194
+ } = this.props;
195
+
196
+ /* Check if any of the new layout props are provided. If not, return an empty
197
+ style object to maintain backward compatibility. */
198
+ const isAutoLayout = this.isAutoLayout();
199
+ if (!isAutoLayout) {
200
+ return {};
201
+ }
202
+ const finalGap = gap !== null && gap !== void 0 ? gap : 4;
203
+ const finalDirection = direction !== null && direction !== void 0 ? direction : 'row';
204
+ const finalAlignment = alignment !== null && alignment !== void 0 ? alignment : 'top-left';
205
+ const isAutoGap = finalGap === 'auto';
206
+ const isRow = finalDirection === 'row';
207
+ const layoutStyle = {};
208
+ if (isAutoGap) {
209
+ const alignConfig = alignmentMatrixAuto[finalAlignment] || alignmentMatrixAuto['start'];
210
+ layoutStyle.justifyContent = alignConfig.justifyContent;
211
+ layoutStyle.alignItems = alignConfig.alignItems;
212
+ } else {
213
+ if (isRow) {
214
+ // For a row, the main-axis gap (between items) is columnGap.
215
+ layoutStyle.columnGap = Number(finalGap);
216
+ } else {
217
+ // For a column, the main-axis gap (between items) is rowGap.
218
+ layoutStyle.rowGap = Number(finalGap);
219
+ }
220
+ }
221
+ return layoutStyle;
222
+ }
223
+
224
+ // Compute content layout (flexDirection, wrap, gap, justifyContent, alignItems).
225
+ getContentContainerStyle() {
226
+ const {
227
+ direction,
228
+ wrap,
229
+ gap,
230
+ alignment,
231
+ columngap
232
+ } = this.props;
233
+
234
+ /* Check if any of the new layout props are provided. If not, return an empty
235
+ style object to maintain backward compatibility. */
236
+ if (!this.isAutoLayout()) {
237
+ return {};
238
+ }
239
+
240
+ // Apply defaults only if the new layout system is active
241
+ const finalDirection = direction !== null && direction !== void 0 ? direction : 'row';
242
+ const finalWrap = wrap !== null && wrap !== void 0 ? wrap : false;
243
+ const finalGap = gap !== null && gap !== void 0 ? gap : 4;
244
+ const finalAlignment = alignment !== null && alignment !== void 0 ? alignment : 'top-left';
245
+ const isRow = finalDirection === 'row';
246
+ const isAutoGap = finalGap === 'auto';
247
+ const isWrap = finalWrap === 'true' || finalWrap === true;
248
+ const layoutStyle = {
249
+ // flexDirection: finalDirection,
250
+ flexWrap: isWrap && isRow ? 'wrap' : 'nowrap'
251
+ };
252
+ if (!isAutoGap) {
253
+ const alignConfig = alignmentMatrixFixed[finalAlignment] || alignmentMatrixFixed['top-left'];
254
+ layoutStyle.justifyContent = isRow ? alignConfig.justifyContent : alignConfig.alignItems;
255
+ layoutStyle.alignItems = isRow ? alignConfig.alignItems : alignConfig.justifyContent;
256
+ }
257
+
258
+ // Add columnGap logic for wrapped rows
259
+ if (isWrap && isRow) {
260
+ if (columngap === 'auto') {
261
+ layoutStyle.alignContent = 'space-between';
262
+ } else if (columngap !== undefined) {
263
+ layoutStyle.rowGap = Number(columngap);
264
+ }
265
+ }
266
+ return {
267
+ ...layoutStyle,
268
+ ...this.getGapStyle()
269
+ };
270
+ }
51
271
  renderSkeleton(props) {
52
272
  if (!props.showskeletonchildren) {
53
- var _this$props;
273
+ var _this$props2;
54
274
  const dimensions = {
55
275
  width: this.styles.root.width ? '100%' : undefined,
56
276
  height: this.styles.root.height ? '100%' : undefined
57
277
  };
58
- const skeletonStyles = ((_this$props = this.props) === null || _this$props === void 0 || (_this$props = _this$props.styles) === null || _this$props === void 0 ? void 0 : _this$props.skeleton) || {
278
+ const skeletonStyles = ((_this$props2 = this.props) === null || _this$props2 === void 0 || (_this$props2 = _this$props2.styles) === null || _this$props2 === void 0 ? void 0 : _this$props2.skeleton) || {
59
279
  root: {},
60
280
  text: {}
61
281
  };
@@ -99,36 +319,54 @@ export default class WmContainer extends PartialHost {
99
319
  }
100
320
  }
101
321
  renderStickyContent(props, dimensions, styles) {
322
+ var _this$props3, _this$props5;
102
323
  const {
103
324
  stickyContainerVisibility
104
325
  } = this.state;
105
326
  const {
106
327
  positioningStyles
107
328
  } = getParentStyles(this);
329
+ const autoLayoutStyle = this.getContentContainerStyle();
330
+ const directionStyle = {};
331
+ if ((_this$props3 = this.props) !== null && _this$props3 !== void 0 && _this$props3.direction) {
332
+ var _this$props4;
333
+ directionStyle.flexDirection = (_this$props4 = this.props) === null || _this$props4 === void 0 ? void 0 : _this$props4.direction;
334
+ }
335
+ const autoLayoutDimensionsInner = this.getDimensionStyle((_this$props5 = this.props) === null || _this$props5 === void 0 ? void 0 : _this$props5.direction, true);
336
+ const isAutoLayout = this.isAutoLayout();
108
337
  return /*#__PURE__*/React.createElement(React.Fragment, null, stickyContainerVisibility ? /*#__PURE__*/React.createElement(StickyContainer, {
109
338
  component: this,
110
339
  theme: this.theme,
111
340
  style: [this.styles.sticky, {
112
341
  backgroundColor: styles.backgroundColor
113
- }],
342
+ }, isAutoLayout ? directionStyle : {}],
114
343
  positionStyles: positioningStyles,
115
344
  show: props.show
116
345
  }, /*#__PURE__*/React.createElement(View, {
117
- style: [dimensions, {
346
+ style: [isAutoLayout ? autoLayoutDimensionsInner : dimensions, {
118
347
  backgroundColor: styles.backgroundColor
119
- }, this.styles.content]
348
+ }, this.styles.content, isAutoLayout ? autoLayoutStyle : {}]
120
349
  }, this.renderContent(props))) : /*#__PURE__*/React.createElement(React.Fragment, null), /*#__PURE__*/React.createElement(Animated.View, {
121
- style: [dimensions, {
350
+ style: [isAutoLayout ? autoLayoutDimensionsInner : dimensions, {
122
351
  opacity: this.stickyContainerOpacity
123
- }, this.styles.content],
352
+ }, this.styles.content, isAutoLayout ? autoLayoutStyle : {}],
124
353
  ref: this.containerRef
125
354
  }, this.renderContent(props)));
126
355
  }
127
356
  renderWidget(props) {
357
+ var _this$props6, _this$props8, _this$props9;
358
+ const autoLayoutStyle = this.getContentContainerStyle();
359
+ const directionStyle = {};
360
+ if ((_this$props6 = this.props) !== null && _this$props6 !== void 0 && _this$props6.direction) {
361
+ var _this$props7;
362
+ directionStyle.flexDirection = (_this$props7 = this.props) === null || _this$props7 === void 0 ? void 0 : _this$props7.direction;
363
+ }
128
364
  const dimensions = {
129
365
  width: this.styles.root.width ? '100%' : undefined,
130
366
  height: this.styles.root.height ? '100%' : undefined
131
367
  };
368
+ const autoLayoutDimensions = this.getDimensionStyle((_this$props8 = this.props) === null || _this$props8 === void 0 ? void 0 : _this$props8.direction);
369
+ const autoLayoutDimensionsInner = this.getDimensionStyle((_this$props9 = this.props) === null || _this$props9 === void 0 ? void 0 : _this$props9.direction, true);
132
370
  const styles = this._showSkeleton ? {
133
371
  ...this.styles.root,
134
372
  ...this.styles.skeleton.root
@@ -136,28 +374,43 @@ export default class WmContainer extends PartialHost {
136
374
  if (props.sticky) {
137
375
  this.isSticky = true;
138
376
  }
377
+ const isAutoLayout = this.isAutoLayout();
139
378
  return /*#__PURE__*/React.createElement(SafeAreaInsetsContext.Consumer, null, (insets = {
140
379
  top: 0,
141
380
  bottom: 0,
142
381
  left: 0,
143
382
  right: 0
144
383
  }) => {
384
+ var _this$props0;
145
385
  this.insets = insets;
146
386
  return /*#__PURE__*/React.createElement(Animatedview, {
147
387
  entryanimation: props.animation,
148
388
  delay: props.animationdelay,
149
- style: styles,
389
+ style: [styles, isAutoLayout ? {
390
+ ...this.getDimensionStyle((_this$props0 = this.props) === null || _this$props0 === void 0 ? void 0 : _this$props0['parent-direction']),
391
+ ...directionStyle
392
+ } : {}],
150
393
  onLayout: (event, ref) => {
151
394
  this.handleLayout(event, ref);
152
395
  }
153
396
  }, this.getBackground(), /*#__PURE__*/React.createElement(Tappable, _extends({}, this.getTestPropsForAction(), {
154
397
  target: this,
155
- styles: dimensions,
398
+ styles: [isAutoLayout ? {
399
+ ...autoLayoutDimensionsInner,
400
+ ...directionStyle
401
+ } : dimensions],
156
402
  disableTouchEffect: this.state.props.disabletoucheffect
157
403
  }), props.sticky ? this.renderStickyContent(props, dimensions, styles) : !props.scrollable ? /*#__PURE__*/React.createElement(View, {
158
- style: [dimensions, this.styles.content]
404
+ style: [isAutoLayout ? autoLayoutDimensionsInner : dimensions, this.styles.content, isAutoLayout ? {
405
+ ...directionStyle,
406
+ ...autoLayoutStyle,
407
+ minWidth: 0
408
+ } : {}]
159
409
  }, this.renderContent(props)) : /*#__PURE__*/React.createElement(ScrollView, {
160
- style: [dimensions, this.styles.content],
410
+ style: [isAutoLayout ? autoLayoutDimensionsInner : dimensions, this.styles.content, isAutoLayout ? {
411
+ ...directionStyle,
412
+ ...autoLayoutStyle
413
+ } : {}],
161
414
  onScroll: event => this.notify('scroll', [event]),
162
415
  scrollEventThrottle: 48
163
416
  }, this.renderContent(props))));
@@ -1 +1 @@
1
- {"version":3,"names":["React","View","Platform","Animated","WmContainerProps","DEFAULT_CLASS","Tappable","Animatedview","PartialHost","PartialHostState","createSkeleton","ScrollView","StickyWrapperContext","SafeAreaInsetsContext","StickyContainer","getParentStyles","injector","WmContainerState","constructor","args","_defineProperty","WmContainer","props","get","top","bottom","left","right","containerRef","createRef","stickyContainerOpacity","Value","subscribe","_event","sticky","setTimeout","getStickyHeaderTranslateY","getBackground","_showSkeleton","_background","renderSkeleton","showskeletonchildren","_this$props","dimensions","width","styles","root","undefined","height","skeletonStyles","skeleton","text","theme","createElement","style","opacity","_extends","getTestPropsForAction","target","disableTouchEffect","state","disabletoucheffect","content","renderContent","_this$appConfig","_this$containerRef","isEdgeToEdgeApp","appConfig","edgeToEdgeConfig","current","measure","_x","_y","_width","_height","px","py","_this$insets","topInsetsInYposition","OS","insets","context","stickyContainerTranslateY","value","updateState","stickyContainerVisibility","componentDidUpdate","_prevProps","prevState","timing","toValue","delay","useNativeDriver","start","renderStickyContent","positioningStyles","Fragment","component","backgroundColor","positionStyles","show","ref","renderWidget","isSticky","Consumer","entryanimation","animation","animationdelay","onLayout","event","handleLayout","scrollable","onScroll","notify","scrollEventThrottle"],"sources":["container.component.tsx"],"sourcesContent":["import React from 'react';\nimport { LayoutChangeEvent, View, ViewStyle, Platform, Animated } from 'react-native';\nimport WmContainerProps from './container.props';\nimport { DEFAULT_CLASS, WmContainerStyles } from './container.styles';\nimport { Tappable } from '@wavemaker/app-rn-runtime/core/tappable.component';\nimport { Animatedview } from '@wavemaker/app-rn-runtime/components/basic/animatedview.component';\nimport { PartialHost, PartialHostState } from './partial-host.component';\nimport { createSkeleton } from '../basic/skeleton/skeleton.component';\nimport { WmSkeletonStyles } from '../basic/skeleton/skeleton.styles';\nimport { ScrollView } from 'react-native-gesture-handler';\nimport { StickyWrapperContextType, StickyWrapperContext } from '@wavemaker/app-rn-runtime/core/sticky-wrapper';\nimport { EdgeInsets, SafeAreaInsetsContext } from 'react-native-safe-area-context';\nimport { StickyContainer } from '@wavemaker/app-rn-runtime/core/components/sticky-container.component';\nimport { getParentStyles } from '@wavemaker/app-rn-runtime/core/components/sticky-container.styles';\nimport injector from '@wavemaker/app-rn-runtime/core/injector';\nimport AppConfig from '@wavemaker/app-rn-runtime/core/AppConfig';\n\nexport class WmContainerState extends PartialHostState<WmContainerProps> {\n isPartialLoaded = false;\n stickyContainerVisibility = false;\n}\n\nexport default class WmContainer extends PartialHost<WmContainerProps, WmContainerState, WmContainerStyles> {\n static contextType = StickyWrapperContext;\n private containerRef: React.RefObject<View | null>;\n private stickyContainerOpacity: Animated.Value;\n private appConfig = injector.get<AppConfig>('APP_CONFIG');\n insets: EdgeInsets | null = {\n top: 0, bottom: 0, left: 0, right: 0\n };\n\n constructor(props: WmContainerProps) {\n super(props, DEFAULT_CLASS, new WmContainerProps(), new WmContainerState());\n this.containerRef = React.createRef();\n this.stickyContainerOpacity = new Animated.Value(1);\n\n this.subscribe('updateStickyHeaders', (_event: any) => {\n if(this.props.sticky){\n setTimeout(()=>{\n this.getStickyHeaderTranslateY();\n }, 500);\n }\n })\n }\n\n getBackground(): React.JSX.Element | null {\n return this._showSkeleton ? null : this._background\n } \n \n public renderSkeleton(props: WmContainerProps): React.ReactNode {\n if(!props.showskeletonchildren) {\n const dimensions = {\n width: this.styles.root.width ? '100%' : undefined,\n height: this.styles.root.height ? '100%' : undefined\n }; \n const skeletonStyles: WmSkeletonStyles = this.props?.styles?.skeleton || { root: {}, text: {} } as WmSkeletonStyles\n return createSkeleton(this.theme, skeletonStyles, {\n ...this.styles.root\n }, (<View style={[this.styles.root, { opacity: 0 }]}>\n <Tappable {...this.getTestPropsForAction()} target={this} styles={dimensions} disableTouchEffect={this.state.props.disabletoucheffect}>\n <View style={[dimensions as ViewStyle, this.styles.content]}>{this.renderContent(props)}</View>\n </Tappable>\n\n </View>))\n }\n return null;\n }\n\n public getStickyHeaderTranslateY(){\n const isEdgeToEdgeApp = !!this.appConfig?.edgeToEdgeConfig?.isEdgeToEdgeApp;\n this.containerRef?.current?.measure((_x = 0, _y = 0, _width = 0, _height = 0, px = 0, py = 0)=>{\n const topInsetsInYposition = (Platform.OS == 'ios' && !isEdgeToEdgeApp) ? (this.insets?.top || 0): 0\n if((this.context) && (this.context as StickyWrapperContextType).stickyContainerTranslateY) {\n (this.context as StickyWrapperContextType).stickyContainerTranslateY.value = py - topInsetsInYposition ;\n this.updateState({ stickyContainerVisibility: true} as WmContainerState); \n }\n })\n }\n\n componentDidUpdate(_prevProps: any, prevState: any) {\n if (prevState.stickyContainerVisibility !== this.state.stickyContainerVisibility) {\n Animated.timing(this.stickyContainerOpacity, {\n toValue: this.state.stickyContainerVisibility ? 0 : 1,\n delay: 500,\n useNativeDriver: true\n }).start();\n }\n }\n\n private renderStickyContent(props: WmContainerProps, dimensions: ViewStyle, styles: ViewStyle) {\n const { stickyContainerVisibility } = this.state;\n const { positioningStyles } = getParentStyles(this);\n\n return (\n <>\n {stickyContainerVisibility ? (\n <StickyContainer\n component={this}\n theme={this.theme}\n style={[\n this.styles.sticky,\n { backgroundColor: styles.backgroundColor }\n ]}\n positionStyles={positioningStyles}\n show={props.show as boolean}\n >\n <View style={[dimensions as ViewStyle, { backgroundColor: styles.backgroundColor }, this.styles.content]}>\n {this.renderContent(props)}\n </View>\n </StickyContainer>\n ) : <></>}\n <Animated.View \n style={[\n dimensions as ViewStyle, \n { opacity: this.stickyContainerOpacity }, \n this.styles.content\n ]} \n ref={this.containerRef}\n >\n {this.renderContent(props)}\n </Animated.View>\n </>\n );\n }\n\n renderWidget(props: WmContainerProps) {\n const dimensions: ViewStyle = {\n width: this.styles.root.width ? '100%' : undefined,\n height: this.styles.root.height ? '100%' : undefined\n };\n\n const styles = this._showSkeleton ? {\n ...this.styles.root,\n ...this.styles.skeleton.root\n } : this.styles.root;\n\n if (props.sticky) {\n this.isSticky = true;\n }\n return (\n <SafeAreaInsetsContext.Consumer>\n {(insets = { top: 0, bottom: 0, left: 0, right: 0 }) => {\n this.insets = insets;\n return (\n <Animatedview \n entryanimation={props.animation} \n delay={props.animationdelay} \n style={styles}\n onLayout={(event: LayoutChangeEvent, ref: React.RefObject<View>) => {\n this.handleLayout(event, ref);\n }}\n >\n {this.getBackground()}\n <Tappable \n {...this.getTestPropsForAction()} \n target={this} \n styles={dimensions} \n disableTouchEffect={this.state.props.disabletoucheffect}\n >\n {props.sticky ? (\n this.renderStickyContent(props, dimensions, styles)\n ) : !props.scrollable ? (\n <View style={[dimensions as ViewStyle, this.styles.content]}>\n {this.renderContent(props)}\n </View>\n ) : (\n <ScrollView \n style={[dimensions as ViewStyle, this.styles.content]}\n onScroll={(event) => this.notify('scroll', [event])}\n scrollEventThrottle={48}\n >\n {this.renderContent(props)}\n </ScrollView>\n )}\n </Tappable>\n </Animatedview>\n );\n }}\n </SafeAreaInsetsContext.Consumer>\n );\n }\n}\n"],"mappings":";;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAA4BC,IAAI,EAAaC,QAAQ,EAAEC,QAAQ,QAAQ,cAAc;AACrF,OAAOC,gBAAgB,MAAM,mBAAmB;AAChD,SAASC,aAAa,QAA2B,oBAAoB;AACrE,SAASC,QAAQ,QAAQ,mDAAmD;AAC5E,SAASC,YAAY,QAAQ,mEAAmE;AAChG,SAASC,WAAW,EAAEC,gBAAgB,QAAQ,0BAA0B;AACxE,SAASC,cAAc,QAAQ,sCAAsC;AAErE,SAASC,UAAU,QAAQ,8BAA8B;AACzD,SAAmCC,oBAAoB,QAAQ,+CAA+C;AAC9G,SAAqBC,qBAAqB,QAAQ,gCAAgC;AAClF,SAASC,eAAe,QAAQ,sEAAsE;AACtG,SAASC,eAAe,QAAQ,mEAAmE;AACnG,OAAOC,QAAQ,MAAM,yCAAyC;AAG9D,OAAO,MAAMC,gBAAgB,SAASR,gBAAgB,CAAmB;EAAAS,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAC,eAAA,0BACrD,KAAK;IAAAA,eAAA,oCACK,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Ae,IAAI,CAACE,MAAM,CAACiB,OAAO;MAAE,GACzD,IAAI,CAACC,aAAa,CAACzC,KAAK,CACrB,CAAC,gBAEPtB,KAAA,CAAAqD,aAAA,CAAC1C,UAAU;QACT2C,KAAK,EAAE,CAACX,UAAU,EAAe,IAAI,CAACE,MAAM,CAACiB,OAAO,CAAE;QACtDkD,QAAQ,EAAGH,KAAK,IAAK,IAAI,CAACI,MAAM,CAAC,QAAQ,EAAE,CAACJ,KAAK,CAAC,CAAE;QACpDK,mBAAmB,EAAE;MAAG,GAEvB,IAAI,CAACnD,aAAa,CAACzC,KAAK,CACf,CAEN,CACE,CAAC;IAEnB,CAC8B,CAAC;EAErC;AACF;AAACF,eAAA,CA/JoBC,WAAW,iBACTT,oBAAoB","ignoreList":[]}
1
+ {"version":3,"names":["React","View","Platform","Animated","WmContainerProps","DEFAULT_CLASS","Tappable","Animatedview","PartialHost","PartialHostState","createSkeleton","ScrollView","StickyWrapperContext","SafeAreaInsetsContext","StickyContainer","getParentStyles","injector","alignmentMatrixFixed","justifyContent","alignItems","alignmentMatrixAuto","start","center","end","WmContainerState","constructor","args","_defineProperty","WmContainer","props","get","top","bottom","left","right","containerRef","createRef","stickyContainerOpacity","Value","subscribe","_event","sticky","setTimeout","getStickyHeaderTranslateY","getBackground","_showSkeleton","_background","isAutoLayout","direction","wrap","gap","alignment","columngap","isAutoLayoutPresent","undefined","getDimensionStyle","isInnerView","baseStyle","styles","root","width","height","dimensionStyle","isRow","_this$props","alignSelf","flexGrow","num","endsWith","parseFloat","isNaN","flexShrink","minWidth","getGapStyle","finalGap","finalDirection","finalAlignment","isAutoGap","layoutStyle","alignConfig","columnGap","Number","rowGap","getContentContainerStyle","finalWrap","isWrap","flexWrap","alignContent","renderSkeleton","showskeletonchildren","_this$props2","dimensions","skeletonStyles","skeleton","text","theme","createElement","style","opacity","_extends","getTestPropsForAction","target","disableTouchEffect","state","disabletoucheffect","content","renderContent","_this$appConfig","_this$containerRef","isEdgeToEdgeApp","appConfig","edgeToEdgeConfig","current","measure","_x","_y","_width","_height","px","py","_this$insets","topInsetsInYposition","OS","insets","context","stickyContainerTranslateY","value","updateState","stickyContainerVisibility","componentDidUpdate","_prevProps","prevState","timing","toValue","delay","useNativeDriver","renderStickyContent","_this$props3","_this$props5","positioningStyles","autoLayoutStyle","directionStyle","_this$props4","flexDirection","autoLayoutDimensionsInner","Fragment","component","backgroundColor","positionStyles","show","ref","renderWidget","_this$props6","_this$props8","_this$props9","_this$props7","autoLayoutDimensions","isSticky","Consumer","_this$props0","entryanimation","animation","animationdelay","onLayout","event","handleLayout","scrollable","onScroll","notify","scrollEventThrottle"],"sources":["container.component.tsx"],"sourcesContent":["import React from 'react';\nimport { DimensionValue, LayoutChangeEvent, StyleProp, View, ViewStyle, Platform, Animated } from 'react-native';\nimport WmContainerProps from './container.props';\nimport { DEFAULT_CLASS, WmContainerStyles } from './container.styles';\nimport { Tappable } from '@wavemaker/app-rn-runtime/core/tappable.component';\nimport { Animatedview } from '@wavemaker/app-rn-runtime/components/basic/animatedview.component';\nimport { PartialHost, PartialHostState } from './partial-host.component';\nimport { createSkeleton } from '../basic/skeleton/skeleton.component';\nimport { WmSkeletonStyles } from '../basic/skeleton/skeleton.styles';\nimport { ScrollView } from 'react-native-gesture-handler';\nimport { StickyWrapperContextType, StickyWrapperContext } from '@wavemaker/app-rn-runtime/core/sticky-wrapper';\nimport { EdgeInsets, SafeAreaInsetsContext } from 'react-native-safe-area-context';\nimport { StickyContainer } from '@wavemaker/app-rn-runtime/core/components/sticky-container.component';\nimport { getParentStyles } from '@wavemaker/app-rn-runtime/core/components/sticky-container.styles';\nimport injector from '@wavemaker/app-rn-runtime/core/injector';\nimport AppConfig from '@wavemaker/app-rn-runtime/core/AppConfig';\n\n// Alignment matrix for flex properties\nconst alignmentMatrixFixed: Record<\n string,\n { justifyContent: string; alignItems: string }\n> = {\n 'top-left': { justifyContent: 'flex-start', alignItems: 'flex-start' },\n 'top-center': { justifyContent: 'center', alignItems: 'flex-start' },\n 'top-right': { justifyContent: 'flex-end', alignItems: 'flex-start' },\n 'middle-left': { justifyContent: 'flex-start', alignItems: 'center' },\n 'middle-center': { justifyContent: 'center', alignItems: 'center' },\n 'middle-right': { justifyContent: 'flex-end', alignItems: 'center' },\n 'bottom-left': { justifyContent: 'flex-start', alignItems: 'flex-end' },\n 'bottom-center': { justifyContent: 'center', alignItems: 'flex-end' },\n 'bottom-right': { justifyContent: 'flex-end', alignItems: 'flex-end' },\n};\n\nconst alignmentMatrixAuto: Record<\n string,\n { justifyContent: string; alignItems: string }\n> = {\n start: { justifyContent: 'space-between', alignItems: 'flex-start' },\n center: { justifyContent: 'space-between', alignItems: 'center' },\n end: { justifyContent: 'space-between', alignItems: 'flex-end' },\n};\n\nexport class WmContainerState extends PartialHostState<WmContainerProps> {\n isPartialLoaded = false;\n stickyContainerVisibility = false;\n}\n\nexport default class WmContainer extends PartialHost<WmContainerProps, WmContainerState, WmContainerStyles> {\n static contextType = StickyWrapperContext;\n private containerRef: React.RefObject<View | null>;\n private stickyContainerOpacity: Animated.Value;\n private appConfig = injector.get<AppConfig>('APP_CONFIG');\n insets: EdgeInsets | null = {\n top: 0, bottom: 0, left: 0, right: 0\n };\n\n constructor(props: WmContainerProps) {\n super(props, DEFAULT_CLASS, new WmContainerProps(), new WmContainerState());\n this.containerRef = React.createRef();\n this.stickyContainerOpacity = new Animated.Value(1);\n\n this.subscribe('updateStickyHeaders', (_event: any) => {\n if(this.props.sticky){\n setTimeout(()=>{\n this.getStickyHeaderTranslateY();\n }, 500);\n }\n })\n }\n\n getBackground(): React.JSX.Element | null {\n return this._showSkeleton ? null : this._background\n }\n\n private isAutoLayout() {\n const { direction, wrap, gap, alignment, columngap } = this.props;\n\n /* Check if any of the new layout props are provided. If not, return an empty\n style object to maintain backward compatibility. */\n const isAutoLayoutPresent = \n direction !== undefined || \n wrap !== undefined || \n gap !== undefined || \n alignment !== undefined ||\n columngap !== undefined;\n\n return isAutoLayoutPresent;\n }\n\n private getDimensionStyle(direction?: string, isInnerView: boolean = false): ViewStyle {\n const baseStyle = this.styles.root || {};\n const { width, height }: any = baseStyle;\n const dimensionStyle: ViewStyle = {};\n const isRow = direction === \"row\";\n\n if (isInnerView) {\n if (width && width !== 'hug') {\n dimensionStyle.width = '100%';\n }\n\n if (height && height !== 'hug') {\n dimensionStyle.height = '100%';\n }\n return dimensionStyle;\n }\n\n if (height === 'fill') {\n if(!this.props?.['parent-direction']) {\n dimensionStyle.height = '100%';\n } else {\n if (isRow) {\n dimensionStyle.alignSelf = 'stretch'; \n } else {\n dimensionStyle.flexGrow = 1; \n }\n dimensionStyle.height = undefined;\n }\n } \n else if (height === 'hug' || height === undefined) {\n if (isRow) {\n dimensionStyle.alignSelf = 'flex-start'; \n } else {\n dimensionStyle.flexGrow = 0; \n }\n dimensionStyle.height = undefined;\n }\n else if (height) {\n const num = (typeof height === 'string' && height.endsWith('%')) ? height : parseFloat(height);\n dimensionStyle.height = (isNaN(num as number) ? height : num) as DimensionValue;\n }\n\n if (width === 'fill') {\n if (isRow) {\n dimensionStyle.flexGrow = 1;\n dimensionStyle.flexShrink = 1;\n dimensionStyle.minWidth = 0;\n } else {\n dimensionStyle.alignSelf = 'stretch'; \n }\n dimensionStyle.width = undefined;\n } \n else if (width === 'hug') {\n if (isRow) {\n dimensionStyle.flexGrow = 0; \n } else {\n dimensionStyle.alignSelf = 'flex-start'; \n }\n dimensionStyle.width = undefined;\n }\n else if (width === undefined) {\n if (isRow) {\n dimensionStyle.flexGrow = 0; \n } else {\n dimensionStyle.alignSelf = 'stretch'; \n }\n dimensionStyle.width = undefined;\n }\n else if (width) {\n const num = (typeof width === 'string' && width.endsWith('%')) ? width : parseFloat(width);\n dimensionStyle.width = (isNaN(num as number) ? width : num) as DimensionValue;\n }\n\n return dimensionStyle;\n }\n\n private getGapStyle(): ViewStyle {\n const { direction, wrap, gap, alignment, columngap } = this.props;\n\n /* Check if any of the new layout props are provided. If not, return an empty\n style object to maintain backward compatibility. */\n const isAutoLayout = this.isAutoLayout();\n\n if (!isAutoLayout) {\n return {};\n }\n const finalGap = gap ?? 4;\n const finalDirection = direction ?? 'row';\n const finalAlignment = alignment ?? 'top-left';\n\n const isAutoGap = finalGap === 'auto';\n const isRow = finalDirection === 'row';\n\n const layoutStyle: ViewStyle = {};\n\n if (isAutoGap) {\n const alignConfig = alignmentMatrixAuto[finalAlignment] || alignmentMatrixAuto['start'];\n layoutStyle.justifyContent = alignConfig.justifyContent as ViewStyle['justifyContent'];\n layoutStyle.alignItems = alignConfig.alignItems as ViewStyle['alignItems'];\n } else {\n if (isRow) {\n // For a row, the main-axis gap (between items) is columnGap.\n layoutStyle.columnGap = Number(finalGap);\n } else {\n // For a column, the main-axis gap (between items) is rowGap.\n layoutStyle.rowGap = Number(finalGap);\n }\n }\n\n return layoutStyle;\n }\n\n // Compute content layout (flexDirection, wrap, gap, justifyContent, alignItems).\n private getContentContainerStyle(): ViewStyle {\n const { direction, wrap, gap, alignment, columngap } = this.props;\n\n /* Check if any of the new layout props are provided. If not, return an empty\n style object to maintain backward compatibility. */\n if (!this.isAutoLayout()) {\n return {};\n }\n\n // Apply defaults only if the new layout system is active\n const finalDirection = direction ?? 'row';\n const finalWrap = wrap ?? false;\n const finalGap = gap ?? 4;\n const finalAlignment = alignment ?? 'top-left';\n\n const isRow = finalDirection === 'row';\n const isAutoGap = finalGap === 'auto';\n const isWrap = finalWrap === 'true' || finalWrap === true;\n\n const layoutStyle: ViewStyle = {\n // flexDirection: finalDirection,\n flexWrap: isWrap && isRow ? 'wrap' : 'nowrap',\n };\n\n if (!isAutoGap) {\n const alignConfig =\n alignmentMatrixFixed[finalAlignment] || alignmentMatrixFixed['top-left'];\n\n layoutStyle.justifyContent = (\n isRow ? alignConfig.justifyContent : alignConfig.alignItems\n ) as ViewStyle['justifyContent'];\n layoutStyle.alignItems = (\n isRow ? alignConfig.alignItems : alignConfig.justifyContent\n ) as ViewStyle['alignItems'];\n }\n\n // Add columnGap logic for wrapped rows\n if (isWrap && isRow) {\n if (columngap === 'auto') {\n layoutStyle.alignContent = 'space-between';\n } else if (columngap !== undefined) {\n layoutStyle.rowGap = Number(columngap);\n }\n }\n\n return {\n ...layoutStyle,\n ...this.getGapStyle()\n };\n }\n \n public renderSkeleton(props: WmContainerProps): React.ReactNode {\n if(!props.showskeletonchildren) {\n const dimensions = {\n width: this.styles.root.width ? '100%' : undefined,\n height: this.styles.root.height ? '100%' : undefined\n }; \n const skeletonStyles: WmSkeletonStyles = this.props?.styles?.skeleton || { root: {}, text: {} } as WmSkeletonStyles\n return createSkeleton(this.theme, skeletonStyles, {\n ...this.styles.root\n }, (<View style={[this.styles.root, { opacity: 0 }]}>\n <Tappable {...this.getTestPropsForAction()} target={this} styles={dimensions} disableTouchEffect={this.state.props.disabletoucheffect}>\n <View style={[dimensions as ViewStyle, this.styles.content]}>{this.renderContent(props)}</View>\n </Tappable>\n\n </View>))\n }\n return null;\n }\n\n public getStickyHeaderTranslateY(){\n const isEdgeToEdgeApp = !!this.appConfig?.edgeToEdgeConfig?.isEdgeToEdgeApp;\n this.containerRef?.current?.measure((_x = 0, _y = 0, _width = 0, _height = 0, px = 0, py = 0)=>{\n const topInsetsInYposition = (Platform.OS == 'ios' && !isEdgeToEdgeApp) ? (this.insets?.top || 0): 0\n if((this.context) && (this.context as StickyWrapperContextType).stickyContainerTranslateY) {\n (this.context as StickyWrapperContextType).stickyContainerTranslateY.value = py - topInsetsInYposition ;\n this.updateState({ stickyContainerVisibility: true} as WmContainerState); \n }\n })\n }\n\n componentDidUpdate(_prevProps: any, prevState: any) {\n if (prevState.stickyContainerVisibility !== this.state.stickyContainerVisibility) {\n Animated.timing(this.stickyContainerOpacity, {\n toValue: this.state.stickyContainerVisibility ? 0 : 1,\n delay: 500,\n useNativeDriver: true\n }).start();\n }\n }\n\n private renderStickyContent(props: WmContainerProps, dimensions: ViewStyle, styles: ViewStyle) {\n const { stickyContainerVisibility } = this.state;\n const { positioningStyles } = getParentStyles(this);\n const autoLayoutStyle = this.getContentContainerStyle();\n const directionStyle: ViewStyle= {};\n if(this.props?.direction) {\n directionStyle.flexDirection = this.props?.direction;\n }\n const autoLayoutDimensionsInner = this.getDimensionStyle(this.props?.direction, true);\n const isAutoLayout = this.isAutoLayout();\n\n return (\n <>\n {stickyContainerVisibility ? (\n <StickyContainer\n component={this}\n theme={this.theme}\n style={[\n this.styles.sticky,\n { backgroundColor: styles.backgroundColor },\n isAutoLayout ? directionStyle : {}\n ]}\n positionStyles={positioningStyles}\n show={props.show as boolean}\n >\n <View style={[isAutoLayout ? autoLayoutDimensionsInner : dimensions as ViewStyle, { backgroundColor: styles.backgroundColor }, this.styles.content, isAutoLayout ? autoLayoutStyle : {}]}>\n {this.renderContent(props)}\n </View>\n </StickyContainer>\n ) : <></>}\n <Animated.View \n style={[\n isAutoLayout ? autoLayoutDimensionsInner : dimensions as ViewStyle, \n { opacity: this.stickyContainerOpacity }, \n this.styles.content,\n isAutoLayout ? autoLayoutStyle : {}\n ]} \n ref={this.containerRef}\n >\n {this.renderContent(props)}\n </Animated.View>\n </>\n );\n }\n\n renderWidget(props: WmContainerProps) {\n const autoLayoutStyle = this.getContentContainerStyle();\n const directionStyle: ViewStyle= {};\n if(this.props?.direction) {\n directionStyle.flexDirection = this.props?.direction;\n }\n\n const dimensions: ViewStyle = {\n width: this.styles.root.width ? '100%' : undefined,\n height: this.styles.root.height ? '100%' : undefined\n };\n\n const autoLayoutDimensions = this.getDimensionStyle(this.props?.direction);\n const autoLayoutDimensionsInner = this.getDimensionStyle(this.props?.direction, true);\n\n const styles = this._showSkeleton ? {\n ...this.styles.root,\n ...this.styles.skeleton.root\n } : this.styles.root;\n\n if (props.sticky) {\n this.isSticky = true;\n }\n\n const isAutoLayout = this.isAutoLayout();\n return (\n <SafeAreaInsetsContext.Consumer>\n {(insets = { top: 0, bottom: 0, left: 0, right: 0 }) => {\n this.insets = insets;\n return (\n <Animatedview \n entryanimation={props.animation} \n delay={props.animationdelay} \n style={[styles, isAutoLayout ? {...this.getDimensionStyle(this.props?.['parent-direction']), ...directionStyle} : {}]}\n onLayout={(event: LayoutChangeEvent, ref: React.RefObject<View>) => {\n this.handleLayout(event, ref);\n }}\n >\n {this.getBackground()}\n <Tappable \n {...this.getTestPropsForAction()} \n target={this} \n styles={[isAutoLayout ? { ...autoLayoutDimensionsInner, ...directionStyle } : dimensions]} \n disableTouchEffect={this.state.props.disabletoucheffect}\n >\n {props.sticky ? (\n this.renderStickyContent(props, dimensions, styles)\n ) : !props.scrollable ? (\n <View style={[\n isAutoLayout ? autoLayoutDimensionsInner : dimensions, \n this.styles.content,\n isAutoLayout ? { ...directionStyle, ...autoLayoutStyle, minWidth: 0 } : {},\n ]}>\n {this.renderContent(props)}\n </View>\n ) : (\n <ScrollView \n style={[isAutoLayout ? autoLayoutDimensionsInner : dimensions as ViewStyle,\n this.styles.content,\n isAutoLayout ? {...directionStyle, ...autoLayoutStyle } : {} ]}\n onScroll={(event) => this.notify('scroll', [event])}\n scrollEventThrottle={48}\n >\n {this.renderContent(props)}\n </ScrollView>\n )}\n </Tappable>\n </Animatedview>\n );\n }}\n </SafeAreaInsetsContext.Consumer>\n );\n }\n}\n"],"mappings":";;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAAuDC,IAAI,EAAaC,QAAQ,EAAEC,QAAQ,QAAQ,cAAc;AAChH,OAAOC,gBAAgB,MAAM,mBAAmB;AAChD,SAASC,aAAa,QAA2B,oBAAoB;AACrE,SAASC,QAAQ,QAAQ,mDAAmD;AAC5E,SAASC,YAAY,QAAQ,mEAAmE;AAChG,SAASC,WAAW,EAAEC,gBAAgB,QAAQ,0BAA0B;AACxE,SAASC,cAAc,QAAQ,sCAAsC;AAErE,SAASC,UAAU,QAAQ,8BAA8B;AACzD,SAAmCC,oBAAoB,QAAQ,+CAA+C;AAC9G,SAAqBC,qBAAqB,QAAQ,gCAAgC;AAClF,SAASC,eAAe,QAAQ,sEAAsE;AACtG,SAASC,eAAe,QAAQ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UAAuB,EACxE,IAAI,CAACjC,MAAM,CAAC+C,OAAO,EACnB1D,YAAY,GAAG;UAAC,GAAG8F,cAAc;UAAE,GAAGD;QAAgB,CAAC,GAAG,CAAC,CAAC,CAAG;QACjE2B,QAAQ,EAAGH,KAAK,IAAK,IAAI,CAACI,MAAM,CAAC,QAAQ,EAAE,CAACJ,KAAK,CAAC,CAAE;QACpDK,mBAAmB,EAAE;MAAG,GAEvB,IAAI,CAAC/D,aAAa,CAAC7E,KAAK,CACf,CAER,CACE,CAAC;IAEnB,CAC8B,CAAC;EAErC;AACF;AAACF,eAAA,CA5WoBC,WAAW,iBACThB,oBAAoB","ignoreList":[]}
@@ -88,7 +88,7 @@ export default class WmCurrency extends BaseNumberComponent {
88
88
  }, opts, {
89
89
  floatingLabel: props.floatinglabel,
90
90
  floatingLabelStyle: this.styles.floatingLabel,
91
- activeFloatingLabelStyle: this.theme.mergeStyle(this.styles.activeFloatingLabel, (_this$theme$getStyle = this.theme.getStyle('app-currency-with-label')) === null || _this$theme$getStyle === void 0 ? void 0 : _this$theme$getStyle.activeFloatingLabel, (_this$theme$getStyle2 = this.theme.getStyle(`${classname}`)) === null || _this$theme$getStyle2 === void 0 ? void 0 : _this$theme$getStyle2.focused),
91
+ activeFloatingLabelStyle: this.theme.mergeStyle((_this$theme$getStyle = this.theme.getStyle('app-currency-with-label')) === null || _this$theme$getStyle === void 0 ? void 0 : _this$theme$getStyle.activeFloatingLabel, (_this$theme$getStyle2 = this.theme.getStyle(`${classname}`)) === null || _this$theme$getStyle2 === void 0 ? void 0 : _this$theme$getStyle2.focused, this.styles.activeFloatingLabel ? this.styles.activeFloatingLabel : {}),
92
92
  inactiveFloatingLabelStyle: this.styles.inactiveFloatingLabel,
93
93
  editable: props.disabled || props.readonly ? false : true,
94
94
  placeholder: props.placeholder,
@@ -1 +1 @@
1
- {"version":3,"names":["React","View","Text","Platform","WmCurrencyProps","CURRENCY_INFO","WMTextInput","DEFAULT_CLASS","BaseNumberComponent","BaseNumberState","isNull","AccessibilityWidgetType","getAccessibilityProps","countDecimalDigits","validateInputOnDevice","createSkeleton","WmCurrencyState","constructor","args","_defineProperty","WmCurrency","props","onPropertyChange","name","$new","$old","updateState","currencySymbol","symbol","getStyleClassName","classes","state","floatinglabel","push","join","renderTextSkeleton","createElement","Fragment","theme","styles","skeleton","root","renderWidget","_this$state$textValue","_this$theme$getStyle","_this$theme$getStyle2","opts","valueExpr","OS","foundationStyle","getStyle","classname","split","pop","textValue","toString","style","onLayout","event","handleLayout","_showSkeleton","skeletonLabelWrapper","labelWrapper","accessible","accessibilityLabel","skeletonLabel","label","importantForAccessibility","skeletonTextInputWrapper","flex","_extends","getTestPropsForInput","CURRENCY","ref","widgetRef","selectionStart","selectionEnd","cursor","keyboardType","placeholderTextColor","placeholderText","color","isInputFocused","mergeStyle","input","inputNoLeftRadius","text","isValid","invalid","focused","disabled","floatingLabel","floatingLabelStyle","activeFloatingLabelStyle","activeFloatingLabel","inactiveFloatingLabelStyle","inactiveFloatingLabel","editable","readonly","placeholder","background","_background","onBlur","bind","onFocus","onKeyPress","validateInputEntry","onSubmitEditing","onChangeText","isValidText","validText","decimalPlaces","decimalPlacesInNumber","restrictDecimalRegex","RegExp","updatedCurrencyText","replace","_this$widgetRef","setNativeProps","onChange","invokeChange","allowContentSelection","userSelect"],"sources":["currency.component.tsx"],"sourcesContent":["import React from 'react';\nimport { View, Text, Platform, DimensionValue } from 'react-native';\n\nimport WmCurrencyProps from './currency.props';\nimport { CURRENCY_INFO } from '@wavemaker/app-rn-runtime/core/currency-constants';\nimport { WMTextInput } from '@wavemaker/app-rn-runtime/core/components/textinput.component';\nimport { DEFAULT_CLASS, WmCurrencyStyles } from './currency.styles';\nimport {\n BaseNumberComponent,\n BaseNumberState\n} from '@wavemaker/app-rn-runtime/components/input/basenumber/basenumber.component';\nimport { isNull } from \"lodash\";\nimport { AccessibilityWidgetType, getAccessibilityProps } from '@wavemaker/app-rn-runtime/core/accessibility';\nimport { countDecimalDigits, validateInputOnDevice } from '@wavemaker/app-rn-runtime/core/utils';\nimport { createSkeleton } from '@wavemaker/app-rn-runtime/components/basic/skeleton/skeleton.component';\nimport { WmSkeletonStyles } from '../../basic/skeleton/skeleton.styles';\n\nexport class WmCurrencyState extends BaseNumberState<WmCurrencyProps> {\n currencySymbol: any;\n}\n\nexport default class WmCurrency extends BaseNumberComponent<WmCurrencyProps, WmCurrencyState, WmCurrencyStyles> {\n\n constructor(props: WmCurrencyProps) {\n super(props, DEFAULT_CLASS, new WmCurrencyProps(), new WmCurrencyState());\n }\n\n onPropertyChange(name: string, $new: any, $old: any) {\n super.onPropertyChange(name, $new, $old);\n switch (name) {\n case 'currency':\n if ($new) {\n this.updateState({\n currencySymbol: CURRENCY_INFO[$new].symbol,\n } as WmCurrencyState);\n }\n break;\n\n }\n }\n\n public getStyleClassName(): string | undefined {\n const classes = [];\n if (this.state.props.floatinglabel) {\n classes.push('app-currency-with-label');\n }\n classes.push(super.getStyleClassName());\n return classes.join(' ');\n }\n\n public renderTextSkeleton(props:any): React.ReactNode {\n return this.props.floatinglabel ? <>{createSkeleton(this.theme, {} as WmSkeletonStyles, {...props})}</>\n : <>{createSkeleton(this.theme, {} as WmSkeletonStyles, {\n ...this.styles.skeleton.root,\n })}</>\n }\n\n renderWidget(props: WmCurrencyProps) {\n let opts: any = {};\n const valueExpr = Platform.OS === 'web' ? 'value' : 'defaultValue';\n const foundationStyle = this.theme.getStyle('app-input');\n const classname = this.state.props.classname ? this.state.props.classname.split(\" \").pop() : '';\n opts[valueExpr] = this.state.textValue?.toString() || '';\n return (<View style={this.styles.root} onLayout={(event) => this.handleLayout(event)}>\n <View style={ (this._showSkeleton && !this.props.floatinglabel) ? this.styles.skeletonLabelWrapper.root : this.styles.labelWrapper } accessible accessibilityLabel={this.state.currencySymbol}>\n {this._showSkeleton ? <>{this.renderTextSkeleton(this.styles.skeletonLabel.root)}</> :\n <Text style={this.styles.label} importantForAccessibility='no'>{this.state.currencySymbol}</Text>}\n </View>\n {this._showSkeleton ? <>{this.renderTextSkeleton(this.styles.skeletonTextInputWrapper.root)}</> :<View style={{flex: 1}}>\n <WMTextInput\n {...this.getTestPropsForInput()}\n {...getAccessibilityProps(AccessibilityWidgetType.CURRENCY, props)}\n ref={(ref: any) => {\n this.widgetRef = ref;\n // @ts-ignore\n if (ref && !isNull(ref.selectionStart) && !isNull(ref.selectionEnd)) {\n // @ts-ignore\n ref.selectionStart = ref.selectionEnd = this.cursor;\n }\n }}\n keyboardType=\"numeric\"\n placeholderTextColor={this.styles.placeholderText.color as any}\n isInputFocused={ this.state.isInputFocused }\n style={[\n this.theme.mergeStyle(\n this.styles.input,\n // foundationStyle ? this.styles.root : null,\n foundationStyle?.root,\n this.styles.inputNoLeftRadius\n ),\n this.theme.mergeStyle(this.styles.text, foundationStyle?.text, this.theme.getStyle(`${classname}`)),\n this.state.isValid ? {} : this.theme.mergeStyle(this.styles.invalid, foundationStyle?.invalid),\n this.state.isInputFocused ? this.theme.mergeStyle(this.styles.focused, foundationStyle?.focused, this.theme.getStyle(`${classname}`).focused) : {},\n this.state.props.disabled ? this.theme.mergeStyle(this.styles.inputNoLeftRadius,foundationStyle?.disabled, this.theme.getStyle(`${classname}`).disabled) : {}\n ]}\n {...opts}\n floatingLabel={props.floatinglabel}\n floatingLabelStyle={this.styles.floatingLabel}\n activeFloatingLabelStyle={this.theme.mergeStyle(this.styles.activeFloatingLabel,\n this.theme.getStyle('app-currency-with-label')?.activeFloatingLabel,\n this.theme.getStyle(`${classname}`)?.focused)}\n inactiveFloatingLabelStyle={this.styles.inactiveFloatingLabel}\n editable={props.disabled || props.readonly ? false : true}\n placeholder={props.placeholder}\n background={this._background}\n onBlur={this.onBlur.bind(this)}\n onFocus={this.onFocus.bind(this)}\n onKeyPress={this.validateInputEntry.bind(this)}\n onSubmitEditing={this.onSubmitEditing.bind(this)}\n onChangeText={(text) => {\n const {isValidText, validText} = validateInputOnDevice(text, \"currency\");\n const decimalPlaces = props.decimalPlaces;\n const decimalPlacesInNumber = countDecimalDigits(validText);\n const restrictDecimalRegex = new RegExp(`(\\\\.\\\\d{${decimalPlaces}})\\\\d*`);\n const updatedCurrencyText = validText.replace(restrictDecimalRegex, '$1');\n\n if (!isValidText || decimalPlaces < decimalPlacesInNumber) {\n (this.widgetRef as any)?.setNativeProps({ text: updatedCurrencyText });\n }\n\n this.onChangeText.bind(this)(updatedCurrencyText, 'currency');\n }}\n onChange={this.invokeChange.bind(this)}\n allowContentSelection={this.styles.text.userSelect === 'text'}\n />\n </View> }\n </View>);\n }\n}\n"],"mappings":";;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,EAAEC,IAAI,EAAEC,QAAQ,QAAwB,cAAc;AAEnE,OAAOC,eAAe,MAAM,kBAAkB;AAC9C,SAASC,aAAa,QAAQ,mDAAmD;AACjF,SAASC,WAAW,QAAQ,+DAA+D;AAC3F,SAASC,aAAa,QAA0B,mBAAmB;AACnE,SACEC,mBAAmB,EACnBC,eAAe,QACV,4EAA4E;AACnF,SAASC,MAAM,QAAQ,QAAQ;AAC/B,SAASC,uBAAuB,EAAEC,qBAAqB,QAAQ,8CAA8C;AAC7G,SAASC,kBAAkB,EAAEC,qBAAqB,QAAQ,sCAAsC;AAChG,SAASC,cAAc,QAAQ,wEAAwE;AAGvG,OAAO,MAAMC,eAAe,SAASP,eAAe,CAAkB;EAAAQ,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAC,eAAA;EAAA;AAEtE;AAEA,eAAe,MAAMC,UAAU,SAASZ,mBAAmB,CAAqD;EAE9GS,WAAWA,CAACI,KAAsB,EAAE;IAClC,KAAK,CAACA,KAAK,EAAEd,aAAa,EAAE,IAAIH,eAAe,CAAC,CAAC,EAAE,IAAIY,eAAe,CAAC,CAAC,CAAC;EAC3E;EAEAM,gBAAgBA,CAACC,IAAY,EAAEC,IAAS,EAAEC,IAAS,EAAE;IACnD,KAAK,CAACH,gBAAgB,CAACC,IAAI,EAAEC,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I,QAAQ,EAAE,IAAI,CAACC,YAAY,CAACjB,IAAI,CAAC,IAAI,CAAE;MACvCkB,qBAAqB,EAAE,IAAI,CAAClF,MAAM,CAAC+C,IAAI,CAACoC,UAAU,KAAK;IAAO,EAC/D,CACK,CACF,CAAC;EACT;AACF","ignoreList":[]}
1
+ {"version":3,"names":["React","View","Text","Platform","WmCurrencyProps","CURRENCY_INFO","WMTextInput","DEFAULT_CLASS","BaseNumberComponent","BaseNumberState","isNull","AccessibilityWidgetType","getAccessibilityProps","countDecimalDigits","validateInputOnDevice","createSkeleton","WmCurrencyState","constructor","args","_defineProperty","WmCurrency","props","onPropertyChange","name","$new","$old","updateState","currencySymbol","symbol","getStyleClassName","classes","state","floatinglabel","push","join","renderTextSkeleton","createElement","Fragment","theme","styles","skeleton","root","renderWidget","_this$state$textValue","_this$theme$getStyle","_this$theme$getStyle2","opts","valueExpr","OS","foundationStyle","getStyle","classname","split","pop","textValue","toString","style","onLayout","event","handleLayout","_showSkeleton","skeletonLabelWrapper","labelWrapper","accessible","accessibilityLabel","skeletonLabel","label","importantForAccessibility","skeletonTextInputWrapper","flex","_extends","getTestPropsForInput","CURRENCY","ref","widgetRef","selectionStart","selectionEnd","cursor","keyboardType","placeholderTextColor","placeholderText","color","isInputFocused","mergeStyle","input","inputNoLeftRadius","text","isValid","invalid","focused","disabled","floatingLabel","floatingLabelStyle","activeFloatingLabelStyle","activeFloatingLabel","inactiveFloatingLabelStyle","inactiveFloatingLabel","editable","readonly","placeholder","background","_background","onBlur","bind","onFocus","onKeyPress","validateInputEntry","onSubmitEditing","onChangeText","isValidText","validText","decimalPlaces","decimalPlacesInNumber","restrictDecimalRegex","RegExp","updatedCurrencyText","replace","_this$widgetRef","setNativeProps","onChange","invokeChange","allowContentSelection","userSelect"],"sources":["currency.component.tsx"],"sourcesContent":["import React from 'react';\nimport { View, Text, Platform, DimensionValue } from 'react-native';\n\nimport WmCurrencyProps from './currency.props';\nimport { CURRENCY_INFO } from '@wavemaker/app-rn-runtime/core/currency-constants';\nimport { WMTextInput } from '@wavemaker/app-rn-runtime/core/components/textinput.component';\nimport { DEFAULT_CLASS, WmCurrencyStyles } from './currency.styles';\nimport {\n BaseNumberComponent,\n BaseNumberState\n} from '@wavemaker/app-rn-runtime/components/input/basenumber/basenumber.component';\nimport { isNull } from \"lodash\";\nimport { AccessibilityWidgetType, getAccessibilityProps } from '@wavemaker/app-rn-runtime/core/accessibility';\nimport { countDecimalDigits, validateInputOnDevice } from '@wavemaker/app-rn-runtime/core/utils';\nimport { createSkeleton } from '@wavemaker/app-rn-runtime/components/basic/skeleton/skeleton.component';\nimport { WmSkeletonStyles } from '../../basic/skeleton/skeleton.styles';\n\nexport class WmCurrencyState extends BaseNumberState<WmCurrencyProps> {\n currencySymbol: any;\n}\n\nexport default class WmCurrency extends BaseNumberComponent<WmCurrencyProps, WmCurrencyState, WmCurrencyStyles> {\n\n constructor(props: WmCurrencyProps) {\n super(props, DEFAULT_CLASS, new WmCurrencyProps(), new WmCurrencyState());\n }\n\n onPropertyChange(name: string, $new: any, $old: any) {\n super.onPropertyChange(name, $new, $old);\n switch (name) {\n case 'currency':\n if ($new) {\n this.updateState({\n currencySymbol: CURRENCY_INFO[$new].symbol,\n } as WmCurrencyState);\n }\n break;\n\n }\n }\n\n public getStyleClassName(): string | undefined {\n const classes = [];\n if (this.state.props.floatinglabel) {\n classes.push('app-currency-with-label');\n }\n classes.push(super.getStyleClassName());\n return classes.join(' ');\n }\n\n public renderTextSkeleton(props:any): React.ReactNode {\n return this.props.floatinglabel ? <>{createSkeleton(this.theme, {} as WmSkeletonStyles, {...props})}</>\n : <>{createSkeleton(this.theme, {} as WmSkeletonStyles, {\n ...this.styles.skeleton.root,\n })}</>\n }\n\n renderWidget(props: WmCurrencyProps) {\n let opts: any = {};\n const valueExpr = Platform.OS === 'web' ? 'value' : 'defaultValue';\n const foundationStyle = this.theme.getStyle('app-input');\n const classname = this.state.props.classname ? this.state.props.classname.split(\" \").pop() : '';\n opts[valueExpr] = this.state.textValue?.toString() || '';\n return (<View style={this.styles.root} onLayout={(event) => this.handleLayout(event)}>\n <View style={ (this._showSkeleton && !this.props.floatinglabel) ? this.styles.skeletonLabelWrapper.root : this.styles.labelWrapper } accessible accessibilityLabel={this.state.currencySymbol}>\n {this._showSkeleton ? <>{this.renderTextSkeleton(this.styles.skeletonLabel.root)}</> :\n <Text style={this.styles.label} importantForAccessibility='no'>{this.state.currencySymbol}</Text>}\n </View>\n {this._showSkeleton ? <>{this.renderTextSkeleton(this.styles.skeletonTextInputWrapper.root)}</> :<View style={{flex: 1}}>\n <WMTextInput\n {...this.getTestPropsForInput()}\n {...getAccessibilityProps(AccessibilityWidgetType.CURRENCY, props)}\n ref={(ref: any) => {\n this.widgetRef = ref;\n // @ts-ignore\n if (ref && !isNull(ref.selectionStart) && !isNull(ref.selectionEnd)) {\n // @ts-ignore\n ref.selectionStart = ref.selectionEnd = this.cursor;\n }\n }}\n keyboardType=\"numeric\"\n placeholderTextColor={this.styles.placeholderText.color as any}\n isInputFocused={ this.state.isInputFocused }\n style={[\n this.theme.mergeStyle(\n this.styles.input,\n // foundationStyle ? this.styles.root : null,\n foundationStyle?.root,\n this.styles.inputNoLeftRadius\n ),\n this.theme.mergeStyle(this.styles.text, foundationStyle?.text, this.theme.getStyle(`${classname}`)),\n this.state.isValid ? {} : this.theme.mergeStyle(this.styles.invalid, foundationStyle?.invalid),\n this.state.isInputFocused ? this.theme.mergeStyle(this.styles.focused, foundationStyle?.focused, this.theme.getStyle(`${classname}`).focused) : {},\n this.state.props.disabled ? this.theme.mergeStyle(this.styles.inputNoLeftRadius,foundationStyle?.disabled, this.theme.getStyle(`${classname}`).disabled) : {}\n ]}\n {...opts}\n floatingLabel={props.floatinglabel}\n floatingLabelStyle={this.styles.floatingLabel}\n activeFloatingLabelStyle={this.theme.mergeStyle(\n this.theme.getStyle('app-currency-with-label')?.activeFloatingLabel,\n this.theme.getStyle(`${classname}`)?.focused,\n this.styles.activeFloatingLabel ? this.styles.activeFloatingLabel : {}\n )}\n inactiveFloatingLabelStyle={this.styles.inactiveFloatingLabel}\n editable={props.disabled || props.readonly ? false : true}\n placeholder={props.placeholder}\n background={this._background}\n onBlur={this.onBlur.bind(this)}\n onFocus={this.onFocus.bind(this)}\n onKeyPress={this.validateInputEntry.bind(this)}\n onSubmitEditing={this.onSubmitEditing.bind(this)}\n onChangeText={(text) => {\n const {isValidText, validText} = validateInputOnDevice(text, \"currency\");\n const decimalPlaces = props.decimalPlaces;\n const decimalPlacesInNumber = countDecimalDigits(validText);\n const restrictDecimalRegex = new RegExp(`(\\\\.\\\\d{${decimalPlaces}})\\\\d*`);\n const updatedCurrencyText = validText.replace(restrictDecimalRegex, '$1');\n\n if (!isValidText || decimalPlaces < decimalPlacesInNumber) {\n (this.widgetRef as any)?.setNativeProps({ text: updatedCurrencyText });\n }\n\n this.onChangeText.bind(this)(updatedCurrencyText, 'currency');\n }}\n onChange={this.invokeChange.bind(this)}\n allowContentSelection={this.styles.text.userSelect === 'text'}\n />\n </View> }\n </View>);\n }\n}\n"],"mappings":";;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,EAAEC,IAAI,EAAEC,QAAQ,QAAwB,cAAc;AAEnE,OAAOC,eAAe,MAAM,kBAAkB;AAC9C,SAASC,aAAa,QAAQ,mDAAmD;AACjF,SAASC,WAAW,QAAQ,+DAA+D;AAC3F,SAASC,aAAa,QAA0B,mBAAmB;AACnE,SACEC,mBAAmB,EACnBC,eAAe,QACV,4EAA4E;AACnF,SAASC,MAAM,QAAQ,QAAQ;AAC/B,SAASC,uBAAuB,EAAEC,qBAAqB,QAAQ,8CAA8C;AAC7G,SAASC,kBAAkB,EAAEC,qBAAqB,QAAQ,sCAAsC;AAChG,SAASC,cAAc,QAAQ,wEAAwE;AAGvG,OAAO,MAAMC,eAAe,SAASP,eAAe,CAAkB;EAAAQ,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAC,eAAA;EAAA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