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AU,CAAEC,QAAS,GAAIC,YAAa,IAEvCF,EAAQC,QAAQ,kBAAoB,CACjCE,EAAGA,IAAMC,EAAQ,MACjBC,MAAO,gBACPC,GAAI,GAEJC,KAAK,EACLC,GAAI,YACJC,EAAG,iBACHC,EAAG,YAEHC,IAAK,GAGLC,GAAI,8BAKRC,OAAOC,aAAeD,OAAOC,cAAgB,GAC7CD,OAAOC,aAAab,QAAO/B,EAAAA,EAAA,GACpB2C,OAAOC,aAAab,SAAW,IAC/BD,EAAQC,SAGXY,OAAOC,aAAaZ,YAAWhC,EAAAA,EAAA,GAC5B2C,OAAOC,aAAaZ,aAAe,IACnCF,EAAQE,aAEY,MAAMa,EAAiB,GAC9BA,EAAe,6DAA+D,CACtFZ,EAAGA,IAAMC,EAAQ,MACjBY,GAAI,sCAEpBH,OAAOC,aAAeD,OAAOC,cAAgB,GAC7CD,OAAOC,aAAaC,eAAc7C,EAAAA,EAAA,GACP2C,OAAOC,aAAaC,gBAAkB,IACtCA,UCtC3BE,EAAOC,QAAU7F","sources":["webpack://Msdyn365.Commerce.Online/./src/modules/eve-form-input/eve-form-input.props.autogenerated.ts?2c26","webpack://Msdyn365.Commerce.Online/./src/modules/eve-form-input/eve-form-input.tsx?578c","webpack://Msdyn365.Commerce.Online/./src/modules/eve-form-input/eve-form-input.view.tsx?2a32","webpack://Msdyn365.Commerce.Online/./src/modules/eve-form/context/FormContext.ts?30cf","webpack://Msdyn365.Commerce.Online/./src/utilities/normalizeName.ts?3142","webpack://Msdyn365.Commerce.Online/./lib/eve-form-input/module-registration.js?f038","webpack://Msdyn365.Commerce.Online/external var \"React\"?0d3b"],"sourcesContent":["/**\r\n * Copyright (c) Microsoft Corporation\r\n * All rights reserved. See License.txt in the project root for license information.\r\n * IEveFormInput contentModule Interface Properties\r\n * THIS FILE IS AUTO-GENERATED - MANUAL MODIFICATIONS WILL BE LOST\r\n */\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\n\r\nexport const enum fieldwidth {\r\n fullWidth = 'fullWidth',\r\n halfWidth = 'halfWidth',\r\n thirdWidth = 'thirdWidth',\r\n twoThirdWidth = 'twoThirdWidth'\r\n}\r\n\r\nexport interface IEveFormInputConfig extends Msdyn365.IModuleConfig {\r\n friendlyName?: string;\r\n name?: string;\r\n validation?: IValidationData;\r\n placeholder?: string;\r\n istextarea?: boolean;\r\n rows?: number;\r\n characterlimit?: number;\r\n fieldwidth?: fieldwidth;\r\n defaultvalue?: string;\r\n}\r\n\r\nexport interface IEveFormInputResources {\r\n defaultError: string;\r\n charactersRemaining: string;\r\n}\r\n\r\nexport interface IValidationData {\r\n regex?: string;\r\n errorMessage?: string;\r\n isRequiredValidation?: boolean;\r\n}\r\n\r\nexport interface IEveFormInputProps extends Msdyn365.IModule {\r\n resources: IEveFormInputResources;\r\n config: IEveFormInputConfig;\r\n}\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport * as React from 'react';\r\nimport { normalizeName } from '../../utilities/normalizeName';\r\nimport { FormContext, IFieldValidation, IFormField } from '../eve-form/context/FormContext';\r\n\r\nimport { IEveFormInputData } from './eve-form-input.data';\r\nimport { fieldwidth, IEveFormInputProps } from './eve-form-input.props.autogenerated';\r\n\r\nexport interface IEveFormInputViewProps extends IEveFormInputPropsExtended {\r\n registeredField: IFormField;\r\n handleChange: () => {};\r\n numCharsRemaining: number;\r\n}\r\n\r\nexport interface IEveFormInputPropsExtended extends IEveFormInputProps {}\r\n\r\n/**\r\n *\r\n * EveFormInput component. A standard text input field.\r\n * @extends {React.PureComponent}\r\n */\r\nclass EveFormInput extends React.PureComponent> {\r\n public static contextType = FormContext;\r\n public declare context: React.ContextType;\r\n private numCharsRemaining: number;\r\n\r\n constructor(props: IEveFormInputProps) {\r\n super(props);\r\n this.handleChange = this.handleChange.bind(this);\r\n this.reset = this.reset.bind(this);\r\n this.numCharsRemaining = props.config.characterlimit ?? 0;\r\n }\r\n\r\n /**\r\n * resets this field.\r\n * @returns void\r\n */\r\n public reset() {\r\n const registeredField = this.context.fields[this.props.config.name ? normalizeName(this.props.config.name) : ''];\r\n registeredField.value = '';\r\n registeredField.errors = [];\r\n }\r\n\r\n /**\r\n * Fires when this component has mounted; prepares validation and registers this field to context.\r\n * @returns void\r\n */\r\n public componentDidMount() {\r\n const {\r\n config: { validation, name, friendlyName },\r\n resources: { defaultError }\r\n } = this.props;\r\n\r\n const validationArray: IFieldValidation[] = [];\r\n\r\n if (validation) {\r\n const validationObject: IFieldValidation = {\r\n regex: validation?.regex ? validation.regex : '',\r\n errorMessage: validation?.errorMessage ? validation.errorMessage : defaultError,\r\n isRequiredValidation: validation?.isRequiredValidation ? validation.isRequiredValidation : false\r\n };\r\n\r\n validationArray.push(validationObject);\r\n }\r\n\r\n this.context.registerField({\r\n isRequired: validation?.isRequiredValidation ? validation.isRequiredValidation : false,\r\n name: name ? name : '',\r\n validation: validationArray,\r\n value: '',\r\n errors: [],\r\n friendly: friendlyName ? friendlyName : '',\r\n reset: this.reset\r\n });\r\n }\r\n\r\n /**\r\n * Updates this fields value in context.\r\n * @param e : React.ChangeEvent\r\n */\r\n private handleChange(e: React.ChangeEvent) {\r\n if (this.props.config.characterlimit) {\r\n this.numCharsRemaining = this.props.config.characterlimit - e.target.value.length;\r\n }\r\n this.context.updateField(\r\n this.props.config.name ? this.props.config.name : '',\r\n e.target.value,\r\n this.props.config.friendlyName ? this.props.config.friendlyName : ''\r\n );\r\n }\r\n\r\n /**\r\n * Returns bootstrap styling based on enum value from module config. This is replicated in all eve-form input modules due to autogenerated definitions.\r\n * @returns string\r\n */\r\n private getWidth(): string {\r\n switch (this.props.config.fieldwidth) {\r\n case fieldwidth.halfWidth:\r\n return 'col-6';\r\n case fieldwidth.thirdWidth:\r\n return 'col-4';\r\n case fieldwidth.twoThirdWidth:\r\n return 'col-8';\r\n case fieldwidth.fullWidth:\r\n default:\r\n return 'col-12';\r\n }\r\n }\r\n\r\n /**\r\n * This renders the module.\r\n * @returns JSX.Element | Null\r\n */\r\n public render(): JSX.Element | null {\r\n const registeredField = this.context.fields[this.props.config.name ? normalizeName(this.props.config.name) : ''];\r\n if (!registeredField) {\r\n return null;\r\n }\r\n return (\r\n
\r\n {this.props.renderView({\r\n ...this.props,\r\n registeredField: registeredField,\r\n handleChange: this.handleChange,\r\n numCharsRemaining: this.numCharsRemaining\r\n })}\r\n
\r\n );\r\n }\r\n}\r\n\r\nexport default EveFormInput;\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport * as React from 'react';\r\nimport { IEveFormInputViewProps } from './eve-form-input';\r\n\r\nexport default (props: IEveFormInputViewProps) => {\r\n if (props.config.istextarea) {\r\n return (\r\n <>\r\n \r\n \r\n {props.config.characterlimit ? (\r\n

\r\n {props.numCharsRemaining} {props.resources.charactersRemaining}\r\n

\r\n ) : (\r\n <>\r\n )}\r\n {props.registeredField.errors.map((err, idx) => (\r\n
\r\n {err}\r\n
\r\n ))}\r\n \r\n );\r\n } else {\r\n return (\r\n <>\r\n \r\n \r\n {props.config.characterlimit ? (\r\n

\r\n {props.numCharsRemaining} {props.resources.charactersRemaining}\r\n

\r\n ) : (\r\n <>\r\n )}\r\n {props.registeredField.errors.map((err, idx) => (\r\n
\r\n {err}\r\n
\r\n ))}\r\n \r\n );\r\n }\r\n};\r\n","/*\r\n * EVENICA FORM CONTEXT\r\n * Author: Michael Reed-Bennet\r\n */\r\n\r\nimport { createContext } from 'react';\r\n\r\n/* INTERFACE: IFormField\r\n * Purpose: Holds individual field information.\r\n */\r\nexport interface IFormField {\r\n name: string;\r\n value: string;\r\n isRequired: boolean;\r\n validation: IFieldValidation[];\r\n errors: string[];\r\n reset: () => void;\r\n friendly: string;\r\n}\r\n\r\n/* INTERFACE: IFieldValidation\r\n * Purpose: Generic Interface for taking validation regexes from individual field modules.\r\n */\r\nexport interface IFieldValidation {\r\n regex: string;\r\n errorMessage: string;\r\n isRequiredValidation?: boolean;\r\n invalidSelection?: string;\r\n}\r\n\r\n/* INTERFACE: IFormContext\r\n * Purpose: Context interface for use with eve-form and it's child modules.\r\n */\r\nexport interface IFormContext {\r\n registerField: (fieldData: IFormField) => void;\r\n updateField: (fieldName: string, fieldValue: string, friendlyName: string) => void;\r\n fields: Record;\r\n}\r\n\r\nconst fields: Record = {};\r\nconst _errorMsg = 'Must be used within a provider';\r\n\r\nconst updateField = (fieldName: string, fieldValue: string, friendlyName: string) => {\r\n throw Error(_errorMsg);\r\n};\r\nconst registerField = (fieldData: IFormField) => {\r\n throw Error(_errorMsg);\r\n};\r\n\r\nexport const FormContext = createContext({ registerField, updateField, fields });\r\n\r\nconst { Consumer: FormConsumer, Provider: FormProvider } = FormContext;\r\nexport { FormConsumer, FormProvider };\r\n","export const normalizeName = (name: string) => name.replace(/ /, '').toLowerCase();\r\n","const binding = { modules: {}, dataActions: {} };\n\n (binding.modules['eve-form-input'] = {\n c: () => require('partner/modules/eve-form-input/eve-form-input.tsx'),\n $type: 'contentModule',\n da: [],\n \n iNM: false,\n ns: '__local__',\n n: 'eve-form-input',\n p: '__local__',\n \n pdp: '',\n \n \n md: 'src/modules/eve-form-input'\n });\n \n\n \n window.__bindings__ = window.__bindings__ || {};\n window.__bindings__.modules = {\n ...window.__bindings__.modules || {},\n ...binding.modules\n };\n \n window.__bindings__.dataActions = {\n ...window.__bindings__.dataActions || {},\n ...binding.dataActions\n };\n export const viewDictionary = {};\n viewDictionary['__local__|__local__|modules|eve-form-input|eve-form-input'] = {\n c: () => require('partner/modules/eve-form-input/eve-form-input.view.tsx'),\n cn: '__local__-__local__-eve-form-input'\n };\nwindow.__bindings__ = window.__bindings__ || {};\nwindow.__bindings__.viewDictionary = {\n ...window.__bindings__.viewDictionary || {},\n ...viewDictionary\n };","module.exports = React;"],"names":["fieldwidth","EveFormInput","React","constructor","props","_props$config$charact","super","this","handleChange","bind","reset","numCharsRemaining","config","characterlimit","registeredField","context","fields","name","normalizeName","value","errors","componentDidMount","validation","friendlyName","resources","defaultError","validationArray","validationObject","regex","errorMessage","isRequiredValidation","push","registerField","isRequired","friendly","e","target","length","updateField","getWidth","halfWidth","thirdWidth","twoThirdWidth","fullWidth","render","className","renderView","_objectSpread","contextType","FormContext","istextarea","htmlFor","id","rows","maxLength","onChange","defaultValue","defaultvalue","placeholder","charactersRemaining","map","err","idx","key","type","_errorMsg","createContext","fieldData","Error","fieldName","fieldValue","Consumer","FormConsumer","Provider","FormProvider","replace","toLowerCase","binding","modules","dataActions","c","require","$type","da","iNM","ns","n","p","pdp","md","window","__bindings__","viewDictionary","cn","module","exports"],"sourceRoot":""}