@ehfuse/mui-form-controls 3.1.61 → 3.2.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/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2025 KIM YOUNG JIN (ehfuse@gmail.com)
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2025 KIM YOUNG JIN (ehfuse@gmail.com)
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -79,6 +79,38 @@ npm install react-daum-postcode
79
79
  }
80
80
  ```
81
81
 
82
+ ## readonly 와 disabled (v3.2.0)
83
+
84
+ 모든 컨트롤에서 두 prop 의 의미를 다음과 같이 통일했습니다.
85
+
86
+ | prop | 조작 | 글자 | 렌더 |
87
+ | ---------------------- | -------- | -------- | ------------------------------------------- |
88
+ | (없음) | 가능 | 선명 | 실제 입력 컴포넌트 |
89
+ | `readonly` | 불가 | **선명** | 경량 박스(`ReadonlyDisplay`) — input 없음 |
90
+ | `disabled` | 불가 | **흐림** | 경량 박스 — input 없음 (readonly + 흐림) |
91
+ | `readonly readonlyInput` | 불가 | 선명 | 실제 입력 컴포넌트(`readOnly` + 조작 차단) |
92
+
93
+ - `disabled` 는 **`readonly` + 글자 흐림**입니다. 둘 다 주면 `disabled` 가 이깁니다.
94
+ - 텍스트 계열 컨트롤(TextField / NumberTextField / Date·Time / Select / LabelSelect / Autocomplete / Phone / Email / Jumin / BizNum / CorpNum / Password / Search / Clear / Address / TextArea)은
95
+ readonly·disabled 일 때 **실제 `<input>` 을 만들지 않고** 값만 그리므로, 읽기 전용 칸이 많은 화면(목록·상세)이 눈에 띄게 가벼워집니다.
96
+ - 마우스로 조작하는 컨트롤(Checkbox / Switch / RadioGroup / Slider / ToggleButton(Group) / Rating)은 표시 형태가 텍스트가 아니라 박스로 바꾸지 않고,
97
+ `readonly` 는 **흐려지지 않은 채 조작만 차단**하고 `disabled` 만 MUI 기본대로 흐려집니다.
98
+ - 값이 아닌 UI 형태가 중요한 `CardNumTextField` / `VerificationCodeTextField` / `TagsTextField` 는 박스 렌더 대상이 아니며, 위의 흐림 규칙만 따릅니다.
99
+
100
+ ### 진짜 입력칸이 필요할 때: `readonlyInput`
101
+
102
+ 박스 렌더에는 입력 요소가 없으므로 아래가 동작하지 않습니다. 필요하면 `readonlyInput` 으로 예전 동작을 되살리세요.
103
+
104
+ - 외부에서 `inputRef` 로 `focus()` / `select()` 하는 칸
105
+ - `sx` 에 `& .MuiInputBase-input` 등 입력 내부 셀렉터로 스타일을 거는 칸
106
+ - `slotProps` 로 넘긴 커스텀 adornment 중 start/end 이외의 것
107
+
108
+ ```tsx
109
+ <TextField label="메모" value={memo} readonly readonlyInput />
110
+ ```
111
+
112
+ > `readonlyLight` 는 v3.2.0 부터 기본 동작이 되어 **무시**됩니다(@deprecated). 지워도 되고 남겨둬도 무해합니다.
113
+
82
114
  ## 빠른 시작
83
115
 
84
116
  ```tsx
@@ -6,6 +6,7 @@
6
6
  * @author 김영진 (ehfuse@gmail.com)
7
7
  */
8
8
  import React from "react";
