@wavemaker/app-rn-runtime 11.5.1-next.40402 → 11.5.1-rc.5400
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/basic/buttongroup/buttongroup.styles.js +4 -2
- app-rn-runtime/components/basic/buttongroup/buttongroup.styles.js.map +1 -1
- app-rn-runtime/components/basic/label/label.component.js +1 -2
- app-rn-runtime/components/basic/label/label.component.js.map +1 -1
- app-rn-runtime/components/basic/label/label.props.js +0 -1
- app-rn-runtime/components/basic/label/label.props.js.map +1 -1
- app-rn-runtime/components/chart/area-chart/area-chart.component.js +28 -28
- app-rn-runtime/components/chart/area-chart/area-chart.component.js.map +1 -1
- app-rn-runtime/components/chart/area-chart/area-chart.props.js +9 -1
- app-rn-runtime/components/chart/area-chart/area-chart.props.js.map +1 -1
- app-rn-runtime/components/chart/bar-chart/bar-chart.component.js +15 -20
- app-rn-runtime/components/chart/bar-chart/bar-chart.component.js.map +1 -1
- app-rn-runtime/components/chart/basechart.component.js +83 -55
- app-rn-runtime/components/chart/basechart.component.js.map +1 -1
- app-rn-runtime/components/chart/basechart.props.js +9 -5
- app-rn-runtime/components/chart/basechart.props.js.map +1 -1
- app-rn-runtime/components/chart/basechart.styles.js +26 -3
- app-rn-runtime/components/chart/basechart.styles.js.map +1 -1
- app-rn-runtime/components/chart/line-chart/line-chart.component.js +45 -23
- app-rn-runtime/components/chart/line-chart/line-chart.component.js.map +1 -1
- app-rn-runtime/components/chart/line-chart/line-chart.props.js +1 -0
- app-rn-runtime/components/chart/line-chart/line-chart.props.js.map +1 -1
- app-rn-runtime/components/chart/pie-chart/pie-chart.component.js.map +1 -1
- app-rn-runtime/components/container/wizard/wizard.component.js +97 -5
- app-rn-runtime/components/container/wizard/wizard.component.js.map +1 -1
- app-rn-runtime/components/container/wizard/wizard.props.js +4 -0
- app-rn-runtime/components/container/wizard/wizard.props.js.map +1 -1
- app-rn-runtime/components/container/wizard/wizard.styles.js +103 -5
- app-rn-runtime/components/container/wizard/wizard.styles.js.map +1 -1
- app-rn-runtime/components/container/wizard/wizardstep/wizardstep.component.js +0 -8
- app-rn-runtime/components/container/wizard/wizardstep/wizardstep.component.js.map +1 -1
- app-rn-runtime/components/container/wizard/wizardstep/wizardstep.props.js +1 -0
- app-rn-runtime/components/container/wizard/wizardstep/wizardstep.props.js.map +1 -1
- app-rn-runtime/components/data/list/list.component.js +2 -3
- app-rn-runtime/components/data/list/list.component.js.map +1 -1
- app-rn-runtime/components/input/basenumber/basenumber.component.js +41 -7
- app-rn-runtime/components/input/basenumber/basenumber.component.js.map +1 -1
- app-rn-runtime/components/input/basenumber/basenumber.props.js +1 -0
- app-rn-runtime/components/input/basenumber/basenumber.props.js.map +1 -1
- app-rn-runtime/components/input/currency/currency.component.js +4 -1
- app-rn-runtime/components/input/currency/currency.component.js.map +1 -1
- app-rn-runtime/components/input/number/number.component.js +4 -1
- app-rn-runtime/components/input/number/number.component.js.map +1 -1
- app-rn-runtime/components/navigation/basenav/basenav.component.js +2 -1
- app-rn-runtime/components/navigation/basenav/basenav.component.js.map +1 -1
- app-rn-runtime/core/utils.js +16 -0
- app-rn-runtime/core/utils.js.map +1 -1
- app-rn-runtime/package.json +3 -3
- app-rn-runtime/variables/service-variable.js +0 -1
- app-rn-runtime/variables/service-variable.js.map +1 -1
- app-rn-runtime/components/chart/staticdata.js +0 -215
- app-rn-runtime/components/chart/staticdata.js.map +0 -1
|
@@ -11,8 +11,7 @@ BASE_THEME.registerStyle((themeVariables, addStyle) => {
|
|
|
11
11
|
borderWidth: 1,
|
|
12
12
|
borderStyle: 'solid',
|
|
13
13
|
borderColor: themeVariables.buttonGrpBorderColor,
|
|
14
|
-
backgroundColor: themeVariables.buttonGrpBgColor
|
|
15
|
-
overflow: 'hidden'
|
|
14
|
+
backgroundColor: themeVariables.buttonGrpBgColor
|
|
16
15
|
},
|
|
17
16
|
text: {},
|
|
18
17
|
skeleton: {
|
|
@@ -34,6 +33,9 @@ BASE_THEME.registerStyle((themeVariables, addStyle) => {
|
|
|
34
33
|
backgroundColor: 'transparent',
|
|
35
34
|
flex: 1,
|
|
36
35
|
borderColor: themeVariables.buttonGrpBorderColor
|
|
36
|
+
},
|
|
37
|
+
text: {
|
|
38
|
+
color: themeVariables.defaultColor9
|
|
37
39
|
}
|
|
38
40
|
});
|
|
39
41
|
addStyle('btn-group-first-child', '', {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["BASE_THEME","defineStyles","DEFAULT_CLASS","registerStyle","themeVariables","addStyle","defaultStyles","root","flexDirection","alignSelf","alignItems","borderRadius","borderWidth","borderStyle","borderColor","buttonGrpBorderColor","backgroundColor","buttonGrpBgColor","
|
|
1
|
+
{"version":3,"names":["BASE_THEME","defineStyles","DEFAULT_CLASS","registerStyle","themeVariables","addStyle","defaultStyles","root","flexDirection","alignSelf","alignItems","borderRadius","borderWidth","borderStyle","borderColor","buttonGrpBorderColor","backgroundColor","buttonGrpBgColor","text","skeleton","width","height","borderTopWidth","borderBottomWidth","borderLeftWidth","borderRightWidth","flex","color","defaultColor9"],"sources":["buttongroup.styles.ts"],"sourcesContent":["import BASE_THEME from '@wavemaker/app-rn-runtime/styles/theme';\nimport { BaseStyles, defineStyles } from '@wavemaker/app-rn-runtime/core/base.component';\nimport { WmButtonStyles } from '../button/button.styles';\nimport { WmSkeletonStyles } from '../skeleton/skeleton.styles';\n\nexport type WmButtongroupStyles = BaseStyles & {\n skeleton: WmSkeletonStyles\n};\n\nexport const DEFAULT_CLASS = 'app-buttongroup';\nBASE_THEME.registerStyle((themeVariables, addStyle) => {\n const defaultStyles: WmButtongroupStyles = defineStyles({\n root: {\n flexDirection: 'row',\n alignSelf: 'flex-start',\n alignItems: 'center',\n borderRadius: 100,\n borderWidth: 1,\n borderStyle: 'solid',\n borderColor: themeVariables.buttonGrpBorderColor,\n backgroundColor: themeVariables.buttonGrpBgColor\n }, \n text: {},\n skeleton: {\n root : {\n width: '100%',\n height: 48,\n borderRadius: 4,\n borderColor: themeVariables.buttonGrpBorderColor\n }\n } as any as WmSkeletonStyles\n });\n\n\n addStyle('btn-group-child', '', {\n root: {\n borderTopWidth: 0,\n borderBottomWidth: 0,\n borderLeftWidth: 1,\n borderRightWidth: 0,\n borderRadius: 0,\n backgroundColor: 'transparent',\n flex: 1,\n borderColor: themeVariables.buttonGrpBorderColor,\n },\n text: {\n color: themeVariables.defaultColor9,\n }\n } as WmButtonStyles);\n addStyle('btn-group-first-child', '', {\n root: {\n borderLeftWidth: 0,\n borderRadius: 0,\n backgroundColor: 'transparent',\n borderColor: themeVariables.buttonGrpBorderColor\n }\n } as WmButtonStyles);\n addStyle(DEFAULT_CLASS, '', defaultStyles);\n});\n"],"mappings":"AAAA,OAAOA,UAAU,MAAM,wCAAwC;AAC/D,SAAqBC,YAAY,QAAQ,+CAA+C;AAQxF,OAAO,MAAMC,aAAa,GAAG,iBAAiB;AAC9CF,UAAU,CAACG,aAAa,CAAC,CAACC,cAAc,EAAEC,QAAQ,KAAK;EACrD,MAAMC,aAAkC,GAAGL,YAAY,CAAC;IACpDM,IAAI,EAAE;MACJC,aAAa,EAAE,KAAK;MACpBC,SAAS,EAAE,YAAY;MACvBC,UAAU,EAAE,QAAQ;MACpBC,YAAY,EAAE,GAAG;MACjBC,WAAW,EAAE,CAAC;MACdC,WAAW,EAAE,OAAO;MACpBC,WAAW,EAAEV,cAAc,CAACW,oBAAoB;MAChDC,eAAe,EAAEZ,cAAc,CAACa;IAClC,CAAC;IACDC,IAAI,EAAE,CAAC,CAAC;IACRC,QAAQ,EAAE;MACRZ,IAAI,EAAG;QACLa,KAAK,EAAE,MAAM;QACbC,MAAM,EAAE,EAAE;QACVV,YAAY,EAAE,CAAC;QACfG,WAAW,EAAEV,cAAc,CAACW;MAC9B;IACF;EACJ,CAAC,CAAC;EAGFV,QAAQ,CAAC,iBAAiB,EAAE,EAAE,EAAE;IAC9BE,IAAI,EAAE;MACJe,cAAc,EAAE,CAAC;MACjBC,iBAAiB,EAAE,CAAC;MACpBC,eAAe,EAAE,CAAC;MAClBC,gBAAgB,EAAE,CAAC;MACnBd,YAAY,EAAE,CAAC;MACfK,eAAe,EAAE,aAAa;MAC9BU,IAAI,EAAE,CAAC;MACPZ,WAAW,EAAEV,cAAc,CAACW;IAC9B,CAAC;IACDG,IAAI,EAAE;MACJS,KAAK,EAAEvB,cAAc,CAACwB;IACxB;EACF,CAAmB,CAAC;EACpBvB,QAAQ,CAAC,uBAAuB,EAAE,EAAE,EAAE;IACpCE,IAAI,EAAE;MACJiB,eAAe,EAAE,CAAC;MAClBb,YAAY,EAAE,CAAC;MACfK,eAAe,EAAE,aAAa;MAC9BF,WAAW,EAAEV,cAAc,CAACW;IAC9B;EACF,CAAmB,CAAC;EACpBV,QAAQ,CAACH,aAAa,EAAE,EAAE,EAAEI,aAAa,CAAC;AAC5C,CAAC,CAAC"}
|
|
@@ -115,8 +115,7 @@ export default class WmLabel extends BaseComponent {
|
|
|
115
115
|
color: props.isValid === false ? 'red' : this.styles.text.color
|
|
116
116
|
}],
|
|
117
117
|
numberOfLines: props.wrap ? undefined : 1,
|
|
118
|
-
selectable: this.styles.text.userSelect === 'text'
|
|
119
|
-
ellipsizeMode: "tail"
|
|
118
|
+
selectable: this.styles.text.userSelect === 'text'
|
|
120
119
|
}, toString(part.text), props.required && this.getAsterisk())))))) : null;
|
|
121
120
|
}
|
|
122
121
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","Text","View","BaseComponent","BaseComponentState","Tappable","WmLabelProps","DEFAULT_CLASS","isNil","toString","Animatedview","createSkeleton","WmAnchor","WmLabelState","constructor","arguments","_defineProperty","WmLabel","props","getAsterisk","createElement","style","styles","asterisk","onPropertyChange","name","$new","$old","updateState","parts","parseCaption","getMultilineSkeleton","width","height","borderRadius","marginBottom","theme","skeleton","caption","pattern","linkRegex","captionSplit","split","i","length","isLink","test","part","isNextTextALink","text","link","push","renderSkeleton","_this$styles$root","_this$styles$root2","skeletonWidth","skeletonwidth","root","skeletonHeight","skeletonheight","fontSize","multilineskeleton","renderWidget","_this$state$parts","entryanimation","animation","_background","target","flex","flexWrap","state","map","index","Fragment","key","hyperlink","color","isValid","numberOfLines","wrap","undefined","selectable","userSelect","ellipsizeMode","required"],"sources":["label.component.tsx"],"sourcesContent":["import React from 'react';\nimport { DimensionValue, Text, View } from 'react-native';\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\nimport { Tappable } from '@wavemaker/app-rn-runtime/core/tappable.component';\n\nimport WmLabelProps from './label.props';\nimport { DEFAULT_CLASS, WmLabelStyles } from './label.styles';\nimport { isNil, toString } from 'lodash-es';\nimport { Animatedview } from '@wavemaker/app-rn-runtime/components/basic/animatedview.component';\nimport WmSkeleton, { createSkeleton } from '../skeleton/skeleton.component';\nimport { totalMonths } from 'react-native-paper-dates/lib/typescript/Date/dateUtils';\nimport WmAnchor from '../anchor/anchor.component';\n\ntype PartType = {\n text?: string,\n link?: string,\n};\n\nexport class WmLabelState extends BaseComponentState<WmLabelProps> {\n parts: PartType[] = []\n}\n\nexport default class WmLabel extends BaseComponent<WmLabelProps, WmLabelState, WmLabelStyles> {\n\n constructor(props: WmLabelProps) {\n super(props, DEFAULT_CLASS, new WmLabelProps(), new WmLabelState());\n }\n\n private getAsterisk () {\n return <Text style={this.styles.asterisk}>*</Text>;\n }\n\n public onPropertyChange(name: string, $new: any, $old: any): void {\n super.onPropertyChange(name, $new, $old);\n\n switch(name) {\n case \"caption\":\n this.updateState({\n parts: this.parseCaption($new)\n } as WmLabelState);\n break;\n }\n }\n private getMultilineSkeleton(width: any, height: any) {\n const styles = {\n borderRadius:4,\n marginBottom: 10,\n height: height\n };\n return createSkeleton(this.theme, this.styles.skeleton, {\n ...styles,\n width: width,\n height: height\n });\n }\n\n parseCaption(caption: string) {\n if (!caption) {\n return [];\n }\n caption += '';\n const pattern = /\\[([^\\]]+)\\]\\((http.*?[^)])\\)/g;\n const linkRegex = /^(http|https):\\/\\/[^ \"]+$/;\n const captionSplit = caption.split(pattern);\n\n let parts = [];\n\n for (let i = 0; i < captionSplit.length; i++) {\n const isLink = linkRegex.test(captionSplit[i]);\n let part: PartType = {};\n \n const isNextTextALink = linkRegex.test(captionSplit[i + 1]) || false;\n if (isLink) {\n part.text = captionSplit[i - 1] ?? '';\n part.link = captionSplit[i];\n } else {\n part.text = isNextTextALink ? \"\" : captionSplit[i];\n };\n\n if (part.text) {\n parts.push(part);\n }\n }\n\n return parts;\n }\n\n public renderSkeleton(props: WmLabelProps){\n const skeletonWidth = this.props.skeletonwidth || this.styles.root?.width;\n const skeletonHeight = this.props.skeletonheight || this.styles.root?.height || this.styles.text.fontSize;\n if(this.props.multilineskeleton) {\n return (<View style={{\n width: skeletonWidth as DimensionValue\n }}>\n {this.getMultilineSkeleton('100%', skeletonHeight)}\n {this.getMultilineSkeleton('70%', skeletonHeight)}\n {this.getMultilineSkeleton('40%', skeletonHeight)}\n </View>)\n }\n else{\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\n renderWidget(props: WmLabelProps) {\n return !isNil(props.caption) ? (\n <Animatedview entryanimation={props.animation} style={this.styles.root}>\n {this._background}\n <Tappable target={this}>\n <Text style={{flex: 1, flexWrap: \"wrap\"}}>\n {this.state.parts?.map((part, index) => (\n <React.Fragment key={`part_${index}`}>\n {part.link ? (\n <WmAnchor styles={this.styles.link} caption={part.text} hyperlink={part.link} />\n ) : (\n <Text\n style={[\n this.styles.text,\n {\n color:\n props.isValid === false\n ? 'red'\n : this.styles.text.color,\n },\n ]}\n numberOfLines={props.wrap ? undefined : 1}\n selectable={this.styles.text.userSelect === 'text'}\n ellipsizeMode=\"tail\"\n >\n {toString(part.text)}\n {props.required && this.getAsterisk()}\n </Text>\n )}\n </React.Fragment>\n ))}\n </Text>\n </Tappable>\n </Animatedview>\n ) : null;\n }\n}\n"],"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ACb,IAAI;EACV;AACF"}
|
|
1
|
+
{"version":3,"names":["React","Text","View","BaseComponent","BaseComponentState","Tappable","WmLabelProps","DEFAULT_CLASS","isNil","toString","Animatedview","createSkeleton","WmAnchor","WmLabelState","constructor","arguments","_defineProperty","WmLabel","props","getAsterisk","createElement","style","styles","asterisk","onPropertyChange","name","$new","$old","updateState","parts","parseCaption","getMultilineSkeleton","width","height","borderRadius","marginBottom","theme","skeleton","caption","pattern","linkRegex","captionSplit","split","i","length","isLink","test","part","isNextTextALink","text","link","push","renderSkeleton","_this$styles$root","_this$styles$root2","skeletonWidth","skeletonwidth","root","skeletonHeight","skeletonheight","fontSize","multilineskeleton","renderWidget","_this$state$parts","entryanimation","animation","_background","target","flex","flexWrap","state","map","index","Fragment","key","hyperlink","color","isValid","numberOfLines","wrap","undefined","selectable","userSelect","required"],"sources":["label.component.tsx"],"sourcesContent":["import React from 'react';\nimport { DimensionValue, Text, View } from 'react-native';\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\nimport { Tappable } from '@wavemaker/app-rn-runtime/core/tappable.component';\n\nimport WmLabelProps from './label.props';\nimport { DEFAULT_CLASS, WmLabelStyles } from './label.styles';\nimport { isNil, toString } from 'lodash-es';\nimport { Animatedview } from '@wavemaker/app-rn-runtime/components/basic/animatedview.component';\nimport WmSkeleton, { createSkeleton } from '../skeleton/skeleton.component';\nimport { totalMonths } from 'react-native-paper-dates/lib/typescript/Date/dateUtils';\nimport WmAnchor from '../anchor/anchor.component';\n\ntype PartType = {\n text?: string,\n link?: string,\n};\n\nexport class WmLabelState extends BaseComponentState<WmLabelProps> {\n parts: PartType[] = []\n}\n\nexport default class WmLabel extends BaseComponent<WmLabelProps, WmLabelState, WmLabelStyles> {\n\n constructor(props: WmLabelProps) {\n super(props, DEFAULT_CLASS, new WmLabelProps(), new WmLabelState());\n }\n\n private getAsterisk () {\n return <Text style={this.styles.asterisk}>*</Text>;\n }\n\n public onPropertyChange(name: string, $new: any, $old: any): void {\n super.onPropertyChange(name, $new, $old);\n\n switch(name) {\n case \"caption\":\n this.updateState({\n parts: this.parseCaption($new)\n } as WmLabelState);\n break;\n }\n }\n private getMultilineSkeleton(width: any, height: any) {\n const styles = {\n borderRadius:4,\n marginBottom: 10,\n height: height\n };\n return createSkeleton(this.theme, this.styles.skeleton, {\n ...styles,\n width: width,\n height: height\n });\n }\n\n parseCaption(caption: string) {\n if (!caption) {\n return [];\n }\n caption += '';\n const pattern = /\\[([^\\]]+)\\]\\((http.*?[^)])\\)/g;\n const linkRegex = /^(http|https):\\/\\/[^ \"]+$/;\n const captionSplit = caption.split(pattern);\n\n let parts = [];\n\n for (let i = 0; i < captionSplit.length; i++) {\n const isLink = linkRegex.test(captionSplit[i]);\n let part: PartType = {};\n \n const isNextTextALink = linkRegex.test(captionSplit[i + 1]) || false;\n if (isLink) {\n part.text = captionSplit[i - 1] ?? '';\n part.link = captionSplit[i];\n } else {\n part.text = isNextTextALink ? \"\" : captionSplit[i];\n };\n\n if (part.text) {\n parts.push(part);\n }\n }\n\n return parts;\n }\n\n public renderSkeleton(props: WmLabelProps){\n const skeletonWidth = this.props.skeletonwidth || this.styles.root?.width;\n const skeletonHeight = this.props.skeletonheight || this.styles.root?.height || this.styles.text.fontSize;\n if(this.props.multilineskeleton) {\n return (<View style={{\n width: skeletonWidth as DimensionValue\n }}>\n {this.getMultilineSkeleton('100%', skeletonHeight)}\n {this.getMultilineSkeleton('70%', skeletonHeight)}\n {this.getMultilineSkeleton('40%', skeletonHeight)}\n </View>)\n }\n else{\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\n renderWidget(props: WmLabelProps) {\n return !isNil(props.caption) ? (\n <Animatedview entryanimation={props.animation} style={this.styles.root}>\n {this._background}\n <Tappable target={this}>\n <Text style={{flex: 1, flexWrap: \"wrap\"}}>\n {this.state.parts?.map((part, index) => (\n <React.Fragment key={`part_${index}`}>\n {part.link ? (\n <WmAnchor styles={this.styles.link} caption={part.text} hyperlink={part.link} />\n ) : (\n <Text\n style={[\n this.styles.text,\n {\n color:\n props.isValid === false\n ? 'red'\n : this.styles.text.color,\n },\n ]}\n numberOfLines={props.wrap ? undefined : 1}\n selectable={this.styles.text.userSelect === 'text'}\n >\n {toString(part.text)}\n {props.required && this.getAsterisk()}\n </Text>\n )}\n </React.Fragment>\n ))}\n </Text>\n </Tappable>\n </Animatedview>\n ) : null;\n }\n}\n"],"mappings":";;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAAyBC,IAAI,EAAEC,IAAI,QAAQ,cAAc;AACzD,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,+CAA+C;AACjG,SAASC,QAAQ,QAAQ,mDAAmD;AAE5E,OAAOC,YAAY,MAAM,eAAe;AACxC,SAASC,aAAa,QAAuB,gBAAgB;AAC7D,SAASC,KAAK,EAAEC,QAAQ,QAAQ,WAAW;AAC3C,SAASC,YAAY,QAAQ,mEAAmE;AAChG,SAAqBC,cAAc,QAAQ,gCAAgC;AAE3E,OAAOC,QAAQ,MAAM,4BAA4B;AAOjD,OAAO,MAAMC,YAAY,SAAST,kBAAkB,CAAe;EAAAU,YAAA;IAAA,SAAAC,SAAA;IAAAC,eAAA,gBAC7C,EAAE;EAAA;AACxB;AAEA,eAAe,MAAMC,OAAO,SAASd,aAAa,CAA4C;EAE5FW,WAAWA,CAACI,KAAmB,EAAE;IAC/B,KAAK,CAACA,KAAK,EAAEX,aAAa,EAAE,IAAID,YAAY,CAAC,CAAC,EAAE,IAAIO,YAAY,CAAC,CAAC,CAAC;EACrE;EAEQM,WAAWA,CAAA,EAAI;IACrB,oBAAOnB,KAAA,CAAAoB,aAAA,CAACnB,IAAI;MAACoB,KAAK,EAAE,IAAI,CAACC,MAAM,CAACC;IAAS,GAAC,GAAO,CAAC;EACpD;EAEOC,gBAAgBA,CAACC,IAAY,EAAEC,IAAS,EAAEC,IAAS,E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CACD;MACFE,aAAa,EAAE5D,KAAK,CAAC6D,IAAI,GAAGC,SAAS,GAAG,CAAE;MAC1CC,UAAU,EAAE,IAAI,CAAC3D,MAAM,CAAC2B,IAAI,CAACiC,UAAU,KAAK;IAAO,GAElDzE,QAAQ,CAACsC,IAAI,CAACE,IAAI,CAAC,EACnB/B,KAAK,CAACiE,QAAQ,IAAI,IAAI,CAAChE,WAAW,CAAC,CAChC,CAEM,CACjB,CACG,CACE,CACE,CAAC,GACb,IAAI;EACV;AACF"}
|
|
@@ -10,7 +10,6 @@ export default class WmLabelProps extends BaseProps {
|
|
|
10
10
|
_defineProperty(this, "required", null);
|
|
11
11
|
_defineProperty(this, "isValid", true);
|
|
12
12
|
_defineProperty(this, "wrap", true);
|
|
13
|
-
_defineProperty(this, "noOfLines", 1);
|
|
14
13
|
_defineProperty(this, "skeletonheight", null);
|
|
15
14
|
_defineProperty(this, "skeletonwidth", null);
|
|
16
15
|
_defineProperty(this, "multilineskeleton", false);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["BaseProps","WmLabelProps","constructor","arguments","_defineProperty"],"sources":["label.props.ts"],"sourcesContent":["import { BaseProps } from '@wavemaker/app-rn-runtime/core/base.component';\n\nexport default class WmLabelProps extends BaseProps {\n animation?: string = null as any;\n caption?: string = 'Label';\n required?: boolean = null as any;\n isValid?: boolean = true;\n wrap?: boolean = true;\n
|
|
1
|
+
{"version":3,"names":["BaseProps","WmLabelProps","constructor","arguments","_defineProperty"],"sources":["label.props.ts"],"sourcesContent":["import { BaseProps } from '@wavemaker/app-rn-runtime/core/base.component';\n\nexport default class WmLabelProps extends BaseProps {\n animation?: string = null as any;\n caption?: string = 'Label';\n required?: boolean = null as any;\n isValid?: boolean = true;\n wrap?: boolean = true;\n skeletonheight?: string = null as any;\n skeletonwidth?: string = null as any;\n multilineskeleton?: boolean = false;\n}\n"],"mappings":";;;AAAA,SAASA,SAAS,QAAQ,+CAA+C;AAEzE,eAAe,MAAMC,YAAY,SAASD,SAAS,CAAC;EAAAE,YAAA;IAAA,SAAAC,SAAA;IAAAC,eAAA,oBAC3B,IAAI;IAAAA,eAAA,kBACN,OAAO;IAAAA,eAAA,mBACL,IAAI;IAAAA,eAAA,kBACL,IAAI;IAAAA,eAAA,eACP,IAAI;IAAAA,eAAA,yBACK,IAAI;IAAAA,eAAA,wBACL,IAAI;IAAAA,eAAA,4BACC,KAAK;EAAA;AACvC"}
|
|
@@ -2,13 +2,14 @@ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key i
|
|
|
2
2
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
3
3
|
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); }
|
|
4
4
|
import React from 'react';
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
5
|
+
import Color from "color";
|
|
6
|
+
import { View } from 'react-native';
|
|
7
|
+
import { Defs, LinearGradient, Stop, Svg } from 'react-native-svg';
|
|
8
|
+
import { VictoryArea, VictoryChart, VictoryLegend, VictoryStack, VictoryScatter, VictoryGroup } from "victory-native";
|
|
8
9
|
import WmAreaChartProps from './area-chart.props';
|
|
9
10
|
import { DEFAULT_CLASS } from './area-chart.styles';
|
|
10
11
|
import { BaseChartComponent, BaseChartComponentState } from "@wavemaker/app-rn-runtime/components/chart/basechart.component";
|
|
11
|
-
import
|
|
12
|
+
import { isNumber } from 'lodash-es';
|
|
12
13
|
export class WmAreaChartState extends BaseChartComponentState {
|
|
13
14
|
constructor() {
|
|
14
15
|
super(...arguments);
|
|
@@ -31,26 +32,18 @@ export default class WmAreaChart extends BaseChartComponent {
|
|
|
31
32
|
return null;
|
|
32
33
|
}
|
|
33
34
|
let mindomain = {
|
|
34
|
-
x:
|
|
35
|
-
y:
|
|
35
|
+
x: props.xdomain === 'Min' ? this.state.chartMinX : undefined,
|
|
36
|
+
y: props.ydomain === 'Min' ? this.state.chartMinY : undefined
|
|
36
37
|
};
|
|
37
38
|
const chartName = this.props.name ?? 'nonameAreachart';
|
|
39
|
+
let gradientStop = '100%';
|
|
40
|
+
if (isNumber(this.state.chartMaxY) && isNumber(this.state.chartMinY) && this.state.chartMaxY > 0) {
|
|
41
|
+
gradientStop = (this.state.chartMaxY - this.state.chartMinY) * 100 / this.state.chartMaxY + '%';
|
|
42
|
+
}
|
|
38
43
|
return /*#__PURE__*/React.createElement(View, {
|
|
39
44
|
style: this.styles.root,
|
|
40
45
|
onLayout: this.onViewLayoutChange.bind(this)
|
|
41
|
-
},
|
|
42
|
-
style: {
|
|
43
|
-
flexDirection: 'row',
|
|
44
|
-
alignItems: 'center'
|
|
45
|
-
}
|
|
46
|
-
}, props.iconclass ? /*#__PURE__*/React.createElement(WmIcon, {
|
|
47
|
-
iconclass: props.iconclass,
|
|
48
|
-
styles: this.styles.icon
|
|
49
|
-
}) : null, /*#__PURE__*/React.createElement(Text, {
|
|
50
|
-
style: this.styles.title
|
|
51
|
-
}, props.title)), /*#__PURE__*/React.createElement(Text, {
|
|
52
|
-
style: this.styles.subHeading
|
|
53
|
-
}, props.subheading)), this.state.chartWidth ? /*#__PURE__*/React.createElement(VictoryChart, {
|
|
46
|
+
}, this.state.chartWidth ? /*#__PURE__*/React.createElement(VictoryChart, {
|
|
54
47
|
theme: this.state.theme,
|
|
55
48
|
height: this.styles.root.height,
|
|
56
49
|
width: this.state.chartWidth || 120,
|
|
@@ -58,10 +51,18 @@ export default class WmAreaChart extends BaseChartComponent {
|
|
|
58
51
|
top: 70,
|
|
59
52
|
bottom: 50,
|
|
60
53
|
left: 50,
|
|
61
|
-
right:
|
|
54
|
+
right: 30
|
|
62
55
|
},
|
|
63
56
|
minDomain: mindomain
|
|
64
|
-
},
|
|
57
|
+
}, /*#__PURE__*/React.createElement(VictoryLegend, {
|
|
58
|
+
name: 'legend',
|
|
59
|
+
containerComponent: /*#__PURE__*/React.createElement(Svg, null),
|
|
60
|
+
title: [props.title, props.subheading],
|
|
61
|
+
orientation: "horizontal",
|
|
62
|
+
gutter: 20,
|
|
63
|
+
data: [],
|
|
64
|
+
theme: this.state.theme
|
|
65
|
+
}), this.getLegendView(), this.getXaxis(), this.getYAxis(), /*#__PURE__*/React.createElement(VictoryStack, null, this.state.data.map((d, i) => {
|
|
65
66
|
return /*#__PURE__*/React.createElement(VictoryGroup, {
|
|
66
67
|
key: props.name + '_area_group_' + i
|
|
67
68
|
}, /*#__PURE__*/React.createElement(Defs, null, /*#__PURE__*/React.createElement(LinearGradient, {
|
|
@@ -72,18 +73,18 @@ export default class WmAreaChart extends BaseChartComponent {
|
|
|
72
73
|
y2: "100%"
|
|
73
74
|
}, /*#__PURE__*/React.createElement(Stop, {
|
|
74
75
|
offset: "0%",
|
|
75
|
-
stopColor: this.state.colors[i]
|
|
76
|
+
stopColor: Color(this.state.colors[i]).lighten(0.2).rgb().toString()
|
|
76
77
|
}), /*#__PURE__*/React.createElement(Stop, {
|
|
77
|
-
offset:
|
|
78
|
-
stopColor:
|
|
79
|
-
stopOpacity: "0"
|
|
78
|
+
offset: gradientStop,
|
|
79
|
+
stopColor: Color(this.state.colors[i]).lighten(0.6).rgb().toString()
|
|
80
80
|
}))), /*#__PURE__*/React.createElement(VictoryArea, {
|
|
81
81
|
interpolation: props.interpolation,
|
|
82
82
|
key: props.name + '_' + i,
|
|
83
83
|
style: {
|
|
84
84
|
data: {
|
|
85
85
|
fill: `url(#${chartName}Gradient${i})`,
|
|
86
|
-
stroke: this.state.colors[i]
|
|
86
|
+
stroke: this.state.colors[i],
|
|
87
|
+
strokeWidth: props.linethickness
|
|
87
88
|
}
|
|
88
89
|
},
|
|
89
90
|
data: d
|
|
@@ -92,8 +93,7 @@ export default class WmAreaChart extends BaseChartComponent {
|
|
|
92
93
|
key: props.name + '_scatter' + i,
|
|
93
94
|
style: {
|
|
94
95
|
data: {
|
|
95
|
-
fill: this.state.colors[i]
|
|
96
|
-
opacity: 0.8
|
|
96
|
+
fill: Color(this.state.colors[i]).darken(0.2).rgb().toString()
|
|
97
97
|
}
|
|
98
98
|
},
|
|
99
99
|
data: d
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","
|
|
1
|
+
{"version":3,"names":["React","Color","View","Defs","LinearGradient","Stop","Svg","VictoryArea","VictoryChart","VictoryLegend","VictoryStack","VictoryScatter","VictoryGroup","WmAreaChartProps","DEFAULT_CLASS","BaseChartComponent","BaseChartComponentState","isNumber","WmAreaChartState","constructor","arguments","_defineProperty","WmAreaChart","props","e","viewWidth","nativeEvent","layout","width","updateState","chartWidth","renderWidget","_this$state$data","state","data","length","mindomain","x","xdomain","chartMinX","undefined","y","ydomain","chartMinY","chartName","name","gradientStop","chartMaxY","createElement","style","styles","root","onLayout","onViewLayoutChange","bind","theme","height","padding","top","bottom","left","right","minDomain","containerComponent","title","subheading","orientation","gutter","getLegendView","getXaxis","getYAxis","map","d","i","key","id","x1","y1","x2","y2","offset","stopColor","colors","lighten","rgb","toString","interpolation","fill","stroke","strokeWidth","linethickness","highlightpoints","size","darken"],"sources":["area-chart.component.tsx"],"sourcesContent":["import React from 'react';\nimport Color from \"color\";\nimport { LayoutChangeEvent, View, Text } from 'react-native';\nimport { Defs, LinearGradient, Stop, Svg } from 'react-native-svg';\nimport { VictoryArea, VictoryLine, VictoryChart, VictoryLegend, VictoryStack, VictoryScatter, VictoryGroup } from \"victory-native\";\nimport { InterpolationPropType } from 'victory-core';\nimport WmAreaChartProps from './area-chart.props';\nimport { DEFAULT_CLASS, WmAreaChartStyles } from './area-chart.styles';\nimport {\n BaseChartComponent,\n BaseChartComponentState\n} from \"@wavemaker/app-rn-runtime/components/chart/basechart.component\";\nimport ThemeVariables from '@wavemaker/app-rn-runtime/styles/theme.variables';\nimport { isNil, isNumber } from 'lodash-es';\n\nexport class WmAreaChartState extends BaseChartComponentState<WmAreaChartProps> {\n chartWidth = 0;\n}\n\nexport default class WmAreaChart extends BaseChartComponent<WmAreaChartProps, WmAreaChartState, WmAreaChartStyles> {\n\n constructor(props: WmAreaChartProps) {\n super(props, DEFAULT_CLASS, new WmAreaChartProps(), new WmAreaChartState());\n }\n\n onViewLayoutChange = (e: LayoutChangeEvent) => {\n let viewWidth = e.nativeEvent.layout.width;\n this.updateState({\n chartWidth: viewWidth\n } as WmAreaChartState)\n }\n\n renderWidget(props: WmAreaChartProps) {\n if (!this.state.data?.length) {\n return null;\n }\n let mindomain={\n x: props.xdomain === 'Min' ? this.state.chartMinX: undefined,\n y: props.ydomain === 'Min' ? this.state.chartMinY: undefined\n };\n const chartName = this.props.name ?? 'nonameAreachart';\n let gradientStop = '100%';\n if (isNumber(this.state.chartMaxY) && isNumber(this.state.chartMinY) && this.state.chartMaxY > 0) {\n gradientStop = (this.state.chartMaxY - this.state.chartMinY) * 100 / this.state.chartMaxY + '%';\n }\n return (\n <View\n style={this.styles.root}\n onLayout={this.onViewLayoutChange.bind(this)}\n >\n {this.state.chartWidth ? \n (\n <VictoryChart\n theme={this.state.theme}\n height={this.styles.root.height as number}\n width={this.state.chartWidth || 120}\n padding={{ top: 70, bottom: 50, left: 50, right: 30 }}\n minDomain={mindomain}\n > \n <VictoryLegend\n name={'legend'}\n containerComponent={<Svg />}\n title={[props.title, props.subheading]}\n orientation=\"horizontal\"\n gutter={20}\n data={[]}\n theme={this.state.theme}\n />\n {this.getLegendView()}\n {this.getXaxis()}\n {this.getYAxis()}\n <VictoryStack>\n {\n this.state.data.map((d: any, i: number) => {\n return <VictoryGroup key={props.name + '_area_group_' + i}>\n <Defs>\n <LinearGradient id={`${chartName}Gradient${i}`} x1=\"0%\" y1=\"0%\" x2=\"0%\" y2=\"100%\">\n <Stop offset=\"0%\" stopColor={Color(this.state.colors[i]).lighten(0.2).rgb().toString()}/>\n <Stop offset={gradientStop} stopColor={Color(this.state.colors[i]).lighten(0.6).rgb().toString()}/>\n </LinearGradient>\n </Defs>\n <VictoryArea\n interpolation={props.interpolation as InterpolationPropType}\n key={props.name + '_' + i}\n style={{\n data: {\n fill: `url(#${chartName}Gradient${i})`,\n stroke: this.state.colors[i],\n strokeWidth: props.linethickness,\n }\n }}\n data={d}\n />\n {props.highlightpoints ?\n <VictoryScatter\n size={5}\n key={props.name + '_scatter' + i}\n style={{\n data: { \n fill: Color(this.state.colors[i]).darken(0.2).rgb().toString()}\n }} \n data={d}\n />\n : null}\n </VictoryGroup>\n })\n }\n </VictoryStack>\n </VictoryChart>\n )\n : null}\n </View>);\n }\n}\n"],"mappings":";;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,KAAK,MAAM,OAAO;AACzB,SAA4BC,IAAI,QAAc,cAAc;AAC5D,SAASC,IAAI,EAAEC,cAAc,EAAEC,IAAI,EAAEC,GAAG,QAAQ,kBAAkB;AAClE,SAASC,WAAW,EAAeC,YAAY,EAAEC,aAAa,EAAEC,YAAY,EAAEC,cAAc,EAAEC,YAAY,QAAQ,gBAAgB;AAElI,OAAOC,gBAAgB,MAAM,oBAAoB;AACjD,SAASC,aAAa,QAA2B,qBAAqB;AACtE,SACEC,kBAAkB,EAClBC,uBAAuB,QAClB,gEAAgE;AAEvE,SAAgBC,QAAQ,QAAQ,WAAW;AAE3C,OAAO,MAAMC,gBAAgB,SAASF,uBAAuB,CAAmB;EAAAG,YAAA;IAAA,SAAAC,SAAA;IAAAC,eAAA,qBACjE,CAAC;EAAA;AAChB;AAEA,eAAe,MAAMC,WAAW,SAASP,kBAAkB,CAAwD;EAEjHI,WAAWA,CAACI,KAAuB,EAAE;IACnC,KAAK,CAACA,KAAK,EAAET,aAAa,EAAE,IAAID,gBAAgB,CAAC,CAAC,EAAE,IAAIK,gBAAgB,CAAC,CAAC,CAAC;IAACG,eAAA,6BAGxDG,CAAoB,IAAK;MAC7C,IAAIC,SAAS,GAAGD,CAAC,CAACE,WAAW,CAACC,M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AACT,CAAC,CAAC,CAAC,CAACoB,MAAM,CAAC,GAAG,CAAC,CAACT,GAAG,CAAC,CAAC,CAACC,QAAQ,CAAC;UAAC;QAClE,CAAE;QACFnD,IAAI,EAAEsC;MAAE,CACP,CAAC,GACJ,IACU,CAAC;IACjB,CAAC,CAEW,CACF,CAAC,GAEjB,IACE,CAAC;EACT;AACF"}
|
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
2
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
3
|
+
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); }
|
|
1
4
|
import BaseChartComponentProps from "@wavemaker/app-rn-runtime/components/chart/basechart.props";
|
|
2
|
-
export default class WmAreaChartProps extends BaseChartComponentProps {
|
|
5
|
+
export default class WmAreaChartProps extends BaseChartComponentProps {
|
|
6
|
+
constructor() {
|
|
7
|
+
super(...arguments);
|
|
8
|
+
_defineProperty(this, "linethickness", 2);
|
|
9
|
+
}
|
|
10
|
+
}
|
|
3
11
|
//# sourceMappingURL=area-chart.props.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["BaseChartComponentProps","WmAreaChartProps"],"sources":["area-chart.props.ts"],"sourcesContent":["import BaseChartComponentProps from \"@wavemaker/app-rn-runtime/components/chart/basechart.props\";\n\nexport default class WmAreaChartProps extends BaseChartComponentProps {\n
|
|
1
|
+
{"version":3,"names":["BaseChartComponentProps","WmAreaChartProps","constructor","arguments","_defineProperty"],"sources":["area-chart.props.ts"],"sourcesContent":["import BaseChartComponentProps from \"@wavemaker/app-rn-runtime/components/chart/basechart.props\";\n\nexport default class WmAreaChartProps extends BaseChartComponentProps {\n linethickness: number = 2;\n}\n"],"mappings":";;;AAAA,OAAOA,uBAAuB,MAAM,4DAA4D;AAEhG,eAAe,MAAMC,gBAAgB,SAASD,uBAAuB,CAAC;EAAAE,YAAA;IAAA,SAAAC,SAAA;IAAAC,eAAA,wBAC1C,CAAC;EAAA;AAC7B"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import { VictoryChart, VictoryBar, VictoryStack, VictoryGroup } from "victory-native";
|
|
2
|
+
import { View } from 'react-native';
|
|
3
|
+
import { VictoryChart, VictoryBar, VictoryLegend, VictoryStack, VictoryGroup } from "victory-native";
|
|
4
4
|
import { BaseChartComponent, BaseChartComponentState } from "@wavemaker/app-rn-runtime/components/chart/basechart.component";
|
|
5
5
|
import WmBarChartProps from './bar-chart.props';
|
|
6
6
|
import { DEFAULT_CLASS } from './bar-chart.styles';
|
|
7
|
-
import
|
|
7
|
+
import { Svg } from "react-native-svg";
|
|
8
8
|
export class WmBarChartState extends BaseChartComponentState {}
|
|
9
9
|
export default class WmBarChart extends BaseChartComponent {
|
|
10
10
|
constructor(props) {
|
|
@@ -20,8 +20,7 @@ export default class WmBarChart extends BaseChartComponent {
|
|
|
20
20
|
horizontal: props.horizontal,
|
|
21
21
|
labels: props.showvalues ? this.labelFn.bind(this) : undefined,
|
|
22
22
|
data: d,
|
|
23
|
-
height: 100
|
|
24
|
-
alignment: "start"
|
|
23
|
+
height: 100
|
|
25
24
|
});
|
|
26
25
|
});
|
|
27
26
|
}
|
|
@@ -35,19 +34,7 @@ export default class WmBarChart extends BaseChartComponent {
|
|
|
35
34
|
};
|
|
36
35
|
return /*#__PURE__*/React.createElement(View, {
|
|
37
36
|
style: this.styles.root
|
|
38
|
-
}, /*#__PURE__*/React.createElement(
|
|
39
|
-
style: {
|
|
40
|
-
flexDirection: 'row',
|
|
41
|
-
alignItems: 'center'
|
|
42
|
-
}
|
|
43
|
-
}, props.iconclass ? /*#__PURE__*/React.createElement(WmIcon, {
|
|
44
|
-
iconclass: props.iconclass,
|
|
45
|
-
styles: this.styles.icon
|
|
46
|
-
}) : null, /*#__PURE__*/React.createElement(Text, {
|
|
47
|
-
style: this.styles.title
|
|
48
|
-
}, props.title)), /*#__PURE__*/React.createElement(Text, {
|
|
49
|
-
style: this.styles.subHeading
|
|
50
|
-
}, props.subheading)), /*#__PURE__*/React.createElement(VictoryChart, {
|
|
37
|
+
}, /*#__PURE__*/React.createElement(VictoryChart, {
|
|
51
38
|
theme: this.state.theme,
|
|
52
39
|
height: this.styles.root.height,
|
|
53
40
|
width: this.styles.root.width || this.screenWidth,
|
|
@@ -58,11 +45,19 @@ export default class WmBarChart extends BaseChartComponent {
|
|
|
58
45
|
left: props.offsetleft,
|
|
59
46
|
right: props.offsetright
|
|
60
47
|
}
|
|
61
|
-
},
|
|
48
|
+
}, /*#__PURE__*/React.createElement(VictoryLegend, {
|
|
49
|
+
name: 'legend',
|
|
50
|
+
containerComponent: /*#__PURE__*/React.createElement(Svg, null),
|
|
51
|
+
title: [props.title, props.subheading],
|
|
52
|
+
orientation: "horizontal",
|
|
53
|
+
gutter: 20,
|
|
54
|
+
data: [],
|
|
55
|
+
theme: this.state.theme
|
|
56
|
+
}), this.getLegendView(), this.getXaxis(), this.getYAxis(), props.viewtype === 'Stacked' ? /*#__PURE__*/React.createElement(VictoryStack, {
|
|
62
57
|
colorScale: this.state.colors
|
|
63
58
|
}, this.getBarChart(props)) : /*#__PURE__*/React.createElement(VictoryGroup, {
|
|
64
59
|
colorScale: this.state.colors,
|
|
65
|
-
offset:
|
|
60
|
+
offset: 5
|
|
66
61
|
}, this.getBarChart(props))));
|
|
67
62
|
}
|
|
68
63
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","
|
|
1
|
+
{"version":3,"names":["React","View","VictoryChart","VictoryBar","VictoryLegend","VictoryStack","VictoryGroup","BaseChartComponent","BaseChartComponentState","WmBarChartProps","DEFAULT_CLASS","Svg","WmBarChartState","WmBarChart","constructor","props","labelFn","data","abbreviateNumber","datum","y","getBarChart","state","map","d","i","createElement","key","name","horizontal","labels","showvalues","bind","undefined","height","renderWidget","length","mindomain","x","xdomain","chartMinX","ydomain","chartMinY","style","styles","root","theme","width","screenWidth","minDomain","padding","top","offsettop","bottom","offsetbottom","left","offsetleft","right","offsetright","containerComponent","title","subheading","orientation","gutter","getLegendView","getXaxis","getYAxis","viewtype","colorScale","colors","offset"],"sources":["bar-chart.component.tsx"],"sourcesContent":["import React from 'react';\nimport { View } from 'react-native';\n\nimport {\n VictoryChart,\n VictoryBar,\n VictoryLegend,\n VictoryStack,\n VictoryGroup\n} from \"victory-native\";\n\nimport {\n BaseChartComponent,\n BaseChartComponentState\n} from \"@wavemaker/app-rn-runtime/components/chart/basechart.component\";\nimport WmBarChartProps from './bar-chart.props';\nimport { DEFAULT_CLASS, WmBarChartStyles } from './bar-chart.styles';\nimport { Svg } from \"react-native-svg\";\n\nexport class WmBarChartState extends BaseChartComponentState<WmBarChartProps> {}\n\nexport default class WmBarChart extends BaseChartComponent<WmBarChartProps, WmBarChartState, WmBarChartStyles> {\n\n constructor(props: WmBarChartProps) {\n super(props, DEFAULT_CLASS, new WmBarChartProps(), new WmBarChartState());\n }\n\n labelFn(data: any): string | number | string[] | number[] | null {\n return this.abbreviateNumber(data.datum.y);\n }\n\n getBarChart(props: WmBarChartProps) {\n return this.state.data.map((d: any, i: number) => {\n return <VictoryBar key={props.name + '_' + i}\n horizontal={props.horizontal} labels={props.showvalues ? this.labelFn.bind(this) : undefined}\n data={d}\n height={100}\n />\n });\n}\n\n renderWidget(props: WmBarChartProps) {\n if (!this.state.data.length) {\n return null;\n }\n let mindomain={x: this.props.xdomain === 'Min' ? this.state.chartMinX: undefined, y: this.props.ydomain === 'Min' ? this.state.chartMinY: undefined};\n return (<View\n style={this.styles.root}\n ><VictoryChart theme={this.state.theme}\n height={this.styles.root.height as number}\n width={this.styles.root.width as number || this.screenWidth}\n minDomain={mindomain}\n padding={{ top: props.offsettop, bottom: props.offsetbottom, left: props.offsetleft, right: props.offsetright }}>\n <VictoryLegend\n name={'legend'}\n containerComponent={<Svg />}\n title={[props.title, props.subheading]}\n orientation=\"horizontal\"\n gutter={20}\n data={[]}\n theme={this.state.theme}\n />\n {this.getLegendView()}\n {this.getXaxis()}\n {this.getYAxis()}\n {\n props.viewtype === 'Stacked' ? <VictoryStack colorScale={this.state.colors}>\n {\n this.getBarChart(props)\n }\n </VictoryStack> : <VictoryGroup colorScale={this.state.colors} offset={5}>\n {\n this.getBarChart(props)\n }\n </VictoryGroup>\n }\n </VictoryChart></View>);\n }\n}\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,QAAQ,cAAc;AAEnC,SACEC,YAAY,EACZC,UAAU,EACVC,aAAa,EACbC,YAAY,EACZC,YAAY,QACP,gBAAgB;AAEvB,SACEC,kBAAkB,EAClBC,uBAAuB,QAClB,gEAAgE;AACvE,OAAOC,eAAe,MAAM,mBAAmB;AAC/C,SAASC,aAAa,QAA0B,oBAAoB;AACpE,SAASC,GAAG,QAAQ,kBAAkB;AAEtC,OAAO,MAAMC,eAAe,SAASJ,uBAAuB,CAAkB;AAE9E,eAAe,MAAMK,UAAU,SAASN,kBAAkB,CAAqD;EAE7GO,WAAWA,CAACC,KAAsB,EAAE;IAClC,KAAK,CAACA,KAAK,EAAEL,aAAa,EAAE,IAAID,eAAe,CAAC,CAAC,EAAE,IAAIG,eAAe,CAAC,CAAC,CAAC;EAC3E;EAEAI,OAAOA,CAACC,IAAS,EAAgD;IAC/D,OAAO,IAAI,CAACC,gBAAgB,CAACD,IAAI,CAACE,KAAK,CAACC,CAAC,CAAC;EAC5C;EAEAC,WAAWA,CAACN,KAAsB,EAAE;IACpC,OAAO,IAAI,CAACO,KAAK,CAACL,IAAI,CAACM,GAAG,CA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