@wavemaker/app-rn-runtime 12.0.0-next.141211 → 12.0.0-next.141214
Sign up to get free protection for your applications and to get access to all the features.
- app-rn-runtime/components/advanced/carousel/carousel.component.js +1 -0
- app-rn-runtime/components/advanced/carousel/carousel.component.js.map +1 -1
- app-rn-runtime/components/basic/audio/audio.component.js +9 -2
- app-rn-runtime/components/basic/audio/audio.component.js.map +1 -1
- app-rn-runtime/components/basic/audio/audio.styles.js +7 -0
- app-rn-runtime/components/basic/audio/audio.styles.js.map +1 -1
- app-rn-runtime/components/basic/custom/custom.component.js +1 -1
- app-rn-runtime/components/basic/custom/custom.component.js.map +1 -1
- app-rn-runtime/components/basic/lottie/lottie.component.js +3 -1
- app-rn-runtime/components/basic/lottie/lottie.component.js.map +1 -1
- app-rn-runtime/components/basic/search/search.component.js +1 -1
- app-rn-runtime/components/basic/search/search.component.js.map +1 -1
- app-rn-runtime/components/basic/search/search.props.js +1 -0
- app-rn-runtime/components/basic/search/search.props.js.map +1 -1
- app-rn-runtime/components/basic/skeleton/skeleton.component.js +2 -0
- app-rn-runtime/components/basic/skeleton/skeleton.component.js.map +1 -1
- app-rn-runtime/components/basic/video/video.component.js +6 -0
- app-rn-runtime/components/basic/video/video.component.js.map +1 -1
- app-rn-runtime/components/basic/video/video.styles.js +7 -1
- app-rn-runtime/components/basic/video/video.styles.js.map +1 -1
- app-rn-runtime/components/container/container.component.js +8 -1
- app-rn-runtime/components/container/container.component.js.map +1 -1
- app-rn-runtime/components/container/container.props.js +1 -0
- app-rn-runtime/components/container/container.props.js.map +1 -1
- app-rn-runtime/components/container/tabs/tabpane/tabpane.props.js +1 -0
- app-rn-runtime/components/container/tabs/tabpane/tabpane.props.js.map +1 -1
- app-rn-runtime/components/container/tabs/tabs.component.js +3 -1
- app-rn-runtime/components/container/tabs/tabs.component.js.map +1 -1
- app-rn-runtime/components/container/wizard/wizardstep/wizardstep.component.js +4 -0
- app-rn-runtime/components/container/wizard/wizardstep/wizardstep.component.js.map +1 -1
- app-rn-runtime/components/data/form/form-field/form-field.component.js +2 -1
- app-rn-runtime/components/data/form/form-field/form-field.component.js.map +1 -1
- app-rn-runtime/components/input/baseinput/baseinput.component.js +46 -10
- app-rn-runtime/components/input/baseinput/baseinput.component.js.map +1 -1
- app-rn-runtime/components/input/basenumber/basenumber.component.js +19 -6
- app-rn-runtime/components/input/basenumber/basenumber.component.js.map +1 -1
- app-rn-runtime/components/input/calendar/calendar.component.js +25 -0
- app-rn-runtime/components/input/calendar/calendar.component.js.map +1 -1
- app-rn-runtime/components/input/calendar/calendar.styles.js +19 -0
- app-rn-runtime/components/input/calendar/calendar.styles.js.map +1 -1
- app-rn-runtime/components/input/checkbox/checkbox.component.js +23 -3
- app-rn-runtime/components/input/checkbox/checkbox.component.js.map +1 -1
- app-rn-runtime/components/input/checkbox/checkbox.styles.js +19 -2
- app-rn-runtime/components/input/checkbox/checkbox.styles.js.map +1 -1
- app-rn-runtime/components/input/chips/chips.component.js +16 -2
- app-rn-runtime/components/input/chips/chips.component.js.map +1 -1
- app-rn-runtime/components/input/chips/chips.styles.js +8 -0
- app-rn-runtime/components/input/chips/chips.styles.js.map +1 -1
- app-rn-runtime/components/input/currency/currency.component.js +14 -4
- app-rn-runtime/components/input/currency/currency.component.js.map +1 -1
- app-rn-runtime/components/input/currency/currency.styles.js +43 -1
- app-rn-runtime/components/input/currency/currency.styles.js.map +1 -1
- app-rn-runtime/components/input/epoch/base-datetime.component.js +26 -5
- app-rn-runtime/components/input/epoch/base-datetime.component.js.map +1 -1
- app-rn-runtime/components/input/epoch/datetime/datetime.props.js +6 -0
- app-rn-runtime/components/input/epoch/datetime/datetime.props.js.map +1 -1
- app-rn-runtime/components/input/epoch/datetime/datetime.styles.js +13 -0
- app-rn-runtime/components/input/epoch/datetime/datetime.styles.js.map +1 -1
- app-rn-runtime/components/input/epoch/wheelpickermodal/date/date-picker-modal.component.js +7 -4
- app-rn-runtime/components/input/epoch/wheelpickermodal/date/date-picker-modal.component.js.map +1 -1
- app-rn-runtime/components/input/epoch/wheelpickermodal/date/date-picker-modal.props.js +3 -0
- app-rn-runtime/components/input/epoch/wheelpickermodal/date/date-picker-modal.props.js.map +1 -1
- app-rn-runtime/components/input/epoch/wheelpickermodal/time/time-picker-modal.component.js +7 -4
- app-rn-runtime/components/input/epoch/wheelpickermodal/time/time-picker-modal.component.js.map +1 -1
- app-rn-runtime/components/input/epoch/wheelpickermodal/time/time-picker-modal.props.js +3 -0
- app-rn-runtime/components/input/epoch/wheelpickermodal/time/time-picker-modal.props.js.map +1 -1
- app-rn-runtime/components/input/number/number.component.js +17 -3
- app-rn-runtime/components/input/number/number.component.js.map +1 -1
- app-rn-runtime/components/input/number/number.styles.js +24 -1
- app-rn-runtime/components/input/number/number.styles.js.map +1 -1
- app-rn-runtime/components/input/radioset/radioset.component.js +12 -7
- app-rn-runtime/components/input/radioset/radioset.component.js.map +1 -1
- app-rn-runtime/components/input/radioset/radioset.props.js +1 -0
- app-rn-runtime/components/input/radioset/radioset.props.js.map +1 -1
- app-rn-runtime/components/input/radioset/radioset.styles.js +6 -0
- app-rn-runtime/components/input/radioset/radioset.styles.js.map +1 -1
- app-rn-runtime/components/input/select/select.component.js +11 -3
- app-rn-runtime/components/input/select/select.component.js.map +1 -1
- app-rn-runtime/components/input/select/select.styles.js +24 -0
- app-rn-runtime/components/input/select/select.styles.js.map +1 -1
- app-rn-runtime/components/input/switch/switch.component.js +13 -3
- app-rn-runtime/components/input/switch/switch.component.js.map +1 -1
- app-rn-runtime/components/input/switch/switch.styles.js +15 -0
- app-rn-runtime/components/input/switch/switch.styles.js.map +1 -1
- app-rn-runtime/components/input/text/text.component.js +5 -2
- app-rn-runtime/components/input/text/text.component.js.map +1 -1
- app-rn-runtime/components/input/text/text.props.js +1 -0
- app-rn-runtime/components/input/text/text.props.js.map +1 -1
- app-rn-runtime/components/input/text/text.styles.js +3 -0
- app-rn-runtime/components/input/text/text.styles.js.map +1 -1
- app-rn-runtime/components/input/textarea/textarea.component.js +3 -1
- app-rn-runtime/components/input/textarea/textarea.component.js.map +1 -1
- app-rn-runtime/components/input/textarea/textarea.styles.js +3 -0
- app-rn-runtime/components/input/textarea/textarea.styles.js.map +1 -1
- app-rn-runtime/components/input/toggle/toggle.component.js +6 -0
- app-rn-runtime/components/input/toggle/toggle.component.js.map +1 -1
- app-rn-runtime/components/input/toggle/toggle.props.js +2 -0
- app-rn-runtime/components/input/toggle/toggle.props.js.map +1 -1
- app-rn-runtime/components/input/toggle/toggle.styles.js +7 -0
- app-rn-runtime/components/input/toggle/toggle.styles.js.map +1 -1
- app-rn-runtime/components/page/content/content.component.js +4 -19
- app-rn-runtime/components/page/content/content.component.js.map +1 -1
- app-rn-runtime/components/page/left-panel/left-panel.component.js +4 -1
- app-rn-runtime/components/page/left-panel/left-panel.component.js.map +1 -1
- app-rn-runtime/components/page/page-content/page-content.component.js +43 -12
- app-rn-runtime/components/page/page-content/page-content.component.js.map +1 -1
- app-rn-runtime/core/AppConfig.js.map +1 -1
- app-rn-runtime/core/base.component.js +31 -5
- app-rn-runtime/core/base.component.js.map +1 -1
- app-rn-runtime/core/components/textinput.component.js +9 -7
- app-rn-runtime/core/components/textinput.component.js.map +1 -1
- app-rn-runtime/core/storage.service.js +15 -0
- app-rn-runtime/core/storage.service.js.map +1 -1
- app-rn-runtime/core/wm-component-tree.js +58 -0
- app-rn-runtime/core/wm-component-tree.js.map +1 -0
- app-rn-runtime/package.json +13 -6
- app-rn-runtime/runtime/App.js +21 -2
- app-rn-runtime/runtime/App.js.map +1 -1
- app-rn-runtime/runtime/App.navigator.js +1 -0
- app-rn-runtime/runtime/App.navigator.js.map +1 -1
- app-rn-runtime/runtime/base-fragment.component.js +18 -0
- app-rn-runtime/runtime/base-fragment.component.js.map +1 -1
- app-rn-runtime/runtime/base-page.component.js +38 -2
- app-rn-runtime/runtime/base-page.component.js.map +1 -1
- app-rn-runtime/runtime/base-partial.component.js +3 -0
- app-rn-runtime/runtime/base-partial.component.js.map +1 -1
- app-rn-runtime/runtime/navigator/drawer.navigator.js +19 -10
- app-rn-runtime/runtime/navigator/drawer.navigator.js.map +1 -1
- app-rn-runtime/runtime/services/app-modal.service.js +4 -4
- app-rn-runtime/runtime/services/app-modal.service.js.map +1 -1
- app-rn-runtime/styles/theme.js +5 -0
- app-rn-runtime/styles/theme.js.map +1 -1
- app-rn-runtime/styles/theme.variables.js +1 -1
- app-rn-runtime/styles/theme.variables.js.map +1 -1
- app-rn-runtime/variables/http.service.js +5 -1
- app-rn-runtime/variables/http.service.js.map +1 -1
- app-rn-runtime/variables/live-variable.js +14 -0
- app-rn-runtime/variables/live-variable.js.map +1 -1
@@ -84,6 +84,30 @@ BASE_THEME.registerStyle((themeVariables, addStyle) => {
|
|
84
84
|
justifyContent: 'center',
|
85
85
|
backgroundColor: 'transparent'
|
86
86
|
}
|
87
|
+
},
|
88
|
+
skeleton: {
|
89
|
+
root: {
|
90
|
+
minWidth: 0,
|
91
|
+
width: 120,
|
92
|
+
height: 16,
|
93
|
+
borderRadius: 4,
|
94
|
+
marginRight: 8,
|
95
|
+
padding: 0
|
96
|
+
}
|
97
|
+
},
|
98
|
+
arrowButtonSkeleton: {
|
99
|
+
root: {
|
100
|
+
width: 24,
|
101
|
+
height: 24,
|
102
|
+
borderRadius: 12
|
103
|
+
}
|
104
|
+
},
|
105
|
+
textSkeleton: {
|
106
|
+
root: {
|
107
|
+
width: 100,
|
108
|
+
height: 16,
|
109
|
+
borderRadius: 8
|
110
|
+
}
|
87
111
|
}
|
88
112
|
});
|
89
113
|
addStyle(DEFAULT_CLASS, '', defaultStyles);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["BASE_THEME","defineStyles","Platform","DEFAULT_CLASS","registerStyle","themeVariables","addStyle","defaultStyles","root","flexDirection","padding","borderWidth","borderStyle","borderColor","inputBorderColor","backgroundColor","inputBackgroundColor","borderRadius","minWidth","alignItems","invalid","borderBottomColor","inputInvalidBorderColor","text","fontSize","fontFamily","baseFont","flex","color","inputTextColor","checkIcon","primaryColor","disabledText","inputDisabledBgColor","modal","height","modalContent","position","width","selectItem","paddingHorizontal","paddingVertical","borderBottomWidth","borderBottomStyle","selecttemBorderColor","lastSelectItem","selectItemText","selectItemTextColor","selectedItem","selectedItemText","placeholderText","inputPlaceholderColor","dropDownContent","arrowButton","paddingTop","paddingBottom","paddingLeft","paddingRight","minHeight","alignSelf","justifyContent","OS","textAlign"],"sources":["select.styles.ts"],"sourcesContent":["import BASE_THEME, {AllStyle} from '@wavemaker/app-rn-runtime/styles/theme';\nimport { BaseStyles, defineStyles } from '@wavemaker/app-rn-runtime/core/base.component';\nimport { WmButtonStyles } from '@wavemaker/app-rn-runtime/components/basic/button/button.styles';\nimport { Platform } from 'react-native';\nimport { WmIconStyles } from '@wavemaker/app-rn-runtime/components/basic/icon/icon.styles';\n\nexport type WmSelectStyles = BaseStyles & {\n arrowButton: WmButtonStyles;\n modal: AllStyle;\n modalContent: AllStyle;\n checkIcon: WmIconStyles;\n selectItem: AllStyle;\n lastSelectItem: AllStyle,\n selectItemText: AllStyle;\n selectedItem: AllStyle;\n selectedItemText: AllStyle;\n dropDownContent: AllStyle;\n disabledText: AllStyle;\n placeholderText: AllStyle;\n invalid: AllStyle;\n};\n\nexport const DEFAULT_CLASS = 'app-select';\nBASE_THEME.registerStyle((themeVariables, addStyle) => {\n const defaultStyles: WmSelectStyles = defineStyles({\n root: {\n flexDirection: 'row',\n padding: 12,\n borderWidth: 1,\n borderStyle: 'solid',\n borderColor: themeVariables.inputBorderColor,\n backgroundColor: themeVariables.inputBackgroundColor,\n borderRadius: 6,\n minWidth: 160,\n alignItems: 'center'\n },\n invalid: {\n borderBottomColor: themeVariables.inputInvalidBorderColor\n },\n text: {\n fontSize: 16,\n fontFamily: themeVariables.baseFont,\n flex: 1,\n color: themeVariables.inputTextColor\n },\n checkIcon: {\n text: {\n fontSize: 24,\n color: themeVariables.primaryColor\n }\n } as WmIconStyles,\n disabledText: {\n backgroundColor : themeVariables.inputDisabledBgColor\n },\n modal: {\n backgroundColor: 'rgba(0, 0, 0, 0.3)',\n height: '100%'\n },\n modalContent: {\n backgroundColor: themeVariables.inputBackgroundColor,\n borderRadius: 6,\n position: 'absolute',\n borderWidth: 1,\n borderStyle: 'solid',\n borderColor: themeVariables.inputBorderColor,\n width: '90%'\n },\n selectItem: {\n width: '100%',\n paddingHorizontal: 16,\n paddingVertical: 8,\n borderBottomWidth: 1,\n borderBottomStyle: 'solid',\n borderBottomColor: themeVariables.selecttemBorderColor,\n flexDirection: 'row',\n alignItems: 'center'\n },\n lastSelectItem: {\n borderBottomWidth: 0\n },\n selectItemText: {\n fontSize: 16,\n fontFamily: themeVariables.baseFont,\n color: themeVariables.selectItemTextColor,\n flex: 1\n },\n selectedItem: {},\n selectedItemText:{},\n placeholderText: {\n color: themeVariables.inputPlaceholderColor\n },\n dropDownContent: {},\n arrowButton: {\n root: {\n borderRadius: 0,\n paddingTop: 6,\n paddingBottom: 6,\n paddingLeft: 6,\n paddingRight: 0,\n minHeight: 0,\n alignItems: 'center',\n alignSelf: 'center',\n justifyContent: 'center',\n backgroundColor: 'transparent'\n }\n } as WmButtonStyles,\n });\n\n addStyle(DEFAULT_CLASS, '', defaultStyles);\n addStyle(DEFAULT_CLASS + '-disabled', '', {\n root : {\n backgroundColor: themeVariables.inputDisabledBgColor\n }\n });\n addStyle(DEFAULT_CLASS + '-rtl', '', Platform.OS==\"web\"?{\n text:{\n textAlign:'right',\n }\n }:{\n text:{\n textAlign:'left',\n }\n });\n});\n"],"mappings":"AAAA,OAAOA,UAAU,MAAkB,wCAAwC;AAC3E,SAAqBC,YAAY,QAAQ,+CAA+C;AAExF,SAASC,QAAQ,QAAQ,cAAc;
|
1
|
+
{"version":3,"names":["BASE_THEME","defineStyles","Platform","DEFAULT_CLASS","registerStyle","themeVariables","addStyle","defaultStyles","root","flexDirection","padding","borderWidth","borderStyle","borderColor","inputBorderColor","backgroundColor","inputBackgroundColor","borderRadius","minWidth","alignItems","invalid","borderBottomColor","inputInvalidBorderColor","text","fontSize","fontFamily","baseFont","flex","color","inputTextColor","checkIcon","primaryColor","disabledText","inputDisabledBgColor","modal","height","modalContent","position","width","selectItem","paddingHorizontal","paddingVertical","borderBottomWidth","borderBottomStyle","selecttemBorderColor","lastSelectItem","selectItemText","selectItemTextColor","selectedItem","selectedItemText","placeholderText","inputPlaceholderColor","dropDownContent","arrowButton","paddingTop","paddingBottom","paddingLeft","paddingRight","minHeight","alignSelf","justifyContent","skeleton","marginRight","arrowButtonSkeleton","textSkeleton","OS","textAlign"],"sources":["select.styles.ts"],"sourcesContent":["import BASE_THEME, {AllStyle} from '@wavemaker/app-rn-runtime/styles/theme';\nimport { BaseStyles, defineStyles } from '@wavemaker/app-rn-runtime/core/base.component';\nimport { WmButtonStyles } from '@wavemaker/app-rn-runtime/components/basic/button/button.styles';\nimport { Platform } from 'react-native';\nimport { WmIconStyles } from '@wavemaker/app-rn-runtime/components/basic/icon/icon.styles';\nimport { WmSkeletonStyles } from '@wavemaker/app-rn-runtime/components/basic/skeleton/skeleton.styles';\n\nexport type WmSelectStyles = BaseStyles & {\n arrowButton: WmButtonStyles;\n modal: AllStyle;\n modalContent: AllStyle;\n checkIcon: WmIconStyles;\n selectItem: AllStyle;\n lastSelectItem: AllStyle,\n selectItemText: AllStyle;\n selectedItem: AllStyle;\n selectedItemText: AllStyle;\n dropDownContent: AllStyle;\n disabledText: AllStyle;\n placeholderText: AllStyle;\n invalid: AllStyle;\n skeleton: WmSkeletonStyles;\n arrowButtonSkeleton: WmSkeletonStyles;\n textSkeleton: WmSkeletonStyles;\n};\n\nexport const DEFAULT_CLASS = 'app-select';\nBASE_THEME.registerStyle((themeVariables, addStyle) => {\n const defaultStyles: WmSelectStyles = defineStyles({\n root: {\n flexDirection: 'row',\n padding: 12,\n borderWidth: 1,\n borderStyle: 'solid',\n borderColor: themeVariables.inputBorderColor,\n backgroundColor: themeVariables.inputBackgroundColor,\n borderRadius: 6,\n minWidth: 160,\n alignItems: 'center'\n },\n invalid: {\n borderBottomColor: themeVariables.inputInvalidBorderColor\n },\n text: {\n fontSize: 16,\n fontFamily: themeVariables.baseFont,\n flex: 1,\n color: themeVariables.inputTextColor\n },\n checkIcon: {\n text: {\n fontSize: 24,\n color: themeVariables.primaryColor\n }\n } as WmIconStyles,\n disabledText: {\n backgroundColor : themeVariables.inputDisabledBgColor\n },\n modal: {\n backgroundColor: 'rgba(0, 0, 0, 0.3)',\n height: '100%'\n },\n modalContent: {\n backgroundColor: themeVariables.inputBackgroundColor,\n borderRadius: 6,\n position: 'absolute',\n borderWidth: 1,\n borderStyle: 'solid',\n borderColor: themeVariables.inputBorderColor,\n width: '90%'\n },\n selectItem: {\n width: '100%',\n paddingHorizontal: 16,\n paddingVertical: 8,\n borderBottomWidth: 1,\n borderBottomStyle: 'solid',\n borderBottomColor: themeVariables.selecttemBorderColor,\n flexDirection: 'row',\n alignItems: 'center'\n },\n lastSelectItem: {\n borderBottomWidth: 0\n },\n selectItemText: {\n fontSize: 16,\n fontFamily: themeVariables.baseFont,\n color: themeVariables.selectItemTextColor,\n flex: 1\n },\n selectedItem: {},\n selectedItemText:{},\n placeholderText: {\n color: themeVariables.inputPlaceholderColor\n },\n dropDownContent: {},\n arrowButton: {\n root: {\n borderRadius: 0,\n paddingTop: 6,\n paddingBottom: 6,\n paddingLeft: 6,\n paddingRight: 0,\n minHeight: 0,\n alignItems: 'center',\n alignSelf: 'center',\n justifyContent: 'center',\n backgroundColor: 'transparent'\n }\n } as WmButtonStyles,\n skeleton: {\n root:{\n minWidth: 0,\n width:120,\n height: 16,\n borderRadius: 4,\n marginRight:8,\n padding:0\n }\n } as any as WmSkeletonStyles,\n arrowButtonSkeleton: {\n root: {\n width: 24,\n height: 24,\n borderRadius: 12 \n }\n } as any as WmSkeletonStyles,\n textSkeleton: {\n root: {\n width: 100,\n height: 16,\n borderRadius: 8 \n }\n } as any as WmSkeletonStyles\n });\n\n addStyle(DEFAULT_CLASS, '', defaultStyles);\n addStyle(DEFAULT_CLASS + '-disabled', '', {\n root : {\n backgroundColor: themeVariables.inputDisabledBgColor\n }\n });\n addStyle(DEFAULT_CLASS + '-rtl', '', Platform.OS==\"web\"?{\n text:{\n textAlign:'right',\n }\n }:{\n text:{\n textAlign:'left',\n }\n });\n});\n"],"mappings":"AAAA,OAAOA,UAAU,MAAkB,wCAAwC;AAC3E,SAAqBC,YAAY,QAAQ,+CAA+C;AAExF,SAASC,QAAQ,QAAQ,cAAc;AAuBvC,OAAO,MAAMC,aAAa,GAAG,YAAY;AACzCH,UAAU,CAACI,aAAa,CAAC,CAACC,cAAc,EAAEC,QAAQ,KAAK;EACrD,MAAMC,aAA6B,GAAGN,YAAY,CAAC;IACjDO,IAAI,EAAE;MACJC,aAAa,EAAE,KAAK;MACpBC,OAAO,EAAE,EAAE;MACXC,WAAW,EAAE,CAAC;MACdC,WAAW,EAAE,OAAO;MACpBC,WAAW,EAAER,cAAc,CAACS,gBAAgB;MAC5CC,eAAe,EAAEV,cAAc,CAACW,oBAAoB;MACpDC,YAAY,EAAE,CAAC;MACfC,QAAQ,EAAE,GAAG;MACbC,UAAU,EAAE;IACd,CAAC;IACDC,OAAO,EAAE;MACPC,iBAAiB,EAAEhB,cAAc,CAACiB;IACpC,CAAC;IACDC,IAAI,EAAE;MACJC,QAAQ,EAAE,EAAE;MACZC,UAAU,EAAEpB,cAAc,CAACqB,QAAQ;MACnCC,IAAI,EAAE,CAAC;MACPC,KAAK,EAAEvB,cAAc,CAACwB;IACxB,CAAC;IACDC,SAAS,EAAE;MACTP,IAAI,EAAE;QACJC,QAAQ,EAAE,EAAE;QACZI,KAAK,EAAEvB,cAAc,CAAC0B;MACxB;IACF,CAAiB;IACjBC,YAAY,EAAE;MACZjB,eAAe,EAAGV,cAAc,CAAC4B;IACnC,CAAC;IACDC,KAAK,EAAE;MACLnB,eAAe,EAAE,oBAAoB;MACrCoB,MAAM,EAAE;IACV,CAAC;IACDC,YAAY,EAAE;MACZrB,eAAe,EAAEV,cAAc,CAACW,oBAAoB;M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Y,EAAE,CAAC;QACf6C,WAAW,EAAC,CAAC;QACbpD,OAAO,EAAC;MACV;IACF,CAA4B;IAC5BqD,mBAAmB,EAAE;MACnBvD,IAAI,EAAE;QACJ8B,KAAK,EAAE,EAAE;QACTH,MAAM,EAAE,EAAE;QACVlB,YAAY,EAAE;MAChB;IACF,CAA4B;IAC5B+C,YAAY,EAAE;MACZxD,IAAI,EAAE;QACJ8B,KAAK,EAAE,GAAG;QACVH,MAAM,EAAE,EAAE;QACVlB,YAAY,EAAE;MAChB;IACF;EACF,CAAC,CAAC;EAEFX,QAAQ,CAACH,aAAa,EAAE,EAAE,EAAEI,aAAa,CAAC;EAC1CD,QAAQ,CAACH,aAAa,GAAG,WAAW,EAAE,EAAE,EAAE;IACtCK,IAAI,EAAG;MACLO,eAAe,EAAEV,cAAc,CAAC4B;IAClC;EACJ,CAAC,CAAC;EACF3B,QAAQ,CAACH,aAAa,GAAG,MAAM,EAAE,EAAE,EAAED,QAAQ,CAAC+D,EAAE,IAAE,KAAK,GAAC;IACtD1C,IAAI,EAAC;MACH2C,SAAS,EAAC;IACZ;EACF,CAAC,GAAC;IACA3C,IAAI,EAAC;MACH2C,SAAS,EAAC;IACZ;EACF,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
|
@@ -8,6 +8,7 @@ import WmIcon from '@wavemaker/app-rn-runtime/components/basic/icon/icon.compone
|
|
8
8
|
import { BaseDatasetComponent, BaseDatasetState } from '../basedataset/basedataset.component';
|
9
9
|
import { Tappable } from '@wavemaker/app-rn-runtime/core/tappable.component';
|
10
10
|
import { AccessibilityWidgetType, getAccessibilityProps } from '@wavemaker/app-rn-runtime/core/accessibility';
|
11
|
+
import { createSkeleton } from '@wavemaker/app-rn-runtime/components/basic/skeleton/skeleton.component';
|
11
12
|
export class WmSwitchState extends BaseDatasetState {}
|
12
13
|
export default class WmSwitch extends BaseDatasetComponent {
|
13
14
|
constructor(props) {
|
@@ -68,17 +69,26 @@ export default class WmSwitch extends BaseDatasetComponent {
|
|
68
69
|
styles: this.styles.loadingIcon,
|
69
70
|
iconclass: item.icon,
|
70
71
|
caption: displayText
|
71
|
-
}) : /*#__PURE__*/React.createElement(View, null,
|
72
|
+
}) : /*#__PURE__*/React.createElement(View, null, this._showSkeleton ? createSkeleton(this.theme, {}, {
|
73
|
+
...this.styles.text,
|
74
|
+
...this.styles.textSkeleton.root
|
75
|
+
}) : /*#__PURE__*/React.createElement(Text, _extends({}, this.getTestPropsForLabel('label' + index), {
|
72
76
|
style: [isSelected ? this.styles.selectedButtonText : this.styles.text, {
|
73
77
|
color: isSelected ? this.styles.selectedButton.color : this.styles.button.color
|
74
78
|
}]
|
75
79
|
}), displayText)));
|
76
80
|
}
|
77
|
-
|
81
|
+
renderItems() {
|
78
82
|
const items = this.state.dataItems;
|
83
|
+
if (this._showSkeleton) {
|
84
|
+
return [{}, {}, {}].map((item, index) => this.renderChild(item, index));
|
85
|
+
}
|
86
|
+
return items && items.length ? items.map((item, index) => this.renderChild(item, index)) : null;
|
87
|
+
}
|
88
|
+
renderWidget(props) {
|
79
89
|
return /*#__PURE__*/React.createElement(View, {
|
80
90
|
style: this.styles.root
|
81
|
-
},
|
91
|
+
}, this.renderItems());
|
82
92
|
}
|
83
93
|
}
|
84
94
|
//# sourceMappingURL=switch.component.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["React","Text","View","isEqual","find","WmSwitchProps","DEFAULT_CLASS","WmIcon","BaseDatasetComponent","BaseDatasetState","Tappable","AccessibilityWidgetType","getAccessibilityProps","WmSwitchState","WmSwitch","constructor","props","onChange","value","oldVal","state","datavalue","validate","datafield","selectedItem","dataItems","item","key","dataObject","updateState","isDefault","invokeEvent","invokeEventCallback","undefined","proxy","onTap","event","getItemKey","renderChild","index","btnClass","length","displayText","displayexp","displayfield","isSelected","createElement","_extends","getTestPropsForAction","accessibilityProps","SWITCH","selected","hint","disabled","bind","styles","button","selectedButton","iconclass","id","getTestId","loadingIcon","icon","caption","getTestPropsForLabel","style","selectedButtonText","
|
1
|
+
{"version":3,"names":["React","Text","View","isEqual","find","WmSwitchProps","DEFAULT_CLASS","WmIcon","BaseDatasetComponent","BaseDatasetState","Tappable","AccessibilityWidgetType","getAccessibilityProps","createSkeleton","WmSwitchState","WmSwitch","constructor","props","onChange","value","oldVal","state","datavalue","validate","datafield","selectedItem","dataItems","item","key","dataObject","updateState","isDefault","invokeEvent","invokeEventCallback","undefined","proxy","onTap","event","getItemKey","renderChild","index","btnClass","length","displayText","displayexp","displayfield","isSelected","createElement","_extends","getTestPropsForAction","accessibilityProps","SWITCH","selected","hint","disabled","bind","styles","button","selectedButton","iconclass","id","getTestId","loadingIcon","icon","caption","_showSkeleton","theme","text","textSkeleton","root","getTestPropsForLabel","style","selectedButtonText","color","renderItems","items","map","renderWidget"],"sources":["switch.component.tsx"],"sourcesContent":["import React, { useRef } from 'react';\nimport {DimensionValue, LayoutChangeEvent, Text, View} from \"react-native\";\nimport { isEqual, find } from 'lodash';\n\nimport WmSwitchProps from './switch.props';\nimport { DEFAULT_CLASS, WmSwitchStyles } from './switch.styles';\nimport WmIcon from '@wavemaker/app-rn-runtime/components/basic/icon/icon.component';\nimport { BaseDatasetComponent, BaseDatasetState } from '../basedataset/basedataset.component';\nimport { Tappable } from '@wavemaker/app-rn-runtime/core/tappable.component';\nimport { AccessibilityWidgetType, getAccessibilityProps } from '@wavemaker/app-rn-runtime/core/accessibility';\nimport { createSkeleton } from '@wavemaker/app-rn-runtime/components/basic/skeleton/skeleton.component';\nimport { WmSkeletonStyles } from '../../basic/skeleton/skeleton.styles';\n\nexport class WmSwitchState extends BaseDatasetState<WmSwitchProps> {}\n\nexport default class WmSwitch extends BaseDatasetComponent<WmSwitchProps, WmSwitchState, WmSwitchStyles> {\n constructor(props: WmSwitchProps) {\n super(props, DEFAULT_CLASS, new WmSwitchProps());\n }\n\n onChange(value: any) {\n if (!value) {\n return;\n }\n const oldVal = this.state.props.datavalue;\n this.validate(value);\n if (value === oldVal) {\n return;\n }\n if (this.state.props.datafield === 'All Fields') {\n const selectedItem = find(this.state.dataItems, (item) => isEqual(item.key, value));\n value = selectedItem && selectedItem.dataObject;\n }\n // @ts-ignore\n this.updateState({props: {datavalue: value}, isDefault: false},\n () => {\n if (!this.props.invokeEvent) {\n this.invokeEventCallback('onChange', [undefined, this.proxy, value, oldVal]);\n }\n });\n }\n\n onTap(event: any, item: any) {\n const value = this.state.props.datafield === 'All Fields' ? this.getItemKey(item.datafield) : item.datafield;\n this.onChange(value);\n this.invokeEventCallback('onTap', [ event, this.proxy ]);\n }\n renderChild(item: any, index: any) {\n let btnClass = 'button';\n const props = this.state.props;\n if(index === 0) {\n btnClass = 'firstButton';\n } else if (index+1 === this.state.dataItems.length) {\n btnClass = 'lastButton';\n }\n const displayText = item.displayexp || item.displayfield;\n const isSelected = this.state.props.datafield === 'All Fields' ? isEqual(props.datavalue, item.datafield) : this.state.props.datavalue === item.datafield;\n return (\n <Tappable\n {...this.getTestPropsForAction('button'+index)}\n accessibilityProps={{...getAccessibilityProps(AccessibilityWidgetType.SWITCH, {selected: isSelected, hint: props?.hint})}}\n onTap={this.state.props.disabled ? undefined : this.onTap.bind(this, null, item)}\n styles={[\n this.styles.button,\n this.styles[btnClass],\n isSelected ? this.styles.selectedButton : null]}\n key={item.key}>\n {this.state.props.iconclass ?\n (<WmIcon\n id={this.getTestId('icon' + index)}\n styles={this.styles.loadingIcon}\n iconclass={item.icon}\n caption={displayText}></WmIcon>)\n : (<View>\n {\n this._showSkeleton ? createSkeleton(this.theme, {} as WmSkeletonStyles, {\n ...this.styles.text,\n ...this.styles.textSkeleton.root\n }) : <Text\n {...this.getTestPropsForLabel('label' + index)}\n style={[ isSelected ? this.styles.selectedButtonText : this.styles.text,\n {color: isSelected ? this.styles.selectedButton.color : this.styles.button.color }]}>\n {displayText}\n </Text>\n }\n </View>)}\n </Tappable>\n );\n };\n\n renderItems() {\n const items = this.state.dataItems;\n if(this._showSkeleton) {\n return [{}, {}, {}].map((item: any, index: any) => this.renderChild(item, index))\n }\n return items && items.length ?\n items.map((item: any, index: any) => this.renderChild(item, index)): null\n }\n\n renderWidget(props: WmSwitchProps) {\n return (<View style={this.styles.root}>\n {this.renderItems()}\n </View>);\n }\n}\n"],"mappings":";AAAA,OAAOA,KAAK,MAAkB,OAAO;AACrC,SAA2CC,IAAI,EAAEC,IAAI,QAAO,cAAc;AAC1E,SAASC,OAAO,EAAEC,IAAI,QAAQ,QAAQ;AAEtC,OAAOC,aAAa,MAAM,gBAAgB;AAC1C,SAASC,aAAa,QAAwB,iBAAiB;AAC/D,OAAOC,MAAM,MAAM,gEAAgE;AACnF,SAASC,oBAAoB,EAAEC,gBAAgB,QAAQ,sCAAsC;AAC7F,SAASC,QAAQ,QAAQ,mDAAmD;AAC5E,SAASC,uBAAuB,EAAEC,qBAAqB,QAAQ,8CAA8C;AAC7G,SAASC,cAAc,QAAQ,wEAAwE;AAGvG,OAAO,MAAMC,aAAa,SAASL,gBAAgB,CAAgB;AAEnE,eAAe,MAAMM,QAAQ,SAASP,oBAAoB,CAA+C;EACvGQ,WAAWA,CAACC,KAAoB,EAAE;IAChC,KAAK,CAACA,KAAK,EAAEX,aAAa,EAAE,IAAID,aAAa,CAAC,CAAC,CAAC;EAClD;EAEAa,QAAQA,CAACC,KAAU,EAAE;IACnB,IAAI,CAACA,KAAK,EAAE;MACV;IACF;IACA,MAAMC,MAAM,GAAG,IAAI,CAACC,KAAK,CAACJ,KAAK,CAACK,SAAS;IACzC,IAAI,CAACC,QAAQ,CAACJ,KAAK,CAAC;IACpB,IAAIA,KAAK,KAAKC,MAAM,EAAE;MACpB;IACF;IACA,IAAI,IAAI,CAACC,KAAK,CAACJ,KAAK,CAACO,SAAS,KAAK,YAAY,EAAE;MAC/C,MAAMC,YAAY,GAAGrB,IAAI,CAAC,IAAI,CAACiB,KAAK,CAACK,SAAS,EAAGC,IAAI,IAAKxB,OAAO,CAACwB,IAAI,CAACC,GAAG,EAAET,KAAK,CAAC,CAAC;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[]}
|
@@ -68,6 +68,21 @@ BASE_THEME.registerStyle((themeVariables, addStyle) => {
|
|
68
68
|
borderTopRightRadius: 18,
|
69
69
|
borderBottomRightRadius: 18,
|
70
70
|
borderRightWidth: 1
|
71
|
+
},
|
72
|
+
skeleton: {
|
73
|
+
root: {
|
74
|
+
width: 64,
|
75
|
+
height: 40,
|
76
|
+
paddingLeft: 16,
|
77
|
+
paddingRight: 16
|
78
|
+
}
|
79
|
+
},
|
80
|
+
textSkeleton: {
|
81
|
+
root: {
|
82
|
+
width: 30,
|
83
|
+
height: 10,
|
84
|
+
borderRadius: 4
|
85
|
+
}
|
71
86
|
}
|
72
87
|
});
|
73
88
|
addStyle(DEFAULT_CLASS, '', defaultStyles);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["BASE_THEME","defineStyles","Platform","DEFAULT_CLASS","registerStyle","themeVariables","addStyle","defaultStyles","root","minHeight","padding","flexDirection","text","fontWeight","fontSize","textTransform","userSelect","loadingIcon","flex","alignSelf","justifyContent","color","listSubTitleColor","button","backgroundColor","switchBgColor","switchTextColor","minWidth","height","paddingLeft","paddingRight","borderTopLeftRadius","borderBottomLeftRadius","borderBottomRightRadius","borderTopRightRadius","borderColor","switchBorderColor","borderWidth","borderRightWidth","fontFamily","baseFont","alignItems","selectedButton","switchActiveTextColor","switchActiveBgColor","selectedButtonText","firstButton","lastButton","OS","borderLeftWidth"],"sources":["switch.styles.ts"],"sourcesContent":["import BASE_THEME, {AllStyle} from '@wavemaker/app-rn-runtime/styles/theme';\nimport { BaseStyles, defineStyles } from '@wavemaker/app-rn-runtime/core/base.component';\nimport {WmIconStyles} from \"@wavemaker/app-rn-runtime/components/basic/icon/icon.styles\";\nimport { Platform } from 'react-native';\n\nexport type WmSwitchStyles = BaseStyles & {\n loadingIcon: WmIconStyles,\n button: AllStyle,\n selectedButton: AllStyle,\n selectedButtonText: AllStyle,\n firstButton: AllStyle,\n lastButton: AllStyle\n};\n\nexport const DEFAULT_CLASS = 'app-switch';\nBASE_THEME.registerStyle((themeVariables, addStyle) => {\n const defaultStyles: WmSwitchStyles = defineStyles<WmSwitchStyles>({\n root: {\n minHeight: 24,\n padding: 4,\n flexDirection: 'row'\n },\n text: {\n fontWeight: '500',\n fontSize: 16,\n textTransform: 'uppercase',\n userSelect: 'none',\n },\n loadingIcon: {\n root: {\n flex: 1,\n alignSelf: 'center',\n justifyContent: 'center',\n fontSize: 16\n },\n text: {\n color: themeVariables.listSubTitleColor\n }\n } as WmIconStyles,\n button: {\n backgroundColor: themeVariables.switchBgColor,\n color: themeVariables.switchTextColor,\n fontSize: 14,\n minWidth: 64,\n height: 40,\n paddingLeft: 16,\n paddingRight: 16,\n borderTopLeftRadius: 0,\n borderBottomLeftRadius: 0,\n borderBottomRightRadius: 0,\n borderTopRightRadius: 0,\n borderColor: themeVariables.switchBorderColor,\n borderWidth: 1,\n borderRightWidth: 0,\n fontWeight: '500',\n fontFamily: themeVariables.baseFont,\n justifyContent: 'center',\n alignItems: 'center'\n } as AllStyle,\n selectedButton: {\n color: themeVariables.switchActiveTextColor,\n backgroundColor: themeVariables.switchActiveBgColor,\n borderColor: themeVariables.switchBorderColor\n } as AllStyle,\n selectedButtonText: {\n fontWeight: '500',\n fontSize: 16,\n textTransform: 'uppercase'\n } as AllStyle,\n firstButton: {\n borderTopLeftRadius: 18,\n borderBottomLeftRadius: 18,\n borderTopRightRadius: 0,\n borderBottomRightRadius: 0\n } as AllStyle,\n lastButton: {\n borderTopLeftRadius: 0,\n borderBottomLeftRadius: 0,\n borderTopRightRadius: 18,\n borderBottomRightRadius: 18,\n borderRightWidth: 1\n } as AllStyle\n });\n\n addStyle(DEFAULT_CLASS, '', defaultStyles);\n addStyle(DEFAULT_CLASS + '-disabled', '', {\n root: {}\n });\n addStyle(DEFAULT_CLASS + '-rtl', '', Platform.OS==\"web\"?{\n firstButton:{\n borderTopLeftRadius: 0,\n borderBottomLeftRadius: 0,\n borderTopRightRadius: 6,\n borderBottomRightRadius: 6,\n borderRightWidth: 1,\n borderLeftWidth: 0\n } ,\n lastButton:{\n borderTopLeftRadius: 6,\n borderBottomLeftRadius: 6,\n borderTopRightRadius: 0,\n borderBottomRightRadius: 0,\n borderRightWidth: 0\n }\n }:{});\n addStyle(DEFAULT_CLASS + '1-rtl', '', Platform.OS==\"web\"?{\n firstButton:{\n borderTopLeftRadius: 0,\n borderBottomLeftRadius: 0,\n borderTopRightRadius: 500,\n borderBottomRightRadius: 500,\n borderRightWidth: 0,\n borderLeftWidth: 1\n } ,\n lastButton:{\n flex: 1,\n borderTopLeftRadius: 500,\n borderBottomLeftRadius: 500,\n borderTopRightRadius: 0,\n borderBottomRightRadius: 0,\n borderRightWidth: 1\n }\n }:{});\n addStyle(DEFAULT_CLASS + '1', '', {\n firstButton: {\n borderTopLeftRadius: 500,\n borderBottomLeftRadius: 500,\n borderTopRightRadius: 0,\n borderBottomRightRadius: 0\n } as AllStyle,\n lastButton: {\n flex: 1,\n borderTopLeftRadius: 0,\n borderBottomLeftRadius: 0,\n borderTopRightRadius: 500,\n borderBottomRightRadius: 500\n } as AllStyle\n } as WmSwitchStyles);\n});\n"],"mappings":"AAAA,OAAOA,UAAU,MAAkB,wCAAwC;AAC3E,SAAqBC,YAAY,QAAQ,+CAA+C;AAExF,SAASC,QAAQ,QAAQ,cAAc;
|
1
|
+
{"version":3,"names":["BASE_THEME","defineStyles","Platform","DEFAULT_CLASS","registerStyle","themeVariables","addStyle","defaultStyles","root","minHeight","padding","flexDirection","text","fontWeight","fontSize","textTransform","userSelect","loadingIcon","flex","alignSelf","justifyContent","color","listSubTitleColor","button","backgroundColor","switchBgColor","switchTextColor","minWidth","height","paddingLeft","paddingRight","borderTopLeftRadius","borderBottomLeftRadius","borderBottomRightRadius","borderTopRightRadius","borderColor","switchBorderColor","borderWidth","borderRightWidth","fontFamily","baseFont","alignItems","selectedButton","switchActiveTextColor","switchActiveBgColor","selectedButtonText","firstButton","lastButton","skeleton","width","textSkeleton","borderRadius","OS","borderLeftWidth"],"sources":["switch.styles.ts"],"sourcesContent":["import BASE_THEME, {AllStyle} from '@wavemaker/app-rn-runtime/styles/theme';\nimport { BaseStyles, defineStyles } from '@wavemaker/app-rn-runtime/core/base.component';\nimport {WmIconStyles} from \"@wavemaker/app-rn-runtime/components/basic/icon/icon.styles\";\nimport { Platform } from 'react-native';\nimport { WmSkeletonStyles } from '@wavemaker/app-rn-runtime/components/basic/skeleton/skeleton.styles';\n\nexport type WmSwitchStyles = BaseStyles & {\n loadingIcon: WmIconStyles,\n button: AllStyle,\n selectedButton: AllStyle,\n selectedButtonText: AllStyle,\n firstButton: AllStyle,\n lastButton: AllStyle,\n skeleton: WmSkeletonStyles,\n textSkeleton: WmSkeletonStyles\n};\n\nexport const DEFAULT_CLASS = 'app-switch';\nBASE_THEME.registerStyle((themeVariables, addStyle) => {\n const defaultStyles: WmSwitchStyles = defineStyles<WmSwitchStyles>({\n root: {\n minHeight: 24,\n padding: 4,\n flexDirection: 'row'\n },\n text: {\n fontWeight: '500',\n fontSize: 16,\n textTransform: 'uppercase',\n userSelect: 'none',\n },\n loadingIcon: {\n root: {\n flex: 1,\n alignSelf: 'center',\n justifyContent: 'center',\n fontSize: 16\n },\n text: {\n color: themeVariables.listSubTitleColor\n }\n } as WmIconStyles,\n button: {\n backgroundColor: themeVariables.switchBgColor,\n color: themeVariables.switchTextColor,\n fontSize: 14,\n minWidth: 64,\n height: 40,\n paddingLeft: 16,\n paddingRight: 16,\n borderTopLeftRadius: 0,\n borderBottomLeftRadius: 0,\n borderBottomRightRadius: 0,\n borderTopRightRadius: 0,\n borderColor: themeVariables.switchBorderColor,\n borderWidth: 1,\n borderRightWidth: 0,\n fontWeight: '500',\n fontFamily: themeVariables.baseFont,\n justifyContent: 'center',\n alignItems: 'center'\n } as AllStyle,\n selectedButton: {\n color: themeVariables.switchActiveTextColor,\n backgroundColor: themeVariables.switchActiveBgColor,\n borderColor: themeVariables.switchBorderColor\n } as AllStyle,\n selectedButtonText: {\n fontWeight: '500',\n fontSize: 16,\n textTransform: 'uppercase'\n } as AllStyle,\n firstButton: {\n borderTopLeftRadius: 18,\n borderBottomLeftRadius: 18,\n borderTopRightRadius: 0,\n borderBottomRightRadius: 0\n } as AllStyle,\n lastButton: {\n borderTopLeftRadius: 0,\n borderBottomLeftRadius: 0,\n borderTopRightRadius: 18,\n borderBottomRightRadius: 18,\n borderRightWidth: 1\n } as AllStyle,\n skeleton: {\n root: {\n width:64,\n height: 40,\n paddingLeft: 16,\n paddingRight: 16,\n },\n } as any as WmSkeletonStyles,\n textSkeleton: {\n root: {\n width: 30,\n height: 10,\n borderRadius: 4\n }\n } as any as WmSkeletonStyles\n });\n\n addStyle(DEFAULT_CLASS, '', defaultStyles);\n addStyle(DEFAULT_CLASS + '-disabled', '', {\n root: {}\n });\n addStyle(DEFAULT_CLASS + '-rtl', '', Platform.OS==\"web\"?{\n firstButton:{\n borderTopLeftRadius: 0,\n borderBottomLeftRadius: 0,\n borderTopRightRadius: 6,\n borderBottomRightRadius: 6,\n borderRightWidth: 1,\n borderLeftWidth: 0\n } ,\n lastButton:{\n borderTopLeftRadius: 6,\n borderBottomLeftRadius: 6,\n borderTopRightRadius: 0,\n borderBottomRightRadius: 0,\n borderRightWidth: 0\n }\n }:{});\n addStyle(DEFAULT_CLASS + '1-rtl', '', Platform.OS==\"web\"?{\n firstButton:{\n borderTopLeftRadius: 0,\n borderBottomLeftRadius: 0,\n borderTopRightRadius: 500,\n borderBottomRightRadius: 500,\n borderRightWidth: 0,\n borderLeftWidth: 1\n } ,\n lastButton:{\n flex: 1,\n borderTopLeftRadius: 500,\n borderBottomLeftRadius: 500,\n borderTopRightRadius: 0,\n borderBottomRightRadius: 0,\n borderRightWidth: 1\n }\n }:{});\n addStyle(DEFAULT_CLASS + '1', '', {\n firstButton: {\n borderTopLeftRadius: 500,\n borderBottomLeftRadius: 500,\n borderTopRightRadius: 0,\n borderBottomRightRadius: 0\n } as AllStyle,\n lastButton: {\n flex: 1,\n borderTopLeftRad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mB,CAAC;AACtB,CAAC,CAAC","ignoreList":[]}
|
@@ -60,13 +60,15 @@ export default class WmText extends BaseInputComponent {
|
|
60
60
|
floatingLabelStyle: this.styles.floatingLabel,
|
61
61
|
activeFloatingLabelStyle: this.styles.activeFloatingLabel,
|
62
62
|
placeholderTextColor: this.styles.placeholderText.color,
|
63
|
-
|
63
|
+
isInputFocused: this.state.isInputFocused,
|
64
|
+
style: [this.styles.root, this.styles.text, this.state.isValid ? {} : this.styles.invalid, this.state.isInputFocused ? this.styles.focused : {}],
|
64
65
|
keyboardType: this.state.keyboardType,
|
65
66
|
autoComplete: props.autocomplete ? 'username' : 'off',
|
66
67
|
autoFocus: props.autofocus,
|
67
68
|
editable: props.disabled || props.readonly ? false : true,
|
68
69
|
secureTextEntry: props.type === 'password' && !props.maskchar ? true : false,
|
69
70
|
displayformat: props.displayformat,
|
71
|
+
background: this._background,
|
70
72
|
maskchar: props.maskchar,
|
71
73
|
maxLength: props.maxchars,
|
72
74
|
placeholder: props.placeholder,
|
@@ -75,7 +77,8 @@ export default class WmText extends BaseInputComponent {
|
|
75
77
|
onKeyPress: this.onKeyPress.bind(this),
|
76
78
|
onChangeText: this.onChangeText.bind(this),
|
77
79
|
onChange: this.invokeChange.bind(this),
|
78
|
-
allowContentSelection: this.styles.text.userSelect === 'text'
|
80
|
+
allowContentSelection: this.styles.text.userSelect === 'text',
|
81
|
+
autoCapitalize: props.autocapitalize
|
79
82
|
}));
|
80
83
|
}
|
81
84
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["React","Platform","WmTextProps","DEFAULT_CLASS","WMTextInput","BaseInputComponent","BaseInputState","isNull","AccessibilityWidgetType","getAccessibilityProps","createSkeleton","WmTextState","WmText","constructor","props","getStyleClassName","classes","state","floatinglabel","push","join","renderSkeleton","skeletonWidth","skeletonHeight","skeletonwidth","_this$styles$root","styles","root","width","skeletonheight","_this$styles$root2","height","theme","skeleton","renderWidget","_this$state$textValue","opts","valueExpr","OS","textValue","toString","createElement","_extends","getTestPropsForInput","TEXT","ref","widgetRef","selectionStart","selectionEnd","cursor","floatingLabel","floatingLabelStyle","activeFloatingLabelStyle","activeFloatingLabel","placeholderTextColor","placeholderText","color","style","text","isValid","invalid","keyboardType","autoComplete","autocomplete","autoFocus","autofocus","editable","disabled","readonly","secureTextEntry","type","maskchar","displayformat","maxLength","maxchars","placeholder","onBlur","bind","onFocus","onKeyPress","onChangeText","onChange","invokeChange","allowContentSelection","userSelect"],"sources":["text.component.tsx"],"sourcesContent":["import React from 'react';\nimport { DimensionValue, Platform } from 'react-native';\n\nimport WmTextProps from './text.props';\nimport { DEFAULT_CLASS, WmTextStyles } from './text.styles';\nimport { WMTextInput } from '@wavemaker/app-rn-runtime/core/components/textinput.component';\nimport { BaseInputComponent, BaseInputState } from \"@wavemaker/app-rn-runtime/components/input/baseinput/baseinput.component\";\nimport { isNull } from 'lodash';\nimport { AccessibilityWidgetType, getAccessibilityProps } from '@wavemaker/app-rn-runtime/core/accessibility'; \nimport { createSkeleton } from '@wavemaker/app-rn-runtime/components/basic/skeleton/skeleton.component';\n\nexport class WmTextState extends BaseInputState<WmTextProps> {\n}\n\nexport default class WmText extends BaseInputComponent<WmTextProps, WmTextState, WmTextStyles> {\n\n constructor(props: WmTextProps) {\n super(props, DEFAULT_CLASS, new WmTextProps(), new WmTextState());\n }\n\n public getStyleClassName(): string | undefined {\n const classes = [];\n if (this.state.props.floatinglabel) {\n classes.push('app-text-with-label'); \n }\n classes.push(super.getStyleClassName());\n return classes.join(' ');\n }\n\n public renderSkeleton(props: WmTextProps): React.ReactNode { \n let skeletonWidth, skeletonHeight;\n \n if(this.props.skeletonwidth == \"0\") {\n skeletonWidth = 0\n } else {\n skeletonWidth = this.props.skeletonwidth || this.styles.root?.width\n }\n\n if(this.props.skeletonheight == \"0\") {\n skeletonHeight = 0\n } else {\n skeletonHeight = this.props.skeletonheight || this.styles.root?.height;\n }\n\n return createSkeleton(this.theme, this.styles.skeleton, {\n ...this.styles.root,\n width: skeletonWidth as DimensionValue,\n height: skeletonHeight as DimensionValue\n })\n }\n\n renderWidget(props: WmTextProps) {\n let opts: any = {};\n const valueExpr = Platform.OS === 'web' ? 'value' : 'defaultValue';\n opts[valueExpr] = this.state.textValue?.toString() || '';\n return (\n <WMTextInput\n {...this.getTestPropsForInput()}\n {...getAccessibilityProps(\n AccessibilityWidgetType.TEXT,\n props\n )}\n ref={(ref: any) => {this.widgetRef = ref;\n // @ts-ignore\n if (ref && !isNull(ref.selectionStart) && !isNull(ref.selectionEnd)) {\n // @ts-ignore\n ref.selectionStart = ref.selectionEnd = this.cursor;\n }}}\n {...opts}\n floatingLabel={props.floatinglabel}\n floatingLabelStyle={this.styles.floatingLabel}\n activeFloatingLabelStyle={this.styles.activeFloatingLabel}\n placeholderTextColor={this.styles.placeholderText.color as any}\n style={[this.styles.root, this.styles.text, this.state.isValid ? {} : this.styles.invalid]}\n keyboardType={this.state.keyboardType}\n autoComplete={props.autocomplete ? 'username' : 'off'}\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 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 />\n );\n }\n}\n"],"mappings":";AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAAyBC,QAAQ,QAAQ,cAAc;AAEvD,OAAOC,WAAW,MAAM,cAAc;AACtC,SAASC,aAAa,QAAsB,eAAe;AAC3D,SAASC,WAAW,QAAQ,+DAA+D;AAC3F,SAASC,kBAAkB,EAAEC,cAAc,QAAQ,0EAA0E;AAC7H,SAASC,MAAM,QAAQ,QAAQ;AAC/B,SAASC,uBAAuB,EAAEC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DC,KAAK,EAAE,CAAC,IAAI,
|
1
|
+
{"version":3,"names":["React","Platform","WmTextProps","DEFAULT_CLASS","WMTextInput","BaseInputComponent","BaseInputState","isNull","AccessibilityWidgetType","getAccessibilityProps","createSkeleton","WmTextState","WmText","constructor","props","getStyleClassName","classes","state","floatinglabel","push","join","renderSkeleton","skeletonWidth","skeletonHeight","skeletonwidth","_this$styles$root","styles","root","width","skeletonheight","_this$styles$root2","height","theme","skeleton","renderWidget","_this$state$textValue","opts","valueExpr","OS","textValue","toString","createElement","_extends","getTestPropsForInput","TEXT","ref","widgetRef","selectionStart","selectionEnd","cursor","floatingLabel","floatingLabelStyle","activeFloatingLabelStyle","activeFloatingLabel","placeholderTextColor","placeholderText","color","isInputFocused","style","text","isValid","invalid","focused","keyboardType","autoComplete","autocomplete","autoFocus","autofocus","editable","disabled","readonly","secureTextEntry","type","maskchar","displayformat","background","_background","maxLength","maxchars","placeholder","onBlur","bind","onFocus","onKeyPress","onChangeText","onChange","invokeChange","allowContentSelection","userSelect","autoCapitalize","autocapitalize"],"sources":["text.component.tsx"],"sourcesContent":["import React from 'react';\nimport { DimensionValue, Platform } from 'react-native';\n\nimport WmTextProps from './text.props';\nimport { DEFAULT_CLASS, WmTextStyles } from './text.styles';\nimport { WMTextInput } from '@wavemaker/app-rn-runtime/core/components/textinput.component';\nimport { BaseInputComponent, BaseInputState } from \"@wavemaker/app-rn-runtime/components/input/baseinput/baseinput.component\";\nimport { isNull } from 'lodash';\nimport { AccessibilityWidgetType, getAccessibilityProps } from '@wavemaker/app-rn-runtime/core/accessibility'; \nimport { createSkeleton } from '@wavemaker/app-rn-runtime/components/basic/skeleton/skeleton.component';\n\nexport class WmTextState extends BaseInputState<WmTextProps> {\n}\n\nexport default class WmText extends BaseInputComponent<WmTextProps, WmTextState, WmTextStyles> {\n\n constructor(props: WmTextProps) {\n super(props, DEFAULT_CLASS, new WmTextProps(), new WmTextState());\n }\n\n public getStyleClassName(): string | undefined {\n const classes = [];\n if (this.state.props.floatinglabel) {\n classes.push('app-text-with-label'); \n }\n classes.push(super.getStyleClassName());\n return classes.join(' ');\n }\n\n public renderSkeleton(props: WmTextProps): React.ReactNode { \n let skeletonWidth, skeletonHeight;\n \n if(this.props.skeletonwidth == \"0\") {\n skeletonWidth = 0\n } else {\n skeletonWidth = this.props.skeletonwidth || this.styles.root?.width\n }\n\n if(this.props.skeletonheight == \"0\") {\n skeletonHeight = 0\n } else {\n skeletonHeight = this.props.skeletonheight || this.styles.root?.height;\n }\n\n return createSkeleton(this.theme, this.styles.skeleton, {\n ...this.styles.root,\n width: skeletonWidth as DimensionValue,\n height: skeletonHeight as DimensionValue\n })\n }\n\n renderWidget(props: WmTextProps) {\n let opts: any = {};\n const valueExpr = Platform.OS === 'web' ? 'value' : 'defaultValue';\n opts[valueExpr] = this.state.textValue?.toString() || '';\n return (\n <WMTextInput\n {...this.getTestPropsForInput()}\n {...getAccessibilityProps(\n AccessibilityWidgetType.TEXT,\n props\n )}\n ref={(ref: any) => {this.widgetRef = ref;\n // @ts-ignore\n if (ref && !isNull(ref.selectionStart) && !isNull(ref.selectionEnd)) {\n // @ts-ignore\n ref.selectionStart = ref.selectionEnd = this.cursor;\n }}}\n {...opts}\n floatingLabel={props.floatinglabel}\n floatingLabelStyle={this.styles.floatingLabel}\n activeFloatingLabelStyle={this.styles.activeFloatingLabel}\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, this.state.isInputFocused ? this.styles.focused : {}]}\n keyboardType={this.state.keyboardType}\n autoComplete={props.autocomplete ? 'username' : 'off'}\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 />\n );\n }\n}\n"],"mappings":";AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAAyBC,QAAQ,QAAQ,cAAc;AAEvD,OAAOC,WAAW,MAAM,cAAc;AACtC,SAASC,aAAa,QAAsB,eAAe;AAC3D,SAASC,WAAW,QAAQ,+DAA+D;AAC3F,SAASC,kBAAkB,EAAEC,cAAc,QAAQ,0EAA0E;AAC7H,SAASC,MAAM,QAAQ,QAAQ;AAC/B,SAASC,uBAAuB,EAAEC,qBAAqB,QAAQ,8CAA8C;AAC7G,SAASC,cAAc,QAAQ,wEAAwE;AAEvG,OAAO,MAAMC,WAAW,SAASL,cAAc,CAAc;AAG7D,eAAe,MAAMM,MAAM,SAASP,kBAAkB,CAAyC;EAE7FQ,WAAWA,CAACC,KAAkB,EAAE;IAC9B,KAAK,CAACA,KAAK,EAAEX,aAAa,EAAE,IAAID,WAAW,CAAC,CAAC,EAAE,IAAIS,WAAW,CAAC,CAAC,CAAC;EACnE;EAEOI,iBAAiBA,CAAA,EAAuB;IAC7C,MAAMC,OAAO,GAAG,EAAE;IAClB,IAAI,IAAI,CAACC,KAAK,CAACH,KAAK,CAACI,aAAa,EAAE;MAClCF,OAAO,CAACG,IAAI,CAAC,qBAAqB,CAAC;IACrC;IACAH,OAAO,CAACG,IAAI,CAAC,KAAK,CAACJ,iBAAiB,CAAC,CAAC,CAAC;IACvC,OAAOC,OAAO,CAACI,IAAI,CAAC,GAAG,CAAC;EAC1B;EAEOC,cAAcA,CAACP,KAAkB,EAAmB;IACzD,IAAIQ,aAAa,EAAEC,cAAc;IAEjC,IAAG,IAAI,CAACT,KAAK,CAACU,aAAa,IAAI,GAAG,EAAE;MAClCF,aAAa,GAAG,CAAC;IACnB,CAAC,MAAM;MAAA,IAAAG,iB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,WAAY;MAC7BH,QAAQ,EAAE3D,KAAK,CAAC2D,QAAS;MACzBI,SAAS,EAAE/D,KAAK,CAACgE,QAAS;MAC1BC,WAAW,EAAEjE,KAAK,CAACiE,WAAY;MAC/BC,MAAM,EAAE,IAAI,CAACA,MAAM,CAACC,IAAI,CAAC,IAAI,CAAE;MAC/BC,OAAO,EAAE,IAAI,CAACA,OAAO,CAACD,IAAI,CAAC,IAAI,CAAE;MACjCE,UAAU,EAAE,IAAI,CAACA,UAAU,CAACF,IAAI,CAAC,IAAI,CAAE;MACvCG,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,CAAC7D,MAAM,CAACiC,IAAI,CAAC6B,UAAU,KAAK,MAAO;MAC9DC,cAAc,EAAE3E,KAAK,CAAC4E;IAAe,EACtC,CAAC;EAER;AACF","ignoreList":[]}
|
@@ -9,6 +9,7 @@ export default class WmTextProps extends BaseInputProps {
|
|
9
9
|
_defineProperty(this, "placeholder", 'Enter text');
|
10
10
|
_defineProperty(this, "skeletonheight", null);
|
11
11
|
_defineProperty(this, "skeletonwidth", null);
|
12
|
+
_defineProperty(this, "autocapitalize", 'none');
|
12
13
|
}
|
13
14
|
}
|
14
15
|
//# sourceMappingURL=text.props.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["BaseInputProps","WmTextProps","constructor","args","_defineProperty"],"sources":["text.props.ts"],"sourcesContent":["import BaseInputProps from \"@wavemaker/app-rn-runtime/components/input/baseinput/baseinput.props\";\n\nexport default class WmTextProps extends BaseInputProps {\n floatinglabel?: string;\n placeholder: string = 'Enter text';\n skeletonheight?: string = null as any;\n skeletonwidth?: string = null as any;\n}\n"],"mappings":";;;AAAA,OAAOA,cAAc,MAAM,sEAAsE;AAEjG,eAAe,MAAMC,WAAW,SAASD,cAAc,CAAC;EAAAE,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAC,eAAA;IAAAA,eAAA,sBAEhC,YAAY;IAAAA,eAAA,yBACR,IAAI;IAAAA,eAAA,wBACL,IAAI;EAAA;
|
1
|
+
{"version":3,"names":["BaseInputProps","WmTextProps","constructor","args","_defineProperty"],"sources":["text.props.ts"],"sourcesContent":["import BaseInputProps from \"@wavemaker/app-rn-runtime/components/input/baseinput/baseinput.props\";\n\nexport default class WmTextProps extends BaseInputProps {\n floatinglabel?: string;\n placeholder: string = 'Enter text';\n skeletonheight?: string = null as any;\n skeletonwidth?: string = null as any;\n autocapitalize?: string = 'none';\n}\n"],"mappings":";;;AAAA,OAAOA,cAAc,MAAM,sEAAsE;AAEjG,eAAe,MAAMC,WAAW,SAASD,cAAc,CAAC;EAAAE,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAC,eAAA;IAAAA,eAAA,sBAEhC,YAAY;IAAAA,eAAA,yBACR,IAAI;IAAAA,eAAA,wBACL,IAAI;IAAAA,eAAA,yBACH,MAAM;EAAA;AAClC","ignoreList":[]}
|
@@ -22,6 +22,9 @@ BASE_THEME.registerStyle((themeVariables, addStyle) => {
|
|
22
22
|
invalid: {
|
23
23
|
borderBottomColor: themeVariables.inputInvalidBorderColor
|
24
24
|
},
|
25
|
+
focused: {
|
26
|
+
borderColor: themeVariables.inputFocusBorderColor
|
27
|
+
},
|
25
28
|
placeholderText: {
|
26
29
|
color: themeVariables.inputPlaceholderColor
|
27
30
|
},
|
@@ -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","borderRadius","fontFamily","baseFont","text","fontSize","invalid","borderBottomColor","inputInvalidBorderColor","placeholderText","color","inputPlaceholderColor","floatingLabel","activeFloatingLabel","skeleton","width","height","inputDisabledBgColor","textAlign","position","top","left","floatingLabelColor","activeFloatingLabelColor"],"sources":["text.styles.ts"],"sourcesContent":["import BASE_THEME, {AllStyle, Theme} from '@wavemaker/app-rn-runtime/styles/theme';\nimport { BaseStyles, defineStyles } from '@wavemaker/app-rn-runtime/core/base.component';\nimport {ColorValue} from \"react-native\";\nimport { WmSkeletonStyles } from '@wavemaker/app-rn-runtime/components/basic/skeleton/skeleton.styles';\n\nexport type WmTextStyles = BaseStyles & {\n invalid: AllStyle;\n placeholderText: AllStyle;\n floatingLabel: AllStyle;\n activeFloatingLabel: 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 borderRadius: 6,\n fontFamily: themeVariables.baseFont\n },\n text: {\n fontSize: 16\n },\n invalid: {\n borderBottomColor: themeVariables.inputInvalidBorderColor\n },\n placeholderText: {\n color: themeVariables.inputPlaceholderColor\n },\n floatingLabel: {},\n activeFloatingLabel: {},\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 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});"],"mappings":"AAAA,OAAOA,UAAU,MAAyB,wCAAwC;AAClF,SAAqBC,YAAY,QAAQ,+CAA+C;
|
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","borderRadius","fontFamily","baseFont","text","fontSize","invalid","borderBottomColor","inputInvalidBorderColor","focused","inputFocusBorderColor","placeholderText","color","inputPlaceholderColor","floatingLabel","activeFloatingLabel","skeleton","width","height","inputDisabledBgColor","textAlign","position","top","left","floatingLabelColor","activeFloatingLabelColor"],"sources":["text.styles.ts"],"sourcesContent":["import BASE_THEME, {AllStyle, Theme} from '@wavemaker/app-rn-runtime/styles/theme';\nimport { BaseStyles, defineStyles } from '@wavemaker/app-rn-runtime/core/base.component';\nimport {ColorValue} from \"react-native\";\nimport { WmSkeletonStyles } from '@wavemaker/app-rn-runtime/components/basic/skeleton/skeleton.styles';\n\nexport type WmTextStyles = BaseStyles & {\n invalid: AllStyle;\n focused: AllStyle;\n placeholderText: AllStyle;\n floatingLabel: AllStyle;\n activeFloatingLabel: 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 borderRadius: 6,\n fontFamily: themeVariables.baseFont\n },\n text: {\n fontSize: 16\n },\n invalid: {\n borderBottomColor: themeVariables.inputInvalidBorderColor\n },\n focused : {\n borderColor: themeVariables.inputFocusBorderColor,\n },\n placeholderText: {\n color: themeVariables.inputPlaceholderColor\n },\n floatingLabel: {},\n activeFloatingLabel: {},\n 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 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});"],"mappings":"AAAA,OAAOA,UAAU,MAAyB,wCAAwC;AAClF,SAAqBC,YAAY,QAAQ,+CAA+C;AAaxF,OAAO,MAAMC,aAAa,GAAG,UAAU;AACvCF,UAAU,CAACG,aAAa,CAAC,CAACC,cAAc,EAAEC,QAAQ,KAAK;EACrD,MAAMC,aAA2B,GAAGL,YAAY,CAAC;IAC7CM,IAAI,EAAE;MACJC,SAAS,EAAE,EAAE;MACbC,UAAU,EAAE,CAAC;MACbC,aAAa,EAAE,CAAC;MAChBC,WAAW,EAAE,CAAC;MACdC,WAAW,EAAE,EAAE;MACfC,YAAY,EAAE,EAAE;MAChBC,WAAW,EAAE,OAAO;MACpBC,WAAW,EAAEX,cAAc,CAACY,gBAAgB;MAC5CC,eAAe,EAAEb,cAAc,CAACc,oBAAoB;MACpDC,YAAY,EAAE,CAAC;MACfC,UAAU,EAAEhB,cAAc,CAACiB;IAC7B,CAAC;IACDC,IAAI,EAAE;MACJC,QAAQ,EAAE;IACZ,CAAC;IACDC,OAAO,EAAE;MACPC,iBAAiB,EAAErB,cAAc,CAACsB;IACpC,CAAC;IACDC,OAAO,EAAG;MACRZ,WAAW,EAAEX,cAAc,CAACwB;IAC9B,CAAC;IACDC,eAAe,EAAE;MACjBC,KAAK,EAAE1B,cAAc,CAAC2B;IACtB,CAAC;IACDC,aAAa,EAAE,CAAC,CAAC;IACjBC,mBAAmB,EAAE,CAAC,CAAC;IACvBC,QAAQ,EAAE;MACR3B,IAAI,EAAE;QACJ4B,KAAK,EAAE,MAAM;QACbC,MAAM,EAAE,EAAE;QACVjB,YAAY,EAAE;MAChB;IACF;EACJ,CAAC,CAAC;EAEFd,QAAQ,CAACH,aAAa,EAAE,EAAE,EAAEI,aAAa,CAAC;EAC1CD,QAAQ,CAACH,aAAa,GAAG,WAAW,EAAE,EAAE,EAAE;IACtCK,IAAI,EAAG;MACLU,eAAe,EAAEb,cAAc,CAACiC;IAClC;EACJ,CAAC,CAAC;EACFhC,QAAQ,CAACH,aAAa,GAAG,MAAM,EAAE,EAAE,EAAE;IACjCK,IAAI,EAAC;MACH+B,SAAS,EAAE;IACb;EACJ,CAAC,CAAC;EACFjC,QAAQ,CAACH,aAAa,GAAG,aAAa,EAAE,EAAE,EAAE;IAC1CK,IAAI,EAAE;MACJC,SAAS,EAAE;IACb,CAAC;IACDwB,aAAa,EAAE;MACbO,QAAQ,EAAE,UAAU;MACpBC,GAAG,EAAE,EAAE;MACPC,IAAI,EAAE,EAAE;MACRlB,QAAQ,EAAE,EAAE;MACZO,KAAK,EAAE1B,cAAc,CAACsC;IACxB,CAAC;IACDT,mBAAmB,EAAE;MACnBH,KAAK,EAAE1B,cAAc,CAACuC;IACxB;EACF,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
|
@@ -56,9 +56,11 @@ export default class WmTextarea extends BaseInputComponent {
|
|
56
56
|
}
|
57
57
|
},
|
58
58
|
placeholderTextColor: this.styles.placeholderText.color,
|
59
|
-
|
59
|
+
isInputFocused: this.state.isInputFocused,
|
60
|
+
style: [this.styles.root, this.styles.text, this.state.isValid ? {} : this.styles.invalid, this.state.isInputFocused ? this.styles.focused : {}],
|
60
61
|
multiline: true,
|
61
62
|
numberOfLines: 4,
|
63
|
+
background: this._background,
|
62
64
|
keyboardType: this.state.keyboardType
|
63
65
|
}, opts, {
|
64
66
|
floatingLabel: props.floatinglabel,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["React","Platform","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","opts","valueExpr","OS","textValue","toString","createElement","_extends","getTestPropsForInput","TEXTAREA","ref","widgetRef","selectionStart","selectionEnd","cursor","placeholderTextColor","placeholderText","color","style","text","isValid","invalid","multiline","numberOfLines","keyboardType","floatingLabel","floatingLabelStyle","activeFloatingLabelStyle","activeFloatingLabel","autoComplete","autocomplete","autoFocus","autofocus","editable","disabled","readonly","maxLength","maxchars","placeholder","onBlur","bind","onFocus","onKeyPress","onChangeText","onChange","invokeChange","allowContentSelection","userSelect"],"sources":["textarea.component.tsx"],"sourcesContent":["import React from 'react';\nimport { DimensionValue, Platform } from 'react-native';\nimport WmTextareaProps from './textarea.props';\nimport { DEFAULT_CLASS, WmTextareaStyles } from './textarea.styles';\nimport {\n BaseInputComponent,\n BaseInputState\n} from '@wavemaker/app-rn-runtime/components/input/baseinput/baseinput.component';\nimport { WMTextInput } from '@wavemaker/app-rn-runtime/core/components/textinput.component';\nimport { isNull } from 'lodash';\nimport { AccessibilityWidgetType, getAccessibilityProps } from '@wavemaker/app-rn-runtime/core/accessibility'; \nimport { createSkeleton } from '@wavemaker/app-rn-runtime/components/basic/skeleton/skeleton.component';\n\nexport class WmTextareaState extends BaseInputState<WmTextareaProps> {}\n\nexport default class WmTextarea extends BaseInputComponent<WmTextareaProps, WmTextareaState, WmTextareaStyles> {\n\n constructor(props: WmTextareaProps) {\n super(props, DEFAULT_CLASS, new WmTextareaProps(), new WmTextareaState());\n }\n\n public getStyleClassName(): string | undefined {\n const classes = [];\n if (this.state.props.floatinglabel) {\n classes.push('app-textarea-with-label'); \n }\n classes.push(super.getStyleClassName());\n return classes.join(' ');\n }\n\n public renderSkeleton(props: WmTextareaProps): React.ReactNode {\n let skeletonWidth, skeletonHeight;\n if(this.props.skeletonwidth == \"0\") {\n skeletonWidth = 0\n } else {\n skeletonWidth = this.props.skeletonwidth || this.styles.root?.width\n }\n\n if(this.props.skeletonheight == \"0\") {\n skeletonHeight = 0\n } else {\n skeletonHeight = this.props.skeletonheight || this.styles.root?.height;\n }\n\n return createSkeleton(this.theme, this.styles.skeleton, {\n ...this.styles.root,\n width: skeletonWidth as DimensionValue,\n height: skeletonHeight as DimensionValue\n });\n }\n\n renderWidget(props: WmTextareaProps) {\n let opts: any = {};\n const valueExpr = Platform.OS === 'web' ? 'value' : 'defaultValue';\n opts[valueExpr] = this.state.textValue?.toString() || '';\n return ( <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 style={[this.styles.root, this.styles.text, this.state.isValid ? {} : this.styles.invalid]}\n multiline={true}\n numberOfLines={4}\n keyboardType={this.state.keyboardType}\n {...opts}\n floatingLabel={props.floatinglabel}\n floatingLabelStyle={this.styles.floatingLabel}\n activeFloatingLabelStyle={this.styles.activeFloatingLabel}\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 />);\n }\n}\n"],"mappings":";AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAAyBC,QAAQ,QAAQ,cAAc;AACvD,OAAOC,eAAe,MAAM,kBAAkB;AAC9C,SAASC,aAAa,QAA0B,mBAAmB;AACnE,SACEC,kBAAkB,EAClBC,cAAc,QACT,0EAA0E;AACjF,SAASC,WAAW,QAAQ,+DAA+D;AAC3F,SAASC,MAAM,QAAQ,QAAQ;AAC/B,SAASC,uBAAuB,EAAEC,qBAAqB,QAAQ,8CAA8C;AAC7G,SAASC,cAAc,QAAQ,wEAAwE;AAEvG,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,aAAa,IAAI,GAAG,EAAE;MAClCF,aAAa,GAAG,CAAC;IACnB,CAAC,MAAM;MAAA,IAAAG,iBAAA;MACLH,aAAa,GAAG,IAAI,CAACR,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AAc,CAAC,IAAI,CAACxC,MAAM,CAACsC,GAAG,CAACG,YAAY,CAAC,EAAE;UACnE;UACAH,GAAG,CAACE,cAAc,GAAGF,GAAG,CAACG,YAAY,GAAG,IAAI,CAACC,MAAM;QACrD;MAAC,CAAE;MACLC,oBAAoB,EAAE,IAAI,CAACxB,MAAM,CAACyB,eAAe,CAACC,KAAa;MAC/DC,KAAK,EAAE,CAAC,IAAI,
|
1
|
+
{"version":3,"names":["React","Platform","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","opts","valueExpr","OS","textValue","toString","createElement","_extends","getTestPropsForInput","TEXTAREA","ref","widgetRef","selectionStart","selectionEnd","cursor","placeholderTextColor","placeholderText","color","isInputFocused","style","text","isValid","invalid","focused","multiline","numberOfLines","background","_background","keyboardType","floatingLabel","floatingLabelStyle","activeFloatingLabelStyle","activeFloatingLabel","autoComplete","autocomplete","autoFocus","autofocus","editable","disabled","readonly","maxLength","maxchars","placeholder","onBlur","bind","onFocus","onKeyPress","onChangeText","onChange","invokeChange","allowContentSelection","userSelect"],"sources":["textarea.component.tsx"],"sourcesContent":["import React from 'react';\nimport { DimensionValue, Platform } from 'react-native';\nimport WmTextareaProps from './textarea.props';\nimport { DEFAULT_CLASS, WmTextareaStyles } from './textarea.styles';\nimport {\n BaseInputComponent,\n BaseInputState\n} from '@wavemaker/app-rn-runtime/components/input/baseinput/baseinput.component';\nimport { WMTextInput } from '@wavemaker/app-rn-runtime/core/components/textinput.component';\nimport { isNull } from 'lodash';\nimport { AccessibilityWidgetType, getAccessibilityProps } from '@wavemaker/app-rn-runtime/core/accessibility'; \nimport { createSkeleton } from '@wavemaker/app-rn-runtime/components/basic/skeleton/skeleton.component';\n\nexport class WmTextareaState extends BaseInputState<WmTextareaProps> {}\n\nexport default class WmTextarea extends BaseInputComponent<WmTextareaProps, WmTextareaState, WmTextareaStyles> {\n\n constructor(props: WmTextareaProps) {\n super(props, DEFAULT_CLASS, new WmTextareaProps(), new WmTextareaState());\n }\n\n public getStyleClassName(): string | undefined {\n const classes = [];\n if (this.state.props.floatinglabel) {\n classes.push('app-textarea-with-label'); \n }\n classes.push(super.getStyleClassName());\n return classes.join(' ');\n }\n\n public renderSkeleton(props: WmTextareaProps): React.ReactNode {\n let skeletonWidth, skeletonHeight;\n if(this.props.skeletonwidth == \"0\") {\n skeletonWidth = 0\n } else {\n skeletonWidth = this.props.skeletonwidth || this.styles.root?.width\n }\n\n if(this.props.skeletonheight == \"0\") {\n skeletonHeight = 0\n } else {\n skeletonHeight = this.props.skeletonheight || this.styles.root?.height;\n }\n\n return createSkeleton(this.theme, this.styles.skeleton, {\n ...this.styles.root,\n width: skeletonWidth as DimensionValue,\n height: skeletonHeight as DimensionValue\n });\n }\n\n renderWidget(props: WmTextareaProps) {\n let opts: any = {};\n const valueExpr = Platform.OS === 'web' ? 'value' : 'defaultValue';\n opts[valueExpr] = this.state.textValue?.toString() || '';\n return ( <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, this.state.isInputFocused ? this.styles.focused : {}]}\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.styles.activeFloatingLabel}\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 />);\n }\n}\n"],"mappings":";AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAAyBC,QAAQ,QAAQ,cAAc;AACvD,OAAOC,eAAe,MAAM,kBAAkB;AAC9C,SAASC,aAAa,QAA0B,mBAAmB;AACnE,SACEC,kBAAkB,EAClBC,cAAc,QACT,0EAA0E;AACjF,SAASC,WAAW,QAAQ,+DAA+D;AAC3F,SAASC,MAAM,QAAQ,QAAQ;AAC/B,SAASC,uBAAuB,EAAEC,qBAAqB,QAAQ,8CAA8C;AAC7G,SAASC,cAAc,QAAQ,wEAAwE;AAEvG,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;EA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,QAAQ,EAAE1D,KAAK,CAAC2D,QAAQ,IAAI3D,KAAK,CAAC4D,QAAQ,GAAG,KAAK,GAAG,IAAK;MAC1DC,SAAS,EAAE7D,KAAK,CAAC8D,QAAS;MAC1BC,WAAW,EAAE/D,KAAK,CAAC+D,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,CAAC3D,MAAM,CAAC6B,IAAI,CAAC+B,UAAU,KAAK;IAAO,EAC/D,CAAC;EACJ;AACF","ignoreList":[]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["BASE_THEME","defineStyles","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","placeholderText","color","inputPlaceholderColor","skeleton","width","height","inputDisabledBgColor","textAlign","paddingTop","position","top","left","floatingLabelColor","activeFloatingLabelColor"],"sources":["textarea.styles.ts"],"sourcesContent":["import BASE_THEME, { AllStyle } from '@wavemaker/app-rn-runtime/styles/theme';\nimport { BaseStyles, defineStyles } from '@wavemaker/app-rn-runtime/core/base.component';\nimport { WmSkeletonStyles } from '@wavemaker/app-rn-runtime/components/basic/skeleton/skeleton.styles';\n\nexport type WmTextareaStyles = BaseStyles & {\n invalid: AllStyle;\n placeholderText: AllStyle;\n floatingLabel: AllStyle;\n activeFloatingLabel: AllStyle;\n skeleton: WmSkeletonStyles;\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 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 });\n\n addStyle(DEFAULT_CLASS, '', defaultStyles);\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});"],"mappings":"AAAA,OAAOA,UAAU,MAAoB,wCAAwC;AAC7E,SAAqBC,YAAY,QAAQ,+CAA+C;
|
1
|
+
{"version":3,"names":["BASE_THEME","defineStyles","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","inputDisabledBgColor","textAlign","paddingTop","position","top","left","floatingLabelColor","activeFloatingLabelColor"],"sources":["textarea.styles.ts"],"sourcesContent":["import BASE_THEME, { AllStyle } from '@wavemaker/app-rn-runtime/styles/theme';\nimport { BaseStyles, defineStyles } from '@wavemaker/app-rn-runtime/core/base.component';\nimport { WmSkeletonStyles } from '@wavemaker/app-rn-runtime/components/basic/skeleton/skeleton.styles';\n\nexport type WmTextareaStyles = BaseStyles & {\n invalid: AllStyle;\n focused: AllStyle;\n placeholderText: AllStyle;\n floatingLabel: AllStyle;\n activeFloatingLabel: AllStyle;\n skeleton: WmSkeletonStyles;\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 });\n\n addStyle(DEFAULT_CLASS, '', defaultStyles);\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.activeFloating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C;MACH4B,SAAS,EAAE;IACb;EACF,CAAC,CAAC;EACF9B,QAAQ,CAACH,aAAa,GAAG,aAAa,EAAE,EAAE,EAAE;IAC1CiB,IAAI,EAAC;MACHiB,UAAU,EAAE;IACd,CAAC;IACDd,aAAa,EAAE;MACbe,QAAQ,EAAE,UAAU;MACpBC,GAAG,EAAE,EAAE;MACPC,IAAI,EAAE,EAAE;MACRnB,QAAQ,EAAE,EAAE;MACZS,KAAK,EAAEzB,cAAc,CAACoC;IACxB,CAAC;IACDjB,mBAAmB,EAAE;MACnBM,KAAK,EAAEzB,cAAc,CAACqC;IACxB;EACF,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
|
@@ -10,6 +10,7 @@ import { unStringify, validateField } from '@wavemaker/app-rn-runtime/core/utils
|
|
10
10
|
import { AccessibilityWidgetType, getAccessibilityProps } from '@wavemaker/app-rn-runtime/core/accessibility';
|
11
11
|
import WmToggleProps from './toggle.props';
|
12
12
|
import { DEFAULT_CLASS } from './toggle.styles';
|
13
|
+
import { createSkeleton } from '@wavemaker/app-rn-runtime/components/basic/skeleton/skeleton.component';
|
13
14
|
export class WmToggleState extends BaseComponentState {
|
14
15
|
constructor(...args) {
|
15
16
|
super(...args);
|
@@ -92,6 +93,11 @@ export default class WmToggle extends BaseComponent {
|
|
92
93
|
viewWidth: width
|
93
94
|
});
|
94
95
|
}
|
96
|
+
renderSkeleton(props) {
|
97
|
+
return createSkeleton(this.theme, this.styles.skeleton, {
|
98
|
+
...this.styles.skeleton.root
|
99
|
+
});
|
100
|
+
}
|
95
101
|
renderWidget(props) {
|
96
102
|
const styles = this.theme.mergeStyle(this.styles, this.theme.getStyle(this.state.isSwitchOn ? 'app-toggle-on' : 'app-toggle-off'));
|
97
103
|
return /*#__PURE__*/React.createElement(TouchableOpacity, _extends({
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["React","TouchableOpacity","Animated","Easing","View","BackgroundComponent","BaseComponent","BaseComponentState","unStringify","validateField","AccessibilityWidgetType","getAccessibilityProps","WmToggleProps","DEFAULT_CLASS","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","sequence","timing","scaleValue","toValue","duration","useNativeDriver","animationValue","easing","linear","start","onFieldChange","invokeEventCallback","proxy","onLayoutChange","event","width","nativeEvent","layout","setState","viewWidth","renderWidget","styles","theme","mergeStyle","getStyle","createElement","_extends","onLayout","e","TOGGLE","selected","onPress","disabled","readonly","setTimeout","getTestPropsForAction","style","root","animation","handle","size","backgroundSize","position","backgroundPosition","image","backgroundImage","repeat","backgroundRepeat","transform","translateX","interpolate","inputRange","outputRange","scale"],"sources":["toggle.component.tsx"],"sourcesContent":["import React from 'react';\nimport { TouchableOpacity, Animated, Easing, LayoutChangeEvent, View } from 'react-native';\n\nimport { BackgroundComponent } from '@wavemaker/app-rn-runtime/styles/background.component';\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\nimport { unStringify, validateField} from '@wavemaker/app-rn-runtime/core/utils';\nimport { AccessibilityWidgetType, getAccessibilityProps } from '@wavemaker/app-rn-runtime/core/accessibility'; \n\nimport WmToggleProps from './toggle.props';\nimport { DEFAULT_CLASS, WmToggleStyles } from './toggle.styles';\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 Animated.sequence([\n Animated.timing(this.scaleValue, {\n toValue: 1.6,\n duration: 300,\n useNativeDriver: true,\n }),\n Animated.timing(this.animationValue, {\n toValue: value ? 1 : 0,\n duration: 300,\n easing: Easing.linear,\n useNativeDriver: true,\n }),\n ]).start(() => {\n Animated.timing(this.scaleValue, {\n toValue: value ? 1.5 : 1,\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 this.invokeEventCallback('onBlur', [ null, this.proxy ]);\n });\n }\n\n onLayoutChange(event: LayoutChangeEvent){\n let width = event.nativeEvent.layout.width;\n this.setState({\n viewWidth: width,\n } as WmToggleState);\n }\n\n renderWidget(props: WmToggleProps) {\n const styles = this.theme.mergeStyle(this.styles, \n this.theme.getStyle(this.state.isSwitchOn ? 'app-toggle-on' : 'app-toggle-off'));\n return (\n <TouchableOpacity \n onLayout={(e) => {\n this.onLayoutChange(e);\n }}\n {...getAccessibilityProps(AccessibilityWidgetType.TOGGLE, {...this.props, selected: this.state.isSwitchOn})}\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 outputRange: [0, this.state.viewWidth - (this.styles.handle.width as number + 18)],\n }),\n },\n { scale: this.scaleValue }\n ],\n },\n ]}>\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"],"mappings":";;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,gBAAgB,EAAEC,QAAQ,EAAEC,MAAM,EAAqBC,IAAI,QAAQ,cAAc;AAE1F,SAASC,mBAAmB,QAAQ,uDAAuD;AAC3F,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,+CAA+C;AACjG,SAASC,WAAW,EAAEC,aAAa,QAAO,sCAAsC;AAChF,SAASC,uBAAuB,EAAEC,qBAAqB,QAAQ,8CAA8C;AAE7G,OAAOC,aAAa,MAAM,gBAAgB;AAC1C,SAASC,aAAa,QAAwB,iBAAiB;AAE/D,OAAO,MAAMC,aAAa,SAASP,kBAAkB,CAAgB;EAAAQ,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,SAASZ,aA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AACkB,MAAM,CAACM,eAAgB;MACrCC,MAAM,EAAEzB,MAAM,CAACkB,MAAM,CAACQ,gBAAgB,IAAI;IAAY,CACvD,CACY,CACD,CAAC;EAEvB;AACF","ignoreList":[]}
|
1
|
+
{"version":3,"names":["React","TouchableOpacity","Animated","Easing","View","BackgroundComponent","BaseComponent","BaseComponentState","unStringify","validateField","AccessibilityWidgetType","getAccessibilityProps","WmToggleProps","DEFAULT_CLASS","createSkeleton","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","sequence","timing","scaleValue","toValue","duration","useNativeDriver","animationValue","easing","linear","start","onFieldChange","invokeEventCallback","proxy","onLayoutChange","event","width","nativeEvent","layout","setState","viewWidth","renderSkeleton","theme","styles","skeleton","root","renderWidget","mergeStyle","getStyle","createElement","_extends","onLayout","e","TOGGLE","selected","onPress","disabled","readonly","setTimeout","getTestPropsForAction","style","animation","handle","size","backgroundSize","position","backgroundPosition","image","backgroundImage","repeat","backgroundRepeat","transform","translateX","interpolate","inputRange","outputRange","scale"],"sources":["toggle.component.tsx"],"sourcesContent":["import React from 'react';\nimport { TouchableOpacity, Animated, Easing, LayoutChangeEvent, View, DimensionValue } from 'react-native';\n\nimport { BackgroundComponent } from '@wavemaker/app-rn-runtime/styles/background.component';\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\nimport { unStringify, validateField} from '@wavemaker/app-rn-runtime/core/utils';\nimport { AccessibilityWidgetType, getAccessibilityProps } from '@wavemaker/app-rn-runtime/core/accessibility'; \n\nimport WmToggleProps from './toggle.props';\nimport { DEFAULT_CLASS, WmToggleStyles } from './toggle.styles';\nimport { createSkeleton } from '@wavemaker/app-rn-runtime/components/basic/skeleton/skeleton.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 Animated.sequence([\n Animated.timing(this.scaleValue, {\n toValue: 1.6,\n duration: 300,\n useNativeDriver: true,\n }),\n Animated.timing(this.animationValue, {\n toValue: value ? 1 : 0,\n duration: 300,\n easing: Easing.linear,\n useNativeDriver: true,\n }),\n ]).start(() => {\n Animated.timing(this.scaleValue, {\n toValue: value ? 1.5 : 1,\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 this.invokeEventCallback('onBlur', [ null, this.proxy ]);\n });\n }\n\n onLayoutChange(event: LayoutChangeEvent){\n let width = event.nativeEvent.layout.width;\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\n renderWidget(props: WmToggleProps) {\n const styles = this.theme.mergeStyle(this.styles, \n this.theme.getStyle(this.state.isSwitchOn ? 'app-toggle-on' : 'app-toggle-off'));\n return (\n <TouchableOpacity \n onLayout={(e) => {\n this.onLayoutChange(e);\n }}\n {...getAccessibilityProps(AccessibilityWidgetType.TOGGLE, {...this.props, selected: this.state.isSwitchOn})}\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 outputRange: [0, this.state.viewWidth - (this.styles.handle.width as number + 18)],\n }),\n },\n { scale: this.scaleValue }\n ],\n },\n ]}>\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"],"mappings":";;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,gBAAgB,EAAEC,QAAQ,EAAEC,MAAM,EAAqBC,IAAI,QAAwB,cAAc;AAE1G,SAASC,mBAAmB,QAAQ,uDAAuD;AAC3F,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,+CAA+C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A,CAAAqE,aAAA,CAACnE,QAAQ,CAACE,IAAI;MACjB4E,KAAK,EAAE,CACLjB,MAAM,CAACmB,MAAM,EACb;QACES,SAAS,EAAE,CACT;UACEC,UAAU,EAAE,IAAI,CAAC7C,cAAc,CAAC8C,WAAW,CAAC;YAC1CC,UAAU,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;YAClBC,WAAW,EAAE,CAAC,CAAC,EAAE,IAAI,CAACpE,KAAK,CAACiC,SAAS,IAAI,IAAI,CAACG,MAAM,CAACmB,MAAM,CAAC1B,KAAK,GAAa,EAAE,CAAC;UACnF,CAAC;QACH,CAAC,EACD;UAAEwC,KAAK,EAAE,IAAI,CAACrD;QAAW,CAAC;MAE9B,CAAC;IACD,gBACF3C,KAAA,CAAAqE,aAAA,CAAChE,mBAAmB;MAClB8E,IAAI,EAAEpB,MAAM,CAACmB,MAAM,CAACE,cAAc,IAAI,SAAU;MAChDC,QAAQ,EAAEtB,MAAM,CAACmB,MAAM,CAACI,kBAAmB;MAC3CC,KAAK,EAAExB,MAAM,CAACmB,MAAM,CAACM,eAAgB;MACrCC,MAAM,EAAE1B,MAAM,CAACmB,MAAM,CAACQ,gBAAgB,IAAI;IAAY,CACvD,CACY,CACD,CAAC;EAEvB;AACF","ignoreList":[]}
|
@@ -15,6 +15,8 @@ export default class WmToggleProps extends BaseProps {
|
|
15
15
|
_defineProperty(this, "accessibilityrole", "togglebutton");
|
16
16
|
_defineProperty(this, "accessibilitylabelledby", undefined);
|
17
17
|
_defineProperty(this, "invokeEvent", void 0);
|
18
|
+
_defineProperty(this, "skeletonheight", null);
|
19
|
+
_defineProperty(this, "skeletonwidth", null);
|
18
20
|
}
|
19
21
|
}
|
20
22
|
//# 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/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 accessibilitylabel?: string = undefined;\n hint?: string = undefined;\n accessibilityrole?: AccessibilityRole = \"togglebutton\";\n accessibilitylabelledby?: string = undefined;\n invokeEvent?: Function;\n}\n"],"mappings":";;;AACA,SAASA,SAAS,QAAQ,+CAA+C;AAEzE,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,6BAEaC,SAAS;IAAAD,eAAA,eACvBC,SAAS;IAAAD,eAAA,4BACe,cAAc;IAAAA,eAAA,kCACnBC,SAAS;IAAAD,eAAA;EAAA;
|
1
|
+
{"version":3,"names":["BaseProps","WmToggleProps","constructor","args","_defineProperty","undefined"],"sources":["toggle.props.ts"],"sourcesContent":["import {AccessibilityRole} from 'react-native';\nimport { BaseProps } from '@wavemaker/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 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}\n"],"mappings":";;;AACA,SAASA,SAAS,QAAQ,+CAA+C;AAEzE,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,6BAEaC,SAAS;IAAAD,eAAA,eACvBC,SAAS;IAAAD,eAAA,4BACe,cAAc;IAAAA,eAAA,kCACnBC,SAAS;IAAAD,eAAA;IAAAA,eAAA,yBAElB,IAAI;IAAAA,eAAA,wBACL,IAAI;EAAA;AAC/B","ignoreList":[]}
|
@@ -19,6 +19,13 @@ BASE_THEME.registerStyle((themeVariables, addStyle) => {
|
|
19
19
|
marginRight: 0,
|
20
20
|
backgroundSize: '100% 100%',
|
21
21
|
backgroundPosition: 'center'
|
22
|
+
},
|
23
|
+
skeleton: {
|
24
|
+
root: {
|
25
|
+
width: 52,
|
26
|
+
height: 32,
|
27
|
+
borderRadius: 18
|
28
|
+
}
|
22
29
|
}
|
23
30
|
});
|
24
31
|
addStyle(DEFAULT_CLASS, '', defaultStyles);
|