9
+ import type { SxProps, Theme } from "@mui/material/styles";
9
10
  export declare const TextArea: React.ForwardRefExoticComponent<import("./types").BaseTextFieldProps & {
10
11
  label?: string;
11
12
  value?: string;
@@ -18,7 +19,7 @@ export declare const TextArea: React.ForwardRefExoticComponent<import("./types")
18
19
  placeholder?: string;
19
20
  disabled?: boolean;
20
21
  fullWidth?: boolean;
21
- sx?: import("@mui/system").SxProps<import("@mui/material").Theme>;
22
+ sx?: SxProps<Theme>;
22
23
  inputProps?: React.TextareaHTMLAttributes<HTMLTextAreaElement>;
23
24
  inputRef?: React.Ref<HTMLTextAreaElement>;
24
25
  slotProps?: {
@@ -7,4 +7,9 @@
7
7
  */
8
8
  import React from "react";
9
9
  import type { BaseTextFieldProps } from "./types";
10
+ /** slotProps.input 에서 start/endAdornment 만 뽑아 박스 렌더에 넘긴다(함수형 slotProps 는 무시). */
11
+ export declare function pickAdornments(slotProps: unknown): {
12
+ startAdornment?: React.ReactNode;
13
+ endAdornment?: React.ReactNode;
14
+ };
10
15
  export declare const TextField: React.ForwardRefExoticComponent<(Omit<import("@mui/material").FilledTextFieldProps & BaseTextFieldProps, "ref"> | Omit<import("@mui/material").OutlinedTextFieldProps & BaseTextFieldProps, "ref"> | Omit<import("@mui/material").StandardTextFieldProps & BaseTextFieldProps, "ref">) & React.RefAttributes<HTMLDivElement>>;
package/dist/address.js CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";var J=Object.create;var L=Object.defineProperty;var X=Object.getOwnPropertyDescriptor;var Z=Object.getOwnPropertyNames;var ee=Object.getPrototypeOf,te=Object.prototype.hasOwnProperty;var ne=(o,r)=>{for(var e in r)L(o,e,{get:r[e],enumerable:!0})},U=(o,r,e,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let t of Z(r))!te.call(o,t)&&t!==e&&L(o,t,{get:()=>r[t],enumerable:!(n=X(r,t))||n.enumerable});return o};var M=(o,r,e)=>(e=o!=null?J(ee(o)):{},U(r||!o||!o.__esModule?L(e,"default",{value:o,enumerable:!0}):e,o)),re=o=>U(L({},"__esModule",{value:!0}),o);var ce={};ne(ce,{AddressTextField:()=>N});module.exports=re(ce);var d=require("@mui/material"),G=M(require("@mui/icons-material/Search")),K=M(require("@mui/icons-material/Close")),c=require("react");var v=M(require("react")),x=function(o,r){return x=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var t in n)n.hasOwnProperty(t)&&(e[t]=n[t])},x(o,r)},b=function(){return b=Object.assign||function(o){for(var r,e=1,n=arguments.length;e<n;e++)for(var t in r=arguments[e])Object.prototype.hasOwnProperty.call(r,t)&&(o[t]=r[t]);return o},b.apply(this,arguments)};function oe(o,r){var e={};for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&r.indexOf(n)<0&&(e[n]=o[n]);if(o!=null&&typeof Object.getOwnPropertySymbols=="function"){var t=0;for(n=Object.getOwnPropertySymbols(o);t<n.length;t++)r.indexOf(n[t])<0&&Object.prototype.propertyIsEnumerable.call(o,n[t])&&(e[n[t]]=o[n[t]])}return e}var P,j="https://t1.kakaocdn.net/mapjsapi/bundle/postcode/prod/postcode.v2.js",se=(P=null,function(o){return o===void 0&&(o=j),P||(P=new Promise((function(r,e){var n=document.createElement("script");n.src=o,n.onload=function(){var t,m,i,u=(m=(t=window?.kakao)===null||t===void 0?void 0:t.Postcode)!==null&&m!==void 0?m:(i=window?.daum)===null||i===void 0?void 0:i.Postcode;if(u)return r(u);e(new Error("Script is loaded successfully, but cannot find Postcode module. Check your scriptURL property."))},n.onerror=function(t){return e(t)},n.id="kakao_postcode_script",document.body.appendChild(n)})))}),ue=v.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."),ae={width:"100%",height:400},le={scriptUrl:j,errorMessage:ue,autoClose:!0},B=(function(o){function r(){var e=o!==null&&o.apply(this,arguments)||this;return e.mounted=!1,e.wrap=(0,v.createRef)(),e.state={hasError:!1,completed:!1},e.initiate=function(n){if(e.wrap.current){var t=e.props;t.scriptUrl,t.className,t.style;var m=t.defaultQuery,i=t.autoClose;t.errorMessage;var u=t.onComplete,l=t.onClose,f=t.onResize,p=t.onSearch,y=oe(t,["scriptUrl","className","style","defaultQuery","autoClose","errorMessage","onComplete","onClose","onResize","onSearch"]);new n(b(b({},y),{oncomplete:function(R){u&&u(R),e.setState({completed:!0})},onsearch:p,onresize:f,onclose:l,width:"100%",height:"100%"})).embed(e.wrap.current,{q:m,autoClose:i})}},e.onError=function(n){console.error(n),e.setState({hasError:!0})},e}return(function(e,n){function t(){this.constructor=e}x(e,n),e.prototype=n===null?Object.create(n):(t.prototype=n.prototype,new t)})(r,o),r.prototype.componentDidMount=function(){var e=this.initiate,n=this.onError,t=this.props.scriptUrl;t&&(this.mounted||(se(t).then(e).catch(n),this.mounted=!0))},r.prototype.render=function(){var e=this.props,n=e.className,t=e.style,m=e.errorMessage,i=e.autoClose,u=this.state,l=u.hasError,f=u.completed;return i===!0&&f===!0?null:v.default.createElement("div",{ref:this.wrap,className:n,style:b(b({},ae),t)},l&&m)},r.defaultProps=le,r})(v.Component);var h=require("react");function D({name:o="",debounce:r,onChange:e}){let n=(0,h.useRef)(""),t=(0,h.useRef)(null);(0,h.useEffect)(()=>()=>{t.current&&clearTimeout(t.current)},[]);let m=(0,h.useCallback)((u,l,f=!1)=>{if(l===n.current)return;let p=()=>{if(l!==n.current&&(n.current=l,e)){let y={...u||{},target:{...u?.target||{},name:o,value:l}};e(y)}};t.current&&clearTimeout(t.current),f||r===void 0||r===0?p():t.current=setTimeout(p,r)},[e,r,o]),i=(0,h.useCallback)((u,l)=>{if(t.current&&(clearTimeout(t.current),t.current=null),l!==n.current&&(n.current=l,e)){let f={...u,target:{...u.target,name:o,value:l}};e(f)}},[e,o]);return{emitChange:m,flushOnBlur:i,lastEmittedValue:n,debounceTimer:t}}var O=require("react");var A=require("react");var F=require("react");var S=require("react");var a=require("react/jsx-runtime");var $=(0,c.forwardRef)(function({value:r,onChange:e,readonly:n,debounce:t,onBlur:m,size:i,spellCheck:u=!1,onAddressComplete:l,inputRef:f,...p},y){let R=(0,c.useRef)(null);(0,c.useImperativeHandle)(f,()=>R.current,[]);let[w,I]=(0,c.useState)(typeof r=="string"?r:""),[_,C]=(0,c.useState)(!1),Y=i==="small"?20:24,{emitChange:H,flushOnBlur:W,lastEmittedValue:T}=D({name:p.name,debounce:t,onChange:e});(0,c.useEffect)(()=>{if(r!=null){let s=String(r);s!==T.current&&(I(s),T.current=s)}else T.current!==""&&(I(""),T.current="")},[r,T]);let q=s=>{let g=s.address,E="";s.addressType==="R"&&(s.bname!==""&&/[동|로|가]$/g.test(s.bname)&&(E+=s.bname),s.buildingName!==""&&s.apartment==="Y"&&(E+=E!==""?", "+s.buildingName:s.buildingName),E!==""&&(E=" ("+E+")"),g+=E),I(g),H(null,g,!0),l?.(g,s),C(!1)},k=()=>{C(!0)},Q=s=>{s.key==="Enter"&&(s.preventDefault(),k())},V=()=>{C(!1)},z=()=>{C(!1),H(null,w,!0)};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(d.TextField,{...p,ref:y,inputRef:R,size:i,value:w,onChange:n?void 0:s=>{let g=s.target.value;I(g),H(s,g)},autoComplete:"off",spellCheck:u,onKeyDown:n?void 0:Q,onBlur:n?void 0:s=>{W(s,w),m&&m(s)},sx:{...n?{"& .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)"}}:{},...n&&{pointerEvents:"none"}},slotProps:{...p.slotProps,input:{...p.slotProps?.input,readOnly:n,endAdornment:n?void 0:(0,a.jsx)(d.InputAdornment,{position:"end",sx:{mr:i==="small"?-.5:.5},children:(0,a.jsx)(d.IconButton,{tabIndex:-1,onClick:k,edge:"end","aria-label":"\uC8FC\uC18C \uCC3E\uAE30",size:i,children:(0,a.jsx)(G.default,{sx:{fontSize:Y}})})})}}}),(0,a.jsxs)(d.Dialog,{open:_,onClose:V,maxWidth:"sm",fullWidth:!0,slotProps:{paper:{sx:{height:"550px"}}},children:[(0,a.jsxs)(d.DialogTitle,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",pr:2},children:["\uC8FC\uC18C \uAC80\uC0C9",(0,a.jsx)(d.IconButton,{onClick:z,size:"small",children:(0,a.jsx)(K.default,{})})]}),(0,a.jsx)(d.DialogContent,{style:{padding:0},dividers:!0,children:(0,a.jsx)(B,{onComplete:q,onClose:V,defaultQuery:w,style:{width:"100%",height:"100%"}})})]})]})}),ie=(0,c.forwardRef)(function({form:r,name:e,onChange:n,...t},m){if(!r||typeof r.useValue!="function")throw new Error("AddressTextField form prop is missing. Provide a form from useForm or useGlobalForm.");if(!e)throw new Error("AddressTextField requires a name when form prop is provided.");let i=r.useValue(e),u=(0,c.useCallback)(l=>{r.handleFormChange(l),n?.(l)},[r,n]);return(0,a.jsx)($,{...t,ref:m,name:e,value:i,onChange:u})}),N=(0,c.forwardRef)(function(r,e){return r.form?(0,a.jsx)(ie,{...r,ref:e}):(0,a.jsx)($,{...r,ref:e})});0&&(module.exports={AddressTextField});
1
+ "use strict";var ae=Object.create;var D=Object.defineProperty;var ie=Object.getOwnPropertyDescriptor;var ue=Object.getOwnPropertyNames;var ce=Object.getPrototypeOf,de=Object.prototype.hasOwnProperty;var me=(e,t)=>{for(var n in t)D(e,n,{get:t[n],enumerable:!0})},_=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of ue(t))!de.call(e,o)&&o!==n&&D(e,o,{get:()=>t[o],enumerable:!(r=ie(t,o))||r.enumerable});return e};var S=(e,t,n)=>(n=e!=null?ae(ce(e)):{},_(t||!e||!e.__esModule?D(n,"default",{value:e,enumerable:!0}):n,e)),fe=e=>_(D({},"__esModule",{value:!0}),e);var Ce={};me(Ce,{AddressTextField:()=>re});module.exports=fe(Ce);var p=require("@mui/material"),ee=S(require("@mui/icons-material/Search")),te=S(require("@mui/icons-material/Close")),d=require("react");var g=S(require("react")),V=function(e,t){return V=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])},V(e,t)},C=function(){return C=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},C.apply(this,arguments)};function pe(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 A,Y="https://t1.kakaocdn.net/mapjsapi/bundle/postcode/prod/postcode.v2.js",he=(A=null,function(e){return e===void 0&&(e=Y),A||(A=new Promise((function(t,n){var r=document.createElement("script");r.src=e,r.onload=function(){var o,i,s,a=(i=(o=window?.kakao)===null||o===void 0?void 0:o.Postcode)!==null&&i!==void 0?i:(s=window?.daum)===null||s===void 0?void 0:s.Postcode;if(a)return t(a);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)})))}),ge=g.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."),ve={width:"100%",height:400},be={scriptUrl:Y,errorMessage:ge,autoClose:!0},z=(function(e){function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.mounted=!1,n.wrap=(0,g.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 i=o.defaultQuery,s=o.autoClose;o.errorMessage;var a=o.onComplete,u=o.onClose,h=o.onResize,f=o.onSearch,b=pe(o,["scriptUrl","className","style","defaultQuery","autoClose","errorMessage","onComplete","onClose","onResize","onSearch"]);new r(C(C({},b),{oncomplete:function(w){a&&a(w),n.setState({completed:!0})},onsearch:f,onresize:h,onclose:u,width:"100%",height:"100%"})).embed(n.wrap.current,{q:i,autoClose:s})}},n.onError=function(r){console.error(r),n.setState({hasError:!0})},n}return(function(n,r){function o(){this.constructor=n}V(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,i=n.errorMessage,s=n.autoClose,a=this.state,u=a.hasError,h=a.completed;return s===!0&&h===!0?null:g.default.createElement("div",{ref:this.wrap,className:r,style:C(C({},ve),o)},u&&i)},t.defaultProps=be,t})(g.Component);var v=require("react");function U({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 i=(0,v.useCallback)((a,u,h=!1)=>{if(u===r.current)return;let f=()=>{if(u!==r.current&&(r.current=u,n)){let b={...a||{},target:{...a?.target||{},name:e,value:u}};n(b)}};o.current&&clearTimeout(o.current),h||t===void 0||t===0?f():o.current=setTimeout(f,t)},[n,t,e]),s=(0,v.useCallback)((a,u)=>{if(o.current&&(clearTimeout(o.current),o.current=null),u!==r.current&&(r.current=u,n)){let h={...a,target:{...a.target,name:e,value:u}};n(h)}},[n,e]);return{emitChange:i,flushOnBlur:s,lastEmittedValue:r,debounceTimer:o}}var B=require("react");var N=require("react");var j=require("react");var W=require("react");var R=require("@mui/material/styles"),q=require("@mui/material"),m=require("react/jsx-runtime");var ye=(0,R.styled)(q.Box,{shouldForwardProp:e=>e!=="small"&&e!=="fullWidth"&&e!=="dimmed"})(({theme:e,small:t,fullWidth:n,dimmed:r})=>({position:"relative",display:"inline-flex",alignItems:"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,R.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}}})),Re=(0,R.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"})),we=(0,R.styled)("div",{shouldForwardProp:e=>e!=="align"&&e!=="small"&&e!=="multiline"})(({align:e,small:t,multiline:n})=>({display:"flex",alignItems:n?"flex-start":"center",gap:4,width:"100%",padding:t?"8.5px 14px":"16.5px 14px",fontSize:"1rem",lineHeight:"1.4375em",justifyContent:e==="right"?"flex-end":e==="center"?"center":"flex-start",minWidth:0})),Te=(0,R.styled)("span",{shouldForwardProp:e=>e!=="multiline"})(({multiline:e})=>({minWidth:0,flex:e?1:void 0,overflow:"hidden",whiteSpace:e?"pre-wrap":"nowrap",overflowWrap:e?"anywhere":void 0,textOverflow:e?void 0:"ellipsis"})),F=(0,R.styled)("span",{shouldForwardProp:e=>e!=="pushRight"})(({theme:e,pushRight:t})=>({flexShrink:0,display:"inline-flex",alignItems:"center",marginLeft:t?"auto":void 0,color:e.palette.text.secondary}));function G({label:e,value:t,prefix:n,suffix:r,startAdornment:o,endAdornment:i,showAffixOnlyWithValue:s=!1,align:a="left",size:u="medium",fullWidth:h,dimmed:f=!1,multiline:b=!1,onClick:w,title:T,className:I,id:O,sx:x}){let H=u==="small",P=!(t==null||t===""),M=!s||P;return(0,m.jsxs)(ye,{small:H,fullWidth:h,dimmed:f,className:I,id:O,title:T,onClick:w,sx:x,children:[(0,m.jsx)(Ee,{"aria-hidden":"true",dimmed:f,children:(0,m.jsx)("legend",{children:e?(0,m.jsx)("span",{children:e}):(0,m.jsx)("span",{children:"\u200B"})})}),e?(0,m.jsx)(Re,{dimmed:f,children:e}):null,(0,m.jsxs)(we,{align:a,small:H,multiline:b,children:[o?(0,m.jsx)(F,{children:o}):null,n&&M?(0,m.jsx)(F,{children:n}):null,(0,m.jsx)(Te,{multiline:b,children:t}),r&&M?(0,m.jsx)(F,{children:r}):null,i?(0,m.jsx)(F,{pushRight:a!=="right",children:i}):null]})]})}var k=require("react/jsx-runtime");function Q(e){return!!(e.readonly||e.disabled)&&!e.readonlyInput}function J(e){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,sx:e.sx}}function X(e,t){return t?t(e):e==null?"":String(e)}function Ie({form:e,name:t,value:n,format:r,disabled:o,...i}){let s=e.useValue(t);return(0,k.jsx)(G,{...i,value:X(s===void 0?n:s,r),dimmed:!!o})}function Z(e){if(e.form&&e.name&&typeof e.form.useValue=="function")return(0,k.jsx)(Ie,{...e});let{form:t,name:n,value:r,format:o,disabled:i,...s}=e;return(0,k.jsx)(G,{...s,value:X(r,o),dimmed:!!i})}var c=require("react/jsx-runtime");var ne=(0,d.forwardRef)(function({value:t,onChange:n,readonly:r,debounce:o,onBlur:i,size:s,spellCheck:a=!1,onAddressComplete:u,inputRef:h,...f},b){let w=(0,d.useRef)(null);(0,d.useImperativeHandle)(h,()=>w.current,[]);let[T,I]=(0,d.useState)(typeof t=="string"?t:""),[O,x]=(0,d.useState)(!1),H=s==="small"?20:24,{emitChange:P,flushOnBlur:M,lastEmittedValue:L}=U({name:f.name,debounce:o,onChange:n});(0,d.useEffect)(()=>{if(t!=null){let l=String(t);l!==L.current&&(I(l),L.current=l)}else L.current!==""&&(I(""),L.current="")},[t,L]);let oe=l=>{let y=l.address,E="";l.addressType==="R"&&(l.bname!==""&&/[동|로|가]$/g.test(l.bname)&&(E+=l.bname),l.buildingName!==""&&l.apartment==="Y"&&(E+=E!==""?", "+l.buildingName:l.buildingName),E!==""&&(E=" ("+E+")"),y+=E),I(y),P(null,y,!0),u?.(y,l),x(!1)},K=()=>{x(!0)},se=l=>{l.key==="Enter"&&(l.preventDefault(),K())},$=()=>{x(!1)},le=()=>{x(!1),P(null,T,!0)};return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(p.TextField,{...f,ref:b,inputRef:w,size:s,value:T,onChange:r?void 0:l=>{let y=l.target.value;I(y),P(l,y)},autoComplete:"off",spellCheck:a,onKeyDown:r?void 0:se,onBlur:r?void 0:l=>{M(l,T),i&&i(l)},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:{...f.slotProps,input:{...f.slotProps?.input,readOnly:r,endAdornment:r?void 0:(0,c.jsx)(p.InputAdornment,{position:"end",sx:{mr:s==="small"?-.5:.5},children:(0,c.jsx)(p.IconButton,{tabIndex:-1,onClick:K,edge:"end","aria-label":"\uC8FC\uC18C \uCC3E\uAE30",size:s,children:(0,c.jsx)(ee.default,{sx:{fontSize:H}})})})}}}),(0,c.jsxs)(p.Dialog,{open:O,onClose:$,maxWidth:"sm",fullWidth:!0,slotProps:{paper:{sx:{height:"550px"}}},children:[(0,c.jsxs)(p.DialogTitle,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",pr:2},children:["\uC8FC\uC18C \uAC80\uC0C9",(0,c.jsx)(p.IconButton,{onClick:le,size:"small",children:(0,c.jsx)(te.default,{})})]}),(0,c.jsx)(p.DialogContent,{style:{padding:0},dividers:!0,children:(0,c.jsx)(z,{onComplete:oe,onClose:$,defaultQuery:T,style:{width:"100%",height:"100%"}})})]})]})}),xe=(0,d.forwardRef)(function({form:t,name:n,onChange:r,...o},i){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 s=t.useValue(n),a=(0,d.useCallback)(u=>{t.handleFormChange(u),r?.(u)},[t,r]);return(0,c.jsx)(ne,{...o,ref:i,name:n,value:s,onChange:a})}),re=(0,d.forwardRef)(function(t,n){return Q(t)?(0,c.jsx)(Z,{...J(t)}):t.form?(0,c.jsx)(xe,{...t,ref:n}):(0,c.jsx)(ne,{...t,ref:n})});0&&(module.exports={AddressTextField});
2
2
  /**
3
3
  * useTextFieldBase.ts
4
4
  *
@@ -38,6 +38,42 @@
38
38
  * @copyright 2025 김영진 (Kim Young Jin)
39
39
  * @author 김영진 (ehfuse@gmail.com)
40
40
  */
