@owp/core 2.5.51 → 2.5.53
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/_virtual/index16.js +4 -4
- package/dist/_virtual/index17.js +4 -4
- package/dist/_virtual/index18.js +4 -4
- package/dist/_virtual/index19.js +4 -4
- package/dist/_virtual/index3.js +2 -2
- package/dist/_virtual/index4.js +2 -2
- package/dist/components/OwpErrorBoundary/OwpErrorBoundary.js +49 -32
- package/dist/components/OwpErrorBoundary/OwpErrorBoundary.js.map +1 -1
- package/dist/components/OwpLoading/OwpLoading.js +7 -6
- package/dist/components/OwpLoading/OwpLoading.js.map +1 -1
- package/dist/components/OwpNavLinkAdapter/OwpNavLinkAdapter.js +100 -28
- package/dist/components/OwpNavLinkAdapter/OwpNavLinkAdapter.js.map +1 -1
- package/dist/components/OwpPageSkeleton/OwpPageSkeleton.js +4 -4
- package/dist/components/OwpSuspense/OwpSuspense.js +66 -60
- package/dist/components/OwpSuspense/OwpSuspense.js.map +1 -1
- package/dist/components/OwpTreeGrid/OwpTreeGrid.js +352 -297
- package/dist/components/OwpTreeGrid/OwpTreeGrid.js.map +1 -1
- package/dist/components/OwpTreeGrid/internal/treeGridRuntime.js +654 -604
- package/dist/components/OwpTreeGrid/internal/treeGridRuntime.js.map +1 -1
- package/dist/components/OwpTreeGrid/internal/treeGridTheme.js +516 -425
- package/dist/components/OwpTreeGrid/internal/treeGridTheme.js.map +1 -1
- package/dist/configs/theme.js +26 -22
- package/dist/configs/theme.js.map +1 -1
- package/dist/constants/gridTheme.js +40 -29
- package/dist/constants/gridTheme.js.map +1 -1
- package/dist/contexts/OwpUiProvider.js +37 -34
- package/dist/contexts/OwpUiProvider.js.map +1 -1
- package/dist/features/themePreview/components/ThemePreviewCanvas.js +8 -8
- package/dist/features/themePreview/components/ThemePreviewCanvasSections.js +27 -27
- package/dist/features/themePreview/components/ThemePreviewColorField.js +4 -4
- package/dist/features/themePreview/components/ThemePreviewControls.js +8 -8
- package/dist/features/themePreview/configs/grid.js +5 -7
- package/dist/features/themePreview/configs/grid.js.map +1 -1
- package/dist/features/themePreview/configs/previewStorage.js +26 -32
- package/dist/features/themePreview/configs/previewStorage.js.map +1 -1
- package/dist/features/themePreview/configs/settings.js +13 -12
- package/dist/features/themePreview/configs/settings.js.map +1 -1
- package/dist/features/themePreview/dialogs/ThemePreviewDialog.js +5 -5
- package/dist/features/themePreview/dialogs/index.js +5 -0
- package/dist/features/themePreview/dialogs/index.js.map +1 -0
- package/dist/features/themePreview/utils/themePreviewDefinitions.js +4 -12
- package/dist/features/themePreview/utils/themePreviewDefinitions.js.map +1 -1
- package/dist/features/themePreview/utils/themePreviewExport.js +48 -37
- package/dist/features/themePreview/utils/themePreviewExport.js.map +1 -1
- package/dist/hooks/internal/useNavigationActiveRouteRemount.js +19 -16
- package/dist/hooks/internal/useNavigationActiveRouteRemount.js.map +1 -1
- package/dist/hooks/internal/useRouteTransitionLoading.js +49 -0
- package/dist/hooks/internal/useRouteTransitionLoading.js.map +1 -0
- package/dist/index.js +67 -66
- package/dist/layout/Layout.js +107 -34
- package/dist/layout/Layout.js.map +1 -1
- package/dist/layout/components/navigation/NavBadge.js +8 -8
- package/dist/layout/components/navigation/NavBadge.js.map +1 -1
- package/dist/layout/components/navigation/NavItem.js +19 -15
- package/dist/layout/components/navigation/NavItem.js.map +1 -1
- package/dist/layout/components/navigation/Navigation.js +25 -22
- package/dist/layout/components/navigation/Navigation.js.map +1 -1
- package/dist/layout/components/navigation/NavigationMenu.js +25 -18
- package/dist/layout/components/navigation/NavigationMenu.js.map +1 -1
- package/dist/layout/components/navigation/vertical/NavVerticalLayout.js +69 -44
- package/dist/layout/components/navigation/vertical/NavVerticalLayout.js.map +1 -1
- package/dist/layout/components/navigation/vertical/types/NavVerticalCollapse.js +71 -64
- package/dist/layout/components/navigation/vertical/types/NavVerticalCollapse.js.map +1 -1
- package/dist/layout/components/navigation/vertical/types/NavVerticalGroup.js +15 -14
- package/dist/layout/components/navigation/vertical/types/NavVerticalGroup.js.map +1 -1
- package/dist/layout/components/navigation/vertical/types/NavVerticalItem.js +16 -14
- package/dist/layout/components/navigation/vertical/types/NavVerticalItem.js.map +1 -1
- package/dist/layout/components/navigation/vertical/types/NavVerticalLink.js +17 -12
- package/dist/layout/components/navigation/vertical/types/NavVerticalLink.js.map +1 -1
- package/dist/layout/components/toggles/NavigationSearchToggle.js +164 -165
- package/dist/layout/components/toggles/NavigationSearchToggle.js.map +1 -1
- package/dist/layout/components/toggles/NavigationShortcutsToggle.js +88 -95
- package/dist/layout/components/toggles/NavigationShortcutsToggle.js.map +1 -1
- package/dist/layout/components/toggles/ThemePreviewToggle.js +26 -27
- package/dist/layout/components/toggles/ThemePreviewToggle.js.map +1 -1
- package/dist/node_modules/.pnpm/inko@1.1.1/node_modules/inko/index.js +1 -1
- package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/index.js +1 -1
- package/dist/node_modules/.pnpm/react-overlays@5.2.1_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/react-overlays/esm/Portal.js +1 -1
- package/dist/owp-app.css +1 -1
- package/dist/types/components/OwpErrorBoundary/OwpErrorBoundary.d.ts +4 -0
- package/dist/types/components/OwpErrorBoundary/index.d.ts +1 -1
- package/dist/types/components/OwpNumberField/OwpNumberField.d.ts +2 -2
- package/dist/types/components/OwpPicker/internal/DatePickerInput.d.ts +1 -1
- package/dist/types/components/OwpSuspense/OwpSuspense.d.ts +1 -0
- package/dist/types/components/OwpTable/internal/OwpTableBase.d.ts +1 -1
- package/dist/types/components/OwpTabs/OwpTab.d.ts +1 -1
- package/dist/types/components/OwpTabs/OwpTabs.d.ts +1 -1
- package/dist/types/components/OwpTreeGrid/internal/treeGridRuntime.d.ts +7 -1
- package/dist/types/components/OwpTreeGrid/internal/treeGridTheme.d.ts +2 -0
- package/dist/types/configs/theme/index.d.ts +2 -0
- package/dist/types/constants/gridTheme.d.ts +4 -0
- package/dist/types/contexts/OwpAppContext.d.ts +1 -1
- package/dist/types/features/themePreview/configs/grid.d.ts +2 -4
- package/dist/types/features/themePreview/configs/settings.d.ts +14 -4
- package/dist/types/features/themePreview/utils/themePreviewExport.d.ts +1 -1
- package/dist/types/features/themePreview/utils/themePreviewSettings.d.ts +1 -1
- package/dist/types/hooks/internal/useRouteTransitionLoading.d.ts +27 -0
- package/dist/types/index.d.ts +1 -1
- package/dist/types/layout/components/navigation/NavItem.d.ts +2 -3
- package/dist/types/layout/components/navigation/NavigationMenu.d.ts +5 -5
- package/dist/types/layout/components/navigation/vertical/NavVerticalLayout.d.ts +1 -1
- package/dist/types/layout/components/navigation/vertical/types/NavVerticalCollapse.d.ts +1 -1
- package/dist/types/layout/components/navigation/vertical/types/NavVerticalGroup.d.ts +1 -1
- package/dist/types/layout/components/navigation/vertical/types/NavVerticalItem.d.ts +1 -1
- package/dist/types/layout/components/navigation/vertical/types/NavVerticalLink.d.ts +1 -1
- package/dist/types/store/atoms/owpSettingsAtoms.d.ts +1 -1
- package/dist/types/types/OwpGridThemeTypes.d.ts +4 -0
- package/dist/types/types/OwpSettingsTypes.d.ts +7 -0
- package/dist/types/types/index.d.ts +1 -1
- package/dist/types/utils/internal/navigationSearchUtils.d.ts +22 -0
- package/dist/types/utils/internal/navigationUtils.d.ts +22 -27
- package/dist/utils/internal/navigationSearchUtils.js +44 -0
- package/dist/utils/internal/navigationSearchUtils.js.map +1 -0
- package/dist/utils/internal/navigationUtils.js +38 -123
- package/dist/utils/internal/navigationUtils.js.map +1 -1
- package/dist/utils/treeGridUtil.js +123 -118
- package/dist/utils/treeGridUtil.js.map +1 -1
- package/package.json +1 -2
- package/dist/features/themePreview.js +0 -76
- package/dist/features/themePreview.js.map +0 -1
- package/dist/node_modules/.pnpm/es-toolkit@1.39.10/node_modules/es-toolkit/dist/compat/_internal/isIterateeCall.js +0 -14
- package/dist/node_modules/.pnpm/es-toolkit@1.39.10/node_modules/es-toolkit/dist/compat/_internal/isIterateeCall.js.map +0 -1
- package/dist/node_modules/.pnpm/es-toolkit@1.39.10/node_modules/es-toolkit/dist/compat/object/defaults.js +0 -24
- package/dist/node_modules/.pnpm/es-toolkit@1.39.10/node_modules/es-toolkit/dist/compat/object/defaults.js.map +0 -1
- package/dist/node_modules/.pnpm/es-toolkit@1.39.10/node_modules/es-toolkit/dist/compat/string/trim.js +0 -10
- package/dist/node_modules/.pnpm/es-toolkit@1.39.10/node_modules/es-toolkit/dist/compat/string/trim.js.map +0 -1
- package/features/themePreview.d.ts +0 -3
- package/features/themePreview.js +0 -1
|
@@ -63,7 +63,7 @@ export declare function getThemePreviewPaletteValue(settings: ThemePreviewSettin
|
|
|
63
63
|
* @param settings app settings
|
|
64
64
|
* @param sectionKey preset section key
|
|
65
65
|
*/
|
|
66
|
-
export declare function getThemePreviewSectionMode(settings: OwpSettingsConfigType, sectionKey: ThemePreviewPresetSectionKey): "
|
|
66
|
+
export declare function getThemePreviewSectionMode(settings: OwpSettingsConfigType, sectionKey: ThemePreviewPresetSectionKey): "dark" | "light";
|
|
67
67
|
/**
|
|
68
68
|
* settings와 일치하는 preset key를 section별로 계산
|
|
69
69
|
* @param settings app settings
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
type RouteTransitionLoadingState = {
|
|
2
|
+
isLoading: boolean;
|
|
3
|
+
pathname?: string;
|
|
4
|
+
};
|
|
5
|
+
/**
|
|
6
|
+
* route transition loading 표시 상태 조회
|
|
7
|
+
*/
|
|
8
|
+
export declare const useRouteTransitionLoadingState: () => RouteTransitionLoadingState;
|
|
9
|
+
/**
|
|
10
|
+
* skeleton fallback 출력 완료 pathname 목록 조회
|
|
11
|
+
*/
|
|
12
|
+
export declare const useRouteSkeletonRenderedPathnames: () => ReadonlySet<string>;
|
|
13
|
+
/**
|
|
14
|
+
* navigation 클릭 직후 route 이동 전까지 표시할 optimistic active path 조회
|
|
15
|
+
*/
|
|
16
|
+
export declare const useNavigationOptimisticActivePath: () => string;
|
|
17
|
+
/**
|
|
18
|
+
* route transition loading 표시 상태 제어
|
|
19
|
+
*/
|
|
20
|
+
export declare const useRouteTransitionLoadingActions: () => {
|
|
21
|
+
startRouteTransitionLoading: (pathname?: string) => void;
|
|
22
|
+
stopRouteTransitionLoading: () => void;
|
|
23
|
+
setNavigationOptimisticActivePath: (path: string) => void;
|
|
24
|
+
clearNavigationOptimisticActivePath: () => void;
|
|
25
|
+
markRouteSkeletonRendered: (pathname: string) => void;
|
|
26
|
+
};
|
|
27
|
+
export {};
|
package/dist/types/index.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ export * from './components/OwpDialog';
|
|
|
8
8
|
export { OwpDialogsProvider } from './components/OwpDialogsProvider';
|
|
9
9
|
export * from './components/OwpCommonCode';
|
|
10
10
|
export * from './components/OwpExportExcelButton/OwpExportExcelButton';
|
|
11
|
-
export { OwpErrorBoundary } from './components/OwpErrorBoundary';
|
|
11
|
+
export { OwpErrorBoundary, OwpRouteErrorElement } from './components/OwpErrorBoundary';
|
|
12
12
|
export * from './components/OwpErrorStatusPage';
|
|
13
13
|
export * from './components/OwpFieldHelperText';
|
|
14
14
|
export * from './components/OwpFilePickerButton/OwpFilePickerButton';
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import type { OwpNavItemType as NavItemType } from '@/types/OwpNavigationTypes';
|
|
2
|
+
import type { NavigationItemClickContext } from './NavigationMenu';
|
|
2
3
|
/** Navigation item renderer에 전달되는 공통 속성 */
|
|
3
4
|
export type NavItemComponentProps = {
|
|
4
|
-
/** render할 navigation item type */
|
|
5
|
-
type: string;
|
|
6
5
|
/** navigation item 원본 설정 */
|
|
7
6
|
item: NavItemType;
|
|
8
7
|
/** vertical item density 축소 여부 */
|
|
@@ -10,7 +9,7 @@ export type NavItemComponentProps = {
|
|
|
10
9
|
/** 중첩 collapse depth */
|
|
11
10
|
nestedLevel?: number;
|
|
12
11
|
/** leaf/collapse item click callback */
|
|
13
|
-
onItemClick?: (item: NavItemType) => void;
|
|
12
|
+
onItemClick?: (item: NavItemType, context?: NavigationItemClickContext) => void;
|
|
14
13
|
/** permission rule 적용 여부 */
|
|
15
14
|
checkPermission?: boolean;
|
|
16
15
|
/** 현재 route 기준으로 펼쳐 둘 collapse ID 집합 */
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import type { OwpNavItemType as NavItemType } from '@/types/OwpNavigationTypes';
|
|
2
|
+
export type NavigationItemClickContext = {
|
|
3
|
+
/** mobile navigation close 여부 */
|
|
4
|
+
shouldCloseNavigation?: boolean;
|
|
5
|
+
};
|
|
2
6
|
/** Vertical navigation menu rendering과 route 기반 collapse open 상태 속성 */
|
|
3
7
|
export type NavigationMenuProps = {
|
|
4
8
|
/** root className */
|
|
@@ -8,15 +12,11 @@ export type NavigationMenuProps = {
|
|
|
8
12
|
/** 상위 navigation 영역 활성 여부 */
|
|
9
13
|
active?: boolean;
|
|
10
14
|
/** item click callback */
|
|
11
|
-
onItemClick?: (item: NavItemType) => void;
|
|
15
|
+
onItemClick?: (item: NavItemType, context?: NavigationItemClickContext) => void;
|
|
12
16
|
/** render할 navigation tree */
|
|
13
17
|
navigation?: NavItemType[];
|
|
14
18
|
/** navigation layout 종류 */
|
|
15
19
|
layout?: 'vertical';
|
|
16
|
-
/** 최상위 level 여부 */
|
|
17
|
-
firstLevel?: boolean;
|
|
18
|
-
/** 외부에서 지정한 선택 item ID */
|
|
19
|
-
selectedId?: string;
|
|
20
20
|
/** permission rule 적용 여부 */
|
|
21
21
|
checkPermission?: boolean;
|
|
22
22
|
/** 외부에서 제어하는 collapse open ID 집합 */
|
|
@@ -70,7 +70,7 @@ export declare const customScrollbarsEnabledAtom: import("jotai").Atom<boolean>;
|
|
|
70
70
|
/**
|
|
71
71
|
* current direction 조회 atom
|
|
72
72
|
*/
|
|
73
|
-
export declare const directionAtom: import("jotai").Atom<"
|
|
73
|
+
export declare const directionAtom: import("jotai").Atom<"ltr" | "rtl">;
|
|
74
74
|
/**
|
|
75
75
|
* main theme 설정 조회 atom
|
|
76
76
|
*/
|
|
@@ -44,6 +44,10 @@ export type OwpGridCellThemeConfigType = {
|
|
|
44
44
|
* OWP grid interaction state theme 설정
|
|
45
45
|
*/
|
|
46
46
|
export type OwpGridStateThemeConfigType = {
|
|
47
|
+
/** hover 배경색 */
|
|
48
|
+
hoverBackgroundColor?: string;
|
|
49
|
+
/** hover border 색상 */
|
|
50
|
+
hoverBorderColor?: string;
|
|
47
51
|
/** hover row 배경색 */
|
|
48
52
|
hoverRowBackgroundColor?: string;
|
|
49
53
|
/** hover row border 색상 */
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { themeLayoutDefaultsProps } from '@/layout/themeLayoutConfigs';
|
|
2
2
|
import type { Palette } from '@mui/material/styles';
|
|
3
|
+
import type { SnackbarProviderProps } from 'notistack';
|
|
3
4
|
import { PartialDeep } from 'type-fest';
|
|
4
5
|
import type { OwpGridThemeConfigType } from './OwpGridThemeTypes';
|
|
5
6
|
import type { OwpTableThemeConfigType } from './OwpTableThemeTypes';
|
|
@@ -20,6 +21,10 @@ export type OwpSnackbarVariantThemeConfigType = {
|
|
|
20
21
|
* OWP snackbar theme 설정
|
|
21
22
|
*/
|
|
22
23
|
export type OwpSnackbarThemeConfigType = Record<OwpSnackbarVariantType, OwpSnackbarVariantThemeConfigType>;
|
|
24
|
+
/**
|
|
25
|
+
* OWP snackbar provider 표시 설정
|
|
26
|
+
*/
|
|
27
|
+
export type OwpSnackbarProviderConfigType = Pick<SnackbarProviderProps, 'anchorOrigin' | 'autoHideDuration' | 'maxSnack' | 'style'>;
|
|
23
28
|
/**
|
|
24
29
|
* OWP theme 한 벌의 palette/grid/table 설정
|
|
25
30
|
*/
|
|
@@ -59,6 +64,8 @@ export type OwpSettingsConfigType = {
|
|
|
59
64
|
};
|
|
60
65
|
/** snackbar variant theme 설정 */
|
|
61
66
|
snackbar: OwpSnackbarThemeConfigType;
|
|
67
|
+
/** SnackbarProvider 표시 설정 */
|
|
68
|
+
snackbarProviderProps?: OwpSnackbarProviderConfigType;
|
|
62
69
|
/** route auth 미지정 시 사용할 기본 권한 */
|
|
63
70
|
defaultAuth?: string[];
|
|
64
71
|
/** 로그인 화면 redirect URL */
|
|
@@ -4,7 +4,7 @@ export type { AlertDialogPayload, AlertDialogProps, AlertOptions, CloseDialog, C
|
|
|
4
4
|
export type { OwpExcelJSBrowserModule } from './OwpExcelTypes';
|
|
5
5
|
export type { OwpGridBodyThemeConfigType, OwpGridCellThemeConfigType, OwpGridChangedThemeConfigType, OwpGridEditableThemeConfigType, OwpGridHeaderThemeConfigType, OwpGridRowThemeConfigType, OwpGridStateThemeConfigType, OwpGridThemeConfigType, } from './OwpGridThemeTypes';
|
|
6
6
|
export type { OwpTableCellThemeConfigType, OwpTableHeaderThemeConfigType, OwpTableThemeConfigType, OwpTableVariantThemeConfigType, } from './OwpTableThemeTypes';
|
|
7
|
-
export type { OwpSnackbarThemeConfigType, OwpSnackbarVariantThemeConfigType, OwpSnackbarVariantType, OwpThemeType, OwpThemesType, OwpSettingsConfigType, } from './OwpSettingsTypes';
|
|
7
|
+
export type { OwpSnackbarProviderConfigType, OwpSnackbarThemeConfigType, OwpSnackbarVariantThemeConfigType, OwpSnackbarVariantType, OwpThemeType, OwpThemesType, OwpSettingsConfigType, } from './OwpSettingsTypes';
|
|
8
8
|
export type { OwpFlatNavItemType, OwpNavBadgeType, OwpNavPermission, OwpNavItemType, OwpPermissionFlag, } from './OwpNavigationTypes';
|
|
9
9
|
export type { OwpRouteConfigModule, OwpRouteConfigModuleMap, OwpRouteConfigType, OwpRouteItemType, OwpRoutesType, } from './OwpRouteTypes';
|
|
10
10
|
export type { AnyFormFieldType, ThemeFormConfigTypes } from './ThemeFormConfigTypes';
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* navigation search 비교용 문자열 정규화
|
|
3
|
+
* @param value 검색 입력 또는 navigation title
|
|
4
|
+
*/
|
|
5
|
+
export declare const normalizeNavigationSearchText: (value?: string) => string;
|
|
6
|
+
/**
|
|
7
|
+
* 한글 음절을 초성 검색 문자열로 변환
|
|
8
|
+
* @param value navigation title
|
|
9
|
+
*/
|
|
10
|
+
export declare const getNavigationHangulInitialSearchText: (value?: string) => string;
|
|
11
|
+
/**
|
|
12
|
+
* navigation title과 검색 입력 match 여부
|
|
13
|
+
* @param title navigation title
|
|
14
|
+
* @param query 검색 입력
|
|
15
|
+
*/
|
|
16
|
+
export declare const isNavigationSearchTextMatch: (title?: string, query?: string) => boolean;
|
|
17
|
+
/**
|
|
18
|
+
* 직접 highlight가 어려운 fuzzy match의 fallback range
|
|
19
|
+
* @param title navigation title
|
|
20
|
+
* @param query 검색 입력
|
|
21
|
+
*/
|
|
22
|
+
export declare const getNavigationSearchFallbackHighlightRanges: (title?: string, query?: string) => [number, number][];
|
|
@@ -1,39 +1,34 @@
|
|
|
1
|
-
import type { OwpFlatNavItemType, OwpNavItemType
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
permission?: OwpNavPermission;
|
|
1
|
+
import type { OwpFlatNavItemType, OwpNavItemType } from '@/types/OwpNavigationTypes';
|
|
2
|
+
export type NavigationPathMatchOptions = {
|
|
3
|
+
/** exact path match 여부 */
|
|
4
|
+
end?: boolean;
|
|
6
5
|
};
|
|
7
6
|
/**
|
|
8
|
-
*
|
|
7
|
+
* route 비교용 pathname 정규화
|
|
8
|
+
* @param path URL 또는 pathname
|
|
9
9
|
*/
|
|
10
|
-
export declare
|
|
10
|
+
export declare const normalizeNavigationPathname: (path?: string) => string;
|
|
11
11
|
/**
|
|
12
|
-
*
|
|
12
|
+
* navigation URL과 현재 pathname segment match 여부
|
|
13
|
+
* @param pathname 현재 route pathname
|
|
14
|
+
* @param navigationUrl navigation item URL
|
|
15
|
+
* @param options match 옵션
|
|
13
16
|
*/
|
|
14
|
-
export declare
|
|
17
|
+
export declare const isNavigationPathMatch: (pathname?: string, navigationUrl?: string, options?: NavigationPathMatchOptions) => boolean;
|
|
18
|
+
/**
|
|
19
|
+
* navigation item type fallback
|
|
20
|
+
* @param item navigation item
|
|
21
|
+
*/
|
|
22
|
+
export declare const resolveNavigationItemType: (item: Pick<OwpNavItemType, "children" | "type">) => string;
|
|
15
23
|
/**
|
|
16
24
|
* Navigation structure helper
|
|
17
25
|
*/
|
|
18
26
|
export declare class OwpNavigationHelper {
|
|
19
|
-
static selectById(nav: OwpNavItemType[], id: string): OwpNavItemType | undefined;
|
|
20
|
-
static appendNavItem(nav: OwpNavItemType[], item: OwpNavItemType, parentId?: string | null): OwpNavItemType[];
|
|
21
|
-
static prependNavItem(nav: OwpNavItemType[], item: OwpNavItemType, parentId?: string | null): OwpNavItemType[];
|
|
22
|
-
static filterNavigationByPermission(nav: OwpNavItemType[], userRole: User['role']): OwpNavItemType[];
|
|
23
|
-
/**
|
|
24
|
-
* Navigation item removal
|
|
25
|
-
*/
|
|
26
|
-
static removeNavItem(nav: OwpNavItemType[], id: string): OwpNavItemType[];
|
|
27
|
-
/**
|
|
28
|
-
* Navigation item update
|
|
29
|
-
*/
|
|
30
|
-
static updateNavItem(nav: OwpNavItemType[], id: string, item: PartialDeep<OwpNavItemType>): OwpNavItemType[];
|
|
31
27
|
/**
|
|
32
|
-
*
|
|
28
|
+
* 검색과 shortcut 후보 navigation list 추출
|
|
29
|
+
* @param navigationItems navigation tree
|
|
30
|
+
* @param flatNavigation 누적 flat list
|
|
31
|
+
* @param parentOrder 상위 order path
|
|
33
32
|
*/
|
|
34
|
-
static getFlatNavigation(navigationItems?: OwpNavItemType[], flatNavigation?:
|
|
35
|
-
static hasPermission(authArr: string[] | string | undefined, userRole: User['role']): boolean;
|
|
36
|
-
static flattenNavigation(navigation: OwpNavItemType[], parentOrder?: string): OwpFlatNavItemType[];
|
|
37
|
-
static unflattenNavigation(navigation: OwpFlatNavItemType[]): OwpNavItemType[];
|
|
33
|
+
static getFlatNavigation(navigationItems?: OwpNavItemType[], flatNavigation?: OwpFlatNavItemType[], parentOrder?: string): OwpFlatNavItemType[];
|
|
38
34
|
}
|
|
39
|
-
export {};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
var u = Object.defineProperty;
|
|
2
|
+
var r = (n, a) => u(n, "name", { value: a, configurable: !0 });
|
|
3
|
+
const c = /\s+/g, o = [
|
|
4
|
+
"ㄱ",
|
|
5
|
+
"ㄲ",
|
|
6
|
+
"ㄴ",
|
|
7
|
+
"ㄷ",
|
|
8
|
+
"ㄸ",
|
|
9
|
+
"ㄹ",
|
|
10
|
+
"ㅁ",
|
|
11
|
+
"ㅂ",
|
|
12
|
+
"ㅃ",
|
|
13
|
+
"ㅅ",
|
|
14
|
+
"ㅆ",
|
|
15
|
+
"ㅇ",
|
|
16
|
+
"ㅈ",
|
|
17
|
+
"ㅉ",
|
|
18
|
+
"ㅊ",
|
|
19
|
+
"ㅋ",
|
|
20
|
+
"ㅌ",
|
|
21
|
+
"ㅍ",
|
|
22
|
+
"ㅎ"
|
|
23
|
+
], g = /* @__PURE__ */ r((n) => Array.from(n).reduce((a, t) => {
|
|
24
|
+
const e = t.charCodeAt(0);
|
|
25
|
+
return e < 4352 || e > 4370 ? `${a}${t}` : `${a}${o[e - 4352]}`;
|
|
26
|
+
}, ""), "normalizeHangulInitialJamo"), l = /* @__PURE__ */ r((n) => g((n ?? "").normalize("NFKC")).toLocaleLowerCase().replace(c, ""), "normalizeNavigationSearchText"), s = /* @__PURE__ */ r((n) => Array.from(l(n)).reduce((a, t) => {
|
|
27
|
+
const e = t.charCodeAt(0);
|
|
28
|
+
if (e < 44032 || e > 55203)
|
|
29
|
+
return `${a}${t}`;
|
|
30
|
+
const i = Math.floor(
|
|
31
|
+
(e - 44032) / 588
|
|
32
|
+
);
|
|
33
|
+
return `${a}${o[i]}`;
|
|
34
|
+
}, ""), "getNavigationHangulInitialSearchText"), d = /* @__PURE__ */ r((n, a) => {
|
|
35
|
+
const t = l(a);
|
|
36
|
+
return t ? l(n).includes(t) ? !0 : s(n).includes(t) : !1;
|
|
37
|
+
}, "isNavigationSearchTextMatch"), C = /* @__PURE__ */ r((n, a) => !n || !d(n, a) ? [] : [[0, n.length]], "getNavigationSearchFallbackHighlightRanges");
|
|
38
|
+
export {
|
|
39
|
+
s as getNavigationHangulInitialSearchText,
|
|
40
|
+
C as getNavigationSearchFallbackHighlightRanges,
|
|
41
|
+
d as isNavigationSearchTextMatch,
|
|
42
|
+
l as normalizeNavigationSearchText
|
|
43
|
+
};
|
|
44
|
+
//# sourceMappingURL=navigationSearchUtils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"navigationSearchUtils.js","sources":["../../../src/utils/internal/navigationSearchUtils.ts"],"sourcesContent":null,"names":["whitespacePattern","hangulInitials","normalizeHangulInitialJamo","__name","value","normalizedText","character","characterCode","normalizeNavigationSearchText","getNavigationHangulInitialSearchText","initialText","initialIndex","isNavigationSearchTextMatch","title","query","normalizedQuery","getNavigationSearchFallbackHighlightRanges"],"mappings":";;AAKA,MAAMA,IAAoB,QACpBC,IAAiB;AAAA,EACrB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAEMC,IAA6B,gBAAAC,EAAA,CAACC,MAC3B,MAAM,KAAKA,CAAK,EAAE,OAAO,CAACC,GAAgBC,MAAc;AAC7D,QAAMC,IAAgBD,EAAU,WAAW,CAAC;AAE5C,SACEC,IAAgB,QAChBA,IAAgB,OAET,GAAGF,CAAc,GAAGC,CAAS,KAG/B,GAAGD,CAAc,GAAGJ,EAAeM,IAAgB,IAA0B,CAAC;AACvF,GAAG,EAAE,GAZ4B,+BAmBtBC,IAAgC,gBAAAL,EAAA,CAACC,MACrCF,GAA4BE,KAAS,IAAI,UAAU,MAAM,CAAC,EAC9D,kBAAA,EACA,QAAQJ,GAAmB,EAAE,GAHW,kCAUhCS,IAAuC,gBAAAN,EAAA,CAACC,MAC5C,MAAM,KAAKI,EAA8BJ,CAAK,CAAC,EAAE,OAAO,CAACM,GAAaJ,MAAc;AACzF,QAAMC,IAAgBD,EAAU,WAAW,CAAC;AAE5C,MACEC,IAAgB,SAChBA,IAAgB;AAEhB,WAAO,GAAGG,CAAW,GAAGJ,CAAS;AAGnC,QAAMK,IAAe,KAAK;AAAA,KACvBJ,IAAgB,SAA2B;AAAA,EAAA;AAG9C,SAAO,GAAGG,CAAW,GAAGT,EAAeU,CAAY,CAAC;AACtD,GAAG,EAAE,GAhB6C,yCAwBvCC,IAA8B,gBAAAT,EAAA,CAACU,GAAgBC,MAAmB;AAC7E,QAAMC,IAAkBP,EAA8BM,CAAK;AAE3D,SAAKC,IAImBP,EAA8BK,CAAK,EAEvC,SAASE,CAAe,IACnC,KAGFN,EAAqCI,CAAK,EAAE,SAASE,CAAe,IATlE;AAUX,GAd2C,gCAqB9BC,IAA6C,gBAAAb,EAAA,CACxDU,GACAC,MAEI,CAACD,KAAS,CAACD,EAA4BC,GAAOC,CAAK,IAC9C,CAAA,IAGF,CAAC,CAAC,GAAGD,EAAM,MAAM,CAAC,GAR+B;"}
|
|
@@ -1,132 +1,47 @@
|
|
|
1
1
|
var f = Object.defineProperty;
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
return
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
children: []
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
h(N, "OwpNavItemModel");
|
|
28
|
-
const a = class a {
|
|
29
|
-
static selectById(i, t) {
|
|
30
|
-
for (let e = 0; e < i.length; e += 1) {
|
|
31
|
-
const r = i[e];
|
|
32
|
-
if (r.id === t)
|
|
33
|
-
return r;
|
|
34
|
-
if (r.children) {
|
|
35
|
-
const n = this.selectById(r.children, t);
|
|
36
|
-
if (n)
|
|
37
|
-
return n;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
static appendNavItem(i, t, e = null) {
|
|
42
|
-
return e ? i.map((r) => {
|
|
43
|
-
if (r.id === e) {
|
|
44
|
-
const n = { ...r };
|
|
45
|
-
return n.children = [...r.children || [], t], n;
|
|
46
|
-
}
|
|
47
|
-
return r.children ? { ...r, children: this.appendNavItem(r.children, t, e) } : { ...r };
|
|
48
|
-
}) : [...i, t];
|
|
49
|
-
}
|
|
50
|
-
static prependNavItem(i, t, e = null) {
|
|
51
|
-
return e ? i.map((r) => {
|
|
52
|
-
if (r.id === e) {
|
|
53
|
-
const n = { ...r };
|
|
54
|
-
return n.children = [t, ...r.children || []], n;
|
|
55
|
-
}
|
|
56
|
-
return r.children ? { ...r, children: this.prependNavItem(r.children, t, e) } : { ...r };
|
|
57
|
-
}) : [t, ...i];
|
|
58
|
-
}
|
|
59
|
-
static filterNavigationByPermission(i, t) {
|
|
60
|
-
return i.reduce((e, r) => {
|
|
61
|
-
const n = r.children ? this.filterNavigationByPermission(r.children, t) : [];
|
|
62
|
-
if (this.hasPermission(r.auth, t) || n.length) {
|
|
63
|
-
const l = { ...r };
|
|
64
|
-
l.children = n.length ? n : void 0, e.push(l);
|
|
65
|
-
}
|
|
66
|
-
return e;
|
|
67
|
-
}, []);
|
|
68
|
-
}
|
|
69
|
-
/**
|
|
70
|
-
* Navigation item removal
|
|
71
|
-
*/
|
|
72
|
-
static removeNavItem(i, t) {
|
|
73
|
-
return i.reduce((e, r) => (r.id !== t && (r.children ? e.push({
|
|
74
|
-
...r,
|
|
75
|
-
children: this.removeNavItem(r.children, t)
|
|
76
|
-
}) : e.push(r)), e), []);
|
|
77
|
-
}
|
|
78
|
-
/**
|
|
79
|
-
* Navigation item update
|
|
80
|
-
*/
|
|
81
|
-
static updateNavItem(i, t, e) {
|
|
82
|
-
return i.map((r) => r.id === t ? p({}, r, e) : r.children ? {
|
|
83
|
-
...r,
|
|
84
|
-
children: this.updateNavItem(r.children, t, e)
|
|
85
|
-
} : r);
|
|
86
|
-
}
|
|
2
|
+
var s = (e, t) => f(e, "name", { value: t, configurable: !0 });
|
|
3
|
+
const g = /[?#]/, p = /\/+$/, u = /* @__PURE__ */ s((e) => {
|
|
4
|
+
if (!e)
|
|
5
|
+
return "";
|
|
6
|
+
const [t = ""] = e.split(g), n = t.startsWith("/") ? t : `/${t}`;
|
|
7
|
+
return n.length > 1 ? n.replace(p, "") : n;
|
|
8
|
+
}, "normalizeNavigationPathname"), y = /* @__PURE__ */ s((e, t, n = {}) => {
|
|
9
|
+
const r = u(e), a = u(t);
|
|
10
|
+
return !r || !a ? !1 : r === a ? !0 : n.end || a === "/" ? !1 : r.startsWith(`${a}/`);
|
|
11
|
+
}, "isNavigationPathMatch"), m = /* @__PURE__ */ s((e) => {
|
|
12
|
+
var t;
|
|
13
|
+
return e.type ?? ((t = e.children) != null && t.length ? "collapse" : "item");
|
|
14
|
+
}, "resolveNavigationItemType"), P = /* @__PURE__ */ s((e, t) => {
|
|
15
|
+
var r;
|
|
16
|
+
const n = { ...e };
|
|
17
|
+
return delete n.children, delete n.sx, {
|
|
18
|
+
...n,
|
|
19
|
+
type: m(e),
|
|
20
|
+
children: (r = e.children) == null ? void 0 : r.map((a) => a.id),
|
|
21
|
+
order: t
|
|
22
|
+
};
|
|
23
|
+
}, "createFlatNavigationItem"), o = class o {
|
|
87
24
|
/**
|
|
88
|
-
*
|
|
25
|
+
* 검색과 shortcut 후보 navigation list 추출
|
|
26
|
+
* @param navigationItems navigation tree
|
|
27
|
+
* @param flatNavigation 누적 flat list
|
|
28
|
+
* @param parentOrder 상위 order path
|
|
89
29
|
*/
|
|
90
|
-
static getFlatNavigation(
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
30
|
+
static getFlatNavigation(t = [], n = [], r = "") {
|
|
31
|
+
var a;
|
|
32
|
+
for (let c = 0; c < t.length; c += 1) {
|
|
33
|
+
const i = t[c], l = m(i), h = r ? `${r}.${c + 1}` : `${c + 1}`;
|
|
34
|
+
l === "item" && n.push(P(i, h)), (l === "collapse" || l === "group") && ((a = i.children) != null && a.length) && this.getFlatNavigation(i.children, n, h);
|
|
94
35
|
}
|
|
95
|
-
return
|
|
96
|
-
}
|
|
97
|
-
// @ts-expect-error legacy user role contract
|
|
98
|
-
static hasPermission(i, t) {
|
|
99
|
-
return i == null ? !0 : i.length === 0 ? !t || t.length === 0 : t && Array.isArray(i) && Array.isArray(t) ? i.some((e) => t.indexOf(e) >= 0) : i.includes(t);
|
|
100
|
-
}
|
|
101
|
-
static flattenNavigation(i, t = "") {
|
|
102
|
-
return i.flatMap((e, r) => {
|
|
103
|
-
var s;
|
|
104
|
-
const n = t ? `${t}.${r + 1}` : `${r + 1}`;
|
|
105
|
-
let l = [
|
|
106
|
-
{ ...e, order: n, children: (s = e.children) == null ? void 0 : s.map((d) => d.id) }
|
|
107
|
-
];
|
|
108
|
-
return e.children && (l = l.concat(this.flattenNavigation(e.children, n))), l;
|
|
109
|
-
});
|
|
110
|
-
}
|
|
111
|
-
static unflattenNavigation(i) {
|
|
112
|
-
const t = {};
|
|
113
|
-
i.forEach((r) => {
|
|
114
|
-
t[r.id] = { ...r, children: [] };
|
|
115
|
-
});
|
|
116
|
-
const e = [];
|
|
117
|
-
return i.forEach((r) => {
|
|
118
|
-
if (r.order.includes(".")) {
|
|
119
|
-
const n = r.order.substring(0, r.order.lastIndexOf(".")), l = i.find((s) => s.order === n);
|
|
120
|
-
l && t[l.id].children.push(t[r.id]);
|
|
121
|
-
} else
|
|
122
|
-
e.push(t[r.id]);
|
|
123
|
-
}), e.map((r) => ({ ...r }));
|
|
36
|
+
return n;
|
|
124
37
|
}
|
|
125
38
|
};
|
|
126
|
-
|
|
127
|
-
let
|
|
39
|
+
s(o, "OwpNavigationHelper");
|
|
40
|
+
let d = o;
|
|
128
41
|
export {
|
|
129
|
-
|
|
130
|
-
|
|
42
|
+
d as OwpNavigationHelper,
|
|
43
|
+
y as isNavigationPathMatch,
|
|
44
|
+
u as normalizeNavigationPathname,
|
|
45
|
+
m as resolveNavigationItemType
|
|
131
46
|
};
|
|
132
47
|
//# sourceMappingURL=navigationUtils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"navigationUtils.js","sources":["../../../src/utils/internal/navigationUtils.ts"],"sourcesContent":null,"names":["
|
|
1
|
+
{"version":3,"file":"navigationUtils.js","sources":["../../../src/utils/internal/navigationUtils.ts"],"sourcesContent":null,"names":["pathSuffixPattern","trailingSlashPattern","normalizeNavigationPathname","__name","path","pathname","normalizedPathname","isNavigationPathMatch","navigationUrl","options","currentPathname","targetPathname","resolveNavigationItemType","item","_a","createFlatNavigationItem","order","flatItem","child","_OwpNavigationHelper","navigationItems","flatNavigation","parentOrder","i","navItem","itemType","OwpNavigationHelper"],"mappings":";;AAOA,MAAMA,IAAoB,QACpBC,IAAuB,QAMhBC,IAA8B,gBAAAC,EAAA,CAACC,MAAkB;AAC5D,MAAI,CAACA;AACH,WAAO;AAGT,QAAM,CAACC,IAAW,EAAE,IAAID,EAAK,MAAMJ,CAAiB,GAC9CM,IAAqBD,EAAS,WAAW,GAAG,IAAIA,IAAW,IAAIA,CAAQ;AAE7E,SAAOC,EAAmB,SAAS,IAC/BA,EAAmB,QAAQL,GAAsB,EAAE,IACnDK;AACN,GAX2C,gCAmB9BC,IAAwB,gBAAAJ,EAAA,CACnCE,GACAG,GACAC,IAAsC,CAAA,MACnC;AACH,QAAMC,IAAkBR,EAA4BG,CAAQ,GACtDM,IAAiBT,EAA4BM,CAAa;AAEhE,SAAI,CAACE,KAAmB,CAACC,IAChB,KAGLD,MAAoBC,IACf,KAGLF,EAAQ,OAAOE,MAAmB,MAC7B,KAGFD,EAAgB,WAAW,GAAGC,CAAc,GAAG;AACxD,GArBqC,0BA2BxBC,IAA4B,gBAAAT,EAAA,CACvCU,MAAA;AAtDF,MAAAC;AAuDK,SAAAD,EAAK,UAASC,IAAAD,EAAK,aAAL,QAAAC,EAAe,SAAS,aAAa;AAAA,GAFf,8BAInCC,IAA2B,gBAAAZ,EAAA,CAC/BU,GACAG,MACuB;AA5DzB,MAAAF;AA6DE,QAAMG,IAAW,EAAE,GAAGJ,EAAA;AAEtB,gBAAOI,EAAS,UAChB,OAAOA,EAAS,IAET;AAAA,IACL,GAAGA;AAAA,IACH,MAAML,EAA0BC,CAAI;AAAA,IACpC,WAAUC,IAAAD,EAAK,aAAL,gBAAAC,EAAe,IAAI,CAACI,MAAUA,EAAM;AAAA,IAC9C,OAAAF;AAAA,EAAA;AAEJ,GAfiC,6BAoBpBG,IAAN,MAAMA,EAAoB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAO/B,OAAO,kBACLC,IAAoC,CAAA,GACpCC,IAAuC,CAAA,GACvCC,IAAsB,IACA;AAxF1B,QAAAR;AAyFI,aAASS,IAAI,GAAGA,IAAIH,EAAgB,QAAQG,KAAK,GAAG;AAClD,YAAMC,IAAUJ,EAAgBG,CAAC,GAC3BE,IAAWb,EAA0BY,CAAO,GAC5CR,IAAQM,IAAc,GAAGA,CAAW,IAAIC,IAAI,CAAC,KAAK,GAAGA,IAAI,CAAC;AAEhE,MAAIE,MAAa,UACfJ,EAAe,KAAKN,EAAyBS,GAASR,CAAK,CAAC,IAGzDS,MAAa,cAAcA,MAAa,cAAYX,IAAAU,EAAQ,aAAR,QAAAV,EAAkB,WACzE,KAAK,kBAAkBU,EAAQ,UAAUH,GAAgBL,CAAK;AAAA,IAElE;AAEA,WAAOK;AAAA,EACT;AACF;AA5BiClB,EAAAgB,GAAA;AAA1B,IAAMO,IAANP;"}
|