@bwg-ui/core 1.1.23 → 1.1.25

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.
Files changed (161) hide show
  1. package/dist/chunks/AuthContext-CXng9fj0.cjs.map +1 -1
  2. package/dist/chunks/{AuthContext-Ei2P-z4d.js → AuthContext-DrEpBrpB.js} +7 -3
  3. package/dist/chunks/AuthContext-DrEpBrpB.js.map +1 -0
  4. package/dist/chunks/{BwgSwitch-CAI-kEaM.cjs → BwgSwitch-DOlc57wi.cjs} +2 -2
  5. package/dist/chunks/BwgSwitch-DOlc57wi.cjs.map +1 -0
  6. package/dist/chunks/{BwgSwitch-B79pseQM.js → BwgSwitch-D_scwi9_.js} +18 -18
  7. package/dist/chunks/BwgSwitch-D_scwi9_.js.map +1 -0
  8. package/dist/chunks/{BwgUploader-DaNV2URT.cjs → BwgUploader-CkXwkcUL.cjs} +2 -2
  9. package/dist/chunks/BwgUploader-CkXwkcUL.cjs.map +1 -0
  10. package/dist/chunks/{BwgUploader-BcVlE61B.js → BwgUploader-DBFF9BPF.js} +327 -327
  11. package/dist/chunks/BwgUploader-DBFF9BPF.js.map +1 -0
  12. package/dist/chunks/LoadingOverlay-DAZJF5wg.js.map +1 -1
  13. package/dist/chunks/LoadingOverlay-DcmKvoZA.cjs.map +1 -1
  14. package/dist/chunks/{SSOHandler-DiW4Ft9i.cjs → SSOHandler-BY6LXMLc.cjs} +32 -32
  15. package/dist/chunks/SSOHandler-BY6LXMLc.cjs.map +1 -0
  16. package/dist/chunks/{SSOHandler-CkPcSHIm.js → SSOHandler-CxvxEBaH.js} +1977 -1930
  17. package/dist/chunks/SSOHandler-CxvxEBaH.js.map +1 -0
  18. package/dist/chunks/ScreenProtectContext-3my4PHFa.js.map +1 -1
  19. package/dist/chunks/ScreenProtectContext-CVuXrJm6.cjs.map +1 -1
  20. package/dist/chunks/SearchBoxContext-DwFDOyYG.cjs.map +1 -1
  21. package/dist/chunks/{SearchBoxContext-BCvEYyFk.js → SearchBoxContext-gWM7FHIw.js} +3 -5
  22. package/dist/chunks/SearchBoxContext-gWM7FHIw.js.map +1 -0
  23. package/dist/chunks/ViewContainer-Bhq22_B3.cjs.map +1 -1
  24. package/dist/chunks/{ViewContainer-CjpJqoGG.js → ViewContainer-D9SKBnrn.js} +40 -28
  25. package/dist/chunks/ViewContainer-D9SKBnrn.js.map +1 -0
  26. package/dist/chunks/apiUtils-BZ6s0_NI.cjs.map +1 -1
  27. package/dist/chunks/{apiUtils-DxzLqPhU.js → apiUtils-DSwE62oG.js} +14 -5
  28. package/dist/chunks/apiUtils-DSwE62oG.js.map +1 -0
  29. package/dist/chunks/{codeStore-CfI4Wh5M.js → codeStore-vPj4Y0TK.js} +2 -2
  30. package/dist/chunks/{codeStore-CfI4Wh5M.js.map → codeStore-vPj4Y0TK.js.map} +1 -1
  31. package/dist/chunks/{core-bHd8azE6.js → core-Dl0PdDdT.js} +2 -2
  32. package/dist/chunks/{core-bHd8azE6.js.map → core-Dl0PdDdT.js.map} +1 -1
  33. package/dist/chunks/{enc-base64-BQYwLKgk.js → enc-base64-D7t4BoUA.js} +3 -3
  34. package/dist/chunks/{enc-base64-BQYwLKgk.js.map → enc-base64-D7t4BoUA.js.map} +1 -1
  35. package/dist/chunks/{favoriteStore-Cemc-26t.js → favoriteStore-Bh1FuZm9.js} +2 -2
  36. package/dist/chunks/{favoriteStore-Cemc-26t.js.map → favoriteStore-Bh1FuZm9.js.map} +1 -1
  37. package/dist/chunks/{popupStore-Bi6o78lP.js → popupStore-BRRmB4zH.js} +2 -2
  38. package/dist/chunks/{popupStore-Bi6o78lP.js.map → popupStore-BRRmB4zH.js.map} +1 -1
  39. package/dist/chunks/{sha256-BZfJs28k.js → sha256-C2-s1oZe.js} +3 -3
  40. package/dist/chunks/{sha256-BZfJs28k.js.map → sha256-C2-s1oZe.js.map} +1 -1
  41. package/dist/chunks/usePopup-D2JEuDrO.cjs.map +1 -1
  42. package/dist/chunks/{usePopup-BSqsnSz7.js → usePopup-DarKTbRC.js} +3 -3
  43. package/dist/chunks/usePopup-DarKTbRC.js.map +1 -0
  44. package/dist/components/common/BookmarkMngModal.d.ts +1 -1
  45. package/dist/components/common/BookmarkMngModal.d.ts.map +1 -1
  46. package/dist/components/common/BookmarkPopver.d.ts +2 -2
  47. package/dist/components/common/BookmarkPopver.d.ts.map +1 -1
  48. package/dist/components/common/BwgButtonGroup.d.ts +5 -5
  49. package/dist/components/common/BwgButtonGroup.d.ts.map +1 -1
  50. package/dist/components/common/BwgCmptArea.d.ts +7 -7
  51. package/dist/components/common/BwgCmptArea.d.ts.map +1 -1
  52. package/dist/components/common/BwgCol.d.ts +2 -1
  53. package/dist/components/common/BwgCol.d.ts.map +1 -1
  54. package/dist/components/common/BwgConfigProvider.d.ts +2 -2
  55. package/dist/components/common/BwgConfigProvider.d.ts.map +1 -1
  56. package/dist/components/common/BwgDetail.d.ts +2 -1
  57. package/dist/components/common/BwgDetail.d.ts.map +1 -1
  58. package/dist/components/common/BwgDraggable.d.ts +5 -5
  59. package/dist/components/common/BwgDraggable.d.ts.map +1 -1
  60. package/dist/components/common/BwgDrawer.d.ts +2 -1
  61. package/dist/components/common/BwgDrawer.d.ts.map +1 -1
  62. package/dist/components/common/BwgEditor.d.ts +5 -5
  63. package/dist/components/common/BwgEditor.d.ts.map +1 -1
  64. package/dist/components/common/BwgGrid.d.ts +8 -8
  65. package/dist/components/common/BwgGrid.d.ts.map +1 -1
  66. package/dist/components/common/BwgInfoArea.d.ts +4 -4
  67. package/dist/components/common/BwgInfoArea.d.ts.map +1 -1
  68. package/dist/components/common/BwgPopup.d.ts +3 -3
  69. package/dist/components/common/BwgPopup.d.ts.map +1 -1
  70. package/dist/components/common/BwgRow.d.ts +2 -1
  71. package/dist/components/common/BwgRow.d.ts.map +1 -1
  72. package/dist/components/common/BwgTitleBox.d.ts +5 -4
  73. package/dist/components/common/BwgTitleBox.d.ts.map +1 -1
  74. package/dist/components/common/BwgView.d.ts +4 -4
  75. package/dist/components/common/BwgView.d.ts.map +1 -1
  76. package/dist/components/common/ContentBox.d.ts +3 -3
  77. package/dist/components/common/ContentBox.d.ts.map +1 -1
  78. package/dist/components/common/ContentLayOut.d.ts +6 -5
  79. package/dist/components/common/ContentLayOut.d.ts.map +1 -1
  80. package/dist/components/common/GlobalConfigProvider.d.ts +2 -2
  81. package/dist/components/common/GlobalConfigProvider.d.ts.map +1 -1
  82. package/dist/components/common/QuickServiceToggle.d.ts +4 -4
  83. package/dist/components/common/QuickServiceToggle.d.ts.map +1 -1
  84. package/dist/components/common/SSOHandler.d.ts +2 -1
  85. package/dist/components/common/SSOHandler.d.ts.map +1 -1
  86. package/dist/components/common/SearchBox.d.ts +5 -4
  87. package/dist/components/common/SearchBox.d.ts.map +1 -1
  88. package/dist/components/common/index.cjs +1 -1
  89. package/dist/components/common/index.js +1 -1
  90. package/dist/components/core/BwgButton.d.ts +3 -2
  91. package/dist/components/core/BwgButton.d.ts.map +1 -1
  92. package/dist/components/core/BwgDatePicker.d.ts +3 -3
  93. package/dist/components/core/BwgDatePicker.d.ts.map +1 -1
  94. package/dist/components/core/BwgDownload.d.ts +2 -2
  95. package/dist/components/core/BwgDownload.d.ts.map +1 -1
  96. package/dist/components/core/BwgForm.d.ts +2 -1
  97. package/dist/components/core/BwgForm.d.ts.map +1 -1
  98. package/dist/components/core/BwgFormItem.d.ts +3 -3
  99. package/dist/components/core/BwgFormItem.d.ts.map +1 -1
  100. package/dist/components/core/BwgInput.d.ts +2 -2
  101. package/dist/components/core/BwgInput.d.ts.map +1 -1
  102. package/dist/components/core/BwgLargeUploader.d.ts +2 -2
  103. package/dist/components/core/BwgLargeUploader.d.ts.map +1 -1
  104. package/dist/components/core/BwgMaskedInput.d.ts +2 -2
  105. package/dist/components/core/BwgMaskedInput.d.ts.map +1 -1
  106. package/dist/components/core/BwgMaskedPicker.d.ts +2 -2
  107. package/dist/components/core/BwgMaskedPicker.d.ts.map +1 -1
  108. package/dist/components/core/BwgRangePicker.d.ts +3 -3
  109. package/dist/components/core/BwgRangePicker.d.ts.map +1 -1
  110. package/dist/components/core/BwgSearch.d.ts +1 -1
  111. package/dist/components/core/BwgSearch.d.ts.map +1 -1
  112. package/dist/components/core/BwgUploader.d.ts +2 -2
  113. package/dist/components/core/BwgUploader.d.ts.map +1 -1
  114. package/dist/components/core/index.cjs +1 -1
  115. package/dist/components/core/index.js +2 -2
  116. package/dist/components/layout/ErrorBound.d.ts +3 -3
  117. package/dist/components/layout/ErrorBound.d.ts.map +1 -1
  118. package/dist/components/layout/LoadingOverlay.d.ts +3 -2
  119. package/dist/components/layout/LoadingOverlay.d.ts.map +1 -1
  120. package/dist/components/layout/PrivateProtectedOverlay.d.ts +3 -2
  121. package/dist/components/layout/PrivateProtectedOverlay.d.ts.map +1 -1
  122. package/dist/components/layout/ProgressOverlay.d.ts +2 -2
  123. package/dist/components/layout/ProgressOverlay.d.ts.map +1 -1
  124. package/dist/components/layout/ViewContainer.d.ts +3 -3
  125. package/dist/components/layout/ViewContainer.d.ts.map +1 -1
  126. package/dist/components/layout/index.js +1 -1
  127. package/dist/components/popup/MenuReport.d.ts +2 -2
  128. package/dist/components/popup/MenuReport.d.ts.map +1 -1
  129. package/dist/index.cjs +1 -1
  130. package/dist/index.js +11 -11
  131. package/dist/provider/contexts/AuthContext.d.ts +3 -2
  132. package/dist/provider/contexts/AuthContext.d.ts.map +1 -1
  133. package/dist/provider/contexts/CommonCodeContext.d.ts +2 -2
  134. package/dist/provider/contexts/CommonCodeContext.d.ts.map +1 -1
  135. package/dist/provider/contexts/ScreenProtectContext.d.ts +5 -5
  136. package/dist/provider/contexts/ScreenProtectContext.d.ts.map +1 -1
  137. package/dist/provider/contexts/SearchBoxContext.d.ts +3 -3
  138. package/dist/provider/contexts/SearchBoxContext.d.ts.map +1 -1
  139. package/dist/provider/contexts/ServiceCodeContext.d.ts +2 -2
  140. package/dist/provider/contexts/ServiceCodeContext.d.ts.map +1 -1
  141. package/dist/provider/index.js +3 -3
  142. package/dist/stores/index.cjs.map +1 -1
  143. package/dist/stores/index.d.ts +0 -1
  144. package/dist/stores/index.d.ts.map +1 -1
  145. package/dist/stores/index.js +6 -6
  146. package/dist/stores/index.js.map +1 -1
  147. package/dist/stores/menuViewStore.d.ts +6 -5
  148. package/dist/stores/menuViewStore.d.ts.map +1 -1
  149. package/dist/utils/index.js +2 -2
  150. package/package.json +1 -1
  151. package/dist/chunks/AuthContext-Ei2P-z4d.js.map +0 -1
  152. package/dist/chunks/BwgSwitch-B79pseQM.js.map +0 -1
  153. package/dist/chunks/BwgSwitch-CAI-kEaM.cjs.map +0 -1
  154. package/dist/chunks/BwgUploader-BcVlE61B.js.map +0 -1
  155. package/dist/chunks/BwgUploader-DaNV2URT.cjs.map +0 -1
  156. package/dist/chunks/SSOHandler-CkPcSHIm.js.map +0 -1
  157. package/dist/chunks/SSOHandler-DiW4Ft9i.cjs.map +0 -1
  158. package/dist/chunks/SearchBoxContext-BCvEYyFk.js.map +0 -1
  159. package/dist/chunks/ViewContainer-CjpJqoGG.js.map +0 -1
  160. package/dist/chunks/apiUtils-DxzLqPhU.js.map +0 -1
  161. package/dist/chunks/usePopup-BSqsnSz7.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../src/stores/index.ts"],"sourcesContent":["// 스토어 import\r\nimport { useCodeStore } from './codeStore';\r\nimport { useFavoriteStore } from './favoriteStore';\r\nimport { useMenuModelStore } from './menuModelStore';\r\nimport { useMenuViewStore } from './menuViewStore';\r\nimport { usePopupStore } from './popupStore';\r\nimport { useUserStore } from './userStore';\r\n\r\n// 스토어 export\r\nexport { useCodeStore, useColorStore, useOptionStore } from './codeStore';\r\nexport { useFavoriteStore } from './favoriteStore';\r\nexport { useLoadingStore, usePopupLoadingStore } from './loadingStore';\r\nexport { useMenuModelStore } from './menuModelStore';\r\nexport { useMenuViewStore } from './menuViewStore';\r\nexport { usePopupStore } from './popupStore';\r\nexport { useUserStore } from './userStore';\r\n\r\n// 스토어 별칭 (간단한 사용을 위한)\r\nexport const useCode = () => useCodeStore.getState();\r\nexport const usePopupState = () => usePopupStore.getState();\r\nexport const useUser = () => useUserStore.getState();\r\nexport const useFavorite = () => useFavoriteStore.getState();\r\nexport const useMenuModel = () => useMenuModelStore.getState();\r\nexport const useMenuView = () => useMenuViewStore.getState();\r\n\r\n// 타입들도 함께 export\r\nexport type {\r\n CodeGroup,\r\n CodeItem,\r\n CommonCodeData,\r\n CommonCodeState,\r\n} from './codeStore';\r\nexport type { FavoriteMenuItem } from './favoriteStore';\r\nexport type { MenuItem } from './menuModelStore';\r\nexport type { TabItem } from './menuViewStore';\r\nexport type { PopupButton, PopupItem, PopupViewProps } from './popupStore';\r\n\r\n"],"names":["useCode","useCodeStore","usePopupState","usePopupStore","useUser","useUserStore","useFavorite","useFavoriteStore","useMenuModel","useMenuModelStore","useMenuView","useMenuViewStore"],"mappings":";;;;;;AAkBO,MAAMA,IAAU,MAAMC,EAAa,SAAA,GAC7BC,IAAgB,MAAMC,EAAc,SAAA,GACpCC,IAAU,MAAMC,EAAa,SAAA,GAC7BC,IAAc,MAAMC,EAAiB,SAAA,GACrCC,IAAe,MAAMC,EAAkB,SAAA,GACvCC,IAAc,MAAMC,EAAiB,SAAA;"}