41
+ /**
42
+ * ReadonlyDisplay.tsx
43
+ *
44
+ * readonly / disabled 입력칸을 "실제 <input> 없이" 그리는 표시 컴포넌트.
45
+ *
46
+ * mfc 의 readonly / disabled 는 기본적으로 이 컴포넌트로 렌더된다.
47
+ * - readonly : 조작 불가 + 글자색은 편집 가능할 때와 동일(흐려지지 않음).
48
+ * - disabled : 조작 불가 + 글자/라벨/테두리가 흐려짐(`dimmed`).
49
+ *
50
+ * 외관은 MUI OutlinedInput 마크업(fieldset+legend)을 그대로 따르므로 테마의 기본 테두리/반경/색을 물려받고,
51
+ * 실제 입력 요소/IME/포커스 머신러리가 없어 렌더 비용이 크게 낮다.
52
+ * 실제 <input> 이 꼭 필요하면 소비처가 `readonlyInput` prop 으로 예전 동작(진짜 입력칸)을 되살릴 수 있다.
53
+ *
54
+ * @license MIT
55
+ * @copyright 2025 김영진 (Kim Young Jin)
56
+ * @author 김영진 (ehfuse@gmail.com)
57
+ */
58
+ /**
59
+ * ReadonlyField.tsx
60
+ *
61
+ * mfc 컨트롤들이 readonly / disabled 상태에서 공통으로 쓰는 "박스 표시" 진입점.
62
+ *
63
+ * 설계 규칙 (v3.2.0 부터):
64
+ * - `readonly` : 실제 <input> 대신 {@link ReadonlyDisplay} 박스로 렌더. 글자색은 편집 상태와 동일(흐려지지 않음).
65
+ * - `disabled` : 같은 박스로 렌더하되 글자/라벨/테두리를 흐리게(dimmed) 그린다. 즉 disabled = readonly + 흐림.
66
+ * - `readonlyInput` : 예전처럼 진짜 입력칸을 렌더한다(포커스/선택/커스텀 adornment 가 꼭 필요한 칸의 탈출구).
67
+ * - `readonlyLight` : v3.2.0 에서 기본 동작이 되었으므로 무시된다(@deprecated).
68
+ *
69
+ * 훅 개수 안정성: 박스 분기는 **훅을 가진 Base 컴포넌트 바깥(export 래퍼)** 에서 한다.
70
+ * Base 안에서 early-return 하면 readonly/disabled 플래그가 런타임에 뒤집힐 때 훅 개수가 달라져 React 가 죽는다.
71
+ * 서로 다른 컴포넌트 타입으로 갈라지면 React 가 언마운트/마운트로 처리해 안전하다.
72
+ *
73
+ * @license MIT
74
+ * @copyright 2025 김영진 (Kim Young Jin)
75
+ * @author 김영진 (ehfuse@gmail.com)
76
+ */
41
77
  /**
42
78
  * AddressTextField.tsx
43
79
  *