@wavemaker/app-rn-runtime 12.0.0-next.140488 → 12.0.0-next.140491

Sign up to get free protection for your applications and to get access to all the features.
Files changed (27) hide show
  1. app-rn-runtime/components/chart/basechart.component.js +30 -2
  2. app-rn-runtime/components/chart/basechart.component.js.map +1 -1
  3. app-rn-runtime/components/chart/basechart.props.js +1 -0
  4. app-rn-runtime/components/chart/basechart.props.js.map +1 -1
  5. app-rn-runtime/components/chart/basechart.styles.js +4 -0
  6. app-rn-runtime/components/chart/basechart.styles.js.map +1 -1
  7. app-rn-runtime/components/chart/bubble-chart/bubble-chart.component.js +15 -3
  8. app-rn-runtime/components/chart/bubble-chart/bubble-chart.component.js.map +1 -1
  9. app-rn-runtime/components/chart/pie-chart/pie-chart.component.js +4 -1
  10. app-rn-runtime/components/chart/pie-chart/pie-chart.component.js.map +1 -1
  11. app-rn-runtime/components/container/wizard/wizard.component.js +15 -3
  12. app-rn-runtime/components/container/wizard/wizard.component.js.map +1 -1
  13. app-rn-runtime/components/data/form/form-field/form-field.component.js +1 -0
  14. app-rn-runtime/components/data/form/form-field/form-field.component.js.map +1 -1
  15. app-rn-runtime/components/input/currency/currency.component.js +16 -1
  16. app-rn-runtime/components/input/currency/currency.component.js.map +1 -1
  17. app-rn-runtime/components/input/epoch/base-datetime.component.js +15 -3
  18. app-rn-runtime/components/input/epoch/base-datetime.component.js.map +1 -1
  19. app-rn-runtime/core/base.component.js +1 -1
  20. app-rn-runtime/core/base.component.js.map +1 -1
  21. app-rn-runtime/core/tappable.component.js +26 -25
  22. app-rn-runtime/core/tappable.component.js.map +1 -1
  23. app-rn-runtime/core/ui-preferences.context.js +7 -0
  24. app-rn-runtime/core/ui-preferences.context.js.map +1 -0
  25. app-rn-runtime/core/utils.js +55 -0
  26. app-rn-runtime/core/utils.js.map +1 -1
  27. app-rn-runtime/package.json +3 -3
@@ -34,10 +34,13 @@ export default class WmWizard extends BaseComponent {
34
34
  }
35
35
  }
36
36
  });
