@wavemaker/app-rn-runtime 11.4.2-rc.5390 → 11.4.2-rc.5398
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/label/label.component.js +2 -1
- app-rn-runtime/components/basic/label/label.component.js.map +1 -1
- app-rn-runtime/components/basic/label/label.props.js +1 -0
- app-rn-runtime/components/basic/label/label.props.js.map +1 -1
- app-rn-runtime/components/chart/area-chart/area-chart.component.js +15 -10
- 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/basechart.component.js +82 -39
- app-rn-runtime/components/chart/basechart.component.js.map +1 -1
- app-rn-runtime/components/chart/basechart.props.js +8 -3
- app-rn-runtime/components/chart/basechart.props.js.map +1 -1
- app-rn-runtime/components/chart/basechart.styles.js +25 -1
- app-rn-runtime/components/chart/basechart.styles.js.map +1 -1
- app-rn-runtime/components/chart/line-chart/line-chart.component.js +31 -6
- 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/container/wizard/wizard.component.js +93 -2
- 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 -2
- app-rn-runtime/components/container/wizard/wizard.styles.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/input/basenumber/basenumber.component.js +39 -5
- 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/core/constant.service.js +22 -0
- app-rn-runtime/core/constant.service.js.map +1 -0
- app-rn-runtime/core/tappable.component.js +5 -2
- app-rn-runtime/core/tappable.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/runtime/App.js +2 -0
- app-rn-runtime/runtime/App.js.map +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","Text","View","TouchableOpacity","Platform","isArray","merge","BaseComponent","BaseComponentState","WmWizardProps","DEFAULT_CLASS","WmButton","WmIcon","WmAnchor","WmWizardState","constructor","arguments","_defineProperty","WmWizard","props","steps","children","defaultStepIndex","defaultstep","map","item","index","name","updateCurrentStep","addWizardStep","step","forceUpdate","componentDidMount","showActiveStep","_this$steps$this$stat","state","currentStep","setActive","_this$steps$this$stat2","isDone","length","undefined","setInActive","updateState","getStepStyle","style","styles","push","doneStep","activeStep","renderWizardHeader","isLastStep","numberOfSteps","isFirstStep","isActiveStep","isNumberTextLayout","classname","show","createElement","headerWrapper","paddingRight","paddingLeft","key","stepWrapper","onPress","bind","disabled","stepCounter","stepIcon","icon","color","iconclass","stepTitle","title","numberTextStepConnector","width","stepConnector","left","OS","isRTL","onPrev","invokePrevCB","onNext","eventName","invokeSkipCB","invokeNextCB","onDone","$event","invokeEventCallback","proxy","onCancel","onSkip","renderWidget","isSkippable","enableskip","root","_background","wizardHeader","i","wizardBody","wizardFooter","flexDirection","actionsalignment","wizardActions","theme","getStyle","doneButton","caption","donebtnlabel","onTap","nextButton","iconposition","nextbtnlabel","prevButton","previousbtnlabel","cancelable","cancelbtnlabel","cancelButton","skipLink"],"sources":["wizard.component.tsx"],"sourcesContent":["import React from 'react';\nimport { Text, View, TouchableOpacity, Platform } from 'react-native';\nimport { isArray, merge } from 'lodash';\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\n\nimport WmWizardProps from './wizard.props';\nimport { DEFAULT_CLASS, WmWizardStyles } from './wizard.styles';\nimport WmButton from '@wavemaker/app-rn-runtime/components/basic/button/button.component';\nimport WmIcon from '@wavemaker/app-rn-runtime/components/basic/icon/icon.component';\nimport WmAnchor from '@wavemaker/app-rn-runtime/components/basic/anchor/anchor.component';\nimport WmWizardstep from './wizardstep/wizardstep.component';\n\nexport class WmWizardState extends BaseComponentState<WmWizardProps> {\n currentStep: number = 0;\n isDone: boolean = false;\n}\n\nexport default class WmWizard extends BaseComponent<WmWizardProps, WmWizardState, WmWizardStyles> {\n private numberOfSteps: number = null as any;\n private steps = [] as WmWizardstep[];\n constructor(props: WmWizardProps) {\n super(props, DEFAULT_CLASS, new WmWizardProps());\n const steps = props.children;\n let defaultStepIndex = 0;\n if (isArray(steps) && props.defaultstep) {\n steps.map((item: any, index: any) => {\n if (props.defaultstep === item.props.name) {\n defaultStepIndex = index;\n }\n })\n }\n this.updateCurrentStep(defaultStepIndex);\n }\n\n addWizardStep(step: WmWizardstep) {\n this.steps[step.props.index] = step;\n this.forceUpdate();\n }\n\n componentDidMount() {\n super.componentDidMount();\n this.showActiveStep();\n }\n\n showActiveStep() {\n this.steps[this.state.currentStep]?.setActive();\n }\n\n updateCurrentStep(index: number, isDone = false) {\n this.steps[this.state.currentStep]?.setInActive();\n this.updateState({\n currentStep: index,\n isDone: isDone\n } as WmWizardState, () => this.showActiveStep());\n }\n\n getStepStyle(index: number) {\n const style = [this.styles.step];\n if (this.state.isDone || index < this.state.currentStep) {\n style.push(this.styles.doneStep);\n } else if (this.state.currentStep === index) {\n style.push(this.styles.activeStep);\n }\n return style;\n }\n\n renderWizardHeader(item: any, index: number) {\n const isLastStep = index === this.numberOfSteps - 1;\n const isFirstStep = index === 0;\n const isActiveStep = index === this.state.currentStep;\n const isNumberTextLayout = this.state.props.classname === 'number-text-inline';\n return item.props.show != false ? (\n <View style={[this.styles.headerWrapper, isNumberTextLayout ?\n {paddingRight: isActiveStep ? 0 : 5, paddingLeft: index === this.state.currentStep + 1 ? 0 : 5}: {}]} key={index+1}>\n <TouchableOpacity style={this.styles.stepWrapper}\n onPress={this.updateCurrentStep.bind(this, index, false)} disabled={index >= this.state.currentStep}>\n <View style={this.getStepStyle(index)}>\n {index >= this.state.currentStep && !this.state.isDone &&\n <Text style={isActiveStep ? this.styles.activeStep : this.styles.stepCounter}>{index+1}</Text>}\n {(index < this.state.currentStep || this.state.isDone) &&\n <WmIcon styles={merge({}, this.styles.stepIcon, {icon: {color: this.styles.activeStep.color}})}\n iconclass={item.props.iconclass || 'wm-sl-l sl-check'}></WmIcon>}\n </View>\n {((isNumberTextLayout && isActiveStep) || !isNumberTextLayout) &&\n <Text style={this.styles.stepTitle}>\n {item.props.title || 'Step Title'}</Text> }\n {this.numberOfSteps > 1 && isActiveStep &&\n <View style={[this.styles.numberTextStepConnector, {width: isLastStep ? 0 : 50}]}></View>}\n </TouchableOpacity>\n {this.numberOfSteps > 1 && <View style={[this.styles.stepConnector, { width: isFirstStep || isLastStep ? '50%' : '100%',\n left: Platform.OS == \"web\"?(!this.isRTL && isFirstStep) || (this.isRTL && isLastStep) ? '50%': '0%': isFirstStep ? '50%': '0%'}]}></View>}\n </View>\n ) : null;\n }\n\n onPrev(steps: any) {\n const index = this.state.currentStep;\n const currentStep = this.steps[index];\n currentStep.invokePrevCB(index);\n this.updateCurrentStep(index - 1);\n }\n\n onNext(steps: any, eventName?: string) {\n const index = this.state.currentStep;\n const currentStep = this.steps[index];\n if (eventName === 'skip') {\n currentStep.invokeSkipCB(index);\n } else {\n currentStep.invokeNextCB(index);\n }\n this.updateCurrentStep(index + 1);\n }\n\n onDone($event: any) {\n this.updateState({\n isDone: true\n } as WmWizardState);\n this.invokeEventCallback('onDone', [$event, this.proxy]);\n }\n\n onCancel() {\n this.invokeEventCallback('onCancel', [null, this.proxy]);\n }\n onSkip(steps: any) {\n this.onNext(steps, 'skip');\n }\n\n renderWidget(props: WmWizardProps) {\n this.numberOfSteps = this.steps.length;\n const activeStep = this.steps[this.state.currentStep];\n const isSkippable = this.steps[this.state.currentStep] && this.steps[this.state.currentStep].props.enableskip;\n return (\n <View style={this.styles.root}>\n {this._background}\n <View style={this.styles.wizardHeader}>\n {this.steps ? this.steps.map((step, i) => this.renderWizardHeader(step, i)) : null}\n </View>\n <View style={this.styles.wizardBody}>\n {props.children}\n </View>\n <View style={[this.styles.wizardFooter,\n {flexDirection: props.actionsalignment === 'right' ? 'row-reverse': 'row'}]}>\n {(this.state.currentStep+1) === this.numberOfSteps &&\n <WmButton iconclass={'wm-sl-l sl-check'} styles={merge({}, this.styles.wizardActions, this.theme.getStyle('btn-success'), this.styles.doneButton)}\n caption={props.donebtnlabel} onTap={this.onDone.bind(this)}></WmButton>\n }\n {(this.state.currentStep+1) < this.numberOfSteps &&\n <WmButton iconclass={'wi wi-chevron-right'} styles={merge({}, this.styles.wizardActions, this.theme.getStyle('btn-primary'), this.styles.nextButton)}\n iconposition={'right'} caption={props.nextbtnlabel} onTap={this.onNext.bind(this, this.steps)}></WmButton>\n }\n {this.state.currentStep > 0 &&\n <WmButton iconclass={'wi wi-chevron-left'} styles={merge({}, this.theme.getStyle('btn-default'), this.styles.wizardActions, this.styles.prevButton)} caption={props.previousbtnlabel}\n onTap={this.onPrev.bind(this, this.steps)}></WmButton>\n }\n {props.cancelable ?\n <WmButton caption={props.cancelbtnlabel} styles={merge({}, this.theme.getStyle('btn-default'), this.styles.wizardActions, this.styles.cancelButton)} onTap={this.onCancel.bind(this)}></WmButton>\n : null\n }\n {isSkippable &&\n <WmAnchor iconclass={'wi wi-chevron-right'} iconposition={'right'} caption={'Skip'}\n styles={merge({},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C,EAAE,IAAI,CAAC3D,MAAM,CAACyD,aAAa,EAAE,IAAI,CAACzD,MAAM,CAACmE,UAAU,CAAE;MAACN,OAAO,EAAExF,KAAK,CAAC+F,gBAAiB;MAC3KL,KAAK,EAAE,IAAI,CAAC7B,MAAM,CAACf,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC7C,KAAK;IAAE,CAAW,CAAC,EAEjED,KAAK,CAACgG,UAAU,gBACbnH,KAAA,CAAA0D,aAAA,CAAC/C,QAAQ;MAACgG,OAAO,EAAExF,KAAK,CAACiG,cAAe;MAACtE,MAAM,EAAExC,KAAK,CAAC,CAAC,CAAC,EAAE,IAAI,CAACkG,KAAK,CAACC,QAAQ,CAAC,aAAa,CAAC,EAAE,IAAI,CAAC3D,MAAM,CAACyD,aAAa,EAAE,IAAI,CAACzD,MAAM,CAACuE,YAAY,CAAE;MAACR,KAAK,EAAE,IAAI,CAACnB,QAAQ,CAACzB,IAAI,CAAC,IAAI;IAAE,CAAW,CAAC,GAC/L,IAAI,EAET4B,WAAW,iBACR7F,KAAA,CAAA0D,aAAA,CAAC7C,QAAQ;MAAC0D,SAAS,EAAE,qBAAsB;MAACwC,YAAY,EAAE,OAAQ;MAACJ,OAAO,EAAE,MAAO;MACzE7D,MAAM,EAAExC,KAAK,CAAC,CAAC,CAAC,EAAE,IAAI,CAACwC,MAAM,CAACyD,aAAa,EAAE,IAAI,CAACzD,MAAM,CAACwE,QAAQ,CAAE;MAACT,KAAK,EAAE,IAAI,CAAClB,MAAM,CAAC1B,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC7C,KAAK;IAAE,CAAW,CAEnI,CACF,CAAC;EAEX;AACF"}
|
|
1
|
+
{"version":3,"names":["React","Text","View","TouchableOpacity","Platform","TouchableWithoutFeedback","isArray","merge","BaseComponent","BaseComponentState","WmWizardProps","DEFAULT_CLASS","WmButton","WmIcon","WmAnchor","WmProgressCircle","WmPopover","WmLabel","WmWizardState","constructor","arguments","_defineProperty","WmWizard","props","onComponentInit","c","popOverRef","steps","children","defaultStepIndex","defaultstep","map","item","index","name","updateCurrentStep","addWizardStep","step","forceUpdate","componentDidMount","showActiveStep","_this$steps$this$stat","state","currentStep","setActive","_this$steps$this$stat2","isDone","length","undefined","setInActive","updateState","getStepStyle","style","styles","push","doneStep","activeStep","renderMenuPopover","menuDataset","getmenudataexpression","Labels","title","createElement","popover","contentanimation","caption","popoverheight","height","popoverwidth","width","listener","iconclass","popovericonclass","iconposition","type","currentMenuItem","key","onPress","hide","stepMenu","activeStepMenu","stepMenuActiveIcon","stepMenuIcon","stepMenuActiveLabel","stepMenuLabel","renderProgressCircleHeader","progressTitle","progresstitle","headerWrapper","stepWrapper","flex","alignItems","justifyContent","flexDirection","minvalue","maxvalue","datavalue","captionplacement","progresstype","subtitle","progressCircle","stepTitle","stepSubTitle","renderWizardHeader","isLastStep","numberOfSteps","isFirstStep","isActiveStep","isNumberTextLayout","classname","show","paddingRight","paddingLeft","bind","disabled","stepCounter","stepIcon","icon","color","numberTextStepConnector","stepConnector","left","OS","isRTL","onPrev","invokePrevCB","onNext","eventName","invokeSkipCB","invokeNextCB","onDone","$event","invokeEventCallback","proxy","onCancel","onSkip","renderWidget","_this$state$props$cla","isSkippable","enableskip","isProgressCircleHeader","includes","root","_background","wizardHeader","i","wizardBody","wizardFooter","actionsalignment","wizardActions","theme","getStyle","doneButton","donebtnlabel","onTap","nextButton","nextbtnlabel","prevButton","previousbtnlabel","cancelable","cancelbtnlabel","cancelButton","skipLink"],"sources":["wizard.component.tsx"],"sourcesContent":["import React from 'react';\nimport { Text, View, TouchableOpacity, Platform, TouchableWithoutFeedback } from 'react-native';\nimport { isArray, merge } from 'lodash';\nimport { BaseComponent, BaseComponentState, LifecycleListener } from '@wavemaker/app-rn-runtime/core/base.component';\n\nimport WmWizardProps from './wizard.props';\nimport { DEFAULT_CLASS, WmWizardStyles } from './wizard.styles';\nimport WmButton from '@wavemaker/app-rn-runtime/components/basic/button/button.component';\nimport WmIcon from '@wavemaker/app-rn-runtime/components/basic/icon/icon.component';\nimport WmAnchor from '@wavemaker/app-rn-runtime/components/basic/anchor/anchor.component';\nimport WmWizardstep from './wizardstep/wizardstep.component';\nimport WmProgressCircle from '@wavemaker/app-rn-runtime/components/basic/progress-circle/progress-circle.component';\nimport WmPopover from '@wavemaker/app-rn-runtime/components/navigation/popover/popover.component';\nimport WmLabel from '@wavemaker/app-rn-runtime/components/basic/label/label.component';\n\nexport class WmWizardState extends BaseComponentState<WmWizardProps> {\n currentStep: number = 0;\n isDone: boolean = false;\n}\n\nexport default class WmWizard extends BaseComponent<WmWizardProps, WmWizardState, WmWizardStyles> {\n private numberOfSteps: number = null as any;\n private steps = [] as WmWizardstep[];\n private popOverRef: WmPopover = null as any;\n\n private listener: LifecycleListener = {\n onComponentInit: (c) => {\n if (c instanceof WmPopover) {\n this.popOverRef = c;\n }\n }\n };\n\n constructor(props: WmWizardProps) {\n super(props, DEFAULT_CLASS, new WmWizardProps());\n const steps = props.children;\n let defaultStepIndex = 0;\n if (isArray(steps) && props.defaultstep) {\n steps.map((item: any, index: any) => {\n if (props.defaultstep === item.props.name) {\n defaultStepIndex = index;\n }\n })\n }\n this.updateCurrentStep(defaultStepIndex);\n }\n\n addWizardStep(step: WmWizardstep) {\n this.steps[step.props.index] = step;\n this.forceUpdate();\n }\n\n componentDidMount() {\n super.componentDidMount();\n this.showActiveStep();\n }\n\n showActiveStep() {\n this.steps[this.state.currentStep]?.setActive();\n }\n\n updateCurrentStep(index: number, isDone = false) {\n this.steps[this.state.currentStep]?.setInActive();\n this.updateState({\n currentStep: index,\n isDone: isDone\n } as WmWizardState, () => this.showActiveStep());\n }\n\n getStepStyle(index: number) {\n const style = [this.styles.step];\n if (this.state.isDone || index < this.state.currentStep) {\n style.push(this.styles.doneStep);\n } else if (this.state.currentStep === index) {\n style.push(this.styles.activeStep);\n }\n return style;\n }\n\n renderMenuPopover(){\n const menuDataset = this.props.getmenudataexpression || ((item: any, index: number) => '') ;\n const Labels = this.steps.map((step: WmWizardstep) => step.state.props.title);\n return (\n <WmPopover\n styles={this.styles.popover}\n contentanimation={'slideInDown'}\n caption={''}\n popoverheight={this.styles.popover.popover.height as string | number | undefined || null}\n popoverwidth={this.styles.popover.popover.width as string | number | undefined || null}\n listener={this.listener}\n iconclass={this.props.popovericonclass || 'fa fa-caret-down'}\n iconposition=\"right\"\n type='dropdown'>\n <View style={this.styles.popover.popover}>\n {Labels.map((item: any, index: number) => {\n const currentMenuItem = index==this.state.currentStep;\n const caption = menuDataset({\"count\":this.steps.length}, index); \n return (\n <TouchableWithoutFeedback key={'wizard_menu_item_'+index} onPress={()=>{this.popOverRef.hide();}}>\n <View style={[this.styles.stepMenu, currentMenuItem?this.styles.activeStepMenu:{}]}>\n <WmIcon caption={caption} iconclass={currentMenuItem? \"wi wi-radio-button-checked\" : 'wi wi-radio-button-unchecked'} styles={currentMenuItem?this.styles.stepMenuActiveIcon:this.styles.stepMenuIcon}/>\n <WmLabel caption={item} styles={currentMenuItem?this.styles.stepMenuActiveLabel:this.styles.stepMenuLabel}/>\n </View>\n </TouchableWithoutFeedback>\n )})}\n </View>\n </WmPopover>\n );\n }\n\n renderProgressCircleHeader(item: any, index: number) {\n const progressTitle = this.props.progresstitle || (index + 1 + '/' + this.steps.length);\n return (\n <View style={[this.styles.headerWrapper]} key={index + 1}>\n <View style={this.styles.stepWrapper}>\n <View style={{ flex: 1, alignItems: 'flex-start', justifyContent: 'center', flexDirection:'row' }}>\n <WmProgressCircle minvalue={0} maxvalue={this.steps.length} datavalue={index + 1} captionplacement={'inside'} type={this.props.progresstype} title={progressTitle} subtitle={''} styles={this.styles.progressCircle} />\n </View>\n <View style={{ flex: 2, justifyContent: 'center', flexDirection: 'column' }}>\n <Text style={this.styles.stepTitle}>\n {item.props.title || 'Step Title'}</Text>\n <Text style={this.styles.stepSubTitle}>\n {item.props.subtitle || 'Step Sub Title'}</Text>\n </View>\n <View style={{ flexDirection: 'row', alignItems: 'flex-end', justifyContent: 'flex-end' }}>\n {this.renderMenuPopover()}\n </View>\n </View>\n </View>\n );\n }\n\n renderWizardHeader(item: any, index: number) {\n const isLastStep = index === this.numberOfSteps - 1;\n const isFirstStep = index === 0;\n const isActiveStep = index === this.state.currentStep;\n const isNumberTextLayout = this.state.props.classname === 'number-text-inline';\n return item.props.show != false ? (\n <View style={[this.styles.headerWrapper, isNumberTextLayout ?\n {paddingRight: isActiveStep ? 0 : 5, paddingLeft: index === this.state.currentStep + 1 ? 0 : 5}: {}]} key={index+1}>\n <TouchableOpacity style={this.styles.stepWrapper}\n onPress={this.updateCurrentStep.bind(this, index, false)} disabled={index >= this.state.currentStep}>\n <View style={this.getStepStyle(index)}>\n {index >= this.state.currentStep && !this.state.isDone &&\n <Text style={isActiveStep ? this.styles.activeStep : this.styles.stepCounter}>{index+1}</Text>}\n {(index < this.state.currentStep || this.state.isDone) &&\n <WmIcon styles={merge({}, this.styles.stepIcon, {icon: {color: this.styles.activeStep.color}})}\n iconclass={item.props.iconclass || 'wm-sl-l sl-check'}></WmIcon>}\n </View>\n {((isNumberTextLayout && isActiveStep) || !isNumberTextLayout) &&\n <Text style={this.styles.stepTitle}>\n {item.props.title || 'Step Title'}</Text> }\n {this.numberOfSteps > 1 && isActiveStep &&\n <View style={[this.styles.numberTextStepConnector, {width: isLastStep ? 0 : 50}]}></View>}\n </TouchableOpacity>\n {this.numberOfSteps > 1 && <View style={[this.styles.stepConnector, { width: isFirstStep || isLastStep ? '50%' : '100%',\n left: Platform.OS == \"web\"?(!this.isRTL && isFirstStep) || (this.isRTL && isLastStep) ? '50%': '0%': isFirstStep ? '50%': '0%'}]}></View>}\n </View>\n ) : null;\n }\n\n onPrev(steps: any) {\n const index = this.state.currentStep;\n const currentStep = this.steps[index];\n currentStep.invokePrevCB(index);\n this.updateCurrentStep(index - 1);\n }\n\n onNext(steps: any, eventName?: string) {\n const index = this.state.currentStep;\n const currentStep = this.steps[index];\n if (eventName === 'skip') {\n currentStep.invokeSkipCB(index);\n } else {\n currentStep.invokeNextCB(index);\n }\n this.updateCurrentStep(index + 1);\n }\n\n onDone($event: any) {\n this.updateState({\n isDone: true\n } as WmWizardState);\n this.invokeEventCallback('onDone', [$event, this.proxy]);\n }\n\n onCancel() {\n this.invokeEventCallback('onCancel', [null, this.proxy]);\n }\n onSkip(steps: any) {\n this.onNext(steps, 'skip');\n }\n\n renderWidget(props: WmWizardProps) {\n this.numberOfSteps = this.steps.length;\n const activeStep = this.steps[this.state.currentStep];\n const isSkippable = this.steps[this.state.currentStep] && this.steps[this.state.currentStep].props.enableskip;\n const isProgressCircleHeader = this.state.props.classname?.includes('progress-circle-header');\n return (\n <View style={this.styles.root}>\n {this._background}\n <View style={this.styles.wizardHeader}>\n {activeStep && isProgressCircleHeader ? (this.renderProgressCircleHeader(activeStep, this.state.currentStep)) : (this.steps ? this.steps.map((step, i) => this.renderWizardHeader(step, i)) : null)}\n </View>\n <View style={this.styles.wizardBody}>\n {props.children}\n </View>\n <View style={[this.styles.wizardFooter,\n {flexDirection: props.actionsalignment === 'right' ? 'row-reverse': 'row'}]}>\n {(this.state.currentStep+1) === this.numberOfSteps &&\n <WmButton iconclass={'wm-sl-l sl-check'} styles={merge({}, this.styles.wizardActions, this.theme.getStyle('btn-success'), this.styles.doneButton)}\n caption={props.donebtnlabel} onTap={this.onDone.bind(this)}></WmButton>\n }\n {(this.state.currentStep+1) < this.numberOfSteps &&\n <WmButton iconclass={'wi wi-chevron-right'} styles={merge({}, this.styles.wizardActions, this.theme.getStyle('btn-primary'), this.styles.nextButton)}\n iconposition={'right'} caption={props.nextbtnlabel} onTap={this.onNext.bind(this, this.steps)}></WmButton>\n }\n {this.state.currentStep > 0 &&\n <WmButton iconclass={'wi wi-chevron-left'} styles={merge({}, this.theme.getStyle('btn-default'), this.styles.wizardActions, this.styles.prevButton)} caption={props.previousbtnlabel}\n onTap={this.onPrev.bind(this, this.steps)}></WmButton>\n }\n {props.cancelable ?\n <WmButton caption={props.cancelbtnlabel} styles={merge({}, this.theme.getStyle('btn-default'), this.styles.wizardActions, this.styles.cancelButton)} onTap={this.onCancel.bind(this)}></WmButton>\n : null\n }\n {isSkippable &&\n <WmAnchor iconclass={'wi wi-chevron-right'} iconposition={'right'} caption={'Skip'}\n styles={merge({}, this.styles.wizardActions, this.styles.skipLink)} onTap={this.onSkip.bind(this, this.steps)}></WmAnchor>\n }\n </View>\n </View>\n );\n }\n}\n"],"mappings":";;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,EAAEC,IAAI,EAAEC,gBAAgB,EAAEC,QAAQ,EAAEC,wBAAwB,QAAQ,cAAc;AAC/F,SAASC,OAAO,EAAEC,KAAK,QAAQ,QAAQ;AACvC,SAASC,aAAa,EAAEC,kBAAkB,QAA2B,+CAA+C;AAEpH,OAAOC,aAAa,MAAM,gBAAgB;AAC1C,SAASC,aAAa,QAAwB,iBAAiB;AAC/D,OAAOC,QAAQ,MAAM,oEAAoE;AACzF,OAAOC,MAAM,MAAM,gEAAgE;AACnF,OAAOC,QAAQ,MAAM,oEAAoE;AAEzF,OAAOC,gBAAgB,MAAM,sFAAsF;AACnH,OAAOC,SAAS,MAAM,2EAA2E;AACjG,OAAOC,OAAO,MAAM,kEAAkE;AAEtF,OAAO,MAAMC,aAAa,SAAST,kBAAkB,CAAgB;EAAAU,YAAA;IAAA,SAAAC,SAAA;IAAAC,eAAA,sBAC7C,CAAC;IAAAA,eAAA,iBACL,KAAK;EAAA;AACzB;AAEA,eAAe,MAAMC,QAAQ,SAASd,aAAa,CAA+C;EAahGW,WAAWA,CAACI,KAAoB,EAAE;IAChC,KAAK,CAACA,KAAK,EAAEZ,aAAa,EAAE,IAAID,aAAa,CAAC,CAAC,CAAC;IAACW,eAAA,wBAbnB,IAAI;IAAAA,eAAA,gBACpB,EAAE;IAAAA,eAAA,qBACc,IAAI;IAAAA,eAAA,mBAEE;MACpCG,eAAe,EAAGC,CAAC,IAAK;QACtB,IAAIA,CAAC,YAAYT,SAAS,EAAE;UAC1B,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,CAAE;MAACP,KAAK,EAAE,IAAI,CAACpB,QAAQ,CAACrB,IAAI,CAAC,IAAI;IAAE,CAAW,CAAC,GAC/L,IAAI,EAETyB,WAAW,iBACR1I,KAAA,CAAA8D,aAAA,CAAChD,QAAQ;MAACyD,SAAS,EAAE,qBAAsB;MAACE,YAAY,EAAE,OAAQ;MAACR,OAAO,EAAE,MAAO;MACzEZ,MAAM,EAAE9C,KAAK,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC8C,MAAM,CAACgG,aAAa,EAAE,IAAI,CAAChG,MAAM,CAAC6G,QAAQ,CAAE;MAACR,KAAK,EAAE,IAAI,CAACnB,MAAM,CAACtB,IAAI,CAAC,IAAI,EAAE,IAAI,CAACtF,KAAK;IAAE,CAAW,CAEnI,CACF,CAAC;EAEX;AACF"}
|
|
@@ -13,6 +13,10 @@ export default class WmWizardProps extends BaseProps {
|
|
|
13
13
|
_defineProperty(this, "nextbtnlabel", 'Next');
|
|
14
14
|
_defineProperty(this, "previousbtnlabel", 'Previous');
|
|
15
15
|
_defineProperty(this, "defaultstep", 'none');
|
|
16
|
+
_defineProperty(this, "progresstitle", '');
|
|
17
|
+
_defineProperty(this, "progresstype", 'default');
|
|
18
|
+
_defineProperty(this, "getmenudataexpression", undefined);
|
|
19
|
+
_defineProperty(this, "popovericonclass", 'fa fa-caret-down');
|
|
16
20
|
}
|
|
17
21
|
}
|
|
18
22
|
//# sourceMappingURL=wizard.props.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["BaseProps","WmWizardProps","constructor","arguments","_defineProperty"],"sources":["wizard.props.ts"],"sourcesContent":["import { BaseProps } from '@wavemaker/app-rn-runtime/core/base.component';\n\nexport default class WmWizardProps extends BaseProps {\n actionsalignment: string = 'right';\n children: any;\n cancelable: boolean = true;\n cancelbtnlabel: string = 'Cancel';\n donebtnlabel: string = 'Done';\n nextbtnlabel: string = 'Next';\n previousbtnlabel: string = 'Previous';\n defaultstep: string = 'none';\n}\n"],"mappings":";;;AAAA,SAASA,SAAS,QAAQ,+CAA+C;AAEzE,eAAe,MAAMC,aAAa,SAASD,SAAS,CAAC;EAAAE,YAAA;IAAA,SAAAC,SAAA;IAAAC,eAAA,2BACxB,OAAO;IAAAA,eAAA;IAAAA,eAAA,qBAEZ,IAAI;IAAAA,eAAA,yBACD,QAAQ;IAAAA,eAAA,uBACV,MAAM;IAAAA,eAAA,uBACN,MAAM;IAAAA,eAAA,2BACF,UAAU;IAAAA,eAAA,sBACf,MAAM;EAAA;
|
|
1
|
+
{"version":3,"names":["BaseProps","WmWizardProps","constructor","arguments","_defineProperty","undefined"],"sources":["wizard.props.ts"],"sourcesContent":["import { BaseProps } from '@wavemaker/app-rn-runtime/core/base.component';\n\nexport default class WmWizardProps extends BaseProps {\n actionsalignment: string = 'right';\n children: any;\n cancelable: boolean = true;\n cancelbtnlabel: string = 'Cancel';\n donebtnlabel: string = 'Done';\n nextbtnlabel: string = 'Next';\n previousbtnlabel: string = 'Previous';\n defaultstep: string = 'none';\n progresstitle: string = '';\n progresstype: 'default' | 'success' | 'info' | 'warning' | 'error' = 'default';\n getmenudataexpression: any = undefined;\n popovericonclass: string = 'fa fa-caret-down';\n}\n"],"mappings":";;;AAAA,SAASA,SAAS,QAAQ,+CAA+C;AAEzE,eAAe,MAAMC,aAAa,SAASD,SAAS,CAAC;EAAAE,YAAA;IAAA,SAAAC,SAAA;IAAAC,eAAA,2BACxB,OAAO;IAAAA,eAAA;IAAAA,eAAA,qBAEZ,IAAI;IAAAA,eAAA,yBACD,QAAQ;IAAAA,eAAA,uBACV,MAAM;IAAAA,eAAA,uBACN,MAAM;IAAAA,eAAA,2BACF,UAAU;IAAAA,eAAA,sBACf,MAAM;IAAAA,eAAA,wBACJ,EAAE;IAAAA,eAAA,uBAC2C,SAAS;IAAAA,eAAA,gCACjDC,SAAS;IAAAD,eAAA,2BACX,kBAAkB;EAAA;AAC/C"}
|
|
@@ -47,7 +47,8 @@ BASE_THEME.registerStyle((themeVariables, addStyle) => {
|
|
|
47
47
|
wizardFooter: {
|
|
48
48
|
flexDirection: 'row',
|
|
49
49
|
justifyContent: 'flex-start',
|
|
50
|
-
padding: 12
|
|
50
|
+
padding: 12,
|
|
51
|
+
width: '100%'
|
|
51
52
|
},
|
|
52
53
|
buttonWrapper: {
|
|
53
54
|
flexDirection: 'row'
|
|
@@ -57,6 +58,9 @@ BASE_THEME.registerStyle((themeVariables, addStyle) => {
|
|
|
57
58
|
fontSize: 12,
|
|
58
59
|
color: themeVariables.wizardStepTitleColor
|
|
59
60
|
},
|
|
61
|
+
stepSubTitle: {
|
|
62
|
+
color: themeVariables.wizardStepTitleColor
|
|
63
|
+
},
|
|
60
64
|
step: {
|
|
61
65
|
alignItems: 'center',
|
|
62
66
|
justifyContent: 'center',
|
|
@@ -126,7 +130,15 @@ BASE_THEME.registerStyle((themeVariables, addStyle) => {
|
|
|
126
130
|
stepCounter: {
|
|
127
131
|
fontSize: 15,
|
|
128
132
|
color: themeVariables.wizardStepColor
|
|
129
|
-
}
|
|
133
|
+
},
|
|
134
|
+
progressCircle: {},
|
|
135
|
+
popover: {},
|
|
136
|
+
stepMenu: {},
|
|
137
|
+
activeStepMenu: {},
|
|
138
|
+
stepMenuLabel: {},
|
|
139
|
+
stepMenuActiveLabel: {},
|
|
140
|
+
stepMenuIcon: {},
|
|
141
|
+
stepMenuActiveIcon: {}
|
|
130
142
|
});
|
|
131
143
|
addStyle(DEFAULT_CLASS, '', defaultStyles);
|
|
132
144
|
addStyle('number-text-inline', '', {
|
|
@@ -151,6 +163,95 @@ BASE_THEME.registerStyle((themeVariables, addStyle) => {
|
|
|
151
163
|
padding: 5
|
|
152
164
|
}
|
|
153
165
|
});
|
|
166
|
+
addStyle('progress-circle-header', '', {
|
|
167
|
+
stepWrapper: {
|
|
168
|
+
paddingBottom: 4,
|
|
169
|
+
flexDirection: 'row',
|
|
170
|
+
alignItems: 'center'
|
|
171
|
+
},
|
|
172
|
+
wizardHeader: {
|
|
173
|
+
justifyContent: 'flex-start',
|
|
174
|
+
alignItems: 'center',
|
|
175
|
+
backgroundColor: themeVariables.wizardBackgroundColor,
|
|
176
|
+
height: 120,
|
|
177
|
+
borderRadius: 30
|
|
178
|
+
},
|
|
179
|
+
stepSubTitle: {
|
|
180
|
+
fontSize: 12,
|
|
181
|
+
paddingHorizontal: 5
|
|
182
|
+
},
|
|
183
|
+
headerWrapper: {
|
|
184
|
+
flex: 1
|
|
185
|
+
},
|
|
186
|
+
stepTitle: {
|
|
187
|
+
fontSize: 16,
|
|
188
|
+
paddingHorizontal: 5
|
|
189
|
+
},
|
|
190
|
+
progressCircle: {
|
|
191
|
+
root: {
|
|
192
|
+
height: 60,
|
|
193
|
+
width: 60
|
|
194
|
+
},
|
|
195
|
+
text: {},
|
|
196
|
+
progressValue: {
|
|
197
|
+
height: 8
|
|
198
|
+
}
|
|
199
|
+
},
|
|
200
|
+
popover: {
|
|
201
|
+
popover: {
|
|
202
|
+
width: 160,
|
|
203
|
+
paddingTop: 8,
|
|
204
|
+
paddingBottom: 8,
|
|
205
|
+
backgroundColor: themeVariables.menuBackgroundColor,
|
|
206
|
+
minHeight: 160,
|
|
207
|
+
borderBottomLeftRadius: 28,
|
|
208
|
+
borderBottomRightRadius: 28
|
|
209
|
+
},
|
|
210
|
+
popoverContent: {
|
|
211
|
+
root: {
|
|
212
|
+
//@ts-ignore
|
|
213
|
+
flex: undefined
|
|
214
|
+
}
|
|
215
|
+
},
|
|
216
|
+
modalContent: {
|
|
217
|
+
borderBottomLeftRadius: 28,
|
|
218
|
+
borderBottomRightRadius: 28
|
|
219
|
+
}
|
|
220
|
+
},
|
|
221
|
+
stepMenu: {
|
|
222
|
+
flexDirection: 'row',
|
|
223
|
+
padding: 14,
|
|
224
|
+
alignItems: 'center',
|
|
225
|
+
justifyContent: 'flex-start'
|
|
226
|
+
},
|
|
227
|
+
activeStepMenu: {},
|
|
228
|
+
stepMenuLabel: {
|
|
229
|
+
text: {
|
|
230
|
+
color: themeVariables.menuItemTextColor
|
|
231
|
+
}
|
|
232
|
+
},
|
|
233
|
+
stepMenuActiveLabel: {
|
|
234
|
+
text: {
|
|
235
|
+
color: themeVariables.primaryColor
|
|
236
|
+
}
|
|
237
|
+
},
|
|
238
|
+
stepMenuIcon: {
|
|
239
|
+
root: {
|
|
240
|
+
paddingRight: 4
|
|
241
|
+
},
|
|
242
|
+
text: {
|
|
243
|
+
color: themeVariables.menuItemTextColor
|
|
244
|
+
}
|
|
245
|
+
},
|
|
246
|
+
stepMenuActiveIcon: {
|
|
247
|
+
root: {
|
|
248
|
+
paddingRight: 4
|
|
249
|
+
},
|
|
250
|
+
text: {
|
|
251
|
+
color: themeVariables.primaryColor
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
});
|
|
154
255
|
addStyle(DEFAULT_CLASS + '-rtl', '', {
|
|
155
256
|
wizardActions: {
|
|
156
257
|
icon: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["BASE_THEME","defineStyles","DEFAULT_CLASS","registerStyle","themeVariables","addStyle","defaultStyles","root","flexDirection","backgroundColor","wizardBackgroundColor","display","minHeight","text","activeStep","wizardStepActiveColor","borderColor","color","wizardActiveStepColor","doneStep","wizardStepDoneColor","wizardDoneStepColor","wizardHeader","padding","alignItems","justifyContent","stepWrapper","zIndex","headerWrapper","flex","wizardBody","alignSelf","paddingTop","width","borderWidth","borderTopWidth","borderBottomWidth","wizardBorderColor","wizardFooter","buttonWrapper","stepTitle","textTransform","fontSize","wizardStepTitleColor","step","height","borderRadius","wizardStepColor","wizardActions","marginRight","nextButton","wizardNextBtnColor","prevButton","cancelButton","doneButton","wizardDoneBtnColor","icon","stepIcon","wizardStepIconColor","skipLink","stepConnector","wizardStepConnectorColor","position","top","numberTextStepConnector","stepCounter","transform","rotateY"],"sources":["wizard.styles.ts"],"sourcesContent":["import BASE_THEME, { AllStyle } from '@wavemaker/app-rn-runtime/styles/theme';\nimport { BaseStyles, defineStyles } from '@wavemaker/app-rn-runtime/core/base.component';\nimport { WmButtonStyles } from '@wavemaker/app-rn-runtime/components/basic/button/button.styles';\nimport { WmIconStyles } from '@wavemaker/app-rn-runtime/components/basic/icon/icon.styles';\nimport { WmAnchorStyles } from '@wavemaker/app-rn-runtime/components/basic/anchor/anchor.styles';\n\nexport type WmWizardStyles = BaseStyles & {\n wizardHeader: AllStyle,\n wizardBody: AllStyle,\n wizardFooter: AllStyle,\n wizardActions: WmButtonStyles,\n stepTitle: AllStyle,\n buttonWrapper: AllStyle,\n step: AllStyle,\n nextButton: WmButtonStyles,\n doneButton: WmButtonStyles,\n prevButton: WmButtonStyles,\n cancelButton: WmButtonStyles,\n stepIcon: WmIconStyles,\n skipLink: WmAnchorStyles,\n activeStep: AllStyle,\n doneStep: AllStyle,\n headerWrapper: AllStyle,\n stepWrapper: AllStyle,\n stepConnector: AllStyle,\n numberTextStepConnector: AllStyle,\n stepCounter: AllStyle\n};\n\nexport const DEFAULT_CLASS = 'app-wizard';\nBASE_THEME.registerStyle((themeVariables, addStyle) => {\n const defaultStyles: WmWizardStyles = defineStyles({\n root: {\n flexDirection: 'column',\n backgroundColor: themeVariables.wizardBackgroundColor,\n display: 'flex',\n minHeight: 240\n },\n text: {},\n activeStep:{\n backgroundColor: themeVariables.wizardStepActiveColor,\n borderColor: themeVariables.wizardStepActiveColor,\n color: themeVariables.wizardActiveStepColor\n },\n doneStep: {\n backgroundColor: themeVariables.wizardStepDoneColor,\n color: themeVariables.wizardDoneStepColor,\n borderColor: themeVariables.wizardStepDoneColor\n },\n wizardHeader: {\n padding: 8,\n flexDirection: 'row',\n alignItems: 'flex-start',\n justifyContent: 'center'\n },\n stepWrapper: {\n alignItems: 'center',\n justifyContent: 'center',\n zIndex: 20\n },\n headerWrapper: {\n flex: 1\n },\n wizardBody: {\n alignSelf: 'flex-start',\n paddingTop: 10,\n flex: 1,\n width: '100%',\n borderWidth: 0,\n borderTopWidth: 1,\n borderBottomWidth: 1,\n borderColor: themeVariables.wizardBorderColor\n },\n wizardFooter: {\n flexDirection: 'row',\n justifyContent: 'flex-start',\n padding: 12\n },\n buttonWrapper: {\n flexDirection: 'row',\n },\n stepTitle: {\n textTransform: 'capitalize',\n fontSize: 12,\n color: themeVariables.wizardStepTitleColor\n },\n step: {\n alignItems: 'center',\n justifyContent: 'center',\n width: 37,\n backgroundColor: themeVariables.wizardBackgroundColor,\n height: 37,\n borderWidth: 1,\n borderRadius: 18.5,\n color: themeVariables.wizardStepColor,\n borderColor: themeVariables.wizardStepColor\n },\n wizardActions: {\n root: {\n marginRight: 8\n },\n text : {\n textTransform: 'capitalize',\n fontSize: 14\n }\n } as WmButtonStyles,\n nextButton: {\n root: {\n marginRight: 0,\n backgroundColor: themeVariables.wizardNextBtnColor,\n borderColor: themeVariables.wizardNextBtnColor\n }\n } as WmButtonStyles,\n prevButton: {\n } as WmButtonStyles,\n cancelButton: {\n } as WmButtonStyles,\n doneButton: {\n root: {\n marginRight: 0,\n backgroundColor: themeVariables.wizardDoneBtnColor\n },\n icon: {\n text: {\n fontSize: 12\n }\n }\n } as WmButtonStyles,\n stepIcon: {\n root: {\n alignSelf: 'center',\n justifyContent: 'center'\n },\n text: {\n color: themeVariables.wizardStepIconColor,\n fontSize: 15\n }\n } as WmIconStyles,\n skipLink: {\n root: {\n padding: 8,\n alignSelf: 'flex-end'\n },\n } as WmAnchorStyles,\n stepConnector: {\n backgroundColor: themeVariables.wizardStepConnectorColor,\n position: 'absolute',\n top: 17.5,\n zIndex: 10,\n height: 2\n },\n numberTextStepConnector: {\n display: 'none'\n },\n stepCounter: {\n fontSize: 15,\n color: themeVariables.wizardStepColor\n }\n } as WmWizardStyles);\n\n addStyle(DEFAULT_CLASS, '', defaultStyles);\n addStyle('number-text-inline', '', {\n stepConnector: {\n display: 'none'\n },\n numberTextStepConnector: {\n backgroundColor: themeVariables.wizardStepConnectorColor,\n height: 2,\n display: 'flex'\n },\n stepWrapper: {\n flexDirection: 'row'\n },\n wizardHeader: {\n justifyContent: 'flex-start'\n },\n headerWrapper: {\n flex: -1\n },\n stepTitle: {\n padding: 5\n },\n } as WmWizardStyles);\n addStyle(DEFAULT_CLASS + '-rtl', '', {\n wizardActions: {\n icon: {\n root:{\n transform: [{rotateY:'180deg'}]\n }\n },\n },\n nextButton:{\n root: {\n marginRight: 8,\n }\n },\n doneButton:{\n root: {\n marginRight: 8,\n },\n icon:{\n root:{\n transform: [{rotateY:'0deg'}]\n }\n }\n }\n });\n});\n"],"mappings":"AAAA,OAAOA,UAAU,MAAoB,wCAAwC;AAC7E,SAAqBC,YAAY,QAAQ,+CAA+C;AA4BxF,OAAO,MAAMC,aAAa,GAAG,YAAY;AACzCF,UAAU,CAACG,aAAa,CAAC,CAACC,cAAc,EAAEC,QAAQ,KAAK;EACrD,MAAMC,aAA6B,GAAGL,YAAY,CAAC;IAC/CM,IAAI,EAAE;MACJC,aAAa,EAAE,QAAQ;MACvBC,eAAe,EAAEL,cAAc,CAACM,qBAAqB;MACrDC,OAAO,EAAE,MAAM;MACfC,SAAS,EAAE;IACb,CAAC;IACDC,IAAI,EAAE,CAAC,CAAC;IACRC,UAAU,EAAC;MACPL,eAAe,EAAEL,cAAc,CAACW,qBAAqB;MACrDC,WAAW,EAAEZ,cAAc,CAACW,qBAAqB;MACjDE,KAAK,EAAEb,cAAc,CAACc;IAC1B,CAAC;IACDC,QAAQ,EAAE;MACRV,eAAe,EAAEL,cAAc,CAACgB,mBAAmB;MACnDH,KAAK,EAAEb,cAAc,CAACiB,mBAAmB;MACzCL,WAAW,EAAEZ,cAAc,CAACgB;IAC9B,CAAC;IACDE,YAAY,EAAE;MACZC,OAAO,EAAE,CAAC;MACVf,aAAa,EAAE,KAAK;MACpBgB,UAAU,EAAE,YAAY;MACxBC,cAAc,EAAE;IAClB,CAAC;IACDC,WAAW,EAAE;MACXF,UAAU,EAAE,QAAQ;MACpBC,cAAc,EAAE,QAAQ;MACxBE,MAAM,EAAE;IACV,CAAC;IACDC,aAAa,EAAE;MACbC,IAAI,EAA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;IACDW,SAAS,EAAE;MACTjB,OAAO,EAAE;IACX;EACF,CAAmB,CAAC;EACpBlB,QAAQ,CAACH,aAAa,GAAG,MAAM,EAAE,EAAE,EAAE;IACnC8C,aAAa,EAAE;MACbQ,IAAI,EAAE;QACJjD,IAAI,EAAC;UACH2D,SAAS,EAAE,CAAC;YAACC,OAAO,EAAC;UAAQ,CAAC;QAChC;MACF;IACF,CAAC;IACDjB,UAAU,EAAC;MACT3C,IAAI,EAAE;QACJ0C,WAAW,EAAE;MACf;IACF,CAAC;IACDK,UAAU,EAAC;MACT/C,IAAI,EAAE;QACJ0C,WAAW,EAAE;MACf,CAAC;MACDO,IAAI,EAAC;QACHjD,IAAI,EAAC;UACH2D,SAAS,EAAE,CAAC;YAACC,OAAO,EAAC;UAAM,CAAC;QAC9B;MACF;IACF;EACF,CAAC,CAAC;AACJ,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"names":["BASE_THEME","defineStyles","DEFAULT_CLASS","registerStyle","themeVariables","addStyle","defaultStyles","root","flexDirection","backgroundColor","wizardBackgroundColor","display","minHeight","text","activeStep","wizardStepActiveColor","borderColor","color","wizardActiveStepColor","doneStep","wizardStepDoneColor","wizardDoneStepColor","wizardHeader","padding","alignItems","justifyContent","stepWrapper","zIndex","headerWrapper","flex","wizardBody","alignSelf","paddingTop","width","borderWidth","borderTopWidth","borderBottomWidth","wizardBorderColor","wizardFooter","buttonWrapper","stepTitle","textTransform","fontSize","wizardStepTitleColor","stepSubTitle","step","height","borderRadius","wizardStepColor","wizardActions","marginRight","nextButton","wizardNextBtnColor","prevButton","cancelButton","doneButton","wizardDoneBtnColor","icon","stepIcon","wizardStepIconColor","skipLink","stepConnector","wizardStepConnectorColor","position","top","numberTextStepConnector","stepCounter","progressCircle","popover","stepMenu","activeStepMenu","stepMenuLabel","stepMenuActiveLabel","stepMenuIcon","stepMenuActiveIcon","paddingBottom","paddingHorizontal","progressValue","menuBackgroundColor","borderBottomLeftRadius","borderBottomRightRadius","popoverContent","undefined","modalContent","menuItemTextColor","primaryColor","paddingRight","transform","rotateY"],"sources":["wizard.styles.ts"],"sourcesContent":["import BASE_THEME, { AllStyle } from '@wavemaker/app-rn-runtime/styles/theme';\nimport { BaseStyles, defineStyles } from '@wavemaker/app-rn-runtime/core/base.component';\nimport { WmButtonStyles } from '@wavemaker/app-rn-runtime/components/basic/button/button.styles';\nimport { WmIconStyles } from '@wavemaker/app-rn-runtime/components/basic/icon/icon.styles';\nimport { WmAnchorStyles } from '@wavemaker/app-rn-runtime/components/basic/anchor/anchor.styles';\nimport { WmProgressCircleStyles } from '@wavemaker/app-rn-runtime/components/basic/progress-circle/progress-circle.styles';\nimport { WmPopoverStyles } from '@wavemaker/app-rn-runtime/components/navigation/popover/popover.styles';\nimport { WmLabelStyles } from '@wavemaker/app-rn-runtime/components/basic/label/label.styles';\n\nexport type WmWizardStyles = BaseStyles & {\n wizardHeader: AllStyle,\n wizardBody: AllStyle,\n wizardFooter: AllStyle,\n wizardActions: WmButtonStyles,\n stepTitle: AllStyle,\n stepSubTitle: AllStyle,\n buttonWrapper: AllStyle,\n step: AllStyle,\n nextButton: WmButtonStyles,\n doneButton: WmButtonStyles,\n prevButton: WmButtonStyles,\n cancelButton: WmButtonStyles,\n stepIcon: WmIconStyles,\n skipLink: WmAnchorStyles,\n activeStep: AllStyle,\n doneStep: AllStyle,\n headerWrapper: AllStyle,\n stepWrapper: AllStyle,\n stepConnector: AllStyle,\n numberTextStepConnector: AllStyle,\n stepCounter: AllStyle,\n progressCircle: WmProgressCircleStyles,\n popover: WmPopoverStyles,\n stepMenu: AllStyle,\n activeStepMenu: AllStyle,\n stepMenuLabel: WmLabelStyles,\n stepMenuActiveLabel: WmLabelStyles\n stepMenuIcon: WmIconStyles,\n stepMenuActiveIcon: WmIconStyles\n};\n\nexport const DEFAULT_CLASS = 'app-wizard';\nBASE_THEME.registerStyle((themeVariables, addStyle) => {\n const defaultStyles: WmWizardStyles = defineStyles({\n root: {\n flexDirection: 'column',\n backgroundColor: themeVariables.wizardBackgroundColor,\n display: 'flex',\n minHeight: 240\n },\n text: {},\n activeStep:{\n backgroundColor: themeVariables.wizardStepActiveColor,\n borderColor: themeVariables.wizardStepActiveColor,\n color: themeVariables.wizardActiveStepColor\n },\n doneStep: {\n backgroundColor: themeVariables.wizardStepDoneColor,\n color: themeVariables.wizardDoneStepColor,\n borderColor: themeVariables.wizardStepDoneColor\n },\n wizardHeader: {\n padding: 8,\n flexDirection: 'row',\n alignItems: 'flex-start',\n justifyContent: 'center'\n },\n stepWrapper: {\n alignItems: 'center',\n justifyContent: 'center',\n zIndex: 20\n },\n headerWrapper: {\n flex: 1\n },\n wizardBody: {\n alignSelf: 'flex-start',\n paddingTop: 10,\n flex: 1,\n width: '100%',\n borderWidth: 0,\n borderTopWidth: 1,\n borderBottomWidth: 1,\n borderColor: themeVariables.wizardBorderColor\n },\n wizardFooter: {\n flexDirection: 'row',\n justifyContent: 'flex-start',\n padding: 12,\n width: '100%',\n },\n buttonWrapper: {\n flexDirection: 'row',\n },\n stepTitle: {\n textTransform: 'capitalize',\n fontSize: 12,\n color: themeVariables.wizardStepTitleColor\n },\n stepSubTitle:{\n color: themeVariables.wizardStepTitleColor\n },\n step: {\n alignItems: 'center',\n justifyContent: 'center',\n width: 37,\n backgroundColor: themeVariables.wizardBackgroundColor,\n height: 37,\n borderWidth: 1,\n borderRadius: 18.5,\n color: themeVariables.wizardStepColor,\n borderColor: themeVariables.wizardStepColor\n },\n wizardActions: {\n root: {\n marginRight: 8\n },\n text : {\n textTransform: 'capitalize',\n fontSize: 14\n }\n } as WmButtonStyles,\n nextButton: {\n root: {\n marginRight: 0,\n backgroundColor: themeVariables.wizardNextBtnColor,\n borderColor: themeVariables.wizardNextBtnColor\n }\n } as WmButtonStyles,\n prevButton: {\n } as WmButtonStyles,\n cancelButton: {\n } as WmButtonStyles,\n doneButton: {\n root: {\n marginRight: 0,\n backgroundColor: themeVariables.wizardDoneBtnColor\n },\n icon: {\n text: {\n fontSize: 12\n }\n }\n } as WmButtonStyles,\n stepIcon: {\n root: {\n alignSelf: 'center',\n justifyContent: 'center'\n },\n text: {\n color: themeVariables.wizardStepIconColor,\n fontSize: 15\n }\n } as WmIconStyles,\n skipLink: {\n root: {\n padding: 8,\n alignSelf: 'flex-end'\n },\n } as WmAnchorStyles,\n stepConnector: {\n backgroundColor: themeVariables.wizardStepConnectorColor,\n position: 'absolute',\n top: 17.5,\n zIndex: 10,\n height: 2\n },\n numberTextStepConnector: {\n display: 'none'\n },\n stepCounter: {\n fontSize: 15,\n color: themeVariables.wizardStepColor\n },\n progressCircle:{} as WmProgressCircleStyles,\n popover:{} as WmPopoverStyles,\n stepMenu:{},\n activeStepMenu:{},\n stepMenuLabel: {} as WmLabelStyles,\n stepMenuActiveLabel: {} as WmLabelStyles,\n stepMenuIcon: {} as WmIconStyles,\n stepMenuActiveIcon: {} as WmIconStyles\n } as WmWizardStyles);\n\n addStyle(DEFAULT_CLASS, '', defaultStyles);\n addStyle('number-text-inline', '', {\n stepConnector: {\n display: 'none'\n },\n numberTextStepConnector: {\n backgroundColor: themeVariables.wizardStepConnectorColor,\n height: 2,\n display: 'flex'\n },\n stepWrapper: {\n flexDirection: 'row'\n },\n wizardHeader: {\n justifyContent: 'flex-start'\n },\n headerWrapper: {\n flex: -1\n },\n stepTitle: {\n padding: 5\n },\n } as WmWizardStyles);\n addStyle('progress-circle-header', '', {\n stepWrapper: {\n paddingBottom: 4,\n flexDirection: 'row',\n alignItems: 'center'\n },\n wizardHeader: {\n justifyContent: 'flex-start',\n alignItems: 'center',\n backgroundColor: themeVariables.wizardBackgroundColor,\n height: 120,\n borderRadius: 30\n },\n stepSubTitle:{\n fontSize: 12,\n paddingHorizontal: 5\n },\n headerWrapper: {\n flex: 1\n },\n stepTitle: {\n fontSize: 16,\n paddingHorizontal: 5\n },\n progressCircle:{\n root: { \n height: 60, \n width: 60 \n }, \n text: {},\n progressValue:{\n height: 8\n }\n },\n popover:{\n popover:{\n width: 160,\n paddingTop: 8,\n paddingBottom: 8,\n backgroundColor: themeVariables.menuBackgroundColor,\n minHeight:160,\n borderBottomLeftRadius: 28,\n borderBottomRightRadius: 28 \n },\n popoverContent: {\n root:{\n //@ts-ignore\n flex: undefined\n }\n },\n modalContent:{\n borderBottomLeftRadius: 28,\n borderBottomRightRadius: 28\n }\n } as WmPopoverStyles,\n stepMenu:{\n flexDirection: 'row', \n padding: 14, \n alignItems: 'center', \n justifyContent:'flex-start'\n },\n activeStepMenu:{},\n stepMenuLabel:{\n text:{\n color:themeVariables.menuItemTextColor\n }\n },\n stepMenuActiveLabel:{\n text:{\n color: themeVariables.primaryColor\n }\n },\n stepMenuIcon: {\n root:{\n paddingRight: 4\n },\n text:{\n color:themeVariables.menuItemTextColor\n }\n },\n stepMenuActiveIcon:{\n root:{\n paddingRight: 4\n },\n text:{\n color: themeVariables.primaryColor\n }\n }\n } as WmWizardStyles);\n addStyle(DEFAULT_CLASS + '-rtl', '', {\n wizardActions: {\n icon: {\n root:{\n transform: [{rotateY:'180deg'}]\n }\n },\n },\n nextButton:{\n root: {\n marginRight: 8,\n }\n },\n doneButton:{\n root: {\n marginRight: 8,\n },\n icon:{\n root:{\n transform: [{rotateY:'0deg'}]\n }\n }\n }\n });\n});\n"],"mappings":"AAAA,OAAOA,UAAU,MAAoB,wCAAwC;AAC7E,SAAqBC,YAAY,QAAQ,+CAA+C;AAwCxF,OAAO,MAAMC,aAAa,GAAG,YAAY;AACzCF,UAAU,CAACG,aAAa,CAAC,CAACC,cAAc,EAAEC,QAAQ,KAAK;EACrD,MAAMC,aAA6B,GAAGL,YAAY,CAAC;IAC/CM,IAAI,EAAE;MACJC,aAAa,EAAE,QAAQ;MACvBC,eAAe,EAAEL,cAAc,CAACM,qBAAqB;MACrDC,OAAO,EAAE,MAAM;MACfC,SAAS,EAAE;IACb,CAAC;IACDC,IAAI,EAAE,CAAC,CAAC;IACRC,UAAU,EAAC;MACPL,eAAe,EAAEL,cAAc,CAACW,qBAAqB;MAC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Ac,CAACgF;MACvB;IACF,CAAC;IACDV,kBAAkB,EAAC;MACjBnE,IAAI,EAAC;QACH+E,YAAY,EAAE;MAChB,CAAC;MACDzE,IAAI,EAAC;QACHI,KAAK,EAAEb,cAAc,CAACiF;MACxB;IACF;EACF,CAAmB,CAAC;EACpBhF,QAAQ,CAACH,aAAa,GAAG,MAAM,EAAE,EAAE,EAAE;IACnC+C,aAAa,EAAE;MACbQ,IAAI,EAAE;QACJlD,IAAI,EAAC;UACHgF,SAAS,EAAE,CAAC;YAACC,OAAO,EAAC;UAAQ,CAAC;QAChC;MACF;IACF,CAAC;IACDrC,UAAU,EAAC;MACT5C,IAAI,EAAE;QACJ2C,WAAW,EAAE;MACf;IACF,CAAC;IACDK,UAAU,EAAC;MACThD,IAAI,EAAE;QACJ2C,WAAW,EAAE;MACf,CAAC;MACDO,IAAI,EAAC;QACHlD,IAAI,EAAC;UACHgF,SAAS,EAAE,CAAC;YAACC,OAAO,EAAC;UAAM,CAAC;QAC9B;MACF;IACF;EACF,CAAC,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -9,6 +9,7 @@ export default class WmWizardstepProps extends BaseProps {
|
|
|
9
9
|
_defineProperty(this, "enableskip", false);
|
|
10
10
|
_defineProperty(this, "iconclass", 'wm-sl-l sl-check');
|
|
11
11
|
_defineProperty(this, "title", 'Step Title');
|
|
12
|
+
_defineProperty(this, "subtitle", 'Sub Title');
|
|
12
13
|
_defineProperty(this, "index", 0);
|
|
13
14
|
}
|
|
14
15
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["BaseProps","WmWizardstepProps","constructor","arguments","_defineProperty"],"sources":["wizardstep.props.ts"],"sourcesContent":["import { BaseProps } from '@wavemaker/app-rn-runtime/core/base.component';\n\nexport default class WmWizardstepProps extends BaseProps {\n children: any;\n enableskip: boolean = false;\n iconclass: string = 'wm-sl-l sl-check';\n title: string = 'Step Title';\n index: number = 0;\n}\n"],"mappings":";;;AAAA,SAASA,SAAS,QAAQ,+CAA+C;AAEzE,eAAe,MAAMC,iBAAiB,SAASD,SAAS,CAAC;EAAAE,YAAA;IAAA,SAAAC,SAAA;IAAAC,eAAA;IAAAA,eAAA,qBAEjC,KAAK;IAAAA,eAAA,oBACP,kBAAkB;IAAAA,eAAA,gBACtB,YAAY;IAAAA,eAAA,
|
|
1
|
+
{"version":3,"names":["BaseProps","WmWizardstepProps","constructor","arguments","_defineProperty"],"sources":["wizardstep.props.ts"],"sourcesContent":["import { BaseProps } from '@wavemaker/app-rn-runtime/core/base.component';\n\nexport default class WmWizardstepProps extends BaseProps {\n children: any;\n enableskip: boolean = false;\n iconclass: string = 'wm-sl-l sl-check';\n title: string = 'Step Title';\n subtitle: string = 'Sub Title';\n index: number = 0;\n}\n"],"mappings":";;;AAAA,SAASA,SAAS,QAAQ,+CAA+C;AAEzE,eAAe,MAAMC,iBAAiB,SAASD,SAAS,CAAC;EAAAE,YAAA;IAAA,SAAAC,SAAA;IAAAC,eAAA;IAAAA,eAAA,qBAEjC,KAAK;IAAAA,eAAA,oBACP,kBAAkB;IAAAA,eAAA,gBACtB,YAAY;IAAAA,eAAA,mBACT,WAAW;IAAAA,eAAA,gBACd,CAAC;EAAA;AACnB"}
|
|
@@ -5,7 +5,7 @@ import { includes, intersection, isNaN, isFinite, toArray } from 'lodash';
|
|
|
5
5
|
import { BaseComponent, BaseComponentState } from "@wavemaker/app-rn-runtime/core/base.component";
|
|
6
6
|
import { DEFAULT_CLASS } from "@wavemaker/app-rn-runtime/components/navigation/basenav/basenav.styles";
|
|
7
7
|
import { Platform } from 'react-native';
|
|
8
|
-
import { validateField } from '@wavemaker/app-rn-runtime/core/utils';
|
|
8
|
+
import { countDecimalDigits, validateField } from '@wavemaker/app-rn-runtime/core/utils';
|
|
9
9
|
export class BaseNumberState extends BaseComponentState {
|
|
10
10
|
constructor() {
|
|
11
11
|
super(...arguments);
|
|
@@ -38,7 +38,40 @@ export class BaseNumberComponent extends BaseComponent {
|
|
|
38
38
|
var _this$widgetRef;
|
|
39
39
|
this === null || this === void 0 || (_this$widgetRef = this.widgetRef) === null || _this$widgetRef === void 0 ? void 0 : _this$widgetRef.focus();
|
|
40
40
|
}
|
|
41
|
-
|
|
41
|
+
validateOnDevice(value, type) {
|
|
42
|
+
const isCurrencyField = type === 'currency';
|
|
43
|
+
let isValidText = true;
|
|
44
|
+
|
|
45
|
+
// * check for alphabets
|
|
46
|
+
if (/[a-zA-Z]/.test(value)) {
|
|
47
|
+
isValidText = false;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// * currency only: check for negative number
|
|
51
|
+
if (isCurrencyField && (Number(value) < 0 || /-/g.test(value))) {
|
|
52
|
+
isValidText = false;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// * check for more than one decimal point
|
|
56
|
+
if (/^\d*\.\d*\..*$/.test(value)) {
|
|
57
|
+
isValidText = false;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
// * check for spaces and comma
|
|
61
|
+
if (/[\s,]/.test(value)) {
|
|
62
|
+
isValidText = false;
|
|
63
|
+
}
|
|
64
|
+
return isValidText;
|
|
65
|
+
}
|
|
66
|
+
onChangeText(value, type) {
|
|
67
|
+
const isValidTextOnDevice = this.validateOnDevice(value, type);
|
|
68
|
+
if (!isValidTextOnDevice) {
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
const decimalPlacesInNumber = countDecimalDigits(value);
|
|
72
|
+
if (this.props.decimalPlaces < decimalPlacesInNumber) {
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
42
75
|
this.updateState({
|
|
43
76
|
textValue: value
|
|
44
77
|
}, () => {
|
|
@@ -261,9 +294,10 @@ export class BaseNumberComponent extends BaseComponent {
|
|
|
261
294
|
}
|
|
262
295
|
break;
|
|
263
296
|
case 'datavalue':
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
297
|
+
// ? why here
|
|
298
|
+
// this.updateState({
|
|
299
|
+
// textValue: $new,
|
|
300
|
+
// } as S);
|
|
267
301
|
const isDefault = this.state.isDefault;
|
|
268
302
|
if (isDefault) {
|
|
269
303
|
this.updateState({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["includes","intersection","isNaN","isFinite","toArray","BaseComponent","BaseComponentState","DEFAULT_CLASS","Platform","validateField","BaseNumberState","constructor","arguments","_defineProperty","BaseNumberComponent","props","defaultClass","length","undefined","defaultProps","defaultState","DECIMAL","GROUP","onChange","event","state","updateon","updateDatavalue","target","value","focus","_this$widgetRef","widgetRef","onChangeText","updateState","textValue","validate","invokeChange","e","OS","cursor","selectionStart","setState","validationObj","isValid","errorType","handleValidation","regexp","condition","RegExp","test","parseNumber","val","parts","split","NaN","number","Number","join","decimal","sum","parseFloat","toFixed","Object","is","source","model","toString","oldValue","datavalue","validNumber","isValidNumber","invokeEventCallback","proxy","onFieldChange","onBlur","newVal","setTimeout","triggerValidation","oldVal","onFocus","countDecimals","decimalValue","validateInputEntry","$event","ctrlKey","key","validity","inputValue","step","preventDefault","getValueInRange","minvalue","maxvalue","required","isInteger","resetValidations","onPropertyChange","name","$new","$old","isDefault","bind"],"sources":["basenumber.component.ts"],"sourcesContent":["import { includes, intersection, isNaN, isFinite, toArray } from 'lodash';\nimport BaseNumberProps from '@wavemaker/app-rn-runtime/components/input/basenumber/basenumber.props';\nimport { BaseComponent, BaseComponentState } from \"@wavemaker/app-rn-runtime/core/base.component\";\nimport { BaseNumberStyles } from '@wavemaker/app-rn-runtime/components/input/basenumber/basenumber.styles';\nimport { DEFAULT_CLASS } from \"@wavemaker/app-rn-runtime/components/navigation/basenav/basenav.styles\";\nimport { Platform, TextInput } from 'react-native';\nimport { validateField } from '@wavemaker/app-rn-runtime/core/utils';\n\nexport class BaseNumberState <T extends BaseNumberProps> extends BaseComponentState<T> {\n isValid: boolean = true;\n textValue: string = '';\n isDefault = false;\n errorType = '';\n}\n\nexport abstract class BaseNumberComponent< T extends BaseNumberProps, S extends BaseNumberState<T>, L extends BaseNumberStyles> extends BaseComponent<T, S, L> {\n private DECIMAL;\n private GROUP;\n public widgetRef: TextInput | null = null;\n private cursor: any = 0;\n constructor(props: T, public defaultClass: string = DEFAULT_CLASS, defaultProps?: T, defaultState?: S) {\n super(props, defaultClass, defaultProps, defaultState);\n this.DECIMAL = '.';\n this.GROUP = ',';\n }\n\n onChange(event: any) {\n if (this.state.props.updateon === 'default') {\n this.updateDatavalue(event.target.value, event);\n }\n }\n\n focus() {\n this?.widgetRef?.focus();\n }\n\n onChangeText(value: any) {\n this.updateState({\n textValue: value\n } as S, () => {\n if (this.state.props.updateon === 'default') {\n this.validate(value);\n this.updateDatavalue(value, null);\n }\n }\n );\n }\n\n invokeChange(e: any) {\n if (Platform.OS === 'web') {\n this.cursor = e.target.selectionStart;\n this.setState({ textValue: e.target.value });\n }\n }\n\n validate(value: any) {\n const validationObj = validateField(this.state.props, value);\n this.updateState({\n isValid: validationObj.isValid,\n errorType: validationObj.errorType\n } as S);\n\n }\n\n handleValidation(value: any) {\n const props = this.state.props;\n if (props.regexp) {\n const condition = new RegExp(props.regexp, 'g');\n return condition.test(value);\n }\n return true;\n }\n\n /**\n * Method parses the Localized number(string) to a valid number.\n * if the string dose not result to a valid number then returns NaN.\n * @param {string} val Localized number.\n * @returns {number}\n */\n private parseNumber(val: string): any {\n // splits string into two parts. decimal and number.\n const parts = val.split(this.DECIMAL);\n if (!parts.length) {\n return;\n }\n if (parts.length > 2) {\n return NaN;\n }\n // If number have decimal point and not have a decimal value then return.\n if (parts[1] === '') {\n return NaN;\n }\n // replaces all group separators form the number.\n const number = Number(parts[0].split(this.GROUP).join(''));\n const decimal = Number(`0.${parts[1] || 0}`);\n if (Number.isNaN(number) || Number.isNaN(decimal)) {\n return NaN;\n }\n const sum = parts.length > 1 ? parseFloat((number + decimal).toFixed(parts[1].length)) : number + decimal;\n // if the number is negative then calculate the number as number - decimal\n // Ex: number = -123 and decimal = 0.45 then number - decimal = -123-045 = -123.45\n // If entered number is -0.1 to -0.9 then the number is -0 and decimal is 0.1 to 0.9. Now calaculate the number as number-decimal\n // Ex: number = -0 and decimal = 0.1 then number-decimal = -0-0.1 = -0.1\n if (number === 0) {\n return Object.is(0, number) ? sum : number - decimal;\n }\n return number > 0 ? sum : number - decimal;\n }\n\n updateDatavalue(value: any, event?: any, source?: any) {\n const model = value && this.parseNumber(value.toString());\n const props = this.state.props;\n const oldValue = props.datavalue;\n if (value === oldValue) {\n return;\n }\n const validNumber = this.isValidNumber(model);\n if (!validNumber) {\n this.invokeEventCallback('onError', [ event, this.proxy, value, oldValue ]);\n return;\n }\n\n this.updateState({\n props: {\n datavalue: model\n }\n } as S, () => {\n !this.props.onFieldChange && value !== oldValue && this.invokeEventCallback('onChange', [event, this.proxy, value, oldValue]);\n if (source === 'blur') {\n this.invokeEventCallback('onBlur', [event, this.proxy]);\n }\n });\n }\n\n onBlur(event: any) {\n let newVal = event.target.value || this.state.textValue;\n this.validate(newVal);\n if (newVal === '') {\n setTimeout(() => {\n this.props.triggerValidation && this.props.triggerValidation();\n })\n }\n if (this.state.props.updateon === 'blur') {\n let oldVal = this.state.props.datavalue || '';\n if (oldVal !== newVal) {\n this.updateDatavalue(newVal, event, 'blur');\n } else {\n this.invokeEventCallback('onBlur', [event, this.proxy]);\n }\n }\n }\n\n onFocus(event: any) {\n this.invokeEventCallback('onFocus', [ event, this.proxy]);\n }\n\n /**\n * returns the number of decimal places a number have.\n * @param value: number\n * @returns {number}\n */\n private countDecimals(value: any) {\n if (value && ((value % 1) !== 0)) {\n const decimalValue = value.toString().split('.')[1];\n return decimalValue && decimalValue.length;\n }\n return 0;\n }\n\n public validateInputEntry($event: any) {\n const props = this.state.props;\n\n // allow actions if control key is pressed or if backspace is pressed. (for Mozilla).\n if ($event.ctrlKey || includes(['Backspace', 'ArrowRight', 'ArrowLeft', 'Tab', 'Enter', 'Delete'], $event.key)) {\n return;\n }\n\n const validity = new RegExp(`^[\\\\d\\\\s-,.e+${this.GROUP}${this.DECIMAL}]$`, 'i');\n const inputValue = $event.target.value;\n // validates entering of decimal values only when user provides decimal limit(i.e step contains decimal values).\n if (inputValue && this.countDecimals(props.step) && (this.countDecimals(inputValue) >= this.countDecimals(props.step))) {\n $event.preventDefault();\n }\n // validates if user entered an invalid character.\n if (!validity.test($event.key)) {\n $event.preventDefault();\n }\n // a decimal value can be entered only once in the input.\n if (includes(inputValue, this.DECIMAL) && $event.key === this.DECIMAL) {\n $event.preventDefault();\n }\n // 'e' can be entered only once in the input.\n if (intersection(toArray(inputValue), ['e', 'E']).length && includes('eE', $event.key)) {\n $event.preventDefault();\n }\n if ((includes(inputValue, '+') || includes(inputValue, '-')) && ($event.key === '+' || $event.key === '-')) {\n $event.preventDefault();\n }\n this.invokeEventCallback('onKeypress', [ $event, this.proxy]);\n }\n\n /**\n * returns a valid number by validating the minimum and maximum values.\n * @param {number} value\n * @returns {number}\n */\n private getValueInRange(value: number): number {\n const props = this.state.props;\n if (!isNaN(props.minvalue) && value < props.minvalue) {\n this.updateState({ errorType: 'minvalue'} as S);\n return props.minvalue;\n\n }\n if (!isNaN(props.maxvalue) && value > props.maxvalue) {\n this.updateState({ errorType: 'maxvalue'} as S);\n return props.maxvalue;\n }\n return value;\n }\n\n /**\n * Adds validations for the number before updating the widget model. like validating min and max value for the widget.\n * @param {number} val number to be validated\n * @returns {number}\n */\n private isValidNumber(val: number): boolean {\n const props = this.state.props;\n\n //empty number widget should not show validation error when required is false\n // @ts-ignore\n if (this.state.props.required === false && val === '') {\n return true;\n }\n // id number is infinite then consider it as invalid value\n if (isNaN(val) || !isFinite(val) || (!Number.isInteger(props.step) &&\n this.countDecimals(val) > this.countDecimals(props.step))) {\n this.updateState({\n isValid: false,\n } as S);\n return false;\n }\n if (val !== this.getValueInRange(val)) {\n this.updateState({\n isValid: false,\n } as S);\n return true;\n }\n this.resetValidations();\n return true;\n }\n\n // resets all the flags related to the widget's validation.\n protected resetValidations() {\n this.updateState({\n isValid: true,\n } as S);\n }\n\n onPropertyChange(name: string, $new: any, $old: any) {\n switch (name) {\n case 'minvalue':\n case 'maxvalue':\n if ($new|| $old) {\n this.isValidNumber($new);\n }\n break;\n case 'datavalue':\n this.updateState({\n textValue: $new\n } as S\n );\n const isDefault = this.state.isDefault;\n if (isDefault) {\n this.updateState({ isDefault: false } as S, this.props.onFieldChange && this.props.onFieldChange.bind(this, 'datavalue', $new, $old, isDefault));\n } else {\n this.props.onFieldChange && this.props.onFieldChange('datavalue', $new, $old, isDefault);\n }\n }\n }\n}\n"],"mappings":";;;AAAA,SAASA,QAAQ,EAAEC,YAAY,EAAEC,KAAK,EAAEC,QAAQ,EAAEC,OAAO,QAAQ,QAAQ;AAEzE,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,+CAA+C;AAEjG,SAASC,aAAa,QAAQ,wEAAwE;AACtG,SAASC,QAAQ,QAAmB,cAAc;AAClD,SAASC,aAAa,QAAQ,sCAAsC;AAEpE,OAAO,MAAMC,eAAe,SAAqCJ,kBAAkB,CAAI;EAAAK,YAAA;IAAA,SAAAC,SAAA;IAAAC,eAAA,kBAClE,IAAI;IAAAA,eAAA,oBACH,EAAE;IAAAA,eAAA,oBACV,KAAK;IAAAA,eAAA,oBACL,EAAE;EAAA;AAChB;AAEA,OAAO,MAAeC,mBAAmB,SAA+FT,aAAa,CAAU;EAK7JM,WAAWA,CAACI,KAAQ,EAAmF;IAAA,IAA1EC,YAAoB,GAAAJ,SAAA,CAAAK,MAAA,QAAAL,SAAA,QAAAM,SAAA,GAAAN,SAAA,MAAGL,aAAa;IAAA,IAAEY,YAAgB,GAAAP,SAAA,CAAAK,MAAA,OAAAL,SAAA,MAAAM,SAAA;IAAA,IAAEE,YAAgB,GAAAR,SAAA,CAAAK,MAAA,OAAAL,SAAA,MAAAM,SAAA;IACnG,KAAK,CAACH,KAAK,EAAEC,YAAY,EAAEG,YAAY,EAAEC,YAAY,CAAC;IAAC,KAD5BJ,YAAoB,GAApBA,YAAoB;IAAAH,eAAA;IAAAA,eAAA;IAAAA,eAAA,oBAF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IAAI,EAAEC,IAAI,EAAEC,SAAS,CAAC,CAAC;QAClJ,CAAC,MAAM;UACL,IAAI,CAACtF,KAAK,CAAC2D,aAAa,IAAI,IAAI,CAAC3D,KAAK,CAAC2D,aAAa,CAAC,WAAW,EAAEyB,IAAI,EAAEC,IAAI,EAAEC,SAAS,CAAC;QAC1F;IACJ;EACF;AACF"}
|
|
1
|
+
{"version":3,"names":["includes","intersection","isNaN","isFinite","toArray","BaseComponent","BaseComponentState","DEFAULT_CLASS","Platform","countDecimalDigits","validateField","BaseNumberState","constructor","arguments","_defineProperty","BaseNumberComponent","props","defaultClass","length","undefined","defaultProps","defaultState","DECIMAL","GROUP","onChange","event","state","updateon","updateDatavalue","target","value","focus","_this$widgetRef","widgetRef","validateOnDevice","type","isCurrencyField","isValidText","test","Number","onChangeText","isValidTextOnDevice","decimalPlacesInNumber","decimalPlaces","updateState","textValue","validate","invokeChange","e","OS","cursor","selectionStart","setState","validationObj","isValid","errorType","handleValidation","regexp","condition","RegExp","parseNumber","val","parts","split","NaN","number","join","decimal","sum","parseFloat","toFixed","Object","is","source","model","toString","oldValue","datavalue","validNumber","isValidNumber","invokeEventCallback","proxy","onFieldChange","onBlur","newVal","setTimeout","triggerValidation","oldVal","onFocus","countDecimals","decimalValue","validateInputEntry","$event","ctrlKey","key","validity","inputValue","step","preventDefault","getValueInRange","minvalue","maxvalue","required","isInteger","resetValidations","onPropertyChange","name","$new","$old","isDefault","bind"],"sources":["basenumber.component.ts"],"sourcesContent":["import { includes, intersection, isNaN, isFinite, toArray } from 'lodash';\nimport BaseNumberProps from '@wavemaker/app-rn-runtime/components/input/basenumber/basenumber.props';\nimport { BaseComponent, BaseComponentState } from \"@wavemaker/app-rn-runtime/core/base.component\";\nimport { BaseNumberStyles } from '@wavemaker/app-rn-runtime/components/input/basenumber/basenumber.styles';\nimport { DEFAULT_CLASS } from \"@wavemaker/app-rn-runtime/components/navigation/basenav/basenav.styles\";\nimport { Platform, TextInput } from 'react-native';\nimport { countDecimalDigits, validateField } from '@wavemaker/app-rn-runtime/core/utils';\n\nexport class BaseNumberState <T extends BaseNumberProps> extends BaseComponentState<T> {\n isValid: boolean = true;\n textValue: string = '';\n isDefault = false;\n errorType = '';\n}\n\nexport abstract class BaseNumberComponent< T extends BaseNumberProps, S extends BaseNumberState<T>, L extends BaseNumberStyles> extends BaseComponent<T, S, L> {\n private DECIMAL;\n private GROUP;\n public widgetRef: TextInput | null = null;\n private cursor: any = 0;\n constructor(props: T, public defaultClass: string = DEFAULT_CLASS, defaultProps?: T, defaultState?: S) {\n super(props, defaultClass, defaultProps, defaultState);\n this.DECIMAL = '.';\n this.GROUP = ',';\n }\n\n onChange(event: any) {\n if (this.state.props.updateon === 'default') {\n this.updateDatavalue(event.target.value, event);\n }\n }\n\n focus() {\n this?.widgetRef?.focus();\n }\n\n validateOnDevice(value: string, type: 'number' | 'currency') {\n const isCurrencyField = type === 'currency';\n let isValidText = true;\n\n // * check for alphabets\n if (/[a-zA-Z]/.test(value)) {\n isValidText = false;\n }\n\n // * currency only: check for negative number\n if (isCurrencyField && (Number(value) < 0 || /-/g.test(value))) {\n isValidText = false;\n }\n\n // * check for more than one decimal point\n if (/^\\d*\\.\\d*\\..*$/.test(value)) {\n isValidText = false;\n }\n\n // * check for spaces and comma\n if (/[\\s,]/.test(value)) {\n isValidText = false;\n }\n\n return isValidText;\n }\n\n onChangeText(value: string, type: 'number' | 'currency') {\n const isValidTextOnDevice = this.validateOnDevice(value, type);\n if (!isValidTextOnDevice) {\n return;\n }\n\n const decimalPlacesInNumber = countDecimalDigits(value);\n\n if (this.props.decimalPlaces < decimalPlacesInNumber) {\n return;\n }\n\n this.updateState({\n textValue: value\n } as S, () => {\n if (this.state.props.updateon === 'default') {\n this.validate(value);\n this.updateDatavalue(value, null);\n }\n }\n );\n }\n\n invokeChange(e: any) {\n if (Platform.OS === 'web') {\n this.cursor = e.target.selectionStart;\n this.setState({ textValue: e.target.value });\n }\n }\n\n validate(value: any) {\n const validationObj = validateField(this.state.props, value);\n this.updateState({\n isValid: validationObj.isValid,\n errorType: validationObj.errorType\n } as S);\n\n }\n\n handleValidation(value: any) {\n const props = this.state.props;\n if (props.regexp) {\n const condition = new RegExp(props.regexp, 'g');\n return condition.test(value);\n }\n return true;\n }\n\n /**\n * Method parses the Localized number(string) to a valid number.\n * if the string dose not result to a valid number then returns NaN.\n * @param {string} val Localized number.\n * @returns {number}\n */\n private parseNumber(val: string): any {\n // splits string into two parts. decimal and number.\n const parts = val.split(this.DECIMAL);\n if (!parts.length) {\n return;\n }\n if (parts.length > 2) {\n return NaN;\n }\n // If number have decimal point and not have a decimal value then return.\n if (parts[1] === '') {\n return NaN;\n }\n // replaces all group separators form the number.\n const number = Number(parts[0].split(this.GROUP).join(''));\n const decimal = Number(`0.${parts[1] || 0}`);\n if (Number.isNaN(number) || Number.isNaN(decimal)) {\n return NaN;\n }\n const sum = parts.length > 1 ? parseFloat((number + decimal).toFixed(parts[1].length)) : number + decimal;\n // if the number is negative then calculate the number as number - decimal\n // Ex: number = -123 and decimal = 0.45 then number - decimal = -123-045 = -123.45\n // If entered number is -0.1 to -0.9 then the number is -0 and decimal is 0.1 to 0.9. Now calaculate the number as number-decimal\n // Ex: number = -0 and decimal = 0.1 then number-decimal = -0-0.1 = -0.1\n if (number === 0) {\n return Object.is(0, number) ? sum : number - decimal;\n }\n return number > 0 ? sum : number - decimal;\n }\n\n updateDatavalue(value: any, event?: any, source?: any) {\n const model = value && this.parseNumber(value.toString());\n const props = this.state.props;\n const oldValue = props.datavalue;\n if (value === oldValue) {\n return;\n }\n const validNumber = this.isValidNumber(model);\n if (!validNumber) {\n this.invokeEventCallback('onError', [ event, this.proxy, value, oldValue ]);\n return;\n }\n\n this.updateState({\n props: {\n datavalue: model\n }\n } as S, () => {\n !this.props.onFieldChange && value !== oldValue && this.invokeEventCallback('onChange', [event, this.proxy, value, oldValue]);\n if (source === 'blur') {\n this.invokeEventCallback('onBlur', [event, this.proxy]);\n }\n });\n }\n\n onBlur(event: any) {\n let newVal = event.target.value || this.state.textValue;\n this.validate(newVal);\n if (newVal === '') {\n setTimeout(() => {\n this.props.triggerValidation && this.props.triggerValidation();\n })\n }\n if (this.state.props.updateon === 'blur') {\n let oldVal = this.state.props.datavalue || '';\n if (oldVal !== newVal) {\n this.updateDatavalue(newVal, event, 'blur');\n } else {\n this.invokeEventCallback('onBlur', [event, this.proxy]);\n }\n }\n }\n\n onFocus(event: any) {\n this.invokeEventCallback('onFocus', [ event, this.proxy]);\n }\n\n /**\n * returns the number of decimal places a number have.\n * @param value: number\n * @returns {number}\n */\n private countDecimals(value: any) {\n if (value && ((value % 1) !== 0)) {\n const decimalValue = value.toString().split('.')[1];\n return decimalValue && decimalValue.length;\n }\n return 0;\n }\n\n public validateInputEntry($event: any) {\n const props = this.state.props;\n\n // allow actions if control key is pressed or if backspace is pressed. (for Mozilla).\n if ($event.ctrlKey || includes(['Backspace', 'ArrowRight', 'ArrowLeft', 'Tab', 'Enter', 'Delete'], $event.key)) {\n return;\n }\n\n const validity = new RegExp(`^[\\\\d\\\\s-,.e+${this.GROUP}${this.DECIMAL}]$`, 'i');\n const inputValue = $event.target.value;\n // validates entering of decimal values only when user provides decimal limit(i.e step contains decimal values).\n if (inputValue && this.countDecimals(props.step) && (this.countDecimals(inputValue) >= this.countDecimals(props.step))) {\n $event.preventDefault();\n }\n // validates if user entered an invalid character.\n if (!validity.test($event.key)) {\n $event.preventDefault();\n }\n // a decimal value can be entered only once in the input.\n if (includes(inputValue, this.DECIMAL) && $event.key === this.DECIMAL) {\n $event.preventDefault();\n }\n // 'e' can be entered only once in the input.\n if (intersection(toArray(inputValue), ['e', 'E']).length && includes('eE', $event.key)) {\n $event.preventDefault();\n }\n if ((includes(inputValue, '+') || includes(inputValue, '-')) && ($event.key === '+' || $event.key === '-')) {\n $event.preventDefault();\n }\n this.invokeEventCallback('onKeypress', [ $event, this.proxy]);\n }\n\n /**\n * returns a valid number by validating the minimum and maximum values.\n * @param {number} value\n * @returns {number}\n */\n private getValueInRange(value: number): number {\n const props = this.state.props;\n if (!isNaN(props.minvalue) && value < props.minvalue) {\n this.updateState({ errorType: 'minvalue'} as S);\n return props.minvalue;\n\n }\n if (!isNaN(props.maxvalue) && value > props.maxvalue) {\n this.updateState({ errorType: 'maxvalue'} as S);\n return props.maxvalue;\n }\n return value;\n }\n\n /**\n * Adds validations for the number before updating the widget model. like validating min and max value for the widget.\n * @param {number} val number to be validated\n * @returns {number}\n */\n private isValidNumber(val: number): boolean {\n const props = this.state.props;\n\n //empty number widget should not show validation error when required is false\n // @ts-ignore\n if (this.state.props.required === false && val === '') {\n return true;\n }\n // id number is infinite then consider it as invalid value\n if (isNaN(val) || !isFinite(val) || (!Number.isInteger(props.step) &&\n this.countDecimals(val) > this.countDecimals(props.step))) {\n this.updateState({\n isValid: false,\n } as S);\n return false;\n }\n if (val !== this.getValueInRange(val)) {\n this.updateState({\n isValid: false,\n } as S);\n return true;\n }\n this.resetValidations();\n return true;\n }\n\n // resets all the flags related to the widget's validation.\n protected resetValidations() {\n this.updateState({\n isValid: true,\n } as S);\n }\n\n onPropertyChange(name: string, $new: any, $old: any) {\n switch (name) {\n case 'minvalue':\n case 'maxvalue':\n if ($new|| $old) {\n this.isValidNumber($new);\n }\n break;\n case 'datavalue':\n // ? why here\n // this.updateState({\n // textValue: $new,\n // } as S);\n const isDefault = this.state.isDefault;\n if (isDefault) {\n this.updateState({ isDefault: false } as S, this.props.onFieldChange && this.props.onFieldChange.bind(this, 'datavalue', $new, $old, isDefault));\n } else {\n this.props.onFieldChange && this.props.onFieldChange('datavalue', $new, $old, isDefault);\n }\n }\n }\n}\n"],"mappings":";;;AAAA,SAASA,QAAQ,EAAEC,YAAY,EAAEC,KAAK,EAAEC,QAAQ,EAAEC,OAAO,QAAQ,QAAQ;AAEzE,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,+CAA+C;AAEjG,SAASC,aAAa,QAAQ,wEAAwE;AACtG,SAASC,QAAQ,QAAmB,cAAc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4B,IAAI,CAAC;QAC1B;QACA;MACF,KAAK,WAAW;QACd;QACA;QACA;QACA;QACA,MAAME,SAAS,GAAG,IAAI,CAACnF,KAAK,CAACmF,SAAS;QACtC,IAAIA,SAAS,EAAE;UACb,IAAI,CAACjE,WAAW,CAAC;YAAEiE,SAAS,EAAE;UAAM,CAAC,EAAO,IAAI,CAAC7F,KAAK,CAACkE,aAAa,IAAI,IAAI,CAAClE,KAAK,CAACkE,aAAa,CAAC4B,IAAI,CAAC,IAAI,EAAE,WAAW,EAAEH,IAAI,EAAEC,IAAI,EAAEC,SAAS,CAAC,CAAC;QAClJ,CAAC,MAAM;UACL,IAAI,CAAC7F,KAAK,CAACkE,aAAa,IAAI,IAAI,CAAClE,KAAK,CAACkE,aAAa,CAAC,WAAW,EAAEyB,IAAI,EAAEC,IAAI,EAAEC,SAAS,CAAC;QAC1F;IACJ;EACF;AACF"}
|
|
@@ -15,6 +15,7 @@ export default class BaseNumberProps extends BaseProps {
|
|
|
15
15
|
_defineProperty(this, "onFieldChange", void 0);
|
|
16
16
|
_defineProperty(this, "required", false);
|
|
17
17
|
_defineProperty(this, "triggerValidation", void 0);
|
|
18
|
+
_defineProperty(this, "decimalPlaces", 2);
|
|
18
19
|
}
|
|
19
20
|
}
|
|
20
21
|
//# sourceMappingURL=basenumber.props.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["BaseProps","BaseNumberProps","constructor","arguments","_defineProperty"],"sources":["basenumber.props.ts"],"sourcesContent":["import { BaseProps } from '@wavemaker/app-rn-runtime/core/base.component';\n\nexport default class BaseNumberProps extends BaseProps {\n datavalue: any;\n minvalue: number = null as any;\n maxvalue: number = null as any;\n step: number = 1;\n updateon: string = 'blur' as any;\n readonly: boolean = null as any;\n regexp: string = null as any;\n onFieldChange: any;\n required: boolean = false;\n triggerValidation: any;\n}\n"],"mappings":";;;AAAA,SAASA,SAAS,QAAQ,+CAA+C;AAEzE,eAAe,MAAMC,eAAe,SAASD,SAAS,CAAC;EAAAE,YAAA;IAAA,SAAAC,SAAA;IAAAC,eAAA;IAAAA,eAAA,mBAElC,IAAI;IAAAA,eAAA,mBACJ,IAAI;IAAAA,eAAA,eACR,CAAC;IAAAA,eAAA,mBACG,MAAM;IAAAA,eAAA,mBACL,IAAI;IAAAA,eAAA,iBACP,IAAI;IAAAA,eAAA;IAAAA,eAAA,mBAED,KAAK;IAAAA,eAAA;EAAA;
|
|
1
|
+
{"version":3,"names":["BaseProps","BaseNumberProps","constructor","arguments","_defineProperty"],"sources":["basenumber.props.ts"],"sourcesContent":["import { BaseProps } from '@wavemaker/app-rn-runtime/core/base.component';\n\nexport default class BaseNumberProps extends BaseProps {\n datavalue: any;\n minvalue: number = null as any;\n maxvalue: number = null as any;\n step: number = 1;\n updateon: string = 'blur' as any;\n readonly: boolean = null as any;\n regexp: string = null as any;\n onFieldChange: any;\n required: boolean = false;\n triggerValidation: any;\n decimalPlaces: number = 2;\n}\n"],"mappings":";;;AAAA,SAASA,SAAS,QAAQ,+CAA+C;AAEzE,eAAe,MAAMC,eAAe,SAASD,SAAS,CAAC;EAAAE,YAAA;IAAA,SAAAC,SAAA;IAAAC,eAAA;IAAAA,eAAA,mBAElC,IAAI;IAAAA,eAAA,mBACJ,IAAI;IAAAA,eAAA,eACR,CAAC;IAAAA,eAAA,mBACG,MAAM;IAAAA,eAAA,mBACL,IAAI;IAAAA,eAAA,iBACP,IAAI;IAAAA,eAAA;IAAAA,eAAA,mBAED,KAAK;IAAAA,eAAA;IAAAA,eAAA,wBAED,CAAC;EAAA;AAC3B"}
|
|
@@ -58,10 +58,13 @@ export default class WmCurrency extends BaseNumberComponent {
|
|
|
58
58
|
}, opts, {
|
|
59
59
|
editable: props.disabled || props.readonly ? false : true,
|
|
60
60
|
placeholder: props.placeholder,
|
|
61
|
+
value: this.state.textValue,
|
|
61
62
|
onBlur: this.onBlur.bind(this),
|
|
62
63
|
onFocus: this.onFocus.bind(this),
|
|
63
64
|
onKeyPress: this.validateInputEntry.bind(this),
|
|
64
|
-
onChangeText:
|
|
65
|
+
onChangeText: text => {
|
|
66
|
+
this.onChangeText.bind(this)(text, 'currency');
|
|
67
|
+
},
|
|
65
68
|
onChange: this.invokeChange.bind(this),
|
|
66
69
|
allowContentSelection: this.styles.text.userSelect === 'text'
|
|
67
70
|
})));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","View","Text","Platform","WmCurrencyProps","CURRENCY_INFO","WMTextInput","DEFAULT_CLASS","BaseNumberComponent","BaseNumberState","isNull","WmCurrencyState","constructor","arguments","_defineProperty","WmCurrency","props","onPropertyChange","name","$new","$old","updateState","currencySymbol","symbol","renderWidget","_this$state$textValue","opts","valueExpr","OS","state","textValue","toString","createElement","style","styles","root","labelWrapper","label","_extends","ref","widgetRef","selectionStart","selectionEnd","cursor","keyboardType","placeholderTextColor","placeholderText","color","input","text","isValid","invalid","editable","disabled","readonly","placeholder","onBlur","bind","onFocus","onKeyPress","validateInputEntry","onChangeText","onChange","invokeChange","allowContentSelection","userSelect"],"sources":["currency.component.tsx"],"sourcesContent":["import React from 'react';\nimport { View, Text, Platform } from 'react-native';\n\nimport WmCurrencyProps from './currency.props';\nimport { CURRENCY_INFO } from '@wavemaker/app-rn-runtime/core/currency-constants';\nimport { WMTextInput } from '@wavemaker/app-rn-runtime/core/components/textinput.component';\nimport { DEFAULT_CLASS, WmCurrencyStyles } from './currency.styles';\nimport {\n BaseNumberComponent,\n BaseNumberState\n} from '@wavemaker/app-rn-runtime/components/input/basenumber/basenumber.component';\nimport { isNull } from \"lodash\";\nexport class WmCurrencyState extends BaseNumberState<WmCurrencyProps> {\n currencySymbol: any;\n}\n\nexport default class WmCurrency extends BaseNumberComponent<WmCurrencyProps, WmCurrencyState, WmCurrencyStyles> {\n\n constructor(props: WmCurrencyProps) {\n super(props, DEFAULT_CLASS, new WmCurrencyProps(), new WmCurrencyState());\n }\n\n onPropertyChange(name: string, $new: any, $old: any) {\n super.onPropertyChange(name, $new, $old);\n switch (name) {\n case 'currency':\n if ($new) {\n this.updateState({\n currencySymbol: CURRENCY_INFO[$new].symbol,\n } as WmCurrencyState);\n }\n break;\n\n }\n }\n\n renderWidget(props: WmCurrencyProps) {\n let opts: any = {};\n const valueExpr = Platform.OS === 'web' ? 'value' : 'defaultValue';\n opts[valueExpr] = this.state.textValue?.toString() || '';\n return (<View style={this.styles.root}>\n <View style={this.styles.labelWrapper}>\n <Text style={this.styles.label}>{this.state.currencySymbol}</Text></View>\n <WMTextInput\n ref={(ref: any) => {\n 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 }}\n keyboardType=\"numeric\"\n placeholderTextColor={this.styles.placeholderText.color as any}\n style={[this.styles.input, this.styles.text, this.state.isValid ? {} : this.styles.invalid]}\n {...opts}\n editable={props.disabled || props.readonly ? false : true}\n placeholder={props.placeholder}\n onBlur={this.onBlur.bind(this)}\n onFocus={this.onFocus.bind(this)}\n onKeyPress={this.validateInputEntry.bind(this)}\n onChangeText={this.onChangeText.bind(this)}\n onChange={this.invokeChange.bind(this)}\n allowContentSelection={this.styles.text.userSelect === 'text'}\n />\n </View>);\n }\n}\n"],"mappings":";;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,EAAEC,IAAI,EAAEC,QAAQ,QAAQ,cAAc;AAEnD,OAAOC,eAAe,MAAM,kBAAkB;AAC9C,SAASC,aAAa,QAAQ,mDAAmD;AACjF,SAASC,WAAW,QAAQ,+DAA+D;AAC3F,SAASC,aAAa,QAA0B,mBAAmB;AACnE,SACEC,mBAAmB,EACnBC,eAAe,QACV,4EAA4E;AACnF,SAASC,MAAM,QAAQ,QAAQ;AAC/B,OAAO,MAAMC,eAAe,SAASF,eAAe,CAAkB;EAAAG,YAAA;IAAA,SAAAC,SAAA;IAAAC,eAAA;EAAA;AAEtE;AAEA,eAAe,MAAMC,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,GAAQ,IAAK;QACjB,IAAI,CAACC,SAAS,GAAGD,GAAG;QACpB;QACA,IAAIA,GAAG,IAAI,CAAC7B,MAAM,CAAC6B,GAAG,CAACE,cAAc,CAAC,IAAI,CAAC/B,MAAM,CAAC6B,GAAG,CAACG,YAAY,CAAC,EAAE;UACnE;UACAH,GAAG,CAACE,cAAc,GAAGF,GAAG,CAACG,YAAY,GAAG,IAAI,CAACC,MAAM;QACrD;MACF,CAAE;MACFC,YAAY,EAAC,SAAS;MACtBC,oBAAoB,EAAE,IAAI,CAACX,MAAM,CAACY,eAAe,CAACC,KAAa;MAC/Dd,KAAK,EAAE,CAAC,IAAI,CAACC,MAAM,CAACc,KAAK,EAAE,IAAI,CAACd,MAAM,CAACe,IAAI,EAAE,IAAI,CAACpB,KAAK,CAACqB,OAAO,GAAG,CAAC,CAAC,GAAG,IAAI,CAAChB,MAAM,CAACiB,OAAO;IAAE,GACxFzB,IAAI;MACR0B,QAAQ,EAAEpC,KAAK,CAACqC,QAAQ,IAAIrC,KAAK,CAACsC,QAAQ,GAAG,KAAK,GAAG,IAAK;MAC1DC,WAAW,EAAEvC,KAAK,CAACuC,WAAY;MAC/BC,MAAM,EAAE,IAAI,CAACA,MAAM,CAACC,IAAI,CAAC,IAAI,CAAE;MAC/BC,OAAO,EAAE,IAAI,CAACA,OAAO,CAACD,IAAI,CAAC,IAAI,CAAE;MACjCE,UAAU,EAAE,IAAI,CAACC,kBAAkB,CAACH,IAAI,CAAC,IAAI,CAAE;MAC/CI,YAAY,
|
|
1
|
+
{"version":3,"names":["React","View","Text","Platform","WmCurrencyProps","CURRENCY_INFO","WMTextInput","DEFAULT_CLASS","BaseNumberComponent","BaseNumberState","isNull","WmCurrencyState","constructor","arguments","_defineProperty","WmCurrency","props","onPropertyChange","name","$new","$old","updateState","currencySymbol","symbol","renderWidget","_this$state$textValue","opts","valueExpr","OS","state","textValue","toString","createElement","style","styles","root","labelWrapper","label","_extends","ref","widgetRef","selectionStart","selectionEnd","cursor","keyboardType","placeholderTextColor","placeholderText","color","input","text","isValid","invalid","editable","disabled","readonly","placeholder","value","onBlur","bind","onFocus","onKeyPress","validateInputEntry","onChangeText","onChange","invokeChange","allowContentSelection","userSelect"],"sources":["currency.component.tsx"],"sourcesContent":["import React from 'react';\nimport { View, Text, Platform } from 'react-native';\n\nimport WmCurrencyProps from './currency.props';\nimport { CURRENCY_INFO } from '@wavemaker/app-rn-runtime/core/currency-constants';\nimport { WMTextInput } from '@wavemaker/app-rn-runtime/core/components/textinput.component';\nimport { DEFAULT_CLASS, WmCurrencyStyles } from './currency.styles';\nimport {\n BaseNumberComponent,\n BaseNumberState\n} from '@wavemaker/app-rn-runtime/components/input/basenumber/basenumber.component';\nimport { isNull } from \"lodash\";\nexport class WmCurrencyState extends BaseNumberState<WmCurrencyProps> {\n currencySymbol: any;\n}\n\nexport default class WmCurrency extends BaseNumberComponent<WmCurrencyProps, WmCurrencyState, WmCurrencyStyles> {\n\n constructor(props: WmCurrencyProps) {\n super(props, DEFAULT_CLASS, new WmCurrencyProps(), new WmCurrencyState());\n }\n\n onPropertyChange(name: string, $new: any, $old: any) {\n super.onPropertyChange(name, $new, $old);\n switch (name) {\n case 'currency':\n if ($new) {\n this.updateState({\n currencySymbol: CURRENCY_INFO[$new].symbol,\n } as WmCurrencyState);\n }\n break;\n\n }\n }\n\n renderWidget(props: WmCurrencyProps) {\n let opts: any = {};\n const valueExpr = Platform.OS === 'web' ? 'value' : 'defaultValue';\n opts[valueExpr] = this.state.textValue?.toString() || '';\n return (<View style={this.styles.root}>\n <View style={this.styles.labelWrapper}>\n <Text style={this.styles.label}>{this.state.currencySymbol}</Text></View>\n <WMTextInput\n ref={(ref: any) => {\n 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 }}\n keyboardType=\"numeric\"\n placeholderTextColor={this.styles.placeholderText.color as any}\n style={[this.styles.input, this.styles.text, this.state.isValid ? {} : this.styles.invalid]}\n {...opts}\n editable={props.disabled || props.readonly ? false : true}\n placeholder={props.placeholder}\n value={this.state.textValue}\n onBlur={this.onBlur.bind(this)}\n onFocus={this.onFocus.bind(this)}\n onKeyPress={this.validateInputEntry.bind(this)}\n onChangeText={(text) => {\n this.onChangeText.bind(this)(text, 'currency');\n }}\n onChange={this.invokeChange.bind(this)}\n allowContentSelection={this.styles.text.userSelect === 'text'}\n />\n </View>);\n }\n}\n"],"mappings":";;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,EAAEC,IAAI,EAAEC,QAAQ,QAAQ,cAAc;AAEnD,OAAOC,eAAe,MAAM,kBAAkB;AAC9C,SAASC,aAAa,QAAQ,mDAAmD;AACjF,SAASC,WAAW,QAAQ,+DAA+D;AAC3F,SAASC,aAAa,QAA0B,mBAAmB;AACnE,SACEC,mBAAmB,EACnBC,eAAe,QACV,4EAA4E;AACnF,SAASC,MAAM,QAAQ,QAAQ;AAC/B,OAAO,MAAMC,eAAe,SAASF,eAAe,CAAkB;EAAAG,YAAA;IAAA,SAAAC,SAAA;IAAAC,eAAA;EAAA;AAEtE;AAEA,eAAe,MAAMC,UAAU,SAASP,mBAAmB,CAAqD;EAE9GI,WAAWA,CAACI,KAAsB,EAAE;IAClC,KAAK,CAACA,KAAK,EAAET,aAAa,EAAE,IAAIH,eAAe,CAAC,CAAC,EAAE,IAAIO,eAAe,CAAC,CAAC,CAAC;EAC3E;EAEAM,gBAAgBA,CAACC,IAAY,EAAEC,IAAS,EAAEC,IAAS,EAAE;IACnD,KAAK,CAACH,gBAAgB,CAACC,IAAI,EAAEC,IAAI,EAAEC,IAAI,CAAC;IACxC,QAAQF,IAAI;MACV,KAAK,UAAU;QACb,IAAIC,IAAI,EAAE;UACR,IAAI,CAACE,WAAW,CAAC;YACfC,cAAc,EAAEjB,aAAa,CAACc,IAAI,CAAC,CAACI;UACtC,CAAoB,CAAC;QACvB;Q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AAI,CAACpB,KAAK,CAACqB,OAAO,GAAG,CAAC,CAAC,GAAG,IAAI,CAAChB,MAAM,CAACiB,OAAO;IAAE,GACxFzB,IAAI;MACR0B,QAAQ,EAAEpC,KAAK,CAACqC,QAAQ,IAAIrC,KAAK,CAACsC,QAAQ,GAAG,KAAK,GAAG,IAAK;MAC1DC,WAAW,EAAEvC,KAAK,CAACuC,WAAY;MAC/BC,KAAK,EAAE,IAAI,CAAC3B,KAAK,CAACC,SAAU;MAC5B2B,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,CAACC,kBAAkB,CAACH,IAAI,CAAC,IAAI,CAAE;MAC/CI,YAAY,EAAGb,IAAI,IAAK;QACtB,IAAI,CAACa,YAAY,CAACJ,IAAI,CAAC,IAAI,CAAC,CAACT,IAAI,EAAE,UAAU,CAAC;MAChD,CAAE;MACFc,QAAQ,EAAE,IAAI,CAACC,YAAY,CAACN,IAAI,CAAC,IAAI,CAAE;MACvCO,qBAAqB,EAAE,IAAI,CAAC/B,MAAM,CAACe,IAAI,CAACiB,UAAU,KAAK;IAAO,EAC/D,CACG,CAAC;EACT;AACF"}
|
|
@@ -40,10 +40,13 @@ export default class WmNumber extends BaseNumberComponent {
|
|
|
40
40
|
autoFocus: props.autofocus,
|
|
41
41
|
editable: props.disabled || props.readonly ? false : true,
|
|
42
42
|
placeholder: props.placeholder,
|
|
43
|
+
value: this.state.textValue,
|
|
43
44
|
onBlur: this.onBlur.bind(this),
|
|
44
45
|
onFocus: this.onFocus.bind(this),
|
|
45
46
|
onKeyPress: this.validateInputEntry.bind(this),
|
|
46
|
-
onChangeText:
|
|
47
|
+
onChangeText: text => {
|
|
48
|
+
this.onChangeText.bind(this)(text, 'number');
|
|
49
|
+
},
|
|
47
50
|
onChange: this.invokeChange.bind(this),
|
|
48
51
|
allowContentSelection: this.styles.text.userSelect === 'text'
|
|
49
52
|
}));
|