\r\n
\r\n {/*
*/}\r\n
\r\n
\r\n
\r\n
\r\n

\r\n
\r\n\r\n
\r\n
\r\n
\r\n
\r\n {/*
*/}\r\n
\r\n
\r\n
\r\n
WELCOME
\r\n
{objMenu.sFullUserName}
\r\n
ROLE:\r\n {\r\n objMenu.lstGroupUser && objMenu.lstGroupUser.length > 1 ?\r\n
{objMenu.sGroupUserName}...\r\n : objMenu.sGroupUserName\r\n }\r\n
\r\n
\r\n
\r\n \r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n\r\n
\r\n {Props.children}\r\n
\r\n\r\n
\r\n
\r\n
\r\n

\r\n
\r\n
\r\n
PTT PUBLIC COMPANY LIMITED
\r\n
Copyright © 2020 PTT Public Company Limited All rights reserved
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n\r\n {/* reponsive menu */}\r\n
\r\n \r\n
\r\n \r\n );\r\n};\r\nexport default Layout_Front;\r\n\r\n","import React, { Component } from \"react\";\r\nimport PropTypes from \"prop-types\";\r\nimport FormErrors from \"./formErrors\";\r\nimport { Field } from \"formik\";\r\nimport Select from \"react-select\";\r\nimport makeAnimated from 'react-select/animated';\r\nimport { i18n } from \"../../i18n\";\r\nimport {\r\n components as materialUiComponents,\r\n styles as materialUiStyles,\r\n} from \"./MaterialUI/reactSelectMaterialUi\";\r\nimport { withStyles } from \"@material-ui/core/styles\";\r\nimport InputLabel from '@material-ui/core/InputLabel';\r\nimport { Tune } from \"@material-ui/icons\";\r\nconst animatedComponents = makeAnimated();\r\n\r\nexport class SelectFormItemNotFast extends Component {\r\n value = () => {\r\n const { mode } = this.props;\r\n if (mode === \"multiple\") {\r\n return this.valueMultiple();\r\n } else {\r\n return this.valueOne();\r\n }\r\n };\r\n\r\n valueMultiple = () => {\r\n const { form, name, options } = this.props;\r\n\r\n if (form.values[name]) {\r\n return form.values[name].map((value) =>\r\n options.find((option) => option.value === value)\r\n );\r\n }\r\n\r\n return [];\r\n };\r\n\r\n valueOne = () => {\r\n const { form, name, options } = this.props;\r\n\r\n if (form.values[name]) {\r\n return options.find((option) => option.value === form.values[name]);\r\n }\r\n\r\n return \"\";\r\n };\r\n\r\n handleSelect = (data) => {\r\n const { form, name } = this.props;\r\n form.setFieldTouched(name);\r\n const { mode } = this.props;\r\n if (mode === \"multiple\") {\r\n return this.handleSelectMultiple(data);\r\n } else {\r\n return this.handleSelectOne(data);\r\n }\r\n };\r\n\r\n handleSelectMultiple = (values) => {\r\n const { form, name, onChangeMultiSelect, onBlurMultiSelect } = this.props;\r\n\r\n if (!values) {\r\n form.setFieldValue(name, []);\r\n if (onChangeMultiSelect) {\r\n onChangeMultiSelect(form, []);\r\n }\r\n if (onBlurMultiSelect) {\r\n onBlurMultiSelect(form, []);\r\n }\r\n return;\r\n } else {\r\n if (onChangeMultiSelect) {\r\n onChangeMultiSelect(form, values);\r\n }\r\n if (onBlurMultiSelect) {\r\n onBlurMultiSelect(form, values);\r\n }\r\n }\r\n\r\n form.setFieldValue(\r\n name,\r\n values.map((data) => (data ? data.value : undefined)).filter(Boolean)\r\n );\r\n };\r\n\r\n handleSelectoBlurMultiSelect = (e) => {\r\n const { onBlurMultiSelect } = this.props;\r\n\r\n if (onBlurMultiSelect) {\r\n onBlurMultiSelect(e, this.value());\r\n }\r\n\r\n };\r\n\r\n handleSelectOne = (data) => {\r\n const { form, name, onSetSelect, allValues } = this.props;\r\n if (!data) {\r\n form.setFieldValue(name, '');\r\n form.setFieldTouched(name);\r\n if (onSetSelect) {\r\n // SET VALUE ตรงนึ้\r\n onSetSelect(form, \"\");\r\n }\r\n return;\r\n }\r\n form.setFieldValue(name, data.value);\r\n form.setFieldTouched(name);\r\n if (onSetSelect) {\r\n // SET VALUE ตรงนึ้\r\n onSetSelect(form, data ? data.value : \"\");\r\n }\r\n\r\n };\r\n\r\n render() {\r\n const {\r\n name,\r\n label,\r\n form,\r\n hint,\r\n options,\r\n disable,\r\n errorMessage,\r\n required,\r\n mode,\r\n placeholder,\r\n isClearable,\r\n classes,\r\n onChangeMultiSelect,\r\n onBlurMultiSelect,\r\n menuPortalTarget,\r\n variant\r\n } = this.props;\r\n const isInvalid = !!FormErrors.displayableError(form, name, errorMessage);\r\n\r\n const controlStyles = {\r\n container: (provided) => ({\r\n ...provided,\r\n width: \"100%\",\r\n marginTop: \"16px\",\r\n marginBottom: \"8px\",\r\n\r\n }),\r\n control: (provided) => ({\r\n ...provided,\r\n borderColor: isInvalid ? \"red\" : undefined,\r\n }),\r\n dropdownIndicator: base => ({\r\n ...base,\r\n cursor: \"pointer\"\r\n }),\r\n indicatorsContainer: base => ({\r\n ...base,\r\n cursor: \"pointer\"\r\n }),\r\n };\r\n\r\n\r\n return (\r\n\r\n
} placement=\"bottom\" arrow>\r\n