@owp/core 2.0.2 → 2.0.3

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/store.js CHANGED
@@ -1,5 +1,5 @@
1
- import { O as s, c as a, m as r } from "./OwpStoreProvider-Cp3bYbdo.js";
2
- import { c as o, d as c, j as i, p as h, k as n, m, n as T, l as g, o as S, E as p, q as b, i as w, B as u, C as D, D as O, r as f, t as k, u as C, v, w as x, x as F, a as L, b as M, h as d, e as N, g as P, f as y, y as A, z as E, A as j, s as q, F as z, G as B } from "./lazyLoadedSlices-BgnXi9pr.js";
1
+ import { O as s, c as a, m as r } from "./OwpStoreProvider-HmqsAzRG.js";
2
+ import { c as o, d as c, j as i, p as h, k as n, m, n as T, l as g, o as S, E as p, q as b, i as w, B as u, C as D, D as O, r as f, t as k, u as C, v, w as x, x as F, a as L, b as M, h as d, e as N, g as P, f as y, y as A, z as E, A as j, s as q, F as z, G as B } from "./lazyLoadedSlices-DGKpiSM4.js";
3
3
  export {
4
4
  s as OwpStoreProvider,
5
5
  o as changeOwpTheme,
@@ -6,6 +6,7 @@ export type NavItemComponentProps = {
6
6
  nestedLevel?: number;
7
7
  onItemClick?: (item: NavItemType) => void;
8
8
  checkPermission?: boolean;
9
+ openedCollapseIds?: ReadonlySet<string>;
9
10
  };
10
11
  /**
11
12
  * Component to render a nav item by type.
@@ -9,6 +9,7 @@ export type NavigationMenuProps = {
9
9
  firstLevel?: boolean;
10
10
  selectedId?: string;
11
11
  checkPermission?: boolean;
12
+ openedCollapseIds?: ReadonlySet<string>;
12
13
  };
13
14
  /**
14
15
  * NavigationMenu
@@ -0,0 +1,5 @@
1
+ import type JSZipModule from 'jszip';
2
+ /**
3
+ * 브라우저 배포용 JSZip 모듈 지연 로드
4
+ */
5
+ export declare const loadJSZip: () => Promise<JSZipModule>;
@@ -0,0 +1,88 @@
1
+ var E = Object.defineProperty;
2
+ var n = (s, a) => E(s, "name", { value: a, configurable: !0 });
3
+ import { useTheme as b } from "@mui/material/styles";
4
+ import { useState as T, useEffect as v, useRef as G } from "react";
5
+ import { g as M, e as y } from "./treeGridUtil-CPNva4kL.js";
6
+ import { b as A } from "./useShortcuts-BjtlXprQ.js";
7
+ function B(s, a, { signal: e, edges: i } = {}) {
8
+ let l, u = null;
9
+ const t = i != null && i.includes("leading"), r = i == null || i.includes("trailing"), o = /* @__PURE__ */ n(() => {
10
+ u !== null && (s.apply(l, u), l = void 0, u = null);
11
+ }, "invoke"), d = /* @__PURE__ */ n(() => {
12
+ r && o(), p();
13
+ }, "onTimerEnd");
14
+ let c = null;
15
+ const m = /* @__PURE__ */ n(() => {
16
+ c != null && clearTimeout(c), c = setTimeout(() => {
17
+ c = null, d();
18
+ }, a);
19
+ }, "schedule"), f = /* @__PURE__ */ n(() => {
20
+ c !== null && (clearTimeout(c), c = null);
21
+ }, "cancelTimer"), p = /* @__PURE__ */ n(() => {
22
+ f(), l = void 0, u = null;
23
+ }, "cancel"), x = /* @__PURE__ */ n(() => {
24
+ o();
25
+ }, "flush"), h = /* @__PURE__ */ n(function(...g) {
26
+ if (e != null && e.aborted)
27
+ return;
28
+ l = this, u = g;
29
+ const w = c == null;
30
+ m(), t && w && o();
31
+ }, "debounced");
32
+ return h.schedule = m, h.cancel = p, h.flush = x, e == null || e.addEventListener("abort", p, { once: !0 }), h;
33
+ }
34
+ n(B, "debounce$1");
35
+ function j(s, a = 0, e = {}) {
36
+ typeof e != "object" && (e = {});
37
+ const { leading: i = !1, trailing: l = !0, maxWait: u } = e, t = Array(2);
38
+ i && (t[0] = "leading"), l && (t[1] = "trailing");
39
+ let r, o = null;
40
+ const d = B(function(...f) {
41
+ r = s.apply(this, f), o = null;
42
+ }, a, { edges: t }), c = /* @__PURE__ */ n(function(...f) {
43
+ return u != null && (o === null && (o = Date.now()), Date.now() - o >= u) ? (r = s.apply(this, f), o = Date.now(), d.cancel(), d.schedule(), r) : (d.apply(this, f), r);
44
+ }, "debounced"), m = /* @__PURE__ */ n(() => (d.flush(), r), "flush");
45
+ return c.cancel = d.cancel, c.flush = m, c;
46
+ }
47
+ n(j, "debounce");
48
+ function k(s) {
49
+ const a = b(), e = s(a).replace("@media ", "");
50
+ function i(t) {
51
+ return window.matchMedia(t).matches;
52
+ }
53
+ n(i, "getMatches");
54
+ const [l, u] = T(i(e));
55
+ return v(
56
+ () => {
57
+ const t = window.matchMedia(e);
58
+ u(i(e));
59
+ const r = /* @__PURE__ */ n((o) => u(o.matches), "handler");
60
+ return t.addEventListener("change", r), () => t.removeEventListener("change", r);
61
+ },
62
+ [e]
63
+ ), l;
64
+ }
65
+ n(k, "useThemeMediaQuery");
66
+ const q = /* @__PURE__ */ n((s) => {
67
+ const { t: a } = A(), e = G(!1), [i, l] = T(!1);
68
+ return { exportByTreeGrid: /* @__PURE__ */ n(async (t) => {
69
+ if (e.current)
70
+ return;
71
+ e.current = !0, l(!0);
72
+ const r = M(s);
73
+ try {
74
+ return typeof t == "string" ? await y(r, { exportName: t, t: a }) : await y(r, {
75
+ ...t,
76
+ t: a
77
+ });
78
+ } finally {
79
+ e.current = !1, l(!1);
80
+ }
81
+ }, "exportByTreeGrid"), isExporting: i };
82
+ }, "useTreeGridExcelExport");
83
+ export {
84
+ q as a,
85
+ j as d,
86
+ k as u
87
+ };
88
+ //# sourceMappingURL=useTreeGridExcelExport-Bfxx0cps.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useTreeGridExcelExport-Bfxx0cps.js","sources":["../../../node_modules/.pnpm/es-toolkit@1.39.10/node_modules/es-toolkit/dist/function/debounce.mjs","../../../node_modules/.pnpm/es-toolkit@1.39.10/node_modules/es-toolkit/dist/compat/function/debounce.mjs","../src/hooks/useThemeMediaQuery.ts","../src/hooks/useTreeGridExcelExport.ts"],"sourcesContent":["function debounce(func, debounceMs, { signal, edges } = {}) {\n let pendingThis = undefined;\n let pendingArgs = null;\n const leading = edges != null && edges.includes('leading');\n const trailing = edges == null || edges.includes('trailing');\n const invoke = () => {\n if (pendingArgs !== null) {\n func.apply(pendingThis, pendingArgs);\n pendingThis = undefined;\n pendingArgs = null;\n }\n };\n const onTimerEnd = () => {\n if (trailing) {\n invoke();\n }\n cancel();\n };\n let timeoutId = null;\n const schedule = () => {\n if (timeoutId != null) {\n clearTimeout(timeoutId);\n }\n timeoutId = setTimeout(() => {\n timeoutId = null;\n onTimerEnd();\n }, debounceMs);\n };\n const cancelTimer = () => {\n if (timeoutId !== null) {\n clearTimeout(timeoutId);\n timeoutId = null;\n }\n };\n const cancel = () => {\n cancelTimer();\n pendingThis = undefined;\n pendingArgs = null;\n };\n const flush = () => {\n invoke();\n };\n const debounced = function (...args) {\n if (signal?.aborted) {\n return;\n }\n pendingThis = this;\n pendingArgs = args;\n const isFirstCall = timeoutId == null;\n schedule();\n if (leading && isFirstCall) {\n invoke();\n }\n };\n debounced.schedule = schedule;\n debounced.cancel = cancel;\n debounced.flush = flush;\n signal?.addEventListener('abort', cancel, { once: true });\n return debounced;\n}\n\nexport { debounce };\n","import { debounce as debounce$1 } from '../../function/debounce.mjs';\n\nfunction debounce(func, debounceMs = 0, options = {}) {\n if (typeof options !== 'object') {\n options = {};\n }\n const { leading = false, trailing = true, maxWait } = options;\n const edges = Array(2);\n if (leading) {\n edges[0] = 'leading';\n }\n if (trailing) {\n edges[1] = 'trailing';\n }\n let result = undefined;\n let pendingAt = null;\n const _debounced = debounce$1(function (...args) {\n result = func.apply(this, args);\n pendingAt = null;\n }, debounceMs, { edges });\n const debounced = function (...args) {\n if (maxWait != null) {\n if (pendingAt === null) {\n pendingAt = Date.now();\n }\n if (Date.now() - pendingAt >= maxWait) {\n result = func.apply(this, args);\n pendingAt = Date.now();\n _debounced.cancel();\n _debounced.schedule();\n return result;\n }\n }\n _debounced.apply(this, args);\n return result;\n };\n const flush = () => {\n _debounced.flush();\n return result;\n };\n debounced.cancel = _debounced.cancel;\n debounced.flush = flush;\n return debounced;\n}\n\nexport { debounce };\n","import { useTheme, type Theme } from '@mui/material/styles';\nimport { useEffect, useState } from 'react';\n\n/**\n * The useThemeMediaQuery function is a custom hook that returns a boolean indicating whether the current screen matches the specified media query.\n * It takes in a themeCallbackFunc as a parameter, which is a function that returns a string representing the media query to match.\n * It returns a boolean indicating whether the current screen matches the specified media query.\n */\nexport function useThemeMediaQuery(themeCallbackFunc: (theme: Theme) => string) {\n const theme = useTheme();\n\n const query = themeCallbackFunc(theme).replace('@media ', '');\n\n \n function getMatches(q: string) {\n return window.matchMedia(q).matches;\n }\n\n const [matches, setMatches] = useState(getMatches(query));\n\n useEffect(\n () => {\n const mediaQuery = window.matchMedia(query);\n\n \n setMatches(getMatches(query));\n\n \n const handler = (event: MediaQueryListEvent) => setMatches(event.matches);\n\n \n mediaQuery.addEventListener('change', handler);\n\n \n return () => mediaQuery.removeEventListener('change', handler);\n },\n [query], \n );\n\n return matches;\n}\n","import {\n ExportTreeGridExcelOptions,\n exportTreeGridExcel,\n} from '@/utils/treeGridExportExcelUtil';\nimport { getTreeGridById } from '@/utils/treeGridUtil';\nimport { useRef, useState } from 'react';\nimport { useOwpTranslation } from './useOwpTranslation';\n\nexport type UseTreeGridExcelExportOptions = Omit<ExportTreeGridExcelOptions, 't'> | string;\n\n/**\n * TreeGrid 엑셀 내보내기 훅\n * @param gridId TreeGrid 인스턴스 ID\n */\nexport const useTreeGridExcelExport = (gridId: string) => {\n const { t } = useOwpTranslation();\n const exportPendingRef = useRef(false);\n const [isExporting, setIsExporting] = useState(false);\n\n \n const exportByTreeGrid = async (options?: UseTreeGridExcelExportOptions) => {\n if (exportPendingRef.current) {\n return;\n }\n\n exportPendingRef.current = true;\n setIsExporting(true);\n\n const grid = getTreeGridById(gridId);\n\n try {\n if (typeof options === 'string') {\n return await exportTreeGridExcel(grid, { exportName: options, t });\n }\n\n return await exportTreeGridExcel(grid, {\n ...options,\n t,\n });\n } finally {\n exportPendingRef.current = false;\n setIsExporting(false);\n }\n };\n\n return { exportByTreeGrid, isExporting };\n};\n"],"names":["debounce","func","debounceMs","signal","edges","pendingThis","pendingArgs","leading","trailing","invoke","__name","onTimerEnd","cancel","timeoutId","schedule","cancelTimer","flush","debounced","args","isFirstCall","options","maxWait","result","pendingAt","_debounced","debounce$1","useThemeMediaQuery","themeCallbackFunc","theme","useTheme","query","getMatches","q","matches","setMatches","useState","useEffect","mediaQuery","handler","event","useTreeGridExcelExport","gridId","t","useOwpTranslation","exportPendingRef","useRef","isExporting","setIsExporting","grid","getTreeGridById","exportTreeGridExcel"],"mappings":";;;;;;AAAA,SAASA,EAASC,GAAMC,GAAY,EAAE,QAAAC,GAAQ,OAAAC,EAAK,IAAK,IAAI;AACxD,MAAIC,GACAC,IAAc;AAClB,QAAMC,IAAUH,KAAS,QAAQA,EAAM,SAAS,SAAS,GACnDI,IAAWJ,KAAS,QAAQA,EAAM,SAAS,UAAU,GACrDK,IAAS,gBAAAC,EAAA,MAAM;AACjB,IAAIJ,MAAgB,SAChBL,EAAK,MAAMI,GAAaC,CAAW,GACnCD,IAAc,QACdC,IAAc;AAAA,EAEtB,GANe,WAOTK,IAAa,gBAAAD,EAAA,MAAM;AACrB,IAAIF,KACAC,EAAM,GAEVG,EAAM;AAAA,EACV,GALmB;AAMnB,MAAIC,IAAY;AAChB,QAAMC,IAAW,gBAAAJ,EAAA,MAAM;AACnB,IAAIG,KAAa,QACb,aAAaA,CAAS,GAE1BA,IAAY,WAAW,MAAM;AACzB,MAAAA,IAAY,MACZF,EAAU;AAAA,IACd,GAAGT,CAAU;AAAA,EACjB,GARiB,aASXa,IAAc,gBAAAL,EAAA,MAAM;AACtB,IAAIG,MAAc,SACd,aAAaA,CAAS,GACtBA,IAAY;AAAA,EAEpB,GALoB,gBAMdD,IAAS,gBAAAF,EAAA,MAAM;AACjB,IAAAK,EAAW,GACXV,IAAc,QACdC,IAAc;AAAA,EAClB,GAJe,WAKTU,IAAQ,gBAAAN,EAAA,MAAM;AAChB,IAAAD,EAAM;AAAA,EACV,GAFc,UAGRQ,IAAY,gBAAAP,EAAA,YAAaQ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