@sonamu-kit/react-components 0.4.0 → 0.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/contexts/types.d.ts
CHANGED
|
@@ -1,13 +1,19 @@
|
|
|
1
1
|
|
|
2
2
|
/**
|
|
3
3
|
* ⚠️ 이 타입은 sonamu/types.ts와 동기화되어야 함
|
|
4
|
+
*
|
|
5
|
+
* 프로젝트별 도메인 필드를 추가하려면 `SonamuFileExtend`를 확장합니다.
|
|
6
|
+
* (`declare module "@sonamu-kit/react-components"`)
|
|
4
7
|
*/
|
|
5
|
-
export
|
|
8
|
+
export interface SonamuFileExtend {
|
|
9
|
+
}
|
|
10
|
+
export type SonamuFileBase = {
|
|
6
11
|
name: string;
|
|
7
12
|
url: string;
|
|
8
13
|
mime_type: string;
|
|
9
14
|
size: number;
|
|
10
15
|
};
|
|
16
|
+
export type SonamuFile = SonamuFileBase & SonamuFileExtend;
|
|
11
17
|
export type Dictionary = Record<string, string | ((...args: any[]) => string)>;
|
|
12
18
|
/**
|
|
13
19
|
* SD 반환 타입 - 제네릭으로 키에 따라 정확한 타입 반환
|
|
@@ -626,7 +626,7 @@ var jt = e.forwardRef(({ orientation: t = "horizontal", opts: n, setApi: r, plug
|
|
|
626
626
|
!u || !r || r(u);
|
|
627
627
|
}, [u, r]), e.useEffect(() => {
|
|
628
628
|
if (u) return g(u), u.on("reInit", g), u.on("select", g), () => {
|
|
629
|
-
u?.off("select", g);
|
|
629
|
+
u?.off("reInit", g), u?.off("select", g);
|
|
630
630
|
};
|
|
631
631
|
}, [u, g]), /* @__PURE__ */ f(kt.Provider, {
|
|
632
632
|
value: {
|
|
@@ -2204,7 +2204,13 @@ function oi({ props: e, isMultiple: t, isAsync: n, isPopoverOpen: i, setIsPopove
|
|
|
2204
2204
|
variant: "outline",
|
|
2205
2205
|
className: "m-1 transition-all duration-300 ease-in-out",
|
|
2206
2206
|
children: [h(e), /* @__PURE__ */ f(Vt, {
|
|
2207
|
-
className: "ml-2 h-3 w-3 cursor-pointer",
|
|
2207
|
+
className: "ml-2 h-3 w-3 cursor-pointer !pointer-events-auto",
|
|
2208
|
+
onPointerDownCapture: (e) => {
|
|
2209
|
+
e.stopPropagation();
|
|
2210
|
+
},
|
|
2211
|
+
onMouseDownCapture: (e) => {
|
|
2212
|
+
e.stopPropagation();
|
|
2213
|
+
},
|
|
2208
2214
|
onClick: (t) => {
|
|
2209
2215
|
t.stopPropagation(), k(e);
|
|
2210
2216
|
}
|
|
@@ -2234,6 +2240,12 @@ function oi({ props: e, isMultiple: t, isAsync: n, isPopoverOpen: i, setIsPopove
|
|
|
2234
2240
|
e.clearable && /* @__PURE__ */ f("div", {
|
|
2235
2241
|
role: "button",
|
|
2236
2242
|
tabIndex: 0,
|
|
2243
|
+
onPointerDownCapture: (e) => {
|
|
2244
|
+
e.stopPropagation();
|
|
2245
|
+
},
|
|
2246
|
+
onMouseDownCapture: (e) => {
|
|
2247
|
+
e.stopPropagation();
|
|
2248
|
+
},
|
|
2237
2249
|
onClick: (e) => {
|
|
2238
2250
|
e.stopPropagation(), j();
|
|
2239
2251
|
},
|
|
@@ -2871,14 +2883,14 @@ function Mi({ config: e, subset: t, baseListParams: n, displayField: i, valueFie
|
|
|
2871
2883
|
"num",
|
|
2872
2884
|
"page",
|
|
2873
2885
|
"keyword"
|
|
2874
|
-
]), A = n
|
|
2886
|
+
]), A = n && Object.entries(n).some(([e, t]) => !k.has(e) && O(t)), j = g || A, M = {
|
|
2875
2887
|
...n,
|
|
2876
2888
|
...T ? { keyword: T } : {}
|
|
2877
2889
|
}, N = j || typeof T == "string" && T.length > 0 || h && Array.isArray(v) && v.length > 0, P = e.useListInfinite(t, M, { enabled: N }), F = P.data?.rows ?? [], ee = P.isLoading, te = P.error ?? void 0, I = !h && O(v) ? v : null, ne = s(() => F.find((e) => e[o] === I), [
|
|
2878
2890
|
F,
|
|
2879
2891
|
I,
|
|
2880
2892
|
o
|
|
2881
|
-
]), re = I
|
|
2893
|
+
]), re = I !== null && !ne, ie = e.useList(t, {
|
|
2882
2894
|
id: I,
|
|
2883
2895
|
num: 1,
|
|
2884
2896
|
page: 1
|
|
@@ -2921,7 +2933,7 @@ function Mi({ config: e, subset: t, baseListParams: n, displayField: i, valueFie
|
|
|
2921
2933
|
P.hasNextPage && !P.isFetchingNextPage && P.fetchNextPage();
|
|
2922
2934
|
}, [P]), { items: me, rowMap: H } = s(() => {
|
|
2923
2935
|
let e = /* @__PURE__ */ new Map(), t = /* @__PURE__ */ new Map();
|
|
2924
|
-
if (!h && L && I
|
|
2936
|
+
if (!h && L && I !== null && (e.set(I, L), t.set(I, {
|
|
2925
2937
|
value: I,
|
|
2926
2938
|
label: w(L)
|
|
2927
2939
|
})), h && B.length > 0) for (let n of B) {
|