@wavemaker-ai/app-rn-runtime 1.0.0-rc.322 → 1.0.0-rc.326
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 +156 -14
- package/components/basic/bottomsheet/bottomsheet.component.js.map +1 -1
- package/components/basic/bottomsheet/bottomsheet.styles.js +0 -3
- package/components/basic/bottomsheet/bottomsheet.styles.js.map +1 -1
- package/components/basic/button/button.component.js +4 -2
- package/components/basic/button/button.component.js.map +1 -1
- package/components/basic/message/message.component.js +1 -0
- package/components/basic/message/message.component.js.map +1 -1
- package/components/basic/progress-circle/progress-circle.component.js +3 -1
- package/components/basic/progress-circle/progress-circle.component.js.map +1 -1
- package/components/basic/search/search.styles.js +8 -3
- package/components/basic/search/search.styles.js.map +1 -1
- package/components/chart/bar-chart/bar-chart.component.js.map +1 -1
- package/components/chart/basechart.component.js +0 -1
- package/components/chart/basechart.component.js.map +1 -1
- package/components/chart/basechart.props.js +1 -0
- package/components/chart/basechart.props.js.map +1 -1
- package/components/chart/bubble-chart/bubble-chart.component.js.map +1 -1
- package/components/chart/line-chart/line-chart.component.js.map +1 -1
- package/components/container/container.component.js +24 -1
- package/components/container/container.component.js.map +1 -1
- package/components/container/container.props.js +7 -0
- package/components/container/container.props.js.map +1 -1
- package/components/container/linearlayout/linearlayoutitem/linearlayoutitem.component.js +25 -1
- package/components/container/linearlayout/linearlayoutitem/linearlayoutitem.component.js.map +1 -1
- package/components/container/linearlayout/linearlayoutitem/linearlayoutitem.props.js +1 -0
- package/components/container/linearlayout/linearlayoutitem/linearlayoutitem.props.js.map +1 -1
- package/components/container/tabs/tabheader/tabheader.component.js +5 -14
- package/components/container/tabs/tabheader/tabheader.component.js.map +1 -1
- package/components/container/tabs/tabheader/tabheader.props.js +0 -2
- package/components/container/tabs/tabheader/tabheader.props.js.map +1 -1
- package/components/container/tabs/tabheader/tabheader.styles.js +1 -43
- package/components/container/tabs/tabheader/tabheader.styles.js.map +1 -1
- package/components/container/tabs/tabs.component.js +2 -6
- package/components/container/tabs/tabs.component.js.map +1 -1
- package/components/container/tabs/tabs.props.js +0 -2
- package/components/container/tabs/tabs.props.js.map +1 -1
- package/components/container/wizard/wizardstep/wizardstep.component.js +22 -3
- package/components/container/wizard/wizardstep/wizardstep.component.js.map +1 -1
- package/components/container/wizard/wizardstep/wizardstep.props.js +2 -0
- package/components/container/wizard/wizardstep/wizardstep.props.js.map +1 -1
- package/components/data/form/form-field/form-field.component.js +2 -0
- package/components/data/form/form-field/form-field.component.js.map +1 -1
- package/components/data/form/form-field/form-field.props.js +2 -0
- package/components/data/form/form-field/form-field.props.js.map +1 -1
- package/components/data/form/form.component.js +4 -1
- package/components/data/form/form.component.js.map +1 -1
- package/components/data/list/list.styles.js +1 -0
- package/components/data/list/list.styles.js.map +1 -1
- package/components/dialogs/dialogcontent/dialogcontent.component.js +2 -1
- package/components/dialogs/dialogcontent/dialogcontent.component.js.map +1 -1
- package/components/input/baseinput/baseinput.component.js +28 -3
- package/components/input/baseinput/baseinput.component.js.map +1 -1
- package/components/input/baseinput/baseinput.props.js +1 -0
- package/components/input/baseinput/baseinput.props.js.map +1 -1
- package/components/input/basenumber/basenumber.component.js +18 -3
- package/components/input/basenumber/basenumber.component.js.map +1 -1
- package/components/input/basenumber/basenumber.props.js +1 -0
- package/components/input/basenumber/basenumber.props.js.map +1 -1
- package/components/input/calendar/calendar.component.js +4 -0
- package/components/input/calendar/calendar.component.js.map +1 -1
- package/components/input/calendar/views/month-view.js +8 -1
- package/components/input/calendar/views/month-view.js.map +1 -1
- package/components/input/checkboxset/checkboxset.component.js +3 -3
- package/components/input/checkboxset/checkboxset.component.js.map +1 -1
- package/components/input/checkboxset/checkboxset.props.js +1 -0
- package/components/input/checkboxset/checkboxset.props.js.map +1 -1
- package/components/input/checkboxset/checkboxset.styles.js +6 -0
- package/components/input/checkboxset/checkboxset.styles.js.map +1 -1
- package/components/input/currency/currency.component.js +1 -0
- package/components/input/currency/currency.component.js.map +1 -1
- package/components/input/currency/currency.styles.js +4 -0
- package/components/input/currency/currency.styles.js.map +1 -1
- package/components/input/number/number.component.js +1 -0
- package/components/input/number/number.component.js.map +1 -1
- package/components/input/number/number.styles.js +4 -0
- package/components/input/number/number.styles.js.map +1 -1
- package/components/input/radioset/radioset.component.js +5 -3
- package/components/input/radioset/radioset.component.js.map +1 -1
- package/components/input/radioset/radioset.props.js +1 -0
- package/components/input/radioset/radioset.props.js.map +1 -1
- package/components/input/radioset/radioset.styles.js +6 -0
- package/components/input/radioset/radioset.styles.js.map +1 -1
- package/components/input/text/text.component.js +14 -3
- package/components/input/text/text.component.js.map +1 -1
- package/components/input/text/text.props.js +1 -0
- package/components/input/text/text.props.js.map +1 -1
- package/components/input/text/text.styles.js +3 -1
- package/components/input/text/text.styles.js.map +1 -1
- package/components/input/textarea/textarea.component.js +3 -2
- package/components/input/textarea/textarea.component.js.map +1 -1
- package/components/input/textarea/textarea.styles.js +4 -0
- package/components/input/textarea/textarea.styles.js.map +1 -1
- package/components/input/toggle/toggle.component.js +4 -13
- package/components/input/toggle/toggle.component.js.map +1 -1
- package/components/input/toggle/toggle.props.js +1 -3
- package/components/input/toggle/toggle.props.js.map +1 -1
- package/components/input/toggle/toggle.styles.js +4 -12
- package/components/input/toggle/toggle.styles.js.map +1 -1
- package/components/navigation/appnavbar/appnavbar.props.js +1 -1
- package/components/navigation/appnavbar/appnavbar.props.js.map +1 -1
- package/components/page/tabbar/tabbar.component.js +3 -2
- package/components/page/tabbar/tabbar.component.js.map +1 -1
- package/core/AppConfig.js.map +1 -1
- package/core/advanced-promise-rejection-tracker.js +1 -2
- package/core/advanced-promise-rejection-tracker.js.map +1 -1
- package/core/auto-layout-host.component.js +8 -2
- package/core/auto-layout-host.component.js.map +1 -1
- package/core/components/floatinglabel.component.js +5 -2
- package/core/components/floatinglabel.component.js.map +1 -1
- package/core/components/textinput.component.js +23 -3
- package/core/components/textinput.component.js.map +1 -1
- package/core/outside-press-handler.js +65 -0
- package/core/outside-press-handler.js.map +1 -0
- package/core/tappable.component.js +109 -15
- package/core/tappable.component.js.map +1 -1
- package/core/viewport.js +13 -8
- package/core/viewport.js.map +1 -1
- package/gestures/carousel-swipe.animation.js +0 -1
- package/gestures/carousel-swipe.animation.js.map +1 -1
- package/npm-shrinkwrap.json +4166 -6251
- package/package-lock.json +4166 -6251
- package/package.json +18 -16
- package/runtime/navigator/drawer.navigator.js +1 -0
- package/runtime/navigator/drawer.navigator.js.map +1 -1
- package/runtime/navigator/stack.navigator.js +16 -1
- package/runtime/navigator/stack.navigator.js.map +1 -1
- package/runtime/services/device/scan-service.js +12 -34
- package/runtime/services/device/scan-service.js.map +1 -1
- package/styles/theme.js +7 -0
- package/styles/theme.js.map +1 -1
- package/styles/theme.variables.js.map +1 -1
- package/components-prism/basic/search/search.component.js +0 -171
- package/components-prism/basic/search/search.component.js.map +0 -1
- package/components-prism/basic/search/search.props.js +0 -13
- package/components-prism/basic/search/search.props.js.map +0 -1
- package/components-prism/basic/search/search.styles.js +0 -115
- package/components-prism/basic/search/search.styles.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["BASE_THEME","defineStyles","DEFAULT_CLASS","registerStyle","themeVariables","addStyle","defaultStyles","root","color","checkedColor","text","group","flexDirection","flexWrap","groupHeaderTitle","backgroundColor","groupHeadingBgColor","fontSize","paddingLeft","paddingRight","lineHeight","fontFamily","baseFont","item","alignContent","marginRight","marginTop","
|
|
1
|
+
{"version":3,"names":["BASE_THEME","defineStyles","DEFAULT_CLASS","registerStyle","themeVariables","addStyle","defaultStyles","root","color","checkedColor","text","group","flexDirection","flexWrap","groupHeaderTitle","backgroundColor","groupHeadingBgColor","fontSize","paddingLeft","paddingRight","lineHeight","fontFamily","baseFont","item","alignContent","marginRight","marginTop","positionright","justifyContent","alignItems","marginLeft","noscrollitem","selectedItem","selectedLabel","radioLabel","alignSelf","labelDefaultColor","skeleton","width","height","borderRadius","uncheckedRadio","borderStyle","borderWidth","borderColor","checkedBorderColor","icon","opacity","checkedRadio","padding","flex","minWidth","maxWidth","checkedDisabledColor"],"sources":["radioset.styles.ts"],"sourcesContent":["import BASE_THEME, { AllStyle } from '@wavemaker-ai/app-rn-runtime/styles/theme';\nimport { BaseStyles, defineStyles } from '@wavemaker-ai/app-rn-runtime/core/base.component';\nimport { WmSkeletonStyles } from '@wavemaker-ai/app-rn-runtime/components/basic/skeleton/skeleton.styles';\nimport { WmIconStyles } from '@wavemaker-ai/app-rn-runtime/components/basic/icon/icon.styles';\n\nexport type WmRadiosetStyles = BaseStyles & {\n group: AllStyle,\n groupHeaderTitle: AllStyle;\n item: AllStyle;\n selectedItem: AllStyle;\n radioLabel: AllStyle;\n skeleton: WmSkeletonStyles;\n uncheckedRadio: WmIconStyles;\n checkedRadio: WmIconStyles;\n};\n\nexport const DEFAULT_CLASS = 'app-radioset';\nBASE_THEME.registerStyle((themeVariables, addStyle) => {\n const defaultStyles: WmRadiosetStyles = defineStyles({\n root: {\n color: themeVariables.checkedColor\n },\n text: {},\n group: {\n flexDirection: 'row',\n flexWrap: 'wrap'\n },\n groupHeaderTitle: {\n backgroundColor: themeVariables.groupHeadingBgColor,\n fontSize: 16,\n paddingLeft: 8,\n paddingRight: 8,\n lineHeight: 40,\n fontFamily: themeVariables.baseFont\n } as AllStyle,\n item: {\n flexDirection: 'row',\n alignContent: 'center',\n marginRight: -20,\n marginTop: 8\n } as AllStyle,\n positionright: {\n flexDirection: 'row-reverse',\n justifyContent: 'space-between',\n alignItems: 'center',\n marginLeft: 10\n } as AllStyle,\n noscrollitem:{\n flexDirection: 'row',\n alignContent: 'center',\n marginTop: 8,\n marginLeft: 16\n } as AllStyle,\n selectedItem: {} as AllStyle,\n selectedLabel: {} as AllStyle,\n radioLabel: {\n alignSelf: 'center',\n fontFamily: themeVariables.baseFont,\n fontSize: 16,\n color: themeVariables.labelDefaultColor,\n marginLeft: 8\n } as AllStyle,\n skeleton: {\n root: {\n width: '100%',\n height: 16,\n borderRadius: 4,\n }\n } as any as WmSkeletonStyles,\n uncheckedRadio: {\n root: {\n width: 20,\n height: 20,\n borderRadius: 10,\n borderStyle: \"solid\",\n borderWidth: 2,\n borderColor: themeVariables.checkedBorderColor,\n },\n text: {},\n icon: {\n opacity: 0,\n }\n } as WmIconStyles,\n checkedRadio : {\n root: {\n width: 20,\n height: 20,\n borderRadius: 10,\n borderStyle: \"solid\",\n borderWidth: 2,\n borderColor: themeVariables.checkedBorderColor,\n },\n text: {\n fontSize: 16\n },\n icon : {\n color: themeVariables.checkedColor,\n padding: 0,\n }\n } as WmIconStyles\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-radioset-input-horizontal', '', {\n root: {\n flex: 1, // Take remaining space after label\n minWidth: 0, // Allow shrinking below intrinsic content size if needed\n maxWidth: '100%' // Prevent overflow\n },\n text: {}\n } as BaseStyles);\n\n addStyle(DEFAULT_CLASS + '-disabled', '', {\n root : {\n color: themeVariables.checkedDisabledColor,\n opacity: 0.8\n }\n });\n});\n"],"mappings":"AAAA,OAAOA,UAAU,MAAoB,2CAA2C;AAChF,SAAqBC,YAAY,QAAQ,kDAAkD;AAe3F,OAAO,MAAMC,aAAa,GAAG,cAAc;AAC3CF,UAAU,CAACG,aAAa,CAAC,CAACC,cAAc,EAAEC,QAAQ,KAAK;EACrD,MAAMC,aAA+B,GAAGL,YAAY,CAAC;IACjDM,IAAI,EAAE;MACJC,KAAK,EAAEJ,cAAc,CAACK;IACxB,CAAC;IACDC,IAAI,EAAE,CAAC,CAAC;IACRC,KAAK,EAAE;MACLC,aAAa,EAAE,KAAK;MACpBC,QAAQ,EAAE;IACZ,CAAC;IACDC,gBAAgB,EAAE;MAChBC,eAAe,EAAEX,cAAc,CAACY,mBAAmB;MACnDC,QAAQ,EAAE,EAAE;MACZC,WAAW,EAAE,CAAC;MACdC,YAAY,EAA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EAAE,EAAE;QAChBE,WAAW,EAAE,OAAO;QACpBC,WAAW,EAAE,CAAC;QACdC,WAAW,EAAExC,cAAc,CAACyC;MAC9B,CAAC;MACDnC,IAAI,EAAE;QACJO,QAAQ,EAAE;MACZ,CAAC;MACD6B,IAAI,EAAG;QACLtC,KAAK,EAAEJ,cAAc,CAACK,YAAY;QAClCwC,OAAO,EAAE;MACX;IACN;EACF,CAAC,CAAC;EAEA5C,QAAQ,CAACH,aAAa,EAAE,EAAE,EAAEI,aAAa,CAAC;;EAE1C;EACAD,QAAQ,CAAC,gCAAgC,EAAE,EAAE,EAAE;IAC7CE,IAAI,EAAE;MACJ2C,IAAI,EAAE,CAAC;MAAE;MACTC,QAAQ,EAAE,CAAC;MAAE;MACbC,QAAQ,EAAE,MAAM,CAAC;IACnB,CAAC;IACD1C,IAAI,EAAE,CAAC;EACT,CAAe,CAAC;EAEhBL,QAAQ,CAACH,aAAa,GAAG,WAAW,EAAE,EAAE,EAAE;IACxCK,IAAI,EAAG;MACLC,KAAK,EAAEJ,cAAc,CAACiD,oBAAoB;MAC1CN,OAAO,EAAE;IACX;EACF,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
|
|
@@ -22,6 +22,14 @@ export default class WmText extends BaseInputComponent {
|
|
|
22
22
|
classes.push(super.getStyleClassName());
|
|
23
23
|
return classes.join(' ');
|
|
24
24
|
}
|
|
25
|
+
onChangeText(text) {
|
|
26
|
+
if (!this.props.uppercase) {
|
|
27
|
+
super.onChangeText(text);
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
const s = text == null ? '' : String(text);
|
|
31
|
+
super.onChangeText(s ? s.toUpperCase() : s);
|
|
32
|
+
}
|
|
25
33
|
renderSkeleton(props) {
|
|
26
34
|
let skeletonWidth, skeletonHeight;
|
|
27
35
|
if (this.props.skeletonwidth == "0") {
|
|
@@ -49,7 +57,7 @@ export default class WmText extends BaseInputComponent {
|
|
|
49
57
|
this.invokeEventCallback('onTrailingiconclick', [this.proxy]);
|
|
50
58
|
}
|
|
51
59
|
renderWidget(props) {
|
|
52
|
-
var _this$state$textValue, _ref, _mergedRoot$padding, _this$theme$getStyle, _this$theme$getStyle2;
|
|
60
|
+
var _this$state$textValue, _ref, _mergedRoot$padding, _mergedRoot$height, _this$theme$getStyle, _this$theme$getStyle2, _props$maxchars;
|
|
53
61
|
let opts = {};
|
|
54
62
|
const valueExpr = Platform.OS === 'web' ? 'value' : 'defaultValue';
|
|
55
63
|
const foundationStyle = this.theme.getStyle('app-input');
|
|
@@ -60,6 +68,7 @@ export default class WmText extends BaseInputComponent {
|
|
|
60
68
|
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
69
|
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
70
|
const hassupportingtext = !!props.hint;
|
|
71
|
+
const inputHeight = (_mergedRoot$height = mergedRoot.height) !== null && _mergedRoot$height !== void 0 ? _mergedRoot$height : mergedRoot.minHeight;
|
|
63
72
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(View, {
|
|
64
73
|
style: this.styles.inputContainer
|
|
65
74
|
}, /*#__PURE__*/React.createElement(WMTextInput, _extends({}, this.getTestPropsForInput(), getAccessibilityProps(AccessibilityWidgetType.TEXT, props), {
|
|
@@ -73,12 +82,14 @@ export default class WmText extends BaseInputComponent {
|
|
|
73
82
|
}
|
|
74
83
|
}, opts, {
|
|
75
84
|
floatingLabel: props.floatinglabel,
|
|
85
|
+
inputheight: typeof inputHeight === 'number' ? inputHeight : undefined,
|
|
76
86
|
floatingLabelStyle: {
|
|
77
87
|
...this.styles.floatingLabel
|
|
78
88
|
},
|
|
79
89
|
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),
|
|
80
90
|
variant: props.variant,
|
|
81
|
-
labelBackground: props.variant
|
|
91
|
+
labelBackground: props.variant != 'filled' ? mergedRoot === null || mergedRoot === void 0 ? void 0 : mergedRoot.backgroundColor : undefined,
|
|
92
|
+
inactiveFloatingLabelStyle: this.styles.inactiveFloatingLabel,
|
|
82
93
|
placeholderTextColor: this.styles.placeholderText.color,
|
|
83
94
|
isInputFocused: this.state.isInputFocused,
|
|
84
95
|
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.
|
|
@@ -91,7 +102,7 @@ export default class WmText extends BaseInputComponent {
|
|
|
91
102
|
displayformat: props.displayformat,
|
|
92
103
|
background: this._background,
|
|
93
104
|
maskchar: props.maskchar,
|
|
94
|
-
maxLength: props.maxchars,
|
|
105
|
+
maxLength: (_props$maxchars = props.maxchars) !== null && _props$maxchars !== void 0 ? _props$maxchars : undefined,
|
|
95
106
|
placeholder: props.placeholder,
|
|
96
107
|
onBlur: this.onBlur.bind(this),
|
|
97
108
|
onFocus: this.onFocus.bind(this),
|
|
@@ -1 +1 @@
|
|
|
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","_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","createElement","Fragment","style","inputContainer","_extends","getTestPropsForInput","TEXT","ref","widgetRef","selectionStart","selectionEnd","cursor","floatingLabel","floatingLabelStyle","activeFloatingLabelStyle","activeFloatingLabel","focused","variant","labelBackground","backgroundColor","undefined","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-ai/app-rn-runtime/core/components/textinput.component';\nimport { BaseInputComponent, BaseInputState } from \"@wavemaker-ai/app-rn-runtime/components/input/baseinput/baseinput.component\";\nimport { isNull } from 'lodash';\nimport { AccessibilityWidgetType, getAccessibilityProps } from '@wavemaker-ai/app-rn-runtime/core/accessibility';\nimport { createSkeleton } from '@wavemaker-ai/app-rn-runtime/components/basic/skeleton/skeleton.component';\nimport WmIcon from '@wavemaker-ai/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\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 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 === 'outlined' ? (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,cA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Input","BaseInputComponent","BaseInputState","isNull","AccessibilityWidgetType","getAccessibilityProps","createSkeleton","WmIcon","WmTextState","WmText","constructor","props","getStyleClassName","classes","state","floatinglabel","push","join","onChangeText","text","uppercase","s","String","toUpperCase","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","_props$maxchars","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","inactiveFloatingLabelStyle","inactiveFloatingLabel","placeholderTextColor","placeholderText","color","isInputFocused","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","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-ai/app-rn-runtime/core/components/textinput.component';\nimport { BaseInputComponent, BaseInputState } from \"@wavemaker-ai/app-rn-runtime/components/input/baseinput/baseinput.component\";\nimport { isNull } from 'lodash';\nimport { AccessibilityWidgetType, getAccessibilityProps } from '@wavemaker-ai/app-rn-runtime/core/accessibility';\nimport { createSkeleton } from '@wavemaker-ai/app-rn-runtime/components/basic/skeleton/skeleton.component';\nimport WmIcon from '@wavemaker-ai/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 onChangeText(text: any) {\n if (!this.props.uppercase) {\n super.onChangeText(text);\n return;\n }\n const s = text == null ? '' : String(text);\n super.onChangeText(s ? s.toUpperCase() : s);\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 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.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 ?? undefined} \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 </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,I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AAI,CAACxC,KAAK,CAAC6B,UAAU,CAAC,IAAI,CAACnC,MAAM,CAACwG,WAAW,EAAE;QAAEU,KAAK,EAAE7E;MAAmB,CAAC,CAAE;MACrFqE,aAAa,EAAC;IAAM,gBAEpB7I,KAAA,CAAA+E,aAAA,CAAClE,MAAM;MACLiI,EAAE,EAAE,IAAI,CAACC,SAAS,CAAC,eAAe,CAAE;MACpCC,IAAI,EAAE,GAAG/H,KAAK,CAAC+H,IAAI,gBAAiB;MACpCC,SAAS,EAAEhI,KAAK,CAACmD,iBAAkB;MACnCjC,MAAM,EAAE,IAAI,CAACA,MAAM,CAACmH,YAAa;MACjCH,UAAU,EAAE,IAAK;MACjBC,KAAK,EAAE,IAAI,CAACtG,iBAAiB,CAACmF,IAAI,CAAC,IAAI;IAAE,CAC1C,CACG,CAEJ,CAAC,EACNtD,iBAAiB,iBACd3E,KAAA,CAAA+E,aAAA,CAAC5E,IAAI,QACDc,KAAK,CAAC2D,IACJ,CAGV,CAAC;EAEL;AACF","ignoreList":[]}
|
|
@@ -10,6 +10,7 @@ export default class WmTextProps extends BaseInputProps {
|
|
|
10
10
|
_defineProperty(this, "skeletonheight", null);
|
|
11
11
|
_defineProperty(this, "skeletonwidth", null);
|
|
12
12
|
_defineProperty(this, "autocapitalize", 'none');
|
|
13
|
+
_defineProperty(this, "uppercase", false);
|
|
13
14
|
_defineProperty(this, "returnkeytype", 'auto');
|
|
14
15
|
_defineProperty(this, "onSubmitEditing", () => {});
|
|
15
16
|
_defineProperty(this, "variant", void 0);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["BaseInputProps","WmTextProps","constructor","args","_defineProperty"],"sources":["text.props.ts"],"sourcesContent":["import BaseInputProps from \"@wavemaker-ai/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,yEAAyE;AAEpG,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,
|
|
1
|
+
{"version":3,"names":["BaseInputProps","WmTextProps","constructor","args","_defineProperty"],"sources":["text.props.ts"],"sourcesContent":["import BaseInputProps from \"@wavemaker-ai/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 uppercase?: boolean = false;\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,yEAAyE;AAEpG,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,oBACV,KAAK;IAAAA,eAAA,wBACe,MAAM;IAAAA,eAAA,0BACnB,MAAM,CAAC,CAAC;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;EAAA;AAKvC","ignoreList":[]}
|
|
@@ -13,7 +13,8 @@ BASE_THEME.registerStyle((themeVariables, addStyle) => {
|
|
|
13
13
|
borderStyle: 'solid',
|
|
14
14
|
borderColor: themeVariables.inputBorderColor,
|
|
15
15
|
backgroundColor: themeVariables.inputBackgroundColor,
|
|
16
|
-
fontFamily: themeVariables.baseFont
|
|
16
|
+
fontFamily: themeVariables.baseFont,
|
|
17
|
+
borderRadius: 6
|
|
17
18
|
},
|
|
18
19
|
text: {
|
|
19
20
|
fontSize: 16
|
|
@@ -60,6 +61,7 @@ BASE_THEME.registerStyle((themeVariables, addStyle) => {
|
|
|
60
61
|
outline: 'none',
|
|
61
62
|
boxShadow: 'none'
|
|
62
63
|
},
|
|
64
|
+
inactiveFloatingLabel: {},
|
|
63
65
|
skeleton: {
|
|
64
66
|
root: {
|
|
65
67
|
width: '100%',
|
|
@@ -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","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","
|
|
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","borderRadius","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","inactiveFloatingLabel","skeleton","width","height","flex","minWidth","maxWidth","inputDisabledBgColor","textAlign","left","floatingLabelColor","activeFloatingLabelColor"],"sources":["text.styles.ts"],"sourcesContent":["import BASE_THEME, { AllStyle, Theme } from '@wavemaker-ai/app-rn-runtime/styles/theme';\nimport { BaseStyles, defineStyles } from '@wavemaker-ai/app-rn-runtime/core/base.component';\nimport { ColorValue } from \"react-native\";\nimport { WmSkeletonStyles } from '@wavemaker-ai/app-rn-runtime/components/basic/skeleton/skeleton.styles';\nimport { WmIconStyles } from '@wavemaker-ai/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 inactiveFloatingLabel: AllStyle;\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 borderRadius: 6,\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 inactiveFloatingLabel: {},\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,2CAA2C;AACvF,SAAqBC,YAAY,QAAQ,kDAAkD;AAqB3F,OAAO,MAAMC,aAAa,GA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cAAc,CAACsD;IACxB,CAAC;IACDzB,mBAAmB,EAAE;MACnBH,KAAK,EAAE1B,cAAc,CAACuD;IACxB;EACF,CAAC,CAAC;EACAtD,QAAQ,CAAC,WAAW,EAAE,EAAE,EAAE;IAC1BE,IAAI,EAAE,CAAC,CAAC;IACRe,IAAI,EAAE,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;IACvBgB,QAAQ,EAAE;MACR1C,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, _this$styles$root3;
|
|
45
|
+
var _this$state$textValue, _this$theme$getStyle, _this$theme$getStyle2, _this$styles$root3, _props$maxchars;
|
|
46
46
|
let opts = {};
|
|
47
47
|
const valueExpr = Platform.OS === 'web' ? 'value' : 'defaultValue';
|
|
48
48
|
const foundationStyle = this.theme.getStyle('app-input');
|
|
@@ -70,10 +70,11 @@ export default class WmTextarea extends BaseInputComponent {
|
|
|
70
70
|
activeFloatingLabelStyle: this.theme.mergeStyle(this.styles.activeFloatingLabel, (_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
71
|
variant: props.variant,
|
|
72
72
|
labelBackground: props.variant === 'outlined' ? (_this$styles$root3 = this.styles.root) === null || _this$styles$root3 === void 0 ? void 0 : _this$styles$root3.backgroundColor : undefined,
|
|
73
|
+
inactiveFloatingLabelStyle: this.styles.inactiveFloatingLabel,
|
|
73
74
|
autoComplete: props.autocomplete ? 'username' : 'off',
|
|
74
75
|
autoFocus: props.autofocus,
|
|
75
76
|
editable: props.disabled || props.readonly ? false : true,
|
|
76
|
-
maxLength: props.maxchars,
|
|
77
|
+
maxLength: (_props$maxchars = props.maxchars) !== null && _props$maxchars !== void 0 ? _props$maxchars : undefined,
|
|
77
78
|
placeholder: props.placeholder || 'Place your text',
|
|
78
79
|
onBlur: this.onBlur.bind(this),
|
|
79
80
|
onFocus: this.onFocus.bind(this),
|
|
@@ -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","_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-ai/app-rn-runtime/components/input/baseinput/baseinput.component';\nimport { WMTextInput } from '@wavemaker-ai/app-rn-runtime/core/components/textinput.component';\nimport { isNull } from 'lodash';\nimport { AccessibilityWidgetType, getAccessibilityProps } from '@wavemaker-ai/app-rn-runtime/core/accessibility';\nimport { createSkeleton } from '@wavemaker-ai/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.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 ]}\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(this.styles.activeFloatingLabel, \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;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MAC/BC,OAAO,EAAE,IAAI,CAACA,OAAO,CAACD,IAAI,CAAC,IAAI,CAAE;MACjCE,UAAU,EAAE,IAAI,CAACA,UAAU,CAACF,IAAI,CAAC,IAAI,CAAE;MACvCG,YAAY,EAAE,IAAI,CAACA,YAAY,CAACH,IAAI,CAAC,IAAI,CAAE;MAC3CI,QAAQ,EAAE,IAAI,CAACC,YAAY,CAACL,IAAI,CAAC,IAAI,CAAE;MACvCM,qBAAqB,EAAE,IAAI,CAACzE,MAAM,CAACsC,IAAI,CAACoC,UAAU,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":[]}
|
|
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","_props$maxchars","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","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-ai/app-rn-runtime/components/input/baseinput/baseinput.component';\nimport { WMTextInput } from '@wavemaker-ai/app-rn-runtime/core/components/textinput.component';\nimport { isNull } from 'lodash';\nimport { AccessibilityWidgetType, getAccessibilityProps } from '@wavemaker-ai/app-rn-runtime/core/accessibility';\nimport { createSkeleton } from '@wavemaker-ai/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.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 ]}\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(this.styles.activeFloatingLabel,\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 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 ?? undefined}\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,6EAA6E;AACpF,SAASC,WAAW,QAAQ,kEAAkE;AAC9F,SAASC,MAAM,QAAQ,QAAQ;AAC/B,SAASC,uBAAuB,EAAEC,qBAAqB,QAAQ,iDAAiD;AAChH,SAASC,cAAc,QAAQ,2EAA2E;AAE1G,OAAO,MAAMC,eAAe,SAASN,cAAc,CAAkB;AAErE,eAAe,MAAMO,UAAU,SAASR,kBAAkB,CAAqD;EAE7GS,WAAWA,CAACC,KAAsB,EAAE;IAClC,KAAK,CAACA,KAAK,EAAEX,aAAa,EAAE,IAAID,eAAe,CAAC,CAAC,EAAE,IAAIS,eAAe,CAAC,CAAC,CAAC;EAC3E;EAEOI,iBAAiBA,CAAA,EAAuB;IAC7C,MAAMC,OAAO,GAAG,EAAE;IAClB,IAAI,IAAI,CAACC,KAAK,CAACH,KAAK,CAACI,aAAa,EAAE;MAClCF,OAAO,CAACG,IAAI,CAAC,yBAAyB,CAAC;IACzC;IACAH,OAAO,CAACG,IAAI,CAAC,KAAK,CAACJ,iBAAiB,CAAC,CAAC,CAAC;IACvC,OAAOC,OAAO,CAACI,IAAI,CAAC,GAAG,CAAC;EAC1B;EAEOC,cAAcA,CAACP,KAAsB,EAAmB;IAC7D,IAAIQ,aAAa,EAAEC,cAAc;IACjC,IAAG,IAAI,CAACT,KAAK,CAACU,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CAAC2D,qBAAsB;MAC9DC,YAAY,EAAExE,KAAK,CAACyE,YAAY,GAAG,UAAU,GAAG,KAAM;MACtDC,SAAS,EAAE1E,KAAK,CAAC2E,SAAU;MAC3BC,QAAQ,EAAE5E,KAAK,CAACwD,QAAQ,IAAIxD,KAAK,CAAC6E,QAAQ,GAAG,KAAK,GAAG,IAAK;MAC1DC,SAAS,GAAArD,eAAA,GAAEzB,KAAK,CAAC+E,QAAQ,cAAAtD,eAAA,cAAAA,eAAA,GAAI4C,SAAU;MACvCW,WAAW,EAAEhF,KAAK,CAACgF,WAAW,IAAI,iBAAkB;MACpDC,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,YAAY,EAAE,IAAI,CAACA,YAAY,CAACH,IAAI,CAAC,IAAI,CAAE;MAC3CI,QAAQ,EAAE,IAAI,CAACC,YAAY,CAACL,IAAI,CAAC,IAAI,CAAE;MACvCM,qBAAqB,EAAE,IAAI,CAAC5E,MAAM,CAACuC,IAAI,CAACsC,UAAU,KAAK,MAAO;MAC9DC,YAAY,EAAE,IAAI,CAACA;IAAa,EACjC,CAAC,EACE1F,KAAK,CAAC+E,QAAQ,IAAI/E,KAAK,CAAC2F,gBAAgB,iBAAK1G,KAAA,CAAAmD,aAAA,CAACjD,IAAI;MAClD+D,KAAK,EAAE,CACL,IAAI,CAACtC,MAAM,CAACgF,QAAQ;IACpB,GACA5F,KAAK,CAAC2F,gBACN,CACJ,CAAC;EACL;AACF","ignoreList":[]}
|
|
@@ -20,6 +20,7 @@ BASE_THEME.registerStyle((themeVariables, addStyle) => {
|
|
|
20
20
|
},
|
|
21
21
|
floatingLabel: {},
|
|
22
22
|
activeFloatingLabel: {},
|
|
23
|
+
inactiveFloatingLabel: {},
|
|
23
24
|
invalid: {
|
|
24
25
|
borderBottomColor: 'red'
|
|
25
26
|
},
|
|
@@ -78,6 +79,9 @@ BASE_THEME.registerStyle((themeVariables, addStyle) => {
|
|
|
78
79
|
},
|
|
79
80
|
activeFloatingLabel: {
|
|
80
81
|
color: themeVariables.activeFloatingLabelColor
|
|
82
|
+
},
|
|
83
|
+
inactiveFloatingLabel: {
|
|
84
|
+
color: themeVariables.floatingLabelColor
|
|
81
85
|
}
|
|
82
86
|
});
|
|
83
87
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["BASE_THEME","defineStyles","ThemeVariables","DEFAULT_CLASS","registerStyle","themeVariables","addStyle","defaultStyles","root","padding","borderWidth","borderStyle","borderColor","inputBorderColor","backgroundColor","inputBackgroundColor","borderRadius","fontFamily","baseFont","minHeight","text","fontSize","textAlignVertical","floatingLabel","activeFloatingLabel","invalid","borderBottomColor","focused","inputFocusBorderColor","placeholderText","color","inputPlaceholderColor","skeleton","width","height","helpText","marginTop","textAlign","INSTANCE","textAreaHelpTextColor","flex","minWidth","maxWidth","inputDisabledBgColor","paddingTop","position","top","left","floatingLabelColor","activeFloatingLabelColor"],"sources":["textarea.styles.ts"],"sourcesContent":["import BASE_THEME, { AllStyle } from '@wavemaker-ai/app-rn-runtime/styles/theme';\nimport { BaseStyles, defineStyles } from '@wavemaker-ai/app-rn-runtime/core/base.component';\nimport { WmSkeletonStyles } from '@wavemaker-ai/app-rn-runtime/components/basic/skeleton/skeleton.styles';\nimport ThemeVariables from '@wavemaker-ai/app-rn-runtime/styles/theme.variables';\n\nexport type WmTextareaStyles = BaseStyles & {\n invalid: AllStyle;\n focused: AllStyle;\n placeholderText: AllStyle;\n floatingLabel: AllStyle;\n activeFloatingLabel: AllStyle;\n skeleton: WmSkeletonStyles;\n helpText:AllStyle;\n};\n\nexport const DEFAULT_CLASS = 'app-textarea';\nBASE_THEME.registerStyle((themeVariables, addStyle) => {\n const defaultStyles: WmTextareaStyles = defineStyles({\n root: {\n padding:12,\n borderWidth:1,\n borderStyle: 'solid',\n borderColor: themeVariables.inputBorderColor,\n backgroundColor: themeVariables.inputBackgroundColor,\n borderRadius: 6,\n fontFamily: themeVariables.baseFont,\n minHeight: 160,\n },\n text: {\n fontSize: 16,\n textAlignVertical: 'top'\n },\n floatingLabel: {},\n activeFloatingLabel: {},\n invalid: {\n borderBottomColor: 'red'\n },\n focused : {\n borderColor: themeVariables.inputFocusBorderColor,\n },\n placeholderText: {\n color: themeVariables.inputPlaceholderColor\n },\n skeleton: {\n root: {\n width: '100%',\n height: 84,\n borderRadius: 4\n }\n } as any as WmSkeletonStyles,\n helpText:{\n marginTop:5,\n textAlign:'right',\n fontSize: 13,\n color: ThemeVariables.INSTANCE.textAreaHelpTextColor\n }\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-textarea-input-horizontal', '', {\n root: {\n flex: 1,\n minWidth: 0, // Allow shrinking below intrinsic content size if needed\n maxWidth: '100%', // Prevent overflow\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 text:{\n paddingTop: 24\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});\n"],"mappings":"AAAA,OAAOA,UAAU,MAAoB,2CAA2C;AAChF,SAAqBC,YAAY,QAAQ,kDAAkD;AAE3F,OAAOC,cAAc,MAAM,qDAAqD;
|
|
1
|
+
{"version":3,"names":["BASE_THEME","defineStyles","ThemeVariables","DEFAULT_CLASS","registerStyle","themeVariables","addStyle","defaultStyles","root","padding","borderWidth","borderStyle","borderColor","inputBorderColor","backgroundColor","inputBackgroundColor","borderRadius","fontFamily","baseFont","minHeight","text","fontSize","textAlignVertical","floatingLabel","activeFloatingLabel","inactiveFloatingLabel","invalid","borderBottomColor","focused","inputFocusBorderColor","placeholderText","color","inputPlaceholderColor","skeleton","width","height","helpText","marginTop","textAlign","INSTANCE","textAreaHelpTextColor","flex","minWidth","maxWidth","inputDisabledBgColor","paddingTop","position","top","left","floatingLabelColor","activeFloatingLabelColor"],"sources":["textarea.styles.ts"],"sourcesContent":["import BASE_THEME, { AllStyle } from '@wavemaker-ai/app-rn-runtime/styles/theme';\nimport { BaseStyles, defineStyles } from '@wavemaker-ai/app-rn-runtime/core/base.component';\nimport { WmSkeletonStyles } from '@wavemaker-ai/app-rn-runtime/components/basic/skeleton/skeleton.styles';\nimport ThemeVariables from '@wavemaker-ai/app-rn-runtime/styles/theme.variables';\n\nexport type WmTextareaStyles = BaseStyles & {\n invalid: AllStyle;\n focused: AllStyle;\n placeholderText: AllStyle;\n floatingLabel: AllStyle;\n activeFloatingLabel: AllStyle;\n inactiveFloatingLabel: AllStyle;\n skeleton: WmSkeletonStyles;\n helpText:AllStyle;\n};\n\nexport const DEFAULT_CLASS = 'app-textarea';\nBASE_THEME.registerStyle((themeVariables, addStyle) => {\n const defaultStyles: WmTextareaStyles = defineStyles({\n root: {\n padding:12,\n borderWidth:1,\n borderStyle: 'solid',\n borderColor: themeVariables.inputBorderColor,\n backgroundColor: themeVariables.inputBackgroundColor,\n borderRadius: 6,\n fontFamily: themeVariables.baseFont,\n minHeight: 160,\n },\n text: {\n fontSize: 16,\n textAlignVertical: 'top'\n },\n floatingLabel: {},\n activeFloatingLabel: {},\n inactiveFloatingLabel: {},\n invalid: {\n borderBottomColor: 'red'\n },\n focused : {\n borderColor: themeVariables.inputFocusBorderColor,\n },\n placeholderText: {\n color: themeVariables.inputPlaceholderColor\n },\n skeleton: {\n root: {\n width: '100%',\n height: 84,\n borderRadius: 4\n }\n } as any as WmSkeletonStyles,\n helpText:{\n marginTop:5,\n textAlign:'right',\n fontSize: 13,\n color: ThemeVariables.INSTANCE.textAreaHelpTextColor\n }\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-textarea-input-horizontal', '', {\n root: {\n flex: 1,\n minWidth: 0, // Allow shrinking below intrinsic content size if needed\n maxWidth: '100%', // Prevent overflow\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 text:{\n paddingTop: 24\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 inactiveFloatingLabel: {\n color: themeVariables.floatingLabelColor\n }\n })\n});\n"],"mappings":"AAAA,OAAOA,UAAU,MAAoB,2CAA2C;AAChF,SAAqBC,YAAY,QAAQ,kDAAkD;AAE3F,OAAOC,cAAc,MAAM,qDAAqD;AAahF,OAAO,MAAMC,aAAa,GAAG,cAAc;AAC3CH,UAAU,CAACI,aAAa,CAAC,CAACC,cAAc,EAAEC,QAAQ,KAAK;EACrD,MAAMC,aAA+B,GAAGN,YAAY,CAAC;IACjDO,IAAI,EAAE;MACJC,OAAO,EAAC,EAAE;MACVC,WAAW,EAAC,CAAC;MACbC,WAAW,EAAE,OAAO;MACpBC,WAAW,EAAEP,cAAc,CAACQ,gBAAgB;MAC5CC,eAAe,EAAET,cAAc,CAACU,oBAAoB;MACpDC,YAAY,EAAE,CAAC;MACfC,UAAU,EAAEZ,cAAc,CAACa,QAAQ;MACnCC,SAAS,EAAE;IACb,CAAC;IACDC,I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B,IAAI,EAAC;MACHyB,UAAU,EAAE;IACd,CAAC;IACDtB,aAAa,EAAE;MACbuB,QAAQ,EAAE,UAAU;MACpBC,GAAG,EAAE,EAAE;MACPC,IAAI,EAAE,EAAE;MACR3B,QAAQ,EAAE,EAAE;MACZU,KAAK,EAAE1B,cAAc,CAAC4C;IACxB,CAAC;IACDzB,mBAAmB,EAAE;MACnBO,KAAK,EAAE1B,cAAc,CAAC6C;IACxB,CAAC;IACDzB,qBAAqB,EAAE;MACrBM,KAAK,EAAE1B,cAAc,CAAC4C;IACxB;EACF,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
|
|
@@ -27,13 +27,6 @@ export default class WmToggle extends BaseComponent {
|
|
|
27
27
|
_defineProperty(this, "animationValue", new Animated.Value(0));
|
|
28
28
|
_defineProperty(this, "scaleValue", new Animated.Value(1));
|
|
29
29
|
}
|
|
30
|
-
componentDidMount() {
|
|
31
|
-
super.componentDidMount();
|
|
32
|
-
const isToggled = this.state.isSwitchOn;
|
|
33
|
-
const toggleIconEnabled = !!unStringify(this.state.props.toggleicon);
|
|
34
|
-
this.animationValue.setValue(isToggled ? 1 : 0);
|
|
35
|
-
this.scaleValue.setValue(toggleIconEnabled ? 1.5 : 1);
|
|
36
|
-
}
|
|
37
30
|
onPropertyChange(name, $new, $old) {
|
|
38
31
|
switch (name) {
|
|
39
32
|
case 'datavalue':
|
|
@@ -72,8 +65,7 @@ export default class WmToggle extends BaseComponent {
|
|
|
72
65
|
const handlesizebounce = Number(this.state.props.handlesizebounce) || 1.6;
|
|
73
66
|
const bounceduration = Number(this.state.props.bounceduration) || 300;
|
|
74
67
|
const slideduration = Number(this.state.props.slideduration) || 300;
|
|
75
|
-
const
|
|
76
|
-
const finalScale = value || toggleIconEnabled ? handlesizeon : handlesizeoff;
|
|
68
|
+
const finalScale = value ? handlesizeon : handlesizeoff;
|
|
77
69
|
Animated.sequence([Animated.timing(this.scaleValue, {
|
|
78
70
|
toValue: handlesizebounce,
|
|
79
71
|
duration: bounceduration,
|
|
@@ -119,12 +111,11 @@ export default class WmToggle extends BaseComponent {
|
|
|
119
111
|
});
|
|
120
112
|
}
|
|
121
113
|
getStatusIcon() {
|
|
122
|
-
|
|
123
|
-
if (toggleIconEnabled) {
|
|
114
|
+
if (this.state.props.toggleIcon) {
|
|
124
115
|
if (this.state.isSwitchOn) {
|
|
125
|
-
return
|
|
116
|
+
return 'wi wi-check';
|
|
126
117
|
} else {
|
|
127
|
-
return
|
|
118
|
+
return 'wi wi-close';
|
|
128
119
|
}
|
|
129
120
|
} else if (this.state.props.showCheckIcon) {
|
|
130
121
|
if (this.state.isSwitchOn) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","TouchableOpacity","Animated","Easing","View","BackgroundComponent","BaseComponent","BaseComponentState","unStringify","validateField","AccessibilityWidgetType","getAccessibilityProps","WmToggleProps","DEFAULT_CLASS","createSkeleton","WmIcon","WmToggleState","constructor","args","_defineProperty","WmToggle","props","Value","componentDidMount","isToggled","state","isSwitchOn","toggleIconEnabled","toggleicon","animationValue","setValue","scaleValue","onPropertyChange","name","$new","$old","value","checkedvalue","updateState","updateDatavalue","datavalue","validate","validationObj","isValid","errorType","onToggleSwitch","oldValue","dataValue","uncheckedvalue","handlesizeon","Number","handlesizeoff","handlesizebounce","bounceduration","slideduration","finalScale","sequence","timing","toValue","duration","useNativeDriver","easing","linear","start","onFieldChange","invokeEventCallback","proxy","setTimeout","onLayoutChange","event","width","nativeEvent","layout","handleLayout","setState","viewWidth","renderSkeleton","theme","styles","skeleton","root","getStatusIcon","selectedicon","unselectedicon","showCheckIcon","renderWidget","classname","getStyleClassName","toggleState","mergeStyle","getStyle","defaultClass","accessibilityProps","TOGGLE","accessible","selected","accessibilitylabel","hint","accessibilityrole","createElement","_extends","onLayout","e","onPress","disabled","readonly","getTestPropsForAction","style","animation","handle","size","backgroundSize","position","backgroundPosition","image","backgroundImage","repeat","backgroundRepeat","transform","translateX","interpolate","inputRange","outputRange","isRTL","scale","iconclass","checkicon","uncheckicon","id","getTestId"],"sources":["toggle.component.tsx"],"sourcesContent":["import React from 'react';\nimport { TouchableOpacity, Animated, Easing, LayoutChangeEvent, View, DimensionValue } from 'react-native';\n\nimport { BackgroundComponent } from '@wavemaker-ai/app-rn-runtime/styles/background.component';\nimport { BaseComponent, BaseComponentState } from '@wavemaker-ai/app-rn-runtime/core/base.component';\nimport { unStringify, validateField} from '@wavemaker-ai/app-rn-runtime/core/utils';\nimport { AccessibilityWidgetType, getAccessibilityProps } from '@wavemaker-ai/app-rn-runtime/core/accessibility';\n\nimport WmToggleProps from './toggle.props';\nimport { DEFAULT_CLASS, WmToggleStyles } from './toggle.styles';\nimport { createSkeleton } from '@wavemaker-ai/app-rn-runtime/components/basic/skeleton/skeleton.component';\nimport WmIcon from '../../basic/icon/icon.component';\n\nexport class WmToggleState extends BaseComponentState<WmToggleProps> {\n isSwitchOn: boolean = false;\n isValid: boolean = true;\n errorType = '';\n viewWidth: number = 0;\n}\n\nexport default class WmToggle extends BaseComponent<WmToggleProps, WmToggleState, WmToggleStyles> {\n\n private animationValue = new Animated.Value(0);\n private scaleValue = new Animated.Value(1);\n\n constructor(props: WmToggleProps) {\n super(props, DEFAULT_CLASS, new WmToggleProps(), new WmToggleState());\n }\n\n componentDidMount(): void {\n super.componentDidMount();\n const isToggled = this.state.isSwitchOn;\n const toggleIconEnabled = !!unStringify(this.state.props.toggleicon);\n this.animationValue.setValue(isToggled? 1 : 0);\n this.scaleValue.setValue(toggleIconEnabled? 1.5: 1);\n }\n\n onPropertyChange(name: string, $new: any, $old: any) {\n switch (name) {\n case 'datavalue':\n let value =\n unStringify($new) ===\n unStringify(this.state.props.checkedvalue, true);\n this.updateState({ isSwitchOn: value } as WmToggleState);\n break;\n }\n }\n\n updateDatavalue(value: any) {\n this.updateState({ props: { datavalue: value }} as WmToggleState);\n }\n\n validate(value: any) {\n const validationObj = validateField(this.state.props, value);\n this.updateState({\n isValid: validationObj.isValid,\n errorType: validationObj.errorType\n } as WmToggleState);\n }\n\n onToggleSwitch(value: any) {\n const oldValue = this.state.props.datavalue;\n this.validate(value);\n this.updateState({ isSwitchOn: value } as WmToggleState);\n const dataValue = value === true ? this.state.props.checkedvalue : this.state.props.uncheckedvalue;\n\n // Convert to number and use || to fallback for empty string, 0, null, undefined, NaN\n const handlesizeon = Number(this.state.props.handlesizeon) || 1.5;\n const handlesizeoff = Number(this.state.props.handlesizeoff) || 1;\n const handlesizebounce = Number(this.state.props.handlesizebounce) || 1.6;\n const bounceduration = Number(this.state.props.bounceduration) || 300;\n const slideduration = Number(this.state.props.slideduration) || 300;\n \n const toggleIconEnabled = !!unStringify(this.state.props.toggleicon);\n const finalScale = value || toggleIconEnabled ? handlesizeon : handlesizeoff;\n \n Animated.sequence([\n Animated.timing(this.scaleValue, {\n toValue: handlesizebounce,\n duration: bounceduration,\n useNativeDriver: true,\n }),\n Animated.timing(this.animationValue, {\n toValue: value ? 1 : 0,\n duration: slideduration,\n easing: Easing.linear,\n useNativeDriver: true,\n }),\n ]).start(() => {\n Animated.timing(this.scaleValue, {\n toValue: finalScale,\n duration: 0,\n useNativeDriver: true,\n }).start();\n });\n // @ts-ignore\n this.updateState({ props: { datavalue: dataValue } },\n ()=> {\n if (!this.props.onFieldChange) {\n this.invokeEventCallback('onChange', [null, this.proxy, dataValue, oldValue]);\n } else {\n this.props.onFieldChange && this.props.onFieldChange('datavalue', dataValue, oldValue);\n }\n setTimeout(() => {\n this.invokeEventCallback('onBlur', [ null, this.proxy ]);\n }, 10);\n\n });\n }\n\n onLayoutChange(event: LayoutChangeEvent){\n let width = event.nativeEvent.layout.width;\n this.handleLayout(event)\n\n this.setState({\n viewWidth: width,\n } as WmToggleState);\n }\n\n public renderSkeleton(props: WmToggleProps): React.ReactNode {\n\n return createSkeleton(this.theme, this.styles.skeleton, {\n ...this.styles.skeleton.root,\n });\n }\n getStatusIcon(){\n const toggleIconEnabled = !!unStringify(this.state.props.toggleicon);\n if(toggleIconEnabled)\n {\n if(this.state.isSwitchOn)\n {\n return this.state.props.selectedicon|| 'wi wi-check'\n }\n else{\n return this.state.props.unselectedicon|| 'wi wi-close'\n }\n }\n else if(this.state.props.showCheckIcon)\n {\n if(this.state.isSwitchOn)\n {\n return 'wi wi-check'\n }\n else{\n return ' '\n }\n }\n else{\n return ''\n }\n }\n\n renderWidget(props: WmToggleProps) {\n const classname = this.getStyleClassName();\n const toggleState = this.state.isSwitchOn ? 'on' : 'off';\n const styles = this.theme.mergeStyle(this.styles, \n this.theme.getStyle(this.defaultClass + '-' + toggleState),\n classname ? this.theme.getStyle(`${classname}.${this.defaultClass}-${toggleState}`) : {});\n const accessibilityProps = getAccessibilityProps(AccessibilityWidgetType.TOGGLE, {\n accessible: props.accessible,\n selected: this.state.isSwitchOn,\n accessibilitylabel: props.accessibilitylabel,\n hint: props.hint,\n accessibilityrole: props.accessibilityrole,\n });\n return (\n <TouchableOpacity\n onLayout={(e) => {\n this.onLayoutChange(e);\n }}\n {...accessibilityProps}\n onPress={() => {\n if (this.props.disabled || this.props.readonly) {\n return;\n }\n // Added setTimeout to smooth animation\n setTimeout(() => {\n this.invokeEventCallback('onFocus', [null, this]);\n this.invokeEventCallback('onTap', [null, this]);\n }, 500);\n this.onToggleSwitch(!this.state.isSwitchOn);\n }}{...this.getTestPropsForAction()}\n style={styles.root}>\n {styles.root.animation && styles.root.animation === 'none' ? (\n <View style={styles.handle}>\n <BackgroundComponent\n size={styles.handle.backgroundSize || 'contain'}\n position={styles.handle.backgroundPosition}\n image={styles.handle.backgroundImage}\n repeat={styles.handle.backgroundRepeat || 'no-repeat'}\n />\n </View>\n ): ( <Animated.View\n style={[\n styles.handle,\n {\n transform: [\n {\n translateX: this.animationValue.interpolate({\n inputRange: [0, 1],\n // TODO Abdullah: add a test case for the below changes. Merging this to expo 52 release branch.\n outputRange: this.isRTL\n ? [0, -1 * (this.state.viewWidth - (this.styles.handle.width as number + 18))]\n : [0, this.state.viewWidth - (this.styles.handle.width as number + 18)],\n }),\n },\n { scale: this.scaleValue }\n ],\n },\n ]}>\n <WmIcon iconclass={this.getStatusIcon()} styles={this.state.isSwitchOn ? this.styles.checkicon : this.styles.uncheckicon} disabled={props.readonly || props.disabled} id={this.getTestId('checkicon')}/>\n <BackgroundComponent\n size={styles.handle.backgroundSize || 'contain'}\n position={styles.handle.backgroundPosition}\n image={styles.handle.backgroundImage}\n repeat={styles.handle.backgroundRepeat || 'no-repeat'}\n />\n </Animated.View>)}\n </TouchableOpacity>\n );\n }\n}\n\n// this.state.props.toggleIcon ? (this.state.isSwitchOn ? 'wi wi-check' : 'wi wi-close') : (this.state.props.showCheckIcon ? (this.state.isSwitchOn ? 'wi wi-check' : '') : '')\n"],"mappings":";;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,gBAAgB,EAAEC,QAAQ,EAAEC,MAAM,EAAqBC,IAAI,QAAwB,cAAc;AAE1G,SAASC,mBAAmB,QAAQ,0DAA0D;AAC9F,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,kDAAkD;AACpG,SAASC,WAAW,EAAEC,aAAa,QAAO,yCAAyC;AACnF,SAASC,uBAAuB,EAAEC,qBAAqB,QAAQ,iDAAiD;AAEhH,OAAOC,aAAa,MAAM,gBAAgB;AAC1C,SAASC,aAAa,QAAwB,iBAAiB;AAC/D,SAASC,cAAc,QAAQ,2EAA2E;AAC1G,OAAOC,MAAM,MAAM,iCAAiC;AAEpD,OAAO,MAAMC,aAAa,SAAST,kBAAkB,CAAgB;EAAAU,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAC,eAAA,qBAC7C,KAAK;IAAAA,eAAA,kBACR,IAAI;IAAAA,eAAA,oBACX,EAAE;IAAAA,eAAA,oBACM,CAAC;EAAA;AACvB;AAEA,eAAe,MAAMC,QAAQ,SAASd,aAAa,CAA+C;EAKhGW,WAAWA,CAACI,KAAoB,EAAE;IAChC,KAAK,CAACA,KAAK,EAAER,aAAa,EAAE,IAAID,aAAa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,MAAM,EAAE,IAAI,CAACrD,KAAK,CAACC,UAAU,GAAG,IAAI,CAACoD,MAAM,CAACgD,SAAS,GAAG,IAAI,CAAChD,MAAM,CAACiD,WAAY;MAACvB,QAAQ,EAAEnF,KAAK,CAACoF,QAAQ,IAAIpF,KAAK,CAACmF,QAAS;MAACwB,EAAE,EAAE,IAAI,CAACC,SAAS,CAAC,WAAW;IAAE,CAAC,CAAC,eACxMjI,KAAA,CAAAmG,aAAA,CAAC9F,mBAAmB;MAClByG,IAAI,EAAEhC,MAAM,CAAC+B,MAAM,CAACE,cAAc,IAAI,SAAU;MAChDC,QAAQ,EAAElC,MAAM,CAAC+B,MAAM,CAACI,kBAAmB;MAC3CC,KAAK,EAAEpC,MAAM,CAAC+B,MAAM,CAACM,eAAgB;MACrCC,MAAM,EAAEtC,MAAM,CAAC+B,MAAM,CAACQ,gBAAgB,IAAI;IAAY,CACvD,CACY,CACD,CAAC;EAEvB;AACF;;AAEA","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["React","TouchableOpacity","Animated","Easing","View","BackgroundComponent","BaseComponent","BaseComponentState","unStringify","validateField","AccessibilityWidgetType","getAccessibilityProps","WmToggleProps","DEFAULT_CLASS","createSkeleton","WmIcon","WmToggleState","constructor","args","_defineProperty","WmToggle","props","Value","onPropertyChange","name","$new","$old","value","state","checkedvalue","updateState","isSwitchOn","updateDatavalue","datavalue","validate","validationObj","isValid","errorType","onToggleSwitch","oldValue","dataValue","uncheckedvalue","handlesizeon","Number","handlesizeoff","handlesizebounce","bounceduration","slideduration","finalScale","sequence","timing","scaleValue","toValue","duration","useNativeDriver","animationValue","easing","linear","start","onFieldChange","invokeEventCallback","proxy","setTimeout","onLayoutChange","event","width","nativeEvent","layout","handleLayout","setState","viewWidth","renderSkeleton","theme","styles","skeleton","root","getStatusIcon","toggleIcon","showCheckIcon","renderWidget","classname","getStyleClassName","toggleState","mergeStyle","getStyle","defaultClass","accessibilityProps","TOGGLE","accessible","selected","accessibilitylabel","hint","accessibilityrole","createElement","_extends","onLayout","e","onPress","disabled","readonly","getTestPropsForAction","style","animation","handle","size","backgroundSize","position","backgroundPosition","image","backgroundImage","repeat","backgroundRepeat","transform","translateX","interpolate","inputRange","outputRange","isRTL","scale","iconclass","checkicon","uncheckicon","id","getTestId"],"sources":["toggle.component.tsx"],"sourcesContent":["import React from 'react';\nimport { TouchableOpacity, Animated, Easing, LayoutChangeEvent, View, DimensionValue } from 'react-native';\n\nimport { BackgroundComponent } from '@wavemaker-ai/app-rn-runtime/styles/background.component';\nimport { BaseComponent, BaseComponentState } from '@wavemaker-ai/app-rn-runtime/core/base.component';\nimport { unStringify, validateField} from '@wavemaker-ai/app-rn-runtime/core/utils';\nimport { AccessibilityWidgetType, getAccessibilityProps } from '@wavemaker-ai/app-rn-runtime/core/accessibility';\n\nimport WmToggleProps from './toggle.props';\nimport { DEFAULT_CLASS, WmToggleStyles } from './toggle.styles';\nimport { createSkeleton } from '@wavemaker-ai/app-rn-runtime/components/basic/skeleton/skeleton.component';\nimport WmIcon from '../../basic/icon/icon.component';\n\nexport class WmToggleState extends BaseComponentState<WmToggleProps> {\n isSwitchOn: boolean = false;\n isValid: boolean = true;\n errorType = '';\n viewWidth: number = 0;\n}\n\nexport default class WmToggle extends BaseComponent<WmToggleProps, WmToggleState, WmToggleStyles> {\n\n private animationValue = new Animated.Value(0);\n private scaleValue = new Animated.Value(1);\n\n constructor(props: WmToggleProps) {\n super(props, DEFAULT_CLASS, new WmToggleProps(), new WmToggleState());\n }\n\n onPropertyChange(name: string, $new: any, $old: any) {\n switch (name) {\n case 'datavalue':\n let value =\n unStringify($new) ===\n unStringify(this.state.props.checkedvalue, true);\n this.updateState({ isSwitchOn: value } as WmToggleState);\n break;\n }\n }\n\n updateDatavalue(value: any) {\n this.updateState({ props: { datavalue: value }} as WmToggleState);\n }\n\n validate(value: any) {\n const validationObj = validateField(this.state.props, value);\n this.updateState({\n isValid: validationObj.isValid,\n errorType: validationObj.errorType\n } as WmToggleState);\n }\n\n onToggleSwitch(value: any) {\n const oldValue = this.state.props.datavalue;\n this.validate(value);\n this.updateState({ isSwitchOn: value } as WmToggleState);\n const dataValue = value === true ? this.state.props.checkedvalue : this.state.props.uncheckedvalue;\n\n // Convert to number and use || to fallback for empty string, 0, null, undefined, NaN\n const handlesizeon = Number(this.state.props.handlesizeon) || 1.5;\n const handlesizeoff = Number(this.state.props.handlesizeoff) || 1;\n const handlesizebounce = Number(this.state.props.handlesizebounce) || 1.6;\n const bounceduration = Number(this.state.props.bounceduration) || 300;\n const slideduration = Number(this.state.props.slideduration) || 300;\n\n const finalScale = value ? handlesizeon : handlesizeoff;\n\n Animated.sequence([\n Animated.timing(this.scaleValue, {\n toValue: handlesizebounce,\n duration: bounceduration,\n useNativeDriver: true,\n }),\n Animated.timing(this.animationValue, {\n toValue: value ? 1 : 0,\n duration: slideduration,\n easing: Easing.linear,\n useNativeDriver: true,\n }),\n ]).start(() => {\n Animated.timing(this.scaleValue, {\n toValue: finalScale,\n duration: 0,\n useNativeDriver: true,\n }).start();\n });\n // @ts-ignore\n this.updateState({ props: { datavalue: dataValue } },\n ()=> {\n if (!this.props.onFieldChange) {\n this.invokeEventCallback('onChange', [null, this.proxy, dataValue, oldValue]);\n } else {\n this.props.onFieldChange && this.props.onFieldChange('datavalue', dataValue, oldValue);\n }\n setTimeout(() => {\n this.invokeEventCallback('onBlur', [ null, this.proxy ]);\n }, 10);\n\n });\n }\n\n onLayoutChange(event: LayoutChangeEvent){\n let width = event.nativeEvent.layout.width;\n this.handleLayout(event)\n\n this.setState({\n viewWidth: width,\n } as WmToggleState);\n }\n\n public renderSkeleton(props: WmToggleProps): React.ReactNode {\n\n return createSkeleton(this.theme, this.styles.skeleton, {\n ...this.styles.skeleton.root,\n });\n }\n getStatusIcon(){\n if(this.state.props.toggleIcon)\n {\n if(this.state.isSwitchOn)\n {\n return 'wi wi-check'\n }\n else{\n return 'wi wi-close'\n }\n }\n else if(this.state.props.showCheckIcon)\n {\n if(this.state.isSwitchOn)\n {\n return 'wi wi-check'\n }\n else{\n return ' '\n }\n }\n else{\n return ''\n }\n }\n\n renderWidget(props: WmToggleProps) {\n const classname = this.getStyleClassName();\n const toggleState = this.state.isSwitchOn ? 'on' : 'off';\n const styles = this.theme.mergeStyle(this.styles, \n this.theme.getStyle(this.defaultClass + '-' + toggleState),\n classname ? this.theme.getStyle(`${classname}.${this.defaultClass}-${toggleState}`) : {});\n const accessibilityProps = getAccessibilityProps(AccessibilityWidgetType.TOGGLE, {\n accessible: props.accessible,\n selected: this.state.isSwitchOn,\n accessibilitylabel: props.accessibilitylabel,\n hint: props.hint,\n accessibilityrole: props.accessibilityrole,\n });\n return (\n <TouchableOpacity\n onLayout={(e) => {\n this.onLayoutChange(e);\n }}\n {...accessibilityProps}\n onPress={() => {\n if (this.props.disabled || this.props.readonly) {\n return;\n }\n // Added setTimeout to smooth animation\n setTimeout(() => {\n this.invokeEventCallback('onFocus', [null, this]);\n this.invokeEventCallback('onTap', [null, this]);\n }, 500);\n this.onToggleSwitch(!this.state.isSwitchOn);\n }}{...this.getTestPropsForAction()}\n style={styles.root}>\n {styles.root.animation && styles.root.animation === 'none' ? (\n <View style={styles.handle}>\n <BackgroundComponent\n size={styles.handle.backgroundSize || 'contain'}\n position={styles.handle.backgroundPosition}\n image={styles.handle.backgroundImage}\n repeat={styles.handle.backgroundRepeat || 'no-repeat'}\n />\n </View>\n ): ( <Animated.View\n style={[\n styles.handle,\n {\n transform: [\n {\n translateX: this.animationValue.interpolate({\n inputRange: [0, 1],\n // TODO Abdullah: add a test case for the below changes. Merging this to expo 52 release branch.\n outputRange: this.isRTL\n ? [0, -1 * (this.state.viewWidth - (this.styles.handle.width as number + 18))]\n : [0, this.state.viewWidth - (this.styles.handle.width as number + 18)],\n }),\n },\n { scale: this.scaleValue }\n ],\n },\n ]}>\n <WmIcon iconclass={this.getStatusIcon()} styles={this.state.isSwitchOn ? this.styles.checkicon : this.styles.uncheckicon} disabled={props.readonly || props.disabled} id={this.getTestId('checkicon')}/>\n <BackgroundComponent\n size={styles.handle.backgroundSize || 'contain'}\n position={styles.handle.backgroundPosition}\n image={styles.handle.backgroundImage}\n repeat={styles.handle.backgroundRepeat || 'no-repeat'}\n />\n </Animated.View>)}\n </TouchableOpacity>\n );\n }\n}\n\n// this.state.props.toggleIcon ? (this.state.isSwitchOn ? 'wi wi-check' : 'wi wi-close') : (this.state.props.showCheckIcon ? (this.state.isSwitchOn ? 'wi wi-check' : '') : '')\n"],"mappings":";;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,gBAAgB,EAAEC,QAAQ,EAAEC,MAAM,EAAqBC,IAAI,QAAwB,cAAc;AAE1G,SAASC,mBAAmB,QAAQ,0DAA0D;AAC9F,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,kDAAkD;AACpG,SAASC,WAAW,EAAEC,aAAa,QAAO,yCAAyC;AACnF,SAASC,uBAAuB,EAAEC,qBAAqB,QAAQ,iDAAiD;AAEhH,OAAOC,aAAa,MAAM,gBAAgB;AAC1C,SAASC,aAAa,QAAwB,iBAAiB;AAC/D,SAASC,cAAc,QAAQ,2EAA2E;AAC1G,OAAOC,MAAM,MAAM,iCAAiC;AAEpD,OAAO,MAAMC,aAAa,SAAST,kBAAkB,CAAgB;EAAAU,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAC,eAAA,qBAC7C,KAAK;IAAAA,eAAA,kBACR,IAAI;IAAAA,eAAA,oBACX,EAAE;IAAAA,eAAA,oBACM,CAAC;EAAA;AACvB;AAEA,eAAe,MAAMC,QAAQ,SAASd,aAAa,CAA+C;EAKhGW,WAAWA,CAACI,KAAoB,EAAE;IAChC,KAAK,CAACA,KAAK,EAAER,aAAa,EAAE,IAAID,aAAa,CAAC,CAAC,EAAE,IAAII,aAAa,CAAC,CAAC,CAAC;IAACG,eAAA,yBAJ/C,IAAIjB,QAAQ,CAACoB,KAAK,CAAC,CAAC,CAAC;IAAAH,eAAA,qBACzB,IAAIjB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,EAAE,CAAC,CAAC,CAAC,GAC5E,CAAC,CAAC,EAAE,IAAI,CAACrC,KAAK,CAAC0C,SAAS,IAAI,IAAI,CAACG,MAAM,CAAC8B,MAAM,CAACtC,KAAK,GAAa,EAAE,CAAC;UAC1E,CAAC;QACH,CAAC,EACD;UAAEqD,KAAK,EAAE,IAAI,CAACnE;QAAW,CAAC;MAE9B,CAAC;IACD,gBACFnD,KAAA,CAAA6F,aAAA,CAAC9E,MAAM;MAACwG,SAAS,EAAE,IAAI,CAAC3C,aAAa,CAAC,CAAE;MAACH,MAAM,EAAE,IAAI,CAAC7C,KAAK,CAACG,UAAU,GAAG,IAAI,CAAC0C,MAAM,CAAC+C,SAAS,GAAG,IAAI,CAAC/C,MAAM,CAACgD,WAAY;MAACvB,QAAQ,EAAE7E,KAAK,CAAC8E,QAAQ,IAAI9E,KAAK,CAAC6E,QAAS;MAACwB,EAAE,EAAE,IAAI,CAACC,SAAS,CAAC,WAAW;IAAE,CAAC,CAAC,eACxM3H,KAAA,CAAA6F,aAAA,CAACxF,mBAAmB;MAClBmG,IAAI,EAAE/B,MAAM,CAAC8B,MAAM,CAACE,cAAc,IAAI,SAAU;MAChDC,QAAQ,EAAEjC,MAAM,CAAC8B,MAAM,CAACI,kBAAmB;MAC3CC,KAAK,EAAEnC,MAAM,CAAC8B,MAAM,CAACM,eAAgB;MACrCC,MAAM,EAAErC,MAAM,CAAC8B,MAAM,CAACQ,gBAAgB,IAAI;IAAY,CACvD,CACY,CACD,CAAC;EAEvB;AACF;;AAEA","ignoreList":[]}
|
|
@@ -23,10 +23,8 @@ export default class WmToggleProps extends BaseProps {
|
|
|
23
23
|
_defineProperty(this, "handlesizebounce", 1.6);
|
|
24
24
|
_defineProperty(this, "bounceduration", 300);
|
|
25
25
|
_defineProperty(this, "slideduration", 300);
|
|
26
|
-
_defineProperty(this, "
|
|
26
|
+
_defineProperty(this, "toggleIcon", false);
|
|
27
27
|
_defineProperty(this, "showCheckIcon", false);
|
|
28
|
-
_defineProperty(this, "selectedicon", void 0);
|
|
29
|
-
_defineProperty(this, "unselectedicon", void 0);
|
|
30
28
|
}
|
|
31
29
|
}
|
|
32
30
|
//# sourceMappingURL=toggle.props.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["BaseProps","WmToggleProps","constructor","args","_defineProperty","undefined"],"sources":["toggle.props.ts"],"sourcesContent":["import {AccessibilityRole} from 'react-native';\nimport { BaseProps } from '@wavemaker-ai/app-rn-runtime/core/base.component';\n\nexport default class WmToggleProps extends BaseProps {\n checkedvalue: any = true;\n uncheckedvalue: any = false;\n datavalue: any;\n readonly? = false;\n onFieldChange: any;\n accessible?: boolean = true;\n accessibilitylabel?: string = undefined;\n hint?: string = undefined;\n accessibilityrole?: AccessibilityRole = \"togglebutton\";\n accessibilitylabelledby?: string = undefined;\n invokeEvent?: Function;\n skeletonheight?: string = null as any;\n skeletonwidth?: string = null as any;\n handlesizeon: number = 1.5;\n handlesizeoff: number = 1;\n handlesizebounce: number = 1.6;\n bounceduration: number = 300;\n slideduration: number = 300;\n
|
|
1
|
+
{"version":3,"names":["BaseProps","WmToggleProps","constructor","args","_defineProperty","undefined"],"sources":["toggle.props.ts"],"sourcesContent":["import {AccessibilityRole} from 'react-native';\nimport { BaseProps } from '@wavemaker-ai/app-rn-runtime/core/base.component';\n\nexport default class WmToggleProps extends BaseProps {\n checkedvalue: any = true;\n uncheckedvalue: any = false;\n datavalue: any;\n readonly? = false;\n onFieldChange: any;\n accessible?: boolean = true;\n accessibilitylabel?: string = undefined;\n hint?: string = undefined;\n accessibilityrole?: AccessibilityRole = \"togglebutton\";\n accessibilitylabelledby?: string = undefined;\n invokeEvent?: Function;\n skeletonheight?: string = null as any;\n skeletonwidth?: string = null as any;\n handlesizeon: number = 1.5;\n handlesizeoff: number = 1;\n handlesizebounce: number = 1.6;\n bounceduration: number = 300;\n slideduration: number = 300;\n toggleIcon?:boolean = false;\n showCheckIcon?:boolean = false;\n}\n"],"mappings":";;;AACA,SAASA,SAAS,QAAQ,kDAAkD;AAE5E,eAAe,MAAMC,aAAa,SAASD,SAAS,CAAC;EAAAE,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAC,eAAA,uBAC/B,IAAI;IAAAA,eAAA,yBACF,KAAK;IAAAA,eAAA;IAAAA,eAAA,mBAEf,KAAK;IAAAA,eAAA;IAAAA,eAAA,qBAEM,IAAI;IAAAA,eAAA,6BACGC,SAAS;IAAAD,eAAA,eACvBC,SAAS;IAAAD,eAAA,4BACe,cAAc;IAAAA,eAAA,kCACnBC,SAAS;IAAAD,eAAA;IAAAA,eAAA,yBAElB,IAAI;IAAAA,eAAA,wBACL,IAAI;IAAAA,eAAA,uBACN,GAAG;IAAAA,eAAA,wBACF,CAAC;IAAAA,eAAA,2BACE,GAAG;IAAAA,eAAA,yBACL,GAAG;IAAAA,eAAA,wBACJ,GAAG;IAAAA,eAAA,qBACL,KAAK;IAAAA,eAAA,wBACF,KAAK;EAAA;AAChC","ignoreList":[]}
|
|
@@ -21,31 +21,23 @@ BASE_THEME.registerStyle((themeVariables, addStyle) => {
|
|
|
21
21
|
backgroundPosition: 'center'
|
|
22
22
|
},
|
|
23
23
|
checkicon: {
|
|
24
|
-
root: {
|
|
25
|
-
minWidth: 0,
|
|
26
|
-
alignSelf: 'center'
|
|
27
|
-
},
|
|
24
|
+
root: {},
|
|
28
25
|
text: {
|
|
29
26
|
fontSize: 16
|
|
30
27
|
},
|
|
31
28
|
icon: {
|
|
32
29
|
color: themeVariables.toggleOnColor,
|
|
33
|
-
padding: 0
|
|
34
|
-
width: 'auto'
|
|
30
|
+
padding: 0
|
|
35
31
|
}
|
|
36
32
|
},
|
|
37
33
|
uncheckicon: {
|
|
38
|
-
root: {
|
|
39
|
-
minWidth: 0,
|
|
40
|
-
alignSelf: 'center'
|
|
41
|
-
},
|
|
34
|
+
root: {},
|
|
42
35
|
text: {
|
|
43
36
|
fontSize: 16
|
|
44
37
|
},
|
|
45
38
|
icon: {
|
|
46
39
|
color: themeVariables.toggleOffColor,
|
|
47
|
-
padding: 0
|
|
48
|
-
width: 'auto'
|
|
40
|
+
padding: 0
|
|
49
41
|
}
|
|
50
42
|
},
|
|
51
43
|
skeleton: {
|