@bwg-ui/core 1.0.0 → 1.1.2
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/AuthContext-CXng9fj0.cjs +2 -0
- package/dist/chunks/AuthContext-CXng9fj0.cjs.map +1 -0
- package/dist/chunks/AuthContext-Ei2P-z4d.js +53 -0
- package/dist/chunks/AuthContext-Ei2P-z4d.js.map +1 -0
- package/dist/chunks/BwgLargeUploader-CaH2F8x6.cjs +3 -0
- package/dist/chunks/BwgLargeUploader-CaH2F8x6.cjs.map +1 -0
- package/dist/chunks/BwgLargeUploader-CwaZ2WwY.js +3316 -0
- package/dist/chunks/BwgLargeUploader-CwaZ2WwY.js.map +1 -0
- package/dist/chunks/BwgSpace-CnLM4qcg.js +1 -0
- package/dist/chunks/BwgSpace-CnLM4qcg.js.map +1 -0
- package/dist/chunks/BwgSpace-b0hmM1Ht.cjs +1 -0
- package/dist/chunks/BwgSpace-b0hmM1Ht.cjs.map +1 -0
- package/dist/chunks/FileUtils-CmK-zHC5.cjs +2 -0
- package/dist/chunks/FileUtils-CmK-zHC5.cjs.map +1 -0
- package/dist/chunks/FileUtils-DsA-Sw37.js +141 -0
- package/dist/chunks/FileUtils-DsA-Sw37.js.map +1 -0
- package/dist/chunks/PublicLayout-BiTPwkVq.cjs +36 -0
- package/dist/chunks/PublicLayout-BiTPwkVq.cjs.map +1 -0
- package/dist/chunks/PublicLayout-g9WMtoZ0.js +139 -0
- package/dist/chunks/PublicLayout-g9WMtoZ0.js.map +1 -0
- package/dist/chunks/SSOHandler-CpCGcq5k.cjs +184 -0
- package/dist/chunks/SSOHandler-CpCGcq5k.cjs.map +1 -0
- package/dist/chunks/{QuickServiceToggle-y7esp1kp.js → SSOHandler-CvYiloZ5.js} +14832 -14630
- package/dist/chunks/SSOHandler-CvYiloZ5.js.map +1 -0
- package/dist/chunks/ScreenProtectContext-ofv2QgMp.cjs +2 -0
- package/dist/chunks/ScreenProtectContext-ofv2QgMp.cjs.map +1 -0
- package/dist/chunks/ScreenProtectContext-zByHldrr.js +115 -0
- package/dist/chunks/ScreenProtectContext-zByHldrr.js.map +1 -0
- package/dist/chunks/{ServiceCodeContext-CDZMr3Mm.js → SearchBoxContext-CzDzVCVm.js} +40 -39
- package/dist/chunks/SearchBoxContext-CzDzVCVm.js.map +1 -0
- package/dist/chunks/SearchBoxContext-mcPWk862.cjs +2 -0
- package/dist/chunks/SearchBoxContext-mcPWk862.cjs.map +1 -0
- package/dist/chunks/{UtilsContext-B16Gh9LL.cjs → UtilsContext-B6P_aohP.cjs} +2 -1
- package/dist/chunks/UtilsContext-B6P_aohP.cjs.map +1 -0
- package/dist/chunks/{UtilsContext-BbfZYiMR.js → UtilsContext-B9uAvAVF.js} +10 -9
- package/dist/chunks/UtilsContext-B9uAvAVF.js.map +1 -0
- package/dist/chunks/_commonjsHelpers-C6fGbg64.js +1 -0
- package/dist/chunks/_commonjsHelpers-C6fGbg64.js.map +1 -0
- package/dist/chunks/_commonjsHelpers-DwGv2jUC.cjs +1 -0
- package/dist/chunks/_commonjsHelpers-DwGv2jUC.cjs.map +1 -0
- package/dist/chunks/{codeStore-Dt6j826J.cjs → codeStore-BG8S_mdS.cjs} +2 -1
- package/dist/chunks/codeStore-BG8S_mdS.cjs.map +1 -0
- package/dist/chunks/{codeStore-bxk_q1sl.js → codeStore-rU4v3QIA.js} +2 -1
- package/dist/chunks/codeStore-rU4v3QIA.js.map +1 -0
- package/dist/chunks/commonUtils-BV6WFv-z.js +1 -0
- package/dist/chunks/commonUtils-BV6WFv-z.js.map +1 -0
- package/dist/chunks/commonUtils-L9Jgc5y-.cjs +1 -0
- package/dist/chunks/commonUtils-L9Jgc5y-.cjs.map +1 -0
- package/dist/chunks/envUtils-C9Gf5aek.js +30 -0
- package/dist/chunks/envUtils-C9Gf5aek.js.map +1 -0
- package/dist/chunks/envUtils-CduTHoHu.cjs +2 -0
- package/dist/chunks/envUtils-CduTHoHu.cjs.map +1 -0
- package/dist/chunks/jsx-runtime-CeSfJrVB.cjs +1 -0
- package/dist/chunks/jsx-runtime-CeSfJrVB.cjs.map +1 -0
- package/dist/chunks/jsx-runtime-Dpn_P65e.js +1 -0
- package/dist/chunks/jsx-runtime-Dpn_P65e.js.map +1 -0
- package/dist/chunks/menuStore-CBvENehP.cjs +2 -0
- package/dist/chunks/menuStore-CBvENehP.cjs.map +1 -0
- package/dist/chunks/{favoriteStore-CguRSEcH.js → menuStore-CvQrMo35.js} +137 -123
- package/dist/chunks/menuStore-CvQrMo35.js.map +1 -0
- package/dist/chunks/{popupStore-CVD8SPTa.cjs → popupStore--hKZUZcO.cjs} +2 -1
- package/dist/chunks/popupStore--hKZUZcO.cjs.map +1 -0
- package/dist/chunks/{popupStore-Dp_fqtim.js → popupStore-BFIHOcoZ.js} +2 -1
- package/dist/chunks/popupStore-BFIHOcoZ.js.map +1 -0
- package/dist/chunks/realFormat-Cha7OTd9.cjs +1 -0
- package/dist/chunks/realFormat-Cha7OTd9.cjs.map +1 -0
- package/dist/chunks/realFormat-DRGLFabQ.js +1 -0
- package/dist/chunks/realFormat-DRGLFabQ.js.map +1 -0
- package/dist/chunks/serviceConfig-Cc8jfw_Y.cjs +3 -0
- package/dist/chunks/serviceConfig-Cc8jfw_Y.cjs.map +1 -0
- package/dist/chunks/{serviceConfig-BJBsdee_.js → serviceConfig-lAlRNVIw.js} +177 -206
- package/dist/chunks/serviceConfig-lAlRNVIw.js.map +1 -0
- package/dist/components/common/BwgButtonGroup.d.ts +1 -0
- package/dist/components/common/BwgButtonGroup.d.ts.map +1 -0
- package/dist/components/common/BwgCmptArea.d.ts +85 -6
- package/dist/components/common/BwgCmptArea.d.ts.map +1 -0
- package/dist/components/common/BwgCol.d.ts +20 -0
- package/dist/components/common/BwgCol.d.ts.map +1 -0
- package/dist/components/common/BwgConfigProvider.d.ts +3 -1
- package/dist/components/common/BwgConfigProvider.d.ts.map +1 -0
- package/dist/components/common/BwgDrawer.d.ts +1 -0
- package/dist/components/common/BwgDrawer.d.ts.map +1 -0
- package/dist/components/common/BwgGrid.d.ts +10 -4
- package/dist/components/common/BwgGrid.d.ts.map +1 -0
- package/dist/components/common/BwgInfoArea.d.ts +3 -1
- package/dist/components/common/BwgInfoArea.d.ts.map +1 -0
- package/dist/components/common/BwgPopup.d.ts +1 -0
- package/dist/components/common/BwgPopup.d.ts.map +1 -0
- package/dist/components/common/BwgRow.d.ts +20 -0
- package/dist/components/common/BwgRow.d.ts.map +1 -0
- package/dist/components/common/BwgSpace.d.ts +1 -0
- package/dist/components/common/BwgSpace.d.ts.map +1 -0
- package/dist/components/common/BwgTable.d.ts +1 -0
- package/dist/components/common/BwgTable.d.ts.map +1 -0
- package/dist/components/common/BwgTabs.d.ts +1 -0
- package/dist/components/common/BwgTabs.d.ts.map +1 -0
- package/dist/components/common/BwgTitleBox.d.ts +6 -1
- package/dist/components/common/BwgTitleBox.d.ts.map +1 -0
- package/dist/components/common/BwgView.d.ts +3 -13
- package/dist/components/common/BwgView.d.ts.map +1 -0
- package/dist/components/common/ContentBox.d.ts +1 -0
- package/dist/components/common/ContentBox.d.ts.map +1 -0
- package/dist/components/common/ContentLayOut.d.ts +1 -0
- package/dist/components/common/ContentLayOut.d.ts.map +1 -0
- package/dist/components/common/GlobalConfigProvider.d.ts +1 -0
- package/dist/components/common/GlobalConfigProvider.d.ts.map +1 -0
- package/dist/components/common/QuickServiceToggle.d.ts +1 -0
- package/dist/components/common/QuickServiceToggle.d.ts.map +1 -0
- package/dist/components/common/SSOHandler.d.ts +3 -0
- package/dist/components/common/SSOHandler.d.ts.map +1 -0
- package/dist/components/common/SearchBox.d.ts +60 -7
- package/dist/components/common/SearchBox.d.ts.map +1 -0
- package/dist/components/common/index.cjs +2 -1
- package/dist/components/common/index.cjs.map +1 -0
- package/dist/components/common/index.d.ts +20 -16
- package/dist/components/common/index.d.ts.map +1 -0
- package/dist/components/common/index.js +21 -17
- package/dist/components/common/index.js.map +1 -0
- package/dist/components/core/BwgButton.d.ts +1 -0
- package/dist/components/core/BwgButton.d.ts.map +1 -0
- package/dist/components/core/BwgCheck.d.ts +1 -0
- package/dist/components/core/BwgCheck.d.ts.map +1 -0
- package/dist/components/core/BwgCheckList.d.ts +1 -0
- package/dist/components/core/BwgCheckList.d.ts.map +1 -0
- package/dist/components/core/BwgDatePicker.d.ts +1 -0
- package/dist/components/core/BwgDatePicker.d.ts.map +1 -0
- package/dist/components/core/BwgForm.d.ts +1 -0
- package/dist/components/core/BwgForm.d.ts.map +1 -0
- package/dist/components/core/BwgFormItem.d.ts +1 -0
- package/dist/components/core/BwgFormItem.d.ts.map +1 -0
- package/dist/components/core/BwgInput.d.ts +1 -0
- package/dist/components/core/BwgInput.d.ts.map +1 -0
- package/dist/components/core/BwgLargeUploader.d.ts +5 -1
- package/dist/components/core/BwgLargeUploader.d.ts.map +1 -0
- package/dist/components/core/BwgMaskedInput.d.ts +1 -0
- package/dist/components/core/BwgMaskedInput.d.ts.map +1 -0
- package/dist/components/core/BwgMaskedPicker.d.ts +1 -0
- package/dist/components/core/BwgMaskedPicker.d.ts.map +1 -0
- package/dist/components/core/BwgMultiSelect.d.ts +1 -0
- package/dist/components/core/BwgMultiSelect.d.ts.map +1 -0
- package/dist/components/core/BwgNumber.d.ts +1 -0
- package/dist/components/core/BwgNumber.d.ts.map +1 -0
- package/dist/components/core/BwgRadio.d.ts +1 -0
- package/dist/components/core/BwgRadio.d.ts.map +1 -0
- package/dist/components/core/BwgRangePicker.d.ts +1 -0
- package/dist/components/core/BwgRangePicker.d.ts.map +1 -0
- package/dist/components/core/BwgSearch.d.ts +5 -0
- package/dist/components/core/BwgSearch.d.ts.map +1 -0
- package/dist/components/core/BwgSelect.d.ts +1 -0
- package/dist/components/core/BwgSelect.d.ts.map +1 -0
- package/dist/components/core/BwgTextArea.d.ts +1 -0
- package/dist/components/core/BwgTextArea.d.ts.map +1 -0
- package/dist/components/core/BwgUploader.d.ts +31 -7
- package/dist/components/core/BwgUploader.d.ts.map +1 -0
- package/dist/components/core/index.cjs +2 -1
- package/dist/components/core/index.cjs.map +1 -0
- package/dist/components/core/index.d.ts +1 -0
- package/dist/components/core/index.d.ts.map +1 -0
- package/dist/components/core/index.js +2 -1
- package/dist/components/core/index.js.map +1 -0
- package/dist/components/guide/BwgComponentGuide.d.ts +1 -0
- package/dist/components/guide/BwgComponentGuide.d.ts.map +1 -0
- package/dist/components/guide/BwgDeveloperGuide.d.ts +1 -0
- package/dist/components/guide/BwgDeveloperGuide.d.ts.map +1 -0
- package/dist/components/guide/index.cjs +1 -0
- package/dist/components/guide/index.cjs.map +1 -0
- package/dist/components/guide/index.d.ts +1 -0
- package/dist/components/guide/index.d.ts.map +1 -0
- package/dist/components/guide/index.js +1 -0
- package/dist/components/guide/index.js.map +1 -0
- package/dist/components/layout/ProgressOverlay.d.ts +11 -0
- package/dist/components/layout/ProgressOverlay.d.ts.map +1 -0
- package/dist/components/layout/ProtectLayout.d.ts +7 -0
- package/dist/components/layout/ProtectLayout.d.ts.map +1 -0
- package/dist/components/layout/PublicLayout.d.ts +7 -0
- package/dist/components/layout/PublicLayout.d.ts.map +1 -0
- package/dist/components/layout/index.cjs +2 -0
- package/dist/components/layout/index.cjs.map +1 -0
- package/dist/components/layout/index.d.ts +4 -0
- package/dist/components/layout/index.d.ts.map +1 -0
- package/dist/components/layout/index.js +7 -0
- package/dist/components/layout/index.js.map +1 -0
- package/dist/index.cjs +2 -1
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +305 -289
- package/dist/index.js.map +1 -0
- package/dist/provider/contexts/AuthContext.d.ts +13 -0
- package/dist/provider/contexts/AuthContext.d.ts.map +1 -0
- package/dist/provider/contexts/CommonCodeContext.d.ts +6 -5
- package/dist/provider/contexts/CommonCodeContext.d.ts.map +1 -0
- package/dist/provider/contexts/ScreenProtectContext.d.ts +22 -0
- package/dist/provider/contexts/ScreenProtectContext.d.ts.map +1 -0
- package/dist/provider/contexts/SearchBoxContext.d.ts +1 -0
- package/dist/provider/contexts/SearchBoxContext.d.ts.map +1 -0
- package/dist/provider/contexts/ServiceCodeContext.d.ts +1 -0
- package/dist/provider/contexts/ServiceCodeContext.d.ts.map +1 -0
- package/dist/provider/contexts/UtilsContext.d.ts +1 -0
- package/dist/provider/contexts/UtilsContext.d.ts.map +1 -0
- package/dist/provider/contexts/index.d.ts +3 -0
- package/dist/provider/contexts/index.d.ts.map +1 -0
- package/dist/provider/hooks/index.d.ts +1 -0
- package/dist/provider/hooks/index.d.ts.map +1 -0
- package/dist/provider/hooks/usePopup.d.ts +2 -1
- package/dist/provider/hooks/usePopup.d.ts.map +1 -0
- package/dist/provider/hooks/useViewState.d.ts +1 -0
- package/dist/provider/hooks/useViewState.d.ts.map +1 -0
- package/dist/provider/index.cjs +2 -1
- package/dist/provider/index.cjs.map +1 -0
- package/dist/provider/index.d.ts +1 -0
- package/dist/provider/index.d.ts.map +1 -0
- package/dist/provider/index.js +26 -19
- package/dist/provider/index.js.map +1 -0
- package/dist/public/realgrid/css/realgrid-style-custom.css +643 -0
- package/dist/public/realgrid/css/realgrid-style.css +1902 -0
- package/dist/public/realgrid/images/ico_c.png +0 -0
- package/dist/public/realgrid/images/ico_d.png +0 -0
- package/dist/public/realgrid/images/ico_jp.png +0 -0
- package/dist/public/realgrid/images/ico_mp.png +0 -0
- package/dist/public/realgrid/images/ico_n.png +0 -0
- package/dist/public/realgrid/images/ico_nd.png +0 -0
- package/dist/public/realgrid/images/ico_p.png +0 -0
- package/dist/public/realgrid/images/ico_r.png +0 -0
- package/dist/public/realgrid/images/ico_sp.png +0 -0
- package/dist/public/realgrid/images/ico_u.png +0 -0
- package/dist/public/realgrid/images/ico_wt.png +0 -0
- package/dist/stores/codeStore.d.ts +4 -3
- package/dist/stores/codeStore.d.ts.map +1 -0
- package/dist/stores/favoriteStore.d.ts +1 -0
- package/dist/stores/favoriteStore.d.ts.map +1 -0
- package/dist/stores/index.cjs +2 -1
- package/dist/stores/index.cjs.map +1 -0
- package/dist/stores/index.d.ts +1 -0
- package/dist/stores/index.d.ts.map +1 -0
- package/dist/stores/index.js +6 -5
- package/dist/stores/index.js.map +1 -0
- package/dist/stores/menuStore.d.ts +1 -0
- package/dist/stores/menuStore.d.ts.map +1 -0
- package/dist/stores/popupStore.d.ts +1 -0
- package/dist/stores/popupStore.d.ts.map +1 -0
- package/dist/stores/userStore.d.ts +4 -3
- package/dist/stores/userStore.d.ts.map +1 -0
- package/dist/styles/assets/images/backgrounds/krx_login_bg.png +0 -0
- package/dist/styles/assets/images/contents/icon/ico-lockscreen.svg +44 -0
- package/dist/styles/assets/images/logos/krx-logo-full.svg +35 -0
- package/dist/styles/components.css +130 -17
- package/dist/styles/global.css +19 -0
- package/dist/styles/layout.css +108 -35
- package/dist/styles/login.css +39 -33
- package/dist/styles/variables.css +221 -5
- package/dist/types/global.d.ts +2 -0
- package/dist/utils/FileUtils.d.ts +8 -0
- package/dist/utils/FileUtils.d.ts.map +1 -0
- package/dist/utils/apiUtils.d.ts +1 -0
- package/dist/utils/apiUtils.d.ts.map +1 -0
- package/dist/utils/arrayUtils.d.ts +1 -0
- package/dist/utils/arrayUtils.d.ts.map +1 -0
- package/dist/utils/commonUtils.d.ts +1 -0
- package/dist/utils/commonUtils.d.ts.map +1 -0
- package/dist/utils/cookieUtils.d.ts +1 -0
- package/dist/utils/cookieUtils.d.ts.map +1 -0
- package/dist/utils/dateUtils.d.ts +1 -0
- package/dist/utils/dateUtils.d.ts.map +1 -0
- package/dist/utils/envUtils.d.ts +9 -0
- package/dist/utils/envUtils.d.ts.map +1 -0
- package/dist/utils/imageUtils.d.ts +1 -0
- package/dist/utils/imageUtils.d.ts.map +1 -0
- package/dist/utils/index.cjs +2 -1
- package/dist/utils/index.cjs.map +1 -0
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +106 -103
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/messageUtils.d.ts +1 -0
- package/dist/utils/messageUtils.d.ts.map +1 -0
- package/dist/utils/notificationUtils.d.ts +1 -0
- package/dist/utils/notificationUtils.d.ts.map +1 -0
- package/dist/utils/objectUtils.d.ts +1 -0
- package/dist/utils/objectUtils.d.ts.map +1 -0
- package/dist/utils/realFormat.d.ts +1 -0
- package/dist/utils/realFormat.d.ts.map +1 -0
- package/dist/utils/serviceConfig.d.ts +1 -0
- package/dist/utils/serviceConfig.d.ts.map +1 -0
- package/dist/utils/stringUtils.d.ts +1 -0
- package/dist/utils/stringUtils.d.ts.map +1 -0
- package/dist/utils/userUtils.d.ts +2 -1
- package/dist/utils/userUtils.d.ts.map +1 -0
- package/package.json +40 -37
- package/dist/chunks/BwgLargeUploader-ByN1XWV4.js +0 -809
- package/dist/chunks/BwgLargeUploader-CU0-MVk4.cjs +0 -1
- package/dist/chunks/QuickServiceToggle-CiCuWfCF.cjs +0 -183
- package/dist/chunks/ServiceCodeContext--ZnMtjzD.cjs +0 -1
- package/dist/chunks/favoriteStore-TgeeY32l.cjs +0 -1
- package/dist/chunks/messageUtils-9DXOwada.js +0 -117
- package/dist/chunks/messageUtils-RjJD_ArW.cjs +0 -1
- package/dist/chunks/serviceConfig-Cr2P4yr4.cjs +0 -2
- package/dist/public/styles/assets/images/contents/icon/ico-business-trip.svg +0 -21
- package/dist/public/styles/assets/images/contents/icon/ico-holiday.svg +0 -23
- package/dist/public/styles/assets/images/contents/icon/ico-menu-help.svg +0 -5
- package/dist/public/styles/assets/images/contents/icon/ico-overtime.svg +0 -17
- package/dist/public/styles/assets/images/contents/icon/ico-quick-tab-move.svg +0 -8
- package/dist/public/styles/assets/images/contents/icon/quick tab-text.svg +0 -4
- package/dist/public/styles/assets/images/contents/icon/quick-tab-text.svg +0 -4
- package/dist/public/test.txt +0 -0
- package/dist/styles/assets/images/contents/icon/quick tab-text.svg +0 -4
- package/dist/test.txt +0 -0
- package/public/styles/assets/images/contents/icon/ico-business-trip.svg +0 -21
- package/public/styles/assets/images/contents/icon/ico-holiday.svg +0 -23
- package/public/styles/assets/images/contents/icon/ico-menu-help.svg +0 -5
- package/public/styles/assets/images/contents/icon/ico-overtime.svg +0 -17
- package/public/styles/assets/images/contents/icon/ico-quick-tab-move.svg +0 -8
- package/public/styles/assets/images/contents/icon/quick tab-text.svg +0 -4
- package/public/styles/assets/images/contents/icon/quick-tab-text.svg +0 -4
- package/public/test.txt +0 -0
|
@@ -0,0 +1,3316 @@
|
|
|
1
|
+
import { j as c } from "./jsx-runtime-Dpn_P65e.js";
|
|
2
|
+
import { Form as k, Select as be, Space as te, Typography as We, Input as G, Button as q, DatePicker as Te, Radio as vt, Checkbox as me, ConfigProvider as Dt, InputNumber as yt, message as C, Upload as H, Spin as St, Card as Ot, List as ue, Tooltip as bt, Flex as Pe, Progress as Tt, notification as Ct } from "antd";
|
|
3
|
+
import Ze, { forwardRef as It, useMemo as M, useRef as re, useEffect as Y, useState as F, createContext as Et, memo as wt, useLayoutEffect as xt, useCallback as Nt, isValidElement as Pt, cloneElement as Me, useContext as Mt } from "react";
|
|
4
|
+
import { u as Rt } from "./popupStore-BFIHOcoZ.js";
|
|
5
|
+
import { SearchOutlined as _t, UploadOutlined as Je, CloseCircleOutlined as Lt, DeleteOutlined as jt, InboxOutlined as Ft, CloudUploadOutlined as kt, CheckCircleOutlined as Yt, FileTextOutlined as At } from "@ant-design/icons";
|
|
6
|
+
import Qe from "imask";
|
|
7
|
+
import P from "dayjs";
|
|
8
|
+
import { V as z, a7 as $ } from "./serviceConfig-lAlRNVIw.js";
|
|
9
|
+
import { findIndex as W } from "lodash";
|
|
10
|
+
import { g as Ht } from "./_commonjsHelpers-C6fGbg64.js";
|
|
11
|
+
import Bt from "jszip";
|
|
12
|
+
const w = Ze.memo(
|
|
13
|
+
({ children: t, label: e, name: r, rules: n, initialValue: o, style: i }) => {
|
|
14
|
+
const s = {
|
|
15
|
+
fontWeight: "bold"
|
|
16
|
+
}, a = Array.isArray(n) && n.some((d) => d.required === !0), u = () => typeof e == "string" ? /* @__PURE__ */ c.jsxs("span", { style: s, children: [
|
|
17
|
+
e,
|
|
18
|
+
a && /* @__PURE__ */ c.jsx("span", { style: { color: "#ff4d4f", marginLeft: "4px" }, children: "*" })
|
|
19
|
+
] }) : /* @__PURE__ */ c.jsx("span", { style: s, children: e });
|
|
20
|
+
return /* @__PURE__ */ c.jsx(
|
|
21
|
+
k.Item,
|
|
22
|
+
{
|
|
23
|
+
className: "bwg-form-item",
|
|
24
|
+
label: u(),
|
|
25
|
+
labelAlign: "left",
|
|
26
|
+
name: r,
|
|
27
|
+
rules: n,
|
|
28
|
+
colon: !1,
|
|
29
|
+
initialValue: o,
|
|
30
|
+
style: i,
|
|
31
|
+
children: t
|
|
32
|
+
}
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
), Ut = It(
|
|
36
|
+
({ children: t, labelCol: e, style: r, className: n, ...o }, i) => /* @__PURE__ */ c.jsx(
|
|
37
|
+
k,
|
|
38
|
+
{
|
|
39
|
+
ref: i,
|
|
40
|
+
...o,
|
|
41
|
+
requiredMark: !1,
|
|
42
|
+
labelCol: e || { flex: "100px" },
|
|
43
|
+
style: { padding: "10px", ...r },
|
|
44
|
+
className: `bwg-form ${n ?? ""}`,
|
|
45
|
+
children: t
|
|
46
|
+
}
|
|
47
|
+
)
|
|
48
|
+
);
|
|
49
|
+
Ut.displayName = "BwgForm";
|
|
50
|
+
const Io = ({
|
|
51
|
+
itemProps: t,
|
|
52
|
+
selectProps: e = {
|
|
53
|
+
options: [],
|
|
54
|
+
allowClear: !0
|
|
55
|
+
}
|
|
56
|
+
}) => {
|
|
57
|
+
const r = k.useFormInstance(), n = !!r, o = M(() => e?.addField === "ALL" ? [{ label: "전체", value: "" }, ...e?.options || []] : e?.addField === "NULL" ? [{ label: "", value: "" }, ...e?.options || []] : e?.options || [], [e.options, e.addField]), i = (u) => {
|
|
58
|
+
e.onChange?.(u);
|
|
59
|
+
}, s = {
|
|
60
|
+
...e,
|
|
61
|
+
allowClear: e.allowClear ?? !0,
|
|
62
|
+
options: o,
|
|
63
|
+
onChange: i,
|
|
64
|
+
variant: e.variant
|
|
65
|
+
};
|
|
66
|
+
console.log("selectComponentProps :: ", s);
|
|
67
|
+
const a = /* @__PURE__ */ c.jsx(be, { ...s, disabled: e.disabled });
|
|
68
|
+
return e.copyable && !n && console.warn(
|
|
69
|
+
"BwgSelect: copyable 기능은 Form 컨텍스트 내에서만 사용 가능합니다."
|
|
70
|
+
), e.copyable ? /* @__PURE__ */ c.jsx(w, { ...t, children: /* @__PURE__ */ c.jsxs(te.Compact, { block: !0, children: [
|
|
71
|
+
/* @__PURE__ */ c.jsx(
|
|
72
|
+
k.Item,
|
|
73
|
+
{
|
|
74
|
+
name: t?.name,
|
|
75
|
+
rules: t?.rules,
|
|
76
|
+
style: { width: "100%", marginBottom: 0 },
|
|
77
|
+
validateStatus: "",
|
|
78
|
+
help: "",
|
|
79
|
+
children: a
|
|
80
|
+
}
|
|
81
|
+
),
|
|
82
|
+
/* @__PURE__ */ c.jsx(
|
|
83
|
+
We.Paragraph,
|
|
84
|
+
{
|
|
85
|
+
copyable: {
|
|
86
|
+
text: n && r?.getFieldValue(t?.name)?.toString() || "",
|
|
87
|
+
tooltips: ["코드복사", "코드복사됨"]
|
|
88
|
+
},
|
|
89
|
+
style: {
|
|
90
|
+
margin: 0,
|
|
91
|
+
backgroundColor: "#f5f5f5",
|
|
92
|
+
borderRadius: "4px",
|
|
93
|
+
border: "1px solid #d9d9d9",
|
|
94
|
+
fontSize: "12px",
|
|
95
|
+
color: "#666",
|
|
96
|
+
display: "flex",
|
|
97
|
+
alignItems: "center",
|
|
98
|
+
height: "30px",
|
|
99
|
+
padding: "0 8px"
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
)
|
|
103
|
+
] }) }) : /* @__PURE__ */ c.jsx(w, { ...t, children: a });
|
|
104
|
+
}, Re = G.Search, Eo = (t) => {
|
|
105
|
+
const e = k.useFormInstance(), { openPopup: r } = Rt(), n = t.itemProps?.name || [], o = t.popupConfig || {
|
|
106
|
+
callback(s) {
|
|
107
|
+
console.log("callback data :: ", s), n.length > 1 ? (e.setFieldValue(n[0], s.code), e.setFieldValue(n[1], s.name)) : e.setFieldValue(n, s.code);
|
|
108
|
+
}
|
|
109
|
+
}, i = {
|
|
110
|
+
...t,
|
|
111
|
+
placeholder: typeof t.placeholder == "string" ? t.placeholder : t.placeholder?.[0] || "",
|
|
112
|
+
onChange: (s) => {
|
|
113
|
+
n.length > 1 && e.setFieldValue(n[0], ""), t.onChange?.(s);
|
|
114
|
+
},
|
|
115
|
+
onSearch: (s) => {
|
|
116
|
+
t.popuCd ? r(t.popuCd, t.popupParams, o) : t.onSearch?.(s);
|
|
117
|
+
}
|
|
118
|
+
};
|
|
119
|
+
return n.length > 1 ? /* @__PURE__ */ c.jsx(w, { ...t.itemProps, name: void 0, children: /* @__PURE__ */ c.jsxs(te.Compact, { block: !0, children: [
|
|
120
|
+
/* @__PURE__ */ c.jsx(
|
|
121
|
+
k.Item,
|
|
122
|
+
{
|
|
123
|
+
name: n[0],
|
|
124
|
+
rules: t.itemProps?.rules,
|
|
125
|
+
style: { width: "40%", marginBottom: 0, marginInlineEnd: 0 },
|
|
126
|
+
validateStatus: "",
|
|
127
|
+
help: "",
|
|
128
|
+
children: /* @__PURE__ */ c.jsx(
|
|
129
|
+
G,
|
|
130
|
+
{
|
|
131
|
+
style: { color: "#999", backgroundColor: "#f5f5f5" },
|
|
132
|
+
placeholder: t.placeholder?.[0] || "",
|
|
133
|
+
readOnly: !0
|
|
134
|
+
}
|
|
135
|
+
)
|
|
136
|
+
}
|
|
137
|
+
),
|
|
138
|
+
/* @__PURE__ */ c.jsx(k.Item, { name: n[1], style: { width: "60%", marginBottom: 0 }, children: /* @__PURE__ */ c.jsx(
|
|
139
|
+
Re,
|
|
140
|
+
{
|
|
141
|
+
readOnly: t.readOnly,
|
|
142
|
+
enterButton: /* @__PURE__ */ c.jsx(
|
|
143
|
+
q,
|
|
144
|
+
{
|
|
145
|
+
icon: /* @__PURE__ */ c.jsx(_t, {}),
|
|
146
|
+
disabled: t.readOnly
|
|
147
|
+
}
|
|
148
|
+
),
|
|
149
|
+
...i
|
|
150
|
+
}
|
|
151
|
+
) })
|
|
152
|
+
] }) }) : /* @__PURE__ */ c.jsx(w, { ...t.itemProps, children: /* @__PURE__ */ c.jsx(Re, { ...i }) });
|
|
153
|
+
}, Vt = (t) => {
|
|
154
|
+
if (typeof t == "string")
|
|
155
|
+
return t.replace(/0/g, "_");
|
|
156
|
+
if (Array.isArray(t))
|
|
157
|
+
return t[0].replace(/0/g, "_");
|
|
158
|
+
if (typeof t == "object" && "mask" in t && "blocks" in t) {
|
|
159
|
+
const { mask: e, blocks: r } = t;
|
|
160
|
+
return e.split(".").map((n) => {
|
|
161
|
+
const i = r?.[n]?.maxLength ?? 3;
|
|
162
|
+
return "_".repeat(i);
|
|
163
|
+
}).join(".");
|
|
164
|
+
}
|
|
165
|
+
return "";
|
|
166
|
+
}, wo = ({
|
|
167
|
+
itemProps: t,
|
|
168
|
+
inputProps: e,
|
|
169
|
+
mask: r
|
|
170
|
+
}) => {
|
|
171
|
+
const n = re(null), o = k.useFormInstance(), i = M(() => Vt(r), [r]);
|
|
172
|
+
return Y(() => {
|
|
173
|
+
if (!n.current?.input) return;
|
|
174
|
+
const s = typeof r == "string" || Array.isArray(r) ? { mask: r } : r, a = Qe(n.current.input, s);
|
|
175
|
+
return a.on("accept", () => {
|
|
176
|
+
o && t?.name && o.setFieldValue(t.name, a.value);
|
|
177
|
+
}), () => {
|
|
178
|
+
a.destroy();
|
|
179
|
+
};
|
|
180
|
+
}, [r, o, t?.name]), /* @__PURE__ */ c.jsx(w, { ...t, children: /* @__PURE__ */ c.jsx(G, { ...e, ref: n, placeholder: i }) });
|
|
181
|
+
}, $t = (t) => {
|
|
182
|
+
switch (t) {
|
|
183
|
+
case "year":
|
|
184
|
+
return { format: "YYYY", mask: "0000", outputFormat: "YYYY" };
|
|
185
|
+
case "month":
|
|
186
|
+
return { format: "YYYY-MM", mask: "0000-00", outputFormat: "YYYYMM" };
|
|
187
|
+
case "date":
|
|
188
|
+
default:
|
|
189
|
+
return {
|
|
190
|
+
format: "YYYY-MM-DD",
|
|
191
|
+
mask: "0000-00-00",
|
|
192
|
+
outputFormat: "YYYYMMDD"
|
|
193
|
+
};
|
|
194
|
+
}
|
|
195
|
+
}, xo = ({
|
|
196
|
+
type: t = "date",
|
|
197
|
+
itemProps: e = { name: "calendar" },
|
|
198
|
+
inputProps: r
|
|
199
|
+
}) => {
|
|
200
|
+
const { format: n, mask: o, outputFormat: i } = $t(t), s = re(null), a = re(null), u = k.useFormInstance(), [d, g] = F(!1), [y, v] = F(!1), f = e?.name, [p, h] = F(null);
|
|
201
|
+
Y(() => {
|
|
202
|
+
if (!s.current?.input) return;
|
|
203
|
+
const m = Qe(s.current.input, {
|
|
204
|
+
mask: o,
|
|
205
|
+
lazy: !1
|
|
206
|
+
});
|
|
207
|
+
return a.current = m, m.on("accept", () => {
|
|
208
|
+
console.log("input :: ", m.value);
|
|
209
|
+
const l = m.value, S = P(l, n, !0);
|
|
210
|
+
console.log("input :: ", S), l.length === n.length && S.isValid() && (console.log("parsed :: ", S.format(i)), u.setFieldValue(f, S.format(i)), a.current.updateValue(), g(!1));
|
|
211
|
+
}), () => {
|
|
212
|
+
m.destroy();
|
|
213
|
+
};
|
|
214
|
+
}, [n, o]), Y(() => {
|
|
215
|
+
h(P(u.getFieldValue(f)));
|
|
216
|
+
}, [u.getFieldValue(f)]);
|
|
217
|
+
const O = (m) => {
|
|
218
|
+
if (!m) {
|
|
219
|
+
a.current?.updateValue();
|
|
220
|
+
return;
|
|
221
|
+
}
|
|
222
|
+
const l = m.format(i);
|
|
223
|
+
console.log("formatted :: ", l), a.current && (a.current.value = l, a.current.updateValue()), v(!1);
|
|
224
|
+
};
|
|
225
|
+
return /* @__PURE__ */ c.jsx(
|
|
226
|
+
w,
|
|
227
|
+
{
|
|
228
|
+
...e,
|
|
229
|
+
name: void 0,
|
|
230
|
+
validateStatus: y ? "warning" : void 0,
|
|
231
|
+
help: y ? "유효하지 않은 날짜입니다" : void 0,
|
|
232
|
+
children: /* @__PURE__ */ c.jsxs("div", { style: { position: "relative" }, children: [
|
|
233
|
+
/* @__PURE__ */ c.jsx(
|
|
234
|
+
k.Item,
|
|
235
|
+
{
|
|
236
|
+
name: f,
|
|
237
|
+
getValueProps: (m) => ({
|
|
238
|
+
value: m ? P(m).format(n) : void 0
|
|
239
|
+
}),
|
|
240
|
+
normalize: (m) => m ? P(m).format(i) : void 0,
|
|
241
|
+
noStyle: !0,
|
|
242
|
+
children: /* @__PURE__ */ c.jsx(
|
|
243
|
+
G,
|
|
244
|
+
{
|
|
245
|
+
...r,
|
|
246
|
+
ref: s,
|
|
247
|
+
onFocus: () => {
|
|
248
|
+
g(!d), a.current?.updateValue();
|
|
249
|
+
},
|
|
250
|
+
onKeyDown: (m) => {
|
|
251
|
+
m.key === "Backspace" && g(!0), m.key === "Tab" && g(!1);
|
|
252
|
+
},
|
|
253
|
+
allowClear: !0,
|
|
254
|
+
placeholder: o.replace(/0/g, "_"),
|
|
255
|
+
autoComplete: "off"
|
|
256
|
+
}
|
|
257
|
+
)
|
|
258
|
+
}
|
|
259
|
+
),
|
|
260
|
+
/* @__PURE__ */ c.jsx(
|
|
261
|
+
Te,
|
|
262
|
+
{
|
|
263
|
+
open: d,
|
|
264
|
+
picker: t,
|
|
265
|
+
format: n,
|
|
266
|
+
value: p,
|
|
267
|
+
onChange: O,
|
|
268
|
+
getPopupContainer: (m) => m.parentElement,
|
|
269
|
+
style: {
|
|
270
|
+
position: "absolute",
|
|
271
|
+
top: 0,
|
|
272
|
+
left: 0,
|
|
273
|
+
pointerEvents: "none",
|
|
274
|
+
opacity: 0,
|
|
275
|
+
width: "100%"
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
)
|
|
279
|
+
] })
|
|
280
|
+
}
|
|
281
|
+
);
|
|
282
|
+
}, No = ({ itemProps: t, inputProps: e }) => /* @__PURE__ */ c.jsx(w, { ...t, children: /* @__PURE__ */ c.jsx(G, { ...e }) }), Po = ({
|
|
283
|
+
itemProps: t,
|
|
284
|
+
inputProps: e,
|
|
285
|
+
type: r = "date",
|
|
286
|
+
useMask: n = !1
|
|
287
|
+
}) => {
|
|
288
|
+
const o = {
|
|
289
|
+
year: { displayFormat: "YYYY", outputFormat: "YYYY" },
|
|
290
|
+
month: { displayFormat: "YYYY-MM", outputFormat: "YYYYMM" },
|
|
291
|
+
date: { displayFormat: "YYYY-MM-DD", outputFormat: "YYYYMMDD" }
|
|
292
|
+
}, { displayFormat: i, outputFormat: s } = o[r], a = (u, d) => {
|
|
293
|
+
if (e?.onChange && typeof e.onChange == "function") {
|
|
294
|
+
let g;
|
|
295
|
+
u instanceof P ? g = u.format(s) : (g = [], u && u.map((y) => {
|
|
296
|
+
g.push(y.format(s));
|
|
297
|
+
})), e.onChange(g, d);
|
|
298
|
+
}
|
|
299
|
+
};
|
|
300
|
+
return /* @__PURE__ */ c.jsx(
|
|
301
|
+
w,
|
|
302
|
+
{
|
|
303
|
+
...t,
|
|
304
|
+
getValueProps: (u) => ({
|
|
305
|
+
value: u && P(u)
|
|
306
|
+
}),
|
|
307
|
+
normalize: (u) => u && `${P(u).format(s)}`,
|
|
308
|
+
children: /* @__PURE__ */ c.jsx(
|
|
309
|
+
Te,
|
|
310
|
+
{
|
|
311
|
+
...e,
|
|
312
|
+
format: n ? { format: i, type: "mask" } : void 0,
|
|
313
|
+
onChange: a
|
|
314
|
+
}
|
|
315
|
+
)
|
|
316
|
+
}
|
|
317
|
+
);
|
|
318
|
+
}, { RangePicker: zt } = Te, Mo = ({
|
|
319
|
+
itemProps: t,
|
|
320
|
+
inputProps: e,
|
|
321
|
+
type: r = "date",
|
|
322
|
+
minDate: n,
|
|
323
|
+
maxDate: o,
|
|
324
|
+
useMask: i = !1
|
|
325
|
+
}) => {
|
|
326
|
+
const s = {
|
|
327
|
+
year: { displayFormat: "YYYY", outputFormat: "YYYY" },
|
|
328
|
+
month: { displayFormat: "YYYY-MM", outputFormat: "YYYYMM" },
|
|
329
|
+
date: { displayFormat: "YYYY-MM-DD", outputFormat: "YYYYMMDD" }
|
|
330
|
+
}, { displayFormat: a, outputFormat: u } = s[r], d = (g, y) => {
|
|
331
|
+
if (e.onChange && typeof e.onChange == "function") {
|
|
332
|
+
let v;
|
|
333
|
+
g instanceof P ? v = g.format(u) : (v = [], g && g.map((f) => {
|
|
334
|
+
v.push(f.format(u));
|
|
335
|
+
})), e.onChange(v, y);
|
|
336
|
+
}
|
|
337
|
+
};
|
|
338
|
+
return /* @__PURE__ */ c.jsx(
|
|
339
|
+
w,
|
|
340
|
+
{
|
|
341
|
+
...t,
|
|
342
|
+
getValueProps: (g) => ({
|
|
343
|
+
value: g && [
|
|
344
|
+
g[0] ? P(g[0]) : null,
|
|
345
|
+
g[1] ? P(g[1]) : null
|
|
346
|
+
]
|
|
347
|
+
}),
|
|
348
|
+
normalize: (g) => [
|
|
349
|
+
g?.[0] ? P(g[0]).format(u) : void 0,
|
|
350
|
+
g?.[1] ? P(g[1]).format(u) : void 0
|
|
351
|
+
],
|
|
352
|
+
children: /* @__PURE__ */ c.jsx(
|
|
353
|
+
zt,
|
|
354
|
+
{
|
|
355
|
+
...e,
|
|
356
|
+
format: i ? {
|
|
357
|
+
format: a,
|
|
358
|
+
type: "mask"
|
|
359
|
+
} : void 0,
|
|
360
|
+
picker: r,
|
|
361
|
+
order: !0,
|
|
362
|
+
minDate: n ? P(n, u) : void 0,
|
|
363
|
+
maxDate: o ? P(o, u) : void 0,
|
|
364
|
+
onChange: d
|
|
365
|
+
}
|
|
366
|
+
)
|
|
367
|
+
}
|
|
368
|
+
);
|
|
369
|
+
}, Ro = ({ itemProps: t, inputProps: e }) => /* @__PURE__ */ c.jsx(w, { ...t, children: /* @__PURE__ */ c.jsx(vt.Group, { ...e }) }), _o = ({
|
|
370
|
+
itemProps: t,
|
|
371
|
+
inputProps: e = {
|
|
372
|
+
format: "YN"
|
|
373
|
+
}
|
|
374
|
+
}) => {
|
|
375
|
+
const r = k.useFormInstance(), n = (o) => {
|
|
376
|
+
e.format === "boolean" ? r.setFieldValue(t?.name, o.target.checked) : r.setFieldValue(t?.name, o.target.checked ? "Y" : "N"), e.onChange && e.onChange(o);
|
|
377
|
+
};
|
|
378
|
+
return /* @__PURE__ */ c.jsx(
|
|
379
|
+
w,
|
|
380
|
+
{
|
|
381
|
+
...t,
|
|
382
|
+
getValueProps: (o) => (console.log("getValueProps :: ", o), { checked: e.format === "boolean" ? !!o : o === "Y" }),
|
|
383
|
+
normalize: (o) => (console.log("normalize :: ", o), typeof o == "boolean" ? e.format === "boolean" ? o : o ? "Y" : "N" : e.format === "boolean" ? !!o : o ? "Y" : "N"),
|
|
384
|
+
children: /* @__PURE__ */ c.jsx(me, { ...e, onChange: n, children: e?.title })
|
|
385
|
+
}
|
|
386
|
+
);
|
|
387
|
+
}, Lo = ({ itemProps: t, inputProps: e }) => {
|
|
388
|
+
const r = k.useFormInstance(), [n, o] = F(
|
|
389
|
+
t?.initialValue ?? []
|
|
390
|
+
), [i, s] = F([]), a = i.length > 0 && i.length == n?.length, u = n?.length > 0 && n.length < i.length;
|
|
391
|
+
Y(() => {
|
|
392
|
+
s(d(e?.options));
|
|
393
|
+
}, [e?.options]), Y(() => {
|
|
394
|
+
o(n);
|
|
395
|
+
}, [n]);
|
|
396
|
+
const d = (v) => {
|
|
397
|
+
const f = [];
|
|
398
|
+
return (v || []).map((p, h) => {
|
|
399
|
+
f.push(p.value);
|
|
400
|
+
}), f;
|
|
401
|
+
}, g = (v) => {
|
|
402
|
+
o(v.target.checked ? i : []), r.setFieldValue(t?.name, v.target.checked ? i : []);
|
|
403
|
+
}, y = (v) => {
|
|
404
|
+
o(v), r.setFieldValue(t?.name, v), e?.onChange && typeof e?.onChange == "function" && e?.onChange(v);
|
|
405
|
+
};
|
|
406
|
+
return /* @__PURE__ */ c.jsx(w, { ...t, children: /* @__PURE__ */ c.jsxs(Dt, { theme: {
|
|
407
|
+
components: {
|
|
408
|
+
Checkbox: {
|
|
409
|
+
colorPrimary: "#6377D1",
|
|
410
|
+
colorPrimaryBorder: "#6377D1",
|
|
411
|
+
colorPrimaryHover: "#6449FC"
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
}, children: [
|
|
415
|
+
e?.allCheck && /* @__PURE__ */ c.jsx(
|
|
416
|
+
me,
|
|
417
|
+
{
|
|
418
|
+
indeterminate: u,
|
|
419
|
+
checked: a,
|
|
420
|
+
onChange: g,
|
|
421
|
+
children: "전체선택"
|
|
422
|
+
}
|
|
423
|
+
),
|
|
424
|
+
/* @__PURE__ */ c.jsx(
|
|
425
|
+
me.Group,
|
|
426
|
+
{
|
|
427
|
+
options: e?.options,
|
|
428
|
+
value: n,
|
|
429
|
+
onChange: y
|
|
430
|
+
}
|
|
431
|
+
)
|
|
432
|
+
] }) });
|
|
433
|
+
}, { TextArea: qt } = G, jo = ({ itemProps: t, inputProps: e }) => /* @__PURE__ */ c.jsx(w, { ...t, children: /* @__PURE__ */ c.jsx(qt, { ...e }) }), Fo = ({ itemProps: t, inputProps: e }) => {
|
|
434
|
+
const r = (o) => {
|
|
435
|
+
let i = o.toString().split(".");
|
|
436
|
+
return e?.decimalPoint != null && i[1] != null && e?.decimalPoint > 0 ? i[1].length > e?.decimalPoint ? i[1] = "." + i[1].substring(0, e?.decimalPoint) : i[1] = "." + i[1] : i[1] = "", i[0].replace(/\B(?=(\d{3})+(?!\d))/g, ",") + i[1];
|
|
437
|
+
}, n = (o) => {
|
|
438
|
+
let i = o.toString().split(".");
|
|
439
|
+
return e?.decimalPoint != null && i[1] != null && e?.decimalPoint > 0 ? i[1].length > e?.decimalPoint ? i[1] = "." + i[1].substring(0, e?.decimalPoint) : i[1] = "." + i[1] : i[1] = "", i[0].replace(/\$\s?|(,*)/g, "") + i[1];
|
|
440
|
+
};
|
|
441
|
+
return /* @__PURE__ */ c.jsx(w, { ...t, children: /* @__PURE__ */ c.jsx(
|
|
442
|
+
yt,
|
|
443
|
+
{
|
|
444
|
+
...e,
|
|
445
|
+
formatter: (o) => r(o),
|
|
446
|
+
parser: (o) => n(o)
|
|
447
|
+
}
|
|
448
|
+
) });
|
|
449
|
+
}, { Option: _e } = be, ko = ({ itemProps: t, inputProps: e }) => {
|
|
450
|
+
const [r, n] = F([]);
|
|
451
|
+
return Y(() => {
|
|
452
|
+
e?.addField === "ALL" ? n([
|
|
453
|
+
{ label: "전체", value: "" },
|
|
454
|
+
...e?.list || []
|
|
455
|
+
]) : e?.addField === "NULL" ? n([{ label: "", value: "" }, ...e?.list || []]) : n(e?.list || []);
|
|
456
|
+
}, [e?.list]), /* @__PURE__ */ c.jsx(
|
|
457
|
+
w,
|
|
458
|
+
{
|
|
459
|
+
...t,
|
|
460
|
+
getValueProps: (o) => o ? {
|
|
461
|
+
value: o && o.indexOf(",") > 0 ? o.split(",") : [o]
|
|
462
|
+
} : {
|
|
463
|
+
value: []
|
|
464
|
+
},
|
|
465
|
+
normalize: (o) => o != null && o != null && o.length > 0 ? o.toString() : "",
|
|
466
|
+
children: /* @__PURE__ */ c.jsx(be, { ...e, mode: "multiple", children: r.map((o) => {
|
|
467
|
+
const { value: i, label: s } = o;
|
|
468
|
+
return e?.printCode ? /* @__PURE__ */ c.jsx(_e, { value: i, label: s, children: /* @__PURE__ */ c.jsx(te, { children: `[${i}] ${s}` }) }, i) : /* @__PURE__ */ c.jsx(_e, { value: i, label: s, children: /* @__PURE__ */ c.jsx(te, { children: `${s}` }) }, i);
|
|
469
|
+
}) })
|
|
470
|
+
}
|
|
471
|
+
);
|
|
472
|
+
}, Yo = (t) => /* @__PURE__ */ c.jsx(q, { ...t, className: "bwg-btn" }), Ke = Et({
|
|
473
|
+
dragDropManager: void 0
|
|
474
|
+
});
|
|
475
|
+
function L(t) {
|
|
476
|
+
return "Minified Redux error #" + t + "; visit https://redux.js.org/Errors?code=" + t + " for the full message or use the non-minified dev environment for full errors. ";
|
|
477
|
+
}
|
|
478
|
+
var Le = (function() {
|
|
479
|
+
return typeof Symbol == "function" && Symbol.observable || "@@observable";
|
|
480
|
+
})(), je = function() {
|
|
481
|
+
return Math.random().toString(36).substring(7).split("").join(".");
|
|
482
|
+
}, Fe = {
|
|
483
|
+
INIT: "@@redux/INIT" + je(),
|
|
484
|
+
REPLACE: "@@redux/REPLACE" + je()
|
|
485
|
+
};
|
|
486
|
+
function Gt(t) {
|
|
487
|
+
if (typeof t != "object" || t === null) return !1;
|
|
488
|
+
for (var e = t; Object.getPrototypeOf(e) !== null; )
|
|
489
|
+
e = Object.getPrototypeOf(e);
|
|
490
|
+
return Object.getPrototypeOf(t) === e;
|
|
491
|
+
}
|
|
492
|
+
function Xt(t) {
|
|
493
|
+
if (t === void 0) return "undefined";
|
|
494
|
+
if (t === null) return "null";
|
|
495
|
+
var e = typeof t;
|
|
496
|
+
switch (e) {
|
|
497
|
+
case "boolean":
|
|
498
|
+
case "string":
|
|
499
|
+
case "number":
|
|
500
|
+
case "symbol":
|
|
501
|
+
case "function":
|
|
502
|
+
return e;
|
|
503
|
+
}
|
|
504
|
+
if (Array.isArray(t)) return "array";
|
|
505
|
+
if (Jt(t)) return "date";
|
|
506
|
+
if (Zt(t)) return "error";
|
|
507
|
+
var r = Wt(t);
|
|
508
|
+
switch (r) {
|
|
509
|
+
case "Symbol":
|
|
510
|
+
case "Promise":
|
|
511
|
+
case "WeakMap":
|
|
512
|
+
case "WeakSet":
|
|
513
|
+
case "Map":
|
|
514
|
+
case "Set":
|
|
515
|
+
return r;
|
|
516
|
+
}
|
|
517
|
+
return e.slice(8, -1).toLowerCase().replace(/\s/g, "");
|
|
518
|
+
}
|
|
519
|
+
function Wt(t) {
|
|
520
|
+
return typeof t.constructor == "function" ? t.constructor.name : null;
|
|
521
|
+
}
|
|
522
|
+
function Zt(t) {
|
|
523
|
+
return t instanceof Error || typeof t.message == "string" && t.constructor && typeof t.constructor.stackTraceLimit == "number";
|
|
524
|
+
}
|
|
525
|
+
function Jt(t) {
|
|
526
|
+
return t instanceof Date ? !0 : typeof t.toDateString == "function" && typeof t.getDate == "function" && typeof t.setDate == "function";
|
|
527
|
+
}
|
|
528
|
+
function U(t) {
|
|
529
|
+
var e = typeof t;
|
|
530
|
+
return process.env.NODE_ENV !== "production" && (e = Xt(t)), e;
|
|
531
|
+
}
|
|
532
|
+
function et(t, e, r) {
|
|
533
|
+
var n;
|
|
534
|
+
if (typeof e == "function" && typeof r == "function" || typeof r == "function" && typeof arguments[3] == "function")
|
|
535
|
+
throw new Error(process.env.NODE_ENV === "production" ? L(0) : "It looks like you are passing several store enhancers to createStore(). This is not supported. Instead, compose them together to a single function. See https://redux.js.org/tutorials/fundamentals/part-4-store#creating-a-store-with-enhancers for an example.");
|
|
536
|
+
if (typeof e == "function" && typeof r > "u" && (r = e, e = void 0), typeof r < "u") {
|
|
537
|
+
if (typeof r != "function")
|
|
538
|
+
throw new Error(process.env.NODE_ENV === "production" ? L(1) : "Expected the enhancer to be a function. Instead, received: '" + U(r) + "'");
|
|
539
|
+
return r(et)(t, e);
|
|
540
|
+
}
|
|
541
|
+
if (typeof t != "function")
|
|
542
|
+
throw new Error(process.env.NODE_ENV === "production" ? L(2) : "Expected the root reducer to be a function. Instead, received: '" + U(t) + "'");
|
|
543
|
+
var o = t, i = e, s = [], a = s, u = !1;
|
|
544
|
+
function d() {
|
|
545
|
+
a === s && (a = s.slice());
|
|
546
|
+
}
|
|
547
|
+
function g() {
|
|
548
|
+
if (u)
|
|
549
|
+
throw new Error(process.env.NODE_ENV === "production" ? L(3) : "You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store.");
|
|
550
|
+
return i;
|
|
551
|
+
}
|
|
552
|
+
function y(h) {
|
|
553
|
+
if (typeof h != "function")
|
|
554
|
+
throw new Error(process.env.NODE_ENV === "production" ? L(4) : "Expected the listener to be a function. Instead, received: '" + U(h) + "'");
|
|
555
|
+
if (u)
|
|
556
|
+
throw new Error(process.env.NODE_ENV === "production" ? L(5) : "You may not call store.subscribe() while the reducer is executing. If you would like to be notified after the store has been updated, subscribe from a component and invoke store.getState() in the callback to access the latest state. See https://redux.js.org/api/store#subscribelistener for more details.");
|
|
557
|
+
var O = !0;
|
|
558
|
+
return d(), a.push(h), function() {
|
|
559
|
+
if (O) {
|
|
560
|
+
if (u)
|
|
561
|
+
throw new Error(process.env.NODE_ENV === "production" ? L(6) : "You may not unsubscribe from a store listener while the reducer is executing. See https://redux.js.org/api/store#subscribelistener for more details.");
|
|
562
|
+
O = !1, d();
|
|
563
|
+
var l = a.indexOf(h);
|
|
564
|
+
a.splice(l, 1), s = null;
|
|
565
|
+
}
|
|
566
|
+
};
|
|
567
|
+
}
|
|
568
|
+
function v(h) {
|
|
569
|
+
if (!Gt(h))
|
|
570
|
+
throw new Error(process.env.NODE_ENV === "production" ? L(7) : "Actions must be plain objects. Instead, the actual type was: '" + U(h) + "'. You may need to add middleware to your store setup to handle dispatching other values, such as 'redux-thunk' to handle dispatching functions. See https://redux.js.org/tutorials/fundamentals/part-4-store#middleware and https://redux.js.org/tutorials/fundamentals/part-6-async-logic#using-the-redux-thunk-middleware for examples.");
|
|
571
|
+
if (typeof h.type > "u")
|
|
572
|
+
throw new Error(process.env.NODE_ENV === "production" ? L(8) : 'Actions may not have an undefined "type" property. You may have misspelled an action type string constant.');
|
|
573
|
+
if (u)
|
|
574
|
+
throw new Error(process.env.NODE_ENV === "production" ? L(9) : "Reducers may not dispatch actions.");
|
|
575
|
+
try {
|
|
576
|
+
u = !0, i = o(i, h);
|
|
577
|
+
} finally {
|
|
578
|
+
u = !1;
|
|
579
|
+
}
|
|
580
|
+
for (var O = s = a, m = 0; m < O.length; m++) {
|
|
581
|
+
var l = O[m];
|
|
582
|
+
l();
|
|
583
|
+
}
|
|
584
|
+
return h;
|
|
585
|
+
}
|
|
586
|
+
function f(h) {
|
|
587
|
+
if (typeof h != "function")
|
|
588
|
+
throw new Error(process.env.NODE_ENV === "production" ? L(10) : "Expected the nextReducer to be a function. Instead, received: '" + U(h));
|
|
589
|
+
o = h, v({
|
|
590
|
+
type: Fe.REPLACE
|
|
591
|
+
});
|
|
592
|
+
}
|
|
593
|
+
function p() {
|
|
594
|
+
var h, O = y;
|
|
595
|
+
return h = {
|
|
596
|
+
/**
|
|
597
|
+
* The minimal observable subscription method.
|
|
598
|
+
* @param {Object} observer Any object that can be used as an observer.
|
|
599
|
+
* The observer object should have a `next` method.
|
|
600
|
+
* @returns {subscription} An object with an `unsubscribe` method that can
|
|
601
|
+
* be used to unsubscribe the observable from the store, and prevent further
|
|
602
|
+
* emission of values from the observable.
|
|
603
|
+
*/
|
|
604
|
+
subscribe: function(l) {
|
|
605
|
+
if (typeof l != "object" || l === null)
|
|
606
|
+
throw new Error(process.env.NODE_ENV === "production" ? L(11) : "Expected the observer to be an object. Instead, received: '" + U(l) + "'");
|
|
607
|
+
function S() {
|
|
608
|
+
l.next && l.next(g());
|
|
609
|
+
}
|
|
610
|
+
S();
|
|
611
|
+
var b = O(S);
|
|
612
|
+
return {
|
|
613
|
+
unsubscribe: b
|
|
614
|
+
};
|
|
615
|
+
}
|
|
616
|
+
}, h[Le] = function() {
|
|
617
|
+
return this;
|
|
618
|
+
}, h;
|
|
619
|
+
}
|
|
620
|
+
return v({
|
|
621
|
+
type: Fe.INIT
|
|
622
|
+
}), n = {
|
|
623
|
+
dispatch: v,
|
|
624
|
+
subscribe: y,
|
|
625
|
+
getState: g,
|
|
626
|
+
replaceReducer: f
|
|
627
|
+
}, n[Le] = p, n;
|
|
628
|
+
}
|
|
629
|
+
function D(t, e, ...r) {
|
|
630
|
+
if (Qt() && e === void 0)
|
|
631
|
+
throw new Error("invariant requires an error message argument");
|
|
632
|
+
if (!t) {
|
|
633
|
+
let n;
|
|
634
|
+
if (e === void 0)
|
|
635
|
+
n = new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");
|
|
636
|
+
else {
|
|
637
|
+
let o = 0;
|
|
638
|
+
n = new Error(e.replace(/%s/g, function() {
|
|
639
|
+
return r[o++];
|
|
640
|
+
})), n.name = "Invariant Violation";
|
|
641
|
+
}
|
|
642
|
+
throw n.framesToPop = 1, n;
|
|
643
|
+
}
|
|
644
|
+
}
|
|
645
|
+
function Qt() {
|
|
646
|
+
return typeof process < "u" && process.env.NODE_ENV === "production";
|
|
647
|
+
}
|
|
648
|
+
function Kt(t, e, r) {
|
|
649
|
+
return e.split(".").reduce(
|
|
650
|
+
(n, o) => n && n[o] ? n[o] : r || null,
|
|
651
|
+
t
|
|
652
|
+
);
|
|
653
|
+
}
|
|
654
|
+
function er(t, e) {
|
|
655
|
+
return t.filter(
|
|
656
|
+
(r) => r !== e
|
|
657
|
+
);
|
|
658
|
+
}
|
|
659
|
+
function tt(t) {
|
|
660
|
+
return typeof t == "object";
|
|
661
|
+
}
|
|
662
|
+
function tr(t, e) {
|
|
663
|
+
const r = /* @__PURE__ */ new Map(), n = (i) => {
|
|
664
|
+
r.set(i, r.has(i) ? r.get(i) + 1 : 1);
|
|
665
|
+
};
|
|
666
|
+
t.forEach(n), e.forEach(n);
|
|
667
|
+
const o = [];
|
|
668
|
+
return r.forEach((i, s) => {
|
|
669
|
+
i === 1 && o.push(s);
|
|
670
|
+
}), o;
|
|
671
|
+
}
|
|
672
|
+
function rr(t, e) {
|
|
673
|
+
return t.filter(
|
|
674
|
+
(r) => e.indexOf(r) > -1
|
|
675
|
+
);
|
|
676
|
+
}
|
|
677
|
+
const Ce = "dnd-core/INIT_COORDS", ne = "dnd-core/BEGIN_DRAG", Ie = "dnd-core/PUBLISH_DRAG_SOURCE", oe = "dnd-core/HOVER", ie = "dnd-core/DROP", se = "dnd-core/END_DRAG";
|
|
678
|
+
function ke(t, e) {
|
|
679
|
+
return {
|
|
680
|
+
type: Ce,
|
|
681
|
+
payload: {
|
|
682
|
+
sourceClientOffset: e || null,
|
|
683
|
+
clientOffset: t || null
|
|
684
|
+
}
|
|
685
|
+
};
|
|
686
|
+
}
|
|
687
|
+
const nr = {
|
|
688
|
+
type: Ce,
|
|
689
|
+
payload: {
|
|
690
|
+
clientOffset: null,
|
|
691
|
+
sourceClientOffset: null
|
|
692
|
+
}
|
|
693
|
+
};
|
|
694
|
+
function or(t) {
|
|
695
|
+
return function(r = [], n = {
|
|
696
|
+
publishSource: !0
|
|
697
|
+
}) {
|
|
698
|
+
const { publishSource: o = !0, clientOffset: i, getSourceClientOffset: s } = n, a = t.getMonitor(), u = t.getRegistry();
|
|
699
|
+
t.dispatch(ke(i)), ir(r, a, u);
|
|
700
|
+
const d = cr(r, a);
|
|
701
|
+
if (d == null) {
|
|
702
|
+
t.dispatch(nr);
|
|
703
|
+
return;
|
|
704
|
+
}
|
|
705
|
+
let g = null;
|
|
706
|
+
if (i) {
|
|
707
|
+
if (!s)
|
|
708
|
+
throw new Error("getSourceClientOffset must be defined");
|
|
709
|
+
sr(s), g = s(d);
|
|
710
|
+
}
|
|
711
|
+
t.dispatch(ke(i, g));
|
|
712
|
+
const v = u.getSource(d).beginDrag(a, d);
|
|
713
|
+
if (v == null)
|
|
714
|
+
return;
|
|
715
|
+
ar(v), u.pinSource(d);
|
|
716
|
+
const f = u.getSourceType(d);
|
|
717
|
+
return {
|
|
718
|
+
type: ne,
|
|
719
|
+
payload: {
|
|
720
|
+
itemType: f,
|
|
721
|
+
item: v,
|
|
722
|
+
sourceId: d,
|
|
723
|
+
clientOffset: i || null,
|
|
724
|
+
sourceClientOffset: g || null,
|
|
725
|
+
isSourcePublic: !!o
|
|
726
|
+
}
|
|
727
|
+
};
|
|
728
|
+
};
|
|
729
|
+
}
|
|
730
|
+
function ir(t, e, r) {
|
|
731
|
+
D(!e.isDragging(), "Cannot call beginDrag while dragging."), t.forEach(function(n) {
|
|
732
|
+
D(r.getSource(n), "Expected sourceIds to be registered.");
|
|
733
|
+
});
|
|
734
|
+
}
|
|
735
|
+
function sr(t) {
|
|
736
|
+
D(typeof t == "function", "When clientOffset is provided, getSourceClientOffset must be a function.");
|
|
737
|
+
}
|
|
738
|
+
function ar(t) {
|
|
739
|
+
D(tt(t), "Item must be an object.");
|
|
740
|
+
}
|
|
741
|
+
function cr(t, e) {
|
|
742
|
+
let r = null;
|
|
743
|
+
for (let n = t.length - 1; n >= 0; n--)
|
|
744
|
+
if (e.canDragSource(t[n])) {
|
|
745
|
+
r = t[n];
|
|
746
|
+
break;
|
|
747
|
+
}
|
|
748
|
+
return r;
|
|
749
|
+
}
|
|
750
|
+
function ur(t, e, r) {
|
|
751
|
+
return e in t ? Object.defineProperty(t, e, {
|
|
752
|
+
value: r,
|
|
753
|
+
enumerable: !0,
|
|
754
|
+
configurable: !0,
|
|
755
|
+
writable: !0
|
|
756
|
+
}) : t[e] = r, t;
|
|
757
|
+
}
|
|
758
|
+
function lr(t) {
|
|
759
|
+
for (var e = 1; e < arguments.length; e++) {
|
|
760
|
+
var r = arguments[e] != null ? arguments[e] : {}, n = Object.keys(r);
|
|
761
|
+
typeof Object.getOwnPropertySymbols == "function" && (n = n.concat(Object.getOwnPropertySymbols(r).filter(function(o) {
|
|
762
|
+
return Object.getOwnPropertyDescriptor(r, o).enumerable;
|
|
763
|
+
}))), n.forEach(function(o) {
|
|
764
|
+
ur(t, o, r[o]);
|
|
765
|
+
});
|
|
766
|
+
}
|
|
767
|
+
return t;
|
|
768
|
+
}
|
|
769
|
+
function dr(t) {
|
|
770
|
+
return function(r = {}) {
|
|
771
|
+
const n = t.getMonitor(), o = t.getRegistry();
|
|
772
|
+
gr(n), pr(n).forEach((s, a) => {
|
|
773
|
+
const u = fr(s, a, o, n), d = {
|
|
774
|
+
type: ie,
|
|
775
|
+
payload: {
|
|
776
|
+
dropResult: lr({}, r, u)
|
|
777
|
+
}
|
|
778
|
+
};
|
|
779
|
+
t.dispatch(d);
|
|
780
|
+
});
|
|
781
|
+
};
|
|
782
|
+
}
|
|
783
|
+
function gr(t) {
|
|
784
|
+
D(t.isDragging(), "Cannot call drop while not dragging."), D(!t.didDrop(), "Cannot call drop twice during one drag operation.");
|
|
785
|
+
}
|
|
786
|
+
function fr(t, e, r, n) {
|
|
787
|
+
const o = r.getTarget(t);
|
|
788
|
+
let i = o ? o.drop(n, t) : void 0;
|
|
789
|
+
return hr(i), typeof i > "u" && (i = e === 0 ? {} : n.getDropResult()), i;
|
|
790
|
+
}
|
|
791
|
+
function hr(t) {
|
|
792
|
+
D(typeof t > "u" || tt(t), "Drop result must either be an object or undefined.");
|
|
793
|
+
}
|
|
794
|
+
function pr(t) {
|
|
795
|
+
const e = t.getTargetIds().filter(t.canDropOnTarget, t);
|
|
796
|
+
return e.reverse(), e;
|
|
797
|
+
}
|
|
798
|
+
function mr(t) {
|
|
799
|
+
return function() {
|
|
800
|
+
const r = t.getMonitor(), n = t.getRegistry();
|
|
801
|
+
vr(r);
|
|
802
|
+
const o = r.getSourceId();
|
|
803
|
+
return o != null && (n.getSource(o, !0).endDrag(r, o), n.unpinSource()), {
|
|
804
|
+
type: se
|
|
805
|
+
};
|
|
806
|
+
};
|
|
807
|
+
}
|
|
808
|
+
function vr(t) {
|
|
809
|
+
D(t.isDragging(), "Cannot call endDrag while not dragging.");
|
|
810
|
+
}
|
|
811
|
+
function ve(t, e) {
|
|
812
|
+
return e === null ? t === null : Array.isArray(t) ? t.some(
|
|
813
|
+
(r) => r === e
|
|
814
|
+
) : t === e;
|
|
815
|
+
}
|
|
816
|
+
function Dr(t) {
|
|
817
|
+
return function(r, { clientOffset: n } = {}) {
|
|
818
|
+
yr(r);
|
|
819
|
+
const o = r.slice(0), i = t.getMonitor(), s = t.getRegistry(), a = i.getItemType();
|
|
820
|
+
return Or(o, s, a), Sr(o, i, s), br(o, i, s), {
|
|
821
|
+
type: oe,
|
|
822
|
+
payload: {
|
|
823
|
+
targetIds: o,
|
|
824
|
+
clientOffset: n || null
|
|
825
|
+
}
|
|
826
|
+
};
|
|
827
|
+
};
|
|
828
|
+
}
|
|
829
|
+
function yr(t) {
|
|
830
|
+
D(Array.isArray(t), "Expected targetIds to be an array.");
|
|
831
|
+
}
|
|
832
|
+
function Sr(t, e, r) {
|
|
833
|
+
D(e.isDragging(), "Cannot call hover while not dragging."), D(!e.didDrop(), "Cannot call hover after drop.");
|
|
834
|
+
for (let n = 0; n < t.length; n++) {
|
|
835
|
+
const o = t[n];
|
|
836
|
+
D(t.lastIndexOf(o) === n, "Expected targetIds to be unique in the passed array.");
|
|
837
|
+
const i = r.getTarget(o);
|
|
838
|
+
D(i, "Expected targetIds to be registered.");
|
|
839
|
+
}
|
|
840
|
+
}
|
|
841
|
+
function Or(t, e, r) {
|
|
842
|
+
for (let n = t.length - 1; n >= 0; n--) {
|
|
843
|
+
const o = t[n], i = e.getTargetType(o);
|
|
844
|
+
ve(i, r) || t.splice(n, 1);
|
|
845
|
+
}
|
|
846
|
+
}
|
|
847
|
+
function br(t, e, r) {
|
|
848
|
+
t.forEach(function(n) {
|
|
849
|
+
r.getTarget(n).hover(e, n);
|
|
850
|
+
});
|
|
851
|
+
}
|
|
852
|
+
function Tr(t) {
|
|
853
|
+
return function() {
|
|
854
|
+
if (t.getMonitor().isDragging())
|
|
855
|
+
return {
|
|
856
|
+
type: Ie
|
|
857
|
+
};
|
|
858
|
+
};
|
|
859
|
+
}
|
|
860
|
+
function Cr(t) {
|
|
861
|
+
return {
|
|
862
|
+
beginDrag: or(t),
|
|
863
|
+
publishDragSource: Tr(t),
|
|
864
|
+
hover: Dr(t),
|
|
865
|
+
drop: dr(t),
|
|
866
|
+
endDrag: mr(t)
|
|
867
|
+
};
|
|
868
|
+
}
|
|
869
|
+
class Ir {
|
|
870
|
+
receiveBackend(e) {
|
|
871
|
+
this.backend = e;
|
|
872
|
+
}
|
|
873
|
+
getMonitor() {
|
|
874
|
+
return this.monitor;
|
|
875
|
+
}
|
|
876
|
+
getBackend() {
|
|
877
|
+
return this.backend;
|
|
878
|
+
}
|
|
879
|
+
getRegistry() {
|
|
880
|
+
return this.monitor.registry;
|
|
881
|
+
}
|
|
882
|
+
getActions() {
|
|
883
|
+
const e = this, { dispatch: r } = this.store;
|
|
884
|
+
function n(i) {
|
|
885
|
+
return (...s) => {
|
|
886
|
+
const a = i.apply(e, s);
|
|
887
|
+
typeof a < "u" && r(a);
|
|
888
|
+
};
|
|
889
|
+
}
|
|
890
|
+
const o = Cr(this);
|
|
891
|
+
return Object.keys(o).reduce((i, s) => {
|
|
892
|
+
const a = o[s];
|
|
893
|
+
return i[s] = n(a), i;
|
|
894
|
+
}, {});
|
|
895
|
+
}
|
|
896
|
+
dispatch(e) {
|
|
897
|
+
this.store.dispatch(e);
|
|
898
|
+
}
|
|
899
|
+
constructor(e, r) {
|
|
900
|
+
this.isSetUp = !1, this.handleRefCountChange = () => {
|
|
901
|
+
const n = this.store.getState().refCount > 0;
|
|
902
|
+
this.backend && (n && !this.isSetUp ? (this.backend.setup(), this.isSetUp = !0) : !n && this.isSetUp && (this.backend.teardown(), this.isSetUp = !1));
|
|
903
|
+
}, this.store = e, this.monitor = r, e.subscribe(this.handleRefCountChange);
|
|
904
|
+
}
|
|
905
|
+
}
|
|
906
|
+
function Er(t, e) {
|
|
907
|
+
return {
|
|
908
|
+
x: t.x + e.x,
|
|
909
|
+
y: t.y + e.y
|
|
910
|
+
};
|
|
911
|
+
}
|
|
912
|
+
function rt(t, e) {
|
|
913
|
+
return {
|
|
914
|
+
x: t.x - e.x,
|
|
915
|
+
y: t.y - e.y
|
|
916
|
+
};
|
|
917
|
+
}
|
|
918
|
+
function wr(t) {
|
|
919
|
+
const { clientOffset: e, initialClientOffset: r, initialSourceClientOffset: n } = t;
|
|
920
|
+
return !e || !r || !n ? null : rt(Er(e, n), r);
|
|
921
|
+
}
|
|
922
|
+
function xr(t) {
|
|
923
|
+
const { clientOffset: e, initialClientOffset: r } = t;
|
|
924
|
+
return !e || !r ? null : rt(e, r);
|
|
925
|
+
}
|
|
926
|
+
const Z = [], Ee = [];
|
|
927
|
+
Z.__IS_NONE__ = !0;
|
|
928
|
+
Ee.__IS_ALL__ = !0;
|
|
929
|
+
function Nr(t, e) {
|
|
930
|
+
return t === Z ? !1 : t === Ee || typeof e > "u" ? !0 : rr(e, t).length > 0;
|
|
931
|
+
}
|
|
932
|
+
class Pr {
|
|
933
|
+
subscribeToStateChange(e, r = {}) {
|
|
934
|
+
const { handlerIds: n } = r;
|
|
935
|
+
D(typeof e == "function", "listener must be a function."), D(typeof n > "u" || Array.isArray(n), "handlerIds, when specified, must be an array of strings.");
|
|
936
|
+
let o = this.store.getState().stateId;
|
|
937
|
+
const i = () => {
|
|
938
|
+
const s = this.store.getState(), a = s.stateId;
|
|
939
|
+
try {
|
|
940
|
+
a === o || a === o + 1 && !Nr(s.dirtyHandlerIds, n) || e();
|
|
941
|
+
} finally {
|
|
942
|
+
o = a;
|
|
943
|
+
}
|
|
944
|
+
};
|
|
945
|
+
return this.store.subscribe(i);
|
|
946
|
+
}
|
|
947
|
+
subscribeToOffsetChange(e) {
|
|
948
|
+
D(typeof e == "function", "listener must be a function.");
|
|
949
|
+
let r = this.store.getState().dragOffset;
|
|
950
|
+
const n = () => {
|
|
951
|
+
const o = this.store.getState().dragOffset;
|
|
952
|
+
o !== r && (r = o, e());
|
|
953
|
+
};
|
|
954
|
+
return this.store.subscribe(n);
|
|
955
|
+
}
|
|
956
|
+
canDragSource(e) {
|
|
957
|
+
if (!e)
|
|
958
|
+
return !1;
|
|
959
|
+
const r = this.registry.getSource(e);
|
|
960
|
+
return D(r, `Expected to find a valid source. sourceId=${e}`), this.isDragging() ? !1 : r.canDrag(this, e);
|
|
961
|
+
}
|
|
962
|
+
canDropOnTarget(e) {
|
|
963
|
+
if (!e)
|
|
964
|
+
return !1;
|
|
965
|
+
const r = this.registry.getTarget(e);
|
|
966
|
+
if (D(r, `Expected to find a valid target. targetId=${e}`), !this.isDragging() || this.didDrop())
|
|
967
|
+
return !1;
|
|
968
|
+
const n = this.registry.getTargetType(e), o = this.getItemType();
|
|
969
|
+
return ve(n, o) && r.canDrop(this, e);
|
|
970
|
+
}
|
|
971
|
+
isDragging() {
|
|
972
|
+
return !!this.getItemType();
|
|
973
|
+
}
|
|
974
|
+
isDraggingSource(e) {
|
|
975
|
+
if (!e)
|
|
976
|
+
return !1;
|
|
977
|
+
const r = this.registry.getSource(e, !0);
|
|
978
|
+
if (D(r, `Expected to find a valid source. sourceId=${e}`), !this.isDragging() || !this.isSourcePublic())
|
|
979
|
+
return !1;
|
|
980
|
+
const n = this.registry.getSourceType(e), o = this.getItemType();
|
|
981
|
+
return n !== o ? !1 : r.isDragging(this, e);
|
|
982
|
+
}
|
|
983
|
+
isOverTarget(e, r = {
|
|
984
|
+
shallow: !1
|
|
985
|
+
}) {
|
|
986
|
+
if (!e)
|
|
987
|
+
return !1;
|
|
988
|
+
const { shallow: n } = r;
|
|
989
|
+
if (!this.isDragging())
|
|
990
|
+
return !1;
|
|
991
|
+
const o = this.registry.getTargetType(e), i = this.getItemType();
|
|
992
|
+
if (i && !ve(o, i))
|
|
993
|
+
return !1;
|
|
994
|
+
const s = this.getTargetIds();
|
|
995
|
+
if (!s.length)
|
|
996
|
+
return !1;
|
|
997
|
+
const a = s.indexOf(e);
|
|
998
|
+
return n ? a === s.length - 1 : a > -1;
|
|
999
|
+
}
|
|
1000
|
+
getItemType() {
|
|
1001
|
+
return this.store.getState().dragOperation.itemType;
|
|
1002
|
+
}
|
|
1003
|
+
getItem() {
|
|
1004
|
+
return this.store.getState().dragOperation.item;
|
|
1005
|
+
}
|
|
1006
|
+
getSourceId() {
|
|
1007
|
+
return this.store.getState().dragOperation.sourceId;
|
|
1008
|
+
}
|
|
1009
|
+
getTargetIds() {
|
|
1010
|
+
return this.store.getState().dragOperation.targetIds;
|
|
1011
|
+
}
|
|
1012
|
+
getDropResult() {
|
|
1013
|
+
return this.store.getState().dragOperation.dropResult;
|
|
1014
|
+
}
|
|
1015
|
+
didDrop() {
|
|
1016
|
+
return this.store.getState().dragOperation.didDrop;
|
|
1017
|
+
}
|
|
1018
|
+
isSourcePublic() {
|
|
1019
|
+
return !!this.store.getState().dragOperation.isSourcePublic;
|
|
1020
|
+
}
|
|
1021
|
+
getInitialClientOffset() {
|
|
1022
|
+
return this.store.getState().dragOffset.initialClientOffset;
|
|
1023
|
+
}
|
|
1024
|
+
getInitialSourceClientOffset() {
|
|
1025
|
+
return this.store.getState().dragOffset.initialSourceClientOffset;
|
|
1026
|
+
}
|
|
1027
|
+
getClientOffset() {
|
|
1028
|
+
return this.store.getState().dragOffset.clientOffset;
|
|
1029
|
+
}
|
|
1030
|
+
getSourceClientOffset() {
|
|
1031
|
+
return wr(this.store.getState().dragOffset);
|
|
1032
|
+
}
|
|
1033
|
+
getDifferenceFromInitialOffset() {
|
|
1034
|
+
return xr(this.store.getState().dragOffset);
|
|
1035
|
+
}
|
|
1036
|
+
constructor(e, r) {
|
|
1037
|
+
this.store = e, this.registry = r;
|
|
1038
|
+
}
|
|
1039
|
+
}
|
|
1040
|
+
const Ye = typeof global < "u" ? global : self, nt = Ye.MutationObserver || Ye.WebKitMutationObserver;
|
|
1041
|
+
function ot(t) {
|
|
1042
|
+
return function() {
|
|
1043
|
+
const r = setTimeout(o, 0), n = setInterval(o, 50);
|
|
1044
|
+
function o() {
|
|
1045
|
+
clearTimeout(r), clearInterval(n), t();
|
|
1046
|
+
}
|
|
1047
|
+
};
|
|
1048
|
+
}
|
|
1049
|
+
function Mr(t) {
|
|
1050
|
+
let e = 1;
|
|
1051
|
+
const r = new nt(t), n = document.createTextNode("");
|
|
1052
|
+
return r.observe(n, {
|
|
1053
|
+
characterData: !0
|
|
1054
|
+
}), function() {
|
|
1055
|
+
e = -e, n.data = e;
|
|
1056
|
+
};
|
|
1057
|
+
}
|
|
1058
|
+
const Rr = typeof nt == "function" ? (
|
|
1059
|
+
// reliably everywhere they are implemented.
|
|
1060
|
+
// They are implemented in all modern browsers.
|
|
1061
|
+
//
|
|
1062
|
+
// - Android 4-4.3
|
|
1063
|
+
// - Chrome 26-34
|
|
1064
|
+
// - Firefox 14-29
|
|
1065
|
+
// - Internet Explorer 11
|
|
1066
|
+
// - iPad Safari 6-7.1
|
|
1067
|
+
// - iPhone Safari 7-7.1
|
|
1068
|
+
// - Safari 6-7
|
|
1069
|
+
Mr
|
|
1070
|
+
) : (
|
|
1071
|
+
// task queue, are implemented in Internet Explorer 10, Safari 5.0-1, and Opera
|
|
1072
|
+
// 11-12, and in web workers in many engines.
|
|
1073
|
+
// Although message channels yield to any queued rendering and IO tasks, they
|
|
1074
|
+
// would be better than imposing the 4ms delay of timers.
|
|
1075
|
+
// However, they do not work reliably in Internet Explorer or Safari.
|
|
1076
|
+
// Internet Explorer 10 is the only browser that has setImmediate but does
|
|
1077
|
+
// not have MutationObservers.
|
|
1078
|
+
// Although setImmediate yields to the browser's renderer, it would be
|
|
1079
|
+
// preferrable to falling back to setTimeout since it does not have
|
|
1080
|
+
// the minimum 4ms penalty.
|
|
1081
|
+
// Unfortunately there appears to be a bug in Internet Explorer 10 Mobile (and
|
|
1082
|
+
// Desktop to a lesser extent) that renders both setImmediate and
|
|
1083
|
+
// MessageChannel useless for the purposes of ASAP.
|
|
1084
|
+
// https://github.com/kriskowal/q/issues/396
|
|
1085
|
+
// Timers are implemented universally.
|
|
1086
|
+
// We fall back to timers in workers in most engines, and in foreground
|
|
1087
|
+
// contexts in the following browsers.
|
|
1088
|
+
// However, note that even this simple case requires nuances to operate in a
|
|
1089
|
+
// broad spectrum of browsers.
|
|
1090
|
+
//
|
|
1091
|
+
// - Firefox 3-13
|
|
1092
|
+
// - Internet Explorer 6-9
|
|
1093
|
+
// - iPad Safari 4.3
|
|
1094
|
+
// - Lynx 2.8.7
|
|
1095
|
+
ot
|
|
1096
|
+
);
|
|
1097
|
+
class _r {
|
|
1098
|
+
// Use the fastest means possible to execute a task in its own turn, with
|
|
1099
|
+
// priority over other events including IO, animation, reflow, and redraw
|
|
1100
|
+
// events in browsers.
|
|
1101
|
+
//
|
|
1102
|
+
// An exception thrown by a task will permanently interrupt the processing of
|
|
1103
|
+
// subsequent tasks. The higher level `asap` function ensures that if an
|
|
1104
|
+
// exception is thrown by a task, that the task queue will continue flushing as
|
|
1105
|
+
// soon as possible, but if you use `rawAsap` directly, you are responsible to
|
|
1106
|
+
// either ensure that no exceptions are thrown from your task, or to manually
|
|
1107
|
+
// call `rawAsap.requestFlush` if an exception is thrown.
|
|
1108
|
+
enqueueTask(e) {
|
|
1109
|
+
const { queue: r, requestFlush: n } = this;
|
|
1110
|
+
r.length || (n(), this.flushing = !0), r[r.length] = e;
|
|
1111
|
+
}
|
|
1112
|
+
constructor() {
|
|
1113
|
+
this.queue = [], this.pendingErrors = [], this.flushing = !1, this.index = 0, this.capacity = 1024, this.flush = () => {
|
|
1114
|
+
const { queue: e } = this;
|
|
1115
|
+
for (; this.index < e.length; ) {
|
|
1116
|
+
const r = this.index;
|
|
1117
|
+
if (this.index++, e[r].call(), this.index > this.capacity) {
|
|
1118
|
+
for (let n = 0, o = e.length - this.index; n < o; n++)
|
|
1119
|
+
e[n] = e[n + this.index];
|
|
1120
|
+
e.length -= this.index, this.index = 0;
|
|
1121
|
+
}
|
|
1122
|
+
}
|
|
1123
|
+
e.length = 0, this.index = 0, this.flushing = !1;
|
|
1124
|
+
}, this.registerPendingError = (e) => {
|
|
1125
|
+
this.pendingErrors.push(e), this.requestErrorThrow();
|
|
1126
|
+
}, this.requestFlush = Rr(this.flush), this.requestErrorThrow = ot(() => {
|
|
1127
|
+
if (this.pendingErrors.length)
|
|
1128
|
+
throw this.pendingErrors.shift();
|
|
1129
|
+
});
|
|
1130
|
+
}
|
|
1131
|
+
}
|
|
1132
|
+
class Lr {
|
|
1133
|
+
call() {
|
|
1134
|
+
try {
|
|
1135
|
+
this.task && this.task();
|
|
1136
|
+
} catch (e) {
|
|
1137
|
+
this.onError(e);
|
|
1138
|
+
} finally {
|
|
1139
|
+
this.task = null, this.release(this);
|
|
1140
|
+
}
|
|
1141
|
+
}
|
|
1142
|
+
constructor(e, r) {
|
|
1143
|
+
this.onError = e, this.release = r, this.task = null;
|
|
1144
|
+
}
|
|
1145
|
+
}
|
|
1146
|
+
class jr {
|
|
1147
|
+
create(e) {
|
|
1148
|
+
const r = this.freeTasks, n = r.length ? r.pop() : new Lr(
|
|
1149
|
+
this.onError,
|
|
1150
|
+
(o) => r[r.length] = o
|
|
1151
|
+
);
|
|
1152
|
+
return n.task = e, n;
|
|
1153
|
+
}
|
|
1154
|
+
constructor(e) {
|
|
1155
|
+
this.onError = e, this.freeTasks = [];
|
|
1156
|
+
}
|
|
1157
|
+
}
|
|
1158
|
+
const it = new _r(), Fr = new jr(it.registerPendingError);
|
|
1159
|
+
function kr(t) {
|
|
1160
|
+
it.enqueueTask(Fr.create(t));
|
|
1161
|
+
}
|
|
1162
|
+
const we = "dnd-core/ADD_SOURCE", xe = "dnd-core/ADD_TARGET", Ne = "dnd-core/REMOVE_SOURCE", ae = "dnd-core/REMOVE_TARGET";
|
|
1163
|
+
function Yr(t) {
|
|
1164
|
+
return {
|
|
1165
|
+
type: we,
|
|
1166
|
+
payload: {
|
|
1167
|
+
sourceId: t
|
|
1168
|
+
}
|
|
1169
|
+
};
|
|
1170
|
+
}
|
|
1171
|
+
function Ar(t) {
|
|
1172
|
+
return {
|
|
1173
|
+
type: xe,
|
|
1174
|
+
payload: {
|
|
1175
|
+
targetId: t
|
|
1176
|
+
}
|
|
1177
|
+
};
|
|
1178
|
+
}
|
|
1179
|
+
function Hr(t) {
|
|
1180
|
+
return {
|
|
1181
|
+
type: Ne,
|
|
1182
|
+
payload: {
|
|
1183
|
+
sourceId: t
|
|
1184
|
+
}
|
|
1185
|
+
};
|
|
1186
|
+
}
|
|
1187
|
+
function Br(t) {
|
|
1188
|
+
return {
|
|
1189
|
+
type: ae,
|
|
1190
|
+
payload: {
|
|
1191
|
+
targetId: t
|
|
1192
|
+
}
|
|
1193
|
+
};
|
|
1194
|
+
}
|
|
1195
|
+
function Ur(t) {
|
|
1196
|
+
D(typeof t.canDrag == "function", "Expected canDrag to be a function."), D(typeof t.beginDrag == "function", "Expected beginDrag to be a function."), D(typeof t.endDrag == "function", "Expected endDrag to be a function.");
|
|
1197
|
+
}
|
|
1198
|
+
function Vr(t) {
|
|
1199
|
+
D(typeof t.canDrop == "function", "Expected canDrop to be a function."), D(typeof t.hover == "function", "Expected hover to be a function."), D(typeof t.drop == "function", "Expected beginDrag to be a function.");
|
|
1200
|
+
}
|
|
1201
|
+
function De(t, e) {
|
|
1202
|
+
if (e && Array.isArray(t)) {
|
|
1203
|
+
t.forEach(
|
|
1204
|
+
(r) => De(r, !1)
|
|
1205
|
+
);
|
|
1206
|
+
return;
|
|
1207
|
+
}
|
|
1208
|
+
D(typeof t == "string" || typeof t == "symbol", e ? "Type can only be a string, a symbol, or an array of either." : "Type can only be a string or a symbol.");
|
|
1209
|
+
}
|
|
1210
|
+
var j;
|
|
1211
|
+
(function(t) {
|
|
1212
|
+
t.SOURCE = "SOURCE", t.TARGET = "TARGET";
|
|
1213
|
+
})(j || (j = {}));
|
|
1214
|
+
let $r = 0;
|
|
1215
|
+
function zr() {
|
|
1216
|
+
return $r++;
|
|
1217
|
+
}
|
|
1218
|
+
function qr(t) {
|
|
1219
|
+
const e = zr().toString();
|
|
1220
|
+
switch (t) {
|
|
1221
|
+
case j.SOURCE:
|
|
1222
|
+
return `S${e}`;
|
|
1223
|
+
case j.TARGET:
|
|
1224
|
+
return `T${e}`;
|
|
1225
|
+
default:
|
|
1226
|
+
throw new Error(`Unknown Handler Role: ${t}`);
|
|
1227
|
+
}
|
|
1228
|
+
}
|
|
1229
|
+
function Ae(t) {
|
|
1230
|
+
switch (t[0]) {
|
|
1231
|
+
case "S":
|
|
1232
|
+
return j.SOURCE;
|
|
1233
|
+
case "T":
|
|
1234
|
+
return j.TARGET;
|
|
1235
|
+
default:
|
|
1236
|
+
throw new Error(`Cannot parse handler ID: ${t}`);
|
|
1237
|
+
}
|
|
1238
|
+
}
|
|
1239
|
+
function He(t, e) {
|
|
1240
|
+
const r = t.entries();
|
|
1241
|
+
let n = !1;
|
|
1242
|
+
do {
|
|
1243
|
+
const { done: o, value: [, i] } = r.next();
|
|
1244
|
+
if (i === e)
|
|
1245
|
+
return !0;
|
|
1246
|
+
n = !!o;
|
|
1247
|
+
} while (!n);
|
|
1248
|
+
return !1;
|
|
1249
|
+
}
|
|
1250
|
+
class Gr {
|
|
1251
|
+
addSource(e, r) {
|
|
1252
|
+
De(e), Ur(r);
|
|
1253
|
+
const n = this.addHandler(j.SOURCE, e, r);
|
|
1254
|
+
return this.store.dispatch(Yr(n)), n;
|
|
1255
|
+
}
|
|
1256
|
+
addTarget(e, r) {
|
|
1257
|
+
De(e, !0), Vr(r);
|
|
1258
|
+
const n = this.addHandler(j.TARGET, e, r);
|
|
1259
|
+
return this.store.dispatch(Ar(n)), n;
|
|
1260
|
+
}
|
|
1261
|
+
containsHandler(e) {
|
|
1262
|
+
return He(this.dragSources, e) || He(this.dropTargets, e);
|
|
1263
|
+
}
|
|
1264
|
+
getSource(e, r = !1) {
|
|
1265
|
+
return D(this.isSourceId(e), "Expected a valid source ID."), r && e === this.pinnedSourceId ? this.pinnedSource : this.dragSources.get(e);
|
|
1266
|
+
}
|
|
1267
|
+
getTarget(e) {
|
|
1268
|
+
return D(this.isTargetId(e), "Expected a valid target ID."), this.dropTargets.get(e);
|
|
1269
|
+
}
|
|
1270
|
+
getSourceType(e) {
|
|
1271
|
+
return D(this.isSourceId(e), "Expected a valid source ID."), this.types.get(e);
|
|
1272
|
+
}
|
|
1273
|
+
getTargetType(e) {
|
|
1274
|
+
return D(this.isTargetId(e), "Expected a valid target ID."), this.types.get(e);
|
|
1275
|
+
}
|
|
1276
|
+
isSourceId(e) {
|
|
1277
|
+
return Ae(e) === j.SOURCE;
|
|
1278
|
+
}
|
|
1279
|
+
isTargetId(e) {
|
|
1280
|
+
return Ae(e) === j.TARGET;
|
|
1281
|
+
}
|
|
1282
|
+
removeSource(e) {
|
|
1283
|
+
D(this.getSource(e), "Expected an existing source."), this.store.dispatch(Hr(e)), kr(() => {
|
|
1284
|
+
this.dragSources.delete(e), this.types.delete(e);
|
|
1285
|
+
});
|
|
1286
|
+
}
|
|
1287
|
+
removeTarget(e) {
|
|
1288
|
+
D(this.getTarget(e), "Expected an existing target."), this.store.dispatch(Br(e)), this.dropTargets.delete(e), this.types.delete(e);
|
|
1289
|
+
}
|
|
1290
|
+
pinSource(e) {
|
|
1291
|
+
const r = this.getSource(e);
|
|
1292
|
+
D(r, "Expected an existing source."), this.pinnedSourceId = e, this.pinnedSource = r;
|
|
1293
|
+
}
|
|
1294
|
+
unpinSource() {
|
|
1295
|
+
D(this.pinnedSource, "No source is pinned at the time."), this.pinnedSourceId = null, this.pinnedSource = null;
|
|
1296
|
+
}
|
|
1297
|
+
addHandler(e, r, n) {
|
|
1298
|
+
const o = qr(e);
|
|
1299
|
+
return this.types.set(o, r), e === j.SOURCE ? this.dragSources.set(o, n) : e === j.TARGET && this.dropTargets.set(o, n), o;
|
|
1300
|
+
}
|
|
1301
|
+
constructor(e) {
|
|
1302
|
+
this.types = /* @__PURE__ */ new Map(), this.dragSources = /* @__PURE__ */ new Map(), this.dropTargets = /* @__PURE__ */ new Map(), this.pinnedSourceId = null, this.pinnedSource = null, this.store = e;
|
|
1303
|
+
}
|
|
1304
|
+
}
|
|
1305
|
+
const Xr = (t, e) => t === e;
|
|
1306
|
+
function Wr(t, e) {
|
|
1307
|
+
return !t && !e ? !0 : !t || !e ? !1 : t.x === e.x && t.y === e.y;
|
|
1308
|
+
}
|
|
1309
|
+
function Zr(t, e, r = Xr) {
|
|
1310
|
+
if (t.length !== e.length)
|
|
1311
|
+
return !1;
|
|
1312
|
+
for (let n = 0; n < t.length; ++n)
|
|
1313
|
+
if (!r(t[n], e[n]))
|
|
1314
|
+
return !1;
|
|
1315
|
+
return !0;
|
|
1316
|
+
}
|
|
1317
|
+
function Jr(t = Z, e) {
|
|
1318
|
+
switch (e.type) {
|
|
1319
|
+
case oe:
|
|
1320
|
+
break;
|
|
1321
|
+
case we:
|
|
1322
|
+
case xe:
|
|
1323
|
+
case ae:
|
|
1324
|
+
case Ne:
|
|
1325
|
+
return Z;
|
|
1326
|
+
case ne:
|
|
1327
|
+
case Ie:
|
|
1328
|
+
case se:
|
|
1329
|
+
case ie:
|
|
1330
|
+
default:
|
|
1331
|
+
return Ee;
|
|
1332
|
+
}
|
|
1333
|
+
const { targetIds: r = [], prevTargetIds: n = [] } = e.payload, o = tr(r, n);
|
|
1334
|
+
if (!(o.length > 0 || !Zr(r, n)))
|
|
1335
|
+
return Z;
|
|
1336
|
+
const s = n[n.length - 1], a = r[r.length - 1];
|
|
1337
|
+
return s !== a && (s && o.push(s), a && o.push(a)), o;
|
|
1338
|
+
}
|
|
1339
|
+
function Qr(t, e, r) {
|
|
1340
|
+
return e in t ? Object.defineProperty(t, e, {
|
|
1341
|
+
value: r,
|
|
1342
|
+
enumerable: !0,
|
|
1343
|
+
configurable: !0,
|
|
1344
|
+
writable: !0
|
|
1345
|
+
}) : t[e] = r, t;
|
|
1346
|
+
}
|
|
1347
|
+
function Kr(t) {
|
|
1348
|
+
for (var e = 1; e < arguments.length; e++) {
|
|
1349
|
+
var r = arguments[e] != null ? arguments[e] : {}, n = Object.keys(r);
|
|
1350
|
+
typeof Object.getOwnPropertySymbols == "function" && (n = n.concat(Object.getOwnPropertySymbols(r).filter(function(o) {
|
|
1351
|
+
return Object.getOwnPropertyDescriptor(r, o).enumerable;
|
|
1352
|
+
}))), n.forEach(function(o) {
|
|
1353
|
+
Qr(t, o, r[o]);
|
|
1354
|
+
});
|
|
1355
|
+
}
|
|
1356
|
+
return t;
|
|
1357
|
+
}
|
|
1358
|
+
const Be = {
|
|
1359
|
+
initialSourceClientOffset: null,
|
|
1360
|
+
initialClientOffset: null,
|
|
1361
|
+
clientOffset: null
|
|
1362
|
+
};
|
|
1363
|
+
function en(t = Be, e) {
|
|
1364
|
+
const { payload: r } = e;
|
|
1365
|
+
switch (e.type) {
|
|
1366
|
+
case Ce:
|
|
1367
|
+
case ne:
|
|
1368
|
+
return {
|
|
1369
|
+
initialSourceClientOffset: r.sourceClientOffset,
|
|
1370
|
+
initialClientOffset: r.clientOffset,
|
|
1371
|
+
clientOffset: r.clientOffset
|
|
1372
|
+
};
|
|
1373
|
+
case oe:
|
|
1374
|
+
return Wr(t.clientOffset, r.clientOffset) ? t : Kr({}, t, {
|
|
1375
|
+
clientOffset: r.clientOffset
|
|
1376
|
+
});
|
|
1377
|
+
case se:
|
|
1378
|
+
case ie:
|
|
1379
|
+
return Be;
|
|
1380
|
+
default:
|
|
1381
|
+
return t;
|
|
1382
|
+
}
|
|
1383
|
+
}
|
|
1384
|
+
function tn(t, e, r) {
|
|
1385
|
+
return e in t ? Object.defineProperty(t, e, {
|
|
1386
|
+
value: r,
|
|
1387
|
+
enumerable: !0,
|
|
1388
|
+
configurable: !0,
|
|
1389
|
+
writable: !0
|
|
1390
|
+
}) : t[e] = r, t;
|
|
1391
|
+
}
|
|
1392
|
+
function V(t) {
|
|
1393
|
+
for (var e = 1; e < arguments.length; e++) {
|
|
1394
|
+
var r = arguments[e] != null ? arguments[e] : {}, n = Object.keys(r);
|
|
1395
|
+
typeof Object.getOwnPropertySymbols == "function" && (n = n.concat(Object.getOwnPropertySymbols(r).filter(function(o) {
|
|
1396
|
+
return Object.getOwnPropertyDescriptor(r, o).enumerable;
|
|
1397
|
+
}))), n.forEach(function(o) {
|
|
1398
|
+
tn(t, o, r[o]);
|
|
1399
|
+
});
|
|
1400
|
+
}
|
|
1401
|
+
return t;
|
|
1402
|
+
}
|
|
1403
|
+
const rn = {
|
|
1404
|
+
itemType: null,
|
|
1405
|
+
item: null,
|
|
1406
|
+
sourceId: null,
|
|
1407
|
+
targetIds: [],
|
|
1408
|
+
dropResult: null,
|
|
1409
|
+
didDrop: !1,
|
|
1410
|
+
isSourcePublic: null
|
|
1411
|
+
};
|
|
1412
|
+
function nn(t = rn, e) {
|
|
1413
|
+
const { payload: r } = e;
|
|
1414
|
+
switch (e.type) {
|
|
1415
|
+
case ne:
|
|
1416
|
+
return V({}, t, {
|
|
1417
|
+
itemType: r.itemType,
|
|
1418
|
+
item: r.item,
|
|
1419
|
+
sourceId: r.sourceId,
|
|
1420
|
+
isSourcePublic: r.isSourcePublic,
|
|
1421
|
+
dropResult: null,
|
|
1422
|
+
didDrop: !1
|
|
1423
|
+
});
|
|
1424
|
+
case Ie:
|
|
1425
|
+
return V({}, t, {
|
|
1426
|
+
isSourcePublic: !0
|
|
1427
|
+
});
|
|
1428
|
+
case oe:
|
|
1429
|
+
return V({}, t, {
|
|
1430
|
+
targetIds: r.targetIds
|
|
1431
|
+
});
|
|
1432
|
+
case ae:
|
|
1433
|
+
return t.targetIds.indexOf(r.targetId) === -1 ? t : V({}, t, {
|
|
1434
|
+
targetIds: er(t.targetIds, r.targetId)
|
|
1435
|
+
});
|
|
1436
|
+
case ie:
|
|
1437
|
+
return V({}, t, {
|
|
1438
|
+
dropResult: r.dropResult,
|
|
1439
|
+
didDrop: !0,
|
|
1440
|
+
targetIds: []
|
|
1441
|
+
});
|
|
1442
|
+
case se:
|
|
1443
|
+
return V({}, t, {
|
|
1444
|
+
itemType: null,
|
|
1445
|
+
item: null,
|
|
1446
|
+
sourceId: null,
|
|
1447
|
+
dropResult: null,
|
|
1448
|
+
didDrop: !1,
|
|
1449
|
+
isSourcePublic: null,
|
|
1450
|
+
targetIds: []
|
|
1451
|
+
});
|
|
1452
|
+
default:
|
|
1453
|
+
return t;
|
|
1454
|
+
}
|
|
1455
|
+
}
|
|
1456
|
+
function on(t = 0, e) {
|
|
1457
|
+
switch (e.type) {
|
|
1458
|
+
case we:
|
|
1459
|
+
case xe:
|
|
1460
|
+
return t + 1;
|
|
1461
|
+
case Ne:
|
|
1462
|
+
case ae:
|
|
1463
|
+
return t - 1;
|
|
1464
|
+
default:
|
|
1465
|
+
return t;
|
|
1466
|
+
}
|
|
1467
|
+
}
|
|
1468
|
+
function sn(t = 0) {
|
|
1469
|
+
return t + 1;
|
|
1470
|
+
}
|
|
1471
|
+
function an(t, e, r) {
|
|
1472
|
+
return e in t ? Object.defineProperty(t, e, {
|
|
1473
|
+
value: r,
|
|
1474
|
+
enumerable: !0,
|
|
1475
|
+
configurable: !0,
|
|
1476
|
+
writable: !0
|
|
1477
|
+
}) : t[e] = r, t;
|
|
1478
|
+
}
|
|
1479
|
+
function cn(t) {
|
|
1480
|
+
for (var e = 1; e < arguments.length; e++) {
|
|
1481
|
+
var r = arguments[e] != null ? arguments[e] : {}, n = Object.keys(r);
|
|
1482
|
+
typeof Object.getOwnPropertySymbols == "function" && (n = n.concat(Object.getOwnPropertySymbols(r).filter(function(o) {
|
|
1483
|
+
return Object.getOwnPropertyDescriptor(r, o).enumerable;
|
|
1484
|
+
}))), n.forEach(function(o) {
|
|
1485
|
+
an(t, o, r[o]);
|
|
1486
|
+
});
|
|
1487
|
+
}
|
|
1488
|
+
return t;
|
|
1489
|
+
}
|
|
1490
|
+
function un(t = {}, e) {
|
|
1491
|
+
return {
|
|
1492
|
+
dirtyHandlerIds: Jr(t.dirtyHandlerIds, {
|
|
1493
|
+
type: e.type,
|
|
1494
|
+
payload: cn({}, e.payload, {
|
|
1495
|
+
prevTargetIds: Kt(t, "dragOperation.targetIds", [])
|
|
1496
|
+
})
|
|
1497
|
+
}),
|
|
1498
|
+
dragOffset: en(t.dragOffset, e),
|
|
1499
|
+
refCount: on(t.refCount, e),
|
|
1500
|
+
dragOperation: nn(t.dragOperation, e),
|
|
1501
|
+
stateId: sn(t.stateId)
|
|
1502
|
+
};
|
|
1503
|
+
}
|
|
1504
|
+
function ln(t, e = void 0, r = {}, n = !1) {
|
|
1505
|
+
const o = dn(n), i = new Pr(o, new Gr(o)), s = new Ir(o, i), a = t(s, e, r);
|
|
1506
|
+
return s.receiveBackend(a), s;
|
|
1507
|
+
}
|
|
1508
|
+
function dn(t) {
|
|
1509
|
+
const e = typeof window < "u" && window.__REDUX_DEVTOOLS_EXTENSION__;
|
|
1510
|
+
return et(un, t && e && e({
|
|
1511
|
+
name: "dnd-core",
|
|
1512
|
+
instanceId: "dnd-core"
|
|
1513
|
+
}));
|
|
1514
|
+
}
|
|
1515
|
+
function gn(t, e) {
|
|
1516
|
+
if (t == null) return {};
|
|
1517
|
+
var r = fn(t, e), n, o;
|
|
1518
|
+
if (Object.getOwnPropertySymbols) {
|
|
1519
|
+
var i = Object.getOwnPropertySymbols(t);
|
|
1520
|
+
for (o = 0; o < i.length; o++)
|
|
1521
|
+
n = i[o], !(e.indexOf(n) >= 0) && Object.prototype.propertyIsEnumerable.call(t, n) && (r[n] = t[n]);
|
|
1522
|
+
}
|
|
1523
|
+
return r;
|
|
1524
|
+
}
|
|
1525
|
+
function fn(t, e) {
|
|
1526
|
+
if (t == null) return {};
|
|
1527
|
+
var r = {}, n = Object.keys(t), o, i;
|
|
1528
|
+
for (i = 0; i < n.length; i++)
|
|
1529
|
+
o = n[i], !(e.indexOf(o) >= 0) && (r[o] = t[o]);
|
|
1530
|
+
return r;
|
|
1531
|
+
}
|
|
1532
|
+
let Ue = 0;
|
|
1533
|
+
const ee = Symbol.for("__REACT_DND_CONTEXT_INSTANCE__");
|
|
1534
|
+
var hn = /* @__PURE__ */ wt(function(e) {
|
|
1535
|
+
var { children: r } = e, n = gn(e, [
|
|
1536
|
+
"children"
|
|
1537
|
+
]);
|
|
1538
|
+
const [o, i] = pn(n);
|
|
1539
|
+
return Y(() => {
|
|
1540
|
+
if (i) {
|
|
1541
|
+
const s = st();
|
|
1542
|
+
return ++Ue, () => {
|
|
1543
|
+
--Ue === 0 && (s[ee] = null);
|
|
1544
|
+
};
|
|
1545
|
+
}
|
|
1546
|
+
}, []), /* @__PURE__ */ c.jsx(Ke.Provider, {
|
|
1547
|
+
value: o,
|
|
1548
|
+
children: r
|
|
1549
|
+
});
|
|
1550
|
+
});
|
|
1551
|
+
function pn(t) {
|
|
1552
|
+
if ("manager" in t)
|
|
1553
|
+
return [
|
|
1554
|
+
{
|
|
1555
|
+
dragDropManager: t.manager
|
|
1556
|
+
},
|
|
1557
|
+
!1
|
|
1558
|
+
];
|
|
1559
|
+
const e = mn(t.backend, t.context, t.options, t.debugMode), r = !t.context;
|
|
1560
|
+
return [
|
|
1561
|
+
e,
|
|
1562
|
+
r
|
|
1563
|
+
];
|
|
1564
|
+
}
|
|
1565
|
+
function mn(t, e = st(), r, n) {
|
|
1566
|
+
const o = e;
|
|
1567
|
+
return o[ee] || (o[ee] = {
|
|
1568
|
+
dragDropManager: ln(t, e, r, n)
|
|
1569
|
+
}), o[ee];
|
|
1570
|
+
}
|
|
1571
|
+
function st() {
|
|
1572
|
+
return typeof global < "u" ? global : window;
|
|
1573
|
+
}
|
|
1574
|
+
var le, Ve;
|
|
1575
|
+
function vn() {
|
|
1576
|
+
return Ve || (Ve = 1, le = function t(e, r) {
|
|
1577
|
+
if (e === r) return !0;
|
|
1578
|
+
if (e && r && typeof e == "object" && typeof r == "object") {
|
|
1579
|
+
if (e.constructor !== r.constructor) return !1;
|
|
1580
|
+
var n, o, i;
|
|
1581
|
+
if (Array.isArray(e)) {
|
|
1582
|
+
if (n = e.length, n != r.length) return !1;
|
|
1583
|
+
for (o = n; o-- !== 0; )
|
|
1584
|
+
if (!t(e[o], r[o])) return !1;
|
|
1585
|
+
return !0;
|
|
1586
|
+
}
|
|
1587
|
+
if (e.constructor === RegExp) return e.source === r.source && e.flags === r.flags;
|
|
1588
|
+
if (e.valueOf !== Object.prototype.valueOf) return e.valueOf() === r.valueOf();
|
|
1589
|
+
if (e.toString !== Object.prototype.toString) return e.toString() === r.toString();
|
|
1590
|
+
if (i = Object.keys(e), n = i.length, n !== Object.keys(r).length) return !1;
|
|
1591
|
+
for (o = n; o-- !== 0; )
|
|
1592
|
+
if (!Object.prototype.hasOwnProperty.call(r, i[o])) return !1;
|
|
1593
|
+
for (o = n; o-- !== 0; ) {
|
|
1594
|
+
var s = i[o];
|
|
1595
|
+
if (!t(e[s], r[s])) return !1;
|
|
1596
|
+
}
|
|
1597
|
+
return !0;
|
|
1598
|
+
}
|
|
1599
|
+
return e !== e && r !== r;
|
|
1600
|
+
}), le;
|
|
1601
|
+
}
|
|
1602
|
+
var Dn = vn();
|
|
1603
|
+
const yn = /* @__PURE__ */ Ht(Dn), B = typeof window < "u" ? xt : Y;
|
|
1604
|
+
function Sn(t, e, r) {
|
|
1605
|
+
const [n, o] = F(
|
|
1606
|
+
() => e(t)
|
|
1607
|
+
), i = Nt(() => {
|
|
1608
|
+
const s = e(t);
|
|
1609
|
+
yn(n, s) || (o(s), r && r());
|
|
1610
|
+
}, [
|
|
1611
|
+
n,
|
|
1612
|
+
t,
|
|
1613
|
+
r
|
|
1614
|
+
]);
|
|
1615
|
+
return B(i), [
|
|
1616
|
+
n,
|
|
1617
|
+
i
|
|
1618
|
+
];
|
|
1619
|
+
}
|
|
1620
|
+
function On(t, e, r) {
|
|
1621
|
+
const [n, o] = Sn(t, e, r);
|
|
1622
|
+
return B(function() {
|
|
1623
|
+
const s = t.getHandlerId();
|
|
1624
|
+
if (s != null)
|
|
1625
|
+
return t.subscribeToStateChange(o, {
|
|
1626
|
+
handlerIds: [
|
|
1627
|
+
s
|
|
1628
|
+
]
|
|
1629
|
+
});
|
|
1630
|
+
}, [
|
|
1631
|
+
t,
|
|
1632
|
+
o
|
|
1633
|
+
]), n;
|
|
1634
|
+
}
|
|
1635
|
+
function at(t, e, r) {
|
|
1636
|
+
return On(
|
|
1637
|
+
e,
|
|
1638
|
+
t || (() => ({})),
|
|
1639
|
+
() => r.reconnect()
|
|
1640
|
+
);
|
|
1641
|
+
}
|
|
1642
|
+
function ct(t, e) {
|
|
1643
|
+
const r = [];
|
|
1644
|
+
return typeof t != "function" && r.push(t), M(() => typeof t == "function" ? t() : t, r);
|
|
1645
|
+
}
|
|
1646
|
+
function bn(t) {
|
|
1647
|
+
return M(
|
|
1648
|
+
() => t.hooks.dragSource(),
|
|
1649
|
+
[
|
|
1650
|
+
t
|
|
1651
|
+
]
|
|
1652
|
+
);
|
|
1653
|
+
}
|
|
1654
|
+
function Tn(t) {
|
|
1655
|
+
return M(
|
|
1656
|
+
() => t.hooks.dragPreview(),
|
|
1657
|
+
[
|
|
1658
|
+
t
|
|
1659
|
+
]
|
|
1660
|
+
);
|
|
1661
|
+
}
|
|
1662
|
+
let de = !1, ge = !1;
|
|
1663
|
+
class Cn {
|
|
1664
|
+
receiveHandlerId(e) {
|
|
1665
|
+
this.sourceId = e;
|
|
1666
|
+
}
|
|
1667
|
+
getHandlerId() {
|
|
1668
|
+
return this.sourceId;
|
|
1669
|
+
}
|
|
1670
|
+
canDrag() {
|
|
1671
|
+
D(!de, "You may not call monitor.canDrag() inside your canDrag() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");
|
|
1672
|
+
try {
|
|
1673
|
+
return de = !0, this.internalMonitor.canDragSource(this.sourceId);
|
|
1674
|
+
} finally {
|
|
1675
|
+
de = !1;
|
|
1676
|
+
}
|
|
1677
|
+
}
|
|
1678
|
+
isDragging() {
|
|
1679
|
+
if (!this.sourceId)
|
|
1680
|
+
return !1;
|
|
1681
|
+
D(!ge, "You may not call monitor.isDragging() inside your isDragging() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");
|
|
1682
|
+
try {
|
|
1683
|
+
return ge = !0, this.internalMonitor.isDraggingSource(this.sourceId);
|
|
1684
|
+
} finally {
|
|
1685
|
+
ge = !1;
|
|
1686
|
+
}
|
|
1687
|
+
}
|
|
1688
|
+
subscribeToStateChange(e, r) {
|
|
1689
|
+
return this.internalMonitor.subscribeToStateChange(e, r);
|
|
1690
|
+
}
|
|
1691
|
+
isDraggingSource(e) {
|
|
1692
|
+
return this.internalMonitor.isDraggingSource(e);
|
|
1693
|
+
}
|
|
1694
|
+
isOverTarget(e, r) {
|
|
1695
|
+
return this.internalMonitor.isOverTarget(e, r);
|
|
1696
|
+
}
|
|
1697
|
+
getTargetIds() {
|
|
1698
|
+
return this.internalMonitor.getTargetIds();
|
|
1699
|
+
}
|
|
1700
|
+
isSourcePublic() {
|
|
1701
|
+
return this.internalMonitor.isSourcePublic();
|
|
1702
|
+
}
|
|
1703
|
+
getSourceId() {
|
|
1704
|
+
return this.internalMonitor.getSourceId();
|
|
1705
|
+
}
|
|
1706
|
+
subscribeToOffsetChange(e) {
|
|
1707
|
+
return this.internalMonitor.subscribeToOffsetChange(e);
|
|
1708
|
+
}
|
|
1709
|
+
canDragSource(e) {
|
|
1710
|
+
return this.internalMonitor.canDragSource(e);
|
|
1711
|
+
}
|
|
1712
|
+
canDropOnTarget(e) {
|
|
1713
|
+
return this.internalMonitor.canDropOnTarget(e);
|
|
1714
|
+
}
|
|
1715
|
+
getItemType() {
|
|
1716
|
+
return this.internalMonitor.getItemType();
|
|
1717
|
+
}
|
|
1718
|
+
getItem() {
|
|
1719
|
+
return this.internalMonitor.getItem();
|
|
1720
|
+
}
|
|
1721
|
+
getDropResult() {
|
|
1722
|
+
return this.internalMonitor.getDropResult();
|
|
1723
|
+
}
|
|
1724
|
+
didDrop() {
|
|
1725
|
+
return this.internalMonitor.didDrop();
|
|
1726
|
+
}
|
|
1727
|
+
getInitialClientOffset() {
|
|
1728
|
+
return this.internalMonitor.getInitialClientOffset();
|
|
1729
|
+
}
|
|
1730
|
+
getInitialSourceClientOffset() {
|
|
1731
|
+
return this.internalMonitor.getInitialSourceClientOffset();
|
|
1732
|
+
}
|
|
1733
|
+
getSourceClientOffset() {
|
|
1734
|
+
return this.internalMonitor.getSourceClientOffset();
|
|
1735
|
+
}
|
|
1736
|
+
getClientOffset() {
|
|
1737
|
+
return this.internalMonitor.getClientOffset();
|
|
1738
|
+
}
|
|
1739
|
+
getDifferenceFromInitialOffset() {
|
|
1740
|
+
return this.internalMonitor.getDifferenceFromInitialOffset();
|
|
1741
|
+
}
|
|
1742
|
+
constructor(e) {
|
|
1743
|
+
this.sourceId = null, this.internalMonitor = e.getMonitor();
|
|
1744
|
+
}
|
|
1745
|
+
}
|
|
1746
|
+
let fe = !1;
|
|
1747
|
+
class In {
|
|
1748
|
+
receiveHandlerId(e) {
|
|
1749
|
+
this.targetId = e;
|
|
1750
|
+
}
|
|
1751
|
+
getHandlerId() {
|
|
1752
|
+
return this.targetId;
|
|
1753
|
+
}
|
|
1754
|
+
subscribeToStateChange(e, r) {
|
|
1755
|
+
return this.internalMonitor.subscribeToStateChange(e, r);
|
|
1756
|
+
}
|
|
1757
|
+
canDrop() {
|
|
1758
|
+
if (!this.targetId)
|
|
1759
|
+
return !1;
|
|
1760
|
+
D(!fe, "You may not call monitor.canDrop() inside your canDrop() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target-monitor");
|
|
1761
|
+
try {
|
|
1762
|
+
return fe = !0, this.internalMonitor.canDropOnTarget(this.targetId);
|
|
1763
|
+
} finally {
|
|
1764
|
+
fe = !1;
|
|
1765
|
+
}
|
|
1766
|
+
}
|
|
1767
|
+
isOver(e) {
|
|
1768
|
+
return this.targetId ? this.internalMonitor.isOverTarget(this.targetId, e) : !1;
|
|
1769
|
+
}
|
|
1770
|
+
getItemType() {
|
|
1771
|
+
return this.internalMonitor.getItemType();
|
|
1772
|
+
}
|
|
1773
|
+
getItem() {
|
|
1774
|
+
return this.internalMonitor.getItem();
|
|
1775
|
+
}
|
|
1776
|
+
getDropResult() {
|
|
1777
|
+
return this.internalMonitor.getDropResult();
|
|
1778
|
+
}
|
|
1779
|
+
didDrop() {
|
|
1780
|
+
return this.internalMonitor.didDrop();
|
|
1781
|
+
}
|
|
1782
|
+
getInitialClientOffset() {
|
|
1783
|
+
return this.internalMonitor.getInitialClientOffset();
|
|
1784
|
+
}
|
|
1785
|
+
getInitialSourceClientOffset() {
|
|
1786
|
+
return this.internalMonitor.getInitialSourceClientOffset();
|
|
1787
|
+
}
|
|
1788
|
+
getSourceClientOffset() {
|
|
1789
|
+
return this.internalMonitor.getSourceClientOffset();
|
|
1790
|
+
}
|
|
1791
|
+
getClientOffset() {
|
|
1792
|
+
return this.internalMonitor.getClientOffset();
|
|
1793
|
+
}
|
|
1794
|
+
getDifferenceFromInitialOffset() {
|
|
1795
|
+
return this.internalMonitor.getDifferenceFromInitialOffset();
|
|
1796
|
+
}
|
|
1797
|
+
constructor(e) {
|
|
1798
|
+
this.targetId = null, this.internalMonitor = e.getMonitor();
|
|
1799
|
+
}
|
|
1800
|
+
}
|
|
1801
|
+
function En(t, e, r) {
|
|
1802
|
+
const n = r.getRegistry(), o = n.addTarget(t, e);
|
|
1803
|
+
return [
|
|
1804
|
+
o,
|
|
1805
|
+
() => n.removeTarget(o)
|
|
1806
|
+
];
|
|
1807
|
+
}
|
|
1808
|
+
function wn(t, e, r) {
|
|
1809
|
+
const n = r.getRegistry(), o = n.addSource(t, e);
|
|
1810
|
+
return [
|
|
1811
|
+
o,
|
|
1812
|
+
() => n.removeSource(o)
|
|
1813
|
+
];
|
|
1814
|
+
}
|
|
1815
|
+
function ye(t, e, r, n) {
|
|
1816
|
+
let o;
|
|
1817
|
+
if (o !== void 0)
|
|
1818
|
+
return !!o;
|
|
1819
|
+
if (t === e)
|
|
1820
|
+
return !0;
|
|
1821
|
+
if (typeof t != "object" || !t || typeof e != "object" || !e)
|
|
1822
|
+
return !1;
|
|
1823
|
+
const i = Object.keys(t), s = Object.keys(e);
|
|
1824
|
+
if (i.length !== s.length)
|
|
1825
|
+
return !1;
|
|
1826
|
+
const a = Object.prototype.hasOwnProperty.bind(e);
|
|
1827
|
+
for (let u = 0; u < i.length; u++) {
|
|
1828
|
+
const d = i[u];
|
|
1829
|
+
if (!a(d))
|
|
1830
|
+
return !1;
|
|
1831
|
+
const g = t[d], y = e[d];
|
|
1832
|
+
if (o = void 0, o === !1 || o === void 0 && g !== y)
|
|
1833
|
+
return !1;
|
|
1834
|
+
}
|
|
1835
|
+
return !0;
|
|
1836
|
+
}
|
|
1837
|
+
function Se(t) {
|
|
1838
|
+
return (
|
|
1839
|
+
// eslint-disable-next-line no-prototype-builtins
|
|
1840
|
+
t !== null && typeof t == "object" && Object.prototype.hasOwnProperty.call(t, "current")
|
|
1841
|
+
);
|
|
1842
|
+
}
|
|
1843
|
+
function xn(t) {
|
|
1844
|
+
if (typeof t.type == "string")
|
|
1845
|
+
return;
|
|
1846
|
+
const e = t.type.displayName || t.type.name || "the component";
|
|
1847
|
+
throw new Error(`Only native element nodes can now be passed to React DnD connectors.You can either wrap ${e} into a <div>, or turn it into a drag source or a drop target itself.`);
|
|
1848
|
+
}
|
|
1849
|
+
function Nn(t) {
|
|
1850
|
+
return (e = null, r = null) => {
|
|
1851
|
+
if (!Pt(e)) {
|
|
1852
|
+
const i = e;
|
|
1853
|
+
return t(i, r), i;
|
|
1854
|
+
}
|
|
1855
|
+
const n = e;
|
|
1856
|
+
return xn(n), Pn(n, r ? (i) => t(i, r) : t);
|
|
1857
|
+
};
|
|
1858
|
+
}
|
|
1859
|
+
function ut(t) {
|
|
1860
|
+
const e = {};
|
|
1861
|
+
return Object.keys(t).forEach((r) => {
|
|
1862
|
+
const n = t[r];
|
|
1863
|
+
if (r.endsWith("Ref"))
|
|
1864
|
+
e[r] = t[r];
|
|
1865
|
+
else {
|
|
1866
|
+
const o = Nn(n);
|
|
1867
|
+
e[r] = () => o;
|
|
1868
|
+
}
|
|
1869
|
+
}), e;
|
|
1870
|
+
}
|
|
1871
|
+
function $e(t, e) {
|
|
1872
|
+
typeof t == "function" ? t(e) : t.current = e;
|
|
1873
|
+
}
|
|
1874
|
+
function Pn(t, e) {
|
|
1875
|
+
const r = t.ref;
|
|
1876
|
+
return D(typeof r != "string", "Cannot connect React DnD to an element with an existing string ref. Please convert it to use a callback ref instead, or wrap it into a <span> or <div>. Read more: https://reactjs.org/docs/refs-and-the-dom.html#callback-refs"), r ? Me(t, {
|
|
1877
|
+
ref: (n) => {
|
|
1878
|
+
$e(r, n), $e(e, n);
|
|
1879
|
+
}
|
|
1880
|
+
}) : Me(t, {
|
|
1881
|
+
ref: e
|
|
1882
|
+
});
|
|
1883
|
+
}
|
|
1884
|
+
class Mn {
|
|
1885
|
+
receiveHandlerId(e) {
|
|
1886
|
+
this.handlerId !== e && (this.handlerId = e, this.reconnect());
|
|
1887
|
+
}
|
|
1888
|
+
get connectTarget() {
|
|
1889
|
+
return this.dragSource;
|
|
1890
|
+
}
|
|
1891
|
+
get dragSourceOptions() {
|
|
1892
|
+
return this.dragSourceOptionsInternal;
|
|
1893
|
+
}
|
|
1894
|
+
set dragSourceOptions(e) {
|
|
1895
|
+
this.dragSourceOptionsInternal = e;
|
|
1896
|
+
}
|
|
1897
|
+
get dragPreviewOptions() {
|
|
1898
|
+
return this.dragPreviewOptionsInternal;
|
|
1899
|
+
}
|
|
1900
|
+
set dragPreviewOptions(e) {
|
|
1901
|
+
this.dragPreviewOptionsInternal = e;
|
|
1902
|
+
}
|
|
1903
|
+
reconnect() {
|
|
1904
|
+
const e = this.reconnectDragSource();
|
|
1905
|
+
this.reconnectDragPreview(e);
|
|
1906
|
+
}
|
|
1907
|
+
reconnectDragSource() {
|
|
1908
|
+
const e = this.dragSource, r = this.didHandlerIdChange() || this.didConnectedDragSourceChange() || this.didDragSourceOptionsChange();
|
|
1909
|
+
return r && this.disconnectDragSource(), this.handlerId ? e ? (r && (this.lastConnectedHandlerId = this.handlerId, this.lastConnectedDragSource = e, this.lastConnectedDragSourceOptions = this.dragSourceOptions, this.dragSourceUnsubscribe = this.backend.connectDragSource(this.handlerId, e, this.dragSourceOptions)), r) : (this.lastConnectedDragSource = e, r) : r;
|
|
1910
|
+
}
|
|
1911
|
+
reconnectDragPreview(e = !1) {
|
|
1912
|
+
const r = this.dragPreview, n = e || this.didHandlerIdChange() || this.didConnectedDragPreviewChange() || this.didDragPreviewOptionsChange();
|
|
1913
|
+
if (n && this.disconnectDragPreview(), !!this.handlerId) {
|
|
1914
|
+
if (!r) {
|
|
1915
|
+
this.lastConnectedDragPreview = r;
|
|
1916
|
+
return;
|
|
1917
|
+
}
|
|
1918
|
+
n && (this.lastConnectedHandlerId = this.handlerId, this.lastConnectedDragPreview = r, this.lastConnectedDragPreviewOptions = this.dragPreviewOptions, this.dragPreviewUnsubscribe = this.backend.connectDragPreview(this.handlerId, r, this.dragPreviewOptions));
|
|
1919
|
+
}
|
|
1920
|
+
}
|
|
1921
|
+
didHandlerIdChange() {
|
|
1922
|
+
return this.lastConnectedHandlerId !== this.handlerId;
|
|
1923
|
+
}
|
|
1924
|
+
didConnectedDragSourceChange() {
|
|
1925
|
+
return this.lastConnectedDragSource !== this.dragSource;
|
|
1926
|
+
}
|
|
1927
|
+
didConnectedDragPreviewChange() {
|
|
1928
|
+
return this.lastConnectedDragPreview !== this.dragPreview;
|
|
1929
|
+
}
|
|
1930
|
+
didDragSourceOptionsChange() {
|
|
1931
|
+
return !ye(this.lastConnectedDragSourceOptions, this.dragSourceOptions);
|
|
1932
|
+
}
|
|
1933
|
+
didDragPreviewOptionsChange() {
|
|
1934
|
+
return !ye(this.lastConnectedDragPreviewOptions, this.dragPreviewOptions);
|
|
1935
|
+
}
|
|
1936
|
+
disconnectDragSource() {
|
|
1937
|
+
this.dragSourceUnsubscribe && (this.dragSourceUnsubscribe(), this.dragSourceUnsubscribe = void 0);
|
|
1938
|
+
}
|
|
1939
|
+
disconnectDragPreview() {
|
|
1940
|
+
this.dragPreviewUnsubscribe && (this.dragPreviewUnsubscribe(), this.dragPreviewUnsubscribe = void 0, this.dragPreviewNode = null, this.dragPreviewRef = null);
|
|
1941
|
+
}
|
|
1942
|
+
get dragSource() {
|
|
1943
|
+
return this.dragSourceNode || this.dragSourceRef && this.dragSourceRef.current;
|
|
1944
|
+
}
|
|
1945
|
+
get dragPreview() {
|
|
1946
|
+
return this.dragPreviewNode || this.dragPreviewRef && this.dragPreviewRef.current;
|
|
1947
|
+
}
|
|
1948
|
+
clearDragSource() {
|
|
1949
|
+
this.dragSourceNode = null, this.dragSourceRef = null;
|
|
1950
|
+
}
|
|
1951
|
+
clearDragPreview() {
|
|
1952
|
+
this.dragPreviewNode = null, this.dragPreviewRef = null;
|
|
1953
|
+
}
|
|
1954
|
+
constructor(e) {
|
|
1955
|
+
this.hooks = ut({
|
|
1956
|
+
dragSource: (r, n) => {
|
|
1957
|
+
this.clearDragSource(), this.dragSourceOptions = n || null, Se(r) ? this.dragSourceRef = r : this.dragSourceNode = r, this.reconnectDragSource();
|
|
1958
|
+
},
|
|
1959
|
+
dragPreview: (r, n) => {
|
|
1960
|
+
this.clearDragPreview(), this.dragPreviewOptions = n || null, Se(r) ? this.dragPreviewRef = r : this.dragPreviewNode = r, this.reconnectDragPreview();
|
|
1961
|
+
}
|
|
1962
|
+
}), this.handlerId = null, this.dragSourceRef = null, this.dragSourceOptionsInternal = null, this.dragPreviewRef = null, this.dragPreviewOptionsInternal = null, this.lastConnectedHandlerId = null, this.lastConnectedDragSource = null, this.lastConnectedDragSourceOptions = null, this.lastConnectedDragPreview = null, this.lastConnectedDragPreviewOptions = null, this.backend = e;
|
|
1963
|
+
}
|
|
1964
|
+
}
|
|
1965
|
+
class Rn {
|
|
1966
|
+
get connectTarget() {
|
|
1967
|
+
return this.dropTarget;
|
|
1968
|
+
}
|
|
1969
|
+
reconnect() {
|
|
1970
|
+
const e = this.didHandlerIdChange() || this.didDropTargetChange() || this.didOptionsChange();
|
|
1971
|
+
e && this.disconnectDropTarget();
|
|
1972
|
+
const r = this.dropTarget;
|
|
1973
|
+
if (this.handlerId) {
|
|
1974
|
+
if (!r) {
|
|
1975
|
+
this.lastConnectedDropTarget = r;
|
|
1976
|
+
return;
|
|
1977
|
+
}
|
|
1978
|
+
e && (this.lastConnectedHandlerId = this.handlerId, this.lastConnectedDropTarget = r, this.lastConnectedDropTargetOptions = this.dropTargetOptions, this.unsubscribeDropTarget = this.backend.connectDropTarget(this.handlerId, r, this.dropTargetOptions));
|
|
1979
|
+
}
|
|
1980
|
+
}
|
|
1981
|
+
receiveHandlerId(e) {
|
|
1982
|
+
e !== this.handlerId && (this.handlerId = e, this.reconnect());
|
|
1983
|
+
}
|
|
1984
|
+
get dropTargetOptions() {
|
|
1985
|
+
return this.dropTargetOptionsInternal;
|
|
1986
|
+
}
|
|
1987
|
+
set dropTargetOptions(e) {
|
|
1988
|
+
this.dropTargetOptionsInternal = e;
|
|
1989
|
+
}
|
|
1990
|
+
didHandlerIdChange() {
|
|
1991
|
+
return this.lastConnectedHandlerId !== this.handlerId;
|
|
1992
|
+
}
|
|
1993
|
+
didDropTargetChange() {
|
|
1994
|
+
return this.lastConnectedDropTarget !== this.dropTarget;
|
|
1995
|
+
}
|
|
1996
|
+
didOptionsChange() {
|
|
1997
|
+
return !ye(this.lastConnectedDropTargetOptions, this.dropTargetOptions);
|
|
1998
|
+
}
|
|
1999
|
+
disconnectDropTarget() {
|
|
2000
|
+
this.unsubscribeDropTarget && (this.unsubscribeDropTarget(), this.unsubscribeDropTarget = void 0);
|
|
2001
|
+
}
|
|
2002
|
+
get dropTarget() {
|
|
2003
|
+
return this.dropTargetNode || this.dropTargetRef && this.dropTargetRef.current;
|
|
2004
|
+
}
|
|
2005
|
+
clearDropTarget() {
|
|
2006
|
+
this.dropTargetRef = null, this.dropTargetNode = null;
|
|
2007
|
+
}
|
|
2008
|
+
constructor(e) {
|
|
2009
|
+
this.hooks = ut({
|
|
2010
|
+
dropTarget: (r, n) => {
|
|
2011
|
+
this.clearDropTarget(), this.dropTargetOptions = n, Se(r) ? this.dropTargetRef = r : this.dropTargetNode = r, this.reconnect();
|
|
2012
|
+
}
|
|
2013
|
+
}), this.handlerId = null, this.dropTargetRef = null, this.dropTargetOptionsInternal = null, this.lastConnectedHandlerId = null, this.lastConnectedDropTarget = null, this.lastConnectedDropTargetOptions = null, this.backend = e;
|
|
2014
|
+
}
|
|
2015
|
+
}
|
|
2016
|
+
function X() {
|
|
2017
|
+
const { dragDropManager: t } = Mt(Ke);
|
|
2018
|
+
return D(t != null, "Expected drag drop context"), t;
|
|
2019
|
+
}
|
|
2020
|
+
function _n(t, e) {
|
|
2021
|
+
const r = X(), n = M(
|
|
2022
|
+
() => new Mn(r.getBackend()),
|
|
2023
|
+
[
|
|
2024
|
+
r
|
|
2025
|
+
]
|
|
2026
|
+
);
|
|
2027
|
+
return B(() => (n.dragSourceOptions = t || null, n.reconnect(), () => n.disconnectDragSource()), [
|
|
2028
|
+
n,
|
|
2029
|
+
t
|
|
2030
|
+
]), B(() => (n.dragPreviewOptions = e || null, n.reconnect(), () => n.disconnectDragPreview()), [
|
|
2031
|
+
n,
|
|
2032
|
+
e
|
|
2033
|
+
]), n;
|
|
2034
|
+
}
|
|
2035
|
+
function Ln() {
|
|
2036
|
+
const t = X();
|
|
2037
|
+
return M(
|
|
2038
|
+
() => new Cn(t),
|
|
2039
|
+
[
|
|
2040
|
+
t
|
|
2041
|
+
]
|
|
2042
|
+
);
|
|
2043
|
+
}
|
|
2044
|
+
class jn {
|
|
2045
|
+
beginDrag() {
|
|
2046
|
+
const e = this.spec, r = this.monitor;
|
|
2047
|
+
let n = null;
|
|
2048
|
+
return typeof e.item == "object" ? n = e.item : typeof e.item == "function" ? n = e.item(r) : n = {}, n ?? null;
|
|
2049
|
+
}
|
|
2050
|
+
canDrag() {
|
|
2051
|
+
const e = this.spec, r = this.monitor;
|
|
2052
|
+
return typeof e.canDrag == "boolean" ? e.canDrag : typeof e.canDrag == "function" ? e.canDrag(r) : !0;
|
|
2053
|
+
}
|
|
2054
|
+
isDragging(e, r) {
|
|
2055
|
+
const n = this.spec, o = this.monitor, { isDragging: i } = n;
|
|
2056
|
+
return i ? i(o) : r === e.getSourceId();
|
|
2057
|
+
}
|
|
2058
|
+
endDrag() {
|
|
2059
|
+
const e = this.spec, r = this.monitor, n = this.connector, { end: o } = e;
|
|
2060
|
+
o && o(r.getItem(), r), n.reconnect();
|
|
2061
|
+
}
|
|
2062
|
+
constructor(e, r, n) {
|
|
2063
|
+
this.spec = e, this.monitor = r, this.connector = n;
|
|
2064
|
+
}
|
|
2065
|
+
}
|
|
2066
|
+
function Fn(t, e, r) {
|
|
2067
|
+
const n = M(
|
|
2068
|
+
() => new jn(t, e, r),
|
|
2069
|
+
[
|
|
2070
|
+
e,
|
|
2071
|
+
r
|
|
2072
|
+
]
|
|
2073
|
+
);
|
|
2074
|
+
return Y(() => {
|
|
2075
|
+
n.spec = t;
|
|
2076
|
+
}, [
|
|
2077
|
+
t
|
|
2078
|
+
]), n;
|
|
2079
|
+
}
|
|
2080
|
+
function kn(t) {
|
|
2081
|
+
return M(() => {
|
|
2082
|
+
const e = t.type;
|
|
2083
|
+
return D(e != null, "spec.type must be defined"), e;
|
|
2084
|
+
}, [
|
|
2085
|
+
t
|
|
2086
|
+
]);
|
|
2087
|
+
}
|
|
2088
|
+
function Yn(t, e, r) {
|
|
2089
|
+
const n = X(), o = Fn(t, e, r), i = kn(t);
|
|
2090
|
+
B(function() {
|
|
2091
|
+
if (i != null) {
|
|
2092
|
+
const [a, u] = wn(i, o, n);
|
|
2093
|
+
return e.receiveHandlerId(a), r.receiveHandlerId(a), u;
|
|
2094
|
+
}
|
|
2095
|
+
}, [
|
|
2096
|
+
n,
|
|
2097
|
+
e,
|
|
2098
|
+
r,
|
|
2099
|
+
o,
|
|
2100
|
+
i
|
|
2101
|
+
]);
|
|
2102
|
+
}
|
|
2103
|
+
function An(t, e) {
|
|
2104
|
+
const r = ct(t);
|
|
2105
|
+
D(!r.begin, "useDrag::spec.begin was deprecated in v14. Replace spec.begin() with spec.item(). (see more here - https://react-dnd.github.io/react-dnd/docs/api/use-drag)");
|
|
2106
|
+
const n = Ln(), o = _n(r.options, r.previewOptions);
|
|
2107
|
+
return Yn(r, n, o), [
|
|
2108
|
+
at(r.collect, n, o),
|
|
2109
|
+
bn(o),
|
|
2110
|
+
Tn(o)
|
|
2111
|
+
];
|
|
2112
|
+
}
|
|
2113
|
+
function Hn(t) {
|
|
2114
|
+
return M(
|
|
2115
|
+
() => t.hooks.dropTarget(),
|
|
2116
|
+
[
|
|
2117
|
+
t
|
|
2118
|
+
]
|
|
2119
|
+
);
|
|
2120
|
+
}
|
|
2121
|
+
function Bn(t) {
|
|
2122
|
+
const e = X(), r = M(
|
|
2123
|
+
() => new Rn(e.getBackend()),
|
|
2124
|
+
[
|
|
2125
|
+
e
|
|
2126
|
+
]
|
|
2127
|
+
);
|
|
2128
|
+
return B(() => (r.dropTargetOptions = t || null, r.reconnect(), () => r.disconnectDropTarget()), [
|
|
2129
|
+
t
|
|
2130
|
+
]), r;
|
|
2131
|
+
}
|
|
2132
|
+
function Un() {
|
|
2133
|
+
const t = X();
|
|
2134
|
+
return M(
|
|
2135
|
+
() => new In(t),
|
|
2136
|
+
[
|
|
2137
|
+
t
|
|
2138
|
+
]
|
|
2139
|
+
);
|
|
2140
|
+
}
|
|
2141
|
+
function Vn(t) {
|
|
2142
|
+
const { accept: e } = t;
|
|
2143
|
+
return M(() => (D(t.accept != null, "accept must be defined"), Array.isArray(e) ? e : [
|
|
2144
|
+
e
|
|
2145
|
+
]), [
|
|
2146
|
+
e
|
|
2147
|
+
]);
|
|
2148
|
+
}
|
|
2149
|
+
class $n {
|
|
2150
|
+
canDrop() {
|
|
2151
|
+
const e = this.spec, r = this.monitor;
|
|
2152
|
+
return e.canDrop ? e.canDrop(r.getItem(), r) : !0;
|
|
2153
|
+
}
|
|
2154
|
+
hover() {
|
|
2155
|
+
const e = this.spec, r = this.monitor;
|
|
2156
|
+
e.hover && e.hover(r.getItem(), r);
|
|
2157
|
+
}
|
|
2158
|
+
drop() {
|
|
2159
|
+
const e = this.spec, r = this.monitor;
|
|
2160
|
+
if (e.drop)
|
|
2161
|
+
return e.drop(r.getItem(), r);
|
|
2162
|
+
}
|
|
2163
|
+
constructor(e, r) {
|
|
2164
|
+
this.spec = e, this.monitor = r;
|
|
2165
|
+
}
|
|
2166
|
+
}
|
|
2167
|
+
function zn(t, e) {
|
|
2168
|
+
const r = M(
|
|
2169
|
+
() => new $n(t, e),
|
|
2170
|
+
[
|
|
2171
|
+
e
|
|
2172
|
+
]
|
|
2173
|
+
);
|
|
2174
|
+
return Y(() => {
|
|
2175
|
+
r.spec = t;
|
|
2176
|
+
}, [
|
|
2177
|
+
t
|
|
2178
|
+
]), r;
|
|
2179
|
+
}
|
|
2180
|
+
function qn(t, e, r) {
|
|
2181
|
+
const n = X(), o = zn(t, e), i = Vn(t);
|
|
2182
|
+
B(function() {
|
|
2183
|
+
const [a, u] = En(i, o, n);
|
|
2184
|
+
return e.receiveHandlerId(a), r.receiveHandlerId(a), u;
|
|
2185
|
+
}, [
|
|
2186
|
+
n,
|
|
2187
|
+
e,
|
|
2188
|
+
o,
|
|
2189
|
+
r,
|
|
2190
|
+
i.map(
|
|
2191
|
+
(s) => s.toString()
|
|
2192
|
+
).join("|")
|
|
2193
|
+
]);
|
|
2194
|
+
}
|
|
2195
|
+
function Gn(t, e) {
|
|
2196
|
+
const r = ct(t), n = Un(), o = Bn(r.options);
|
|
2197
|
+
return qn(r, n, o), [
|
|
2198
|
+
at(r.collect, n, o),
|
|
2199
|
+
Hn(o)
|
|
2200
|
+
];
|
|
2201
|
+
}
|
|
2202
|
+
function lt(t) {
|
|
2203
|
+
let e = null;
|
|
2204
|
+
return () => (e == null && (e = t()), e);
|
|
2205
|
+
}
|
|
2206
|
+
function Xn(t, e) {
|
|
2207
|
+
return t.filter(
|
|
2208
|
+
(r) => r !== e
|
|
2209
|
+
);
|
|
2210
|
+
}
|
|
2211
|
+
function Wn(t, e) {
|
|
2212
|
+
const r = /* @__PURE__ */ new Set(), n = (i) => r.add(i);
|
|
2213
|
+
t.forEach(n), e.forEach(n);
|
|
2214
|
+
const o = [];
|
|
2215
|
+
return r.forEach(
|
|
2216
|
+
(i) => o.push(i)
|
|
2217
|
+
), o;
|
|
2218
|
+
}
|
|
2219
|
+
class Zn {
|
|
2220
|
+
enter(e) {
|
|
2221
|
+
const r = this.entered.length, n = (o) => this.isNodeInDocument(o) && (!o.contains || o.contains(e));
|
|
2222
|
+
return this.entered = Wn(this.entered.filter(n), [
|
|
2223
|
+
e
|
|
2224
|
+
]), r === 0 && this.entered.length > 0;
|
|
2225
|
+
}
|
|
2226
|
+
leave(e) {
|
|
2227
|
+
const r = this.entered.length;
|
|
2228
|
+
return this.entered = Xn(this.entered.filter(this.isNodeInDocument), e), r > 0 && this.entered.length === 0;
|
|
2229
|
+
}
|
|
2230
|
+
reset() {
|
|
2231
|
+
this.entered = [];
|
|
2232
|
+
}
|
|
2233
|
+
constructor(e) {
|
|
2234
|
+
this.entered = [], this.isNodeInDocument = e;
|
|
2235
|
+
}
|
|
2236
|
+
}
|
|
2237
|
+
class Jn {
|
|
2238
|
+
initializeExposedProperties() {
|
|
2239
|
+
Object.keys(this.config.exposeProperties).forEach((e) => {
|
|
2240
|
+
Object.defineProperty(this.item, e, {
|
|
2241
|
+
configurable: !0,
|
|
2242
|
+
enumerable: !0,
|
|
2243
|
+
get() {
|
|
2244
|
+
return console.warn(`Browser doesn't allow reading "${e}" until the drop event.`), null;
|
|
2245
|
+
}
|
|
2246
|
+
});
|
|
2247
|
+
});
|
|
2248
|
+
}
|
|
2249
|
+
loadDataTransfer(e) {
|
|
2250
|
+
if (e) {
|
|
2251
|
+
const r = {};
|
|
2252
|
+
Object.keys(this.config.exposeProperties).forEach((n) => {
|
|
2253
|
+
const o = this.config.exposeProperties[n];
|
|
2254
|
+
o != null && (r[n] = {
|
|
2255
|
+
value: o(e, this.config.matchesTypes),
|
|
2256
|
+
configurable: !0,
|
|
2257
|
+
enumerable: !0
|
|
2258
|
+
});
|
|
2259
|
+
}), Object.defineProperties(this.item, r);
|
|
2260
|
+
}
|
|
2261
|
+
}
|
|
2262
|
+
canDrag() {
|
|
2263
|
+
return !0;
|
|
2264
|
+
}
|
|
2265
|
+
beginDrag() {
|
|
2266
|
+
return this.item;
|
|
2267
|
+
}
|
|
2268
|
+
isDragging(e, r) {
|
|
2269
|
+
return r === e.getSourceId();
|
|
2270
|
+
}
|
|
2271
|
+
endDrag() {
|
|
2272
|
+
}
|
|
2273
|
+
constructor(e) {
|
|
2274
|
+
this.config = e, this.item = {}, this.initializeExposedProperties();
|
|
2275
|
+
}
|
|
2276
|
+
}
|
|
2277
|
+
const dt = "__NATIVE_FILE__", gt = "__NATIVE_URL__", ft = "__NATIVE_TEXT__", ht = "__NATIVE_HTML__", ze = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2278
|
+
__proto__: null,
|
|
2279
|
+
FILE: dt,
|
|
2280
|
+
HTML: ht,
|
|
2281
|
+
TEXT: ft,
|
|
2282
|
+
URL: gt
|
|
2283
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
2284
|
+
function he(t, e, r) {
|
|
2285
|
+
const n = e.reduce(
|
|
2286
|
+
(o, i) => o || t.getData(i),
|
|
2287
|
+
""
|
|
2288
|
+
);
|
|
2289
|
+
return n ?? r;
|
|
2290
|
+
}
|
|
2291
|
+
const Oe = {
|
|
2292
|
+
[dt]: {
|
|
2293
|
+
exposeProperties: {
|
|
2294
|
+
files: (t) => Array.prototype.slice.call(t.files),
|
|
2295
|
+
items: (t) => t.items,
|
|
2296
|
+
dataTransfer: (t) => t
|
|
2297
|
+
},
|
|
2298
|
+
matchesTypes: [
|
|
2299
|
+
"Files"
|
|
2300
|
+
]
|
|
2301
|
+
},
|
|
2302
|
+
[ht]: {
|
|
2303
|
+
exposeProperties: {
|
|
2304
|
+
html: (t, e) => he(t, e, ""),
|
|
2305
|
+
dataTransfer: (t) => t
|
|
2306
|
+
},
|
|
2307
|
+
matchesTypes: [
|
|
2308
|
+
"Html",
|
|
2309
|
+
"text/html"
|
|
2310
|
+
]
|
|
2311
|
+
},
|
|
2312
|
+
[gt]: {
|
|
2313
|
+
exposeProperties: {
|
|
2314
|
+
urls: (t, e) => he(t, e, "").split(`
|
|
2315
|
+
`),
|
|
2316
|
+
dataTransfer: (t) => t
|
|
2317
|
+
},
|
|
2318
|
+
matchesTypes: [
|
|
2319
|
+
"Url",
|
|
2320
|
+
"text/uri-list"
|
|
2321
|
+
]
|
|
2322
|
+
},
|
|
2323
|
+
[ft]: {
|
|
2324
|
+
exposeProperties: {
|
|
2325
|
+
text: (t, e) => he(t, e, ""),
|
|
2326
|
+
dataTransfer: (t) => t
|
|
2327
|
+
},
|
|
2328
|
+
matchesTypes: [
|
|
2329
|
+
"Text",
|
|
2330
|
+
"text/plain"
|
|
2331
|
+
]
|
|
2332
|
+
}
|
|
2333
|
+
};
|
|
2334
|
+
function Qn(t, e) {
|
|
2335
|
+
const r = Oe[t];
|
|
2336
|
+
if (!r)
|
|
2337
|
+
throw new Error(`native type ${t} has no configuration`);
|
|
2338
|
+
const n = new Jn(r);
|
|
2339
|
+
return n.loadDataTransfer(e), n;
|
|
2340
|
+
}
|
|
2341
|
+
function pe(t) {
|
|
2342
|
+
if (!t)
|
|
2343
|
+
return null;
|
|
2344
|
+
const e = Array.prototype.slice.call(t.types || []);
|
|
2345
|
+
return Object.keys(Oe).filter((r) => {
|
|
2346
|
+
const n = Oe[r];
|
|
2347
|
+
return n?.matchesTypes ? n.matchesTypes.some(
|
|
2348
|
+
(o) => e.indexOf(o) > -1
|
|
2349
|
+
) : !1;
|
|
2350
|
+
})[0] || null;
|
|
2351
|
+
}
|
|
2352
|
+
const Kn = lt(
|
|
2353
|
+
() => /firefox/i.test(navigator.userAgent)
|
|
2354
|
+
), pt = lt(
|
|
2355
|
+
() => !!window.safari
|
|
2356
|
+
);
|
|
2357
|
+
class qe {
|
|
2358
|
+
interpolate(e) {
|
|
2359
|
+
const { xs: r, ys: n, c1s: o, c2s: i, c3s: s } = this;
|
|
2360
|
+
let a = r.length - 1;
|
|
2361
|
+
if (e === r[a])
|
|
2362
|
+
return n[a];
|
|
2363
|
+
let u = 0, d = s.length - 1, g;
|
|
2364
|
+
for (; u <= d; ) {
|
|
2365
|
+
g = Math.floor(0.5 * (u + d));
|
|
2366
|
+
const f = r[g];
|
|
2367
|
+
if (f < e)
|
|
2368
|
+
u = g + 1;
|
|
2369
|
+
else if (f > e)
|
|
2370
|
+
d = g - 1;
|
|
2371
|
+
else
|
|
2372
|
+
return n[g];
|
|
2373
|
+
}
|
|
2374
|
+
a = Math.max(0, d);
|
|
2375
|
+
const y = e - r[a], v = y * y;
|
|
2376
|
+
return n[a] + o[a] * y + i[a] * v + s[a] * y * v;
|
|
2377
|
+
}
|
|
2378
|
+
constructor(e, r) {
|
|
2379
|
+
const { length: n } = e, o = [];
|
|
2380
|
+
for (let f = 0; f < n; f++)
|
|
2381
|
+
o.push(f);
|
|
2382
|
+
o.sort(
|
|
2383
|
+
(f, p) => e[f] < e[p] ? -1 : 1
|
|
2384
|
+
);
|
|
2385
|
+
const i = [], s = [];
|
|
2386
|
+
let a, u;
|
|
2387
|
+
for (let f = 0; f < n - 1; f++)
|
|
2388
|
+
a = e[f + 1] - e[f], u = r[f + 1] - r[f], i.push(a), s.push(u / a);
|
|
2389
|
+
const d = [
|
|
2390
|
+
s[0]
|
|
2391
|
+
];
|
|
2392
|
+
for (let f = 0; f < i.length - 1; f++) {
|
|
2393
|
+
const p = s[f], h = s[f + 1];
|
|
2394
|
+
if (p * h <= 0)
|
|
2395
|
+
d.push(0);
|
|
2396
|
+
else {
|
|
2397
|
+
a = i[f];
|
|
2398
|
+
const O = i[f + 1], m = a + O;
|
|
2399
|
+
d.push(3 * m / ((m + O) / p + (m + a) / h));
|
|
2400
|
+
}
|
|
2401
|
+
}
|
|
2402
|
+
d.push(s[s.length - 1]);
|
|
2403
|
+
const g = [], y = [];
|
|
2404
|
+
let v;
|
|
2405
|
+
for (let f = 0; f < d.length - 1; f++) {
|
|
2406
|
+
v = s[f];
|
|
2407
|
+
const p = d[f], h = 1 / i[f], O = p + d[f + 1] - v - v;
|
|
2408
|
+
g.push((v - p - O) * h), y.push(O * h * h);
|
|
2409
|
+
}
|
|
2410
|
+
this.xs = e, this.ys = r, this.c1s = d, this.c2s = g, this.c3s = y;
|
|
2411
|
+
}
|
|
2412
|
+
}
|
|
2413
|
+
const eo = 1;
|
|
2414
|
+
function mt(t) {
|
|
2415
|
+
const e = t.nodeType === eo ? t : t.parentElement;
|
|
2416
|
+
if (!e)
|
|
2417
|
+
return null;
|
|
2418
|
+
const { top: r, left: n } = e.getBoundingClientRect();
|
|
2419
|
+
return {
|
|
2420
|
+
x: n,
|
|
2421
|
+
y: r
|
|
2422
|
+
};
|
|
2423
|
+
}
|
|
2424
|
+
function Q(t) {
|
|
2425
|
+
return {
|
|
2426
|
+
x: t.clientX,
|
|
2427
|
+
y: t.clientY
|
|
2428
|
+
};
|
|
2429
|
+
}
|
|
2430
|
+
function to(t) {
|
|
2431
|
+
var e;
|
|
2432
|
+
return t.nodeName === "IMG" && (Kn() || !(!((e = document.documentElement) === null || e === void 0) && e.contains(t)));
|
|
2433
|
+
}
|
|
2434
|
+
function ro(t, e, r, n) {
|
|
2435
|
+
let o = t ? e.width : r, i = t ? e.height : n;
|
|
2436
|
+
return pt() && t && (i /= window.devicePixelRatio, o /= window.devicePixelRatio), {
|
|
2437
|
+
dragPreviewWidth: o,
|
|
2438
|
+
dragPreviewHeight: i
|
|
2439
|
+
};
|
|
2440
|
+
}
|
|
2441
|
+
function no(t, e, r, n, o) {
|
|
2442
|
+
const i = to(e), a = mt(i ? t : e), u = {
|
|
2443
|
+
x: r.x - a.x,
|
|
2444
|
+
y: r.y - a.y
|
|
2445
|
+
}, { offsetWidth: d, offsetHeight: g } = t, { anchorX: y, anchorY: v } = n, { dragPreviewWidth: f, dragPreviewHeight: p } = ro(i, e, d, g), h = () => {
|
|
2446
|
+
let N = new qe([
|
|
2447
|
+
0,
|
|
2448
|
+
0.5,
|
|
2449
|
+
1
|
|
2450
|
+
], [
|
|
2451
|
+
// Dock to the top
|
|
2452
|
+
u.y,
|
|
2453
|
+
// Align at the center
|
|
2454
|
+
u.y / g * p,
|
|
2455
|
+
// Dock to the bottom
|
|
2456
|
+
u.y + p - g
|
|
2457
|
+
]).interpolate(v);
|
|
2458
|
+
return pt() && i && (N += (window.devicePixelRatio - 1) * p), N;
|
|
2459
|
+
}, O = () => new qe([
|
|
2460
|
+
0,
|
|
2461
|
+
0.5,
|
|
2462
|
+
1
|
|
2463
|
+
], [
|
|
2464
|
+
// Dock to the left
|
|
2465
|
+
u.x,
|
|
2466
|
+
// Align at the center
|
|
2467
|
+
u.x / d * f,
|
|
2468
|
+
// Dock to the right
|
|
2469
|
+
u.x + f - d
|
|
2470
|
+
]).interpolate(y), { offsetX: m, offsetY: l } = o, S = m === 0 || m, b = l === 0 || l;
|
|
2471
|
+
return {
|
|
2472
|
+
x: S ? m : O(),
|
|
2473
|
+
y: b ? l : h()
|
|
2474
|
+
};
|
|
2475
|
+
}
|
|
2476
|
+
class oo {
|
|
2477
|
+
get window() {
|
|
2478
|
+
if (this.globalContext)
|
|
2479
|
+
return this.globalContext;
|
|
2480
|
+
if (typeof window < "u")
|
|
2481
|
+
return window;
|
|
2482
|
+
}
|
|
2483
|
+
get document() {
|
|
2484
|
+
var e;
|
|
2485
|
+
return !((e = this.globalContext) === null || e === void 0) && e.document ? this.globalContext.document : this.window ? this.window.document : void 0;
|
|
2486
|
+
}
|
|
2487
|
+
get rootElement() {
|
|
2488
|
+
var e;
|
|
2489
|
+
return ((e = this.optionsArgs) === null || e === void 0 ? void 0 : e.rootElement) || this.window;
|
|
2490
|
+
}
|
|
2491
|
+
constructor(e, r) {
|
|
2492
|
+
this.ownerDocument = null, this.globalContext = e, this.optionsArgs = r;
|
|
2493
|
+
}
|
|
2494
|
+
}
|
|
2495
|
+
function io(t, e, r) {
|
|
2496
|
+
return e in t ? Object.defineProperty(t, e, {
|
|
2497
|
+
value: r,
|
|
2498
|
+
enumerable: !0,
|
|
2499
|
+
configurable: !0,
|
|
2500
|
+
writable: !0
|
|
2501
|
+
}) : t[e] = r, t;
|
|
2502
|
+
}
|
|
2503
|
+
function Ge(t) {
|
|
2504
|
+
for (var e = 1; e < arguments.length; e++) {
|
|
2505
|
+
var r = arguments[e] != null ? arguments[e] : {}, n = Object.keys(r);
|
|
2506
|
+
typeof Object.getOwnPropertySymbols == "function" && (n = n.concat(Object.getOwnPropertySymbols(r).filter(function(o) {
|
|
2507
|
+
return Object.getOwnPropertyDescriptor(r, o).enumerable;
|
|
2508
|
+
}))), n.forEach(function(o) {
|
|
2509
|
+
io(t, o, r[o]);
|
|
2510
|
+
});
|
|
2511
|
+
}
|
|
2512
|
+
return t;
|
|
2513
|
+
}
|
|
2514
|
+
class so {
|
|
2515
|
+
/**
|
|
2516
|
+
* Generate profiling statistics for the HTML5Backend.
|
|
2517
|
+
*/
|
|
2518
|
+
profile() {
|
|
2519
|
+
var e, r;
|
|
2520
|
+
return {
|
|
2521
|
+
sourcePreviewNodes: this.sourcePreviewNodes.size,
|
|
2522
|
+
sourcePreviewNodeOptions: this.sourcePreviewNodeOptions.size,
|
|
2523
|
+
sourceNodeOptions: this.sourceNodeOptions.size,
|
|
2524
|
+
sourceNodes: this.sourceNodes.size,
|
|
2525
|
+
dragStartSourceIds: ((e = this.dragStartSourceIds) === null || e === void 0 ? void 0 : e.length) || 0,
|
|
2526
|
+
dropTargetIds: this.dropTargetIds.length,
|
|
2527
|
+
dragEnterTargetIds: this.dragEnterTargetIds.length,
|
|
2528
|
+
dragOverTargetIds: ((r = this.dragOverTargetIds) === null || r === void 0 ? void 0 : r.length) || 0
|
|
2529
|
+
};
|
|
2530
|
+
}
|
|
2531
|
+
// public for test
|
|
2532
|
+
get window() {
|
|
2533
|
+
return this.options.window;
|
|
2534
|
+
}
|
|
2535
|
+
get document() {
|
|
2536
|
+
return this.options.document;
|
|
2537
|
+
}
|
|
2538
|
+
/**
|
|
2539
|
+
* Get the root element to use for event subscriptions
|
|
2540
|
+
*/
|
|
2541
|
+
get rootElement() {
|
|
2542
|
+
return this.options.rootElement;
|
|
2543
|
+
}
|
|
2544
|
+
setup() {
|
|
2545
|
+
const e = this.rootElement;
|
|
2546
|
+
if (e !== void 0) {
|
|
2547
|
+
if (e.__isReactDndBackendSetUp)
|
|
2548
|
+
throw new Error("Cannot have two HTML5 backends at the same time.");
|
|
2549
|
+
e.__isReactDndBackendSetUp = !0, this.addEventListeners(e);
|
|
2550
|
+
}
|
|
2551
|
+
}
|
|
2552
|
+
teardown() {
|
|
2553
|
+
const e = this.rootElement;
|
|
2554
|
+
if (e !== void 0 && (e.__isReactDndBackendSetUp = !1, this.removeEventListeners(this.rootElement), this.clearCurrentDragSourceNode(), this.asyncEndDragFrameId)) {
|
|
2555
|
+
var r;
|
|
2556
|
+
(r = this.window) === null || r === void 0 || r.cancelAnimationFrame(this.asyncEndDragFrameId);
|
|
2557
|
+
}
|
|
2558
|
+
}
|
|
2559
|
+
connectDragPreview(e, r, n) {
|
|
2560
|
+
return this.sourcePreviewNodeOptions.set(e, n), this.sourcePreviewNodes.set(e, r), () => {
|
|
2561
|
+
this.sourcePreviewNodes.delete(e), this.sourcePreviewNodeOptions.delete(e);
|
|
2562
|
+
};
|
|
2563
|
+
}
|
|
2564
|
+
connectDragSource(e, r, n) {
|
|
2565
|
+
this.sourceNodes.set(e, r), this.sourceNodeOptions.set(e, n);
|
|
2566
|
+
const o = (s) => this.handleDragStart(s, e), i = (s) => this.handleSelectStart(s);
|
|
2567
|
+
return r.setAttribute("draggable", "true"), r.addEventListener("dragstart", o), r.addEventListener("selectstart", i), () => {
|
|
2568
|
+
this.sourceNodes.delete(e), this.sourceNodeOptions.delete(e), r.removeEventListener("dragstart", o), r.removeEventListener("selectstart", i), r.setAttribute("draggable", "false");
|
|
2569
|
+
};
|
|
2570
|
+
}
|
|
2571
|
+
connectDropTarget(e, r) {
|
|
2572
|
+
const n = (s) => this.handleDragEnter(s, e), o = (s) => this.handleDragOver(s, e), i = (s) => this.handleDrop(s, e);
|
|
2573
|
+
return r.addEventListener("dragenter", n), r.addEventListener("dragover", o), r.addEventListener("drop", i), () => {
|
|
2574
|
+
r.removeEventListener("dragenter", n), r.removeEventListener("dragover", o), r.removeEventListener("drop", i);
|
|
2575
|
+
};
|
|
2576
|
+
}
|
|
2577
|
+
addEventListeners(e) {
|
|
2578
|
+
e.addEventListener && (e.addEventListener("dragstart", this.handleTopDragStart), e.addEventListener("dragstart", this.handleTopDragStartCapture, !0), e.addEventListener("dragend", this.handleTopDragEndCapture, !0), e.addEventListener("dragenter", this.handleTopDragEnter), e.addEventListener("dragenter", this.handleTopDragEnterCapture, !0), e.addEventListener("dragleave", this.handleTopDragLeaveCapture, !0), e.addEventListener("dragover", this.handleTopDragOver), e.addEventListener("dragover", this.handleTopDragOverCapture, !0), e.addEventListener("drop", this.handleTopDrop), e.addEventListener("drop", this.handleTopDropCapture, !0));
|
|
2579
|
+
}
|
|
2580
|
+
removeEventListeners(e) {
|
|
2581
|
+
e.removeEventListener && (e.removeEventListener("dragstart", this.handleTopDragStart), e.removeEventListener("dragstart", this.handleTopDragStartCapture, !0), e.removeEventListener("dragend", this.handleTopDragEndCapture, !0), e.removeEventListener("dragenter", this.handleTopDragEnter), e.removeEventListener("dragenter", this.handleTopDragEnterCapture, !0), e.removeEventListener("dragleave", this.handleTopDragLeaveCapture, !0), e.removeEventListener("dragover", this.handleTopDragOver), e.removeEventListener("dragover", this.handleTopDragOverCapture, !0), e.removeEventListener("drop", this.handleTopDrop), e.removeEventListener("drop", this.handleTopDropCapture, !0));
|
|
2582
|
+
}
|
|
2583
|
+
getCurrentSourceNodeOptions() {
|
|
2584
|
+
const e = this.monitor.getSourceId(), r = this.sourceNodeOptions.get(e);
|
|
2585
|
+
return Ge({
|
|
2586
|
+
dropEffect: this.altKeyPressed ? "copy" : "move"
|
|
2587
|
+
}, r || {});
|
|
2588
|
+
}
|
|
2589
|
+
getCurrentDropEffect() {
|
|
2590
|
+
return this.isDraggingNativeItem() ? "copy" : this.getCurrentSourceNodeOptions().dropEffect;
|
|
2591
|
+
}
|
|
2592
|
+
getCurrentSourcePreviewNodeOptions() {
|
|
2593
|
+
const e = this.monitor.getSourceId(), r = this.sourcePreviewNodeOptions.get(e);
|
|
2594
|
+
return Ge({
|
|
2595
|
+
anchorX: 0.5,
|
|
2596
|
+
anchorY: 0.5,
|
|
2597
|
+
captureDraggingState: !1
|
|
2598
|
+
}, r || {});
|
|
2599
|
+
}
|
|
2600
|
+
isDraggingNativeItem() {
|
|
2601
|
+
const e = this.monitor.getItemType();
|
|
2602
|
+
return Object.keys(ze).some(
|
|
2603
|
+
(r) => ze[r] === e
|
|
2604
|
+
);
|
|
2605
|
+
}
|
|
2606
|
+
beginDragNativeItem(e, r) {
|
|
2607
|
+
this.clearCurrentDragSourceNode(), this.currentNativeSource = Qn(e, r), this.currentNativeHandle = this.registry.addSource(e, this.currentNativeSource), this.actions.beginDrag([
|
|
2608
|
+
this.currentNativeHandle
|
|
2609
|
+
]);
|
|
2610
|
+
}
|
|
2611
|
+
setCurrentDragSourceNode(e) {
|
|
2612
|
+
this.clearCurrentDragSourceNode(), this.currentDragSourceNode = e;
|
|
2613
|
+
const r = 1e3;
|
|
2614
|
+
this.mouseMoveTimeoutTimer = setTimeout(() => {
|
|
2615
|
+
var n;
|
|
2616
|
+
return (n = this.rootElement) === null || n === void 0 ? void 0 : n.addEventListener("mousemove", this.endDragIfSourceWasRemovedFromDOM, !0);
|
|
2617
|
+
}, r);
|
|
2618
|
+
}
|
|
2619
|
+
clearCurrentDragSourceNode() {
|
|
2620
|
+
if (this.currentDragSourceNode) {
|
|
2621
|
+
if (this.currentDragSourceNode = null, this.rootElement) {
|
|
2622
|
+
var e;
|
|
2623
|
+
(e = this.window) === null || e === void 0 || e.clearTimeout(this.mouseMoveTimeoutTimer || void 0), this.rootElement.removeEventListener("mousemove", this.endDragIfSourceWasRemovedFromDOM, !0);
|
|
2624
|
+
}
|
|
2625
|
+
return this.mouseMoveTimeoutTimer = null, !0;
|
|
2626
|
+
}
|
|
2627
|
+
return !1;
|
|
2628
|
+
}
|
|
2629
|
+
handleDragStart(e, r) {
|
|
2630
|
+
e.defaultPrevented || (this.dragStartSourceIds || (this.dragStartSourceIds = []), this.dragStartSourceIds.unshift(r));
|
|
2631
|
+
}
|
|
2632
|
+
handleDragEnter(e, r) {
|
|
2633
|
+
this.dragEnterTargetIds.unshift(r);
|
|
2634
|
+
}
|
|
2635
|
+
handleDragOver(e, r) {
|
|
2636
|
+
this.dragOverTargetIds === null && (this.dragOverTargetIds = []), this.dragOverTargetIds.unshift(r);
|
|
2637
|
+
}
|
|
2638
|
+
handleDrop(e, r) {
|
|
2639
|
+
this.dropTargetIds.unshift(r);
|
|
2640
|
+
}
|
|
2641
|
+
constructor(e, r, n) {
|
|
2642
|
+
this.sourcePreviewNodes = /* @__PURE__ */ new Map(), this.sourcePreviewNodeOptions = /* @__PURE__ */ new Map(), this.sourceNodes = /* @__PURE__ */ new Map(), this.sourceNodeOptions = /* @__PURE__ */ new Map(), this.dragStartSourceIds = null, this.dropTargetIds = [], this.dragEnterTargetIds = [], this.currentNativeSource = null, this.currentNativeHandle = null, this.currentDragSourceNode = null, this.altKeyPressed = !1, this.mouseMoveTimeoutTimer = null, this.asyncEndDragFrameId = null, this.dragOverTargetIds = null, this.lastClientOffset = null, this.hoverRafId = null, this.getSourceClientOffset = (o) => {
|
|
2643
|
+
const i = this.sourceNodes.get(o);
|
|
2644
|
+
return i && mt(i) || null;
|
|
2645
|
+
}, this.endDragNativeItem = () => {
|
|
2646
|
+
this.isDraggingNativeItem() && (this.actions.endDrag(), this.currentNativeHandle && this.registry.removeSource(this.currentNativeHandle), this.currentNativeHandle = null, this.currentNativeSource = null);
|
|
2647
|
+
}, this.isNodeInDocument = (o) => !!(o && this.document && this.document.body && this.document.body.contains(o)), this.endDragIfSourceWasRemovedFromDOM = () => {
|
|
2648
|
+
const o = this.currentDragSourceNode;
|
|
2649
|
+
o == null || this.isNodeInDocument(o) || (this.clearCurrentDragSourceNode() && this.monitor.isDragging() && this.actions.endDrag(), this.cancelHover());
|
|
2650
|
+
}, this.scheduleHover = (o) => {
|
|
2651
|
+
this.hoverRafId === null && typeof requestAnimationFrame < "u" && (this.hoverRafId = requestAnimationFrame(() => {
|
|
2652
|
+
this.monitor.isDragging() && this.actions.hover(o || [], {
|
|
2653
|
+
clientOffset: this.lastClientOffset
|
|
2654
|
+
}), this.hoverRafId = null;
|
|
2655
|
+
}));
|
|
2656
|
+
}, this.cancelHover = () => {
|
|
2657
|
+
this.hoverRafId !== null && typeof cancelAnimationFrame < "u" && (cancelAnimationFrame(this.hoverRafId), this.hoverRafId = null);
|
|
2658
|
+
}, this.handleTopDragStartCapture = () => {
|
|
2659
|
+
this.clearCurrentDragSourceNode(), this.dragStartSourceIds = [];
|
|
2660
|
+
}, this.handleTopDragStart = (o) => {
|
|
2661
|
+
if (o.defaultPrevented)
|
|
2662
|
+
return;
|
|
2663
|
+
const { dragStartSourceIds: i } = this;
|
|
2664
|
+
this.dragStartSourceIds = null;
|
|
2665
|
+
const s = Q(o);
|
|
2666
|
+
this.monitor.isDragging() && (this.actions.endDrag(), this.cancelHover()), this.actions.beginDrag(i || [], {
|
|
2667
|
+
publishSource: !1,
|
|
2668
|
+
getSourceClientOffset: this.getSourceClientOffset,
|
|
2669
|
+
clientOffset: s
|
|
2670
|
+
});
|
|
2671
|
+
const { dataTransfer: a } = o, u = pe(a);
|
|
2672
|
+
if (this.monitor.isDragging()) {
|
|
2673
|
+
if (a && typeof a.setDragImage == "function") {
|
|
2674
|
+
const g = this.monitor.getSourceId(), y = this.sourceNodes.get(g), v = this.sourcePreviewNodes.get(g) || y;
|
|
2675
|
+
if (v) {
|
|
2676
|
+
const { anchorX: f, anchorY: p, offsetX: h, offsetY: O } = this.getCurrentSourcePreviewNodeOptions(), S = no(y, v, s, {
|
|
2677
|
+
anchorX: f,
|
|
2678
|
+
anchorY: p
|
|
2679
|
+
}, {
|
|
2680
|
+
offsetX: h,
|
|
2681
|
+
offsetY: O
|
|
2682
|
+
});
|
|
2683
|
+
a.setDragImage(v, S.x, S.y);
|
|
2684
|
+
}
|
|
2685
|
+
}
|
|
2686
|
+
try {
|
|
2687
|
+
a?.setData("application/json", {});
|
|
2688
|
+
} catch {
|
|
2689
|
+
}
|
|
2690
|
+
this.setCurrentDragSourceNode(o.target);
|
|
2691
|
+
const { captureDraggingState: d } = this.getCurrentSourcePreviewNodeOptions();
|
|
2692
|
+
d ? this.actions.publishDragSource() : setTimeout(
|
|
2693
|
+
() => this.actions.publishDragSource(),
|
|
2694
|
+
0
|
|
2695
|
+
);
|
|
2696
|
+
} else if (u)
|
|
2697
|
+
this.beginDragNativeItem(u);
|
|
2698
|
+
else {
|
|
2699
|
+
if (a && !a.types && (o.target && !o.target.hasAttribute || !o.target.hasAttribute("draggable")))
|
|
2700
|
+
return;
|
|
2701
|
+
o.preventDefault();
|
|
2702
|
+
}
|
|
2703
|
+
}, this.handleTopDragEndCapture = () => {
|
|
2704
|
+
this.clearCurrentDragSourceNode() && this.monitor.isDragging() && this.actions.endDrag(), this.cancelHover();
|
|
2705
|
+
}, this.handleTopDragEnterCapture = (o) => {
|
|
2706
|
+
if (this.dragEnterTargetIds = [], this.isDraggingNativeItem()) {
|
|
2707
|
+
var i;
|
|
2708
|
+
(i = this.currentNativeSource) === null || i === void 0 || i.loadDataTransfer(o.dataTransfer);
|
|
2709
|
+
}
|
|
2710
|
+
if (!this.enterLeaveCounter.enter(o.target) || this.monitor.isDragging())
|
|
2711
|
+
return;
|
|
2712
|
+
const { dataTransfer: a } = o, u = pe(a);
|
|
2713
|
+
u && this.beginDragNativeItem(u, a);
|
|
2714
|
+
}, this.handleTopDragEnter = (o) => {
|
|
2715
|
+
const { dragEnterTargetIds: i } = this;
|
|
2716
|
+
if (this.dragEnterTargetIds = [], !this.monitor.isDragging())
|
|
2717
|
+
return;
|
|
2718
|
+
this.altKeyPressed = o.altKey, i.length > 0 && this.actions.hover(i, {
|
|
2719
|
+
clientOffset: Q(o)
|
|
2720
|
+
}), i.some(
|
|
2721
|
+
(a) => this.monitor.canDropOnTarget(a)
|
|
2722
|
+
) && (o.preventDefault(), o.dataTransfer && (o.dataTransfer.dropEffect = this.getCurrentDropEffect()));
|
|
2723
|
+
}, this.handleTopDragOverCapture = (o) => {
|
|
2724
|
+
if (this.dragOverTargetIds = [], this.isDraggingNativeItem()) {
|
|
2725
|
+
var i;
|
|
2726
|
+
(i = this.currentNativeSource) === null || i === void 0 || i.loadDataTransfer(o.dataTransfer);
|
|
2727
|
+
}
|
|
2728
|
+
}, this.handleTopDragOver = (o) => {
|
|
2729
|
+
const { dragOverTargetIds: i } = this;
|
|
2730
|
+
if (this.dragOverTargetIds = [], !this.monitor.isDragging()) {
|
|
2731
|
+
o.preventDefault(), o.dataTransfer && (o.dataTransfer.dropEffect = "none");
|
|
2732
|
+
return;
|
|
2733
|
+
}
|
|
2734
|
+
this.altKeyPressed = o.altKey, this.lastClientOffset = Q(o), this.scheduleHover(i), (i || []).some(
|
|
2735
|
+
(a) => this.monitor.canDropOnTarget(a)
|
|
2736
|
+
) ? (o.preventDefault(), o.dataTransfer && (o.dataTransfer.dropEffect = this.getCurrentDropEffect())) : this.isDraggingNativeItem() ? o.preventDefault() : (o.preventDefault(), o.dataTransfer && (o.dataTransfer.dropEffect = "none"));
|
|
2737
|
+
}, this.handleTopDragLeaveCapture = (o) => {
|
|
2738
|
+
this.isDraggingNativeItem() && o.preventDefault(), this.enterLeaveCounter.leave(o.target) && (this.isDraggingNativeItem() && setTimeout(
|
|
2739
|
+
() => this.endDragNativeItem(),
|
|
2740
|
+
0
|
|
2741
|
+
), this.cancelHover());
|
|
2742
|
+
}, this.handleTopDropCapture = (o) => {
|
|
2743
|
+
if (this.dropTargetIds = [], this.isDraggingNativeItem()) {
|
|
2744
|
+
var i;
|
|
2745
|
+
o.preventDefault(), (i = this.currentNativeSource) === null || i === void 0 || i.loadDataTransfer(o.dataTransfer);
|
|
2746
|
+
} else pe(o.dataTransfer) && o.preventDefault();
|
|
2747
|
+
this.enterLeaveCounter.reset();
|
|
2748
|
+
}, this.handleTopDrop = (o) => {
|
|
2749
|
+
const { dropTargetIds: i } = this;
|
|
2750
|
+
this.dropTargetIds = [], this.actions.hover(i, {
|
|
2751
|
+
clientOffset: Q(o)
|
|
2752
|
+
}), this.actions.drop({
|
|
2753
|
+
dropEffect: this.getCurrentDropEffect()
|
|
2754
|
+
}), this.isDraggingNativeItem() ? this.endDragNativeItem() : this.monitor.isDragging() && this.actions.endDrag(), this.cancelHover();
|
|
2755
|
+
}, this.handleSelectStart = (o) => {
|
|
2756
|
+
const i = o.target;
|
|
2757
|
+
typeof i.dragDrop == "function" && (i.tagName === "INPUT" || i.tagName === "SELECT" || i.tagName === "TEXTAREA" || i.isContentEditable || (o.preventDefault(), i.dragDrop()));
|
|
2758
|
+
}, this.options = new oo(r, n), this.actions = e.getActions(), this.monitor = e.getMonitor(), this.registry = e.getRegistry(), this.enterLeaveCounter = new Zn(this.isNodeInDocument);
|
|
2759
|
+
}
|
|
2760
|
+
}
|
|
2761
|
+
const ao = function(e, r, n) {
|
|
2762
|
+
return new so(e, r, n);
|
|
2763
|
+
}, co = [
|
|
2764
|
+
".pdf",
|
|
2765
|
+
".xlsx",
|
|
2766
|
+
".xls",
|
|
2767
|
+
".docx",
|
|
2768
|
+
".doc",
|
|
2769
|
+
".pptx",
|
|
2770
|
+
".ppt",
|
|
2771
|
+
".hwp",
|
|
2772
|
+
".txt",
|
|
2773
|
+
".csv",
|
|
2774
|
+
// 이미지
|
|
2775
|
+
".jpg",
|
|
2776
|
+
".jpeg",
|
|
2777
|
+
".png",
|
|
2778
|
+
".gif",
|
|
2779
|
+
// 압축
|
|
2780
|
+
".zip"
|
|
2781
|
+
], Xe = {
|
|
2782
|
+
FILE: "file"
|
|
2783
|
+
}, uo = ({
|
|
2784
|
+
originNode: t,
|
|
2785
|
+
file: e,
|
|
2786
|
+
fileList: r,
|
|
2787
|
+
moveFile: n,
|
|
2788
|
+
onDrop: o
|
|
2789
|
+
}) => {
|
|
2790
|
+
const i = re(null), [{ handlerId: s }, a] = Gn({
|
|
2791
|
+
accept: Xe.FILE,
|
|
2792
|
+
collect(y) {
|
|
2793
|
+
return {
|
|
2794
|
+
handlerId: y.getHandlerId()
|
|
2795
|
+
};
|
|
2796
|
+
},
|
|
2797
|
+
hover(y, v) {
|
|
2798
|
+
if (!i.current)
|
|
2799
|
+
return;
|
|
2800
|
+
const f = y.uid, p = e.uid;
|
|
2801
|
+
if (f === p)
|
|
2802
|
+
return;
|
|
2803
|
+
const h = W(r, { uid: p }), O = W(r, { uid: f });
|
|
2804
|
+
if (O === -1 || h === -1)
|
|
2805
|
+
return;
|
|
2806
|
+
const m = i.current?.getBoundingClientRect(), l = (m.bottom - m.top) / 2, b = v.getClientOffset().y - m.top;
|
|
2807
|
+
O < h && b < l || O > h && b > l || n(f, p);
|
|
2808
|
+
},
|
|
2809
|
+
drop() {
|
|
2810
|
+
o();
|
|
2811
|
+
}
|
|
2812
|
+
}), [{ isDragging: u }, d] = An({
|
|
2813
|
+
type: Xe.FILE,
|
|
2814
|
+
item: () => ({
|
|
2815
|
+
uid: e.uid,
|
|
2816
|
+
index: W(r, { uid: e.uid })
|
|
2817
|
+
}),
|
|
2818
|
+
collect: (y) => ({
|
|
2819
|
+
isDragging: y.isDragging()
|
|
2820
|
+
})
|
|
2821
|
+
}), g = u ? 0 : 1;
|
|
2822
|
+
return d(a(i)), /* @__PURE__ */ c.jsx("div", { ref: i, style: { opacity: g }, "data-handler-id": s, children: t });
|
|
2823
|
+
}, Ao = ({
|
|
2824
|
+
fileGrpKey: t,
|
|
2825
|
+
onUploadComplete: e,
|
|
2826
|
+
onFetchFilesTrxCd: r = "SCMFILE00101",
|
|
2827
|
+
onSuccessTrxCd: n = "SCMFILE00102",
|
|
2828
|
+
onDeleteFileTrxCd: o = "SCMFILE00103",
|
|
2829
|
+
onReorderFilesTrxCd: i = "SCMFILE00104",
|
|
2830
|
+
allowedExtensions: s = co,
|
|
2831
|
+
maxFileSize: a = 200
|
|
2832
|
+
}) => {
|
|
2833
|
+
const [u, d] = F([]);
|
|
2834
|
+
Y(() => {
|
|
2835
|
+
t && r && z(r, {
|
|
2836
|
+
crprCd: $().crprCd,
|
|
2837
|
+
sysCd: __SYS_CD__,
|
|
2838
|
+
fileGrpKey: t
|
|
2839
|
+
}).then((p) => {
|
|
2840
|
+
if (p?.sub) {
|
|
2841
|
+
const h = p.sub.map((O) => ({
|
|
2842
|
+
uid: O.fileKey,
|
|
2843
|
+
name: O.lgclFileNm,
|
|
2844
|
+
status: "done",
|
|
2845
|
+
url: `/api/download?filePath=${O.filePath}&logicalName=${O.lgclFileNm}`
|
|
2846
|
+
}));
|
|
2847
|
+
d(h);
|
|
2848
|
+
}
|
|
2849
|
+
}).catch((p) => {
|
|
2850
|
+
console.error("파일 목록 조회 서비스 호출에 실패했습니다.", p), C.error("파일 목록을 불러오는 중 오류가 발생했습니다.");
|
|
2851
|
+
});
|
|
2852
|
+
}, [t, r]);
|
|
2853
|
+
const g = (p, h) => {
|
|
2854
|
+
const O = W(u, { uid: p }), m = W(u, { uid: h });
|
|
2855
|
+
if (O < 0 || m < 0) return;
|
|
2856
|
+
const l = [...u], [S] = l.splice(O, 1);
|
|
2857
|
+
l.splice(m, 0, S), d(l);
|
|
2858
|
+
}, y = () => {
|
|
2859
|
+
if (t && i) {
|
|
2860
|
+
const p = u.map((h) => h.uid);
|
|
2861
|
+
z(i, {
|
|
2862
|
+
crprCd: $().crprCd,
|
|
2863
|
+
sysCd: __SYS_CD__,
|
|
2864
|
+
fileGrpKey: t,
|
|
2865
|
+
reorderedFileKeys: p
|
|
2866
|
+
}).then(() => {
|
|
2867
|
+
C.success("파일 순서가 성공적으로 저장되었습니다.");
|
|
2868
|
+
}).catch((h) => {
|
|
2869
|
+
console.error("파일 순서 저장 서비스 호출 실패:", h), C.error("파일 순서 저장 중 오류가 발생했습니다.");
|
|
2870
|
+
});
|
|
2871
|
+
}
|
|
2872
|
+
}, f = {
|
|
2873
|
+
name: "file",
|
|
2874
|
+
multiple: !0,
|
|
2875
|
+
action: "/api/upload",
|
|
2876
|
+
fileList: u,
|
|
2877
|
+
beforeUpload: (p) => {
|
|
2878
|
+
if (s && s.length > 0) {
|
|
2879
|
+
const h = `.${p.name.split(".").pop()?.toLowerCase()}`;
|
|
2880
|
+
if (!s.includes(h))
|
|
2881
|
+
return C.error(
|
|
2882
|
+
`${p.name} 파일은 허용되지 않는 확장자입니다. (${s.join(
|
|
2883
|
+
", "
|
|
2884
|
+
)})`
|
|
2885
|
+
), H.LIST_IGNORE;
|
|
2886
|
+
}
|
|
2887
|
+
return a && !(p.size / 1024 / 1024 < a) ? (C.error(`일반업로드의 최대용량은 ${a}MB입니다.`), H.LIST_IGNORE) : !0;
|
|
2888
|
+
},
|
|
2889
|
+
onChange(p) {
|
|
2890
|
+
const { status: h, uid: O } = p.file;
|
|
2891
|
+
if (h === "removed") {
|
|
2892
|
+
o ? z(o, {
|
|
2893
|
+
crprCd: $().crprCd,
|
|
2894
|
+
sysCd: __SYS_CD__,
|
|
2895
|
+
fileGrpKey: t,
|
|
2896
|
+
fileKey: O
|
|
2897
|
+
}).then(() => {
|
|
2898
|
+
C.success("파일이 성공적으로 삭제되었습니다."), d(p.fileList);
|
|
2899
|
+
}).catch((l) => {
|
|
2900
|
+
console.error("파일 삭제 서비스 호출에 실패했습니다.", l), C.error("파일 삭제 중 오류가 발생했습니다.");
|
|
2901
|
+
}) : d(p.fileList);
|
|
2902
|
+
return;
|
|
2903
|
+
}
|
|
2904
|
+
let m = [...p.fileList];
|
|
2905
|
+
if (h === "done")
|
|
2906
|
+
if (p.file.response?.success) {
|
|
2907
|
+
const { uploadedFiles: l } = p.file.response;
|
|
2908
|
+
l && Array.isArray(l) && l.length > 0 && l.forEach((S) => {
|
|
2909
|
+
n ? z(n, {
|
|
2910
|
+
crprCd: $().crprCd,
|
|
2911
|
+
sysCd: __SYS_CD__,
|
|
2912
|
+
fileGrpKey: t,
|
|
2913
|
+
sub: [
|
|
2914
|
+
{
|
|
2915
|
+
crprCd: $().crprCd,
|
|
2916
|
+
sysCd: __SYS_CD__,
|
|
2917
|
+
fileGrpKey: t,
|
|
2918
|
+
physFileNm: S.fileNameP,
|
|
2919
|
+
lgclFileNm: S.fileNameL,
|
|
2920
|
+
filePath: S.filePath,
|
|
2921
|
+
fileExtn: S.fileExt,
|
|
2922
|
+
fileSize: S.fileSize,
|
|
2923
|
+
mltpYn: "N"
|
|
2924
|
+
}
|
|
2925
|
+
]
|
|
2926
|
+
}).then((b) => {
|
|
2927
|
+
b?.sub && b.sub.length > 0 && d(
|
|
2928
|
+
(x) => x.map((N) => N.uid === p.file.uid ? {
|
|
2929
|
+
...N,
|
|
2930
|
+
uid: b.sub[0].fileKey,
|
|
2931
|
+
status: "done",
|
|
2932
|
+
url: `/api/download?filePath=${S.filePath}&logicalName=${S.fileNameL}`
|
|
2933
|
+
} : N)
|
|
2934
|
+
);
|
|
2935
|
+
}).catch((b) => {
|
|
2936
|
+
console.error("업로드 후처리 서비스 호출 실패:", b), C.error("파일 후처리 중 오류가 발생했습니다.");
|
|
2937
|
+
}) : m = m.map((b) => b.uid === p.file.uid ? {
|
|
2938
|
+
...b,
|
|
2939
|
+
uid: S.fileNameP,
|
|
2940
|
+
status: "done",
|
|
2941
|
+
url: `/api/download?filePath=${S.filePath}&logicalName=${S.fileNameL}`
|
|
2942
|
+
} : b), e && e({ ...S });
|
|
2943
|
+
}), C.success(
|
|
2944
|
+
p.file.response.message || `${p.file.name} 파일이 성공적으로 업로드되었습니다.`
|
|
2945
|
+
);
|
|
2946
|
+
} else
|
|
2947
|
+
C.error(
|
|
2948
|
+
p.file.response?.message || `${p.file.name} 파일 업로드에 실패했습니다.`
|
|
2949
|
+
);
|
|
2950
|
+
else h === "error" && C.error(
|
|
2951
|
+
p.file.response?.message || `${p.file.name} 파일 업로드 중 오류가 발생했습니다.`
|
|
2952
|
+
);
|
|
2953
|
+
d(m);
|
|
2954
|
+
},
|
|
2955
|
+
itemRender(p, h, O) {
|
|
2956
|
+
const m = Ze.cloneElement(p, {
|
|
2957
|
+
href: h.url || void 0,
|
|
2958
|
+
title: void 0
|
|
2959
|
+
});
|
|
2960
|
+
return /* @__PURE__ */ c.jsx(
|
|
2961
|
+
uo,
|
|
2962
|
+
{
|
|
2963
|
+
originNode: m,
|
|
2964
|
+
file: h,
|
|
2965
|
+
fileList: O,
|
|
2966
|
+
moveFile: g,
|
|
2967
|
+
onDrop: y
|
|
2968
|
+
},
|
|
2969
|
+
h.uid
|
|
2970
|
+
);
|
|
2971
|
+
}
|
|
2972
|
+
};
|
|
2973
|
+
return /* @__PURE__ */ c.jsx(hn, { backend: ao, children: /* @__PURE__ */ c.jsx(H, { ...f, listType: "picture", children: /* @__PURE__ */ c.jsx(q, { icon: /* @__PURE__ */ c.jsx(Je, {}), children: "파일 선택" }) }) });
|
|
2974
|
+
}, { Text: K, Link: Ho } = We, { Dragger: lo } = H, go = [
|
|
2975
|
+
".pdf",
|
|
2976
|
+
".xlsx",
|
|
2977
|
+
".xls",
|
|
2978
|
+
".docx",
|
|
2979
|
+
".doc",
|
|
2980
|
+
".pptx",
|
|
2981
|
+
".ppt",
|
|
2982
|
+
".hwp",
|
|
2983
|
+
".txt",
|
|
2984
|
+
".csv",
|
|
2985
|
+
// 이미지
|
|
2986
|
+
".jpg",
|
|
2987
|
+
".jpeg",
|
|
2988
|
+
".png",
|
|
2989
|
+
".gif",
|
|
2990
|
+
// 압축
|
|
2991
|
+
".zip"
|
|
2992
|
+
], fo = (t, e = 2) => {
|
|
2993
|
+
if (t === 0) return "0 Bytes";
|
|
2994
|
+
const r = 1024, n = e < 0 ? 0 : e, o = ["Bytes", "KB", "MB", "GB", "TB"], i = Math.floor(Math.log(t) / Math.log(r));
|
|
2995
|
+
return parseFloat((t / Math.pow(r, i)).toFixed(n)) + " " + o[i];
|
|
2996
|
+
}, Bo = ({
|
|
2997
|
+
title: t = "첨부파일",
|
|
2998
|
+
fileGrpKey: e,
|
|
2999
|
+
onUploadComplete: r,
|
|
3000
|
+
onSuccessTrxCd: n = "SCMFILE00102",
|
|
3001
|
+
// BwgUploader와 동일한 기본 trxCd 설정
|
|
3002
|
+
anotherServiceTrxCd: o = "SCMFILE00105",
|
|
3003
|
+
allowedExtensions: i = go,
|
|
3004
|
+
maxFileSize: s = 2048
|
|
3005
|
+
// 기본값 2GB
|
|
3006
|
+
}) => {
|
|
3007
|
+
const [a, u] = F([]), [d, g] = F(!1), [y, v] = F(!1), [f, p] = F(0), h = (l) => {
|
|
3008
|
+
if (i && i.length > 0) {
|
|
3009
|
+
const b = ((x) => {
|
|
3010
|
+
const N = x.lastIndexOf(".");
|
|
3011
|
+
return N === -1 ? "" : x.substring(N).toLowerCase();
|
|
3012
|
+
})(l.name);
|
|
3013
|
+
if (!i.includes(b))
|
|
3014
|
+
return C.error(
|
|
3015
|
+
`${l.name} 파일은 허용되지 않는 확장자입니다. (${i.join(
|
|
3016
|
+
", "
|
|
3017
|
+
)}만 가능)`
|
|
3018
|
+
), !1;
|
|
3019
|
+
}
|
|
3020
|
+
return !0;
|
|
3021
|
+
}, O = async () => {
|
|
3022
|
+
const l = a.filter((I) => I.status !== "done"), S = l.reduce(
|
|
3023
|
+
(I, A) => I + (A.size || 0),
|
|
3024
|
+
0
|
|
3025
|
+
), b = 2 * 1024 * 1024 * 1024;
|
|
3026
|
+
if (S > b) {
|
|
3027
|
+
Ct.error({
|
|
3028
|
+
message: "업로드 용량 초과",
|
|
3029
|
+
description: "한 번에 업로드할 수 있는 총 파일 용량은 2GB를 초과할 수 없습니다."
|
|
3030
|
+
});
|
|
3031
|
+
return;
|
|
3032
|
+
}
|
|
3033
|
+
if (l.length === 0) {
|
|
3034
|
+
C.warning(
|
|
3035
|
+
"업로드할 파일이 없거나 모든 파일이 이미 업로드되었습니다."
|
|
3036
|
+
);
|
|
3037
|
+
return;
|
|
3038
|
+
}
|
|
3039
|
+
v(!0);
|
|
3040
|
+
let x;
|
|
3041
|
+
try {
|
|
3042
|
+
const I = new Bt();
|
|
3043
|
+
l.forEach((A) => {
|
|
3044
|
+
A.originFileObj && I.file(A.name, A.originFileObj);
|
|
3045
|
+
}), x = await I.generateAsync({
|
|
3046
|
+
type: "blob",
|
|
3047
|
+
compression: "DEFLATE",
|
|
3048
|
+
compressionOptions: {
|
|
3049
|
+
level: 9
|
|
3050
|
+
// 높은 압축률 설정
|
|
3051
|
+
}
|
|
3052
|
+
});
|
|
3053
|
+
} catch (I) {
|
|
3054
|
+
v(!1), C.error("파일을 압축하는 중 오류가 발생했습니다."), console.error("Zipping error:", I);
|
|
3055
|
+
return;
|
|
3056
|
+
}
|
|
3057
|
+
v(!1);
|
|
3058
|
+
const N = new FormData();
|
|
3059
|
+
N.append("file", x, "upload.zip"), g(!0), p(0);
|
|
3060
|
+
try {
|
|
3061
|
+
const I = await new Promise((R, T) => {
|
|
3062
|
+
const _ = new XMLHttpRequest();
|
|
3063
|
+
_.open("POST", "/api/upload-large", !0), _.upload.onprogress = (E) => {
|
|
3064
|
+
if (E.lengthComputable) {
|
|
3065
|
+
const ce = Math.round(
|
|
3066
|
+
E.loaded / E.total * 100
|
|
3067
|
+
);
|
|
3068
|
+
p(ce);
|
|
3069
|
+
}
|
|
3070
|
+
}, _.onload = () => {
|
|
3071
|
+
if (_.status >= 200 && _.status < 300)
|
|
3072
|
+
try {
|
|
3073
|
+
const E = JSON.parse(_.responseText);
|
|
3074
|
+
E.success ? R(E) : T(
|
|
3075
|
+
new Error(E.message || "파일 업로드에 실패했습니다.")
|
|
3076
|
+
);
|
|
3077
|
+
} catch {
|
|
3078
|
+
T(new Error("잘못된 서버 응답입니다."));
|
|
3079
|
+
}
|
|
3080
|
+
else
|
|
3081
|
+
try {
|
|
3082
|
+
const E = JSON.parse(_.responseText);
|
|
3083
|
+
T(new Error(E.message || `서버 오류: ${_.status}`));
|
|
3084
|
+
} catch {
|
|
3085
|
+
T(new Error(`서버 오류: ${_.status}`));
|
|
3086
|
+
}
|
|
3087
|
+
}, _.onerror = () => {
|
|
3088
|
+
T(new Error("네트워크 오류가 발생했습니다."));
|
|
3089
|
+
}, _.send(N);
|
|
3090
|
+
});
|
|
3091
|
+
C.success(
|
|
3092
|
+
I.message || "압축 파일이 성공적으로 업로드되었습니다."
|
|
3093
|
+
);
|
|
3094
|
+
const A = a.map(
|
|
3095
|
+
(R) => l.find((T) => T.uid === R.uid) ? { ...R, status: "done" } : R
|
|
3096
|
+
);
|
|
3097
|
+
if (u(A), n && I.uploadedFiles && Array.isArray(I.uploadedFiles)) {
|
|
3098
|
+
const R = $();
|
|
3099
|
+
I.uploadedFiles.forEach((T) => {
|
|
3100
|
+
const _ = {
|
|
3101
|
+
crprCd: R.crprCd,
|
|
3102
|
+
sysCd: __SYS_CD__,
|
|
3103
|
+
fileGrpKey: e,
|
|
3104
|
+
sub: [
|
|
3105
|
+
{
|
|
3106
|
+
crprCd: R.crprCd,
|
|
3107
|
+
sysCd: __SYS_CD__,
|
|
3108
|
+
fileGrpKey: e,
|
|
3109
|
+
physFileNm: T.fileNameP,
|
|
3110
|
+
lgclFileNm: T.fileNameL,
|
|
3111
|
+
filePath: T.filePath,
|
|
3112
|
+
fileExtn: T.fileExt,
|
|
3113
|
+
fileSize: T.fileSize,
|
|
3114
|
+
mltpYn: "Y"
|
|
3115
|
+
}
|
|
3116
|
+
]
|
|
3117
|
+
};
|
|
3118
|
+
z(n, _).then((E) => {
|
|
3119
|
+
const ce = a.map((J) => ({
|
|
3120
|
+
crprCd: R.crprCd,
|
|
3121
|
+
sysCd: __SYS_CD__,
|
|
3122
|
+
fileGrpKey: E.sub[0].fileGrpKey,
|
|
3123
|
+
fileKey: E.sub[0].fileKey,
|
|
3124
|
+
lgclFileNm: J.name,
|
|
3125
|
+
fileSize: J.size,
|
|
3126
|
+
fileExtn: J.name.split(".").pop(),
|
|
3127
|
+
fileType: J.type
|
|
3128
|
+
}));
|
|
3129
|
+
z(o, {
|
|
3130
|
+
// 파일 목록에 fileKey를 추가합니다.
|
|
3131
|
+
sub: ce
|
|
3132
|
+
});
|
|
3133
|
+
}).catch((E) => {
|
|
3134
|
+
console.error("후처리 서비스 호출 실패:", E), C.error(
|
|
3135
|
+
`${T.fileNameL} 파일의 후처리 작업에 실패했습니다.`
|
|
3136
|
+
);
|
|
3137
|
+
}), r && r({
|
|
3138
|
+
fileNameP: T.fileNameP,
|
|
3139
|
+
fileNameL: T.fileNameL
|
|
3140
|
+
});
|
|
3141
|
+
});
|
|
3142
|
+
}
|
|
3143
|
+
} catch (I) {
|
|
3144
|
+
C.error(I.message || "파일 업로드 중 오류가 발생했습니다.");
|
|
3145
|
+
const A = a.map(
|
|
3146
|
+
(R) => l.find((T) => T.uid === R.uid) ? {
|
|
3147
|
+
...R,
|
|
3148
|
+
status: "error",
|
|
3149
|
+
response: I.message || "파일 업로드 중 오류가 발생했습니다."
|
|
3150
|
+
} : R
|
|
3151
|
+
);
|
|
3152
|
+
u(A);
|
|
3153
|
+
} finally {
|
|
3154
|
+
g(!1);
|
|
3155
|
+
}
|
|
3156
|
+
}, m = {
|
|
3157
|
+
multiple: !0,
|
|
3158
|
+
fileList: a,
|
|
3159
|
+
beforeUpload: (l) => h(l) ? s && l.size >= s * 1024 * 1024 ? (C.error(
|
|
3160
|
+
`대용량 첨부 파일 최대 크기는 ${(s / 1024).toFixed(
|
|
3161
|
+
1
|
|
3162
|
+
)}GB입니다.`
|
|
3163
|
+
), H.LIST_IGNORE) : !1 : H.LIST_IGNORE,
|
|
3164
|
+
onChange: ({ fileList: l }) => {
|
|
3165
|
+
const S = new Map(a.map((b) => [b.uid, b]));
|
|
3166
|
+
l.forEach((b) => {
|
|
3167
|
+
S.set(b.uid, b);
|
|
3168
|
+
}), u(Array.from(S.values()));
|
|
3169
|
+
},
|
|
3170
|
+
onRemove: (l) => {
|
|
3171
|
+
const S = a.filter((b) => b.uid !== l.uid);
|
|
3172
|
+
u(S);
|
|
3173
|
+
},
|
|
3174
|
+
showUploadList: !1
|
|
3175
|
+
// 수동으로 목록을 렌더링하므로 antd의 기본 목록은 숨깁니다.
|
|
3176
|
+
};
|
|
3177
|
+
return /* @__PURE__ */ c.jsx(
|
|
3178
|
+
St,
|
|
3179
|
+
{
|
|
3180
|
+
spinning: d || y,
|
|
3181
|
+
tip: y ? "파일 압축 중..." : `파일 업로드 중... ${f}%`,
|
|
3182
|
+
children: /* @__PURE__ */ c.jsxs("div", { className: "bwg-large-uploader-container", children: [
|
|
3183
|
+
/* @__PURE__ */ c.jsx(
|
|
3184
|
+
Ot,
|
|
3185
|
+
{
|
|
3186
|
+
title: /* @__PURE__ */ c.jsx(K, { strong: !0, children: t }),
|
|
3187
|
+
extra: /* @__PURE__ */ c.jsx(H, { ...m, children: /* @__PURE__ */ c.jsx(q, { icon: /* @__PURE__ */ c.jsx(Je, {}), children: "파일 선택" }) }),
|
|
3188
|
+
bodyStyle: { padding: 0 },
|
|
3189
|
+
children: /* @__PURE__ */ c.jsx(
|
|
3190
|
+
lo,
|
|
3191
|
+
{
|
|
3192
|
+
...m,
|
|
3193
|
+
style: {
|
|
3194
|
+
border: "none",
|
|
3195
|
+
background: "transparent",
|
|
3196
|
+
padding: 0
|
|
3197
|
+
},
|
|
3198
|
+
children: /* @__PURE__ */ c.jsx("div", { className: "upload-list-container", children: a.length > 0 ? /* @__PURE__ */ c.jsx(
|
|
3199
|
+
ue,
|
|
3200
|
+
{
|
|
3201
|
+
style: { textAlign: "left" },
|
|
3202
|
+
dataSource: a,
|
|
3203
|
+
renderItem: (l) => {
|
|
3204
|
+
const S = l.status === "done", b = l.status === "error";
|
|
3205
|
+
let x;
|
|
3206
|
+
return S ? x = /* @__PURE__ */ c.jsx(
|
|
3207
|
+
Yt,
|
|
3208
|
+
{
|
|
3209
|
+
style: { color: "#52c41a", fontSize: 14 }
|
|
3210
|
+
}
|
|
3211
|
+
) : b ? x = /* @__PURE__ */ c.jsx(
|
|
3212
|
+
bt,
|
|
3213
|
+
{
|
|
3214
|
+
title: typeof l.response == "string" ? l.response : "업로드 실패",
|
|
3215
|
+
children: /* @__PURE__ */ c.jsx(
|
|
3216
|
+
Lt,
|
|
3217
|
+
{
|
|
3218
|
+
style: { color: "#ff4d4f", fontSize: 14 }
|
|
3219
|
+
}
|
|
3220
|
+
)
|
|
3221
|
+
}
|
|
3222
|
+
) : x = /* @__PURE__ */ c.jsx(At, { style: { fontSize: 14 } }), /* @__PURE__ */ c.jsx(
|
|
3223
|
+
ue.Item,
|
|
3224
|
+
{
|
|
3225
|
+
actions: [
|
|
3226
|
+
/* @__PURE__ */ c.jsx(K, { type: "secondary", children: fo(l.size || 0) }, "size"),
|
|
3227
|
+
/* @__PURE__ */ c.jsx(
|
|
3228
|
+
q,
|
|
3229
|
+
{
|
|
3230
|
+
type: "text",
|
|
3231
|
+
icon: /* @__PURE__ */ c.jsx(jt, {}),
|
|
3232
|
+
onClick: (N) => {
|
|
3233
|
+
N.stopPropagation(), m.onRemove?.(l);
|
|
3234
|
+
},
|
|
3235
|
+
disabled: d || y
|
|
3236
|
+
},
|
|
3237
|
+
"delete"
|
|
3238
|
+
)
|
|
3239
|
+
],
|
|
3240
|
+
children: /* @__PURE__ */ c.jsx(
|
|
3241
|
+
ue.Item.Meta,
|
|
3242
|
+
{
|
|
3243
|
+
avatar: x,
|
|
3244
|
+
title: /* @__PURE__ */ c.jsx(K, { type: b ? "danger" : void 0, children: l.name })
|
|
3245
|
+
}
|
|
3246
|
+
)
|
|
3247
|
+
},
|
|
3248
|
+
l.uid
|
|
3249
|
+
);
|
|
3250
|
+
}
|
|
3251
|
+
}
|
|
3252
|
+
) : /* @__PURE__ */ c.jsxs(
|
|
3253
|
+
Pe,
|
|
3254
|
+
{
|
|
3255
|
+
gap: "middle",
|
|
3256
|
+
align: "center",
|
|
3257
|
+
justify: "center",
|
|
3258
|
+
vertical: !0,
|
|
3259
|
+
style: { padding: "20px 0", minHeight: "120px" },
|
|
3260
|
+
children: [
|
|
3261
|
+
/* @__PURE__ */ c.jsx(Ft, { style: { fontSize: "32px", color: "#999" } }),
|
|
3262
|
+
/* @__PURE__ */ c.jsx(K, { type: "secondary", children: "업로드할 파일을 선택하거나 이 영역으로 드래그하세요." })
|
|
3263
|
+
]
|
|
3264
|
+
}
|
|
3265
|
+
) })
|
|
3266
|
+
}
|
|
3267
|
+
)
|
|
3268
|
+
}
|
|
3269
|
+
),
|
|
3270
|
+
a.length > 0 && /* @__PURE__ */ c.jsxs(
|
|
3271
|
+
Pe,
|
|
3272
|
+
{
|
|
3273
|
+
justify: "flex-end",
|
|
3274
|
+
align: "center",
|
|
3275
|
+
gap: "large",
|
|
3276
|
+
style: { marginTop: 16 },
|
|
3277
|
+
children: [
|
|
3278
|
+
d && /* @__PURE__ */ c.jsx("div", { style: { width: "250px" }, children: /* @__PURE__ */ c.jsx(Tt, { percent: f, size: "small" }) }),
|
|
3279
|
+
/* @__PURE__ */ c.jsx(
|
|
3280
|
+
q,
|
|
3281
|
+
{
|
|
3282
|
+
type: "primary",
|
|
3283
|
+
onClick: O,
|
|
3284
|
+
disabled: d || y || a.filter((l) => l.status !== "done").length === 0,
|
|
3285
|
+
icon: /* @__PURE__ */ c.jsx(kt, {}),
|
|
3286
|
+
children: "일괄 업로드"
|
|
3287
|
+
}
|
|
3288
|
+
)
|
|
3289
|
+
]
|
|
3290
|
+
}
|
|
3291
|
+
)
|
|
3292
|
+
] })
|
|
3293
|
+
}
|
|
3294
|
+
);
|
|
3295
|
+
};
|
|
3296
|
+
export {
|
|
3297
|
+
w as B,
|
|
3298
|
+
Ut as a,
|
|
3299
|
+
Io as b,
|
|
3300
|
+
Eo as c,
|
|
3301
|
+
wo as d,
|
|
3302
|
+
xo as e,
|
|
3303
|
+
No as f,
|
|
3304
|
+
Po as g,
|
|
3305
|
+
Mo as h,
|
|
3306
|
+
Ro as i,
|
|
3307
|
+
_o as j,
|
|
3308
|
+
Lo as k,
|
|
3309
|
+
jo as l,
|
|
3310
|
+
Fo as m,
|
|
3311
|
+
ko as n,
|
|
3312
|
+
Yo as o,
|
|
3313
|
+
Ao as p,
|
|
3314
|
+
Bo as q
|
|
3315
|
+
};
|
|
3316
|
+
//# sourceMappingURL=BwgLargeUploader-CwaZ2WwY.js.map
|