@owp/core 2.0.0 → 2.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{OwpStoreProvider-BPa_lWCz.js → OwpStoreProvider-Cp3bYbdo.js} +2 -2
- package/dist/{OwpStoreProvider-BPa_lWCz.js.map → OwpStoreProvider-Cp3bYbdo.js.map} +1 -1
- package/dist/{OwpUtils-DV2LSByd.js → OwpUtils-DW44HL74.js} +118 -146
- package/dist/{OwpUtils-DV2LSByd.js.map → OwpUtils-DW44HL74.js.map} +1 -1
- package/dist/_commonjs-dynamic-modules-Dv7l0Iyf.js +10 -0
- package/dist/_commonjs-dynamic-modules-Dv7l0Iyf.js.map +1 -0
- package/dist/_commonjsHelpers-BHGzZHI-.js +33 -0
- package/dist/_commonjsHelpers-BHGzZHI-.js.map +1 -0
- package/dist/{commonCodeUtils-DNfSjP6S.js → commonCodeUtils-BcfmNY0i.js} +2 -2
- package/dist/{commonCodeUtils-DNfSjP6S.js.map → commonCodeUtils-BcfmNY0i.js.map} +1 -1
- package/dist/contexts.js +11 -12
- package/dist/contexts.js.map +1 -1
- package/dist/exceljs.min-CrYx1Zzn.js +23562 -0
- package/dist/exceljs.min-CrYx1Zzn.js.map +1 -0
- package/dist/hooks.js +4 -4
- package/dist/index.js +15050 -32038
- package/dist/index.js.map +1 -1
- package/dist/{lazyLoadedSlices-C18y0AEB.js → lazyLoadedSlices-BgnXi9pr.js} +80 -79
- package/dist/{lazyLoadedSlices-C18y0AEB.js.map → lazyLoadedSlices-BgnXi9pr.js.map} +1 -1
- package/dist/store.js +2 -2
- package/dist/{toUpper-Dmh8Htx_.js → toUpper-D96_nWkI.js} +2 -2
- package/dist/{toUpper-Dmh8Htx_.js.map → toUpper-D96_nWkI.js.map} +1 -1
- package/dist/{treeGridUtil-DAfaAk6C.js → treeGridUtil-CPNva4kL.js} +291 -287
- package/dist/treeGridUtil-CPNva4kL.js.map +1 -0
- package/dist/types/components/OwpPicker/OwpTimePicker.d.ts +0 -2
- package/dist/types/utils/dayjsBrowser.d.ts +7 -0
- package/dist/types/utils/excelUtil.d.ts +1 -1
- package/dist/types/utils/exceljsBrowser.d.ts +5 -0
- package/dist/{useTreeGridExcelExport-BE6h1hsO.js → useTreeGridExcelExport-C1QPr9Dp.js} +2 -2
- package/dist/{useTreeGridExcelExport-BE6h1hsO.js.map → useTreeGridExcelExport-C1QPr9Dp.js.map} +1 -1
- package/dist/utils.js +243 -246
- package/dist/utils.js.map +1 -1
- package/package.json +1 -1
- package/dist/treeGridUtil-DAfaAk6C.js.map +0 -1
|
@@ -4,7 +4,7 @@ import { j as d } from "./emotion-react-jsx-runtime.browser.esm-BMvSswBW.js";
|
|
|
4
4
|
import { useRef as s } from "react";
|
|
5
5
|
import { Provider as m } from "react-redux";
|
|
6
6
|
import { createSelector as n, configureStore as p } from "@reduxjs/toolkit";
|
|
7
|
-
import { I as w } from "./lazyLoadedSlices-
|
|
7
|
+
import { I as w } from "./lazyLoadedSlices-BgnXi9pr.js";
|
|
8
8
|
import { createDynamicMiddleware as f } from "@reduxjs/toolkit/react";
|
|
9
9
|
const o = f(), { middleware: l } = o;
|
|
10
10
|
o.addMiddleware.withTypes();
|
|
@@ -27,4 +27,4 @@ export {
|
|
|
27
27
|
j as c,
|
|
28
28
|
c as m
|
|
29
29
|
};
|
|
30
|
-
//# sourceMappingURL=OwpStoreProvider-
|
|
30
|
+
//# sourceMappingURL=OwpStoreProvider-Cp3bYbdo.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OwpStoreProvider-
|
|
1
|
+
{"version":3,"file":"OwpStoreProvider-Cp3bYbdo.js","sources":["../src/store/middleware.ts","../src/store/store.ts","../src/contexts/OwpStoreProvider.tsx"],"sourcesContent":["import { createDynamicMiddleware } from '@reduxjs/toolkit/react';\nimport type { AppDispatch, RootState } from './store';\n\n/**\n * Internal dynamic middleware instance\n */\nconst dynamicInstance = createDynamicMiddleware();\n\nexport const { middleware: dynamicMiddleware } = dynamicInstance;\n\ntype Config = {\n state: RootState;\n dispatch: AppDispatch;\n};\n\nexport const addAppMiddleware: ReturnType<typeof dynamicInstance.addMiddleware.withTypes<Config>> =\n dynamicInstance.addMiddleware.withTypes<Config>();\n\nexport const withAppMiddleware: ReturnType<\n typeof dynamicInstance.withMiddleware.withTypes<Config>\n> = dynamicInstance.withMiddleware.withTypes<Config>();\n\nexport const createAppDispatchWithMiddlewareHook: ReturnType<\n typeof dynamicInstance.createDispatchWithMiddlewareHook.withTypes<Config>\n> = dynamicInstance.createDispatchWithMiddlewareHook.withTypes<Config>();\n","import {\n Action,\n Middleware,\n ThunkAction,\n configureStore,\n createSelector,\n createSelectorCreator,\n} from '@reduxjs/toolkit';\nimport { rootReducer } from './lazyLoadedSlices';\nimport { dynamicMiddleware } from './middleware';\n\n/**\n * Public store contract backing file\n */\nexport type RootState = ReturnType<typeof rootReducer>;\n\nconst middlewares: Middleware[] = [dynamicMiddleware];\n\nexport const makeStore = (\n preloadedState?: Partial<RootState>,\n): ReturnType<typeof configureStore<RootState>> => {\n return configureStore({\n reducer: rootReducer,\n middleware: (getDefaultMiddleware) => getDefaultMiddleware().concat(middlewares),\n preloadedState,\n });\n};\n\nexport const store: ReturnType<typeof makeStore> = makeStore();\n\nexport type AppStore = typeof store;\nexport type AppDispatch = AppStore['dispatch'];\nexport type AppThunk<ThunkReturnType = void> = ThunkAction<\n ThunkReturnType,\n RootState,\n unknown,\n Action\n>;\nexport type AppAction<R = Promise<void>> =\n | Action<string>\n | ThunkAction<R, RootState, unknown, Action<string>>;\n\nexport const createAppSelector: ReturnType<typeof createSelectorCreator> =\n createSelector.withTypes<RootState>();\n","import { ReactNode, useRef } from 'react';\nimport { Provider } from 'react-redux';\nimport { AppStore, makeStore, RootState } from '../store/store';\n\nexport interface OwpStoreProviderProps {\n children?: ReactNode;\n preloadedState?: Partial<RootState>;\n}\n\n/**\n * Owp Redux store provider\n * @param children 하위 콘텐츠\n * @param preloadedState 초기 Redux 상태\n */\nexport function OwpStoreProvider({ children, preloadedState }: OwpStoreProviderProps) {\n const storeRef = useRef<AppStore | undefined>(undefined);\n\n if (!storeRef.current) {\n storeRef.current = makeStore(preloadedState);\n }\n\n return <Provider store={storeRef.current}>{children}</Provider>;\n}\n"],"names":["dynamicInstance","createDynamicMiddleware","dynamicMiddleware","middlewares","makeStore","__name","preloadedState","configureStore","rootReducer","getDefaultMiddleware","createAppSelector","createSelector","OwpStoreProvider","children","storeRef","useRef","jsx","Provider"],"mappings":";;;;;;;;AAMA,MAAMA,IAAkBC,EAAA,GAEX,EAAE,YAAYC,EAAA,IAAsBF;AAQ/CA,EAAgB,cAAc,UAAA;AAI5BA,EAAgB,eAAe,UAAA;AAI/BA,EAAgB,iCAAiC,UAAA;ACRrD,MAAMG,IAA4B,CAACD,CAAiB,GAEvCE,IAAY,gBAAAC,EAAA,CACvBC,MAEOC,EAAe;AAAA,EACpB,SAASC;AAAA,EACT,YAAY,gBAAAH,EAAA,CAACI,MAAyBA,EAAA,EAAuB,OAAON,CAAW,GAAnE;AAAA,EACZ,gBAAAG;AAAA,CACD,GAPsB;AAU0BF,EAAA;AAc5C,MAAMM,IACXC,EAAe,UAAA;AC7BV,SAASC,EAAiB,EAAE,UAAAC,GAAU,gBAAAP,KAAyC;AACpF,QAAMQ,IAAWC,EAA6B,MAAS;AAEvD,SAAKD,EAAS,YACZA,EAAS,UAAUV,EAAUE,CAAc,IAGtC,gBAAAU,EAACC,GAAA,EAAS,OAAOH,EAAS,SAAU,UAAAD,GAAS;AACtD;AARgBR,EAAAO,GAAA;"}
|
|
@@ -1,89 +1,64 @@
|
|
|
1
1
|
var w = Object.defineProperty;
|
|
2
|
-
var
|
|
2
|
+
var C = (t, e, n) => e in t ? w(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
|
|
3
3
|
var o = (t, e) => w(t, "name", { value: e, configurable: !0 });
|
|
4
|
-
var
|
|
5
|
-
import * as
|
|
6
|
-
import { e as
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
10
|
-
}
|
|
11
|
-
o(Y, "getDefaultExportFromCjs");
|
|
12
|
-
function Z(t) {
|
|
13
|
-
if (Object.prototype.hasOwnProperty.call(t, "__esModule")) return t;
|
|
14
|
-
var e = t.default;
|
|
15
|
-
if (typeof e == "function") {
|
|
16
|
-
var n = /* @__PURE__ */ o(function r() {
|
|
17
|
-
return this instanceof r ? Reflect.construct(e, arguments, this.constructor) : e.apply(this, arguments);
|
|
18
|
-
}, "a");
|
|
19
|
-
n.prototype = e.prototype;
|
|
20
|
-
} else n = {};
|
|
21
|
-
return Object.defineProperty(n, "__esModule", { value: !0 }), Object.keys(t).forEach(function(r) {
|
|
22
|
-
var s = Object.getOwnPropertyDescriptor(t, r);
|
|
23
|
-
Object.defineProperty(n, r, s.get ? s : {
|
|
24
|
-
enumerable: !0,
|
|
25
|
-
get: /* @__PURE__ */ o(function() {
|
|
26
|
-
return t[r];
|
|
27
|
-
}, "get")
|
|
28
|
-
});
|
|
29
|
-
}), n;
|
|
30
|
-
}
|
|
31
|
-
o(Z, "getAugmentedNamespace");
|
|
32
|
-
function $(t) {
|
|
33
|
-
if (P(t))
|
|
4
|
+
var h = (t, e, n) => C(t, typeof e != "symbol" ? e + "" : e, n);
|
|
5
|
+
import * as F from "@mui/material/colors";
|
|
6
|
+
import { e as M, f as P, c as E, b as k, p as D, m as R, g as K, h as V, j as W, k as B, l as S, n as v, o as q, q as G, r as N, d as $, s as I } from "./isTypedArray-CCnDZ5HJ.js";
|
|
7
|
+
function z(t) {
|
|
8
|
+
if (M(t))
|
|
34
9
|
return t;
|
|
35
|
-
if (Array.isArray(t) ||
|
|
10
|
+
if (Array.isArray(t) || P(t) || t instanceof ArrayBuffer || typeof SharedArrayBuffer < "u" && t instanceof SharedArrayBuffer)
|
|
36
11
|
return t.slice(0);
|
|
37
12
|
const e = Object.getPrototypeOf(t), n = e.constructor;
|
|
38
13
|
if (t instanceof Date || t instanceof Map || t instanceof Set)
|
|
39
14
|
return new n(t);
|
|
40
15
|
if (t instanceof RegExp) {
|
|
41
|
-
const
|
|
42
|
-
return
|
|
16
|
+
const i = new n(t);
|
|
17
|
+
return i.lastIndex = t.lastIndex, i;
|
|
43
18
|
}
|
|
44
19
|
if (t instanceof DataView)
|
|
45
20
|
return new n(t.buffer.slice(0));
|
|
46
21
|
if (t instanceof Error) {
|
|
47
|
-
const
|
|
48
|
-
return
|
|
22
|
+
const i = new n(t.message);
|
|
23
|
+
return i.stack = t.stack, i.name = t.name, i.cause = t.cause, i;
|
|
49
24
|
}
|
|
50
25
|
if (typeof File < "u" && t instanceof File)
|
|
51
26
|
return new n([t], t.name, { type: t.type, lastModified: t.lastModified });
|
|
52
27
|
if (typeof t == "object") {
|
|
53
|
-
const
|
|
54
|
-
return Object.assign(
|
|
28
|
+
const i = Object.create(e);
|
|
29
|
+
return Object.assign(i, t);
|
|
55
30
|
}
|
|
56
31
|
return t;
|
|
57
32
|
}
|
|
58
|
-
o(
|
|
59
|
-
function
|
|
33
|
+
o(z, "clone");
|
|
34
|
+
function H(t, e = E, n = 0) {
|
|
60
35
|
if (!t)
|
|
61
36
|
return;
|
|
62
37
|
n < 0 && (n = Math.max(t.length + n, 0));
|
|
63
|
-
const
|
|
64
|
-
if (typeof
|
|
65
|
-
const
|
|
66
|
-
for (let l = n; l <
|
|
67
|
-
const f =
|
|
68
|
-
if (
|
|
38
|
+
const i = k(e);
|
|
39
|
+
if (typeof i == "function" && !Array.isArray(t)) {
|
|
40
|
+
const r = Object.keys(t);
|
|
41
|
+
for (let l = n; l < r.length; l++) {
|
|
42
|
+
const f = r[l], a = t[f];
|
|
43
|
+
if (i(a, f, t))
|
|
69
44
|
return a;
|
|
70
45
|
}
|
|
71
46
|
return;
|
|
72
47
|
}
|
|
73
|
-
return (Array.isArray(t) ? t.slice(n) : Object.values(t).slice(n)).find(
|
|
48
|
+
return (Array.isArray(t) ? t.slice(n) : Object.values(t).slice(n)).find(i);
|
|
74
49
|
}
|
|
75
|
-
o(
|
|
76
|
-
function
|
|
50
|
+
o(H, "find");
|
|
51
|
+
function J(t, e, n) {
|
|
77
52
|
if (!t)
|
|
78
53
|
return !1;
|
|
79
|
-
e || (e =
|
|
80
|
-
const
|
|
54
|
+
e || (e = E);
|
|
55
|
+
const i = Array.isArray(t) ? t : Object.values(t);
|
|
81
56
|
switch (typeof e) {
|
|
82
57
|
case "function": {
|
|
83
58
|
if (!Array.isArray(t)) {
|
|
84
59
|
const s = Object.keys(t);
|
|
85
|
-
for (let
|
|
86
|
-
const l = s[
|
|
60
|
+
for (let r = 0; r < s.length; r++) {
|
|
61
|
+
const l = s[r], f = t[l];
|
|
87
62
|
if (e(f, l, t))
|
|
88
63
|
return !0;
|
|
89
64
|
}
|
|
@@ -96,88 +71,88 @@ function _(t, e, n) {
|
|
|
96
71
|
}
|
|
97
72
|
case "object":
|
|
98
73
|
if (Array.isArray(e) && e.length === 2) {
|
|
99
|
-
const s = e[0],
|
|
74
|
+
const s = e[0], r = e[1], l = R(s, r);
|
|
100
75
|
if (Array.isArray(t)) {
|
|
101
76
|
for (let f = 0; f < t.length; f++)
|
|
102
77
|
if (l(t[f]))
|
|
103
78
|
return !0;
|
|
104
79
|
return !1;
|
|
105
80
|
}
|
|
106
|
-
return
|
|
81
|
+
return i.some(l);
|
|
107
82
|
} else {
|
|
108
|
-
const s =
|
|
83
|
+
const s = K(e);
|
|
109
84
|
if (Array.isArray(t)) {
|
|
110
|
-
for (let
|
|
111
|
-
if (s(t[
|
|
85
|
+
for (let r = 0; r < t.length; r++)
|
|
86
|
+
if (s(t[r]))
|
|
112
87
|
return !0;
|
|
113
88
|
return !1;
|
|
114
89
|
}
|
|
115
|
-
return
|
|
90
|
+
return i.some(s);
|
|
116
91
|
}
|
|
117
92
|
case "number":
|
|
118
93
|
case "symbol":
|
|
119
94
|
case "string": {
|
|
120
95
|
const s = D(e);
|
|
121
96
|
if (Array.isArray(t)) {
|
|
122
|
-
for (let
|
|
123
|
-
if (s(t[
|
|
97
|
+
for (let r = 0; r < t.length; r++)
|
|
98
|
+
if (s(t[r]))
|
|
124
99
|
return !0;
|
|
125
100
|
return !1;
|
|
126
101
|
}
|
|
127
|
-
return
|
|
102
|
+
return i.some(s);
|
|
128
103
|
}
|
|
129
104
|
}
|
|
130
105
|
}
|
|
131
|
-
o(
|
|
132
|
-
function
|
|
133
|
-
const n = e.slice(0, -1),
|
|
106
|
+
o(J, "some");
|
|
107
|
+
function Q(t, ...e) {
|
|
108
|
+
const n = e.slice(0, -1), i = e[e.length - 1];
|
|
134
109
|
let s = t;
|
|
135
|
-
for (let
|
|
136
|
-
const l = n[
|
|
137
|
-
s =
|
|
110
|
+
for (let r = 0; r < n.length; r++) {
|
|
111
|
+
const l = n[r];
|
|
112
|
+
s = c(s, l, i, /* @__PURE__ */ new Map());
|
|
138
113
|
}
|
|
139
114
|
return s;
|
|
140
115
|
}
|
|
141
|
-
o(
|
|
142
|
-
function
|
|
143
|
-
if (
|
|
116
|
+
o(Q, "mergeWith");
|
|
117
|
+
function c(t, e, n, i) {
|
|
118
|
+
if (M(t) && (t = Object(t)), e == null || typeof e != "object")
|
|
144
119
|
return t;
|
|
145
|
-
if (
|
|
146
|
-
return
|
|
147
|
-
if (
|
|
120
|
+
if (i.has(e))
|
|
121
|
+
return z(i.get(e));
|
|
122
|
+
if (i.set(e, t), Array.isArray(e)) {
|
|
148
123
|
e = e.slice();
|
|
149
|
-
for (let
|
|
150
|
-
e[
|
|
124
|
+
for (let r = 0; r < e.length; r++)
|
|
125
|
+
e[r] = e[r] ?? void 0;
|
|
151
126
|
}
|
|
152
|
-
const s = [...Object.keys(e), ...
|
|
153
|
-
for (let
|
|
154
|
-
const l = s[
|
|
155
|
-
if (
|
|
127
|
+
const s = [...Object.keys(e), ...V(e)];
|
|
128
|
+
for (let r = 0; r < s.length; r++) {
|
|
129
|
+
const l = s[r];
|
|
130
|
+
if (W(l))
|
|
156
131
|
continue;
|
|
157
132
|
let f = e[l], a = t[l];
|
|
158
|
-
if (
|
|
133
|
+
if (B(f) && (f = { ...f }), B(a) && (a = { ...a }), typeof Buffer < "u" && Buffer.isBuffer(f) && (f = S(f)), Array.isArray(f))
|
|
159
134
|
if (typeof a == "object" && a != null) {
|
|
160
|
-
const
|
|
161
|
-
for (let p = 0; p <
|
|
162
|
-
const
|
|
163
|
-
|
|
135
|
+
const y = [], A = Reflect.ownKeys(a);
|
|
136
|
+
for (let p = 0; p < A.length; p++) {
|
|
137
|
+
const O = A[p];
|
|
138
|
+
y[O] = a[O];
|
|
164
139
|
}
|
|
165
|
-
a =
|
|
140
|
+
a = y;
|
|
166
141
|
} else
|
|
167
142
|
a = [];
|
|
168
|
-
const u = n(a, f, l, t, e,
|
|
169
|
-
u !== void 0 ? t[l] = u : Array.isArray(f) ||
|
|
143
|
+
const u = n(a, f, l, t, e, i);
|
|
144
|
+
u !== void 0 ? t[l] = u : Array.isArray(f) || v(a) && v(f) ? t[l] = c(a, f, n, i) : a == null && q(f) ? t[l] = c({}, f, n, i) : a == null && G(f) ? t[l] = S(f) : (a === void 0 || f !== void 0) && (t[l] = f);
|
|
170
145
|
}
|
|
171
146
|
return t;
|
|
172
147
|
}
|
|
173
|
-
o(
|
|
174
|
-
function
|
|
175
|
-
return
|
|
148
|
+
o(c, "mergeWithDeep");
|
|
149
|
+
function X(t, ...e) {
|
|
150
|
+
return Q(t, ...e, N);
|
|
176
151
|
}
|
|
177
|
-
o(
|
|
152
|
+
o(X, "merge");
|
|
178
153
|
const m = class m {
|
|
179
154
|
constructor() {
|
|
180
|
-
|
|
155
|
+
h(this, "events");
|
|
181
156
|
this.events = {};
|
|
182
157
|
}
|
|
183
158
|
/**
|
|
@@ -196,17 +171,17 @@ const m = class m {
|
|
|
196
171
|
* One-time event subscription
|
|
197
172
|
*/
|
|
198
173
|
once(e, n) {
|
|
199
|
-
const
|
|
200
|
-
this.removeListener(e,
|
|
174
|
+
const i = /* @__PURE__ */ o((...s) => {
|
|
175
|
+
this.removeListener(e, i), n.apply(this, s);
|
|
201
176
|
}, "onceFn");
|
|
202
|
-
this.on(e,
|
|
177
|
+
this.on(e, i);
|
|
203
178
|
}
|
|
204
179
|
/**
|
|
205
180
|
* Event emission
|
|
206
181
|
*/
|
|
207
182
|
emit(e, ...n) {
|
|
208
|
-
this._getEventListByName(e).forEach((
|
|
209
|
-
|
|
183
|
+
this._getEventListByName(e).forEach((i) => {
|
|
184
|
+
i.apply(this, n);
|
|
210
185
|
});
|
|
211
186
|
}
|
|
212
187
|
/**
|
|
@@ -217,7 +192,7 @@ const m = class m {
|
|
|
217
192
|
}
|
|
218
193
|
};
|
|
219
194
|
o(m, "OwpEventEmitter");
|
|
220
|
-
let
|
|
195
|
+
let g = m;
|
|
221
196
|
const d = class d {
|
|
222
197
|
/**
|
|
223
198
|
* The filterArrayByString function filters an array of objects by a search string.
|
|
@@ -228,11 +203,11 @@ const d = class d {
|
|
|
228
203
|
if (!n || (n == null ? void 0 : n.length) === 0 || !n)
|
|
229
204
|
return e;
|
|
230
205
|
n = n == null ? void 0 : n.toLowerCase();
|
|
231
|
-
const
|
|
232
|
-
return
|
|
206
|
+
const i = e.filter((s) => this.searchInObj(s, n));
|
|
207
|
+
return i.length === e.length ? e : i;
|
|
233
208
|
}
|
|
234
209
|
static filterArrayByString2(e, n) {
|
|
235
|
-
return typeof n != "string" || n === "" ? e : (n = n == null ? void 0 : n.toLowerCase(), e.filter((
|
|
210
|
+
return typeof n != "string" || n === "" ? e : (n = n == null ? void 0 : n.toLowerCase(), e.filter((i) => this.searchInObj(i, n)));
|
|
236
211
|
}
|
|
237
212
|
/**
|
|
238
213
|
* The searchInObj function searches an object for a given search string.
|
|
@@ -242,13 +217,13 @@ const d = class d {
|
|
|
242
217
|
static searchInObj(e, n) {
|
|
243
218
|
if (!s(e))
|
|
244
219
|
return !1;
|
|
245
|
-
const
|
|
246
|
-
function s(
|
|
247
|
-
return !!(
|
|
220
|
+
const i = Object.keys(e);
|
|
221
|
+
function s(r) {
|
|
222
|
+
return !!(r && typeof r == "object" && !Array.isArray(r) && typeof r != "function");
|
|
248
223
|
}
|
|
249
224
|
o(s, "isRecord");
|
|
250
|
-
for (let
|
|
251
|
-
const l = r
|
|
225
|
+
for (let r = 0; r < i.length; r += 1) {
|
|
226
|
+
const l = i[r], f = e[l];
|
|
252
227
|
if (typeof f == "string") {
|
|
253
228
|
if (this.searchInString(f, n))
|
|
254
229
|
return !0;
|
|
@@ -265,7 +240,7 @@ const d = class d {
|
|
|
265
240
|
*
|
|
266
241
|
*/
|
|
267
242
|
static searchInArray(e, n) {
|
|
268
|
-
return e.forEach((
|
|
243
|
+
return e.forEach((i) => !!(typeof i == "string" && this.searchInString(i, n) || i && typeof i == "object" && this.searchInObj(i, n))), !1;
|
|
269
244
|
}
|
|
270
245
|
/**
|
|
271
246
|
* The searchInString function searches a string for a given search string.
|
|
@@ -302,20 +277,20 @@ const d = class d {
|
|
|
302
277
|
* The setRoutes function sets the routes for the Owp project.
|
|
303
278
|
*/
|
|
304
279
|
static setRoutes(e, n = void 0) {
|
|
305
|
-
let
|
|
306
|
-
e != null && e.routes && (
|
|
307
|
-
const s = /* @__PURE__ */ o((
|
|
308
|
-
const f =
|
|
309
|
-
...
|
|
280
|
+
let i = [];
|
|
281
|
+
e != null && e.routes && (i = [...e.routes]);
|
|
282
|
+
const s = /* @__PURE__ */ o((r, l) => {
|
|
283
|
+
const f = r.auth || r.auth === null ? r.auth : l, a = X({}, e.settings, r.settings), u = {
|
|
284
|
+
...r,
|
|
310
285
|
settings: a,
|
|
311
286
|
auth: f
|
|
312
287
|
};
|
|
313
|
-
return
|
|
288
|
+
return r.children && (u.children = r.children.map((y) => s(y, f))), u;
|
|
314
289
|
}, "applyAuth");
|
|
315
|
-
return
|
|
290
|
+
return i = i.map((r) => {
|
|
316
291
|
const l = e.auth || e.auth === null ? e.auth : n || null;
|
|
317
|
-
return s(
|
|
318
|
-
}), [...
|
|
292
|
+
return s(r, l);
|
|
293
|
+
}), [...i];
|
|
319
294
|
}
|
|
320
295
|
/**
|
|
321
296
|
* The generateRoutesFromConfigs function generates routes from a set of route configurations.
|
|
@@ -323,20 +298,20 @@ const d = class d {
|
|
|
323
298
|
*
|
|
324
299
|
*/
|
|
325
300
|
static generateRoutesFromConfigs(e, n) {
|
|
326
|
-
let
|
|
301
|
+
let i = [];
|
|
327
302
|
return e.forEach((s) => {
|
|
328
|
-
|
|
329
|
-
}),
|
|
303
|
+
i = [...i, ...this.setRoutes(s, n)];
|
|
304
|
+
}), i;
|
|
330
305
|
}
|
|
331
306
|
/**
|
|
332
307
|
* The findById function finds an object by its id.
|
|
333
308
|
*/
|
|
334
309
|
static findById(e, n) {
|
|
335
|
-
const
|
|
336
|
-
if (
|
|
337
|
-
return
|
|
310
|
+
const i = H(e, { id: n });
|
|
311
|
+
if (i)
|
|
312
|
+
return i;
|
|
338
313
|
let s;
|
|
339
|
-
return
|
|
314
|
+
return J(e, (r) => r.children ? (s = this.findById(r.children, n), s) : !1), s;
|
|
340
315
|
}
|
|
341
316
|
/**
|
|
342
317
|
* The randomMatColor function generates a random material color.
|
|
@@ -360,52 +335,49 @@ const d = class d {
|
|
|
360
335
|
"amber",
|
|
361
336
|
"orange",
|
|
362
337
|
"deepOrange"
|
|
363
|
-
],
|
|
364
|
-
return (s =
|
|
338
|
+
], i = n[Math.floor(Math.random() * n.length)];
|
|
339
|
+
return (s = F[i]) == null ? void 0 : s[e];
|
|
365
340
|
}
|
|
366
341
|
/**
|
|
367
342
|
* The findNavItemById function finds a navigation item by its id.
|
|
368
343
|
*/
|
|
369
344
|
static difference(e, n) {
|
|
370
|
-
function
|
|
371
|
-
return s == null ? void 0 : s.reduce((l, f, a) => (
|
|
345
|
+
function i(s, r) {
|
|
346
|
+
return s == null ? void 0 : s.reduce((l, f, a) => ($(f, r[a]) || (l[a] = I(f) && I(r[a]) ? i(f, r[a]) : f), l), {});
|
|
372
347
|
}
|
|
373
|
-
return o(
|
|
348
|
+
return o(i, "changes"), i(e, n);
|
|
374
349
|
}
|
|
375
350
|
/**
|
|
376
351
|
* The hasPermission function checks if a user has permission to access a resource.
|
|
377
352
|
*/
|
|
378
353
|
// @ts-expect-error
|
|
379
354
|
static hasPermission(e, n) {
|
|
380
|
-
var
|
|
381
|
-
return e == null ? !0 : Array.isArray(e) && (e == null ? void 0 : e.length) === 0 ? !n || n.length === 0 : n && Array.isArray(e) && Array.isArray(n) ? e.some((s) => n.indexOf(s) >= 0) : typeof n == "string" && Array.isArray(e) ? (
|
|
355
|
+
var i;
|
|
356
|
+
return e == null ? !0 : Array.isArray(e) && (e == null ? void 0 : e.length) === 0 ? !n || n.length === 0 : n && Array.isArray(e) && Array.isArray(n) ? e.some((s) => n.indexOf(s) >= 0) : typeof n == "string" && Array.isArray(e) ? (i = e == null ? void 0 : e.includes) == null ? void 0 : i.call(e, n) : !1;
|
|
382
357
|
}
|
|
383
358
|
/**
|
|
384
359
|
* The filterArrayByString function filters an array of objects by a search string.
|
|
385
360
|
*/
|
|
386
361
|
static filterRecursive(e, n) {
|
|
387
|
-
return e ? e.reduce((
|
|
388
|
-
let
|
|
389
|
-
if (n(s) && (
|
|
362
|
+
return e ? e.reduce((i, s) => {
|
|
363
|
+
let r = null;
|
|
364
|
+
if (n(s) && (r = { ...s }), s.children != null) {
|
|
390
365
|
const l = this.filterRecursive(s.children, n);
|
|
391
|
-
l && (l == null ? void 0 : l.length) > 0 && (
|
|
366
|
+
l && (l == null ? void 0 : l.length) > 0 && (r = { ...s, children: l });
|
|
392
367
|
}
|
|
393
|
-
return
|
|
368
|
+
return r && i.push(r), i;
|
|
394
369
|
}, []) : null;
|
|
395
370
|
}
|
|
396
371
|
};
|
|
397
372
|
o(d, "OwpUtils"), /**
|
|
398
373
|
* OwpEventEmitter class reference
|
|
399
374
|
*/
|
|
400
|
-
|
|
401
|
-
let
|
|
375
|
+
h(d, "EventEmitter", g);
|
|
376
|
+
let L = d;
|
|
402
377
|
export {
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
X as
|
|
407
|
-
z as f,
|
|
408
|
-
Z as g,
|
|
409
|
-
H as m
|
|
378
|
+
L as O,
|
|
379
|
+
g as a,
|
|
380
|
+
H as f,
|
|
381
|
+
X as m
|
|
410
382
|
};
|
|
411
|
-
//# sourceMappingURL=OwpUtils-
|
|
383
|
+
//# sourceMappingURL=OwpUtils-DW44HL74.js.map
|