@owp/core 1.30.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/colors/chart.d.ts +3 -0
- package/colors/chart.js +1 -0
- package/contexts.d.ts +3 -0
- package/contexts.js +1 -0
- package/dist/{Close-DnXyQZKh.js → Close-C91nHTKM.js} +280 -282
- package/dist/Close-C91nHTKM.js.map +1 -0
- package/dist/{OwpStoreProvider-Bx5p7ooQ.js → OwpStoreProvider-BPa_lWCz.js} +3 -3
- package/dist/OwpStoreProvider-BPa_lWCz.js.map +1 -0
- package/dist/OwpUtils-DV2LSByd.js +411 -0
- package/dist/OwpUtils-DV2LSByd.js.map +1 -0
- package/dist/colorMap-DP-DCZbV.js +82 -0
- package/dist/colorMap-DP-DCZbV.js.map +1 -0
- package/dist/colors/chart.js +6 -0
- package/dist/colors/chart.js.map +1 -0
- package/dist/colors.js +4 -1
- package/dist/colors.js.map +1 -1
- package/dist/commonCodeUtils-DNfSjP6S.js +42 -0
- package/dist/commonCodeUtils-DNfSjP6S.js.map +1 -0
- package/dist/contexts.js +104 -0
- package/dist/contexts.js.map +1 -0
- package/dist/{owpDark-DAY0F6Ph.js → dark-DAY0F6Ph.js} +1 -1
- package/dist/dark-DAY0F6Ph.js.map +1 -0
- package/dist/emotion-react-jsx-runtime.browser.esm-BMvSswBW.js +1496 -0
- package/dist/emotion-react-jsx-runtime.browser.esm-BMvSswBW.js.map +1 -0
- package/dist/hooks.js +119 -73
- package/dist/hooks.js.map +1 -1
- package/dist/index.css +1 -1
- package/dist/index.js +44321 -96
- package/dist/index.js.map +1 -1
- package/dist/isString-Codtu20I.js +55 -0
- package/dist/isString-Codtu20I.js.map +1 -0
- package/dist/isTypedArray-CCnDZ5HJ.js +609 -0
- package/dist/isTypedArray-CCnDZ5HJ.js.map +1 -0
- package/dist/language-DaxFvPOq.js +35 -0
- package/dist/language-DaxFvPOq.js.map +1 -0
- package/dist/lazyLoadedSlices-C18y0AEB.js +2773 -0
- package/dist/lazyLoadedSlices-C18y0AEB.js.map +1 -0
- package/dist/owp-app.css +1 -1
- package/dist/store.js +2 -2
- package/dist/{toUpper-i_I6Tyuv.js → toUpper-Dmh8Htx_.js} +2 -2
- package/dist/{toUpper-i_I6Tyuv.js.map → toUpper-Dmh8Htx_.js.map} +1 -1
- package/dist/{treeGridUtil-WTM_djsN.js → treeGridUtil-DAfaAk6C.js} +19 -19
- package/dist/{treeGridUtil-WTM_djsN.js.map → treeGridUtil-DAfaAk6C.js.map} +1 -1
- package/dist/types/colors/chart/colorMap.d.ts +8 -0
- package/dist/types/colors/chart/index.d.ts +1 -0
- package/dist/types/colors/index.d.ts +2 -2
- package/dist/types/colors/palettes/index.d.ts +2 -0
- package/dist/types/components/OwpErrorBoundary/OwpErrorBoundary.d.ts +1 -1
- package/dist/types/components/OwpFileUploadButton/OwpFileUploadButton.d.ts +2 -2
- package/dist/types/components/OwpHidden/OwpHidden.d.ts +19 -0
- package/dist/types/components/OwpHidden/index.d.ts +2 -0
- package/dist/types/components/OwpLayout/OwpLayout.d.ts +2 -2
- package/dist/types/components/OwpPageCarded/OwpPageCarded.d.ts +2 -2
- package/dist/types/components/OwpPageCarded/OwpPageCardedSidebar.d.ts +1 -1
- package/dist/types/components/OwpPicker/DatePickerInput.d.ts +1 -1
- package/dist/types/components/OwpStyleProvider/OwpStyleProvider.d.ts +5 -5
- package/dist/types/components/OwpTable/OwpTable.d.ts +1 -3
- package/dist/types/components/OwpTabs/OwpTab.d.ts +2 -4
- package/dist/types/components/OwpTabs/OwpTabs.d.ts +2 -4
- package/dist/types/{default-settings/OwpDefaultSettings.d.ts → configs/defaultConfig.d.ts} +1 -1
- package/dist/types/{components/layouts/layout2/Layout2Config.d.ts → configs/layoutConfig.d.ts} +12 -15
- package/dist/types/{context → contexts}/OwpAppProvider.d.ts +10 -3
- package/dist/types/hooks/index.d.ts +4 -2
- package/dist/types/{store/hooks.d.ts → hooks/useAppStore.d.ts} +1 -1
- package/dist/types/hooks/useCurrentLanguage.d.ts +1 -5
- package/dist/types/hooks/useInitApp.d.ts +8 -0
- package/dist/types/hooks/useInitCommonCodes.d.ts +4 -0
- package/dist/types/hooks/useLogoSrc.d.ts +8 -0
- package/dist/types/hooks/useNavigation.d.ts +3 -18
- package/dist/types/hooks/useOwpTranslation.d.ts +0 -2
- package/dist/types/hooks/useThemeMediaQuery.d.ts +1 -1
- package/dist/types/index.d.ts +3 -29
- package/dist/types/{components/layouts/layout3/Layout3.d.ts → layout/Layout.d.ts} +4 -4
- package/dist/types/layout/components/layouts/FooterLayout.d.ts +9 -0
- package/dist/types/layout/components/layouts/LeftSideLayout.d.ts +6 -0
- package/dist/types/layout/components/layouts/NavbarToggleFabLayout.d.ts +8 -0
- package/dist/types/layout/components/layouts/NavbarWrapperLayout.d.ts +5 -0
- package/dist/types/layout/components/menus/LogoutMenu.d.ts +8 -0
- package/dist/types/layout/components/menus/PasswordChangeMenu.d.ts +8 -0
- package/dist/types/{components/layouts/shared-components → layout/components/menus}/UserMenu.d.ts +1 -1
- package/dist/types/{components/layouts/shared-components → layout/components}/navbar/NavbarPinToggleButton.d.ts +1 -1
- package/dist/types/layout/components/navbar/NavbarToggleButton.d.ts +11 -0
- package/dist/types/layout/components/navbar/style/NavbarStyle.d.ts +5 -0
- package/dist/types/layout/components/navbar/style/NavbarStyleContent.d.ts +9 -0
- package/dist/types/layout/components/navigation/NavBadge.d.ts +17 -0
- package/dist/types/layout/components/navigation/NavItem.d.ts +14 -0
- package/dist/types/layout/components/navigation/Navigation.d.ts +3 -0
- package/dist/types/layout/components/navigation/NavigationMenu.d.ts +23 -0
- package/dist/types/layout/components/navigation/vertical/NavVerticalLayout.d.ts +9 -0
- package/dist/types/layout/components/navigation/vertical/types/NavVerticalCollapse.d.ts +6 -0
- package/dist/types/layout/components/navigation/vertical/types/NavVerticalGroup.d.ts +6 -0
- package/dist/types/layout/components/navigation/vertical/types/NavVerticalItem.d.ts +6 -0
- package/dist/types/layout/components/navigation/vertical/types/NavVerticalLink.d.ts +7 -0
- package/dist/types/layout/components/toggles/FullScreenToggle.d.ts +8 -0
- package/dist/types/layout/components/toggles/LanguageSwitcherToggle.d.ts +9 -0
- package/dist/types/layout/components/toggles/NavigationSearchToggle.d.ts +16 -0
- package/dist/types/layout/components/toggles/NavigationShortcutsToggle.d.ts +9 -0
- package/dist/types/layout/components/toggles/toggleStyles.d.ts +10 -0
- package/dist/types/{components/layouts/layout3/components/FooterLayout3.d.ts → layout/components/toolbar/ToolbarLayout.d.ts} +4 -4
- package/dist/types/{components/layouts → layout}/themeLayoutConfigs.d.ts +2 -4
- package/dist/types/store/index.d.ts +1 -1
- package/dist/types/store/lazyLoadedSlices.d.ts +2 -2
- package/dist/types/{components/layouts/shared-components/navigation/store → store}/navigationSlice.d.ts +10 -10
- package/dist/types/store/owpSettingsSlice.d.ts +18 -1356
- package/dist/types/{components/OwpNavigation/types/OwpNavItemType.d.ts → types/OwpNavigationTypes.d.ts} +14 -4
- package/dist/types/types/OwpSettingsTypes.d.ts +2 -2
- package/dist/types/types/index.d.ts +3 -0
- package/dist/types/utils/getEstimatedTextCellWidth.d.ts +12 -0
- package/dist/types/utils/index.d.ts +2 -0
- package/dist/types/utils/language.d.ts +8 -0
- package/dist/types/{components/OwpNavigation/utils/OwpNavigationHelper.d.ts → utils/navigationUtils.d.ts} +17 -5
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/dist/{usePageLockLoading-BUI_3PlR.js → usePageLockLoading-BGODEt_k.js} +5 -5
- package/dist/usePageLockLoading-BGODEt_k.js.map +1 -0
- package/dist/useShortcuts-BjtlXprQ.js +236 -0
- package/dist/useShortcuts-BjtlXprQ.js.map +1 -0
- package/dist/useTreeGridExcelExport-BE6h1hsO.js +120 -0
- package/dist/useTreeGridExcelExport-BE6h1hsO.js.map +1 -0
- package/dist/utils.js +6911 -6671
- package/dist/utils.js.map +1 -1
- package/owp-app.css +1 -0
- package/package.json +51 -47
- package/types.d.ts +3 -0
- package/types.js +1 -0
- package/context.d.ts +0 -3
- package/context.js +0 -1
- package/dist/Close-DnXyQZKh.js.map +0 -1
- package/dist/OwpStoreProvider-Bx5p7ooQ.js.map +0 -1
- package/dist/OwpUtils-C81bM1Gz.js +0 -611
- package/dist/OwpUtils-C81bM1Gz.js.map +0 -1
- package/dist/QuickPanel-CO7Tyc8C.js +0 -104
- package/dist/QuickPanel-CO7Tyc8C.js.map +0 -1
- package/dist/context.js +0 -101
- package/dist/context.js.map +0 -1
- package/dist/emotion-react-jsx-runtime.browser.esm-Cb9H5d3i.js +0 -1751
- package/dist/emotion-react-jsx-runtime.browser.esm-Cb9H5d3i.js.map +0 -1
- package/dist/index-KlA5Es4t.js +0 -46971
- package/dist/index-KlA5Es4t.js.map +0 -1
- package/dist/isTypedArray-DPyC49cI.js +0 -411
- package/dist/isTypedArray-DPyC49cI.js.map +0 -1
- package/dist/lazyLoadedSlices-DC7yg4GT.js +0 -2832
- package/dist/lazyLoadedSlices-DC7yg4GT.js.map +0 -1
- package/dist/owpDark-DAY0F6Ph.js.map +0 -1
- package/dist/types/components/OwpCommonDialog/OwpCommonDialog.d.ts +0 -1
- package/dist/types/components/OwpCommonDialog/index.d.ts +0 -1
- package/dist/types/components/OwpNavigation/OwpNavBadge.d.ts +0 -17
- package/dist/types/components/OwpNavigation/OwpNavItem.d.ts +0 -14
- package/dist/types/components/OwpNavigation/OwpNavigation.d.ts +0 -23
- package/dist/types/components/OwpNavigation/horizontal/OwpNavHorizontalLayout1.d.ts +0 -7
- package/dist/types/components/OwpNavigation/horizontal/types/OwpNavHorizontalCollapse.d.ts +0 -15
- package/dist/types/components/OwpNavigation/horizontal/types/OwpNavHorizontalGroup.d.ts +0 -13
- package/dist/types/components/OwpNavigation/horizontal/types/OwpNavHorizontalItem.d.ts +0 -11
- package/dist/types/components/OwpNavigation/horizontal/types/OwpNavHorizontalLink.d.ts +0 -8
- package/dist/types/components/OwpNavigation/index.d.ts +0 -1
- package/dist/types/components/OwpNavigation/isUrlInChildren.d.ts +0 -7
- package/dist/types/components/OwpNavigation/models/OwpNavItemModel.d.ts +0 -8
- package/dist/types/components/OwpNavigation/types/OwpNavBadgeType.d.ts +0 -9
- package/dist/types/components/OwpNavigation/utils/components.d.ts +0 -4
- package/dist/types/components/OwpNavigation/utils/registerComponent.d.ts +0 -4
- package/dist/types/components/OwpNavigation/vertical/OwpNavVerticalLayout1.d.ts +0 -9
- package/dist/types/components/OwpNavigation/vertical/OwpNavVerticalLayout2.d.ts +0 -7
- package/dist/types/components/OwpNavigation/vertical/types/OwpNavVerticalCollapse.d.ts +0 -7
- package/dist/types/components/OwpNavigation/vertical/types/OwpNavVerticalGroup.d.ts +0 -7
- package/dist/types/components/OwpNavigation/vertical/types/OwpNavVerticalItem.d.ts +0 -7
- package/dist/types/components/OwpNavigation/vertical/types/OwpNavVerticalLink.d.ts +0 -8
- package/dist/types/components/OwpNavigation/vertical/types/OwpNavVerticalTab.d.ts +0 -11
- package/dist/types/components/OwpSearch/OwpSearch.d.ts +0 -23
- package/dist/types/components/OwpSearch/index.d.ts +0 -1
- package/dist/types/components/OwpShortcuts/OwpShortcuts.d.ts +0 -19
- package/dist/types/components/OwpShortcuts/index.d.ts +0 -1
- package/dist/types/components/OwpSidePanel/OwpSidePanel.d.ts +0 -18
- package/dist/types/components/OwpSidePanel/index.d.ts +0 -1
- package/dist/types/components/OwpTheme/OwpTheme.d.ts +0 -18
- package/dist/types/components/OwpTheme/index.d.ts +0 -1
- package/dist/types/components/OwpThemeSelector/OwpThemeSelector.d.ts +0 -16
- package/dist/types/components/OwpThemeSelector/SchemePreview.d.ts +0 -14
- package/dist/types/components/OwpThemeSelector/ThemePreview.d.ts +0 -17
- package/dist/types/components/OwpThemeSelector/index.d.ts +0 -1
- package/dist/types/components/layouts/layout1/Layout1.d.ts +0 -10
- package/dist/types/components/layouts/layout1/Layout1Config.d.ts +0 -114
- package/dist/types/components/layouts/layout1/components/FooterLayout1.d.ts +0 -9
- package/dist/types/components/layouts/layout1/components/LeftSideLayout1.d.ts +0 -6
- package/dist/types/components/layouts/layout1/components/NavbarToggleFabLayout1.d.ts +0 -8
- package/dist/types/components/layouts/layout1/components/NavbarWrapperLayout1.d.ts +0 -5
- package/dist/types/components/layouts/layout1/components/ToolbarLayout1.d.ts +0 -9
- package/dist/types/components/layouts/layout1/components/navbar/style-1/NavbarStyle1.d.ts +0 -5
- package/dist/types/components/layouts/layout1/components/navbar/style-1/NavbarStyle1Content.d.ts +0 -9
- package/dist/types/components/layouts/layout1/components/navbar/style-2/NavbarStyle2.d.ts +0 -5
- package/dist/types/components/layouts/layout1/components/navbar/style-2/NavbarStyle2Content.d.ts +0 -9
- package/dist/types/components/layouts/layout1/components/navbar/style-3/NavbarStyle3.d.ts +0 -9
- package/dist/types/components/layouts/layout1/components/navbar/style-3/NavbarStyle3Content.d.ts +0 -10
- package/dist/types/components/layouts/layout2/Layout2.d.ts +0 -10
- package/dist/types/components/layouts/layout2/components/FooterLayout2.d.ts +0 -9
- package/dist/types/components/layouts/layout2/components/LeftSideLayout2.d.ts +0 -6
- package/dist/types/components/layouts/layout2/components/NavbarLayout2.d.ts +0 -9
- package/dist/types/components/layouts/layout2/components/NavbarMobileLayout2.d.ts +0 -9
- package/dist/types/components/layouts/layout2/components/NavbarToggleFabLayout2.d.ts +0 -8
- package/dist/types/components/layouts/layout2/components/NavbarWrapperLayout2.d.ts +0 -5
- package/dist/types/components/layouts/layout2/components/RightSideLayout2.d.ts +0 -6
- package/dist/types/components/layouts/layout2/components/ToolbarLayout2.d.ts +0 -9
- package/dist/types/components/layouts/layout3/Layout3Config.d.ts +0 -110
- package/dist/types/components/layouts/layout3/components/LeftSideLayout3.d.ts +0 -6
- package/dist/types/components/layouts/layout3/components/NavbarLayout3.d.ts +0 -9
- package/dist/types/components/layouts/layout3/components/NavbarMobileLayout3.d.ts +0 -9
- package/dist/types/components/layouts/layout3/components/NavbarWrapperLayout3.d.ts +0 -5
- package/dist/types/components/layouts/layout3/components/RightSideLayout3.d.ts +0 -6
- package/dist/types/components/layouts/layout3/components/ToolbarLayout3.d.ts +0 -9
- package/dist/types/components/layouts/shared-components/FullScreenToggle.d.ts +0 -8
- package/dist/types/components/layouts/shared-components/LanguageSwitcher.d.ts +0 -7
- package/dist/types/components/layouts/shared-components/PasswordChangeForm.d.ts +0 -2
- package/dist/types/components/layouts/shared-components/navbar/NavbarToggleButton.d.ts +0 -7
- package/dist/types/components/layouts/shared-components/navigation/Navigation.d.ts +0 -3
- package/dist/types/components/layouts/shared-components/navigation/NavigationSearch.d.ts +0 -6
- package/dist/types/components/layouts/shared-components/navigation/NavigationShortcuts.d.ts +0 -6
- package/dist/types/components/layouts/shared-components/quickPanel/QuickPanel.d.ts +0 -5
- package/dist/types/components/layouts/shared-components/quickPanel/QuickPanelToggleButton.d.ts +0 -9
- package/dist/types/components/layouts/shared-components/quickPanel/quickPanelSlice.d.ts +0 -14
- package/dist/types/hooks/useCurrentLogoSrc.d.ts +0 -8
- package/dist/types/hooks/useTreeGridCommonCodeEnum.d.ts +0 -8
- package/dist/usePageLockLoading-BUI_3PlR.js.map +0 -1
- package/dist/useShortcuts-CCf98L8m.js +0 -241
- package/dist/useShortcuts-CCf98L8m.js.map +0 -1
- package/dist/useStorage-CuUmH4fD.js +0 -50
- package/dist/useStorage-CuUmH4fD.js.map +0 -1
- package/dist/useTreeGridExcelExport-N2nOKmkz.js +0 -138
- package/dist/useTreeGridExcelExport-N2nOKmkz.js.map +0 -1
- /package/dist/types/colors/{owpDark.d.ts → palettes/dark.d.ts} +0 -0
- /package/dist/types/colors/{skyBlue.d.ts → palettes/skyBlue.d.ts} +0 -0
- /package/dist/types/{context → contexts}/OwpCoreProvider.d.ts +0 -0
- /package/dist/types/{context → contexts}/OwpStoreProvider.d.ts +0 -0
- /package/dist/types/{context → contexts}/OwpUiProvider.d.ts +0 -0
- /package/dist/types/{context → contexts}/index.d.ts +0 -0
- /package/dist/types/{components/layouts/shared-components → layout/components/logo}/Logo.d.ts +0 -0
- /package/dist/types/{components/layouts/shared-components → layout/components}/navbar/NavbarToggleFab.d.ts +0 -0
- /package/dist/types/{components/layouts/shared-components → layout/components/toggles}/LogoutToggle.d.ts +0 -0
- /package/dist/types/{components/layouts → layout}/themeLayouts.d.ts +0 -0
- /package/dist/types/{components/layouts/shared-components/navbar → store}/navbarSlice.d.ts +0 -0
|
@@ -1,8 +1,15 @@
|
|
|
1
|
-
import { SxProps } from '@mui/system';
|
|
2
|
-
import { OwpNavBadgeType } from './OwpNavBadgeType';
|
|
1
|
+
import type { SxProps } from '@mui/system';
|
|
3
2
|
/**
|
|
4
|
-
*
|
|
5
|
-
|
|
3
|
+
* Navigation badge metadata
|
|
4
|
+
*/
|
|
5
|
+
export type OwpNavBadgeType = {
|
|
6
|
+
bg?: string;
|
|
7
|
+
fg?: string;
|
|
8
|
+
title: string;
|
|
9
|
+
classes?: string;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Navigation item descriptor
|
|
6
13
|
*/
|
|
7
14
|
export type OwpNavItemType = {
|
|
8
15
|
id: string;
|
|
@@ -24,6 +31,9 @@ export type OwpNavItemType = {
|
|
|
24
31
|
children?: OwpNavItemType[];
|
|
25
32
|
hasPermission?: boolean;
|
|
26
33
|
};
|
|
34
|
+
/**
|
|
35
|
+
* Flattened navigation item descriptor
|
|
36
|
+
*/
|
|
27
37
|
export type OwpFlatNavItemType = Omit<OwpNavItemType, 'children' | 'sx'> & {
|
|
28
38
|
children?: string[];
|
|
29
39
|
order: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { themeLayoutDefaultsProps } from '@/
|
|
2
|
-
import { Palette } from '@mui/material/styles
|
|
1
|
+
import { themeLayoutDefaultsProps } from '@/layout/themeLayoutConfigs';
|
|
2
|
+
import type { Palette } from '@mui/material/styles';
|
|
3
3
|
import { PartialDeep } from 'type-fest';
|
|
4
4
|
export type OwpThemeType = {
|
|
5
5
|
palette: PartialDeep<Palette>;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export type { OwpThemeType, OwpThemesType, OwpSettingsConfigType, } from './OwpSettingsTypes';
|
|
2
|
+
export type { OwpFlatNavItemType, OwpNavBadgeType, OwpNavItemType, } from './OwpNavigationTypes';
|
|
3
|
+
export type { AnyFormFieldType, ThemeFormConfigTypes } from './ThemeFormConfigTypes';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
interface GetEstimatedTextCellWidthOptions {
|
|
2
|
+
baseWidth?: number;
|
|
3
|
+
minWidth?: number;
|
|
4
|
+
maxWidth?: number;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* 텍스트 셀 예상 너비 계산
|
|
8
|
+
* @param texts 너비 계산 대상 문자열 목록
|
|
9
|
+
* @param options 기본, 최소, 최대 너비 옵션
|
|
10
|
+
*/
|
|
11
|
+
export declare const getEstimatedTextCellWidth: (texts: readonly string[], { baseWidth, minWidth, maxWidth }?: GetEstimatedTextCellWidthOptions) => number;
|
|
12
|
+
export {};
|
|
@@ -9,9 +9,11 @@ export * from './fetchFile';
|
|
|
9
9
|
export * from './formatDateToYmd';
|
|
10
10
|
export * from './formatNumber';
|
|
11
11
|
export * from './getDisplayValue';
|
|
12
|
+
export * from './getEstimatedTextCellWidth';
|
|
12
13
|
export * from './getFormDefaultValues';
|
|
13
14
|
export * from './getTrimmedValue';
|
|
14
15
|
export * from './isEnterKeyEvent';
|
|
16
|
+
export * from './language';
|
|
15
17
|
export * from './qrCodeUtil';
|
|
16
18
|
export * from './rebuildValue';
|
|
17
19
|
export * from './sanitizeAuthInputValue';
|
|
@@ -1,20 +1,32 @@
|
|
|
1
|
-
import { OwpFlatNavItemType, OwpNavItemType } from '@/
|
|
2
|
-
import {
|
|
1
|
+
import type { OwpFlatNavItemType, OwpNavItemType } from '@/types/OwpNavigationTypes';
|
|
2
|
+
import type { Pathname } from 'history';
|
|
3
|
+
import type { PartialDeep } from 'type-fest';
|
|
4
|
+
/**
|
|
5
|
+
* Navigation item model factory
|
|
6
|
+
*/
|
|
7
|
+
export declare function OwpNavItemModel(data?: PartialDeep<OwpNavItemType>): OwpNavItemType;
|
|
8
|
+
/**
|
|
9
|
+
* Navigation child URL matcher
|
|
10
|
+
*/
|
|
11
|
+
export declare function isUrlInChildren(parent: OwpNavItemType, url: Pathname): boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Navigation structure helper
|
|
14
|
+
*/
|
|
3
15
|
export declare class OwpNavigationHelper {
|
|
4
16
|
static selectById(nav: OwpNavItemType[], id: string): OwpNavItemType | undefined;
|
|
5
17
|
static appendNavItem(nav: OwpNavItemType[], item: OwpNavItemType, parentId?: string | null): OwpNavItemType[];
|
|
6
18
|
static prependNavItem(nav: OwpNavItemType[], item: OwpNavItemType, parentId?: string | null): OwpNavItemType[];
|
|
7
19
|
static filterNavigationByPermission(nav: OwpNavItemType[], userRole: User['role']): OwpNavItemType[];
|
|
8
20
|
/**
|
|
9
|
-
*
|
|
21
|
+
* Navigation item removal
|
|
10
22
|
*/
|
|
11
23
|
static removeNavItem(nav: OwpNavItemType[], id: string): OwpNavItemType[];
|
|
12
24
|
/**
|
|
13
|
-
*
|
|
25
|
+
* Navigation item update
|
|
14
26
|
*/
|
|
15
27
|
static updateNavItem(nav: OwpNavItemType[], id: string, item: PartialDeep<OwpNavItemType>): OwpNavItemType[];
|
|
16
28
|
/**
|
|
17
|
-
*
|
|
29
|
+
* Flat navigation list extraction
|
|
18
30
|
*/
|
|
19
31
|
static getFlatNavigation(navigationItems?: OwpNavItemType[], flatNavigation?: any[]): OwpNavItemType[] | [];
|
|
20
32
|
static hasPermission(authArr: string[] | string | undefined, userRole: User['role']): boolean;
|
package/dist/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var L = Object.defineProperty;
|
|
2
2
|
var e = (t, o) => L(t, "name", { value: o, configurable: !0 });
|
|
3
3
|
import { S } from "./localStorageKeys-Che0CNci.js";
|
|
4
|
-
import { u as g } from "./useShortcuts-
|
|
4
|
+
import { u as g } from "./useShortcuts-BjtlXprQ.js";
|
|
5
5
|
import { useRef as T, useEffect as G } from "react";
|
|
6
6
|
import { useLocation as _, useNavigate as R } from "react-router-dom";
|
|
7
7
|
import { S as a } from "./storageKeys-C6xHFiTo.js";
|
|
@@ -31,9 +31,9 @@ const k = "/auth/login", C = "Message.로그인이 필요합니다.", v = /* @__
|
|
|
31
31
|
), F = /* @__PURE__ */ e(() => i(A), "useGetPageLockLoading"), H = /* @__PURE__ */ e(() => ({ setLoading: d(A) }), "usePageLockLoading");
|
|
32
32
|
export {
|
|
33
33
|
v as a,
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
34
|
+
H as b,
|
|
35
|
+
x as c,
|
|
36
|
+
D as d,
|
|
37
37
|
F as u
|
|
38
38
|
};
|
|
39
|
-
//# sourceMappingURL=usePageLockLoading-
|
|
39
|
+
//# sourceMappingURL=usePageLockLoading-BGODEt_k.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usePageLockLoading-BGODEt_k.js","sources":["../src/hooks/useAccessTokenGuard.ts","../src/hooks/useCurrentUserId.ts","../src/hooks/usePageLockLoading.ts"],"sourcesContent":["import { STORAGE_ACCESS_TOKEN_KEY } from '@/constants/localStorageKeys';\nimport { useOwpAppContext } from '@/contexts/OwpAppProvider';\nimport { useEffect, useRef } from 'react';\nimport { useLocation, useNavigate } from 'react-router-dom';\n\nexport interface UseAccessTokenGuardOptions {\n loginPath?: string;\n isEnabled?: boolean;\n snackbarMessageKey?: string;\n}\n\nconst DEFAULT_LOGIN_PATH = '/auth/login';\nconst DEFAULT_SNACKBAR_MESSAGE_KEY = 'Message.로그인이 필요합니다.';\n\n/**\n * 액세스 토큰 기반 로그인 가드\n * @param loginPath 로그인 라우트 경로\n * @param isEnabled 가드 활성화 여부\n * @param snackbarMessageKey 로그인 필요 안내 메시지 키\n */\nexport const useAccessTokenGuard = ({\n loginPath = DEFAULT_LOGIN_PATH,\n isEnabled,\n snackbarMessageKey = DEFAULT_SNACKBAR_MESSAGE_KEY,\n}: UseAccessTokenGuardOptions = {}) => {\n const { env } = useOwpAppContext();\n const location = useLocation();\n const navigate = useNavigate();\n const accessToken =\n typeof window === 'undefined' ? null : window.localStorage.getItem(STORAGE_ACCESS_TOKEN_KEY);\n const isLoginRoute = location.pathname.startsWith(loginPath);\n const isAccessTokenGuardEnabled = isEnabled ?? env?.isAccessTokenGuardEnabled ?? true;\n const shouldRedirectToLogin = isAccessTokenGuardEnabled && !accessToken && !isLoginRoute;\n const hasHandledRedirectRef = useRef(false);\n\n useEffect(() => {\n if (!shouldRedirectToLogin) {\n hasHandledRedirectRef.current = false;\n return;\n }\n\n if (hasHandledRedirectRef.current) {\n return;\n }\n\n hasHandledRedirectRef.current = true;\n\n navigate(loginPath, {\n replace: true,\n state: snackbarMessageKey\n ? {\n snackbarMessageKey,\n }\n : undefined,\n });\n }, [loginPath, navigate, shouldRedirectToLogin, snackbarMessageKey]);\n\n return shouldRedirectToLogin;\n};\n","import { STORAGE_KEYS } from '@/constants/storageKeys';\nimport { useAtomValue, useSetAtom } from 'jotai';\nimport { atomWithStorage } from 'jotai/utils';\n\nconst currentUserIdAtom = atomWithStorage<string | ''>(STORAGE_KEYS.currentUserId, '');\n\n/**\n * 현재 사용자 ID 조회 훅\n */\nexport const useGetCurrentUserId = () => {\n return useAtomValue(currentUserIdAtom);\n};\n\n/**\n * 현재 사용자 ID 설정 훅\n */\nexport const useSetCurrentUserId = () => {\n return useSetAtom(currentUserIdAtom);\n};\n","import type { OwpPageLockLoadingProps } from '@/components/OwpPageLockLoading';\nimport { STORAGE_KEYS } from '@/constants/storageKeys';\nimport { useAtomValue, useSetAtom } from 'jotai';\nimport { atomWithStorage } from 'jotai/utils';\n\nconst currentLockLoadingAtom = atomWithStorage<OwpPageLockLoadingProps | undefined>(\n STORAGE_KEYS.lockLoadingProps,\n { loading: false },\n);\n\n/**\n * 페이지 잠금 로딩 상태 조회\n */\nexport const useGetPageLockLoading = () => {\n return useAtomValue(currentLockLoadingAtom);\n};\n\n/**\n * 페이지 잠금 로딩 상태 설정\n */\nexport const usePageLockLoading = () => {\n return { setLoading: useSetAtom(currentLockLoadingAtom) };\n};\n"],"names":["DEFAULT_LOGIN_PATH","DEFAULT_SNACKBAR_MESSAGE_KEY","useAccessTokenGuard","__name","loginPath","isEnabled","snackbarMessageKey","env","useOwpAppContext","location","useLocation","navigate","useNavigate","accessToken","STORAGE_ACCESS_TOKEN_KEY","isLoginRoute","shouldRedirectToLogin","hasHandledRedirectRef","useRef","useEffect","currentUserIdAtom","atomWithStorage","STORAGE_KEYS","useGetCurrentUserId","useAtomValue","useSetCurrentUserId","useSetAtom","currentLockLoadingAtom","useGetPageLockLoading","usePageLockLoading"],"mappings":";;;;;;;;;AAWA,MAAMA,IAAqB,eACrBC,IAA+B,uBAQxBC,IAAsB,gBAAAC,EAAA,CAAC;AAAA,EAClC,WAAAC,IAAYJ;AAAA,EACZ,WAAAK;AAAA,EACA,oBAAAC,IAAqBL;AACvB,IAAgC,OAAO;AACrC,QAAM,EAAE,KAAAM,EAAA,IAAQC,EAAA,GACVC,IAAWC,EAAA,GACXC,IAAWC,EAAA,GACXC,IACJ,OAAO,SAAW,MAAc,OAAO,OAAO,aAAa,QAAQC,CAAwB,GACvFC,IAAeN,EAAS,SAAS,WAAWL,CAAS,GAErDY,KAD4BX,MAAaE,KAAA,gBAAAA,EAAK,8BAA6B,OACtB,CAACM,KAAe,CAACE,GACtEE,IAAwBC,EAAO,EAAK;AAE1C,SAAAC,EAAU,MAAM;AACd,QAAI,CAACH,GAAuB;AAC1B,MAAAC,EAAsB,UAAU;AAChC;AAAA,IACF;AAEA,IAAIA,EAAsB,YAI1BA,EAAsB,UAAU,IAEhCN,EAASP,GAAW;AAAA,MAClB,SAAS;AAAA,MACT,OAAOE,IACH;AAAA,QACE,oBAAAA;AAAA,MAAA,IAEF;AAAA,IAAA,CACL;AAAA,EACH,GAAG,CAACF,GAAWO,GAAUK,GAAuBV,CAAkB,CAAC,GAE5DU;AACT,GAtCmC,wBChB7BI,IAAoBC,EAA6BC,EAAa,eAAe,EAAE,GAKxEC,IAAsB,gBAAApB,EAAA,MAC1BqB,EAAaJ,CAAiB,GADJ,wBAOtBK,IAAsB,gBAAAtB,EAAA,MAC1BuB,EAAWN,CAAiB,GADF,wBCX7BO,IAAyBN;AAAA,EAC7BC,EAAa;AAAA,EACb,EAAE,SAAS,GAAA;AACb,GAKaM,IAAwB,gBAAAzB,EAAA,MAC5BqB,EAAaG,CAAsB,GADP,0BAOxBE,IAAqB,gBAAA1B,EAAA,OACzB,EAAE,YAAYuB,EAAWC,CAAsB,EAAA,IADtB;"}
|
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
var j = Object.defineProperty;
|
|
2
|
+
var e = (t, o) => j(t, "name", { value: o, configurable: !0 });
|
|
3
|
+
import { j as g, a as S } from "./emotion-react-jsx-runtime.browser.esm-BMvSswBW.js";
|
|
4
|
+
import { u as P } from "./isString-Codtu20I.js";
|
|
5
|
+
import { createContext as I, useContext as b, useRef as C, useLayoutEffect as G, useEffect as v } from "react";
|
|
6
|
+
import { Typography as N, DialogContent as R, DialogActions as K, Button as x, Dialog as M } from "@mui/material";
|
|
7
|
+
import { useDialogs as U } from "@toolpad/core/useDialogs";
|
|
8
|
+
import { S as l } from "./storageKeys-C6xHFiTo.js";
|
|
9
|
+
import { useAtomValue as f, useSetAtom as m } from "jotai";
|
|
10
|
+
import { atomWithStorage as d } from "jotai/utils";
|
|
11
|
+
import { useDispatch as W, useSelector as z, useStore as F } from "react-redux";
|
|
12
|
+
import { useTranslation as _ } from "react-i18next";
|
|
13
|
+
import { o as q } from "./isTypedArray-CCnDZ5HJ.js";
|
|
14
|
+
function Y(t, o) {
|
|
15
|
+
if (o === void 0)
|
|
16
|
+
return t.trimEnd();
|
|
17
|
+
let n = t.length;
|
|
18
|
+
switch (typeof o) {
|
|
19
|
+
case "string": {
|
|
20
|
+
if (o.length !== 1)
|
|
21
|
+
throw new Error("The 'chars' parameter should be a single character string.");
|
|
22
|
+
for (; n > 0 && t[n - 1] === o; )
|
|
23
|
+
n--;
|
|
24
|
+
break;
|
|
25
|
+
}
|
|
26
|
+
case "object":
|
|
27
|
+
for (; n > 0 && o.includes(t[n - 1]); )
|
|
28
|
+
n--;
|
|
29
|
+
}
|
|
30
|
+
return t.substring(0, n);
|
|
31
|
+
}
|
|
32
|
+
e(Y, "trimEnd$1");
|
|
33
|
+
const V = I(void 0), ct = /* @__PURE__ */ e(({
|
|
34
|
+
configs: t,
|
|
35
|
+
slots: o,
|
|
36
|
+
slotProps: n,
|
|
37
|
+
children: s,
|
|
38
|
+
env: r
|
|
39
|
+
}) => {
|
|
40
|
+
const u = C({ ...t, env: r, slots: o, slotProps: n }), { setEnv: i } = P();
|
|
41
|
+
return G(() => {
|
|
42
|
+
i(r ?? {});
|
|
43
|
+
}, [r, i]), /* @__PURE__ */ g(V.Provider, { value: u.current, children: s });
|
|
44
|
+
}, "OwpAppProvider"), lt = /* @__PURE__ */ e(() => {
|
|
45
|
+
const t = b(V);
|
|
46
|
+
if (t === void 0)
|
|
47
|
+
throw new Error("useOwpAppContext must be used within a OwpAppProvider");
|
|
48
|
+
return t;
|
|
49
|
+
}, "useOwpAppContext");
|
|
50
|
+
function $(t, o, n) {
|
|
51
|
+
return t == null ? "" : Y(t, o.toString().split(""));
|
|
52
|
+
}
|
|
53
|
+
e($, "trimEnd");
|
|
54
|
+
const H = /* @__PURE__ */ e((t) => {
|
|
55
|
+
if (!t.includes("."))
|
|
56
|
+
return;
|
|
57
|
+
const n = $(t, ".").lastIndexOf(".");
|
|
58
|
+
return n < 0 ? t : t.slice(n + 1);
|
|
59
|
+
}, "getDefaultValueFromKey"), T = /* @__PURE__ */ e(() => {
|
|
60
|
+
const { t, ...o } = _("owp");
|
|
61
|
+
return { t: /* @__PURE__ */ e(((...s) => {
|
|
62
|
+
const [r, u] = s, i = q(u) ? u : void 0, c = !!i, h = c && Object.prototype.hasOwnProperty.call(i, "defaultValue");
|
|
63
|
+
if ((u == null || c) && !h && typeof r == "string") {
|
|
64
|
+
const p = H(r);
|
|
65
|
+
if (p) {
|
|
66
|
+
const D = c ? { ...i, defaultValue: p } : { defaultValue: p };
|
|
67
|
+
return t(r, D, ...s.slice(2));
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
return t(...s);
|
|
71
|
+
}), "t"), ...o };
|
|
72
|
+
}, "useOwpTranslation"), a = {
|
|
73
|
+
infoTitle: {
|
|
74
|
+
key: "Message.처리하시겠습니까",
|
|
75
|
+
defaultValue: "처리하시겠습니까?"
|
|
76
|
+
},
|
|
77
|
+
infoOk: {
|
|
78
|
+
key: "Button.확인",
|
|
79
|
+
defaultValue: "확인"
|
|
80
|
+
},
|
|
81
|
+
saveTitle: {
|
|
82
|
+
key: "Message.저장하시겠습니까?",
|
|
83
|
+
defaultValue: "저장하시겠습니까?"
|
|
84
|
+
},
|
|
85
|
+
saveOk: {
|
|
86
|
+
key: "Button.저장",
|
|
87
|
+
defaultValue: "저장"
|
|
88
|
+
},
|
|
89
|
+
updateTitle: {
|
|
90
|
+
key: "Message.수정하시겠습니까?",
|
|
91
|
+
defaultValue: "수정하시겠습니까?"
|
|
92
|
+
},
|
|
93
|
+
updateOk: {
|
|
94
|
+
key: "Button.수정",
|
|
95
|
+
defaultValue: "수정"
|
|
96
|
+
},
|
|
97
|
+
deleteTitle: {
|
|
98
|
+
key: "Message.삭제하시겠습니까?",
|
|
99
|
+
defaultValue: "삭제하시겠습니까?"
|
|
100
|
+
},
|
|
101
|
+
deleteOk: {
|
|
102
|
+
key: "Button.삭제",
|
|
103
|
+
defaultValue: "삭제"
|
|
104
|
+
},
|
|
105
|
+
cancel: {
|
|
106
|
+
key: "Button.취소",
|
|
107
|
+
defaultValue: "취소"
|
|
108
|
+
}
|
|
109
|
+
}, k = /* @__PURE__ */ e((t, o) => t ? {
|
|
110
|
+
color: t,
|
|
111
|
+
...o
|
|
112
|
+
} : o, "mergeOkButtonProps"), ft = /* @__PURE__ */ e(() => {
|
|
113
|
+
const t = U(), { t: o } = T(), n = /* @__PURE__ */ e(({ key: r, defaultValue: u }) => o(r, { defaultValue: u }), "translateConfirmText"), s = /* @__PURE__ */ e((r) => t.open(J, r), "confirmBase");
|
|
114
|
+
return {
|
|
115
|
+
confirm: s,
|
|
116
|
+
confirmInfo: /* @__PURE__ */ e(async ({ title: r, okText: u, severity: i } = {}) => s({
|
|
117
|
+
title: r ?? n(a.infoTitle),
|
|
118
|
+
okText: u ?? n(a.infoOk),
|
|
119
|
+
severity: i ?? "primary",
|
|
120
|
+
useInfo: !0
|
|
121
|
+
}), "confirmInfo"),
|
|
122
|
+
confirmSave: /* @__PURE__ */ e(async ({
|
|
123
|
+
title: r,
|
|
124
|
+
okText: u,
|
|
125
|
+
cancelText: i,
|
|
126
|
+
okButtonProps: c
|
|
127
|
+
} = {}) => s({
|
|
128
|
+
title: r ?? n(a.saveTitle),
|
|
129
|
+
okText: u ?? n(a.saveOk),
|
|
130
|
+
cancelText: i,
|
|
131
|
+
okButtonProps: k("secondary", c)
|
|
132
|
+
}), "confirmSave"),
|
|
133
|
+
confirmUpdate: /* @__PURE__ */ e(async ({
|
|
134
|
+
title: r,
|
|
135
|
+
okText: u,
|
|
136
|
+
cancelText: i,
|
|
137
|
+
okButtonProps: c
|
|
138
|
+
} = {}) => s({
|
|
139
|
+
title: r ?? n(a.updateTitle),
|
|
140
|
+
okText: u ?? n(a.updateOk),
|
|
141
|
+
cancelText: i,
|
|
142
|
+
okButtonProps: k("secondary", c)
|
|
143
|
+
}), "confirmUpdate"),
|
|
144
|
+
confirmDelete: /* @__PURE__ */ e(async ({
|
|
145
|
+
title: r,
|
|
146
|
+
okText: u,
|
|
147
|
+
cancelText: i,
|
|
148
|
+
okButtonProps: c
|
|
149
|
+
} = {}) => s({
|
|
150
|
+
title: r ?? n(a.deleteTitle),
|
|
151
|
+
okText: u ?? n(a.deleteOk),
|
|
152
|
+
cancelText: i,
|
|
153
|
+
okButtonProps: k("error", c)
|
|
154
|
+
}), "confirmDelete")
|
|
155
|
+
};
|
|
156
|
+
}, "useConfirm"), J = /* @__PURE__ */ e(({ payload: t, open: o, onClose: n }) => {
|
|
157
|
+
const { title: s, okButtonProps: r, cancelButtonProps: u, severity: i, useInfo: c } = t, { t: h } = T(), O = (t == null ? void 0 : t.okText) ?? h(a.infoOk.key, { defaultValue: a.infoOk.defaultValue }), p = (t == null ? void 0 : t.cancelText) ?? h(a.cancel.key, { defaultValue: a.cancel.defaultValue });
|
|
158
|
+
return /* @__PURE__ */ S(M, { fullWidth: !0, maxWidth: "xs", open: o, onClose: /* @__PURE__ */ e(() => n(!1), "onClose"), children: [
|
|
159
|
+
/* @__PURE__ */ g(R, { children: /* @__PURE__ */ g(N, { className: "mb-12", variant: "h6", children: s }) }),
|
|
160
|
+
/* @__PURE__ */ S(K, { children: [
|
|
161
|
+
!c && /* @__PURE__ */ g(x, { ...u, variant: "outlined", onClick: /* @__PURE__ */ e(() => n(!1), "onClick"), children: p }),
|
|
162
|
+
/* @__PURE__ */ g(
|
|
163
|
+
x,
|
|
164
|
+
{
|
|
165
|
+
color: i || "primary",
|
|
166
|
+
variant: "contained",
|
|
167
|
+
...r,
|
|
168
|
+
onClick: /* @__PURE__ */ e(() => n(!0), "onClick"),
|
|
169
|
+
children: O
|
|
170
|
+
}
|
|
171
|
+
)
|
|
172
|
+
] })
|
|
173
|
+
] });
|
|
174
|
+
}, "ConfirmDialog");
|
|
175
|
+
function mt(t, o) {
|
|
176
|
+
const n = C(t);
|
|
177
|
+
v(() => {
|
|
178
|
+
n.current = t;
|
|
179
|
+
}, [t]), v(() => {
|
|
180
|
+
let s;
|
|
181
|
+
return o !== null && t && typeof t == "function" && (s = setTimeout(n.current, o)), () => {
|
|
182
|
+
s && clearTimeout(s);
|
|
183
|
+
};
|
|
184
|
+
}, [t, o]);
|
|
185
|
+
}
|
|
186
|
+
e(mt, "useTimeout");
|
|
187
|
+
const y = d(l.commonCodeList, void 0), dt = /* @__PURE__ */ e(() => f(y), "useGetCommonCodeList"), pt = /* @__PURE__ */ e(() => m(y), "useSetCommonCodeList"), gt = W.withTypes(), ht = z.withTypes(), kt = F.withTypes(), A = d(l.currentLanguage, {
|
|
188
|
+
id: "kr",
|
|
189
|
+
title: "한국어",
|
|
190
|
+
flag: "KR"
|
|
191
|
+
}), Tt = /* @__PURE__ */ e(() => {
|
|
192
|
+
const { t } = T();
|
|
193
|
+
return [
|
|
194
|
+
{ id: "kr", title: t("Common.한국어", { defaultValue: "한국어" }), flag: "KR" },
|
|
195
|
+
{
|
|
196
|
+
id: "en",
|
|
197
|
+
title: t("Common.English", { defaultValue: "English" }),
|
|
198
|
+
flag: "EN"
|
|
199
|
+
},
|
|
200
|
+
{ id: "lc", title: t("Common.Etc", { defaultValue: "Etc" }), flag: "LC" }
|
|
201
|
+
];
|
|
202
|
+
}, "useGetLanguageList"), Ot = /* @__PURE__ */ e(() => f(A), "useGetCurrentLanguage"), St = /* @__PURE__ */ e(() => m(A), "useSetCurrentLanguage"), w = d(
|
|
203
|
+
l.currentLogoSrc,
|
|
204
|
+
"assets/images/logo/daedong-door-logo-b.png"
|
|
205
|
+
), vt = /* @__PURE__ */ e(() => f(w), "useGetLogoSrc"), xt = /* @__PURE__ */ e(() => m(w), "useSetLogoSrc"), L = d(
|
|
206
|
+
l.currentUser,
|
|
207
|
+
void 0
|
|
208
|
+
), Ct = /* @__PURE__ */ e(() => f(L), "useGetCurrentUser"), Vt = /* @__PURE__ */ e(() => m(L), "useSetCurrentUser"), E = d(
|
|
209
|
+
l.navigationList,
|
|
210
|
+
void 0
|
|
211
|
+
), yt = /* @__PURE__ */ e(() => f(E), "useGetNavigationList"), At = /* @__PURE__ */ e(() => m(E), "useSetNavigationList"), B = d(l.currentShortcuts, []), wt = /* @__PURE__ */ e(() => f(B), "useGetShortcuts"), Lt = /* @__PURE__ */ e(() => m(B), "useSetShortcuts");
|
|
212
|
+
export {
|
|
213
|
+
ct as O,
|
|
214
|
+
Ot as a,
|
|
215
|
+
T as b,
|
|
216
|
+
V as c,
|
|
217
|
+
xt as d,
|
|
218
|
+
At as e,
|
|
219
|
+
Ct as f,
|
|
220
|
+
pt as g,
|
|
221
|
+
dt as h,
|
|
222
|
+
gt as i,
|
|
223
|
+
ht as j,
|
|
224
|
+
kt as k,
|
|
225
|
+
ft as l,
|
|
226
|
+
Tt as m,
|
|
227
|
+
St as n,
|
|
228
|
+
vt as o,
|
|
229
|
+
Vt as p,
|
|
230
|
+
yt as q,
|
|
231
|
+
wt as r,
|
|
232
|
+
Lt as s,
|
|
233
|
+
mt as t,
|
|
234
|
+
lt as u
|
|
235
|
+
};
|
|
236
|
+
//# sourceMappingURL=useShortcuts-BjtlXprQ.js.map
|
|
@@ -0,0 +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,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;ACkDF,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,M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AAE5E,GAXkC,uBAgBrB6D,KAAwB,gBAAAhF,EAAA,MAC5BqE,EAAaS,CAAmB,GADJ,0BAOxBG,KAAwB,gBAAAjF,EAAA,MAC5BuE,EAAWO,CAAmB,GADF,0BCpC/BI,IAAchB;AAAA,EAClBC,EAAa;AAAA,EACb;AACF,GAKagB,KAAgB,gBAAAnF,EAAA,MACpBqE,EAAaa,CAAW,GADJ,kBAOhBE,KAAgB,gBAAApF,EAAA,MACpBuE,EAAWW,CAAW,GADF,kBCVvBG,IAAkBnB;AAAA,EACtBC,EAAa;AAAA,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,120 @@
|
|
|
1
|
+
var D = Object.defineProperty;
|
|
2
|
+
var n = (e, r) => D(e, "name", { value: r, configurable: !0 });
|
|
3
|
+
import p, { useState as w, useEffect as R, useRef as v } from "react";
|
|
4
|
+
import { d as C } from "./isTypedArray-CCnDZ5HJ.js";
|
|
5
|
+
import { useTheme as M } from "@mui/material/styles";
|
|
6
|
+
import { g as G, e as y } from "./treeGridUtil-DAfaAk6C.js";
|
|
7
|
+
import { b as N } from "./useShortcuts-BjtlXprQ.js";
|
|
8
|
+
function _(e, r, { signal: t, edges: o } = {}) {
|
|
9
|
+
let l, i = null;
|
|
10
|
+
const u = o != null && o.includes("leading"), c = o == null || o.includes("trailing"), a = /* @__PURE__ */ n(() => {
|
|
11
|
+
i !== null && (e.apply(l, i), l = void 0, i = null);
|
|
12
|
+
}, "invoke"), f = /* @__PURE__ */ n(() => {
|
|
13
|
+
c && a(), E();
|
|
14
|
+
}, "onTimerEnd");
|
|
15
|
+
let s = null;
|
|
16
|
+
const m = /* @__PURE__ */ n(() => {
|
|
17
|
+
s != null && clearTimeout(s), s = setTimeout(() => {
|
|
18
|
+
s = null, f();
|
|
19
|
+
}, r);
|
|
20
|
+
}, "schedule"), d = /* @__PURE__ */ n(() => {
|
|
21
|
+
s !== null && (clearTimeout(s), s = null);
|
|
22
|
+
}, "cancelTimer"), E = /* @__PURE__ */ n(() => {
|
|
23
|
+
d(), l = void 0, i = null;
|
|
24
|
+
}, "cancel"), b = /* @__PURE__ */ n(() => {
|
|
25
|
+
a();
|
|
26
|
+
}, "flush"), h = /* @__PURE__ */ n(function(...g) {
|
|
27
|
+
if (t != null && t.aborted)
|
|
28
|
+
return;
|
|
29
|
+
l = this, i = g;
|
|
30
|
+
const x = s == null;
|
|
31
|
+
m(), u && x && a();
|
|
32
|
+
}, "debounced");
|
|
33
|
+
return h.schedule = m, h.cancel = E, h.flush = b, t == null || t.addEventListener("abort", E, { once: !0 }), h;
|
|
34
|
+
}
|
|
35
|
+
n(_, "debounce$1");
|
|
36
|
+
function Q(e, r = 0, t = {}) {
|
|
37
|
+
typeof t != "object" && (t = {});
|
|
38
|
+
const { leading: o = !1, trailing: l = !0, maxWait: i } = t, u = Array(2);
|
|
39
|
+
o && (u[0] = "leading"), l && (u[1] = "trailing");
|
|
40
|
+
let c, a = null;
|
|
41
|
+
const f = _(function(...d) {
|
|
42
|
+
c = e.apply(this, d), a = null;
|
|
43
|
+
}, r, { edges: u }), s = /* @__PURE__ */ n(function(...d) {
|
|
44
|
+
return i != null && (a === null && (a = Date.now()), Date.now() - a >= i) ? (c = e.apply(this, d), a = Date.now(), f.cancel(), f.schedule(), c) : (f.apply(this, d), c);
|
|
45
|
+
}, "debounced"), m = /* @__PURE__ */ n(() => (f.flush(), c), "flush");
|
|
46
|
+
return s.cancel = f.cancel, s.flush = m, s;
|
|
47
|
+
}
|
|
48
|
+
n(Q, "debounce");
|
|
49
|
+
function k(e) {
|
|
50
|
+
if (!e || !e.length)
|
|
51
|
+
throw new Error(
|
|
52
|
+
"useDeepCompareEffect should not be used with no dependencies. Use React.useEffect instead."
|
|
53
|
+
);
|
|
54
|
+
if (e.every(A))
|
|
55
|
+
throw new Error(
|
|
56
|
+
"useDeepCompareEffect should not be used with dependencies that are all primitive values. Use React.useEffect instead."
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
n(k, "checkDeps");
|
|
60
|
+
function A(e) {
|
|
61
|
+
return e == null || /^[sbn]/.test(typeof e);
|
|
62
|
+
}
|
|
63
|
+
n(A, "isPrimitive");
|
|
64
|
+
function T(e) {
|
|
65
|
+
const r = p.useRef(e), t = p.useRef(0);
|
|
66
|
+
return C(e, r.current) || (r.current = e, t.current += 1), p.useMemo(() => r.current, [t.current]);
|
|
67
|
+
}
|
|
68
|
+
n(T, "useDeepCompareMemoize");
|
|
69
|
+
function U(e, r) {
|
|
70
|
+
return process.env.NODE_ENV !== "production" && k(r), p.useEffect(e, T(r));
|
|
71
|
+
}
|
|
72
|
+
n(U, "useDeepCompareEffect");
|
|
73
|
+
function j(e, r) {
|
|
74
|
+
return p.useEffect(e, T(r));
|
|
75
|
+
}
|
|
76
|
+
n(j, "useDeepCompareEffectNoCheck");
|
|
77
|
+
function z(e) {
|
|
78
|
+
const r = M(), t = e(r).replace("@media ", "");
|
|
79
|
+
function o(u) {
|
|
80
|
+
return window.matchMedia(u).matches;
|
|
81
|
+
}
|
|
82
|
+
n(o, "getMatches");
|
|
83
|
+
const [l, i] = w(o(t));
|
|
84
|
+
return R(
|
|
85
|
+
() => {
|
|
86
|
+
const u = window.matchMedia(t);
|
|
87
|
+
i(o(t));
|
|
88
|
+
const c = /* @__PURE__ */ n((a) => i(a.matches), "handler");
|
|
89
|
+
return u.addEventListener("change", c), () => u.removeEventListener("change", c);
|
|
90
|
+
},
|
|
91
|
+
[t]
|
|
92
|
+
), l;
|
|
93
|
+
}
|
|
94
|
+
n(z, "useThemeMediaQuery");
|
|
95
|
+
const F = /* @__PURE__ */ n((e) => {
|
|
96
|
+
const { t: r } = N(), t = v(!1), [o, l] = w(!1);
|
|
97
|
+
return { exportByTreeGrid: /* @__PURE__ */ n(async (u) => {
|
|
98
|
+
if (t.current)
|
|
99
|
+
return;
|
|
100
|
+
t.current = !0, l(!0);
|
|
101
|
+
const c = G(e);
|
|
102
|
+
try {
|
|
103
|
+
return typeof u == "string" ? await y(c, { exportName: u, t: r }) : await y(c, {
|
|
104
|
+
...u,
|
|
105
|
+
t: r
|
|
106
|
+
});
|
|
107
|
+
} finally {
|
|
108
|
+
t.current = !1, l(!1);
|
|
109
|
+
}
|
|
110
|
+
}, "exportByTreeGrid"), isExporting: o };
|
|
111
|
+
}, "useTreeGridExcelExport");
|
|
112
|
+
export {
|
|
113
|
+
U as a,
|
|
114
|
+
j as b,
|
|
115
|
+
z as c,
|
|
116
|
+
Q as d,
|
|
117
|
+
F as e,
|
|
118
|
+
T as u
|
|
119
|
+
};
|
|
120
|
+
//# sourceMappingURL=useTreeGridExcelExport-BE6h1hsO.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useTreeGridExcelExport-BE6h1hsO.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/useDeepCompareEffect.ts","../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 { isEqual as deepEqual } from 'es-toolkit/compat';\nimport React from 'react';\n\ntype UseEffectParamsType = Parameters<typeof React.useEffect>;\ntype EffectCallbackType = UseEffectParamsType[0];\ntype DependencyListType = UseEffectParamsType[1];\n\n// yes, I know it's void, but I like what this communicates about\n// the intent of these functions: It's just like useEffect\ntype UseEffectReturn = ReturnType<typeof React.useEffect>;\n\n/**\n * The checkDeps function checks if the dependency list is valid for use with useDeepCompareEffect.\n * It throws an error if the dependency list is empty or contains only primitive values.\n */\nfunction checkDeps(deps: DependencyListType) {\n if (!deps || !deps.length) {\n throw new Error(\n 'useDeepCompareEffect should not be used with no dependencies. Use React.useEffect instead.',\n );\n }\n\n if (deps.every(isPrimitive)) {\n throw new Error(\n 'useDeepCompareEffect should not be used with dependencies that are all primitive values. Use React.useEffect instead.',\n );\n }\n}\n\n/**\n * The isPrimitive function checks if a value is a primitive type.\n * It returns true if the value is null, undefined, a string, a boolean, or a number.\n */\nfunction isPrimitive(val: unknown) {\n return val == null || /^[sbn]/.test(typeof val);\n}\n\n/**\n * The isPrimitive function checks if a value is a primitive type.\n * It returns true if the value is null, undefined, a string, a boolean, or a number.\n */\nexport function useDeepCompareMemoize<T>(value: T) {\n const ref = React.useRef<T>(value);\n const signalRef = React.useRef<number>(0);\n\n if (!deepEqual(value, ref.current)) {\n ref.current = value;\n signalRef.current += 1;\n }\n\n return React.useMemo(() => ref.current, [signalRef.current]);\n}\n\n/**\n * The isPrimitive function checks if a value is a primitive type.\n * It returns true if the value is null, undefined, a string, a boolean, or a number.\n */\nexport function useDeepCompareEffect(\n callback: EffectCallbackType,\n dependencies: DependencyListType,\n): UseEffectReturn {\n if (process.env.NODE_ENV !== 'production') {\n checkDeps(dependencies);\n }\n\n return React.useEffect(callback, useDeepCompareMemoize(dependencies));\n}\n\n/**\n * deep compare effect 훅\n * @param callback effect 콜백\n * @param dependencies 의존성 목록\n */\nexport function useDeepCompareEffectNoCheck(\n callback: EffectCallbackType,\n dependencies: DependencyListType,\n): UseEffectReturn {\n return React.useEffect(callback, useDeepCompareMemoize(dependencies));\n}\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","checkDeps","deps","isPrimitive","val","useDeepCompareMemoize","value","ref","React","signalRef","deepEqual","useDeepCompareEffect","callback","dependencies","useDeepCompareEffectNoCheck","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,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