@owp/core 2.0.2 → 2.0.4
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/{OwpStoreProvider-Cp3bYbdo.js → OwpStoreProvider-HmqsAzRG.js} +2 -2
- package/dist/{OwpStoreProvider-Cp3bYbdo.js.map → OwpStoreProvider-HmqsAzRG.js.map} +1 -1
- package/dist/contexts.js +32 -32
- package/dist/contexts.js.map +1 -1
- package/dist/hooks.js +124 -95
- package/dist/hooks.js.map +1 -1
- package/dist/index.js +5115 -4993
- package/dist/index.js.map +1 -1
- package/dist/jszip.min-DNVFzgT6.js +2407 -0
- package/dist/jszip.min-DNVFzgT6.js.map +1 -0
- package/dist/{lazyLoadedSlices-BgnXi9pr.js → lazyLoadedSlices-DGKpiSM4.js} +316 -328
- package/dist/{lazyLoadedSlices-BgnXi9pr.js.map → lazyLoadedSlices-DGKpiSM4.js.map} +1 -1
- package/dist/store.js +2 -2
- package/dist/types/contexts/OwpAppProvider.d.ts +10 -1
- package/dist/types/layout/components/navigation/NavItem.d.ts +1 -0
- package/dist/types/layout/components/navigation/NavigationMenu.d.ts +1 -0
- package/dist/types/utils/jszipBrowser.d.ts +5 -0
- package/dist/useShortcuts-BjtlXprQ.js.map +1 -1
- package/dist/useTreeGridExcelExport-Bfxx0cps.js +88 -0
- package/dist/useTreeGridExcelExport-Bfxx0cps.js.map +1 -0
- package/dist/utils.js +2723 -5099
- package/dist/utils.js.map +1 -1
- package/package.json +1 -1
- package/dist/useTreeGridExcelExport-C1QPr9Dp.js +0 -120
- package/dist/useTreeGridExcelExport-C1QPr9Dp.js.map +0 -1
package/dist/store.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { O as s, c as a, m as r } from "./OwpStoreProvider-
|
|
2
|
-
import { c as o, d as c, j as i, p as h, k as n, m, n as T, l as g, o as S, E as p, q as b, i as w, B as u, C as D, D as O, r as f, t as k, u as C, v, w as x, x as F, a as L, b as M, h as d, e as N, g as P, f as y, y as A, z as E, A as j, s as q, F as z, G as B } from "./lazyLoadedSlices-
|
|
1
|
+
import { O as s, c as a, m as r } from "./OwpStoreProvider-HmqsAzRG.js";
|
|
2
|
+
import { c as o, d as c, j as i, p as h, k as n, m, n as T, l as g, o as S, E as p, q as b, i as w, B as u, C as D, D as O, r as f, t as k, u as C, v, w as x, x as F, a as L, b as M, h as d, e as N, g as P, f as y, y as A, z as E, A as j, s as q, F as z, G as B } from "./lazyLoadedSlices-DGKpiSM4.js";
|
|
3
3
|
export {
|
|
4
4
|
s as OwpStoreProvider,
|
|
5
5
|
o as changeOwpTheme,
|
|
@@ -25,7 +25,16 @@ export interface OwpAppSlotProps {
|
|
|
25
25
|
logo?: OwpLogoSlotProps;
|
|
26
26
|
}
|
|
27
27
|
export interface OwpAppEnv {
|
|
28
|
-
|
|
28
|
+
apiBaseUrl?: string;
|
|
29
|
+
isAccessTokenGuardEnabled?: boolean;
|
|
30
|
+
isAutoLogoutEnabled?: boolean;
|
|
31
|
+
autoLogoutIdleTimeoutMs?: number;
|
|
32
|
+
isBackendNavigationEnabled?: boolean;
|
|
33
|
+
isErrorMessageEnabled?: boolean;
|
|
34
|
+
isI18nEnabled?: boolean;
|
|
35
|
+
isI18nLanguageSwitcherEnabled?: boolean;
|
|
36
|
+
isPasswordChangeEnabled?: boolean;
|
|
37
|
+
[key: string]: unknown;
|
|
29
38
|
}
|
|
30
39
|
export interface OwpAppContextValue extends OwpAppConfigs {
|
|
31
40
|
env?: OwpAppEnv;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useShortcuts-BjtlXprQ.js","sources":["../../../node_modules/.pnpm/es-toolkit@1.39.10/node_modules/es-toolkit/dist/string/trimEnd.mjs","../src/contexts/OwpAppProvider.tsx","../../../node_modules/.pnpm/es-toolkit@1.39.10/node_modules/es-toolkit/dist/compat/string/trimEnd.mjs","../src/hooks/useOwpTranslation.ts","../src/hooks/useConfirm.tsx","../src/hooks/useTimeout.ts","../src/hooks/useCommonCodeList.ts","../src/hooks/useAppStore.ts","../src/hooks/useCurrentLanguage.ts","../src/hooks/useLogoSrc.ts","../src/hooks/useCurrentUser.ts","../src/hooks/useNavigation.ts","../src/hooks/useShortcuts.ts"],"sourcesContent":["function trimEnd(str, chars) {\n if (chars === undefined) {\n return str.trimEnd();\n }\n let endIndex = str.length;\n switch (typeof chars) {\n case 'string': {\n if (chars.length !== 1) {\n throw new Error(`The 'chars' parameter should be a single character string.`);\n }\n while (endIndex > 0 && str[endIndex - 1] === chars) {\n endIndex--;\n }\n break;\n }\n case 'object': {\n while (endIndex > 0 && chars.includes(str[endIndex - 1])) {\n endIndex--;\n }\n }\n }\n return str.substring(0, endIndex);\n}\n\nexport { trimEnd };\n","import type { OwpSettingsConfigType, OwpThemesType } from '@/types/OwpSettingsTypes';\nimport type { OwpNavItemType } from '@/types/OwpNavigationTypes';\nimport { useStorage } from '@/hooks/useStorage';\nimport {\n CSSProperties,\n ComponentType,\n createContext,\n ReactNode,\n useContext,\n useLayoutEffect,\n useRef,\n} from 'react';\nimport { PartialDeep } from 'type-fest';\n\n/**\n * Logo slot props\n */\nexport interface OwpLogoSlotProps {\n className?: string;\n style?: CSSProperties;\n}\n\nexport interface OwpAppConfigs {\n routesConfig: any;\n settingsConfig?: PartialDeep<OwpSettingsConfigType>;\n themesConfig?: PartialDeep<OwpThemesType>;\n navigationConfig: OwpNavItemType[];\n}\n\n/**\n * App slots\n */\nexport interface OwpAppSlots {\n logo?: ComponentType<OwpLogoSlotProps>;\n}\n\nexport interface OwpAppSlotProps {\n logo?: OwpLogoSlotProps;\n}\n\nexport interface OwpAppEnv {\n [key: string]: any;\n}\n\nexport interface OwpAppContextValue extends OwpAppConfigs {\n env?: OwpAppEnv;\n slots?: OwpAppSlots;\n slotProps?: OwpAppSlotProps;\n}\n\nexport const OwpAppContext = createContext<OwpAppContextValue | undefined>(undefined);\n\nexport interface OwpAppProviderProps {\n configs: OwpAppConfigs;\n slots?: OwpAppSlots;\n slotProps?: OwpAppSlotProps;\n children?: ReactNode;\n env?: OwpAppEnv;\n}\n\nexport const OwpAppProvider = ({\n configs,\n slots,\n slotProps,\n children,\n env,\n}: OwpAppProviderProps) => {\n const value = useRef<OwpAppContextValue>({ ...configs, env, slots, slotProps });\n const { setEnv } = useStorage();\n\n useLayoutEffect(() => {\n setEnv(env ?? {});\n }, [env, setEnv]);\n\n return <OwpAppContext.Provider value={value.current}>{children}</OwpAppContext.Provider>;\n};\n\nexport const useOwpAppContext = () => {\n const context = useContext(OwpAppContext);\n\n if (context === undefined) {\n throw new Error('useOwpAppContext must be used within a OwpAppProvider');\n }\n\n return context;\n};\n","import { trimEnd as trimEnd$1 } from '../../string/trimEnd.mjs';\n\nfunction trimEnd(str, chars, guard) {\n if (str == null) {\n return '';\n }\n if (guard != null || chars == null) {\n return str.toString().trimEnd();\n }\n return trimEnd$1(str, chars.toString().split(''));\n}\n\nexport { trimEnd };\n","import { isPlainObject, trimEnd } from 'es-toolkit/compat';\nimport { useTranslation } from 'react-i18next';\n\n/**\n * 번역 키 기본 라벨 추출\n * @param key 번역 키\n */\nconst getDefaultValueFromKey = (key: string) => {\n if (!key.includes('.')) {\n return undefined;\n }\n\n const normalizedKey = trimEnd(key, '.');\n const lastSeparatorIndex = normalizedKey.lastIndexOf('.');\n\n if (lastSeparatorIndex < 0) {\n return key;\n }\n\n return key.slice(lastSeparatorIndex + 1);\n};\n\n/**\n * OWP 번역 훅\n */\nexport const useOwpTranslation = () => {\n const { t: i18nT, ...restProps } = useTranslation('owp');\n\n const t: typeof i18nT = ((...args: Parameters<typeof i18nT>) => {\n const [key, options] = args;\n const optionsObject = isPlainObject(options) ? (options as Record<string, unknown>) : undefined;\n const isOptionsObject = Boolean(optionsObject);\n const hasDefaultValue =\n isOptionsObject && Object.prototype.hasOwnProperty.call(optionsObject, 'defaultValue');\n const canInjectDefaultValue = options == null || isOptionsObject;\n\n if (canInjectDefaultValue && !hasDefaultValue && typeof key === 'string') {\n const defaultValue = getDefaultValueFromKey(key);\n\n if (defaultValue) {\n const nextOptions = isOptionsObject ? { ...optionsObject, defaultValue } : { defaultValue };\n\n return i18nT(...([key, nextOptions, ...args.slice(2)] as Parameters<typeof i18nT>));\n }\n }\n\n return i18nT(...args);\n }) as typeof i18nT;\n\n return { t, ...restProps };\n};\n","import {\n Button,\n ButtonProps,\n Dialog,\n DialogActions,\n DialogContent,\n Typography,\n} from '@mui/material';\nimport { useOwpTranslation } from '@/hooks/useOwpTranslation';\nimport { DialogProps, useDialogs } from '@toolpad/core/useDialogs';\nimport { ReactNode } from 'react';\n\nexport interface ConfirmProps {\n title?: ReactNode | string;\n okText?: string;\n cancelText?: string;\n severity?: 'primary' | 'secondary' | 'error' | 'info' | 'success' | 'warning';\n useInfo?: boolean;\n okButtonProps?: ButtonProps;\n onClose?: (result: boolean) => Promise<void>;\n}\ninterface ConfirmBaseProps extends ConfirmProps {\n okButtonProps?: ButtonProps;\n cancelButtonProps?: ButtonProps;\n}\n\ninterface ConfirmTranslationConfig {\n key: string;\n defaultValue: string;\n}\n\n/**\n * 확인 대화상자 번역 설정\n */\nconst CONFIRM_TRANSLATIONS = {\n infoTitle: {\n key: 'Message.처리하시겠습니까',\n defaultValue: '처리하시겠습니까?',\n },\n infoOk: {\n key: 'Button.확인',\n defaultValue: '확인',\n },\n saveTitle: {\n key: 'Message.저장하시겠습니까?',\n defaultValue: '저장하시겠습니까?',\n },\n saveOk: {\n key: 'Button.저장',\n defaultValue: '저장',\n },\n updateTitle: {\n key: 'Message.수정하시겠습니까?',\n defaultValue: '수정하시겠습니까?',\n },\n updateOk: {\n key: 'Button.수정',\n defaultValue: '수정',\n },\n deleteTitle: {\n key: 'Message.삭제하시겠습니까?',\n defaultValue: '삭제하시겠습니까?',\n },\n deleteOk: {\n key: 'Button.삭제',\n defaultValue: '삭제',\n },\n cancel: {\n key: 'Button.취소',\n defaultValue: '취소',\n },\n} as const;\n\n/**\n * 확인 버튼 속성 병합\n * @param defaultColor 기본 버튼 색상\n * @param okButtonProps 사용자 버튼 속성\n */\nconst mergeOkButtonProps = (\n defaultColor: ButtonProps['color'] | undefined,\n okButtonProps?: ButtonProps,\n) => {\n if (!defaultColor) {\n return okButtonProps;\n }\n\n return {\n color: defaultColor,\n ...okButtonProps,\n } as ButtonProps;\n};\n/**\n * 확인 대화상자 훅\n */\nexport const useConfirm = () => {\n const dialogs = useDialogs();\n const { t } = useOwpTranslation();\n\n const translateConfirmText = ({ key, defaultValue }: ConfirmTranslationConfig) =>\n t(key, { defaultValue });\n\n const confirmBase = (props: ConfirmBaseProps) => dialogs.open(ConfirmDialog, props);\n\n return {\n confirm: confirmBase,\n confirmInfo: async ({ title, okText, severity }: ConfirmProps | undefined = {}) => {\n return confirmBase({\n title:\n title ?? translateConfirmText(CONFIRM_TRANSLATIONS.infoTitle),\n okText: okText ?? translateConfirmText(CONFIRM_TRANSLATIONS.infoOk),\n severity: severity ?? 'primary',\n useInfo: true,\n });\n },\n confirmSave: async ({\n title,\n okText,\n cancelText,\n okButtonProps,\n }: ConfirmProps | undefined = {}) => {\n return confirmBase({\n title: title ?? translateConfirmText(CONFIRM_TRANSLATIONS.saveTitle),\n okText: okText ?? translateConfirmText(CONFIRM_TRANSLATIONS.saveOk),\n cancelText,\n okButtonProps: mergeOkButtonProps('secondary', okButtonProps),\n });\n },\n confirmUpdate: async ({\n title,\n okText,\n cancelText,\n okButtonProps,\n }: ConfirmProps | undefined = {}) => {\n return confirmBase({\n title: title ?? translateConfirmText(CONFIRM_TRANSLATIONS.updateTitle),\n okText: okText ?? translateConfirmText(CONFIRM_TRANSLATIONS.updateOk),\n cancelText,\n okButtonProps: mergeOkButtonProps('secondary', okButtonProps),\n });\n },\n confirmDelete: async ({\n title,\n okText,\n cancelText,\n okButtonProps,\n }: ConfirmProps | undefined = {}) => {\n return confirmBase({\n title: title ?? translateConfirmText(CONFIRM_TRANSLATIONS.deleteTitle),\n okText: okText ?? translateConfirmText(CONFIRM_TRANSLATIONS.deleteOk),\n cancelText,\n okButtonProps: mergeOkButtonProps('error', okButtonProps),\n });\n },\n };\n};\n\nconst ConfirmDialog = ({ payload, open, onClose }: DialogProps<ConfirmBaseProps, boolean>) => {\n const { title, okButtonProps, cancelButtonProps, severity, useInfo } = payload;\n\n const { t } = useOwpTranslation();\n\n const okText =\n payload?.okText ?? t(CONFIRM_TRANSLATIONS.infoOk.key, { defaultValue: CONFIRM_TRANSLATIONS.infoOk.defaultValue });\n const cancelText =\n payload?.cancelText ?? t(CONFIRM_TRANSLATIONS.cancel.key, { defaultValue: CONFIRM_TRANSLATIONS.cancel.defaultValue });\n\n return (\n <Dialog fullWidth maxWidth=\"xs\" open={open} onClose={() => onClose(false)}>\n <DialogContent>\n <Typography className=\"mb-12\" variant=\"h6\">\n {title}\n </Typography>\n </DialogContent>\n <DialogActions>\n {!useInfo && (\n <Button {...cancelButtonProps} variant=\"outlined\" onClick={() => onClose(false)}>\n {cancelText}\n </Button>\n )}\n <Button\n color={severity ? severity : 'primary'}\n variant=\"contained\"\n {...okButtonProps}\n onClick={() => onClose(true)}\n >\n {okText}\n </Button>\n </DialogActions>\n </Dialog>\n );\n};\n","import { useEffect, useRef } from 'react';\n\n/**\n * The useTimeout function is a custom hook that sets a timeout for a given callback function.\n * It takes in a callback function and a delay time in milliseconds as parameters.\n * It returns nothing.\n */\nexport function useTimeout(callback: () => void, delay: number) {\n const callbackRef = useRef(callback);\n\n useEffect(() => {\n callbackRef.current = callback;\n }, [callback]);\n\n useEffect(() => {\n let timer: NodeJS.Timeout | undefined;\n\n if (delay !== null && callback && typeof callback === 'function') {\n timer = setTimeout(callbackRef.current, delay);\n }\n\n return () => {\n if (timer) {\n clearTimeout(timer);\n }\n };\n }, [callback, delay]);\n}\n","import { STORAGE_KEYS } from '@/constants/storageKeys';\nimport { CommonCode } from '@/utils/commonCodeUtils';\nimport { useAtomValue, useSetAtom } from 'jotai';\nimport { atomWithStorage } from 'jotai/utils';\n\nconst commonCodeAtom = atomWithStorage<\n | {\n [codeId: string]: Array<CommonCode>;\n }\n | undefined\n>(STORAGE_KEYS.commonCodeList, undefined);\n\n/**\n * 공통코드 목록 조회 훅\n */\nexport const useGetCommonCodeList = () => {\n return useAtomValue(commonCodeAtom);\n};\n\n/**\n * 공통코드 목록 설정 훅\n */\nexport const useSetCommonCodeList = () => {\n return useSetAtom(commonCodeAtom);\n};\n","import { useDispatch, useSelector, useStore } from 'react-redux';\nimport type { AppDispatch, AppStore, RootState } from '@/store/store';\n\n/**\n * Internal typed Redux hooks\n */\nexport const useAppDispatch: () => AppDispatch = useDispatch.withTypes<AppDispatch>();\nexport const useAppSelector: <T>(selector: (state: RootState) => T) => T =\n useSelector.withTypes<RootState>();\nexport const useAppStore: () => AppStore = useStore.withTypes<AppStore>();\n","export { FALLBACK_LANGUAGE_LIST } from '@/constants/language';\nimport { STORAGE_KEYS } from '@/constants/storageKeys';\nimport { useOwpTranslation } from '@/hooks/useOwpTranslation';\nimport { useAtomValue, useSetAtom } from 'jotai';\nimport { atomWithStorage } from 'jotai/utils';\n\nexport type CurrentLanguage = { id: 'en' | 'kr' | 'lc'; title: string; flag: string };\n\nconst currentLanguageAtom = atomWithStorage<CurrentLanguage>(STORAGE_KEYS.currentLanguage, {\n id: 'kr',\n title: '한국어',\n flag: 'KR',\n});\n\n/**\n * 언어 목록 조회 훅\n */\nexport const useGetLanguageList = (): CurrentLanguage[] => {\n const { t } = useOwpTranslation();\n return [\n { id: 'kr', title: t('Common.한국어', { defaultValue: '한국어' }), flag: 'KR' },\n {\n id: 'en',\n title: t('Common.English', { defaultValue: 'English' }),\n flag: 'EN',\n },\n { id: 'lc', title: t('Common.Etc', { defaultValue: 'Etc' }), flag: 'LC' },\n ];\n};\n\n/**\n * 현재 언어 조회 훅\n */\nexport const useGetCurrentLanguage = () => {\n return useAtomValue(currentLanguageAtom);\n};\n\n/**\n * 현재 언어 설정 훅\n */\nexport const useSetCurrentLanguage = () => {\n return useSetAtom(currentLanguageAtom);\n};\n","import { STORAGE_KEYS } from '@/constants/storageKeys';\nimport { useAtomValue, useSetAtom } from 'jotai';\nimport { atomWithStorage } from 'jotai/utils';\n\nconst logoSrcAtom = atomWithStorage<string>(\n STORAGE_KEYS.currentLogoSrc,\n 'assets/images/logo/daedong-door-logo-b.png',\n);\n\n/**\n * 현재 로고 경로 조회 훅\n */\nexport const useGetLogoSrc = () => {\n return useAtomValue(logoSrcAtom);\n};\n\n/**\n * 현재 로고 경로 설정 훅\n */\nexport const useSetLogoSrc = () => {\n return useSetAtom(logoSrcAtom);\n};\n","import { STORAGE_KEYS } from '@/constants/storageKeys';\nimport { useAtomValue, useSetAtom } from 'jotai';\nimport { atomWithStorage } from 'jotai/utils';\n\nexport interface CurrentUser {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n [key: string]: any;\n}\n\nconst currentUserAtom = atomWithStorage<CurrentUser | undefined>(\n STORAGE_KEYS.currentUser,\n undefined,\n);\n\n/**\n * 현재 사용자 정보 조회\n */\nexport const useGetCurrentUser = () => {\n return useAtomValue(currentUserAtom);\n};\n\n/**\n * 현재 사용자 정보 설정\n */\nexport const useSetCurrentUser = () => {\n return useSetAtom(currentUserAtom);\n};\n","import { STORAGE_KEYS } from '@/constants/storageKeys';\nimport type { OwpNavItemType } from '@/types/OwpNavigationTypes';\nimport { useAtomValue, useSetAtom } from 'jotai';\nimport { atomWithStorage } from 'jotai/utils';\n\nconst navigationAtom = atomWithStorage<OwpNavItemType[] | undefined>(\n STORAGE_KEYS.navigationList,\n undefined,\n);\n\n/**\n * 내비게이션 목록 조회 훅\n */\nexport const useGetNavigationList = () => {\n return useAtomValue(navigationAtom);\n};\n\n/**\n * 내비게이션 목록 설정 훅\n */\nexport const useSetNavigationList = () => {\n return useSetAtom(navigationAtom);\n};\n","import { STORAGE_KEYS } from '@/constants/storageKeys';\nimport { useAtomValue, useSetAtom } from 'jotai';\nimport { atomWithStorage } from 'jotai/utils';\n\nconst currentShortcutsAtom = atomWithStorage<Array<string> | []>(STORAGE_KEYS.currentShortcuts, []);\n\n/**\n * 바로가기 목록 조회 훅\n */\nexport const useGetShortcuts = () => {\n return useAtomValue(currentShortcutsAtom);\n};\n\n/**\n * 바로가기 목록 설정 훅\n */\nexport const useSetShortcuts = () => {\n return useSetAtom(currentShortcutsAtom);\n};\n"],"names":["trimEnd","str","chars","endIndex","OwpAppContext","createContext","OwpAppProvider","__name","configs","slots","slotProps","children","env","value","useRef","setEnv","useStorage","useLayoutEffect","useOwpAppContext","context","useContext","guard","trimEnd$1","getDefaultValueFromKey","key","lastSeparatorIndex","useOwpTranslation","i18nT","restProps","useTranslation","args","options","optionsObject","isPlainObject","isOptionsObject","hasDefaultValue","defaultValue","nextOptions","CONFIRM_TRANSLATIONS","mergeOkButtonProps","defaultColor","okButtonProps","useConfirm","dialogs","useDialogs","t","translateConfirmText","confirmBase","props","ConfirmDialog","title","okText","severity","cancelText","payload","open","onClose","cancelButtonProps","useInfo","jsxs","Dialog","jsx","DialogContent","Typography","DialogActions","Button","useTimeout","callback","delay","callbackRef","useEffect","timer","commonCodeAtom","atomWithStorage","STORAGE_KEYS","useGetCommonCodeList","useAtomValue","useSetCommonCodeList","useSetAtom","useAppDispatch","useDispatch","useAppSelector","useSelector","useAppStore","useStore","currentLanguageAtom","useGetLanguageList","useGetCurrentLanguage","useSetCurrentLanguage","logoSrcAtom","useGetLogoSrc","useSetLogoSrc","currentUserAtom","useGetCurrentUser","useSetCurrentUser","navigationAtom","useGetNavigationList","useSetNavigationList","currentShortcutsAtom","useGetShortcuts","useSetShortcuts"],"mappings":";;;;;;;;;;;;;AAAA,SAASA,EAAQC,GAAKC,GAAO;AACzB,MAAIA,MAAU;AACV,WAAOD,EAAI,QAAO;AAEtB,MAAIE,IAAWF,EAAI;AACnB,UAAQ,OAAOC,GAAK;AAAA,IAChB,KAAK,UAAU;AACX,UAAIA,EAAM,WAAW;AACjB,cAAM,IAAI,MAAM,4DAA4D;AAEhF,aAAOC,IAAW,KAAKF,EAAIE,IAAW,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":[0,2]}
|
|
1
|
+
{"version":3,"file":"useShortcuts-BjtlXprQ.js","sources":["../../../node_modules/.pnpm/es-toolkit@1.39.10/node_modules/es-toolkit/dist/string/trimEnd.mjs","../src/contexts/OwpAppProvider.tsx","../../../node_modules/.pnpm/es-toolkit@1.39.10/node_modules/es-toolkit/dist/compat/string/trimEnd.mjs","../src/hooks/useOwpTranslation.ts","../src/hooks/useConfirm.tsx","../src/hooks/useTimeout.ts","../src/hooks/useCommonCodeList.ts","../src/hooks/useAppStore.ts","../src/hooks/useCurrentLanguage.ts","../src/hooks/useLogoSrc.ts","../src/hooks/useCurrentUser.ts","../src/hooks/useNavigation.ts","../src/hooks/useShortcuts.ts"],"sourcesContent":["function trimEnd(str, chars) {\n if (chars === undefined) {\n return str.trimEnd();\n }\n let endIndex = str.length;\n switch (typeof chars) {\n case 'string': {\n if (chars.length !== 1) {\n throw new Error(`The 'chars' parameter should be a single character string.`);\n }\n while (endIndex > 0 && str[endIndex - 1] === chars) {\n endIndex--;\n }\n break;\n }\n case 'object': {\n while (endIndex > 0 && chars.includes(str[endIndex - 1])) {\n endIndex--;\n }\n }\n }\n return str.substring(0, endIndex);\n}\n\nexport { trimEnd };\n","import type { OwpSettingsConfigType, OwpThemesType } from '@/types/OwpSettingsTypes';\nimport type { OwpNavItemType } from '@/types/OwpNavigationTypes';\nimport { useStorage } from '@/hooks/useStorage';\nimport {\n CSSProperties,\n ComponentType,\n createContext,\n ReactNode,\n useContext,\n useLayoutEffect,\n useRef,\n} from 'react';\nimport { PartialDeep } from 'type-fest';\n\n/**\n * Logo slot props\n */\nexport interface OwpLogoSlotProps {\n className?: string;\n style?: CSSProperties;\n}\n\nexport interface OwpAppConfigs {\n routesConfig: any;\n settingsConfig?: PartialDeep<OwpSettingsConfigType>;\n themesConfig?: PartialDeep<OwpThemesType>;\n navigationConfig: OwpNavItemType[];\n}\n\n/**\n * App slots\n */\nexport interface OwpAppSlots {\n logo?: ComponentType<OwpLogoSlotProps>;\n}\n\nexport interface OwpAppSlotProps {\n logo?: OwpLogoSlotProps;\n}\n\nexport interface OwpAppEnv {\n apiBaseUrl?: string;\n isAccessTokenGuardEnabled?: boolean;\n isAutoLogoutEnabled?: boolean;\n autoLogoutIdleTimeoutMs?: number;\n isBackendNavigationEnabled?: boolean;\n isErrorMessageEnabled?: boolean;\n isI18nEnabled?: boolean;\n isI18nLanguageSwitcherEnabled?: boolean;\n isPasswordChangeEnabled?: boolean;\n [key: string]: unknown;\n}\n\nexport interface OwpAppContextValue extends OwpAppConfigs {\n env?: OwpAppEnv;\n slots?: OwpAppSlots;\n slotProps?: OwpAppSlotProps;\n}\n\nexport const OwpAppContext = createContext<OwpAppContextValue | undefined>(undefined);\n\nexport interface OwpAppProviderProps {\n configs: OwpAppConfigs;\n slots?: OwpAppSlots;\n slotProps?: OwpAppSlotProps;\n children?: ReactNode;\n env?: OwpAppEnv;\n}\n\nexport const OwpAppProvider = ({\n configs,\n slots,\n slotProps,\n children,\n env,\n}: OwpAppProviderProps) => {\n const value = useRef<OwpAppContextValue>({ ...configs, env, slots, slotProps });\n const { setEnv } = useStorage();\n\n useLayoutEffect(() => {\n setEnv(env ?? {});\n }, [env, setEnv]);\n\n return <OwpAppContext.Provider value={value.current}>{children}</OwpAppContext.Provider>;\n};\n\nexport const useOwpAppContext = () => {\n const context = useContext(OwpAppContext);\n\n if (context === undefined) {\n throw new Error('useOwpAppContext must be used within a OwpAppProvider');\n }\n\n return context;\n};\n","import { trimEnd as trimEnd$1 } from '../../string/trimEnd.mjs';\n\nfunction trimEnd(str, chars, guard) {\n if (str == null) {\n return '';\n }\n if (guard != null || chars == null) {\n return str.toString().trimEnd();\n }\n return trimEnd$1(str, chars.toString().split(''));\n}\n\nexport { trimEnd };\n","import { isPlainObject, trimEnd } from 'es-toolkit/compat';\nimport { useTranslation } from 'react-i18next';\n\n/**\n * 번역 키 기본 라벨 추출\n * @param key 번역 키\n */\nconst getDefaultValueFromKey = (key: string) => {\n if (!key.includes('.')) {\n return undefined;\n }\n\n const normalizedKey = trimEnd(key, '.');\n const lastSeparatorIndex = normalizedKey.lastIndexOf('.');\n\n if (lastSeparatorIndex < 0) {\n return key;\n }\n\n return key.slice(lastSeparatorIndex + 1);\n};\n\n/**\n * OWP 번역 훅\n */\nexport const useOwpTranslation = () => {\n const { t: i18nT, ...restProps } = useTranslation('owp');\n\n const t: typeof i18nT = ((...args: Parameters<typeof i18nT>) => {\n const [key, options] = args;\n const optionsObject = isPlainObject(options) ? (options as Record<string, unknown>) : undefined;\n const isOptionsObject = Boolean(optionsObject);\n const hasDefaultValue =\n isOptionsObject && Object.prototype.hasOwnProperty.call(optionsObject, 'defaultValue');\n const canInjectDefaultValue = options == null || isOptionsObject;\n\n if (canInjectDefaultValue && !hasDefaultValue && typeof key === 'string') {\n const defaultValue = getDefaultValueFromKey(key);\n\n if (defaultValue) {\n const nextOptions = isOptionsObject ? { ...optionsObject, defaultValue } : { defaultValue };\n\n return i18nT(...([key, nextOptions, ...args.slice(2)] as Parameters<typeof i18nT>));\n }\n }\n\n return i18nT(...args);\n }) as typeof i18nT;\n\n return { t, ...restProps };\n};\n","import {\n Button,\n ButtonProps,\n Dialog,\n DialogActions,\n DialogContent,\n Typography,\n} from '@mui/material';\nimport { useOwpTranslation } from '@/hooks/useOwpTranslation';\nimport { DialogProps, useDialogs } from '@toolpad/core/useDialogs';\nimport { ReactNode } from 'react';\n\nexport interface ConfirmProps {\n title?: ReactNode | string;\n okText?: string;\n cancelText?: string;\n severity?: 'primary' | 'secondary' | 'error' | 'info' | 'success' | 'warning';\n useInfo?: boolean;\n okButtonProps?: ButtonProps;\n onClose?: (result: boolean) => Promise<void>;\n}\ninterface ConfirmBaseProps extends ConfirmProps {\n okButtonProps?: ButtonProps;\n cancelButtonProps?: ButtonProps;\n}\n\ninterface ConfirmTranslationConfig {\n key: string;\n defaultValue: string;\n}\n\n/**\n * 확인 대화상자 번역 설정\n */\nconst CONFIRM_TRANSLATIONS = {\n infoTitle: {\n key: 'Message.처리하시겠습니까',\n defaultValue: '처리하시겠습니까?',\n },\n infoOk: {\n key: 'Button.확인',\n defaultValue: '확인',\n },\n saveTitle: {\n key: 'Message.저장하시겠습니까?',\n defaultValue: '저장하시겠습니까?',\n },\n saveOk: {\n key: 'Button.저장',\n defaultValue: '저장',\n },\n updateTitle: {\n key: 'Message.수정하시겠습니까?',\n defaultValue: '수정하시겠습니까?',\n },\n updateOk: {\n key: 'Button.수정',\n defaultValue: '수정',\n },\n deleteTitle: {\n key: 'Message.삭제하시겠습니까?',\n defaultValue: '삭제하시겠습니까?',\n },\n deleteOk: {\n key: 'Button.삭제',\n defaultValue: '삭제',\n },\n cancel: {\n key: 'Button.취소',\n defaultValue: '취소',\n },\n} as const;\n\n/**\n * 확인 버튼 속성 병합\n * @param defaultColor 기본 버튼 색상\n * @param okButtonProps 사용자 버튼 속성\n */\nconst mergeOkButtonProps = (\n defaultColor: ButtonProps['color'] | undefined,\n okButtonProps?: ButtonProps,\n) => {\n if (!defaultColor) {\n return okButtonProps;\n }\n\n return {\n color: defaultColor,\n ...okButtonProps,\n } as ButtonProps;\n};\n/**\n * 확인 대화상자 훅\n */\nexport const useConfirm = () => {\n const dialogs = useDialogs();\n const { t } = useOwpTranslation();\n\n const translateConfirmText = ({ key, defaultValue }: ConfirmTranslationConfig) =>\n t(key, { defaultValue });\n\n const confirmBase = (props: ConfirmBaseProps) => dialogs.open(ConfirmDialog, props);\n\n return {\n confirm: confirmBase,\n confirmInfo: async ({ title, okText, severity }: ConfirmProps | undefined = {}) => {\n return confirmBase({\n title:\n title ?? translateConfirmText(CONFIRM_TRANSLATIONS.infoTitle),\n okText: okText ?? translateConfirmText(CONFIRM_TRANSLATIONS.infoOk),\n severity: severity ?? 'primary',\n useInfo: true,\n });\n },\n confirmSave: async ({\n title,\n okText,\n cancelText,\n okButtonProps,\n }: ConfirmProps | undefined = {}) => {\n return confirmBase({\n title: title ?? translateConfirmText(CONFIRM_TRANSLATIONS.saveTitle),\n okText: okText ?? translateConfirmText(CONFIRM_TRANSLATIONS.saveOk),\n cancelText,\n okButtonProps: mergeOkButtonProps('secondary', okButtonProps),\n });\n },\n confirmUpdate: async ({\n title,\n okText,\n cancelText,\n okButtonProps,\n }: ConfirmProps | undefined = {}) => {\n return confirmBase({\n title: title ?? translateConfirmText(CONFIRM_TRANSLATIONS.updateTitle),\n okText: okText ?? translateConfirmText(CONFIRM_TRANSLATIONS.updateOk),\n cancelText,\n okButtonProps: mergeOkButtonProps('secondary', okButtonProps),\n });\n },\n confirmDelete: async ({\n title,\n okText,\n cancelText,\n okButtonProps,\n }: ConfirmProps | undefined = {}) => {\n return confirmBase({\n title: title ?? translateConfirmText(CONFIRM_TRANSLATIONS.deleteTitle),\n okText: okText ?? translateConfirmText(CONFIRM_TRANSLATIONS.deleteOk),\n cancelText,\n okButtonProps: mergeOkButtonProps('error', okButtonProps),\n });\n },\n };\n};\n\nconst ConfirmDialog = ({ payload, open, onClose }: DialogProps<ConfirmBaseProps, boolean>) => {\n const { title, okButtonProps, cancelButtonProps, severity, useInfo } = payload;\n\n const { t } = useOwpTranslation();\n\n const okText =\n payload?.okText ?? t(CONFIRM_TRANSLATIONS.infoOk.key, { defaultValue: CONFIRM_TRANSLATIONS.infoOk.defaultValue });\n const cancelText =\n payload?.cancelText ?? t(CONFIRM_TRANSLATIONS.cancel.key, { defaultValue: CONFIRM_TRANSLATIONS.cancel.defaultValue });\n\n return (\n <Dialog fullWidth maxWidth=\"xs\" open={open} onClose={() => onClose(false)}>\n <DialogContent>\n <Typography className=\"mb-12\" variant=\"h6\">\n {title}\n </Typography>\n </DialogContent>\n <DialogActions>\n {!useInfo && (\n <Button {...cancelButtonProps} variant=\"outlined\" onClick={() => onClose(false)}>\n {cancelText}\n </Button>\n )}\n <Button\n color={severity ? severity : 'primary'}\n variant=\"contained\"\n {...okButtonProps}\n onClick={() => onClose(true)}\n >\n {okText}\n </Button>\n </DialogActions>\n </Dialog>\n );\n};\n","import { useEffect, useRef } from 'react';\n\n/**\n * The useTimeout function is a custom hook that sets a timeout for a given callback function.\n * It takes in a callback function and a delay time in milliseconds as parameters.\n * It returns nothing.\n */\nexport function useTimeout(callback: () => void, delay: number) {\n const callbackRef = useRef(callback);\n\n useEffect(() => {\n callbackRef.current = callback;\n }, [callback]);\n\n useEffect(() => {\n let timer: NodeJS.Timeout | undefined;\n\n if (delay !== null && callback && typeof callback === 'function') {\n timer = setTimeout(callbackRef.current, delay);\n }\n\n return () => {\n if (timer) {\n clearTimeout(timer);\n }\n };\n }, [callback, delay]);\n}\n","import { STORAGE_KEYS } from '@/constants/storageKeys';\nimport { CommonCode } from '@/utils/commonCodeUtils';\nimport { useAtomValue, useSetAtom } from 'jotai';\nimport { atomWithStorage } from 'jotai/utils';\n\nconst commonCodeAtom = atomWithStorage<\n | {\n [codeId: string]: Array<CommonCode>;\n }\n | undefined\n>(STORAGE_KEYS.commonCodeList, undefined);\n\n/**\n * 공통코드 목록 조회 훅\n */\nexport const useGetCommonCodeList = () => {\n return useAtomValue(commonCodeAtom);\n};\n\n/**\n * 공통코드 목록 설정 훅\n */\nexport const useSetCommonCodeList = () => {\n return useSetAtom(commonCodeAtom);\n};\n","import { useDispatch, useSelector, useStore } from 'react-redux';\nimport type { AppDispatch, AppStore, RootState } from '@/store/store';\n\n/**\n * Internal typed Redux hooks\n */\nexport const useAppDispatch: () => AppDispatch = useDispatch.withTypes<AppDispatch>();\nexport const useAppSelector: <T>(selector: (state: RootState) => T) => T =\n useSelector.withTypes<RootState>();\nexport const useAppStore: () => AppStore = useStore.withTypes<AppStore>();\n","export { FALLBACK_LANGUAGE_LIST } from '@/constants/language';\nimport { STORAGE_KEYS } from '@/constants/storageKeys';\nimport { useOwpTranslation } from '@/hooks/useOwpTranslation';\nimport { useAtomValue, useSetAtom } from 'jotai';\nimport { atomWithStorage } from 'jotai/utils';\n\nexport type CurrentLanguage = { id: 'en' | 'kr' | 'lc'; title: string; flag: string };\n\nconst currentLanguageAtom = atomWithStorage<CurrentLanguage>(STORAGE_KEYS.currentLanguage, {\n id: 'kr',\n title: '한국어',\n flag: 'KR',\n});\n\n/**\n * 언어 목록 조회 훅\n */\nexport const useGetLanguageList = (): CurrentLanguage[] => {\n const { t } = useOwpTranslation();\n return [\n { id: 'kr', title: t('Common.한국어', { defaultValue: '한국어' }), flag: 'KR' },\n {\n id: 'en',\n title: t('Common.English', { defaultValue: 'English' }),\n flag: 'EN',\n },\n { id: 'lc', title: t('Common.Etc', { defaultValue: 'Etc' }), flag: 'LC' },\n ];\n};\n\n/**\n * 현재 언어 조회 훅\n */\nexport const useGetCurrentLanguage = () => {\n return useAtomValue(currentLanguageAtom);\n};\n\n/**\n * 현재 언어 설정 훅\n */\nexport const useSetCurrentLanguage = () => {\n return useSetAtom(currentLanguageAtom);\n};\n","import { STORAGE_KEYS } from '@/constants/storageKeys';\nimport { useAtomValue, useSetAtom } from 'jotai';\nimport { atomWithStorage } from 'jotai/utils';\n\nconst logoSrcAtom = atomWithStorage<string>(\n STORAGE_KEYS.currentLogoSrc,\n 'assets/images/logo/daedong-door-logo-b.png',\n);\n\n/**\n * 현재 로고 경로 조회 훅\n */\nexport const useGetLogoSrc = () => {\n return useAtomValue(logoSrcAtom);\n};\n\n/**\n * 현재 로고 경로 설정 훅\n */\nexport const useSetLogoSrc = () => {\n return useSetAtom(logoSrcAtom);\n};\n","import { STORAGE_KEYS } from '@/constants/storageKeys';\nimport { useAtomValue, useSetAtom } from 'jotai';\nimport { atomWithStorage } from 'jotai/utils';\n\nexport interface CurrentUser {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n [key: string]: any;\n}\n\nconst currentUserAtom = atomWithStorage<CurrentUser | undefined>(\n STORAGE_KEYS.currentUser,\n undefined,\n);\n\n/**\n * 현재 사용자 정보 조회\n */\nexport const useGetCurrentUser = () => {\n return useAtomValue(currentUserAtom);\n};\n\n/**\n * 현재 사용자 정보 설정\n */\nexport const useSetCurrentUser = () => {\n return useSetAtom(currentUserAtom);\n};\n","import { STORAGE_KEYS } from '@/constants/storageKeys';\nimport type { OwpNavItemType } from '@/types/OwpNavigationTypes';\nimport { useAtomValue, useSetAtom } from 'jotai';\nimport { atomWithStorage } from 'jotai/utils';\n\nconst navigationAtom = atomWithStorage<OwpNavItemType[] | undefined>(\n STORAGE_KEYS.navigationList,\n undefined,\n);\n\n/**\n * 내비게이션 목록 조회 훅\n */\nexport const useGetNavigationList = () => {\n return useAtomValue(navigationAtom);\n};\n\n/**\n * 내비게이션 목록 설정 훅\n */\nexport const useSetNavigationList = () => {\n return useSetAtom(navigationAtom);\n};\n","import { STORAGE_KEYS } from '@/constants/storageKeys';\nimport { useAtomValue, useSetAtom } from 'jotai';\nimport { atomWithStorage } from 'jotai/utils';\n\nconst currentShortcutsAtom = atomWithStorage<Array<string> | []>(STORAGE_KEYS.currentShortcuts, []);\n\n/**\n * 바로가기 목록 조회 훅\n */\nexport const useGetShortcuts = () => {\n return useAtomValue(currentShortcutsAtom);\n};\n\n/**\n * 바로가기 목록 설정 훅\n */\nexport const useSetShortcuts = () => {\n return useSetAtom(currentShortcutsAtom);\n};\n"],"names":["trimEnd","str","chars","endIndex","OwpAppContext","createContext","OwpAppProvider","__name","configs","slots","slotProps","children","env","value","useRef","setEnv","useStorage","useLayoutEffect","useOwpAppContext","context","useContext","guard","trimEnd$1","getDefaultValueFromKey","key","lastSeparatorIndex","useOwpTranslation","i18nT","restProps","useTranslation","args","options","optionsObject","isPlainObject","isOptionsObject","hasDefaultValue","defaultValue","nextOptions","CONFIRM_TRANSLATIONS","mergeOkButtonProps","defaultColor","okButtonProps","useConfirm","dialogs","useDialogs","t","translateConfirmText","confirmBase","props","ConfirmDialog","title","okText","severity","cancelText","payload","open","onClose","cancelButtonProps","useInfo","jsxs","Dialog","jsx","DialogContent","Typography","DialogActions","Button","useTimeout","callback","delay","callbackRef","useEffect","timer","commonCodeAtom","atomWithStorage","STORAGE_KEYS","useGetCommonCodeList","useAtomValue","useSetCommonCodeList","useSetAtom","useAppDispatch","useDispatch","useAppSelector","useSelector","useAppStore","useStore","currentLanguageAtom","useGetLanguageList","useGetCurrentLanguage","useSetCurrentLanguage","logoSrcAtom","useGetLogoSrc","useSetLogoSrc","currentUserAtom","useGetCurrentUser","useSetCurrentUser","navigationAtom","useGetNavigationList","useSetNavigationList","currentShortcutsAtom","useGetShortcuts","useSetShortcuts"],"mappings":";;;;;;;;;;;;;AAAA,SAASA,EAAQC,GAAKC,GAAO;AACzB,MAAIA,MAAU;AACV,WAAOD,EAAI,QAAO;AAEtB,MAAIE,IAAWF,EAAI;AACnB,UAAQ,OAAOC,GAAK;AAAA,IAChB,KAAK,UAAU;AACX,UAAIA,EAAM,WAAW;AACjB,cAAM,IAAI,MAAM,4DAA4D;AAEhF,aAAOC,IAAW,KAAKF,EAAIE,IAAW,CAAC,MAAMD;AACzC,QAAAC;AAEJ;AAAA,IACJ;AAAA,IACA,KAAK;AACD,aAAOA,IAAW,KAAKD,EAAM,SAASD,EAAIE,IAAW,CAAC,CAAC;AACnD,QAAAA;AAAA,EAGhB;AACI,SAAOF,EAAI,UAAU,GAAGE,CAAQ;AACpC;AAtBSH,EAAAA,GAAAA;AC2DF,MAAMI,IAAgBC,EAA8C,MAAS,GAUvEC,KAAiB,gBAAAC,EAAA,CAAC;AAAA,EAC7B,SAAAC;AAAA,EACA,OAAAC;AAAA,EACA,WAAAC;AAAA,EACA,UAAAC;AAAA,EACA,KAAAC;AACF,MAA2B;AACzB,QAAMC,IAAQC,EAA2B,EAAE,GAAGN,GAAS,KAAAI,GAAK,OAAAH,GAAO,WAAAC,GAAW,GACxE,EAAE,QAAAK,EAAA,IAAWC,EAAA;AAEnB,SAAAC,EAAgB,MAAM;AACpB,IAAAF,EAAOH,KAAO,EAAE;AAAA,EAClB,GAAG,CAACA,GAAKG,CAAM,CAAC,qBAERX,EAAc,UAAd,EAAuB,OAAOS,EAAM,SAAU,UAAAF,GAAS;AACjE,GAf8B,mBAiBjBO,KAAmB,gBAAAX,EAAA,MAAM;AACpC,Q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,EACb;AACF,GAKamB,KAAoB,gBAAAtF,EAAA,MACxBqE,EAAagB,CAAe,GADJ,sBAOpBE,KAAoB,gBAAAvF,EAAA,MACxBuE,EAAWc,CAAe,GADF,sBCnB3BG,IAAiBtB;AAAA,EACrBC,EAAa;AAAA,EACb;AACF,GAKasB,KAAuB,gBAAAzF,EAAA,MAC3BqE,EAAamB,CAAc,GADA,yBAOvBE,KAAuB,gBAAA1F,EAAA,MAC3BuE,EAAWiB,CAAc,GADE,yBChB9BG,IAAuBzB,EAAoCC,EAAa,kBAAkB,CAAA,CAAE,GAKrFyB,KAAkB,gBAAA5F,EAAA,MACtBqE,EAAasB,CAAoB,GADX,oBAOlBE,KAAkB,gBAAA7F,EAAA,MACtBuE,EAAWoB,CAAoB,GADT;","x_google_ignoreList":[0,2]}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
var E = Object.defineProperty;
|
|
2
|
+
var n = (s, a) => E(s, "name", { value: a, configurable: !0 });
|
|
3
|
+
import { useTheme as b } from "@mui/material/styles";
|
|
4
|
+
import { useState as T, useEffect as v, useRef as G } from "react";
|
|
5
|
+
import { g as M, e as y } from "./treeGridUtil-CPNva4kL.js";
|
|
6
|
+
import { b as A } from "./useShortcuts-BjtlXprQ.js";
|
|
7
|
+
function B(s, a, { signal: e, edges: i } = {}) {
|
|
8
|
+
let l, u = null;
|
|
9
|
+
const t = i != null && i.includes("leading"), r = i == null || i.includes("trailing"), o = /* @__PURE__ */ n(() => {
|
|
10
|
+
u !== null && (s.apply(l, u), l = void 0, u = null);
|
|
11
|
+
}, "invoke"), d = /* @__PURE__ */ n(() => {
|
|
12
|
+
r && o(), p();
|
|
13
|
+
}, "onTimerEnd");
|
|
14
|
+
let c = null;
|
|
15
|
+
const m = /* @__PURE__ */ n(() => {
|
|
16
|
+
c != null && clearTimeout(c), c = setTimeout(() => {
|
|
17
|
+
c = null, d();
|
|
18
|
+
}, a);
|
|
19
|
+
}, "schedule"), f = /* @__PURE__ */ n(() => {
|
|
20
|
+
c !== null && (clearTimeout(c), c = null);
|
|
21
|
+
}, "cancelTimer"), p = /* @__PURE__ */ n(() => {
|
|
22
|
+
f(), l = void 0, u = null;
|
|
23
|
+
}, "cancel"), x = /* @__PURE__ */ n(() => {
|
|
24
|
+
o();
|
|
25
|
+
}, "flush"), h = /* @__PURE__ */ n(function(...g) {
|
|
26
|
+
if (e != null && e.aborted)
|
|
27
|
+
return;
|
|
28
|
+
l = this, u = g;
|
|
29
|
+
const w = c == null;
|
|
30
|
+
m(), t && w && o();
|
|
31
|
+
}, "debounced");
|
|
32
|
+
return h.schedule = m, h.cancel = p, h.flush = x, e == null || e.addEventListener("abort", p, { once: !0 }), h;
|
|
33
|
+
}
|
|
34
|
+
n(B, "debounce$1");
|
|
35
|
+
function j(s, a = 0, e = {}) {
|
|
36
|
+
typeof e != "object" && (e = {});
|
|
37
|
+
const { leading: i = !1, trailing: l = !0, maxWait: u } = e, t = Array(2);
|
|
38
|
+
i && (t[0] = "leading"), l && (t[1] = "trailing");
|
|
39
|
+
let r, o = null;
|
|
40
|
+
const d = B(function(...f) {
|
|
41
|
+
r = s.apply(this, f), o = null;
|
|
42
|
+
}, a, { edges: t }), c = /* @__PURE__ */ n(function(...f) {
|
|
43
|
+
return u != null && (o === null && (o = Date.now()), Date.now() - o >= u) ? (r = s.apply(this, f), o = Date.now(), d.cancel(), d.schedule(), r) : (d.apply(this, f), r);
|
|
44
|
+
}, "debounced"), m = /* @__PURE__ */ n(() => (d.flush(), r), "flush");
|
|
45
|
+
return c.cancel = d.cancel, c.flush = m, c;
|
|
46
|
+
}
|
|
47
|
+
n(j, "debounce");
|
|
48
|
+
function k(s) {
|
|
49
|
+
const a = b(), e = s(a).replace("@media ", "");
|
|
50
|
+
function i(t) {
|
|
51
|
+
return window.matchMedia(t).matches;
|
|
52
|
+
}
|
|
53
|
+
n(i, "getMatches");
|
|
54
|
+
const [l, u] = T(i(e));
|
|
55
|
+
return v(
|
|
56
|
+
() => {
|
|
57
|
+
const t = window.matchMedia(e);
|
|
58
|
+
u(i(e));
|
|
59
|
+
const r = /* @__PURE__ */ n((o) => u(o.matches), "handler");
|
|
60
|
+
return t.addEventListener("change", r), () => t.removeEventListener("change", r);
|
|
61
|
+
},
|
|
62
|
+
[e]
|
|
63
|
+
), l;
|
|
64
|
+
}
|
|
65
|
+
n(k, "useThemeMediaQuery");
|
|
66
|
+
const q = /* @__PURE__ */ n((s) => {
|
|
67
|
+
const { t: a } = A(), e = G(!1), [i, l] = T(!1);
|
|
68
|
+
return { exportByTreeGrid: /* @__PURE__ */ n(async (t) => {
|
|
69
|
+
if (e.current)
|
|
70
|
+
return;
|
|
71
|
+
e.current = !0, l(!0);
|
|
72
|
+
const r = M(s);
|
|
73
|
+
try {
|
|
74
|
+
return typeof t == "string" ? await y(r, { exportName: t, t: a }) : await y(r, {
|
|
75
|
+
...t,
|
|
76
|
+
t: a
|
|
77
|
+
});
|
|
78
|
+
} finally {
|
|
79
|
+
e.current = !1, l(!1);
|
|
80
|
+
}
|
|
81
|
+
}, "exportByTreeGrid"), isExporting: i };
|
|
82
|
+
}, "useTreeGridExcelExport");
|
|
83
|
+
export {
|
|
84
|
+
q as a,
|
|
85
|
+
j as d,
|
|
86
|
+
k as u
|
|
87
|
+
};
|
|
88
|
+
//# sourceMappingURL=useTreeGridExcelExport-Bfxx0cps.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useTreeGridExcelExport-Bfxx0cps.js","sources":["../../../node_modules/.pnpm/es-toolkit@1.39.10/node_modules/es-toolkit/dist/function/debounce.mjs","../../../node_modules/.pnpm/es-toolkit@1.39.10/node_modules/es-toolkit/dist/compat/function/debounce.mjs","../src/hooks/useThemeMediaQuery.ts","../src/hooks/useTreeGridExcelExport.ts"],"sourcesContent":["function debounce(func, debounceMs, { signal, edges } = {}) {\n let pendingThis = undefined;\n let pendingArgs = null;\n const leading = edges != null && edges.includes('leading');\n const trailing = edges == null || edges.includes('trailing');\n const invoke = () => {\n if (pendingArgs !== null) {\n func.apply(pendingThis, pendingArgs);\n pendingThis = undefined;\n pendingArgs = null;\n }\n };\n const onTimerEnd = () => {\n if (trailing) {\n invoke();\n }\n cancel();\n };\n let timeoutId = null;\n const schedule = () => {\n if (timeoutId != null) {\n clearTimeout(timeoutId);\n }\n timeoutId = setTimeout(() => {\n timeoutId = null;\n onTimerEnd();\n }, debounceMs);\n };\n const cancelTimer = () => {\n if (timeoutId !== null) {\n clearTimeout(timeoutId);\n timeoutId = null;\n }\n };\n const cancel = () => {\n cancelTimer();\n pendingThis = undefined;\n pendingArgs = null;\n };\n const flush = () => {\n invoke();\n };\n const debounced = function (...args) {\n if (signal?.aborted) {\n return;\n }\n pendingThis = this;\n pendingArgs = args;\n const isFirstCall = timeoutId == null;\n schedule();\n if (leading && isFirstCall) {\n invoke();\n }\n };\n debounced.schedule = schedule;\n debounced.cancel = cancel;\n debounced.flush = flush;\n signal?.addEventListener('abort', cancel, { once: true });\n return debounced;\n}\n\nexport { debounce };\n","import { debounce as debounce$1 } from '../../function/debounce.mjs';\n\nfunction debounce(func, debounceMs = 0, options = {}) {\n if (typeof options !== 'object') {\n options = {};\n }\n const { leading = false, trailing = true, maxWait } = options;\n const edges = Array(2);\n if (leading) {\n edges[0] = 'leading';\n }\n if (trailing) {\n edges[1] = 'trailing';\n }\n let result = undefined;\n let pendingAt = null;\n const _debounced = debounce$1(function (...args) {\n result = func.apply(this, args);\n pendingAt = null;\n }, debounceMs, { edges });\n const debounced = function (...args) {\n if (maxWait != null) {\n if (pendingAt === null) {\n pendingAt = Date.now();\n }\n if (Date.now() - pendingAt >= maxWait) {\n result = func.apply(this, args);\n pendingAt = Date.now();\n _debounced.cancel();\n _debounced.schedule();\n return result;\n }\n }\n _debounced.apply(this, args);\n return result;\n };\n const flush = () => {\n _debounced.flush();\n return result;\n };\n debounced.cancel = _debounced.cancel;\n debounced.flush = flush;\n return debounced;\n}\n\nexport { debounce };\n","import { useTheme, type Theme } from '@mui/material/styles';\nimport { useEffect, useState } from 'react';\n\n/**\n * The useThemeMediaQuery function is a custom hook that returns a boolean indicating whether the current screen matches the specified media query.\n * It takes in a themeCallbackFunc as a parameter, which is a function that returns a string representing the media query to match.\n * It returns a boolean indicating whether the current screen matches the specified media query.\n */\nexport function useThemeMediaQuery(themeCallbackFunc: (theme: Theme) => string) {\n const theme = useTheme();\n\n const query = themeCallbackFunc(theme).replace('@media ', '');\n\n \n function getMatches(q: string) {\n return window.matchMedia(q).matches;\n }\n\n const [matches, setMatches] = useState(getMatches(query));\n\n useEffect(\n () => {\n const mediaQuery = window.matchMedia(query);\n\n \n setMatches(getMatches(query));\n\n \n const handler = (event: MediaQueryListEvent) => setMatches(event.matches);\n\n \n mediaQuery.addEventListener('change', handler);\n\n \n return () => mediaQuery.removeEventListener('change', handler);\n },\n [query], \n );\n\n return matches;\n}\n","import {\n ExportTreeGridExcelOptions,\n exportTreeGridExcel,\n} from '@/utils/treeGridExportExcelUtil';\nimport { getTreeGridById } from '@/utils/treeGridUtil';\nimport { useRef, useState } from 'react';\nimport { useOwpTranslation } from './useOwpTranslation';\n\nexport type UseTreeGridExcelExportOptions = Omit<ExportTreeGridExcelOptions, 't'> | string;\n\n/**\n * TreeGrid 엑셀 내보내기 훅\n * @param gridId TreeGrid 인스턴스 ID\n */\nexport const useTreeGridExcelExport = (gridId: string) => {\n const { t } = useOwpTranslation();\n const exportPendingRef = useRef(false);\n const [isExporting, setIsExporting] = useState(false);\n\n \n const exportByTreeGrid = async (options?: UseTreeGridExcelExportOptions) => {\n if (exportPendingRef.current) {\n return;\n }\n\n exportPendingRef.current = true;\n setIsExporting(true);\n\n const grid = getTreeGridById(gridId);\n\n try {\n if (typeof options === 'string') {\n return await exportTreeGridExcel(grid, { exportName: options, t });\n }\n\n return await exportTreeGridExcel(grid, {\n ...options,\n t,\n });\n } finally {\n exportPendingRef.current = false;\n setIsExporting(false);\n }\n };\n\n return { exportByTreeGrid, isExporting };\n};\n"],"names":["debounce","func","debounceMs","signal","edges","pendingThis","pendingArgs","leading","trailing","invoke","__name","onTimerEnd","cancel","timeoutId","schedule","cancelTimer","flush","debounced","args","isFirstCall","options","maxWait","result","pendingAt","_debounced","debounce$1","useThemeMediaQuery","themeCallbackFunc","theme","useTheme","query","getMatches","q","matches","setMatches","useState","useEffect","mediaQuery","handler","event","useTreeGridExcelExport","gridId","t","useOwpTranslation","exportPendingRef","useRef","isExporting","setIsExporting","grid","getTreeGridById","exportTreeGridExcel"],"mappings":";;;;;;AAAA,SAASA,EAASC,GAAMC,GAAY,EAAE,QAAAC,GAAQ,OAAAC,EAAK,IAAK,IAAI;AACxD,MAAIC,GACAC,IAAc;AAClB,QAAMC,IAAUH,KAAS,QAAQA,EAAM,SAAS,SAAS,GACnDI,IAAWJ,KAAS,QAAQA,EAAM,SAAS,UAAU,GACrDK,IAAS,gBAAAC,EAAA,MAAM;AACjB,IAAIJ,MAAgB,SAChBL,EAAK,MAAMI,GAAaC,CAAW,GACnCD,IAAc,QACdC,IAAc;AAAA,EAEtB,GANe,WAOTK,IAAa,gBAAAD,EAAA,MAAM;AACrB,IAAIF,KACAC,EAAM,GAEVG,EAAM;AAAA,EACV,GALmB;AAMnB,MAAIC,IAAY;AAChB,QAAMC,IAAW,gBAAAJ,EAAA,MAAM;AACnB,IAAIG,KAAa,QACb,aAAaA,CAAS,GAE1BA,IAAY,WAAW,MAAM;AACzB,MAAAA,IAAY,MACZF,EAAU;AAAA,IACd,GAAGT,CAAU;AAAA,EACjB,GARiB,aASXa,IAAc,gBAAAL,EAAA,MAAM;AACtB,IAAIG,MAAc,SACd,aAAaA,CAAS,GACtBA,IAAY;AAAA,EAEpB,GALoB,gBAMdD,IAAS,gBAAAF,EAAA,MAAM;AACjB,IAAAK,EAAW,GACXV,IAAc,QACdC,IAAc;AAAA,EAClB,GAJe,WAKTU,IAAQ,gBAAAN,EAAA,MAAM;AAChB,IAAAD,EAAM;AAAA,EACV,GAFc,UAGRQ,IAAY,gBAAAP,EAAA,YAA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