1
+ {"version":3,"file":"index.js","sources":["../../src/stores/index.ts"],"sourcesContent":["// 스토어 import\r\nimport { useCodeStore } from './codeStore';\r\nimport { useFavoriteStore } from './favoriteStore';\r\nimport { useMenuModelStore } from './menuModelStore';\r\nimport { useMenuViewStore } from './menuViewStore';\r\nimport { usePopupStore } from './popupStore';\r\nimport { useUserStore } from './userStore';\r\n\r\n// 스토어 export\r\nexport { useCodeStore, useColorStore, useOptionStore } from './codeStore';\r\nexport { useFavoriteStore } from './favoriteStore';\r\nexport { useLoadingStore, usePopupLoadingStore } from './loadingStore';\r\nexport { useMenuModelStore } from './menuModelStore';\r\nexport { useMenuViewStore } from './menuViewStore';\r\nexport { usePopupStore } from './popupStore';\r\nexport { useUserStore } from './userStore';\r\n\r\n// 스토어 별칭 (간단한 사용을 위한)\r\nexport const useCode = () => useCodeStore.getState();\r\nexport const usePopupState = () => usePopupStore.getState();\r\nexport const useUser = () => useUserStore.getState();\r\nexport const useFavorite = () => useFavoriteStore.getState();\r\nexport const useMenuModel = () => useMenuModelStore.getState();\r\nexport const useMenuView = () => useMenuViewStore.getState();\r\n\r\n// 타입들도 함께 export\r\nexport type {\r\n CodeGroup,\r\n CodeItem,\r\n CommonCodeData,\r\n CommonCodeState,\r\n} from './codeStore';\r\nexport type { MenuItem } from './menuModelStore';\r\nexport type { TabItem } from './menuViewStore';\r\nexport type { PopupButton, PopupItem, PopupViewProps } from './popupStore';\r\n\r\n"],"names":["useCode","useCodeStore","usePopupState","usePopupStore","useUser","useUserStore","useFavorite","useFavoriteStore","useMenuModel","useMenuModelStore","useMenuView","useMenuViewStore"],"mappings":";;;;;;AAkBO,MAAMA,IAAU,MAAMC,EAAa,SAAA,GAC7BC,IAAgB,MAAMC,EAAc,SAAA,GACpCC,IAAU,MAAMC,EAAa,SAAA,GAC7BC,IAAc,MAAMC,EAAiB,SAAA,GACrCC,IAAe,MAAMC,EAAkB,SAAA,GACvCC,IAAc,MAAMC,EAAiB,SAAA;"}
@@ -1,7 +1,8 @@
1
1
  import { MenuItem } from './menuModelStore';
