@wavemaker/app-rn-runtime 11.15.4-rc.250 → 11.15.5-1.256
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.
- package/components/basic/bottomsheet/bottomsheet.component.js +25 -4
- package/components/basic/bottomsheet/bottomsheet.component.js.map +1 -1
- package/components/input/currency/currency.component.js +4 -3
- package/components/input/currency/currency.component.js.map +1 -1
- package/components/input/currency/currency.props.js +1 -0
- package/components/input/currency/currency.props.js.map +1 -1
- package/components/input/epoch/base-datetime.component.js +3 -1
- package/components/input/epoch/base-datetime.component.js.map +1 -1
- package/components/input/epoch/datetime/datetime.props.js +1 -0
- package/components/input/epoch/datetime/datetime.props.js.map +1 -1
- package/components/input/number/number.component.js +4 -3
- package/components/input/number/number.component.js.map +1 -1
- package/components/input/number/number.props.js +1 -0
- package/components/input/number/number.props.js.map +1 -1
- package/components/input/select/select.component.js +1 -1
- package/components/input/select/select.component.js.map +1 -1
- package/components/input/text/text.component.js +54 -10
- package/components/input/text/text.component.js.map +1 -1
- package/components/input/text/text.props.js +5 -0
- package/components/input/text/text.props.js.map +1 -1
- package/components/input/text/text.styles.js +31 -6
- package/components/input/text/text.styles.js.map +1 -1
- package/components/input/textarea/textarea.component.js +4 -3
- package/components/input/textarea/textarea.component.js.map +1 -1
- package/components/input/textarea/textarea.props.js +1 -0
- package/components/input/textarea/textarea.props.js.map +1 -1
- package/core/components/floatinglabel.component.js +59 -12
- package/core/components/floatinglabel.component.js.map +1 -1
- package/core/components/textinput.component.js +6 -20
- package/core/components/textinput.component.js.map +1 -1
- package/npm-shrinkwrap.json +4986 -4930
- package/package-lock.json +4986 -4930
- package/package.json +5 -2
- package/styles/theme.js +7 -0
- package/styles/theme.js.map +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import { Platform } from 'react-native';
|
|
3
|
+
import { Platform, View, Text } from 'react-native';
|
|
4
4
|
import WmTextProps from './text.props';
|
|
5
5
|
import { DEFAULT_CLASS } from './text.styles';
|
|
6
6
|
import { WMTextInput } from '@wavemaker/app-rn-runtime/core/components/textinput.component';
|
|
@@ -8,6 +8,7 @@ import { BaseInputComponent, BaseInputState } from "@wavemaker/app-rn-runtime/co
|
|
|
8
8
|
import { isNull } from 'lodash';
|
|
9
9
|
import { AccessibilityWidgetType, getAccessibilityProps } from '@wavemaker/app-rn-runtime/core/accessibility';
|
|
10
10
|
import { createSkeleton } from '@wavemaker/app-rn-runtime/components/basic/skeleton/skeleton.component';
|
|
11
|
+
import WmIcon from '@wavemaker/app-rn-runtime/components/basic/icon/icon.component';
|
|
11
12
|
export class WmTextState extends BaseInputState {}
|
|
12
13
|
export default class WmText extends BaseInputComponent {
|
|
13
14
|
constructor(props) {
|
|
@@ -41,14 +42,28 @@ export default class WmText extends BaseInputComponent {
|
|
|
41
42
|
height: skeletonHeight
|
|
42
43
|
});
|
|
43
44
|
}
|
|
45
|
+
leadingIconClick() {
|
|
46
|
+
this.invokeEventCallback('onLeadingiconclick', [this.proxy]);
|
|
47
|
+
}
|
|
48
|
+
trailingIconClick() {
|
|
49
|
+
this.invokeEventCallback('onTrailingiconclick', [this.proxy]);
|
|
50
|
+
}
|
|
44
51
|
renderWidget(props) {
|
|
45
|
-
var _this$state$textValue, _this$theme$getStyle, _this$theme$getStyle2;
|
|
52
|
+
var _this$state$textValue, _ref, _mergedRoot$padding, _mergedRoot$height, _this$theme$getStyle, _this$theme$getStyle2;
|
|
46
53
|
let opts = {};
|
|
47
54
|
const valueExpr = Platform.OS === 'web' ? 'value' : 'defaultValue';
|
|
48
55
|
const foundationStyle = this.theme.getStyle('app-input');
|
|
49
56
|
const classname = this.state.props.classname ? this.state.props.classname.split(" ").pop() : '';
|
|
50
57
|
opts[valueExpr] = ((_this$state$textValue = this.state.textValue) === null || _this$state$textValue === void 0 ? void 0 : _this$state$textValue.toString()) || '';
|
|
51
|
-
|
|
58
|
+
const hasLeading = !!props.leadingiconclass;
|
|
59
|
+
const hasTrailing = !!props.trailingiconclass;
|
|
60
|
+
const mergedRoot = this.theme.mergeStyle(this.styles.root, foundationStyle === null || foundationStyle === void 0 ? void 0 : foundationStyle.root, Platform.OS === 'web' ? this.styles.inputWeb : null);
|
|
61
|
+
const basePadding = (_ref = (_mergedRoot$padding = mergedRoot === null || mergedRoot === void 0 ? void 0 : mergedRoot.padding) !== null && _mergedRoot$padding !== void 0 ? _mergedRoot$padding : mergedRoot === null || mergedRoot === void 0 ? void 0 : mergedRoot.paddingLeft) !== null && _ref !== void 0 ? _ref : 16;
|
|
62
|
+
const hassupportingtext = !!props.hint;
|
|
63
|
+
const inputHeight = (_mergedRoot$height = mergedRoot.height) !== null && _mergedRoot$height !== void 0 ? _mergedRoot$height : mergedRoot.minHeight;
|
|
64
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(View, {
|
|
65
|
+
style: this.styles.inputContainer
|
|
66
|
+
}, /*#__PURE__*/React.createElement(WMTextInput, _extends({}, this.getTestPropsForInput(), getAccessibilityProps(AccessibilityWidgetType.TEXT, props), {
|
|
52
67
|
ref: ref => {
|
|
53
68
|
this.widgetRef = ref;
|
|
54
69
|
// @ts-ignore
|
|
@@ -59,12 +74,17 @@ export default class WmText extends BaseInputComponent {
|
|
|
59
74
|
}
|
|
60
75
|
}, opts, {
|
|
61
76
|
floatingLabel: props.floatinglabel,
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
77
|
+
inputheight: typeof inputHeight === 'number' ? inputHeight : undefined,
|
|
78
|
+
floatingLabelStyle: {
|
|
79
|
+
...this.styles.floatingLabel
|
|
80
|
+
},
|
|
81
|
+
activeFloatingLabelStyle: this.theme.mergeStyle(this.styles.activeFloatingLabel, (_this$theme$getStyle = this.theme.getStyle('app-text-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),
|
|
82
|
+
variant: props.variant,
|
|
83
|
+
labelBackground: props.variant != 'filled' ? mergedRoot === null || mergedRoot === void 0 ? void 0 : mergedRoot.backgroundColor : undefined,
|
|
65
84
|
placeholderTextColor: this.styles.placeholderText.color,
|
|
66
85
|
isInputFocused: this.state.isInputFocused,
|
|
67
|
-
style: [this.theme.mergeStyle(this.styles.root, foundationStyle === null || foundationStyle === void 0 ? void 0 : foundationStyle.root), this.theme.mergeStyle(this.styles.text, foundationStyle === null || foundationStyle === void 0 ? void 0 : foundationStyle.text, this.theme.getStyle(`${classname}`)), this.state.isValid ? {} : this.theme.mergeStyle(this.styles.invalid, foundationStyle === null || foundationStyle === void 0 ? void 0 : foundationStyle.invalid), this.state.isInputFocused ? this.theme.mergeStyle(this.styles.focused, foundationStyle === null || foundationStyle === void 0 ? void 0 : foundationStyle.focused, this.theme.getStyle(`${classname}`).focused) : {}, this.state.props.disabled ? this.theme.mergeStyle(foundationStyle === null || foundationStyle === void 0 ? void 0 : foundationStyle.disabled, this.theme.getStyle(`${classname}`).disabled) : {}
|
|
86
|
+
style: [this.theme.mergeStyle(this.styles.root, foundationStyle === null || foundationStyle === void 0 ? void 0 : foundationStyle.root), this.theme.mergeStyle(this.styles.text, foundationStyle === null || foundationStyle === void 0 ? void 0 : foundationStyle.text, this.theme.getStyle(`${classname}`)), this.state.isValid ? {} : this.theme.mergeStyle(this.styles.invalid, foundationStyle === null || foundationStyle === void 0 ? void 0 : foundationStyle.invalid), this.state.isInputFocused ? this.theme.mergeStyle(this.styles.root, this.styles.focused, foundationStyle === null || foundationStyle === void 0 ? void 0 : foundationStyle.focused, this.theme.getStyle(`${classname}`).focused) : {}, this.state.props.disabled ? this.theme.mergeStyle(this.styles.root, foundationStyle === null || foundationStyle === void 0 ? void 0 : foundationStyle.disabled, this.theme.getStyle(`${classname}`).disabled) : {}, hasLeading ? this.styles.inputWithLeadingIcon : {}, hasTrailing ? this.styles.inputWithTrailingIcon : {}, Platform.OS === 'web' ? this.styles.inputWeb : null //added to override the bordercolor getting applied only in web.
|
|
87
|
+
],
|
|
68
88
|
keyboardType: this.state.keyboardType,
|
|
69
89
|
autoComplete: props.autocomplete === "true" ? "username" : props.autocomplete === "false" ? "off" : props.autocomplete,
|
|
70
90
|
autoFocus: props.autofocus,
|
|
@@ -78,13 +98,37 @@ export default class WmText extends BaseInputComponent {
|
|
|
78
98
|
onBlur: this.onBlur.bind(this),
|
|
79
99
|
onFocus: this.onFocus.bind(this),
|
|
80
100
|
onKeyPress: this.onKeyPress.bind(this),
|
|
81
|
-
onSubmitEditing: this.onSubmitEditing.bind(this),
|
|
82
101
|
onChangeText: this.onChangeText.bind(this),
|
|
83
102
|
onChange: this.invokeChange.bind(this),
|
|
84
103
|
allowContentSelection: this.styles.text.userSelect === 'text',
|
|
85
104
|
autoCapitalize: props.autocapitalize,
|
|
86
|
-
handleLayout: this.handleLayout
|
|
87
|
-
|
|
105
|
+
handleLayout: this.handleLayout,
|
|
106
|
+
leadingiconclass: props.leadingiconclass
|
|
107
|
+
})), hasLeading && /*#__PURE__*/React.createElement(View, {
|
|
108
|
+
style: [this.styles.iconWrapper, {
|
|
109
|
+
left: basePadding
|
|
110
|
+
}],
|
|
111
|
+
pointerEvents: "none"
|
|
112
|
+
}, /*#__PURE__*/React.createElement(WmIcon, {
|
|
113
|
+
id: this.getTestId('leading-icon'),
|
|
114
|
+
name: `${props.name}_leading_icon`,
|
|
115
|
+
iconclass: props.leadingiconclass,
|
|
116
|
+
styles: this.styles.leadingIcon,
|
|
117
|
+
accessible: true,
|
|
118
|
+
onTap: this.leadingIconClick.bind(this)
|
|
119
|
+
})), hasTrailing && /*#__PURE__*/React.createElement(View, {
|
|
120
|
+
style: this.theme.mergeStyle(this.styles.iconWrapper, {
|
|
121
|
+
right: basePadding
|
|
122
|
+
}),
|
|
123
|
+
pointerEvents: "none"
|
|
124
|
+
}, /*#__PURE__*/React.createElement(WmIcon, {
|
|
125
|
+
id: this.getTestId('trailing-icon'),
|
|
126
|
+
name: `${props.name}_trailing_icon`,
|
|
127
|
+
iconclass: props.trailingiconclass,
|
|
128
|
+
styles: this.styles.trailingIcon,
|
|
129
|
+
accessible: true,
|
|
130
|
+
onTap: this.trailingIconClick.bind(this)
|
|
131
|
+
}))), hassupportingtext && /*#__PURE__*/React.createElement(Text, null, props.hint));
|
|
88
132
|
}
|
|
89
133
|
}
|
|
90
134
|
//# sourceMappingURL=text.component.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","Platform","WmTextProps","DEFAULT_CLASS","WMTextInput","BaseInputComponent","BaseInputState","isNull","AccessibilityWidgetType","getAccessibilityProps","createSkeleton","WmTextState","WmText","constructor","props","getStyleClassName","classes","state","floatinglabel","push","join","renderSkeleton","skeletonWidth","skeletonHeight","skeletonwidth","_this$styles$root","styles","root","width","skeletonheight","_this$styles$root2","height","theme","skeleton","renderWidget","_this$state$textValue","_this$theme$getStyle","_this$theme$getStyle2","opts","valueExpr","OS","foundationStyle","getStyle","classname","split","pop","textValue","toString","createElement","_extends","getTestPropsForInput","TEXT","ref","widgetRef","selectionStart","selectionEnd","cursor","floatingLabel","floatingLabelStyle","activeFloatingLabelStyle","mergeStyle","activeFloatingLabel","focused","inactiveFloatingLabelStyle","inactiveFloatingLabel","placeholderTextColor","placeholderText","color","isInputFocused","style","text","isValid","invalid","disabled","keyboardType","autoComplete","autocomplete","autoFocus","autofocus","editable","readonly","secureTextEntry","type","maskchar","displayformat","background","_background","maxLength","maxchars","placeholder","onBlur","bind","onFocus","onKeyPress","onSubmitEditing","onChangeText","onChange","invokeChange","allowContentSelection","userSelect","autoCapitalize","autocapitalize","handleLayout"],"sources":["text.component.tsx"],"sourcesContent":["import React from 'react';\nimport { DimensionValue, Platform } from 'react-native';\n\nimport WmTextProps from './text.props';\nimport { DEFAULT_CLASS, WmTextStyles } from './text.styles';\nimport { WMTextInput } from '@wavemaker/app-rn-runtime/core/components/textinput.component';\nimport { BaseInputComponent, BaseInputState } from \"@wavemaker/app-rn-runtime/components/input/baseinput/baseinput.component\";\nimport { isNull } from 'lodash';\nimport { AccessibilityWidgetType, getAccessibilityProps } from '@wavemaker/app-rn-runtime/core/accessibility';\nimport { createSkeleton } from '@wavemaker/app-rn-runtime/components/basic/skeleton/skeleton.component';\n\nexport class WmTextState extends BaseInputState<WmTextProps> {\n}\n\nexport default class WmText extends BaseInputComponent<WmTextProps, WmTextState, WmTextStyles> {\n\n constructor(props: WmTextProps) {\n super(props, DEFAULT_CLASS, new WmTextProps(), new WmTextState());\n }\n\n public getStyleClassName(): string | undefined {\n const classes = [];\n if (this.state.props.floatinglabel) {\n classes.push('app-text-with-label');\n }\n classes.push(super.getStyleClassName());\n return classes.join(' ');\n }\n\n public renderSkeleton(props: WmTextProps): React.ReactNode {\n let skeletonWidth, skeletonHeight;\n\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 renderWidget(props: WmTextProps) {\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 (\n <WMTextInput\n {...this.getTestPropsForInput()}\n {...getAccessibilityProps(\n AccessibilityWidgetType.TEXT,\n props\n )}\n ref={(ref: any) => {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 {...opts}\n floatingLabel={props.floatinglabel}\n floatingLabelStyle={this.styles.floatingLabel}\n activeFloatingLabelStyle={this.theme.mergeStyle(\n this.theme.getStyle('app-text-with-label')?.activeFloatingLabel,\n this.theme.getStyle(`${classname}`)?.focused,\n this.styles.activeFloatingLabel ? this.styles.activeFloatingLabel : {} \n )}\n inactiveFloatingLabelStyle={this.styles.inactiveFloatingLabel}\n placeholderTextColor={this.styles.placeholderText.color as any}\n isInputFocused={ this.state.isInputFocused }\n style={[this.theme.mergeStyle(this.styles.root, foundationStyle?.root),\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(foundationStyle?.disabled, this.theme.getStyle(`${classname}`).disabled) : {}]}\n keyboardType={this.state.keyboardType}\n autoComplete={props.autocomplete === \"true\" ? \"username\" : props.autocomplete === \"false\" ? \"off\" : props.autocomplete}\n autoFocus={props.autofocus}\n editable={props.disabled || props.readonly ? false : true}\n secureTextEntry={props.type === 'password' && !props.maskchar ? true : false}\n displayformat={props.displayformat}\n background={this._background}\n maskchar={props.maskchar}\n maxLength={props.maxchars}\n placeholder={props.placeholder}\n onBlur={this.onBlur.bind(this)}\n onFocus={this.onFocus.bind(this)}\n onKeyPress={this.onKeyPress.bind(this)}\n onSubmitEditing={this.onSubmitEditing.bind(this)}\n onChangeText={this.onChangeText.bind(this)}\n onChange={this.invokeChange.bind(this)}\n allowContentSelection={this.styles.text.userSelect === 'text'}\n autoCapitalize={props.autocapitalize}\n hand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AAEjE,KAAK,CAAC2D,QAAQ,IAAI3D,KAAK,CAACkE,QAAQ,GAAG,KAAK,GAAG,IAAK;MAC1DC,eAAe,EAAEnE,KAAK,CAACoE,IAAI,KAAK,UAAU,IAAI,CAACpE,KAAK,CAACqE,QAAQ,GAAG,IAAI,GAAG,KAAM;MAC7EC,aAAa,EAAEtE,KAAK,CAACsE,aAAc;MACnCC,UAAU,EAAE,IAAI,CAACC,WAAY;MAC7BH,QAAQ,EAAErE,KAAK,CAACqE,QAAS;MACzBI,SAAS,EAAEzE,KAAK,CAAC0E,QAAS;MAC1BC,WAAW,EAAE3E,KAAK,CAAC2E,WAAY;MAC/BC,MAAM,EAAE,IAAI,CAACA,MAAM,CAACC,IAAI,CAAC,IAAI,CAAE;MAC/BC,OAAO,EAAE,IAAI,CAACA,OAAO,CAACD,IAAI,CAAC,IAAI,CAAE;MACjCE,UAAU,EAAE,IAAI,CAACA,UAAU,CAACF,IAAI,CAAC,IAAI,CAAE;MACvCG,eAAe,EAAE,IAAI,CAACA,eAAe,CAACH,IAAI,CAAC,IAAI,CAAE;MACjDI,YAAY,EAAE,IAAI,CAACA,YAAY,CAACJ,IAAI,CAAC,IAAI,CAAE;MAC3CK,QAAQ,EAAE,IAAI,CAACC,YAAY,CAACN,IAAI,CAAC,IAAI,CAAE;MACvCO,qBAAqB,EAAE,IAAI,CAACxE,MAAM,CAAC4C,IAAI,CAAC6B,UAAU,KAAK,MAAO;MAC9DC,cAAc,EAAEtF,KAAK,CAACuF,cAAe;MACrCC,YAAY,EAAE,IAAI,CAACA;IAAa,EACjC,CAAC;EAER;AACF","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["React","Platform","View","Text","WmTextProps","DEFAULT_CLASS","WMTextInput","BaseInputComponent","BaseInputState","isNull","AccessibilityWidgetType","getAccessibilityProps","createSkeleton","WmIcon","WmTextState","WmText","constructor","props","getStyleClassName","classes","state","floatinglabel","push","join","renderSkeleton","skeletonWidth","skeletonHeight","skeletonwidth","_this$styles$root","styles","root","width","skeletonheight","_this$styles$root2","height","theme","skeleton","leadingIconClick","invokeEventCallback","proxy","trailingIconClick","renderWidget","_this$state$textValue","_ref","_mergedRoot$padding","_mergedRoot$height","_this$theme$getStyle","_this$theme$getStyle2","opts","valueExpr","OS","foundationStyle","getStyle","classname","split","pop","textValue","toString","hasLeading","leadingiconclass","hasTrailing","trailingiconclass","mergedRoot","mergeStyle","inputWeb","basePadding","padding","paddingLeft","hassupportingtext","hint","inputHeight","minHeight","createElement","Fragment","style","inputContainer","_extends","getTestPropsForInput","TEXT","ref","widgetRef","selectionStart","selectionEnd","cursor","floatingLabel","inputheight","undefined","floatingLabelStyle","activeFloatingLabelStyle","activeFloatingLabel","focused","variant","labelBackground","backgroundColor","placeholderTextColor","placeholderText","color","isInputFocused","text","isValid","invalid","disabled","inputWithLeadingIcon","inputWithTrailingIcon","keyboardType","autoComplete","autocomplete","autoFocus","autofocus","editable","readonly","secureTextEntry","type","maskchar","displayformat","background","_background","maxLength","maxchars","placeholder","onBlur","bind","onFocus","onKeyPress","onChangeText","onChange","invokeChange","allowContentSelection","userSelect","autoCapitalize","autocapitalize","handleLayout","iconWrapper","left","pointerEvents","id","getTestId","name","iconclass","leadingIcon","accessible","onTap","right","trailingIcon"],"sources":["text.component.tsx"],"sourcesContent":["import React from 'react';\nimport { DimensionValue, Platform, View, Text } from 'react-native';\n\nimport WmTextProps from './text.props';\nimport { DEFAULT_CLASS, WmTextStyles } from './text.styles';\nimport { WMTextInput } from '@wavemaker/app-rn-runtime/core/components/textinput.component';\nimport { BaseInputComponent, BaseInputState } from \"@wavemaker/app-rn-runtime/components/input/baseinput/baseinput.component\";\nimport { isNull } from 'lodash';\nimport { AccessibilityWidgetType, getAccessibilityProps } from '@wavemaker/app-rn-runtime/core/accessibility';\nimport { createSkeleton } from '@wavemaker/app-rn-runtime/components/basic/skeleton/skeleton.component';\nimport WmIcon from '@wavemaker/app-rn-runtime/components/basic/icon/icon.component';\n\nexport class WmTextState extends BaseInputState<WmTextProps> {\n}\n\nexport default class WmText extends BaseInputComponent<WmTextProps, WmTextState, WmTextStyles> {\n\n constructor(props: WmTextProps) {\n super(props, DEFAULT_CLASS, new WmTextProps(), new WmTextState());\n }\n\n public getStyleClassName(): string | undefined {\n const classes = [];\n if (this.state.props.floatinglabel) {\n classes.push('app-text-with-label');\n }\n classes.push(super.getStyleClassName());\n return classes.join(' ');\n }\n\n public renderSkeleton(props: WmTextProps): React.ReactNode {\n let skeletonWidth, skeletonHeight;\n\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 leadingIconClick() {\n this.invokeEventCallback('onLeadingiconclick', [this.proxy]);\n }\n\n private trailingIconClick() {\n this.invokeEventCallback('onTrailingiconclick', [this.proxy]);\n }\n\n renderWidget(props: WmTextProps) {\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\n const hasLeading = !!props.leadingiconclass;\n const hasTrailing = !!props.trailingiconclass;\n\n const mergedRoot = this.theme.mergeStyle(this.styles.root, foundationStyle?.root, Platform.OS === 'web' ? this.styles.inputWeb : null);\n const basePadding = mergedRoot?.padding ?? mergedRoot?.paddingLeft ?? 16;\n const hassupportingtext = !!(props.hint);\n const inputHeight = mergedRoot.height ?? mergedRoot.minHeight;\n\n return (\n <>\n <View style={this.styles.inputContainer}>\n <WMTextInput\n {...this.getTestPropsForInput()}\n {...getAccessibilityProps(\n AccessibilityWidgetType.TEXT,\n props\n )}\n ref={(ref: any) => {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 {...opts}\n floatingLabel={props.floatinglabel}\n inputheight={typeof inputHeight === 'number' ? inputHeight : undefined}\n floatingLabelStyle={{\n ...this.styles.floatingLabel}}\n activeFloatingLabelStyle={this.theme.mergeStyle(this.styles.activeFloatingLabel,\n this.theme.getStyle('app-text-with-label')?.activeFloatingLabel,\n this.theme.getStyle(`${classname}`)?.focused) \n }\n variant={props.variant as 'filled' | 'outlined' | undefined}\n labelBackground={props.variant != 'filled' ? (mergedRoot?.backgroundColor as string) : undefined}\n placeholderTextColor={this.styles.placeholderText.color as any}\n isInputFocused={ this.state.isInputFocused }\n style={[this.theme.mergeStyle(this.styles.root, foundationStyle?.root),\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.root, this.styles.focused, foundationStyle?.focused, this.theme.getStyle(`${classname}`).focused) : {},\n this.state.props.disabled ? this.theme.mergeStyle(this.styles.root, foundationStyle?.disabled, this.theme.getStyle(`${classname}`).disabled) : {},\n hasLeading ? this.styles.inputWithLeadingIcon : {},\n hasTrailing ? this.styles.inputWithTrailingIcon : {},\n Platform.OS === 'web' ? this.styles.inputWeb : null //added to override the bordercolor getting applied only in web.\n ]}\n keyboardType={this.state.keyboardType}\n autoComplete={props.autocomplete === \"true\" ? \"username\" : props.autocomplete === \"false\" ? \"off\" : props.autocomplete}\n autoFocus={props.autofocus}\n editable={props.disabled || props.readonly ? false : true}\n secureTextEntry={props.type === 'password' && !props.maskchar ? true : false}\n displayformat={props.displayformat}\n background={this._background}\n maskchar={props.maskchar}\n maxLength={props.maxchars}\n placeholder={props.placeholder}\n onBlur={this.onBlur.bind(this)}\n onFocus={this.onFocus.bind(this)}\n onKeyPress={this.onKeyPress.bind(this)}\n onChangeText={this.onChangeText.bind(this)}\n onChange={this.invokeChange.bind(this)}\n allowContentSelection={this.styles.text.userSelect === 'text'}\n autoCapitalize={props.autocapitalize}\n handleLayout={this.handleLayout}\n leadingiconclass={props.leadingiconclass}\n />\n {hasLeading && (\n <View\n style={[this.styles.iconWrapper, { left: basePadding as any }]}\n pointerEvents=\"none\"\n >\n <WmIcon\n id={this.getTestId('leading-icon')}\n name={`${props.name}_leading_icon`}\n iconclass={props.leadingiconclass}\n styles={this.styles.leadingIcon}\n accessible={true}\n onTap={this.leadingIconClick.bind(this)}\n />\n </View>\n )}\n {hasTrailing && (\n <View\n style={this.theme.mergeStyle(this.styles.iconWrapper, { right: basePadding as any })}\n pointerEvents=\"none\"\n >\n <WmIcon\n id={this.getTestId('trailing-icon')}\n name={`${props.name}_trailing_icon`}\n iconclass={props.trailingiconclass}\n styles={this.styles.trailingIcon}\n accessible={true}\n onTap={this.trailingIconClick.bind(this)}\n />\n </View>\n )}\n \n </View>\n {hassupportingtext && (\n <Text>\n {props.hint}\n </Text>\n )\n }\n </>\n );\n }\n}\n"],"mappings":";AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAAyBC,QAAQ,EAAEC,IAAI,EAAEC,IAAI,QAAQ,cAAc;AAEnE,OAAOC,WAAW,MAAM,cAAc;AACtC,SAASC,aAAa,QAAsB,eAAe;AAC3D,SAASC,WAAW,QAAQ,+DAA+D;AAC3F,SAASC,kBAAkB,EAAEC,cAAc,QAAQ,0EAA0E;AAC7H,SAASC,MAAM,QAAQ,QAAQ;AAC/B,SAASC,uBAAuB,EAAEC,qBAAqB,QAAQ,8CAA8C;AAC7G,SAASC,cAAc,QAAQ,wEAAwE;AACvG,OAAOC,MAAM,MAAM,gEAAgE;AAEnF,OAAO,MAAMC,WAAW,SAASN,cAAc,CAAc;AAG7D,eAAe,MAAMO,MAAM,SAASR,k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C,SAAS,CAAC,cAAc,CAAE;MACnCC,IAAI,EAAE,GAAGxH,KAAK,CAACwH,IAAI,eAAgB;MACnCC,SAAS,EAAEzH,KAAK,CAAC0C,gBAAiB;MAClC9B,MAAM,EAAE,IAAI,CAACA,MAAM,CAAC8G,WAAY;MAChCC,UAAU,EAAE,IAAK;MACjBC,KAAK,EAAE,IAAI,CAACxG,gBAAgB,CAACoF,IAAI,CAAC,IAAI;IAAE,CACzC,CACG,CACP,EACA7D,WAAW,iBACV5D,KAAA,CAAAwE,aAAA,CAACtE,IAAI;MACHwE,KAAK,EAAE,IAAI,CAACvC,KAAK,CAAC4B,UAAU,CAAC,IAAI,CAAClC,MAAM,CAACuG,WAAW,EAAE;QAAEU,KAAK,EAAE7E;MAAmB,CAAC,CAAE;MACrFqE,aAAa,EAAC;IAAM,gBAEpBtI,KAAA,CAAAwE,aAAA,CAAC3D,MAAM;MACL0H,EAAE,EAAE,IAAI,CAACC,SAAS,CAAC,eAAe,CAAE;MACpCC,IAAI,EAAE,GAAGxH,KAAK,CAACwH,IAAI,gBAAiB;MACpCC,SAAS,EAAEzH,KAAK,CAAC4C,iBAAkB;MACnChC,MAAM,EAAE,IAAI,CAACA,MAAM,CAACkH,YAAa;MACjCH,UAAU,EAAE,IAAK;MACjBC,KAAK,EAAE,IAAI,CAACrG,iBAAiB,CAACiF,IAAI,CAAC,IAAI;IAAE,CAC1C,CACG,CAGJ,CAAC,EACNrD,iBAAiB,iBACdpE,KAAA,CAAAwE,aAAA,CAACrE,IAAI,QACDc,KAAK,CAACoD,IACJ,CAGV,CAAC;EAEL;AACF","ignoreList":[]}
|
|
@@ -11,6 +11,11 @@ export default class WmTextProps extends BaseInputProps {
|
|
|
11
11
|
_defineProperty(this, "skeletonwidth", null);
|
|
12
12
|
_defineProperty(this, "autocapitalize", 'none');
|
|
13
13
|
_defineProperty(this, "returnkeytype", 'auto');
|
|
14
|
+
_defineProperty(this, "onSubmitEditing", () => {});
|
|
15
|
+
_defineProperty(this, "variant", void 0);
|
|
16
|
+
_defineProperty(this, "leadingiconclass", void 0);
|
|
17
|
+
_defineProperty(this, "trailingiconclass", void 0);
|
|
18
|
+
_defineProperty(this, "moveUp", void 0);
|
|
14
19
|
}
|
|
15
20
|
}
|
|
16
21
|
//# sourceMappingURL=text.props.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["BaseInputProps","WmTextProps","constructor","args","_defineProperty"],"sources":["text.props.ts"],"sourcesContent":["import BaseInputProps from \"@wavemaker/app-rn-runtime/components/input/baseinput/baseinput.props\";\n\nexport default class WmTextProps extends BaseInputProps {\n floatinglabel?: string;\n placeholder: string = 'Enter text';\n skeletonheight?: string = null as any;\n skeletonwidth?: string = null as any;\n autocapitalize?: string = 'none';\n returnkeytype: 'auto' | 'next' | 'done' = 'auto';\n}\n"],"mappings":";;;AAAA,OAAOA,cAAc,MAAM,sEAAsE;AAEjG,eAAe,MAAMC,WAAW,SAASD,cAAc,CAAC;EAAAE,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAC,eAAA;IAAAA,eAAA,sBAEhC,YAAY;IAAAA,eAAA,yBACR,IAAI;IAAAA,eAAA,wBACL,IAAI;IAAAA,eAAA,yBACH,MAAM;IAAAA,eAAA,wBACU,MAAM;EAAA;
|
|
1
|
+
{"version":3,"names":["BaseInputProps","WmTextProps","constructor","args","_defineProperty"],"sources":["text.props.ts"],"sourcesContent":["import BaseInputProps from \"@wavemaker/app-rn-runtime/components/input/baseinput/baseinput.props\";\n\nexport default class WmTextProps extends BaseInputProps {\n floatinglabel?: string;\n placeholder: string = 'Enter text';\n skeletonheight?: string = null as any;\n skeletonwidth?: string = null as any;\n autocapitalize?: string = 'none';\n returnkeytype: 'auto' | 'next' | 'done' = 'auto';\n onSubmitEditing: Function = () => {};\n variant?: string;\n leadingiconclass?: string;\n trailingiconclass?: string;\n moveUp?: boolean;\n}\n"],"mappings":";;;AAAA,OAAOA,cAAc,MAAM,sEAAsE;AAEjG,eAAe,MAAMC,WAAW,SAASD,cAAc,CAAC;EAAAE,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAC,eAAA;IAAAA,eAAA,sBAEhC,YAAY;IAAAA,eAAA,yBACR,IAAI;IAAAA,eAAA,wBACL,IAAI;IAAAA,eAAA,yBACH,MAAM;IAAAA,eAAA,wBACU,MAAM;IAAAA,eAAA,0BACnB,MAAM,CAAC,CAAC;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;EAAA;AAKvC","ignoreList":[]}
|
|
@@ -13,7 +13,6 @@ BASE_THEME.registerStyle((themeVariables, addStyle) => {
|
|
|
13
13
|
borderStyle: 'solid',
|
|
14
14
|
borderColor: themeVariables.inputBorderColor,
|
|
15
15
|
backgroundColor: themeVariables.inputBackgroundColor,
|
|
16
|
-
borderRadius: 6,
|
|
17
16
|
fontFamily: themeVariables.baseFont
|
|
18
17
|
},
|
|
19
18
|
text: {
|
|
@@ -30,7 +29,37 @@ BASE_THEME.registerStyle((themeVariables, addStyle) => {
|
|
|
30
29
|
},
|
|
31
30
|
floatingLabel: {},
|
|
32
31
|
activeFloatingLabel: {},
|
|
33
|
-
|
|
32
|
+
inputContainer: {
|
|
33
|
+
position: 'relative'
|
|
34
|
+
},
|
|
35
|
+
inputWithLeadingIcon: {
|
|
36
|
+
paddingLeft: 50
|
|
37
|
+
},
|
|
38
|
+
inputWithTrailingIcon: {
|
|
39
|
+
paddingRight: 48
|
|
40
|
+
},
|
|
41
|
+
iconWrapper: {
|
|
42
|
+
position: 'absolute',
|
|
43
|
+
top: 0,
|
|
44
|
+
bottom: 0,
|
|
45
|
+
justifyContent: 'center'
|
|
46
|
+
},
|
|
47
|
+
leadingIcon: {
|
|
48
|
+
root: {},
|
|
49
|
+
icon: {
|
|
50
|
+
fontSize: 24
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
trailingIcon: {
|
|
54
|
+
root: {},
|
|
55
|
+
icon: {
|
|
56
|
+
fontSize: 24
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
inputWeb: {
|
|
60
|
+
outline: 'none',
|
|
61
|
+
boxShadow: 'none'
|
|
62
|
+
},
|
|
34
63
|
skeleton: {
|
|
35
64
|
root: {
|
|
36
65
|
width: '100%',
|
|
@@ -83,9 +112,6 @@ BASE_THEME.registerStyle((themeVariables, addStyle) => {
|
|
|
83
112
|
},
|
|
84
113
|
activeFloatingLabel: {
|
|
85
114
|
color: themeVariables.activeFloatingLabelColor
|
|
86
|
-
},
|
|
87
|
-
inactiveFloatingLabel: {
|
|
88
|
-
color: themeVariables.floatingLabelColor
|
|
89
115
|
}
|
|
90
116
|
});
|
|
91
117
|
addStyle('app-input', '', {
|
|
@@ -96,7 +122,6 @@ BASE_THEME.registerStyle((themeVariables, addStyle) => {
|
|
|
96
122
|
placeholderText: {},
|
|
97
123
|
floatingLabel: {},
|
|
98
124
|
activeFloatingLabel: {},
|
|
99
|
-
inactiveFloatingLabel: {},
|
|
100
125
|
skeleton: {
|
|
101
126
|
root: {}
|
|
102
127
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["BASE_THEME","defineStyles","DEFAULT_CLASS","registerStyle","themeVariables","addStyle","defaultStyles","root","minHeight","paddingTop","paddingBottom","borderWidth","paddingLeft","paddingRight","borderStyle","borderColor","inputBorderColor","backgroundColor","inputBackgroundColor","
|
|
1
|
+
{"version":3,"names":["BASE_THEME","defineStyles","DEFAULT_CLASS","registerStyle","themeVariables","addStyle","defaultStyles","root","minHeight","paddingTop","paddingBottom","borderWidth","paddingLeft","paddingRight","borderStyle","borderColor","inputBorderColor","backgroundColor","inputBackgroundColor","fontFamily","baseFont","text","fontSize","invalid","borderBottomColor","inputInvalidBorderColor","focused","inputFocusBorderColor","placeholderText","color","inputPlaceholderColor","floatingLabel","activeFloatingLabel","inputContainer","position","inputWithLeadingIcon","inputWithTrailingIcon","iconWrapper","top","bottom","justifyContent","leadingIcon","icon","trailingIcon","inputWeb","outline","boxShadow","skeleton","width","height","borderRadius","flex","minWidth","maxWidth","inputDisabledBgColor","textAlign","left","floatingLabelColor","activeFloatingLabelColor"],"sources":["text.styles.ts"],"sourcesContent":["import BASE_THEME, { AllStyle, Theme } from '@wavemaker/app-rn-runtime/styles/theme';\nimport { BaseStyles, defineStyles } from '@wavemaker/app-rn-runtime/core/base.component';\nimport { ColorValue } from \"react-native\";\nimport { WmSkeletonStyles } from '@wavemaker/app-rn-runtime/components/basic/skeleton/skeleton.styles';\nimport { WmIconStyles } from '@wavemaker/app-rn-runtime/components/basic/icon/icon.styles';\n\nexport type WmTextStyles = BaseStyles & {\n invalid: AllStyle;\n focused: AllStyle;\n placeholderText: AllStyle;\n floatingLabel: AllStyle;\n activeFloatingLabel: AllStyle;\n inputContainer: AllStyle;\n inputWithLeadingIcon: AllStyle;\n inputWithTrailingIcon: AllStyle;\n iconWrapper: AllStyle;\n leadingIcon: WmIconStyles;\n trailingIcon: WmIconStyles;\n skeleton: WmSkeletonStyles;\n};\n\nexport const DEFAULT_CLASS = 'app-text';\nBASE_THEME.registerStyle((themeVariables, addStyle) => {\n const defaultStyles: WmTextStyles = defineStyles({\n root: {\n minHeight: 42,\n paddingTop: 8,\n paddingBottom: 8,\n borderWidth: 1,\n paddingLeft: 16,\n paddingRight: 16,\n borderStyle: 'solid',\n borderColor: themeVariables.inputBorderColor,\n backgroundColor: themeVariables.inputBackgroundColor,\n fontFamily: themeVariables.baseFont,\n },\n text: {\n fontSize: 16\n },\n invalid: {\n borderBottomColor: themeVariables.inputInvalidBorderColor\n },\n focused: {\n borderColor: themeVariables.inputFocusBorderColor,\n },\n placeholderText: {\n color: themeVariables.inputPlaceholderColor\n },\n floatingLabel: {},\n activeFloatingLabel: {},\n inputContainer: {\n position: 'relative',\n },\n inputWithLeadingIcon: {\n paddingLeft: 50,\n },\n inputWithTrailingIcon: {\n paddingRight: 48,\n },\n iconWrapper: {\n position: 'absolute',\n top: 0,\n bottom: 0,\n justifyContent: 'center',\n },\n leadingIcon: {\n root: {},\n icon: {\n fontSize: 24\n },\n } as WmIconStyles,\n trailingIcon: {\n root: {},\n icon: {\n fontSize: 24\n },\n } as WmIconStyles,\n inputWeb: {\n outline: 'none',\n boxShadow: 'none',\n },\n skeleton: {\n root: {\n width: '100%',\n height: 16,\n borderRadius: 4\n }\n } as any as WmSkeletonStyles\n });\n\n addStyle(DEFAULT_CLASS, '', defaultStyles);\n\n // Add horizontal form input styles for horizontal form field layouts - positioned early to avoid overriding more specific styles\n addStyle('form-text-input-horizontal', '', {\n root: {\n flex: 1,\n minWidth: 0,\n maxWidth: '100%',\n },\n text: {\n }\n } as BaseStyles);\n\n // Password widgets use the text component but have their own widget type\n addStyle('form-password-input-horizontal', '', {\n root: {\n flex: 1,\n minWidth: 0,\n maxWidth: '100%',\n },\n text: {}\n } as BaseStyles);\n\n addStyle(DEFAULT_CLASS + '-disabled', '', {\n root: {\n backgroundColor: themeVariables.inputDisabledBgColor\n }\n });\n addStyle(DEFAULT_CLASS + '-rtl', '', {\n root: {\n textAlign: 'right'\n }\n });\n addStyle(DEFAULT_CLASS + '-with-label', '', {\n root: {\n minHeight: 48,\n },\n floatingLabel: {\n position: 'absolute',\n top: 12,\n left: 16,\n fontSize: 14,\n color: themeVariables.floatingLabelColor\n },\n activeFloatingLabel: {\n color: themeVariables.activeFloatingLabelColor,\n }\n });\n addStyle('app-input', '', {\n root: {},\n text: {},\n invalid: {\n },\n focused: {},\n placeholderText: {},\n floatingLabel: {},\n activeFloatingLabel: {},\n skeleton: {\n root: {}\n } as any as WmSkeletonStyles\n });\n});\n"],"mappings":"AAAA,OAAOA,UAAU,MAA2B,wCAAwC;AACpF,SAAqBC,YAAY,QAAQ,+CAA+C;AAoBxF,OAAO,MAAMC,aAAa,GAAG,UAAU;AACvCF,UAAU,CAACG,aAAa,CAAC,CAACC,cAAc,EAAEC,QAAQ,KAAK;EACrD,MAAMC,aAA2B,GAAGL,YAAY,CAAC;IAC/CM,IAAI,EAAE;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AE,CAAC,CAAC;IACRE,OAAO,EAAE,CACT,CAAC;IACDG,OAAO,EAAE,CAAC,CAAC;IACXE,eAAe,EAAE,CAAC,CAAC;IACnBG,aAAa,EAAE,CAAC,CAAC;IACjBC,mBAAmB,EAAE,CAAC,CAAC;IACvBe,QAAQ,EAAE;MACRxC,IAAI,EAAE,CAAC;IACT;EACF,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
|
|
@@ -42,7 +42,7 @@ export default class WmTextarea extends BaseInputComponent {
|
|
|
42
42
|
});
|
|
43
43
|
}
|
|
44
44
|
renderWidget(props) {
|
|
45
|
-
var _this$state$textValue, _this$theme$getStyle, _this$theme$getStyle2;
|
|
45
|
+
var _this$state$textValue, _this$theme$getStyle, _this$theme$getStyle2, _this$styles$root3;
|
|
46
46
|
let opts = {};
|
|
47
47
|
const valueExpr = Platform.OS === 'web' ? 'value' : 'defaultValue';
|
|
48
48
|
const foundationStyle = this.theme.getStyle('app-input');
|
|
@@ -67,8 +67,9 @@ export default class WmTextarea extends BaseInputComponent {
|
|
|
67
67
|
}, opts, {
|
|
68
68
|
floatingLabel: props.floatinglabel,
|
|
69
69
|
floatingLabelStyle: this.styles.floatingLabel,
|
|
70
|
-
activeFloatingLabelStyle: this.theme.mergeStyle((_this$theme$getStyle = this.theme.getStyle('app-textarea-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
|
|
71
|
-
|
|
70
|
+
activeFloatingLabelStyle: this.theme.mergeStyle((_this$theme$getStyle = this.theme.getStyle('app-textarea-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),
|
|
71
|
+
variant: props.variant,
|
|
72
|
+
labelBackground: props.variant === 'outlined' ? (_this$styles$root3 = this.styles.root) === null || _this$styles$root3 === void 0 ? void 0 : _this$styles$root3.backgroundColor : undefined,
|
|
72
73
|
autoComplete: props.autocomplete ? 'username' : 'off',
|
|
73
74
|
autoFocus: props.autofocus,
|
|
74
75
|
editable: props.disabled || props.readonly ? false : true,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","Platform","Text","WmTextareaProps","DEFAULT_CLASS","BaseInputComponent","BaseInputState","WMTextInput","isNull","AccessibilityWidgetType","getAccessibilityProps","createSkeleton","WmTextareaState","WmTextarea","constructor","props","getStyleClassName","classes","state","floatinglabel","push","join","renderSkeleton","skeletonWidth","skeletonHeight","skeletonwidth","_this$styles$root","styles","root","width","skeletonheight","_this$styles$root2","height","theme","skeleton","renderWidget","_this$state$textValue","_this$theme$getStyle","_this$theme$getStyle2","opts","valueExpr","OS","foundationStyle","getStyle","classname","split","pop","textValue","toString","createElement","Fragment","_extends","getTestPropsForInput","TEXTAREA","ref","widgetRef","selectionStart","selectionEnd","cursor","placeholderTextColor","placeholderText","color","isInputFocused","style","text","isValid","invalid","mergeStyle","focused","disabled","multiline","numberOfLines","background","_background","keyboardType","floatingLabel","floatingLabelStyle","activeFloatingLabelStyle","activeFloatingLabel","inactiveFloatingLabelStyle","inactiveFloatingLabel","autoComplete","autocomplete","autoFocus","autofocus","editable","readonly","maxLength","maxchars","placeholder","onBlur","bind","onFocus","onKeyPress","onChangeText","onChange","invokeChange","allowContentSelection","userSelect","handleLayout","limitdisplaytext","helpText"],"sources":["textarea.component.tsx"],"sourcesContent":["import React from 'react';\nimport { DimensionValue, Platform,Text } from 'react-native';\nimport WmTextareaProps from './textarea.props';\nimport { DEFAULT_CLASS, WmTextareaStyles } from './textarea.styles';\nimport {\n BaseInputComponent,\n BaseInputState\n} from '@wavemaker/app-rn-runtime/components/input/baseinput/baseinput.component';\nimport { WMTextInput } from '@wavemaker/app-rn-runtime/core/components/textinput.component';\nimport { isNull } from 'lodash';\nimport { AccessibilityWidgetType, getAccessibilityProps } from '@wavemaker/app-rn-runtime/core/accessibility';\nimport { createSkeleton } from '@wavemaker/app-rn-runtime/components/basic/skeleton/skeleton.component';\n\nexport class WmTextareaState extends BaseInputState<WmTextareaProps> {}\n\nexport default class WmTextarea extends BaseInputComponent<WmTextareaProps, WmTextareaState, WmTextareaStyles> {\n\n constructor(props: WmTextareaProps) {\n super(props, DEFAULT_CLASS, new WmTextareaProps(), new WmTextareaState());\n }\n\n public getStyleClassName(): string | undefined {\n const classes = [];\n if (this.state.props.floatinglabel) {\n classes.push('app-textarea-with-label');\n }\n classes.push(super.getStyleClassName());\n return classes.join(' ');\n }\n\n public renderSkeleton(props: WmTextareaProps): React.ReactNode {\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 renderWidget(props: WmTextareaProps) {\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 (\n <>\n <WMTextInput\n {...this.getTestPropsForInput()}\n {...getAccessibilityProps(\n AccessibilityWidgetType.TEXTAREA,\n props\n )}\n ref={(ref: any) => {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 placeholderTextColor={this.styles.placeholderText.color as any}\n isInputFocused={ this.state.isInputFocused }\n style={[this.styles.root, this.styles.text, this.state.isValid ? {} : this.styles.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(foundationStyle?.disabled, this.theme.getStyle(`${classname}`).disabled) : {}\n ]}\n multiline={true}\n numberOfLines={4}\n background={this._background}\n keyboardType={this.state.keyboardType}\n {...opts}\n floatingLabel={props.floatinglabel}\n floatingLabelStyle={this.styles.floatingLabel}\n activeFloatingLabelStyle={this.theme.mergeStyle(\n this.theme.getStyle('app-textarea-with-label')?.activeFloatingLabel,\n this.theme.getStyle(`${classname}`)?.focused,\n this.styles.activeFloatingLabel ? this.styles.activeFloatingLabel : {} \n )}\n inactiveFloatingLabelStyle={this.styles.inactiveFloatingLabel}\n autoComplete={props.autocomplete ? 'username' : 'off'}\n autoFocus={props.autofocus}\n editable={props.disabled || props.readonly ? false : true}\n maxLength={props.maxchars}\n placeholder={props.placeholder || 'Place your text'}\n onBlur={this.onBlur.bind(this)}\n onFocus={this.onFocus.bind(this)}\n onKeyPress={this.onKeyPress.bind(this)}\n onChangeText={this.onChangeText.bind(this)}\n onChange={this.invokeChange.bind(this)}\n allowContentSelection={this.styles.text.userSelect === 'text'}\n handleLayout={this.handleLayout}\n />\n { (props.maxchars && props.limitdisplaytext) && <Text\n style={[\n this.styles.helpText\n ]} >\n {props.limitdisplaytext}\n </Text>}\n </>);\n }\n}\n"],"mappings":";AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAAyBC,QAAQ,EAACC,IAAI,QAAQ,cAAc;AAC5D,OAAOC,eAAe,MAAM,kBAAkB;AAC9C,SAASC,aAAa,QAA0B,mBAAmB;AACnE,SACEC,kBAAkB,EAClBC,cAAc,QACT,0EAA0E;AACjF,SAASC,WAAW,QAAQ,+DAA+D;AAC3F,SAASC,MAAM,QAAQ,QAAQ;AAC/B,SAASC,uBAAuB,EAAEC,qBA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AC,EACEpF,KAAK,CAACyE,QAAQ,IAAIzE,KAAK,CAACqF,gBAAgB,iBAAKpG,KAAA,CAAAiD,aAAA,CAAC/C,IAAI;MAClD6D,KAAK,EAAE,CACL,IAAI,CAACpC,MAAM,CAAC0E,QAAQ;IACpB,GACAtF,KAAK,CAACqF,gBACN,CACJ,CAAC;EACL;AACF","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["React","Platform","Text","WmTextareaProps","DEFAULT_CLASS","BaseInputComponent","BaseInputState","WMTextInput","isNull","AccessibilityWidgetType","getAccessibilityProps","createSkeleton","WmTextareaState","WmTextarea","constructor","props","getStyleClassName","classes","state","floatinglabel","push","join","renderSkeleton","skeletonWidth","skeletonHeight","skeletonwidth","_this$styles$root","styles","root","width","skeletonheight","_this$styles$root2","height","theme","skeleton","renderWidget","_this$state$textValue","_this$theme$getStyle","_this$theme$getStyle2","_this$styles$root3","opts","valueExpr","OS","foundationStyle","getStyle","classname","split","pop","textValue","toString","createElement","Fragment","_extends","getTestPropsForInput","TEXTAREA","ref","widgetRef","selectionStart","selectionEnd","cursor","placeholderTextColor","placeholderText","color","isInputFocused","style","text","isValid","invalid","mergeStyle","focused","disabled","multiline","numberOfLines","background","_background","keyboardType","floatingLabel","floatingLabelStyle","activeFloatingLabelStyle","activeFloatingLabel","variant","labelBackground","backgroundColor","undefined","autoComplete","autocomplete","autoFocus","autofocus","editable","readonly","maxLength","maxchars","placeholder","onBlur","bind","onFocus","onKeyPress","onChangeText","onChange","invokeChange","allowContentSelection","userSelect","handleLayout","limitdisplaytext","helpText"],"sources":["textarea.component.tsx"],"sourcesContent":["import React from 'react';\nimport { DimensionValue, Platform,Text } from 'react-native';\nimport WmTextareaProps from './textarea.props';\nimport { DEFAULT_CLASS, WmTextareaStyles } from './textarea.styles';\nimport {\n BaseInputComponent,\n BaseInputState\n} from '@wavemaker/app-rn-runtime/components/input/baseinput/baseinput.component';\nimport { WMTextInput } from '@wavemaker/app-rn-runtime/core/components/textinput.component';\nimport { isNull } from 'lodash';\nimport { AccessibilityWidgetType, getAccessibilityProps } from '@wavemaker/app-rn-runtime/core/accessibility';\nimport { createSkeleton } from '@wavemaker/app-rn-runtime/components/basic/skeleton/skeleton.component';\n\nexport class WmTextareaState extends BaseInputState<WmTextareaProps> {}\n\nexport default class WmTextarea extends BaseInputComponent<WmTextareaProps, WmTextareaState, WmTextareaStyles> {\n\n constructor(props: WmTextareaProps) {\n super(props, DEFAULT_CLASS, new WmTextareaProps(), new WmTextareaState());\n }\n\n public getStyleClassName(): string | undefined {\n const classes = [];\n if (this.state.props.floatinglabel) {\n classes.push('app-textarea-with-label');\n }\n classes.push(super.getStyleClassName());\n return classes.join(' ');\n }\n\n public renderSkeleton(props: WmTextareaProps): React.ReactNode {\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 renderWidget(props: WmTextareaProps) {\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 (\n <>\n <WMTextInput\n {...this.getTestPropsForInput()}\n {...getAccessibilityProps(\n AccessibilityWidgetType.TEXTAREA,\n props\n )}\n ref={(ref: any) => {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 placeholderTextColor={this.styles.placeholderText.color as any}\n isInputFocused={ this.state.isInputFocused }\n style={[this.styles.root, this.styles.text, this.state.isValid ? {} : this.styles.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(foundationStyle?.disabled, this.theme.getStyle(`${classname}`).disabled) : {}\n ]}\n multiline={true}\n numberOfLines={4}\n background={this._background}\n keyboardType={this.state.keyboardType}\n {...opts}\n floatingLabel={props.floatinglabel}\n floatingLabelStyle={this.styles.floatingLabel}\n activeFloatingLabelStyle={this.theme.mergeStyle(\n this.theme.getStyle('app-textarea-with-label')?.activeFloatingLabel,\n this.theme.getStyle(`${classname}`)?.focused)}\n variant={props.variant as 'filled' | 'outlined' | undefined}\n labelBackground={props.variant === 'outlined' ? (this.styles.root?.backgroundColor as string) : undefined}\n autoComplete={props.autocomplete ? 'username' : 'off'}\n autoFocus={props.autofocus}\n editable={props.disabled || props.readonly ? false : true}\n maxLength={props.maxchars}\n placeholder={props.placeholder || 'Place your text'}\n onBlur={this.onBlur.bind(this)}\n onFocus={this.onFocus.bind(this)}\n onKeyPress={this.onKeyPress.bind(this)}\n onChangeText={this.onChangeText.bind(this)}\n onChange={this.invokeChange.bind(this)}\n allowContentSelection={this.styles.text.userSelect === 'text'}\n handleLayout={this.handleLayout}\n />\n { (props.maxchars && props.limitdisplaytext) && <Text\n style={[\n this.styles.helpText\n ]} >\n {props.limitdisplaytext}\n </Text>}\n </>);\n }\n}\n"],"mappings":";AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAAyBC,QAAQ,EAACC,IAAI,QAAQ,cAAc;AAC5D,OAAOC,eAAe,MAAM,kBAAkB;AAC9C,SAASC,aAAa,QAA0B,mBAAmB;AACnE,SACEC,kBAAkB,EAClBC,cAAc,QACT,0EAA0E;AACjF,SAASC,WAAW,QAAQ,+DAA+D;AAC3F,SAASC,MAAM,QAAQ,QAAQ;AAC/B,SAASC,uBAAuB,EAAEC,qBAAqB,QA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AAU,KAAK,MAAO;MAC9DC,YAAY,EAAE,IAAI,CAACA;IAAa,EACjC,CAAC,EACEvF,KAAK,CAAC4E,QAAQ,IAAI5E,KAAK,CAACwF,gBAAgB,iBAAKvG,KAAA,CAAAkD,aAAA,CAAChD,IAAI;MAClD8D,KAAK,EAAE,CACL,IAAI,CAACrC,MAAM,CAAC6E,QAAQ;IACpB,GACAzF,KAAK,CAACwF,gBACN,CACJ,CAAC;EACL;AACF","ignoreList":[]}
|
|
@@ -10,6 +10,7 @@ export default class WmTextareaProps extends BaseInputProps {
|
|
|
10
10
|
_defineProperty(this, "skeletonheight", null);
|
|
11
11
|
_defineProperty(this, "skeletonwidth", null);
|
|
12
12
|
_defineProperty(this, "limitdisplaytext", null);
|
|
13
|
+
_defineProperty(this, "variant", void 0);
|
|
13
14
|
}
|
|
14
15
|
}
|
|
15
16
|
//# sourceMappingURL=textarea.props.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["BaseInputProps","WmTextareaProps","constructor","args","_defineProperty"],"sources":["textarea.props.ts"],"sourcesContent":["import BaseInputProps from '@wavemaker/app-rn-runtime/components/input/baseinput/baseinput.props';\n\nexport default class WmTextareaProps extends BaseInputProps {\n floatinglabel?: string;\n placeholder: string = 'Place your text';\n skeletonheight?: string = null as any;\n skeletonwidth?: string = null as any;\n limitdisplaytext?: string = null as any;\n}\n"],"mappings":";;;AAAA,OAAOA,cAAc,MAAM,sEAAsE;AAEjG,eAAe,MAAMC,eAAe,SAASD,cAAc,CAAC;EAAAE,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAC,eAAA;IAAAA,eAAA,sBAEpC,iBAAiB;IAAAA,eAAA,yBACb,IAAI;IAAAA,eAAA,wBACL,IAAI;IAAAA,eAAA,2BACD,IAAI;EAAA;
|
|
1
|
+
{"version":3,"names":["BaseInputProps","WmTextareaProps","constructor","args","_defineProperty"],"sources":["textarea.props.ts"],"sourcesContent":["import BaseInputProps from '@wavemaker/app-rn-runtime/components/input/baseinput/baseinput.props';\n\nexport default class WmTextareaProps extends BaseInputProps {\n floatinglabel?: string;\n placeholder: string = 'Place your text';\n skeletonheight?: string = null as any;\n skeletonwidth?: string = null as any;\n limitdisplaytext?: string = null as any;\n variant?: string;\n}\n"],"mappings":";;;AAAA,OAAOA,cAAc,MAAM,sEAAsE;AAEjG,eAAe,MAAMC,eAAe,SAASD,cAAc,CAAC;EAAAE,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAC,eAAA;IAAAA,eAAA,sBAEpC,iBAAiB;IAAAA,eAAA,yBACb,IAAI;IAAAA,eAAA,wBACL,IAAI;IAAAA,eAAA,2BACD,IAAI;IAAAA,eAAA;EAAA;AAElC","ignoreList":[]}
|
|
@@ -2,32 +2,75 @@ import React, { useEffect, useState } from 'react';
|
|
|
2
2
|
import { Animated, Text } from 'react-native';
|
|
3
3
|
import { Theme } from '@wavemaker/app-rn-runtime/styles/theme';
|
|
4
4
|
export const FloatingLabel = props => {
|
|
5
|
-
var _props$style
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const
|
|
10
|
-
const
|
|
5
|
+
var _props$style;
|
|
6
|
+
const toNumber = (value, fallback) => {
|
|
7
|
+
return typeof value === 'number' ? value : fallback;
|
|
8
|
+
};
|
|
9
|
+
const fontSize = toNumber((_props$style = props.style) === null || _props$style === void 0 ? void 0 : _props$style.fontSize, 16);
|
|
10
|
+
const getAnimationValues = moveUp => {
|
|
11
|
+
const hasLeading = !!props.leadingiconclass;
|
|
12
|
+
if (!moveUp) {
|
|
13
|
+
return {
|
|
14
|
+
x: hasLeading ? 28 : 0,
|
|
15
|
+
y: 0,
|
|
16
|
+
scale: 1
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
switch (props.variant) {
|
|
20
|
+
case 'filled':
|
|
21
|
+
return {
|
|
22
|
+
x: hasLeading ? 28 : 0,
|
|
23
|
+
y: -1 * fontSize * 1,
|
|
24
|
+
scale: 0.8
|
|
25
|
+
};
|
|
26
|
+
case 'outlined':
|
|
27
|
+
return {
|
|
28
|
+
x: 0,
|
|
29
|
+
y: -1 * (fontSize + 14),
|
|
30
|
+
scale: 0.8
|
|
31
|
+
};
|
|
32
|
+
default:
|
|
33
|
+
return {
|
|
34
|
+
x: 0,
|
|
35
|
+
y: -1 * (fontSize + 14),
|
|
36
|
+
scale: 0.8
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
const initial = getAnimationValues(props.moveUp);
|
|
41
|
+
const [labelPositionX] = useState(new Animated.Value(initial.x));
|
|
42
|
+
const [labelPositionY] = useState(new Animated.Value(initial.y));
|
|
43
|
+
const [labelScale] = useState(new Animated.Value(initial.scale));
|
|
11
44
|
useEffect(() => {
|
|
45
|
+
const values = getAnimationValues(props.moveUp);
|
|
12
46
|
Animated.parallel([Animated.timing(labelPositionX, {
|
|
13
|
-
toValue:
|
|
47
|
+
toValue: values.x,
|
|
14
48
|
duration: 200,
|
|
15
49
|
useNativeDriver: true
|
|
16
50
|
}), Animated.timing(labelPositionY, {
|
|
17
|
-
toValue:
|
|
51
|
+
toValue: values.y,
|
|
18
52
|
duration: 200,
|
|
19
53
|
useNativeDriver: true
|
|
20
54
|
}), Animated.timing(labelScale, {
|
|
21
|
-
toValue:
|
|
55
|
+
toValue: values.scale,
|
|
22
56
|
duration: 200,
|
|
23
57
|
useNativeDriver: true
|
|
24
58
|
})]).start();
|
|
25
59
|
}, [props.moveUp]);
|
|
60
|
+
const outlinedNotchStyle = props.variant != 'filled' && props.moveUp ? {
|
|
61
|
+
backgroundColor: props.labelBackground || 'transparent',
|
|
62
|
+
paddingLeft: 4,
|
|
63
|
+
paddingRight: 4
|
|
64
|
+
} : {};
|
|
65
|
+
const filledWithLeadingIconStyle = props.variant === 'filled' && props.leadingiconclass ? {
|
|
66
|
+
paddingLeft: 8
|
|
67
|
+
} : {};
|
|
26
68
|
return /*#__PURE__*/React.createElement(Animated.View, {
|
|
27
69
|
style: [{
|
|
28
70
|
position: 'absolute',
|
|
29
71
|
zIndex: 1,
|
|
30
|
-
|
|
72
|
+
alignSelf: 'flex-start',
|
|
73
|
+
pointerEvents: 'none',
|
|
31
74
|
transform: [{
|
|
32
75
|
translateY: labelPositionY
|
|
33
76
|
}, {
|
|
@@ -35,10 +78,14 @@ export const FloatingLabel = props => {
|
|
|
35
78
|
}, {
|
|
36
79
|
scale: labelScale
|
|
37
80
|
}]
|
|
38
|
-
}, props.style
|
|
81
|
+
}, props.style, outlinedNotchStyle, filledWithLeadingIconStyle, {
|
|
82
|
+
pointerEvents: 'none'
|
|
83
|
+
}],
|
|
39
84
|
pointerEvents: "none"
|
|
40
85
|
}, /*#__PURE__*/React.createElement(Text, {
|
|
41
|
-
style: Theme.BASE.getTextStyle(props.style),
|
|
86
|
+
style: [Theme.BASE.getTextStyle(props.style), {
|
|
87
|
+
pointerEvents: 'none'
|
|
88
|
+
}],
|
|
42
89
|
ellipsizeMode: "tail"
|
|
43
90
|
}, props.label));
|
|
44
91
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useEffect","useState","Animated","Text","Theme","FloatingLabel","props","_props$style","
|
|
1
|
+
{"version":3,"names":["React","useEffect","useState","Animated","Text","Theme","FloatingLabel","props","_props$style","toNumber","value","fallback","fontSize","style","getAnimationValues","moveUp","hasLeading","leadingiconclass","x","y","scale","variant","initial","labelPositionX","Value","labelPositionY","labelScale","values","parallel","timing","toValue","duration","useNativeDriver","start","outlinedNotchStyle","backgroundColor","labelBackground","paddingLeft","paddingRight","filledWithLeadingIconStyle","createElement","View","position","zIndex","alignSelf","pointerEvents","transform","translateY","translateX","BASE","getTextStyle","ellipsizeMode","label"],"sources":["floatinglabel.component.tsx"],"sourcesContent":["import React, { useEffect, useState } from 'react';\nimport { Animated, TextStyle, Text, ViewStyle} from 'react-native';\n\nimport { Theme } from '@wavemaker/app-rn-runtime/styles/theme';\n\nexport const FloatingLabel = (props: {\n label?: string,\n style?: TextStyle & ViewStyle,\n moveUp: boolean,\n variant?: 'filled' | 'outlined',\n labelBackground?: string;\n leadingiconclass?: string;\n inputHeight?: number;\n }) => {\n const toNumber = (value: unknown, fallback: number) => {\n return typeof value === 'number' ? value : fallback;\n };\n const fontSize = toNumber(props.style?.fontSize, 16);\n\n const getAnimationValues = (moveUp: boolean) => {\n const hasLeading = !!props.leadingiconclass;\n if (!moveUp) {\n return { x: hasLeading ? 28 : 0, y: 0, scale: 1 };\n }\n\n switch (props.variant) {\n case 'filled':\n return { x: hasLeading ? 28 : 0, y: -1 * fontSize * 1, scale: 0.8 };\n case 'outlined':\n return { x: 0, y: -1 * (fontSize + 14), scale: 0.8 }; \n default:\n return { x: 0, y: -1 * (fontSize + 14), scale: 0.8 };\n }\n };\n\n\n\n const initial = getAnimationValues(props.moveUp);\n const [labelPositionX] = useState(new Animated.Value(initial.x));\n const [labelPositionY] = useState(new Animated.Value( initial.y));\n const [labelScale] = useState(new Animated.Value(initial.scale));\n\n useEffect(() => {\n const values = getAnimationValues(props.moveUp);\n Animated.parallel([\n Animated.timing(labelPositionX, {\n toValue: values.x,\n duration: 200,\n useNativeDriver: true,\n }),\n Animated.timing(labelPositionY, {\n toValue: values.y,\n duration: 200,\n useNativeDriver: true,\n }),\n Animated.timing(labelScale, {\n toValue: values.scale,\n duration: 200,\n useNativeDriver: true,\n })\n ]).start();\n }, [props.moveUp]);\n\n const outlinedNotchStyle = (props.variant != 'filled' && props.moveUp) ? {\n backgroundColor: props.labelBackground || 'transparent',\n paddingLeft: 4,\n paddingRight: 4\n } : {};\n\n const filledWithLeadingIconStyle = (props.variant === 'filled' && props.leadingiconclass) ? {\n paddingLeft: 8\n } : {};\n\n return (\n <Animated.View style={[{\n position: 'absolute',\n zIndex: 1,\n alignSelf: 'flex-start',\n pointerEvents: 'none',\n transform: [\n {translateY: labelPositionY},\n {translateX: labelPositionX},\n {scale: labelScale}\n ]},\n props.style,\n outlinedNotchStyle,\n filledWithLeadingIconStyle,\n { pointerEvents: 'none' }\n ]}\n pointerEvents=\"none\">\n <Text\n style={[Theme.BASE.getTextStyle(props.style), { pointerEvents: 'none' }]}\n ellipsizeMode=\"tail\">\n {props.label}\n </Text>\n </Animated.View>\n );\n };\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,SAAS,EAAEC,QAAQ,QAAQ,OAAO;AAClD,SAASC,QAAQ,EAAaC,IAAI,QAAkB,cAAc;AAElE,SAASC,KAAK,QAAQ,wCAAwC;AAE9D,OAAO,MAAMC,aAAa,GAAIC,KAQ3B,IAAK;EAAA,IAAAC,YAAA;EACN,MAAMC,QAAQ,GAAGA,CAACC,KAAc,EAAEC,QAAgB,KAAK;IACrD,OAAO,OAAOD,KAAK,KAAK,QAAQ,GAAGA,KAAK,GAAGC,QAAQ;EACrD,CAAC;EACD,MAAMC,QAAQ,GAAGH,QAAQ,EAAAD,YAAA,GAACD,KAAK,CAACM,KAAK,cAAAL,YAAA,uBAAXA,YAAA,CAAaI,QAAQ,EAAE,EAAE,CAAC;EAEpD,MAAME,kBAAkB,GAAIC,MAAe,IAAK;IAC9C,MAAMC,UAAU,GAAG,CAAC,CAACT,KAAK,CAACU,gBAAgB;IAC3C,IAAI,CAACF,MAAM,EAAE;MACX,OAAO;QAAEG,CAAC,EAAEF,UAAU,GAAG,EAAE,GAAG,CAAC;QAAEG,CAAC,EAAE,CAAC;QAAEC,KAAK,EAAE;MAAE,CAAC;IACnD;IAEA,QAAQb,KAAK,CAACc,OAAO;MACnB,KAAK,QAAQ;QACX,OAAO;UAAEH,CAAC,EAAEF,UAAU,GAAG,EAAE,GAAG,CAAC;UAAEG,CAAC,EAAE,CAAC,CAAC,GAAGP,QAAQ,GAAG,CAAC;UAAEQ,KAAK,EAAE;QAAI,CAAC;MACrE,KAAK,UAAU;QACb,OAAO;UAAEF,CAAC,EAAE,CAAC;UAAEC,CAAC,EAAE,CAAC,CAAC,IAAIP,QAAQ,GAAG,EAAE,CAAC;UAAEQ,KAAK,EAAE;QA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|
|
37
|
-
// TODO: Monika WMS-31071 - Consider these improvements:
|
|
38
|
-
// 1. 'words' mode: Use full Title Case regex: text.replace(/\b\w+/g, word => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase())
|
|
39
|
-
// 2. 'sentences' mode: Add newline handling with regex: /(^|\.\s+|\!\s+|\?\s+|\n\s*)(\w)/g
|
|
40
|
-
// 3. Add TypeScript type for mode: type AutoCapitalizeMode = 'none' | 'sentences' | 'words' | 'characters'
|
|
41
|
-
const applyAutoCapitalize = (text, mode) => {
|
|
42
|
-
switch (mode) {
|
|
43
|
-
case 'characters':
|
|
44
|
-
return text.toUpperCase();
|
|
45
|
-
case 'words':
|
|
46
|
-
return text.replace(/\b\w/g, c => c.toUpperCase());
|
|
47
|
-
case 'sentences':
|
|
48
|
-
return text.replace(/(^\w|[.!?]\s+\w)/g, c => c.toUpperCase());
|
|
49
|
-
default:
|
|
50
|
-
return text;
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
36
|
export const WMTextInput = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
54
37
|
var _props$customDisplayV, _props$floatingLabel;
|
|
55
38
|
const [selectRange, setSelectRange] = useState(null);
|
|
@@ -146,9 +129,12 @@ export const WMTextInput = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
146
129
|
return /*#__PURE__*/React.createElement(React.Fragment, null, props.background, props.floatingLabel ? /*#__PURE__*/React.createElement(FloatingLabel, {
|
|
147
130
|
moveUp: !!(value.current || props.isInputFocused || displayValue),
|
|
148
131
|
label: (_props$floatingLabel = props.floatingLabel) !== null && _props$floatingLabel !== void 0 ? _props$floatingLabel : props.placeholder,
|
|
132
|
+
variant: props.variant,
|
|
133
|
+
labelBackground: props.labelBackground,
|
|
134
|
+
leadingiconclass: props.leadingiconclass,
|
|
149
135
|
style: {
|
|
150
136
|
...(props.floatingLabelStyle || []),
|
|
151
|
-
...(props.isInputFocused ? props.activeFloatingLabelStyle || {} :
|
|
137
|
+
...(props.isInputFocused ? props.activeFloatingLabelStyle || {} : {})
|
|
152
138
|
}
|
|
153
139
|
}) : null, Platform.OS === 'android' && !props.editable ? /*#__PURE__*/React.createElement(Text, _extends({
|
|
154
140
|
style: [props.style, hideInput ? {
|
|
@@ -198,8 +184,8 @@ export const WMTextInput = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
198
184
|
onSelectionChange: onSelectionChange,
|
|
199
185
|
caretHidden: !!(selectRange !== null && selectRange !== void 0 && selectRange.end),
|
|
200
186
|
onChangeText: text => {
|
|
201
|
-
if (
|
|
202
|
-
onChangeText(
|
|
187
|
+
if (props.autoCapitalize && props.autoCapitalize === 'characters') {
|
|
188
|
+
onChangeText(text.toUpperCase());
|
|
203
189
|
return;
|
|
204
190
|
}
|
|
205
191
|
onChangeText(text);
|