@owp/core 2.2.3 → 2.2.5
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/index11.js +2 -2
- package/dist/_virtual/index12.js +2 -2
- package/dist/_virtual/index13.js +2 -2
- package/dist/_virtual/index14.js +2 -2
- package/dist/_virtual/index15.js +2 -5
- package/dist/_virtual/index15.js.map +1 -1
- package/dist/_virtual/index16.js +2 -2
- package/dist/_virtual/index17.js +2 -2
- package/dist/_virtual/index5.js +5 -2
- 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/OwpCommonCode/OwpCommonCodeSelector.js +68 -149
- package/dist/components/OwpCommonCode/OwpCommonCodeSelector.js.map +1 -1
- package/dist/components/OwpMrtTable/OwpMrtTable.js +186 -162
- package/dist/components/OwpMrtTable/OwpMrtTable.js.map +1 -1
- package/dist/components/OwpOptionSelector/OwpOptionSelector.js +52 -38
- package/dist/components/OwpOptionSelector/OwpOptionSelector.js.map +1 -1
- package/dist/components/OwpPageTitle/OwpPageTitle.js +74 -18
- package/dist/components/OwpPageTitle/OwpPageTitle.js.map +1 -1
- package/dist/components/OwpQuerySelector/OwpQuerySelector.js +232 -0
- package/dist/components/OwpQuerySelector/OwpQuerySelector.js.map +1 -0
- package/dist/components/OwpSearchFilter/OwpSearchFilter.js +44 -29
- package/dist/components/OwpSearchFilter/OwpSearchFilter.js.map +1 -1
- package/dist/components/OwpSection/OwpSection.js +102 -41
- package/dist/components/OwpSection/OwpSection.js.map +1 -1
- package/dist/components/OwpSelectorBase/OwpSelectorAutocomplete.js +381 -0
- package/dist/components/OwpSelectorBase/OwpSelectorAutocomplete.js.map +1 -0
- package/dist/components/OwpSelectorBase/OwpSelectorBase.js +14 -0
- package/dist/components/OwpSelectorBase/OwpSelectorBase.js.map +1 -0
- package/dist/components/OwpSelectorBase/OwpSelectorSelect.js +152 -0
- package/dist/components/OwpSelectorBase/OwpSelectorSelect.js.map +1 -0
- package/dist/components/OwpSelectorBase/hooks/useOwpSelectorBase.js +120 -0
- package/dist/components/OwpSelectorBase/hooks/useOwpSelectorBase.js.map +1 -0
- package/dist/components/OwpSelectorBase/utils/querySelectorUtils.js +24 -0
- package/dist/components/OwpSelectorBase/utils/querySelectorUtils.js.map +1 -0
- package/dist/hooks/useHeaderWrapState.js +48 -0
- package/dist/hooks/useHeaderWrapState.js.map +1 -0
- package/dist/hooks.js +40 -38
- package/dist/hooks.js.map +1 -1
- package/dist/index.js +39 -37
- package/dist/index.js.map +1 -1
- package/dist/layout/components/navigation/vertical/NavVerticalLayout.js +63 -27
- package/dist/layout/components/navigation/vertical/NavVerticalLayout.js.map +1 -1
- package/dist/node_modules/.pnpm/@mui_icons-material@7.3.9_@mui_material@7.3.9_@emotion_react@11.14.0_@types_react@19.2._dc2be6bc014bebdac88a574e3e02c144/node_modules/@mui/icons-material/esm/ArrowDropDown.js +9 -0
- package/dist/node_modules/.pnpm/@mui_icons-material@7.3.9_@mui_material@7.3.9_@emotion_react@11.14.0_@types_react@19.2._dc2be6bc014bebdac88a574e3e02c144/node_modules/@mui/icons-material/esm/ArrowDropDown.js.map +1 -0
- package/dist/node_modules/.pnpm/es-toolkit@1.39.10/node_modules/es-toolkit/dist/compat/predicate/isFunction.js +10 -0
- package/dist/node_modules/.pnpm/es-toolkit@1.39.10/node_modules/es-toolkit/dist/compat/predicate/isFunction.js.map +1 -0
- 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/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/constants.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/constants.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/constants.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/qrcode@1.5.4/node_modules/qrcode/lib/core/utils.js +1 -1
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/renderer/utils.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/OwpCommonCode/OwpCommonCodeSelector.d.ts +16 -6
- package/dist/types/components/OwpOptionSelector/OwpOptionSelector.d.ts +9 -8
- package/dist/types/components/OwpQuerySelector/OwpQuerySelector.d.ts +6 -0
- package/dist/types/components/OwpQuerySelector/index.d.ts +2 -0
- package/dist/types/components/OwpQuerySelector/types/index.d.ts +1 -0
- package/dist/types/components/OwpQuerySelector/types/types.d.ts +42 -0
- package/dist/types/components/OwpSection/OwpSection.d.ts +3 -1
- package/dist/types/components/OwpSelectorBase/OwpSelectorAutocomplete.d.ts +11 -0
- package/dist/types/components/OwpSelectorBase/OwpSelectorBase.d.ts +6 -0
- package/dist/types/components/OwpSelectorBase/OwpSelectorSelect.d.ts +11 -0
- package/dist/types/components/OwpSelectorBase/hooks/useOwpSelectorBase.d.ts +6 -0
- package/dist/types/components/OwpSelectorBase/types/index.d.ts +1 -0
- package/dist/types/components/OwpSelectorBase/types/types.d.ts +59 -0
- package/dist/types/components/OwpSelectorBase/utils/index.d.ts +1 -0
- package/dist/types/components/OwpSelectorBase/utils/querySelectorUtils.d.ts +31 -0
- package/dist/types/hooks/index.d.ts +1 -0
- package/dist/types/hooks/useHeaderWrapState.d.ts +14 -0
- package/dist/types/index.d.ts +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
var b = Object.defineProperty;
|
|
2
|
+
var U = (a, c) => b(a, "name", { value: c, configurable: !0 });
|
|
3
|
+
import { useOwpTranslation as m } from "../../../hooks/useOwpTranslation.js";
|
|
4
|
+
import { mergeSelectorOptions as I, joinSelectorValue as W, splitSelectorValue as X, getSelectorAllToken as nn, createSelectorChangeEvent as en } from "../utils/querySelectorUtils.js";
|
|
5
|
+
import { useState as Y, useRef as k, useMemo as i, useCallback as d, useEffect as q } from "react";
|
|
6
|
+
const sn = /* @__PURE__ */ U(({
|
|
7
|
+
allOptions: a,
|
|
8
|
+
allValueMode: c = "joined",
|
|
9
|
+
defaultValue: L,
|
|
10
|
+
disableAllValueItem: r,
|
|
11
|
+
multiple: n,
|
|
12
|
+
name: F,
|
|
13
|
+
onChange: G,
|
|
14
|
+
options: H,
|
|
15
|
+
value: j
|
|
16
|
+
}) => {
|
|
17
|
+
const { t: J } = m(), f = j !== void 0, K = L ?? "", [w, x] = Y(L), [h, v] = Y(
|
|
18
|
+
() => n && !r && (j ?? K) === "" ? "all" : "none"
|
|
19
|
+
), Q = k(!1), O = k(j ?? K), g = k(null), B = k(G);
|
|
20
|
+
B.current = G;
|
|
21
|
+
const y = i(
|
|
22
|
+
() => I(H, a),
|
|
23
|
+
[a, H]
|
|
24
|
+
), t = i(
|
|
25
|
+
() => y.filter((e) => !e.disabled).map((e) => e.value),
|
|
26
|
+
[y]
|
|
27
|
+
), Z = i(() => W(t), [t]), o = f ? j : w, R = i(() => X(o), [o]), T = i(() => n && !r && (o == null || o === "") && h === "all" ? t : R, [t, r, h, n, o, R]), E = i(() => new Set(T), [T]), p = i(
|
|
28
|
+
() => ({
|
|
29
|
+
label: J("Common.전체"),
|
|
30
|
+
raw: null,
|
|
31
|
+
value: nn()
|
|
32
|
+
}),
|
|
33
|
+
[J]
|
|
34
|
+
), D = i(
|
|
35
|
+
() => y.filter((e) => E.has(e.value)),
|
|
36
|
+
[y, E]
|
|
37
|
+
), C = i(() => r ? !1 : n ? (o == null || o === "") && h === "all" ? !0 : c === "empty" ? h === "all" : !!t.length && t.every((e) => E.has(e)) : o == null || o === "", [
|
|
38
|
+
t,
|
|
39
|
+
c,
|
|
40
|
+
r,
|
|
41
|
+
h,
|
|
42
|
+
n,
|
|
43
|
+
o,
|
|
44
|
+
E
|
|
45
|
+
]), _ = i(() => !n && C && !r ? p : D[0] ?? null, [p, r, C, n, D]), z = n && c === "joined" ? Z : "", s = d(
|
|
46
|
+
(e, S) => {
|
|
47
|
+
var u;
|
|
48
|
+
n && !r && (e === "" ? (g.current = S ?? "none", v(S ?? "none")) : (g.current = null, v("none"))), f || x(e), (u = B.current) == null || u.call(B, en(F, e));
|
|
49
|
+
},
|
|
50
|
+
[r, f, n, F]
|
|
51
|
+
), P = d(() => {
|
|
52
|
+
s(z, n && c === "empty" ? "all" : void 0);
|
|
53
|
+
}, [z, c, s, n]), $ = d(() => {
|
|
54
|
+
!n || r || (g.current = "all", O.current = "", v("all"), f || x(""));
|
|
55
|
+
}, [r, f, n]), l = d(() => {
|
|
56
|
+
s("", n ? "none" : void 0);
|
|
57
|
+
}, [s, n]), M = d(
|
|
58
|
+
(e) => {
|
|
59
|
+
s(e);
|
|
60
|
+
},
|
|
61
|
+
[s]
|
|
62
|
+
), V = d(
|
|
63
|
+
(e) => {
|
|
64
|
+
const S = e.filter((u) => u !== "");
|
|
65
|
+
if (!r && t.length && t.every((u) => S.includes(u))) {
|
|
66
|
+
P();
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
s(
|
|
70
|
+
W(S),
|
|
71
|
+
c === "empty" ? "none" : void 0
|
|
72
|
+
);
|
|
73
|
+
},
|
|
74
|
+
[t, c, r, s, P]
|
|
75
|
+
);
|
|
76
|
+
return q(() => {
|
|
77
|
+
f || x(L);
|
|
78
|
+
}, [L, f]), q(() => {
|
|
79
|
+
if (n && !r) {
|
|
80
|
+
const e = o ?? "", S = O.current;
|
|
81
|
+
if (e === "") {
|
|
82
|
+
const N = g.current;
|
|
83
|
+
N ? (v(N), g.current = null) : S !== e && v("all"), O.current = e;
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
const u = X(e), A = !!t.length && t.every((N) => u.includes(N));
|
|
87
|
+
v(A ? "all" : "none"), g.current = null, O.current = e;
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
O.current = o ?? "";
|
|
91
|
+
}, [t, r, n, o]), q(() => {
|
|
92
|
+
!n || r || Q.current || f || w !== void 0 && w !== "" || !t.length || (Q.current = !0, s(z, n && c === "empty" ? "all" : void 0));
|
|
93
|
+
}, [
|
|
94
|
+
z,
|
|
95
|
+
t.length,
|
|
96
|
+
c,
|
|
97
|
+
r,
|
|
98
|
+
s,
|
|
99
|
+
w,
|
|
100
|
+
f,
|
|
101
|
+
n
|
|
102
|
+
]), {
|
|
103
|
+
allOption: p,
|
|
104
|
+
allValue: z,
|
|
105
|
+
clearSelection: l,
|
|
106
|
+
isAllSelected: C,
|
|
107
|
+
resolvedOptions: y,
|
|
108
|
+
restoreAllSelection: $,
|
|
109
|
+
selectAll: P,
|
|
110
|
+
selectedOption: _,
|
|
111
|
+
selectedOptions: C && n && !r ? [p, ...y] : D,
|
|
112
|
+
selectedValueList: T,
|
|
113
|
+
selectMultipleValues: V,
|
|
114
|
+
selectSingleValue: M
|
|
115
|
+
};
|
|
116
|
+
}, "useOwpSelectorBase");
|
|
117
|
+
export {
|
|
118
|
+
sn as useOwpSelectorBase
|
|
119
|
+
};
|
|
120
|
+
//# sourceMappingURL=useOwpSelectorBase.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useOwpSelectorBase.js","sources":["../../../../src/components/OwpSelectorBase/hooks/useOwpSelectorBase.ts"],"sourcesContent":["import { useOwpTranslation } from '@/hooks/useOwpTranslation';\nimport {\n type OwpSelectorBaseHookResult,\n type OwpSelectorBaseOption,\n type OwpSelectorBaseProps,\n type OwpSelectorEmptyValueMode,\n} from '../types';\nimport {\n createSelectorChangeEvent,\n getSelectorAllToken,\n joinSelectorValue,\n mergeSelectorOptions,\n splitSelectorValue,\n} from '../utils';\nimport { useCallback, useEffect, useMemo, useRef, useState } from 'react';\n\n/**\n * 공통 선택기 상태 훅\n * @param props 공통 선택기 props\n */\nexport const useOwpSelectorBase = ({\n allOptions,\n allValueMode = 'joined',\n defaultValue,\n disableAllValueItem,\n multiple,\n name,\n onChange,\n options,\n value,\n}: OwpSelectorBaseProps): OwpSelectorBaseHookResult => {\n const { t } = useOwpTranslation();\n const isControlled = value !== undefined;\n const normalizedDefaultValue = defaultValue ?? '';\n const [internalValue, setInternalValue] = useState(defaultValue);\n const [emptyValueMode, setEmptyValueMode] = useState<OwpSelectorEmptyValueMode>(() =>\n multiple && !disableAllValueItem && (value ?? normalizedDefaultValue) === ''\n ? 'all'\n : 'none',\n );\n const didInitializeAllValue = useRef(false);\n const previousNormalizedValue = useRef(value ?? normalizedDefaultValue);\n const pendingEmptyValueMode = useRef<OwpSelectorEmptyValueMode | null>(null);\n const onChangeRef = useRef(onChange);\n\n onChangeRef.current = onChange;\n\n const resolvedOptions = useMemo(\n () => mergeSelectorOptions(options, allOptions),\n [allOptions, options],\n );\n const allValueList = useMemo(\n () => resolvedOptions.filter((option) => !option.disabled).map((option) => option.value),\n [resolvedOptions],\n );\n const joinedAllValue = useMemo(() => joinSelectorValue(allValueList), [allValueList]);\n const normalizedValue = isControlled ? value : internalValue;\n const splitValueList = useMemo(() => splitSelectorValue(normalizedValue), [normalizedValue]);\n const selectedValueList = useMemo(() => {\n if (\n multiple &&\n !disableAllValueItem &&\n (normalizedValue == null || normalizedValue === '') &&\n emptyValueMode === 'all'\n ) {\n return allValueList;\n }\n\n return splitValueList;\n }, [allValueList, disableAllValueItem, emptyValueMode, multiple, normalizedValue, splitValueList]);\n const selectedValueSet = useMemo(() => new Set(selectedValueList), [selectedValueList]);\n const allOption = useMemo<OwpSelectorBaseOption<null>>(\n () => ({\n label: t('Common.전체'),\n raw: null,\n value: getSelectorAllToken(),\n }),\n [t],\n );\n const selectedOptions = useMemo(\n () => resolvedOptions.filter((option) => selectedValueSet.has(option.value)),\n [resolvedOptions, selectedValueSet],\n );\n const isAllSelected = useMemo(() => {\n if (disableAllValueItem) {\n return false;\n }\n\n if (!multiple) {\n return normalizedValue == null || normalizedValue === '';\n }\n\n if ((normalizedValue == null || normalizedValue === '') && emptyValueMode === 'all') {\n return true;\n }\n\n if (allValueMode === 'empty') {\n return emptyValueMode === 'all';\n }\n\n return Boolean(allValueList.length) && allValueList.every((item) => selectedValueSet.has(item));\n }, [\n allValueList,\n allValueMode,\n disableAllValueItem,\n emptyValueMode,\n multiple,\n normalizedValue,\n selectedValueSet,\n ]);\n const selectedOption = useMemo(() => {\n if (!multiple && isAllSelected && !disableAllValueItem) {\n return allOption;\n }\n\n return selectedOptions[0] ?? null;\n }, [allOption, disableAllValueItem, isAllSelected, multiple, selectedOptions]);\n const allValue = multiple\n ? allValueMode === 'joined'\n ? joinedAllValue\n : ''\n : '';\n\n const emitChange = useCallback(\n (nextValue: string, nextEmptyMode?: OwpSelectorEmptyValueMode) => {\n if (multiple && !disableAllValueItem) {\n if (nextValue === '') {\n pendingEmptyValueMode.current = nextEmptyMode ?? 'none';\n setEmptyValueMode(nextEmptyMode ?? 'none');\n } else {\n pendingEmptyValueMode.current = null;\n setEmptyValueMode('none');\n }\n }\n\n if (!isControlled) {\n setInternalValue(nextValue);\n }\n\n onChangeRef.current?.(createSelectorChangeEvent(name, nextValue));\n },\n [disableAllValueItem, isControlled, multiple, name],\n );\n\n const selectAll = useCallback(() => {\n emitChange(allValue, multiple && allValueMode === 'empty' ? 'all' : undefined);\n }, [allValue, allValueMode, emitChange, multiple]);\n\n const restoreAllSelection = useCallback(() => {\n if (!multiple || disableAllValueItem) {\n return;\n }\n\n pendingEmptyValueMode.current = 'all';\n previousNormalizedValue.current = '';\n setEmptyValueMode('all');\n\n if (!isControlled) {\n setInternalValue('');\n }\n }, [disableAllValueItem, isControlled, multiple]);\n\n const clearSelection = useCallback(() => {\n emitChange('', multiple ? 'none' : undefined);\n }, [emitChange, multiple]);\n\n const selectSingleValue = useCallback(\n (nextValue: string) => {\n emitChange(nextValue);\n },\n [emitChange],\n );\n\n const selectMultipleValues = useCallback(\n (nextSelectedValueList: string[]) => {\n const normalizedSelectedValueList = nextSelectedValueList.filter((item) => item !== '');\n\n if (\n !disableAllValueItem &&\n Boolean(allValueList.length) &&\n allValueList.every((item) => normalizedSelectedValueList.includes(item))\n ) {\n selectAll();\n return;\n }\n\n emitChange(\n joinSelectorValue(normalizedSelectedValueList),\n allValueMode === 'empty' ? 'none' : undefined,\n );\n },\n [allValueList, allValueMode, disableAllValueItem, emitChange, selectAll],\n );\n\n useEffect(() => {\n if (isControlled) {\n return;\n }\n\n setInternalValue(defaultValue);\n }, [defaultValue, isControlled]);\n\n useEffect(() => {\n if (multiple && !disableAllValueItem) {\n const nextNormalizedValue = normalizedValue ?? '';\n const previousValue = previousNormalizedValue.current;\n\n if (nextNormalizedValue === '') {\n const nextPendingEmptyValueMode = pendingEmptyValueMode.current;\n\n if (nextPendingEmptyValueMode) {\n setEmptyValueMode(nextPendingEmptyValueMode);\n pendingEmptyValueMode.current = null;\n } else if (previousValue !== nextNormalizedValue) {\n setEmptyValueMode('all');\n }\n\n previousNormalizedValue.current = nextNormalizedValue;\n\n return;\n }\n\n const nextSelectedValueList = splitSelectorValue(nextNormalizedValue);\n const isNextAllSelected =\n Boolean(allValueList.length) &&\n allValueList.every((item) => nextSelectedValueList.includes(item));\n\n setEmptyValueMode(isNextAllSelected ? 'all' : 'none');\n pendingEmptyValueMode.current = null;\n previousNormalizedValue.current = nextNormalizedValue;\n\n return;\n }\n\n previousNormalizedValue.current = normalizedValue ?? '';\n }, [allValueList, disableAllValueItem, multiple, normalizedValue]);\n\n useEffect(() => {\n if (\n !multiple ||\n disableAllValueItem ||\n didInitializeAllValue.current ||\n isControlled ||\n (internalValue !== undefined && internalValue !== '') ||\n !allValueList.length\n ) {\n return;\n }\n\n didInitializeAllValue.current = true;\n emitChange(allValue, multiple && allValueMode === 'empty' ? 'all' : undefined);\n }, [\n allValue,\n allValueList.length,\n allValueMode,\n disableAllValueItem,\n emitChange,\n internalValue,\n isControlled,\n multiple,\n ]);\n\n return {\n allOption,\n allValue,\n clearSelection,\n isAllSelected,\n resolvedOptions,\n restoreAllSelection,\n selectAll,\n selectedOption,\n selectedOptions: isAllSelected && multiple && !disableAllValueItem ? [allOption, ...resolvedOptions] : selectedOptions,\n selectedValueList,\n selectMultipleValues,\n selectSingleValue,\n };\n};\n"],"names":["useOwpSelectorBase","__name","allOptions","allValueMode","defaultValue","disableAllValueItem","multiple","name","onChange","options","value","t","useOwpTranslation","isControlled","normalizedDefaultValue","internalValue","setInternalValue","useState","emptyValueMode","setEmptyValueMode","didInitializeAllValue","useRef","previousNormalizedValue","pendingEmptyValueMode","onChangeRef","resolvedOptions","useMemo","mergeSelectorOptions","allValueList","option","joinedAllValue","joinSelectorValue","normalizedValue","splitValueList","splitSelectorValue","selectedValueList","selectedValueSet","allOption","getSelectorAllToken","selectedOptions","isAllSelected","item","selectedOption","allValue","emitChange","useCallback","nextValue","nextEmptyMode","_a","createSelectorChangeEvent","selectAll","restoreAllSelection","clearSelection","selectSingleValue","selectMultipleValues","nextSelectedValueList","normalizedSelectedValueList","useEffect","nextNormalizedValue","previousValue","nextPendingEmptyValueMode","isNextAllSelected"],"mappings":";;;;;AAoBO,MAAMA,KAAqB,gBAAAC,EAAA,CAAC;AAAA,EACjC,YAAAC;AAAA,EACA,cAAAC,IAAe;AAAA,EACf,cAAAC;AAAA,EACA,qBAAAC;AAAA,EACA,UAAAC;AAAA,EACA,MAAAC;AAAA,EACA,UAAAC;AAAA,EACA,SAAAC;AAAA,EACA,OAAAC;AACF,MAAuD;AACrD,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAA,GACRC,IAAeH,MAAU,QACzBI,IAAyBV,KAAgB,IACzC,CAACW,GAAeC,CAAgB,IAAIC,EAASb,CAAY,GACzD,CAACc,GAAgBC,CAAiB,IAAIF;AAAA,IAAoC,MAC9EX,KAAY,CAACD,MAAwBK,KAASI,OAA4B,KACtE,QACA;AAAA,EAAA,GAEAM,IAAwBC,EAAO,EAAK,GACpCC,IAA0BD,EAAOX,KAASI,CAAsB,GAChES,IAAwBF,EAAyC,IAAI,GACrEG,IAAcH,EAAOb,CAAQ;AAEnC,EAAAgB,EAAY,UAAUhB;AAEtB,QAAMiB,IAAkBC;AAAA,IACtB,MAAMC,EAAqBlB,GAASP,CAAU;AAAA,IAC9C,CAACA,GAAYO,CAAO;AAAA,EAAA,GAEhBmB,IAAeF;AAAA,IACnB,MAAMD,EAAgB,OAAO,CAACI,MAAW,CAACA,EAAO,QA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f,EAAa;AAAA,IACbzB;AAAA,IACAE;AAAA,IACAuC;AAAA,IACA7B;AAAA,IACAF;AAAA,IACAP;AAAA,EAAA,CACD,GAEM;AAAA,IACL,WAAA+B;AAAA,IACA,UAAAM;AAAA,IACA,gBAAAS;AAAA,IACA,eAAAZ;AAAA,IACA,iBAAAf;AAAA,IACA,qBAAA0B;AAAA,IACA,WAAAD;AAAA,IACA,gBAAAR;AAAA,IACA,iBAAiBF,KAAiBlC,KAAY,CAACD,IAAsB,CAACgC,GAAW,GAAGZ,CAAe,IAAIc;AAAA,IACvG,mBAAAJ;AAAA,IACA,sBAAAmB;AAAA,IACA,mBAAAD;AAAA,EAAA;AAEJ,GAhQkC;"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
var c = Object.defineProperty;
|
|
2
|
+
var r = (e, t) => c(e, "name", { value: t, configurable: !0 });
|
|
3
|
+
const a = "__OWP_SELECTOR_ALL__", o = /* @__PURE__ */ r(() => a, "getSelectorAllToken"), i = /* @__PURE__ */ r((e) => e ? e.split(",").map((t) => t.trim()).filter(Boolean) : [], "splitSelectorValue"), u = /* @__PURE__ */ r((e) => e.map((t) => t.trim()).filter(Boolean).join(","), "joinSelectorValue"), E = /* @__PURE__ */ r((e, t) => ({
|
|
4
|
+
target: {
|
|
5
|
+
name: e ?? "",
|
|
6
|
+
value: t
|
|
7
|
+
}
|
|
8
|
+
}), "createSelectorChangeEvent"), S = /* @__PURE__ */ r((...e) => {
|
|
9
|
+
const t = /* @__PURE__ */ new Map();
|
|
10
|
+
return e.forEach((l) => {
|
|
11
|
+
l == null || l.forEach((n) => {
|
|
12
|
+
t.has(n.value) || t.set(n.value, n);
|
|
13
|
+
});
|
|
14
|
+
}), Array.from(t.values());
|
|
15
|
+
}, "mergeSelectorOptions"), _ = /* @__PURE__ */ r((e) => e.value === a, "isSelectorAllOption");
|
|
16
|
+
export {
|
|
17
|
+
E as createSelectorChangeEvent,
|
|
18
|
+
o as getSelectorAllToken,
|
|
19
|
+
_ as isSelectorAllOption,
|
|
20
|
+
u as joinSelectorValue,
|
|
21
|
+
S as mergeSelectorOptions,
|
|
22
|
+
i as splitSelectorValue
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=querySelectorUtils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"querySelectorUtils.js","sources":["../../../../src/components/OwpSelectorBase/utils/querySelectorUtils.ts"],"sourcesContent":["import type { OwpSelectorBaseChangeEvent, OwpSelectorBaseOption } from '../types';\n\nconst SELECTOR_ALL_TOKEN = '__OWP_SELECTOR_ALL__';\n\n/**\n * 전체 선택 토큰 반환\n */\nexport const getSelectorAllToken = () => {\n return SELECTOR_ALL_TOKEN;\n};\n\n/**\n * 선택 값 문자열 분리\n * @param value 원본 선택 값\n */\nexport const splitSelectorValue = (value?: string) => {\n if (!value) {\n return [];\n }\n\n return value\n .split(',')\n .map((item) => item.trim())\n .filter(Boolean);\n};\n\n/**\n * 선택 값 문자열 결합\n * @param valueList 선택 값 목록\n */\nexport const joinSelectorValue = (valueList: string[]) => {\n return valueList\n .map((item) => item.trim())\n .filter(Boolean)\n .join(',');\n};\n\n/**\n * 선택 변경 이벤트 생성\n * @param name 필드 이름\n * @param value 선택 값\n */\nexport const createSelectorChangeEvent = (name: string | undefined, value: string) => {\n return {\n target: {\n name: name ?? '',\n value,\n },\n } as OwpSelectorBaseChangeEvent;\n};\n\n/**\n * 선택 옵션 목록 병합\n * @param optionGroups 옵션 그룹 목록\n */\nexport const mergeSelectorOptions = <T = unknown>(\n ...optionGroups: Array<OwpSelectorBaseOption<T>[] | undefined>\n) => {\n const optionMap = new Map<string, OwpSelectorBaseOption<T>>();\n\n optionGroups.forEach((optionGroup) => {\n optionGroup?.forEach((option) => {\n if (!optionMap.has(option.value)) {\n optionMap.set(option.value, option);\n }\n });\n });\n\n return Array.from(optionMap.values());\n};\n\n/**\n * 선택 옵션 값 포함 여부 확인\n * @param option 선택 옵션\n */\nexport const isSelectorAllOption = (option: OwpSelectorBaseOption) => {\n return option.value === SELECTOR_ALL_TOKEN;\n};\n"],"names":["SELECTOR_ALL_TOKEN","getSelectorAllToken","__name","splitSelectorValue","value","item","joinSelectorValue","valueList","createSelectorChangeEvent","name","mergeSelectorOptions","optionGroups","optionMap","optionGroup","option","isSelectorAllOption"],"mappings":";;AAEA,MAAMA,IAAqB,wBAKdC,IAAsB,gBAAAC,EAAA,MAC1BF,GAD0B,wBAQtBG,IAAqB,gBAAAD,EAAA,CAACE,MAC5BA,IAIEA,EACJ,MAAM,GAAG,EACT,IAAI,CAACC,MAASA,EAAK,KAAA,CAAM,EACzB,OAAO,OAAO,IANR,CAAA,GAFuB,uBAerBC,IAAoB,gBAAAJ,EAAA,CAACK,MACzBA,EACJ,IAAI,CAACF,MAASA,EAAK,MAAM,EACzB,OAAO,OAAO,EACd,KAAK,GAAG,GAJoB,sBAYpBG,IAA4B,gBAAAN,EAAA,CAACO,GAA0BL,OAC3D;AAAA,EACL,QAAQ;AAAA,IACN,MAAMK,KAAQ;AAAA,IACd,OAAAL;AAAA,EAAA;AACF,IALqC,8BAa5BM,IAAuB,gBAAAR,EAAA,IAC/BS,MACA;AACH,QAAMC,wBAAgB,IAAA;AAEtB,SAAAD,EAAa,QAAQ,CAACE,MAAgB;AACpC,IAAAA,KAAA,QAAAA,EAAa,QAAQ,CAACC,MAAW;AAC/B,MAAKF,EAAU,IAAIE,EAAO,KAAK,KAC7BF,EAAU,IAAIE,EAAO,OAAOA,CAAM;AAAA,IAEtC;AAAA,EACF,CAAC,GAEM,MAAM,KAAKF,EAAU,OAAA,CAAQ;AACtC,GAdoC,yBAoBvBG,IAAsB,gBAAAb,EAAA,CAACY,MAC3BA,EAAO,UAAUd,GADS;"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
var b = Object.defineProperty;
|
|
2
|
+
var s = (t, e) => b(t, "name", { value: e, configurable: !0 });
|
|
3
|
+
import { useRef as u, useState as C, useLayoutEffect as S } from "react";
|
|
4
|
+
const y = /* @__PURE__ */ s((t) => !t || t.getClientRects().length === 0 ? 0 : t.offsetWidth, "getVisibleElementWidth"), h = /* @__PURE__ */ s((t) => {
|
|
5
|
+
if (!t || t.getClientRects().length === 0)
|
|
6
|
+
return 0;
|
|
7
|
+
const e = Array.from(t.children).filter(
|
|
8
|
+
(r) => r.getClientRects().length > 0
|
|
9
|
+
);
|
|
10
|
+
if (e.length === 0)
|
|
11
|
+
return t.offsetWidth;
|
|
12
|
+
const n = window.getComputedStyle(t), o = Number.parseFloat(n.columnGap || n.gap || "0") || 0;
|
|
13
|
+
return e.reduce((r, l) => r + l.offsetWidth, 0) + o * Math.max(e.length - 1, 0);
|
|
14
|
+
}, "getGroupContentWidth"), E = /* @__PURE__ */ s((t = []) => {
|
|
15
|
+
const e = u(null), n = u(null), o = u(null), r = u(null), [l, g] = C(!1);
|
|
16
|
+
return S(() => {
|
|
17
|
+
const c = e.current;
|
|
18
|
+
if (!c)
|
|
19
|
+
return;
|
|
20
|
+
const d = /* @__PURE__ */ s(() => {
|
|
21
|
+
const i = window.getComputedStyle(c), W = Number.parseFloat(i.columnGap || i.gap || "0") || 0, p = [
|
|
22
|
+
y(n.current),
|
|
23
|
+
h(o.current),
|
|
24
|
+
h(r.current)
|
|
25
|
+
].filter((a) => a > 0), m = p.reduce((a, R) => a + R, 0) + W * Math.max(p.length - 1, 0);
|
|
26
|
+
g(m > c.clientWidth);
|
|
27
|
+
}, "updateWrapState");
|
|
28
|
+
d();
|
|
29
|
+
const f = new ResizeObserver(() => {
|
|
30
|
+
d();
|
|
31
|
+
});
|
|
32
|
+
return [c, n.current, o.current, r.current].filter(Boolean).forEach((i) => {
|
|
33
|
+
f.observe(i);
|
|
34
|
+
}), () => {
|
|
35
|
+
f.disconnect();
|
|
36
|
+
};
|
|
37
|
+
}, [t]), {
|
|
38
|
+
containerRef: e,
|
|
39
|
+
titleRef: n,
|
|
40
|
+
slotsRef: o,
|
|
41
|
+
actionsRef: r,
|
|
42
|
+
isWrapped: l
|
|
43
|
+
};
|
|
44
|
+
}, "useHeaderWrapState");
|
|
45
|
+
export {
|
|
46
|
+
E as useHeaderWrapState
|
|
47
|
+
};
|
|
48
|
+
//# sourceMappingURL=useHeaderWrapState.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useHeaderWrapState.js","sources":["../../src/hooks/useHeaderWrapState.ts"],"sourcesContent":["import { useLayoutEffect, useRef, useState, type RefObject } from 'react';\n\ntype HeaderWrapState = {\n containerRef: RefObject<HTMLDivElement | null>;\n titleRef: RefObject<HTMLDivElement | null>;\n slotsRef: RefObject<HTMLDivElement | null>;\n actionsRef: RefObject<HTMLDivElement | null>;\n isWrapped: boolean;\n};\n\nconst getVisibleElementWidth = (element: HTMLElement | null) => {\n if (!element || element.getClientRects().length === 0) {\n return 0;\n }\n\n return element.offsetWidth;\n};\n\nconst getGroupContentWidth = (element: HTMLElement | null) => {\n if (!element || element.getClientRects().length === 0) {\n return 0;\n }\n\n const visibleChildren = Array.from(element.children).filter(\n (child) => (child as HTMLElement).getClientRects().length > 0,\n ) as HTMLElement[];\n\n if (visibleChildren.length === 0) {\n return element.offsetWidth;\n }\n\n const computedStyle = window.getComputedStyle(element);\n const gap = Number.parseFloat(computedStyle.columnGap || computedStyle.gap || '0') || 0;\n\n return (\n visibleChildren.reduce((totalWidth, child) => totalWidth + child.offsetWidth, 0) +\n gap * Math.max(visibleChildren.length - 1, 0)\n );\n};\n\n/**\n * 헤더 한 줄 배치 가능 여부 계산 훅\n * @param deps 측정 재실행 의존성\n */\nconst useHeaderWrapState = (deps: unknown[] = []): HeaderWrapState => {\n const containerRef = useRef<HTMLDivElement>(null);\n const titleRef = useRef<HTMLDivElement>(null);\n const slotsRef = useRef<HTMLDivElement>(null);\n const actionsRef = useRef<HTMLDivElement>(null);\n const [isWrapped, setIsWrapped] = useState(false);\n\n useLayoutEffect(() => {\n const containerElement = containerRef.current;\n\n if (!containerElement) {\n return undefined;\n }\n\n const updateWrapState = () => {\n const containerStyle = window.getComputedStyle(containerElement);\n const columnGap =\n Number.parseFloat(containerStyle.columnGap || containerStyle.gap || '0') || 0;\n const groupWidths = [\n getVisibleElementWidth(titleRef.current),\n getGroupContentWidth(slotsRef.current),\n getGroupContentWidth(actionsRef.current),\n ].filter((width) => width > 0);\n const requiredWidth =\n groupWidths.reduce((totalWidth, width) => totalWidth + width, 0) +\n columnGap * Math.max(groupWidths.length - 1, 0);\n\n setIsWrapped(requiredWidth > containerElement.clientWidth);\n };\n\n updateWrapState();\n\n const resizeObserver = new ResizeObserver(() => {\n updateWrapState();\n });\n\n [containerElement, titleRef.current, slotsRef.current, actionsRef.current]\n .filter(Boolean)\n .forEach((element) => {\n resizeObserver.observe(element as HTMLElement);\n });\n\n return () => {\n resizeObserver.disconnect();\n };\n }, [deps]);\n\n return {\n containerRef,\n titleRef,\n slotsRef,\n actionsRef,\n isWrapped,\n };\n};\n\nexport { useHeaderWrapState };\n"],"names":["getVisibleElementWidth","__name","element","getGroupContentWidth","visibleChildren","child","computedStyle","gap","totalWidth","useHeaderWrapState","deps","containerRef","useRef","titleRef","slotsRef","actionsRef","isWrapped","setIsWrapped","useState","useLayoutEffect","containerElement","updateWrapState","containerStyle","columnGap","groupWidths","width","requiredWidth","resizeObserver"],"mappings":";;;AAUA,MAAMA,IAAyB,gBAAAC,EAAA,CAACC,MAC1B,CAACA,KAAWA,EAAQ,eAAA,EAAiB,WAAW,IAC3C,IAGFA,EAAQ,aALc,2BAQzBC,IAAuB,gBAAAF,EAAA,CAACC,MAAgC;AAC5D,MAAI,CAACA,KAAWA,EAAQ,eAAA,EAAiB,WAAW;AAClD,WAAO;AAGT,QAAME,IAAkB,MAAM,KAAKF,EAAQ,QAAQ,EAAE;AAAA,IACnD,CAACG,MAAWA,EAAsB,eAAA,EAAiB,SAAS;AAAA,EAAA;AAG9D,MAAID,EAAgB,WAAW;AAC7B,WAAOF,EAAQ;AAGjB,QAAMI,IAAgB,OAAO,iBAAiBJ,CAA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B;AAAA,IAC/C,CAAC,GAEI,MAAM;AACX,MAAAyB,EAAe,WAAA;AAAA,IACjB;AAAA,EACF,GAAG,CAACjB,CAAI,CAAC,GAEF;AAAA,IACL,cAAAC;AAAA,IACA,UAAAE;AAAA,IACA,UAAAC;AAAA,IACA,YAAAC;AAAA,IACA,WAAAC;AAAA,EAAA;AAEJ,GAtD2B;"}
|
package/dist/hooks.js
CHANGED
|
@@ -1,33 +1,34 @@
|
|
|
1
|
-
import { useGetCommonCodeList as
|
|
1
|
+
import { useGetCommonCodeList as o, useSetCommonCodeList as t } from "./hooks/useCommonCodeList.js";
|
|
2
2
|
import { useAccessTokenGuard as u } from "./hooks/useAccessTokenGuard.js";
|
|
3
|
-
import { useAppDispatch as
|
|
3
|
+
import { useAppDispatch as m, useAppSelector as f, useAppStore as n } from "./hooks/useAppStore.js";
|
|
4
4
|
import { useConfirm as a } from "./hooks/useConfirm.js";
|
|
5
5
|
import { useGetCurrentLanguage as C, useGetLanguageList as L, useSetCurrentLanguage as g } from "./hooks/useCurrentLanguage.js";
|
|
6
|
-
import { useGetLogoSrc as
|
|
6
|
+
import { useGetLogoSrc as c, useSetLogoSrc as G } from "./hooks/useLogoSrc.js";
|
|
7
7
|
import { useGetCurrentUser as A, useSetCurrentUser as E } from "./hooks/useCurrentUser.js";
|
|
8
8
|
import { useGetCurrentUserId as h, useSetCurrentUserId as v } from "./hooks/useCurrentUserId.js";
|
|
9
9
|
import { useDebounce as I } from "./hooks/useDebounce.js";
|
|
10
10
|
import { useDeepCompareEffect as k, useDeepCompareEffectNoCheck as N, useDeepCompareMemoize as l } from "./hooks/useDeepCompareEffect.js";
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
11
|
+
import { useHeaderWrapState as M } from "./hooks/useHeaderWrapState.js";
|
|
12
|
+
import { useInitApp as b } from "./hooks/useInitApp.js";
|
|
13
|
+
import { useInitCommonCodes as y } from "./hooks/useInitCommonCodes.js";
|
|
14
|
+
import { useGetNavigationList as B, useSetNavigationList as F } from "./hooks/useNavigation.js";
|
|
15
|
+
import { useOwpTranslation as K } from "./hooks/useOwpTranslation.js";
|
|
16
|
+
import { useGetPageLockLoading as Q, usePageLockLoading as W } from "./hooks/usePageLockLoading.js";
|
|
16
17
|
import { usePrevious as q } from "./hooks/usePrevious.js";
|
|
17
|
-
import { useGetShortcuts as
|
|
18
|
-
import { getEnv as
|
|
19
|
-
import { useThemeMediaQuery as
|
|
20
|
-
import { useTimeout as
|
|
21
|
-
import { useTreeGridCommonCodeEnums as
|
|
22
|
-
import { useTreeGridEnums as
|
|
23
|
-
import { useTreeGridExcelExport as
|
|
24
|
-
import { FALLBACK_LANGUAGE_LIST as
|
|
18
|
+
import { useGetShortcuts as R, useSetShortcuts as V } from "./hooks/useShortcuts.js";
|
|
19
|
+
import { getEnv as Y, setEnv as Z, useStorage as $ } from "./hooks/useStorage.js";
|
|
20
|
+
import { useThemeMediaQuery as re } from "./hooks/useThemeMediaQuery.js";
|
|
21
|
+
import { useTimeout as te } from "./hooks/useTimeout.js";
|
|
22
|
+
import { useTreeGridCommonCodeEnums as ue } from "./hooks/useTreeGridCommonCodeEnums.js";
|
|
23
|
+
import { useTreeGridEnums as me } from "./hooks/useTreeGridEnums.js";
|
|
24
|
+
import { useTreeGridExcelExport as ne } from "./hooks/useTreeGridExcelExport.js";
|
|
25
|
+
import { FALLBACK_LANGUAGE_LIST as ae } from "./constants/language.js";
|
|
25
26
|
export {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
ae as FALLBACK_LANGUAGE_LIST,
|
|
28
|
+
Y as getEnv,
|
|
29
|
+
Z as setEnv,
|
|
29
30
|
u as useAccessTokenGuard,
|
|
30
|
-
|
|
31
|
+
m as useAppDispatch,
|
|
31
32
|
f as useAppSelector,
|
|
32
33
|
n as useAppStore,
|
|
33
34
|
a as useConfirm,
|
|
@@ -35,32 +36,33 @@ export {
|
|
|
35
36
|
k as useDeepCompareEffect,
|
|
36
37
|
N as useDeepCompareEffectNoCheck,
|
|
37
38
|
l as useDeepCompareMemoize,
|
|
38
|
-
|
|
39
|
+
o as useGetCommonCodeList,
|
|
39
40
|
C as useGetCurrentLanguage,
|
|
40
41
|
A as useGetCurrentUser,
|
|
41
42
|
h as useGetCurrentUserId,
|
|
42
43
|
L as useGetLanguageList,
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
M as
|
|
48
|
-
b as
|
|
49
|
-
|
|
50
|
-
|
|
44
|
+
c as useGetLogoSrc,
|
|
45
|
+
B as useGetNavigationList,
|
|
46
|
+
Q as useGetPageLockLoading,
|
|
47
|
+
R as useGetShortcuts,
|
|
48
|
+
M as useHeaderWrapState,
|
|
49
|
+
b as useInitApp,
|
|
50
|
+
y as useInitCommonCodes,
|
|
51
|
+
K as useOwpTranslation,
|
|
52
|
+
W as usePageLockLoading,
|
|
51
53
|
q as usePrevious,
|
|
52
54
|
t as useSetCommonCodeList,
|
|
53
55
|
g as useSetCurrentLanguage,
|
|
54
56
|
E as useSetCurrentUser,
|
|
55
57
|
v as useSetCurrentUserId,
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
58
|
+
G as useSetLogoSrc,
|
|
59
|
+
F as useSetNavigationList,
|
|
60
|
+
V as useSetShortcuts,
|
|
61
|
+
$ as useStorage,
|
|
62
|
+
re as useThemeMediaQuery,
|
|
63
|
+
te as useTimeout,
|
|
64
|
+
ue as useTreeGridCommonCodeEnums,
|
|
65
|
+
me as useTreeGridEnums,
|
|
66
|
+
ne as useTreeGridExcelExport
|
|
65
67
|
};
|
|
66
68
|
//# sourceMappingURL=hooks.js.map
|
package/dist/hooks.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hooks.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"hooks.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/index.js
CHANGED
|
@@ -2,18 +2,18 @@ import { DialogsProvider as r } from "@toolpad/core/useDialogs";
|
|
|
2
2
|
import { themeLayouts as p } from "./layout/themeLayouts.js";
|
|
3
3
|
import { createInitialOwpSettings as a, defaultSettings as f, defaultThemeOptions as x, defaultThemes as O, extendThemeWithMixins as w, generateSettings as i, getDefaultLayout as d, getDefaultThemeSettings as l, getParsedQuerySettings as n, mustHaveThemeOptions as g } from "./configs/defaultConfig.js";
|
|
4
4
|
import { OwpAutoLogoutDialog as T } from "./components/OwpAutoLogoutDialog/OwpAutoLogoutDialog.js";
|
|
5
|
-
import { OwpBarcodeInputField as
|
|
5
|
+
import { OwpBarcodeInputField as s } from "./components/OwpBarcodeInput/OwpBarcodeInputField.js";
|
|
6
6
|
import { OwpExportDataToExcelButton as C } from "./components/OwpExportExcelButton/OwpExportExcelButton.js";
|
|
7
7
|
import { OwpFileUploadButton as b } from "./components/OwpFileUploadButton/OwpFileUploadButton.js";
|
|
8
8
|
import { OwpMoreActionsButton as h } from "./components/OwpMoreActionsButton/OwpMoreActionsButton.js";
|
|
9
|
-
import { OwpPageCardedHeader as
|
|
9
|
+
import { OwpPageCardedHeader as k } from "./components/OwpPageCarded/OwpPageCardedHeader.js";
|
|
10
10
|
import { OwpPageCardedSidebar as L } from "./components/OwpPageCarded/OwpPageCardedSidebar.js";
|
|
11
11
|
import { OwpPageCardedSidebarContent as G } from "./components/OwpPageCarded/OwpPageCardedSidebarContent.js";
|
|
12
12
|
import { OwpDatePicker as v } from "./components/OwpPicker/OwpDatePicker.js";
|
|
13
13
|
import { OwpDateRangePicker as I } from "./components/OwpPicker/OwpDateRangePicker.js";
|
|
14
14
|
import { OwpTimePicker as A } from "./components/OwpPicker/OwpTimePicker.js";
|
|
15
15
|
import { OwpWeekDatePicker as N } from "./components/OwpPicker/OwpWeekDatePicker.js";
|
|
16
|
-
import { OwpYearRangePicker as
|
|
16
|
+
import { OwpYearRangePicker as W } from "./components/OwpPicker/OwpYearRangePicker.js";
|
|
17
17
|
import { OwpDataTable as U } from "./components/OwpTable/OwpDataTable.js";
|
|
18
18
|
import { OwpTable as Z, OwpTableTotalCount as j, StyledTable as q, StyledTableRow as z } from "./components/OwpTable/OwpTable.js";
|
|
19
19
|
import { OwpVerticalTable as K } from "./components/OwpTable/OwpVerticalTable.js";
|
|
@@ -26,37 +26,38 @@ import { OwpEventEmitter as xe } from "./components/OwpEventEmitter/OwpEventEmit
|
|
|
26
26
|
import { OwpLanguageSwitcherSelect as we } from "./components/OwpLanguageSwitcherSelect/OwpLanguageSwitcherSelect.js";
|
|
27
27
|
import { OwpCommonDialog as de, OwpDialog as le } from "./components/OwpDialog/OwpDialog.js";
|
|
28
28
|
import { CommonCodeSelector as ge, OwpCommonCodeSelector as ue } from "./components/OwpCommonCode/OwpCommonCodeSelector.js";
|
|
29
|
-
import { CommonCodeRadioGroup as
|
|
29
|
+
import { CommonCodeRadioGroup as ce, OwpCommonCodeRadioGroup as se } from "./components/OwpCommonCode/OwpCommonCodeRadioGroup.js";
|
|
30
30
|
import { OwpErrorStatusPage as Ce } from "./components/OwpErrorStatusPage/OwpErrorStatusPage.js";
|
|
31
31
|
import { OwpLayout as be } from "./components/OwpLayout/OwpLayout.js";
|
|
32
32
|
import { OwpLoading as he } from "./components/OwpLoading/OwpLoading.js";
|
|
33
|
-
import { OwpMrtTable as
|
|
33
|
+
import { OwpMrtTable as ke } from "./components/OwpMrtTable/OwpMrtTable.js";
|
|
34
34
|
import { OwpNumberField as Le } from "./components/OwpNumberField/OwpNumberField.js";
|
|
35
35
|
import { OwpOptionSelector as Ge } from "./components/OwpOptionSelector/OwpOptionSelector.js";
|
|
36
36
|
import { OwpPageCarded as ve } from "./components/OwpPageCarded/OwpPageCarded.js";
|
|
37
37
|
import { OwpPageContent as Ie } from "./components/OwpPageContent/OwpPageContent.js";
|
|
38
38
|
import { OwpPageLockLoading as Ae } from "./components/OwpPageLockLoading/OwpPageLockLoading.js";
|
|
39
39
|
import { OwpPageTitle as Ne } from "./components/OwpPageTitle/OwpPageTitle.js";
|
|
40
|
-
import {
|
|
41
|
-
import {
|
|
42
|
-
import {
|
|
43
|
-
import {
|
|
44
|
-
import {
|
|
45
|
-
import {
|
|
46
|
-
import {
|
|
47
|
-
import {
|
|
48
|
-
import {
|
|
49
|
-
import {
|
|
50
|
-
import {
|
|
51
|
-
import {
|
|
52
|
-
import {
|
|
40
|
+
import { OwpQuerySelector as We } from "./components/OwpQuerySelector/OwpQuerySelector.js";
|
|
41
|
+
import { OwpScrollbars as Ue } from "./components/OwpScrollbars/OwpScrollbars.js";
|
|
42
|
+
import { OwpSearchFilter as Ze } from "./components/OwpSearchFilter/OwpSearchFilter.js";
|
|
43
|
+
import { OwpSection as qe } from "./components/OwpSection/OwpSection.js";
|
|
44
|
+
import { OwpStyleProvider as Je } from "./components/OwpStyleProvider/OwpStyleProvider.js";
|
|
45
|
+
import { OwpSuspense as Xe } from "./components/OwpSuspense/OwpSuspense.js";
|
|
46
|
+
import { OwpSvgIcon as $e } from "./components/OwpSvgIcon/OwpSvgIcon.js";
|
|
47
|
+
import { OwpTab as oo } from "./components/OwpTabs/OwpTab.js";
|
|
48
|
+
import { OwpTabs as to } from "./components/OwpTabs/OwpTabs.js";
|
|
49
|
+
import { OwpTreeGridExcelButton as mo } from "./components/OwpTreeGridExcelButton/OwpTreeGridExcelButton.js";
|
|
50
|
+
import { OwpTreeGridResetChangesButton as fo } from "./components/OwpTreeGridResetChangesButton/OwpTreeGridResetChangesButton.js";
|
|
51
|
+
import { OwpTreeGrid as Oo } from "./components/OwpTreeGrid/OwpTreeGrid.js";
|
|
52
|
+
import { TreeGrid as io } from "./components/OwpTreeGrid/TreeGrid.js";
|
|
53
|
+
import { OwpYesNoSelector as no } from "./components/OwpYesNoSelector/OwpYesNoSelector.js";
|
|
53
54
|
export {
|
|
54
|
-
|
|
55
|
+
ce as CommonCodeRadioGroup,
|
|
55
56
|
ge as CommonCodeSelector,
|
|
56
57
|
r as DialogsProvider,
|
|
57
58
|
T as OwpAutoLogoutDialog,
|
|
58
|
-
|
|
59
|
-
|
|
59
|
+
s as OwpBarcodeInputField,
|
|
60
|
+
se as OwpCommonCodeRadioGroup,
|
|
60
61
|
ue as OwpCommonCodeSelector,
|
|
61
62
|
de as OwpCommonDialog,
|
|
62
63
|
U as OwpDataTable,
|
|
@@ -72,41 +73,42 @@ export {
|
|
|
72
73
|
be as OwpLayout,
|
|
73
74
|
he as OwpLoading,
|
|
74
75
|
h as OwpMoreActionsButton,
|
|
75
|
-
|
|
76
|
+
ke as OwpMrtTable,
|
|
76
77
|
Le as OwpNumberField,
|
|
77
78
|
Ge as OwpOptionSelector,
|
|
78
79
|
pe as OwpPageBreadcrumb,
|
|
79
80
|
ve as OwpPageCarded,
|
|
80
|
-
|
|
81
|
+
k as OwpPageCardedHeader,
|
|
81
82
|
L as OwpPageCardedSidebar,
|
|
82
83
|
G as OwpPageCardedSidebarContent,
|
|
83
84
|
Ie as OwpPageContent,
|
|
84
85
|
Ae as OwpPageLockLoading,
|
|
85
86
|
Ne as OwpPageTitle,
|
|
86
|
-
|
|
87
|
-
Ue as
|
|
88
|
-
Ze as
|
|
89
|
-
qe as
|
|
90
|
-
Je as
|
|
91
|
-
Xe as
|
|
92
|
-
$e as
|
|
87
|
+
We as OwpQuerySelector,
|
|
88
|
+
Ue as OwpScrollbars,
|
|
89
|
+
Ze as OwpSearchFilter,
|
|
90
|
+
qe as OwpSection,
|
|
91
|
+
Je as OwpStyleProvider,
|
|
92
|
+
Xe as OwpSuspense,
|
|
93
|
+
$e as OwpSvgIcon,
|
|
94
|
+
oo as OwpTab,
|
|
93
95
|
Z as OwpTable,
|
|
94
96
|
j as OwpTableTotalCount,
|
|
95
|
-
|
|
97
|
+
to as OwpTabs,
|
|
96
98
|
_ as OwpTextMaskField,
|
|
97
99
|
A as OwpTimePicker,
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
100
|
+
Oo as OwpTreeGrid,
|
|
101
|
+
mo as OwpTreeGridExcelButton,
|
|
102
|
+
fo as OwpTreeGridResetChangesButton,
|
|
101
103
|
ee as OwpTreeGridToolbar,
|
|
102
104
|
K as OwpVerticalTable,
|
|
103
105
|
N as OwpWeekDatePicker,
|
|
104
|
-
|
|
105
|
-
|
|
106
|
+
W as OwpYearRangePicker,
|
|
107
|
+
no as OwpYesNoSelector,
|
|
106
108
|
re as OwpZoomImageSlider,
|
|
107
109
|
q as StyledTable,
|
|
108
110
|
z as StyledTableRow,
|
|
109
|
-
|
|
111
|
+
io as TreeGrid,
|
|
110
112
|
a as createInitialOwpSettings,
|
|
111
113
|
f as defaultSettings,
|
|
112
114
|
x as defaultThemeOptions,
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,21 +1,22 @@
|
|
|
1
|
-
var
|
|
2
|
-
var a = (
|
|
3
|
-
import { jsx as
|
|
4
|
-
import
|
|
5
|
-
import { styled as
|
|
6
|
-
import { clsx as
|
|
1
|
+
var u = Object.defineProperty;
|
|
2
|
+
var a = (e, t) => u(e, "name", { value: t, configurable: !0 });
|
|
3
|
+
import { jsx as d } 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 h from "@mui/material/List";
|
|
5
|
+
import { styled as w } from "@mui/material/styles";
|
|
6
|
+
import { clsx as f } from "../../../../node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.js";
|
|
7
|
+
import { useRef as v, useEffect as b } from "react";
|
|
7
8
|
import { NavItem as y } from "../NavItem.js";
|
|
8
|
-
const
|
|
9
|
+
const S = w(h)(({ theme: e }) => ({
|
|
9
10
|
"& .owp-list-item": {
|
|
10
11
|
"&:hover": {
|
|
11
12
|
backgroundColor: "rgba(0,0,0,.04)",
|
|
12
|
-
...
|
|
13
|
+
...e.applyStyles("dark", {
|
|
13
14
|
backgroundColor: "rgba(255, 255, 255, 0.05)"
|
|
14
15
|
})
|
|
15
16
|
},
|
|
16
17
|
"&:focus:not(.active)": {
|
|
17
18
|
backgroundColor: "rgba(0,0,0,.05)",
|
|
18
|
-
...
|
|
19
|
+
...e.applyStyles("dark", {
|
|
19
20
|
backgroundColor: "rgba(255, 255, 255, 0.06)"
|
|
20
21
|
})
|
|
21
22
|
}
|
|
@@ -39,32 +40,67 @@ const b = v(g)(({ theme: t }) => ({
|
|
|
39
40
|
height: 32
|
|
40
41
|
}
|
|
41
42
|
}
|
|
42
|
-
}))
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
43
|
+
})), x = '.owp-list-item[aria-current="page"], .owp-list-item.active', g = 40, C = 0.35, I = /* @__PURE__ */ a((e) => {
|
|
44
|
+
const t = e.parentElement;
|
|
45
|
+
if (t && t.scrollHeight > t.clientHeight)
|
|
46
|
+
return t;
|
|
47
|
+
let o = t == null ? void 0 : t.parentElement;
|
|
48
|
+
for (; o; ) {
|
|
49
|
+
if (o.scrollHeight > o.clientHeight)
|
|
50
|
+
return o;
|
|
51
|
+
o = o.parentElement;
|
|
47
52
|
}
|
|
48
|
-
return
|
|
49
|
-
|
|
53
|
+
return null;
|
|
54
|
+
}, "getNavigationScrollContainer"), k = /* @__PURE__ */ a((e) => {
|
|
55
|
+
const t = e.querySelectorAll(x), o = t.item(t.length - 1);
|
|
56
|
+
if (!o)
|
|
57
|
+
return;
|
|
58
|
+
const i = I(e);
|
|
59
|
+
if (!i)
|
|
60
|
+
return;
|
|
61
|
+
const l = i.getBoundingClientRect(), n = o.getBoundingClientRect(), p = n.top < l.top + g, s = n.bottom > l.bottom - g;
|
|
62
|
+
if (p || s) {
|
|
63
|
+
const c = i.scrollTop + (n.top - l.top) - i.clientHeight * C + n.height / 2, m = i.scrollHeight - i.clientHeight;
|
|
64
|
+
i.scrollTo({
|
|
65
|
+
top: Math.min(Math.max(c, 0), m),
|
|
66
|
+
behavior: "smooth"
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
}, "scrollSelectedItemIntoView");
|
|
70
|
+
function L(e) {
|
|
71
|
+
const { navigation: t, active: o, dense: i, className: l, onItemClick: n, checkPermission: p, openedCollapseIds: s } = e, c = v(null);
|
|
72
|
+
b(() => {
|
|
73
|
+
const r = window.requestAnimationFrame(() => {
|
|
74
|
+
c.current && k(c.current);
|
|
75
|
+
});
|
|
76
|
+
return () => {
|
|
77
|
+
window.cancelAnimationFrame(r);
|
|
78
|
+
};
|
|
79
|
+
}, [s]);
|
|
80
|
+
function m(r) {
|
|
81
|
+
n == null || n(r);
|
|
82
|
+
}
|
|
83
|
+
return a(m, "handleItemClick"), /* @__PURE__ */ d(
|
|
84
|
+
S,
|
|
50
85
|
{
|
|
51
|
-
|
|
86
|
+
ref: c,
|
|
87
|
+
className: f(
|
|
52
88
|
"navigation whitespace-nowrap px-12 py-0",
|
|
53
|
-
`active-${
|
|
54
|
-
|
|
55
|
-
|
|
89
|
+
`active-${o}-list`,
|
|
90
|
+
i && "dense",
|
|
91
|
+
l
|
|
56
92
|
),
|
|
57
|
-
children:
|
|
93
|
+
children: t.map((r) => /* @__PURE__ */ d(
|
|
58
94
|
y,
|
|
59
95
|
{
|
|
60
|
-
type: `vertical-${
|
|
61
|
-
item:
|
|
96
|
+
type: `vertical-${r.type}`,
|
|
97
|
+
item: r,
|
|
62
98
|
nestedLevel: 0,
|
|
63
|
-
onItemClick:
|
|
64
|
-
checkPermission:
|
|
65
|
-
openedCollapseIds:
|
|
99
|
+
onItemClick: m,
|
|
100
|
+
checkPermission: p,
|
|
101
|
+
openedCollapseIds: s
|
|
66
102
|
},
|
|
67
|
-
|
|
103
|
+
r.id
|
|
68
104
|
))
|
|
69
105
|
}
|
|
70
106
|
);
|