@bwg-ui/core 1.1.21 → 1.1.23
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/chunks/BwgSwitch-B79pseQM.js +269 -0
- package/dist/chunks/BwgSwitch-B79pseQM.js.map +1 -0
- package/dist/chunks/BwgSwitch-CAI-kEaM.cjs +2 -0
- package/dist/chunks/BwgSwitch-CAI-kEaM.cjs.map +1 -0
- package/dist/chunks/{BwgDownload-COsACbpJ.js → BwgUploader-BcVlE61B.js} +2933 -2982
- package/dist/chunks/BwgUploader-BcVlE61B.js.map +1 -0
- package/dist/chunks/BwgUploader-DaNV2URT.cjs +3 -0
- package/dist/chunks/BwgUploader-DaNV2URT.cjs.map +1 -0
- package/dist/chunks/LoadingOverlay-DAZJF5wg.js +19 -0
- package/dist/chunks/LoadingOverlay-DAZJF5wg.js.map +1 -0
- package/dist/chunks/LoadingOverlay-DcmKvoZA.cjs +2 -0
- package/dist/chunks/LoadingOverlay-DcmKvoZA.cjs.map +1 -0
- package/dist/chunks/{SSOHandler-BHJ5NexT.js → SSOHandler-CkPcSHIm.js} +12085 -10934
- package/dist/chunks/SSOHandler-CkPcSHIm.js.map +1 -0
- package/dist/chunks/SSOHandler-DiW4Ft9i.cjs +237 -0
- package/dist/chunks/SSOHandler-DiW4Ft9i.cjs.map +1 -0
- package/dist/chunks/{SearchBoxContext-BxJN-x3-.js → SearchBoxContext-BCvEYyFk.js} +7 -7
- package/dist/chunks/{SearchBoxContext-BxJN-x3-.js.map → SearchBoxContext-BCvEYyFk.js.map} +1 -1
- package/dist/chunks/{SearchBoxContext-DnQGaRgo.cjs → SearchBoxContext-DwFDOyYG.cjs} +2 -2
- package/dist/chunks/{SearchBoxContext-DnQGaRgo.cjs.map → SearchBoxContext-DwFDOyYG.cjs.map} +1 -1
- package/dist/chunks/{ViewContainer-HSyLfryI.cjs → ViewContainer-Bhq22_B3.cjs} +2 -2
- package/dist/chunks/{ViewContainer-HSyLfryI.cjs.map → ViewContainer-Bhq22_B3.cjs.map} +1 -1
- package/dist/chunks/{ViewContainer-x2yzKkIG.js → ViewContainer-CjpJqoGG.js} +2 -2
- package/dist/chunks/{ViewContainer-x2yzKkIG.js.map → ViewContainer-CjpJqoGG.js.map} +1 -1
- package/dist/chunks/apiUtils-BZ6s0_NI.cjs +3 -0
- package/dist/chunks/apiUtils-BZ6s0_NI.cjs.map +1 -0
- package/dist/chunks/apiUtils-DxzLqPhU.js +1441 -0
- package/dist/chunks/apiUtils-DxzLqPhU.js.map +1 -0
- package/dist/chunks/{codeStore-DefmZVgs.js → codeStore-CfI4Wh5M.js} +4 -4
- package/dist/chunks/{codeStore-DefmZVgs.js.map → codeStore-CfI4Wh5M.js.map} +1 -1
- package/dist/chunks/{codeStore-pQbDqWkZ.cjs → codeStore-il4-kZPe.cjs} +2 -2
- package/dist/chunks/{codeStore-pQbDqWkZ.cjs.map → codeStore-il4-kZPe.cjs.map} +1 -1
- package/dist/chunks/core-BHejg5iS.cjs +2 -0
- package/dist/chunks/core-BHejg5iS.cjs.map +1 -0
- package/dist/chunks/core-bHd8azE6.js +514 -0
- package/dist/chunks/core-bHd8azE6.js.map +1 -0
- package/dist/chunks/enc-base64-BQYwLKgk.js +102 -0
- package/dist/chunks/enc-base64-BQYwLKgk.js.map +1 -0
- package/dist/chunks/enc-base64-BkBtNBQV.cjs +2 -0
- package/dist/chunks/enc-base64-BkBtNBQV.cjs.map +1 -0
- package/dist/chunks/{favoriteStore-BXBziAgB.cjs → favoriteStore-CcKg_nEH.cjs} +2 -2
- package/dist/chunks/{favoriteStore-BXBziAgB.cjs.map → favoriteStore-CcKg_nEH.cjs.map} +1 -1
- package/dist/chunks/{favoriteStore-DAPC01iF.js → favoriteStore-Cemc-26t.js} +2 -2
- package/dist/chunks/{favoriteStore-DAPC01iF.js.map → favoriteStore-Cemc-26t.js.map} +1 -1
- package/dist/chunks/{popupStore-CcQg9AvK.js → popupStore-Bi6o78lP.js} +2 -2
- package/dist/chunks/{popupStore-CcQg9AvK.js.map → popupStore-Bi6o78lP.js.map} +1 -1
- package/dist/chunks/{popupStore-BV632k5p.cjs → popupStore-DUApUBF2.cjs} +2 -2
- package/dist/chunks/{popupStore-BV632k5p.cjs.map → popupStore-DUApUBF2.cjs.map} +1 -1
- package/dist/chunks/sha256-BZfJs28k.js +79 -0
- package/dist/chunks/sha256-BZfJs28k.js.map +1 -0
- package/dist/chunks/sha256-DiIRoCQ8.cjs +2 -0
- package/dist/chunks/sha256-DiIRoCQ8.cjs.map +1 -0
- package/dist/chunks/{usePopup-Cw5xsOaH.js → usePopup-BSqsnSz7.js} +3 -3
- package/dist/chunks/{usePopup-Cw5xsOaH.js.map → usePopup-BSqsnSz7.js.map} +1 -1
- package/dist/chunks/{usePopup-DoVGuobp.cjs → usePopup-D2JEuDrO.cjs} +2 -2
- package/dist/chunks/{usePopup-DoVGuobp.cjs.map → usePopup-D2JEuDrO.cjs.map} +1 -1
- package/dist/components/common/BwgDraggable.d.ts +1 -1
- package/dist/components/common/BwgDraggable.d.ts.map +1 -1
- package/dist/components/common/BwgEditor.d.ts +43 -36
- package/dist/components/common/BwgEditor.d.ts.map +1 -1
- package/dist/components/common/BwgGrid.d.ts +13 -5
- package/dist/components/common/BwgGrid.d.ts.map +1 -1
- package/dist/components/common/BwgPagination.d.ts +25 -5
- package/dist/components/common/BwgPagination.d.ts.map +1 -1
- package/dist/components/common/BwgView.d.ts.map +1 -1
- package/dist/components/common/index.cjs +1 -1
- package/dist/components/common/index.js +1 -1
- package/dist/components/core/BwgCheck.d.ts +11 -0
- package/dist/components/core/BwgCheck.d.ts.map +1 -1
- package/dist/components/core/BwgDownload.d.ts.map +1 -1
- package/dist/components/core/BwgSelect.d.ts +2 -2
- package/dist/components/core/BwgSelect.d.ts.map +1 -1
- package/dist/components/core/BwgSwitch.d.ts +24 -0
- package/dist/components/core/BwgSwitch.d.ts.map +1 -0
- package/dist/components/core/index.cjs +1 -1
- package/dist/components/core/index.d.ts +20 -19
- package/dist/components/core/index.d.ts.map +1 -1
- package/dist/components/core/index.js +22 -21
- package/dist/components/layout/LoadingOverlay.d.ts +3 -3
- package/dist/components/layout/LoadingOverlay.d.ts.map +1 -1
- package/dist/components/layout/index.cjs +1 -1
- package/dist/components/layout/index.js +2 -2
- package/dist/components/popup/MenuReport.d.ts.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +116 -115
- package/dist/provider/index.cjs +1 -1
- package/dist/provider/index.js +2 -2
- package/dist/stores/index.cjs +1 -1
- package/dist/stores/index.cjs.map +1 -1
- package/dist/stores/index.d.ts +7 -7
- package/dist/stores/index.d.ts.map +1 -1
- package/dist/stores/index.js +16 -15
- package/dist/stores/index.js.map +1 -1
- package/dist/stores/loadingStore.d.ts +1 -0
- package/dist/stores/loadingStore.d.ts.map +1 -1
- package/dist/stores/menuModelStore.d.ts.map +1 -1
- package/dist/styles/assets/images/header/icon/ico-bell.svg +3 -3
- package/dist/styles/assets/images/header/icon/ico-logout.svg +10 -10
- package/dist/styles/assets/images/header/icon/ico-setting.svg +4 -4
- package/dist/styles/assets/images/header/icon/ico-sidebar-arrow.svg +3 -3
- package/dist/styles/layout.css +14 -1
- package/dist/utils/apiUtils.d.ts +4 -8
- package/dist/utils/apiUtils.d.ts.map +1 -1
- package/dist/utils/commonUtils.d.ts +6 -0
- package/dist/utils/commonUtils.d.ts.map +1 -1
- package/dist/utils/index.cjs +1 -1
- package/dist/utils/index.cjs.map +1 -1
- package/dist/utils/index.d.ts +0 -1
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +53 -54
- package/dist/utils/index.js.map +1 -1
- package/package.json +2 -1
- package/dist/chunks/BwgCheck-BDt8r0gn.js +0 -200
- package/dist/chunks/BwgCheck-BDt8r0gn.js.map +0 -1
- package/dist/chunks/BwgCheck-Dtzr-6rg.cjs +0 -2
- package/dist/chunks/BwgCheck-Dtzr-6rg.cjs.map +0 -1
- package/dist/chunks/BwgDownload-COsACbpJ.js.map +0 -1
- package/dist/chunks/BwgDownload-i6w7ZD-i.cjs +0 -3
- package/dist/chunks/BwgDownload-i6w7ZD-i.cjs.map +0 -1
- package/dist/chunks/LoadingOverlay-CAO6_FuF.js +0 -29
- package/dist/chunks/LoadingOverlay-CAO6_FuF.js.map +0 -1
- package/dist/chunks/LoadingOverlay-NX9Mo_6n.cjs +0 -2
- package/dist/chunks/LoadingOverlay-NX9Mo_6n.cjs.map +0 -1
- package/dist/chunks/SSOHandler-BHJ5NexT.js.map +0 -1
- package/dist/chunks/SSOHandler-BtrmIPzQ.cjs +0 -236
- package/dist/chunks/SSOHandler-BtrmIPzQ.cjs.map +0 -1
- package/dist/chunks/apiUtils-CudW_FKE.cjs +0 -3
- package/dist/chunks/apiUtils-CudW_FKE.cjs.map +0 -1
- package/dist/chunks/apiUtils-DfPv_gmI.js +0 -2064
- package/dist/chunks/apiUtils-DfPv_gmI.js.map +0 -1
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";const r=require("./jsx-runtime-CeSfJrVB.cjs"),i=require("antd"),f=require("react"),c=require("dayjs"),x=f.memo(({children:n,label:e,name:s,rules:a,initialValue:o,style:l,...u})=>{const m={fontWeight:"bold"},d=Array.isArray(a)&&a.some(g=>g.required===!0),t=()=>typeof e=="string"?r.jsxRuntimeExports.jsxs("span",{style:m,children:[e,d&&r.jsxRuntimeExports.jsx("span",{style:{color:"#ff4d4f",marginLeft:"4px"},children:"*"})]}):r.jsxRuntimeExports.jsx("span",{style:m,children:e});return r.jsxRuntimeExports.jsx(i.Form.Item,{className:"bwg-form-item",label:e?t():void 0,labelAlign:"left",name:s,rules:a,colon:!1,initialValue:o,style:l,...u,children:n})}),j=f.forwardRef(({children:n,labelCol:e,style:s,className:a,...o},l)=>r.jsxRuntimeExports.jsx(i.ConfigProvider,{form:{validateMessages:{required:"'${label}을(를) 입력해주세요.'"}},children:r.jsxRuntimeExports.jsx(i.Form,{ref:l,...o,requiredMark:!1,labelCol:e||{flex:"100px"},style:{padding:"10px",...s},className:`bwg-form ${a??""}`,children:n})}));j.displayName="BwgForm";const p=({itemProps:n,selectProps:e={options:[],allowClear:!0}})=>{const s=i.Form.useFormInstance(),a=!!s,o=f.useMemo(()=>e?.addField==="ALL"?[{label:"전체",value:""},...e?.options||[]]:e?.addField==="NULL"?[{label:"",value:""},...e?.options||[]]:e?.options||[],[e.options,e.addField]),l=d=>{e.onChange?.(d)},u={...e,allowClear:e.allowClear??!0,options:o,onChange:l,variant:e.variant},m=r.jsxRuntimeExports.jsx(i.Select,{...u,disabled:e.disabled});return e.copyable&&!a&&console.warn("BwgSelect: copyable 기능은 Form 컨텍스트 내에서만 사용 가능합니다."),e.copyable?r.jsxRuntimeExports.jsx(x,{...n,children:r.jsxRuntimeExports.jsxs(i.Space.Compact,{block:!0,children:[r.jsxRuntimeExports.jsx(i.Form.Item,{name:n?.name,rules:n?.rules,style:{width:"100%",marginBottom:0},validateStatus:"",help:"",children:m}),r.jsxRuntimeExports.jsx(i.Typography.Paragraph,{copyable:{text:a&&s?.getFieldValue(n?.name)?.toString()||"",tooltips:["코드복사","코드복사됨"]},style:{margin:0,backgroundColor:"#f5f5f5",borderRadius:"4px",border:"1px solid #d9d9d9",fontSize:"12px",color:"#666",display:"flex",alignItems:"center",height:"30px",padding:"0 8px"}})]})}):r.jsxRuntimeExports.jsx(x,{...n,children:m})},Y=({itemProps:n,inputProps:e})=>r.jsxRuntimeExports.jsx(x,{...n,children:r.jsxRuntimeExports.jsx(i.Input,{...e})}),{RangePicker:F}=i.DatePicker,h={year:{displayFormat:"YYYY",outputFormat:"YYYY"},month:{displayFormat:"YYYY-MM",outputFormat:"YYYYMM"},date:{displayFormat:"YYYY-MM-DD",outputFormat:"YYYYMMDD"},time:{displayFormat:"HH:mm",outputFormat:"HHmm"},datetime:{displayFormat:"YYYY-MM-DD HH:mm",outputFormat:"YYYYMMDDHHmm"}},R=({itemProps:n,inputProps:e,type:s="date",minDate:a,maxDate:o,returnType:l="string"})=>{const{displayFormat:u,outputFormat:m}=f.useMemo(()=>h[s],[s]),d=f.useMemo(()=>Object.values(h).map(t=>t.outputFormat).sort((t,g)=>{if(t.length===g.length){if(t===m)return-1;if(g===m)return 1}return g.length-t.length}),[m]);return r.jsxRuntimeExports.jsx(x,{...n,getValueProps:t=>({value:t&&t.length>0?[t[0]?c.isDayjs(t[0])?t[0]:c(t[0],d):null,t[1]?c.isDayjs(t[1])?t[1]:c(t[1],d):null]:null}),normalize:t=>t?l==="dayjs"?[t[0]??void 0,t[1]??void 0]:[t[0]?t[0].format(m):void 0,t[1]?t[1].format(m):void 0]:[void 0,void 0],children:r.jsxRuntimeExports.jsx(F,{...e,order:!0,minDate:a?c(a,d):void 0,maxDate:o?c(o,d):void 0,picker:s==="datetime"?"date":s,showTime:e?.showTime??(s==="datetime"||s==="time"),format:u})})},y=({itemProps:n,inputProps:e={format:"YN"}})=>{const s=i.Form.useFormInstance(),a=o=>{e.format==="boolean"?s.setFieldValue(n?.name,o.target.checked):s.setFieldValue(n?.name,o.target.checked?"Y":"N"),e.onChange&&e.onChange(o)};return r.jsxRuntimeExports.jsx(x,{...n,getValueProps:o=>(console.log("getValueProps :: ",o),{checked:e.format==="boolean"?!!o:o==="Y"}),normalize:o=>(console.log("normalize :: ",o),typeof o=="boolean"?e.format==="boolean"?o:o?"Y":"N":e.format==="boolean"?!!o:o?"Y":"N"),children:r.jsxRuntimeExports.jsx(i.Checkbox,{...e,onChange:a,children:e?.title})})};exports.BwgCheck=y;exports.BwgForm=j;exports.BwgFormItem=x;exports.BwgInput=Y;exports.BwgRangePicker=R;exports.BwgSelect=p;
|
|
2
|
-
//# sourceMappingURL=BwgCheck-Dtzr-6rg.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"BwgCheck-Dtzr-6rg.cjs","sources":["../../src/components/core/BwgFormItem.tsx","../../src/components/core/BwgForm.tsx","../../src/components/core/BwgSelect.tsx","../../src/components/core/BwgInput.tsx","../../src/components/core/BwgRangePicker.tsx","../../src/components/core/BwgCheck.tsx"],"sourcesContent":["import { Form, FormItemProps } from \"antd\";\r\nimport React from \"react\";\r\n\r\nexport interface BwgFormItemProps extends FormItemProps {\r\n /** 폼 아이템 이름 */\r\n name?: string | string[];\r\n /** 폼 아이템 라벨 */\r\n label?: string | React.ReactNode;\r\n /** 폼 아이템 규칙 */\r\n rules?: any;\r\n /** 폼 아이템 초기값 */\r\n initialValue?: any;\r\n /** 폼 아이템 자식 컴포넌트 */\r\n children?: React.ReactNode;\r\n}\r\n\r\n/** 입력 폼 아이템 컴포넌트 */\r\nconst BwgFormItem = React.memo(\r\n ({\r\n children,\r\n label,\r\n name,\r\n rules,\r\n initialValue,\r\n style,\r\n ...rest\r\n }: BwgFormItemProps) => {\r\n const labelStyle = {\r\n fontWeight: \"bold\",\r\n };\r\n\r\n // rules에서 required 필드 확인\r\n const isRequired =\r\n Array.isArray(rules) && rules.some((rule: any) => rule.required === true);\r\n\r\n // 라벨 렌더링 함수\r\n const renderLabel = () => {\r\n if (typeof label === \"string\") {\r\n return (\r\n <span style={labelStyle}>\r\n {label}\r\n {isRequired && (\r\n <span style={{ color: \"#ff4d4f\", marginLeft: \"4px\" }}>*</span>\r\n )}\r\n </span>\r\n );\r\n }\r\n return <span style={labelStyle}>{label}</span>;\r\n };\r\n\r\n return (\r\n <Form.Item\r\n className=\"bwg-form-item\"\r\n label={label ? renderLabel() : undefined}\r\n labelAlign=\"left\"\r\n name={name}\r\n rules={rules}\r\n colon={false}\r\n initialValue={initialValue}\r\n style={style}\r\n {...rest}\r\n >\r\n {children}\r\n </Form.Item>\r\n );\r\n }\r\n);\r\n\r\nexport default BwgFormItem;\r\n","import { ConfigProvider, Form, FormProps } from \"antd\";\r\nimport { forwardRef } from \"react\";\r\n\r\nexport interface BwgFormProps extends FormProps {\r\n children: React.ReactNode;\r\n}\r\n\r\nconst BwgForm = forwardRef<any, BwgFormProps>(\r\n ({ children, labelCol, style, className, ...props }, ref) => {\r\n return (\r\n <ConfigProvider\r\n form={{\r\n //기존 rule.message의 default message인 $name을를 입력해주세요를 변경\r\n validateMessages: { required: \"'${label}을(를) 입력해주세요.'\" },\r\n }}\r\n >\r\n <Form\r\n ref={ref}\r\n {...props}\r\n requiredMark={false}\r\n labelCol={labelCol || { flex: \"100px\" }}\r\n style={{ padding: \"10px\", ...style }}\r\n className={`bwg-form ${className ?? \"\"}`}\r\n >\r\n {children}\r\n </Form>\r\n </ConfigProvider>\r\n );\r\n }\r\n);\r\n\r\nBwgForm.displayName = \"BwgForm\";\r\n\r\nexport default BwgForm;\r\n","import { useMemo } from \"react\";\r\nimport { Form, Select, Space, Typography } from \"antd\";\r\nimport { LabeledValue, SelectProps } from \"antd/es/select\";\r\nimport BwgFormItem, { BwgFormItemProps } from \"./BwgFormItem\";\r\nimport { SimpleCodeItem } from \"../../stores/codeStore\";\r\n\r\nexport type SelectBoxProps = SelectProps & {\r\n addField?: \"ALL\" | \"NULL\";\r\n options: SimpleCodeItem[];\r\n copyable?: boolean;\r\n};\r\n\r\nexport interface BwgSelectProps {\r\n /** 폼 아이템 속성 */\r\n itemProps?: BwgFormItemProps;\r\n selectProps?: SelectBoxProps;\r\n}\r\n\r\nconst BwgSelect = ({\r\n itemProps,\r\n selectProps = {\r\n options: [],\r\n allowClear: true,\r\n },\r\n}: BwgSelectProps) => {\r\n // Form 컨텍스트 체크\r\n const form = Form.useFormInstance();\r\n const isFormContext = !!form;\r\n\r\n // 옵션 리스트 메모이제이션\r\n const optionList = useMemo(() => {\r\n if (selectProps?.addField === \"ALL\") {\r\n return [{ label: \"전체\", value: \"\" }, ...(selectProps?.options || [])];\r\n } else if (selectProps?.addField === \"NULL\") {\r\n return [{ label: \"\", value: \"\" }, ...(selectProps?.options || [])];\r\n } else {\r\n return selectProps?.options || [];\r\n }\r\n }, [selectProps.options, selectProps.addField]);\r\n\r\n const handleChange = (newValue: string) => {\r\n selectProps.onChange?.(newValue);\r\n };\r\n\r\n // Select 컴포넌트에 전달할 props\r\n const selectComponentProps = {\r\n ...selectProps,\r\n allowClear: selectProps.allowClear ?? true,\r\n options: optionList,\r\n onChange: handleChange,\r\n variant: selectProps.variant,\r\n };\r\n\r\n // console.log(\"selectComponentProps :: \", selectComponentProps);\r\n\r\n const selectComponent = (\r\n <Select {...selectComponentProps} disabled={selectProps.disabled} />\r\n );\r\n\r\n // copyable일 때 Form 컨텍스트 체크\r\n if (selectProps.copyable && !isFormContext) {\r\n console.warn(\r\n \"BwgSelect: copyable 기능은 Form 컨텍스트 내에서만 사용 가능합니다.\"\r\n );\r\n }\r\n\r\n if (selectProps.copyable) {\r\n return (\r\n <BwgFormItem {...itemProps}>\r\n <Space.Compact block>\r\n <Form.Item\r\n name={itemProps?.name}\r\n rules={itemProps?.rules}\r\n style={{ width: \"100%\", marginBottom: 0 }}\r\n validateStatus=\"\"\r\n help=\"\"\r\n >\r\n {selectComponent}\r\n </Form.Item>\r\n <Typography.Paragraph\r\n copyable={{\r\n text: isFormContext\r\n ? form?.getFieldValue(itemProps?.name)?.toString() || \"\"\r\n : \"\",\r\n tooltips: [\"코드복사\", \"코드복사됨\"],\r\n }}\r\n style={{\r\n margin: 0,\r\n backgroundColor: \"#f5f5f5\",\r\n borderRadius: \"4px\",\r\n border: \"1px solid #d9d9d9\",\r\n fontSize: \"12px\",\r\n color: \"#666\",\r\n display: \"flex\",\r\n alignItems: \"center\",\r\n height: \"30px\",\r\n padding: \"0 8px\",\r\n }}\r\n />\r\n </Space.Compact>\r\n </BwgFormItem>\r\n );\r\n } else {\r\n return <BwgFormItem {...itemProps}>{selectComponent}</BwgFormItem>;\r\n }\r\n};\r\n\r\nexport default BwgSelect;\r\n","import React from 'react';\r\nimport { Input, InputProps } from 'antd';\r\nimport BwgFormItem, { BwgFormItemProps } from './BwgFormItem';\r\n\r\nexport interface BwgInputProps {\r\n itemProps?: BwgFormItemProps;\r\n inputProps?: InputProps;\r\n}\r\n\r\nconst BwgInput: React.FC<BwgInputProps> = ({ itemProps, inputProps }) => {\r\n return (\r\n <BwgFormItem {...itemProps}>\r\n <Input {...inputProps} />\r\n </BwgFormItem>\r\n );\r\n};\r\n\r\nexport default BwgInput;\r\n","import React, { useMemo } from \"react\";\r\nimport { DatePicker } from \"antd\";\r\nimport BwgFormItem, { BwgFormItemProps } from \"./BwgFormItem\";\r\nimport { RangePickerProps } from \"antd/es/date-picker\";\r\nimport dayjs, { Dayjs } from \"dayjs\";\r\n\r\nconst { RangePicker } = DatePicker;\r\n\r\nexport interface BwgRangePickerProps {\r\n inputProps?: RangePickerProps;\r\n itemProps?: BwgFormItemProps;\r\n type?: \"year\" | \"month\" | \"date\" | \"time\" | \"datetime\";\r\n minDate?: string;\r\n maxDate?: string;\r\n returnType?: \"dayjs\" | \"string\";\r\n}\r\n\r\nconst formatMap = {\r\n year: { displayFormat: \"YYYY\", outputFormat: \"YYYY\" },\r\n month: { displayFormat: \"YYYY-MM\", outputFormat: \"YYYYMM\" },\r\n date: { displayFormat: \"YYYY-MM-DD\", outputFormat: \"YYYYMMDD\" },\r\n time: { displayFormat: \"HH:mm\", outputFormat: \"HHmm\" },\r\n datetime: {\r\n displayFormat: \"YYYY-MM-DD HH:mm\",\r\n outputFormat: \"YYYYMMDDHHmm\",\r\n },\r\n};\r\n\r\nconst BwgRangePicker = ({\r\n itemProps,\r\n inputProps,\r\n type = \"date\",\r\n minDate,\r\n maxDate,\r\n returnType = \"string\",\r\n}: BwgRangePickerProps) => {\r\n // type이 변경될 때 format이 업데이트되도록 useMemo를 사용합니다.\r\n const { displayFormat, outputFormat } = useMemo(\r\n () => formatMap[type],\r\n [type]\r\n );\r\n\r\n // 현재 type의 포맷을 우선순위로 두어 파싱 순서 결정\r\n const allOutputFormats = useMemo(\r\n () =>\r\n Object.values(formatMap)\r\n .map((f) => f.outputFormat)\r\n .sort((a, b) => {\r\n if (a.length === b.length) {\r\n if (a === outputFormat) return -1; // 현재 포맷이면 우선순위를 높인다\r\n if (b === outputFormat) return 1;\r\n }\r\n return b.length - a.length;\r\n }),\r\n [outputFormat] // type(outputFormat)이 바뀔 때마다 재정렬\r\n );\r\n return (\r\n <BwgFormItem\r\n {...itemProps}\r\n getValueProps={(value) => ({\r\n // 폼에 저장된 값(문자열 또는 Dayjs)을 RangePicker가 요구하는 Dayjs 배열로 변환\r\n value:\r\n value && value.length > 0\r\n ? [\r\n value[0]\r\n ? dayjs.isDayjs(value[0])\r\n ? (value[0] as Dayjs)\r\n : dayjs(value[0] as any, allOutputFormats)\r\n : null,\r\n value[1]\r\n ? dayjs.isDayjs(value[1])\r\n ? (value[1] as Dayjs)\r\n : dayjs(value[1] as any, allOutputFormats)\r\n : null,\r\n ]\r\n : null,\r\n })}\r\n normalize={(value: [Dayjs, Dayjs] | null) => {\r\n // RangePicker에서 넘어온 dayjs 객체 배열을 현재 type에 맞는 outputFormat으로 변환합니다.\r\n if (!value) {\r\n return [undefined, undefined];\r\n }\r\n if (returnType === \"dayjs\") {\r\n return [value[0] ?? undefined, value[1] ?? undefined];\r\n }\r\n return [\r\n value[0] ? value[0].format(outputFormat) : undefined,\r\n value[1] ? value[1].format(outputFormat) : undefined,\r\n ];\r\n }}\r\n >\r\n <RangePicker\r\n {...inputProps}\r\n order={true}\r\n // minDate/maxDate도 모든 포맷으로 파싱하도록 수정\r\n minDate={minDate ? dayjs(minDate, allOutputFormats) : undefined}\r\n maxDate={maxDate ? dayjs(maxDate, allOutputFormats) : undefined}\r\n // antd DatePicker는 type 대신 picker와 showTime 속성을 사용합니다.\r\n picker={type === \"datetime\" ? \"date\" : type}\r\n showTime={\r\n inputProps?.showTime ?? (type === \"datetime\" || type === \"time\")\r\n }\r\n // useMask 속성 관련 로직이 불분명하고, displayFormat을 직접 사용하는 것이 더 확실합니다.\r\n format={displayFormat}\r\n // onChange 이벤트는 BwgFormItem의 normalize로 처리하므로 제거합니다.\r\n />\r\n </BwgFormItem>\r\n );\r\n};\r\n\r\nexport default BwgRangePicker;\r\n","import { Checkbox, CheckboxProps, Form } from 'antd';\r\nimport BwgFormItem, { BwgFormItemProps } from './BwgFormItem';\r\n\r\nexport type BwgCheckBoxProps = CheckboxProps & {\r\n format?: 'boolean' | 'YN';\r\n};\r\n\r\nexport interface BwgCheckProps {\r\n itemProps?: BwgFormItemProps;\r\n inputProps?: BwgCheckBoxProps;\r\n}\r\n\r\nconst BwgCheck = ({\r\n itemProps,\r\n inputProps = {\r\n format: 'YN',\r\n },\r\n}: BwgCheckProps) => {\r\n const form = Form.useFormInstance();\r\n\r\n const handleChange = (e: any) => {\r\n //console.log('handleChange :: ', e.target.checked);\r\n if (inputProps.format === 'boolean') {\r\n form.setFieldValue(itemProps?.name, e.target.checked);\r\n } else {\r\n form.setFieldValue(itemProps?.name, e.target.checked ? 'Y' : 'N');\r\n }\r\n\r\n inputProps.onChange && inputProps.onChange(e);\r\n };\r\n\r\n return (\r\n <BwgFormItem\r\n {...itemProps}\r\n getValueProps={value => {\r\n console.log('getValueProps :: ', value);\r\n const checked =\r\n inputProps.format === 'boolean'\r\n ? Boolean(value)\r\n : value === 'Y'\r\n ? true\r\n : false;\r\n return { checked }; // ✅ 수정: value 대신 checked 반환\r\n }}\r\n normalize={value => {\r\n console.log('normalize :: ', value);\r\n // 체크박스의 경우 e.target.checked 값이 전달되므로 이를 처리\r\n if (typeof value === 'boolean') {\r\n if (inputProps.format === 'boolean') {\r\n return value;\r\n }\r\n return value ? 'Y' : 'N';\r\n }\r\n // 문자열이나 다른 값의 경우 기존 로직 유지\r\n if (inputProps.format === 'boolean') {\r\n return !!value;\r\n }\r\n return value ? 'Y' : 'N';\r\n }}\r\n >\r\n <Checkbox {...inputProps} onChange={handleChange}>\r\n {inputProps?.title}\r\n </Checkbox>\r\n </BwgFormItem>\r\n );\r\n};\r\n\r\nexport default BwgCheck;\r\n"],"names":["BwgFormItem","React","children","label","name","rules","initialValue","style","rest","labelStyle","isRequired","rule","renderLabel","jsxs","jsx","Form","BwgForm","forwardRef","labelCol","className","props","ref","ConfigProvider","BwgSelect","itemProps","selectProps","form","isFormContext","optionList","useMemo","handleChange","newValue","selectComponentProps","selectComponent","Select","Space","Typography","BwgInput","inputProps","Input","RangePicker","DatePicker","formatMap","BwgRangePicker","type","minDate","maxDate","returnType","displayFormat","outputFormat","allOutputFormats","f","a","b","value","dayjs","BwgCheck","e","Checkbox"],"mappings":"mHAiBMA,EAAcC,EAAM,KACxB,CAAC,CACC,SAAAC,EACA,MAAAC,EACA,KAAAC,EACA,MAAAC,EACA,aAAAC,EACA,MAAAC,EACA,GAAGC,CAAA,IACmB,CACtB,MAAMC,EAAa,CACjB,WAAY,MAAA,EAIRC,EACJ,MAAM,QAAQL,CAAK,GAAKA,EAAM,KAAMM,GAAcA,EAAK,WAAa,EAAI,EAGpEC,EAAc,IACd,OAAOT,GAAU,SAEjBU,EAAAA,kBAAAA,KAAC,OAAA,CAAK,MAAOJ,EACV,SAAA,CAAAN,EACAO,GACCI,EAAAA,kBAAAA,IAAC,OAAA,CAAK,MAAO,CAAE,MAAO,UAAW,WAAY,OAAS,SAAA,GAAA,CAAC,CAAA,EAE3D,EAGGA,EAAAA,kBAAAA,IAAC,OAAA,CAAK,MAAOL,EAAa,SAAAN,EAAM,EAGzC,OACEW,EAAAA,kBAAAA,IAACC,EAAAA,KAAK,KAAL,CACC,UAAU,gBACV,MAAOZ,EAAQS,EAAA,EAAgB,OAC/B,WAAW,OACX,KAAAR,EACA,MAAAC,EACA,MAAO,GACP,aAAAC,EACA,MAAAC,EACC,GAAGC,EAEH,SAAAN,CAAA,CAAA,CAGP,CACF,EC3DMc,EAAUC,EAAAA,WACd,CAAC,CAAE,SAAAf,EAAU,SAAAgB,EAAU,MAAAX,EAAO,UAAAY,EAAW,GAAGC,CAAA,EAASC,IAEjDP,EAAAA,kBAAAA,IAACQ,EAAAA,eAAA,CACC,KAAM,CAEJ,iBAAkB,CAAE,SAAU,wBAAA,CAAyB,EAGzD,SAAAR,EAAAA,kBAAAA,IAACC,EAAAA,KAAA,CACC,IAAAM,EACC,GAAGD,EACJ,aAAc,G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