2
+ import { ReactNode } from 'react';
2
3
  export interface ViewItem {
3
4
  viewId: string;
4
- viewLabel: string | React.ReactNode;
5
+ viewLabel: string | ReactNode;
5
6
  viewParams?: Record<string, any>;
6
7
  prntInfo?: {
7
8
  menuId: string;
@@ -10,12 +11,12 @@ export interface ViewItem {
10
11
  }
11
12
  export interface TabItem {
12
13
  key: string;
13
- label: string | React.ReactNode;
14
- gubun: "M" | "C";
14
+ label: string | ReactNode;
15
+ gubun: 'M' | 'C';
15
16
  menuItem?: MenuItem;
16
17
  componentItem?: {
17
18
  scrnPath: string;
18
- prsnInfoYn?: "Y" | "N";
19
+ prsnInfoYn?: 'Y' | 'N';
19
20
  prntInfo?: {
20
21
  menuId: string;
21
22
  menuNm: string;
@@ -42,7 +43,7 @@ type MenuViewState = {
42
43
  * @returns
43
44
  * @description 상세 탭 추가
44
45
  */
45
- openDetailView: (viewInfo: ViewItem, scrnPath: string, prsnInfoYn?: "Y" | "N") => void;
46
+ openDetailView: (viewInfo: ViewItem, scrnPath: string, prsnInfoYn?: 'Y' | 'N') => void;
46
47
  focusTab: (tabKey: string) => void;
47
48
  closeTab: (tabKey: string) => void;
48
49
  closeAllTabs: () => void;
@@ -1 +1 @@
1
- {"version":3,"file":"menuViewStore.d.ts","sourceRoot":"","sources":["../../src/stores/menuViewStore.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAqB,MAAM,kBAAkB,CAAC;AAQ/D,MAAM,WAAW,QAAQ;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,GAAG,KAAK,CAAC,SAAS,CAAC;IACpC,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACjC,QAAQ,CAAC,EAAC;QACR,MAAM,EAAE,MAAM,CAAC;QACf,MAAM,EAAE,MAAM,CAAC;KAChB,CAAA;CACF;AAGD,MAAM,WAAW,OAAO;IACtB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,GAAG,KAAK,CAAC,SAAS,CAAC;IAChC,KAAK,EAAE,GAAG,GAAG,GAAG,CAAC;IACjB,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,aAAa,CAAC,EAAE;QACd,QAAQ,EAAE,MAAM,CAAC;QACjB,UAAU,CAAC,EAAE,GAAG,GAAG,GAAG,CAAC;QACvB,QAAQ,CAAC,EAAE;YACT,MAAM,EAAE,MAAM,CAAC;YACf,MAAM,EAAE,MAAM,CAAC;SAChB,CAAC;KACH,CAAC;IACF,QAAQ,EAAE,OAAO,CAAC;CACnB;AAID,KAAK,aAAa,GAAG;IAGnB,YAAY,EAAE,MAAM,GAAG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M,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,IAAI,CAAC;IAEjE,oBAAoB,EAAE,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,KAAK,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;CAC9E,CAAC;AAGF,eAAO,MAAM,gBAAgB,4EA0N1B,CAAC"}
@@ -1,5 +1,5 @@
1
- import { c as C, aA as U, aK as l, aL as c, aM as d, aN as g, aO as p, aP as u } from "../chunks/apiUtils-DxzLqPhU.js";
2
- import { A as W, T as Y, f as G, b as H, h as J, d as Q, e as X, H as Z, J as ss, F as es, G as as, K as os, I as ts, E as rs, a as is, N as ns, S as ls, aj as cs, a8 as ds, w as gs, u as ps, W as us, ai as ms, L as fs, a4 as Ss, C as Cs, a2 as Us, a3 as hs, am as vs, g as ws, V as ys, ao as bs, a5 as Es, a6 as Ms, aD as Ds, x as Rs, aC as _s, at as Is, au as Ns, as as Os, ab as As, i as Ls, av as Ps, al as ks, Q as js, ar as Fs, ap as Bs, aq as Ts, ay as $s, ax as xs, aw as Ks, aB as qs, o as zs, l as Vs, B as Ws, a9 as Ys, X as Gs, D as Hs, m as Js, a7 as Qs, az as Xs, y as Zs, p as se, r as ee, k as ae, n as oe, aa as te, Y as re, j as ie, z as ne, q as le, _ as ce, $ as de, an as ge, ad as pe, ah as ue, af as me, ae as fe, ag as Se, ac as Ce, a0 as Ue, a1 as he, M as ve, R as we, O as ye, s as be, U as Ee, ak as Me, P as De, t as Re, Z as _e, v as Ie } from "../chunks/apiUtils-DxzLqPhU.js";
1
+ import { c as C, aA as U, aK as l, aL as c, aM as d, aN as g, aO as p, aP as u } from "../chunks/apiUtils-DSwE62oG.js";
2
+ import { A as W, T as Y, f as G, b as H, h as J, d as Q, e as X, H as Z, J as ss, F as es, G as as, K as os, I as ts, E as rs, a as is, N as ns, S as ls, aj as cs, a8 as ds, w as gs, u as ps, W as us, ai as ms, L as fs, a4 as Ss, C as Cs, a2 as Us, a3 as hs, am as vs, g as ws, V as ys, ao as bs, a5 as Es, a6 as Ms, aD as Ds, x as Rs, aC as _s, at as Is, au as Ns, as as Os, ab as As, i as Ls, av as Ps, al as ks, Q as js, ar as Fs, ap as Bs, aq as Ts, ay as $s, ax as xs, aw as Ks, aB as qs, o as zs, l as Vs, B as Ws, a9 as Ys, X as Gs, D as Hs, m as Js, a7 as Qs, az as Xs, y as Zs, p as se, r as ee, k as ae, n as oe, aa as te, Y as re, j as ie, z as ne, q as le, _ as ce, $ as de, an as ge, ad as pe, ah as ue, af as me, ae as fe, ag as Se, ac as Ce, a0 as Ue, a1 as he, M as ve, R as we, O as ye, s as be, U as Ee, ak as Me, P as De, t as Re, Z as _e, v as Ie } from "../chunks/apiUtils-DSwE62oG.js";
3
3
  import { message as t } from "antd";
4
4
  import { r as h } from "../chunks/realFormat-DRGLFabQ.js";
5
5
  const v = (s, e, o = "text/plain") => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bwg-ui/core",
3
- "version": "1.1.23",
3
+ "version": "1.1.25",
4
4
  "description": "bankwareglobal UI 라이브러리입니다.",
5
5
  "author": "kyeongdon.park",
6
6
  "license": "ISC",
@@ -1 +0,0 @@
1
- {"version":3,"file":"AuthContext-Ei2P-z4d.js","sources":["../../src/provider/contexts/AuthContext.tsx"],"sourcesContent":["import { createContext, useContext, useMemo, useState } from \"react\";\r\n\r\ntype AuthContextValue = {\r\n authed: boolean;\r\n busy: boolean; // show global progress when true\r\n verifyWithToken: (token: string) => Promise<boolean>; // initial SSO\r\n reauthWithPin: (pin: string) => Promise<boolean>; // unlock SSO\r\n logout: () => void;\r\n };\r\n \r\n const AuthContext = createContext<AuthContextValue | null>(null);\r\n export const useAuth = () => {\r\n const ctx = useContext(AuthContext);\r\n if (!ctx) throw new Error(\"useAuth must be used within AuthProvider\");\r\n return ctx;\r\n }; \r\n \r\n export const AuthProvider: React.FC<{ children: React.ReactNode }> = ({ children }) => {\r\n const [authed, setAuthed] = useState(false);\r\n const [busy, setBusy] = useState(false);\r\n \r\n // Heuristic text parser for JSP boolean responses\r\n const parseOk = async (res: Response) => {\r\n const text = (await res.text()).trim().toLowerCase();\r\n try {\r\n const j = JSON.parse(text);\r\n if (typeof j === \"object\" && j && (j.ok === true || j.success === true)) return true;\r\n } catch {}\r\n if ([\"true\", \"ok\", \"1\", \"y\"].includes(text)) return true;\r\n return false;\r\n };\r\n \r\n const verifyWithToken = async (token: string) => {\r\n setBusy(true);\r\n try {\r\n // TODO: replace with your real endpoint\r\n const res = await fetch(\"/serviceEndpoint/sso_check.jsp\", {\r\n method: \"POST\",\r\n headers: { \"Content-Type\": \"application/x-www-form-urlencoded\" },\r\n body: \"token=\" + encodeURIComponent(token),\r\n });\r\n const ok = res.ok && (await parseOk(res));\r\n setAuthed(ok);\r\n return ok;\r\n } catch (e) {\r\n return false;\r\n } finally {\r\n setBusy(false);\r\n }\r\n };\r\n \r\n const reauthWithPin = async (pin: string) => {\r\n setBusy(true);\r\n try {\r\n // TODO: replace with your real endpoint\r\n const res = await fetch(\"/serviceEndpoint/sso_reauth.jsp\", {\r\n method: \"POST\",\r\n headers: { \"Content-Type\": \"application/x-www-form-urlencoded\" },\r\n body: \"pin=\" + encodeURIComponent(pin),\r\n });\r\n const ok = res.ok && (await parseOk(res));\r\n // Keep authed true only if reauth succeeds\r\n if (!ok) return false;\r\n setAuthed(true);\r\n return true;\r\n } catch (e) {\r\n return false;\r\n } finally {\r\n setBusy(false);\r\n }\r\n };\r\n \r\n const logout = () => {\r\n setAuthed(false);\r\n };\r\n \r\n const value = useMemo(() => ({ authed, busy, verifyWithToken, reauthWithPin, logout }), [authed, busy]);\r\n return <AuthContext.Provider value={value}>{children}</AuthContext.Provider>;\r\n };"],"names":["AuthContext","createContext","useAuth","ctx","useContext","AuthProvider","children","authed","setAuthed","useState","busy","setBusy","parseOk","res","text","j","verifyWithToken","token","ok","reauthWithPin","pin","logout","value","useMem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;AAAA,MAAA,CACtC;AAGD,aAFWP,EAAI,MAAO,MAAMD,EAAQC,CAAG,KAGvCL,EAAU,EAAI,GACP,MAFS;AAAA,IAGlB,QAAY;AACV,aAAO;AAAA,IACT,UAAA;AACE,MAAAG,EAAQ,EAAK;AAAA,IACf;AAAA,EACF,GAEMU,IAAS,MAAM;AACnB,IAAAb,EAAU,EAAK;AAAA,EACjB,GAEMc,IAAQC,EAAQ,OAAO,EAAE,QAAAhB,GAAQ,MAAAG,GAAM,iBAAAM,GAAiB,eAAAG,GAAe,QAAAE,EAAA,IAAW,CAACd,GAAQG,CAAI,CAAC;AACtG,SAAOc,gBAAAA,EAAAA,IAACxB,EAAY,UAAZ,EAAqB,OAAAsB,GAAe,UAAAhB,EAAA,CAAS;AACvD;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"BwgSwitch-B79pseQM.js","sources":["../../src/components/core/BwgFormItem.tsx","../../src/components/core/BwgCheck.tsx","../../src/components/core/BwgDatePicker.tsx","../../src/components/core/BwgForm.tsx","../../src/components/core/BwgInput.tsx","../../src/components/core/BwgRangePicker.tsx","../../src/components/core/BwgSelect.tsx","../../src/components/core/BwgSwitch.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 { 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\n/**\r\n * 체크박스 컴포넌트\r\n * @param itemProps - BwgFormItemProps\r\n * @param inputProps - BwgCheckBoxProps\r\n * @returns \r\n * @example\r\n * <BwgCheck\r\n * itemProps={{ name: 'check' }}\r\n * inputProps={{ format: 'YN' }}\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","import React, { useMemo } from \"react\";\r\nimport { DatePicker } from \"antd\";\r\nimport BwgFormItem, { BwgFormItemProps } from \"./BwgFormItem\";\r\nimport { DatePickerProps } from \"antd/es/date-picker\";\r\nimport dayjs, { Dayjs } from \"dayjs\";\r\n\r\nexport interface BwgDatePickerProps {\r\n itemProps?: BwgFormItemProps;\r\n inputProps?: DatePickerProps;\r\n type?: \"year\" | \"month\" | \"date\" | \"time\" | \"datetime\";\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 BwgDatePicker = ({\r\n itemProps,\r\n inputProps,\r\n type = \"date\",\r\n returnType = \"string\",\r\n}: BwgDatePickerProps) => {\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)을 DatePicker가 요구하는 Dayjs로 변환\r\n value: value\r\n ? dayjs.isDayjs(value)\r\n ? (value as Dayjs)\r\n : dayjs(value as any, allOutputFormats)\r\n : null,\r\n })}\r\n normalize={(value) => {\r\n // DatePicker에서 넘어온 Dayjs를 returnType에 따라 반환\r\n if (!value) return null;\r\n if (returnType === \"dayjs\") return value as Dayjs;\r\n return value.format(outputFormat);\r\n }}\r\n >\r\n <DatePicker\r\n {...inputProps}\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로 처리하므로 중복되는 handleChange를 제거합니다.\r\n ></DatePicker>\r\n </BwgFormItem>\r\n );\r\n};\r\n\r\nexport default BwgDatePicker;\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 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 { Form, Select, Space, Typography } from 'antd';\r\nimport { SelectProps } from 'antd/es/select';\r\nimport { useMemo } from 'react';\r\nimport { SimpleCodeItem } from '../../stores/codeStore';\r\nimport BwgFormItem, { BwgFormItemProps } from './BwgFormItem';\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} name={undefined}>\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 { Form, Switch, SwitchProps } from \"antd\";\r\nimport BwgFormItem, { BwgFormItemProps } from \"./BwgFormItem\";\r\n\r\nexport type BwgSwitchItemProps = SwitchProps & {\r\n format?: 'boolean' | 'YN';\r\n };\r\n \r\n export interface BwgSwitchProps {\r\n itemProps?: BwgFormItemProps;\r\n inputProps?: BwgSwitchItemProps;\r\n }\r\n\r\n/**\r\n * 스위치 컴포넌트\r\n * @param itemProps - BwgFormItemProps\r\n * @param inputProps - BwgSwitchItemProps\r\n * @returns \r\n * @example\r\n * <BwgSwitch\r\n * itemProps={{ name: 'switch' }}\r\n * inputProps={{ format: 'YN' }}\r\n * />\r\n * @returns \r\n */\r\nconst BwgSwitch = ({\r\n itemProps,\r\n inputProps = {\r\n format: 'YN',\r\n },\r\n}: BwgSwitchProps) => {\r\n const form = Form.useFormInstance();\r\n \r\n const handleChange = (checked: boolean, e: any) => {\r\n if (inputProps.format === 'boolean') {\r\n form.setFieldValue(itemProps?.name, checked);\r\n } else {\r\n form.setFieldValue(itemProps?.name, checked ? 'Y' : 'N');\r\n }\r\n \r\n inputProps.onChange && inputProps.onChange(checked, e as any);\r\n };\r\n\r\n return <BwgFormItem {...itemProps} \r\n 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 };\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 <Switch {...inputProps} onChange={(checked: boolean, e: any) => handleChange(checked, e)} />\r\n </BwgFormItem>;\r\n};\r\n\r\nexport default BwgSwitch;"],"names":["BwgFormItem","React","children","label","name","rules","initialValue","style","rest","labelStyle","isRequired","rule","renderLabel","jsxs","jsx","Form","BwgCheck","itemProps","inputProps","form","handleChange","value","Checkbox","formatMap","BwgDatePicker","type","returnType","displayFormat","outputFormat","useMemo","allOutputFormats","f","a","b","dayjs","DatePicker","BwgForm","forwardRef","labelCol","className","props","ref","ConfigProvider","BwgInput","Input","RangePicker","BwgRangePicker","minDate","maxDate","BwgSelect","selectProps","isFormContext","optionList","newValue","selectComponentProps","selectComponent","Select","Space","Typography","BwgSwitch","checked","e","Switch"],"mappings":";;;;AAiBA,MAAMA,IAAcC,EAAM;AAAA,EACxB,CAAC;AAAA,IACC,UAAAC;AAAA,IACA,OAAAC;AAAA,IACA,MAAAC;AAAA,IACA,OAAAC;AAAA,IACA,cAAAC;AAAA,IACA,OAAAC;AAAA,IACA,GAAGC;AAAA,EAAA,MACmB;AACtB,UAAMC,IAAa;AAAA,MACjB,YAAY;AAAA,IAAA,GAIRC,IACJ,MAAM,QAAQL,CAAK,KAAKA,EAAM,KAAK,CAACM,MAAcA,EAAK,aAAa,EAAI,GAGpEC,IAAc,MACd,OAAOT,KAAU,WAEjBU,gBAAAA,EAAAA,KAAC,QAAA,EAAK,OAAOJ,GACV,UAAA;AAAA,MAAAN;AAAA,MACAO,KACCI,gBAAAA,EAAAA,IAAC,QAAA,EAAK,OAAO,EAAE,OAAO,WAAW,YAAY,SAAS,UAAA,IAAA,CAAC;AAAA,IAAA,GAE3D,IAGGA,gBAAAA,EAAAA,IAAC,QAAA,EAAK,OAAOL,GAAa,UAAAN,GAAM;AAGzC,WACEW,gBAAAA,EAAAA;AAAAA,MAACC,EAAK;AAAA,MAAL;AAAA,QACC,WAAU;AAAA,QACV,OAAOZ,IAAQS,EAAA,IAAgB;AAAA,QAC/B,YAAW;AAAA,QACX,MAAAR;AAAA,QACA,OAAAC;AAAA,QACA,OAAO;AAAA,QACP,cAAAC;AAAA,QACA,OAAAC;AAAA,QACC,G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ACjB,CAAC,CAACG,IAEJA,IAAQ,MAAM;AAAA,MAGrB,UAAAP,gBAAAA,EAAAA,IAACgD,GAAA,EAAQ,GAAG5C,GAAY,UAAU,CAAC0C,GAAkBC,MAAWzC,EAAawC,GAASC,CAAC,EAAA,CAAG;AAAA,IAAA;AAAA,EAAA;AAElG;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"BwgSwitch-CAI-kEaM.cjs","sources":["../../src/components/core/BwgFormItem.tsx","../../src/components/core/BwgCheck.tsx","../../src/components/core/BwgDatePicker.tsx","../../src/components/core/BwgForm.tsx","../../src/components/core/BwgInput.tsx","../../src/components/core/BwgRangePicker.tsx","../../src/components/core/BwgSelect.tsx","../../src/components/core/BwgSwitch.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 { 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\n/**\r\n * 체크박스 컴포넌트\r\n * @param itemProps - BwgFormItemProps\r\n * @param inputProps - BwgCheckBoxProps\r\n * @returns \r\n * @example\r\n * <BwgCheck\r\n * itemProps={{ name: 'check' }}\r\n * inputProps={{ format: 'YN' }}\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","import React, { useMemo } from \"react\";\r\nimport { DatePicker } from \"antd\";\r\nimport BwgFormItem, { BwgFormItemProps } from \"./BwgFormItem\";\r\nimport { DatePickerProps } from \"antd/es/date-picker\";\r\nimport dayjs, { Dayjs } from \"dayjs\";\r\n\r\nexport interface BwgDatePickerProps {\r\n itemProps?: BwgFormItemProps;\r\n inputProps?: DatePickerProps;\r\n type?: \"year\" | \"month\" | \"date\" | \"time\" | \"datetime\";\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 BwgDatePicker = ({\r\n itemProps,\r\n inputProps,\r\n type = \"date\",\r\n returnType = \"string\",\r\n}: BwgDatePickerProps) => {\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)을 DatePicker가 요구하는 Dayjs로 변환\r\n value: value\r\n ? dayjs.isDayjs(value)\r\n ? (value as Dayjs)\r\n : dayjs(value as any, allOutputFormats)\r\n : null,\r\n })}\r\n normalize={(value) => {\r\n // DatePicker에서 넘어온 Dayjs를 returnType에 따라 반환\r\n if (!value) return null;\r\n if (returnType === \"dayjs\") return value as Dayjs;\r\n return value.format(outputFormat);\r\n }}\r\n >\r\n <DatePicker\r\n {...inputProps}\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로 처리하므로 중복되는 handleChange를 제거합니다.\r\n ></DatePicker>\r\n </BwgFormItem>\r\n );\r\n};\r\n\r\nexport default BwgDatePicker;\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 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 { Form, Select, Space, Typography } from 'antd';\r\nimport { SelectProps } from 'antd/es/select';\r\nimport { useMemo } from 'react';\r\nimport { SimpleCodeItem } from '../../stores/codeStore';\r\nimport BwgFormItem, { BwgFormItemProps } from './BwgFormItem';\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} name={undefined}>\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 { Form, Switch, SwitchProps } from \"antd\";\r\nimport BwgFormItem, { BwgFormItemProps } from \"./BwgFormItem\";\r\n\r\nexport type BwgSwitchItemProps = SwitchProps & {\r\n format?: 'boolean' | 'YN';\r\n };\r\n \r\n export interface BwgSwitchProps {\r\n itemProps?: BwgFormItemProps;\r\n inputProps?: BwgSwitchItemProps;\r\n }\r\n\r\n/**\r\n * 스위치 컴포넌트\r\n * @param itemProps - BwgFormItemProps\r\n * @param inputProps - BwgSwitchItemProps\r\n * @returns \r\n * @example\r\n * <BwgSwitch\r\n * itemProps={{ name: 'switch' }}\r\n * inputProps={{ format: 'YN' }}\r\n * />\r\n * @returns \r\n */\r\nconst BwgSwitch = ({\r\n itemProps,\r\n inputProps = {\r\n format: 'YN',\r\n },\r\n}: BwgSwitchProps) => {\r\n const form = Form.useFormInstance();\r\n \r\n const handleChange = (checked: boolean, e: any) => {\r\n if (inputProps.format === 'boolean') {\r\n form.setFieldValue(itemProps?.name, checked);\r\n } else {\r\n form.setFieldValue(itemProps?.name, checked ? 'Y' : 'N');\r\n }\r\n \r\n inputProps.onChange && inputProps.onChange(checked, e as any);\r\n };\r\n\r\n return <BwgFormItem {...itemProps} \r\n 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 };\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 <Switch {...inputProps} onChange={(checked: boolean, e: any) => handleChange(checked, e)} />\r\n </BwgFormItem>;\r\n};\r\n\r\nexport default BwgSwitch;"],"names":["BwgFormItem","React","children","label","name","rules","initialValue","style","rest","labelStyle","isRequired","rule","renderLabel","jsxs","jsx","Form","BwgCheck","itemProps","inputProps","form","handleChange","value","Checkbox","formatMap","BwgDatePicker","type","returnType","displayFormat","outputFormat","useMemo","allOutputFormats","f","a","b","dayjs","DatePicker","BwgForm","forwardRef","labelCol","className","props","ref","ConfigProvider","BwgInput","Input","RangePicker","BwgRangePicker","minDate","maxDate","BwgSelect","selectProps","isFormContext","optionList","newValue","selectComponentProps","selectComponent","Select","Space","Typography","BwgSwitch","checked","e","Switch"],"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,EC3CMc,EAAW,CAAC,CAChB,UAAAC,EACA,WAAAC,EAAa,CACX,OAAQ,IAAA,CAEZ,IAAqB,CACnB,MAAMC,EAAOJ,EAAAA,KAAK,gBAAA,EAEZK,EAAgB,GAAW,CAE3BF,EAAW,SAAW,UACxBC,EAAK,cAAcF,GAAW,KAAM,EAAE,OAAO,OAAO,EAEpDE,EAAK,cAAcF,GAAW,KAAM,EAAE,OAAO,QAAU,IAAM,GAAG,EAGlEC,EAAW,UAAYA,EAAW,SAAS,CAAC,CAC9C,EAEA,OACEJ,EAAAA,kBAAAA,IAACd,EAAA,CACE,GAAGiB,EACJ,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