{"version":3,"file":"form_application-BHPTsML2.js","sources":["../../../app/javascript/old_packs/candidate_form/createDateOptionTags.js","../../../app/javascript/old_packs/candidate_form/createConfirmItems.js","../../../app/javascript/old_packs/candidate_form/changeView.js","../../../app/javascript/old_packs/candidate_form/validators/validateTextLength.js","../../../app/javascript/old_packs/candidate_form/validators/validateTextFormat.js","../../../app/javascript/old_packs/candidate_form/validators/validateRequired.js","../../../app/javascript/old_packs/candidate_form/validateFormData.js","../../../app/javascript/old_packs/candidate_form/showErrorMessages.js","../../../app/javascript/old_packs/candidate_form/show.js"],"sourcesContent":["//年月はまとめてカウンターに渡して生成\nexport const createDateOptionTags = (yearClass, monthClass, dayClass) => {\n const yearTags = document.getElementsByClassName(yearClass);\n const monthTags = document.getElementsByClassName(monthClass);\n const dayTags = document.getElementsByClassName(dayClass);\n if (!yearTags || !monthTags || !dayTags) return;\n [...yearTags].forEach((yearTag, index) => {\n const monthTag = monthTags[index];\n const dayTag = dayTags[index];\n createReverseOptionTags(yearTag, 1900, new Date().getFullYear() + 1);\n createOptionTags(monthTag, 1, 12);\n createDayOptionTags(yearTag, monthTag, dayTag);\n [yearTag, monthTag].forEach((tag) => {\n tag.addEventListener('change', () => createDayOptionTags(yearTag, monthTag, dayTag));\n });\n });\n};\n\nconst createOptionTags = (element, start, end) => {\n element.innerHTML = '';\n let option = document.createElement('option');\n option.value = '';\n option.text = '-';\n element.appendChild(option);\n for (let i = start; i <= end; i++) {\n let option = document.createElement('option');\n option.value = i;\n option.text = i;\n element.appendChild(option);\n }\n};\n\nconst createReverseOptionTags = (element, start, end) => {\n element.innerHTML = '';\n let option = document.createElement('option');\n option.value = '';\n option.text = '-';\n element.appendChild(option);\n for (let i = end; i >= start; i--) {\n let option = document.createElement('option');\n option.value = i;\n option.text = i;\n element.appendChild(option);\n }\n};\n\n//日だけ年月で3パターンを判定してカウンター関数に投げる\nconst createDayOptionTags = (year, month, day) => {\n let februaryDays = checkLeap(year.value) ? 29 : 28;\n\n if (month.value == 2) {\n createOptionTags(day, 1, februaryDays);\n } else if (month.value.match(/^(4|6|9|11)$/)) {\n createOptionTags(day, 1, 30);\n } else {\n createOptionTags(day, 1, 31);\n }\n};\n\n//閏年判定\nconst checkLeap = (year) => (year % 4 == 0 && year % 100 != 0) || year % 400 == 0;\n","export const createConfirmItems = () => {\n const formItems = [...document.getElementsByClassName('js-candidate-form-item')];\n const confirmItems = [...document.getElementsByClassName('js-candidate-form-item-confirm')];\n gon.form_items.forEach((item) => {\n const { id, form_type } = item;\n const target = formItems.filter((items) => parseInt(items.dataset.formId) === id);\n const confirmItem = confirmItems.filter((item) => parseInt(item.dataset.formId) === id);\n if (form_type.includes('check')) {\n const content = [...target].map((elem) => elem.checked && elem.value).filter((e) => e);\n confirmItems.forEach((item) => {\n if (content.includes(item.value)) item.checked = true;\n });\n }\n if (form_type.includes('selectbox')) {\n confirmItem[0].textContent = target[0].options[target[0].selectedIndex].label;\n }\n if (form_type.includes('radio')) {\n const content = [...target].map((elem) => elem.checked && elem.value).filter((e) => e)[0];\n confirmItems.forEach((item) => {\n if (item.value === content) item.checked = true;\n });\n }\n if (form_type.includes('file')) {\n // ファイル\n const list = confirmItem[0];\n list.innerHTML = '';\n const fileInput = document.getElementById('js-candidate-form-files');\n if (!fileInput) return;\n [...fileInput.files].forEach((file) => {\n const li = document.createElement('li');\n li.classList.add('p-form-item-file');\n const p = document.createElement('p');\n p.innerText = file.name;\n p.classList.add('p-form-item-file-name');\n li.appendChild(p);\n list.appendChild(li);\n });\n }\n if (form_type.includes('date')) {\n const year = target.filter((e) => e.classList.contains('js-form-year'))[0].value;\n const month = target.filter((e) => e.classList.contains('js-form-month'))[0].value;\n const day = target.filter((e) => e.classList.contains('js-form-day'))[0].value;\n confirmItem[0].textContent = `${year}年${month}月${day}日`;\n }\n if (form_type.includes('text') || form_type.includes('textarea')) {\n confirmItem[0].textContent = target[0].value;\n }\n });\n};\n","export const showConfirmView = () => {\n const formItemContainers = [...document.getElementsByClassName('js-candidate-form-item')];\n const confirmItemContainers = [\n ...document.getElementsByClassName('js-candidate-form-item-confirm-container'),\n ];\n const formViewButtons = document.getElementById('js-candidate-form-button-edit-view');\n const confirmViewButtons = document.getElementById('js-candidate-form-button-confirm-view');\n formItemContainers.forEach((item) => (item.style.display = 'none'));\n confirmItemContainers.forEach((item) => (item.style.display = 'block'));\n formViewButtons.style.display = 'none';\n confirmViewButtons.style.display = 'flex';\n window.scrollTo({\n top: 0,\n behavior: 'smooth',\n });\n};\n\nexport const showEditView = () => {\n const formItemContainers = [...document.getElementsByClassName('js-candidate-form-item')];\n const confirmItemContainers = [\n ...document.getElementsByClassName('js-candidate-form-item-confirm-container'),\n ];\n const formViewButtons = document.getElementById('js-candidate-form-button-edit-view');\n const confirmViewButtons = document.getElementById('js-candidate-form-button-confirm-view');\n formItemContainers.forEach((item) => (item.style.display = 'block'));\n confirmItemContainers.forEach((item) => (item.style.display = 'none'));\n formViewButtons.style.display = 'flex';\n confirmViewButtons.style.display = 'none';\n window.scrollTo({\n top: 0,\n behavior: 'smooth',\n });\n};\n","export const validateTextLength = ({ form_data, item }) => {\n const { min_length: min, max_length: max, required, form_type } = item;\n\n // テキスト入力じゃない場合はチェックなし\n if (!['text', 'textarea'].includes(form_type)) return false;\n\n // 必須項目ではなくかつ入力もされていない場合チェックなし\n if (!required && form_data == '') return false;\n\n const hasMin = Number.isInteger(min);\n const hasMax = Number.isInteger(max);\n\n // どちらも設定されていない場合チェックなし\n if (!hasMin && !hasMax) return false;\n\n const minText = hasMin ? `${min}文字${hasMax ? 'から' : '以上'}` : '';\n const maxText = hasMax ? `${max}文字まで` : '';\n const length = form_data.length;\n\n // minだけ定義されていて下回っている場合\n if (!hasMax && length < min) return minText;\n\n // maxだけ定義されていてオーバーしている場合\n if (!hasMin && max < length) return maxText;\n\n // どちらも定義されていてmin,maxに収まっていない場合\n if ((hasMin && length < min) || (hasMax && max < length)) return minText + maxText;\n\n // どちらも定義されていて問題ない場合\n return false;\n};\n","import Ajv from 'ajv';\nimport addFormats from 'ajv-formats';\n\n// const hiraganaRegx =\n\nconst format_settings = {\n hiragana: {\n // eslint-disable-next-line no-irregular-whitespace\n pattern: /^[ぁ-んー 、。\\s]*$/,\n },\n katakana: {\n // eslint-disable-next-line no-irregular-whitespace\n pattern: /^[ァ-ヶー ヲ-ン゙゚\\s]*$/,\n },\n number: {\n pattern: /^-?[0-9]+$/,\n },\n tel_hyphen: {\n type: 'string',\n pattern: '[0-9]{2,4}-[0-9]{2,4}-[0-9]{4}',\n },\n tel: {\n type: 'string',\n pattern: '^0[0-9]{9,10}$',\n },\n email: {\n type: 'string',\n format: 'email',\n },\n url: {\n type: 'string',\n format: 'url',\n },\n nothing: {\n type: 'string',\n },\n};\n\nconst typeErrorMessage = {\n hiragana: 'ひらがなで入力してください',\n katakana: 'カタカナで入力してください',\n tel_hyphen: '電話番号(ハイフンあり)を入力してください',\n tel: '電話番号(ハイフンなし)を入力してください',\n number: '数字を入力してください',\n email: 'メールアドレスを入力してください',\n url: 'URLを入力してください',\n nothing: '',\n};\n\nexport const validateTextFormat = ({ form_data, item }) => {\n const { format_type, required } = item;\n\n // 必須項目じゃないかつ入力もされていない場合はチェックなし\n if (form_data === '' && !required) return false;\n\n if (['hiragana', 'katakana', 'number'].includes(format_type)) {\n const valid = format_settings[format_type].pattern.test(form_data);\n return !valid && typeErrorMessage[format_type];\n } else {\n const ajv = new Ajv();\n addFormats(ajv);\n\n const schema = {\n type: 'object',\n properties: {\n form_data: {\n ...format_settings[format_type],\n },\n },\n };\n\n const validate = ajv.compile(schema);\n const valid = validate({ form_data });\n return !valid && typeErrorMessage[format_type];\n }\n};\n","export const validateRequired = ({ form_data, item }) => {\n const { required, form_type } = item;\n if (!required) return false;\n\n if (form_type === 'checkbox') {\n return !form_data.length && '一つ以上選択してください';\n }\n if (form_type === 'file') {\n return !form_data.files.length && '必須項目を選択してください';\n }\n if (['selectbox', 'radio'].includes(form_type)) {\n return !form_data && '必須項目を選択してください';\n }\n if (['text', 'textarea'].includes(form_type)) {\n return !form_data && '必須項目を入力してください';\n }\n if (form_type === 'date') {\n const reg = /^[1-2]\\d{3}-([1-9]|[12]\\d|3[01])-([1-9]|[12]\\d|3[01])$/;\n return !reg.test(form_data) && '必須項目を入力してください';\n }\n};\n","import { validateTextFormat, validateRequired, validateTextLength } from './validators';\n\nexport const validateFormData = ({ target, item }) => {\n let form_data;\n const { id, form_type, order_number } = item;\n if (form_type.includes('checkbox')) {\n form_data = [...target].map((elem) => elem.checked && elem.value).filter((e) => e);\n }\n if (form_type.includes('selectbox')) {\n form_data = target[0].value;\n }\n if (form_type.includes('radio')) {\n form_data = [...target].map((elem) => elem.checked && elem.value).filter((e) => e)[0];\n }\n if (form_type.includes('file')) {\n // ファイル\n form_data = document.getElementById('js-candidate-form-files');\n }\n if (form_type.includes('date')) {\n const year = target.filter((e) => e.className.includes('js-form-year'))[0].value;\n const month = target.filter((e) => e.className.includes('js-form-month'))[0].value;\n const day = target.filter((e) => e.className.includes('js-form-day'))[0].value;\n form_data = !year || !month || !day ? '' : `${year}-${month}-${day}`;\n }\n if (form_type.includes('text') || form_type.includes('textarea')) {\n form_data = target[0].value;\n }\n\n const result = {\n id,\n form_data,\n form_type,\n order_number,\n invaild: [\n validateTextFormat({ form_data, item }),\n validateRequired({ form_data, item }),\n validateTextLength({ form_data, item }),\n ].filter((e) => e),\n };\n return result;\n};\n","export const showErrorMessages = ({ validateResults }) => {\n validateResults.forEach((result) => {\n const { id, invaild } = result;\n const errorTarget = document.querySelector(\n `.js-candidate-form-item-error[data-form-id=\"${id}\"]`\n );\n errorTarget.innerHTML = '';\n invaild.forEach((message) => {\n const p = document.createElement('p');\n p.innerText = message;\n errorTarget.appendChild(p);\n });\n\n const target = [...document.querySelectorAll(`.js-candidate-form-item[data-form-id=\"${id}\"]`)];\n [...target].forEach((e) => e.classList.toggle('isInvaild', invaild.length > 0));\n });\n};\n","import { createDateOptionTags } from './createDateOptionTags';\nimport { createConfirmItems } from './createConfirmItems';\nimport { showConfirmView, showEditView } from './changeView';\nimport { validateFormData } from './validateFormData';\nimport { showErrorMessages } from './showErrorMessages';\n\ndocument.addEventListener('DOMContentLoaded', () => {\n if (!gon?.form_items) return;\n createDateOptionTags('js-form-year', 'js-form-month', 'js-form-day');\n window.formFileData = false;\n const formFileItem = gon.form_items.filter((item) => item.item_type === 'candidate_file')[0];\n if (!formFileItem) return;\n const target = document.getElementsByClassName('js-candidate-file-item')[0];\n if (target) {\n target.addEventListener('change', (e) => {\n const fileInput = document.getElementById('js-candidate-form-files');\n fileInput.files = e?.target?.files;\n });\n }\n});\n\nwindow.showConfirm = () => {\n const validateResults = gon.form_items\n .map((item) => {\n const { id } = item;\n const target = [\n ...document.querySelectorAll(`.js-candidate-form-item[data-form-id=\"${id}\"]`),\n ];\n return validateFormData({ target, item });\n })\n .filter((e) => e);\n showErrorMessages({ validateResults });\n console.log(validateResults);\n const hasInvaildItem = !!validateResults.flatMap((result) => result.invaild).length;\n if (hasInvaildItem) {\n const orderId = Math.min(\n ...validateResults\n .filter((result) => result.invaild.length > 0)\n .map((result) => result.order_number)\n );\n const targetId = validateResults.filter((result) => result.order_number === orderId)?.[0]?.id;\n const target = document.querySelector(`.p-form-box[data-form-id=\"${targetId}\"]`);\n const top = target.offsetTop;\n window.scrollTo({\n top,\n behavior: 'smooth',\n });\n return;\n }\n\n const formResults = validateResults.map(({ id, form_data }) => ({\n item_id: id,\n content: form_data,\n }));\n\n createConfirmItems();\n showConfirmView();\n document.getElementById('candidate_form_results').value = JSON.stringify(formResults);\n};\n\nwindow.backToEditView = () => {\n document.getElementById('candidate_form_results').value = '';\n showEditView();\n};\n\nwindow.submitForm = () => {\n const form = document.forms[0];\n form.submit();\n};\nwindow.backToEditView = () => {\n document.getElementById('candidate_form_results').value = '';\n showEditView();\n};\n\nwindow.submitForm = () => {\n const form = document.forms[0];\n form.submit();\n};\nwindow.backToEditView = () => {\n document.getElementById('candidate_form_results').value = '';\n showEditView();\n};\n\nwindow.submitForm = () => {\n const form = document.forms[0];\n form.submit();\n};\nwindow.backToEditView = () => {\n document.getElementById('candidate_form_results').value = '';\n showEditView();\n};\n\nwindow.submitForm = () => {\n const form = document.forms[0];\n form.submit();\n};\nwindow.backToEditView = () => {\n document.getElementById('candidate_form_results').value = '';\n showEditView();\n};\n\nwindow.submitForm = () => {\n const form = document.forms[0];\n form.submit();\n};\nwindow.backToEditView = () => {\n document.getElementById('candidate_form_results').value = '';\n showEditView();\n};\n\nwindow.submitForm = () => {\n const form = document.forms[0];\n form.submit();\n};\nwindow.backToEditView = () => {\n document.getElementById('candidate_form_results').value = '';\n showEditView();\n};\n\nwindow.submitForm = () => {\n const form = document.forms[0];\n form.submit();\n};\nwindow.backToEditView = () => {\n document.getElementById('candidate_form_results').value = '';\n showEditView();\n};\n\nwindow.submitForm = () => {\n const form = document.forms[0];\n form.submit();\n};\n"],"names":["createDateOptionTags","yearClass","monthClass","dayClass","yearTags","monthTags","dayTags","yearTag","index","monthTag","dayTag","createReverseOptionTags","createOptionTags","createDayOptionTags","tag","element","start","end","option","i","year","month","day","februaryDays","checkLeap","createConfirmItems","formItems","confirmItems","item","id","form_type","target","items","confirmItem","content","elem","e","list","fileInput","file","li","p","showConfirmView","formItemContainers","confirmItemContainers","formViewButtons","confirmViewButtons","showEditView","validateTextLength","form_data","min","max","required","hasMin","hasMax","minText","maxText","length","format_settings","typeErrorMessage","validateTextFormat","format_type","ajv","Ajv","addFormats","schema","validateRequired","validateFormData","order_number","showErrorMessages","validateResults","result","invaild","errorTarget","message","_a","orderId","targetId","_b","top","formResults"],"mappings":"gHACO,MAAMA,EAAuB,CAACC,EAAWC,EAAYC,IAAa,CACvE,MAAMC,EAAW,SAAS,uBAAuBH,CAAS,EACpDI,EAAY,SAAS,uBAAuBH,CAAU,EACtDI,EAAU,SAAS,uBAAuBH,CAAQ,EACpD,CAACC,GAAY,CAACC,GAAa,CAACC,GAChC,CAAC,GAAGF,CAAQ,EAAE,QAAQ,CAACG,EAASC,IAAU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