@ogcio/design-system-react 1.16.0 → 1.17.1
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/accordion/accordion-item.js +0 -1
- package/dist/alert/alert.d.ts +2 -1
- package/dist/alert/alert.js +32 -31
- package/dist/autocomplete/use-autocomplete-controller.js +55 -54
- package/dist/breadcrumbs/breadcrumbs.js +29 -23
- package/dist/card/card-next.js +1 -1
- package/dist/data-table/data-table-footer.d.ts +12 -0
- package/dist/data-table/data-table-footer.js +66 -0
- package/dist/data-table/data-table-header.d.ts +28 -0
- package/dist/data-table/data-table-header.js +157 -0
- package/dist/data-table/data-table-selected-rows.d.ts +6 -0
- package/dist/data-table/data-table-selected-rows.js +23 -0
- package/dist/{data-grid → data-table}/tanstack/tanstack-helpers.d.ts +1 -0
- package/dist/{data-grid → data-table}/tanstack/tanstack-helpers.js +27 -25
- package/dist/drawer/drawer.js +19 -12
- package/dist/forms/form-field/form-field.js +18 -18
- package/dist/header/components/header-menu.js +26 -27
- package/dist/icon-button/icon-button.js +18 -16
- package/dist/index.d.ts +4 -4
- package/dist/index.js +43 -43
- package/dist/input-radio/input-radio.js +31 -31
- package/dist/modal/modal.d.ts +2 -1
- package/dist/modal/modal.js +162 -149
- package/dist/popover/popover.js +10 -1
- package/dist/select/select-menu.js +27 -27
- package/dist/styles.css +1 -1
- package/dist/table/table-pagination.js +2 -2
- package/dist/utils/utilities.d.ts +2 -0
- package/dist/utils/utilities.js +26 -15
- package/package.json +4 -4
- package/dist/data-grid/data-grid-footer.d.ts +0 -12
- package/dist/data-grid/data-grid-footer.js +0 -66
- package/dist/data-grid/data-grid-header.d.ts +0 -12
- package/dist/data-grid/data-grid-header.js +0 -82
- /package/dist/{data-grid → data-table}/editable-table-cell.d.ts +0 -0
- /package/dist/{data-grid → data-table}/editable-table-cell.js +0 -0
- /package/dist/{data-grid → data-table}/types.d.ts +0 -0
- /package/dist/{data-grid → data-table}/types.js +0 -0
package/dist/alert/alert.d.ts
CHANGED
|
@@ -82,8 +82,9 @@ type AlertProps = {
|
|
|
82
82
|
children?: ReactNode;
|
|
83
83
|
dismissible?: boolean;
|
|
84
84
|
dataTestid?: string;
|
|
85
|
+
className?: string;
|
|
85
86
|
onClose?: (event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
86
87
|
};
|
|
87
|
-
declare function Alert({ title, children, variant, dismissible, onClose, dataTestid, }: AlertProps): import("react/jsx-runtime").JSX.Element | null;
|
|
88
|
+
declare function Alert({ title, children, variant, dismissible, onClose, dataTestid, className, }: AlertProps): import("react/jsx-runtime").JSX.Element | null;
|
|
88
89
|
export { Alert, alertVariants };
|
|
89
90
|
export type { AlertProps };
|
package/dist/alert/alert.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsxs as n, jsx as r } from "react/jsx-runtime";
|
|
3
|
-
import { useState as
|
|
4
|
-
import { c as
|
|
5
|
-
import { cn as
|
|
6
|
-
import { translate as
|
|
7
|
-
import { Icon as
|
|
8
|
-
import { IconButton as
|
|
9
|
-
const
|
|
3
|
+
import { useState as h } from "react";
|
|
4
|
+
import { c as v } from "../index-CB-zPpNk.js";
|
|
5
|
+
import { cn as k } from "../cn.js";
|
|
6
|
+
import { translate as w } from "../i18n/utility.js";
|
|
7
|
+
import { Icon as N } from "../icon/icon.js";
|
|
8
|
+
import { IconButton as V } from "../icon-button/icon-button.js";
|
|
9
|
+
const x = v({
|
|
10
10
|
slots: {
|
|
11
11
|
base: "gi-alert-base",
|
|
12
12
|
baseDismissible: "gi-alert-base-dismissible",
|
|
@@ -30,16 +30,16 @@ const V = h({
|
|
|
30
30
|
},
|
|
31
31
|
warning: {
|
|
32
32
|
base: "gi-alert-warning",
|
|
33
|
-
baseDismissible: "gi-alert-
|
|
33
|
+
baseDismissible: "gi-alert-warning"
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
36
|
},
|
|
37
37
|
defaultVariants: {
|
|
38
38
|
variant: "info"
|
|
39
39
|
}
|
|
40
|
-
}),
|
|
40
|
+
}), I = ({ variant: i }) => {
|
|
41
41
|
let s;
|
|
42
|
-
switch (
|
|
42
|
+
switch (i) {
|
|
43
43
|
case "warning": {
|
|
44
44
|
s = "warning";
|
|
45
45
|
break;
|
|
@@ -57,50 +57,51 @@ const V = h({
|
|
|
57
57
|
}
|
|
58
58
|
return s;
|
|
59
59
|
};
|
|
60
|
-
function
|
|
61
|
-
title:
|
|
60
|
+
function q({
|
|
61
|
+
title: i,
|
|
62
62
|
children: s,
|
|
63
|
-
variant:
|
|
63
|
+
variant: a = "info",
|
|
64
64
|
dismissible: t,
|
|
65
|
-
onClose:
|
|
66
|
-
dataTestid: l
|
|
65
|
+
onClose: e,
|
|
66
|
+
dataTestid: l,
|
|
67
|
+
className: c
|
|
67
68
|
}) {
|
|
68
|
-
const [
|
|
69
|
-
variant:
|
|
70
|
-
}),
|
|
71
|
-
return
|
|
69
|
+
const [o, m] = h(!1), { base: d, heading: g, container: b, dismiss: f, baseDismissible: u } = x({
|
|
70
|
+
variant: a
|
|
71
|
+
}), p = t ? u : d;
|
|
72
|
+
return o ? null : /* @__PURE__ */ n(
|
|
72
73
|
"div",
|
|
73
74
|
{
|
|
74
|
-
className:
|
|
75
|
+
className: k(p(), c, "gi-not-prose"),
|
|
75
76
|
"data-testid": l,
|
|
76
77
|
role: "alert",
|
|
77
78
|
"aria-live": "assertive",
|
|
78
79
|
children: [
|
|
79
80
|
/* @__PURE__ */ r(
|
|
80
|
-
|
|
81
|
+
N,
|
|
81
82
|
{
|
|
82
|
-
icon:
|
|
83
|
+
icon: I({ variant: a }),
|
|
83
84
|
ariaHidden: !0,
|
|
84
85
|
className: "gi-alert-icon",
|
|
85
|
-
"data-variant":
|
|
86
|
+
"data-variant": a
|
|
86
87
|
}
|
|
87
88
|
),
|
|
88
89
|
/* @__PURE__ */ n("div", { className: b(), children: [
|
|
89
|
-
/* @__PURE__ */ r("p", { className:
|
|
90
|
+
/* @__PURE__ */ r("p", { className: g(), children: i }),
|
|
90
91
|
s
|
|
91
92
|
] }),
|
|
92
93
|
t && /* @__PURE__ */ r(
|
|
93
|
-
|
|
94
|
+
V,
|
|
94
95
|
{
|
|
95
|
-
onClick: (
|
|
96
|
-
|
|
96
|
+
onClick: (D) => {
|
|
97
|
+
m(!0), e == null || e(D);
|
|
97
98
|
},
|
|
98
|
-
className:
|
|
99
|
+
className: f(),
|
|
99
100
|
size: "small",
|
|
100
101
|
appearance: "dark",
|
|
101
102
|
variant: "flat",
|
|
102
103
|
icon: { icon: "close" },
|
|
103
|
-
"aria-label":
|
|
104
|
+
"aria-label": w("alert.dismissAlert", {
|
|
104
105
|
defaultValue: "Dismiss alert"
|
|
105
106
|
})
|
|
106
107
|
}
|
|
@@ -110,6 +111,6 @@ function _({
|
|
|
110
111
|
);
|
|
111
112
|
}
|
|
112
113
|
export {
|
|
113
|
-
|
|
114
|
-
|
|
114
|
+
q as Alert,
|
|
115
|
+
x as alertVariants
|
|
115
116
|
};
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { l as F } from "../lodash-D1c5hFAM.js";
|
|
2
|
-
import { useRef as g, useMemo as G, Children as
|
|
3
|
-
import { useScrollHighlightedItem as
|
|
2
|
+
import { useRef as g, useMemo as G, Children as C, useReducer as X, useEffect as A, isValidElement as h } from "react";
|
|
3
|
+
import { useScrollHighlightedItem as Y } from "../hooks/use-scroll-highlighted-item.js";
|
|
4
|
+
import { safeCloneElement as j } from "../utils/utilities.js";
|
|
4
5
|
import { AUTOCOMPLETE_ACTIONS as k } from "./types.js";
|
|
5
6
|
const {
|
|
6
|
-
ON_RESET:
|
|
7
|
+
ON_RESET: x,
|
|
7
8
|
ON_SELECT_ITEM: q,
|
|
8
9
|
SET_INPUT_VALUE: P,
|
|
9
10
|
SET_IS_OPEN: v,
|
|
10
|
-
SET_OPTIONS:
|
|
11
|
+
SET_OPTIONS: E,
|
|
11
12
|
TOGGLE_CLEAR_BUTTON: U,
|
|
12
13
|
SET_VALUE: w,
|
|
13
14
|
SET_HIGHLIGHTED_INDEX: S,
|
|
@@ -18,7 +19,7 @@ const {
|
|
|
18
19
|
return { ...e, isOpen: t.payload };
|
|
19
20
|
case P:
|
|
20
21
|
return { ...e, inputValue: t.payload };
|
|
21
|
-
case
|
|
22
|
+
case E:
|
|
22
23
|
return {
|
|
23
24
|
...e,
|
|
24
25
|
autocompleteOptions: t.payload || []
|
|
@@ -30,7 +31,7 @@ const {
|
|
|
30
31
|
...e,
|
|
31
32
|
isClearButtonEnabled: t.payload || !!e.inputValue
|
|
32
33
|
};
|
|
33
|
-
case
|
|
34
|
+
case x:
|
|
34
35
|
return {
|
|
35
36
|
...e,
|
|
36
37
|
value: "",
|
|
@@ -55,26 +56,26 @@ const {
|
|
|
55
56
|
}
|
|
56
57
|
}, J = (e) => {
|
|
57
58
|
var n, p;
|
|
58
|
-
const t = ((n = e == null ? void 0 : e.type) == null ? void 0 : n.componentType) || ((p = e == null ? void 0 : e.props) == null ? void 0 : p.
|
|
59
|
-
return
|
|
60
|
-
},
|
|
59
|
+
const t = ((n = e == null ? void 0 : e.type) == null ? void 0 : n.componentType) || ((p = e == null ? void 0 : e.props) == null ? void 0 : p.__type);
|
|
60
|
+
return h(e) && (t === "AutocompleteItem" || t === "AutocompleteGroupItem");
|
|
61
|
+
}, B = (e, t) => {
|
|
61
62
|
var s, a;
|
|
62
63
|
const n = ((s = e.props.children) == null ? void 0 : s.toString().toLowerCase()) || "", p = (a = e.props.value) == null ? void 0 : a.toLowerCase(), l = t.toLowerCase();
|
|
63
64
|
return n.includes(l) || p.includes(l);
|
|
64
|
-
}, V = (e) =>
|
|
65
|
-
var p, l, s, a,
|
|
65
|
+
}, V = (e) => C.toArray(e).filter((t) => J(t)) || [], R = (e, t) => {
|
|
66
|
+
var p, l, s, a, I, f;
|
|
66
67
|
const n = V(e);
|
|
67
|
-
for (const
|
|
68
|
-
const
|
|
69
|
-
if (((s =
|
|
70
|
-
return ((a =
|
|
71
|
-
if (
|
|
72
|
-
const u =
|
|
73
|
-
(
|
|
68
|
+
for (const y of n) {
|
|
69
|
+
const T = ((p = y.type) == null ? void 0 : p.componentType) || ((l = y.props) == null ? void 0 : l.__type);
|
|
70
|
+
if (((s = y.props) == null ? void 0 : s.value) === t)
|
|
71
|
+
return ((a = y.props.children) == null ? void 0 : a.toString()) || "";
|
|
72
|
+
if (T === "AutocompleteGroupItem") {
|
|
73
|
+
const u = C.toArray(y.props.children).filter(
|
|
74
|
+
(c) => h(c)
|
|
74
75
|
);
|
|
75
|
-
for (const
|
|
76
|
-
if (((
|
|
77
|
-
return ((
|
|
76
|
+
for (const c of u)
|
|
77
|
+
if (((I = c.props) == null ? void 0 : I.value) === t)
|
|
78
|
+
return ((f = c.props.children) == null ? void 0 : f.toString()) || "";
|
|
78
79
|
}
|
|
79
80
|
}
|
|
80
81
|
return "";
|
|
@@ -83,10 +84,10 @@ const {
|
|
|
83
84
|
return t != null && t.length && t.every(
|
|
84
85
|
(p) => {
|
|
85
86
|
var l;
|
|
86
|
-
return p.props.
|
|
87
|
+
return p.props.__type === "AutocompleteGroupItem" || ((l = p.type) == null ? void 0 : l.componentType) === "AutocompleteGroupItem";
|
|
87
88
|
}
|
|
88
89
|
) ? "AutocompleteGroupItem" : "AutocompleteItem";
|
|
89
|
-
},
|
|
90
|
+
}, pe = ({
|
|
90
91
|
children: e,
|
|
91
92
|
defaultValue: t = "",
|
|
92
93
|
isOpen: n = !1,
|
|
@@ -94,43 +95,43 @@ const {
|
|
|
94
95
|
onOpen: l,
|
|
95
96
|
onClose: s,
|
|
96
97
|
onChange: a,
|
|
97
|
-
value:
|
|
98
|
+
value: I
|
|
98
99
|
}) => {
|
|
99
|
-
const
|
|
100
|
+
const f = g(null), y = g(null), T = g(!1), u = G(
|
|
100
101
|
() => V(e || []),
|
|
101
102
|
[e]
|
|
102
|
-
),
|
|
103
|
+
), c = () => {
|
|
103
104
|
var i;
|
|
104
|
-
return (i =
|
|
105
|
-
},
|
|
105
|
+
return (i = f.current) == null ? void 0 : i.focus();
|
|
106
|
+
}, d = G(() => K(e), [e]), [r, o] = X(z, null, () => ({
|
|
106
107
|
isOpen: !!n,
|
|
107
|
-
value:
|
|
108
|
+
value: I,
|
|
108
109
|
inputValue: t,
|
|
109
110
|
autocompleteOptions: u,
|
|
110
111
|
isClearButtonEnabled: !1,
|
|
111
112
|
highlightedIndex: -1,
|
|
112
|
-
optionType:
|
|
113
|
+
optionType: d
|
|
113
114
|
}));
|
|
114
|
-
|
|
115
|
-
o({ type:
|
|
115
|
+
Y(y, r.highlightedIndex), A(() => {
|
|
116
|
+
o({ type: E, payload: u });
|
|
116
117
|
}, [u]), A(() => {
|
|
117
|
-
o({ type: H, payload:
|
|
118
|
-
}, [
|
|
119
|
-
if (!
|
|
120
|
-
|
|
118
|
+
o({ type: H, payload: d });
|
|
119
|
+
}, [d]), A(() => {
|
|
120
|
+
if (!T.current) {
|
|
121
|
+
T.current = !0;
|
|
121
122
|
return;
|
|
122
123
|
}
|
|
123
|
-
r.inputValue === "" && r.value === "" &&
|
|
124
|
+
r.inputValue === "" && r.value === "" && c();
|
|
124
125
|
}, [r.isClearButtonEnabled]), A(() => {
|
|
125
126
|
if (r.isOpen)
|
|
126
|
-
l == null || l(),
|
|
127
|
+
l == null || l(), c(), o({ type: E, payload: u });
|
|
127
128
|
else {
|
|
128
129
|
s == null || s();
|
|
129
|
-
const i =
|
|
130
|
+
const i = R(e, r.value);
|
|
130
131
|
i && r.value ? (o({
|
|
131
132
|
type: P,
|
|
132
133
|
payload: i
|
|
133
|
-
}), o({ type: v, payload: !1 })) : p || (o({ type:
|
|
134
|
+
}), o({ type: v, payload: !1 })) : p || (o({ type: x }), a == null || a("")), o({ type: U });
|
|
134
135
|
}
|
|
135
136
|
}, [r.isOpen]);
|
|
136
137
|
const M = G(
|
|
@@ -138,34 +139,34 @@ const {
|
|
|
138
139
|
if (i) {
|
|
139
140
|
const _ = u.map((m) => {
|
|
140
141
|
var L, b;
|
|
141
|
-
const D = ((L = m.type) == null ? void 0 : L.componentType) || ((b = m.props) == null ? void 0 : b.
|
|
142
|
-
if (
|
|
143
|
-
const
|
|
142
|
+
const D = ((L = m.type) == null ? void 0 : L.componentType) || ((b = m.props) == null ? void 0 : b.__type);
|
|
143
|
+
if (d === "AutocompleteGroupItem" && D === "AutocompleteGroupItem") {
|
|
144
|
+
const N = C.toArray(
|
|
144
145
|
m.props.children
|
|
145
|
-
).filter((O) =>
|
|
146
|
-
(O) =>
|
|
146
|
+
).filter((O) => h(O)).filter(
|
|
147
|
+
(O) => B(O, i)
|
|
147
148
|
);
|
|
148
|
-
return
|
|
149
|
-
} else if (
|
|
150
|
-
return
|
|
149
|
+
return N.length > 0 ? j(m, { children: N }) : null;
|
|
150
|
+
} else if (d === "AutocompleteItem")
|
|
151
|
+
return B(m, i) ? m : null;
|
|
151
152
|
return null;
|
|
152
153
|
}).filter(Boolean);
|
|
153
|
-
o({ type:
|
|
154
|
+
o({ type: E, payload: _ }), o({ type: S, payload: -1 }), (!r.isOpen && !r.value || (_ == null ? void 0 : _.length) === 0) && o({ type: v, payload: !0 });
|
|
154
155
|
} else
|
|
155
|
-
o({ type: w, payload: "" }), o({ type:
|
|
156
|
+
o({ type: w, payload: "" }), o({ type: E, payload: u }), o({ type: S, payload: -1 });
|
|
156
157
|
}, 500),
|
|
157
158
|
[u, r.isOpen, r.value, p]
|
|
158
159
|
);
|
|
159
160
|
return {
|
|
160
161
|
state: r,
|
|
161
162
|
dispatch: o,
|
|
162
|
-
inputRef:
|
|
163
|
-
listRef:
|
|
163
|
+
inputRef: f,
|
|
164
|
+
listRef: y,
|
|
164
165
|
validChildren: u,
|
|
165
|
-
getOptionLabelByValue:
|
|
166
|
+
getOptionLabelByValue: R,
|
|
166
167
|
debouncedFilter: M
|
|
167
168
|
};
|
|
168
169
|
};
|
|
169
170
|
export {
|
|
170
|
-
|
|
171
|
+
pe as useAutocompleteController
|
|
171
172
|
};
|
|
@@ -1,38 +1,44 @@
|
|
|
1
1
|
import { jsx as r, jsxs as m } from "react/jsx-runtime";
|
|
2
|
-
import { translate as
|
|
3
|
-
import { Icon as
|
|
4
|
-
import { Link as
|
|
5
|
-
const
|
|
2
|
+
import { translate as c } from "../i18n/utility.js";
|
|
3
|
+
import { Icon as t } from "../icon/icon.js";
|
|
4
|
+
import { Link as o } from "../link/link.js";
|
|
5
|
+
const h = () => /* @__PURE__ */ r("div", { "aria-hidden": "true", children: /* @__PURE__ */ r(t, { className: "gi-text-gray-700", icon: "more_horiz" }) }), n = ({
|
|
6
6
|
href: e,
|
|
7
7
|
children: a,
|
|
8
|
-
asChild:
|
|
9
|
-
...
|
|
8
|
+
asChild: s,
|
|
9
|
+
...i
|
|
10
10
|
}) => /* @__PURE__ */ r(
|
|
11
|
-
|
|
11
|
+
o,
|
|
12
12
|
{
|
|
13
13
|
noColor: !0,
|
|
14
|
-
asChild:
|
|
14
|
+
asChild: s,
|
|
15
15
|
href: e,
|
|
16
16
|
"aria-label": `${a} page`,
|
|
17
17
|
size: "sm",
|
|
18
18
|
className: "gi-breadcrumbs-link",
|
|
19
|
-
...
|
|
19
|
+
...i,
|
|
20
20
|
children: a
|
|
21
21
|
}
|
|
22
|
-
), f = (e) => /* @__PURE__ */ r(
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
"
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
22
|
+
), f = (e) => /* @__PURE__ */ r(n, { ...e, "aria-current": "page" }), b = () => /* @__PURE__ */ r("span", { className: "gi-breadcrumbs-separator", children: "/" }), B = ({ children: e, iconStart: a }) => {
|
|
23
|
+
const s = Array.isArray(e) ? e : [e];
|
|
24
|
+
return /* @__PURE__ */ r(
|
|
25
|
+
"nav",
|
|
26
|
+
{
|
|
27
|
+
"aria-label": c("breadcrumbs.breadcrumbs", { defaultValue: "Breadcrumbs" }),
|
|
28
|
+
className: "gi-breadcrumbs",
|
|
29
|
+
children: /* @__PURE__ */ m("ol", { role: "list", children: [
|
|
30
|
+
a && /* @__PURE__ */ r("li", { role: "listitem", className: "gi-pr-1", children: /* @__PURE__ */ r(t, { "aria-label": "chevron-left", icon: "chevron_left", size: "sm" }) }),
|
|
31
|
+
s.map((i, l) => /* @__PURE__ */ m("li", { role: "listitem", children: [
|
|
32
|
+
i,
|
|
33
|
+
l < s.length - 1 && /* @__PURE__ */ r(b, {})
|
|
34
|
+
] }, `breadcrumb_item_${l}`))
|
|
35
|
+
] })
|
|
36
|
+
}
|
|
37
|
+
);
|
|
38
|
+
};
|
|
33
39
|
export {
|
|
34
40
|
f as BreadcrumbCurrentLink,
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
41
|
+
h as BreadcrumbEllipsis,
|
|
42
|
+
n as BreadcrumbLink,
|
|
43
|
+
B as Breadcrumbs
|
|
38
44
|
};
|
package/dist/card/card-next.js
CHANGED
|
@@ -60,7 +60,7 @@ const D = ({ children: e }) => {
|
|
|
60
60
|
var d, C;
|
|
61
61
|
if (!f(t))
|
|
62
62
|
return;
|
|
63
|
-
(((d = t == null ? void 0 : t.type) == null ? void 0 : d.componentType) || ((C = t.props) == null ? void 0 : C.
|
|
63
|
+
(((d = t == null ? void 0 : t.type) == null ? void 0 : d.componentType) || ((C = t.props) == null ? void 0 : C.__type)) === "CardTag" ? n.push(t) : a.push(t);
|
|
64
64
|
}), /* @__PURE__ */ r(o.Provider, { value: !0, children: /* @__PURE__ */ g("div", { className: "gi-card-header", children: [
|
|
65
65
|
/* @__PURE__ */ r("div", { className: "gi-card-heading", children: a }),
|
|
66
66
|
n
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
interface DataTableFooterTypeProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
}
|
|
5
|
+
interface DataTableFooterProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
6
|
+
children?: React.ReactNode;
|
|
7
|
+
}
|
|
8
|
+
export type { DataTableFooterProps, DataTableFooterTypeProps };
|
|
9
|
+
export declare const DataTableFooterStart: React.FC<DataTableFooterTypeProps>;
|
|
10
|
+
export declare const DataTableFooterCenter: React.FC<DataTableFooterTypeProps>;
|
|
11
|
+
export declare const DataTableFooterEnd: React.FC<DataTableFooterTypeProps>;
|
|
12
|
+
export declare const DataTableFooter: React.FC<DataTableFooterProps>;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { jsx as s, jsxs as x } from "react/jsx-runtime";
|
|
2
|
+
import l from "react";
|
|
3
|
+
import { cn as i } from "../cn.js";
|
|
4
|
+
const o = (e, t) => l.isValidElement(e) && e.type === t, r = (e, t, n) => e ? /* @__PURE__ */ s(
|
|
5
|
+
"div",
|
|
6
|
+
{
|
|
7
|
+
className: i(
|
|
8
|
+
t,
|
|
9
|
+
n,
|
|
10
|
+
e.props.className
|
|
11
|
+
),
|
|
12
|
+
style: e.props.style,
|
|
13
|
+
children: e.props.children
|
|
14
|
+
}
|
|
15
|
+
) : null, y = ({
|
|
16
|
+
children: e,
|
|
17
|
+
...t
|
|
18
|
+
}) => /* @__PURE__ */ s("div", { ...t, children: e });
|
|
19
|
+
y.displayName = "DataTableFooterStart";
|
|
20
|
+
const F = ({
|
|
21
|
+
children: e,
|
|
22
|
+
...t
|
|
23
|
+
}) => /* @__PURE__ */ s("div", { ...t, children: e });
|
|
24
|
+
F.displayName = "DataTableFooterCenter";
|
|
25
|
+
const T = ({
|
|
26
|
+
children: e,
|
|
27
|
+
...t
|
|
28
|
+
}) => /* @__PURE__ */ s("div", { ...t, children: e });
|
|
29
|
+
T.displayName = "DataTableFooterEnd";
|
|
30
|
+
const E = ({
|
|
31
|
+
children: e,
|
|
32
|
+
className: t,
|
|
33
|
+
...n
|
|
34
|
+
}) => {
|
|
35
|
+
const D = l.useMemo(() => {
|
|
36
|
+
let f = null, u = null, b = null;
|
|
37
|
+
return l.Children.forEach(e, (a) => {
|
|
38
|
+
o(a, y) ? f = a : o(a, F) ? u = a : o(a, T) && (b = a);
|
|
39
|
+
}), { start: f, center: u, end: b };
|
|
40
|
+
}, [e]), { start: c, center: d, end: m } = D, p = !!!c && !!!d && !!m, g = "gi-grow gi-basis-0 gi-min-w-0", C = `${g} gi-text-center`, S = i("gi-min-w-0", {
|
|
41
|
+
"gi-basis-1/2 gi-text-right": !p
|
|
42
|
+
});
|
|
43
|
+
return /* @__PURE__ */ x(
|
|
44
|
+
"div",
|
|
45
|
+
{
|
|
46
|
+
...n,
|
|
47
|
+
className: i(
|
|
48
|
+
"gi-flex gi-flex-row gi-w-full gi-items-center gi-py-2",
|
|
49
|
+
p ? "gi-justify-end" : "gi-gap-2",
|
|
50
|
+
t
|
|
51
|
+
),
|
|
52
|
+
children: [
|
|
53
|
+
r(c, g),
|
|
54
|
+
r(d, C),
|
|
55
|
+
r(m, S)
|
|
56
|
+
]
|
|
57
|
+
}
|
|
58
|
+
);
|
|
59
|
+
};
|
|
60
|
+
E.displayName = "DataTableFooter";
|
|
61
|
+
export {
|
|
62
|
+
E as DataTableFooter,
|
|
63
|
+
F as DataTableFooterCenter,
|
|
64
|
+
T as DataTableFooterEnd,
|
|
65
|
+
y as DataTableFooterStart
|
|
66
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
interface DataTableHeaderTypeProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
}
|
|
5
|
+
interface DataTableHeaderProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
6
|
+
children?: React.ReactNode;
|
|
7
|
+
showHeader?: boolean;
|
|
8
|
+
showFilter?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare const DataTableHeader: React.FC<DataTableHeaderProps>;
|
|
11
|
+
export declare const DataTableHeaderSearch: React.FC<DataTableHeaderTypeProps>;
|
|
12
|
+
export declare const DataTableHeaderActions: React.FC<DataTableHeaderTypeProps>;
|
|
13
|
+
export declare const DataTableHeaderFilter: React.FC<DataTableHeaderTypeProps>;
|
|
14
|
+
export declare const DataTableHeaderFilterTitle: React.FC<DataTableHeaderTypeProps>;
|
|
15
|
+
export declare const DataTableHeaderFilterContent: React.FC<DataTableHeaderTypeProps>;
|
|
16
|
+
export declare const DataTableHeaderFilterContentTitle: React.FC<DataTableHeaderTypeProps>;
|
|
17
|
+
export declare const DataTableHeaderFilterActions: React.FC<DataTableHeaderTypeProps>;
|
|
18
|
+
type DataTableHeaderFilterListProps = {
|
|
19
|
+
filters: {
|
|
20
|
+
id: string;
|
|
21
|
+
label: string;
|
|
22
|
+
}[];
|
|
23
|
+
onRemove?: (id: string) => void;
|
|
24
|
+
onClear?: () => void;
|
|
25
|
+
className?: string;
|
|
26
|
+
};
|
|
27
|
+
export declare const DataTableHeaderFilterList: React.FC<DataTableHeaderFilterListProps>;
|
|
28
|
+
export {};
|