@owp/core 2.3.1 → 2.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_virtual/index10.js +2 -2
- package/dist/_virtual/index11.js +2 -2
- package/dist/_virtual/index13.js +2 -2
- package/dist/_virtual/index14.js +2 -2
- package/dist/_virtual/index15.js +2 -2
- package/dist/_virtual/index16.js +5 -2
- package/dist/_virtual/index16.js.map +1 -1
- package/dist/_virtual/index17.js +2 -2
- package/dist/_virtual/index5.js +2 -5
- package/dist/_virtual/index5.js.map +1 -1
- package/dist/_virtual/index6.js +2 -2
- package/dist/_virtual/index7.js +2 -2
- package/dist/components/OwpLayout/OwpLayout.js +39 -39
- package/dist/components/OwpLayout/OwpLayout.js.map +1 -1
- package/dist/components/OwpTreeGrid/OwpTreeGrid.js +169 -148
- package/dist/components/OwpTreeGrid/OwpTreeGrid.js.map +1 -1
- package/dist/components/OwpTreeGrid/internal/OwpTreeGridLoadingOverlay.js +1 -1
- package/dist/components/OwpTreeGrid/internal/OwpTreeGridLoadingOverlay.js.map +1 -1
- package/dist/components/OwpTreeGrid/internal/OwpTreeGridNoDataOverlay.js +1 -1
- package/dist/components/OwpTreeGrid/internal/OwpTreeGridNoDataOverlay.js.map +1 -1
- package/dist/components/OwpTreeGrid/{hooks → internal/hooks}/useOwpTreeGridOverlayFrame.js +1 -1
- package/dist/components/OwpTreeGrid/internal/hooks/useOwpTreeGridOverlayFrame.js.map +1 -0
- package/dist/components/OwpTreeGrid/internal/treeGridColumnEditRules.js +84 -0
- package/dist/components/OwpTreeGrid/internal/treeGridColumnEditRules.js.map +1 -0
- package/dist/components/OwpTreeGrid/internal/treeGridRuntime.js +114 -103
- package/dist/components/OwpTreeGrid/internal/treeGridRuntime.js.map +1 -1
- package/dist/components/OwpTreeGrid/internal/utils/perf.js.map +1 -0
- package/dist/layout/Layout.js +24 -24
- package/dist/layout/Layout.js.map +1 -1
- package/dist/layout/themeLayouts.js.map +1 -1
- package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/CODE128/index.js +1 -1
- package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/CODE39/index.js +1 -1
- package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/CODE93/index.js +1 -1
- package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/EAN_UPC/index.js +1 -1
- package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/GenericBarcode/index.js +1 -1
- package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/ITF/index.js +1 -1
- package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/MSI/index.js +1 -1
- package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/codabar/index.js +1 -1
- package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/pharmacode/index.js +1 -1
- package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/renderers/index.js +1 -1
- package/dist/node_modules/.pnpm/prop-types@15.8.1/node_modules/prop-types/index.js +1 -1
- package/dist/node_modules/.pnpm/react-imask@7.6.1_react@19.2.4/node_modules/react-imask/esm/mixin.js +1 -1
- package/dist/node_modules/.pnpm/react-is@16.13.1/node_modules/react-is/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/OwpTreeGrid/OwpTreeGrid.d.ts +7 -1
- package/dist/types/components/OwpTreeGrid/index.d.ts +1 -1
- package/dist/types/components/OwpTreeGrid/internal/OwpTreeGridLoadingOverlay.d.ts +1 -1
- package/dist/types/components/OwpTreeGrid/internal/OwpTreeGridNoDataOverlay.d.ts +1 -1
- package/dist/types/components/OwpTreeGrid/internal/treeGridColumnEditRules.d.ts +60 -0
- package/dist/types/components/OwpTreeGrid/internal/treeGridRuntime.d.ts +7 -2
- package/dist/types/layout/Layout.d.ts +2 -0
- package/dist/types/layout/themeLayouts.d.ts +2 -0
- package/package.json +2 -2
- package/dist/components/OwpTreeGrid/hooks/useOwpTreeGridOverlayFrame.js.map +0 -1
- package/dist/components/OwpTreeGrid/utils/perf.js.map +0 -1
- /package/dist/components/OwpTreeGrid/{utils → internal/utils}/perf.js +0 -0
- /package/dist/types/components/OwpTreeGrid/{hooks → internal/hooks}/useOwpTreeGridOverlayFrame.d.ts +0 -0
- /package/dist/types/components/OwpTreeGrid/{utils → internal/utils}/perf.d.ts +0 -0
package/dist/_virtual/index10.js
CHANGED
package/dist/_virtual/index11.js
CHANGED
package/dist/_virtual/index13.js
CHANGED
package/dist/_virtual/index14.js
CHANGED
package/dist/_virtual/index15.js
CHANGED
package/dist/_virtual/index16.js
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
import { getDefaultExportFromCjs as r } from "./_commonjsHelpers.js";
|
|
2
|
+
import { __require as o } from "../node_modules/.pnpm/prop-types@15.8.1/node_modules/prop-types/index.js";
|
|
3
|
+
var p = /* @__PURE__ */ o();
|
|
4
|
+
const s = /* @__PURE__ */ r(p);
|
|
2
5
|
export {
|
|
3
|
-
|
|
6
|
+
s as default
|
|
4
7
|
};
|
|
5
8
|
//# sourceMappingURL=index16.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index16.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index16.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
|
package/dist/_virtual/index17.js
CHANGED
package/dist/_virtual/index5.js
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
import { __require as o } from "../node_modules/.pnpm/prop-types@15.8.1/node_modules/prop-types/index.js";
|
|
3
|
-
var p = /* @__PURE__ */ o();
|
|
4
|
-
const s = /* @__PURE__ */ r(p);
|
|
1
|
+
var r = {};
|
|
5
2
|
export {
|
|
6
|
-
|
|
3
|
+
r as __exports
|
|
7
4
|
};
|
|
8
5
|
//# sourceMappingURL=index5.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index5.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index5.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
package/dist/_virtual/index6.js
CHANGED
package/dist/_virtual/index7.js
CHANGED
|
@@ -1,47 +1,47 @@
|
|
|
1
|
-
var
|
|
2
|
-
var g = (
|
|
3
|
-
import { jsx as
|
|
4
|
-
import { themeLayouts as
|
|
5
|
-
import { useOwpAppContext as
|
|
6
|
-
import { generateSettings as
|
|
7
|
-
import { useOwpTranslation as
|
|
8
|
-
import { useSetSettings as
|
|
9
|
-
import { useRef as
|
|
10
|
-
import { useLocation as
|
|
11
|
-
import { isEqual as
|
|
12
|
-
import { merge as
|
|
13
|
-
import { OwpLoading as
|
|
14
|
-
function
|
|
15
|
-
var
|
|
16
|
-
const { routesConfig:
|
|
17
|
-
() =>
|
|
18
|
-
[
|
|
19
|
-
),
|
|
20
|
-
() =>
|
|
21
|
-
[
|
|
22
|
-
);
|
|
23
|
-
return
|
|
24
|
-
|
|
25
|
-
}, [
|
|
1
|
+
var O = Object.defineProperty;
|
|
2
|
+
var g = (a, e) => O(a, "name", { value: e, configurable: !0 });
|
|
3
|
+
import { jsx as z } from "../../node_modules/.pnpm/@emotion_react@11.14.0_@types_react@19.2.14_react@19.2.4/node_modules/@emotion/react/jsx-runtime/dist/emotion-react-jsx-runtime.browser.esm.js";
|
|
4
|
+
import { themeLayouts as P } from "../../layout/themeLayouts.js";
|
|
5
|
+
import { useOwpAppContext as v } from "../../contexts/OwpAppProvider.js";
|
|
6
|
+
import { generateSettings as x } from "../../configs/defaultConfig.js";
|
|
7
|
+
import { useOwpTranslation as j } from "../../hooks/useOwpTranslation.js";
|
|
8
|
+
import { useSetSettings as B, useGetCurrentSettings as E, useGetDefaultSettings as F } from "../../hooks/useOwpSettings.js";
|
|
9
|
+
import { useRef as G, useMemo as l, useEffect as h } from "react";
|
|
10
|
+
import { useLocation as M, matchRoutes as T } from "react-router-dom";
|
|
11
|
+
import { isEqual as b } from "../../node_modules/.pnpm/es-toolkit@1.39.10/node_modules/es-toolkit/dist/predicate/isEqual.js";
|
|
12
|
+
import { merge as k } from "../../node_modules/.pnpm/es-toolkit@1.39.10/node_modules/es-toolkit/dist/compat/object/merge.js";
|
|
13
|
+
import { OwpLoading as q } from "../OwpLoading/OwpLoading.js";
|
|
14
|
+
function $(a) {
|
|
15
|
+
var L, w;
|
|
16
|
+
const { routesConfig: e } = v(), { i18n: n } = j(), { layouts: f = P, children: c } = a, m = B(), r = E(), i = F(), d = M(), { pathname: t } = d, y = G(!1), p = l(
|
|
17
|
+
() => A(e, t, "settings", !0),
|
|
18
|
+
[t, e]
|
|
19
|
+
), s = l(() => p === void 0 ? i : x(i, p), [i, p]), o = l(
|
|
20
|
+
() => r === s || b(s, r),
|
|
21
|
+
[s, r]
|
|
22
|
+
), u = o ? r : s, S = (L = u == null ? void 0 : u.layout) == null ? void 0 : L.style, I = (w = u == null ? void 0 : u.layout) == null ? void 0 : w.config;
|
|
23
|
+
return h(() => {
|
|
24
|
+
o || m(s);
|
|
25
|
+
}, [s, o, m]), h(() => {
|
|
26
26
|
window.scrollTo(0, 0);
|
|
27
|
-
}, [
|
|
28
|
-
|
|
29
|
-
}, [
|
|
27
|
+
}, [t]), h(() => {
|
|
28
|
+
o && n.isInitialized && (y.current = !0);
|
|
29
|
+
}, [n.isInitialized, o]), l(() => !n.isInitialized || !o && !y.current ? /* @__PURE__ */ z(q, {}) : Object.entries(f).map(([R, C]) => R === S ? /* @__PURE__ */ z(C, { layoutConfig: I, children: c }, R) : null), [c, n.isInitialized, o, I, S, f]);
|
|
30
30
|
}
|
|
31
|
-
g(
|
|
32
|
-
function
|
|
33
|
-
const
|
|
34
|
-
if (!
|
|
31
|
+
g($, "OwpLayout");
|
|
32
|
+
function A(a, e, n, f = !0) {
|
|
33
|
+
const c = T(a, e);
|
|
34
|
+
if (!c)
|
|
35
35
|
return;
|
|
36
|
-
let
|
|
37
|
-
const
|
|
38
|
-
const
|
|
39
|
-
return
|
|
36
|
+
let m = !1;
|
|
37
|
+
const r = c.reduce((i, d) => {
|
|
38
|
+
const t = d.route[n];
|
|
39
|
+
return t === void 0 ? i : (m = !0, !f || t === null ? t : k(i ?? {}, t));
|
|
40
40
|
}, void 0);
|
|
41
|
-
return
|
|
41
|
+
return m ? r : void 0;
|
|
42
42
|
}
|
|
43
|
-
g(
|
|
43
|
+
g(A, "getRouteParamUtil");
|
|
44
44
|
export {
|
|
45
|
-
|
|
45
|
+
$ as OwpLayout
|
|
46
46
|
};
|
|
47
47
|
//# sourceMappingURL=OwpLayout.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OwpLayout.js","sources":["../../../src/components/OwpLayout/OwpLayout.tsx"],"sourcesContent":["import { themeLayouts, themeLayoutsType } from '@/layout/themeLayouts';\nimport { useOwpAppContext } from '@/contexts/OwpAppProvider';\nimport { generateSettings } from '@/configs/defaultConfig';\nimport { useOwpTranslation } from '@/hooks/useOwpTranslation';\nimport {\n useGetCurrentSettings,\n useGetDefaultSettings,\n useSetSettings,\n} from '@/hooks/useOwpSettings';\nimport type { OwpSettingsConfigType } from '@/types/OwpSettingsTypes';\nimport { OwpRoutesType } from '@/utils/common/OwpUtils';\nimport { isEqual, merge } from 'es-toolkit/compat';\nimport { type ReactNode, useEffect, useMemo, useRef } from 'react';\nimport { matchRoutes, RouteMatch, RouteObject, useLocation } from 'react-router-dom';\nimport { OwpLoading } from '../OwpLoading';\n\nexport type OwpRouteObjectType = RouteObject & {\n settings?: OwpSettingsConfigType;\n auth?: string[] | [] | null | undefined;\n};\n\nexport type OwpRouteMatchType = RouteMatch & {\n route: OwpRouteObjectType;\n};\n\ntype OwpLayoutProps = {\n layouts?: themeLayoutsType;\n children?: ReactNode;\n};\n\n/**\n * OwpLayout\n * React frontend component in a React project that is used for layouting the user interface. The component\n * handles generating user interface settings related to current routes, merged with default settings, and uses\n * the new settings to generate layouts.\n */\nfunction OwpLayout(props: OwpLayoutProps) {\n const { routesConfig } = useOwpAppContext();\n const { i18n } = useOwpTranslation();\n\n const { layouts = themeLayouts, children } = props;\n const setSettings = useSetSettings();\n const settings = useGetCurrentSettings();\n const defaultSettings = useGetDefaultSettings();\n
|
|
1
|
+
{"version":3,"file":"OwpLayout.js","sources":["../../../src/components/OwpLayout/OwpLayout.tsx"],"sourcesContent":["import { themeLayouts, themeLayoutsType } from '@/layout/themeLayouts';\nimport { useOwpAppContext } from '@/contexts/OwpAppProvider';\nimport { generateSettings } from '@/configs/defaultConfig';\nimport { LayoutConfigDefaultsType } from '@/configs/layoutConfig';\nimport { useOwpTranslation } from '@/hooks/useOwpTranslation';\nimport {\n useGetCurrentSettings,\n useGetDefaultSettings,\n useSetSettings,\n} from '@/hooks/useOwpSettings';\nimport type { OwpSettingsConfigType } from '@/types/OwpSettingsTypes';\nimport { OwpRoutesType } from '@/utils/common/OwpUtils';\nimport { isEqual, merge } from 'es-toolkit/compat';\nimport { type ReactNode, useEffect, useMemo, useRef } from 'react';\nimport { matchRoutes, RouteMatch, RouteObject, useLocation } from 'react-router-dom';\nimport { OwpLoading } from '../OwpLoading';\n\nexport type OwpRouteObjectType = RouteObject & {\n settings?: OwpSettingsConfigType;\n auth?: string[] | [] | null | undefined;\n};\n\nexport type OwpRouteMatchType = RouteMatch & {\n route: OwpRouteObjectType;\n};\n\ntype OwpLayoutProps = {\n layouts?: themeLayoutsType;\n children?: ReactNode;\n};\n\n/**\n * OwpLayout\n * React frontend component in a React project that is used for layouting the user interface. The component\n * handles generating user interface settings related to current routes, merged with default settings, and uses\n * the new settings to generate layouts.\n */\nfunction OwpLayout(props: OwpLayoutProps) {\n const { routesConfig } = useOwpAppContext();\n const { i18n } = useOwpTranslation();\n\n const { layouts = themeLayouts, children } = props;\n const setSettings = useSetSettings();\n const settings = useGetCurrentSettings();\n const defaultSettings = useGetDefaultSettings();\n const location = useLocation();\n const { pathname } = location;\n const hasCompletedInitialLayoutSyncRef = useRef(false);\n\n const matchedSettings = useMemo(\n () => getRouteParamUtil(routesConfig, pathname, 'settings', true),\n [pathname, routesConfig],\n );\n const currentSettings = useMemo(() => {\n if (matchedSettings === undefined) {\n return defaultSettings;\n }\n\n return generateSettings(defaultSettings, matchedSettings);\n }, [defaultSettings, matchedSettings]);\n const isSettingsSynchronized = useMemo(\n () => settings === currentSettings || isEqual(currentSettings, settings),\n [currentSettings, settings],\n );\n const resolvedSettings = isSettingsSynchronized ? settings : currentSettings;\n const layoutStyle = resolvedSettings?.layout?.style;\n const layoutConfig = resolvedSettings?.layout?.config as LayoutConfigDefaultsType | undefined;\n\n useEffect(() => {\n if (isSettingsSynchronized) {\n return;\n }\n\n setSettings(currentSettings);\n }, [currentSettings, isSettingsSynchronized, setSettings]);\n\n useEffect(() => {\n window.scrollTo(0, 0);\n }, [pathname]);\n\n useEffect(() => {\n if (isSettingsSynchronized && i18n.isInitialized) {\n hasCompletedInitialLayoutSyncRef.current = true;\n }\n }, [i18n.isInitialized, isSettingsSynchronized]);\n\n return useMemo(() => {\n const shouldBlockForInitialLoading =\n !i18n.isInitialized ||\n (!isSettingsSynchronized && !hasCompletedInitialLayoutSyncRef.current);\n\n if (shouldBlockForInitialLoading) {\n return <OwpLoading />;\n }\n\n return Object.entries(layouts).map(([key, Layout]) => {\n if (key === layoutStyle) {\n return (\n <Layout key={key} layoutConfig={layoutConfig}>\n {children}\n </Layout>\n );\n }\n\n return null;\n });\n }, [children, i18n.isInitialized, isSettingsSynchronized, layoutConfig, layoutStyle, layouts]);\n}\n\nexport { OwpLayout };\n\n/**\n * Utility function to retrieve and merge or replace a specific route parameter from matched routes.\n *\n * @param pathname The current pathname\n * @param key The key of the parameter to merge or replace (e.g., 'settings', 'auth')\n * @param useMerge Whether to merge the parameter (using es-toolkit merge) or replace it\n * @returns The merged or replaced parameter data of type T\n */\nfunction getRouteParamUtil<T>(\n routes: OwpRoutesType,\n pathname: string,\n key: keyof OwpRouteObjectType,\n useMerge: boolean = true,\n): T | undefined {\n const matchedRoutes = matchRoutes(routes, pathname) as OwpRouteMatchType[] | null;\n\n if (!matchedRoutes) {\n return undefined;\n }\n\n let hasMatchedParam = false;\n\n const resolvedRouteParam = matchedRoutes.reduce<T | undefined>((acc, match) => {\n const routeParam = match.route[key] as T | undefined;\n\n if (routeParam === undefined) {\n return acc;\n }\n\n hasMatchedParam = true;\n\n if (!useMerge) {\n return routeParam;\n }\n\n if (routeParam === null) {\n return routeParam;\n }\n\n return merge(acc ?? {}, routeParam);\n }, undefined);\n\n return hasMatchedParam ? resolvedRouteParam : undefined;\n}\n"],"names":["OwpLayout","props","routesConfig","useOwpAppContext","i18n","useOwpTranslation","layouts","themeLayouts","children","setSettings","useSetSettings","settings","useGetCurrentSettings","defaultSettings","useGetDefaultSettings","location","useLocation","pathname","hasCompletedInitialLayoutSyncRef","useRef","matchedSettings","useMemo","getRouteParamUtil","currentSettings","generateSettings","isSettingsSynchronized","isEqual","resolvedSettings","layoutStyle","_a","layoutConfig","_b","useEffect","OwpLoading","key","Layout","jsx","__name","routes","useMerge","matchedRoutes","matchRoutes","hasMatchedParam","resolvedRouteParam","acc","match","routeParam","merge"],"mappings":";;;;;;;;;;;;;AAqCA,SAASA,EAAUC,GAAuB;;AACxC,QAAM,EAAE,cAAAC,EAAA,IAAiBC,EAAA,GACnB,EAAE,MAAAC,EAAA,IAASC,EAAA,GAEX,EAAE,SAAAC,IAAUC,GAAc,UAAAC,EAAA,IAAaP,GACvCQ,IAAcC,EAAA,GACdC,IAAWC,EAAA,GACXC,IAAkBC,EAAA,GAClBC,IAAWC,EAAA,GACX,EAAE,UAAAC,MAAaF,GACfG,IAAmCC,EAAO,EAAK,GAE/CC,IAAkBC;AAAA,IACtB,MAAMC,EAAkBpB,GAAce,GAAU,YAAY,EAAI;AAAA,IAChE,CAACA,GAAUf,CAAY;AAAA,EAAA,GAEnBqB,IAAkBF,EAAQ,MAC1BD,MAAoB,SACfP,IAGFW,EAAiBX,GAAiBO,CAAe,GACvD,CAACP,GAAiBO,CAAe,CAAC,GAC/BK,IAAyBJ;AAAA,IAC7B,MAAMV,MAAaY,KAAmBG,EAAQH,GAAiBZ,CAAQ;AAAA,IACvE,CAACY,GAAiBZ,CAAQ;AAAA,EAAA,GAEtBgB,IAAmBF,IAAyBd,IAAWY,GACvDK,KAAcC,IAAAF,KAAA,gBAAAA,EAAkB,WAAlB,gBAAAE,EAA0B,OACxCC,KAAeC,IAAAJ,KAAA,gBAAAA,EAAkB,WAAlB,gBAAAI,EAA0B;AAE/C,SAAAC,EAAU,MAAM;AACd,IAAIP,KAIJhB,EAAYc,CAAe;AAAA,EAC7B,GAAG,CAACA,GAAiBE,GAAwBhB,CAAW,CAAC,GAEzDuB,EAAU,MAAM;AACd,WAAO,SAAS,GAAG,CAAC;AAAA,EACtB,GAAG,CAACf,CAAQ,CAAC,GAEbe,EAAU,MAAM;AACd,IAAIP,KAA0BrB,EAAK,kBACjCc,EAAiC,UAAU;AAAA,EAE/C,GAAG,CAACd,EAAK,eAAeqB,CAAsB,CAAC,GAExCJ,EAAQ,MAEX,CAACjB,EAAK,iBACL,CAACqB,KAA0B,CAACP,EAAiC,4BAGtDe,GAAA,EAAW,IAGd,OAAO,QAAQ3B,CAAO,EAAE,IAAI,CAAC,CAAC4B,GAAKC,CAAM,MAC1CD,MAAQN,IAER,gBAAAQ,EAACD,GAAA,EAAiB,cAAAL,GACf,UAAAtB,EAAA,GADU0B,CAEb,IAIG,IACR,GACA,CAAC1B,GAAUJ,EAAK,eAAeqB,GAAwBK,GAAcF,GAAatB,CAAO,CAAC;AAC/F;AAtES+B,EAAArC,GAAA;AAkFT,SAASsB,EACPgB,GACArB,GACAiB,GACAK,IAAoB,IACL;AACf,QAAMC,IAAgBC,EAAYH,GAAQrB,CAAQ;AAElD,MAAI,CAACuB;AACH;AAGF,MAAIE,IAAkB;AAEtB,QAAMC,IAAqBH,EAAc,OAAsB,CAACI,GAAKC,MAAU;AAC7E,UAAMC,IAAaD,EAAM,MAAMX,CAAG;AAElC,WAAIY,MAAe,SACVF,KAGTF,IAAkB,IAEd,CAACH,KAIDO,MAAe,OACVA,IAGFC,EAAMH,KAAO,CAAA,GAAIE,CAAU;AAAA,EACpC,GAAG,MAAS;AAEZ,SAAOJ,IAAkBC,IAAqB;AAChD;AAnCSN,EAAAf,GAAA;"}
|
|
@@ -1,200 +1,221 @@
|
|
|
1
|
-
var
|
|
2
|
-
var a = (r, u) =>
|
|
3
|
-
import { jsxs as
|
|
4
|
-
import { useOwpTranslation as
|
|
5
|
-
import { useGetCurrentLanguage as
|
|
6
|
-
import { TREE_GRID_BODY_ROWS_CHANGED_EVENT as
|
|
7
|
-
import { getTreeGridPerfTimestamp as
|
|
8
|
-
import { useRef as e, useState as
|
|
9
|
-
import { useOwpTreeGridOverlayFrame as
|
|
10
|
-
import { bindTreeGridEvents as
|
|
11
|
-
import { applyTreeGridLayoutToGrid as
|
|
12
|
-
import { OwpTreeGridLoadingOverlay as
|
|
13
|
-
import { OwpTreeGridNoDataOverlay as
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
|
|
1
|
+
var he = Object.defineProperty;
|
|
2
|
+
var a = (r, u) => he(r, "name", { value: u, configurable: !0 });
|
|
3
|
+
import { jsxs as qe, jsx as q } from "../../node_modules/.pnpm/@emotion_react@11.14.0_@types_react@19.2.14_react@19.2.4/node_modules/@emotion/react/jsx-runtime/dist/emotion-react-jsx-runtime.browser.esm.js";
|
|
4
|
+
import { useOwpTranslation as je } from "../../hooks/useOwpTranslation.js";
|
|
5
|
+
import { useGetCurrentLanguage as Fe } from "../../hooks/useCurrentLanguage.js";
|
|
6
|
+
import { TREE_GRID_BODY_ROWS_CHANGED_EVENT as ge } from "../../utils/treeGridBodyRowsEvent.js";
|
|
7
|
+
import { getTreeGridPerfTimestamp as j, countTreeGridPerf as be, logTreeGridPerf as Ee, measureTreeGridPerf as Be } from "./internal/utils/perf.js";
|
|
8
|
+
import { useRef as e, useState as F, useEffect as L, useLayoutEffect as We } from "react";
|
|
9
|
+
import { useOwpTreeGridOverlayFrame as ze } from "./internal/hooks/useOwpTreeGridOverlayFrame.js";
|
|
10
|
+
import { bindTreeGridEvents as Ye, getTreeGridBodyDataCount as W, buildTreeGridInitializationOptions as ke, hasTreeGridDisplayDataRows as Ie, replaceTreeGridBodyData as Je, TREE_GRID_BINDING_LOADING_MIN_VISIBLE_MS as Ke } from "./internal/treeGridRuntime.js";
|
|
11
|
+
import { applyTreeGridLayoutToGrid as Qe } from "./internal/treeGridLayout.js";
|
|
12
|
+
import { OwpTreeGridLoadingOverlay as Xe } from "./internal/OwpTreeGridLoadingOverlay.js";
|
|
13
|
+
import { OwpTreeGridNoDataOverlay as Ze } from "./internal/OwpTreeGridNoDataOverlay.js";
|
|
14
|
+
import { resolveTreeGridColumnEditRuleLookup as Le, createTreeGridColumnEditRulesState as $e, syncTreeGridColumnEditRules as Ue } from "./internal/treeGridColumnEditRules.js";
|
|
15
|
+
import { isEmpty as w } from "../../node_modules/.pnpm/es-toolkit@1.39.10/node_modules/es-toolkit/dist/compat/predicate/isEmpty.js";
|
|
16
|
+
import { delay as er } from "../../node_modules/.pnpm/es-toolkit@1.39.10/node_modules/es-toolkit/dist/compat/function/delay.js";
|
|
17
|
+
import { isEqual as we } from "../../node_modules/.pnpm/es-toolkit@1.39.10/node_modules/es-toolkit/dist/predicate/isEqual.js";
|
|
18
|
+
import { omit as rr } from "../../node_modules/.pnpm/es-toolkit@1.39.10/node_modules/es-toolkit/dist/compat/object/omit.js";
|
|
19
|
+
const Dr = /* @__PURE__ */ a(({
|
|
19
20
|
id: r = "treeGridWrapper",
|
|
20
21
|
containerStyle: u,
|
|
21
|
-
containerClassName:
|
|
22
|
-
className:
|
|
23
|
-
style:
|
|
24
|
-
height:
|
|
25
|
-
width:
|
|
26
|
-
layoutUrl:
|
|
27
|
-
dataUrl:
|
|
28
|
-
layoutOverrides:
|
|
22
|
+
containerClassName: Oe,
|
|
23
|
+
className: Ce,
|
|
24
|
+
style: Ae,
|
|
25
|
+
height: z = "100%",
|
|
26
|
+
width: Y = "100%",
|
|
27
|
+
layoutUrl: _e,
|
|
28
|
+
dataUrl: He,
|
|
29
|
+
layoutOverrides: O,
|
|
29
30
|
data: n,
|
|
30
|
-
useDataUrl:
|
|
31
|
-
onSelect:
|
|
32
|
-
onRowClick:
|
|
33
|
-
onRowAdd:
|
|
34
|
-
onRowDelete:
|
|
35
|
-
onRowUndelete:
|
|
36
|
-
onRowChange:
|
|
37
|
-
onClickButton:
|
|
38
|
-
onSave:
|
|
39
|
-
onReady:
|
|
40
|
-
onAfterValueChanged:
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
31
|
+
useDataUrl: k,
|
|
32
|
+
onSelect: J,
|
|
33
|
+
onRowClick: K,
|
|
34
|
+
onRowAdd: Q,
|
|
35
|
+
onRowDelete: X,
|
|
36
|
+
onRowUndelete: Z,
|
|
37
|
+
onRowChange: $,
|
|
38
|
+
onClickButton: U,
|
|
39
|
+
onSave: ee,
|
|
40
|
+
onReady: re,
|
|
41
|
+
onAfterValueChanged: te,
|
|
42
|
+
columnEditRules: f,
|
|
43
|
+
highlightEditableCells: ne = !0,
|
|
44
|
+
highlightChangedCells: oe = !0,
|
|
45
|
+
loading: xe,
|
|
44
46
|
showLoading: o = !0
|
|
45
47
|
}) => {
|
|
46
|
-
const { t:
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
48
|
+
const { t: C } = je(), i = e(null), ie = e(null), se = e(null), A = e(null), _ = e(O), ue = e(n), H = e(
|
|
49
|
+
f
|
|
50
|
+
), x = e(
|
|
51
|
+
Le(f, {
|
|
52
|
+
hourMinuteInvalidText: C("Message.시간은 HH:mm 형식으로 입력해주세요.")
|
|
53
|
+
})
|
|
54
|
+
), ae = e({
|
|
55
|
+
onSelect: J,
|
|
56
|
+
onRowClick: K,
|
|
57
|
+
onRowAdd: Q,
|
|
58
|
+
onRowDelete: X,
|
|
59
|
+
onRowUndelete: Z,
|
|
60
|
+
onRowChange: $,
|
|
61
|
+
onClickButton: U,
|
|
62
|
+
onSave: ee,
|
|
63
|
+
onReady: re,
|
|
64
|
+
onAfterValueChanged: te
|
|
65
|
+
}), p = e(void 0), N = e(!1), D = e(void 0), g = e(void 0), b = e(
|
|
66
|
+
void 0
|
|
67
|
+
), ce = e($e()), Ne = e(!1), m = e(0), c = e(null), R = e(void 0), y = e(void 0), de = e(ne), le = e(oe), [P, Pe] = F(!1), [Me, v] = F(!1), [Ve, fe] = F(!1), E = Fe(), pe = e(E.id), Se = o && n !== void 0 && P && g.current !== n, M = o && xe === !0 || o && (Me || Se), V = !M && n !== void 0 && w(n) && !Ve, me = /* @__PURE__ */ a((t) => {
|
|
68
|
+
fe(Ie(t));
|
|
59
69
|
}, "syncHasDisplayDataRows");
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
70
|
+
_.current = O, ue.current = n, H.current = f, x.current = Le(f, {
|
|
71
|
+
hourMinuteInvalidText: C("Message.시간은 HH:mm 형식으로 입력해주세요.")
|
|
72
|
+
}), de.current = ne, le.current = oe, ae.current = {
|
|
73
|
+
onSelect: J,
|
|
74
|
+
onRowClick: K,
|
|
75
|
+
onRowAdd: Q,
|
|
76
|
+
onRowDelete: X,
|
|
77
|
+
onRowUndelete: Z,
|
|
78
|
+
onRowChange: $,
|
|
79
|
+
onClickButton: U,
|
|
80
|
+
onSave: ee,
|
|
81
|
+
onReady: re,
|
|
82
|
+
onAfterValueChanged: te
|
|
71
83
|
};
|
|
72
|
-
const
|
|
73
|
-
visible:
|
|
74
|
-
containerRef:
|
|
84
|
+
const Re = ze({
|
|
85
|
+
visible: M || V,
|
|
86
|
+
containerRef: ie,
|
|
75
87
|
treeGridInstanceRef: i,
|
|
76
88
|
debugId: r
|
|
77
|
-
}),
|
|
78
|
-
|
|
79
|
-
}, "clearBindingLoadingHideTimeout"),
|
|
80
|
-
|
|
89
|
+
}), B = /* @__PURE__ */ a(() => {
|
|
90
|
+
R.current !== void 0 && (window.clearTimeout(R.current), R.current = void 0);
|
|
91
|
+
}, "clearBindingLoadingHideTimeout"), S = /* @__PURE__ */ a(() => {
|
|
92
|
+
y.current !== void 0 && (window.clearTimeout(y.current), y.current = void 0);
|
|
81
93
|
}, "clearBodyReloadStartTimeout");
|
|
82
|
-
|
|
94
|
+
L(() => {
|
|
83
95
|
const t = /* @__PURE__ */ a((s) => {
|
|
84
|
-
var
|
|
85
|
-
((
|
|
96
|
+
var d;
|
|
97
|
+
((d = s.detail) == null ? void 0 : d.gridId) === r && fe(Ie(i.current));
|
|
86
98
|
}, "handleBodyRowsChanged");
|
|
87
|
-
return window.addEventListener(
|
|
88
|
-
window.removeEventListener(
|
|
99
|
+
return window.addEventListener(ge, t), () => {
|
|
100
|
+
window.removeEventListener(ge, t);
|
|
89
101
|
};
|
|
90
|
-
}, [r]),
|
|
91
|
-
o || (
|
|
92
|
-
}, [o]),
|
|
102
|
+
}, [r]), L(() => {
|
|
103
|
+
o || (S(), B(), c.current = null, v(!1));
|
|
104
|
+
}, [o]), L(() => {
|
|
93
105
|
var t;
|
|
94
|
-
if (
|
|
95
|
-
return
|
|
106
|
+
if (E.id !== pe.current && !w(i.current) && ((t = i.current) == null || t.Dispose(), i.current = null, pe.current = E.id), !!w(i.current))
|
|
107
|
+
return Ye({
|
|
96
108
|
id: r,
|
|
97
|
-
latestEventHandlersRef:
|
|
98
|
-
highlightEditableCellsRef:
|
|
99
|
-
highlightChangedCellsRef:
|
|
109
|
+
latestEventHandlersRef: ae,
|
|
110
|
+
highlightEditableCellsRef: de,
|
|
111
|
+
highlightChangedCellsRef: le,
|
|
100
112
|
treeGridInstanceRef: i,
|
|
101
|
-
treeGridInitStartedAtRef:
|
|
102
|
-
latestLayoutOverridesRef:
|
|
103
|
-
appliedLayoutOverridesRef:
|
|
104
|
-
appliedBodyDataPropRef:
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
113
|
+
treeGridInitStartedAtRef: se,
|
|
114
|
+
latestLayoutOverridesRef: _,
|
|
115
|
+
appliedLayoutOverridesRef: D,
|
|
116
|
+
appliedBodyDataPropRef: g,
|
|
117
|
+
latestColumnEditRulesRef: H,
|
|
118
|
+
latestColumnEditRuleLookupRef: x,
|
|
119
|
+
appliedColumnEditRulesRef: b,
|
|
120
|
+
columnEditRulesStateRef: ce,
|
|
121
|
+
hasAppliedInitialLayoutRef: Ne,
|
|
122
|
+
syncHasDisplayDataRows: me,
|
|
123
|
+
setIsTreeGridReady: Pe
|
|
124
|
+
}), se.current = j(), be(r, "init"), Ee(r, "TreeGrid init start", {
|
|
125
|
+
useDataUrl: !!k,
|
|
126
|
+
bodyRowCount: W(n)
|
|
111
127
|
}), window.TreeGrid(
|
|
112
|
-
|
|
128
|
+
ke({
|
|
113
129
|
id: r,
|
|
114
|
-
layoutUrl:
|
|
115
|
-
dataUrl:
|
|
130
|
+
layoutUrl: _e,
|
|
131
|
+
dataUrl: He,
|
|
116
132
|
bodyData: n,
|
|
117
|
-
useDataUrl:
|
|
118
|
-
width:
|
|
119
|
-
height:
|
|
120
|
-
languageId:
|
|
133
|
+
useDataUrl: k,
|
|
134
|
+
width: Y,
|
|
135
|
+
height: z,
|
|
136
|
+
languageId: E.id
|
|
121
137
|
}),
|
|
122
138
|
r,
|
|
123
139
|
r
|
|
124
140
|
), () => {
|
|
125
|
-
|
|
141
|
+
er(() => {
|
|
126
142
|
var s;
|
|
127
143
|
(s = i.current) == null || s.Dispose();
|
|
128
144
|
}, 200);
|
|
129
145
|
};
|
|
130
|
-
}, []),
|
|
131
|
-
const t = i.current, s =
|
|
132
|
-
if (
|
|
146
|
+
}, []), We(() => {
|
|
147
|
+
const t = i.current, s = _.current, T = ue.current, d = H.current;
|
|
148
|
+
if (w(t) || !P)
|
|
133
149
|
return;
|
|
134
|
-
const
|
|
135
|
-
if (!(!
|
|
136
|
-
if (
|
|
137
|
-
const
|
|
138
|
-
|
|
139
|
-
disableBodyReload: !!
|
|
150
|
+
const ye = D.current !== s && !we(D.current, s), I = g.current !== T && (!N.current || p.current !== T), ve = b.current !== d && !we(b.current, d);
|
|
151
|
+
if (!(!ye && !I && !ve)) {
|
|
152
|
+
if (ye) {
|
|
153
|
+
const l = j();
|
|
154
|
+
Qe(t, s, I), D.current = s, Be(r, "apply layout", l, {
|
|
155
|
+
disableBodyReload: !!I
|
|
140
156
|
});
|
|
141
157
|
}
|
|
142
|
-
if (
|
|
143
|
-
const
|
|
144
|
-
const
|
|
145
|
-
|
|
146
|
-
bodyRowCount:
|
|
147
|
-
}),
|
|
148
|
-
if (
|
|
158
|
+
if (I) {
|
|
159
|
+
const l = m.current + 1, Te = /* @__PURE__ */ a(() => {
|
|
160
|
+
const G = p.current;
|
|
161
|
+
y.current = void 0, A.current = j(), be(r, "reload"), Ee(r, "ReloadBody start", {
|
|
162
|
+
bodyRowCount: W(G)
|
|
163
|
+
}), Je(t, G, () => {
|
|
164
|
+
if (m.current !== l)
|
|
149
165
|
return;
|
|
150
|
-
|
|
151
|
-
bodyRowCount:
|
|
152
|
-
}),
|
|
153
|
-
const
|
|
154
|
-
if (!o ||
|
|
155
|
-
c.current = null,
|
|
166
|
+
g.current = G, me(t), Be(r, "ReloadBody end", A.current, {
|
|
167
|
+
bodyRowCount: W(G)
|
|
168
|
+
}), A.current = null, p.current === G && (p.current = void 0, N.current = !1);
|
|
169
|
+
const Ge = c.current;
|
|
170
|
+
if (!o || Ge === null) {
|
|
171
|
+
c.current = null, v(!1);
|
|
156
172
|
return;
|
|
157
173
|
}
|
|
158
|
-
const
|
|
174
|
+
const De = Math.max(
|
|
159
175
|
0,
|
|
160
|
-
|
|
176
|
+
Ke - (Date.now() - Ge)
|
|
161
177
|
);
|
|
162
|
-
if (
|
|
163
|
-
c.current = null,
|
|
178
|
+
if (B(), De === 0) {
|
|
179
|
+
c.current = null, v(!1);
|
|
164
180
|
return;
|
|
165
181
|
}
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
},
|
|
182
|
+
R.current = window.setTimeout(() => {
|
|
183
|
+
m.current === l && (R.current = void 0, c.current = null, v(!1));
|
|
184
|
+
}, De);
|
|
169
185
|
});
|
|
170
186
|
}, "runBodyReload");
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
}, 0)) :
|
|
187
|
+
m.current = l, p.current = T, N.current = !0, o && T !== void 0 ? (S(), B(), c.current = Date.now(), v(!0), y.current = window.setTimeout(() => {
|
|
188
|
+
m.current === l && Te();
|
|
189
|
+
}, 0)) : Te();
|
|
174
190
|
}
|
|
191
|
+
ve && (Ue(
|
|
192
|
+
t,
|
|
193
|
+
x.current,
|
|
194
|
+
ce.current
|
|
195
|
+
), b.current = d);
|
|
175
196
|
}
|
|
176
|
-
}, [
|
|
177
|
-
|
|
197
|
+
}, [P, O, n, f, o, r]), L(() => () => {
|
|
198
|
+
S(), B();
|
|
178
199
|
}, []);
|
|
179
|
-
const
|
|
180
|
-
height:
|
|
181
|
-
width:
|
|
200
|
+
const h = {
|
|
201
|
+
height: z,
|
|
202
|
+
width: Y,
|
|
182
203
|
...u
|
|
183
204
|
};
|
|
184
|
-
return (o ||
|
|
185
|
-
/* @__PURE__ */
|
|
186
|
-
/* @__PURE__ */
|
|
187
|
-
|
|
205
|
+
return (o || V) && (h.position = u != null && u.position && u.position !== "static" ? u.position : "relative", h.isolation = "isolate"), /* @__PURE__ */ qe("div", { ref: ie, className: Oe, style: h, children: [
|
|
206
|
+
/* @__PURE__ */ q("div", { id: r, className: Ce, style: rr(Ae, ["height", "width"]) }),
|
|
207
|
+
/* @__PURE__ */ q(
|
|
208
|
+
Ze,
|
|
188
209
|
{
|
|
189
|
-
visible:
|
|
190
|
-
message:
|
|
191
|
-
overlayFrame:
|
|
210
|
+
visible: V,
|
|
211
|
+
message: C("Message.조회된 결과가 없습니다."),
|
|
212
|
+
overlayFrame: Re
|
|
192
213
|
}
|
|
193
214
|
),
|
|
194
|
-
/* @__PURE__ */
|
|
215
|
+
/* @__PURE__ */ q(Xe, { visible: M, overlayFrame: Re })
|
|
195
216
|
] });
|
|
196
217
|
}, "OwpTreeGrid");
|
|
197
218
|
export {
|
|
198
|
-
|
|
219
|
+
Dr as OwpTreeGrid
|
|
199
220
|
};
|
|
200
221
|
//# sourceMappingURL=OwpTreeGrid.js.map
|