37
- const steps = props.children;
37
+ }
38
+ updateDefaultStep() {
39
+ const steps = this.steps;
40
+ const props = this.props;
38
41
  let defaultStepIndex = 0;
39
42
  if (isArray(steps) && props.defaultstep) {
40
- steps.map((item, index) => {
43
+ steps && steps.map((item, index) => {
41
44
  if (props.defaultstep === item.props.name) {
42
45
  defaultStepIndex = index;
43
46
  }
@@ -51,7 +54,16 @@ export default class WmWizard extends BaseComponent {
51
54
  }
52
55
  componentDidMount() {
53
56
  super.componentDidMount();
54
- this.showActiveStep();
57
+ if (this.props.defaultstep) {
58
+ this.updateDefaultStep();
59
+ }
60
+ }
61
+ componentDidUpdate(prevProps, prevState, snapshot) {
62
+ super.componentDidUpdate && super.componentDidUpdate(prevProps, prevState, snapshot);
63
+ // * when a variable is bind to default step
64
+ if (this.props.defaultstep && prevProps.defaultstep !== this.props.defaultstep) {
65
+ this.updateDefaultStep();
66
+ }
55
67
  }
56
68
  showActiveStep() {
57
69
  var _this$steps$this$stat;
@@ -1 +1 @@
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","args","_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","isDone","_this$steps$this$stat2","lastStep","setInActive","updateState","invokeEventCallback","proxy","getStepStyle","style","styles","push","doneStep","activeStep","renderMenuPopover","menuDataset","getmenudataexpression","Labels","title","createElement","id","getTestId","popover","contentanimation","caption","popoverheight","height","popoverwidth","width","listener","iconclass","popovericonclass","iconposition","type","currentMenuItem","length","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","_extends","stepTitle","getTestPropsForLabel","stepSubTitle","renderWizardHeader","isLastStep","numberOfSteps","isFirstStep","isActiveStep","isNumberTextLayout","classname","show","paddingRight","paddingLeft","bind","disabled","headernavigation","accessibilityRole","activeStepCounter","stepCounter","stepIcon","icon","color","numberTextStepConnector","stepConnector","left","OS","isRTL","prev","invokePrevCB","next","eventName","invokeSkipCB","invokeNextCB","done","$event","cancel","skip","renderWidget","_this$state$props$cla","isSkippable","enableskip","isProgressCircleHeader","includes","root","_background","wizardHeader","i","wizardBody","wizardFooter","actionsalignment","showdone","wizardActions","theme","getStyle","doneButton","donebtnlabel","onTap","disabledone","shownext","nextButton","nextbtnlabel","disablenext","showprev","prevButton","previousbtnlabel","disableprev","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 const lastStep = this.state.currentStep;\n this.steps[this.state.currentStep]?.setInActive();\n this.updateState({\n currentStep: index,\n isDone: isDone\n } as WmWizardState, () => {\n this.showActiveStep();\n if (lastStep !== index) {\n this.invokeEventCallback('onChange', [null, this.proxy, index + 1, lastStep + 1]);\n }\n });\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 id={this.getTestId('menu')}\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 id={this.getTestId('icon')} 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 id={this.getTestId('progress')} 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} {...this.getTestPropsForLabel('step' + (index + 1) + '_title')}>\n {item.props.title || 'Step Title'}</Text>\n <Text style={this.styles.stepSubTitle} {...this.getTestPropsForLabel('step' + (index + 1)+ '_subtitle')}>\n {item.props.subtitle || 'Step Sub Title'}</Text>\n </View>\n <View style={{ flexDirection: 'row', alignItems: 'flex-end', justifyContent: 'flex-end', flex: 1 }}>\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.state.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 || !this.state.props.headernavigation}\n accessibilityRole='header'>\n <View style={this.getStepStyle(index)}>\n {index >= this.state.currentStep && !this.state.isDone &&\n <Text style={isActiveStep ? [this.styles.activeStep, this.styles.activeStepCounter] : this.styles.stepCounter} {...this.getTestPropsForLabel('step' + (index + 1) + '_indicator')}>{index+1}</Text>}\n {(index < this.state.currentStep || this.state.isDone) &&\n <WmIcon id={this.getTestId('status')} styles={merge({}, this.styles.stepIcon, {icon: {color: this.styles.activeStep.color}})}\n iconclass={item.state.props.iconclass || 'wm-sl-l sl-check'}></WmIcon>}\n </View>\n {(isActiveStep) &&\n <Text style={this.styles.stepTitle} {...this.getTestPropsForLabel('step' + (index + 1) + '_title')}>\n {item.state.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 prev() {\n const index = this.state.currentStep;\n if (index <= 0) {\n return;\n }\n const currentStep = this.steps[index];\n if(currentStep.invokePrevCB(index) == false){\n return;\n }\n this.updateCurrentStep(index - 1);\n }\n\n next(eventName?: string) {\n const index = this.state.currentStep;\n if (index >= this.steps.length - 1) {\n return;\n }\n const currentStep = this.steps[index];\n if (eventName === 'skip') {\n currentStep.invokeSkipCB(index);\n } else if (currentStep.invokeNextCB(index) == false) {\n return;\n }\n this.updateCurrentStep(index + 1);\n }\n\n done($event: any) {\n if (this.state.currentStep !== this.steps.length - 1) {\n return;\n }\n this.updateState({\n isDone: true\n } as WmWizardState);\n this.invokeEventCallback('onDone', [$event, this.proxy]);\n }\n\n cancel() {\n this.invokeEventCallback('onCancel', [null, this.proxy]);\n }\n\n skip() {\n this.next('skip');\n }\n\n renderWidget(props: WmWizardProps) {\n this.numberOfSteps = this.steps.length;\n const activeStep = this.steps[this.state.currentStep];\n const isSkippable = activeStep && activeStep.state.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 && activeStep.state.props.showdone &&\n <WmButton iconclass={'wm-sl-l sl-check'} styles={merge({}, this.styles.wizardActions, this.theme.getStyle('btn-default'), this.styles.doneButton)}\n id = {this.getTestId('donebtn')} caption={props.donebtnlabel} onTap={this.done.bind(this)} disabled={activeStep.state.props.disabledone}></WmButton>\n }\n {(this.state.currentStep+1) < this.numberOfSteps && activeStep.state.props.shownext &&\n <WmButton iconclass={'wi wi-chevron-right'} styles={merge({}, this.styles.wizardActions, this.theme.getStyle('btn-default'), this.styles.nextButton)}\n id = {this.getTestId('nextbtn')}\n iconposition={'right'} caption={props.nextbtnlabel} onTap={this.next.bind(this)} disabled={activeStep.state.props.disablenext}></WmButton>\n }\n {this.state.currentStep > 0 && activeStep.state.props.showprev &&\n <WmButton iconclass={'wi wi-chevron-left'} styles={merge({}, this.theme.getStyle('btn-default'), this.styles.wizardActions, this.styles.prevButton)} caption={props.previousbtnlabel}\n id = {this.getTestId('prevbtn')}\n onTap={this.prev.bind(this)} disabled={activeStep.state.props.disableprev}></WmButton>\n }\n {props.cancelable ?\n <WmButton id = {this.getTestId('cancelbtn')} caption={props.cancelbtnlabel} styles={merge({}, this.theme.getStyle('btn-default'), this.styles.wizardActions, this.styles.cancelButton)} onTap={this.cancel.bind(this)}></WmButton>\n : null\n }\n {isSkippable &&\n <WmAnchor iconclass={'wi wi-chevron-right'} iconposition={'right'} caption={'Skip'}\n id = {this.getTestId('skip')}\n styles={merge({}, this.styles.wizardActions, this.styles.skipLink)} onTap={this.skip.bind(this)}></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,GAAAC,IAAA;IAAA,SAAAA,IAAA;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,EAAE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View","TouchableOpacity","Platform","TouchableWithoutFeedback","isArray","merge","BaseComponent","BaseComponentState","WmWizardProps","DEFAULT_CLASS","WmButton","WmIcon","WmAnchor","WmProgressCircle","WmPopover","WmLabel","WmWizardState","constructor","args","_defineProperty","WmWizard","props","onComponentInit","c","popOverRef","updateDefaultStep","steps","defaultStepIndex","defaultstep","map","item","index","name","updateCurrentStep","addWizardStep","step","forceUpdate","componentDidMount","componentDidUpdate","prevProps","prevState","snapshot","showActiveStep","_this$steps$this$stat","state","currentStep","setActive","isDone","_this$steps$this$stat2","lastStep","setInActive","updateState","invokeEventCallback","proxy","getStepStyle","style","styles","push","doneStep","activeStep","renderMenuPopover","menuDataset","getmenudataexpression","Labels","title","createElement","id","getTestId","popover","contentanimation","caption","popoverheight","height","popoverwidth","width","listener","iconclass","popovericonclass","iconposition","type","currentMenuItem","length","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","_extends","stepTitle","getTestPropsForLabel","stepSubTitle","renderWizardHeader","isLastStep","numberOfSteps","isFirstStep","isActiveStep","isNumberTextLayout","classname","show","paddingRight","paddingLeft","bind","disabled","headernavigation","accessibilityRole","activeStepCounter","stepCounter","stepIcon","icon","color","numberTextStepConnector","stepConnector","left","OS","isRTL","prev","invokePrevCB","next","eventName","invokeSkipCB","invokeNextCB","done","$event","cancel","skip","renderWidget","_this$state$props$cla","isSkippable","enableskip","isProgressCircleHeader","includes","root","_background","wizardHeader","i","wizardBody","children","wizardFooter","actionsalignment","showdone","wizardActions","theme","getStyle","doneButton","donebtnlabel","onTap","disabledone","shownext","nextButton","nextbtnlabel","disablenext","showprev","prevButton","previousbtnlabel","disableprev","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 }\n\n updateDefaultStep() {\n const steps = this.steps;\n const props = this.props;\n let defaultStepIndex = 0;\n if (isArray(steps) && props.defaultstep) {\n steps && 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 if (this.props.defaultstep) {\n this.updateDefaultStep();\n }\n }\n\n componentDidUpdate(prevProps: Readonly<WmWizardProps>, prevState: Readonly<WmWizardState>, snapshot?: any): void {\n super.componentDidUpdate && super.componentDidUpdate(prevProps, prevState, snapshot);\n // * when a variable is bind to default step\n if (this.props.defaultstep && prevProps.defaultstep !== this.props.defaultstep) {\n this.updateDefaultStep();\n }\n }\n\n showActiveStep() {\n this.steps[this.state.currentStep]?.setActive();\n }\n\n updateCurrentStep(index: number, isDone = false) {\n const lastStep = this.state.currentStep;\n this.steps[this.state.currentStep]?.setInActive();\n this.updateState({\n currentStep: index,\n isDone: isDone\n } as WmWizardState, () => {\n this.showActiveStep();\n if (lastStep !== index) {\n this.invokeEventCallback('onChange', [null, this.proxy, index + 1, lastStep + 1]);\n }\n });\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 id={this.getTestId('menu')}\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 id={this.getTestId('icon')} 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 id={this.getTestId('progress')} 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} {...this.getTestPropsForLabel('step' + (index + 1) + '_title')}>\n {item.props.title || 'Step Title'}</Text>\n <Text style={this.styles.stepSubTitle} {...this.getTestPropsForLabel('step' + (index + 1)+ '_subtitle')}>\n {item.props.subtitle || 'Step Sub Title'}</Text>\n </View>\n <View style={{ flexDirection: 'row', alignItems: 'flex-end', justifyContent: 'flex-end', flex: 1 }}>\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.state.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 || !this.state.props.headernavigation}\n accessibilityRole='header'>\n <View style={this.getStepStyle(index)}>\n {index >= this.state.currentStep && !this.state.isDone &&\n <Text style={isActiveStep ? [this.styles.activeStep, this.styles.activeStepCounter] : this.styles.stepCounter} {...this.getTestPropsForLabel('step' + (index + 1) + '_indicator')}>{index+1}</Text>}\n {(index < this.state.currentStep || this.state.isDone) &&\n <WmIcon id={this.getTestId('status')} styles={merge({}, this.styles.stepIcon, {icon: {color: this.styles.activeStep.color}})}\n iconclass={item.state.props.iconclass || 'wm-sl-l sl-check'}></WmIcon>}\n </View>\n {(isActiveStep) &&\n <Text style={this.styles.stepTitle} {...this.getTestPropsForLabel('step' + (index + 1) + '_title')}>\n {item.state.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 prev() {\n const index = this.state.currentStep;\n if (index <= 0) {\n return;\n }\n const currentStep = this.steps[index];\n if(currentStep.invokePrevCB(index) == false){\n return;\n }\n this.updateCurrentStep(index - 1);\n }\n\n next(eventName?: string) {\n const index = this.state.currentStep;\n if (index >= this.steps.length - 1) {\n return;\n }\n const currentStep = this.steps[index];\n if (eventName === 'skip') {\n currentStep.invokeSkipCB(index);\n } else if (currentStep.invokeNextCB(index) == false) {\n return;\n }\n this.updateCurrentStep(index + 1);\n }\n\n done($event: any) {\n if (this.state.currentStep !== this.steps.length - 1) {\n return;\n }\n this.updateState({\n isDone: true\n } as WmWizardState);\n this.invokeEventCallback('onDone', [$event, this.proxy]);\n }\n\n cancel() {\n this.invokeEventCallback('onCancel', [null, this.proxy]);\n }\n\n skip() {\n this.next('skip');\n }\n\n renderWidget(props: WmWizardProps) {\n this.numberOfSteps = this.steps.length;\n const activeStep = this.steps[this.state.currentStep];\n const isSkippable = activeStep && activeStep.state.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 && activeStep.state.props.showdone &&\n <WmButton iconclass={'wm-sl-l sl-check'} styles={merge({}, this.styles.wizardActions, this.theme.getStyle('btn-default'), this.styles.doneButton)}\n id = {this.getTestId('donebtn')} caption={props.donebtnlabel} onTap={this.done.bind(this)} disabled={activeStep.state.props.disabledone}></WmButton>\n }\n {(this.state.currentStep+1) < this.numberOfSteps && activeStep.state.props.shownext &&\n <WmButton iconclass={'wi wi-chevron-right'} styles={merge({}, this.styles.wizardActions, this.theme.getStyle('btn-default'), this.styles.nextButton)}\n id = {this.getTestId('nextbtn')}\n iconposition={'right'} caption={props.nextbtnlabel} onTap={this.next.bind(this)} disabled={activeStep.state.props.disablenext}></WmButton>\n }\n {this.state.currentStep > 0 && activeStep.state.props.showprev &&\n <WmButton iconclass={'wi wi-chevron-left'} styles={merge({}, this.theme.getStyle('btn-default'), this.styles.wizardActions, this.styles.prevButton)} caption={props.previousbtnlabel}\n id = {this.getTestId('prevbtn')}\n onTap={this.prev.bind(this)} disabled={activeStep.state.props.disableprev}></WmButton>\n }\n {props.cancelable ?\n <WmButton id = {this.getTestId('cancelbtn')} caption={props.cancelbtnlabel} styles={merge({}, this.theme.getStyle('btn-default'), this.styles.wizardActions, this.styles.cancelButton)} onTap={this.cancel.bind(this)}></WmButton>\n : null\n }\n {isSkippable &&\n <WmAnchor iconclass={'wi wi-chevron-right'} iconposition={'right'} caption={'Skip'}\n id = {this.getTestId('skip')}\n styles={merge({}, this.styles.wizardActions, this.styles.skipLink)} onTap={this.skip.bind(this)}></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,GAAAC,IAAA;IAAA,SAAAA,IAAA;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,IAAI,CAACU,UAAU,GAAGD,CAAC;QACrB;MACF;IACF,CAAC;EAID;EAEAE,iBAAiBA,CAAA,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AAQ,CAAE;MAACb,KAAK,EAAE,IAAI,CAACrB,IAAI,CAACvB,IAAI,CAAC,IAAI;IAAE,CAAW,CAE7G,CACF,CAAC;EAEX;AACF","ignoreList":[]}
@@ -226,6 +226,7 @@ export default class WmFormField extends BaseComponent {
226
226
  isValid: this.state.isValid,
227
227
  maskchar: props.maskchar,
228
228
  displayformat: props.displayformat,
229
+ classname: props.classname,
229
230
  invokeEvent: this.invokeEventCallback.bind(this),
230
231
  triggerValidation: this.validateFormField.bind(this),
231
232
  onFieldChange: this.onFieldChangeEvt.bind(this),
@@ -1 +1 @@
1
- {"version":3,"names":["React","Text","View","BaseComponent","BaseComponentState","isEqual","isNil","get","find","cloneDeep","forEach","keys","WmFormFieldProps","DEFAULT_CLASS","PERFORMANCE_LOGGER","WmFormFieldState","constructor","args","_defineProperty","WmFormField","props","form","formScope","componentDidMount","_this$form","_this$form2","_this$form3","formwidget","formKey","formWidgets","name","registerFormFields","formFields","onFieldChangeEvt","$new","$old","isDefault","notifyChanges","updateState","datavalue","invokeEventCallback","undefined","validateFormField","updateDataOutput","call","observeOn","fields","field","formfield","f","proxy","notifyForFields","push","validate","setTimeout","getPromiseList","validators","arr","fn","promise","Function","bind","Promise","setAsyncValidators","_asyncValidatorFn","all","then","err","validationMsg","hasOwnProperty","messageKeys","toString","setInvalidState","setValidators","_cloneValidators","_syncValidators","obj","index","key","defaultValidatorMessages","value","propsObj","updateFormWidgetDataset","res","displayField","dataset","data","datafield","displayfield","state","msg","isValid","validationmessage","onPropertyChange","debug","applyDefaultValue","setPrimaryKey","setReadOnlyState","updateMode","_this$formwidget","readonly","_this$formwidget2","_this$_syncValidators","_this$formwidget3","errorType","errormsg","errorMessage","renderWidget","childrenWithProps","Children","map","renderFormFields","children","child","cloneElement","maskchar","displayformat","invokeEvent","triggerValidation","onFieldChange","formRef","placeholder","createElement","style","styles","root","_background","_extends","getTestPropsForLabel","errorMsg"],"sources":["form-field.component.tsx"],"sourcesContent":["import React from 'react';\nimport {Text, View} from 'react-native';\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\nimport { widgetsWithUndefinedValue } from '@wavemaker/app-rn-runtime/core/utils';\nimport { isEqual, isNil, get, find, cloneDeep, forEach, keys } from 'lodash';\n\nimport WmFormFieldProps from './form-field.props';\nimport { DEFAULT_CLASS, WmFormFieldStyles } from './form-field.styles';\nimport {PERFORMANCE_LOGGER} from \"@wavemaker/app-rn-runtime/core/logger\";\n\nexport class WmFormFieldState extends BaseComponentState<WmFormFieldProps> {\n isValid = true;\n}\n\nexport default class WmFormField extends BaseComponent<WmFormFieldProps, WmFormFieldState, WmFormFieldStyles> {\n public form: any;\n public formwidget: any;\n public _syncValidators: any;\n public defaultValidatorMessages: any = [];\n private notifyForFields: any = [];\n private _asyncValidatorFn: any;\n constructor(props: WmFormFieldProps) {\n super(props, DEFAULT_CLASS, new WmFormFieldProps(), new WmFormFieldState());\n if (!this.form) {\n this.form = props.formScope && props.formScope();\n }\n }\n\n componentDidMount() {\n super.componentDidMount();\n this.formwidget = (this.props.formKey && this.form?.formWidgets[this.props.formKey])\n || (this.props.name && this.form?.formWidgets[this.props.name]);\n this.form?.registerFormFields(this.form.formFields, this.form.formWidgets);\n }\n\n onFieldChangeEvt(name: string, $new: any, $old: any, isDefault: boolean) {\n this.notifyChanges();\n if (!isEqual($old, $new)) {\n this.updateState({ props: { datavalue: $new }} as WmFormFieldState, () => {\n !isDefault && this.invokeEventCallback('onChange', [undefined, this, $new, $old]);\n this.validateFormField();\n });\n if (this.form) {\n this.form.updateDataOutput.call(this.form, get(this.props, 'formKey', this.props.name), $new);\n }\n }\n }\n\n // Registers observer of validation fields\n observeOn(fields: any) {\n forEach(fields, (field) => {\n const formfield = find(this.form.formFields, (f) => f.proxy.name === field);\n if (formfield) {\n formfield.notifyForFields.push(this);\n }\n });\n }\n\n // Notifies changes to observing validation fields\n notifyChanges() {\n forEach(this.notifyForFields, (field) => {\n field.formwidget.validate(field.formwidget.datavalue);\n setTimeout(() => field.validateFormField());\n });\n }\n\n getPromiseList(validators: any) {\n const arr: any = [];\n forEach(validators, (fn) => {\n let promise = fn;\n if (fn instanceof Function && fn.bind) {\n promise = fn(this.formwidget.proxy, this.form);\n }\n if (promise instanceof Promise) {\n arr.push(promise);\n }\n });\n return arr;\n }\n\n // this method sets the asyncValidation on the form field. Assigns validationmessages from the returned response\n setAsyncValidators(validators: any) {\n this._asyncValidatorFn = () => {\n return Promise.all(this.getPromiseList(validators)).then(() => {\n return null;\n }, err => {\n let validationMsg: string;\n // if err obj has validationMessage key, then set validationMessage using this value\n // else return the value of the first key in the err object as validation message.\n if (err.hasOwnProperty('errorMessage')) {\n validationMsg = get(err, 'errorMessage');\n } else {\n const messageKeys = keys(err);\n validationMsg = (err[messageKeys[0]]).toString();\n }\n this.setInvalidState(validationMsg);\n return err;\n })\n };\n }\n\n // sets the default validation on the form field\n setValidators(validators: any) {\n let _cloneValidators = cloneDeep(validators);\n this._syncValidators = [];\n forEach(_cloneValidators, (obj, index) => {\n // custom validation is bound to function.\n if (obj && obj instanceof Function) {\n // passing formwidget and form as arguments to the obj (i.e. validator function)\n _cloneValidators[index] = obj.bind(undefined, this.formwidget.proxy, this.form);\n this._syncValidators.push(_cloneValidators[index]);\n } else {\n // checks for default validator like required, maxchars etc.\n const key = get(obj, 'type');\n this.defaultValidatorMessages[key] = get(obj, 'errorMessage');\n const value = get(obj, 'validator');\n let propsObj: any = {\n props: {}\n };\n propsObj.props[key] = value;\n key === 'required' && this.updateState(propsObj as WmFormFieldState);\n this.formwidget.updateState(propsObj as WmFormFieldState);\n }\n });\n }\n\n updateFormWidgetDataset(res: any, displayField: string) {\n this.formwidget.updateState({\n props: {\n dataset: res.data,\n datafield: 'All Fields',\n displayfield: this.formwidget.state.props.displayfield || displayField,\n }\n } as WmFormFieldState);\n }\n\n setInvalidState(msg: string) {\n this.updateState({\n isValid: false,\n props: {\n validationmessage: msg\n }\n } as WmFormFieldState)\n this.formwidget.updateState({\n isValid: false,\n props: {\n validationmessage: msg\n }\n } as WmFormFieldState);\n }\n\n onPropertyChange(name: string, $new: any, $old: any) {\n switch (name) {\n case 'datavalue':\n if (!isEqual($old, $new)) {\n PERFORMANCE_LOGGER.debug(`form field ${this.props.name} changed from ${$old} to ${$new}`);\n }\n break;\n case 'defaultvalue':\n if (!isEqual($old, $new)) {\n get(this, 'form') && this.form.applyDefaultValue(this);\n }\n break;\n case 'primary-key':\n if ($new) {\n this.form.setPrimaryKey(this.props.name);\n }\n break;\n }\n }\n\n setReadOnlyState(updateMode: any) {\n this.formwidget?.updateState({\n props: {\n readonly: !updateMode,\n }\n } as WmFormFieldState);\n }\n\n validateFormField() {\n if (this.formwidget?.state.isValid === false) {\n const errorType = this.formwidget?.state?.errorType;\n let validationMsg = get(this.defaultValidatorMessages, errorType);\n if (validationMsg) {\n if (validationMsg instanceof Function) {\n // passing formwidget and form as arguments to the errorMessage function.\n validationMsg = validationMsg(this.formwidget.proxy, this.form);\n }\n this.updateState({ props: {\n validationmessage: validationMsg\n }} as WmFormFieldState);\n }\n this.updateState({ isValid: false} as WmFormFieldState);\n } else {\n this.updateState({ isValid: true } as WmFormFieldState);\n }\n\n this._syncValidators?.forEach((fn: any) => {\n const errormsg = fn();\n let validationMsg = errormsg?.errorMessage;\n if (validationMsg) {\n if (validationMsg instanceof Function) {\n // passing formwidget and form as arguments to the errorMessage function.\n validationMsg = validationMsg(this.formwidget.proxy, this.form);\n }\n this.setInvalidState(validationMsg);\n }\n })\n\n this._asyncValidatorFn && this._asyncValidatorFn();\n\n }\n\n get value(){\n return this.state.props.datavalue;\n }\n\n renderWidget(props: WmFormFieldProps) {\n var childrenWithProps = React.Children.map(props.renderFormFields(this.proxy).props.children, (child) => {\n return React.cloneElement(child, {\n datavalue: props.datavalue,\n value: this.value,\n isValid: this.state.isValid,\n maskchar: props.maskchar,\n displayformat: props.displayformat,\n invokeEvent: this.invokeEventCallback.bind(this),\n triggerValidation: this.validateFormField.bind(this),\n onFieldChange: this.onFieldChangeEvt.bind(this),\n formRef: props.formRef,\n ...(!isNil(props?.placeholder) ? { placeholder: props.placeholder } : {})\n });\n });\n return (\n <View style={this.styles.root}>{this._background}{childrenWithProps}\n {this.state.isValid === false && <Text {...this.getTestPropsForLabel('error_msg')} style={this.styles.errorMsg}>{props.validationmessage}</Text>}\n </View>\n );\n }\n}\n"],"mappings":";;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAAQC,IAAI,EAAEC,IAAI,QAAO,cAAc;AACvC,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,+CAA+C;AAEjG,SAASC,OAAO,EAAEC,KAAK,EAAEC,GAAG,EAAEC,IAAI,EAAEC,SAAS,EAAEC,OAAO,EAAEC,IAAI,QAAQ,QAAQ;AAE5E,OAAOC,gBAAgB,MAAM,oBAAoB;AACjD,SAASC,aAAa,QAA2B,qBAAqB;AACtE,SAAQC,kBAAkB,QAAO,uCAAuC;AAExE,OAAO,MAAMC,gBAAgB,SAASX,kBAAkB,CAAmB;EAAAY,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAC,eAAA,kBAC/D,IAAI;EAAA;AAChB;AAEA,eAAe,MAAMC,WAAW,SAAShB,aAAa,CAAwD;EAO5Ga,WAAWA,CAACI,KAAuB,EAAE;IACnC,KAAK,CAACA,KAAK,EAAEP,aAAa,EAAE,IAAID,gBAAgB,CAAC,CAAC,EAAE,IAAIG,gBAAgB,CAAC,CAAC,CAAC;IAACG,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA,mCAJvC,EAAE;IAAAA,eAAA,0BACV,EAAE;IAAAA,eAAA;IAI/B,IAAI,CAAC,IAAI,CAACG,IAAI,EAAE;MACd,IAAI,CAACA,IAAI,GAAGD,KAAK,CAACE,SAAS,IAAIF,KAAK,CAACE,SAAS,CAAC,CAAC;IAClD;EACF;EAEAC,iBAAiBA,CAAA,EAAG;IAAA,IAAAC,UAAA,EAAAC,WAAA,EAAAC,WAAA;IACl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F,KAAK,CAAC+F,QAAQ;QACxBC,aAAa,EAAEhG,KAAK,CAACgG,aAAa;QAClCC,WAAW,EAAE,IAAI,CAAC7E,mBAAmB,CAACqB,IAAI,CAAC,IAAI,CAAC;QAChDyD,iBAAiB,EAAE,IAAI,CAAC5E,iBAAiB,CAACmB,IAAI,CAAC,IAAI,CAAC;QACpD0D,aAAa,EAAE,IAAI,CAACtF,gBAAgB,CAAC4B,IAAI,CAAC,IAAI,CAAC;QAC/C2D,OAAO,EAAEpG,KAAK,CAACoG,OAAO;QACtB,IAAI,CAAClH,KAAK,CAACc,KAAK,aAALA,KAAK,uBAALA,KAAK,CAAEqG,WAAW,CAAC,GAAG;UAAEA,WAAW,EAAErG,KAAK,CAACqG;QAAY,CAAC,GAAG,CAAC,CAAC;MACzE,CAAC,CAAC;IACP,CAAC,CAAC;IACF,oBACEzH,KAAA,CAAA0H,aAAA,CAACxH,IAAI;MAACyH,KAAK,EAAE,IAAI,CAACC,MAAM,CAACC;IAAK,GAAE,IAAI,CAACC,WAAW,EAAElB,iBAAiB,EAChE,IAAI,CAACnB,KAAK,CAACE,OAAO,KAAK,KAAK,iBAAI3F,KAAA,CAAA0H,aAAA,CAACzH,IAAI,EAAA8H,QAAA,KAAK,IAAI,CAACC,oBAAoB,CAAC,WAAW,CAAC;MAAEL,KAAK,EAAE,IAAI,CAACC,MAAM,CAACK;IAAS,IAAE7G,KAAK,CAACwE,iBAAwB,CAC3I,CAAC;EAEX;AACF","ignoreList":[]}
1
+ {"version":3,"names":["React","Text","View","BaseComponent","BaseComponentState","isEqual","isNil","get","find","cloneDeep","forEach","keys","WmFormFieldProps","DEFAULT_CLASS","PERFORMANCE_LOGGER","WmFormFieldState","constructor","args","_defineProperty","WmFormField","props","form","formScope","componentDidMount","_this$form","_this$form2","_this$form3","formwidget","formKey","formWidgets","name","registerFormFields","formFields","onFieldChangeEvt","$new","$old","isDefault","notifyChanges","updateState","datavalue","invokeEventCallback","undefined","validateFormField","updateDataOutput","call","observeOn","fields","field","formfield","f","proxy","notifyForFields","push","validate","setTimeout","getPromiseList","validators","arr","fn","promise","Function","bind","Promise","setAsyncValidators","_asyncValidatorFn","all","then","err","validationMsg","hasOwnProperty","messageKeys","toString","setInvalidState","setValidators","_cloneValidators","_syncValidators","obj","index","key","defaultValidatorMessages","value","propsObj","updateFormWidgetDataset","res","displayField","dataset","data","datafield","displayfield","state","msg","isValid","validationmessage","onPropertyChange","debug","applyDefaultValue","setPrimaryKey","setReadOnlyState","updateMode","_this$formwidget","readonly","_this$formwidget2","_this$_syncValidators","_this$formwidget3","errorType","errormsg","errorMessage","renderWidget","childrenWithProps","Children","map","renderFormFields","children","child","cloneElement","maskchar","displayformat","classname","invokeEvent","triggerValidation","onFieldChange","formRef","placeholder","createElement","style","styles","root","_background","_extends","getTestPropsForLabel","errorMsg"],"sources":["form-field.component.tsx"],"sourcesContent":["import React from 'react';\nimport {Text, View} from 'react-native';\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\nimport { widgetsWithUndefinedValue } from '@wavemaker/app-rn-runtime/core/utils';\nimport { isEqual, isNil, get, find, cloneDeep, forEach, keys } from 'lodash';\n\nimport WmFormFieldProps from './form-field.props';\nimport { DEFAULT_CLASS, WmFormFieldStyles } from './form-field.styles';\nimport {PERFORMANCE_LOGGER} from \"@wavemaker/app-rn-runtime/core/logger\";\n\nexport class WmFormFieldState extends BaseComponentState<WmFormFieldProps> {\n isValid = true;\n}\n\nexport default class WmFormField extends BaseComponent<WmFormFieldProps, WmFormFieldState, WmFormFieldStyles> {\n public form: any;\n public formwidget: any;\n public _syncValidators: any;\n public defaultValidatorMessages: any = [];\n private notifyForFields: any = [];\n private _asyncValidatorFn: any;\n constructor(props: WmFormFieldProps) {\n super(props, DEFAULT_CLASS, new WmFormFieldProps(), new WmFormFieldState());\n if (!this.form) {\n this.form = props.formScope && props.formScope();\n }\n }\n\n componentDidMount() {\n super.componentDidMount();\n this.formwidget = (this.props.formKey && this.form?.formWidgets[this.props.formKey])\n || (this.props.name && this.form?.formWidgets[this.props.name]);\n this.form?.registerFormFields(this.form.formFields, this.form.formWidgets);\n }\n\n onFieldChangeEvt(name: string, $new: any, $old: any, isDefault: boolean) {\n this.notifyChanges();\n if (!isEqual($old, $new)) {\n this.updateState({ props: { datavalue: $new }} as WmFormFieldState, () => {\n !isDefault && this.invokeEventCallback('onChange', [undefined, this, $new, $old]);\n this.validateFormField();\n });\n if (this.form) {\n this.form.updateDataOutput.call(this.form, get(this.props, 'formKey', this.props.name), $new);\n }\n }\n }\n\n // Registers observer of validation fields\n observeOn(fields: any) {\n forEach(fields, (field) => {\n const formfield = find(this.form.formFields, (f) => f.proxy.name === field);\n if (formfield) {\n formfield.notifyForFields.push(this);\n }\n });\n }\n\n // Notifies changes to observing validation fields\n notifyChanges() {\n forEach(this.notifyForFields, (field) => {\n field.formwidget.validate(field.formwidget.datavalue);\n setTimeout(() => field.validateFormField());\n });\n }\n\n getPromiseList(validators: any) {\n const arr: any = [];\n forEach(validators, (fn) => {\n let promise = fn;\n if (fn instanceof Function && fn.bind) {\n promise = fn(this.formwidget.proxy, this.form);\n }\n if (promise instanceof Promise) {\n arr.push(promise);\n }\n });\n return arr;\n }\n\n // this method sets the asyncValidation on the form field. Assigns validationmessages from the returned response\n setAsyncValidators(validators: any) {\n this._asyncValidatorFn = () => {\n return Promise.all(this.getPromiseList(validators)).then(() => {\n return null;\n }, err => {\n let validationMsg: string;\n // if err obj has validationMessage key, then set validationMessage using this value\n // else return the value of the first key in the err object as validation message.\n if (err.hasOwnProperty('errorMessage')) {\n validationMsg = get(err, 'errorMessage');\n } else {\n const messageKeys = keys(err);\n validationMsg = (err[messageKeys[0]]).toString();\n }\n this.setInvalidState(validationMsg);\n return err;\n })\n };\n }\n\n // sets the default validation on the form field\n setValidators(validators: any) {\n let _cloneValidators = cloneDeep(validators);\n this._syncValidators = [];\n forEach(_cloneValidators, (obj, index) => {\n // custom validation is bound to function.\n if (obj && obj instanceof Function) {\n // passing formwidget and form as arguments to the obj (i.e. validator function)\n _cloneValidators[index] = obj.bind(undefined, this.formwidget.proxy, this.form);\n this._syncValidators.push(_cloneValidators[index]);\n } else {\n // checks for default validator like required, maxchars etc.\n const key = get(obj, 'type');\n this.defaultValidatorMessages[key] = get(obj, 'errorMessage');\n const value = get(obj, 'validator');\n let propsObj: any = {\n props: {}\n };\n propsObj.props[key] = value;\n key === 'required' && this.updateState(propsObj as WmFormFieldState);\n this.formwidget.updateState(propsObj as WmFormFieldState);\n }\n });\n }\n\n updateFormWidgetDataset(res: any, displayField: string) {\n this.formwidget.updateState({\n props: {\n dataset: res.data,\n datafield: 'All Fields',\n displayfield: this.formwidget.state.props.displayfield || displayField,\n }\n } as WmFormFieldState);\n }\n\n setInvalidState(msg: string) {\n this.updateState({\n isValid: false,\n props: {\n validationmessage: msg\n }\n } as WmFormFieldState)\n this.formwidget.updateState({\n isValid: false,\n props: {\n validationmessage: msg\n }\n } as WmFormFieldState);\n }\n\n onPropertyChange(name: string, $new: any, $old: any) {\n switch (name) {\n case 'datavalue':\n if (!isEqual($old, $new)) {\n PERFORMANCE_LOGGER.debug(`form field ${this.props.name} changed from ${$old} to ${$new}`);\n }\n break;\n case 'defaultvalue':\n if (!isEqual($old, $new)) {\n get(this, 'form') && this.form.applyDefaultValue(this);\n }\n break;\n case 'primary-key':\n if ($new) {\n this.form.setPrimaryKey(this.props.name);\n }\n break;\n }\n }\n\n setReadOnlyState(updateMode: any) {\n this.formwidget?.updateState({\n props: {\n readonly: !updateMode,\n }\n } as WmFormFieldState);\n }\n\n validateFormField() {\n if (this.formwidget?.state.isValid === false) {\n const errorType = this.formwidget?.state?.errorType;\n let validationMsg = get(this.defaultValidatorMessages, errorType);\n if (validationMsg) {\n if (validationMsg instanceof Function) {\n // passing formwidget and form as arguments to the errorMessage function.\n validationMsg = validationMsg(this.formwidget.proxy, this.form);\n }\n this.updateState({ props: {\n validationmessage: validationMsg\n }} as WmFormFieldState);\n }\n this.updateState({ isValid: false} as WmFormFieldState);\n } else {\n this.updateState({ isValid: true } as WmFormFieldState);\n }\n\n this._syncValidators?.forEach((fn: any) => {\n const errormsg = fn();\n let validationMsg = errormsg?.errorMessage;\n if (validationMsg) {\n if (validationMsg instanceof Function) {\n // passing formwidget and form as arguments to the errorMessage function.\n validationMsg = validationMsg(this.formwidget.proxy, this.form);\n }\n this.setInvalidState(validationMsg);\n }\n })\n\n this._asyncValidatorFn && this._asyncValidatorFn();\n\n }\n\n get value(){\n return this.state.props.datavalue;\n }\n\n renderWidget(props: WmFormFieldProps) {\n var childrenWithProps = React.Children.map(props.renderFormFields(this.proxy).props.children, (child) => {\n return React.cloneElement(child, {\n datavalue: props.datavalue,\n value: this.value,\n isValid: this.state.isValid,\n maskchar: props.maskchar,\n displayformat: props.displayformat,\n classname : props.classname,\n invokeEvent: this.invokeEventCallback.bind(this),\n triggerValidation: this.validateFormField.bind(this),\n onFieldChange: this.onFieldChangeEvt.bind(this),\n formRef: props.formRef,\n ...(!isNil(props?.placeholder) ? { placeholder: props.placeholder } : {})\n });\n });\n return (\n <View style={this.styles.root}>{this._background}{childrenWithProps}\n {this.state.isValid === false && <Text {...this.getTestPropsForLabel('error_msg')} style={this.styles.errorMsg}>{props.validationmessage}</Text>}\n </View>\n );\n }\n}\n"],"mappings":";;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAAQC,IAAI,EAAEC,IAAI,QAAO,cAAc;AACvC,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,+CAA+C;AAEjG,SAASC,OAAO,EAAEC,KAAK,EAAEC,GAAG,EAAEC,IAAI,EAAEC,SAAS,EAAEC,OAAO,EAAEC,IAAI,QAAQ,QAAQ;AAE5E,OAAOC,gBAAgB,MAAM,oBAAoB;AACjD,SAASC,aAAa,QAA2B,qBAAqB;AACtE,SAAQC,kBAAkB,QAAO,uCAAuC;AAExE,OAAO,MAAMC,gBAAgB,SAASX,kBAAkB,CAAmB;EAAAY,YAAA,GAAAC,IAAA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K,GAAE,IAAI,CAACC,WAAW,EAAEnB,iBAAiB,EAChE,IAAI,CAACnB,KAAK,CAACE,OAAO,KAAK,KAAK,iBAAI3F,KAAA,CAAA2H,aAAA,CAAC1H,IAAI,EAAA+H,QAAA,KAAK,IAAI,CAACC,oBAAoB,CAAC,WAAW,CAAC;MAAEL,KAAK,EAAE,IAAI,CAACC,MAAM,CAACK;IAAS,IAAE9G,KAAK,CAACwE,iBAAwB,CAC3I,CAAC;EAEX;AACF","ignoreList":[]}
@@ -11,6 +11,7 @@ import { DEFAULT_CLASS } from './currency.styles';
11
11
  import { BaseNumberComponent, BaseNumberState } from '@wavemaker/app-rn-runtime/components/input/basenumber/basenumber.component';
12
12
  import { isNull } from "lodash";
13
13
  import { AccessibilityWidgetType, getAccessibilityProps } from '@wavemaker/app-rn-runtime/core/accessibility';
14
+ import { countDecimalDigits, validateInputOnDevice } from '@wavemaker/app-rn-runtime/core/utils';
14
15
  export class WmCurrencyState extends BaseNumberState {
15
16
  constructor(...args) {
16
17
  super(...args);
@@ -78,7 +79,21 @@ export default class WmCurrency extends BaseNumberComponent {
78
79
  onFocus: this.onFocus.bind(this),
79
80
  onKeyPress: this.validateInputEntry.bind(this),
80
81
  onChangeText: text => {
81
- this.onChangeText.bind(this)(text, 'currency');
82
+ const {
83
+ isValidText,
84
+ validText
85
+ } = validateInputOnDevice(text, "currency");
86
+ const decimalPlaces = props.decimalPlaces;
87
+ const decimalPlacesInNumber = countDecimalDigits(validText);
88
+ const restrictDecimalRegex = new RegExp(`(\\.\\d{${decimalPlaces}})\\d*`);
89
+ const updatedCurrencyText = validText.replace(restrictDecimalRegex, '$1');
90
+ if (!isValidText || decimalPlaces < decimalPlacesInNumber) {
91
+ var _this$widgetRef;
92
+ (_this$widgetRef = this.widgetRef) === null || _this$widgetRef === void 0 || _this$widgetRef.setNativeProps({
93
+ text: updatedCurrencyText
94
+ });
95
+ }
96
+ this.onChangeText.bind(this)(updatedCurrencyText, 'currency');
82
97
  },
83
98
  onChange: this.invokeChange.bind(this),
84
99
  allowContentSelection: this.styles.text.userSelect === 'text'
@@ -1 +1 @@
1
- {"version":3,"names":["React","View","Text","Platform","WmCurrencyProps","CURRENCY_INFO","WMTextInput","DEFAULT_CLASS","BaseNumberComponent","BaseNumberState","isNull","AccessibilityWidgetType","getAccessibilityProps","WmCurrencyState","constructor","args","_defineProperty","WmCurrency","props","onPropertyChange","name","$new","$old","updateState","currencySymbol","symbol","getStyleClassName","classes","state","floatinglabel","push","join","renderWidget","_this$state$textValue","opts","valueExpr","OS","textValue","toString","createElement","style","styles","root","labelWrapper","label","flex","_extends","getTestPropsForInput","CURRENCY","ref","widgetRef","selectionStart","selectionEnd","cursor","keyboardType","placeholderTextColor","placeholderText","color","input","text","isValid","invalid","floatingLabel","floatingLabelStyle","activeFloatingLabelStyle","activeFloatingLabel","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\";\nimport { AccessibilityWidgetType, getAccessibilityProps } from '@wavemaker/app-rn-runtime/core/accessibility'; \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 public getStyleClassName(): string | undefined {\n const classes = [];\n if (this.state.props.floatinglabel) {\n classes.push('app-currency-with-label'); \n }\n classes.push(super.getStyleClassName());\n return classes.join(' ');\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>\n </View>\n <View style={{flex: 1}}>\n <WMTextInput\n {...this.getTestPropsForInput()}\n {...getAccessibilityProps(AccessibilityWidgetType.CURRENCY, props)}\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 floatingLabel={props.floatinglabel}\n floatingLabelStyle={this.styles.floatingLabel}\n activeFloatingLabelStyle={this.styles.activeFloatingLabel}\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={(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 </View>);\n }\n}\n"],"mappings":";;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,EAAEC,IAAI,EAAEC,QAAQ,QAAQ,c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AAE,IAAI,CAACd,MAAM,CAACe,eAAe,CAACC,KAAa;MAC/DjB,KAAK,EAAE,CAAC,IAAI,CAACC,MAAM,CAACiB,KAAK,EAAE,IAAI,CAACjB,MAAM,CAACkB,IAAI,EAAE,IAAI,CAAC/B,KAAK,CAACgC,OAAO,GAAG,CAAC,CAAC,GAAG,IAAI,CAACnB,MAAM,CAACoB,OAAO;IAAE,GACxF3B,IAAI;MACR4B,aAAa,EAAE5C,KAAK,CAACW,aAAc;MACnCkC,kBAAkB,EAAE,IAAI,CAACtB,MAAM,CAACqB,aAAc;MAC9CE,wBAAwB,EAAE,IAAI,CAACvB,MAAM,CAACwB,mBAAoB;MAC1DC,QAAQ,EAAEhD,KAAK,CAACiD,QAAQ,IAAIjD,KAAK,CAACkD,QAAQ,GAAG,KAAK,GAAG,IAAK;MAC1DC,WAAW,EAAEnD,KAAK,CAACmD,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,EAAGhB,IAAI,IAAK;QACtB,IAAI,CAACgB,YAAY,CAACJ,IAAI,CAAC,IAAI,CAAC,CAACZ,IAAI,EAAE,UAAU,CAAC;MAChD,CAAE;MACFiB,QAAQ,EAAE,IAAI,CAACC,YAAY,CAACN,IAAI,CAAC,IAAI,CAAE;MACvCO,qBAAqB,EAAE,IAAI,CAACrC,MAAM,CAACkB,IAAI,CAACoB,UAAU,KAAK;IAAO,EAC/D,CACK,CACF,CAAC;EACT;AACF","ignoreList":[]}
1
+ {"version":3,"names":["React","View","Text","Platform","WmCurrencyProps","CURRENCY_INFO","WMTextInput","DEFAULT_CLASS","BaseNumberComponent","BaseNumberState","isNull","AccessibilityWidgetType","getAccessibilityProps","countDecimalDigits","validateInputOnDevice","WmCurrencyState","constructor","args","_defineProperty","WmCurrency","props","onPropertyChange","name","$new","$old","updateState","currencySymbol","symbol","getStyleClassName","classes","state","floatinglabel","push","join","renderWidget","_this$state$textValue","opts","valueExpr","OS","textValue","toString","createElement","style","styles","root","labelWrapper","label","flex","_extends","getTestPropsForInput","CURRENCY","ref","widgetRef","selectionStart","selectionEnd","cursor","keyboardType","placeholderTextColor","placeholderText","color","input","text","isValid","invalid","floatingLabel","floatingLabelStyle","activeFloatingLabelStyle","activeFloatingLabel","editable","disabled","readonly","placeholder","onBlur","bind","onFocus","onKeyPress","validateInputEntry","onChangeText","isValidText","validText","decimalPlaces","decimalPlacesInNumber","restrictDecimalRegex","RegExp","updatedCurrencyText","replace","_this$widgetRef","setNativeProps","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\";\nimport { AccessibilityWidgetType, getAccessibilityProps } from '@wavemaker/app-rn-runtime/core/accessibility'; \nimport { countDecimalDigits, validateInputOnDevice } from '@wavemaker/app-rn-runtime/core/utils';\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 public getStyleClassName(): string | undefined {\n const classes = [];\n if (this.state.props.floatinglabel) {\n classes.push('app-currency-with-label'); \n }\n classes.push(super.getStyleClassName());\n return classes.join(' ');\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>\n </View>\n <View style={{flex: 1}}>\n <WMTextInput\n {...this.getTestPropsForInput()}\n {...getAccessibilityProps(AccessibilityWidgetType.CURRENCY, props)}\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 floatingLabel={props.floatinglabel}\n floatingLabelStyle={this.styles.floatingLabel}\n activeFloatingLabelStyle={this.styles.activeFloatingLabel}\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={(text) => {\n const {isValidText, validText} = validateInputOnDevice(text, \"currency\");\n const decimalPlaces = props.decimalPlaces;\n const decimalPlacesInNumber = countDecimalDigits(validText);\n const restrictDecimalRegex = new RegExp(`(\\\\.\\\\d{${decimalPlaces}})\\\\d*`);\n const updatedCurrencyText = validText.replace(restrictDecimalRegex, '$1');\n\n if (!isValidText || decimalPlaces < decimalPlacesInNumber) {\n (this.widgetRef as any)?.setNativeProps({ text: updatedCurrencyText });\n }\n\n this.onChangeText.bind(this)(updatedCurrencyText, 'currency');\n }}\n onChange={this.invokeChange.bind(this)}\n allowContentSelection={this.styles.text.userSelect === 'text'}\n />\n </View>\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,SAASC,uBAAuB,EAAEC,qBAAqB,QAAQ,8CAA8C;AAC7G,SAASC,kBAAkB,EAAEC,qBAAqB,QAAQ,sCAAsC;AAChG,OAAO,MAAMC,eAAe,SAASN,eAAe,CAAkB;EAAAO,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAC,eAAA;EAAA;AAEtE;AAEA,eAAe,MAAMC,UAAU,SAASX,mBAAmB,CAAqD;EAE9GQ,WAAWA,CAACI,KAAsB,EAAE;IAClC,KAAK,CAACA,KAAK,EAAEb,aAAa,EAAE,IAAIH,eAAe,CAAC,CAAC,EAAE,IAAIW,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,EAAErB,aAAa,CAACkB,IAAI,CAAC,CAACI;UACtC,CAAoB,CAAC;QACvB;QACA;IAEJ;EACF;EAEOC,iBAAiBA,CAAA,EAAuB;I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Aa;QACzC,MAAMC,qBAAqB,GAAGpE,kBAAkB,CAACkE,SAAS,CAAC;QAC3D,MAAMG,oBAAoB,GAAG,IAAIC,MAAM,CAAC,WAAWH,aAAa,QAAQ,CAAC;QACzE,MAAMI,mBAAmB,GAAGL,SAAS,CAACM,OAAO,CAACH,oBAAoB,EAAE,IAAI,CAAC;QAEzE,IAAI,CAACJ,WAAW,IAAIE,aAAa,GAAGC,qBAAqB,EAAE;UAAA,IAAAK,eAAA;UACzD,CAAAA,eAAA,GAAC,IAAI,CAAClC,SAAS,cAAAkC,eAAA,eAAfA,eAAA,CAAyBC,cAAc,CAAC;YAAE1B,IAAI,EAAEuB;UAAoB,CAAC,CAAC;QACxE;QAEA,IAAI,CAACP,YAAY,CAACJ,IAAI,CAAC,IAAI,CAAC,CAACW,mBAAmB,EAAE,UAAU,CAAC;MAC/D,CAAE;MACFI,QAAQ,EAAE,IAAI,CAACC,YAAY,CAAChB,IAAI,CAAC,IAAI,CAAE;MACvCiB,qBAAqB,EAAE,IAAI,CAAC/C,MAAM,CAACkB,IAAI,CAAC8B,UAAU,KAAK;IAAO,EAC/D,CACK,CACF,CAAC;EACT;AACF","ignoreList":[]}
@@ -13,7 +13,7 @@ import { DEFAULT_CLASS } from './datetime/datetime.styles';
13
13
  import WebDatePicker from './date-picker.component';
14
14
  import { isNumber, isString } from 'lodash-es';
15
15
  import { ModalConsumer } from '@wavemaker/app-rn-runtime/core/modal.service';
16
- import { validateField } from '@wavemaker/app-rn-runtime/core/utils';
16
+ import { isDateFormatAsPerPattern, validateField } from '@wavemaker/app-rn-runtime/core/utils';
17
17
  import { AccessibilityWidgetType, getAccessibilityProps } from '@wavemaker/app-rn-runtime/core/accessibility';
18
18
  import { FloatingLabel } from '@wavemaker/app-rn-runtime/core/components/floatinglabel.component';
19
19
  import AppI18nService from '@wavemaker/app-rn-runtime/runtime/services/app-i18n.service';
@@ -127,9 +127,15 @@ export default class BaseDatetime extends BaseComponent {
127
127
  case 'mindate':
128
128
  if (isString($new)) {
129
129
  const minDateVal = $new === CURRENT_DATE || $new === CURRENT_TIME ? new Date() : props.mindate;
130
+ // * check if supplied mindate is as per datepattern
131
+ const isMinMatchingPattern = minDateVal ? isDateFormatAsPerPattern(this.momentPattern(props.datepattern), minDateVal) : false;
132
+ // * min date formatted as per datepattern
133
+ const minDatePatternFormatted = minDateVal && isMinMatchingPattern ? moment(moment(minDateVal, this.momentPattern(props.datepattern)).format('YYYY-MM-DD')) : null;
134
+ // * min date formatted as per ISO, if mindate supplied is not as per datepattern
135
+ const formattedMinDate = minDatePatternFormatted && isMinMatchingPattern ? minDatePatternFormatted.toDate() : moment(minDateVal).toDate();
130
136
  this.updateState({
131
137
  props: {
132
- mindate: moment(minDateVal, this.momentPattern(props.datepattern)).toDate()
138
+ mindate: formattedMinDate
133
139
  }
134
140
  });
135
141
  }
@@ -137,9 +143,15 @@ export default class BaseDatetime extends BaseComponent {
137
143
  case 'maxdate':
138
144
  if (isString($new)) {
139
145
  const maxDateVal = $new === CURRENT_DATE || $new === CURRENT_TIME ? new Date() : props.maxdate;
146
+ // * check if supplied maxdate is as per datepattern
147
+ const isMaxMatchingPattern = maxDateVal ? isDateFormatAsPerPattern(this.momentPattern(props.datepattern), maxDateVal) : false;
148
+ // * max date formatted as per datepattern
149
+ const maxDatePatternFormatted = maxDateVal && isMaxMatchingPattern ? moment(moment(maxDateVal, this.momentPattern(props.datepattern)).format('YYYY-MM-DD')) : null;
150
+ // * max date formatted as per ISO, if maxdate supplied is not as per datepattern
151
+ const formattedMaxDate = maxDatePatternFormatted && isMaxMatchingPattern ? maxDatePatternFormatted.toDate() : moment(maxDateVal).toDate();
140
152
  this.updateState({
141
153
  props: {
142
- maxdate: moment(maxDateVal, this.momentPattern(props.datepattern)).toDate()
154
+ maxdate: formattedMaxDate
143
155
  }
144
156
  });
145
157
  }