@ehfuse/mui-form-controls 3.3.11 → 3.3.13

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/address.js CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";var ie=Object.create;var k=Object.defineProperty;var ue=Object.getOwnPropertyDescriptor;var ce=Object.getOwnPropertyNames;var de=Object.getPrototypeOf,me=Object.prototype.hasOwnProperty;var fe=(e,t)=>{for(var n in t)k(e,n,{get:t[n],enumerable:!0})},Y=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of ce(t))!me.call(e,o)&&o!==n&&k(e,o,{get:()=>t[o],enumerable:!(r=ue(t,o))||r.enumerable});return e};var U=(e,t,n)=>(n=e!=null?ie(de(e)):{},Y(t||!e||!e.__esModule?k(n,"default",{value:e,enumerable:!0}):n,e)),pe=e=>Y(k({},"__esModule",{value:!0}),e);var Le={};fe(Le,{AddressTextField:()=>le});module.exports=pe(Le);var f=require("@mui/material"),re=U(require("@mui/icons-material/Search")),oe=U(require("@mui/icons-material/Close")),d=require("react");var h=U(require("react")),N=function(e,t){return N=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var o in r)r.hasOwnProperty(o)&&(n[o]=r[o])},N(e,t)},M=function(){return M=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},M.apply(this,arguments)};function ge(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function"){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}var B,q="https://t1.kakaocdn.net/mapjsapi/bundle/postcode/prod/postcode.v2.js",he=(B=null,function(e){return e===void 0&&(e=q),B||(B=new Promise((function(t,n){var r=document.createElement("script");r.src=e,r.onload=function(){var o,s,l,i=(s=(o=window?.kakao)===null||o===void 0?void 0:o.Postcode)!==null&&s!==void 0?s:(l=window?.daum)===null||l===void 0?void 0:l.Postcode;if(i)return t(i);n(new Error("Script is loaded successfully, but cannot find Postcode module. Check your scriptURL property."))},r.onerror=function(o){return n(o)},r.id="kakao_postcode_script",document.body.appendChild(r)})))}),ve=h.default.createElement("p",null,"\uD604\uC7AC Kakao \uC6B0\uD3B8\uBC88\uD638 \uC11C\uBE44\uC2A4\uB97C \uC774\uC6A9\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. \uC7A0\uC2DC \uD6C4 \uB2E4\uC2DC \uC2DC\uB3C4\uD574\uC8FC\uC138\uC694."),be={width:"100%",height:400},ye={scriptUrl:q,errorMessage:ve,autoClose:!0},Q=(function(e){function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.mounted=!1,n.wrap=(0,h.createRef)(),n.state={hasError:!1,completed:!1},n.initiate=function(r){if(n.wrap.current){var o=n.props;o.scriptUrl,o.className,o.style;var s=o.defaultQuery,l=o.autoClose;o.errorMessage;var i=o.onComplete,u=o.onClose,p=o.onResize,m=o.onSearch,b=ge(o,["scriptUrl","className","style","defaultQuery","autoClose","errorMessage","onComplete","onClose","onResize","onSearch"]);new r(M(M({},b),{oncomplete:function(T){i&&i(T),n.setState({completed:!0})},onsearch:m,onresize:p,onclose:u,width:"100%",height:"100%"})).embed(n.wrap.current,{q:s,autoClose:l})}},n.onError=function(r){console.error(r),n.setState({hasError:!0})},n}return(function(n,r){function o(){this.constructor=n}N(n,r),n.prototype=r===null?Object.create(r):(o.prototype=r.prototype,new o)})(t,e),t.prototype.componentDidMount=function(){var n=this.initiate,r=this.onError,o=this.props.scriptUrl;o&&(this.mounted||(he(o).then(n).catch(r),this.mounted=!0))},t.prototype.render=function(){var n=this.props,r=n.className,o=n.style,s=n.errorMessage,l=n.autoClose,i=this.state,u=i.hasError,p=i.completed;return l===!0&&p===!0?null:h.default.createElement("div",{ref:this.wrap,className:r,style:M(M({},be),o)},u&&s)},t.defaultProps=ye,t})(h.Component);var v=require("react");function j({name:e="",debounce:t,onChange:n}){let r=(0,v.useRef)(""),o=(0,v.useRef)(null);(0,v.useEffect)(()=>()=>{o.current&&clearTimeout(o.current)},[]);let s=(0,v.useCallback)((i,u,p=!1)=>{if(u===r.current)return;let m=()=>{if(u!==r.current&&(r.current=u,n)){let b={...i||{},target:{...i?.target||{},name:e,value:u}};n(b)}};o.current&&clearTimeout(o.current),p||t===void 0||t===0?m():o.current=setTimeout(m,t)},[n,t,e]),l=(0,v.useCallback)((i,u)=>{if(o.current&&(clearTimeout(o.current),o.current=null),u!==r.current&&(r.current=u,n)){let p={...i,target:{...i.target,name:e,value:u}};n(p)}},[n,e]);return{emitChange:s,flushOnBlur:l,lastEmittedValue:r,debounceTimer:o}}var $=require("react");var W=require("react");var G=require("react");var K=require("react");var H=require("@mui/material/styles"),X=require("@mui/material"),g=require("react/jsx-runtime");var w={root:"MuiInputBase-root MuiOutlinedInput-root",outline:"MuiOutlinedInput-notchedOutline",label:"MuiFormLabel-root MuiInputLabel-root MuiInputLabel-outlined MuiInputLabel-shrink",input:"MuiInputBase-input MuiOutlinedInput-input",adornment:"MuiInputAdornment-root",disabled:"Mui-disabled"},Re=(0,H.styled)(X.Box,{shouldForwardProp:e=>e!=="small"&&e!=="fullWidth"&&e!=="dimmed"&&e!=="multiline"})(({theme:e,small:t,fullWidth:n,dimmed:r,multiline:o})=>({position:"relative",display:"inline-flex",alignItems:o?"flex-start":"center",width:n?"100%":void 0,minHeight:t?40:56,borderRadius:e.shape.borderRadius||4,color:r?e.palette.text.disabled:e.palette.text.primary,font:"inherit",boxSizing:"border-box"})),Ee=(0,H.styled)("fieldset",{shouldForwardProp:e=>e!=="dimmed"})(({theme:e,dimmed:t})=>({position:"absolute",inset:"-5px 0 0 0",margin:0,padding:"0 8px",borderRadius:"inherit",borderStyle:"solid",borderWidth:1,borderColor:t?e.palette.action.disabled:e.palette.mode==="dark"?"rgba(255, 255, 255, 0.23)":"rgba(0, 0, 0, 0.23)",pointerEvents:"none",overflow:"hidden",minWidth:0,"& > legend":{padding:0,fontSize:"0.75em",lineHeight:"11px",visibility:"hidden",maxWidth:"100%",whiteSpace:"nowrap","& > span":{paddingLeft:5,paddingRight:5,display:"inline-block",opacity:0}}})),we=(0,H.styled)("span",{shouldForwardProp:e=>e!=="dimmed"})(({theme:e,dimmed:t})=>({position:"absolute",top:0,left:9,transform:"translateY(-50%)",padding:"0 4px",fontSize:"0.75rem",lineHeight:"1.4375em",color:t?e.palette.text.disabled:e.palette.text.secondary,backgroundColor:e.palette.background.paper,pointerEvents:"none",whiteSpace:"nowrap",maxWidth:"calc(100% - 18px)",overflow:"hidden",textOverflow:"ellipsis",zIndex:1})),Te=(0,H.styled)("div",{shouldForwardProp:e=>e!=="multiline"&&e!=="small"&&e!=="align"&&e!=="hasStart"&&e!=="hasEnd"&&e!=="minRows"})(({multiline:e,small:t,align:n,hasStart:r,hasEnd:o,minRows:s})=>({flex:1,minWidth:0,boxSizing:"border-box",padding:t?"8.5px 14px":"16.5px 14px",paddingLeft:r?0:void 0,paddingRight:o?0:void 0,fontSize:"1rem",lineHeight:"1.4375em",font:"inherit",textAlign:n,minHeight:e&&s?`calc(${s} * 1.4375em)`:void 0,overflow:"hidden",whiteSpace:e?"pre-wrap":"nowrap",overflowWrap:e?"anywhere":void 0,textOverflow:e?void 0:"ellipsis"})),J=(0,H.styled)("span",{shouldForwardProp:e=>e!=="side"})(({theme:e,side:t})=>({flexShrink:0,display:"inline-flex",alignItems:"center",whiteSpace:"nowrap",paddingLeft:t==="start"?14:void 0,paddingRight:t==="end"?14:void 0,color:e.palette.text.secondary}));function _({label:e,value:t,prefix:n,suffix:r,startAdornment:o,endAdornment:s,showAffixOnlyWithValue:l=!1,align:i="left",size:u="medium",fullWidth:p,dimmed:m=!1,multiline:b=!1,minRows:T,onClick:I,title:x,className:S,id:C,sx:O}){let P=u==="small",V=!(t==null||t===""),y=!l||V,D=o||(n&&y?n:null),L=s||(r&&y?r:null),A=m?` ${w.disabled}`:"";return(0,g.jsxs)(Re,{small:P,fullWidth:p,dimmed:m,multiline:b,className:`${w.root}${A}${S?` ${S}`:""}`,id:C,title:x,onClick:I,sx:O,children:[(0,g.jsx)(Ee,{"aria-hidden":"true",dimmed:m,className:w.outline,children:(0,g.jsx)("legend",{children:e?(0,g.jsx)("span",{children:e}):(0,g.jsx)("span",{children:"\u200B"})})}),e?(0,g.jsx)(we,{dimmed:m,className:`${w.label}${A}`,children:e}):null,D?(0,g.jsx)(J,{side:"start",className:w.adornment,children:D}):null,(0,g.jsx)(Te,{className:`${w.input}${A}`,multiline:b,small:P,align:i,hasStart:!!D,hasEnd:!!L,minRows:T,children:t}),L?(0,g.jsx)(J,{side:"end",className:w.adornment,children:L}):null]})}var F=require("react/jsx-runtime");function Z(e){return!!(e.readonly||e.disabled)&&!e.readonlyInput}function Ie(e){let t=e,n=t?.input,r=t?.htmlInput?.style?.textAlign;return{startAdornment:n&&typeof n!="function"?n.startAdornment:void 0,endAdornment:n&&typeof n!="function"?n.endAdornment:void 0,align:r==="right"||r==="center"?r:void 0}}function xe(e,t){if(!e)return t;if(!t)return e;let n=r=>Array.isArray(r)?r:[r];return[...n(e),...n(t)]}function ee(e){let t=Ie(e.slotProps);return{form:e.form,name:e.name,value:e.value,label:e.label,disabled:e.disabled,size:e.size==="small"?"small":"medium",fullWidth:e.fullWidth,className:e.className,id:e.id,onClick:e.onClick,multiline:!!e.multiline,minRows:e.minRows===void 0?void 0:Number(e.minRows),sx:xe(e.formControlProps?.sx,e.sx),...t}}function te(e,t){return t?t(e):e==null?"":String(e)}function Ce({form:e,name:t,value:n,format:r,disabled:o,...s}){let l=e.useValue(t);return(0,F.jsx)(_,{...s,value:te(l===void 0?n:l,r),dimmed:!!o})}function ne(e){if(e.form&&e.name&&typeof e.form.useValue=="function")return(0,F.jsx)(Ce,{...e});let{form:t,name:n,value:r,format:o,disabled:s,...l}=e;return(0,F.jsx)(_,{...l,value:te(r,o),dimmed:!!s})}var c=require("react/jsx-runtime");var se=(0,d.forwardRef)(function({value:t,onChange:n,readonly:r,debounce:o,onBlur:s,size:l,spellCheck:i=!1,onAddressComplete:u,inputRef:p,...m},b){let T=(0,d.useRef)(null);(0,d.useImperativeHandle)(p,()=>T.current,[]);let[I,x]=(0,d.useState)(typeof t=="string"?t:""),[S,C]=(0,d.useState)(!1),O=l==="small"?20:24,{emitChange:P,flushOnBlur:V,lastEmittedValue:y}=j({name:m.name,debounce:o,onChange:n});(0,d.useEffect)(()=>{if(t!=null){let a=String(t);a!==y.current&&(x(a),y.current=a)}else y.current!==""&&(x(""),y.current="")},[t,y]);let D=a=>{let R=a.address,E="";a.addressType==="R"&&(a.bname!==""&&/[동|로|가]$/g.test(a.bname)&&(E+=a.bname),a.buildingName!==""&&a.apartment==="Y"&&(E+=E!==""?", "+a.buildingName:a.buildingName),E!==""&&(E=" ("+E+")"),R+=E),x(R),P(null,R,!0),u?.(R,a),C(!1)},L=()=>{C(!0)},A=a=>{a.key==="Enter"&&(a.preventDefault(),L())},z=()=>{C(!1)},ae=()=>{C(!1),P(null,I,!0)};return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(f.TextField,{...m,ref:b,inputRef:T,size:l,value:I,onChange:r?void 0:a=>{let R=a.target.value;x(R),P(a,R)},autoComplete:"off",spellCheck:i,onKeyDown:r?void 0:A,onBlur:r?void 0:a=>{V(a,I),s&&s(a)},sx:{...r?{"& .MuiOutlinedInput-root.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:"rgba(0, 0, 0, 0.23)",borderWidth:1},"& .MuiOutlinedInput-root:hover .MuiOutlinedInput-notchedOutline":{borderColor:"rgba(0, 0, 0, 0.23)"},"& .MuiInputLabel-root.Mui-focused":{color:"rgba(0, 0, 0, 0.6)"}}:{},...r&&{pointerEvents:"none"}},slotProps:{...m.slotProps,input:{...m.slotProps?.input,readOnly:r,endAdornment:r?void 0:(0,c.jsx)(f.InputAdornment,{position:"end",sx:{mr:l==="small"?-.5:.5},children:(0,c.jsx)(f.IconButton,{tabIndex:-1,onClick:L,edge:"end","aria-label":"\uC8FC\uC18C \uCC3E\uAE30",size:l,children:(0,c.jsx)(re.default,{sx:{fontSize:O}})})})}}}),(0,c.jsxs)(f.Dialog,{open:S,onClose:z,maxWidth:"sm",fullWidth:!0,slotProps:{paper:{sx:{height:"550px"}}},children:[(0,c.jsxs)(f.DialogTitle,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",pr:2},children:["\uC8FC\uC18C \uAC80\uC0C9",(0,c.jsx)(f.IconButton,{onClick:ae,size:"small",children:(0,c.jsx)(oe.default,{})})]}),(0,c.jsx)(f.DialogContent,{style:{padding:0},dividers:!0,children:(0,c.jsx)(Q,{onComplete:D,onClose:z,defaultQuery:I,style:{width:"100%",height:"100%"}})})]})]})}),Pe=(0,d.forwardRef)(function({form:t,name:n,onChange:r,...o},s){if(!t||typeof t.useValue!="function")throw new Error("AddressTextField form prop is missing. Provide a form from useForm or useGlobalForm.");if(!n)throw new Error("AddressTextField requires a name when form prop is provided.");let l=t.useValue(n),i=(0,d.useCallback)(u=>{t.handleFormChange(u),r?.(u)},[t,r]);return(0,c.jsx)(se,{...o,ref:s,name:n,value:l,onChange:i})}),le=(0,d.forwardRef)(function(t,n){return Z(t)?(0,c.jsx)(ne,{...ee(t)}):t.form?(0,c.jsx)(Pe,{...t,ref:n}):(0,c.jsx)(se,{...t,ref:n})});0&&(module.exports={AddressTextField});
1
+ "use strict";var ie=Object.create;var k=Object.defineProperty;var ue=Object.getOwnPropertyDescriptor;var ce=Object.getOwnPropertyNames;var de=Object.getPrototypeOf,me=Object.prototype.hasOwnProperty;var fe=(e,t)=>{for(var n in t)k(e,n,{get:t[n],enumerable:!0})},Y=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of ce(t))!me.call(e,o)&&o!==n&&k(e,o,{get:()=>t[o],enumerable:!(r=ue(t,o))||r.enumerable});return e};var U=(e,t,n)=>(n=e!=null?ie(de(e)):{},Y(t||!e||!e.__esModule?k(n,"default",{value:e,enumerable:!0}):n,e)),pe=e=>Y(k({},"__esModule",{value:!0}),e);var Le={};fe(Le,{AddressTextField:()=>le});module.exports=pe(Le);var f=require("@mui/material"),re=U(require("@mui/icons-material/Search")),oe=U(require("@mui/icons-material/Close")),d=require("react");var h=U(require("react")),N=function(e,t){return N=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var o in r)r.hasOwnProperty(o)&&(n[o]=r[o])},N(e,t)},M=function(){return M=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},M.apply(this,arguments)};function ge(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function"){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}var B,q="https://t1.kakaocdn.net/mapjsapi/bundle/postcode/prod/postcode.v2.js",he=(B=null,function(e){return e===void 0&&(e=q),B||(B=new Promise((function(t,n){var r=document.createElement("script");r.src=e,r.onload=function(){var o,s,l,i=(s=(o=window?.kakao)===null||o===void 0?void 0:o.Postcode)!==null&&s!==void 0?s:(l=window?.daum)===null||l===void 0?void 0:l.Postcode;if(i)return t(i);n(new Error("Script is loaded successfully, but cannot find Postcode module. Check your scriptURL property."))},r.onerror=function(o){return n(o)},r.id="kakao_postcode_script",document.body.appendChild(r)})))}),ve=h.default.createElement("p",null,"\uD604\uC7AC Kakao \uC6B0\uD3B8\uBC88\uD638 \uC11C\uBE44\uC2A4\uB97C \uC774\uC6A9\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. \uC7A0\uC2DC \uD6C4 \uB2E4\uC2DC \uC2DC\uB3C4\uD574\uC8FC\uC138\uC694."),be={width:"100%",height:400},ye={scriptUrl:q,errorMessage:ve,autoClose:!0},Q=(function(e){function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.mounted=!1,n.wrap=(0,h.createRef)(),n.state={hasError:!1,completed:!1},n.initiate=function(r){if(n.wrap.current){var o=n.props;o.scriptUrl,o.className,o.style;var s=o.defaultQuery,l=o.autoClose;o.errorMessage;var i=o.onComplete,u=o.onClose,p=o.onResize,m=o.onSearch,b=ge(o,["scriptUrl","className","style","defaultQuery","autoClose","errorMessage","onComplete","onClose","onResize","onSearch"]);new r(M(M({},b),{oncomplete:function(T){i&&i(T),n.setState({completed:!0})},onsearch:m,onresize:p,onclose:u,width:"100%",height:"100%"})).embed(n.wrap.current,{q:s,autoClose:l})}},n.onError=function(r){console.error(r),n.setState({hasError:!0})},n}return(function(n,r){function o(){this.constructor=n}N(n,r),n.prototype=r===null?Object.create(r):(o.prototype=r.prototype,new o)})(t,e),t.prototype.componentDidMount=function(){var n=this.initiate,r=this.onError,o=this.props.scriptUrl;o&&(this.mounted||(he(o).then(n).catch(r),this.mounted=!0))},t.prototype.render=function(){var n=this.props,r=n.className,o=n.style,s=n.errorMessage,l=n.autoClose,i=this.state,u=i.hasError,p=i.completed;return l===!0&&p===!0?null:h.default.createElement("div",{ref:this.wrap,className:r,style:M(M({},be),o)},u&&s)},t.defaultProps=ye,t})(h.Component);var v=require("react");function j({name:e="",debounce:t,onChange:n}){let r=(0,v.useRef)(""),o=(0,v.useRef)(null);(0,v.useEffect)(()=>()=>{o.current&&clearTimeout(o.current)},[]);let s=(0,v.useCallback)((i,u,p=!1)=>{if(u===r.current)return;let m=()=>{if(u!==r.current&&(r.current=u,n)){let b={...i||{},target:{...i?.target||{},name:e,value:u}};n(b)}};o.current&&clearTimeout(o.current),p||t===void 0||t===0?m():o.current=setTimeout(m,t)},[n,t,e]),l=(0,v.useCallback)((i,u)=>{if(o.current&&(clearTimeout(o.current),o.current=null),u!==r.current&&(r.current=u,n)){let p={...i,target:{...i.target,name:e,value:u}};n(p)}},[n,e]);return{emitChange:s,flushOnBlur:l,lastEmittedValue:r,debounceTimer:o}}var $=require("react");var W=require("react");var G=require("react");var K=require("react");var H=require("@mui/material/styles"),X=require("@mui/material"),g=require("react/jsx-runtime");var w={root:"MuiInputBase-root MuiOutlinedInput-root",outline:"MuiOutlinedInput-notchedOutline",label:"MuiFormLabel-root MuiInputLabel-root MuiInputLabel-outlined MuiInputLabel-shrink",input:"MuiInputBase-input MuiOutlinedInput-input",adornment:"MuiInputAdornment-root",disabled:"Mui-disabled"},Re=(0,H.styled)(X.Box,{shouldForwardProp:e=>e!=="small"&&e!=="fullWidth"&&e!=="dimmed"&&e!=="multiline"})(({theme:e,small:t,fullWidth:n,dimmed:r,multiline:o})=>({position:"relative",display:"inline-flex",alignItems:o?"flex-start":"center",width:n?"100%":void 0,minHeight:t?"calc(1.4375em + 17px)":"calc(1.4375em + 33px)",borderRadius:e.shape.borderRadius||4,color:r?e.palette.text.disabled:e.palette.text.primary,...e.typography.body1,lineHeight:"1.4375em",boxSizing:"border-box"})),Ee=(0,H.styled)("fieldset",{shouldForwardProp:e=>e!=="dimmed"})(({theme:e,dimmed:t})=>({position:"absolute",inset:"-5px 0 0 0",margin:0,padding:"0 8px",borderRadius:"inherit",borderStyle:"solid",borderWidth:1,borderColor:t?e.palette.action.disabled:e.palette.mode==="dark"?"rgba(255, 255, 255, 0.23)":"rgba(0, 0, 0, 0.23)",pointerEvents:"none",overflow:"hidden",minWidth:0,"& > legend":{padding:0,fontSize:"0.75em",lineHeight:"11px",visibility:"hidden",maxWidth:"100%",whiteSpace:"nowrap","& > span":{paddingLeft:5,paddingRight:5,display:"inline-block",opacity:0}}})),we=(0,H.styled)("span",{shouldForwardProp:e=>e!=="dimmed"})(({theme:e,dimmed:t})=>({position:"absolute",top:0,left:9,transform:"translateY(-50%)",padding:"0 4px",fontSize:"0.75em",lineHeight:"1.4375em",color:t?e.palette.text.disabled:e.palette.text.secondary,backgroundColor:e.palette.background.paper,pointerEvents:"none",whiteSpace:"nowrap",maxWidth:"calc(100% - 18px)",overflow:"hidden",textOverflow:"ellipsis",zIndex:1})),Te=(0,H.styled)("div",{shouldForwardProp:e=>e!=="multiline"&&e!=="small"&&e!=="align"&&e!=="hasStart"&&e!=="hasEnd"&&e!=="minRows"})(({multiline:e,small:t,align:n,hasStart:r,hasEnd:o,minRows:s})=>({flex:1,minWidth:0,boxSizing:"border-box",padding:t?"8.5px 14px":"16.5px 14px",paddingLeft:r?0:void 0,paddingRight:o?0:void 0,fontSize:"1rem",lineHeight:"1.4375em",font:"inherit",textAlign:n,minHeight:e&&s?`calc(${s} * 1.4375em)`:void 0,overflow:"hidden",whiteSpace:e?"pre-wrap":"nowrap",overflowWrap:e?"anywhere":void 0,textOverflow:e?void 0:"ellipsis"})),J=(0,H.styled)("span",{shouldForwardProp:e=>e!=="side"})(({theme:e,side:t})=>({flexShrink:0,display:"inline-flex",alignItems:"center",whiteSpace:"nowrap",paddingLeft:t==="start"?14:void 0,paddingRight:t==="end"?14:void 0,color:e.palette.text.secondary}));function _({label:e,value:t,prefix:n,suffix:r,startAdornment:o,endAdornment:s,showAffixOnlyWithValue:l=!1,align:i="left",size:u="medium",fullWidth:p,dimmed:m=!1,multiline:b=!1,minRows:T,onClick:I,title:x,className:S,id:C,sx:O}){let P=u==="small",V=!(t==null||t===""),y=!l||V,D=o||(n&&y?n:null),L=s||(r&&y?r:null),A=m?` ${w.disabled}`:"";return(0,g.jsxs)(Re,{small:P,fullWidth:p,dimmed:m,multiline:b,className:`${w.root}${A}${S?` ${S}`:""}`,id:C,title:x,onClick:I,sx:O,children:[(0,g.jsx)(Ee,{"aria-hidden":"true",dimmed:m,className:w.outline,children:(0,g.jsx)("legend",{children:e?(0,g.jsx)("span",{children:e}):(0,g.jsx)("span",{children:"\u200B"})})}),e?(0,g.jsx)(we,{dimmed:m,className:`${w.label}${A}`,children:e}):null,D?(0,g.jsx)(J,{side:"start",className:w.adornment,children:D}):null,(0,g.jsx)(Te,{className:`${w.input}${A}`,multiline:b,small:P,align:i,hasStart:!!D,hasEnd:!!L,minRows:T,children:t}),L?(0,g.jsx)(J,{side:"end",className:w.adornment,children:L}):null]})}var F=require("react/jsx-runtime");function Z(e){return!!(e.readonly||e.disabled)&&!e.readonlyInput}function Ie(e){let t=e,n=t?.input,r=t?.htmlInput?.style?.textAlign;return{startAdornment:n&&typeof n!="function"?n.startAdornment:void 0,endAdornment:n&&typeof n!="function"?n.endAdornment:void 0,align:r==="right"||r==="center"?r:void 0}}function xe(e,t){if(!e)return t;if(!t)return e;let n=r=>Array.isArray(r)?r:[r];return[...n(e),...n(t)]}function ee(e){let t=Ie(e.slotProps);return{form:e.form,name:e.name,value:e.value,label:e.label,disabled:e.disabled,size:e.size==="small"?"small":"medium",fullWidth:e.fullWidth,className:e.className,id:e.id,onClick:e.onClick,multiline:!!e.multiline,minRows:e.minRows===void 0?void 0:Number(e.minRows),sx:xe(e.formControlProps?.sx,e.sx),...t}}function te(e,t){return t?t(e):e==null?"":String(e)}function Ce({form:e,name:t,value:n,format:r,disabled:o,...s}){let l=e.useValue(t);return(0,F.jsx)(_,{...s,value:te(l===void 0?n:l,r),dimmed:!!o})}function ne(e){if(e.form&&e.name&&typeof e.form.useValue=="function")return(0,F.jsx)(Ce,{...e});let{form:t,name:n,value:r,format:o,disabled:s,...l}=e;return(0,F.jsx)(_,{...l,value:te(r,o),dimmed:!!s})}var c=require("react/jsx-runtime");var se=(0,d.forwardRef)(function({value:t,onChange:n,readonly:r,debounce:o,onBlur:s,size:l,spellCheck:i=!1,onAddressComplete:u,inputRef:p,...m},b){let T=(0,d.useRef)(null);(0,d.useImperativeHandle)(p,()=>T.current,[]);let[I,x]=(0,d.useState)(typeof t=="string"?t:""),[S,C]=(0,d.useState)(!1),O=l==="small"?20:24,{emitChange:P,flushOnBlur:V,lastEmittedValue:y}=j({name:m.name,debounce:o,onChange:n});(0,d.useEffect)(()=>{if(t!=null){let a=String(t);a!==y.current&&(x(a),y.current=a)}else y.current!==""&&(x(""),y.current="")},[t,y]);let D=a=>{let R=a.address,E="";a.addressType==="R"&&(a.bname!==""&&/[동|로|가]$/g.test(a.bname)&&(E+=a.bname),a.buildingName!==""&&a.apartment==="Y"&&(E+=E!==""?", "+a.buildingName:a.buildingName),E!==""&&(E=" ("+E+")"),R+=E),x(R),P(null,R,!0),u?.(R,a),C(!1)},L=()=>{C(!0)},A=a=>{a.key==="Enter"&&(a.preventDefault(),L())},z=()=>{C(!1)},ae=()=>{C(!1),P(null,I,!0)};return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(f.TextField,{...m,ref:b,inputRef:T,size:l,value:I,onChange:r?void 0:a=>{let R=a.target.value;x(R),P(a,R)},autoComplete:"off",spellCheck:i,onKeyDown:r?void 0:A,onBlur:r?void 0:a=>{V(a,I),s&&s(a)},sx:{...r?{"& .MuiOutlinedInput-root.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:"rgba(0, 0, 0, 0.23)",borderWidth:1},"& .MuiOutlinedInput-root:hover .MuiOutlinedInput-notchedOutline":{borderColor:"rgba(0, 0, 0, 0.23)"},"& .MuiInputLabel-root.Mui-focused":{color:"rgba(0, 0, 0, 0.6)"}}:{},...r&&{pointerEvents:"none"}},slotProps:{...m.slotProps,input:{...m.slotProps?.input,readOnly:r,endAdornment:r?void 0:(0,c.jsx)(f.InputAdornment,{position:"end",sx:{mr:l==="small"?-.5:.5},children:(0,c.jsx)(f.IconButton,{tabIndex:-1,onClick:L,edge:"end","aria-label":"\uC8FC\uC18C \uCC3E\uAE30",size:l,children:(0,c.jsx)(re.default,{sx:{fontSize:O}})})})}}}),(0,c.jsxs)(f.Dialog,{open:S,onClose:z,maxWidth:"sm",fullWidth:!0,slotProps:{paper:{sx:{height:"550px"}}},children:[(0,c.jsxs)(f.DialogTitle,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",pr:2},children:["\uC8FC\uC18C \uAC80\uC0C9",(0,c.jsx)(f.IconButton,{onClick:ae,size:"small",children:(0,c.jsx)(oe.default,{})})]}),(0,c.jsx)(f.DialogContent,{style:{padding:0},dividers:!0,children:(0,c.jsx)(Q,{onComplete:D,onClose:z,defaultQuery:I,style:{width:"100%",height:"100%"}})})]})]})}),Pe=(0,d.forwardRef)(function({form:t,name:n,onChange:r,...o},s){if(!t||typeof t.useValue!="function")throw new Error("AddressTextField form prop is missing. Provide a form from useForm or useGlobalForm.");if(!n)throw new Error("AddressTextField requires a name when form prop is provided.");let l=t.useValue(n),i=(0,d.useCallback)(u=>{t.handleFormChange(u),r?.(u)},[t,r]);return(0,c.jsx)(se,{...o,ref:s,name:n,value:l,onChange:i})}),le=(0,d.forwardRef)(function(t,n){return Z(t)?(0,c.jsx)(ne,{...ee(t)}):t.form?(0,c.jsx)(Pe,{...t,ref:n}):(0,c.jsx)(se,{...t,ref:n})});0&&(module.exports={AddressTextField});
2
2
  /**
3
3
  * useTextFieldBase.ts
4
4
  *