@owp/core 2.5.51 → 2.5.52
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/index3.js +2 -2
- package/dist/_virtual/index4.js +2 -2
- 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/OwpSuspense/OwpSuspense.js +66 -60
- package/dist/components/OwpSuspense/OwpSuspense.js.map +1 -1
- package/dist/components/OwpTreeGrid/OwpTreeGrid.js +351 -295
- package/dist/components/OwpTreeGrid/OwpTreeGrid.js.map +1 -1
- package/dist/components/OwpTreeGrid/internal/treeGridRuntime.js +396 -392
- package/dist/components/OwpTreeGrid/internal/treeGridRuntime.js.map +1 -1
- package/dist/components/OwpTreeGrid/internal/treeGridTheme.js +37 -43
- package/dist/components/OwpTreeGrid/internal/treeGridTheme.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/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 +163 -164
- 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/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/CODE128/constants.js +1 -1
- package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/EAN_UPC/constants.js +1 -1
- package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/index.js +1 -1
- package/dist/types/components/OwpNumberField/OwpNumberField.d.ts +1 -1
- 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 +5 -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/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/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/package.json +1 -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
|
@@ -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;"}
|
package/package.json
CHANGED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
var m = Object.defineProperty;
|
|
2
|
-
var i = (f, r) => m(f, "name", { value: r, configurable: !0 });
|
|
3
|
-
import { isIndex as e } from "./isIndex.js";
|
|
4
|
-
import { isArrayLike as o } from "../predicate/isArrayLike.js";
|
|
5
|
-
import { isObject as p } from "../predicate/isObject.js";
|
|
6
|
-
import { eq as s } from "../util/eq.js";
|
|
7
|
-
function g(f, r, t) {
|
|
8
|
-
return p(t) && (typeof r == "number" && o(t) && e(r) && r < t.length || typeof r == "string" && r in t) ? s(t[r], f) : !1;
|
|
9
|
-
}
|
|
10
|
-
i(g, "isIterateeCall");
|
|
11
|
-
export {
|
|
12
|
-
g as isIterateeCall
|
|
13
|
-
};
|
|
14
|
-
//# sourceMappingURL=isIterateeCall.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"isIterateeCall.js","sources":["../../../../../../../../../../../node_modules/.pnpm/es-toolkit@1.39.10/node_modules/es-toolkit/dist/compat/_internal/isIterateeCall.mjs"],"sourcesContent":null,"names":["isIterateeCall","value","index","object","isObject","isArrayLike","isIndex","eq","__name"],"mappings":";;;;;;AAKA,SAASA,EAAeC,GAAOC,GAAOC,GAAQ;AAC1C,SAAKC,EAASD,CAAM,MAGf,OAAOD,KAAU,YAAYG,EAAYF,CAAM,KAAKG,EAAQJ,CAAK,KAAKA,IAAQC,EAAO,UACrF,OAAOD,KAAU,YAAYA,KAASC,KAChCI,EAAGJ,EAAOD,CAAK,GAAGD,CAAK,IAJvB;AAOf;AATSO,EAAAR,GAAA;","x_google_ignoreList":[0]}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
var c = Object.defineProperty;
|
|
2
|
-
var p = (t, e) => c(t, "name", { value: e, configurable: !0 });
|
|
3
|
-
import { isIterateeCall as g } from "../_internal/isIterateeCall.js";
|
|
4
|
-
import { eq as h } from "../util/eq.js";
|
|
5
|
-
function y(t, ...e) {
|
|
6
|
-
t = Object(t);
|
|
7
|
-
const O = Object.prototype;
|
|
8
|
-
let o = e.length;
|
|
9
|
-
const r = o > 2 ? e[2] : void 0;
|
|
10
|
-
r && g(e[0], e[1], r) && (o = 1);
|
|
11
|
-
for (let f = 0; f < o; f++) {
|
|
12
|
-
const i = e[f], a = Object.keys(i);
|
|
13
|
-
for (let l = 0; l < a.length; l++) {
|
|
14
|
-
const n = a[l], d = t[n];
|
|
15
|
-
(d === void 0 || !Object.hasOwn(t, n) && h(d, O[n])) && (t[n] = i[n]);
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
return t;
|
|
19
|
-
}
|
|
20
|
-
p(y, "defaults");
|
|
21
|
-
export {
|
|
22
|
-
y as defaults
|
|
23
|
-
};
|
|
24
|
-
//# sourceMappingURL=defaults.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"defaults.js","sources":["../../../../../../../../../../../node_modules/.pnpm/es-toolkit@1.39.10/node_modules/es-toolkit/dist/compat/object/defaults.mjs"],"sourcesContent":null,"names":["defaults","object","sources","objectProto","length","guard","isIterateeCall","i","source","keys","j","key","value","eq","__name"],"mappings":";;;;AAGA,SAASA,EAASC,MAAWC,GAAS;AAClC,EAAAD,IAAS,OAAOA,CAAM;AACtB,QAAME,IAAc,OAAO;AAC3B,MAAIC,IAASF,EAAQ;AACrB,QAAMG,IAAQD,IAAS,IAAIF,EAAQ,CAAC,IAAI;AACxC,EAAIG,KAASC,EAAeJ,EAAQ,CAAC,GAAGA,EAAQ,CAAC,GAAGG,CAAK,MACrDD,IAAS;AAEb,WAASG,IAAI,GAAGA,IAAIH,GAAQG,KAAK;AAC7B,UAAMC,IAASN,EAAQK,CAAC,GAClBE,IAAO,OAAO,KAAKD,CAAM;AAC/B,aAASE,IAAI,GAAGA,IAAID,EAAK,QAAQC,KAAK;AAClC,YAAMC,IAAMF,EAAKC,CAAC,GACZE,IAAQX,EAAOU,CAAG;AACxB,OAAIC,MAAU,UACT,CAAC,OAAO,OAAOX,GAAQU,CAAG,KAAKE,EAAGD,GAAOT,EAAYQ,CAAG,CAAC,OAC1DV,EAAOU,CAAG,IAAIH,EAAOG,CAAG;AAAA,IAEhC;AAAA,EACJ;AACA,SAAOV;AACX;AArBSa,EAAAd,GAAA;","x_google_ignoreList":[0]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"trim.js","sources":["../../../../../../../../../../../node_modules/.pnpm/es-toolkit@1.39.10/node_modules/es-toolkit/dist/compat/string/trim.mjs"],"sourcesContent":null,"names":["trim","str","chars","guard","__name"],"mappings":";;AAEA,SAASA,EAAKC,GAAKC,GAAOC,GAAO;AAC7B,SAAIF,KAAO,OACA,KAGAA,EAAI,SAAQ,EAAG,KAAI;AAelC;AApBSG,EAAAJ,GAAA;","x_google_ignoreList":[0]}
|