@mertcankocak/core-project 1.3.0 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/FormikDropdown/FormikDropdown.d.ts +49 -0
- package/dist/components/FormikDropdown/FormikDropdown.d.ts.map +1 -0
- package/dist/components/FormikDropdown/index.d.ts +4 -0
- package/dist/components/FormikDropdown/index.d.ts.map +1 -0
- package/dist/components/FormikDropdown/types.d.ts +9 -0
- package/dist/components/FormikDropdown/types.d.ts.map +1 -0
- package/dist/components/FormikTextField/FormikTextField.d.ts +10 -1
- package/dist/components/FormikTextField/FormikTextField.d.ts.map +1 -1
- package/dist/components/FormikTextField/index.d.ts +2 -0
- package/dist/components/FormikTextField/index.d.ts.map +1 -1
- package/dist/components/FormikTextField/masks.d.ts +28 -0
- package/dist/components/FormikTextField/masks.d.ts.map +1 -0
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/core-project.es.js +1058 -830
- package/dist/core-project.umd.js +10 -10
- package/package.json +18 -16
package/dist/core-project.umd.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(f,Q){typeof exports=="object"&&typeof module<"u"?Q(exports,require("yup"),require("file-type"),require("react"),require("formik"),require("@mui/material"),require("lodash")):typeof define=="function"&&define.amd?define(["exports","yup","file-type","react","formik","@mui/material","lodash"],Q):(f=typeof globalThis<"u"?globalThis:f||self,Q(f.CoreProject={},f.Yup,f.FileType,f.React,f.Formik,f.MaterialUI,f._))})(this,function(f,Q,ze,z,fr,$,cr){"use strict";function dr(t){const i=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const o in t)if(o!=="default"){const u=Object.getOwnPropertyDescriptor(t,o);Object.defineProperty(i,o,u.get?u:{enumerable:!0,get:()=>t[o]})}}return i.default=t,Object.freeze(i)}const A=dr(Q),_e=/^[0-9]{11}$/;function Ae(t){if(!_e.test(t))return!1;const i=t.split("").map(Number);return!(i[0]===0||i.slice(0,9).reduce((l,r)=>l+r,0)%10!==i[9]||i.slice(0,10).reduce((l,r)=>l+r,0)%10!==i[10])}function mr(t){const{required:i=!1,message:o="Geçerli bir T.C. kimlik numarası giriniz",requiredMessage:u="T.C. kimlik numarası zorunludur",name:l="tcKimlikNo"}=t||{};let r=A.string();return i&&(r=r.required(u)),r=r.matches(_e,"T.C. kimlik numarası 11 haneli olmalıdır"),r=r.test({name:l,message:o,test(a){return!i&&(!a||a.trim()==="")?!0:i&&!a||!a||typeof a!="string"?!1:Ae(a)}}),r}const Ie=/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/;function Me(t){return Ie.test(t)}function gr(t){const{required:i=!1,message:o="Geçerli bir email adresi giriniz",requiredMessage:u="Email zorunludur",name:l="email"}=t||{};let r=A.string();return i&&(r=r.required(u)),r=r.email(o).test({name:l,message:o,test(a){return!i&&(!a||a.trim()==="")?!0:i&&!a||!a||typeof a!="string"?!1:Me(a)}}),r}const Fe=/^(\+90\s?)?(0?5\d{2})\s?(\d{3})\s?(\d{2})\s?(\d{2})$/;function Ne(t){const i=t.replace(/\s+/g,"").replace(/[-\+()]/g,"");return i.length!==10&&i.length!==11||!i.match(/^(0?5\d{9})$/)?!1:Fe.test(t)||/^0?5\d{9}$/.test(i)}function hr(t){const{required:i=!1,message:o="Geçerli bir telefon numarası giriniz (05XX XXX XX XX)",requiredMessage:u="Telefon numarası zorunludur",name:l="phone"}=t||{};let r=A.string();return i&&(r=r.required(u)),r=r.test({name:l,message:o,test(a){return!i&&(!a||a.trim()==="")?!0:i&&!a||!a||typeof a!="string"?!1:Ne(a)}}),r}function pr(t,i){const{minLength:o=8,requireUppercase:u=!0,requireLowercase:l=!0,requireNumber:r=!0,requireSpecialChar:a=!0}=i||{},d=[];return t.length<o&&d.push(`Şifre en az ${o} karakter olmalıdır`),u&&!/[A-Z]/.test(t)&&d.push("Şifre en az bir büyük harf içermelidir"),l&&!/[a-z]/.test(t)&&d.push("Şifre en az bir küçük harf içermelidir"),r&&!/\d/.test(t)&&d.push("Şifre en az bir rakam içermelidir"),a&&!/[!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?]/.test(t)&&d.push("Şifre en az bir özel karakter içermelidir"),{isValid:d.length===0,errors:d}}function vr(t){const{required:i=!1,requiredMessage:o="Şifre zorunludur",minLength:u=8,requireUppercase:l=!0,requireLowercase:r=!0,requireNumber:a=!0,requireSpecialChar:d=!0,minLengthMessage:h=`Şifre en az ${u} karakter olmalıdır`,uppercaseMessage:S="Şifre en az bir büyük harf içermelidir",lowercaseMessage:R="Şifre en az bir küçük harf içermelidir",numberMessage:b="Şifre en az bir rakam içermelidir",specialCharMessage:E="Şifre en az bir özel karakter içermelidir"}=t||{};let p=A.string();return i&&(p=p.required(o)),p=p.min(u,h),l&&(p=p.matches(/[A-Z]/,S)),r&&(p=p.matches(/[a-z]/,R)),a&&(p=p.matches(/\d/,b)),d&&(p=p.matches(/[!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?]/,E)),p}function yr(t,i){const{required:o=!1,message:u="Şifreler eşleşmiyor",requiredMessage:l="Şifre tekrarı zorunludur"}=i||{};let r=A.string();return o&&(r=r.required(l)),r=r.oneOf([A.ref(t)],u),r}const Re=/^[a-zA-ZçğıöşüÇĞIİÖŞÜ\s]+$/;function xe(t){return!t||t.trim().length===0||t.trim().length<2?!1:Re.test(t)}function Er(t){const{required:i=!1,message:o="İsim sadece harf içermelidir",requiredMessage:u="İsim zorunludur",name:l="name"}=t||{};let r=A.string();return i&&(r=r.required(u)),r=r.min(2,"İsim en az 2 karakter olmalıdır").matches(Re,o).test({name:l,message:o,test(a){return!i&&(!a||a.trim()==="")?!0:i&&!a||!a||typeof a!="string"?!1:xe(a)}}),r}const qe=/^TR\d{2}[0-9A-Z]{4}\d{1}[0-9A-Z]{15,30}$/i;function Be(t){const i=t.replace(/\s+/g,"").toUpperCase();if(!qe.test(i))return!1;const u=(i.slice(4)+i.slice(0,4)).split("").map(r=>{const a=r.charCodeAt(0);return a>=65&&a<=90?a-55:r}).join("");return BigInt(u)%BigInt(97)===BigInt(1)}function br(t){const{required:i=!1,message:o="Geçerli bir IBAN numarası giriniz",requiredMessage:u="IBAN zorunludur",name:l="iban"}=t||{};let r=A.string();return i&&(r=r.required(u)),r=r.test({name:l,message:o,test(a){return!i&&(!a||a.trim()==="")?!0:i&&!a||!a||typeof a!="string"?!1:Be(a)}}),r}const Le=/^\d{13,19}$/;function Ve(t){const i=t.replace(/\s+/g,"").replace(/-/g,"");if(!Le.test(i))return!1;let o=0,u=!1;for(let l=i.length-1;l>=0;l--){let r=parseInt(i[l],10);u&&(r*=2,r>9&&(r-=9)),o+=r,u=!u}return o%10===0}function _r(t){const{required:i=!1,message:o="Geçerli bir kredi kartı numarası giriniz",requiredMessage:u="Kredi kartı numarası zorunludur",name:l="creditCard"}=t||{};let r=A.string();return i&&(r=r.required(u)),r=r.test({name:l,message:o,test(a){return!i&&(!a||a.trim()==="")?!0:i&&!a||!a||typeof a!="string"?!1:Ve(a)}}),r}const Ge=/^\d{10}$/;function $e(t){if(!Ge.test(t))return!1;const i=t.split("").map(Number);return i.slice(0,9).reduce((l,r,a)=>{const d=(a+1)%9||9;return l+r*d},0)%11%10===i[9]}function Rr(t){const{required:i=!1,message:o="Geçerli bir VKN (Vergi Kimlik Numarası) giriniz",requiredMessage:u="VKN zorunludur",name:l="vkn"}=t||{};let r=A.string();return i&&(r=r.required(u)),r=r.test({name:l,message:o,test(a){return!i&&(!a||a.trim()==="")?!0:i&&!a||!a||typeof a!="string"?!1:$e(a)}}),r}const Te=/^(\d{2})\s?([A-ZÇĞIİÖŞÜ]{1,3})\s?(\d{2,4})$/i;function Ue(t){const i=t.replace(/\s+/g," ").trim().toUpperCase();if(!Te.test(i))return!1;const o=i.match(Te);if(!o)return!1;const[,u,l,r]=o,a=parseInt(u,10);return!(a<1||a>81||l.length<1||l.length>3||r.length<2||r.length>4)}function Tr(t){const{required:i=!1,message:o="Geçerli bir araç plakası giriniz (örn: 34 ABC 123)",requiredMessage:u="Araç plakası zorunludur",name:l="plate"}=t||{};let r=A.string();return i&&(r=r.required(u)),r=r.test({name:l,message:o,test(a){return!i&&(!a||a.trim()==="")?!0:i&&!a||!a||typeof a!="string"?!1:Ue(a)}}),r}function ee(t){const i=t.split(".");return i.length>1?i[i.length-1].toLowerCase():""}async function kr(t,i){const{maxSize:o,minSize:u,allowedExtensions:l=[],allowedMimeTypes:r=[]}=i||{},a=[];if(o&&t.size>o){const d=(o/1048576).toFixed(2);a.push(`Dosya boyutu en fazla ${d} MB olmalıdır`)}if(u&&t.size<u){const d=(u/1048576).toFixed(2);a.push(`Dosya boyutu en az ${d} MB olmalıdır`)}if(l.length>0&&r.length===0&&console.warn("⚠️ UYARI: Sadece dosya uzantısı kontrolü yapılıyor. Güvenlik için 'allowedMimeTypes' parametresini kullanarak magic bytes kontrolü yapmanız önerilir."),l.length>0&&t instanceof File){const d=ee(t.name);l.includes(d)||a.push(`İzin verilen dosya uzantıları: ${l.join(", ")}`)}if(r.length>0)try{const d=await t.arrayBuffer(),h=new Uint8Array(d),S=await ze.fileTypeFromBuffer(h);S?r.includes(S.mime)||a.push(`Dosya tipi uyumsuz. Beklenen: ${r.join(", ")}, Tespit edilen: ${S.mime}. (Dosya uzantısı: ${t instanceof File?ee(t.name):"bilinmiyor"})`):a.push("Dosya tipi belirlenemedi. Dosya bozuk olabilir veya desteklenmeyen bir formatta olabilir.")}catch{a.push("Dosya tipi kontrol edilemedi. Dosya okunamadı.")}return{isValid:a.length===0,errors:a}}function Sr(t){const{required:i=!1,message:o="Geçerli bir dosya seçiniz",requiredMessage:u="Dosya zorunludur",name:l="file",maxSize:r,minSize:a,allowedExtensions:d=[],allowedMimeTypes:h=[],sizeMessage:S,extensionMessage:R}=t||{};let b=A.mixed();return i&&(b=b.required(u)),b=b.test({name:l,message:o||"Geçerli bir dosya seçiniz",async test(E){if(!i&&!E)return!0;if(i&&!E||!(E instanceof File))return!1;if(r&&E.size>r){const p=(r/1048576).toFixed(2);return this.createError({message:S||`Dosya boyutu en fazla ${p} MB olmalıdır`})}if(a&&E.size<a){const p=(a/1048576).toFixed(2);return this.createError({message:S||`Dosya boyutu en az ${p} MB olmalıdır`})}if(d.length>0){const p=ee(E.name);if(!d.includes(p))return this.createError({message:R||`İzin verilen dosya uzantıları: ${d.join(", ")}`})}if(h.length>0)try{const p=await E.arrayBuffer(),L=new Uint8Array(p),F=await ze.fileTypeFromBuffer(L);if(!F)return this.createError({message:"Dosya tipi belirlenemedi. Dosya bozuk olabilir veya desteklenmeyen bir formatta olabilir."});if(!h.includes(F.mime)){const ne=ee(E.name);return this.createError({message:`Dosya tipi uyumsuz. Beklenen: ${h.join(", ")}, Tespit edilen: ${F.mime}. (Dosya uzantısı: ${ne})`})}}catch{return this.createError({message:"Dosya tipi kontrol edilemedi. Dosya okunamadı."})}return!0}}),b}function Cr(t,i){const{minDate:o,maxDate:u}=i||{},l=typeof t=="string"?new Date(t):t;if(isNaN(l.getTime()))return{isValid:!1,error:"Geçersiz tarih formatı"};if(o){const r=typeof o=="string"?new Date(o):o;if(l<r)return{isValid:!1,error:`Tarih ${r.toLocaleDateString("tr-TR")} tarihinden sonra olmalıdır`}}if(u){const r=typeof u=="string"?new Date(u):u;if(l>r)return{isValid:!1,error:`Tarih ${r.toLocaleDateString("tr-TR")} tarihinden önce olmalıdır`}}return{isValid:!0}}function ke(t){const{required:i=!1,requiredMessage:o="Tarih zorunludur",minDate:u,maxDate:l,minDateMessage:r,maxDateMessage:a}=t||{};let d=A.date();if(i&&(d=d.required(o)),u){const h=typeof u=="string"?new Date(u):u;d=d.min(h,r||`Tarih ${h.toLocaleDateString("tr-TR")} tarihinden sonra olmalıdır`)}if(l){const h=typeof l=="string"?new Date(l):l;d=d.max(h,a||`Tarih ${h.toLocaleDateString("tr-TR")} tarihinden önce olmalıdır`)}return d}function Dr(t){return ke({...t,maxDate:new Date,maxDateMessage:(t==null?void 0:t.message)||"Tarih geçmiş bir tarih olmalıdır"})}function wr(t){return ke({...t,minDate:new Date,minDateMessage:(t==null?void 0:t.message)||"Tarih gelecek bir tarih olmalıdır"})}var Se={exports:{}},re={};/**
|
|
1
|
+
(function(c,me){typeof exports=="object"&&typeof module<"u"?me(exports,require("yup"),require("file-type"),require("react"),require("formik"),require("@mui/material"),require("@mui/icons-material"),require("lodash")):typeof define=="function"&&define.amd?define(["exports","yup","file-type","react","formik","@mui/material","@mui/icons-material","lodash"],me):(c=typeof globalThis<"u"?globalThis:c||self,me(c.CoreProject={},c.Yup,c.FileType,c.React,c.Formik,c.MaterialUI,c.MaterialUIIcons,c._))})(this,function(c,me,Fe,S,$e,M,Ne,pr){"use strict";function vr(t){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const r in t)if(r!=="default"){const u=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(n,r,u.get?u:{enumerable:!0,get:()=>t[r]})}}return n.default=t,Object.freeze(n)}const N=vr(me),De=/^[0-9]{11}$/;function Be(t){if(!De.test(t))return!1;const n=t.split("").map(Number);return!(n[0]===0||n.slice(0,9).reduce((l,i)=>l+i,0)%10!==n[9]||n.slice(0,10).reduce((l,i)=>l+i,0)%10!==n[10])}function yr(t){const{required:n=!1,message:r="Geçerli bir T.C. kimlik numarası giriniz",requiredMessage:u="T.C. kimlik numarası zorunludur",name:l="tcKimlikNo"}=t||{};let i=N.string();return n&&(i=i.required(u)),i=i.matches(De,"T.C. kimlik numarası 11 haneli olmalıdır"),i=i.test({name:l,message:r,test(a){return!n&&(!a||a.trim()==="")?!0:n&&!a||!a||typeof a!="string"?!1:Be(a)}}),i}const Le=/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/;function Ve(t){return Le.test(t)}function br(t){const{required:n=!1,message:r="Geçerli bir email adresi giriniz",requiredMessage:u="Email zorunludur",name:l="email"}=t||{};let i=N.string();return n&&(i=i.required(u)),i=i.email(r).test({name:l,message:r,test(a){return!n&&(!a||a.trim()==="")?!0:n&&!a||!a||typeof a!="string"?!1:Ve(a)}}),i}const Ge=/^(\+90\s?)?(0?5\d{2})\s?(\d{3})\s?(\d{2})\s?(\d{2})$/;function qe(t){const n=t.replace(/\s+/g,"").replace(/[-\+()]/g,"");return n.length!==10&&n.length!==11||!n.match(/^(0?5\d{9})$/)?!1:Ge.test(t)||/^0?5\d{9}$/.test(n)}function Er(t){const{required:n=!1,message:r="Geçerli bir telefon numarası giriniz (05XX XXX XX XX)",requiredMessage:u="Telefon numarası zorunludur",name:l="phone"}=t||{};let i=N.string();return n&&(i=i.required(u)),i=i.test({name:l,message:r,test(a){return!n&&(!a||a.trim()==="")?!0:n&&!a||!a||typeof a!="string"?!1:qe(a)}}),i}function _r(t,n){const{minLength:r=8,requireUppercase:u=!0,requireLowercase:l=!0,requireNumber:i=!0,requireSpecialChar:a=!0}=n||{},f=[];return t.length<r&&f.push(`Şifre en az ${r} karakter olmalıdır`),u&&!/[A-Z]/.test(t)&&f.push("Şifre en az bir büyük harf içermelidir"),l&&!/[a-z]/.test(t)&&f.push("Şifre en az bir küçük harf içermelidir"),i&&!/\d/.test(t)&&f.push("Şifre en az bir rakam içermelidir"),a&&!/[!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?]/.test(t)&&f.push("Şifre en az bir özel karakter içermelidir"),{isValid:f.length===0,errors:f}}function Rr(t){const{required:n=!1,requiredMessage:r="Şifre zorunludur",minLength:u=8,requireUppercase:l=!0,requireLowercase:i=!0,requireNumber:a=!0,requireSpecialChar:f=!0,minLengthMessage:h=`Şifre en az ${u} karakter olmalıdır`,uppercaseMessage:P="Şifre en az bir büyük harf içermelidir",lowercaseMessage:T="Şifre en az bir küçük harf içermelidir",numberMessage:k="Şifre en az bir rakam içermelidir",specialCharMessage:R="Şifre en az bir özel karakter içermelidir"}=t||{};let v=N.string();return n&&(v=v.required(r)),v=v.min(u,h),l&&(v=v.matches(/[A-Z]/,P)),i&&(v=v.matches(/[a-z]/,T)),a&&(v=v.matches(/\d/,k)),f&&(v=v.matches(/[!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?]/,R)),v}function Tr(t,n){const{required:r=!1,message:u="Şifreler eşleşmiyor",requiredMessage:l="Şifre tekrarı zorunludur"}=n||{};let i=N.string();return r&&(i=i.required(l)),i=i.oneOf([N.ref(t)],u),i}const Ce=/^[a-zA-ZçğıöşüÇĞIİÖŞÜ\s]+$/;function Ue(t){return!t||t.trim().length===0||t.trim().length<2?!1:Ce.test(t)}function kr(t){const{required:n=!1,message:r="İsim sadece harf içermelidir",requiredMessage:u="İsim zorunludur",name:l="name"}=t||{};let i=N.string();return n&&(i=i.required(u)),i=i.min(2,"İsim en az 2 karakter olmalıdır").matches(Ce,r).test({name:l,message:r,test(a){return!n&&(!a||a.trim()==="")?!0:n&&!a||!a||typeof a!="string"?!1:Ue(a)}}),i}const Xe=/^TR\d{2}[0-9A-Z]{4}\d{1}[0-9A-Z]{15,30}$/i;function Ke(t){const n=t.replace(/\s+/g,"").toUpperCase();if(!Xe.test(n))return!1;const u=(n.slice(4)+n.slice(0,4)).split("").map(i=>{const a=i.charCodeAt(0);return a>=65&&a<=90?a-55:i}).join("");return BigInt(u)%BigInt(97)===BigInt(1)}function Sr(t){const{required:n=!1,message:r="Geçerli bir IBAN numarası giriniz",requiredMessage:u="IBAN zorunludur",name:l="iban"}=t||{};let i=N.string();return n&&(i=i.required(u)),i=i.test({name:l,message:r,test(a){return!n&&(!a||a.trim()==="")?!0:n&&!a||!a||typeof a!="string"?!1:Ke(a)}}),i}const Ye=/^\d{13,19}$/;function We(t){const n=t.replace(/\s+/g,"").replace(/-/g,"");if(!Ye.test(n))return!1;let r=0,u=!1;for(let l=n.length-1;l>=0;l--){let i=parseInt(n[l],10);u&&(i*=2,i>9&&(i-=9)),r+=i,u=!u}return r%10===0}function Dr(t){const{required:n=!1,message:r="Geçerli bir kredi kartı numarası giriniz",requiredMessage:u="Kredi kartı numarası zorunludur",name:l="creditCard"}=t||{};let i=N.string();return n&&(i=i.required(u)),i=i.test({name:l,message:r,test(a){return!n&&(!a||a.trim()==="")?!0:n&&!a||!a||typeof a!="string"?!1:We(a)}}),i}const Ze=/^\d{10}$/;function He(t){if(!Ze.test(t))return!1;const n=t.split("").map(Number);return n.slice(0,9).reduce((l,i,a)=>{const f=(a+1)%9||9;return l+i*f},0)%11%10===n[9]}function Cr(t){const{required:n=!1,message:r="Geçerli bir VKN (Vergi Kimlik Numarası) giriniz",requiredMessage:u="VKN zorunludur",name:l="vkn"}=t||{};let i=N.string();return n&&(i=i.required(u)),i=i.test({name:l,message:r,test(a){return!n&&(!a||a.trim()==="")?!0:n&&!a||!a||typeof a!="string"?!1:He(a)}}),i}const we=/^(\d{2})\s?([A-ZÇĞIİÖŞÜ]{1,3})\s?(\d{2,4})$/i;function Je(t){const n=t.replace(/\s+/g," ").trim().toUpperCase();if(!we.test(n))return!1;const r=n.match(we);if(!r)return!1;const[,u,l,i]=r,a=parseInt(u,10);return!(a<1||a>81||l.length<1||l.length>3||i.length<2||i.length>4)}function wr(t){const{required:n=!1,message:r="Geçerli bir araç plakası giriniz (örn: 34 ABC 123)",requiredMessage:u="Araç plakası zorunludur",name:l="plate"}=t||{};let i=N.string();return n&&(i=i.required(u)),i=i.test({name:l,message:r,test(a){return!n&&(!a||a.trim()==="")?!0:n&&!a||!a||typeof a!="string"?!1:Je(a)}}),i}function he(t){const n=t.split(".");return n.length>1?n[n.length-1].toLowerCase():""}async function Pr(t,n){const{maxSize:r,minSize:u,allowedExtensions:l=[],allowedMimeTypes:i=[]}=n||{},a=[];if(r&&t.size>r){const f=(r/1048576).toFixed(2);a.push(`Dosya boyutu en fazla ${f} MB olmalıdır`)}if(u&&t.size<u){const f=(u/1048576).toFixed(2);a.push(`Dosya boyutu en az ${f} MB olmalıdır`)}if(l.length>0&&i.length===0&&console.warn("⚠️ UYARI: Sadece dosya uzantısı kontrolü yapılıyor. Güvenlik için 'allowedMimeTypes' parametresini kullanarak magic bytes kontrolü yapmanız önerilir."),l.length>0&&t instanceof File){const f=he(t.name);l.includes(f)||a.push(`İzin verilen dosya uzantıları: ${l.join(", ")}`)}if(i.length>0)try{const f=await t.arrayBuffer(),h=new Uint8Array(f),P=await Fe.fileTypeFromBuffer(h);P?i.includes(P.mime)||a.push(`Dosya tipi uyumsuz. Beklenen: ${i.join(", ")}, Tespit edilen: ${P.mime}. (Dosya uzantısı: ${t instanceof File?he(t.name):"bilinmiyor"})`):a.push("Dosya tipi belirlenemedi. Dosya bozuk olabilir veya desteklenmeyen bir formatta olabilir.")}catch{a.push("Dosya tipi kontrol edilemedi. Dosya okunamadı.")}return{isValid:a.length===0,errors:a}}function jr(t){const{required:n=!1,message:r="Geçerli bir dosya seçiniz",requiredMessage:u="Dosya zorunludur",name:l="file",maxSize:i,minSize:a,allowedExtensions:f=[],allowedMimeTypes:h=[],sizeMessage:P,extensionMessage:T}=t||{};let k=N.mixed();return n&&(k=k.required(u)),k=k.test({name:l,message:r||"Geçerli bir dosya seçiniz",async test(R){if(!n&&!R)return!0;if(n&&!R||!(R instanceof File))return!1;if(i&&R.size>i){const v=(i/1048576).toFixed(2);return this.createError({message:P||`Dosya boyutu en fazla ${v} MB olmalıdır`})}if(a&&R.size<a){const v=(a/1048576).toFixed(2);return this.createError({message:P||`Dosya boyutu en az ${v} MB olmalıdır`})}if(f.length>0){const v=he(R.name);if(!f.includes(v))return this.createError({message:T||`İzin verilen dosya uzantıları: ${f.join(", ")}`})}if(h.length>0)try{const v=await R.arrayBuffer(),K=new Uint8Array(v),z=await Fe.fileTypeFromBuffer(K);if(!z)return this.createError({message:"Dosya tipi belirlenemedi. Dosya bozuk olabilir veya desteklenmeyen bir formatta olabilir."});if(!h.includes(z.mime)){const ee=he(R.name);return this.createError({message:`Dosya tipi uyumsuz. Beklenen: ${h.join(", ")}, Tespit edilen: ${z.mime}. (Dosya uzantısı: ${ee})`})}}catch{return this.createError({message:"Dosya tipi kontrol edilemedi. Dosya okunamadı."})}return!0}}),k}function Or(t,n){const{minDate:r,maxDate:u}=n||{},l=typeof t=="string"?new Date(t):t;if(isNaN(l.getTime()))return{isValid:!1,error:"Geçersiz tarih formatı"};if(r){const i=typeof r=="string"?new Date(r):r;if(l<i)return{isValid:!1,error:`Tarih ${i.toLocaleDateString("tr-TR")} tarihinden sonra olmalıdır`}}if(u){const i=typeof u=="string"?new Date(u):u;if(l>i)return{isValid:!1,error:`Tarih ${i.toLocaleDateString("tr-TR")} tarihinden önce olmalıdır`}}return{isValid:!0}}function Pe(t){const{required:n=!1,requiredMessage:r="Tarih zorunludur",minDate:u,maxDate:l,minDateMessage:i,maxDateMessage:a}=t||{};let f=N.date();if(n&&(f=f.required(r)),u){const h=typeof u=="string"?new Date(u):u;f=f.min(h,i||`Tarih ${h.toLocaleDateString("tr-TR")} tarihinden sonra olmalıdır`)}if(l){const h=typeof l=="string"?new Date(l):l;f=f.max(h,a||`Tarih ${h.toLocaleDateString("tr-TR")} tarihinden önce olmalıdır`)}return f}function Ar(t){return Pe({...t,maxDate:new Date,maxDateMessage:(t==null?void 0:t.message)||"Tarih geçmiş bir tarih olmalıdır"})}function zr(t){return Pe({...t,minDate:new Date,minDateMessage:(t==null?void 0:t.message)||"Tarih gelecek bir tarih olmalıdır"})}var je={exports:{}},ge={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* react-jsx-runtime.production.min.js
|
|
4
4
|
*
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var
|
|
9
|
+
*/var Qe;function Ir(){if(Qe)return ge;Qe=1;var t=S,n=Symbol.for("react.element"),r=Symbol.for("react.fragment"),u=Object.prototype.hasOwnProperty,l=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};function a(f,h,P){var T,k={},R=null,v=null;P!==void 0&&(R=""+P),h.key!==void 0&&(R=""+h.key),h.ref!==void 0&&(v=h.ref);for(T in h)u.call(h,T)&&!i.hasOwnProperty(T)&&(k[T]=h[T]);if(f&&f.defaultProps)for(T in h=f.defaultProps,h)k[T]===void 0&&(k[T]=h[T]);return{$$typeof:n,type:f,key:R,ref:v,props:k,_owner:l.current}}return ge.Fragment=r,ge.jsx=a,ge.jsxs=a,ge}var pe={};/**
|
|
10
10
|
* @license React
|
|
11
11
|
* react-jsx-runtime.development.js
|
|
12
12
|
*
|
|
@@ -14,17 +14,17 @@
|
|
|
14
14
|
*
|
|
15
15
|
* This source code is licensed under the MIT license found in the
|
|
16
16
|
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var
|
|
18
|
-
`+
|
|
19
|
-
`),
|
|
20
|
-
`),
|
|
21
|
-
`+m[
|
|
17
|
+
*/var er;function Mr(){return er||(er=1,process.env.NODE_ENV!=="production"&&function(){var t=S,n=Symbol.for("react.element"),r=Symbol.for("react.portal"),u=Symbol.for("react.fragment"),l=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),f=Symbol.for("react.context"),h=Symbol.for("react.forward_ref"),P=Symbol.for("react.suspense"),T=Symbol.for("react.suspense_list"),k=Symbol.for("react.memo"),R=Symbol.for("react.lazy"),v=Symbol.for("react.offscreen"),K=Symbol.iterator,z="@@iterator";function ee(e){if(e===null||typeof e!="object")return null;var s=K&&e[K]||e[z];return typeof s=="function"?s:null}var U=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function E(e){{for(var s=arguments.length,o=new Array(s>1?s-1:0),d=1;d<s;d++)o[d-1]=arguments[d];Y("error",e,o)}}function Y(e,s,o){{var d=U.ReactDebugCurrentFrame,b=d.getStackAddendum();b!==""&&(s+="%s",o=o.concat([b]));var _=o.map(function(p){return String(p)});_.unshift("Warning: "+s),Function.prototype.apply.call(console[e],console,_)}}var se=!1,re=!1,W=!1,O=!1,X=!1,V;V=Symbol.for("react.module.reference");function Z(e){return!!(typeof e=="string"||typeof e=="function"||e===u||e===i||X||e===l||e===P||e===T||O||e===v||se||re||W||typeof e=="object"&&e!==null&&(e.$$typeof===R||e.$$typeof===k||e.$$typeof===a||e.$$typeof===f||e.$$typeof===h||e.$$typeof===V||e.getModuleId!==void 0))}function te(e,s,o){var d=e.displayName;if(d)return d;var b=s.displayName||s.name||"";return b!==""?o+"("+b+")":o}function H(e){return e.displayName||"Context"}function I(e){if(e==null)return null;if(typeof e.tag=="number"&&E("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case u:return"Fragment";case r:return"Portal";case i:return"Profiler";case l:return"StrictMode";case P:return"Suspense";case T:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case f:var s=e;return H(s)+".Consumer";case a:var o=e;return H(o._context)+".Provider";case h:return te(e,e.render,"ForwardRef");case k:var d=e.displayName||null;return d!==null?d:I(e.type)||"Memo";case R:{var b=e,_=b._payload,p=b._init;try{return I(p(_))}catch{return null}}}return null}var g=Object.assign,y=0,B,G,x,ne,_e,oe,ve;function ye(){}ye.__reactDisabledLog=!0;function Oe(){{if(y===0){B=console.log,G=console.info,x=console.warn,ne=console.error,_e=console.group,oe=console.groupCollapsed,ve=console.groupEnd;var e={configurable:!0,enumerable:!0,value:ye,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}y++}}function Re(){{if(y--,y===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:g({},e,{value:B}),info:g({},e,{value:G}),warn:g({},e,{value:x}),error:g({},e,{value:ne}),group:g({},e,{value:_e}),groupCollapsed:g({},e,{value:oe}),groupEnd:g({},e,{value:ve})})}y<0&&E("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var J=U.ReactCurrentDispatcher,be;function q(e,s,o){{if(be===void 0)try{throw Error()}catch(b){var d=b.stack.trim().match(/\n( *(at )?)/);be=d&&d[1]||""}return`
|
|
18
|
+
`+be+e}}var Q=!1,ue;{var Ee=typeof WeakMap=="function"?WeakMap:Map;ue=new Ee}function ie(e,s){if(!e||Q)return"";{var o=ue.get(e);if(o!==void 0)return o}var d;Q=!0;var b=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var _;_=J.current,J.current=null,Oe();try{if(s){var p=function(){throw Error()};if(Object.defineProperty(p.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(p,[])}catch($){d=$}Reflect.construct(e,[],p)}else{try{p.call()}catch($){d=$}e.call(p.prototype)}}else{try{throw Error()}catch($){d=$}e()}}catch($){if($&&d&&typeof $.stack=="string"){for(var m=$.stack.split(`
|
|
19
|
+
`),F=d.stack.split(`
|
|
20
|
+
`),j=m.length-1,A=F.length-1;j>=1&&A>=0&&m[j]!==F[A];)A--;for(;j>=1&&A>=0;j--,A--)if(m[j]!==F[A]){if(j!==1||A!==1)do if(j--,A--,A<0||m[j]!==F[A]){var L=`
|
|
21
|
+
`+m[j].replace(" at new "," at ");return e.displayName&&L.includes("<anonymous>")&&(L=L.replace("<anonymous>",e.displayName)),typeof e=="function"&&ue.set(e,L),L}while(j>=1&&A>=0);break}}}finally{Q=!1,J.current=_,Re(),Error.prepareStackTrace=b}var de=e?e.displayName||e.name:"",ae=de?q(de):"";return typeof e=="function"&&ue.set(e,ae),ae}function Te(e,s,o){return ie(e,!1)}function le(e){var s=e.prototype;return!!(s&&s.isReactComponent)}function ce(e,s,o){if(e==null)return"";if(typeof e=="function")return ie(e,le(e));if(typeof e=="string")return q(e);switch(e){case P:return q("Suspense");case T:return q("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case h:return Te(e.render);case k:return ce(e.type,s,o);case R:{var d=e,b=d._payload,_=d._init;try{return ce(_(b),s,o)}catch{}}}return""}var D=Object.prototype.hasOwnProperty,w={},ke=U.ReactDebugCurrentFrame;function Se(e){if(e){var s=e._owner,o=ce(e.type,e._source,s?s.type:null);ke.setExtraStackFrame(o)}else ke.setExtraStackFrame(null)}function Kr(e,s,o,d,b){{var _=Function.call.bind(D);for(var p in e)if(_(e,p)){var m=void 0;try{if(typeof e[p]!="function"){var F=Error((d||"React class")+": "+o+" type `"+p+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[p]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw F.name="Invariant Violation",F}m=e[p](s,p,d,o,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(j){m=j}m&&!(m instanceof Error)&&(Se(b),E("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",d||"React class",o,p,typeof m),Se(null)),m instanceof Error&&!(m.message in w)&&(w[m.message]=!0,Se(b),E("Failed %s type: %s",o,m.message),Se(null))}}}var Yr=Array.isArray;function Ae(e){return Yr(e)}function Wr(e){{var s=typeof Symbol=="function"&&Symbol.toStringTag,o=s&&e[Symbol.toStringTag]||e.constructor.name||"Object";return o}}function Zr(e){try{return ir(e),!1}catch{return!0}}function ir(e){return""+e}function ar(e){if(Zr(e))return E("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Wr(e)),ir(e)}var sr=U.ReactCurrentOwner,Hr={key:!0,ref:!0,__self:!0,__source:!0},or,ur;function Jr(e){if(D.call(e,"ref")){var s=Object.getOwnPropertyDescriptor(e,"ref").get;if(s&&s.isReactWarning)return!1}return e.ref!==void 0}function Qr(e){if(D.call(e,"key")){var s=Object.getOwnPropertyDescriptor(e,"key").get;if(s&&s.isReactWarning)return!1}return e.key!==void 0}function et(e,s){typeof e.ref=="string"&&sr.current}function rt(e,s){{var o=function(){or||(or=!0,E("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",s))};o.isReactWarning=!0,Object.defineProperty(e,"key",{get:o,configurable:!0})}}function tt(e,s){{var o=function(){ur||(ur=!0,E("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",s))};o.isReactWarning=!0,Object.defineProperty(e,"ref",{get:o,configurable:!0})}}var nt=function(e,s,o,d,b,_,p){var m={$$typeof:n,type:e,key:s,ref:o,props:p,_owner:_};return m._store={},Object.defineProperty(m._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(m,"_self",{configurable:!1,enumerable:!1,writable:!1,value:d}),Object.defineProperty(m,"_source",{configurable:!1,enumerable:!1,writable:!1,value:b}),Object.freeze&&(Object.freeze(m.props),Object.freeze(m)),m};function it(e,s,o,d,b){{var _,p={},m=null,F=null;o!==void 0&&(ar(o),m=""+o),Qr(s)&&(ar(s.key),m=""+s.key),Jr(s)&&(F=s.ref,et(s,b));for(_ in s)D.call(s,_)&&!Hr.hasOwnProperty(_)&&(p[_]=s[_]);if(e&&e.defaultProps){var j=e.defaultProps;for(_ in j)p[_]===void 0&&(p[_]=j[_])}if(m||F){var A=typeof e=="function"?e.displayName||e.name||"Unknown":e;m&&rt(p,A),F&&tt(p,A)}return nt(e,m,F,b,d,sr.current,p)}}var ze=U.ReactCurrentOwner,lr=U.ReactDebugCurrentFrame;function fe(e){if(e){var s=e._owner,o=ce(e.type,e._source,s?s.type:null);lr.setExtraStackFrame(o)}else lr.setExtraStackFrame(null)}var Ie;Ie=!1;function Me(e){return typeof e=="object"&&e!==null&&e.$$typeof===n}function cr(){{if(ze.current){var e=I(ze.current.type);if(e)return`
|
|
22
22
|
|
|
23
|
-
Check the render method of \``+e+"`."}return""}}function
|
|
23
|
+
Check the render method of \``+e+"`."}return""}}function at(e){return""}var fr={};function st(e){{var s=cr();if(!s){var o=typeof e=="string"?e:e.displayName||e.name;o&&(s=`
|
|
24
24
|
|
|
25
|
-
Check the top-level render call using <`+
|
|
25
|
+
Check the top-level render call using <`+o+">.")}return s}}function dr(e,s){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var o=st(s);if(fr[o])return;fr[o]=!0;var d="";e&&e._owner&&e._owner!==ze.current&&(d=" It was passed a child from "+I(e._owner.type)+"."),fe(e),E('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',o,d),fe(null)}}function mr(e,s){{if(typeof e!="object")return;if(Ae(e))for(var o=0;o<e.length;o++){var d=e[o];Me(d)&&dr(d,s)}else if(Me(e))e._store&&(e._store.validated=!0);else if(e){var b=ee(e);if(typeof b=="function"&&b!==e.entries)for(var _=b.call(e),p;!(p=_.next()).done;)Me(p.value)&&dr(p.value,s)}}}function ot(e){{var s=e.type;if(s==null||typeof s=="string")return;var o;if(typeof s=="function")o=s.propTypes;else if(typeof s=="object"&&(s.$$typeof===h||s.$$typeof===k))o=s.propTypes;else return;if(o){var d=I(s);Kr(o,e.props,"prop",d,e)}else if(s.PropTypes!==void 0&&!Ie){Ie=!0;var b=I(s);E("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",b||"Unknown")}typeof s.getDefaultProps=="function"&&!s.getDefaultProps.isReactClassApproved&&E("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function ut(e){{for(var s=Object.keys(e.props),o=0;o<s.length;o++){var d=s[o];if(d!=="children"&&d!=="key"){fe(e),E("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",d),fe(null);break}}e.ref!==null&&(fe(e),E("Invalid attribute `ref` supplied to `React.Fragment`."),fe(null))}}var hr={};function gr(e,s,o,d,b,_){{var p=Z(e);if(!p){var m="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(m+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var F=at();F?m+=F:m+=cr();var j;e===null?j="null":Ae(e)?j="array":e!==void 0&&e.$$typeof===n?(j="<"+(I(e.type)||"Unknown")+" />",m=" Did you accidentally export a JSX literal instead of a component?"):j=typeof e,E("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",j,m)}var A=it(e,s,o,b,_);if(A==null)return A;if(p){var L=s.children;if(L!==void 0)if(d)if(Ae(L)){for(var de=0;de<L.length;de++)mr(L[de],e);Object.freeze&&Object.freeze(L)}else E("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else mr(L,e)}if(D.call(s,"key")){var ae=I(e),$=Object.keys(s).filter(function(ht){return ht!=="key"}),xe=$.length>0?"{key: someKey, "+$.join(": ..., ")+": ...}":"{key: someKey}";if(!hr[ae+xe]){var mt=$.length>0?"{"+$.join(": ..., ")+": ...}":"{}";E(`A props object containing a "key" prop is being spread into JSX:
|
|
26
26
|
let props = %s;
|
|
27
27
|
<%s {...props} />
|
|
28
28
|
React keys must be passed directly to JSX without using spread:
|
|
29
29
|
let props = %s;
|
|
30
|
-
<%s key={someKey} {...props} />`,
|
|
30
|
+
<%s key={someKey} {...props} />`,xe,ae,mt,ae),hr[ae+xe]=!0}}return e===u?ut(A):ot(A),A}}function lt(e,s,o){return gr(e,s,o,!0)}function ct(e,s,o){return gr(e,s,o,!1)}var ft=ct,dt=lt;pe.Fragment=u,pe.jsx=ft,pe.jsxs=dt}()),pe}process.env.NODE_ENV==="production"?je.exports=Ir():je.exports=Mr();var C=je.exports;function rr(t){return t.replace(/ı/g,"I").replace(/i/g,"İ").replace(/ğ/g,"Ğ").replace(/ü/g,"Ü").replace(/ş/g,"Ş").replace(/ö/g,"Ö").replace(/ç/g,"Ç").toUpperCase().replace(/I/g,"ı").replace(/İ/g,"İ").replace(/Ğ/g,"ğ").replace(/Ü/g,"ü").replace(/Ş/g,"ş").replace(/Ö/g,"ö").replace(/Ç/g,"ç")}const xr=300,Fr=1,$r=["password","email","number","tel","url"],Nr=["Backspace","Delete","ArrowLeft","ArrowRight","Tab","Enter","Escape"];function Br(t,n,r){return r||$r.includes(n)||!t?t:rr(t)}function Lr(t){return/[0-9.]/.test(t)||Nr.includes(t)}function Vr(t){const r=t.replace(/\D/g,"").slice(0,11);return r.length===0?"":r.length<=3?r:r.length<=6?`${r.slice(0,3)} ${r.slice(3)}`:r.length<=8?`${r.slice(0,3)} ${r.slice(3,6)} ${r.slice(6)}`:`${r.slice(0,3)} ${r.slice(3,6)} ${r.slice(6,8)} ${r.slice(8)}`}function Gr(t){const r=t.replace(/\D/g,"").slice(0,8);return r.length===0?"":r.length<=2?r:r.length<=4?`${r.slice(0,2)}/${r.slice(2)}`:`${r.slice(0,2)}/${r.slice(2,4)}/${r.slice(4)}`}function qr(t){const r=t.replace(/\D/g,"").slice(0,11);return r.length===0?"":r.length<=3?r:r.length<=6?`${r.slice(0,3)} ${r.slice(3)}`:`${r.slice(0,3)} ${r.slice(3,6)} ${r.slice(6)}`}function Ur(t){const r=t.replace(/[^A-Za-z0-9]/g,"").toUpperCase().slice(0,26);return r.length===0?"":r.length<=4?r:r.length<=8?`${r.slice(0,4)} ${r.slice(4)}`:r.length<=12?`${r.slice(0,4)} ${r.slice(4,8)} ${r.slice(8)}`:r.length<=16?`${r.slice(0,4)} ${r.slice(4,8)} ${r.slice(8,12)} ${r.slice(12)}`:r.length<=20?`${r.slice(0,4)} ${r.slice(4,8)} ${r.slice(8,12)} ${r.slice(12,16)} ${r.slice(16)}`:r.length<=24?`${r.slice(0,4)} ${r.slice(4,8)} ${r.slice(8,12)} ${r.slice(12,16)} ${r.slice(16,20)} ${r.slice(20)}`:`${r.slice(0,4)} ${r.slice(4,8)} ${r.slice(8,12)} ${r.slice(12,16)} ${r.slice(16,20)} ${r.slice(20,24)} ${r.slice(24)}`}function Xr(t,n){if(!n)return t;if(typeof n=="function")return n(t);switch(n){case"phone":return Vr(t);case"date":return Gr(t);case"tcKimlikNo":return qr(t);case"iban":return Ur(t);default:return t}}const tr=S.forwardRef(({name:t,label:n,type:r="text",placeholder:u,className:l,fieldToSearch:i,onSuggestionSearch:a,disabled:f=!1,step:h,min:P,max:T,startAdornment:k,endAdornment:R,disableUppercase:v=!1,required:K=!1,fullWidth:z,debounceDelay:ee=xr,minSearchLength:U=Fr,helperText:E,autoFocus:Y,multiline:se,rows:re,maxLength:W,errorMessageFormatter:O,"aria-label":X,"aria-describedby":V,sx:Z,inputSx:te,inputElementSx:H,mask:I,showPasswordToggle:g=!1,...y},B)=>{const[G,x,ne]=$e.useField(t),[_e,oe]=S.useState([]),[ve,ye]=S.useState(!1),[Oe,Re]=S.useState(!1),[J,be]=S.useState(!1),q=S.useRef(i&&a?pr.debounce(async D=>{if(D.length>=U){ye(!0);try{const w=await a(i,D);oe(w)}catch(w){console.error("Search error:",w),oe([])}ye(!1)}else oe([])},ee):null).current;S.useEffect(()=>{q&&G.value&&q(G.value)},[G.value,q]),S.useEffect(()=>()=>{q&&q.cancel()},[q]);const Q=S.useCallback(D=>{let w=Br(D,r,v);return I&&r!=="password"&&(w=Xr(w,I)),w},[r,v,I]),ue=S.useCallback(()=>{be(D=>!D)},[]),Ee=S.useMemo(()=>r==="password"&&J?"text":r,[r,J]),ie=S.useMemo(()=>{if(!(!x.touched||!x.error))return O?O(x.error):x.error},[x.touched,x.error,O]),Te=S.useMemo(()=>ie||E,[ie,E]),le=S.useMemo(()=>{var D;return{name:t,label:n,type:Ee,placeholder:u,required:K,disabled:f,error:x.touched&&!!x.error,helperText:Te,className:l,fullWidth:z!==void 0?z:!!n,autoFocus:Y,multiline:se,rows:re,sx:H?[Z,{"& .MuiInputBase-input":H}].filter(Boolean):Z,inputProps:{maxLength:W,step:h,min:P,max:T,...r==="number"&&{onKeyDown:w=>{Lr(w.key)||w.preventDefault()}},...y.inputProps},InputProps:{startAdornment:k?C.jsx(M.InputAdornment,{position:"start",children:k}):void 0,endAdornment:C.jsxs(C.Fragment,{children:[r==="password"&&g&&C.jsx(M.InputAdornment,{position:"end",children:C.jsx(M.IconButton,{"aria-label":"Şifreyi göster/gizle",onClick:ue,edge:"end",children:J?C.jsx(Ne.VisibilityOff,{}):C.jsx(Ne.Visibility,{})})}),R?C.jsx(M.InputAdornment,{position:"end",children:R}):void 0,(D=y.InputProps)==null?void 0:D.endAdornment]}),...te&&{sx:te},...y.InputProps},"aria-label":X,"aria-describedby":V||(ie?`${t}-error`:void 0),"aria-invalid":x.touched&&x.error?!0:void 0,ref:B,...y}},[t,n,Ee,u,K,f,x.touched,x.error,Te,l,z,Y,se,re,W,h,P,T,k,R,X,V,Z,te,H,I,g,J,Ee,y]);if(i&&a)return C.jsx(M.Autocomplete,{freeSolo:!0,open:Oe,onOpen:()=>Re(!0),onClose:()=>Re(!1),options:_e,loading:ve,disabled:f,value:G.value||"",onChange:(D,w)=>{const ke=w||"";ne.setValue(Q(ke))},onInputChange:(D,w)=>{ne.setValue(Q(w))},renderInput:D=>{var w;return C.jsx(M.TextField,{...D,...le,InputProps:{...D.InputProps,...le.InputProps,endAdornment:C.jsxs(C.Fragment,{children:[ve?C.jsx(M.CircularProgress,{color:"inherit",size:20}):null,(w=le.InputProps)==null?void 0:w.endAdornment,D.InputProps.endAdornment]})},ref:B})}});const ce=S.useCallback(D=>{const w=D.target.value;ne.setValue(Q(w))},[ne,Q]);return C.jsx(M.TextField,{...le,value:G.value||"",onChange:ce,onBlur:G.onBlur})});tr.displayName="FormikTextField";const nr=S.forwardRef(({name:t,options:n=[],label:r,placeholder:u,className:l,disabled:i=!1,required:a=!1,fullWidth:f=!0,helperText:h,autoFocus:P,errorMessageFormatter:T,"aria-label":k,"aria-describedby":R,sx:v,formControlSx:K,multiple:z=!1,searchable:ee=!1,searchPlaceholder:U,onChange:E,renderOption:Y,...se},re)=>{const[W,O,X]=$e.useField(t),V=S.useMemo(()=>{if(!(!O.touched||!O.error))return T?T(O.error):O.error},[O.touched,O.error,T]),Z=S.useMemo(()=>V||h,[V,h]),te=S.useCallback(g=>{const y=g.target.value;X.setValue(y),E&&E(y)},[X,E]),H=S.useCallback((g,y)=>{if(z){const B=Array.isArray(y)?y.map(G=>G.value):[];X.setValue(B),E&&E(B)}else{const B=y&&!Array.isArray(y)?y.value:"";X.setValue(B),E&&E(B)}},[X,E,z]),I=`${t}-select`;return ee?C.jsx(M.Autocomplete,{ref:re,options:n,getOptionLabel:g=>g.label,value:z?n.filter(g=>{var y;return(y=W.value)==null?void 0:y.includes(g.value)}):n.find(g=>g.value===W.value)||null,onChange:H,multiple:z,disabled:i,fullWidth:f,renderInput:g=>C.jsx(M.TextField,{...g,name:t,label:r,placeholder:U||u,required:a,error:O.touched&&!!O.error,helperText:Z,className:l,autoFocus:P,inputProps:{...g.inputProps,"aria-label":k,"aria-describedby":R||(V?`${t}-error`:void 0),"aria-invalid":O.touched&&O.error?!0:void 0},sx:v}),renderOption:(g,y)=>S.createElement("li",{...g,key:y.value},Y?Y(y,n.indexOf(y)):y.label),getOptionDisabled:g=>{if(typeof g=="object")return g.disabled||!1;const y=n.find(B=>B.value===g);return(y==null?void 0:y.disabled)||!1}}):C.jsxs(M.FormControl,{ref:re,fullWidth:f,error:O.touched&&!!O.error,className:l,disabled:i,required:a,sx:K,children:[r&&C.jsx(M.InputLabel,{id:`${I}-label`,required:a,children:r}),C.jsxs(M.Select,{labelId:r?`${I}-label`:void 0,id:I,name:t,value:W.value??(z?[]:""),onChange:te,onBlur:W.onBlur,label:r,displayEmpty:!!u,multiple:z,autoFocus:P,inputProps:{"aria-label":k,"aria-describedby":R||(V?`${t}-error`:void 0),"aria-invalid":O.touched&&O.error?!0:void 0},sx:v,...se,children:[u&&C.jsx(M.MenuItem,{value:z?[]:"",disabled:!0,children:u}),n.map(g=>C.jsx(M.MenuItem,{value:g.value,disabled:g.disabled,children:Y?Y(g,n.indexOf(g)):g.label},g.value))]}),Z&&C.jsx(M.FormHelperText,{children:Z})]})});nr.displayName="FormikDropdown",c.CREDIT_CARD_REGEX=Ye,c.EMAIL_REGEX=Le,c.FormikDropdown=nr,c.FormikTextField=tr,c.IBAN_REGEX=Xe,c.NAME_REGEX=Ce,c.PHONE_REGEX=Ge,c.PLATE_REGEX=we,c.TC_KIMLIK_NO_REGEX=De,c.VKN_REGEX=Ze,c.creditCardSchema=Dr,c.dateSchema=Pe,c.emailSchema=br,c.fileSchema=jr,c.futureDateSchema=zr,c.getFileExtension=he,c.ibanSchema=Sr,c.nameSchema=kr,c.passwordMatchSchema=Tr,c.passwordSchema=Rr,c.pastDateSchema=Ar,c.phoneSchema=Er,c.plateSchema=wr,c.tcKimlikNoSchema=yr,c.toTurkishUpperCase=rr,c.validateCreditCard=We,c.validateDate=Or,c.validateEmail=Ve,c.validateFile=Pr,c.validateIBAN=Ke,c.validateName=Ue,c.validatePassword=_r,c.validatePhone=qe,c.validatePlate=Je,c.validateTCKimlikNo=Be,c.validateVKN=He,c.vknSchema=Cr,Object.defineProperty(c,Symbol.toStringTag,{value:"Module"})});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mertcankocak/core-project",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"description": "React TypeScript component library built with Vite",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/core-project.umd.js",
|
|
@@ -40,32 +40,34 @@
|
|
|
40
40
|
},
|
|
41
41
|
"homepage": "https://github.com/MertcanKocak1/CoreProject#readme",
|
|
42
42
|
"peerDependencies": {
|
|
43
|
-
"react": "^18.0.0",
|
|
44
|
-
"react-dom": "^18.0.0",
|
|
45
|
-
"yup": "^1.0.0",
|
|
46
|
-
"file-type": "^19.0.0",
|
|
47
|
-
"formik": "^2.0.0",
|
|
48
|
-
"@mui/material": "^5.0.0",
|
|
49
43
|
"@emotion/react": "^11.0.0",
|
|
50
44
|
"@emotion/styled": "^11.0.0",
|
|
51
|
-
"
|
|
45
|
+
"@mui/icons-material": "^5.0.0",
|
|
46
|
+
"@mui/material": "^5.0.0",
|
|
47
|
+
"file-type": "^19.0.0",
|
|
48
|
+
"formik": "^2.0.0",
|
|
49
|
+
"lodash": "^4.17.21",
|
|
50
|
+
"react": "^18.0.0",
|
|
51
|
+
"react-dom": "^18.0.0",
|
|
52
|
+
"yup": "^1.0.0"
|
|
52
53
|
},
|
|
53
54
|
"devDependencies": {
|
|
55
|
+
"@emotion/react": "^11.11.3",
|
|
56
|
+
"@emotion/styled": "^11.11.0",
|
|
57
|
+
"@mui/icons-material": "^5.18.0",
|
|
58
|
+
"@mui/material": "^5.15.0",
|
|
59
|
+
"@types/lodash": "^4.14.202",
|
|
54
60
|
"@types/react": "^18.2.43",
|
|
55
61
|
"@types/react-dom": "^18.2.17",
|
|
56
62
|
"@vitejs/plugin-react": "^4.2.1",
|
|
63
|
+
"file-type": "^19.0.0",
|
|
64
|
+
"formik": "^2.4.5",
|
|
65
|
+
"lodash": "^4.17.21",
|
|
57
66
|
"react": "^18.2.0",
|
|
58
67
|
"react-dom": "^18.2.0",
|
|
59
68
|
"typescript": "^5.3.3",
|
|
60
69
|
"vite": "^5.0.8",
|
|
61
70
|
"vite-plugin-dts": "^3.6.4",
|
|
62
|
-
"yup": "^1.4.0"
|
|
63
|
-
"file-type": "^19.0.0",
|
|
64
|
-
"formik": "^2.4.5",
|
|
65
|
-
"@mui/material": "^5.15.0",
|
|
66
|
-
"@emotion/react": "^11.11.3",
|
|
67
|
-
"@emotion/styled": "^11.11.0",
|
|
68
|
-
"lodash": "^4.17.21",
|
|
69
|
-
"@types/lodash": "^4.14.202"
|
|
71
|
+
"yup": "^1.4.0"
|
|
70
72
|
}
|
|
71
73
|
}
|