@wavemaker/app-rn-runtime 11.5.2-rc.5436 → 11.5.2-rc.5490
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- app-rn-runtime/components/data/list/list.component.js +53 -1
- app-rn-runtime/components/data/list/list.component.js.map +1 -1
- app-rn-runtime/components/input/basenumber/basenumber.component.js +3 -3
- app-rn-runtime/components/input/basenumber/basenumber.component.js.map +1 -1
- app-rn-runtime/components/input/currency/currency.component.js +17 -2
- app-rn-runtime/components/input/currency/currency.component.js.map +1 -1
- app-rn-runtime/components/input/currency/currency.props.js +1 -0
- app-rn-runtime/components/input/currency/currency.props.js.map +1 -1
- app-rn-runtime/components/input/currency/currency.styles.js +19 -1
- app-rn-runtime/components/input/currency/currency.styles.js.map +1 -1
- app-rn-runtime/components/input/epoch/base-datetime.component.js +10 -2
- app-rn-runtime/components/input/epoch/base-datetime.component.js.map +1 -1
- app-rn-runtime/components/input/epoch/date/date.component.js +8 -0
- app-rn-runtime/components/input/epoch/date/date.component.js.map +1 -1
- app-rn-runtime/components/input/epoch/date/date.styles.js +16 -0
- app-rn-runtime/components/input/epoch/date/date.styles.js.map +1 -1
- app-rn-runtime/components/input/epoch/datetime/datetime.component.js +8 -0
- app-rn-runtime/components/input/epoch/datetime/datetime.component.js.map +1 -1
- app-rn-runtime/components/input/epoch/datetime/datetime.props.js +1 -0
- app-rn-runtime/components/input/epoch/datetime/datetime.props.js.map +1 -1
- app-rn-runtime/components/input/epoch/datetime/datetime.styles.js +21 -1
- app-rn-runtime/components/input/epoch/datetime/datetime.styles.js.map +1 -1
- app-rn-runtime/components/input/epoch/time/time.component.js +8 -0
- app-rn-runtime/components/input/epoch/time/time.component.js.map +1 -1
- app-rn-runtime/components/input/epoch/time/time.styles.js +16 -0
- app-rn-runtime/components/input/epoch/time/time.styles.js.map +1 -1
- app-rn-runtime/components/input/number/number.component.js +11 -0
- app-rn-runtime/components/input/number/number.component.js.map +1 -1
- app-rn-runtime/components/input/number/number.props.js +1 -0
- app-rn-runtime/components/input/number/number.props.js.map +1 -1
- app-rn-runtime/components/input/number/number.styles.js +17 -0
- app-rn-runtime/components/input/number/number.styles.js.map +1 -1
- app-rn-runtime/components/input/text/text.component.js +11 -0
- 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 +17 -0
- app-rn-runtime/components/input/text/text.styles.js.map +1 -1
- app-rn-runtime/components/input/textarea/textarea.component.js +11 -0
- app-rn-runtime/components/input/textarea/textarea.component.js.map +1 -1
- app-rn-runtime/components/input/textarea/textarea.props.js +1 -0
- app-rn-runtime/components/input/textarea/textarea.props.js.map +1 -1
- app-rn-runtime/components/input/textarea/textarea.styles.js +17 -0
- app-rn-runtime/components/input/textarea/textarea.styles.js.map +1 -1
- app-rn-runtime/components/page/tabbar/curve.js +84 -0
- app-rn-runtime/components/page/tabbar/curve.js.map +1 -0
- app-rn-runtime/components/page/tabbar/tabbar.component.js +43 -9
- app-rn-runtime/components/page/tabbar/tabbar.component.js.map +1 -1
- app-rn-runtime/components/page/tabbar/tabbar.styles.js +54 -1
- app-rn-runtime/components/page/tabbar/tabbar.styles.js.map +1 -1
- app-rn-runtime/core/base.component.js +5 -1
- app-rn-runtime/core/base.component.js.map +1 -1
- app-rn-runtime/core/components/floatinglabel.component.js +45 -0
- app-rn-runtime/core/components/floatinglabel.component.js.map +1 -0
- app-rn-runtime/core/components/textinput.component.js +25 -2
- app-rn-runtime/core/components/textinput.component.js.map +1 -1
- app-rn-runtime/package.json +5 -3
- app-rn-runtime/styles/theme.js +36 -0
- app-rn-runtime/styles/theme.js.map +1 -1
- app-rn-runtime/styles/theme.variables.js +7 -0
- app-rn-runtime/styles/theme.variables.js.map +1 -1
|
@@ -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","skeleton","width","height","inputDisabledBgColor","textAlign"],"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 '../../basic/skeleton/skeleton.styles';\n\nexport type WmTextStyles = BaseStyles & {\n invalid: AllStyle;\n placeholderText: AllStyle;\n skeleton: WmSkeletonStyles
|
|
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 '../../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;AAYxF,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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
|
|
11
11
|
constructor(props) {
|
|
12
12
|
super(props, DEFAULT_CLASS, new WmTextareaProps(), new WmTextareaState());
|
|
13
13
|
}
|
|
14
|
+
getStyleClassName() {
|
|
15
|
+
const classes = [];
|
|
16
|
+
if (this.state.props.floatinglabel) {
|
|
17
|
+
classes.push('app-textarea-with-label');
|
|
18
|
+
}
|
|
19
|
+
classes.push(super.getStyleClassName());
|
|
20
|
+
return classes.join(' ');
|
|
21
|
+
}
|
|
14
22
|
renderWidget(props) {
|
|
15
23
|
var _this$state$textValue;
|
|
16
24
|
let opts = {};
|
|
@@ -31,6 +39,9 @@ export default class WmTextarea extends BaseInputComponent {
|
|
|
31
39
|
numberOfLines: 4,
|
|
32
40
|
keyboardType: this.state.keyboardType
|
|
33
41
|
}, opts, {
|
|
42
|
+
floatingLabel: props.floatinglabel,
|
|
43
|
+
floatingLabelStyle: this.styles.floatingLabel,
|
|
44
|
+
activeFloatingLabelStyle: this.styles.activeFloatingLabel,
|
|
34
45
|
autoComplete: props.autocomplete ? 'username' : 'off',
|
|
35
46
|
autoFocus: props.autofocus,
|
|
36
47
|
editable: props.disabled || props.readonly ? false : true,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","Platform","WmTextareaProps","DEFAULT_CLASS","BaseInputComponent","BaseInputState","WMTextInput","isNull","WmTextareaState","WmTextarea","constructor","props","renderWidget","_this$state$textValue","opts","valueExpr","OS","
|
|
1
|
+
{"version":3,"names":["React","Platform","WmTextareaProps","DEFAULT_CLASS","BaseInputComponent","BaseInputState","WMTextInput","isNull","WmTextareaState","WmTextarea","constructor","props","getStyleClassName","classes","state","floatinglabel","push","join","renderWidget","_this$state$textValue","opts","valueExpr","OS","textValue","toString","createElement","_extends","getTestPropsForInput","ref","widgetRef","selectionStart","selectionEnd","cursor","placeholderTextColor","styles","placeholderText","color","style","root","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 { Platform, TextInput, View } 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';\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 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 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,SAASC,QAAQ,QAAyB,cAAc;AACxD,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;AAE/B,OAAO,MAAMC,eAAe,SAASH,cAAc,CAAkB;AAErE,eAAe,MAAMI,UAAU,SAASL,kBAAkB,CAAqD;EAE7GM,WAAWA,CAACC,KAAsB,EAAE;IAClC,KAAK,CAACA,KAAK,EAAER,aAAa,EAAE,IAAID,eAAe,CAAC,CAAC,EAAE,IAAIM,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;EAEAC,YAAYA,CAACP,KAAsB,EAAE;IAAA,IAAAQ,qBAAA;IACnC,IAAIC,IAAS,GAAG,CAAC,CAAC;IAClB,MAAMC,SAAS,GAAGpB,QAAQ,CAACqB,EAAE,KAAK,KAAK,GAAG,OAAO,GAAG,cAAc;IAClE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,KAAK,CAAC4C,QAAQ,GAAG,KAAK,GAAG,IAAK;MAC1DC,SAAS,EAAE7C,KAAK,CAAC8C,QAAS;MAC1BC,WAAW,EAAE/C,KAAK,CAAC+C,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,CAAChC,MAAM,CAACK,IAAI,CAAC4B,UAAU,KAAK;IAAO,EAC/D,CAAC;EACJ;AACF"}
|
|
@@ -5,6 +5,7 @@ import BaseInputProps from '@wavemaker/app-rn-runtime/components/input/baseinput
|
|
|
5
5
|
export default class WmTextareaProps extends BaseInputProps {
|
|
6
6
|
constructor() {
|
|
7
7
|
super(...arguments);
|
|
8
|
+
_defineProperty(this, "floatinglabel", void 0);
|
|
8
9
|
_defineProperty(this, "placeholder", 'Place your text');
|
|
9
10
|
}
|
|
10
11
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["BaseInputProps","WmTextareaProps","constructor","arguments","_defineProperty"],"sources":["textarea.props.ts"],"sourcesContent":["import BaseInputProps from '@wavemaker/app-rn-runtime/components/input/baseinput/baseinput.props';\n\nexport default class WmTextareaProps extends BaseInputProps {\n placeholder: string = 'Place your text';\n}\n"],"mappings":";;;AAAA,OAAOA,cAAc,MAAM,sEAAsE;AAEjG,eAAe,MAAMC,eAAe,SAASD,cAAc,CAAC;EAAAE,YAAA;IAAA,SAAAC,SAAA;IAAAC,eAAA,
|
|
1
|
+
{"version":3,"names":["BaseInputProps","WmTextareaProps","constructor","arguments","_defineProperty"],"sources":["textarea.props.ts"],"sourcesContent":["import BaseInputProps from '@wavemaker/app-rn-runtime/components/input/baseinput/baseinput.props';\n\nexport default class WmTextareaProps extends BaseInputProps {\n floatinglabel?: string;\n placeholder: string = 'Place your text';\n}\n"],"mappings":";;;AAAA,OAAOA,cAAc,MAAM,sEAAsE;AAEjG,eAAe,MAAMC,eAAe,SAASD,cAAc,CAAC;EAAAE,YAAA;IAAA,SAAAC,SAAA;IAAAC,eAAA;IAAAA,eAAA,sBAEpC,iBAAiB;EAAA;AACzC"}
|
|
@@ -17,6 +17,8 @@ BASE_THEME.registerStyle((themeVariables, addStyle) => {
|
|
|
17
17
|
fontSize: 16,
|
|
18
18
|
textAlignVertical: 'top'
|
|
19
19
|
},
|
|
20
|
+
floatingLabel: {},
|
|
21
|
+
activeFloatingLabel: {},
|
|
20
22
|
invalid: {
|
|
21
23
|
borderBottomColor: 'red'
|
|
22
24
|
},
|
|
@@ -42,5 +44,20 @@ BASE_THEME.registerStyle((themeVariables, addStyle) => {
|
|
|
42
44
|
textAlign: 'right'
|
|
43
45
|
}
|
|
44
46
|
});
|
|
47
|
+
addStyle(DEFAULT_CLASS + '-with-label', '', {
|
|
48
|
+
text: {
|
|
49
|
+
paddingTop: 24
|
|
50
|
+
},
|
|
51
|
+
floatingLabel: {
|
|
52
|
+
position: 'absolute',
|
|
53
|
+
top: 12,
|
|
54
|
+
left: 16,
|
|
55
|
+
fontSize: 14,
|
|
56
|
+
color: themeVariables.floatingLabelColor
|
|
57
|
+
},
|
|
58
|
+
activeFloatingLabel: {
|
|
59
|
+
color: themeVariables.activeFloatingLabelColor
|
|
60
|
+
}
|
|
61
|
+
});
|
|
45
62
|
});
|
|
46
63
|
//# sourceMappingURL=textarea.styles.js.map
|
|
@@ -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","invalid","borderBottomColor","placeholderText","color","inputPlaceholderColor","skeleton","width","height","inputDisabledBgColor","textAlign"],"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 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 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});"],"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","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;AAWxF,OAAO,MAAMC,aAAa,GAAG,cAAc;AAC3CF,UAAU,CAACG,aAAa,CAAC,CAACC,cAAc,EAAEC,QAAQ,KAAK;EACrD,MAAMC,aAA+B,GAAGL,YAAY,CAAC;IACjDM,IAAI,EAAE;MACJC,OAAO,EAAC,EAAE;MACVC,WAAW,EAAC,CAAC;MACbC,WAAW,EAAE,OAAO;MACpBC,WAAW,EAAEP,cAAc,CAACQ,gBAAgB;MAC5CC,eAAe,EAAET,cAAc,CAACU,oBAAoB;MACpDC,YAAY,EAAE,CAAC;MACfC,UAAU,EAAEZ,cAAc,CAACa,QAAQ;MACnCC,SAAS,EAAE;IACb,CAAC;IACDC,IAAI,EAAE;MACJC,QAAQ,EAAE,EAAE;MACZC,iBAAiB,EAAE;IACrB,CAAC;IACDC,aAAa,EAAE,CAAC,CAAC;IACjBC,mBAAmB,EAAE,CAAC,CAAC;IACvBC,OAAO,EAAE;MACPC,iBAAiB,EAAE;IACrB,CAAC;IACDC,eAAe,EAAE;MACfC,KAAK,EAAEvB,cAAc,CAACwB;IACxB,CAAC;IACDC,QAAQ,EAAE;MACRtB,IAAI,EAAE;QACJuB,KAAK,EAAE,MAAM;QACbC,MAAM,EAAE,EAAE;QACVhB,YAAY,EAAE;MAChB;IACF;EACJ,CAAC,CAAC;EAEFV,QAAQ,CAACH,aAAa,EAAE,EAAE,EAAEI,aAAa,CAAC;EAC1CD,QAAQ,CAACH,aAAa,GAAG,WAAW,EAAE,EAAE,EAAE;IACtCK,IAAI,EAAG;MACLM,eAAe,EAAET,cAAc,CAAC4B;IAClC;EACJ,CAAC,CAAC;EACF3B,QAAQ,CAACH,aAAa,GAAG,MAAM,EAAE,EAAE,EAAE;IACnCK,IAAI,EAAC;MACH0B,SAAS,EAAE;IACb;EACF,CAAC,CAAC;EACF5B,QAAQ,CAACH,aAAa,GAAG,aAAa,EAAE,EAAE,EAAE;IAC1CiB,IAAI,EAAC;MACHe,UAAU,EAAE;IACd,CAAC;IACDZ,aAAa,EAAE;MACba,QAAQ,EAAE,UAAU;MACpBC,GAAG,EAAE,EAAE;MACPC,IAAI,EAAE,EAAE;MACRjB,QAAQ,EAAE,EAAE;MACZO,KAAK,EAAEvB,cAAc,CAACkC;IACxB,CAAC;IACDf,mBAAmB,EAAE;MACnBI,KAAK,EAAEvB,cAAc,CAACmC;IACxB;EACF,CAAC,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import * as d3Shape from "d3-shape";
|
|
2
|
+
// import { scale } from "react-native-size-scaling";
|
|
3
|
+
const scale = n => n;
|
|
4
|
+
//** Path Line */
|
|
5
|
+
const line = (width, height) => {
|
|
6
|
+
const path = d3Shape.line().x(d => d.x).y(d => d.y)([{
|
|
7
|
+
x: width / 2,
|
|
8
|
+
y: 0
|
|
9
|
+
}, {
|
|
10
|
+
x: width,
|
|
11
|
+
y: 0
|
|
12
|
+
}, {
|
|
13
|
+
x: width,
|
|
14
|
+
y: height
|
|
15
|
+
}, {
|
|
16
|
+
x: 0,
|
|
17
|
+
y: height
|
|
18
|
+
}, {
|
|
19
|
+
x: 0,
|
|
20
|
+
y: 0
|
|
21
|
+
}, {
|
|
22
|
+
x: width / 2,
|
|
23
|
+
y: 0
|
|
24
|
+
}]);
|
|
25
|
+
return path;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
//** Path Curved*/
|
|
29
|
+
const lineCurvedDown = (iPosition, height, circle) => {
|
|
30
|
+
const position = iPosition;
|
|
31
|
+
const circleWidth = circle + position;
|
|
32
|
+
const trim = (position + circleWidth) / 2;
|
|
33
|
+
const curved = d3Shape.line().x(d => d.x).y(d => d.y).curve(d3Shape.curveBasis)([{
|
|
34
|
+
x: position - scale(20),
|
|
35
|
+
y: 0
|
|
36
|
+
},
|
|
37
|
+
// border center left
|
|
38
|
+
{
|
|
39
|
+
x: position - scale(10),
|
|
40
|
+
y: scale(2)
|
|
41
|
+
}, {
|
|
42
|
+
x: position - scale(2),
|
|
43
|
+
y: scale(10)
|
|
44
|
+
}, {
|
|
45
|
+
x: position,
|
|
46
|
+
y: scale(17)
|
|
47
|
+
}, {
|
|
48
|
+
x: trim - scale(25),
|
|
49
|
+
y: height / 2 + scale(2)
|
|
50
|
+
}, {
|
|
51
|
+
x: trim - scale(10),
|
|
52
|
+
y: height / 2 + scale(10)
|
|
53
|
+
}, {
|
|
54
|
+
x: trim,
|
|
55
|
+
y: height / 2 + scale(10)
|
|
56
|
+
}, {
|
|
57
|
+
x: trim + scale(10),
|
|
58
|
+
y: height / 2 + scale(10)
|
|
59
|
+
}, {
|
|
60
|
+
x: trim + scale(25),
|
|
61
|
+
y: height / 2 + scale(2)
|
|
62
|
+
}, {
|
|
63
|
+
x: circleWidth,
|
|
64
|
+
y: scale(17)
|
|
65
|
+
},
|
|
66
|
+
// border center right
|
|
67
|
+
{
|
|
68
|
+
x: circleWidth + scale(2),
|
|
69
|
+
y: scale(10)
|
|
70
|
+
}, {
|
|
71
|
+
x: circleWidth + scale(10),
|
|
72
|
+
y: 0
|
|
73
|
+
}, {
|
|
74
|
+
x: circleWidth + scale(20),
|
|
75
|
+
y: 0
|
|
76
|
+
}]);
|
|
77
|
+
return curved;
|
|
78
|
+
};
|
|
79
|
+
export const getPathDown = (width, iHeight, centerWidth, clippedTabbarHeight) => {
|
|
80
|
+
const height = scale(iHeight);
|
|
81
|
+
const circleWidth = scale(centerWidth) + scale(16);
|
|
82
|
+
return `${line(width, clippedTabbarHeight)} ${lineCurvedDown(width / 2 - circleWidth / 2, height, circleWidth)}`;
|
|
83
|
+
};
|
|
84
|
+
//# sourceMappingURL=curve.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["d3Shape","scale","n","line","width","height","path","x","d","y","lineCurvedDown","iPosition","circle","position","circleWidth","trim","curved","curve","curveBasis","getPathDown","iHeight","centerWidth","clippedTabbarHeight"],"sources":["curve.tsx"],"sourcesContent":["import * as d3Shape from \"d3-shape\";\n// import { scale } from \"react-native-size-scaling\";\nconst scale = (n: number) => n;\n\ninterface LineDatum {\n x: number;\n y: number;\n missing?: boolean;\n}\n\n//** Path Line */\nconst line = (width : number, height: number) => {\n const path: any = d3Shape\n .line<LineDatum>()\n .x((d) => d.x)\n .y((d) => d.y)([\n { x: width / 2, y: 0 },\n { x: width, y: 0 },\n { x: width, y: height },\n { x: 0, y: height},\n { x: 0, y: 0 },\n { x: width / 2, y: 0 },\n ]);\n \nreturn path;\n};\n\n//** Path Curved*/\nconst lineCurvedDown = (iPosition: number, height: number, circle: number) => {\n const position = iPosition;\n const circleWidth = circle + position;\n const trim = (position + circleWidth) / 2;\n \n const curved: any = d3Shape\n .line<LineDatum>()\n .x((d) => d.x)\n .y((d) => d.y)\n .curve(d3Shape.curveBasis)([\n { x: position - scale(20), y: 0 }, // border center left\n { x: position - scale(10), y: scale(2) },\n { x: position - scale(2), y: scale(10) },\n { x: position, y: scale(17) },\n \n { x: trim - scale(25), y: height / 2 + scale(2) },\n { x: trim - scale(10), y: height / 2 + scale(10) },\n { x: trim, y: height / 2 + scale(10) },\n { x: trim + scale(10), y: height / 2 + scale(10) },\n { x: trim + scale(25), y: height / 2 + scale(2) },\n \n { x: circleWidth, y: scale(17) }, // border center right\n { x: circleWidth + scale(2), y: scale(10) },\n { x: circleWidth + scale(10), y: 0 },\n { x: circleWidth + scale(20), y: 0 },\n ]);\n return curved;\n};\n\nexport const getPathDown = (width: number, iHeight: number, centerWidth: number, clippedTabbarHeight: number) => {\n const height = scale(iHeight);\n const circleWidth = scale(centerWidth) + scale(16);\n return `${line(width, clippedTabbarHeight)} ${lineCurvedDown(\n width / 2 - circleWidth / 2,\n height,\n circleWidth\n )}`;\n};\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O,WAAW,GAAGb,KAAK,CAAC,CAAC,CAAC;IAAEQ,CAAC,EAAER,KAAK,CAAC,EAAE;EAAE,CAAC,EAC3C;IAAEM,CAAC,EAAEO,WAAW,GAAGb,KAAK,CAAC,EAAE,CAAC;IAAEQ,CAAC,EAAE;EAAE,CAAC,EACpC;IAAEF,CAAC,EAAEO,WAAW,GAAGb,KAAK,CAAC,EAAE,CAAC;IAAEQ,CAAC,EAAE;EAAE,CAAC,CACrC,CAAC;EACJ,OAAOO,MAAM;AACf,CAAC;AAED,OAAO,MAAMG,WAAW,GAAGA,CAACf,KAAa,EAAEgB,OAAe,EAAEC,WAAmB,EAAEC,mBAA2B,KAAK;EAC/G,MAAMjB,MAAM,GAAGJ,KAAK,CAACmB,OAAO,CAAC;EAC7B,MAAMN,WAAW,GAAGb,KAAK,CAACoB,WAAW,CAAC,GAAGpB,KAAK,CAAC,EAAE,CAAC;EAClD,OAAQ,GAAEE,IAAI,CAACC,KAAK,EAAEkB,mBAAmB,CAAE,IAAGZ,cAAc,CAC1DN,KAAK,GAAG,CAAC,GAAGU,WAAW,GAAG,CAAC,EAC3BT,MAAM,EACNS,WACF,CAAE,EAAC;AACL,CAAC"}
|
|
@@ -3,7 +3,7 @@ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key i
|
|
|
3
3
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
4
4
|
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
5
5
|
import React from 'react';
|
|
6
|
-
import { Text, View, TouchableOpacity } from 'react-native';
|
|
6
|
+
import { Text, View, TouchableOpacity, Dimensions } from 'react-native';
|
|
7
7
|
import { ThemeProvider } from '@wavemaker/app-rn-runtime/styles/theme';
|
|
8
8
|
import { ModalConsumer } from '@wavemaker/app-rn-runtime/core/modal.service';
|
|
9
9
|
import WmIcon from '@wavemaker/app-rn-runtime/components/basic/icon/icon.component';
|
|
@@ -11,32 +11,47 @@ import { NavigationServiceConsumer } from '@wavemaker/app-rn-runtime/core/naviga
|
|
|
11
11
|
import { BaseNavComponent, BaseNavState } from '@wavemaker/app-rn-runtime/components/navigation/basenav/basenav.component';
|
|
12
12
|
import WmTabbarProps from './tabbar.props';
|
|
13
13
|
import { DEFAULT_CLASS } from './tabbar.styles';
|
|
14
|
+
import Svg, { Path } from 'react-native-svg';
|
|
15
|
+
import { getPathDown } from './curve';
|
|
16
|
+
// import { scale } from 'react-native-size-scaling';
|
|
17
|
+
import ThemeVariables from '@wavemaker/app-rn-runtime/styles/theme.variables';
|
|
18
|
+
const scale = n => n;
|
|
14
19
|
class WmTabbarState extends BaseNavState {
|
|
15
20
|
constructor() {
|
|
16
21
|
super(...arguments);
|
|
17
22
|
_defineProperty(this, "showMore", false);
|
|
18
23
|
_defineProperty(this, "modalOptions", {});
|
|
24
|
+
_defineProperty(this, "dataItems", []);
|
|
19
25
|
}
|
|
20
26
|
}
|
|
21
27
|
export default class WmTabbar extends BaseNavComponent {
|
|
22
28
|
constructor(props) {
|
|
23
29
|
super(props, DEFAULT_CLASS, new WmTabbarProps(), new WmTabbarState());
|
|
24
30
|
_defineProperty(this, "tabbarHeight", 0);
|
|
31
|
+
_defineProperty(this, "maxWidth", Dimensions.get("window").width);
|
|
32
|
+
_defineProperty(this, "returnpathDown", void 0);
|
|
25
33
|
}
|
|
26
34
|
renderTabItem(item, testId, props, onSelect) {
|
|
35
|
+
let floating = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
|
|
27
36
|
const isActive = props.isActive && props.isActive(item);
|
|
28
37
|
const getDisplayLabel = this.props.getDisplayExpression || (label => label);
|
|
29
|
-
|
|
38
|
+
let increasedGap = Number(testId) === (item === null || item === void 0 ? void 0 : item.indexBeforeMid) && this.state.dataItems.length % 2 != 0 && (props.classname || '').indexOf('clipped-tabbar') >= 0 ? [this.styles.tabItem, {
|
|
39
|
+
paddingRight: 70
|
|
40
|
+
}] : [this.styles.tabItem];
|
|
41
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
42
|
+
style: [increasedGap, floating ? this.styles.centerHubItem : {}],
|
|
43
|
+
key: `${item.label}_${testId}`
|
|
44
|
+
}, /*#__PURE__*/React.createElement(TouchableOpacity, _extends({}, this.getTestPropsForAction('item' + testId), {
|
|
30
45
|
onPress: () => onSelect && onSelect(),
|
|
31
46
|
key: item.key
|
|
32
47
|
}), /*#__PURE__*/React.createElement(View, {
|
|
33
|
-
style: [
|
|
48
|
+
style: [isActive && !floating ? this.styles.activeTabItem : {}]
|
|
34
49
|
}, /*#__PURE__*/React.createElement(WmIcon, {
|
|
35
|
-
styles: this.theme.mergeStyle({}, this.styles.tabIcon, isActive ? this.styles.activeTabIcon : {}),
|
|
50
|
+
styles: this.theme.mergeStyle({}, this.styles.tabIcon, floating ? this.styles.centerHubIcon : {}, isActive && !floating ? this.styles.activeTabIcon : {}),
|
|
36
51
|
iconclass: item.icon
|
|
37
52
|
}), /*#__PURE__*/React.createElement(Text, {
|
|
38
|
-
style: [this.styles.tabLabel, isActive ? this.styles.activeTabLabel : {}]
|
|
39
|
-
}, getDisplayLabel(item.label))));
|
|
53
|
+
style: [this.styles.tabLabel, floating ? this.styles.centerHubLabel : {}, isActive && !floating ? this.styles.activeTabLabel : {}]
|
|
54
|
+
}, getDisplayLabel(item.label)))));
|
|
40
55
|
}
|
|
41
56
|
onItemSelect(item, navigationService) {
|
|
42
57
|
item.link && navigationService.openUrl(item.link);
|
|
@@ -54,6 +69,14 @@ export default class WmTabbar extends BaseNavComponent {
|
|
|
54
69
|
renderWidget(props) {
|
|
55
70
|
let max = 5;
|
|
56
71
|
const tabItems = this.state.dataItems;
|
|
72
|
+
const tabItemsLength = tabItems.length;
|
|
73
|
+
const isClippedTabbar = (props.classname || '').indexOf('clipped-tabbar') >= 0 && tabItemsLength % 2 !== 0;
|
|
74
|
+
if (tabItemsLength % 2 !== 0) {
|
|
75
|
+
const middleIndex = Math.floor(tabItemsLength / 2);
|
|
76
|
+
tabItems[middleIndex]['floating'] = true;
|
|
77
|
+
tabItems[middleIndex - 1]['indexBeforeMid'] = middleIndex - 1;
|
|
78
|
+
}
|
|
79
|
+
this.returnpathDown = getPathDown(this.maxWidth, 65, 60, this.styles.root.height);
|
|
57
80
|
const moreItems = [];
|
|
58
81
|
if (tabItems.length > max) {
|
|
59
82
|
const moreItemsCount = Math.ceil((tabItems.length + 1 - max) / max) * max;
|
|
@@ -71,7 +94,18 @@ export default class WmTabbar extends BaseNavComponent {
|
|
|
71
94
|
}
|
|
72
95
|
return /*#__PURE__*/React.createElement(NavigationServiceConsumer, null, navigationService => /*#__PURE__*/React.createElement(View, {
|
|
73
96
|
style: this.styles.root
|
|
74
|
-
}, /*#__PURE__*/React.createElement(
|
|
97
|
+
}, isClippedTabbar ? /*#__PURE__*/React.createElement(Svg, {
|
|
98
|
+
width: this.maxWidth,
|
|
99
|
+
height: scale(this.styles.root.height),
|
|
100
|
+
style: {
|
|
101
|
+
zIndex: -1,
|
|
102
|
+
position: 'absolute',
|
|
103
|
+
backgroundColor: ThemeVariables.INSTANCE.transparent
|
|
104
|
+
}
|
|
105
|
+
}, /*#__PURE__*/React.createElement(Path, {
|
|
106
|
+
fill: ThemeVariables.INSTANCE.tabbarBackgroundColor,
|
|
107
|
+
d: this.returnpathDown
|
|
108
|
+
})) : /*#__PURE__*/React.createElement(React.Fragment, null), /*#__PURE__*/React.createElement(ModalConsumer, null, modalService => {
|
|
75
109
|
if (this.state.showMore) {
|
|
76
110
|
modalService.showModal(this.prepareModalOptions( /*#__PURE__*/React.createElement(ThemeProvider, {
|
|
77
111
|
value: this.theme
|
|
@@ -80,7 +114,7 @@ export default class WmTabbar extends BaseNavComponent {
|
|
|
80
114
|
}, moreItems.map((a, i) => /*#__PURE__*/React.createElement(View, {
|
|
81
115
|
key: i,
|
|
82
116
|
style: this.styles.moreMenuRow
|
|
83
|
-
}, a.map(item => this.renderTabItem(item, i + '', props, () => this.onItemSelect(item, navigationService)))))))));
|
|
117
|
+
}, a.map((item, index) => this.renderTabItem(item, i + '', props, () => this.onItemSelect(item, navigationService)))))))));
|
|
84
118
|
} else {
|
|
85
119
|
modalService.hideModal(this.state.modalOptions);
|
|
86
120
|
}
|
|
@@ -90,7 +124,7 @@ export default class WmTabbar extends BaseNavComponent {
|
|
|
90
124
|
onLayout: e => {
|
|
91
125
|
this.tabbarHeight = e.nativeEvent.layout.height;
|
|
92
126
|
}
|
|
93
|
-
}, tabItems.filter((item, i) => i < max).map((item, i) => this.renderTabItem(item, i + '', props, () => this.onItemSelect(item, navigationService))), tabItems.length > max && this.renderTabItem({
|
|
127
|
+
}, tabItems.filter((item, i) => i < max).map((item, i) => this.renderTabItem(item, i + '', props, () => this.onItemSelect(item, navigationService), item.floating)), tabItems.length > max && this.renderTabItem({
|
|
94
128
|
label: props.morebuttonlabel,
|
|
95
129
|
icon: props.morebuttoniconclass
|
|
96
130
|
}, 6666 + '', props, () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","Text","View","TouchableOpacity","ThemeProvider","ModalConsumer","WmIcon","NavigationServiceConsumer","BaseNavComponent","BaseNavState","WmTabbarProps","DEFAULT_CLASS","WmTabbarState","constructor","arguments","_defineProperty","WmTabbar","props","renderTabItem","item","testId","onSelect","isActive","getDisplayLabel","getDisplayExpression","label","createElement","_extends","getTestPropsForAction","onPress","key","style","styles","tabItem","activeTabItem","theme","mergeStyle","tabIcon","activeTabIcon","iconclass","icon","tabLabel","activeTabLabel","onItemSelect","navigationService","link","openUrl","invokeEventCallback","proxy","prepareModalOptions","content","o","state","modalOptions","modalStyle","bottom","tabbarHeight","contentStyle","modalContent","renderWidget","max","tabItems","dataItems","moreItems","length","moreItemsCount","Math","ceil","j","i","row","push","root","modalService","showMore","showModal","value","moreMenu","map","a","moreMenuRow","hideModal","menu","onLayout","e","nativeEvent","layout","height","filter","morebuttonlabel","morebuttoniconclass","updateState"],"sources":["tabbar.component.tsx"],"sourcesContent":["import React, { ReactNode } from 'react';\nimport { Text, View, TouchableOpacity } from 'react-native';\n\nimport { ThemeProvider } from '@wavemaker/app-rn-runtime/styles/theme';\nimport { ModalConsumer, ModalOptions, ModalService } from '@wavemaker/app-rn-runtime/core/modal.service';\nimport WmIcon from '@wavemaker/app-rn-runtime/components/basic/icon/icon.component';\nimport NavigationService, { NavigationServiceConsumer } from '@wavemaker/app-rn-runtime/core/navigation.service';\nimport { BaseNavProps } from '@wavemaker/app-rn-runtime/components/navigation/basenav/basenav.props';\nimport { BaseNavComponent, BaseNavState, NavigationDataItem } from '@wavemaker/app-rn-runtime/components/navigation/basenav/basenav.component';\n\nimport WmTabbarProps from './tabbar.props';\nimport { DEFAULT_CLASS, WmTabbarStyles } from './tabbar.styles';\n\nclass WmTabbarState<T extends BaseNavProps> extends BaseNavState<T>{\n showMore = false;\n modalOptions = {} as ModalOptions;\n}\n\nexport default class WmTabbar extends BaseNavComponent<WmTabbarProps, WmTabbarState<WmTabbarProps>, WmTabbarStyles> {\n\n private tabbarHeight = 0;\n\n constructor(props: WmTabbarProps) {\n super(props, DEFAULT_CLASS, new WmTabbarProps(), new WmTabbarState());\n }\n\n renderTabItem(item: NavigationDataItem, testId: string, props: WmTabbarProps, onSelect: Function) {\n const isActive = props.isActive && props.isActive(item);\n const getDisplayLabel = this.props.getDisplayExpression || ((label: string) => label);\n return (\n <TouchableOpacity {...this.getTestPropsForAction('item' + testId)} onPress={() => onSelect && onSelect()} key={item.key}>\n <View style={[this.styles.tabItem, isActive ? this.styles.activeTabItem: {}]}>\n <WmIcon styles={this.theme.mergeStyle({}, this.styles.tabIcon, isActive ? this.styles.activeTabIcon: {})} iconclass={item.icon}></WmIcon>\n <Text style={[this.styles.tabLabel, isActive ? this.styles.activeTabLabel: {}]}>{getDisplayLabel(item.label)}</Text>\n </View>\n </TouchableOpacity>\n );\n }\n\n onItemSelect(item: NavigationDataItem, navigationService: NavigationService) {\n item.link && navigationService.openUrl(item.link);\n this.invokeEventCallback('onSelect', [null, this.proxy, item]);\n }\n\n prepareModalOptions(content: ReactNode) {\n const o = this.state.modalOptions;\n o.content = content;\n o.modalStyle = {\n bottom: this.tabbarHeight\n };\n o.contentStyle = this.styles.modalContent; \n return o;\n }\n\n renderWidget(props: WmTabbarProps) {\n let max = 5;\n const tabItems = this.state.dataItems;\n const moreItems = [] as any[][];\n if (tabItems.length > max) {\n const moreItemsCount = Math.ceil((tabItems.length + 1 - max)/ max) * max;\n let j = 0;\n for (let i = max-1; i < moreItemsCount;) {\n const row = [];\n for (let j = 0; j < max; j++) {\n row[j] = tabItems[i++] || {key: 'tabItem' + i} as NavigationDataItem;\n }\n moreItems.push(row);\n }\n max = max - 1;\n }\n return (\n <NavigationServiceConsumer>\n {(navigationService) =>\n (<View style={this.styles.root}>\n <ModalConsumer>\n {(modalService: ModalService) => {\n if (this.state.showMore) {\n modalService.showModal(this.prepareModalOptions((\n <ThemeProvider value={this.theme} >\n <View style={this.styles.moreMenu}>\n {moreItems.map((a, i) =>\n (<View key={i} style={this.styles.moreMenuRow}>\n {a.map(item => this.renderTabItem(item, i + '', props, () => this.onItemSelect(item, navigationService)))}\n </View>)\n )}\n </View>\n </ThemeProvider>)));\n } else {\n modalService.hideModal(this.state.modalOptions);\n }\n return null;\n }}\n </ModalConsumer>\n <View style={this.styles.menu}\n onLayout={e => { this.tabbarHeight = e.nativeEvent.layout.height}}>\n {tabItems.filter((item, i) => i < max)\n .map((item, i) => this.renderTabItem(item, i + '', props, () => this.onItemSelect(item, navigationService)))}\n {tabItems.length > max && (\n this.renderTabItem({\n label: props.morebuttonlabel,\n icon: props.morebuttoniconclass\n } as NavigationDataItem, 6666 +'', props, () => {\n this.updateState({showMore: !this.state.showMore} as WmTabbarState<WmTabbarProps>);\n })\n )}\n </View>\n </View>)}\n </NavigationServiceConsum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MACjBO,KAAK,EAAER,KAAK,CAACwE,eAAe;MAC5BjD,IAAI,EAAEvB,KAAK,CAACyE;IACd,CAAC,EAAwB,IAAI,GAAE,EAAE,EAAEzE,KAAK,EAAG,MAAM;MAC/C,IAAI,CAAC0E,WAAW,CAAC;QAACjB,QAAQ,EAAE,CAAC,IAAI,CAACtB,KAAK,CAACsB;MAAQ,CAAiC,CAAC;IACpF,CAAC,CAEC,CACF,CACmB,CAAC;EAEhC;AACF"}
|
|
1
|
+
{"version":3,"names":["React","Text","View","TouchableOpacity","Dimensions","ThemeProvider","ModalConsumer","WmIcon","NavigationServiceConsumer","BaseNavComponent","BaseNavState","WmTabbarProps","DEFAULT_CLASS","Svg","Path","getPathDown","ThemeVariables","scale","n","WmTabbarState","constructor","arguments","_defineProperty","WmTabbar","props","get","width","renderTabItem","item","testId","onSelect","floating","length","undefined","isActive","getDisplayLabel","getDisplayExpression","label","increasedGap","Number","indexBeforeMid","state","dataItems","classname","indexOf","styles","tabItem","paddingRight","createElement","style","centerHubItem","key","_extends","getTestPropsForAction","onPress","activeTabItem","theme","mergeStyle","tabIcon","centerHubIcon","activeTabIcon","iconclass","icon","tabLabel","centerHubLabel","activeTabLabel","onItemSelect","navigationService","link","openUrl","invokeEventCallback","proxy","prepareModalOptions","content","o","modalOptions","modalStyle","bottom","tabbarHeight","contentStyle","modalContent","renderWidget","max","tabItems","tabItemsLength","isClippedTabbar","middleIndex","Math","floor","returnpathDown","maxWidth","root","height","moreItems","moreItemsCount","ceil","j","i","row","push","zIndex","position","backgroundColor","INSTANCE","transparent","fill","tabbarBackgroundColor","d","Fragment","modalService","showMore","showModal","value","moreMenu","map","a","moreMenuRow","index","hideModal","menu","onLayout","e","nativeEvent","layout","filter","morebuttonlabel","morebuttoniconclass","updateState"],"sources":["tabbar.component.tsx"],"sourcesContent":["import React, { ReactNode } from 'react';\nimport { Text, View, TouchableOpacity, Dimensions } from 'react-native';\n\nimport { ThemeProvider } from '@wavemaker/app-rn-runtime/styles/theme';\nimport { ModalConsumer, ModalOptions, ModalService } from '@wavemaker/app-rn-runtime/core/modal.service';\nimport WmIcon from '@wavemaker/app-rn-runtime/components/basic/icon/icon.component';\nimport NavigationService, { NavigationServiceConsumer } from '@wavemaker/app-rn-runtime/core/navigation.service';\nimport { BaseNavProps } from '@wavemaker/app-rn-runtime/components/navigation/basenav/basenav.props';\nimport { BaseNavComponent, BaseNavState, NavigationDataItem } from '@wavemaker/app-rn-runtime/components/navigation/basenav/basenav.component';\n\nimport WmTabbarProps from './tabbar.props';\nimport { DEFAULT_CLASS, WmTabbarStyles } from './tabbar.styles';\nimport Svg, { Path } from 'react-native-svg';\nimport { getPathDown } from './curve';\n// import { scale } from 'react-native-size-scaling';\nimport ThemeVariables from '@wavemaker/app-rn-runtime/styles/theme.variables';\n\ninterface TabDataItem extends NavigationDataItem {\n floating: boolean;\n indexBeforeMid: number;\n}\n\nconst scale = (n: number) => n;\n\nclass WmTabbarState<T extends BaseNavProps> extends BaseNavState<T> {\n showMore = false;\n modalOptions = {} as ModalOptions;\n dataItems: TabDataItem[] = [];\n}\n\nexport default class WmTabbar extends BaseNavComponent<WmTabbarProps, WmTabbarState<WmTabbarProps>, WmTabbarStyles> {\n\n private tabbarHeight = 0;\n\n constructor(props: WmTabbarProps) {\n super(props, DEFAULT_CLASS, new WmTabbarProps(), new WmTabbarState());\n }\n\n private maxWidth = Dimensions.get(\"window\").width; \n private returnpathDown: any;\n\n renderTabItem(item: TabDataItem, testId: string, props: WmTabbarProps, onSelect: Function, floating = false) {\n\n const isActive = props.isActive && props.isActive(item);\n const getDisplayLabel = this.props.getDisplayExpression || ((label: string) => label);\n let increasedGap = Number(testId) === item?.indexBeforeMid && (this.state.dataItems.length % 2!=0) && ((props.classname || '').indexOf('clipped-tabbar') >= 0)\n ? [this.styles.tabItem, { paddingRight: 70 }]\n : [this.styles.tabItem];\n \n return (\n <View style={[increasedGap, floating? this.styles.centerHubItem: {}]} key={`${item.label}_${testId}`}>\n <TouchableOpacity {...this.getTestPropsForAction('item' + testId)} onPress={() => onSelect && onSelect()} key={item.key}>\n <View style={[isActive && !floating ? this.styles.activeTabItem : {}]}>\n <WmIcon styles={this.theme.mergeStyle({}, this.styles.tabIcon ,floating? this.styles.centerHubIcon: {}, isActive && !floating ? this.styles.activeTabIcon : {})}\n iconclass={item.icon}></WmIcon>\n <Text style={[this.styles.tabLabel,floating? this.styles.centerHubLabel: {}, isActive && !floating ? this.styles.activeTabLabel: {}]}>{getDisplayLabel(item.label)}</Text>\n </View>\n </TouchableOpacity>\n </View>\n );\n}\n\n onItemSelect(item: TabDataItem, navigationService: NavigationService) {\n item.link && navigationService.openUrl(item.link);\n this.invokeEventCallback('onSelect', [null, this.proxy, item]);\n }\n\n prepareModalOptions(content: ReactNode) {\n const o = this.state.modalOptions;\n o.content = content;\n o.modalStyle = {\n bottom: this.tabbarHeight\n };\n o.contentStyle = this.styles.modalContent; \n return o;\n }\n\n renderWidget(props: WmTabbarProps) {\n let max = 5;\n const tabItems = this.state.dataItems;\n const tabItemsLength = tabItems.length;\n const isClippedTabbar = ((props.classname || '').indexOf('clipped-tabbar') >= 0) && (tabItemsLength % 2 !== 0);\n if (tabItemsLength % 2 !== 0) {\n const middleIndex = Math.floor(tabItemsLength / 2);\n tabItems[middleIndex]['floating'] = true;\n tabItems[middleIndex - 1]['indexBeforeMid'] = middleIndex-1;\n }\n this.returnpathDown = getPathDown(this.maxWidth, 65 ,60,this.styles.root.height as number);\n const moreItems = [] as any[][];\n if (tabItems.length > max) {\n const moreItemsCount = Math.ceil((tabItems.length + 1 - max)/ max) * max;\n let j = 0;\n for (let i = max-1; i < moreItemsCount;) {\n const row = [];\n for (let j = 0; j < max; j++) {\n row[j] = tabItems[i++] || {key: 'tabItem' + i} as TabDataItem;\n }\n moreItems.push(row);\n }\n max = max - 1;\n }\n return (\n <NavigationServiceConsumer>\n {(navigationService) =>\n (<View style={this.styles.root}>\n {isClippedTabbar ? (\n <Svg width={this.maxWidth} height={scale(this.styles.root.height as number)} style={{zIndex: -1,position: 'absolute',backgroundColor: ThemeVariables.INSTANCE.transparent}}>\n <Path fill={ThemeVariables.INSTANCE.tabbarBackgroundColor} {...{ d: this.returnpathDown }}/>\n </Svg>\n ): <></>} \n <ModalConsumer>\n {(modalService: ModalService) => {\n if (this.state.showMore) {\n modalService.showModal(this.prepareModalOptions((\n <ThemeProvider value={this.theme} >\n <View style={this.styles.moreMenu}>\n {moreItems.map((a, i) =>\n (<View key={i} style={this.styles.moreMenuRow}>\n {a.map((item, index) => this.renderTabItem(item, i + '', props, () => this.onItemSelect(item, navigationService)))}\n </View>)\n )}\n </View>\n </ThemeProvider>)));\n } else {\n modalService.hideModal(this.state.modalOptions);\n }\n return null;\n }}\n </ModalConsumer>\n <View style={this.styles.menu}\n onLayout={e => { this.tabbarHeight = e.nativeEvent.layout.height}}> \n {tabItems.filter((item, i) => i < max)\n .map((item, i) => this.renderTabItem(item, i + '', props, () => this.onItemSelect(item, navigationService), item.floating))}\n {tabItems.length > max && (\n this.renderTabItem({\n label: props.morebuttonlabel,\n icon: props.morebuttoniconclass\n } as TabDataItem, 6666 +'', props, () => {\n this.updateState({showMore: !this.state.showMore} as WmTabbarState<WmTabbarProps>);\n })\n )}\n </View>\n </View>)}\n </NavigationServiceConsumer>\n );\n }\n}\n"],"mappings":";;;;AAAA,OAAOA,KAAK,MAAqB,OAAO;AACxC,SAASC,IAAI,EAAEC,IAAI,EAAEC,gBAAgB,EAAEC,UAAU,QAAQ,cAAc;AAEvE,SAASC,aAAa,QAAQ,wCAAwC;AACtE,SAASC,aAAa,QAAoC,8CAA8C;AACxG,OAAOC,MAAM,MAAM,gEAAgE;AACnF,SAA4BC,yBAAyB,QAAQ,mDAAmD;AAEhH,SAASC,gBAAgB,EAAEC,YAAY,QAA4B,2EAA2E;AAE9I,OAAOC,aAAa,MAAM,gBAAgB;AAC1C,SAASC,aAAa,QAAwB,iBAAiB;AAC/D,OAAOC,GAAG,IAAIC,IAAI,QAAQ,kB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E,CAAC,CAAC;MACrB,CAAC,MAAM;QACL0C,YAAY,CAACS,SAAS,CAAC,IAAI,CAAC7E,KAAK,CAACkC,YAAY,CAAC;MACjD;MACA,OAAO,IAAI;IACb,CACa,CAAC,eAChB3E,KAAA,CAAAgD,aAAA,CAAC9C,IAAI;MAAC+C,KAAK,EAAE,IAAI,CAACJ,MAAM,CAAC0E,IAAK;MAC5BC,QAAQ,EAAEC,CAAC,IAAI;QAAE,IAAI,CAAC3C,YAAY,GAAG2C,CAAC,CAACC,WAAW,CAACC,MAAM,CAAC/B,MAAM;MAAA;IAAE,GACjET,QAAQ,CAACyC,MAAM,CAAC,CAAChG,IAAI,EAAEqE,CAAC,KAAKA,CAAC,GAAGf,GAAG,CAAC,CACnCgC,GAAG,CAAC,CAACtF,IAAI,EAAEqE,CAAC,KAAK,IAAI,CAACtE,aAAa,CAACC,IAAI,EAAEqE,CAAC,GAAG,EAAE,EAAEzE,KAAK,EAAE,MAAM,IAAI,CAAC0C,YAAY,CAACtC,IAAI,EAAEuC,iBAAiB,CAAC,EAAEvC,IAAI,CAACG,QAAQ,CAAC,CAAC,EAC5HoD,QAAQ,CAACnD,MAAM,GAAGkD,GAAG,IACpB,IAAI,CAACvD,aAAa,CAAC;MACjBU,KAAK,EAAEb,KAAK,CAACqG,eAAe;MAC5B/D,IAAI,EAAEtC,KAAK,CAACsG;IACd,CAAC,EAAiB,IAAI,GAAE,EAAE,EAAEtG,KAAK,EAAG,MAAM;MACxC,IAAI,CAACuG,WAAW,CAAC;QAACjB,QAAQ,EAAE,CAAC,IAAI,CAACrE,KAAK,CAACqE;MAAQ,CAAiC,CAAC;IACpF,CAAC,CAEC,CACF,CACmB,CAAC;EAEhC;AACF"}
|
|
@@ -71,9 +71,17 @@ BASE_THEME.registerStyle((themeVariables, addStyle) => {
|
|
|
71
71
|
marginTop: -32,
|
|
72
72
|
paddingBottom: 14
|
|
73
73
|
},
|
|
74
|
-
activeTabLabel: {}
|
|
74
|
+
activeTabLabel: {},
|
|
75
|
+
centerHubItem: {},
|
|
76
|
+
centerHubIcon: {},
|
|
77
|
+
centerHubLabel: {}
|
|
75
78
|
});
|
|
76
79
|
addStyle(DEFAULT_CLASS, '', defaultStyles);
|
|
80
|
+
addStyle('tabbar-spacer', '', {
|
|
81
|
+
root: {
|
|
82
|
+
height: 96
|
|
83
|
+
}
|
|
84
|
+
});
|
|
77
85
|
addStyle(DEFAULT_CLASS + '-1', '', {
|
|
78
86
|
root: {
|
|
79
87
|
height: undefined
|
|
@@ -96,5 +104,50 @@ BASE_THEME.registerStyle((themeVariables, addStyle) => {
|
|
|
96
104
|
marginTop: 0
|
|
97
105
|
}
|
|
98
106
|
});
|
|
107
|
+
addStyle('clipped-tabbar', '', {
|
|
108
|
+
root: {
|
|
109
|
+
backgroundColor: themeVariables.transparent,
|
|
110
|
+
marginTop: -88
|
|
111
|
+
},
|
|
112
|
+
menu: {
|
|
113
|
+
backgroundColor: themeVariables.transparent
|
|
114
|
+
},
|
|
115
|
+
centerHubItem: {
|
|
116
|
+
width: 70,
|
|
117
|
+
height: 70,
|
|
118
|
+
shadowColor: 'grey',
|
|
119
|
+
shadowOpacity: 0.1,
|
|
120
|
+
opacity: 1,
|
|
121
|
+
shadowOffset: {
|
|
122
|
+
width: 2,
|
|
123
|
+
height: 0
|
|
124
|
+
},
|
|
125
|
+
shadowRadius: 2,
|
|
126
|
+
borderRadius: 35,
|
|
127
|
+
position: 'absolute',
|
|
128
|
+
bottom: 53,
|
|
129
|
+
alignItems: 'center',
|
|
130
|
+
justifyContent: 'center',
|
|
131
|
+
backgroundColor: themeVariables.centerHubItemColor,
|
|
132
|
+
left: themeVariables.maxWidth / 2 - 35
|
|
133
|
+
},
|
|
134
|
+
centerHubIcon: {
|
|
135
|
+
root: {
|
|
136
|
+
alignSelf: 'center',
|
|
137
|
+
paddingBottom: 0,
|
|
138
|
+
borderBottomColor: themeVariables.transparent,
|
|
139
|
+
borderBottomWidth: 0
|
|
140
|
+
},
|
|
141
|
+
icon: {
|
|
142
|
+
fontSize: 24,
|
|
143
|
+
color: themeVariables.centerHubIconColor
|
|
144
|
+
}
|
|
145
|
+
},
|
|
146
|
+
centerHubLabel: {
|
|
147
|
+
color: themeVariables.centerHubLabelColor,
|
|
148
|
+
marginTop: 0,
|
|
149
|
+
paddingBottom: 4
|
|
150
|
+
}
|
|
151
|
+
});
|
|
99
152
|
});
|
|
100
153
|
//# sourceMappingURL=tabbar.styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["BASE_THEME","defineStyles","DEFAULT_CLASS","registerStyle","themeVariables","addStyle","defaultStyles","root","height","text","menu","flexDirection","backgroundColor","tabbarBackgroundColor","justifyContent","alignItems","modalContent","moreMenu","width","getStyle","shadowOffset","shadowOpacity","shadowRadius","moreMenuRow","paddingTop","paddingBottom","tabItem","minWidth","opacity","activeTabItem","tabIcon","alignSelf","borderBottomColor","transparent","borderBottomWidth","icon","fontSize","color","tabbarIconColor","activeTabIcon","tabLabel","fontWeight","textAlign","fontFamily","baseFont","marginTop","activeTabLabel","undefined","borderTopWidth","borderTopColor"],"sources":["tabbar.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 '../../basic/icon/icon.styles';\n\nexport type WmTabbarStyles = BaseStyles & {\n menu: AllStyle,\n modalContent: AllStyle,\n moreMenu: AllStyle,\n moreMenuRow: AllStyle,\n tabItem: AllStyle,\n activeTabItem: AllStyle,\n tabIcon: WmIconStyles,\n activeTabIcon: WmIconStyles,\n tabLabel: AllStyle,\n activeTabLabel: AllStyle\n};\n\nexport const DEFAULT_CLASS = 'app-tabbar';\n BASE_THEME.registerStyle((themeVariables, addStyle) => {\n const defaultStyles: WmTabbarStyles = defineStyles<WmTabbarStyles>({\n root: {\n height: 88\n },\n text: {},\n menu: {\n height: '100%',\n flexDirection: 'row',\n backgroundColor: themeVariables.tabbarBackgroundColor,\n justifyContent: 'space-around',\n alignItems: 'flex-end',\n },\n modalContent: {},\n moreMenu: {\n width: '100%',\n flexDirection: 'column-reverse',\n justifyContent: 'flex-end',\n backgroundColor: themeVariables.tabbarBackgroundColor,\n ...BASE_THEME.getStyle('elevate1').root,\n shadowOffset: {\n width: 0,\n height: -6\n },\n shadowOpacity: 0.3,\n shadowRadius: 6\n },\n moreMenuRow: {\n flexDirection: 'row-reverse',\n justifyContent: 'space-around',\n width: '100%',\n paddingTop: 4,\n paddingBottom: 4\n },\n tabItem: {\n flexDirection: 'column',\n justifyContent: 'center',\n alignItems: 'center',\n minWidth: 60,\n opacity: 0.4\n },\n activeTabItem: {\n opacity: 1\n },\n tabIcon: {\n root: {\n alignSelf: 'center',\n paddingBottom: 32,\n borderBottomColor: themeVariables.transparent,\n borderBottomWidth: 4\n },\n icon: {\n fontSize: 36,\n color: themeVariables.tabbarIconColor\n }\n } as WmIconStyles,\n activeTabIcon: {\n root: {\n borderBottomColor: themeVariables.tabbarIconColor,\n }\n } as WmIconStyles,\n tabLabel: {\n fontSize: 14,\n fontWeight: '500',\n color: themeVariables.tabbarIconColor,\n textAlign: 'center',\n fontFamily: themeVariables.baseFont,\n marginTop: -32,\n paddingBottom: 14\n },\n activeTabLabel: {}\n });\n\n addStyle(DEFAULT_CLASS, '', defaultStyles);\n addStyle(DEFAULT_CLASS+ '-1', '', {\n root: {\n height: undefined\n },\n tabItem: {\n justifyContent: 'space-between' \n },\n activeTabItem: {\n borderTopWidth: 4,\n borderTopColor: themeVariables.tabbarIconColor\n },\n tabIcon: {\n root: {\n paddingTop: 8,\n paddingBottom: 8,\n borderBottomWidth: 0\n }\n },\n tabLabel: {\n marginTop: 0\n }\n } as WmTabbarStyles);\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","height","text","menu","flexDirection","backgroundColor","tabbarBackgroundColor","justifyContent","alignItems","modalContent","moreMenu","width","getStyle","shadowOffset","shadowOpacity","shadowRadius","moreMenuRow","paddingTop","paddingBottom","tabItem","minWidth","opacity","activeTabItem","tabIcon","alignSelf","borderBottomColor","transparent","borderBottomWidth","icon","fontSize","color","tabbarIconColor","activeTabIcon","tabLabel","fontWeight","textAlign","fontFamily","baseFont","marginTop","activeTabLabel","centerHubItem","centerHubIcon","centerHubLabel","undefined","borderTopWidth","borderTopColor","shadowColor","borderRadius","position","bottom","centerHubItemColor","left","maxWidth","centerHubIconColor","centerHubLabelColor"],"sources":["tabbar.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 '../../basic/icon/icon.styles';\n\nexport type WmTabbarStyles = BaseStyles & {\n menu: AllStyle,\n modalContent: AllStyle,\n moreMenu: AllStyle,\n moreMenuRow: AllStyle,\n tabItem: AllStyle,\n activeTabItem: AllStyle,\n tabIcon: WmIconStyles,\n activeTabIcon: WmIconStyles,\n tabLabel: AllStyle,\n activeTabLabel: AllStyle,\n centerHubItem: AllStyle,\n centerHubIcon: WmIconStyles,\n centerHubLabel: AllStyle\n};\n\nexport const DEFAULT_CLASS = 'app-tabbar';\n BASE_THEME.registerStyle((themeVariables, addStyle) => {\n const defaultStyles: WmTabbarStyles = defineStyles<WmTabbarStyles>({\n root: {\n height: 88\n },\n text: {},\n menu: {\n height: '100%',\n flexDirection: 'row',\n backgroundColor: themeVariables.tabbarBackgroundColor,\n justifyContent: 'space-around',\n alignItems: 'flex-end',\n },\n modalContent: {},\n moreMenu: {\n width: '100%',\n flexDirection: 'column-reverse',\n justifyContent: 'flex-end',\n backgroundColor: themeVariables.tabbarBackgroundColor,\n ...BASE_THEME.getStyle('elevate1').root,\n shadowOffset: {\n width: 0,\n height: -6\n },\n shadowOpacity: 0.3,\n shadowRadius: 6\n },\n moreMenuRow: {\n flexDirection: 'row-reverse',\n justifyContent: 'space-around',\n width: '100%',\n paddingTop: 4,\n paddingBottom: 4\n },\n tabItem: {\n flexDirection: 'column',\n justifyContent: 'center',\n alignItems: 'center',\n minWidth: 60,\n opacity: 0.4\n },\n activeTabItem: {\n opacity: 1\n },\n tabIcon: {\n root: {\n alignSelf: 'center',\n paddingBottom: 32,\n borderBottomColor: themeVariables.transparent,\n borderBottomWidth: 4\n },\n icon: {\n fontSize: 36,\n color: themeVariables.tabbarIconColor\n }\n } as WmIconStyles,\n activeTabIcon: {\n root: {\n borderBottomColor: themeVariables.tabbarIconColor,\n }\n } as WmIconStyles,\n tabLabel: {\n fontSize: 14,\n fontWeight: '500',\n color: themeVariables.tabbarIconColor,\n textAlign: 'center',\n fontFamily: themeVariables.baseFont,\n marginTop: -32,\n paddingBottom: 14\n },\n activeTabLabel: {},\n centerHubItem: {},\n centerHubIcon: {} as WmIconStyles, \n centerHubLabel:{}\n });\n\n addStyle(DEFAULT_CLASS, '', defaultStyles);\n addStyle('tabbar-spacer', '', {\n root: {\n height: 96\n }\n });\n addStyle(DEFAULT_CLASS+ '-1', '', {\n root: {\n height: undefined\n },\n tabItem: {\n justifyContent: 'space-between' \n },\n activeTabItem: {\n borderTopWidth: 4,\n borderTopColor: themeVariables.tabbarIconColor\n },\n tabIcon: {\n root: {\n paddingTop: 8,\n paddingBottom: 8,\n borderBottomWidth: 0\n }\n },\n tabLabel: {\n marginTop: 0\n }\n } as WmTabbarStyles);\n addStyle('clipped-tabbar', '', {\n root:{\n backgroundColor: themeVariables.transparent,\n marginTop: -88\n },\n menu: {\n backgroundColor: themeVariables.transparent\n },\n centerHubItem: {\n width: 70,\n height: 70,\n shadowColor: 'grey',\n shadowOpacity: 0.1,\n opacity: 1,\n shadowOffset: { width: 2, height: 0 },\n shadowRadius: 2,\n borderRadius: 35,\n position: 'absolute',\n bottom: 53,\n alignItems: 'center',\n justifyContent: 'center',\n backgroundColor: themeVariables.centerHubItemColor,\n left: (themeVariables.maxWidth/2) - 35\n },\n centerHubIcon: {\n root: {\n alignSelf: 'center',\n paddingBottom: 0,\n borderBottomColor: themeVariables.transparent,\n borderBottomWidth: 0 \n },\n icon: {\n fontSize: 24,\n color: themeVariables.centerHubIconColor\n }\n } as WmIconStyles, \n centerHubLabel:{\n color: themeVariables.centerHubLabelColor,\n marginTop: 0,\n paddingBottom: 4\n }\n })\n});"],"mappings":"AAAA,OAAOA,UAAU,MAAoB,wCAAwC;AAC7E,SAAqBC,YAAY,QAAQ,+CAA+C;AAmBxF,OAAO,MAAMC,aAAa,GAAG,YAAY;AACrCF,UAAU,CAACG,aAAa,CAAC,CAACC,cAAc,EAAEC,QAAQ,KAAK;EACvD,MAAMC,aAA6B,GAAGL,YAAY,CAAiB;IAC/DM,IAAI,EAAE;MACFC,MAAM,EAAE;IACZ,CAAC;IACDC,IAAI,EAAE,CAAC,CAAC;IACRC,IAAI,EAAE;MACFF,MAAM,EAAE,MAAM;MACdG,aAAa,EAAE,KAAK;MACpBC,eAAe,EAAER,cAAc,CAACS,qBAAqB;MACrDC,cAAc,EAAE,cAAc;MAC9BC,UAAU,EAAE;IAChB,CAAC;IACDC,YAAY,EAAE,CAAC,CAAC;IAChBC,QAAQ,EAAE;MACNC,KAAK,EAAE,MAAM;MACbP,aAAa,EAAE,gBAAgB;MAC/BG,cAAc,EAAE,UAAU;MAC1BF,eAAe,EAAER,cAAc,CAACS,qBAAqB;MACrD,GAAGb,UAAU,CAACmB,QAAQ,CAAC,UAAU,CAAC,CAACZ,IAAI;MACvCa,YAAY,EAAE;QACVF,KAAK,EAAE,CAAC;QACRV,MAAM,EAAE,CAAC;MACb,CAAC;MACDa,aAAa,EAAE,GAAG;MAClBC,YAAY,EAAE;IAClB,CAAC;IACDC,WAAW,EAAE;MACTZ,aAAa,EAAE,aAAa;MAC5BG,cAAc,EAAE,cAAc;MAC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AAiB,EAAE;MACvB,CAAC;MACDC,IAAI,EAAE;QACFC,QAAQ,EAAE,EAAE;QACZC,KAAK,EAAGjC,cAAc,CAACwD;MAC3B;IACJ,CAAiB;IACjBX,cAAc,EAAC;MACXZ,KAAK,EAAGjC,cAAc,CAACyD,mBAAmB;MAC1ChB,SAAS,EAAE,CAAC;MACZpB,aAAa,EAAE;IACnB;EACJ,CAAC,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -357,6 +357,9 @@ export class BaseComponent extends React.Component {
|
|
|
357
357
|
testID: id
|
|
358
358
|
};
|
|
359
359
|
}
|
|
360
|
+
getStyleClassName() {
|
|
361
|
+
return this.state.props.classname;
|
|
362
|
+
}
|
|
360
363
|
getTestPropsForInput(suffix) {
|
|
361
364
|
return this.getTestProps(suffix || 'i');
|
|
362
365
|
}
|
|
@@ -394,11 +397,12 @@ export class BaseComponent extends React.Component {
|
|
|
394
397
|
const selectedLocale = this.i18nService.getSelectedLocale();
|
|
395
398
|
return this.getDependenciesFromContext(() => {
|
|
396
399
|
WIDGET_LOGGER.info(() => `${this.props.name || this.constructor.name} is rendering.`);
|
|
400
|
+
const classname = this.getStyleClassName();
|
|
397
401
|
this.styles = this.theme.mergeStyle(this.getDefaultStyles(), {
|
|
398
402
|
text: this.theme.getStyle('app-' + selectedLocale)
|
|
399
403
|
}, {
|
|
400
404
|
text: this.theme.getStyle(this.defaultClass + '-' + selectedLocale)
|
|
401
|
-
}, props.disabled ? this.theme.getStyle(this.defaultClass + '-disabled') : null, this.isRTL ? this.theme.getStyle(this.defaultClass + '-rtl') : null,
|
|
405
|
+
}, props.disabled ? this.theme.getStyle(this.defaultClass + '-disabled') : null, this.isRTL ? this.theme.getStyle(this.defaultClass + '-rtl') : null, classname && this.theme.getStyle(classname), props.showindevice && this.theme.getStyle('d-all-none ' + props.showindevice.map(d => `d-${d}-flex`).join(' ')), this.props.styles, {
|
|
402
406
|
root: this.styleOverrides,
|
|
403
407
|
text: this.styleOverrides
|
|
404
408
|
});
|